@mui/material 6.0.0-alpha.12 → 6.0.0-alpha.14

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 (70) hide show
  1. package/Alert/Alert.d.ts +12 -3
  2. package/ButtonBase/ButtonBase.js +4 -12
  3. package/CHANGELOG.md +91 -0
  4. package/Dialog/Dialog.js +2 -1
  5. package/Hidden/hiddenCssClasses.d.ts +3 -0
  6. package/Link/Link.js +4 -14
  7. package/Modal/Modal.js +27 -17
  8. package/PigmentContainer/PigmentContainer.d.ts +55 -0
  9. package/PigmentContainer/PigmentContainer.js +98 -0
  10. package/PigmentContainer/index.d.ts +3 -0
  11. package/PigmentContainer/index.js +3 -0
  12. package/PigmentContainer/package.json +6 -0
  13. package/PigmentGrid/PigmentGrid.d.ts +108 -0
  14. package/PigmentGrid/PigmentGrid.js +149 -0
  15. package/PigmentGrid/index.d.ts +3 -0
  16. package/PigmentGrid/index.js +3 -0
  17. package/PigmentGrid/package.json +6 -0
  18. package/PigmentHidden/PigmentHidden.d.ts +97 -0
  19. package/PigmentHidden/PigmentHidden.js +278 -0
  20. package/PigmentHidden/index.d.ts +2 -0
  21. package/PigmentHidden/index.js +2 -0
  22. package/PigmentHidden/package.json +6 -0
  23. package/PigmentStack/PigmentStack.d.ts +51 -0
  24. package/PigmentStack/PigmentStack.js +81 -0
  25. package/PigmentStack/index.d.ts +3 -0
  26. package/PigmentStack/index.js +3 -0
  27. package/PigmentStack/package.json +6 -0
  28. package/Rating/Rating.js +5 -12
  29. package/Tooltip/Tooltip.js +4 -14
  30. package/index.js +1 -1
  31. package/modern/ButtonBase/ButtonBase.js +4 -12
  32. package/modern/Dialog/Dialog.js +2 -1
  33. package/modern/Link/Link.js +4 -14
  34. package/modern/Modal/Modal.js +27 -17
  35. package/modern/PigmentContainer/PigmentContainer.js +98 -0
  36. package/modern/PigmentContainer/index.js +3 -0
  37. package/modern/PigmentGrid/PigmentGrid.js +149 -0
  38. package/modern/PigmentGrid/index.js +3 -0
  39. package/modern/PigmentHidden/PigmentHidden.js +278 -0
  40. package/modern/PigmentHidden/index.js +2 -0
  41. package/modern/PigmentStack/PigmentStack.js +81 -0
  42. package/modern/PigmentStack/index.js +3 -0
  43. package/modern/Rating/Rating.js +5 -12
  44. package/modern/Tooltip/Tooltip.js +4 -14
  45. package/modern/index.js +1 -1
  46. package/modern/utils/index.js +0 -1
  47. package/node/ButtonBase/ButtonBase.js +4 -12
  48. package/node/Dialog/Dialog.js +2 -1
  49. package/node/Link/Link.js +4 -14
  50. package/node/Modal/Modal.js +27 -18
  51. package/node/PigmentContainer/PigmentContainer.js +108 -0
  52. package/node/PigmentContainer/index.js +36 -0
  53. package/node/PigmentGrid/PigmentGrid.js +159 -0
  54. package/node/PigmentGrid/index.js +36 -0
  55. package/node/PigmentHidden/PigmentHidden.js +287 -0
  56. package/node/PigmentHidden/index.js +26 -0
  57. package/node/PigmentStack/PigmentStack.js +91 -0
  58. package/node/PigmentStack/index.js +36 -0
  59. package/node/Rating/Rating.js +4 -11
  60. package/node/Tooltip/Tooltip.js +4 -14
  61. package/node/index.js +1 -1
  62. package/node/utils/index.js +0 -7
  63. package/package.json +10 -6
  64. package/styles/responsiveFontSizes.d.ts +3 -4
  65. package/utils/index.d.ts +0 -1
  66. package/utils/index.js +0 -1
  67. package/modern/utils/useIsFocusVisible.js +0 -4
  68. package/node/utils/useIsFocusVisible.js +0 -10
  69. package/utils/useIsFocusVisible.d.ts +0 -3
  70. package/utils/useIsFocusVisible.js +0 -4
