@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/cjs/index.js CHANGED
@@ -41442,7 +41442,7 @@ const AccordionRoot = styled$1(Paper$1, {
41442
41442
  margin: '16px 0'
41443
41443
  }
41444
41444
  }));
41445
- const Accordion = /*#__PURE__*/React__namespace.forwardRef(function Accordion(inProps, ref) {
41445
+ const Accordion$1 = /*#__PURE__*/React__namespace.forwardRef(function Accordion(inProps, ref) {
41446
41446
  const props = useThemeProps({
41447
41447
  props: inProps,
41448
41448
  name: 'MuiAccordion'
@@ -41509,7 +41509,7 @@ const Accordion = /*#__PURE__*/React__namespace.forwardRef(function Accordion(in
41509
41509
  }))]
41510
41510
  }));
41511
41511
  });
41512
- process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes */ = {
41512
+ process.env.NODE_ENV !== "production" ? Accordion$1.propTypes /* remove-proptypes */ = {
41513
41513
  // ----------------------------- Warning --------------------------------
41514
41514
  // | These PropTypes are generated from the TypeScript type definitions |
41515
41515
  // | To update them edit the d.ts file and run "yarn proptypes" |
@@ -41583,7 +41583,7 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
41583
41583
  */
41584
41584
  TransitionProps: PropTypes.object
41585
41585
  } : void 0;
41586
- var Accordion$1 = Accordion;
41586
+ var AccordionMui = Accordion$1;
41587
41587
 
41588
41588
  function getAccordionDetailsUtilityClass(slot) {
41589
41589
  return generateUtilityClass('MuiAccordionDetails', slot);
@@ -50502,18 +50502,21 @@ var Checkbox = function (_a) {
50502
50502
  } }, { children: error })))] })));
50503
50503
  };
50504
50504
 
