@groupeactual/ui-kit 0.4.16 → 0.4.18

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.
@@ -1,9 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
- interface Props {
2
+ import { AccordionProps } from '@mui/material/Accordion';
3
+ interface Props extends Omit<AccordionProps, 'children'> {
3
4
  icon: ReactNode;
4
- title: ReactNode;
5
5
  content: ReactNode;
6
+ title?: string;
6
7
  summaryHeight?: number;
7
8
  }
8
- declare const ActAccordion: ({ icon, title, content, summaryHeight }: Props) => JSX.Element;
9
- export default ActAccordion;
9
+ declare const Accordion: ({ icon, title, content, summaryHeight, ...props }: Props) => JSX.Element;
10
+ export default Accordion;
@@ -1,11 +1,20 @@
1
1
  /// <reference types="react" />
2
2
  import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
3
- declare const Sizes: Record<string, number>;
3
+ import { BoxProps } from '@mui/material/Box';
4
+ declare const FontSizes: {
5
+ xs: number;
6
+ sm: number;
7
+ md: number;
8
+ lg: number;
9
+ xl: number;
10
+ xxl: number;
11
+ xxxl: number;
12
+ };
4
13
  interface Props {
5
14
  variant?: 'square' | 'none';
6
15
  icon: IconDefinition;
7
16
  color?: string;
8
- fontSize?: number | keyof typeof Sizes;
17
+ size?: number | keyof typeof FontSizes;
9
18
  }
10
- declare const Icon: ({ variant, icon, color, fontSize }: Props) => JSX.Element;
19
+ declare const Icon: ({ variant, icon, color, size, ...props }: Props & BoxProps) => JSX.Element;
11
20
  export default Icon;
package/dist/esm/index.js CHANGED
@@ -41416,7 +41416,7 @@ const AccordionRoot = styled$1(Paper$1, {
41416
41416
  margin: '16px 0'
41417
41417
  }
41418
41418
  }));
41419
- const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
41419
+ const Accordion$1 = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
41420
41420
  const props = useThemeProps({
41421
41421
  props: inProps,
41422
41422
  name: 'MuiAccordion'
@@ -41483,7 +41483,7 @@ const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref)
41483
41483
  }))]
41484
41484
  }));
41485
41485
  });
41486
- process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes */ = {
41486
+ process.env.NODE_ENV !== "production" ? Accordion$1.propTypes /* remove-proptypes */ = {
41487
41487
  // ----------------------------- Warning --------------------------------
41488
41488
  // | These PropTypes are generated from the TypeScript type definitions |
41489
41489
  // | To update them edit the d.ts file and run "yarn proptypes" |
@@ -41557,7 +41557,7 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
41557
41557
  */
41558
41558
  TransitionProps: PropTypes.object
41559
41559
  } : void 0;
41560
- var Accordion$1 = Accordion;
41560
+ var AccordionMui = Accordion$1;
41561
41561
 
41562
41562
  function getAccordionDetailsUtilityClass(slot) {
41563
41563
  return generateUtilityClass('MuiAccordionDetails', slot);
@@ -50476,18 +50476,21 @@ var Checkbox = function (_a) {
50476
50476
  } }, { children: error })))] })));
50477
50477
  };
50478
50478
 
