@groupeactual/ui-kit 0.2.1 → 0.2.3

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,7 +1,7 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  export interface DesignSystemContextValues {
3
3
  isDarkTheme: boolean;
4
- themeName: 'default' | 'lucie';
4
+ themeName: string;
5
5
  toggleDarkTheme: () => void;
6
6
  }
7
7
  export declare const DesignSystemContext: import("react").Context<DesignSystemContextValues>;
package/dist/cjs/index.js CHANGED
@@ -43,15 +43,15 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
43
43
  PERFORMANCE OF THIS SOFTWARE.
44
44
  ***************************************************************************** */
45
45
 
46
- var __assign$1 = function() {
47
- __assign$1 = Object.assign || function __assign(t) {
46
+ var __assign = function() {
47
+ __assign = Object.assign || function __assign(t) {
48
48
  for (var s, i = 1, n = arguments.length; i < n; i++) {
49
49
  s = arguments[i];
50
50
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
51
51
  }
52
52
  return t;
53
53
  };
54
- return __assign$1.apply(this, arguments);
54
+ return __assign.apply(this, arguments);
55
55
  };
56
56
 
57
57
  function __rest(s, e) {
@@ -5652,8 +5652,8 @@ const backgroundColor = style$1({
5652
5652
  prop: 'backgroundColor',
5653
5653
  themeKey: 'palette'
5654
5654
  });
5655
- const palette = compose(color, bgcolor, backgroundColor);
5656
- var palette$1 = palette;
5655
+ const palette$1 = compose(color, bgcolor, backgroundColor);
5656
+ var palette$2 = palette$1;
5657
5657
 
5658
5658
  const position = style$1({
5659
5659
  prop: 'position'
@@ -5781,7 +5781,7 @@ const filterPropsMapping = {
5781
5781
  flexbox: flexbox$1.filterProps,
5782
5782
  grid: grid$1.filterProps,
5783
5783
  positions: positions.filterProps,
5784
- palette: palette$1.filterProps,
5784
+ palette: palette$2.filterProps,
5785
5785
  shadows: shadows$2.filterProps,
5786
5786
  sizing: sizing$1.filterProps,
5787
5787
  spacing: spacing.filterProps,
@@ -5793,7 +5793,7 @@ const styleFunctionMapping = {
5793
5793
  flexbox: flexbox$1,
5794
5794
  grid: grid$1,
5795
5795
  positions,
5796
- palette: palette$1,
5796
+ palette: palette$2,
5797
5797
  shadows: shadows$2,
5798
5798
  sizing: sizing$1,
5799
5799
  spacing,
@@ -51375,9 +51375,9 @@ process.env.NODE_ENV !== "production" ? TextField$1.propTypes
51375
51375
  } : void 0;
51376
51376
  var MuiTextField = TextField$1;
51377
51377
 
51378
- var ActText = function (props) { return jsxRuntime.jsx(Typography$1, __assign$1({}, props)); };
51378
+ var ActText = function (props) { return jsxRuntime.jsx(Typography$1, __assign({}, props)); };
51379
51379
 
51380
- var ActHeading = function (props) { return jsxRuntime.jsx(Typography$1, __assign$1({}, props)); };
51380
+ var ActHeading = function (props) { return jsxRuntime.jsx(Typography$1, __assign({}, props)); };
51381
51381
 
51382
51382
  var ActButton = styled$1(Button$1)(function (_a) {
51383
51383
  var theme = _a.theme;
@@ -51401,7 +51401,7 @@ var TextField = function (_a) {
51401
51401
  setInternalValue(value);
51402
51402
  }
51403
51403
  }, [value]);
51404
- return (jsxRuntime.jsx(MuiTextField, __assign$1({ variant: "outlined", name: name, label: label, value: internalValue, onClick: function (e) { return e.stopPropagation(); }, InputProps: {
51404
+ return (jsxRuntime.jsx(MuiTextField, __assign({ variant: "outlined", name: name, label: label, value: internalValue, onClick: function (e) { return e.stopPropagation(); }, InputProps: {
51405
51405
  endAdornment: endAdornment
51406
51406
  }, onChange: function (e) {
51407
51407
  setInternalValue(e.currentTarget.value);
@@ -51419,10 +51419,10 @@ var Checkbox = function (_a) {
51419
51419
  setInternalValue(value);
51420
51420
  }
51421
51421
  }, [value]);
51422
- return (jsxRuntime.jsxs(FormControl$1, __assign$1({ fullWidth: true }, { children: [jsxRuntime.jsx(FormControlLabel$1, { sx: { display: 'table' }, control: jsxRuntime.jsx(Box$3, __assign$1({ sx: { display: 'table-cell' } }, { children: jsxRuntime.jsx(CheckboxMUI, { name: name, sx: { marginTop: -0.5 }, checked: internalValue, color: "primary", onChange: function (e) {
51422
+ return (jsxRuntime.jsxs(FormControl$1, __assign({ fullWidth: true }, { children: [jsxRuntime.jsx(FormControlLabel$1, { sx: { display: 'table' }, control: jsxRuntime.jsx(Box$3, __assign({ sx: { display: 'table-cell' } }, { children: jsxRuntime.jsx(CheckboxMUI, { name: name, sx: { marginTop: -0.5 }, checked: internalValue, color: "primary", onChange: function (e) {
51423
51423
  setInternalValue(e.target.checked);
51424
51424
  onChange(name, e.target.checked, true);
51425
- } }) })), label: jsxRuntime.jsx(Typography$1, __assign$1({ sx: sx }, { children: label })) }), error && (jsxRuntime.jsx(Typography$1, __assign$1({ sx: {
51425
+ } }) })), label: jsxRuntime.jsx(Typography$1, __assign({ sx: sx }, { children: label })) }), error && (jsxRuntime.jsx(Typography$1, __assign({ sx: {
51426
51426
  marginTop: -1,
51427
51427
  color: '#B80025',
51428
51428
  fontWeight: 400,
@@ -51430,158 +51430,274 @@ var Checkbox = function (_a) {
51430
51430
  } }, { children: error })))] })));
51431
51431
  };
51432
51432
 
51433
- /******************************************************************************
51434
- Copyright (c) Microsoft Corporation.
51435
-
51436
- Permission to use, copy, modify, and/or distribute this software for any
51437
- purpose with or without fee is hereby granted.
51438
-
51439
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
51440
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
51441
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
51442
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
51443
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
51444
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
51445
- PERFORMANCE OF THIS SOFTWARE.
51446
- ***************************************************************************** */
51447
-
51448
- var __assign = function() {
51449
- __assign = Object.assign || function __assign(t) {
51450
- for (var s, i = 1, n = arguments.length; i < n; i++) {
51451
- s = arguments[i];
51452
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
51453
- }
51454
- return t;
51455
- };
51456
- return __assign.apply(this, arguments);
51457
- };
51458
-
51459
- var fontSizes$1 = {
51460
- caption: "11px",
51461
- body2: "13px",
51462
- body1: "14px",
51463
- subtitle2: "18px",
51464
- subtitle1: "24px",
51465
- h2: "29px",
51466
- h1: "35px",
51467
- bigNumber: "42px",
51468
- title2: "55px"
51469
- };
51470
- var fontWeights = {
51471
- light: "300",
51472
- regular: "400",
51473
- medium: "500",
51474
- bold: "700",
51475
- caption: "400",
51476
- body2: "400",
51477
- body1: "400",
51478
- subtitle2: "500",
51479
- subtitle1: "400",
51480
- h2: "500",
51481
- h1: "700"
51482
- };
51483
- var lineHeights = {
51484
- caption: "12px",
51485
- body2: "16px",
51486
- body1: "18px",
51487
- subtitle2: "21px",
51488
- subtitle1: "28px",
51489
- h2: "34px",
51490
- h1: "41px"
51491
- };
51492
- var colors$1 = {
51493
- text: {
51494
- primary: "#272727",
51495
- secondary: "#545352"
51496
- },
51497
- black: "#000000",
51498
- white: "#FFFFFF",
51499
- red: "red",
51500
- green: "green",
51501
- blueClickable: "#136CAC",
51502
- greyDark: "#545352",
51503
- greyXDark: "#272727",
51504
- defaultBorder: "#CBCBCB",
51505
- greyLightBorder: "#F0F0F0",
51506
- redLight: "rgba(255, 0, 0, 0.04)"
51507
- };
51508
- var defaultTokens = {
51509
- fontSizes: fontSizes$1,
51510
- fontWeights: fontWeights,
51511
- lineHeights: lineHeights,
51512
- colors: colors$1
51433
+ /**
51434
+ * Do not edit directly
51435
+ * Generated on Fri, 18 Nov 2022 15:06:19 GMT
51436
+ */
51437
+ var DefaultWebShadowAllContent = {
51438
+ color: '#2727271f',
51439
+ type: 'dropShadow',
51440
+ x: '0',
51441
+ y: '2',
51442
+ blur: '10',
51443
+ spread: '0'
51513
51444
  };
51445
+ var DefaultFontFamiliesRoboto = 'Roboto';
51446
+ var DefaultLineHeights12 = '12';
51447
+ var DefaultLineHeights16 = '16';
51448
+ var DefaultLineHeights18 = '18';
51449
+ var DefaultLineHeights21 = '21';
51450
+ var DefaultLineHeights28 = '28';
51451
+ var DefaultLineHeights34 = '34';
51452
+ var DefaultLineHeights41 = '41';
51453
+ var DefaultLineHeights49 = '49';
51454
+ var DefaultFontWeightsRoboto700 = 'Bold';
51455
+ var DefaultFontWeightsRoboto500 = 'Medium';
51456
+ var DefaultFontWeightsRoboto400 = 'Regular';
51457
+ var DefaultFontSize10 = '10';
51458
+ var DefaultFontSize12 = '12';
51459
+ var DefaultFontSize14 = '14';
51460
+ var DefaultFontSize16 = '16';
51461
+ var DefaultFontSize18 = '18';
51462
+ var DefaultFontSize24 = '24';
51463
+ var DefaultFontSize29 = '29';
51464
+ var DefaultFontSize35 = '35';
51465
+ var DefaultFontSize42 = '42';
51466
+ var DefaultLetterSpacing0 = '0%';
51467
+ var DefaultParagraphSpacing0 = '0';
51468
+ var DefaultParagraphSpacing8 = '8';
51469
+ var DefaultTextCaseNone = 'none';
51470
+ var DefaultTextDecorationNone = 'none';
51471
+ var DefaultTextDecorationUnderline = 'underline';
51472
+ var DefaultSpacingXxs = '4';
51473
+ var DefaultSpacingXs = '8';
51474
+ var DefaultSpacingSm = '16';
51475
+ var DefaultSpacingMd = '24';
51476
+ var DefaultSpacingLg = '32';
51477
+ var DefaultSpacingXl = '40';
51478
+ var DefaultSpacingXxl = '72';
51479
+ var DefaultBorderRadius4 = '4';
51480
+ var DefaultBorderRadius8 = '8';
51481
+ var DefaultBorderRadius16 = '16';
51482
+ var DefaultBorderRadius24 = '24';
51483
+ var DefaultSizingXs = '8';
51484
+ var DefaultSizingSm = '12';
51485
+ var DefaultSizingMd = '16';
51486
+ var DefaultSizingLg = '24';
51487
+ var DefaultSizingXl = '32';
51488
+ var DefaultSizingXxl = '40';
51489
+ var DefaultSizingXxxl = '72';
51490
+ var DefaultDefaultColorsRedActual = '#e40521';
51491
+ var DefaultDefaultColorsBlueClickable = '#136cac';
51492
+ var DefaultDefaultColorsBlueHoverClickable = '#004f88';
51493
+ var DefaultDefaultColorsGreyMediumInactive = '#808080';
51494
+ var DefaultDefaultColorsGreyXDark = '#272727';
51495
+ var DefaultDefaultColorsGreyDark = '#545352';
51496
+ var DefaultDefaultColorsWhite = '#ffffff';
51497
+ var DefaultDefaultColorsGreyXLight = '#f0f0f0';
51498
+ var DefaultDefaultColorsGreyXDarkBgModal = '#27272780';
51499
+ var DefaultDefaultColorsBlueHoverEquivalence12 = '#e8f1f7';
51500
+ var DefaultDefaultColorsBlueHoverOpacity12 = '#136cac1f';
51501
+ var DefaultDefaultColorsGreyLightDefaultborder = '#cbcbcb';
51502
+ var DefaultDefaultColorsBlueInfo = '#1d91c3';
51503
+ var DefaultDefaultColorsGreenSuccess = '#23956d';
51504
+ var DefaultDefaultColorsOrangeWarning = '#e46221';
51505
+ var DefaultDefaultColorsRedError = '#b80025';
51506
+ var DefaultDefaultColorsBlueDark = '#0d2c54';
51507
+ var DefaultDefaultColorsBlueMedium = '#3d5a80';
51508
+ var DefaultDefaultColorsBlueLight = '#7fdcea';
51509
+ var DefaultDefaultColorsGreenDark = '#125e42';
51510
+ var DefaultDefaultColorsGreenMedium = '#1f8461';
51511
+ var DefaultDefaultColorsGreen = '#5dca8b';
51512
+ var DefaultDefaultColorsGreenLight = '#bad07a';
51513
+ var DefaultDefaultColorsBrown = '#6f2902';
51514
+ var DefaultDefaultColorsBrownLight = '#b65700';
51515
+ var DefaultDefaultColorsOrangeLight = '#f59b00';
51516
+ var DefaultDefaultColorsYellow = '#f9d25e';
51517
+ var DefaultDefaultColorsPurpleDark = '#530d48';
51518
+ var DefaultDefaultColorsPurple = '#831443';
51519
+ var DefaultDefaultColorsPink = '#ca1e5c';
51520
+ var DefaultDefaultColorsPinkLight = '#fd6972';
51521
+
51522
+ var tokens = /*#__PURE__*/Object.freeze({
51523
+ __proto__: null,
51524
+ DefaultWebShadowAllContent: DefaultWebShadowAllContent,
51525
+ DefaultFontFamiliesRoboto: DefaultFontFamiliesRoboto,
51526
+ DefaultLineHeights12: DefaultLineHeights12,
51527
+ DefaultLineHeights16: DefaultLineHeights16,
51528
+ DefaultLineHeights18: DefaultLineHeights18,
51529
+ DefaultLineHeights21: DefaultLineHeights21,
51530
+ DefaultLineHeights28: DefaultLineHeights28,
51531
+ DefaultLineHeights34: DefaultLineHeights34,
51532
+ DefaultLineHeights41: DefaultLineHeights41,
51533
+ DefaultLineHeights49: DefaultLineHeights49,
51534
+ DefaultFontWeightsRoboto700: DefaultFontWeightsRoboto700,
51535
+ DefaultFontWeightsRoboto500: DefaultFontWeightsRoboto500,
51536
+ DefaultFontWeightsRoboto400: DefaultFontWeightsRoboto400,
51537
+ DefaultFontSize10: DefaultFontSize10,
51538
+ DefaultFontSize12: DefaultFontSize12,
51539
+ DefaultFontSize14: DefaultFontSize14,
51540
+ DefaultFontSize16: DefaultFontSize16,
51541
+ DefaultFontSize18: DefaultFontSize18,
51542
+ DefaultFontSize24: DefaultFontSize24,
51543
+ DefaultFontSize29: DefaultFontSize29,
51544
+ DefaultFontSize35: DefaultFontSize35,
51545
+ DefaultFontSize42: DefaultFontSize42,
51546
+ DefaultLetterSpacing0: DefaultLetterSpacing0,
51547
+ DefaultParagraphSpacing0: DefaultParagraphSpacing0,
51548
+ DefaultParagraphSpacing8: DefaultParagraphSpacing8,
51549
+ DefaultTextCaseNone: DefaultTextCaseNone,
51550
+ DefaultTextDecorationNone: DefaultTextDecorationNone,
51551
+ DefaultTextDecorationUnderline: DefaultTextDecorationUnderline,
51552
+ DefaultSpacingXxs: DefaultSpacingXxs,
51553
+ DefaultSpacingXs: DefaultSpacingXs,
51554
+ DefaultSpacingSm: DefaultSpacingSm,
51555
+ DefaultSpacingMd: DefaultSpacingMd,
51556
+ DefaultSpacingLg: DefaultSpacingLg,
51557
+ DefaultSpacingXl: DefaultSpacingXl,
51558
+ DefaultSpacingXxl: DefaultSpacingXxl,
51559
+ DefaultBorderRadius4: DefaultBorderRadius4,
51560
+ DefaultBorderRadius8: DefaultBorderRadius8,
51561
+ DefaultBorderRadius16: DefaultBorderRadius16,
51562
+ DefaultBorderRadius24: DefaultBorderRadius24,
51563
+ DefaultSizingXs: DefaultSizingXs,
51564
+ DefaultSizingSm: DefaultSizingSm,
51565
+ DefaultSizingMd: DefaultSizingMd,
51566
+ DefaultSizingLg: DefaultSizingLg,
51567
+ DefaultSizingXl: DefaultSizingXl,
51568
+ DefaultSizingXxl: DefaultSizingXxl,
51569
+ DefaultSizingXxxl: DefaultSizingXxxl,
51570
+ DefaultDefaultColorsRedActual: DefaultDefaultColorsRedActual,
51571
+ DefaultDefaultColorsBlueClickable: DefaultDefaultColorsBlueClickable,
51572
+ DefaultDefaultColorsBlueHoverClickable: DefaultDefaultColorsBlueHoverClickable,
51573
+ DefaultDefaultColorsGreyMediumInactive: DefaultDefaultColorsGreyMediumInactive,
51574
+ DefaultDefaultColorsGreyXDark: DefaultDefaultColorsGreyXDark,
51575
+ DefaultDefaultColorsGreyDark: DefaultDefaultColorsGreyDark,
51576
+ DefaultDefaultColorsWhite: DefaultDefaultColorsWhite,
51577
+ DefaultDefaultColorsGreyXLight: DefaultDefaultColorsGreyXLight,
51578
+ DefaultDefaultColorsGreyXDarkBgModal: DefaultDefaultColorsGreyXDarkBgModal,
51579
+ DefaultDefaultColorsBlueHoverEquivalence12: DefaultDefaultColorsBlueHoverEquivalence12,
51580
+ DefaultDefaultColorsBlueHoverOpacity12: DefaultDefaultColorsBlueHoverOpacity12,
51581
+ DefaultDefaultColorsGreyLightDefaultborder: DefaultDefaultColorsGreyLightDefaultborder,
51582
+ DefaultDefaultColorsBlueInfo: DefaultDefaultColorsBlueInfo,
51583
+ DefaultDefaultColorsGreenSuccess: DefaultDefaultColorsGreenSuccess,
51584
+ DefaultDefaultColorsOrangeWarning: DefaultDefaultColorsOrangeWarning,
51585
+ DefaultDefaultColorsRedError: DefaultDefaultColorsRedError,
51586
+ DefaultDefaultColorsBlueDark: DefaultDefaultColorsBlueDark,
51587
+ DefaultDefaultColorsBlueMedium: DefaultDefaultColorsBlueMedium,
51588
+ DefaultDefaultColorsBlueLight: DefaultDefaultColorsBlueLight,
51589
+ DefaultDefaultColorsGreenDark: DefaultDefaultColorsGreenDark,
51590
+ DefaultDefaultColorsGreenMedium: DefaultDefaultColorsGreenMedium,
51591
+ DefaultDefaultColorsGreen: DefaultDefaultColorsGreen,
51592
+ DefaultDefaultColorsGreenLight: DefaultDefaultColorsGreenLight,
51593
+ DefaultDefaultColorsBrown: DefaultDefaultColorsBrown,
51594
+ DefaultDefaultColorsBrownLight: DefaultDefaultColorsBrownLight,
51595
+ DefaultDefaultColorsOrangeLight: DefaultDefaultColorsOrangeLight,
51596
+ DefaultDefaultColorsYellow: DefaultDefaultColorsYellow,
51597
+ DefaultDefaultColorsPurpleDark: DefaultDefaultColorsPurpleDark,
51598
+ DefaultDefaultColorsPurple: DefaultDefaultColorsPurple,
51599
+ DefaultDefaultColorsPink: DefaultDefaultColorsPink,
51600
+ DefaultDefaultColorsPinkLight: DefaultDefaultColorsPinkLight
51601
+ });
51514
51602
 
51515
- var fontSizes = {
51516
- h3: "1.3rem"
51517
- };
51518
- var colors = {
51519
- red: "#E11C31",
51520
- redDark: "#B80025",
51521
- greyLight: "#F0F0F0",
51522
- greyDark: "#808080",
51523
- greySemiDark: "#545352",
51524
- grey: "#CBCBCB",
51525
- blue: "#136CAC",
51526
- orange: "#E46221"
51527
- };
51528
- var lucieTokens = {
51529
- fontSizes: fontSizes,
51530
- colors: colors
51603
+ var getTokensByType = function (type) {
51604
+ var defaultTokens = {};
51605
+ Object.keys(tokens).forEach(function (colorName) {
51606
+ if (colorName.startsWith("Default".concat(type))) {
51607
+ var colorKey = colorName.replace("Default".concat(type), '');
51608
+ colorKey = colorKey.charAt(0).toLowerCase() + colorKey.slice(1);
51609
+ defaultTokens[colorKey] = tokens[colorName];
51610
+ }
51611
+ });
51612
+ return defaultTokens;
51531
51613
  };
51532
-
51533
51614
  var useThemeTokens = function (themeName) {
51534
51615
  if (themeName === void 0) { themeName = 'default'; }
51535
- var themeTokens = React.useMemo(function () {
51536
- switch (themeName) {
51537
- case 'lucie':
51538
- return lucieTokens;
51539
- default:
51540
- return {};
51541
- }
51542
- }, [themeName]);
51543
51616
  var tokens = React.useMemo(function () {
51544
- var baseTokens = defaultTokens;
51545
51617
  return {
51546
- fontSizes: __assign(__assign({}, baseTokens.fontSizes), themeTokens.fontSizes),
51547
- fontWeights: __assign(__assign({}, baseTokens.fontWeights), themeTokens.fontWeights),
51548
- lineHeights: __assign(__assign({}, baseTokens.lineHeights), themeTokens.lineHeights),
51549
- colors: __assign(__assign({}, baseTokens.colors), themeTokens.colors)
51618
+ fontSizes: getTokensByType('FontSize'),
51619
+ fontWeights: getTokensByType('FontWeights'),
51620
+ lineHeights: getTokensByType('LineHeights'),
51621
+ colors: getTokensByType('DefaultColors'),
51622
+ spacing: getTokensByType('Spacing'),
51623
+ sizing: getTokensByType('Sizing')
51550
51624
  };
51551
- }, [themeName, themeTokens]);
51552
- var materialUIThemeTokens = React.useMemo(function () {
51553
- var typographies = [
51554
- 'h1',
51555
- 'h2',
51556
- 'h3',
51557
- 'subtitle1',
51558
- 'subtitle2',
51559
- 'body1',
51560
- 'body2',
51561
- 'caption'
51562
- ];
51563
- var typography = {};
51564
- typographies.forEach(function (typo) {
51565
- typography[typo] = {
51566
- fontSize: tokens.fontSizes[typo],
51567
- lineHeight: tokens.lineHeights[typo],
51568
- fontWeight: tokens.fontWeights[typo]
51569
- };
51570
- });
51625
+ }, [themeName]);
51626
+ return { themeName: themeName, tokens: tokens };
51627
+ };
51628
+
51629
+ var palette = {};
51630
+ Object.keys(tokens).forEach(function (colorName) {
51631
+ if (colorName.startsWith('DefaultDefaultColors')) {
51632
+ var colorKey = colorName.replace('DefaultDefaultColors', '');
51633
+ colorKey = colorKey.charAt(0).toLowerCase() + colorKey.slice(1);
51634
+ palette[colorKey] = tokens[colorName];
51635
+ }
51636
+ });
51637
+ // TODO ne gère pour le moment que le theme default, possibilité de rendre la fonction
51638
+ // générique en gérant le theme 'Default'FontSize35
51639
+ var useMaterialThemeTokens = function (themeName) {
51640
+ if (themeName === void 0) { themeName = 'default'; }
51641
+ var muiTokens = React.useMemo(function () {
51571
51642
  return {
51572
- typography: __assign(__assign({}, typography), { fontWeightLight: tokens.fontWeights.light, fontWeightRegular: tokens.fontWeights.regular, fontWeightMedium: tokens.fontWeights.medium, fontWeightBold: tokens.fontWeights.bold }),
51573
- palette: tokens.colors
51643
+ typography: {
51644
+ h1: {
51645
+ fontSize: DefaultFontSize35,
51646
+ lineHeight: DefaultLineHeights41,
51647
+ fontWeight: DefaultFontWeightsRoboto700
51648
+ },
51649
+ h2: {
51650
+ fontSize: DefaultFontSize29,
51651
+ lineHeight: DefaultLineHeights34,
51652
+ fontWeight: DefaultFontWeightsRoboto500
51653
+ },
51654
+ h3: {
51655
+ fontSize: DefaultFontSize24,
51656
+ lineHeight: DefaultLineHeights28,
51657
+ fontWeight: DefaultFontWeightsRoboto400
51658
+ },
51659
+ subtitle1: {
51660
+ fontSize: DefaultFontSize24,
51661
+ lineHeight: DefaultLineHeights28,
51662
+ fontWeight: DefaultFontWeightsRoboto400
51663
+ },
51664
+ subtitle2: {
51665
+ fontSize: DefaultFontSize18,
51666
+ lineHeight: DefaultLineHeights21,
51667
+ fontWeight: DefaultFontWeightsRoboto500
51668
+ },
51669
+ body1: {
51670
+ fontSize: DefaultFontSize14,
51671
+ lineHeight: DefaultLineHeights18,
51672
+ fontWeight: DefaultFontWeightsRoboto400
51673
+ },
51674
+ body2: {
51675
+ fontSize: DefaultFontSize12,
51676
+ lineHeight: DefaultLineHeights16,
51677
+ fontWeight: DefaultFontWeightsRoboto400
51678
+ },
51679
+ caption: {
51680
+ fontSize: DefaultFontSize10,
51681
+ lineHeight: DefaultLineHeights12,
51682
+ fontWeight: DefaultFontWeightsRoboto400
51683
+ },
51684
+ fontWeightLight: DefaultFontWeightsRoboto400,
51685
+ fontWeightRegular: DefaultFontWeightsRoboto500,
51686
+ fontWeightMedium: DefaultFontWeightsRoboto500,
51687
+ fontWeightBold: DefaultFontWeightsRoboto700
51688
+ },
51689
+ palette: palette
51574
51690
  };
51575
51691
  }, [tokens, themeName]);
51576
- return { themeName: themeName, tokens: tokens, materialUIThemeTokens: materialUIThemeTokens };
51692
+ return { muiTokens: muiTokens };
51577
51693
  };
51578
51694
 
51579
51695
  var ActAccordion = function (_a) {
51580
51696
  var icon = _a.icon, title = _a.title, content = _a.content, summaryHeight = _a.summaryHeight;
51581
51697
  var tokens = useThemeTokens('lucie').tokens;
51582
- return (jsxRuntime.jsxs(Accordion$1, __assign$1({ sx: { border: "1px solid ".concat(tokens.colors.defaultBorder) } }, { children: [jsxRuntime.jsx(AccordionSummary$1, __assign$1({ expandIcon: icon, sx: {
51698
+ return (jsxRuntime.jsxs(Accordion$1, __assign({ sx: { border: "1px solid ".concat(tokens.colors.defaultBorder) } }, { children: [jsxRuntime.jsx(AccordionSummary$1, __assign({ expandIcon: icon, sx: {
51583
51699
  height: summaryHeight || 60
51584
- } }, { children: title })), jsxRuntime.jsx(AccordionDetails$1, __assign$1({ sx: {
51700
+ } }, { children: title })), jsxRuntime.jsx(AccordionDetails$1, __assign({ sx: {
51585
51701
  bgcolor: tokens.colors.greyLightBorder,
51586
51702
  borderTop: '1px solid #CBCBCB'
51587
51703
  } }, { children: content }))] })));
@@ -51591,7 +51707,7 @@ var ActAccordion = function (_a) {
51591
51707
  var FontAwesomeSvgIcon = React.forwardRef(function (_a, ref) {
51592
51708
  var icon = _a.icon, fontSize = _a.fontSize;
51593
51709
  var _b = icon.icon, width = _b[0], height = _b[1], svgPathData = _b[4];
51594
- return (jsxRuntime.jsx(SvgIcon$1, __assign$1({ ref: ref, viewBox: "0 0 ".concat(width, " ").concat(height), sx: {
51710
+ return (jsxRuntime.jsx(SvgIcon$1, __assign({ ref: ref, viewBox: "0 0 ".concat(width, " ").concat(height), sx: {
51595
51711
  fontSize: fontSize
51596
51712
  } }, { children: typeof svgPathData === 'string' ? (jsxRuntime.jsx("path", { d: svgPathData })) : (
51597
51713
  /**
@@ -51667,7 +51783,7 @@ var IconProvider = function (_a) {
51667
51783
  };
51668
51784
  }
51669
51785
  };
51670
- return (jsxRuntime.jsx(Box$1, __assign$1({ component: "span", sx: getStyles() }, { children: jsxRuntime.jsx(FontAwesomeSvgIcon, { icon: icon, fontSize: getFontSize() }) })));
51786
+ return (jsxRuntime.jsx(Box$1, __assign({ component: "span", sx: getStyles() }, { children: jsxRuntime.jsx(FontAwesomeSvgIcon, { icon: icon, fontSize: getFontSize() }) })));
51671
51787
  };
51672
51788
 
51673
51789
  var DesignSystemContext = React.createContext({
@@ -51678,9 +51794,10 @@ var DesignSystemContext = React.createContext({
51678
51794
  var MaterialThemeProvider = function (_a) {
51679
51795
  var children = _a.children;
51680
51796
  var themeName = React.useContext(DesignSystemContext).themeName;
51681
- var materialUIThemeTokens = useThemeTokens(themeName).materialUIThemeTokens;
51682
- var theme = React.useMemo(function () { return createTheme(materialUIThemeTokens); }, [materialUIThemeTokens]);
51683
- return jsxRuntime.jsx(ThemeProvider, __assign$1({ theme: theme }, { children: children }));
51797
+ var muiTokens = useMaterialThemeTokens(themeName).muiTokens;
51798
+ console.log('muiTokens', muiTokens);
51799
+ var theme = createTheme(muiTokens);
51800
+ return jsxRuntime.jsx(ThemeProvider, __assign({ theme: theme }, { children: children }));
51684
51801
  };
51685
51802
  var DesignSystemProvider = function (_a) {
51686
51803
  var children = _a.children, _b = _a.name, themeName = _b === void 0 ? 'default' : _b;
@@ -51688,7 +51805,7 @@ var DesignSystemProvider = function (_a) {
51688
51805
  var toggleDarkTheme = function () {
51689
51806
  setIsDarkTheme(!isDarkTheme);
51690
51807
  };
51691
- return (jsxRuntime.jsx(DesignSystemContext.Provider, __assign$1({ value: { isDarkTheme: isDarkTheme, themeName: themeName, toggleDarkTheme: toggleDarkTheme } }, { children: jsxRuntime.jsx(MaterialThemeProvider, { children: children }) })));
51808
+ return (jsxRuntime.jsx(DesignSystemContext.Provider, __assign({ value: { isDarkTheme: isDarkTheme, themeName: themeName, toggleDarkTheme: toggleDarkTheme } }, { children: jsxRuntime.jsx(MaterialThemeProvider, { children: children }) })));
51692
51809
  };
51693
51810
 
51694
51811
  exports.ActAccordion = ActAccordion;