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