package/Alert/Alert.d.ts CHANGED
@@ -9,8 +9,9 @@ import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
9
9
  export type AlertColor = 'success' | 'info' | 'warning' | 'error';
10
10
 
11
11
  export interface AlertPropsVariantOverrides {}
12
-
13
12
  export interface AlertPropsColorOverrides {}
13
+ export interface AlertCloseButtonSlotPropsOverrides {}
14
+ export interface AlertCloseIconSlotPropsOverrides {}
14
15
 
15
16
  export interface AlertSlots {
16
17
  /**
@@ -28,8 +29,16 @@ export interface AlertSlots {
28
29
  export type AlertSlotsAndSlotProps = CreateSlotsAndSlotProps<
29
30
  AlertSlots,
30
31
  {
31
- closeButton: SlotProps<React.ElementType<IconButtonProps>, {}, AlertOwnerState>;
32
- closeIcon: SlotProps<React.ElementType<SvgIconProps>, {}, AlertOwnerState>;
32
+ closeButton: SlotProps<
33
+ React.ElementType<IconButtonProps>,
34
+ AlertCloseButtonSlotPropsOverrides,
35
+ AlertOwnerState
36
+ >;
37
+ closeIcon: SlotProps<
38
+ React.ElementType<SvgIconProps>,
39
+ AlertCloseIconSlotPropsOverrides,
40
+ AlertOwnerState
41
+ >;
33
42
  }
34
43
  >;
35
44
 
@@ -6,11 +6,11 @@ import clsx from 'clsx';
6
6
  import refType from '@mui/utils/refType';
7
7
  import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
8
8
  import composeClasses from '@mui/utils/composeClasses';
9
+ import isFocusVisible from '@mui/utils/isFocusVisible';
9
10
  import { styled } from '../zero-styled';
10
11
  import { useDefaultProps } from '../DefaultPropsProvider';
11
12
  import useForkRef from '../utils/useForkRef';
12
13
  import useEventCallback from '../utils/useEventCallback';
13
- import useIsFocusVisible from '../utils/useIsFocusVisible';
14
14
  import TouchRipple from './TouchRipple';
15
15
  import buttonBaseClasses, { getButtonBaseUtilityClass } from './buttonBaseClasses';
16
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -119,12 +119,6 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
119
119
  const buttonRef = React.useRef(null);
120
120
  const rippleRef = React.useRef(null);
121
121
  const handleRippleRef = useForkRef(rippleRef, touchRippleRef);
122
- const {
123
- isFocusVisibleRef,
124
- onFocus: handleFocusVisible,
125
- onBlur: handleBlurVisible,
126
- ref: focusVisibleRef
127
- } = useIsFocusVisible();
128
122
  const [focusVisible, setFocusVisible] = React.useState(false);
129
123
  if (disabled && focusVisible) {
130
124
  setFocusVisible(false);
@@ -173,8 +167,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
173
167
  const handleTouchEnd = useRippleHandler('stop', onTouchEnd);
174
168
  const handleTouchMove = useRippleHandler('stop', onTouchMove);
175
169
  const handleBlur = useRippleHandler('stop', event => {
176
- handleBlurVisible(event);
177
- if (isFocusVisibleRef.current === false) {
170
+ if (!isFocusVisible(event.target)) {
178
171
  setFocusVisible(false);
179
172
  }
180
173
  if (onBlur) {
@@ -186,8 +179,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
186
179
  if (!buttonRef.current) {
187
180
  buttonRef.current = event.currentTarget;
188
181
  }
189
- handleFocusVisible(event);
190
- if (isFocusVisibleRef.current === true) {
182
+ if (isFocusVisible(event.target)) {
191
183
  setFocusVisible(true);
192
184
  if (onFocusVisible) {
193
185
  onFocusVisible(event);
@@ -256,7 +248,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
256
248
  buttonProps['aria-disabled'] = disabled;
257
249
  }
258
250
  }
259
- const handleRef = useForkRef(ref, focusVisibleRef, buttonRef);
251
+ const handleRef = useForkRef(ref, buttonRef);
260
252
  if (process.env.NODE_ENV !== 'production') {
261
253
  // eslint-disable-next-line react-hooks/rules-of-hooks
262
254
  React.useEffect(() => {
package/CHANGELOG.md CHANGED
@@ -1,5 +1,96 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## v6.0.0-alpha.14
4
+
5
+ <!-- generated comparing v6.0.0-alpha.13..next -->
6
+
7
+ _Jul 3, 2024_
8
+
9
+ A big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - ✨ Updated Grid v2 to match PigmentGrid (#42742) @DiegoAndai
12
+
13
+ ### `@mui/material@v6.0.0-alpha.14`
14
+
15
+ #### BREAKING CHANGES
16
+
17
+ - [Grid] Update Grid props to match PigmentGrid (#42742) @DiegoAndai
18
+
19
+ Use the codemod below to migrate the props:
20
+
21
+ ```bash
22
+ npx @mui/codemod@next v6.0.0/grid-v2-props /path/to/folder
23
+ ```
24
+
25
+ #### Changes
26
+
27
+ - [Alert] Add ability to override slot props (#42787) @alexey-kozlenkov
28
+ - [Dialog] Revert incorrect textAlign style removal (#42778) @DiegoAndai
29
+ - [theme] Support `CssVarsTheme` in `responsiveFontSizes` return type (#42786) @jxdp
30
+
31
+ ### Docs
32
+
33
+ - [material-ui] Add some writing tweaks to v6 migration page (#42623) @danilo-leal
34
+ - [material-ui] Fix issues reported by react-compiler in docs folder (#42830) @sai6855
35
+ - [material-ui] Add some writing tweaks to v6 migration page (#42623) @danilo-leal
36
+ - [base-ui] Fix wrong description for `UseTabParameters.onChange` (#42749) @ohgree
37
+ - Fix 301 MDN redirections @oliviertassinari
38
+
39
+ ### Core
40
+
41
+ - [core] Bump React to 18.3.1 (#42047) @renovate[bot]
42
+ - [core] Revert lint for `useThemeProps` (#42817) @siriwatknp
43
+ - [core] Remove useIsFocusVisible util (#42467) @DiegoAndai
44
+ - [core] Remove react-test-renderer (#42784) @aarongarciah
45
+ - [core][mui-utils] Remove remaining IE11 references (#42777) @DiegoAndai
46
+ - [code-infra] Move `HighlightedCode` test into `@mui/docs` package (#42835) @LukasTy
47
+ - [code-infra] Cleanup `@mui/docs` usage and legacy re-exports (#42833) @LukasTy
48
+ - [docs-infra] Fix React Compiler ESLint issues in website components (#42566) @aarongarciah
49
+ - [docs-infra] Add batch of design polish (#42823) @danilo-leal
50
+ - [test][mui-utils] Remove usages of deprecated react-dom APIs (#42780) @aarongarciah
51
+ - [test][joy-ui][Autocomplete] Fix spread key error in test (#42775) @aarongarciah
52
+
53
+ All contributors of this release in alphabetical order: @aarongarciah, @alexey-kozlenkov, @danilo-leal, @DiegoAndai, @Janpot, @jxdp, @LukasTy, @ohgree, @oliviertassinari, @renovate[bot], @sai6855, @siriwatknp
54
+
55
+ ## v6.0.0-alpha.13
56
+
57
+ <!-- generated comparing v6.0.0-alpha.12..next -->
58
+
59
+ _Jun 27, 2024_
60
+
61
+ A big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
62
+
63
+ - 🚀 Added layout components for Pigment CSS integration (#42693) @siriwatknp
64
+
65
+ ### `@mui/material@6.0.0-alpha.13`
66
+
67
+ - [Autocomplete] Fix more React 18.3 key spread warnings in demos (#42639) @wbt
68
+ - [Container][Grid][Stack][Hidden] Export Pigment CSS layout components (#42693) @siriwatknp
69
+ - [Text Field] when click password visibility button, text caret position change to very front. (#42595) @appleSimple
70
+ - [Modal] migrate useSlotProps to useSLot (#42150) @sai6855
71
+
72
+ ### `@mui/styles@6.0.0-alpha.13`
73
+
74
+ - [withStyles] Expect React defaultProps warning in test (#42752) @aarongarciah
75
+
76
+ ### Docs
77
+
78
+ - Fix link in CONTRIBUTING.md (#42755) @Janpot
79
+ - Add documentation on migrating JSS's alternative, array-based syntax to syntax supported by Emotion (#42053) @cjl750
80
+ - Fix type error in virtualized table demo (#42757) @aarongarciah
81
+ - Add first batch of v6 migration (#42242) @siriwatknp
82
+ - Fix quotes on font-family dedeclaration in the Landing Page template theme (#42748) @joetats
83
+
84
+ ### Core
85
+
86
+ - [code-infra] Refactor eslint `import/no-cycle` rule (#42705) @LukasTy
87
+ - [core] Target direct version for prerelease (#42768) @siriwatknp
88
+ - [test] Remove enzyme (#42706) @aarongarciah
89
+ - [test] Remove createMount test util (#42703) @aarongarciah
90
+ - [website] Add Ale to team (#42764) @alelthomas
91
+
92
+ All contributors of this release in alphabetical order: @aarongarciah, @alelthomas, @appleSimple, @cjl750, @Janpot, @joetats, @LukasTy, @sai6855, @siriwatknp, @wbt
93
+
3
94
  ## v6.0.0-alpha.12
4
95
 
5
96
  <!-- generated comparing v6.0.0-alpha.11..next -->
package/Dialog/Dialog.js CHANGED
@@ -124,7 +124,8 @@ const DialogPaper = styled(Paper, {
124
124
  },
125
125
  style: {
126
126
  display: 'inline-block',
127
- verticalAlign: 'middle'
127
+ verticalAlign: 'middle',
128
+ textAlign: 'initial'
128
129
  }
129
130
  }, {
130
131
  props: ({
@@ -0,0 +1,3 @@
1
+ export declare function getHiddenCssUtilityClass(slot: string): string;
2
+ declare const hiddenCssClasses: Record<"root" | "xlDown" | "xlUp" | "onlyXl" | "lgDown" | "lgUp" | "onlyLg" | "mdDown" | "mdUp" | "onlyMd" | "smDown" | "smUp" | "onlySm" | "xsDown" | "xsUp" | "onlyXs", string>;
3
+ export default hiddenCssClasses;
package/Link/Link.js CHANGED
@@ -6,11 +6,10 @@ import clsx from 'clsx';
6
6
  import { alpha } from '@mui/system/colorManipulator';
7
7
  import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
8
8
  import composeClasses from '@mui/utils/composeClasses';
9
+ import isFocusVisible from '@mui/utils/isFocusVisible';
9
10
  import capitalize from '../utils/capitalize';
10
11
  import { styled, useTheme } from '../zero-styled';
11
12
  import { useDefaultProps } from '../DefaultPropsProvider';
12
- import useIsFocusVisible from '../utils/useIsFocusVisible';
13
- import useForkRef from '../utils/useForkRef';
14
13
  import Typography from '../Typography';
15
14
  import linkClasses, { getLinkUtilityClass } from './linkClasses';
16
15
  import getTextDecoration, { colorTransformations } from './getTextDecoration';
@@ -135,17 +134,9 @@ const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
135
134
  sx,
136
135
  ...other
137
136
  } = props;
138
- const {
139
- isFocusVisibleRef,
140
- onBlur: handleBlurVisible,
141
- onFocus: handleFocusVisible,
142
- ref: focusVisibleRef
143
- } = useIsFocusVisible();
144
137
  const [focusVisible, setFocusVisible] = React.useState(false);
145
- const handlerRef = useForkRef(ref, focusVisibleRef);
146
138
  const handleBlur = event => {
147
- handleBlurVisible(event);
148
- if (isFocusVisibleRef.current === false) {
139
+ if (!isFocusVisible(event.target)) {
149
140
  setFocusVisible(false);
150
141
  }
151
142
  if (onBlur) {
@@ -153,8 +144,7 @@ const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
153
144
  }
154
145
  };
155
146
  const handleFocus = event => {
156
- handleFocusVisible(event);
157
- if (isFocusVisibleRef.current === true) {
147
+ if (isFocusVisible(event.target)) {
158
148
  setFocusVisible(true);
159
149
  }
160
150
  if (onFocus) {
@@ -177,7 +167,7 @@ const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
177
167
  component: component,
178
168
  onBlur: handleBlur,
179
169
  onFocus: handleFocus,
180
- ref: handlerRef,
170
+ ref: ref,
181
171
  ownerState: ownerState,
182
172
  variant: variant,
183
173
  ...other,
package/Modal/Modal.js CHANGED
@@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
5
5
  import clsx from 'clsx';
6
6
  import HTMLElementType from '@mui/utils/HTMLElementType';
7
7
  import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
8
- import { useSlotProps } from '@mui/base/utils';
9
8
  import { unstable_useModal as useModal } from '@mui/base/unstable_useModal';
10
9
  import composeClasses from '@mui/utils/composeClasses';
11
10
  import FocusTrap from '../Unstable_TrapFocus';
@@ -14,6 +13,8 @@ import { styled } from '../zero-styled';
14
13
  import { useDefaultProps } from '../DefaultPropsProvider';
15
14
  import Backdrop from '../Backdrop';
16
15
  import { getModalUtilityClass } from './modalClasses';
16
+ import useSlot from '../utils/useSlot';
17
+ import { useForkRef } from '../utils';
17
18
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
19
  const useUtilityClasses = ownerState => {
19
20
  const {
@@ -106,8 +107,8 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
106
107
  onTransitionEnter,
107
108
  onTransitionExited,
108
109
  open,
109
- slotProps,
110
- slots,
110
+ slotProps = {},
111
+ slots = {},
111
112
  // eslint-disable-next-line react/prop-types
112
113
  theme,
113
114
  ...other
@@ -155,25 +156,31 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
155
156
  childProps.onEnter = onEnter;
156
157
  childProps.onExited = onExited;
157
158
  }
158
- const RootSlot = slots?.root ?? components.Root ?? ModalRoot;
159
- const BackdropSlot = slots?.backdrop ?? components.Backdrop ?? BackdropComponent;
160
- const rootSlotProps = slotProps?.root ?? componentsProps.root;
161
- const backdropSlotProps = slotProps?.backdrop ?? componentsProps.backdrop;
162
- const rootProps = useSlotProps({
163
- elementType: RootSlot,
164
- externalSlotProps: rootSlotProps,
165
- externalForwardedProps: other,
159
+ const externalForwardedProps = {
160
+ slots: {
161
+ root: components.Root,
162
+ backdrop: components.Backdrop,
163
+ ...slots
164
+ },
165
+ slotProps: {
166
+ ...componentsProps,
167
+ ...slotProps
168
+ }
169
+ };
170
+ const [RootSlot, rootProps] = useSlot('root', {
171
+ elementType: ModalRoot,
172
+ externalForwardedProps,
166
173
  getSlotProps: getRootProps,
167
174
  additionalProps: {
168
175
  ref,
169
176
  as: component
170
177
  },
171
178
  ownerState,
172
- className: clsx(className, rootSlotProps?.className, classes?.root, !ownerState.open && ownerState.exited && classes?.hidden)
179
+ className: clsx(className, classes?.root, !ownerState.open && ownerState.exited && classes?.hidden)
173
180
  });
174
- const backdropProps = useSlotProps({
175
- elementType: BackdropSlot,
176
- externalSlotProps: backdropSlotProps,
181
+ const [BackdropSlot, backdropProps] = useSlot('backdrop', {
182
+ elementType: BackdropComponent,
183
+ externalForwardedProps,
177
184
  additionalProps: BackdropProps,
178
185
  getSlotProps: otherHandlers => {
179
186
  return getBackdropProps({
@@ -188,9 +195,10 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
188
195
  }
189
196
  });
190
197
  },
191
- className: clsx(backdropSlotProps?.className, BackdropProps?.className, classes?.backdrop),
198
+ className: clsx(BackdropProps?.className, classes?.backdrop),
192
199
  ownerState
193
200
  });
201
+ const backdropRef = useForkRef(BackdropProps?.ref, backdropProps.ref);
194
202
  if (!keepMounted && !open && (!hasTransition || exited)) {
195
203
  return null;
196
204
  }
@@ -200,8 +208,10 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
200
208
  disablePortal: disablePortal,
201
209
  children: /*#__PURE__*/_jsxs(RootSlot, {
202
210
  ...rootProps,
211
+ ...other,
203
212
  children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/_jsx(BackdropSlot, {
204
- ...backdropProps
213
+ ...backdropProps,
214
+ ref: backdropRef
205
215
  }) : null, /*#__PURE__*/_jsx(FocusTrap, {
206
216
  disableEnforceFocus: disableEnforceFocus,
207
217
  disableAutoFocus: disableAutoFocus,
@@ -0,0 +1,55 @@
1
+ import * as React from 'react';
2
+ import { OverridableComponent, OverrideProps } from '@mui/types';
3
+ import { SxProps, Breakpoint } from '@mui/system';
4
+ import { Theme } from '../styles';
5
+ import { ContainerClasses } from '../Container/containerClasses';
6
+ export interface PigmentContainerOwnProps {
7
+ children?: React.ReactNode;
8
+ /**
9
+ * Override or extend the styles applied to the component.
10
+ */
11
+ classes?: Partial<ContainerClasses>;
12
+ /**
13
+ * If `true`, the left and right padding is removed.
14
+ * @default false
15
+ */
16
+ disableGutters?: boolean;
17
+ /**
18
+ * Set the max-width to match the min-width of the current breakpoint.
19
+ * This is useful if you'd prefer to design for a fixed set of sizes
20
+ * instead of trying to accommodate a fully fluid viewport.
21
+ * It's fluid by default.
22
+ * @default false
23
+ */
24
+ fixed?: boolean;
25
+ /**
26
+ * Determine the max-width of the container.
27
+ * The container width grows with the size of the screen.
28
+ * Set to `false` to disable `maxWidth`.
29
+ * @default 'lg'
30
+ */
31
+ maxWidth?: Breakpoint | false;
32
+ /**
33
+ * The system prop that allows defining system overrides as well as additional CSS styles.
34
+ */
35
+ sx?: SxProps<Theme>;
36
+ }
37
+ export interface PigmentContainerTypeMap<AdditionalProps = {}, RootComponent extends React.ElementType = 'div'> {
38
+ props: AdditionalProps & PigmentContainerOwnProps;
39
+ defaultComponent: RootComponent;
40
+ }
41
+ export type PigmentContainerProps<RootComponent extends React.ElementType = PigmentContainerTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<PigmentContainerTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
42
+ component?: React.ElementType;
43
+ };
44
+ /**
45
+ *
46
+ * Demos:
47
+ *
48
+ * - [Container](https://next.mui.com/material-ui/react-container/)
49
+ *
50
+ * API:
51
+ *
52
+ * - [PigmentContainer API](https://next.mui.com/material-ui/api/pigment-container/)
53
+ */
54
+ declare const PigmentContainer: OverridableComponent<PigmentContainerTypeMap<{}, "div">>;
55
+ export default PigmentContainer;
@@ -0,0 +1,98 @@
1
+ import * as React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import clsx from 'clsx';
4
+ // @ts-ignore
5
+ import Container from '@pigment-css/react/Container';
6
+ import capitalize from '@mui/utils/capitalize';
7
+ import composeClasses from '@mui/utils/composeClasses';
8
+ import generateUtilityClass from '@mui/utils/generateUtilityClass';
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ const useUtilityClasses = ownerState => {
11
+ const {
12
+ classes,
13
+ fixed,
14
+ disableGutters,
15
+ maxWidth
16
+ } = ownerState;
17
+ const slots = {
18
+ root: ['root', maxWidth && `maxWidth${capitalize(String(maxWidth))}`, fixed && 'fixed', disableGutters && 'disableGutters']
19
+ };
20
+ return composeClasses(slots, slot => generateUtilityClass('MuiContainer', slot), classes);
21
+ };
22
+ /**
23
+ *
24
+ * Demos:
25
+ *
26
+ * - [Container](https://next.mui.com/material-ui/react-container/)
27
+ *
28
+ * API:
29
+ *
30
+ * - [PigmentContainer API](https://next.mui.com/material-ui/api/pigment-container/)
31
+ */
32
+ const PigmentContainer = /*#__PURE__*/React.forwardRef(function PigmentContainer({
33
+ className,
34
+ disableGutters = false,
35
+ fixed = false,
36
+ maxWidth = 'lg',
37
+ ...props
38
+ }, ref) {
39
+ const ownerState = {
40
+ ...props,
41
+ disableGutters,
42
+ fixed,
43
+ maxWidth
44
+ };
45
+ const classes = useUtilityClasses(ownerState);
46
+ return /*#__PURE__*/_jsx(Container, {
47
+ className: clsx(classes.root, className),
48
+ disableGutters: disableGutters,
49
+ fixed: fixed,
50
+ maxWidth: maxWidth,
51
+ ...props,
52
+ // @ts-ignore
53
+ ref: ref
54
+ });
55
+ });
56
+ process.env.NODE_ENV !== "production" ? PigmentContainer.propTypes /* remove-proptypes */ = {
57
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
58
+ // │ These PropTypes are generated from the TypeScript type definitions. │
59
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
60
+ // └─────────────────────────────────────────────────────────────────────┘
61
+ /**
62
+ * @ignore
63
+ */
64
+ children: PropTypes.node,
65
+ /**
66
+ * Override or extend the styles applied to the component.
67
+ */
68
+ classes: PropTypes.object,
69
+ /**
70
+ * @ignore
71
+ */
72
+ className: PropTypes.string,
73
+ /**
74
+ * If `true`, the left and right padding is removed.
75
+ * @default false
76
+ */
77
+ disableGutters: PropTypes.bool,
78
+ /**
79
+ * Set the max-width to match the min-width of the current breakpoint.
80
+ * This is useful if you'd prefer to design for a fixed set of sizes
81
+ * instead of trying to accommodate a fully fluid viewport.
82
+ * It's fluid by default.
83
+ * @default false
84
+ */
85
+ fixed: PropTypes.bool,
86
+ /**
87
+ * Determine the max-width of the container.
88
+ * The container width grows with the size of the screen.
89
+ * Set to `false` to disable `maxWidth`.
90
+ * @default 'lg'
91
+ */
92
+ maxWidth: PropTypes.oneOf(['lg', 'md', 'sm', 'xl', 'xs', false]),
93
+ /**
94
+ * The system prop that allows defining system overrides as well as additional CSS styles.
95
+ */
96
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
97
+ } : void 0;
98
+ export default PigmentContainer;
@@ -0,0 +1,3 @@
1
+ export { default } from './PigmentContainer';
2
+ export * from './PigmentContainer';
3
+ export { default as containerClasses } from '../Container/containerClasses';
@@ -0,0 +1,3 @@
1
+ export { default } from './PigmentContainer';
2
+ export * from './PigmentContainer';
3
+ export { default as containerClasses } from '../Container/containerClasses';
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/PigmentContainer/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1,108 @@
1
+ import * as React from 'react';
2
+ import { OverridableComponent, OverrideProps } from '@mui/types';
3
+ import { SxProps } from '@mui/system';
4
+ import { Breakpoint, Theme } from '../styles';
5
+ type ResponsiveStyleValue<T> = T | Array<T | null> | {
6
+ [key in Breakpoint]?: T | null;
7
+ };
8
+ export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
9
+ export type GridSpacing = number | string;
10
+ export type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
11
+ export type GridSize = 'auto' | 'grow' | number;
12
+ export interface GridBaseProps {
13
+ /**
14
+ * The content of the component.
15
+ */
16
+ children?: React.ReactNode;
17
+ /**
18
+ * The number of columns.
19
+ * @default 12
20
+ */
21
+ columns?: ResponsiveStyleValue<number>;
22
+ /**
23
+ * Defines the horizontal space between the type `item` components.
24
+ * It overrides the value of the `spacing` prop.
25
+ */
26
+ columnSpacing?: ResponsiveStyleValue<GridSpacing>;
27
+ /**
28
+ * If `true`, the component will have the flex *container* behavior.
29
+ * You should be wrapping *items* with a *container*.
30
+ * @default false
31
+ */
32
+ container?: boolean;
33
+ /**
34
+ * Defines the `flex-direction` style property.
35
+ * It is applied for all screen sizes.
36
+ * @default 'row'
37
+ */
38
+ direction?: ResponsiveStyleValue<GridDirection>;
39
+ /**
40
+ * Defines the offset of the grid.
41
+ */
42
+ offset?: ResponsiveStyleValue<number> | undefined;
43
+ /**
44
+ * @internal
45
+ * The level of the grid starts from `0`
46
+ * and increases when the grid nests inside another grid regardless of container or item.
47
+ *
48
+ * ```js
49
+ * <Grid> // level 0
50
+ * <Grid> // level 1
51
+ * <Grid> // level 2
52
+ * <Grid> // level 1
53
+ * ```
54
+ *
55
+ * Only consecutive grid is considered nesting.
56
+ * A grid container will start at `0` if there are non-Grid element above it.
57
+ *
58
+ * ```js
59
+ * <Grid> // level 0
60
+ * <div>
61
+ * <Grid> // level 0
62
+ * <Grid> // level 1
63
+ * ```
64
+ */
65
+ unstable_level?: number;
66
+ /**
67
+ * Defines the vertical space between the type `item` components.
68
+ * It overrides the value of the `spacing` prop.
69
+ */
70
+ rowSpacing?: ResponsiveStyleValue<GridSpacing>;
71
+ /**
72
+ * Defines the space between the type `item` components.
73
+ * It can only be used on a type `container` component.
74
+ * @default 0
75
+ */
76
+ spacing?: ResponsiveStyleValue<GridSpacing> | undefined;
77
+ /**
78
+ * Defines the column size of the grid.
79
+ */
80
+ size?: ResponsiveStyleValue<GridSize> | undefined;
81
+ /**
82
+ * Defines the `flex-wrap` style property.
83
+ * It's applied for all screen sizes.
84
+ * @default 'wrap'
85
+ */
86
+ wrap?: GridWrap;
87
+ }
88
+ export interface GridTypeMap<AdditionalProps = {}, DefaultComponent extends React.ElementType = 'div'> {
89
+ props: AdditionalProps & GridBaseProps & {
90
+ sx?: SxProps<Theme>;
91
+ };
92
+ defaultComponent: DefaultComponent;
93
+ }
94
+ export type GridProps<RootComponent extends React.ElementType = GridTypeMap['defaultComponent'], AdditionalProps = {
95
+ component?: React.ElementType;
96
+ }> = OverrideProps<GridTypeMap<AdditionalProps, RootComponent>, RootComponent>;
97
+ /**
98
+ *
99
+ * Demos:
100
+ *
101
+ * - [Grid version 2](https://next.mui.com/material-ui/react-grid2/)
102
+ *
103
+ * API:
104
+ *
105
+ * - [PigmentGrid API](https://next.mui.com/material-ui/api/pigment-grid/)
106
+ */
107
+ declare const PigmentGrid: OverridableComponent<GridTypeMap<{}, "div">>;
108
+ export default PigmentGrid;