@groupeactual/ui-kit 0.4.13 → 0.4.15

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.
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
3
+ interface Props {
4
+ variant?: 'square' | 'none';
5
+ icon: IconDefinition;
6
+ color?: string;
7
+ fontSize?: number;
8
+ }
9
+ declare const Icon: ({ variant, icon, color, fontSize }: Props) => JSX.Element;
10
+ export default Icon;
@@ -1 +1 @@
1
- export { default } from './IconProvider';
1
+ export { default } from './Icon';
@@ -4,4 +4,4 @@ export { default as Button } from './Button';
4
4
  export { default as TextField } from './Form/TextField';
5
5
  export { default as Checkbox } from './Form/Checkbox';
6
6
  export { default as Accordion } from './Accordion';
7
- export { default as IconProvider } from './Icon/IconProvider';
7
+ export { default as IconProvider } from './Icon/Icon';
package/dist/cjs/index.js CHANGED
@@ -50450,7 +50450,7 @@ process.env.NODE_ENV !== "production" ? TextField$1.propTypes /* remove-proptype
50450
50450
  } : void 0;
50451
50451
  var MuiTextField = TextField$1;
50452
50452
 
50453
- var Text = function (props) { return jsxRuntime.jsx(Typography$1, __assign$1({}, props)); };
50453
+ var Text = function (props) { return (jsxRuntime.jsx(Typography$1, __assign$1({ color: "greyXDark" }, props))); };
50454
50454
 
50455
50455
  var Link = function (props) { return jsxRuntime.jsx(LinkMui, __assign$1({}, props)); };
50456
50456
 
@@ -50466,7 +50466,7 @@ var TextField = function (_a) {
50466
50466
  setInternalValue(value);
50467
50467
  }
50468
50468
  }, [value]);
50469
- 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) {
50469
+ return (jsxRuntime.jsx(MuiTextField, __assign$1({ id: label === placeholder ? 'text-field-mui' : 'test-field-ds', variant: "outlined", name: name, label: label, value: internalValue, placeholder: label === placeholder ? undefined : placeholder, FormHelperTextProps: { component: 'div' }, InputLabelProps: { shrink: label === placeholder ? undefined : true }, onClick: function (e) { return e.stopPropagation(); }, onChange: function (e) {
50470
50470
  setInternalValue(e.currentTarget.value);
50471
50471
  onChange(e);
50472
50472
  }, onBlur: function (e) {
@@ -50485,15 +50485,17 @@ var Checkbox = function (_a) {
50485
50485
  setInternalValue(value);
50486
50486
  }
50487
50487
  }, [value]);
50488
- return (jsxRuntime.jsxs(FormControl$1, __assign$1({ fullWidth: true }, { children: [jsxRuntime.jsx(FormControlLabel$1, { control: jsxRuntime.jsx(Box$3, { children: jsxRuntime.jsx(CheckboxMUI, __assign$1({ name: name, sx: { marginTop: -0.5 }, checked: internalValue, color: "primary", onChange: function (e) {
50488
+ return (jsxRuntime.jsxs(FormControl$1, __assign$1({ fullWidth: true }, { children: [jsxRuntime.jsx(FormControlLabel$1, { control: jsxRuntime.jsx(Box$3, { children: jsxRuntime.jsx(CheckboxMUI, __assign$1({ name: name, sx: { marginTop: '-2px' }, checked: internalValue, color: "primary", onChange: function (e) {
50489
50489
  setInternalValue(e.target.checked);
50490
50490
  onChange(name, e.target.checked, true);
50491
50491
  } }, props)) }), label: jsxRuntime.jsx(Typography$1, __assign$1({ component: "span", sx: {
50492
50492
  fontSize: '14px',
50493
+ marginLeft: '-3px',
50494
+ marginTop: '2px',
50493
50495
  fontWeight: 400,
50494
50496
  color: error ? '#B80025' : '#000'
50495
50497
  } }, { children: label })) }), error && (jsxRuntime.jsx(Typography$1, __assign$1({ sx: {
50496
- marginTop: -1,
50498
+ marginTop: -0.5,
50497
50499
  color: '#B80025',
50498
50500
  fontWeight: 400,
50499
50501
  fontSize: '10px'
@@ -50516,7 +50518,7 @@ var FontAwesomeSvgIcon = React.forwardRef(function (_a, ref) {
50516
50518
  var icon = _a.icon, fontSize = _a.fontSize;
50517
50519
  var _b = icon.icon, width = _b[0], height = _b[1], svgPathData = _b[4];
50518
50520
  return (jsxRuntime.jsx(SvgIcon$1, __assign$1({ ref: ref, viewBox: "0 0 ".concat(width, " ").concat(height), sx: {
50519
- fontSize: fontSize
50521
+ fontSize: fontSize !== null && fontSize !== void 0 ? fontSize : '14px'
50520
50522
  } }, { children: typeof svgPathData === 'string' ? (jsxRuntime.jsx("path", { d: svgPathData })) : (
50521
50523
  /**
50522
50524
  * A multi-path Font Awesome icon seems to imply a duotune icon. The 0th path seems to
@@ -50527,71 +50529,42 @@ var FontAwesomeSvgIcon = React.forwardRef(function (_a, ref) {
50527
50529
  */
