tp-react-elements-dev 1.12.5 → 1.12.7

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.
Files changed (68) hide show
  1. package/dist/App.d.ts +2 -2
  2. package/dist/App.test.d.ts +1 -1
  3. package/dist/Utilities/Constants/FormConstants.d.ts +10 -10
  4. package/dist/Utilities/Constants/FunctionConstants.d.ts +61 -0
  5. package/dist/Utilities/Interface/FormInterface.d.ts +69 -70
  6. package/dist/components/DeleteComponent/Delete.stories.d.ts +5 -4
  7. package/dist/components/DeleteComponent/DeleteField.d.ts +7 -7
  8. package/dist/components/Form/Form.stories.d.ts +5 -4
  9. package/dist/components/Form/Form.styles.d.ts +43 -40
  10. package/dist/components/Form/FormActiveSwitch.d.ts +3 -3
  11. package/dist/components/Form/FormConstants.d.ts +13 -13
  12. package/dist/components/Form/FormContainer.d.ts +2 -2
  13. package/dist/components/Form/FormRender.d.ts +3 -3
  14. package/dist/components/Form/FormRenderConstants.d.ts +15 -15
  15. package/dist/components/Form/FormRenderWrapper.d.ts +18 -18
  16. package/dist/components/FormComponents/DatePicker/DateRangePicker.d.ts +7 -7
  17. package/dist/components/FormComponents/DatePicker/DatepickerWrapperV2.d.ts +6 -6
  18. package/dist/components/FormComponents/DatePicker/MonthPicker.d.ts +2 -2
  19. package/dist/components/FormComponents/DatePicker/Monthpickerrender.d.ts +6 -6
  20. package/dist/components/FormComponents/FileUpload/FormRenderFileUpload.d.ts +6 -6
  21. package/dist/components/FormComponents/FileUpload/FormRenderMultiFileUpload.d.ts +6 -6
  22. package/dist/components/FormComponents/FormBottomField/FormBottomField.d.ts +3 -3
  23. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.d.ts +6 -6
  24. package/dist/components/FormComponents/FormCheckBoxGroup/FormCheckBoxGroup.d.ts +6 -6
  25. package/dist/components/FormComponents/FormErrorField/FormErrorField.d.ts +3 -3
  26. package/dist/components/FormComponents/FormNumberField/FormNumberField.d.ts +6 -6
  27. package/dist/components/FormComponents/FormNumberField/FormNumberFieldDecimal.d.ts +6 -6
  28. package/dist/components/FormComponents/FormRadioGroup/FormRadioGroup.d.ts +6 -6
  29. package/dist/components/FormComponents/FormTextAreaField/FormTextAreaField.d.ts +6 -6
  30. package/dist/components/FormComponents/FormTextAreaField/FormTextAreaField.styles.d.ts +3 -3
  31. package/dist/components/FormComponents/FormTextField/FormTextField.d.ts +6 -6
  32. package/dist/components/FormComponents/FormTextField/FormTextField.styles.d.ts +5 -5
  33. package/dist/components/FormComponents/HelperText/HelperText.d.ts +3 -3
  34. package/dist/components/FormComponents/PasswordField/PasswordField.d.ts +6 -6
  35. package/dist/components/FormComponents/RichTextEditor/RichTextEditor.d.ts +5 -5
  36. package/dist/components/FormComponents/RichTextEditor/RichTextEditorWrapper.d.ts +6 -6
  37. package/dist/components/FormComponents/RichTextEditor/jodit.index.d.ts +17 -17
  38. package/dist/components/FormComponents/Select/MultiSelect.d.ts +2 -2
  39. package/dist/components/FormComponents/Select/MultiSelectv1.d.ts +5 -5
  40. package/dist/components/FormComponents/Select/SingleSelect.d.ts +6 -6
  41. package/dist/components/FormComponents/Select/SingleSelectNonAutoComplete.d.ts +6 -6
  42. package/dist/components/FormComponents/Select/SingleSelectSearchApi.d.ts +2 -2
  43. package/dist/components/FormComponents/TimePicker/TimePicker.d.ts +5 -5
  44. package/dist/components/FormComponents/YearPickerField/YearPickerField.d.ts +2 -2
  45. package/dist/components/Global.styles.d.ts +34 -35
  46. package/dist/components/ModalField/ConfirmationDialog.d.ts +11 -11
  47. package/dist/components/ModalField/ModalField.d.ts +17 -18
  48. package/dist/components/SelectField/MultiSelectFieldComponent.d.ts +11 -11
  49. package/dist/components/SessionTimeOut/SessionTimeOut.d.ts +10 -10
  50. package/dist/components/SessionTimeOut/SessionTimeOut.stories.d.ts +5 -4
  51. package/dist/components/TimePickerField/TimePickerField.d.ts +1 -1
  52. package/dist/components/index.d.ts +10 -10
  53. package/dist/index.d.ts +36 -22
  54. package/dist/index.esm.js +37 -1574
  55. package/dist/index.js +34 -1617
  56. package/dist/material-ui.css +1 -0
  57. package/dist/material-ui.d.ts +2 -0
  58. package/dist/material-ui.esm.css +1 -0
  59. package/dist/material-ui.esm.js +3 -0
  60. package/dist/material-ui.js +20 -0
  61. package/dist/mui-x-date-datepicker.d.ts +1 -0
  62. package/dist/redux-toolkit.d.ts +1 -0
  63. package/dist/reportWebVitals.d.ts +3 -3
  64. package/dist/setupTests.d.ts +1 -1
  65. package/dist/styles/theme.d.ts +9 -9
  66. package/dist/tanstack-react-query.d.ts +1 -0
  67. package/dist/theme.d.ts +10 -10
  68. package/package.json +12 -25
package/dist/index.js CHANGED
@@ -5901,10 +5901,10 @@ if (!isBrowser$3) {
5901
5901
  };
5902
5902
  }
5903
5903
 
5904
- var ThemeContext$3 = /* #__PURE__ */React__namespace.createContext({});
5904
+ var ThemeContext$2 = /* #__PURE__ */React__namespace.createContext({});
5905
5905
 
5906
- var useTheme$b = function useTheme() {
5907
- return React__namespace.useContext(ThemeContext$3);
5906
+ var useTheme$a = function useTheme() {
5907
+ return React__namespace.useContext(ThemeContext$2);
5908
5908
  };
5909
5909
 
5910
5910
  var getTheme = function getTheme(outerTheme, theme) {
@@ -5922,21 +5922,21 @@ var createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {
5922
5922
  return getTheme(outerTheme, theme);
5923
5923
  });
5924
5924
  });