50505
- var ActAccordion = function (_a) {
50506
- var icon = _a.icon, title = _a.title, content = _a.content, summaryHeight = _a.summaryHeight;
50507
- return (jsxRuntime.jsxs(Accordion$1, __assign$1({ sx: { border: "1px solid", borderColor: 'GreyLightDefaultborder' } }, { children: [jsxRuntime.jsx(AccordionSummary$1, __assign$1({ expandIcon: icon, sx: {
50505
+ var Accordion = function (_a) {
50506
+ var icon = _a.icon, title = _a.title, content = _a.content, summaryHeight = _a.summaryHeight, props = __rest(_a, ["icon", "title", "content", "summaryHeight"]);
50507
+ return (jsxRuntime.jsxs(AccordionMui, __assign$1({ sx: { border: "1px solid", borderColor: 'greyLightDefaultBorder' } }, props, { children: [jsxRuntime.jsx(AccordionSummary$1, __assign$1({ expandIcon: icon, sx: {
50508
+ fontWeight: 500,
50509
+ fontSize: 18,
50510
+ lineHeight: 21,
50508
50511
  height: summaryHeight || 60
50509
50512
  } }, { children: title })), jsxRuntime.jsx(AccordionDetails$1, __assign$1({ sx: {
50510
- backgroundColor: 'GreyXLight',
50511
- borderColor: 'GreyLightDefaultborder',
50512
- borderTop: '1px solid'
50513
+ backgroundColor: 'greyXLight',
50514
+ borderTop: '1px solid',
50515
+ borderColor: 'greyLightDefaultBorder'
50513
50516
  } }, { children: content }))] })));
50514
50517
  };
50515
50518
 
50516
- var Sizes = {
50519
+ var FontSizes = {
50517
50520
  xs: 8,
50518
50521
  sm: 12,
50519
50522
  md: 16,
@@ -50539,7 +50542,7 @@ var FontAwesomeSvgIcon = React.forwardRef(function (_a, ref) {
50539
50542
  svgPathData.map(function (d, i) { return (jsxRuntime.jsx("path", { style: { opacity: i === 0 ? 0.4 : 1 }, d: d }, i)); })) })));
50540
50543
  });
50541
50544
  var Icon = function (_a) {
50542
- 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;
50545
+ 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"]);
50543
50546
  var getStyles = function () {
50544
50547
  var theme = useTheme$1();
50545
50548
  var usedColor = theme.palette[color]
@@ -50555,7 +50558,7 @@ var Icon = function (_a) {
50555
50558
  borderRadius: '4px',
50556
50559
  borderColor: '1px solid ' + usedColor,
50557
50560
  overflow: 'visible',
50558
- padding: '10px',
50561
+ padding: usedFontSize + 'px',
50559
50562
  width: usedFontSize,
50560
50563
  height: usedFontSize,
50561
50564
  display: 'flex',
@@ -50566,7 +50569,7 @@ var Icon = function (_a) {
50566
50569
  return {
50567
50570
  color: usedColor,
50568
50571
  width: usedFontSize,
50569
- height: fontSize,
50572
+ height: size,
50570
50573
  display: 'inline-flex',
50571
50574
  alignItems: 'center',
50572
50575
  justifyContent: 'center'
@@ -50574,15 +50577,14 @@ var Icon = function (_a) {
50574
50577
  }
50575
50578
  };
50576
50579
  var isKey = function (key) {
50577
- return key in Sizes;
50580
+ return key in FontSizes;
50578
50581
  };
50579
- var usedFontSize = isKey(fontSize)
50580
- ? Sizes[fontSize]
50581
- : fontSize >= 0
50582
- ? fontSize
50582
+ var usedFontSize = isKey(size)
50583
+ ? FontSizes[size]
50584
+ : size >= 0
50585
+ ? size
50583
50586
  : 16;
50584
- console.log('isKey', isKey(fontSize));
50585
- return (jsxRuntime.jsx(Box$1, __assign$1({ component: "span", sx: getStyles() }, { children: jsxRuntime.jsx(FontAwesomeSvgIcon, { icon: icon, fontSize: usedFontSize }) })));
50587
+ return (jsxRuntime.jsx(Box$1, __assign$1({ component: "span", sx: getStyles() }, props, { children: jsxRuntime.jsx(FontAwesomeSvgIcon, { icon: icon, fontSize: usedFontSize }) })));
50586
50588
  };
50587
50589
 
50588
50590
  /******************************************************************************
@@ -50952,6 +50954,9 @@ var TextFieldCss = function (muiTokens) {
50952
50954
  return {
50953
50955
  MuiFormHelperText: {
50954
50956
  styleOverrides: {
50957
+ '@font-face': {
50958
+ fontFamily: 'Roboto'
50959
+ },
50955
50960
  root: {
50956
50961
  fontWeight: 400,
50957
50962
  fontSize: '11px',
@@ -51120,10 +51125,34 @@ var ButtonCss = function (muiTokens) {
51120
51125
  };
51121
51126
  };
51122
51127
 
51128
+ var AccordionCss = function () {
51129
+ return {
51130
+ MuiAccordionSummary: {
51131
+ styleOverrides: {
51132
+ '@font-face': {
51133
+ fontFamily: 'Roboto'
51134
+ },
51135
+ content: {
51136
+ paddingLeft: '12px',
51137
+ fontWeight: 500,
51138
+ fontSize: '18px',
51139
+ lineHeight: '21px'
51140
+ }
51141
+ }
51142
+ }
51143
+ };
51144
+ };
51145
+
51123
51146
  var useMaterialThemeCss = function (muiTokens) {
51124
51147
  var muiCss = React.useMemo(function () {
51125
51148
  return {
51126
- components: __assign(__assign(__assign({}, TextFieldCss(muiTokens)), ButtonCss(muiTokens)), { MuiSvgIcon: {
51149
+ components: __assign(__assign(__assign(__assign({}, TextFieldCss(muiTokens)), ButtonCss(muiTokens)), AccordionCss()), { MuiCssBaseline: {
51150
+ styleOverrides: {
51151
+ '@font-face': {
51152
+ fontFamily: 'Roboto'
51153
+ }
51154
+ }
51155
+ }, MuiSvgIcon: {
51127
51156
  styleOverrides: {
51128
51157
  colorSuccess: {
51129
51158
  color: muiTokens.palette.success.main
@@ -51136,12 +51165,17 @@ var useMaterialThemeCss = function (muiTokens) {
51136
51165
  };
51137
51166
 
51138
51167
  var useMaterialThemeTokens = function (themeName) {
51168
+ var fontWeights = {
51169
+ RobotoBold: 700,
51170
+ RobotoMedium: 500,
51171
+ RobotoRegular: 400
51172
+ };
51139
51173
  var designTokens = tokens;
51140
51174
  var muiTokensObject = {
51141
51175
  typography: {
51142
51176
  fontFamily: getFontFamilies(themeName).join(','),
51143
51177
  bigNumber: {
51144
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51178
+ fontWeight: fontWeights.RobotoBold,
51145
51179
  lineHeight: designTokens["".concat(themeName, "LineHeights49")] + 'px',
51146
51180
  fontSize: designTokens["".concat(themeName, "FontSize42")] + 'px',
51147
51181
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51150,7 +51184,7 @@ var useMaterialThemeTokens = function (themeName) {
51150
51184
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51151
51185
  },
51152
51186
  header1: {
51153
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51187
+ fontWeight: fontWeights.RobotoBold,
51154
51188
  lineHeight: designTokens["".concat(themeName, "LineHeights41")] + 'px',
51155
51189
  fontSize: designTokens["".concat(themeName, "FontSize35")] + 'px',
51156
51190
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51159,7 +51193,7 @@ var useMaterialThemeTokens = function (themeName) {
51159
51193
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51160
51194
  },
51161
51195
  header2: {
51162
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto500")],
51196
+ fontWeight: fontWeights.RobotoMedium,
51163
51197
  lineHeight: designTokens["".concat(themeName, "LineHeights34")] + 'px',
51164
51198
  fontSize: designTokens["".concat(themeName, "FontSize29")] + 'px',
51165
51199
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51168,7 +51202,7 @@ var useMaterialThemeTokens = function (themeName) {
51168
51202
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51169
51203
  },
51170
51204
  header3: {
51171
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto400")],
51205
+ fontWeight: fontWeights.RobotoRegular,
51172
51206
  lineHeight: designTokens["".concat(themeName, "LineHeights28")] + 'px',
51173
51207
  fontSize: designTokens["".concat(themeName, "FontSize24")] + 'px',
51174
51208
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51177,7 +51211,7 @@ var useMaterialThemeTokens = function (themeName) {
51177
51211
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51178
51212
  },
51179
51213
  header4: {
51180
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto500")],
51214
+ fontWeight: fontWeights.RobotoMedium,
51181
51215
  lineHeight: designTokens["".concat(themeName, "LineHeights21")] + 'px',
51182
51216
  fontSize: designTokens["".concat(themeName, "FontSize18")] + 'px',
51183
51217
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51186,7 +51220,7 @@ var useMaterialThemeTokens = function (themeName) {
51186
51220
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51187
51221
  },
51188
51222
  body1Regular: {
51189
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto400")],
51223
+ fontWeight: fontWeights.RobotoRegular,
51190
51224
  lineHeight: designTokens["".concat(themeName, "LineHeights18")] + 'px',
51191
51225
  fontSize: designTokens["".concat(themeName, "FontSize14")] + 'px',
51192
51226
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51195,7 +51229,7 @@ var useMaterialThemeTokens = function (themeName) {
51195
51229
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51196
51230
  },
51197
51231
  body1Medium: {
51198
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto500")],
51232
+ fontWeight: fontWeights.RobotoMedium,
51199
51233
  lineHeight: designTokens["".concat(themeName, "LineHeights18")] + 'px',
51200
51234
  fontSize: designTokens["".concat(themeName, "FontSize14")] + 'px',
51201
51235
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51204,7 +51238,7 @@ var useMaterialThemeTokens = function (themeName) {
51204
51238
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51205
51239
  },
51206
51240
  body1Bold: {
51207
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51241
+ fontWeight: fontWeights.RobotoBold,
51208
51242
  lineHeight: designTokens["".concat(themeName, "LineHeights18")] + 'px',
51209
51243
  fontSize: designTokens["".concat(themeName, "FontSize14")] + 'px',
51210
51244
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51213,7 +51247,7 @@ var useMaterialThemeTokens = function (themeName) {
51213
51247
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51214
51248
  },
51215
51249
  body2Regular: {
51216
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto400")],
51250
+ fontWeight: fontWeights.RobotoRegular,
51217
51251
  lineHeight: designTokens["".concat(themeName, "LineHeights16")] + 'px',
51218
51252
  fontSize: designTokens["".concat(themeName, "FontSize13")] + 'px',
51219
51253
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51222,7 +51256,7 @@ var useMaterialThemeTokens = function (themeName) {
51222
51256
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51223
51257
  },
51224
51258
  body2Medium: {
51225
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto500")],
51259
+ fontWeight: fontWeights.RobotoMedium,
51226
51260
  lineHeight: designTokens["".concat(themeName, "LineHeights16")] + 'px',
51227
51261
  fontSize: designTokens["".concat(themeName, "FontSize13")] + 'px',
51228
51262
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51231,7 +51265,7 @@ var useMaterialThemeTokens = function (themeName) {
51231
51265
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51232
51266
  },
51233
51267
  body2Bold: {
51234
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51268
+ fontWeight: fontWeights.RobotoBold,
51235
51269
  lineHeight: designTokens["".concat(themeName, "LineHeights16")] + 'px',
51236
51270
  fontSize: designTokens["".concat(themeName, "FontSize13")] + 'px',
51237
51271
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51240,7 +51274,7 @@ var useMaterialThemeTokens = function (themeName) {
51240
51274
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51241
51275
  },
51242
51276
  caption: {
51243
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto400")],
51277
+ fontWeight: fontWeights.RobotoRegular,
51244
51278
  lineHeight: designTokens["".concat(themeName, "LineHeights12")] + 'px',
51245
51279
  fontSize: designTokens["".concat(themeName, "FontSize11")] + 'px',
51246
51280
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51249,7 +51283,7 @@ var useMaterialThemeTokens = function (themeName) {
51249
51283
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51250
51284
  },
51251
51285
  buttonNotif: {
51252
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51286
+ fontWeight: fontWeights.RobotoBold,
51253
51287
  lineHeight: designTokens["".concat(themeName, "LineHeights18")] + 'px',
51254
51288
  fontSize: designTokens["".concat(themeName, "FontSize14")] + 'px',
51255
51289
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51258,7 +51292,7 @@ var useMaterialThemeTokens = function (themeName) {
51258
51292
  textDecoration: designTokens["".concat(themeName, "TextDecorationNone")]
51259
51293
  },
51260
51294
  link1: {
51261
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51295
+ fontWeight: fontWeights.RobotoBold,
51262
51296
  lineHeight: designTokens["".concat(themeName, "LineHeights18")] + 'px',
51263
51297
  fontSize: designTokens["".concat(themeName, "FontSize14")] + 'px',
51264
51298
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51267,7 +51301,7 @@ var useMaterialThemeTokens = function (themeName) {
51267
51301
  textDecoration: designTokens["".concat(themeName, "TextDecorationUnderline")]
51268
51302
  },
51269
51303
  link2: {
51270
- fontWeight: designTokens["".concat(themeName, "FontWeightsRoboto700")],
51304
+ fontWeight: fontWeights.RobotoBold,
51271
51305
  lineHeight: designTokens["".concat(themeName, "LineHeights16")] + 'px',
51272
51306
  fontSize: designTokens["".concat(themeName, "FontSize13")] + 'px',
51273
51307
  letterSpacing: designTokens["".concat(themeName, "LetterSpacingNone")],
@@ -51275,9 +51309,9 @@ var useMaterialThemeTokens = function (themeName) {
51275
51309
  textCase: designTokens["".concat(themeName, "TextCaseNone")],
51276
51310
  textDecoration: designTokens["".concat(themeName, "TextDecorationUnderline")]
51277
51311
  },
51278
- fontWeightRegular: designTokens["".concat(themeName, "FontWeightsRoboto400")],
51279
- fontWeightMedium: designTokens["".concat(themeName, "FontWeightsRoboto500")],
51280
- fontWeightBold: designTokens["".concat(themeName, "FontWeightsRoboto700")]
51312
+ fontWeightRegular: fontWeights.RobotoBold,
51313
+ fontWeightMedium: fontWeights.RobotoMedium,
51314
+ fontWeightBold: fontWeights.RobotoRegular
51281
51315
  },
51282
51316
  breakpoints: {
51283
51317
  values: {
@@ -51298,7 +51332,7 @@ var useMaterialThemeTokens = function (themeName) {
51298
51332
  snackbar: 1400,
51299
51333
  tooltip: 1500
51300
51334
  },
51301
- // spacing: Number(designTokens[`${themeName}SpacingXs`]), // spacing minimum
51335
+ spacing: Number(designTokens["".concat(themeName, "SpacingXxs")]),
51302
51336
  palette: getMuiPalette(themeName)
51303
51337
  };
51304
51338
  var muiCss = useMaterialThemeCss(muiTokensObject).muiCss;
@@ -51329,7 +51363,7 @@ var DesignSystemProvider = function (_a) {
51329
51363
  return (jsxRuntime.jsx(DesignSystemContext.Provider, __assign$1({ value: { isDarkTheme: isDarkTheme, themeName: themeName, toggleDarkTheme: toggleDarkTheme } }, { children: jsxRuntime.jsx(MaterialThemeProvider, { children: children }) })));
51330
51364
  };
51331
51365
 
51332
- exports.Accordion = ActAccordion;
51366
+ exports.Accordion = Accordion;
51333
51367
  exports.Button = Button;
51334
51368
  exports.Checkbox = Checkbox;
51335
51369
  exports.DesignSystemContext = DesignSystemContext;