50528
50530
  svgPathData.map(function (d, i) { return (jsxRuntime.jsx("path", { style: { opacity: i === 0 ? 0.4 : 1 }, d: d }, i)); })) })));
50529
50531
  });
50530
- var IconProvider = function (_a) {
50531
- var variant = _a.variant, icon = _a.icon, color = _a.color, size = _a.size;
50532
- var getFontSize = function () {
50533
- if (variant === 'roundedIcon') {
50534
- return '1.5rem';
50535
- }
50536
- if (variant === 'smallRoundedIcon') {
50537
- return '0.9rem';
50538
- }
50539
- switch (size) {
50540
- case 'xxs':
50541
- return '.8rem';
50542
- case 'xs':
50543
- return '1rem';
50544
- case 'm':
50545
- return '1.5rem';
50546
- case 'lg':
50547
- return '1.8rem';
50548
- case 'xl':
50549
- return '2.2rem';
50550
- case 'xxl':
50551
- return '4rem';
50552
- default:
50553
- return '1.2rem';
50554
- }
50555
- };
50532
+ var Icon = function (_a) {
50533
+ var _b = _a.variant, variant = _b === void 0 ? 'none' : _b, icon = _a.icon, _c = _a.color, color = _c === void 0 ? '#136cac' : _c, _d = _a.fontSize, fontSize = _d === void 0 ? 16 : _d;
50556
50534
  var getStyles = function () {
50535
+ var theme = useTheme$1();
50536
+ var defaultColor = theme.palette[color]
50537
+ ? theme.palette[color]
50538
+ : !color || (color === null || color === void 0 ? void 0 : color.length) === 0
50539
+ ? '#136cac'
50540
+ : color;
50557
50541
  switch (variant) {
50558
- case 'roundedIcon':
50542
+ case 'square':
50559
50543
  return {
50560
- color: 'actual.main',
50561
- backgroundColor: 'actual.light',
50562
- borderRadius: '100px',
50544
+ color: defaultColor,
50545
+ backgroundColor: "".concat(defaultColor, "14"),
50546
+ borderRadius: '4px',
50547
+ borderColor: '1px solid ' + defaultColor,
50563
50548
  overflow: 'visible',
50564
- height: 50,
50565
- width: 50,
50566
- display: 'flex',
50567
- fontSize: '1.5rem',
50568
- justifyContent: 'center',
50569
- alignItems: 'center'
50570
- };
50571
- case 'smallRoundedIcon':
50572
- return {
50573
- color: 'actual.main',
50574
- backgroundColor: 'actual.light',
50575
- borderRadius: '100px',
50576
- overflow: 'visible',
50577
- height: 30,
50578
- width: 30,
50549
+ padding: '10px',
50550
+ width: fontSize,
50551
+ height: fontSize,
50579
50552
  display: 'flex',
50580
50553
  justifyContent: 'center',
50581
50554
  alignItems: 'center'
50582
50555
  };
50583
50556
  default:
50584
50557
  return {
50585
- color: color !== null && color !== void 0 ? color : 'primary.main',
50586
- width: getFontSize(),
50587
- height: getFontSize(),
50558
+ color: defaultColor,
50559
+ width: fontSize,
50560
+ height: fontSize,
50588
50561
  display: 'inline-flex',
50589
50562
  alignItems: 'center',
50590
50563
  justifyContent: 'center'
50591
50564
  };
50592
50565
  }
50593
50566
  };
50594
- return (jsxRuntime.jsx(Box$1, __assign$1({ component: "span", sx: getStyles() }, { children: jsxRuntime.jsx(FontAwesomeSvgIcon, { icon: icon, fontSize: getFontSize() }) })));
50567
+ return (jsxRuntime.jsx(Box$1, __assign$1({ component: "span", sx: getStyles() }, { children: jsxRuntime.jsx(FontAwesomeSvgIcon, { icon: icon, fontSize: fontSize }) })));
50595
50568
  };
50596
50569
 
50597
50570
  /******************************************************************************
@@ -50976,16 +50949,14 @@ var TextFieldCss = function (muiTokens) {
50976
50949
  }
50977
50950
  },
50978
50951
  MuiOutlinedInput: {
50979
- defaultProps: {
50980
- notched: true
50981
- },
50952
+ defaultProps: {},
50982
50953
  styleOverrides: {
50983
50954
  input: {
50984
50955
  fontSize: '14px',
50985
50956
  lineHeight: '18px',
50986
50957
  fontWeight: 400,
50987
50958
  padding: '12px 14px !important',
50988
- height: '18px',
50959
+ height: '20px',
50989
50960
  color: muiTokens.palette.greyXDark,
50990
50961
  '&::placeholder': {
50991
50962
  color: "".concat(muiTokens.palette.greyDark, " !important"),
@@ -50999,6 +50970,27 @@ var TextFieldCss = function (muiTokens) {
50999
50970
  color: muiTokens.palette.greyDark,
51000
50971
  borderColor: muiTokens.palette.greyLightDefaultborder,
51001
50972
  WebkitTextFillColor: muiTokens.palette.greyDark
50973
+ },
50974
+ '&#text-field-mui': {
50975
+ fontSize: '14px',
50976
+ lineHeight: '18px',
50977
+ fontWeight: 400,
50978
+ padding: '12px 14px !important',
50979
+ height: '20px',
50980
+ color: muiTokens.palette.greyXDark,
50981
+ '&::placeholder': {
50982
+ color: "".concat(muiTokens.palette.greyDark, " !important"),
50983
+ opacity: 1 + ' !important',
50984
+ fontWeight: 400,
50985
+ lineHeight: '18px',
50986
+ fontSize: '14px'
50987
+ },
50988
+ '&.Mui-disabled': {
50989
+ backgroundColor: muiTokens.palette.greyXLight,
50990
+ color: muiTokens.palette.greyDark,
50991
+ borderColor: muiTokens.palette.greyLightDefaultborder,
50992
+ WebkitTextFillColor: muiTokens.palette.greyDark
50993
+ }
51002
50994
  }
51003
50995
  },
51004
50996
  notchedOutline: {
@@ -51014,6 +51006,9 @@ var TextFieldCss = function (muiTokens) {
51014
51006
  },
51015
51007
  '&.Mui-hover.MuiOutlinedInput-notchedOutline': {
51016
51008
  borderColor: muiTokens.palette.greyDark
51009
+ },
51010
+ '.MuiSvgIcon-root': {
51011
+ marginLeft: '-22px'
51017
51012
  }
51018
51013
  }
51019
51014
  }
@@ -51021,14 +51016,35 @@ var TextFieldCss = function (muiTokens) {
51021
51016
  MuiInputLabel: {
51022
51017
  styleOverrides: {
51023
51018
  root: {
51024
- fontSize: '16px',
51025
- lineHeight: '16px',
51026
- height: '16px',
51027
- fontWeight: 500,
51028
- transform: 'translate(14px, -7px) scale(0.75)',
51029
- color: muiTokens.palette.greyXDark,
51030
- '&.Mui-disabled': {
51031
- color: muiTokens.palette.greyDark
51019
+ '&#text-field-mui-label': {
51020
+ fontSize: '14px',
51021
+ lineHeight: '18px',
51022
+ height: '16px',
51023
+ color: "".concat(muiTokens.palette.greyDark, " !important"),
51024
+ fontWeight: 400,
51025
+ marginTop: '-3px',
51026
+ '&.Mui-disabled': {
51027
+ color: muiTokens.palette.greyDark
51028
+ },
51029
+ '&.Mui-focused': {
51030
+ lineHeight: '16px',
51031
+ fontWeight: 500,
51032
+ fontSize: '16px',
51033
+ marginTop: 0,
51034
+ color: "".concat(muiTokens.palette.blueClickable, " !important"),
51035
+ transform: 'translate(14px, -7px) scale(0.75)'
51036
+ }
51037
+ },
51038
+ '&#text-field-ds-label': {
51039
+ fontSize: '16px',
51040
+ lineHeight: '16px',
51041
+ height: '16px',
51042
+ fontWeight: 500,
51043
+ transform: 'translate(14px, -7px) scale(0.75)',
51044
+ color: muiTokens.palette.greyXDark,
51045
+ '&.Mui-disabled': {
51046
+ color: muiTokens.palette.greyDark
51047
+ }
51032
51048
  }
51033
51049
  }
51034
51050
  }
@@ -51041,12 +51057,13 @@ var ButtonCss = function (muiTokens) {
51041
51057
  MuiButton: {
51042
51058
  styleOverrides: {
51043
51059
  root: {
51044
- borderRadius: 4,
51060
+ borderRadius: '4px',
51045
51061
  padding: '7.5px 16px',
51046
51062
  fontWeight: muiTokens.typography.fontWeightBold,
51047
51063
  lineHeight: '18px',
51048
51064
  textTransform: 'unset',
51049
51065
  fontSize: '14px',
51066
+ height: '44px',
51050
51067
  border: '1px solid'
51051
51068
  },
51052
51069
  primary: {
@@ -51075,8 +51092,9 @@ var ButtonCss = function (muiTokens) {
51075
51092
  color: muiTokens.palette.greyMediumInactive + ' !important'
51076
51093
  },
51077
51094
  '&:hover': {
51078
- borderColor: muiTokens.palette.greyDark + ' !important',
51079
- backgroundColor: muiTokens.palette.white + ' !important'
51095
+ borderColor: muiTokens.palette.blueHoverClickable + ' !important',
51096
+ backgroundColor: muiTokens.palette.white + ' !important',
51097
+ color: muiTokens.palette.blueHoverClickable + ' !important'
51080
51098
  }
51081
51099
  }
51082
51100
  }
@@ -51262,7 +51280,7 @@ var useMaterialThemeTokens = function (themeName) {
51262
51280
  snackbar: 1400,
51263
51281
  tooltip: 1500
51264
51282
  },
51265
- spacing: Number(designTokens["".concat(themeName, "SpacingXxs")]),
51283
+ // spacing: Number(designTokens[`${themeName}SpacingXs`]), // spacing minimum
51266
51284
  palette: getMuiPalette(themeName)
51267
51285
  };
51268
51286
  var muiCss = useMaterialThemeCss(muiTokensObject).muiCss;
@@ -51298,7 +51316,7 @@ exports.Button = Button;
51298
51316
  exports.Checkbox = Checkbox;
51299
51317
  exports.DesignSystemContext = DesignSystemContext;
51300
51318
  exports.DesignSystemProvider = DesignSystemProvider;
51301
- exports.IconProvider = IconProvider;
51319
+ exports.IconProvider = Icon;
51302
51320
  exports.Link = Link;
51303
51321
  exports.Text = Text;
51304
51322
  exports.TextField = TextField;