5925
- var ThemeProvider$7 = function ThemeProvider(props) {
5926
- var theme = React__namespace.useContext(ThemeContext$3);
5925
+ var ThemeProvider$4 = function ThemeProvider(props) {
5926
+ var theme = React__namespace.useContext(ThemeContext$2);
5927
5927
 
5928
5928
  if (props.theme !== theme) {
5929
5929
  theme = createCacheWithTheme(theme)(props.theme);
5930
5930
  }
5931
5931
 
5932
- return /*#__PURE__*/React__namespace.createElement(ThemeContext$3.Provider, {
5932
+ return /*#__PURE__*/React__namespace.createElement(ThemeContext$2.Provider, {
5933
5933
  value: theme
5934
5934
  }, props.children);
5935
5935
  };
5936
- function withTheme$1(Component) {
5936
+ function withTheme(Component) {
5937
5937
  var componentName = Component.displayName || Component.name || 'Component';
5938
5938
  var WithTheme = /*#__PURE__*/React__namespace.forwardRef(function render(props, ref) {
5939
- var theme = React__namespace.useContext(ThemeContext$3);
5939
+ var theme = React__namespace.useContext(ThemeContext$2);
5940
5940
  return /*#__PURE__*/React__namespace.createElement(Component, _extends({
5941
5941
  theme: theme,
5942
5942
  ref: ref
@@ -6011,7 +6011,7 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
6011
6011
  className = props.className + " ";
6012
6012
  }
6013
6013
 
6014
- var serialized = serializeStyles(registeredStyles, undefined, React__namespace.useContext(ThemeContext$3));
6014
+ var serialized = serializeStyles(registeredStyles, undefined, React__namespace.useContext(ThemeContext$2));
6015
6015
 
6016
6016
  className += cache.key + "-" + serialized.name;
6017
6017
  var newProps = {};
@@ -6069,7 +6069,7 @@ var jsx = function jsx(type, props) {
6069
6069
  var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
6070
6070
 
6071
6071
  var styles = props.styles;
6072
- var serialized = serializeStyles([styles], undefined, React__namespace.useContext(ThemeContext$3));
6072
+ var serialized = serializeStyles([styles], undefined, React__namespace.useContext(ThemeContext$2));
6073
6073
 
6074
6074
  if (!isBrowser$3) {
6075
6075
  var _ref;
@@ -6306,7 +6306,7 @@ var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
6306
6306
  var content = {
6307
6307
  css: css,
6308
6308
  cx: cx,
6309
- theme: React__namespace.useContext(ThemeContext$3)
6309
+ theme: React__namespace.useContext(ThemeContext$2)
6310
6310
  };
6311
6311
  var ele = props.children(content);
6312
6312
  hasRendered = true;
@@ -6321,16 +6321,16 @@ var emotionReact_esm = /*#__PURE__*/Object.freeze({
6321
6321
  CacheProvider: CacheProvider,
6322
6322
  ClassNames: ClassNames,
6323
6323
  Global: Global,
6324
- ThemeContext: ThemeContext$3,
6325
- ThemeProvider: ThemeProvider$7,
6324
+ ThemeContext: ThemeContext$2,
6325
+ ThemeProvider: ThemeProvider$4,
6326
6326
  __unsafe_useEmotionCache: __unsafe_useEmotionCache,
6327
6327
  get createElement () { return jsx; },
6328
6328
  css: css$2,
6329
6329
  get jsx () { return jsx; },
6330
6330
  keyframes: keyframes,
6331
- useTheme: useTheme$b,
6331
+ useTheme: useTheme$a,
6332
6332
  get withEmotionCache () { return withEmotionCache; },
6333
- withTheme: withTheme$1
6333
+ withTheme: withTheme
6334
6334
  });
6335
6335
 
6336
6336
  // eslint-disable-next-line no-undef
@@ -6460,7 +6460,7 @@ var createStyled$3 = function createStyled(tag, options) {
6460
6460
  mergedProps[key] = props[key];
6461
6461
  }
6462
6462
 
6463
- mergedProps.theme = React__namespace.useContext(ThemeContext$3);
6463
+ mergedProps.theme = React__namespace.useContext(ThemeContext$2);
6464
6464
  }
6465
6465
 
6466
6466
  if (typeof props.className === 'string') {
@@ -7717,110 +7717,6 @@ if (process.env.NODE_ENV !== 'production') {
7717
7717
  var propTypesExports = propTypes.exports;
7718
7718
  var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
7719
7719
 
7720
- const cacheMap = new Map();
7721
-
7722
- // We might be able to remove this when this issue is fixed:
7723
- // https://github.com/emotion-js/emotion/issues/2790
7724
- const createEmotionCache = (options, CustomSheet) => {
7725
- const cache = createCache(options);
7726
-
7727
- // Do the same as https://github.com/emotion-js/emotion/blob/main/packages/cache/src/index.js#L238-L245
7728
- cache.sheet = new CustomSheet({
7729
- key: cache.key,
7730
- nonce: cache.sheet.nonce,
7731
- container: cache.sheet.container,
7732
- speedy: cache.sheet.isSpeedy,
7733
- prepend: cache.sheet.prepend,
7734
- insertionPoint: cache.sheet.insertionPoint
7735
- });
7736
- return cache;
7737
- };
7738
- let insertionPoint;
7739
- if (typeof document === 'object') {
7740
- // Use `insertionPoint` over `prepend`(deprecated) because it can be controlled for GlobalStyles injection order
7741
- // For more information, see https://github.com/mui/material-ui/issues/44597
7742
- insertionPoint = document.querySelector('[name="emotion-insertion-point"]');
7743
- if (!insertionPoint) {
7744
- insertionPoint = document.createElement('meta');
7745
- insertionPoint.setAttribute('name', 'emotion-insertion-point');
7746
- insertionPoint.setAttribute('content', '');
7747
- const head = document.querySelector('head');
7748
- if (head) {
7749
- head.prepend(insertionPoint);
7750
- }
7751
- }
7752
- }
7753
- function getCache$1(injectFirst, enableCssLayer) {
7754
- if (injectFirst || enableCssLayer) {
7755
- /**
7756
- * This is for client-side apps only.
7757
- * A custom sheet is required to make the GlobalStyles API injected above the insertion point.
7758
- * This is because the [sheet](https://github.com/emotion-js/emotion/blob/main/packages/react/src/global.js#L94-L99) does not consume the options.
7759
- */
7760
- class MyStyleSheet extends StyleSheet$1 {
7761
- insert(rule, options) {
7762
- if (this.key && this.key.endsWith('global')) {
7763
- this.before = insertionPoint;
7764
- }
7765
- return super.insert(rule, options);
7766
- }
7767
- }
7768
- const emotionCache = createEmotionCache({
7769
- key: 'css',
7770
- insertionPoint: injectFirst ? insertionPoint : undefined
7771
- }, MyStyleSheet);
7772
- if (enableCssLayer) {
7773
- const prevInsert = emotionCache.insert;
7774
- emotionCache.insert = (...args) => {
7775
- if (!args[1].styles.match(/^@layer\s+[^{]*$/)) {
7776
- // avoid nested @layer
7777
- args[1].styles = `@layer mui {${args[1].styles}}`;
7778
- }
7779
- return prevInsert(...args);
7780
- };
7781
- }
7782
- return emotionCache;
7783
- }
7784
- return undefined;
7785
- }
7786
- function StyledEngineProvider$2(props) {
7787
- const {
7788
- injectFirst,
7789
- enableCssLayer,
7790
- children
7791
- } = props;
7792
- const cache = React__namespace.useMemo(() => {
7793
- const cacheKey = `${injectFirst}-${enableCssLayer}`;
7794
- if (typeof document === 'object' && cacheMap.has(cacheKey)) {
7795
- return cacheMap.get(cacheKey);
7796
- }
7797
- const fresh = getCache$1(injectFirst, enableCssLayer);
7798
- cacheMap.set(cacheKey, fresh);
7799
- return fresh;
7800
- }, [injectFirst, enableCssLayer]);
7801
- return cache ? /*#__PURE__*/jsxRuntimeExports.jsx(CacheProvider, {
7802
- value: cache,
7803
- children: children
7804
- }) : children;
7805
- }
7806
- process.env.NODE_ENV !== "production" ? StyledEngineProvider$2.propTypes = {
7807
- /**
7808
- * Your component tree.
7809
- */
7810
- children: PropTypes.node,
7811
- /**
7812
- * If `true`, the styles are wrapped in `@layer mui`.
7813
- * Learn more about [Cascade layers](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Cascade_layers).
7814
- */
7815
- enableCssLayer: PropTypes.bool,
7816
- /**
7817
- * By default, the styles are injected last in the <head> element of the page.
7818
- * As a result, they gain more specificity than any other style sheet.
7819
- * If you want to override MUI's styles, set this prop.
7820
- */
7821
- injectFirst: PropTypes.bool
7822
- } : void 0;
7823
-
7824
7720
  function isEmpty$3(obj) {
7825
7721
  return obj === undefined || obj === null || Object.keys(obj).length === 0;
7826
7722
  }
@@ -9565,14 +9461,14 @@ function createTheme$4(options = {}, ...args) {
9565
9461
  function isObjectEmpty$2(obj) {
9566
9462
  return Object.keys(obj).length === 0;
9567
9463
  }
9568
- function useTheme$a(defaultTheme = null) {
9569
- const contextTheme = React__namespace.useContext(ThemeContext$3);
9464
+ function useTheme$9(defaultTheme = null) {
9465
+ const contextTheme = React__namespace.useContext(ThemeContext$2);
9570
9466
  return !contextTheme || isObjectEmpty$2(contextTheme) ? defaultTheme : contextTheme;
9571
9467
  }
9572
9468
 
9573
9469
  const systemDefaultTheme$1 = createTheme$4();
9574
- function useTheme$9(defaultTheme = systemDefaultTheme$1) {
9575
- return useTheme$a(defaultTheme);
9470
+ function useTheme$8(defaultTheme = systemDefaultTheme$1) {
9471
+ return useTheme$9(defaultTheme);
9576
9472
  }
9577
9473
 
9578
9474
  function wrapGlobalLayer(styles) {
@@ -9591,7 +9487,7 @@ function GlobalStyles$7({
9591
9487
  themeId,
9592
9488
  defaultTheme = {}
9593
9489
  }) {
9594
- const upperTheme = useTheme$9(defaultTheme);
9490
+ const upperTheme = useTheme$8(defaultTheme);
9595
9491
  const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
9596
9492
  let globalStyles = typeof styles === 'function' ? styles(resolvedTheme) : styles;
9597
9493
  if (resolvedTheme.modularCssLayers) {
@@ -9709,7 +9605,7 @@ function createBox$2(options = {}) {
9709
9605
  shouldForwardProp: prop => prop !== 'theme' && prop !== 'sx' && prop !== 'as'
9710
9606
  })(styleFunctionSx$2);
9711
9607
  const Box = /*#__PURE__*/React__namespace.forwardRef(function Box(inProps, ref) {
9712
- const theme = useTheme$9(defaultTheme);
9608
+ const theme = useTheme$8(defaultTheme);
9713
9609
  const {
9714
9610
  className,
9715
9611
  component = 'div',
@@ -10164,7 +10060,7 @@ function useThemeProps$3({
10164
10060
  defaultTheme,
10165
10061
  themeId
10166
10062
  }) {
10167
- let theme = useTheme$9(defaultTheme);
10063
+ let theme = useTheme$8(defaultTheme);
10168
10064
  if (themeId) {
10169
10065
  theme = theme[themeId] || theme;
10170
10066
  }
@@ -10216,10 +10112,10 @@ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSs
10216
10112
  }
10217
10113
 
10218
10114
  // See https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379 for why
10219
- const safeReact$2 = {
10115
+ const safeReact$1 = {
10220
10116
  ...React__namespace
10221
10117
  };
10222
- const maybeReactUseSyncExternalStore = safeReact$2.useSyncExternalStore;
10118
+ const maybeReactUseSyncExternalStore = safeReact$1.useSyncExternalStore;
10223
10119
  function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
10224
10120
  const getDefaultSnapshot = React__namespace.useCallback(() => defaultMatches, [defaultMatches]);
10225
10121
  const getServerSnapshot = React__namespace.useMemo(() => {
@@ -10256,7 +10152,7 @@ function unstable_createUseMediaQuery(params = {}) {
10256
10152
  themeId
10257
10153
  } = params;
10258
10154
  return function useMediaQuery(queryInput, options = {}) {
10259
- let theme = useTheme$a();
10155
+ let theme = useTheme$9();
10260
10156
  if (theme && themeId) {
10261
10157
  theme = theme[themeId] || theme;
10262
10158
  }
@@ -10327,10 +10223,6 @@ function hexToRgb(color) {
10327
10223
  return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;
10328
10224
  }).join(', ')})` : '';
10329
10225
  }
10330
- function intToHex(int) {
10331
- const hex = int.toString(16);
10332
- return hex.length === 1 ? `0${hex}` : hex;
10333
- }
10334
10226
 
10335
10227
  /**
10336
10228
  * Returns an object with the type and values of a color.
@@ -10423,22 +10315,6 @@ function recomposeColor(color) {
10423
10315
  return `${type}(${values})`;
10424
10316
  }
10425
10317
 
10426
- /**
10427
- * Converts a color from CSS rgb format to CSS hex format.
10428
- * @param {string} color - RGB color, i.e. rgb(n, n, n)
10429
- * @returns {string} A CSS rgb color string, i.e. #nnnnnn
10430
- */
10431
- function rgbToHex(color) {
10432
- // Idempotent
10433
- if (color.startsWith('#')) {
10434
- return color;
10435
- }
10436
- const {
10437
- values
10438
- } = decomposeColor(color);
10439
- return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;
10440
- }
10441
-
10442
10318
  /**
10443
10319
  * Converts a color from hsl format to rgb format.
10444
10320
  * @param {string} color - HSL color values
@@ -10606,108 +10482,8 @@ function private_safeEmphasize(color, coefficient, warning) {
10606
10482
  }
10607
10483
  }
10608
10484
 
10609
- // This module is based on https://github.com/airbnb/prop-types-exact repository.
10610
- // However, in order to reduce the number of dependencies and to remove some extra safe checks
10611
- // the module was forked.
10612
-
10613
- const specialProperty$2 = 'exact-prop: \u200b';
10614
- function exactProp$4(propTypes) {
10615
- if (process.env.NODE_ENV === 'production') {
10616
- return propTypes;
10617
- }
10618
- return {
10619
- ...propTypes,
10620
- [specialProperty$2]: props => {
10621
- const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));
10622
- if (unsupportedProps.length > 0) {
10623
- return new Error(`The following props are not supported: ${unsupportedProps.map(prop => `\`${prop}\``).join(', ')}. Please remove them.`);
10624
- }
10625
- return null;
10626
- }
10627
- };
10628
- }
10629
-
10630
- const ThemeContext$2 = /*#__PURE__*/React__namespace.createContext(null);
10631
- if (process.env.NODE_ENV !== 'production') {
10632
- ThemeContext$2.displayName = 'ThemeContext';
10633
- }
10634
-
10635
- function useTheme$8() {
10636
- const theme = React__namespace.useContext(ThemeContext$2);
10637
- if (process.env.NODE_ENV !== 'production') {
10638
- // TODO: uncomment once we enable eslint-plugin-react-compiler eslint-disable-next-line react-compiler/react-compiler
10639
- // eslint-disable-next-line react-hooks/rules-of-hooks -- It's not required to run React.useDebugValue in production
10640
- React__namespace.useDebugValue(theme);
10641
- }
10642
- return theme;
10643
- }
10644
-
10645
- const hasSymbol$1 = typeof Symbol === 'function' && Symbol.for;
10646
- var nested$2 = hasSymbol$1 ? Symbol.for('mui.nested') : '__THEME_NESTED__';
10647
-
10648
- function mergeOuterLocalTheme(outerTheme, localTheme) {
10649
- if (typeof localTheme === 'function') {
10650
- const mergedTheme = localTheme(outerTheme);
10651
- if (process.env.NODE_ENV !== 'production') ;
10652
- return mergedTheme;
10653
- }
10654
- return {
10655
- ...outerTheme,
10656
- ...localTheme
10657
- };
10658
- }
10659
-
10660
- /**
10661
- * This component takes a `theme` prop.
10662
- * It makes the `theme` available down the React tree thanks to React context.
10663
- * This component should preferably be used at **the root of your component tree**.
10664
- */
10665
- function ThemeProvider$6(props) {
10666
- const {
10667
- children,
10668
- theme: localTheme
10669
- } = props;
10670
- const outerTheme = useTheme$8();
10671
- if (process.env.NODE_ENV !== 'production') ;
10672
- const theme = React__namespace.useMemo(() => {
10673
- const output = outerTheme === null ? {
10674
- ...localTheme
10675
- } : mergeOuterLocalTheme(outerTheme, localTheme);
10676
- if (output != null) {
10677
- output[nested$2] = outerTheme !== null;
10678
- }
10679
- return output;
10680
- }, [localTheme, outerTheme]);
10681
- return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext$2.Provider, {
10682
- value: theme,
10683
- children: children
10684
- });
10685
- }
10686
- process.env.NODE_ENV !== "production" ? ThemeProvider$6.propTypes = {
10687
- /**
10688
- * Your component tree.
10689
- */
10690
- children: PropTypes.node,
10691
- /**
10692
- * A theme object. You can provide a function to extend the outer theme.
10693
- */
10694
- theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired
10695
- } : void 0;
10696
- if (process.env.NODE_ENV !== 'production') {
10697
- process.env.NODE_ENV !== "production" ? ThemeProvider$6.propTypes = exactProp$4(ThemeProvider$6.propTypes) : void 0;
10698
- }
10699
-
10700
10485
  const RtlContext = /*#__PURE__*/React__namespace.createContext();
10701
- function RtlProvider$1({
10702
- value,
10703
- ...props
10704
- }) {
10705
- return /*#__PURE__*/jsxRuntimeExports.jsx(RtlContext.Provider, {
10706
- value: value ?? true,
10707
- ...props
10708
- });
10709
- }
10710
- process.env.NODE_ENV !== "production" ? RtlProvider$1.propTypes = {
10486
+ process.env.NODE_ENV !== "production" ? {
10711
10487
  children: PropTypes.node,
10712
10488
  value: PropTypes.bool
10713
10489
  } : void 0;
@@ -10717,16 +10493,7 @@ const useRtl = () => {
10717
10493
  };
10718
10494
 
10719
10495
  const PropsContext = /*#__PURE__*/React__namespace.createContext(undefined);
10720
- function DefaultPropsProvider$4({
10721
- value,
10722
- children
10723
- }) {
10724
- return /*#__PURE__*/jsxRuntimeExports.jsx(PropsContext.Provider, {
10725
- value: value,
10726
- children: children
10727
- });
10728
- }
10729
- process.env.NODE_ENV !== "production" ? DefaultPropsProvider$4.propTypes /* remove-proptypes */ = {
10496
+ process.env.NODE_ENV !== "production" ? {
10730
10497
  // ┌────────────────────────────── Warning ──────────────────────────────┐
10731
10498
  // │ These PropTypes are generated from the TypeScript type definitions. │
10732
10499
  // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
@@ -10774,176 +10541,6 @@ function useDefaultProps$1({
10774
10541
  });
10775
10542
  }
10776
10543
 
10777
- let globalId$2 = 0;
10778
-
10779
- // TODO React 17: Remove `useGlobalId` once React 17 support is removed
10780
- function useGlobalId$2(idOverride) {
10781
- const [defaultId, setDefaultId] = React__namespace.useState(idOverride);
10782
- const id = idOverride || defaultId;
10783
- React__namespace.useEffect(() => {
10784
- if (defaultId == null) {
10785
- // Fallback to this default id when possible.
10786
- // Use the incrementing value for client-side rendering only.
10787
- // We can't use it server-side.
10788
- // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
10789
- globalId$2 += 1;
10790
- setDefaultId(`mui-${globalId$2}`);
10791
- }
10792
- }, [defaultId]);
10793
- return id;
10794
- }
10795
-
10796
- // See https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379 for why
10797
- const safeReact$1 = {
10798
- ...React__namespace
10799
- };
10800
- const maybeReactUseId$2 = safeReact$1.useId;
10801
-
10802
- /**
10803
- *
10804
- * @example <div id={useId()} />
10805
- * @param idOverride
10806
- * @returns {string}
10807
- */
10808
- function useId$8(idOverride) {
10809
- // React.useId() is only available from React 17.0.0.
10810
- if (maybeReactUseId$2 !== undefined) {
10811
- const reactId = maybeReactUseId$2();
10812
- return reactId;
10813
- }
10814
-
10815
- // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
10816
- // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.
10817
- return useGlobalId$2(idOverride);
10818
- }
10819
-
10820
- function useLayerOrder$1(theme) {
10821
- const upperTheme = useTheme$a();
10822
- const id = useId$8() || '';
10823
- const {
10824
- modularCssLayers
10825
- } = theme;
10826
- let layerOrder = 'mui.global, mui.components, mui.theme, mui.custom, mui.sx';
10827
- if (!modularCssLayers || upperTheme !== null) {
10828
- // skip this hook if upper theme exists.
10829
- layerOrder = '';
10830
- } else if (typeof modularCssLayers === 'string') {
10831
- layerOrder = modularCssLayers.replace(/mui(?!\.)/g, layerOrder);
10832
- } else {
10833
- layerOrder = `@layer ${layerOrder};`;
10834
- }
10835
- useEnhancedEffect$7(() => {
10836
- const head = document.querySelector('head');
10837
- if (!head) {
10838
- return;
10839
- }
10840
- const firstChild = head.firstChild;
10841
- if (layerOrder) {
10842
- // Only insert if first child doesn't have data-mui-layer-order attribute
10843
- if (firstChild && firstChild.hasAttribute?.('data-mui-layer-order') && firstChild.getAttribute('data-mui-layer-order') === id) {
10844
- return;
10845
- }
10846
- const styleElement = document.createElement('style');
10847
- styleElement.setAttribute('data-mui-layer-order', id);
10848
- styleElement.textContent = layerOrder;
10849
- head.prepend(styleElement);
10850
- } else {
10851
- head.querySelector(`style[data-mui-layer-order="${id}"]`)?.remove();
10852
- }
10853
- }, [layerOrder, id]);
10854
- if (!layerOrder) {
10855
- return null;
10856
- }
10857
- return /*#__PURE__*/jsxRuntimeExports.jsx(GlobalStyles$7, {
10858
- styles: layerOrder
10859
- });
10860
- }
10861
-
10862
- const EMPTY_THEME = {};
10863
- function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
10864
- return React__namespace.useMemo(() => {
10865
- const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
10866
- if (typeof localTheme === 'function') {
10867
- const mergedTheme = localTheme(resolvedTheme);
10868
- const result = themeId ? {
10869
- ...upperTheme,
10870
- [themeId]: mergedTheme
10871
- } : mergedTheme;
10872
- // must return a function for the private theme to NOT merge with the upper theme.
10873
- // see the test case "use provided theme from a callback" in ThemeProvider.test.js
10874
- if (isPrivate) {
10875
- return () => result;
10876
- }
10877
- return result;
10878
- }
10879
- return themeId ? {
10880
- ...upperTheme,
10881
- [themeId]: localTheme
10882
- } : {
10883
- ...upperTheme,
10884
- ...localTheme
10885
- };
10886
- }, [themeId, upperTheme, localTheme, isPrivate]);
10887
- }
10888
-
10889
- /**
10890
- * This component makes the `theme` available down the React tree.
10891
- * It should preferably be used at **the root of your component tree**.
10892
- *
10893
- * <ThemeProvider theme={theme}> // existing use case
10894
- * <ThemeProvider theme={{ id: theme }}> // theme scoping
10895
- */
10896
- function ThemeProvider$5(props) {
10897
- const {
10898
- children,
10899
- theme: localTheme,
10900
- themeId
10901
- } = props;
10902
- const upperTheme = useTheme$a(EMPTY_THEME);
10903
- const upperPrivateTheme = useTheme$8() || EMPTY_THEME;
10904
- if (process.env.NODE_ENV !== 'production') {
10905
- if (upperTheme === null && typeof localTheme === 'function' || themeId && upperTheme && !upperTheme[themeId] && typeof localTheme === 'function') ;
10906
- }
10907
- const engineTheme = useThemeScoping(themeId, upperTheme, localTheme);
10908
- const privateTheme = useThemeScoping(themeId, upperPrivateTheme, localTheme, true);
10909
- const rtlValue = (themeId ? engineTheme[themeId] : engineTheme).direction === 'rtl';
10910
- const layerOrder = useLayerOrder$1(engineTheme);
10911
- return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$6, {
10912
- theme: privateTheme,
10913
- children: /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext$3.Provider, {
10914
- value: engineTheme,
10915
- children: /*#__PURE__*/jsxRuntimeExports.jsx(RtlProvider$1, {
10916
- value: rtlValue,
10917
- children: /*#__PURE__*/jsxRuntimeExports.jsxs(DefaultPropsProvider$4, {
10918
- value: themeId ? engineTheme[themeId].components : engineTheme.components,
10919
- children: [layerOrder, children]
10920
- })
10921
- })
10922
- })
10923
- });
10924
- }
10925
- process.env.NODE_ENV !== "production" ? ThemeProvider$5.propTypes /* remove-proptypes */ = {
10926
- // ┌────────────────────────────── Warning ──────────────────────────────┐
10927
- // │ These PropTypes are generated from the TypeScript type definitions. │
10928
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
10929
- // └─────────────────────────────────────────────────────────────────────┘
10930
- /**
10931
- * Your component tree.
10932
- */
10933
- children: PropTypes.node,
10934
- /**
10935
- * A theme object. You can provide a function to extend the outer theme.
10936
- */
10937
- theme: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired,
10938
- /**
10939
- * The design system's unique id for getting the corresponded theme when there are multiple design systems.
10940
- */
10941
- themeId: PropTypes.string
10942
- } : void 0;
10943
- if (process.env.NODE_ENV !== 'production') {
10944
- process.env.NODE_ENV !== "production" ? ThemeProvider$5.propTypes = exactProp$4(ThemeProvider$5.propTypes) : void 0;
10945
- }
10946
-
10947
10544
  /* eslint-disable @typescript-eslint/naming-convention */
10948
10545
 
10949
10546
  // We need to pass an argument as `{ theme }` for PigmentCSS, but we don't want to
@@ -10971,676 +10568,6 @@ function unstable_memoTheme(styleFn) {
10971
10568
  };
10972
10569
  }
10973
10570
 
10974
- /**
10975
- * Split this component for RSC import
10976
- */
10977
- const DEFAULT_MODE_STORAGE_KEY = 'mode';
10978
- const DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';
10979
- const DEFAULT_ATTRIBUTE = 'data-color-scheme';
10980
- function InitColorSchemeScript$1(options) {
10981
- const {
10982
- defaultMode = 'system',
10983
- defaultLightColorScheme = 'light',
10984
- defaultDarkColorScheme = 'dark',
10985
- modeStorageKey = DEFAULT_MODE_STORAGE_KEY,
10986
- colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,
10987
- attribute: initialAttribute = DEFAULT_ATTRIBUTE,
10988
- colorSchemeNode = 'document.documentElement',
10989
- nonce
10990
- } = options || {};
10991
- let setter = '';
10992
- let attribute = initialAttribute;
10993
- if (initialAttribute === 'class') {
10994
- attribute = '.%s';
10995
- }
10996
- if (initialAttribute === 'data') {
10997
- attribute = '[data-%s]';
10998
- }
10999
- if (attribute.startsWith('.')) {
11000
- const selector = attribute.substring(1);
11001
- setter += `${colorSchemeNode}.classList.remove('${selector}'.replace('%s', light), '${selector}'.replace('%s', dark));
11002
- ${colorSchemeNode}.classList.add('${selector}'.replace('%s', colorScheme));`;
11003
- }
11004
- const matches = attribute.match(/\[([^\]]+)\]/); // case [data-color-scheme='%s'] or [data-color-scheme]
11005
- if (matches) {
11006
- const [attr, value] = matches[1].split('=');
11007
- if (!value) {
11008
- setter += `${colorSchemeNode}.removeAttribute('${attr}'.replace('%s', light));
11009
- ${colorSchemeNode}.removeAttribute('${attr}'.replace('%s', dark));`;
11010
- }
11011
- setter += `
11012
- ${colorSchemeNode}.setAttribute('${attr}'.replace('%s', colorScheme), ${value ? `${value}.replace('%s', colorScheme)` : '""'});`;
11013
- } else {
11014
- setter += `${colorSchemeNode}.setAttribute('${attribute}', colorScheme);`;
11015
- }
11016
- return /*#__PURE__*/jsxRuntimeExports.jsx("script", {
11017
- suppressHydrationWarning: true,
11018
- nonce: typeof window === 'undefined' ? nonce : ''
11019
- // eslint-disable-next-line react/no-danger
11020
- ,
11021
- dangerouslySetInnerHTML: {
11022
- __html: `(function() {
11023
- try {
11024
- let colorScheme = '';
11025
- const mode = localStorage.getItem('${modeStorageKey}') || '${defaultMode}';
11026
- const dark = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
11027
- const light = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
11028
- if (mode === 'system') {
11029
- // handle system mode
11030
- const mql = window.matchMedia('(prefers-color-scheme: dark)');
11031
- if (mql.matches) {
11032
- colorScheme = dark
11033
- } else {
11034
- colorScheme = light
11035
- }
11036
- }
11037
- if (mode === 'light') {
11038
- colorScheme = light;
11039
- }
11040
- if (mode === 'dark') {
11041
- colorScheme = dark;
11042
- }
11043
- if (colorScheme) {
11044
- ${setter}
11045
- }
11046
- } catch(e){}})();`
11047
- }
11048
- }, "mui-color-scheme-init");
11049
- }
11050
-
11051
- function noop$6() {}
11052
- const localStorageManager$1 = ({
11053
- key,
11054
- storageWindow
11055
- }) => {
11056
- if (!storageWindow && typeof window !== 'undefined') {
11057
- storageWindow = window;
11058
- }
11059
- return {
11060
- get(defaultValue) {
11061
- if (typeof window === 'undefined') {
11062
- return undefined;
11063
- }
11064
- if (!storageWindow) {
11065
- return defaultValue;
11066
- }
11067
- let value;
11068
- try {
11069
- value = storageWindow.localStorage.getItem(key);
11070
- } catch {
11071
- // Unsupported
11072
- }
11073
- return value || defaultValue;
11074
- },
11075
- set: value => {
11076
- if (storageWindow) {
11077
- try {
11078
- storageWindow.localStorage.setItem(key, value);
11079
- } catch {
11080
- // Unsupported
11081
- }
11082
- }
11083
- },
11084
- subscribe: handler => {
11085
- if (!storageWindow) {
11086
- return noop$6;
11087
- }
11088
- const listener = event => {
11089
- const value = event.newValue;
11090
- if (event.key === key) {
11091
- handler(value);
11092
- }
11093
- };
11094
- storageWindow.addEventListener('storage', listener);
11095
- return () => {
11096
- storageWindow.removeEventListener('storage', listener);
11097
- };
11098
- }
11099
- };
11100
- };
11101
-
11102
- function noop$5() {}
11103
- function getSystemMode(mode) {
11104
- if (typeof window !== 'undefined' && typeof window.matchMedia === 'function' && mode === 'system') {
11105
- const mql = window.matchMedia('(prefers-color-scheme: dark)');
11106
- if (mql.matches) {
11107
- return 'dark';
11108
- }
11109
- return 'light';
11110
- }
11111
- return undefined;
11112
- }
11113
- function processState(state, callback) {
11114
- if (state.mode === 'light' || state.mode === 'system' && state.systemMode === 'light') {
11115
- return callback('light');
11116
- }
11117
- if (state.mode === 'dark' || state.mode === 'system' && state.systemMode === 'dark') {
11118
- return callback('dark');
11119
- }
11120
- return undefined;
11121
- }
11122
- function getColorScheme(state) {
11123
- return processState(state, mode => {
11124
- if (mode === 'light') {
11125
- return state.lightColorScheme;
11126
- }
11127
- if (mode === 'dark') {
11128
- return state.darkColorScheme;
11129
- }
11130
- return undefined;
11131
- });
11132
- }
11133
- function useCurrentColorScheme$1(options) {
11134
- const {
11135
- defaultMode = 'light',
11136
- defaultLightColorScheme,
11137
- defaultDarkColorScheme,
11138
- supportedColorSchemes = [],
11139
- modeStorageKey = DEFAULT_MODE_STORAGE_KEY,
11140
- colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,
11141
- storageWindow = typeof window === 'undefined' ? undefined : window,
11142
- storageManager = localStorageManager$1,
11143
- noSsr = false
11144
- } = options;
11145
- const joinedColorSchemes = supportedColorSchemes.join(',');
11146
- const isMultiSchemes = supportedColorSchemes.length > 1;
11147
- const modeStorage = React__namespace.useMemo(() => storageManager?.({
11148
- key: modeStorageKey,
11149
- storageWindow
11150
- }), [storageManager, modeStorageKey, storageWindow]);
11151
- const lightStorage = React__namespace.useMemo(() => storageManager?.({
11152
- key: `${colorSchemeStorageKey}-light`,
11153
- storageWindow
11154
- }), [storageManager, colorSchemeStorageKey, storageWindow]);
11155
- const darkStorage = React__namespace.useMemo(() => storageManager?.({
11156
- key: `${colorSchemeStorageKey}-dark`,
11157
- storageWindow
11158
- }), [storageManager, colorSchemeStorageKey, storageWindow]);
11159
- const [state, setState] = React__namespace.useState(() => {
11160
- const initialMode = modeStorage?.get(defaultMode) || defaultMode;
11161
- const lightColorScheme = lightStorage?.get(defaultLightColorScheme) || defaultLightColorScheme;
11162
- const darkColorScheme = darkStorage?.get(defaultDarkColorScheme) || defaultDarkColorScheme;
11163
- return {
11164
- mode: initialMode,
11165
- systemMode: getSystemMode(initialMode),
11166
- lightColorScheme,
11167
- darkColorScheme
11168
- };
11169
- });
11170
- const [isClient, setIsClient] = React__namespace.useState(noSsr || !isMultiSchemes);
11171
- React__namespace.useEffect(() => {
11172
- setIsClient(true); // to rerender the component after hydration
11173
- }, []);
11174
- const colorScheme = getColorScheme(state);
11175
- const setMode = React__namespace.useCallback(mode => {
11176
- setState(currentState => {
11177
- if (mode === currentState.mode) {
11178
- // do nothing if mode does not change
11179
- return currentState;
11180
- }
11181
- const newMode = mode ?? defaultMode;
11182
- modeStorage?.set(newMode);
11183
- return {
11184
- ...currentState,
11185
- mode: newMode,
11186
- systemMode: getSystemMode(newMode)
11187
- };
11188
- });
11189
- }, [modeStorage, defaultMode]);
11190
- const setColorScheme = React__namespace.useCallback(value => {
11191
- if (!value) {
11192
- setState(currentState => {
11193
- lightStorage?.set(defaultLightColorScheme);
11194
- darkStorage?.set(defaultDarkColorScheme);
11195
- return {
11196
- ...currentState,
11197
- lightColorScheme: defaultLightColorScheme,
11198
- darkColorScheme: defaultDarkColorScheme
11199
- };
11200
- });
11201
- } else if (typeof value === 'string') {
11202
- if (value && !joinedColorSchemes.includes(value)) ; else {
11203
- setState(currentState => {
11204
- const newState = {
11205
- ...currentState
11206
- };
11207
- processState(currentState, mode => {
11208
- if (mode === 'light') {
11209
- lightStorage?.set(value);
11210
- newState.lightColorScheme = value;
11211
- }
11212
- if (mode === 'dark') {
11213
- darkStorage?.set(value);
11214
- newState.darkColorScheme = value;
11215
- }
11216
- });
11217
- return newState;
11218
- });
11219
- }
11220
- } else {
11221
- setState(currentState => {
11222
- const newState = {
11223
- ...currentState
11224
- };
11225
- const newLightColorScheme = value.light === null ? defaultLightColorScheme : value.light;
11226
- const newDarkColorScheme = value.dark === null ? defaultDarkColorScheme : value.dark;
11227
- if (newLightColorScheme) {
11228
- if (!joinedColorSchemes.includes(newLightColorScheme)) ; else {
11229
- newState.lightColorScheme = newLightColorScheme;
11230
- lightStorage?.set(newLightColorScheme);
11231
- }
11232
- }
11233
- if (newDarkColorScheme) {
11234
- if (!joinedColorSchemes.includes(newDarkColorScheme)) ; else {
11235
- newState.darkColorScheme = newDarkColorScheme;
11236
- darkStorage?.set(newDarkColorScheme);
11237
- }
11238
- }
11239
- return newState;
11240
- });
11241
- }
11242
- }, [joinedColorSchemes, lightStorage, darkStorage, defaultLightColorScheme, defaultDarkColorScheme]);
11243
- const handleMediaQuery = React__namespace.useCallback(event => {
11244
- if (state.mode === 'system') {
11245
- setState(currentState => {
11246
- const systemMode = event?.matches ? 'dark' : 'light';
11247
-
11248
- // Early exit, nothing changed.
11249
- if (currentState.systemMode === systemMode) {
11250
- return currentState;
11251
- }
11252
- return {
11253
- ...currentState,
11254
- systemMode
11255
- };
11256
- });
11257
- }
11258
- }, [state.mode]);
11259
-
11260
- // Ref hack to avoid adding handleMediaQuery as a dep
11261
- const mediaListener = React__namespace.useRef(handleMediaQuery);
11262
- mediaListener.current = handleMediaQuery;
11263
- React__namespace.useEffect(() => {
11264
- if (typeof window.matchMedia !== 'function' || !isMultiSchemes) {
11265
- return undefined;
11266
- }
11267
- const handler = (...args) => mediaListener.current(...args);
11268
-
11269
- // Always listen to System preference
11270
- const media = window.matchMedia('(prefers-color-scheme: dark)');
11271
-
11272
- // Intentionally use deprecated listener methods to support iOS & old browsers
11273
- media.addListener(handler);
11274
- handler(media);
11275
- return () => {
11276
- media.removeListener(handler);
11277
- };
11278
- }, [isMultiSchemes]);
11279
-
11280
- // Handle when localStorage has changed
11281
- React__namespace.useEffect(() => {
11282
- if (isMultiSchemes) {
11283
- const unsubscribeMode = modeStorage?.subscribe(value => {
11284
- if (!value || ['light', 'dark', 'system'].includes(value)) {
11285
- setMode(value || defaultMode);
11286
- }
11287
- }) || noop$5;
11288
- const unsubscribeLight = lightStorage?.subscribe(value => {
11289
- if (!value || joinedColorSchemes.match(value)) {
11290
- setColorScheme({
11291
- light: value
11292
- });
11293
- }
11294
- }) || noop$5;
11295
- const unsubscribeDark = darkStorage?.subscribe(value => {
11296
- if (!value || joinedColorSchemes.match(value)) {
11297
- setColorScheme({
11298
- dark: value
11299
- });
11300
- }
11301
- }) || noop$5;
11302
- return () => {
11303
- unsubscribeMode();
11304
- unsubscribeLight();
11305
- unsubscribeDark();
11306
- };
11307
- }
11308
- return undefined;
11309
- }, [setColorScheme, setMode, joinedColorSchemes, defaultMode, storageWindow, isMultiSchemes, modeStorage, lightStorage, darkStorage]);
11310
- return {
11311
- ...state,
11312
- mode: isClient ? state.mode : undefined,
11313
- systemMode: isClient ? state.systemMode : undefined,
11314
- colorScheme: isClient ? colorScheme : undefined,
11315
- setMode,
11316
- setColorScheme
11317
- };
11318
- }
11319
-
11320
- const DISABLE_CSS_TRANSITION = '*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}';
11321
- function createCssVarsProvider$1(options) {
11322
- const {
11323
- themeId,
11324
- /**
11325
- * This `theme` object needs to follow a certain structure to
11326
- * be used correctly by the finel `CssVarsProvider`. It should have a
11327
- * `colorSchemes` key with the light and dark (and any other) palette.
11328
- * It should also ideally have a vars object created using `prepareCssVars`.
11329
- */
11330
- theme: defaultTheme = {},
11331
- modeStorageKey: defaultModeStorageKey = DEFAULT_MODE_STORAGE_KEY,
11332
- colorSchemeStorageKey: defaultColorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,
11333
- disableTransitionOnChange: designSystemTransitionOnChange = false,
11334
- defaultColorScheme,
11335
- resolveTheme
11336
- } = options;
11337
- const defaultContext = {
11338
- allColorSchemes: [],
11339
- colorScheme: undefined,
11340
- darkColorScheme: undefined,
11341
- lightColorScheme: undefined,
11342
- mode: undefined,
11343
- setColorScheme: () => {},
11344
- setMode: () => {},
11345
- systemMode: undefined
11346
- };
11347
- const ColorSchemeContext = /*#__PURE__*/React__namespace.createContext(undefined);
11348
- if (process.env.NODE_ENV !== 'production') {
11349
- ColorSchemeContext.displayName = 'ColorSchemeContext';
11350
- }
11351
- const useColorScheme = () => React__namespace.useContext(ColorSchemeContext) || defaultContext;
11352
- const defaultColorSchemes = {};
11353
- const defaultComponents = {};
11354
- function CssVarsProvider(props) {
11355
- const {
11356
- children,
11357
- theme: themeProp,
11358
- modeStorageKey = defaultModeStorageKey,
11359
- colorSchemeStorageKey = defaultColorSchemeStorageKey,
11360
- disableTransitionOnChange = designSystemTransitionOnChange,
11361
- storageManager,
11362
- storageWindow = typeof window === 'undefined' ? undefined : window,
11363
- documentNode = typeof document === 'undefined' ? undefined : document,
11364
- colorSchemeNode = typeof document === 'undefined' ? undefined : document.documentElement,
11365
- disableNestedContext = false,
11366
- disableStyleSheetGeneration = false,
11367
- defaultMode: initialMode = 'system',
11368
- forceThemeRerender = false,
11369
- noSsr
11370
- } = props;
11371
- const hasMounted = React__namespace.useRef(false);
11372
- const upperTheme = useTheme$8();
11373
- const ctx = React__namespace.useContext(ColorSchemeContext);
11374
- const nested = !!ctx && !disableNestedContext;
11375
- const initialTheme = React__namespace.useMemo(() => {
11376
- if (themeProp) {
11377
- return themeProp;
11378
- }
11379
- return typeof defaultTheme === 'function' ? defaultTheme() : defaultTheme;
11380
- }, [themeProp]);
11381
- const scopedTheme = initialTheme[themeId];
11382
- const restThemeProp = scopedTheme || initialTheme;
11383
- const {
11384
- colorSchemes = defaultColorSchemes,
11385
- components = defaultComponents,
11386
- cssVarPrefix
11387
- } = restThemeProp;
11388
- const joinedColorSchemes = Object.keys(colorSchemes).filter(k => !!colorSchemes[k]).join(',');
11389
- const allColorSchemes = React__namespace.useMemo(() => joinedColorSchemes.split(','), [joinedColorSchemes]);
11390
- const defaultLightColorScheme = typeof defaultColorScheme === 'string' ? defaultColorScheme : defaultColorScheme.light;
11391
- const defaultDarkColorScheme = typeof defaultColorScheme === 'string' ? defaultColorScheme : defaultColorScheme.dark;
11392
- const defaultMode = colorSchemes[defaultLightColorScheme] && colorSchemes[defaultDarkColorScheme] ? initialMode : colorSchemes[restThemeProp.defaultColorScheme]?.palette?.mode || restThemeProp.palette?.mode;
11393
-
11394
- // 1. Get the data about the `mode`, `colorScheme`, and setter functions.
11395
- const {
11396
- mode: stateMode,
11397
- setMode,
11398
- systemMode,
11399
- lightColorScheme,
11400
- darkColorScheme,
11401
- colorScheme: stateColorScheme,
11402
- setColorScheme
11403
- } = useCurrentColorScheme$1({
11404
- supportedColorSchemes: allColorSchemes,
11405
- defaultLightColorScheme,
11406
- defaultDarkColorScheme,
11407
- modeStorageKey,
11408
- colorSchemeStorageKey,
11409
- defaultMode,
11410
- storageManager,
11411
- storageWindow,
11412
- noSsr
11413
- });
11414
- let mode = stateMode;
11415
- let colorScheme = stateColorScheme;
11416
- if (nested) {
11417
- mode = ctx.mode;
11418
- colorScheme = ctx.colorScheme;
11419
- }
11420
- if (process.env.NODE_ENV !== 'production') {
11421
- if (forceThemeRerender && !restThemeProp.vars) ;
11422
- }
11423
-
11424
- // `colorScheme` is undefined on the server and hydration phase
11425
- let calculatedColorScheme = colorScheme || restThemeProp.defaultColorScheme;
11426
- if (restThemeProp.vars && !forceThemeRerender) {
11427
- calculatedColorScheme = restThemeProp.defaultColorScheme;
11428
- }
11429
- const memoTheme = React__namespace.useMemo(() => {
11430
- // 2. get the `vars` object that refers to the CSS custom properties
11431
- const themeVars = restThemeProp.generateThemeVars?.() || restThemeProp.vars;
11432
-
11433
- // 3. Start composing the theme object
11434
- const theme = {
11435
- ...restThemeProp,
11436
- components,
11437
- colorSchemes,
11438
- cssVarPrefix,
11439
- vars: themeVars
11440
- };
11441
- if (typeof theme.generateSpacing === 'function') {
11442
- theme.spacing = theme.generateSpacing();
11443
- }
11444
-
11445
- // 4. Resolve the color scheme and merge it to the theme
11446
- if (calculatedColorScheme) {
11447
- const scheme = colorSchemes[calculatedColorScheme];
11448
- if (scheme && typeof scheme === 'object') {
11449
- // 4.1 Merge the selected color scheme to the theme
11450
- Object.keys(scheme).forEach(schemeKey => {
11451
- if (scheme[schemeKey] && typeof scheme[schemeKey] === 'object') {
11452
- // shallow merge the 1st level structure of the theme.
11453
- theme[schemeKey] = {
11454
- ...theme[schemeKey],
11455
- ...scheme[schemeKey]
11456
- };
11457
- } else {
11458
- theme[schemeKey] = scheme[schemeKey];
11459
- }
11460
- });
11461
- }
11462
- }
11463
- return resolveTheme ? resolveTheme(theme) : theme;
11464
- }, [restThemeProp, calculatedColorScheme, components, colorSchemes, cssVarPrefix]);
11465
-
11466
- // 5. Declaring effects
11467
- // 5.1 Updates the selector value to use the current color scheme which tells CSS to use the proper stylesheet.
11468
- const colorSchemeSelector = restThemeProp.colorSchemeSelector;
11469
- useEnhancedEffect$7(() => {
11470
- if (colorScheme && colorSchemeNode && colorSchemeSelector && colorSchemeSelector !== 'media') {
11471
- const selector = colorSchemeSelector;
11472
- let rule = colorSchemeSelector;
11473
- if (selector === 'class') {
11474
- rule = `.%s`;
11475
- }
11476
- if (selector === 'data') {
11477
- rule = `[data-%s]`;
11478
- }
11479
- if (selector?.startsWith('data-') && !selector.includes('%s')) {
11480
- // 'data-mui-color-scheme' -> '[data-mui-color-scheme="%s"]'
11481
- rule = `[${selector}="%s"]`;
11482
- }
11483
- if (rule.startsWith('.')) {
11484
- colorSchemeNode.classList.remove(...allColorSchemes.map(scheme => rule.substring(1).replace('%s', scheme)));
11485
- colorSchemeNode.classList.add(rule.substring(1).replace('%s', colorScheme));
11486
- } else {
11487
- const matches = rule.replace('%s', colorScheme).match(/\[([^\]]+)\]/);
11488
- if (matches) {
11489
- const [attr, value] = matches[1].split('=');
11490
- if (!value) {
11491
- // for attributes like `data-theme-dark`, `data-theme-light`
11492
- // remove all the existing data attributes before setting the new one
11493
- allColorSchemes.forEach(scheme => {
11494
- colorSchemeNode.removeAttribute(attr.replace(colorScheme, scheme));
11495
- });
11496
- }
11497
- colorSchemeNode.setAttribute(attr, value ? value.replace(/"|'/g, '') : '');
11498
- } else {
11499
- colorSchemeNode.setAttribute(rule, colorScheme);
11500
- }
11501
- }
11502
- }
11503
- }, [colorScheme, colorSchemeSelector, colorSchemeNode, allColorSchemes]);
11504
-
11505
- // 5.2 Remove the CSS transition when color scheme changes to create instant experience.
11506
- // credit: https://github.com/pacocoursey/next-themes/blob/b5c2bad50de2d61ad7b52a9c5cdc801a78507d7a/index.tsx#L313
11507
- React__namespace.useEffect(() => {
11508
- let timer;
11509
- if (disableTransitionOnChange && hasMounted.current && documentNode) {
11510
- const css = documentNode.createElement('style');
11511
- css.appendChild(documentNode.createTextNode(DISABLE_CSS_TRANSITION));
11512
- documentNode.head.appendChild(css);
11513
-
11514
- // Force browser repaint
11515
- (() => window.getComputedStyle(documentNode.body))();
11516
- timer = setTimeout(() => {
11517
- documentNode.head.removeChild(css);
11518
- }, 1);
11519
- }
11520
- return () => {
11521
- clearTimeout(timer);
11522
- };
11523
- }, [colorScheme, disableTransitionOnChange, documentNode]);
11524
- React__namespace.useEffect(() => {
11525
- hasMounted.current = true;
11526
- return () => {
11527
- hasMounted.current = false;
11528
- };
11529
- }, []);
11530
- const contextValue = React__namespace.useMemo(() => ({
11531
- allColorSchemes,
11532
- colorScheme,
11533
- darkColorScheme,
11534
- lightColorScheme,
11535
- mode,
11536
- setColorScheme,
11537
- setMode: process.env.NODE_ENV === 'production' ? setMode : newMode => {
11538
- if (memoTheme.colorSchemeSelector === 'media') ;
11539
- setMode(newMode);
11540
- },
11541
- systemMode
11542
- }), [allColorSchemes, colorScheme, darkColorScheme, lightColorScheme, mode, setColorScheme, setMode, systemMode, memoTheme.colorSchemeSelector]);
11543
- let shouldGenerateStyleSheet = true;
11544
- if (disableStyleSheetGeneration || restThemeProp.cssVariables === false || nested && upperTheme?.cssVarPrefix === cssVarPrefix) {
11545
- shouldGenerateStyleSheet = false;
11546
- }
11547
- const element = /*#__PURE__*/jsxRuntimeExports.jsxs(React__namespace.Fragment, {
11548
- children: [/*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$5, {
11549
- themeId: scopedTheme ? themeId : undefined,
11550
- theme: memoTheme,
11551
- children: children
11552
- }), shouldGenerateStyleSheet && /*#__PURE__*/jsxRuntimeExports.jsx(GlobalStyles$8, {
11553
- styles: memoTheme.generateStyleSheets?.() || []
11554
- })]
11555
- });
11556
- if (nested) {
11557
- return element;
11558
- }
11559
- return /*#__PURE__*/jsxRuntimeExports.jsx(ColorSchemeContext.Provider, {
11560
- value: contextValue,
11561
- children: element
11562
- });
11563
- }
11564
- process.env.NODE_ENV !== "production" ? CssVarsProvider.propTypes = {
11565
- /**
11566
- * The component tree.
11567
- */
11568
- children: PropTypes.node,
11569
- /**
11570
- * The node used to attach the color-scheme attribute
11571
- */
11572
- colorSchemeNode: PropTypes.any,
11573
- /**
11574
- * localStorage key used to store `colorScheme`
11575
- */
11576
- colorSchemeStorageKey: PropTypes.string,
11577
- /**
11578
- * The default mode when the storage is empty,
11579
- * require the theme to have `colorSchemes` with light and dark.
11580
- */
11581
- defaultMode: PropTypes.string,
11582
- /**
11583
- * If `true`, the provider creates its own context and generate stylesheet as if it is a root `CssVarsProvider`.
11584
- */
11585
- disableNestedContext: PropTypes.bool,
11586
- /**
11587
- * If `true`, the style sheet won't be generated.
11588
- *
11589
- * This is useful for controlling nested CssVarsProvider behavior.
11590
- */
11591
- disableStyleSheetGeneration: PropTypes.bool,
11592
- /**
11593
- * Disable CSS transitions when switching between modes or color schemes.
11594
- */
11595
- disableTransitionOnChange: PropTypes.bool,
11596
- /**
11597
- * The document to attach the attribute to.
11598
- */
11599
- documentNode: PropTypes.any,
11600
- /**
11601
- * If `true`, theme values are recalculated when the mode changes.
11602
- */
11603
- forceThemeRerender: PropTypes.bool,
11604
- /**
11605
- * The key in the local storage used to store current color scheme.
11606
- */
11607
- modeStorageKey: PropTypes.string,
11608
- /**
11609
- * If `true`, the mode will be the same value as the storage without an extra rerendering after the hydration.
11610
- * You should use this option in conjuction with `InitColorSchemeScript` component.
11611
- */
11612
- noSsr: PropTypes.bool,
11613
- /**
11614
- * The storage manager to be used for storing the mode and color scheme
11615
- * @default using `window.localStorage`
11616
- */
11617
- storageManager: PropTypes.func,
11618
- /**
11619
- * The window that attaches the 'storage' event listener.
11620
- * @default window
11621
- */
11622
- storageWindow: PropTypes.any,
11623
- /**
11624
- * The calculated theme object that will be passed through context.
11625
- */
11626
- theme: PropTypes.object
11627
- } : void 0;
11628
- const defaultLightColorScheme = typeof defaultColorScheme === 'string' ? defaultColorScheme : defaultColorScheme.light;
11629
- const defaultDarkColorScheme = typeof defaultColorScheme === 'string' ? defaultColorScheme : defaultColorScheme.dark;
11630
- const getInitColorSchemeScript = params => InitColorSchemeScript$1({
11631
- colorSchemeStorageKey: defaultColorSchemeStorageKey,
11632
- defaultLightColorScheme,
11633
- defaultDarkColorScheme,
11634
- modeStorageKey: defaultModeStorageKey,
11635
- ...params
11636
- });
11637
- return {
11638
- CssVarsProvider,
11639
- useColorScheme,
11640
- getInitColorSchemeScript
11641
- };
11642
- }
11643
-
11644
10571
  /**
11645
10572
  * The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
11646
10573
  * and they does not need to remember the prefix (defined once).
@@ -12467,7 +11394,7 @@ function createGrid$1(options = {}) {
12467
11394
  // This will allow adding custom styled fn (for example for custom sx style function)
12468
11395
  createStyledComponent = defaultCreateStyledComponent$1,
12469
11396
  useThemeProps = useThemePropsDefault$1,
12470
- useTheme = useTheme$9,
11397
+ useTheme = useTheme$8,
12471
11398
  componentName = 'MuiGrid'
12472
11399
  } = options;
12473
11400
  const useUtilityClasses = (ownerState, theme) => {
@@ -12745,85 +11672,6 @@ function createStack$1(options = {}) {
12745
11672
  return Stack;
12746
11673
  }
12747
11674
 
12748
- function adaptV4Theme(inputTheme) {
12749
- if (process.env.NODE_ENV !== 'production') ;
12750
- const {
12751
- defaultProps = {},
12752
- mixins = {},
12753
- overrides = {},
12754
- palette = {},
12755
- props = {},
12756
- styleOverrides = {},
12757
- ...other
12758
- } = inputTheme;
12759
- const theme = {
12760
- ...other,
12761
- components: {}
12762
- };
12763
-
12764
- // default props
12765
- Object.keys(defaultProps).forEach(component => {
12766
- const componentValue = theme.components[component] || {};
12767
- componentValue.defaultProps = defaultProps[component];
12768
- theme.components[component] = componentValue;
12769
- });
12770
- Object.keys(props).forEach(component => {
12771
- const componentValue = theme.components[component] || {};
12772
- componentValue.defaultProps = props[component];
12773
- theme.components[component] = componentValue;
12774
- });
12775
-
12776
- // CSS overrides
12777
- Object.keys(styleOverrides).forEach(component => {
12778
- const componentValue = theme.components[component] || {};
12779
- componentValue.styleOverrides = styleOverrides[component];
12780
- theme.components[component] = componentValue;
12781
- });
12782
- Object.keys(overrides).forEach(component => {
12783
- const componentValue = theme.components[component] || {};
12784
- componentValue.styleOverrides = overrides[component];
12785
- theme.components[component] = componentValue;
12786
- });
12787
-
12788
- // theme.spacing
12789
- theme.spacing = createSpacing$1(inputTheme.spacing);
12790
-
12791
- // theme.mixins.gutters
12792
- const breakpoints = createBreakpoints$1(inputTheme.breakpoints || {});
12793
- const spacing = theme.spacing;
12794
- theme.mixins = {
12795
- gutters: (styles = {}) => {
12796
- return {
12797
- paddingLeft: spacing(2),
12798
- paddingRight: spacing(2),
12799
- ...styles,
12800
- [breakpoints.up('sm')]: {
12801
- paddingLeft: spacing(3),
12802
- paddingRight: spacing(3),
12803
- ...styles[breakpoints.up('sm')]
12804
- }
12805
- };
12806
- },
12807
- ...mixins
12808
- };
12809
- const {
12810
- type: typeInput,
12811
- mode: modeInput,
12812
- ...paletteRest
12813
- } = palette;
12814
- const finalMode = modeInput || typeInput || 'light';
12815
- theme.palette = {
12816
- // theme.palette.text.hint
12817
- text: {
12818
- hint: finalMode === 'dark' ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.38)'
12819
- },
12820
- mode: finalMode,
12821
- type: finalMode,
12822
- ...paletteRest
12823
- };
12824
- return theme;
12825
- }
12826
-
12827
11675
  var reactIs = {exports: {}};
12828
11676
 
12829
11677
  var reactIs_production = {};
@@ -13982,7 +12830,6 @@ function shouldSkipGeneratingVar$1(keys) {
13982
12830
  * @internal These variables should not appear in the :root stylesheet when the `defaultColorScheme="dark"`
13983
12831
  */
13984
12832
  const excludeVariablesFromRoot$1 = cssVarPrefix => [...[...Array(25)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}overlays-${index}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkColor`];
13985
- var excludeVariablesFromRoot$2 = excludeVariablesFromRoot$1;
13986
12833
 
13987
12834
  var defaultGetSelector = theme => (colorScheme, css) => {
13988
12835
  const root = theme.rootSelector || ':root';
@@ -14001,7 +12848,7 @@ var defaultGetSelector = theme => (colorScheme, css) => {
14001
12848
  if (theme.defaultColorScheme === colorScheme) {
14002
12849
  if (colorScheme === 'dark') {
14003
12850
  const excludedVariables = {};
14004
- excludeVariablesFromRoot$2(theme.cssVarPrefix).forEach(cssVar => {
12851
+ excludeVariablesFromRoot$1(theme.cssVarPrefix).forEach(cssVar => {
14005
12852
  excludedVariables[cssVar] = css[cssVar];
14006
12853
  delete css[cssVar];
14007
12854
  });
@@ -14543,21 +13390,6 @@ function createTheme$3(options = {},
14543
13390
  }, ...args);
14544
13391
  }
14545
13392
 
14546
- function createMuiStrictModeTheme(options, ...args) {
14547
- return createTheme$3(deepmerge$5({
14548
- unstable_strictMode: true
14549
- }, options), ...args);
14550
- }
14551
-
14552
- // To remove in v6
14553
- function createStyles(styles) {
14554
- return styles;
14555
- }
14556
-
14557
- function isUnitless(value) {
14558
- return String(parseFloat(value)).length === String(value).length;
14559
- }
14560
-
14561
13393
  // Ported from Compass
14562
13394
  // https://github.com/Compass/compass/blob/master/core/stylesheets/compass/typography/_units.scss
14563
13395
  // Emulate the sass function "unit"
@@ -14570,186 +13402,10 @@ function toUnitless(length) {
14570
13402
  return parseFloat(length);
14571
13403
  }
14572
13404
 
14573
- // Convert any CSS <length> or <percentage> value to any another.
14574
- // From https://github.com/KyleAMathews/convert-css-length
14575
- function convertLength(baseFontSize) {
14576
- return (length, toUnit) => {
14577
- const fromUnit = getUnit(length);
14578
-
14579
- // Optimize for cases where `from` and `to` units are accidentally the same.
14580
- if (fromUnit === toUnit) {
14581
- return length;
14582
- }
14583
-
14584
- // Convert input length to pixels.
14585
- let pxLength = toUnitless(length);
14586
- if (fromUnit !== 'px') {
14587
- if (fromUnit === 'em') {
14588
- pxLength = toUnitless(length) * toUnitless(baseFontSize);
14589
- } else if (fromUnit === 'rem') {
14590
- pxLength = toUnitless(length) * toUnitless(baseFontSize);
14591
- }
14592
- }
14593
-
14594
- // Convert length in pixels to the output unit
14595
- let outputLength = pxLength;
14596
- if (toUnit !== 'px') {
14597
- if (toUnit === 'em') {
14598
- outputLength = pxLength / toUnitless(baseFontSize);
14599
- } else if (toUnit === 'rem') {
14600
- outputLength = pxLength / toUnitless(baseFontSize);
14601
- } else {
14602
- return length;
14603
- }
14604
- }
14605
- return parseFloat(outputLength.toFixed(5)) + toUnit;
14606
- };
14607
- }
14608
- function alignProperty({
14609
- size,
14610
- grid
14611
- }) {
14612
- const sizeBelow = size - size % grid;
14613
- const sizeAbove = sizeBelow + grid;
14614
- return size - sizeBelow < sizeAbove - size ? sizeBelow : sizeAbove;
14615
- }
14616
-
14617
- // fontGrid finds a minimal grid (in rem) for the fontSize values so that the
14618
- // lineHeight falls under a x pixels grid, 4px in the case of Material Design,
14619
- // without changing the relative line height
14620
- function fontGrid({
14621
- lineHeight,
14622
- pixels,
14623
- htmlFontSize
14624
- }) {
14625
- return pixels / (lineHeight * htmlFontSize);
14626
- }
14627
-
14628
- /**
14629
- * generate a responsive version of a given CSS property
14630
- * @example
14631
- * responsiveProperty({
14632
- * cssProperty: 'fontSize',
14633
- * min: 15,
14634
- * max: 20,
14635
- * unit: 'px',
14636
- * breakpoints: [300, 600],
14637
- * })
14638
- *
14639
- * // this returns
14640
- *
14641
- * {
14642
- * fontSize: '15px',
14643
- * '@media (min-width:300px)': {
14644
- * fontSize: '17.5px',
14645
- * },
14646
- * '@media (min-width:600px)': {
14647
- * fontSize: '20px',
14648
- * },
14649
- * }
14650
- * @param {Object} params
14651
- * @param {string} params.cssProperty - The CSS property to be made responsive
14652
- * @param {number} params.min - The smallest value of the CSS property
14653
- * @param {number} params.max - The largest value of the CSS property
14654
- * @param {string} [params.unit] - The unit to be used for the CSS property
14655
- * @param {Array.number} [params.breakpoints] - An array of breakpoints
14656
- * @param {number} [params.alignStep] - Round scaled value to fall under this grid
14657
- * @returns {Object} responsive styles for {params.cssProperty}
14658
- */
14659
- function responsiveProperty({
14660
- cssProperty,
14661
- min,
14662
- max,
14663
- unit = 'rem',
14664
- breakpoints = [600, 900, 1200],
14665
- transform = null
14666
- }) {
14667
- const output = {
14668
- [cssProperty]: `${min}${unit}`
14669
- };
14670
- const factor = (max - min) / breakpoints[breakpoints.length - 1];
14671
- breakpoints.forEach(breakpoint => {
14672
- let value = min + factor * breakpoint;
14673
- if (transform !== null) {
14674
- value = transform(value);
14675
- }
14676
- output[`@media (min-width:${breakpoint}px)`] = {
14677
- [cssProperty]: `${Math.round(value * 10000) / 10000}${unit}`
14678
- };
14679
- });
14680
- return output;
14681
- }
14682
-
14683
- function responsiveFontSizes(themeInput, options = {}) {
14684
- const {
14685
- breakpoints = ['sm', 'md', 'lg'],
14686
- disableAlign = false,
14687
- factor = 2,
14688
- variants = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'caption', 'button', 'overline']
14689
- } = options;
14690
- const theme = {
14691
- ...themeInput
14692
- };
14693
- theme.typography = {
14694
- ...theme.typography
14695
- };
14696
- const typography = theme.typography;
14697
-
14698
- // Convert between CSS lengths e.g. em->px or px->rem
14699
- // Set the baseFontSize for your project. Defaults to 16px (also the browser default).
14700
- const convert = convertLength(typography.htmlFontSize);
14701
- const breakpointValues = breakpoints.map(x => theme.breakpoints.values[x]);
14702
- variants.forEach(variant => {
14703
- const style = typography[variant];
14704
- if (!style) {
14705
- return;
14706
- }
14707
- const remFontSize = parseFloat(convert(style.fontSize, 'rem'));
14708
- if (remFontSize <= 1) {
14709
- return;
14710
- }
14711
- const maxFontSize = remFontSize;
14712
- const minFontSize = 1 + (maxFontSize - 1) / factor;
14713
- let {
14714
- lineHeight
14715
- } = style;
14716
- if (!isUnitless(lineHeight) && !disableAlign) {
14717
- throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: Unsupported non-unitless line height with grid alignment.\n' + 'Use unitless line heights instead.' : formatMuiErrorMessage$6(6));
14718
- }
14719
- if (!isUnitless(lineHeight)) {
14720
- // make it unitless
14721
- lineHeight = parseFloat(convert(lineHeight, 'rem')) / parseFloat(remFontSize);
14722
- }
14723
- let transform = null;
14724
- if (!disableAlign) {
14725
- transform = value => alignProperty({
14726
- size: value,
14727
- grid: fontGrid({
14728
- pixels: 4,
14729
- lineHeight,
14730
- htmlFontSize: typography.htmlFontSize
14731
- })
14732
- });
14733
- }
14734
- typography[variant] = {
14735
- ...style,
14736
- ...responsiveProperty({
14737
- cssProperty: 'fontSize',
14738
- min: minFontSize,
14739
- max: maxFontSize,
14740
- unit: 'rem',
14741
- breakpoints: breakpointValues,
14742
- transform
14743
- })
14744
- };
14745
- });
14746
- return theme;
14747
- }
14748
-
14749
13405
  const defaultTheme$2 = createTheme$3();
14750
13406
 
14751
13407
  function useTheme$7() {
14752
- const theme = useTheme$9(defaultTheme$2);
13408
+ const theme = useTheme$8(defaultTheme$2);
14753
13409
  if (process.env.NODE_ENV !== 'production') {
14754
13410
  // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
14755
13411
  // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -14783,199 +13439,6 @@ const styled$3 = createStyled$2({
14783
13439
  rootShouldForwardProp: rootShouldForwardProp$1
14784
13440
  });
14785
13441
 
14786
- function ThemeProviderNoVars({
14787
- theme: themeInput,
14788
- ...props
14789
- }) {
14790
- const scopedTheme = THEME_ID in themeInput ? themeInput[THEME_ID] : undefined;
14791
- return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$5, {
14792
- ...props,
14793
- themeId: scopedTheme ? THEME_ID : undefined,
14794
- theme: scopedTheme || themeInput
14795
- });
14796
- }
14797
-
14798
- const defaultConfig = {
14799
- attribute: 'data-mui-color-scheme',
14800
- colorSchemeStorageKey: 'mui-color-scheme',
14801
- defaultLightColorScheme: 'light',
14802
- defaultDarkColorScheme: 'dark',
14803
- modeStorageKey: 'mui-mode'
14804
- };
14805
- process.env.NODE_ENV !== "production" ? {
14806
- // ┌────────────────────────────── Warning ──────────────────────────────┐
14807
- // │ These PropTypes are generated from the TypeScript type definitions. │
14808
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
14809
- // └─────────────────────────────────────────────────────────────────────┘
14810
- /**
14811
- * DOM attribute for applying a color scheme.
14812
- * @default 'data-mui-color-scheme'
14813
- * @example '.mode-%s' // for class based color scheme
14814
- * @example '[data-mode-%s]' // for data-attribute without '='
14815
- */
14816
- attribute: PropTypes.string,
14817
- /**
14818
- * The node (provided as string) used to attach the color-scheme attribute.
14819
- * @default 'document.documentElement'
14820
- */
14821
- colorSchemeNode: PropTypes.string,
14822
- /**
14823
- * localStorage key used to store `colorScheme`.
14824
- * @default 'mui-color-scheme'
14825
- */
14826
- colorSchemeStorageKey: PropTypes.string,
14827
- /**
14828
- * The default color scheme to be used in dark mode.
14829
- * @default 'dark'
14830
- */
14831
- defaultDarkColorScheme: PropTypes.string,
14832
- /**
14833
- * The default color scheme to be used in light mode.
14834
- * @default 'light'
14835
- */
14836
- defaultLightColorScheme: PropTypes.string,
14837
- /**
14838
- * The default mode when the storage is empty (user's first visit).
14839
- * @default 'system'
14840
- */
14841
- defaultMode: PropTypes.oneOf(['dark', 'light', 'system']),
14842
- /**
14843
- * localStorage key used to store `mode`.
14844
- * @default 'mui-mode'
14845
- */
14846
- modeStorageKey: PropTypes.string,
14847
- /**
14848
- * Nonce string to pass to the inline script for CSP headers.
14849
- */
14850
- nonce: PropTypes.string
14851
- } : void 0;
14852
-
14853
- const {
14854
- CssVarsProvider: InternalCssVarsProvider,
14855
- useColorScheme,
14856
- getInitColorSchemeScript: deprecatedGetInitColorSchemeScript
14857
- } = createCssVarsProvider$1({
14858
- themeId: THEME_ID,
14859
- // @ts-ignore ignore module augmentation tests
14860
- theme: () => createTheme$3({
14861
- cssVariables: true
14862
- }),
14863
- colorSchemeStorageKey: defaultConfig.colorSchemeStorageKey,
14864
- modeStorageKey: defaultConfig.modeStorageKey,
14865
- defaultColorScheme: {
14866
- light: defaultConfig.defaultLightColorScheme,
14867
- dark: defaultConfig.defaultDarkColorScheme
14868
- },
14869
- resolveTheme: theme => {
14870
- const newTheme = {
14871
- ...theme,
14872
- typography: createTypography$1(theme.palette, theme.typography)
14873
- };
14874
- newTheme.unstable_sx = function sx(props) {
14875
- return styleFunctionSx$2({
14876
- sx: props,
14877
- theme: this
14878
- });
14879
- };
14880
- return newTheme;
14881
- }
14882
- });
14883
-
14884
- // TODO: remove in v7
14885
- // eslint-disable-next-line @typescript-eslint/naming-convention
14886
- function Experimental_CssVarsProvider(props) {
14887
- if (process.env.NODE_ENV !== 'production') ;
14888
- return /*#__PURE__*/jsxRuntimeExports.jsx(InternalCssVarsProvider, {
14889
- ...props
14890
- });
14891
- }
14892
-
14893
- // TODO: remove in v7
14894
- const getInitColorSchemeScript = params => {
14895
- return deprecatedGetInitColorSchemeScript(params);
14896
- };
14897
-
14898
- /**
14899
- * TODO: remove this export in v7
14900
- * @deprecated
14901
- * The `CssVarsProvider` component has been deprecated and ported into `ThemeProvider`.
14902
- *
14903
- * You should use `ThemeProvider` and `createTheme()` instead:
14904
- *
14905
- * ```diff
14906
- * - import { CssVarsProvider, extendTheme } from '@mui/material/styles';
14907
- * + import { ThemeProvider, createTheme } from '@mui/material/styles';
14908
- *
14909
- * - const theme = extendTheme();
14910
- * + const theme = createTheme({
14911
- * + cssVariables: true,
14912
- * + colorSchemes: { light: true, dark: true },
14913
- * + });
14914
- *
14915
- * - <CssVarsProvider theme={theme}>
14916
- * + <ThemeProvider theme={theme}>
14917
- * ```
14918
- *
14919
- * To see the full documentation, check out https://mui.com/material-ui/customization/css-theme-variables/usage/.
14920
- */
14921
- const CssVarsProvider = InternalCssVarsProvider;
14922
-
14923
- function ThemeProvider$4({
14924
- theme,
14925
- ...props
14926
- }) {
14927
- const noVarsTheme = React__namespace.useMemo(() => {
14928
- if (typeof theme === 'function') {
14929
- return theme;
14930
- }
14931
- const muiTheme = THEME_ID in theme ? theme[THEME_ID] : theme;
14932
- if (!('colorSchemes' in muiTheme)) {
14933
- if (!('vars' in muiTheme)) {
14934
- // For non-CSS variables themes, set `vars` to null to prevent theme inheritance from the upper theme.
14935
- // The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
14936
- return {
14937
- ...theme,
14938
- vars: null
14939
- };
14940
- }
14941
- return theme;
14942
- }
14943
- return null;
14944
- }, [theme]);
14945
- if (noVarsTheme) {
14946
- return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProviderNoVars, {
14947
- theme: noVarsTheme,
14948
- ...props
14949
- });
14950
- }
14951
- return /*#__PURE__*/jsxRuntimeExports.jsx(CssVarsProvider, {
14952
- theme: theme,
14953
- ...props
14954
- });
14955
- }
14956
-
14957
- function makeStyles$1() {
14958
- throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: makeStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : formatMuiErrorMessage$6(14));
14959
- }
14960
-
14961
- function withStyles() {
14962
- throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : formatMuiErrorMessage$6(15));
14963
- }
14964
-
14965
- function withTheme() {
14966
- throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withTheme is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : formatMuiErrorMessage$6(16));
14967
- }
14968
-
14969
- function deprecatedExtendTheme(...args) {
14970
- return createThemeWithVars$1(...args);
14971
- }
14972
-
14973
- // TODO: Remove this function in v6.
14974
- // eslint-disable-next-line @typescript-eslint/naming-convention
14975
- function experimental_sx() {
14976
- throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.' + 'For more details, see https://github.com/mui/material-ui/pull/35150.' : formatMuiErrorMessage$6(19));
14977
- }
14978
-
14979
13442
  // It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
14980
13443
  //
14981
13444
  // A strict capitalization should uppercase the first letter of each word in the sentence.
@@ -85873,7 +84336,7 @@ const MonthCalendar = /*#__PURE__*/React__namespace.forwardRef(function MonthCal
85873
84336
  valueManager: singleItemValueManager
85874
84337
  });
85875
84338
  const now = useNow(timezone);
85876
- const theme = useTheme$9();
84339
+ const theme = useTheme$8();
85877
84340
  const utils = useUtils();
85878
84341
  const referenceDate = React__namespace.useMemo(() => singleItemValueManager.getInitialReferenceValue({
85879
84342
  value,
@@ -86327,7 +84790,7 @@ const YearCalendar = /*#__PURE__*/React__namespace.forwardRef(function YearCalen
86327
84790
  valueManager: singleItemValueManager
86328
84791
  });
86329
84792
  const now = useNow(timezone);
86330
- const theme = useTheme$9();
84793
+ const theme = useTheme$8();
86331
84794
  const utils = useUtils();
86332
84795
  const referenceDate = React__namespace.useMemo(() => singleItemValueManager.getInitialReferenceValue({
86333
84796
  value,
@@ -128221,7 +126684,7 @@ const customTheme = createTheme$3({
128221
126684
  });
128222
126685
 
128223
126686
  const FormRenderWrapper = ({ formArray, name, numberOfColumns = 3, form, variant = "", fieldError, }) => {
128224
- return (jsxRuntimeExports.jsx(ThemeProvider$7, { theme: customTheme, children: jsxRuntimeExports.jsx(FormComponent, { container: true, margin: "auto", children: formArray.map((item, i) => {
126687
+ return (jsxRuntimeExports.jsx(ThemeProvider$4, { theme: customTheme, children: jsxRuntimeExports.jsx(FormComponent, { container: true, margin: "auto", children: formArray.map((item, i) => {
128225
126688
  return (item.inputType && (jsxRuntimeExports.jsx(Formitem, { container: true, sx: item.CustomProps, noOfColumn: item.numberOfColumns || numberOfColumns, children: jsxRuntimeExports.jsx(RenderForm, { item: item, register: form.register, control: form.control, errors: form.formState.errors, getValues: form.getValues, clearErrors: form.clearErrors, setValue: form.setValue, variant: variant, fieldError: fieldError }) }, i)));
128226
126689
  }) }) }));
128227
126690
  };
@@ -205081,12 +203544,10 @@ exports.BrowserRouter = BrowserRouter;
205081
203544
  exports.ButtonTP = Button$1;
205082
203545
  exports.CacheBuster = CacheBuster;
205083
203546
  exports.CryptoJS = index$2;
205084
- exports.CssVarsProvider = CssVarsProvider;
205085
203547
  exports.DEFAULT_VERSION = DEFAULT_VERSION;
205086
203548
  exports.DatePicker = DatePicker;
205087
203549
  exports.DeleteField = DeleteField;
205088
203550
  exports.DeleteFieldTP = DeleteField;
205089
- exports.Experimental_CssVarsProvider = Experimental_CssVarsProvider;
205090
203551
  exports.FLUSH = FLUSH;
205091
203552
  exports.FileSaver = FileSaver_min;
205092
203553
  exports.Form = Form;
@@ -205194,9 +203655,6 @@ exports.SessionTimeoutField = SessionTimeOut;
205194
203655
  exports.SessionTimeoutFieldTP = SessionTimeOut;
205195
203656
  exports.StaticRouter = StaticRouter;
205196
203657
  exports.StaticRouterProvider = StaticRouterProvider;
205197
- exports.StyledEngineProvider = StyledEngineProvider$2;
205198
- exports.THEME_ID = THEME_ID;
205199
- exports.ThemeProvider = ThemeProvider$4;
205200
203658
  exports.TypographyTP = Typography;
205201
203659
  exports.UNSAFE_DataRouterContext = DataRouterContext;
205202
203660
  exports.UNSAFE_DataRouterStateContext = DataRouterStateContext;
@@ -205234,13 +203692,10 @@ exports.UNSAFE_withErrorBoundaryProps = withErrorBoundaryProps;
205234
203692
  exports.UNSAFE_withHydrateFallbackProps = withHydrateFallbackProps;
205235
203693
  exports.XLSX = xlsx;
205236
203694
  exports.XLSXStyle = xlsx_min$1;
205237
- exports.adaptV4Theme = adaptV4Theme;
205238
- exports.alpha = alpha;
205239
203695
  exports.calculateTotalArrayValueTotal = calculateTotalArrayValueTotal;
205240
203696
  exports.cellKeyboardShortcuts = cellKeyboardShortcuts;
205241
203697
  exports.checkIsDateIsBefore = checkIsDateIsBefore;
205242
203698
  exports.createBrowserRouter = createBrowserRouter;
205243
- exports.createColorScheme = createColorScheme$1;
205244
203699
  exports.createCookie = createCookie;
205245
203700
  exports.createCookieSessionStorage = createCookieSessionStorage;
205246
203701
  exports.createHashRouter = createHashRouter;
@@ -205260,25 +203715,13 @@ exports.createSession = createSession;
205260
203715
  exports.createSessionStorage = createSessionStorage;
205261
203716
  exports.createStaticHandler = createStaticHandler2;
205262
203717
  exports.createStaticRouter = createStaticRouter;
205263
- exports.createStyles = createStyles;
205264
- exports.createTheme = createTheme$3;
205265
203718
  exports.createTransform = createTransform;
205266
- exports.createTransitions = createTransitions$1;
205267
- exports.css = css$2;
205268
- exports.darken = darken;
205269
203719
  exports.data = data;
205270
203720
  exports.dateFns = index$4;
205271
203721
  exports.dayjsLib = dayjs;
205272
- exports.decomposeColor = decomposeColor;
205273
203722
  exports.decryptText = decryptText;
205274
203723
  exports.defaultDisplayColumnProps = defaultDisplayColumnProps;
205275
- exports.duration = duration;
205276
- exports.easing = easing;
205277
- exports.emphasize = emphasize;
205278
203724
  exports.encryptText = encryptText;
205279
- exports.experimental_extendTheme = deprecatedExtendTheme;
205280
- exports.experimental_sx = experimental_sx;
205281
- exports.extendTheme = createThemeWithVars$1;
205282
203725
  exports.findMenuHierarchy = findMenuHierarchy;
205283
203726
  exports.flexRender = flexRender;
205284
203727
  exports.generatePath = generatePath;
@@ -205286,36 +203729,27 @@ exports.getAllLeafColumnDefs = getAllLeafColumnDefs;
205286
203729
  exports.getCanRankRows = getCanRankRows;
205287
203730
  exports.getColumnFilterInfo = getColumnFilterInfo;
205288
203731
  exports.getColumnId = getColumnId;
205289
- exports.getContrastRatio = getContrastRatio;
205290
203732
  exports.getDefaultColumnFilterFn = getDefaultColumnFilterFn;
205291
203733
  exports.getDefaultColumnOrderIds = getDefaultColumnOrderIds;
205292
203734
  exports.getDesiredDate = getDesiredDate;
205293
203735
  exports.getFormattedDate = getFormattedDate;
205294
- exports.getInitColorSchemeScript = getInitColorSchemeScript;
205295
203736
  exports.getInitials = getInitials;
205296
203737
  exports.getIsRankingRows = getIsRankingRows;
205297
203738
  exports.getIsRowSelected = getIsRowSelected;
205298
203739
  exports.getLeadingDisplayColumnIds = getLeadingDisplayColumnIds;
205299
- exports.getLuminance = getLuminance;
205300
203740
  exports.getMRT_RowSelectionHandler = getMRT_RowSelectionHandler;
205301
203741
  exports.getMRT_Rows = getMRT_Rows;
205302
203742
  exports.getMRT_SelectAllHandler = getMRT_SelectAllHandler;
205303
- exports.getOverlayAlpha = getOverlayAlpha$1;
205304
203743
  exports.getStoredState = getStoredState;
205305
203744
  exports.getTrailingDisplayColumnIds = getTrailingDisplayColumnIds;
205306
203745
  exports.getUsernameFromEmail = getUsernameFromEmail;
205307
203746
  exports.handleDownloadReactTableDataExcel = handleDownloadReactTableDataExcel;
205308
- exports.hexToRgb = hexToRgb;
205309
203747
  exports.href = href;
205310
- exports.hslToRgb = hslToRgb;
205311
203748
  exports.isCellEditable = isCellEditable;
205312
203749
  exports.isCookie = isCookie;
205313
203750
  exports.isRouteErrorResponse = isRouteErrorResponse;
205314
203751
  exports.isSession = isSession;
205315
- exports.keyframes = keyframes;
205316
- exports.lighten = lighten;
205317
203752
  exports.lightenColor = lightenColor;
205318
- exports.makeStyles = makeStyles$1;
205319
203753
  exports.matchPath = matchPath;
205320
203754
  exports.matchRoutes = matchRoutes;
205321
203755
  exports.mrtFilterOptions = mrtFilterOptions;
@@ -205325,21 +203759,14 @@ exports.persistCombineReducers = persistCombineReducers;
205325
203759
  exports.persistReducer = persistReducer;
205326
203760
  exports.persistStore = persistStore;
205327
203761
  exports.prepareColumns = prepareColumns;
205328
- exports.private_createMixins = createMixins$1;
205329
- exports.private_createTypography = createTypography$1;
205330
- exports.private_excludeVariablesFromRoot = excludeVariablesFromRoot$2;
205331
203762
  exports.purgeStoredState = purgeStoredState;
205332
203763
  exports.rankGlobalFuzzy = rankGlobalFuzzy;
205333
- exports.recomposeColor = recomposeColor;
205334
203764
  exports.redirect = redirect;
205335
203765
  exports.redirectDocument = redirectDocument;
205336
203766
  exports.renderMatches = renderMatches;
205337
203767
  exports.reorderColumn = reorderColumn;
205338
203768
  exports.replace = replace;
205339
203769
  exports.resolvePath = resolvePath;
205340
- exports.responsiveFontSizes = responsiveFontSizes;
205341
- exports.rgbToHex = rgbToHex;
205342
- exports.shouldSkipGeneratingVar = shouldSkipGeneratingVar$1;
205343
203770
  exports.showRowActionsColumn = showRowActionsColumn;
205344
203771
  exports.showRowDragColumn = showRowDragColumn;
205345
203772
  exports.showRowExpandColumn = showRowExpandColumn;
@@ -205347,27 +203774,21 @@ exports.showRowNumbersColumn = showRowNumbersColumn;
205347
203774
  exports.showRowPinningColumn = showRowPinningColumn;
205348
203775
  exports.showRowSelectionColumn = showRowSelectionColumn;
205349
203776
  exports.showRowSpacerColumn = showRowSpacerColumn;
205350
- exports.styled = styled$3;
205351
203777
  exports.unstable_HistoryRouter = HistoryRouter;
205352
203778
  exports.unstable_RSCHydratedRouter = RSCHydratedRouter;
205353
203779
  exports.unstable_RSCStaticRouter = RSCStaticRouter;
205354
203780
  exports.unstable_RouterContextProvider = unstable_RouterContextProvider;
205355
- exports.unstable_createBreakpoints = createBreakpoints$1;
205356
203781
  exports.unstable_createCallServer = createCallServer;
205357
203782
  exports.unstable_createContext = unstable_createContext;
205358
- exports.unstable_createMuiStrictModeTheme = createMuiStrictModeTheme;
205359
203783
  exports.unstable_getRSCStream = getRSCStream;
205360
- exports.unstable_getUnit = getUnit;
205361
203784
  exports.unstable_routeRSCServerRequest = routeRSCServerRequest;
205362
203785
  exports.unstable_setDevServerHooks = setDevServerHooks;
205363
- exports.unstable_toUnitless = toUnitless;
205364
203786
  exports.unstable_usePrompt = usePrompt;
205365
203787
  exports.useActionData = useActionData;
205366
203788
  exports.useAsyncError = useAsyncError;
205367
203789
  exports.useAsyncValue = useAsyncValue;
205368
203790
  exports.useBeforeUnload = useBeforeUnload;
205369
203791
  exports.useBlocker = useBlocker;
205370
- exports.useColorScheme = useColorScheme;
205371
203792
  exports.useDispatch = useDispatch;
205372
203793
  exports.useDropdownOptions = useDropdownOptions;
205373
203794
  exports.useFetcher = useFetcher;
@@ -205406,11 +203827,7 @@ exports.useSearchParams = useSearchParams;
205406
203827
  exports.useSelector = useSelector;
205407
203828
  exports.useStore = useStore;
205408
203829
  exports.useSubmit = useSubmit;
205409
- exports.useTheme = useTheme$7;
205410
- exports.useThemeProps = useThemeProps$2;
205411
203830
  exports.useViewTransitionState = useViewTransitionState;
205412
- exports.withStyles = withStyles;
205413
- exports.withTheme = withTheme;
205414
203831
  exports.yup = index_esm$1;
205415
203832
  exports.yupResolverTP = o;
205416
203833
  //# sourceMappingURL=index.js.map