50479
- var ActAccordion = function (_a) {
50480
- var icon = _a.icon, title = _a.title, content = _a.content, summaryHeight = _a.summaryHeight;
50481
- return (jsxs(Accordion$1, __assign$1({ sx: { border: "1px solid", borderColor: 'GreyLightDefaultborder' } }, { children: [jsx(AccordionSummary$1, __assign$1({ expandIcon: icon, sx: {
50479
+ var Accordion = function (_a) {
50480
+ var icon = _a.icon, title = _a.title, content = _a.content, summaryHeight = _a.summaryHeight, props = __rest(_a, ["icon", "title", "content", "summaryHeight"]);
50481
+ return (jsxs(AccordionMui, __assign$1({ sx: { border: "1px solid", borderColor: 'greyLightDefaultBorder' } }, props, { children: [jsx(AccordionSummary$1, __assign$1({ expandIcon: icon, sx: {
50482
+ fontWeight: 500,
50483
+ fontSize: 18,
50484
+ lineHeight: 21,
50482
50485
  height: summaryHeight || 60
50483
50486
  } }, { children: title })), jsx(AccordionDetails$1, __assign$1({ sx: {
50484
- backgroundColor: 'GreyXLight',
50485
- borderColor: 'GreyLightDefaultborder',
50486
- borderTop: '1px solid'
50487
+ backgroundColor: 'greyXLight',
50488
+ borderTop: '1px solid',
50489
+ borderColor: 'greyLightDefaultBorder'
50487
50490
  } }, { children: content }))] })));
50488
50491
  };
50489
50492
 
50490
- var Sizes = {
50493
+ var FontSizes = {
50491
50494
  xs: 8,
50492
50495
  sm: 12,
50493
50496
  md: 16,
@@ -50513,7 +50516,7 @@ var FontAwesomeSvgIcon = forwardRef(function (_a, ref) {
50513
50516
  svgPathData.map(function (d, i) { return (jsx("path", { style: { opacity: i === 0 ? 0.4 : 1 }, d: d }, i)); })) })));
50514
50517
  });
50515
50518
  var Icon = function (_a) {
50516
- 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;
50519
+ var _b = _a.variant, variant = _b === void 0 ? 'none' : _b, icon = _a.icon, _c = _a.color, color = _c === void 0 ? '#136cac' : _c, _d = _a.size, size = _d === void 0 ? 16 : _d, props = __rest(_a, ["variant", "icon", "color", "size"]);
50517
50520
  var getStyles = function () {
50518
50521
  var theme = useTheme$1();
50519
50522
  var usedColor = theme.palette[color]
@@ -50529,7 +50532,7 @@ var Icon = function (_a) {
50529
50532
  borderRadius: '4px',
50530
50533
  borderColor: '1px solid ' + usedColor,
50531
50534
  overflow: 'visible',
50532
- padding: '10px',
50535
+ padding: usedFontSize + 'px',
50533
50536
  width: usedFontSize,
50534
50537
  height: usedFontSize,
50535
50538
  display: 'flex',
@@ -50540,7 +50543,7 @@ var Icon = function (_a) {
50540
50543
  return {
50541
50544
  color: usedColor,
50542
50545
  width: usedFontSize,
50543
- height: fontSize,
50546
+ height: size,
50544
50547
  display: 'inline-flex',
50545
50548
  alignItems: 'center',
50546
50549
  justifyContent: 'center'
@@ -50548,15 +50551,14 @@ var Icon = function (_a) {
50548
50551
  }
50549
50552
  };
50550
50553
  var isKey = function (key) {
50551
- return key in Sizes;
50554
+ return key in FontSizes;
50552
50555
  };
50553
- var usedFontSize = isKey(fontSize)
50554
- ? Sizes[fontSize]
50555
- : fontSize >= 0
50556
- ? fontSize
50556
+ var usedFontSize = isKey(size)
50557
+ ? FontSizes[size]
50558
+ : size >= 0
50559
+ ? size
50557
50560
  : 16;
50558
- console.log('isKey', isKey(fontSize));
50559
- return (jsx(Box$1, __assign$1({ component: "span", sx: getStyles() }, { children: jsx(FontAwesomeSvgIcon, { icon: icon, fontSize: usedFontSize }) })));
50561
+ return (jsx(Box$1, __assign$1({ component: "span", sx: getStyles() }, props, { children: jsx(FontAwesomeSvgIcon, { icon: icon, fontSize: usedFontSize }) })));
50560
50562
  };
50561
50563
 
50562
50564
  /******************************************************************************
@@ -50926,6 +50928,9 @@ var TextFieldCss = function (muiTokens) {
50926
50928
  return {
50927
50929
  MuiFormHelperText: {
50928
50930
  styleOverrides: {
50931
+ '@font-face': {
50932
+ fontFamily: 'Roboto'
50933
+ },
50929
50934
  root: {
50930
50935
  fontWeight: 400,
50931
50936
  fontSize: '11px',
@@ -51094,10 +51099,34 @@ var ButtonCss = function (muiTokens) {
51094
51099
  };
51095
51100
  };
51096
51101
 
51102
+ var AccordionCss = function () {
51103
+ return {
51104
+ MuiAccordionSummary: {
51105
+ styleOverrides: {
51106
+ '@font-face': {
51107
+ fontFamily: 'Roboto'
51108
+ },
51109
+ content: {
51110
+ paddingLeft: '12px',
51111
+ fontWeight: 500,
51112
+ fontSize: '18px',
51113
+ lineHeight: '21px'
51114
+ }
51115
+ }
51116
+ }
51117
+ };
51118
+ };
51119
+
51097
51120
  var useMaterialThemeCss = function (muiTokens) {
51098
51121
  var muiCss = useMemo(function () {
51099
51122
  return {
51100
- components: __assign(__assign(__assign({}, TextFieldCss(muiTokens)), ButtonCss(muiTokens)), { MuiSvgIcon: {
51123
+ components: __assign(__assign(__assign(__assign({}, TextFieldCss(muiTokens)), ButtonCss(muiTokens)), AccordionCss()), { MuiCssBaseline: {
51124
+ styleOverrides: {
51125
+ '@font-face': {
51126
+ fontFamily: 'Roboto'
51127
+ }
51128
+ }
51129
+ }, MuiSvgIcon: {
51101
51130
  styleOverrides: {
51102
51131
  colorSuccess: {
51103
51132
  color: muiTokens.palette.success.main
@@ -51110,12 +51139,17 @@ var useMaterialThemeCss = function (muiTokens) {
51110
51139
  };
51111
51140
 
51112
51141
  var useMaterialThemeTokens = function (themeName) {
51142
+ var fontWeights = {
51143
+ RobotoBold: 700,
51144
+ RobotoMedium: 500,
51145
+ RobotoRegular: 400
51146
+ };
51113
51147
  var designTokens = tokens;
51114
51148
  var muiTokensObject = {
51115
51149
  typography: {
51116
51150
  fontFamily: getFontFamilies(themeName).join(','),
51117
51151
  bigNumber: {
51118
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51152
+ fontWeight: fontWeights.RobotoBold,
51119
51153
  lineHeight: designTokens["".concat(themeName, "LineHeights49")] + 'px',
51120
51154
  fontSize: designTokens["".concat(themeName, "FontSize42")] + 'px',
51121
51155
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51124,7 +51158,7 @@ var useMaterialThemeTokens = function (themeName) {
51124
51158
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51125
51159
  },
51126
51160
  header1: {
51127
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51161
+ fontWeight: fontWeights.RobotoBold,
51128
51162
  lineHeight: designTokens["".concat(themeName, "LineHeights41")] + 'px',
51129
51163
  fontSize: designTokens["".concat(themeName, "FontSize35")] + 'px',
51130
51164
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51133,7 +51167,7 @@ var useMaterialThemeTokens = function (themeName) {
51133
51167
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51134
51168
  },
51135
51169
  header2: {
51136
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto500")],
51170
+ fontWeight: fontWeights.RobotoMedium,
51137
51171
  lineHeight: designTokens["".concat(themeName, "LineHeights34")] + 'px',
51138
51172
  fontSize: designTokens["".concat(themeName, "FontSize29")] + 'px',
51139
51173
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51142,7 +51176,7 @@ var useMaterialThemeTokens = function (themeName) {
51142
51176
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51143
51177
  },
51144
51178
  header3: {
51145
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto400")],
51179
+ fontWeight: fontWeights.RobotoRegular,
51146
51180
  lineHeight: designTokens["".concat(themeName, "LineHeights28")] + 'px',
51147
51181
  fontSize: designTokens["".concat(themeName, "FontSize24")] + 'px',
51148
51182
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51151,7 +51185,7 @@ var useMaterialThemeTokens = function (themeName) {
51151
51185
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51152
51186
  },
51153
51187
  header4: {
51154
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto500")],
51188
+ fontWeight: fontWeights.RobotoMedium,
51155
51189
  lineHeight: designTokens["".concat(themeName, "LineHeights21")] + 'px',
51156
51190
  fontSize: designTokens["".concat(themeName, "FontSize18")] + 'px',
51157
51191
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51160,7 +51194,7 @@ var useMaterialThemeTokens = function (themeName) {
51160
51194
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51161
51195
  },
51162
51196
  body1Regular: {
51163
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto400")],
51197
+ fontWeight: fontWeights.RobotoRegular,
51164
51198
  lineHeight: designTokens["".concat(themeName, "LineHeights18")] + 'px',
51165
51199
  fontSize: designTokens["".concat(themeName, "FontSize14")] + 'px',
51166
51200
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51169,7 +51203,7 @@ var useMaterialThemeTokens = function (themeName) {
51169
51203
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51170
51204
  },
51171
51205
  body1Medium: {
51172
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto500")],
51206
+ fontWeight: fontWeights.RobotoMedium,
51173
51207
  lineHeight: designTokens["".concat(themeName, "LineHeights18")] + 'px',
51174
51208
  fontSize: designTokens["".concat(themeName, "FontSize14")] + 'px',
51175
51209
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51178,7 +51212,7 @@ var useMaterialThemeTokens = function (themeName) {
51178
51212
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51179
51213
  },
51180
51214
  body1Bold: {
51181
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51215
+ fontWeight: fontWeights.RobotoBold,
51182
51216
  lineHeight: designTokens["".concat(themeName, "LineHeights18")] + 'px',
51183
51217
  fontSize: designTokens["".concat(themeName, "FontSize14")] + 'px',
51184
51218
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51187,7 +51221,7 @@ var useMaterialThemeTokens = function (themeName) {
51187
51221
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51188
51222
  },
51189
51223
  body2Regular: {
51190
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto400")],
51224
+ fontWeight: fontWeights.RobotoRegular,
51191
51225
  lineHeight: designTokens["".concat(themeName, "LineHeights16")] + 'px',
51192
51226
  fontSize: designTokens["".concat(themeName, "FontSize13")] + 'px',
51193
51227
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51196,7 +51230,7 @@ var useMaterialThemeTokens = function (themeName) {
51196
51230
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51197
51231
  },
51198
51232
  body2Medium: {
51199
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto500")],
51233
+ fontWeight: fontWeights.RobotoMedium,
51200
51234
  lineHeight: designTokens["".concat(themeName, "LineHeights16")] + 'px',
51201
51235
  fontSize: designTokens["".concat(themeName, "FontSize13")] + 'px',
51202
51236
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51205,7 +51239,7 @@ var useMaterialThemeTokens = function (themeName) {
51205
51239
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51206
51240
  },
51207
51241
  body2Bold: {
51208
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51242
+ fontWeight: fontWeights.RobotoBold,
51209
51243
  lineHeight: designTokens["".concat(themeName, "LineHeights16")] + 'px',
51210
51244
  fontSize: designTokens["".concat(themeName, "FontSize13")] + 'px',
51211
51245
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51214,7 +51248,7 @@ var useMaterialThemeTokens = function (themeName) {
51214
51248
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51215
51249
  },
51216
51250
  caption: {
51217
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto400")],
51251
+ fontWeight: fontWeights.RobotoRegular,
51218
51252
  lineHeight: designTokens["".concat(themeName, "LineHeights12")] + 'px',
51219
51253
  fontSize: designTokens["".concat(themeName, "FontSize11")] + 'px',
51220
51254
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51223,7 +51257,7 @@ var useMaterialThemeTokens = function (themeName) {
51223
51257
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51224
51258
  },
51225
51259
  buttonNotif: {
51226
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51260
+ fontWeight: fontWeights.RobotoBold,
51227
51261
  lineHeight: designTokens["".concat(themeName, "LineHeights18")] + 'px',
51228
51262
  fontSize: designTokens["".concat(themeName, "FontSize14")] + 'px',
51229
51263
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51232,7 +51266,7 @@ var useMaterialThemeTokens = function (themeName) {
51232
51266
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51233
51267
  },
51234
51268
  link1: {
51235
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51269
+ fontWeight: fontWeights.RobotoBold,
51236
51270
  lineHeight: designTokens["".concat(themeName, "LineHeights18")] + 'px',
51237
51271
  fontSize: designTokens["".concat(themeName, "FontSize14")] + 'px',
51238
51272
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51241,7 +51275,7 @@ var useMaterialThemeTokens = function (themeName) {
51241
51275
  textDecoration: designTokens["".concat(themeName, "TextDecorationUnderline")]
51242
51276
  },
51243
51277
  link2: {
51244
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51278
+ fontWeight: fontWeights.RobotoBold,
51245
51279
  lineHeight: designTokens["".concat(themeName, "LineHeights16")] + 'px',
51246
51280
  fontSize: designTokens["".concat(themeName, "FontSize13")] + 'px',
51247
51281
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51249,9 +51283,9 @@ var useMaterialThemeTokens = function (themeName) {
51249
51283
  textCase: designTokens["".concat(themeName, "TextCaseNone")],
51250
51284
  textDecoration: designTokens["".concat(themeName, "TextDecorationUnderline")]
51251
51285
  },
51252
- fontWeightRegular: designTokens["".concat(themeName, "FontWeightsRoboto400")],
51253
- fontWeightMedium: designTokens["".concat(themeName, "FontWeightsRoboto500")],
51254
- fontWeightBold: designTokens["".concat(themeName, "FontWeightsRoboto700")]
51286
+ fontWeightRegular: fontWeights.RobotoBold,
51287
+ fontWeightMedium: fontWeights.RobotoMedium,
51288
+ fontWeightBold: fontWeights.RobotoRegular
51255
51289
  },
51256
51290
  breakpoints: {
51257
51291
  values: {
@@ -51272,7 +51306,7 @@ var useMaterialThemeTokens = function (themeName) {
51272
51306
  snackbar: 1400,
51273
51307
  tooltip: 1500
51274
51308
  },
51275
- // spacing: Number(designTokens[`${themeName}SpacingXs`]), // spacing minimum
51309
+ spacing: Number(designTokens["".concat(themeName, "SpacingXxs")]),
51276
51310
  palette: getMuiPalette(themeName)
51277
51311
  };
51278
51312
  var muiCss = useMaterialThemeCss(muiTokensObject).muiCss;
@@ -51303,5 +51337,5 @@ var DesignSystemProvider = function (_a) {
51303
51337
  return (jsx(DesignSystemContext.Provider, __assign$1({ value: { isDarkTheme: isDarkTheme, themeName: themeName, toggleDarkTheme: toggleDarkTheme } }, { children: jsx(MaterialThemeProvider, { children: children }) })));
51304
51338
  };
51305
51339
 
51306
- export { ActAccordion as Accordion, Button, Checkbox, DesignSystemContext, DesignSystemProvider, Icon as IconProvider, Link, Text, TextField };
51340
+ export { Accordion, Button, Checkbox, DesignSystemContext, DesignSystemProvider, Icon as IconProvider, Link, Text, TextField };
51307
51341
  //# sourceMappingURL=index.js.map