start UI implementing

This commit is contained in:
2026-08-18 21:38:57 +02:00
parent f040982b9c
commit d639cf3234
57692 changed files with 2619272 additions and 417 deletions
@@ -0,0 +1,49 @@
import * as React from 'react';
import type { OverridableComponent, OverrideProps } from '@mui/types';
import type { SxProps, AllSystemCSSProperties, ResponsiveStyleValue, OverwriteCSSProperties, AliasesCSSProperties } from "../styleFunctionSx/index.mjs";
import type { PropsFor } from "../style/index.mjs";
import type { ComposedStyleFunction } from "../compose/index.mjs";
import type { Theme as SystemTheme } from "../createTheme/index.mjs";
import type borders from "../borders/index.mjs";
import type display from "../display/index.mjs";
import type flexbox from "../flexbox/index.mjs";
import type grid from "../cssGrid/index.mjs";
import type palette from "../palette/index.mjs";
import type positions from "../positions/index.mjs";
import type shadows from "../shadows/index.mjs";
import type sizing from "../sizing/index.mjs";
import type spacing from "../spacing/index.mjs";
import type typography from "../typography/index.mjs";
export interface CustomSystemProps extends AliasesCSSProperties, OverwriteCSSProperties {}
export type SimpleSystemKeys = keyof PropsFor<ComposedStyleFunction<[typeof borders, typeof display, typeof flexbox, typeof grid, typeof palette, typeof positions, typeof shadows, typeof sizing, typeof spacing, typeof typography]>>;
type StandardSystemKeys = Extract<SimpleSystemKeys, keyof AllSystemCSSProperties>;
export type SystemProps<Theme extends object = {}> = { [K in StandardSystemKeys]?: ResponsiveStyleValue<AllSystemCSSProperties[K]> | ((theme: Theme) => ResponsiveStyleValue<AllSystemCSSProperties[K]>) };
export interface BoxOwnProps<Theme extends object = SystemTheme> {
children?: React.ReactNode;
ref?: React.Ref<unknown> | undefined;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme> | undefined;
}
export interface BoxTypeMap<AdditionalProps = {}, RootComponent extends React.ElementType = 'div', Theme extends object = SystemTheme> {
props: AdditionalProps & BoxOwnProps<Theme>;
defaultComponent: RootComponent;
}
/**
*
* Demos:
*
* - [Box (Material UI)](https://mui.com/material-ui/react-box/)
* - [Menubar (Material UI)](https://mui.com/material-ui/react-menubar/)
* - [Box (MUI System)](https://mui.com/system/react-box/)
*
* API:
*
* - [Box API](https://mui.com/system/api/box/)
*/
declare const Box: OverridableComponent<BoxTypeMap>;
export type BoxProps<RootComponent extends React.ElementType = BoxTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<BoxTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
component?: React.ElementType | undefined;
};
export default Box;
+49
View File
@@ -0,0 +1,49 @@
import * as React from 'react';
import type { OverridableComponent, OverrideProps } from '@mui/types';
import type { SxProps, AllSystemCSSProperties, ResponsiveStyleValue, OverwriteCSSProperties, AliasesCSSProperties } from "../styleFunctionSx/index.js";
import type { PropsFor } from "../style/index.js";
import type { ComposedStyleFunction } from "../compose/index.js";
import type { Theme as SystemTheme } from "../createTheme/index.js";
import type borders from "../borders/index.js";
import type display from "../display/index.js";
import type flexbox from "../flexbox/index.js";
import type grid from "../cssGrid/index.js";
import type palette from "../palette/index.js";
import type positions from "../positions/index.js";
import type shadows from "../shadows/index.js";
import type sizing from "../sizing/index.js";
import type spacing from "../spacing/index.js";
import type typography from "../typography/index.js";
export interface CustomSystemProps extends AliasesCSSProperties, OverwriteCSSProperties {}
export type SimpleSystemKeys = keyof PropsFor<ComposedStyleFunction<[typeof borders, typeof display, typeof flexbox, typeof grid, typeof palette, typeof positions, typeof shadows, typeof sizing, typeof spacing, typeof typography]>>;
type StandardSystemKeys = Extract<SimpleSystemKeys, keyof AllSystemCSSProperties>;
export type SystemProps<Theme extends object = {}> = { [K in StandardSystemKeys]?: ResponsiveStyleValue<AllSystemCSSProperties[K]> | ((theme: Theme) => ResponsiveStyleValue<AllSystemCSSProperties[K]>) };
export interface BoxOwnProps<Theme extends object = SystemTheme> {
children?: React.ReactNode;
ref?: React.Ref<unknown> | undefined;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme> | undefined;
}
export interface BoxTypeMap<AdditionalProps = {}, RootComponent extends React.ElementType = 'div', Theme extends object = SystemTheme> {
props: AdditionalProps & BoxOwnProps<Theme>;
defaultComponent: RootComponent;
}
/**
*
* Demos:
*
* - [Box (Material UI)](https://mui.com/material-ui/react-box/)
* - [Menubar (Material UI)](https://mui.com/material-ui/react-menubar/)
* - [Box (MUI System)](https://mui.com/system/react-box/)
*
* API:
*
* - [Box API](https://mui.com/system/api/box/)
*/
declare const Box: OverridableComponent<BoxTypeMap>;
export type BoxProps<RootComponent extends React.ElementType = BoxTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<BoxTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
component?: React.ElementType | undefined;
};
export default Box;
+51
View File
@@ -0,0 +1,51 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _ClassNameGenerator = _interopRequireDefault(require("@mui/utils/ClassNameGenerator"));
var _createBox = _interopRequireDefault(require("../createBox"));
var _boxClasses = _interopRequireDefault(require("./boxClasses"));
// The SimpleSystemKeys are subset of the AllSystemCSSProperties, so this should be ok
// This is needed as these are used as keys inside AllSystemCSSProperties
/**
*
* Demos:
*
* - [Box (Material UI)](https://mui.com/material-ui/react-box/)
* - [Menubar (Material UI)](https://mui.com/material-ui/react-menubar/)
* - [Box (MUI System)](https://mui.com/system/react-box/)
*
* API:
*
* - [Box API](https://mui.com/system/api/box/)
*/
const Box = (0, _createBox.default)({
defaultClassName: _boxClasses.default.root,
generateClassName: _ClassNameGenerator.default.generate
});
process.env.NODE_ENV !== "production" ? Box.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* @ignore
*/
children: _propTypes.default.node,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: _propTypes.default.elementType,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
} : void 0;
var _default = exports.default = Box;
+46
View File
@@ -0,0 +1,46 @@
'use client';
import PropTypes from 'prop-types';
import ClassNameGenerator from '@mui/utils/ClassNameGenerator';
import createBox from "../createBox/index.mjs";
import boxClasses from "./boxClasses.mjs";
// The SimpleSystemKeys are subset of the AllSystemCSSProperties, so this should be ok
// This is needed as these are used as keys inside AllSystemCSSProperties
/**
*
* Demos:
*
* - [Box (Material UI)](https://mui.com/material-ui/react-box/)
* - [Menubar (Material UI)](https://mui.com/material-ui/react-menubar/)
* - [Box (MUI System)](https://mui.com/system/react-box/)
*
* API:
*
* - [Box API](https://mui.com/system/api/box/)
*/
const Box = createBox({
defaultClassName: boxClasses.root,
generateClassName: ClassNameGenerator.generate
});
process.env.NODE_ENV !== "production" ? Box.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* @ignore
*/
children: PropTypes.node,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: PropTypes.elementType,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
} : void 0;
export default Box;
@@ -0,0 +1,7 @@
export interface BoxClasses {
/** Styles applied to the root element. */
root: string;
}
export type BoxClassKey = keyof BoxClasses;
declare const boxClasses: BoxClasses;
export default boxClasses;
@@ -0,0 +1,7 @@
export interface BoxClasses {
/** Styles applied to the root element. */
root: string;
}
export type BoxClassKey = keyof BoxClasses;
declare const boxClasses: BoxClasses;
export default boxClasses;
@@ -0,0 +1,10 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
const boxClasses = (0, _generateUtilityClasses.default)('MuiBox', ['root']);
var _default = exports.default = boxClasses;
@@ -0,0 +1,3 @@
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
const boxClasses = generateUtilityClasses('MuiBox', ['root']);
export default boxClasses;
@@ -0,0 +1,4 @@
export { default } from "./Box.mjs";
export * from "./Box.mjs";
export { default as boxClasses } from "./boxClasses.mjs";
export * from "./boxClasses.mjs";
@@ -0,0 +1,4 @@
export { default } from "./Box.js";
export * from "./Box.js";
export { default as boxClasses } from "./boxClasses.js";
export * from "./boxClasses.js";
+45
View File
@@ -0,0 +1,45 @@
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
boxClasses: true
};
Object.defineProperty(exports, "boxClasses", {
enumerable: true,
get: function () {
return _boxClasses.default;
}
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _Box.default;
}
});
var _Box = _interopRequireWildcard(require("./Box"));
Object.keys(_Box).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _Box[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _Box[key];
}
});
});
var _boxClasses = _interopRequireWildcard(require("./boxClasses"));
Object.keys(_boxClasses).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _boxClasses[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _boxClasses[key];
}
});
});
@@ -0,0 +1,4 @@
export { default } from "./Box.mjs";
export * from "./Box.mjs";
export { default as boxClasses } from "./boxClasses.mjs";
export * from "./boxClasses.mjs";
+829
View File
@@ -0,0 +1,829 @@
# [Versions](https://mui.com/material-ui/getting-started/versions/)
## 9.3.0
<!-- generated comparing v9.2.0..master -->
_Aug 4, 2026_
A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
- ♿️ Keyboard navigation in the [Toggle Button Group](https://mui.com/material-ui/react-toggle-button/) now follows the roving tabindex pattern.
- ♿️ The [Autocomplete](https://mui.com/material-ui/react-autocomplete/) announces its loading and no options messages through a new `status` slot.
### `@mui/material@9.3.0`
- [autocomplete] Wrap the no results and loading messages in an aria live region (#48690) @silviuaavram
- [buttongroup] Respect global disableRipple / disableFocusRipple in grouped buttons (#48762) @siriwatknp
- [checkbox][radio] Respect global disableRipple from MuiButtonBase defaultProps (#48795) @siriwatknp
- [formcontrollabel] Add missing `labelPlacementEnd` class (#48843) @siriwatknp
- [listitembutton] Fix typos in component code (#48868) @ZeeshanTamboli
- [menuitem] Add `aria-checked` for checkbox and radio menu items (#48651) @siriwatknp
- [modal] Replace custom findIndexOf with findIndex (#48827) @ZeeshanTamboli
- [modal][dialog] Fix scrollbar compensation in Shadow DOM (#48826) @ZeeshanTamboli
- [select] Fix endAdornment overlapping the open indicator (#48723) @siriwatknp
- [tablepagination] Add focus style to default InputBase used in Select (#48871) @silviuaavram
- [togglebuttongroup] Add roving tabindex keyboard navigation (#48849) @silviuaavram
### `@mui/system@9.3.0`
- Prevent prototype pollution in cssVarsParser (#48822) @Janpot
### `@mui/codemod@9.3.0`
- Don't leak state between files in v5.0.0/path-imports (#48797) @manbearwiz
- Remove use of eval() (#48701) @oliviertassinari
- Transform all style exports in `v5.0.0/path-imports` codemod (#48800) @manbearwiz
### Docs
- Clarify `container` prop inheritance for Shadow DOM (#48670) @Juan-C-Ceballos
- Clarify third-party script risk in CSP unsafe-inline note (#48787) @Janpot
- Document `box-sx-prop` codemod (#48888) @SR0725
- Document Grid direction column removal in v9 upgrade guide (#48880) @kalayciburak
- Fix color contrast in GitHub labels example (#48844) @silviuaavram
- Fix per-page canonical URL and stale SEO link (#48789) @brijeshb42
- Fix redirect loop on the Design Kits page (#48869) @Janpot
- Fix typo 'overriden' -> 'overridden' in CHANGELOG (#48785) @ZhouYinLong-lab
- Improve TransferList examples (#48845) @silviuaavram
- Link a new theme generator tool (#48847) @mansourcodes
- Remove broken learning resource links (#48598) @morning-verlu
- Update the 9.2.0 changelog (#48763) @silviuaavram
- [autocomplete] Clarify how to render custom start and end adornments (#48883) @DebadityaHait
- [drawer] Clarify clipped AppBar spacing (#48887) @rushijagani-dev
- [menu] Fix stale `selected` prop reference in Selected menu section (#48879) @LukasTy
- [skeleton] Document preserving typography sizing with custom border radius (#48596) @meaqua9420
### Core
- [blog] Fix caret annotation broken by Prettier wrapping (#48884) @bernardobelchior
- [code-infra] Automate team sync on about page (#48794) @brijeshb42
- [code-infra] Bump @mui/internal-code-infra to 0.0.4-canary.101 (#48878) @Janpot
- [code-infra] Fix Dependabot alerts (#48756) @Janpot
- [code-infra] Fix team sync PR creation (#48911) @brijeshb42
- [code-infra] Pin node version in publish CI (#48799) @brijeshb42
- [core-docs] Tighten service worker host check (#48581) @Janpot
- [docs-infra] Change branch name to the allowed one (#48910) @brijeshb42
All contributors of this release in alphabetical order: @bernardobelchior, @brijeshb42, @DebadityaHait, @Janpot, @Juan-C-Ceballos, @kalayciburak, @LukasTy, @manbearwiz, @mansourcodes, @meaqua9420, @morning-verlu, @oliviertassinari, @rushijagani-dev, @silviuaavram, @siriwatknp, @SR0725, @ZeeshanTamboli, @ZhouYinLong-lab
## 9.2.0
<!-- generated comparing v9.1.2..master -->
_Jul 3, 2026_
A big thanks to the 9 contributors who made this release possible.
- ⚙️ Add support for [`data-*` attributes on `slotProps`](https://mui.com/material-ui/guides/typescript/#allowing-data-attributes-on-slotprops).
### `@mui/material@9.2.0`
- [l10n] Add missing MuiPagination localization to zh-CN locale (#48741) @greymoth-jp
- [select] Guard display ref during mouse down (#48744) @michelengelen
### `@mui/utils@9.2.0`
- [utils] Add opt-in `DataAttributesOverrides` augmentation for slot props (#48554) @LukasTy
### Docs
- [docs] Improve Icon Dialog responsiveness on small screens (#48639) @Prakash1185
- [docs] Fix invalid UTF-8 in skill references (#48739) @mturac
### Core
- [code-infra] Resolve Renovate dashboard warnings (#48700) @Sushantplive
- [code-infra] Validate npm publishing through dry run (#48691) @brijeshb42
- [code-infra] Run prettier after renovate update (#48754) @Janpot
- [code-infra] Fix 'A11y results committed?' check on react-pinned nightly jobs (#48740) @Janpot
- [core] Remove leftover Joy UI references (#48719) @siriwatknp
- [code-infra] Bump react-router to 7.15.1 (#48725) @Janpot
- [docs-infra] Drive docs analytics IDs via ANALYTICS_ENV (#48694) @Janpot
- [docs-infra] Pre-render API page descriptions (#48693) @brijeshb42
- [code-infra][icons-material] Build lib/package.json with code-infra --no-expand (#48689) @Janpot
- [code-infra] Fix react@18/next nightly workflow (#48635) @Janpot
All contributors of this release in alphabetical order: @brijeshb42, @greymoth-jp, @Janpot, @LukasTy, @michelengelen, @mturac, @Prakash1185, @siriwatknp, @Sushantplive
## 9.1.2
<!-- generated comparing v9.1.1..master -->
_Jun 23, 2026_
A big thanks to the 5 contributors who made this release possible.
### `@mui/material@9.1.2`
- [autocomplete] Don't submit forms when committing `freeSolo` value with Enter key (#48679) @mj12albert
- [transitions] Fix RTG import in ESM (#48645) @mj12albert
### `@mui/system@9.1.2`
- [InitColorSchemeScript] Fix script tag warning in Next.js 16 dev mode (#48671) @siriwatknp
### Docs
- Fix typos in release instructions (#48687) @brijeshb42
- Update @mui/x-\* packages to latest (#48661) @Janpot
### Core
- [code-infra] Convert leaf @mui/system .js+.d.ts pairs to TypeScript (part 1) (#48578) @Janpot
- [code-infra] Bump to latest code-infra packages (#48672) @brijeshb42
- [code-infra] Resolve remaining minimatch advisory (#48662) @Janpot
- [code-infra] Bump nx to resolve minimatch advisory (#48658) @Janpot
- [core] Drop @babel/\* pnpm overrides (#48710) @Janpot
- [docs-infra] Revert "Pin StackBlitz demo vite to v7 and plugin-react to v5" (#48709) @Janpot
- [docs-infra] Fix code-block copy button broken on direct page load (#48653) @brijeshb42
- [test] Stabilize Data Grid demo data in Argos screenshots (#48654) @LukasTy
All contributors of this release in alphabetical order: @brijeshb42, @Janpot, @LukasTy, @mj12albert, @siriwatknp
## 9.1.1
<!-- generated comparing v9.1.0..master -->
_Jun 11, 2026_
A big thanks to the 9 contributors who made this release possible.
### `@mui/material@9.1.1`
- [Autocomplete] Update fullWidth prop documentation (#48626) @vipin8797
- [ButtonBase] Fix focus ripple lingering after blur (#48650) @siriwatknp
- [InitColorSchemeScript] Server-render in tests for React 19.3 (#48604) @Janpot
- [Transition] Mount child in same commit when opening from unmounted (#48649) @siriwatknp
### `@mui/styled-engine@9.1.1`
- [styled-engine] Prevent enableCssLayer styles from being overridden by unlayered styles (#48603) @Janpot
### Docs
- Send SOURCE to Brevo on newsletter subscribe (#48633) @aemartos
- fix TypeScript heading capitalization (#48619) @ifer47
- Remove outdated security section (#48628) @oliviertassinari
- [legal] Update EULA links on website (#48642) @rluzists1
### Core
- Update dependencies to resolve Dependabot security alerts (#48641) @Janpot
- [core-docs] Pin StackBlitz demo vite to v7 and plugin-react to v5 (#48643) @Janpot
- [code-infra] Port codebase to use tsgo (#48616) @brijeshb42
- [docs-infra] Fix immutable cache headers for /\_next/static assets (#48655) @brijeshb42
- [docs-infra] Run link checker during docs build instead of as separate CI step (#48634) @Janpot
- [docs-infra] Support turbopack for docs (#48569) @brijeshb42
- [test] Cover docs landing-page composites with Argos (#48589) @LukasTy
All contributors of this release in alphabetical order: @aemartos, @brijeshb42, @ifer47, @Janpot, @LukasTy, @oliviertassinari, @rluzists1, @siriwatknp, @vipin8797
## 9.1.0
<!-- generated comparing v9.0.1..master -->
_Jun 8, 2026_
A big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
- ⚙️ Support for the [prefers-reduced-motion](https://mui.com/material-ui/transitions/#reduced-motion) setting.
- ♿️ Improved support for Windows High Contrast mode with the [enhanceHighContrast](https://mui.com/material-ui/customization/palette/#windows-high-contrast-mode) theme wrapper.
### `@mui/material@9.1.0`
- [autocomplete] Enable clearing highlight when mouse leaves popup (#48354) @mj12albert
- [autocomplete] Fix `freeSolo` controlled values cleared by initial `null` (#48611) @mj12albert
- [autocomplete] Fix item removal when it receives focus from VoiceOver before using Backspace (#48572) @silviuaavram
- [autocomplete] Fix `resetHighlightOnMouseLeave` JSdoc (#48536) @mj12albert
- [autocomplete] Guard against null inputRef during unmount (#48617) @noam3127
- [badge] Add `aria-hidden` to badge content and polish docs demos (#48471) @mj12albert
- [badge] Use inline CSS variables for anchorOrigin/overlap positioning (#48549) @siriwatknp
- [button] Fix customized flex gap styles (#48542) @mj12albert
- [dialog] Fix unwanted `DialogPaper` focus ring (#48535) @mj12albert
- [focus trap] Fix incorrect tab order when `tabIndex >= 1` (#48546) @mj12albert
- [progress] Show runtime errors only once (#48591) @silviuaavram
- [select] Allow spacebar to select elements (#48615) @silviuaavram
- [select] Support typeahead when closed (#48563) @mj12albert
- [step button] Choose higher contrast ripple color for dark mode focus (#48612) @silviuaavram
- [stepper] Include StepConnector inside Step element (#48492) @silviuaavram
- [stepper] Proper support for vertical alternativeLabel (#48485) @silviuaavram
- [tabs] Fix React 18 roving tabindex and dedupe invalid-value warning (#48605) @Janpot
- [theme] Add HighContrast theme enhancer (#48319) @silviuaavram
- [timeline item] Fix extra ::before spacing when TimelineOppositeContent is present (#46663) @tyalau
- [tooltip] Prevent stuck-open tooltip when child becomes disabled (#48606) @Janpot
- [transitions] Custom `Transition` component (#48325) @mj12albert
- [transitions] Support `prefers-reduced-motion` (#48357) @mj12albert
### `@mui/utils@9.1.0`
- [utils] Prevent prototype pollution in fastDeepAssign (#48580) @Janpot
### Docs
- [docs] Add function `slotProps` documentation (#48574) @mj12albert
- [docs] Clarify styled-components version compatibility (#48533) @nightt5879
- [docs] Fix broken URLs (#48520) @oliviertassinari
- [docs] Fix invalid JSON in Zed MCP setup example (#48490) @pavan-sh
- [docs] Mention release version for enhanceHighContrast (#48609) @silviuaavram
- [docs] Remove outdated MUI X v8 notification (#48600) @cherniavskii
- [docs] Remove redundant enhanceHighContrast information (#48632) @silviuaavram
- [docs-infra] Decrease loaded bundle size on docs (#48584) @brijeshb42
- [docs-infra] Drop multi-locale plumbing from API pages (#48370) @brijeshb42
- [docs-infra] Fix Cookie banner heading (#48529) @oliviertassinari
- [docs-infra] Infinitely cache all static assets (#48627) @brijeshb42
- [docs-infra] Remove outdated noSEOadvantage entries (#48527) @oliviertassinari
- [docs-infra] Restore build-only invariant throws via `NEXT_RUNTIME` guard (#48475) @Janpot
- [docs-infra] Test HTML validation in broken links checker (#48088) @Janpot
- [docs][icons] Fix Font Awesome Chip demo in dark mode (#48576) @siriwatknp
- [docs][icons] Remove redundant font awesome demo (#48493) @ZeeshanTamboli
- [docs][modal] Add nested modal guidance (#46507) @JakeSaterlay
- [docs][stepper] Fix focus management in examples (#48494) @silviuaavram
### Core
- Eslint markdown (#48371) @Janpot
- [agents] Fix some docs links (#48561) @silviuaavram
- [blog] Copy editing improvement on v9 announcement blog posts (#48543) @joserodolfofreitas
- [code-infra] Cleanup unused jss packages (#48590) @brijeshb42
- [code-infra] Collapse canary workflows into nightly and nightly-cron (#48556) @Janpot
- [code-infra] Convert @mui/private-theming to TypeScript (#48565) @Janpot
- [code-infra] Convert @mui/styled-engine to TypeScript (#48544) @Janpot
- [code-infra] Convert @mui/styled-engine-sc to TypeScript (#48577) @Janpot
- [code-infra] Fix duplicate resource_class in test_regressions CI job (#48601) @LukasTy
- [code-infra] Make @mui/internal-docs-utils compatible with TypeScript 6 (#48594) @Janpot
- [code-infra] Migrate CircleCI jobs to Gen2 resource classes (#48593) @LukasTy
- [code-infra] Parallelize visual regression screenshots (#48557) @Janpot
- [code-infra] Run nightly-cron on v7.x (#48579) @Janpot
- [core] Fix typescript@next typecheck (#48587) @Janpot
- [pnpm] Add security settings to pnpm-workspace.yaml (#48582) @Janpot
- [styled-engine-sc] Fix compatibility with Vite and Vitest (#48558) @mj12albert
- [test] Add axe-core tests for mui-material (#48341) @siriwatknp
- [test] Configure Tailwind CSS in the visual-regression app (#48575) @Janpot
All contributors of this release in alphabetical order: @brijeshb42, @cherniavskii, @JakeSaterlay, @Janpot, @joserodolfofreitas, @LukasTy, @mj12albert, @nightt5879, @noam3127, @oliviertassinari, @pavan-sh, @silviuaavram, @siriwatknp, @tyalau, @ZeeshanTamboli
## 9.0.1
<!-- generated comparing v9.0.0..master -->
_May 6, 2026_
A big thanks to the 25 contributors who made this release possible.
### `@mui/material@9.0.1`
- [accessibility] HighContrast mode on Avatar, Badge, Slider and Switch (#48320) @silviuaavram
- [autocomplete] Fix highlight sync and scroll preservation (#48322) @mj12albert
- [autocomplete] Fix input value and clear (#48263) @mj12albert
- [autocomplete] Fix iOS group scrollbar overflow (#48400) @oliviertassinari
- [autocomplete] Fix popper rendering issues (#48327) @mj12albert
- [autocomplete] Improve highlight tracking and selection state (#48219) @mj12albert
- [button] Fix `startIcon` alignment (#48332) @mj12albert
- [button][button base] Document `type` attribute (#48146) @mj12albert
- [button][fab][menu item][list item button] Remove duplicated className entries (#48213) @silviuaavram
- [checkbox] Set `aria-checked=mixed` when indeterminate (#48147) @mj12albert
- [circularprogress][linearprogress] Improve accessibility (#48172) @silviuaavram
- [dialog][drawer][focus trap] Fix initial focus target (#48280) @mj12albert
- [drawer] Fix swipe close flicker (#48372) @mj12albert
- [drawer] Fix transition jump (#48308) @mj12albert
- [focus trap] Remove IE 11-specific focus safety check from FocusTrap cleanup (#48368) @ZeeshanTamboli
- [form controls] Add internal `useFormControlState` hook (#48344) @mj12albert
- [icon button] Remove unused color palette mapping in styles (#48353) @sai6855
- [icons] Revert to using wildcard export paths (#48381) @brijeshb42
- [input] Fix layout shift with display: flex (#43839) @oliviertassinari
- [input] Prevent `notched` prop leaking into DOM (#48281) @mj12albert
- [input base] Place aria-label on the input element (#48283) @silviuaavram
- [inputs] Fix autofocus in SSR environment (#48290) @mj12albert
- [List] Fix sticky subheader overlapping iOS scrollbar (#48375) @sandeshdamkondwar
- [popper] Persist positioning styles when popperOptions changes reference (#48121) @mj12albert
- [select] Stop using combobox element for labeling (#48251) @silviuaavram
- [select] Support single-pointer-cycle selection and pointer cancellation (#48328) @mj12albert
- [switch] Fix incorrect `role` with `slotProps.input` (#48469) @mj12albert
- [tabs] Fix scrollable tabs blocking pointer events (#48166) @mj12albert
- [textfield] Fix autofill styles always in dark mode when CSS variables is used (#48244) @ZeeshanTamboli
- [tooltip] Simplify RTL styles using CSS logical properties (#48351) @sai6855
- [tooltip] Close Tooltip when its child becomes disabled (#44507) @chudesno
- [typography] Fix `h4` variant when using `responsiveFontSizes()` (#48314) @mj12albert
- [useMediaQuery] Fix crash in Firefox extension (#45196) @Mr-Quin
### `@mui/system@9.0.1`
- [system] Fix theme mutation when using responsive typography shorthand in sx (#48266) @tomups
### `@mui/codemod@9.0.1`
- [codemod] Add --jsx option to `v9.0.0/system-props` codemod (#48315) @siriwatknp
- [codemod] Add packageName support to the v9 system props codemod (#48253) @franco-dias
### `@mui/utils@9.0.1`
- [utils] Add shadow dom utils (#48256) @mj12albert
- [utils] Fix `resolveProps` receiving empty string className (#48289) @SAY-5
- [utils] Remove unnecessary `excludeKeys` from `extractEventHandlers` (#48481) @ZeeshanTamboli
### Docs
- [docs][autocomplete] Add demo with Tanstack Query `useInfiniteQuery` (#48356) @mj12albert
- [docs] Add agent skills for styling, theming, Next.js, and Tailwind CSS integrations (#48187) @mapache-salvaje
- [docs] Cleanup `@mui/base` (#48278) @mj12albert
- [docs] Fix create-playground script (#48380) @imazizbohra
- [docs] Fix date range calendar demo after MUI X v9 update (#48262) @LukasTy
- [docs] Fix icon search modal (#48255) @mj12albert
- [docs] Fix Material UI and MUI system "Upgrade to v9" docs (#48245) @ZeeshanTamboli
- [docs] Fix Popover JSdoc (#48310) @nitzan-treg
- [docs] Fix RTL toggle highlight in docs settings drawer (#48476) @sai6855
- [docs] Fix typos (#48155) @ayushshukla1807
- [docs] Fix typos (#48270) @pavan-sh
- [docs] Fix versions page (#48261) @mnajdova
- [docs] Fix vision grammar (#48477) @pavan-sh
- [docs] Improve accessibility for select examples (#48250) @silviuaavram
- [docs] Improve CSP guide with required directives (#48258) @Janpot
- [docs] Link to agent skills in relevant docs (#48387) @mapache-salvaje
- [docs] Make NumberField described by helper text (#48257) @silviuaavram
- [docs] Remove esm.sh references and endorsement (#44649) (#48330) @starboyvarun
- [docs] Remove generated CSS utility component doc (#48383) @mj12albert
- [docs] Remove incorrect message from experiments page and hide `/experiments` from crawlers (#48297) @ZeeshanTamboli
- [docs] Remove outdated references of .ttf and .woff (#48399) @oliviertassinari
- [docs] Restore wider maxWidth for `disableToc` pages (#48260) @LukasTy
- [docs] Show v9 announcement banner (#48242) @mnajdova
- [docs] Sync team members from frontend-public endpoint (#48273) @Janpot
- [docs] Update AGENTS.md testing section (#48392) @mj12albert
- [docs] Update e2e test README and test error message (#48285) @ZeeshanTamboli
- [docs] Update menu examples to always have aria-expanded (#48211) @silviuaavram
- [docs] Update MUI Treasury links (#47760) @siriwatknp
- [docs] Update MUI X dependencies to v9.0.0 (#48231) @siriwatknp
- [docs] Update MUI X roadmap section (#48316) @siriwatknp
- [docs] Update WCAG links and version from 2.1 to 2.2 (#48379) @mj12albert
- [docs] Use `React.useId()` for demo IDs (#48300) @Janpot
### Core
- [blog] Introducing Material UI and MUI X v9 (#48157) @joserodolfofreitas
- [code-infra] bundle size check internal core docs (#48390) @Janpot
- [code-infra] Deduplicate vale script (#48385) @brijeshb42
- [code-infra] Fix type shadowing (#48389) @Janpot
- [code-infra] Migrate to vite from webpack for e2e tests (#48248) @brijeshb42
- [code-infra] Remove a few ts-ignore comments (#43265) @Janpot
- [code-infra] Remove no longer needed `eslint-import-resolver-webpack` package (#48207) @ZeeshanTamboli
- [code-infra] Remove references to @mui/base and @mui/joy (#48358) @brijeshb42
- [code-infra] Use vale rules from code-infra package (#48173) @brijeshb42
- [core] Remove next.mui.com links (#48240) @mnajdova
- [core-docs] Use type-only imports for type-only references (#48386) @JCQuintas
- [docs-infra] Add x-chat to MuiProductId type and product switcher (#48209) @hasdfa
- [docs-infra] Fix duplicate JSDoc in proptypes generation (#48304) @brijeshb42
- [docs-infra] Fix duplicate JSDoc in proptypes generation for merged declarations (#48296) @brijeshb42
- [docs-infra] Fix import of cjs react-simple-code-editor in esm (#48349) @brijeshb42
- [docs-infra] Fix tab index on Base UI tab (#48345) @brijeshb42
- [docs-infra] Migrate docs app container/frame components (#48182) @brijeshb42
- [docs-infra] Migrate MarkdownDocs component to docs package (#48227) @brijeshb42
- [docs-infra] Re-apply changes from previous revert (#48243) @brijeshb42
- [docs-infra] Remove infra around the i18n setup (#48360) @brijeshb42
- [docs-infra] Rename package to @mui/internal-api-docs-builder (#48230) @brijeshb42
- [docs-infra] Revert JSDoc in proptypes generation for merged declarations (#48301) @brijeshb42
- [docs-infra] Revert Migrate docs app container/frame components (#48239) @brijeshb42
- [docs-infra] Revert Migrate MarkdownDocs component to docs package (#48238) @brijeshb42
- [internal] Add missing #host-reference (#48226) @silviuaavram
- [internal] Move changelog and update security page for post v9 release (#48298) @siriwatknp
- [internal] Remove outdated .woff files (#48398) @oliviertassinari
- [test] Fix autocomplete test description (#48395) @ZeeshanTamboli
All contributors of this release in alphabetical order: @ayushshukla1807, @brijeshb42, @chudesno, @franco-dias, @hasdfa, @imazizbohra, @Janpot, @JCQuintas, @joserodolfofreitas, @LukasTy, @mapache-salvaje, @mj12albert, @mnajdova, @Mr-Quin, @nitzan-treg, @oliviertassinari, @pavan-sh, @sai6855, @sandeshdamkondwar, @SAY-5, @silviuaavram, @siriwatknp, @starboyvarun, @tomups, @ZeeshanTamboli
## 9.0.0
<!-- generated comparing v9.0.0-beta.1..master -->
_Apr 7, 2026_
A big thanks to the 7 contributors who made this release possible.
🥳 We're excited to announce the stable release of Material UI v9! This major release focus on accessibility improvements, sx prop performance, and cleanup of deprecated APIs.
For more details, check out the [upgrade guide](https://mui.com/material-ui/migration/upgrade-to-v9/).
### `@mui/material@9.0.0`
- [slider] Use pointer events instead of mouse events (#48164) @mj12albert
- [switch] Add border to make it visible in high contrast mode (#48180) @silviuaavram
- [transitions] Performance improvements & misc fixes (#48151) @mj12albert
- Remove unnecessary overridesResolvers from styled components (#48204) @sai6855
### Core
- [code-infra] Setup workflow to publish internal packages (#47952) @brijeshb42
- [core-docs] Add `x-scheduler` to `MuiProductId` type (#48185) @rita-codes
- [docs-infra] Add scheduler to product switcher (#48208) @rita-codes
- [internal] Prepare libraries for v9 stable release (#48206) @siriwatknp
All contributors of this release in alphabetical order: @brijeshb42, @mj12albert, @noraleonte, @rita-codes, @sai6855, @silviuaavram, @siriwatknp
## 9.0.0-beta.1
<!-- generated comparing v9.0.0-beta.0..master -->
_Apr 2, 2026_
A big thanks to the 11 contributors who made this release possible.
### `@mui/material@9.0.0-beta.1`
#### Breaking Changes
- [grid] Remove 'column' and 'column-reverse' options from `direction` prop (#47564) @sai6855
- [icons] Remove legacy `*Outline` icons (#48116) @mj12albert
- [list-item-icon] Use theme spacing instead of hardcoded minWidth (#46597) @adiitxa
#### Changes
- [all components] Fix `slotProps.transition` types (#48153) @mj12albert
- [alert][dialog] Accessibility improvements (#48113) @silviuaavram
- [autocomplete] Fix helper text focusing input when clicked (#48156) @mj12albert
- [button-base] Add `nativeButton` prop (#47989) @mj12albert
- [input] Fix high contrast cutoff on first character (#48150) @silviuaavram
- [menu] Fix empty roving focus container (#48114) @mj12albert
- [utils] Explicitly register roving tab items with parent (#48122) @mj12albert
### Docs
- Fix HTML validation errors (#48107) @Janpot
- Fix duplicate IDs and HTML validation issues (#48095) @Janpot
- Fix the dark mode footer row shadow for the Data Grid on the advanced components page (#48149) @arminmeh
- Improve jsdom section (#48098) @oliviertassinari
- Update "Deprecated APIs removed" section to h2 in "Upgrade to v9" docs (#48115) @ZeeshanTamboli
- [docs][progress] Label all demo components (#48143) @mj12albert
- [docs-infra] Add x-scheduler to component API URL resolver (#48097) @rita-codes
- [docs-infra] Resolve some redirects (#48165) @Janpot
- [docs-infra] Update v9 Search Index (#48028) @dav-is
### Core
- [code-infra] Discover exports for bundle size report (#48170) @Janpot
- [internal] Fix use of ellipsis (#48096) @oliviertassinari
- [test] Add screenshot test for Virtualized Table (#47947) @mnajdova
- [test] Remove `componentsProp` from `describeConformance` tests (#48142) @ZeeshanTamboli
- [theme] Do not create channel tokens for custom colors when `nativeColor` is used (#47765) @ZeeshanTamboli
All contributors of this release in alphabetical order: @adiitxa, @arminmeh, @dav-is, @Janpot, @mj12albert, @mnajdova, @oliviertassinari, @rita-codes, @sai6855, @silviuaavram, @ZeeshanTamboli
## 9.0.0-beta.0
<!-- generated comparing v9.0.0-alpha.4..master -->
_Mar 25, 2026_
A big thanks to the 8 contributors who made this release possible.
### `@mui/material@9.0.0-beta.0`
#### Breaking Changes
- [linear-progress] Remove deprecated CSS classes (#48068) @mj12albert
- [list-item, list-item-text] Remove deprecated props (#48042) @siriwatknp
- [button-group] Remove deprecated classes (#48043) @siriwatknp
- [card] Remove deprecated CardHeader props (#47995) @silviuaavram
- [checkbox][radio][switch] Remove deprecated inputProps and inputRef (#48059) @siriwatknp
- [chip] Remove deprecated classes (#48046) @silviuaavram
- [dialog][modal][drawer][swipeabledrawer] Remove deprecated props and classes (#48039) @silviuaavram
- [divider] Remove deprecated CSS classes (#48075) @siriwatknp
- [drawer] Remove deprecated CSS classes (#48077) @siriwatknp
- [image-list-item-bar] Remove deprecated CSS classes (#48064) @siriwatknp
- [inputs] Remove deprecated props & classes (#48071) @mj12albert
- [material-ui] Remove unnecessary overridesResolvers from styled components (#48082) @ZeeshanTamboli
- [material-ui][system] Remove deprecated system props from Box, Stack, Typography (#48072) @siriwatknp
- [pagination-item] Remove deprecated CSS classes (#48076) @siriwatknp
- [pagination-item] Remove deprecated props (#48038) @siriwatknp
- [rating] Remove deprecated IconContainerComponent (#48019) @siriwatknp
- [select] Remove deprecated CSS classes (#48065) @mj12albert
- [slider] Remove deprecated CSS classes (#48074) @siriwatknp
- [step-connector][step-content][step-label] Remove deprecated props and classes (#48058) @siriwatknp
- [tabs][tab] Remove deprecated CSS classes (#48078) @siriwatknp
- [table-pagination][table-sort-label] Remove deprecated props and classes (#48060) @siriwatknp
- [toggle-button-group] Remove deprecated classes (#48061) @siriwatknp
#### Changes
- [system] Improve performance when using sx prop (#44254) @romgrk
### `@mui/codemod@9.0.0-beta.0`
- [codemod] Add missing codemod links in upgrade guide (#48069) @silviuaavram
### Docs
- Mention all breaking changes in changelog (#48091) @silviuaavram
- Fix link to upgrade-to-v9 docs in release CHANGELOG (#48081) @ZeeshanTamboli
### Core
- Update browserslistrc (#48085) @silviuaavram
- [code-infra] Prevent major version updates of bundler/framework packages in bundling fixtures (#48062) @Copilot
- [code-infra][icons-material] Avoid material utils barrel in createSvgIcon (#48029) @anchmelev
- [docs-infra] Migrate more leaf components to mui-docs (#48018) @brijeshb42
All contributors of this release in alphabetical order: @anchmelev, @brijeshb42, @Copilot, @mj12albert, @romgrk, @silviuaavram, @siriwatknp, @ZeeshanTamboli
## 9.0.0-alpha.4
<!-- generated comparing v9.0.0-alpha.3..master -->
_Mar 20, 2026_
A big thanks to the 11 contributors who made this release possible.
### `@mui/material@9.0.0-alpha.4`
#### Breaking Changes
- [accordion] Remove deprecated props (#47963) @silviuaavram
- `TransitionComponent`
- `TransitionProps`
- [accordionsummary] Remove deprecated CSS class (#48006) @silviuaavram
- `contentGutters`
- [alert] Remove deprecated CSS classes (#48011) @silviuaavram
- `standardSuccess`
- `standardInfo`
- `standardWarning`
- `standardError`
- `outlinedSuccess`
- `outlinedInfo`
- `outlinedWarning`
- `outlinedError`
- `filledSuccess`
- `filledInfo`
- `filledWarning`
- `filledError`
- [alert] Remove deprecated props (#47965) @silviuaavram
- `components`
- `componentsProps`
- [autocomplete] Remove deprecated props (#47864) @ZeeshanTamboli
- `ChipProps`
- `componentsProps`
- `ListboxComponent`
- `ListboxProps`
- `PaperComponent`
- `PopperComponent`
- `renderTags`
- [avatar] Remove deprecated props (#47966) @silviuaavram
- `imgProps`
- [avatargroup] Remove deprecated props (#47968) @silviuaavram
- `componentsProps`
- [backdrop] Remove deprecated props (#47991) @silviuaavram
- `components`
- `componentsProps`
- `TransitionComponent`
- [badge] Remove deprecated props (#47993) @silviuaavram
- `components`
- `componentsProps`
- [button] Remove deprecated CSS classes (#48012) @silviuaavram
- Color variant classes: `textInherit`, `outlinedPrimary`, `containedSecondary`, etc.
- Size classes: `textSizeSmall`, `iconSizeMedium`, etc.
- [circularprogress] Remove deprecated CSS classes (#48014) @silviuaavram
- `circleDeterminate`
- `circleIndeterminate`
- [divider] Remove deprecated prop (#48013) @atharva3333
- `light`
- [formcontrollabel] Remove deprecated props (#48032) @atharva3333
- `componentsProps`
- [menu] Remove deprecated props (#48021) @siriwatknp
- `MenuListProps`
- `PaperProps`
- `TransitionProps`
- [mobilestepper] Remove deprecated props (#48041) @siriwatknp
- `LinearProgressProps`
- [popover] Remove deprecated props (#48021) @siriwatknp
- `BackdropComponent`
- `BackdropProps`
- `PaperProps`
- `TransitionComponent`
- `TransitionProps`
- [popper] Remove deprecated props (#48020) @siriwatknp
- `components`
- `componentsProps`
- [select] Remove deprecated props passed via `MenuProps` (#48021) @siriwatknp
- `MenuListProps`
- `PaperProps`
- `TransitionProps`
- [slider] Remove deprecated props (#47996) @siriwatknp
- `components`
- `componentsProps`
- [speeddial] Remove deprecated props (#47998) @siriwatknp
- `TransitionComponent`
- `TransitionProps`
- [speeddialaction] Remove deprecated props (#47998) @siriwatknp
- `FabProps`
- `tooltipTitle`
- `tooltipPlacement`
- `tooltipOpen`
- `TooltipClasses`
- [tabs] Remove deprecated props (#48017) @siriwatknp
- `ScrollButtonComponent`
- `TabIndicatorProps`
- `TabScrollButtonProps`
- `slots.StartScrollButtonIcon`
- `slots.EndScrollButtonIcon`
- [textfield] Remove deprecated props (#47878) @ZeeshanTamboli
- `InputProps`
- `inputProps`
- `SelectProps`
- `InputLabelProps`
- `FormHelperTextProps`
- [tooltip] Remove deprecated props (#47988) @siriwatknp
- `components`
- `componentsProps`
- `PopperComponent`
- `PopperProps`
- `TransitionComponent`
- `TransitionProps`
- [typography] Remove deprecated prop (#47986) @siriwatknp
- `paragraph`
- [buttonbase] Key handlers should not run on a disabled non-native button (#48003) @mj12albert
- [tablepagination] Format pagination numbers according to locale (#47803) @siriwatknp
- [textfield] Use non-native label for `<TextField select/>` (#47958) @mj12albert
Check out the [v9 upgrade guide](https://mui.com/material-ui/migration/upgrade-to-v9/).
#### Changes
- [autocomplete] Optimize selected option lookup (#47953) @anchmelev
- [buttonbase] Fix native button detection (#47985) @mj12albert
- [inputbase] Fix test using removed InputProps on TextField (#48000) @siriwatknp
- [popper] Add missing classes export (#48031) @mj12albert
- [select] Fix focus visible always set on menu item (#47912) @silviuaavram
- [slider] Fix focus visible styles incorrectly applied by pointer (#47894) @mj12albert
- [slider] Accept readonly array for the value prop (#47936) @pcorpet
### `@mui/codemod@9.0.0-alpha.4`
- [codemod] Add slot key rename to `tabs-props` codemod and add to README (#48035) @siriwatknp
- [codemod] Add card-header-props migration guide (#48005) @siriwatknp
### Docs
- [blog] Lowercase 2026-MUI-X-price-changes blog post URL (#47871) @Janpot
- [docs] Wide docs layout (#47950) @noraleonte
- [docs] Mention the list of props removed in upgrade guide (#48010) @silviuaavram
- [docs] Update Autocomplete deprecated props removal migration guide docs (#47990) @ZeeshanTamboli
- [docs-infra] Extract shared App component from \_app into @mui/docs (#47933) @brijeshb42
- [docs-infra] Expose global theme object (#47964) @Janpot
- [docs][system] Update `styled` API docs for easier understanding (#47957) @olivier-lxo
### Core
- [code-infra] Add pkg-pr-new as dev dependency (#47992) @Janpot
- [code-infra] Remove CI coverage collection and upload to Codecov (#47930) @Janpot
- [core] Migrate to ESLint 10 (#47872) @brijeshb42
- [core] Remove GridLegacy component (#47956) @siriwatknp
All contributors of this release in alphabetical order: @anchmelev, @atharva3333, @brijeshb42, @Janpot, @mj12albert, @noraleonte, @olivier-lxo, @pcorpet, @silviuaavram, @siriwatknp, @ZeeshanTamboli
## 9.0.0-alpha.3
<!-- generated comparing v9.0.0-alpha.2..master -->
_Mar 12, 2026_
A big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
- 📖 A new [Menubar](https://mui.com/material-ui/react-menubar/) component page integrated with [Base UI](https://base-ui.com/react/components/menubar)
- ♿️ Improved the Roving TabIndex keyboard navigation for the Stepper, Tabs and MenuList components.
### `@mui/material@9.0.0-alpha.3`
#### Breaking Changes
- [stepper][menulist][tabs] Improve accessibility (#47687) @silviuaavram
#### Changes
- [autocomplete] Add `root` slot (#47852) @GerardasB
- [autocomplete] Fix popup reopening on window focus regain with openOnFocus (#47790) @aman44444
- [autocomplete] Support full slots for clearIndicator and popupIndicator (#47891) @silviuaavram
- [material-ui] Partially revert "[material-ui] Clean up duplicated CSS rules (#47838)" (#47927) @sai6855
### Docs
- [docs][codemod] Add v7 migration docs for deprecated Autocomplete APIs and Autocomplete codemod (#47945) @ZeeshanTamboli
- [docs] Update faq about vendor chunks (#47747) @Janpot
- [docs] Use direct palette vars in Tailwind v4 snippet (#47940) @Ahmad-Alaziz
- [docs][menubar] Add Menubar component page (#47616) @siriwatknp
### Core
- [core] Fix the release prepare steps (#47951) @silviuaavram
- [core] Remove Joy UI code and docs (#47939) @mnajdova
- [code-infra] Add previously missed export of themeCssVarsAugmentation (#47918) @brijeshb42
- [docs-infra] Import font module for nextjs transpilation (#47935) @brijeshb42
- [docs-infra] Migrate simpler modules from docs to mui-docs (#47897) @brijeshb42
- [test] Fix detached anchorEl elements in tests (#47929) @Janpot
All contributors of this release in alphabetical order: @Ahmad-Alaziz, @aman44444, @brijeshb42, @GerardasB, @Janpot, @mnajdova, @sai6855, @silviuaavram, @siriwatknp, @ZeeshanTamboli
## 9.0.0-alpha.2
<!-- generated comparing v9.0.0-alpha.1..master -->
_Mar 5, 2026_
A big thanks to the 4 contributors who made this release possible.
### @mui/material@9.0.0-alpha.2
- Clean up duplicated CSS rules (#47838) @sai6855
### @mui/system@9.0.0-alpha.2
- Refactor sortContainerQueries to define regex outside of sort function (#47817) @sai6855
### Docs
- Move shared components to @mui/docs package (#47672) @Janpot
- Fix small typo in NumberField page (#47877) @arthur-plazanet
### Core
- [code-infra] Reduce paths for attw checks (#47896) @brijeshb42
- [docs-infra] Run syncTeamMembers (#47900) @Janpot
All contributors of this release in alphabetical order: @arthur-plazanet, @brijeshb42, @Janpot, @sai6855
## 9.0.0-alpha.1
<!-- generated comparing v9.0.0-alpha.0..master -->
_Feb 26, 2026_
A big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
### @mui/material@9.0.0-alpha.1
#### Breaking Changes
- [Autocomplete] Prevents Autocomplete menu from opening on right click (#47797) @silviuaavram
- [Backdrop] Remove aria-hidden by default (#47798) @silviuaavram
- [ButtonBase] Ensure that onClick propagates when non-native button is clicked (#47800) @silviuaavram
- [Dialog][Modal] Remove `disableEscapeKeyDown` prop (#47695) @silviuaavram
- [Grid] Remove system props support (#47846) @siriwatknp
- [theme] Remove MuiTouchRipple from theme component types (#47849) @siriwatknp
- [useAutocomplete] Improve isOptionEqualToValue value argument type (#47801) @silviuaavram
#### Changes
- [TableCell][theme] Apply `alpha` before color mixing to border bottom color when nativeColor + cssVariables is used (#47762) @ZeeshanTamboli
- [Tooltip] Fix error is thrown when wrapping an input which is disabled while focused (#47684) @ZeeshanTamboli
### Docs
- [docs] Add updated community theme resource (#47847) @PeterTYLiu
- [docs] Few copy fixes (#47806) @pavan-sh
- [docs] Fix IPA reader link in blog post (#47796) @pavan-sh
- [docs] Fix JSX in Overriding component structure docs (#47799) @ZeeshanTamboli
- [docs] Fix the keyboard navigation in GroupedMenu example (#47842) @silviuaavram
- [docs] Fix Theme builder video (#47835) @oliviertassinari
- [docs] Update pricing sankey as done (#47795) @alexfauquette
- [docs][system] Update sizing docs to clarify `(0, 1]` behavior. (#47845) @matthias-ccri
### Core
- [blog] Blogpost for upcoming price changes for MUI X (#47748) @DanailH
- [code-infra] Detect browser envs that don't support layout (#47813) @Janpot
- [code-infra] Enable undefined addition to optional properties (#47750) @brijeshb42
- [code-infra] Exclusively enable test mode in jsdom (#47812) @Janpot
- [code-infra] Fix console.warn during test (#47802) @Janpot
- [code-infra] Remove vale as a workspace dependency (#47860) @brijeshb42
- [code-infra] Setup flat build for packages (#47670) @brijeshb42
- [code-infra] Upgrade react-docgen to v8 (#47685) @JCQuintas
- [docs-infra] Reapply Cookie Banner with Design Fixes (#47744) @dav-is
- [internal] Remove legacy MUI Base API docs (#47804) @ZeeshanTamboli
All contributors of this release in alphabetical order: @alexfauquette, @brijeshb42, @DanailH, @dav-is, @Janpot, @JCQuintas, @matthias-ccri, @oliviertassinari, @pavan-sh, @PeterTYLiu, @silviuaavram, @siriwatknp, @ZeeshanTamboli
## 9.0.0-alpha.0
<!-- generated comparing v7.3.8..master -->
_Feb 17, 2026_
A big thanks to the 3 contributors who made this release possible.
### @mui/material@9.0.0-alpha.0
- [theme] Generate `color-mix` value on top of default generated Material UI CSS variables (#47767) @ZeeshanTamboli
### Docs
- [docs] Make tooltips describe their visible text triggers (#47658) @silviuaavram
- [docs][theme] Fix `nativeColor` docs (#47759) @ZeeshanTamboli
### Core
- [blog] A pattern for opt-in type-only breaking changes in minor versions (#47622) @bernardobelchior
- [internal] Prepare libraries for first v9 alpha release (#47756) @silviuaavram
All contributors of this release in alphabetical order: @bernardobelchior, @silviuaavram, @ZeeshanTamboli
## Older versions
Changes before 9.x are listed in our [changelog for older versions](https://github.com/mui/material-ui/blob/HEAD/CHANGELOG.old.md).
Note: v8 is skipped to align the release version with MUI X v9.
@@ -0,0 +1,7 @@
import * as CSS from 'csstype';
/**
* All non-vendor-prefixed CSS properties. (Also allows `number` in order to support CSS-in-JS libs,
* since they are converted to `px`.)
*/
export interface CSSProperties extends CSS.StandardProperties<number | string>, CSS.SvgProperties<number | string> {}
@@ -0,0 +1,7 @@
import * as CSS from 'csstype';
/**
* All non-vendor-prefixed CSS properties. (Also allows `number` in order to support CSS-in-JS libs,
* since they are converted to `px`.)
*/
export interface CSSProperties extends CSS.StandardProperties<number | string>, CSS.SvgProperties<number | string> {}
@@ -0,0 +1,13 @@
/**
*
* Demos:
*
* - [Container (Material UI)](https://mui.com/material-ui/react-container/)
* - [Container (MUI System)](https://mui.com/system/react-container/)
*
* API:
*
* - [Container API](https://mui.com/system/api/container/)
*/
declare const Container: import("@mui/types").OverridableComponent<import("./ContainerProps.mjs").ContainerTypeMap<{}, "div">>;
export default Container;
@@ -0,0 +1,13 @@
/**
*
* Demos:
*
* - [Container (Material UI)](https://mui.com/material-ui/react-container/)
* - [Container (MUI System)](https://mui.com/system/react-container/)
*
* API:
*
* - [Container API](https://mui.com/system/api/container/)
*/
declare const Container: import("@mui/types").OverridableComponent<import("./ContainerProps.js").ContainerTypeMap<{}, "div">>;
export default Container;
@@ -0,0 +1,66 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _createContainer = _interopRequireDefault(require("./createContainer"));
/**
*
* Demos:
*
* - [Container (Material UI)](https://mui.com/material-ui/react-container/)
* - [Container (MUI System)](https://mui.com/system/react-container/)
*
* API:
*
* - [Container API](https://mui.com/system/api/container/)
*/
const Container = (0, _createContainer.default)();
process.env.NODE_ENV !== "production" ? Container.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* @ignore
*/
children: _propTypes.default.node,
/**
* Override or extend the styles applied to the component.
*/
classes: _propTypes.default.object,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: _propTypes.default.elementType,
/**
* If `true`, the left and right padding is removed.
* @default false
*/
disableGutters: _propTypes.default.bool,
/**
* Set the max-width to match the min-width of the current breakpoint.
* This is useful if you'd prefer to design for a fixed set of sizes
* instead of trying to accommodate a fully fluid viewport.
* It's fluid by default.
* @default false
*/
fixed: _propTypes.default.bool,
/**
* Determine the max-width of the container.
* The container width grows with the size of the screen.
* Set to `false` to disable `maxWidth`.
* @default 'lg'
*/
maxWidth: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), _propTypes.default.string]),
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
} : void 0;
var _default = exports.default = Container;
@@ -0,0 +1,61 @@
'use client';
import PropTypes from 'prop-types';
import createContainer from "./createContainer.mjs";
/**
*
* Demos:
*
* - [Container (Material UI)](https://mui.com/material-ui/react-container/)
* - [Container (MUI System)](https://mui.com/system/react-container/)
*
* API:
*
* - [Container API](https://mui.com/system/api/container/)
*/
const Container = createContainer();
process.env.NODE_ENV !== "production" ? Container.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* @ignore
*/
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
*/
classes: PropTypes.object,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: PropTypes.elementType,
/**
* If `true`, the left and right padding is removed.
* @default false
*/
disableGutters: PropTypes.bool,
/**
* Set the max-width to match the min-width of the current breakpoint.
* This is useful if you'd prefer to design for a fixed set of sizes
* instead of trying to accommodate a fully fluid viewport.
* It's fluid by default.
* @default false
*/
fixed: PropTypes.bool,
/**
* Determine the max-width of the container.
* The container width grows with the size of the screen.
* Set to `false` to disable `maxWidth`.
* @default 'lg'
*/
maxWidth: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), PropTypes.string]),
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
} : void 0;
export default Container;
@@ -0,0 +1,40 @@
import * as React from 'react';
import { OverrideProps } from '@mui/types';
import { SxProps } from "../styleFunctionSx/index.mjs";
import { Theme, Breakpoint } from "../createTheme/index.mjs";
import { ContainerClasses } from "./containerClasses.mjs";
export interface ContainerTypeMap<AdditionalProps = {}, DefaultComponent extends React.ElementType = 'div'> {
props: AdditionalProps & {
children?: React.ReactNode;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<ContainerClasses> | undefined;
/**
* If `true`, the left and right padding is removed.
* @default false
*/
disableGutters?: boolean | undefined;
/**
* Set the max-width to match the min-width of the current breakpoint.
* This is useful if you'd prefer to design for a fixed set of sizes
* instead of trying to accommodate a fully fluid viewport.
* It's fluid by default.
* @default false
*/
fixed?: boolean | undefined;
/**
* Determine the max-width of the container.
* The container width grows with the size of the screen.
* Set to `false` to disable `maxWidth`.
* @default 'lg'
*/
maxWidth?: Breakpoint | false | undefined;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme> | undefined;
};
defaultComponent: DefaultComponent;
}
export type ContainerProps<RootComponent extends React.ElementType = ContainerTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<ContainerTypeMap<AdditionalProps, RootComponent>, RootComponent>;
@@ -0,0 +1,40 @@
import * as React from 'react';
import { OverrideProps } from '@mui/types';
import { SxProps } from "../styleFunctionSx/index.js";
import { Theme, Breakpoint } from "../createTheme/index.js";
import { ContainerClasses } from "./containerClasses.js";
export interface ContainerTypeMap<AdditionalProps = {}, DefaultComponent extends React.ElementType = 'div'> {
props: AdditionalProps & {
children?: React.ReactNode;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<ContainerClasses> | undefined;
/**
* If `true`, the left and right padding is removed.
* @default false
*/
disableGutters?: boolean | undefined;
/**
* Set the max-width to match the min-width of the current breakpoint.
* This is useful if you'd prefer to design for a fixed set of sizes
* instead of trying to accommodate a fully fluid viewport.
* It's fluid by default.
* @default false
*/
fixed?: boolean | undefined;
/**
* Determine the max-width of the container.
* The container width grows with the size of the screen.
* Set to `false` to disable `maxWidth`.
* @default 'lg'
*/
maxWidth?: Breakpoint | false | undefined;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme> | undefined;
};
defaultComponent: DefaultComponent;
}
export type ContainerProps<RootComponent extends React.ElementType = ContainerTypeMap['defaultComponent'], AdditionalProps = {}> = OverrideProps<ContainerTypeMap<AdditionalProps, RootComponent>, RootComponent>;
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,22 @@
export interface ContainerClasses {
/** Styles applied to the root element. */
root: string;
/** Styles applied to the root element if `disableGutters={true}`. */
disableGutters: string;
/** Styles applied to the root element if `fixed={true}`. */
fixed: string;
/** Styles applied to the root element if `maxWidth="xs"`. */
maxWidthXs: string;
/** Styles applied to the root element if `maxWidth="sm"`. */
maxWidthSm: string;
/** Styles applied to the root element if `maxWidth="md"`. */
maxWidthMd: string;
/** Styles applied to the root element if `maxWidth="lg"`. */
maxWidthLg: string;
/** Styles applied to the root element if `maxWidth="xl"`. */
maxWidthXl: string;
}
export type ContainerClassKey = keyof ContainerClasses;
export declare function getContainerUtilityClass(slot: string): string;
declare const containerClasses: ContainerClasses;
export default containerClasses;
@@ -0,0 +1,22 @@
export interface ContainerClasses {
/** Styles applied to the root element. */
root: string;
/** Styles applied to the root element if `disableGutters={true}`. */
disableGutters: string;
/** Styles applied to the root element if `fixed={true}`. */
fixed: string;
/** Styles applied to the root element if `maxWidth="xs"`. */
maxWidthXs: string;
/** Styles applied to the root element if `maxWidth="sm"`. */
maxWidthSm: string;
/** Styles applied to the root element if `maxWidth="md"`. */
maxWidthMd: string;
/** Styles applied to the root element if `maxWidth="lg"`. */
maxWidthLg: string;
/** Styles applied to the root element if `maxWidth="xl"`. */
maxWidthXl: string;
}
export type ContainerClassKey = keyof ContainerClasses;
export declare function getContainerUtilityClass(slot: string): string;
declare const containerClasses: ContainerClasses;
export default containerClasses;
@@ -0,0 +1,15 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.getContainerUtilityClass = getContainerUtilityClass;
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
function getContainerUtilityClass(slot) {
return (0, _generateUtilityClass.default)('MuiContainer', slot);
}
const containerClasses = (0, _generateUtilityClasses.default)('MuiContainer', ['root', 'disableGutters', 'fixed', 'maxWidthXs', 'maxWidthSm', 'maxWidthMd', 'maxWidthLg', 'maxWidthXl']);
var _default = exports.default = containerClasses;
@@ -0,0 +1,7 @@
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
import generateUtilityClass from '@mui/utils/generateUtilityClass';
export function getContainerUtilityClass(slot) {
return generateUtilityClass('MuiContainer', slot);
}
const containerClasses = generateUtilityClasses('MuiContainer', ['root', 'disableGutters', 'fixed', 'maxWidthXs', 'maxWidthSm', 'maxWidthMd', 'maxWidthLg', 'maxWidthXl']);
export default containerClasses;
@@ -0,0 +1,18 @@
import * as React from 'react';
import { Interpolation, MUIStyledComponent as StyledComponent } from '@mui/styled-engine';
import { OverridableComponent } from '@mui/types';
import { ContainerProps, ContainerTypeMap } from "./ContainerProps.mjs";
import { Theme as DefaultTheme } from "../createTheme/index.mjs";
interface StyleFnProps<Theme> extends ContainerProps {
theme: Theme;
ownerState: ContainerProps;
}
type RequiredThemeStructure = Pick<DefaultTheme, 'breakpoints' | 'spacing'>;
export default function createContainer<Theme extends RequiredThemeStructure = DefaultTheme>(options?: {
createStyledComponent?: ((...styles: Array<Interpolation<StyleFnProps<Theme>>>) => StyledComponent<ContainerProps>) | undefined;
useThemeProps?: ((inProps: ContainerProps) => ContainerProps & {
component?: React.ElementType | undefined;
}) | undefined;
componentName?: string | undefined;
}): OverridableComponent<ContainerTypeMap<{}, "div">>;
export {};
@@ -0,0 +1,18 @@
import * as React from 'react';
import { Interpolation, MUIStyledComponent as StyledComponent } from '@mui/styled-engine';
import { OverridableComponent } from '@mui/types';
import { ContainerProps, ContainerTypeMap } from "./ContainerProps.js";
import { Theme as DefaultTheme } from "../createTheme/index.js";
interface StyleFnProps<Theme> extends ContainerProps {
theme: Theme;
ownerState: ContainerProps;
}
type RequiredThemeStructure = Pick<DefaultTheme, 'breakpoints' | 'spacing'>;
export default function createContainer<Theme extends RequiredThemeStructure = DefaultTheme>(options?: {
createStyledComponent?: ((...styles: Array<Interpolation<StyleFnProps<Theme>>>) => StyledComponent<ContainerProps>) | undefined;
useThemeProps?: ((inProps: ContainerProps) => ContainerProps & {
component?: React.ElementType | undefined;
}) | undefined;
componentName?: string | undefined;
}): OverridableComponent<ContainerTypeMap<{}, "div">>;
export {};
@@ -0,0 +1,156 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = createContainer;
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
var _capitalize = _interopRequireDefault(require("@mui/utils/capitalize"));
var _useThemeProps = _interopRequireDefault(require("../useThemeProps"));
var _styled = _interopRequireDefault(require("../styled"));
var _createTheme = _interopRequireDefault(require("../createTheme"));
var _jsxRuntime = require("react/jsx-runtime");
const defaultTheme = (0, _createTheme.default)();
const defaultCreateStyledComponent = (0, _styled.default)('div', {
name: 'MuiContainer',
slot: 'Root',
overridesResolver: (props, styles) => {
const {
ownerState
} = props;
return [styles.root, styles[`maxWidth${(0, _capitalize.default)(String(ownerState.maxWidth))}`], ownerState.fixed && styles.fixed, ownerState.disableGutters && styles.disableGutters];
}
});
const useThemePropsDefault = inProps => (0, _useThemeProps.default)({
props: inProps,
name: 'MuiContainer',
defaultTheme
});
const useUtilityClasses = (ownerState, componentName) => {
const getContainerUtilityClass = slot => {
return (0, _generateUtilityClass.default)(componentName, slot);
};
const {
classes,
fixed,
disableGutters,
maxWidth
} = ownerState;
const slots = {
root: ['root', maxWidth && `maxWidth${(0, _capitalize.default)(String(maxWidth))}`, fixed && 'fixed', disableGutters && 'disableGutters']
};
return (0, _composeClasses.default)(slots, getContainerUtilityClass, classes);
};
function createContainer(options = {}) {
const {
// This will allow adding custom styled fn (for example for custom sx style function)
createStyledComponent = defaultCreateStyledComponent,
useThemeProps = useThemePropsDefault,
componentName = 'MuiContainer'
} = options;
const ContainerRoot = createStyledComponent(({
theme,
ownerState
}) => ({
width: '100%',
marginLeft: 'auto',
boxSizing: 'border-box',
marginRight: 'auto',
...(!ownerState.disableGutters && {
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(2),
// @ts-ignore module augmentation fails if custom breakpoints are used
[theme.breakpoints.up('sm')]: {
paddingLeft: theme.spacing(3),
paddingRight: theme.spacing(3)
}
})
}), ({
theme,
ownerState
}) => ownerState.fixed && Object.keys(theme.breakpoints.values).reduce((acc, breakpointValueKey) => {
const breakpoint = breakpointValueKey;
const value = theme.breakpoints.values[breakpoint];
if (value !== 0) {
// @ts-ignore
acc[theme.breakpoints.up(breakpoint)] = {
maxWidth: `${value}${theme.breakpoints.unit}`
};
}
return acc;
}, {}), ({
theme,
ownerState
}) => ({
// @ts-ignore module augmentation fails if custom breakpoints are used
...(ownerState.maxWidth === 'xs' && {
// @ts-ignore module augmentation fails if custom breakpoints are used
[theme.breakpoints.up('xs')]: {
// @ts-ignore module augmentation fails if custom breakpoints are used
maxWidth: Math.max(theme.breakpoints.values.xs, 444)
}
}),
...(ownerState.maxWidth &&
// @ts-ignore module augmentation fails if custom breakpoints are used
ownerState.maxWidth !== 'xs' && {
// @ts-ignore module augmentation fails if custom breakpoints are used
[theme.breakpoints.up(ownerState.maxWidth)]: {
// @ts-ignore module augmentation fails if custom breakpoints are used
maxWidth: `${theme.breakpoints.values[ownerState.maxWidth]}${theme.breakpoints.unit}`
}
})
}));
const Container = /*#__PURE__*/React.forwardRef(function Container(inProps, ref) {
const props = useThemeProps(inProps);
const {
className,
component = 'div',
disableGutters = false,
fixed = false,
maxWidth = 'lg',
classes: classesProp,
...other
} = props;
const ownerState = {
...props,
component,
disableGutters,
fixed,
maxWidth
};
// @ts-ignore module augmentation fails if custom breakpoints are used
const classes = useUtilityClasses(ownerState, componentName);
return (
/*#__PURE__*/
// @ts-ignore theme is injected by the styled util
(0, _jsxRuntime.jsx)(ContainerRoot, {
as: component
// @ts-ignore module augmentation fails if custom breakpoints are used
,
ownerState: ownerState,
className: (0, _clsx.default)(classes.root, className),
ref: ref,
...other
})
);
});
process.env.NODE_ENV !== "production" ? Container.propTypes /* remove-proptypes */ = {
children: _propTypes.default.node,
classes: _propTypes.default.object,
className: _propTypes.default.string,
component: _propTypes.default.elementType,
disableGutters: _propTypes.default.bool,
fixed: _propTypes.default.bool,
maxWidth: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), _propTypes.default.string]),
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
} : void 0;
return Container;
}
@@ -0,0 +1,149 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import generateUtilityClass from '@mui/utils/generateUtilityClass';
import composeClasses from '@mui/utils/composeClasses';
import capitalize from '@mui/utils/capitalize';
import useThemePropsSystem from "../useThemeProps/index.mjs";
import systemStyled from "../styled/index.mjs";
import createTheme from "../createTheme/index.mjs";
import { jsx as _jsx } from "react/jsx-runtime";
const defaultTheme = createTheme();
const defaultCreateStyledComponent = systemStyled('div', {
name: 'MuiContainer',
slot: 'Root',
overridesResolver: (props, styles) => {
const {
ownerState
} = props;
return [styles.root, styles[`maxWidth${capitalize(String(ownerState.maxWidth))}`], ownerState.fixed && styles.fixed, ownerState.disableGutters && styles.disableGutters];
}
});
const useThemePropsDefault = inProps => useThemePropsSystem({
props: inProps,
name: 'MuiContainer',
defaultTheme
});
const useUtilityClasses = (ownerState, componentName) => {
const getContainerUtilityClass = slot => {
return generateUtilityClass(componentName, slot);
};
const {
classes,
fixed,
disableGutters,
maxWidth
} = ownerState;
const slots = {
root: ['root', maxWidth && `maxWidth${capitalize(String(maxWidth))}`, fixed && 'fixed', disableGutters && 'disableGutters']
};
return composeClasses(slots, getContainerUtilityClass, classes);
};
export default function createContainer(options = {}) {
const {
// This will allow adding custom styled fn (for example for custom sx style function)
createStyledComponent = defaultCreateStyledComponent,
useThemeProps = useThemePropsDefault,
componentName = 'MuiContainer'
} = options;
const ContainerRoot = createStyledComponent(({
theme,
ownerState
}) => ({
width: '100%',
marginLeft: 'auto',
boxSizing: 'border-box',
marginRight: 'auto',
...(!ownerState.disableGutters && {
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(2),
// @ts-ignore module augmentation fails if custom breakpoints are used
[theme.breakpoints.up('sm')]: {
paddingLeft: theme.spacing(3),
paddingRight: theme.spacing(3)
}
})
}), ({
theme,
ownerState
}) => ownerState.fixed && Object.keys(theme.breakpoints.values).reduce((acc, breakpointValueKey) => {
const breakpoint = breakpointValueKey;
const value = theme.breakpoints.values[breakpoint];
if (value !== 0) {
// @ts-ignore
acc[theme.breakpoints.up(breakpoint)] = {
maxWidth: `${value}${theme.breakpoints.unit}`
};
}
return acc;
}, {}), ({
theme,
ownerState
}) => ({
// @ts-ignore module augmentation fails if custom breakpoints are used
...(ownerState.maxWidth === 'xs' && {
// @ts-ignore module augmentation fails if custom breakpoints are used
[theme.breakpoints.up('xs')]: {
// @ts-ignore module augmentation fails if custom breakpoints are used
maxWidth: Math.max(theme.breakpoints.values.xs, 444)
}
}),
...(ownerState.maxWidth &&
// @ts-ignore module augmentation fails if custom breakpoints are used
ownerState.maxWidth !== 'xs' && {
// @ts-ignore module augmentation fails if custom breakpoints are used
[theme.breakpoints.up(ownerState.maxWidth)]: {
// @ts-ignore module augmentation fails if custom breakpoints are used
maxWidth: `${theme.breakpoints.values[ownerState.maxWidth]}${theme.breakpoints.unit}`
}
})
}));
const Container = /*#__PURE__*/React.forwardRef(function Container(inProps, ref) {
const props = useThemeProps(inProps);
const {
className,
component = 'div',
disableGutters = false,
fixed = false,
maxWidth = 'lg',
classes: classesProp,
...other
} = props;
const ownerState = {
...props,
component,
disableGutters,
fixed,
maxWidth
};
// @ts-ignore module augmentation fails if custom breakpoints are used
const classes = useUtilityClasses(ownerState, componentName);
return (
/*#__PURE__*/
// @ts-ignore theme is injected by the styled util
_jsx(ContainerRoot, {
as: component
// @ts-ignore module augmentation fails if custom breakpoints are used
,
ownerState: ownerState,
className: clsx(classes.root, className),
ref: ref,
...other
})
);
});
process.env.NODE_ENV !== "production" ? Container.propTypes /* remove-proptypes */ = {
children: PropTypes.node,
classes: PropTypes.object,
className: PropTypes.string,
component: PropTypes.elementType,
disableGutters: PropTypes.bool,
fixed: PropTypes.bool,
maxWidth: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), PropTypes.string]),
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
} : void 0;
return Container;
}
@@ -0,0 +1,4 @@
export { default } from "./Container.mjs";
export type * from "./ContainerProps.mjs";
export { default as containerClasses } from "./containerClasses.mjs";
export * from "./containerClasses.mjs";
@@ -0,0 +1,4 @@
export { default } from "./Container.js";
export type * from "./ContainerProps.js";
export { default as containerClasses } from "./containerClasses.js";
export * from "./containerClasses.js";
@@ -0,0 +1,35 @@
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
containerClasses: true
};
Object.defineProperty(exports, "containerClasses", {
enumerable: true,
get: function () {
return _containerClasses.default;
}
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _Container.default;
}
});
var _Container = _interopRequireDefault(require("./Container"));
var _containerClasses = _interopRequireWildcard(require("./containerClasses"));
Object.keys(_containerClasses).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _containerClasses[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _containerClasses[key];
}
});
});
@@ -0,0 +1,3 @@
export { default } from "./Container.mjs";
export { default as containerClasses } from "./containerClasses.mjs";
export * from "./containerClasses.mjs";
@@ -0,0 +1,18 @@
import * as React from 'react';
declare function DefaultPropsProvider({
value,
children
}: React.PropsWithChildren<{
value: Record<string, any> | undefined;
}>): React.JSX.Element;
declare namespace DefaultPropsProvider {
var propTypes: any;
}
export declare function useDefaultProps<Props>({
props,
name
}: {
props: Props;
name: string;
}): Props;
export default DefaultPropsProvider;
@@ -0,0 +1,18 @@
import * as React from 'react';
declare function DefaultPropsProvider({
value,
children
}: React.PropsWithChildren<{
value: Record<string, any> | undefined;
}>): React.JSX.Element;
declare namespace DefaultPropsProvider {
var propTypes: any;
}
export declare function useDefaultProps<Props>({
props,
name
}: {
props: Props;
name: string;
}): Props;
export default DefaultPropsProvider;
@@ -0,0 +1,72 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.useDefaultProps = useDefaultProps;
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _resolveProps = _interopRequireDefault(require("@mui/utils/resolveProps"));
var _jsxRuntime = require("react/jsx-runtime");
const PropsContext = /*#__PURE__*/React.createContext(undefined);
function DefaultPropsProvider({
value,
children
}) {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PropsContext.Provider, {
value: value,
children: children
});
}
process.env.NODE_ENV !== "production" ? DefaultPropsProvider.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* @ignore
*/
children: _propTypes.default.node,
/**
* @ignore
*/
value: _propTypes.default.object
} : void 0;
function getThemeProps(params) {
const {
theme,
name,
props
} = params;
if (!theme || !theme.components || !theme.components[name]) {
return props;
}
const config = theme.components[name];
if (config.defaultProps) {
// compatible with v5 signature
return (0, _resolveProps.default)(config.defaultProps, props, theme.components.mergeClassNameAndStyle);
}
if (!config.styleOverrides && !config.variants) {
// v6 signature, no property 'defaultProps'
return (0, _resolveProps.default)(config, props, theme.components.mergeClassNameAndStyle);
}
return props;
}
function useDefaultProps({
props,
name
}) {
const ctx = React.useContext(PropsContext);
return getThemeProps({
props,
name,
theme: {
components: ctx
}
});
}
var _default = exports.default = DefaultPropsProvider;
@@ -0,0 +1,64 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import resolveProps from '@mui/utils/resolveProps';
import { jsx as _jsx } from "react/jsx-runtime";
const PropsContext = /*#__PURE__*/React.createContext(undefined);
function DefaultPropsProvider({
value,
children
}) {
return /*#__PURE__*/_jsx(PropsContext.Provider, {
value: value,
children: children
});
}
process.env.NODE_ENV !== "production" ? DefaultPropsProvider.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* @ignore
*/
children: PropTypes.node,
/**
* @ignore
*/
value: PropTypes.object
} : void 0;
function getThemeProps(params) {
const {
theme,
name,
props
} = params;
if (!theme || !theme.components || !theme.components[name]) {
return props;
}
const config = theme.components[name];
if (config.defaultProps) {
// compatible with v5 signature
return resolveProps(config.defaultProps, props, theme.components.mergeClassNameAndStyle);
}
if (!config.styleOverrides && !config.variants) {
// v6 signature, no property 'defaultProps'
return resolveProps(config, props, theme.components.mergeClassNameAndStyle);
}
return props;
}
export function useDefaultProps({
props,
name
}) {
const ctx = React.useContext(PropsContext);
return getThemeProps({
props,
name,
theme: {
components: ctx
}
});
}
export default DefaultPropsProvider;
@@ -0,0 +1 @@
export { default, useDefaultProps } from "./DefaultPropsProvider.mjs";
@@ -0,0 +1 @@
export { default, useDefaultProps } from "./DefaultPropsProvider.js";
@@ -0,0 +1,19 @@
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _DefaultPropsProvider.default;
}
});
Object.defineProperty(exports, "useDefaultProps", {
enumerable: true,
get: function () {
return _DefaultPropsProvider.useDefaultProps;
}
});
var _DefaultPropsProvider = _interopRequireWildcard(require("./DefaultPropsProvider"));
@@ -0,0 +1 @@
export { default, useDefaultProps } from "./DefaultPropsProvider.mjs";
@@ -0,0 +1,16 @@
import { Interpolation } from '@mui/styled-engine';
import { Theme as SystemTheme } from "../createTheme/index.mjs";
export interface GlobalStylesProps<Theme = SystemTheme> {
styles: Interpolation<Theme>;
defaultTheme?: object | undefined;
themeId?: string | undefined;
}
declare function GlobalStyles<Theme = SystemTheme>({
styles,
themeId,
defaultTheme
}: GlobalStylesProps<Theme>): import("react").JSX.Element;
declare namespace GlobalStyles {
var propTypes: any;
}
export default GlobalStyles;
@@ -0,0 +1,16 @@
import { Interpolation } from '@mui/styled-engine';
import { Theme as SystemTheme } from "../createTheme/index.js";
export interface GlobalStylesProps<Theme = SystemTheme> {
styles: Interpolation<Theme>;
defaultTheme?: object | undefined;
themeId?: string | undefined;
}
declare function GlobalStyles<Theme = SystemTheme>({
styles,
themeId,
defaultTheme
}: GlobalStylesProps<Theme>): import("react").JSX.Element;
declare namespace GlobalStyles {
var propTypes: any;
}
export default GlobalStyles;
@@ -0,0 +1,66 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _styledEngine = require("@mui/styled-engine");
var _useTheme = _interopRequireDefault(require("../useTheme"));
var _jsxRuntime = require("react/jsx-runtime");
function wrapGlobalLayer(styles) {
const serialized = (0, _styledEngine.internal_serializeStyles)(styles);
if (styles !== serialized && serialized.styles) {
if (!serialized.styles.match(/^@layer\s+[^{]*$/)) {
// If the styles are not already wrapped in a layer, wrap them in a global layer.
serialized.styles = `@layer global{${serialized.styles}}`;
}
return serialized;
}
return styles;
}
function GlobalStyles({
styles,
themeId,
defaultTheme = {}
}) {
const upperTheme = (0, _useTheme.default)(defaultTheme);
const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
let globalStyles = typeof styles === 'function' ? styles(resolvedTheme) : styles;
if (resolvedTheme.modularCssLayers) {
if (Array.isArray(globalStyles)) {
globalStyles = globalStyles.map(styleArg => {
if (typeof styleArg === 'function') {
return wrapGlobalLayer(styleArg(resolvedTheme));
}
return wrapGlobalLayer(styleArg);
});
} else {
globalStyles = wrapGlobalLayer(globalStyles);
}
}
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledEngine.GlobalStyles, {
styles: globalStyles
});
}
process.env.NODE_ENV !== "production" ? GlobalStyles.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* @ignore
*/
defaultTheme: _propTypes.default.object,
/**
* @ignore
*/
styles: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.array, _propTypes.default.func, _propTypes.default.number, _propTypes.default.object, _propTypes.default.string, _propTypes.default.bool]),
/**
* @ignore
*/
themeId: _propTypes.default.string
} : void 0;
var _default = exports.default = GlobalStyles;
@@ -0,0 +1,60 @@
'use client';
import PropTypes from 'prop-types';
import { GlobalStyles as MuiGlobalStyles, internal_serializeStyles as serializeStyles } from '@mui/styled-engine';
import useTheme from "../useTheme/index.mjs";
import { jsx as _jsx } from "react/jsx-runtime";
function wrapGlobalLayer(styles) {
const serialized = serializeStyles(styles);
if (styles !== serialized && serialized.styles) {
if (!serialized.styles.match(/^@layer\s+[^{]*$/)) {
// If the styles are not already wrapped in a layer, wrap them in a global layer.
serialized.styles = `@layer global{${serialized.styles}}`;
}
return serialized;
}
return styles;
}
function GlobalStyles({
styles,
themeId,
defaultTheme = {}
}) {
const upperTheme = useTheme(defaultTheme);
const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
let globalStyles = typeof styles === 'function' ? styles(resolvedTheme) : styles;
if (resolvedTheme.modularCssLayers) {
if (Array.isArray(globalStyles)) {
globalStyles = globalStyles.map(styleArg => {
if (typeof styleArg === 'function') {
return wrapGlobalLayer(styleArg(resolvedTheme));
}
return wrapGlobalLayer(styleArg);
});
} else {
globalStyles = wrapGlobalLayer(globalStyles);
}
}
return /*#__PURE__*/_jsx(MuiGlobalStyles, {
styles: globalStyles
});
}
process.env.NODE_ENV !== "production" ? GlobalStyles.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* @ignore
*/
defaultTheme: PropTypes.object,
/**
* @ignore
*/
styles: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.array, PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool]),
/**
* @ignore
*/
themeId: PropTypes.string
} : void 0;
export default GlobalStyles;
@@ -0,0 +1,2 @@
export { default } from "./GlobalStyles.mjs";
export * from "./GlobalStyles.mjs";
@@ -0,0 +1,2 @@
export { default } from "./GlobalStyles.js";
export * from "./GlobalStyles.js";
@@ -0,0 +1,25 @@
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {};
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _GlobalStyles.default;
}
});
var _GlobalStyles = _interopRequireWildcard(require("./GlobalStyles"));
Object.keys(_GlobalStyles).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _GlobalStyles[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _GlobalStyles[key];
}
});
});
@@ -0,0 +1,2 @@
export { default } from "./GlobalStyles.mjs";
export * from "./GlobalStyles.mjs";
@@ -0,0 +1,12 @@
/**
*
* Demos:
*
* - [Grid (Material UI)](https://mui.com/material-ui/react-grid/)
*
* API:
*
* - [Grid API](https://mui.com/system/api/grid/)
*/
declare const Grid: import("@mui/types").OverridableComponent<import("./GridProps.mjs").GridTypeMap<{}, "div">>;
export default Grid;
@@ -0,0 +1,12 @@
/**
*
* Demos:
*
* - [Grid (Material UI)](https://mui.com/material-ui/react-grid/)
*
* API:
*
* - [Grid API](https://mui.com/system/api/grid/)
*/
declare const Grid: import("@mui/types").OverridableComponent<import("./GridProps.js").GridTypeMap<{}, "div">>;
export default Grid;
+115
View File
@@ -0,0 +1,115 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _createGrid = _interopRequireDefault(require("./createGrid"));
/**
*
* Demos:
*
* - [Grid (Material UI)](https://mui.com/material-ui/react-grid/)
*
* API:
*
* - [Grid API](https://mui.com/system/api/grid/)
*/
const Grid = (0, _createGrid.default)();
process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* The content of the component.
*/
children: _propTypes.default.node,
/**
* The number of columns.
* @default 12
*/
columns: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.number, _propTypes.default.object]),
/**
* Defines the horizontal space between the type `item` components.
* It overrides the value of the `spacing` prop.
*/
columnSpacing: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
/**
* If `true`, the component will have the flex *container* behavior.
* You should be wrapping *items* with a *container*.
* @default false
*/
container: _propTypes.default.bool,
/**
* Defines the `flex-direction` style property for the container.
*
* ⚠️ Only `row` and `row-reverse` are supported. `column` and `column-reverse` are not supported,
* because the Grid component is designed to subdivide layouts into **columns**, not rows.
*
* For vertical layouts, use `Stack` instead.
*
* @default 'row'
*/
direction: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['row-reverse', 'row']), _propTypes.default.arrayOf(_propTypes.default.oneOf(['row-reverse', 'row'])), _propTypes.default.object]),
/**
* Defines the offset value for the type `item` components.
*/
offset: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])), _propTypes.default.object]),
/**
* Defines the vertical space between the type `item` components.
* It overrides the value of the `spacing` prop.
*/
rowSpacing: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
/**
* Defines the size of the the type `item` components.
*/
size: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.string, _propTypes.default.bool, _propTypes.default.number, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool, _propTypes.default.number])), _propTypes.default.object]),
/**
* Defines the space between the type `item` components.
* It can only be used on a type `container` component.
* @default 0
*/
spacing: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
/**
* @ignore
*/
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
/**
* The level of the grid starts from `0` and increases when the grid nests
* inside another grid. Nesting is defined as a container Grid being a direct
* child of a container Grid.
*
* ```js
* <Grid container> // level 0
* <Grid container> // level 1
* <Grid container> // level 2
* ```
*
* Only consecutive grid is considered nesting. A grid container will start at
* `0` if there are non-Grid container element above it.
*
* ```js
* <Grid container> // level 0
* <div>
* <Grid container> // level 0
* ```
*
* ```js
* <Grid container> // level 0
* <Grid>
* <Grid container> // level 0
* ```
*/
unstable_level: _propTypes.default.number,
/**
* Defines the `flex-wrap` style property.
* It's applied for all screen sizes.
* @default 'wrap'
*/
wrap: _propTypes.default.oneOf(['nowrap', 'wrap-reverse', 'wrap'])
} : void 0;
var _default = exports.default = Grid;
+109
View File
@@ -0,0 +1,109 @@
'use client';
import PropTypes from 'prop-types';
import createGrid from "./createGrid.mjs";
/**
*
* Demos:
*
* - [Grid (Material UI)](https://mui.com/material-ui/react-grid/)
*
* API:
*
* - [Grid API](https://mui.com/system/api/grid/)
*/
const Grid = createGrid();
process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* The content of the component.
*/
children: PropTypes.node,
/**
* The number of columns.
* @default 12
*/
columns: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number, PropTypes.object]),
/**
* Defines the horizontal space between the type `item` components.
* It overrides the value of the `spacing` prop.
*/
columnSpacing: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
/**
* If `true`, the component will have the flex *container* behavior.
* You should be wrapping *items* with a *container*.
* @default false
*/
container: PropTypes.bool,
/**
* Defines the `flex-direction` style property for the container.
*
* ⚠️ Only `row` and `row-reverse` are supported. `column` and `column-reverse` are not supported,
* because the Grid component is designed to subdivide layouts into **columns**, not rows.
*
* For vertical layouts, use `Stack` instead.
*
* @default 'row'
*/
direction: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['row-reverse', 'row'])), PropTypes.object]),
/**
* Defines the offset value for the type `item` components.
*/
offset: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.string, PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])), PropTypes.object]),
/**
* Defines the vertical space between the type `item` components.
* It overrides the value of the `spacing` prop.
*/
rowSpacing: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
/**
* Defines the size of the the type `item` components.
*/
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number])), PropTypes.object]),
/**
* Defines the space between the type `item` components.
* It can only be used on a type `container` component.
* @default 0
*/
spacing: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
/**
* @ignore
*/
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
/**
* The level of the grid starts from `0` and increases when the grid nests
* inside another grid. Nesting is defined as a container Grid being a direct
* child of a container Grid.
*
* ```js
* <Grid container> // level 0
* <Grid container> // level 1
* <Grid container> // level 2
* ```
*
* Only consecutive grid is considered nesting. A grid container will start at
* `0` if there are non-Grid container element above it.
*
* ```js
* <Grid container> // level 0
* <div>
* <Grid container> // level 0
* ```
*
* ```js
* <Grid container> // level 0
* <Grid>
* <Grid container> // level 0
* ```
*/
unstable_level: PropTypes.number,
/**
* Defines the `flex-wrap` style property.
* It's applied for all screen sizes.
* @default 'wrap'
*/
wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap'])
} : void 0;
export default Grid;
@@ -0,0 +1,106 @@
import * as React from 'react';
import { OverrideProps, PartiallyRequired } from '@mui/types';
import { SxProps } from "../styleFunctionSx/index.mjs";
import { Theme, Breakpoint } from "../createTheme/index.mjs";
type ResponsiveStyleValue<T> = T | Array<T | null> | { [key in Breakpoint]?: T | null };
export type GridDirection = 'row' | 'row-reverse';
export type GridSpacing = number | string;
export type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
export type GridSize = 'auto' | 'grow' | number | false;
export type GridOffset = 'auto' | number;
export interface GridBaseProps {
/**
* The content of the component.
*/
children?: React.ReactNode;
/**
* The number of columns.
* @default 12
*/
columns?: ResponsiveStyleValue<number> | undefined;
/**
* Defines the horizontal space between the type `item` components.
* It overrides the value of the `spacing` prop.
*/
columnSpacing?: ResponsiveStyleValue<GridSpacing> | undefined;
/**
* If `true`, the component will have the flex *container* behavior.
* You should be wrapping *items* with a *container*.
* @default false
*/
container?: boolean | undefined;
/**
* Defines the `flex-direction` style property for the container.
*
* ⚠️ Only `row` and `row-reverse` are supported. `column` and `column-reverse` are not supported,
* because the Grid component is designed to subdivide layouts into **columns**, not rows.
*
* For vertical layouts, use `Stack` instead.
*
* @default 'row'
*/
direction?: ResponsiveStyleValue<GridDirection> | undefined;
/**
* Defines the offset value for the type `item` components.
*/
offset?: ResponsiveStyleValue<GridOffset> | undefined;
/**
* The level of the grid starts from `0` and increases when the grid nests
* inside another grid. Nesting is defined as a container Grid being a direct
* child of a container Grid.
*
* ```js
* <Grid container> // level 0
* <Grid container> // level 1
* <Grid container> // level 2
* ```
*
* Only consecutive grid is considered nesting. A grid container will start at
* `0` if there are non-Grid container element above it.
*
* ```js
* <Grid container> // level 0
* <div>
* <Grid container> // level 0
* ```
*
* ```js
* <Grid container> // level 0
* <Grid>
* <Grid container> // level 0
* ```
*/
unstable_level?: number | undefined;
/**
* Defines the vertical space between the type `item` components.
* It overrides the value of the `spacing` prop.
*/
rowSpacing?: ResponsiveStyleValue<GridSpacing> | undefined;
/**
* Defines the size of the the type `item` components.
*/
size?: ResponsiveStyleValue<GridSize> | undefined;
/**
* Defines the space between the type `item` components.
* It can only be used on a type `container` component.
* @default 0
*/
spacing?: ResponsiveStyleValue<GridSpacing> | undefined;
/**
* Defines the `flex-wrap` style property.
* It's applied for all screen sizes.
* @default 'wrap'
*/
wrap?: GridWrap | undefined;
}
export type GridOwnerState = PartiallyRequired<GridBaseProps, 'size' | 'offset' | 'unstable_level'>;
export interface GridTypeMap<AdditionalProps = {}, DefaultComponent extends React.ElementType = 'div'> {
props: AdditionalProps & GridBaseProps & {
sx?: SxProps<Theme> | undefined;
};
defaultComponent: DefaultComponent;
}
export type GridProps<RootComponent extends React.ElementType = GridTypeMap['defaultComponent'], AdditionalProps = {
component?: React.ElementType | undefined;
}> = OverrideProps<GridTypeMap<AdditionalProps, RootComponent>, RootComponent>;
export {};
@@ -0,0 +1,106 @@
import * as React from 'react';
import { OverrideProps, PartiallyRequired } from '@mui/types';
import { SxProps } from "../styleFunctionSx/index.js";
import { Theme, Breakpoint } from "../createTheme/index.js";
type ResponsiveStyleValue<T> = T | Array<T | null> | { [key in Breakpoint]?: T | null };
export type GridDirection = 'row' | 'row-reverse';
export type GridSpacing = number | string;
export type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
export type GridSize = 'auto' | 'grow' | number | false;
export type GridOffset = 'auto' | number;
export interface GridBaseProps {
/**
* The content of the component.
*/
children?: React.ReactNode;
/**
* The number of columns.
* @default 12
*/
columns?: ResponsiveStyleValue<number> | undefined;
/**
* Defines the horizontal space between the type `item` components.
* It overrides the value of the `spacing` prop.
*/
columnSpacing?: ResponsiveStyleValue<GridSpacing> | undefined;
/**
* If `true`, the component will have the flex *container* behavior.
* You should be wrapping *items* with a *container*.
* @default false
*/
container?: boolean | undefined;
/**
* Defines the `flex-direction` style property for the container.
*
* ⚠️ Only `row` and `row-reverse` are supported. `column` and `column-reverse` are not supported,
* because the Grid component is designed to subdivide layouts into **columns**, not rows.
*
* For vertical layouts, use `Stack` instead.
*
* @default 'row'
*/
direction?: ResponsiveStyleValue<GridDirection> | undefined;
/**
* Defines the offset value for the type `item` components.
*/
offset?: ResponsiveStyleValue<GridOffset> | undefined;
/**
* The level of the grid starts from `0` and increases when the grid nests
* inside another grid. Nesting is defined as a container Grid being a direct
* child of a container Grid.
*
* ```js
* <Grid container> // level 0
* <Grid container> // level 1
* <Grid container> // level 2
* ```
*
* Only consecutive grid is considered nesting. A grid container will start at
* `0` if there are non-Grid container element above it.
*
* ```js
* <Grid container> // level 0
* <div>
* <Grid container> // level 0
* ```
*
* ```js
* <Grid container> // level 0
* <Grid>
* <Grid container> // level 0
* ```
*/
unstable_level?: number | undefined;
/**
* Defines the vertical space between the type `item` components.
* It overrides the value of the `spacing` prop.
*/
rowSpacing?: ResponsiveStyleValue<GridSpacing> | undefined;
/**
* Defines the size of the the type `item` components.
*/
size?: ResponsiveStyleValue<GridSize> | undefined;
/**
* Defines the space between the type `item` components.
* It can only be used on a type `container` component.
* @default 0
*/
spacing?: ResponsiveStyleValue<GridSpacing> | undefined;
/**
* Defines the `flex-wrap` style property.
* It's applied for all screen sizes.
* @default 'wrap'
*/
wrap?: GridWrap | undefined;
}
export type GridOwnerState = PartiallyRequired<GridBaseProps, 'size' | 'offset' | 'unstable_level'>;
export interface GridTypeMap<AdditionalProps = {}, DefaultComponent extends React.ElementType = 'div'> {
props: AdditionalProps & GridBaseProps & {
sx?: SxProps<Theme> | undefined;
};
defaultComponent: DefaultComponent;
}
export type GridProps<RootComponent extends React.ElementType = GridTypeMap['defaultComponent'], AdditionalProps = {
component?: React.ElementType | undefined;
}> = OverrideProps<GridTypeMap<AdditionalProps, RootComponent>, RootComponent>;
export {};
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,13 @@
import * as React from 'react';
import { OverridableComponent } from '@mui/types';
import useThemeSystem from "../useTheme/index.mjs";
import { GridTypeMap } from "./GridProps.mjs";
declare const defaultCreateStyledComponent: import("@mui/styled-engine").CreateStyledComponent<import("../index.mjs").MUIStyledCommonProps<any>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}, any>;
declare function useThemePropsDefault<T extends {}>(props: T): T;
export default function createGrid(options?: {
createStyledComponent?: typeof defaultCreateStyledComponent | undefined;
useThemeProps?: typeof useThemePropsDefault | undefined;
useTheme?: typeof useThemeSystem | undefined;
componentName?: string | undefined;
}): OverridableComponent<GridTypeMap<{}, "div">>;
export {};
@@ -0,0 +1,13 @@
import * as React from 'react';
import { OverridableComponent } from '@mui/types';
import useThemeSystem from "../useTheme/index.js";
import { GridTypeMap } from "./GridProps.js";
declare const defaultCreateStyledComponent: import("@mui/styled-engine").CreateStyledComponent<import("../index.js").MUIStyledCommonProps<any>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}, any>;
declare function useThemePropsDefault<T extends {}>(props: T): T;
export default function createGrid(options?: {
createStyledComponent?: typeof defaultCreateStyledComponent | undefined;
useThemeProps?: typeof useThemePropsDefault | undefined;
useTheme?: typeof useThemeSystem | undefined;
componentName?: string | undefined;
}): OverridableComponent<GridTypeMap<{}, "div">>;
export {};
@@ -0,0 +1,156 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = createGrid;
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _isMuiElement = _interopRequireDefault(require("@mui/utils/isMuiElement"));
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
var _styled = _interopRequireDefault(require("../styled"));
var _useThemeProps = _interopRequireDefault(require("../useThemeProps"));
var _useTheme = _interopRequireDefault(require("../useTheme"));
var _createTheme = _interopRequireDefault(require("../createTheme"));
var _gridGenerator = require("./gridGenerator");
var _jsxRuntime = require("react/jsx-runtime");
const defaultTheme = (0, _createTheme.default)();
// widening Theme to any so that the consumer can own the theme structure.
const defaultCreateStyledComponent = (0, _styled.default)('div', {
name: 'MuiGrid',
slot: 'Root'
});
function useThemePropsDefault(props) {
return (0, _useThemeProps.default)({
props,
name: 'MuiGrid',
defaultTheme
});
}
function createGrid(options = {}) {
const {
// This will allow adding custom styled fn (for example for custom sx style function)
createStyledComponent = defaultCreateStyledComponent,
useThemeProps = useThemePropsDefault,
useTheme = _useTheme.default,
componentName = 'MuiGrid'
} = options;
const useUtilityClasses = (ownerState, theme) => {
const {
container,
direction,
spacing,
wrap,
size
} = ownerState;
const slots = {
root: ['root', container && 'container', wrap !== 'wrap' && `wrap-xs-${String(wrap)}`, ...(0, _gridGenerator.generateDirectionClasses)(direction), ...(0, _gridGenerator.generateSizeClassNames)(size), ...(container ? (0, _gridGenerator.generateSpacingClassNames)(spacing, theme.breakpoints.keys[0]) : [])]
};
return (0, _composeClasses.default)(slots, slot => (0, _generateUtilityClass.default)(componentName, slot), {});
};
function parseResponsiveProp(propValue, breakpoints, shouldUseValue = () => true) {
const parsedProp = {};
if (propValue === null) {
return parsedProp;
}
if (Array.isArray(propValue)) {
propValue.forEach((value, index) => {
if (value !== null && shouldUseValue(value) && breakpoints.keys[index]) {
parsedProp[breakpoints.keys[index]] = value;
}
});
} else if (typeof propValue === 'object') {
Object.keys(propValue).forEach(key => {
const value = propValue[key];
if (value !== null && value !== undefined && shouldUseValue(value)) {
parsedProp[key] = value;
}
});
} else {
parsedProp[breakpoints.keys[0]] = propValue;
}
return parsedProp;
}
const GridRoot = createStyledComponent(_gridGenerator.generateGridColumnsStyles, _gridGenerator.generateGridColumnSpacingStyles, _gridGenerator.generateGridRowSpacingStyles, _gridGenerator.generateGridSizeStyles, _gridGenerator.generateGridDirectionStyles, _gridGenerator.generateGridStyles, _gridGenerator.generateGridOffsetStyles);
const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
const theme = useTheme();
const themeProps = useThemeProps(inProps);
const props = themeProps;
const {
className,
children,
columns: columnsProp = 12,
container = false,
component = 'div',
direction = 'row',
wrap = 'wrap',
size: sizeProp = {},
offset: offsetProp = {},
spacing: spacingProp = 0,
rowSpacing: rowSpacingProp = spacingProp,
columnSpacing: columnSpacingProp = spacingProp,
unstable_level: level = 0,
...other
} = props;
const size = parseResponsiveProp(sizeProp, theme.breakpoints, val => val !== false);
const offset = parseResponsiveProp(offsetProp, theme.breakpoints);
const columns = inProps.columns ?? (level ? undefined : columnsProp);
const spacing = inProps.spacing ?? (level ? undefined : spacingProp);
const rowSpacing = inProps.rowSpacing ?? inProps.spacing ?? (level ? undefined : rowSpacingProp);
const columnSpacing = inProps.columnSpacing ?? inProps.spacing ?? (level ? undefined : columnSpacingProp);
const ownerState = {
...props,
level,
columns,
container,
direction,
wrap,
spacing,
rowSpacing,
columnSpacing,
size,
offset
};
const classes = useUtilityClasses(ownerState, theme);
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridRoot, {
ref: ref,
as: component,
ownerState: ownerState,
className: (0, _clsx.default)(classes.root, className),
...other,
children: React.Children.map(children, child => {
if (/*#__PURE__*/React.isValidElement(child) && (0, _isMuiElement.default)(child, ['Grid']) && container && child.props.container) {
return /*#__PURE__*/React.cloneElement(child, {
unstable_level: child.props?.unstable_level ?? level + 1
});
}
return child;
})
});
});
process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ = {
children: _propTypes.default.node,
className: _propTypes.default.string,
columns: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.number, _propTypes.default.object]),
columnSpacing: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
component: _propTypes.default.elementType,
container: _propTypes.default.bool,
direction: _propTypes.default.oneOfType([_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), _propTypes.default.arrayOf(_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), _propTypes.default.object]),
offset: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])), _propTypes.default.object]),
rowSpacing: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
size: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool, _propTypes.default.number, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool, _propTypes.default.number])), _propTypes.default.object]),
spacing: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
wrap: _propTypes.default.oneOf(['nowrap', 'wrap-reverse', 'wrap'])
} : void 0;
// @ts-expect-error internal logic for nested grid
Grid.muiName = 'Grid';
return Grid;
}
@@ -0,0 +1,149 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import isMuiElement from '@mui/utils/isMuiElement';
import generateUtilityClass from '@mui/utils/generateUtilityClass';
import composeClasses from '@mui/utils/composeClasses';
import systemStyled from "../styled/index.mjs";
import useThemePropsSystem from "../useThemeProps/index.mjs";
import useThemeSystem from "../useTheme/index.mjs";
import createTheme from "../createTheme/index.mjs";
import { generateGridStyles, generateGridSizeStyles, generateGridColumnsStyles, generateGridColumnSpacingStyles, generateGridRowSpacingStyles, generateGridDirectionStyles, generateGridOffsetStyles, generateSizeClassNames, generateSpacingClassNames, generateDirectionClasses } from "./gridGenerator.mjs";
import { jsx as _jsx } from "react/jsx-runtime";
const defaultTheme = createTheme();
// widening Theme to any so that the consumer can own the theme structure.
const defaultCreateStyledComponent = systemStyled('div', {
name: 'MuiGrid',
slot: 'Root'
});
function useThemePropsDefault(props) {
return useThemePropsSystem({
props,
name: 'MuiGrid',
defaultTheme
});
}
export default function createGrid(options = {}) {
const {
// This will allow adding custom styled fn (for example for custom sx style function)
createStyledComponent = defaultCreateStyledComponent,
useThemeProps = useThemePropsDefault,
useTheme = useThemeSystem,
componentName = 'MuiGrid'
} = options;
const useUtilityClasses = (ownerState, theme) => {
const {
container,
direction,
spacing,
wrap,
size
} = ownerState;
const slots = {
root: ['root', container && 'container', wrap !== 'wrap' && `wrap-xs-${String(wrap)}`, ...generateDirectionClasses(direction), ...generateSizeClassNames(size), ...(container ? generateSpacingClassNames(spacing, theme.breakpoints.keys[0]) : [])]
};
return composeClasses(slots, slot => generateUtilityClass(componentName, slot), {});
};
function parseResponsiveProp(propValue, breakpoints, shouldUseValue = () => true) {
const parsedProp = {};
if (propValue === null) {
return parsedProp;
}
if (Array.isArray(propValue)) {
propValue.forEach((value, index) => {
if (value !== null && shouldUseValue(value) && breakpoints.keys[index]) {
parsedProp[breakpoints.keys[index]] = value;
}
});
} else if (typeof propValue === 'object') {
Object.keys(propValue).forEach(key => {
const value = propValue[key];
if (value !== null && value !== undefined && shouldUseValue(value)) {
parsedProp[key] = value;
}
});
} else {
parsedProp[breakpoints.keys[0]] = propValue;
}
return parsedProp;
}
const GridRoot = createStyledComponent(generateGridColumnsStyles, generateGridColumnSpacingStyles, generateGridRowSpacingStyles, generateGridSizeStyles, generateGridDirectionStyles, generateGridStyles, generateGridOffsetStyles);
const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
const theme = useTheme();
const themeProps = useThemeProps(inProps);
const props = themeProps;
const {
className,
children,
columns: columnsProp = 12,
container = false,
component = 'div',
direction = 'row',
wrap = 'wrap',
size: sizeProp = {},
offset: offsetProp = {},
spacing: spacingProp = 0,
rowSpacing: rowSpacingProp = spacingProp,
columnSpacing: columnSpacingProp = spacingProp,
unstable_level: level = 0,
...other
} = props;
const size = parseResponsiveProp(sizeProp, theme.breakpoints, val => val !== false);
const offset = parseResponsiveProp(offsetProp, theme.breakpoints);
const columns = inProps.columns ?? (level ? undefined : columnsProp);
const spacing = inProps.spacing ?? (level ? undefined : spacingProp);
const rowSpacing = inProps.rowSpacing ?? inProps.spacing ?? (level ? undefined : rowSpacingProp);
const columnSpacing = inProps.columnSpacing ?? inProps.spacing ?? (level ? undefined : columnSpacingProp);
const ownerState = {
...props,
level,
columns,
container,
direction,
wrap,
spacing,
rowSpacing,
columnSpacing,
size,
offset
};
const classes = useUtilityClasses(ownerState, theme);
return /*#__PURE__*/_jsx(GridRoot, {
ref: ref,
as: component,
ownerState: ownerState,
className: clsx(classes.root, className),
...other,
children: React.Children.map(children, child => {
if (/*#__PURE__*/React.isValidElement(child) && isMuiElement(child, ['Grid']) && container && child.props.container) {
return /*#__PURE__*/React.cloneElement(child, {
unstable_level: child.props?.unstable_level ?? level + 1
});
}
return child;
})
});
});
process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ = {
children: PropTypes.node,
className: PropTypes.string,
columns: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number, PropTypes.object]),
columnSpacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
component: PropTypes.elementType,
container: PropTypes.bool,
direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
offset: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])), PropTypes.object]),
rowSpacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
size: PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.bool, PropTypes.number])), PropTypes.object]),
spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap'])
} : void 0;
// @ts-expect-error internal logic for nested grid
Grid.muiName = 'Grid';
return Grid;
}
@@ -0,0 +1,20 @@
export interface GridClasses {
/** Styles applied to the root element. */
root: string;
/** Styles applied to the root element if `container={true}`. */
container: string;
/** Styles applied to the root element if `direction="column"`. */
'direction-xs-column': string;
/** Styles applied to the root element if `direction="column-reverse"`. */
'direction-xs-column-reverse': string;
/** Styles applied to the root element if `direction="row-reverse"`. */
'direction-xs-row-reverse': string;
/** Styles applied to the root element if `wrap="nowrap"`. */
'wrap-xs-nowrap': string;
/** Styles applied to the root element if `wrap="reverse"`. */
'wrap-xs-wrap-reverse': string;
}
export type GridClassKey = keyof GridClasses;
export declare function getGridUtilityClass(slot: string): string;
declare const gridClasses: GridClasses;
export default gridClasses;
@@ -0,0 +1,20 @@
export interface GridClasses {
/** Styles applied to the root element. */
root: string;
/** Styles applied to the root element if `container={true}`. */
container: string;
/** Styles applied to the root element if `direction="column"`. */
'direction-xs-column': string;
/** Styles applied to the root element if `direction="column-reverse"`. */
'direction-xs-column-reverse': string;
/** Styles applied to the root element if `direction="row-reverse"`. */
'direction-xs-row-reverse': string;
/** Styles applied to the root element if `wrap="nowrap"`. */
'wrap-xs-nowrap': string;
/** Styles applied to the root element if `wrap="reverse"`. */
'wrap-xs-wrap-reverse': string;
}
export type GridClassKey = keyof GridClasses;
export declare function getGridUtilityClass(slot: string): string;
declare const gridClasses: GridClasses;
export default gridClasses;
@@ -0,0 +1,27 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.getGridUtilityClass = getGridUtilityClass;
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
function getGridUtilityClass(slot) {
return (0, _generateUtilityClass.default)('MuiGrid', slot);
}
const SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];
const WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];
const GRID_SIZES = ['auto', 'grow', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
const gridClasses = (0, _generateUtilityClasses.default)('MuiGrid', ['root', 'container', 'item',
// spacings
...SPACINGS.map(spacing => `spacing-xs-${spacing}`),
// direction values
...DIRECTIONS.map(direction => `direction-xs-${direction}`),
// wrap values
...WRAPS.map(wrap => `wrap-xs-${wrap}`),
// grid sizes for all breakpoints
...GRID_SIZES.map(size => `grid-xs-${size}`), ...GRID_SIZES.map(size => `grid-sm-${size}`), ...GRID_SIZES.map(size => `grid-md-${size}`), ...GRID_SIZES.map(size => `grid-lg-${size}`), ...GRID_SIZES.map(size => `grid-xl-${size}`)]);
var _default = exports.default = gridClasses;
@@ -0,0 +1,19 @@
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
import generateUtilityClass from '@mui/utils/generateUtilityClass';
export function getGridUtilityClass(slot) {
return generateUtilityClass('MuiGrid', slot);
}
const SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];
const WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];
const GRID_SIZES = ['auto', 'grow', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
const gridClasses = generateUtilityClasses('MuiGrid', ['root', 'container', 'item',
// spacings
...SPACINGS.map(spacing => `spacing-xs-${spacing}`),
// direction values
...DIRECTIONS.map(direction => `direction-xs-${direction}`),
// wrap values
...WRAPS.map(wrap => `wrap-xs-${wrap}`),
// grid sizes for all breakpoints
...GRID_SIZES.map(size => `grid-xs-${size}`), ...GRID_SIZES.map(size => `grid-sm-${size}`), ...GRID_SIZES.map(size => `grid-md-${size}`), ...GRID_SIZES.map(size => `grid-lg-${size}`), ...GRID_SIZES.map(size => `grid-xl-${size}`)]);
export default gridClasses;
@@ -0,0 +1,42 @@
import { Breakpoints } from "../createBreakpoints/createBreakpoints.mjs";
import { Spacing } from "../createTheme/createSpacing.mjs";
import { ResponsiveStyleValue } from "../styleFunctionSx/index.mjs";
import { GridDirection, GridOwnerState } from "./GridProps.mjs";
interface Props {
theme: {
breakpoints: Breakpoints;
spacing?: Spacing | undefined;
};
ownerState: GridOwnerState;
}
export declare const generateGridSizeStyles: ({
theme,
ownerState
}: Props) => {};
export declare const generateGridOffsetStyles: ({
theme,
ownerState
}: Props) => {};
export declare const generateGridColumnsStyles: ({
theme,
ownerState
}: Props) => {};
export declare const generateGridRowSpacingStyles: ({
theme,
ownerState
}: Props) => {};
export declare const generateGridColumnSpacingStyles: ({
theme,
ownerState
}: Props) => {};
export declare const generateGridDirectionStyles: ({
theme,
ownerState
}: Props) => {};
export declare const generateGridStyles: ({
ownerState
}: Props) => {};
export declare const generateSizeClassNames: (size: GridOwnerState['size']) => string[];
export declare const generateSpacingClassNames: (spacing: GridOwnerState['spacing'], smallestBreakpoint?: string) => string[];
export declare const generateDirectionClasses: (direction: ResponsiveStyleValue<GridDirection> | undefined) => string[];
export {};
@@ -0,0 +1,42 @@
import { Breakpoints } from "../createBreakpoints/createBreakpoints.js";
import { Spacing } from "../createTheme/createSpacing.js";
import { ResponsiveStyleValue } from "../styleFunctionSx/index.js";
import { GridDirection, GridOwnerState } from "./GridProps.js";
interface Props {
theme: {
breakpoints: Breakpoints;
spacing?: Spacing | undefined;
};
ownerState: GridOwnerState;
}
export declare const generateGridSizeStyles: ({
theme,
ownerState
}: Props) => {};
export declare const generateGridOffsetStyles: ({
theme,
ownerState
}: Props) => {};
export declare const generateGridColumnsStyles: ({
theme,
ownerState
}: Props) => {};
export declare const generateGridRowSpacingStyles: ({
theme,
ownerState
}: Props) => {};
export declare const generateGridColumnSpacingStyles: ({
theme,
ownerState
}: Props) => {};
export declare const generateGridDirectionStyles: ({
theme,
ownerState
}: Props) => {};
export declare const generateGridStyles: ({
ownerState
}: Props) => {};
export declare const generateSizeClassNames: (size: GridOwnerState['size']) => string[];
export declare const generateSpacingClassNames: (spacing: GridOwnerState['spacing'], smallestBreakpoint?: string) => string[];
export declare const generateDirectionClasses: (direction: ResponsiveStyleValue<GridDirection> | undefined) => string[];
export {};
@@ -0,0 +1,209 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.generateSpacingClassNames = exports.generateSizeClassNames = exports.generateGridStyles = exports.generateGridSizeStyles = exports.generateGridRowSpacingStyles = exports.generateGridOffsetStyles = exports.generateGridDirectionStyles = exports.generateGridColumnsStyles = exports.generateGridColumnSpacingStyles = exports.generateDirectionClasses = void 0;
var _traverseBreakpoints = require("./traverseBreakpoints");
function getSelfSpacingVar(axis) {
return `--Grid-${axis}Spacing`;
}
function getParentSpacingVar(axis) {
return `--Grid-parent-${axis}Spacing`;
}
const selfColumnsVar = '--Grid-columns';
const parentColumnsVar = '--Grid-parent-columns';
const generateGridSizeStyles = ({
theme,
ownerState
}) => {
const styles = {};
(0, _traverseBreakpoints.traverseBreakpoints)(theme.breakpoints, ownerState.size, (appendStyle, value) => {
let style = {};
if (value === 'grow') {
style = {
flexBasis: 0,
flexGrow: 1,
maxWidth: '100%'
};
}
if (value === 'auto') {
style = {
flexBasis: 'auto',
flexGrow: 0,
flexShrink: 0,
maxWidth: 'none',
width: 'auto'
};
}
if (typeof value === 'number') {
style = {
flexGrow: 0,
flexBasis: 'auto',
width: `calc(100% * ${value} / var(${parentColumnsVar}) - (var(${parentColumnsVar}) - ${value}) * (var(${getParentSpacingVar('column')}) / var(${parentColumnsVar})))`
};
}
appendStyle(styles, style);
});
return styles;
};
exports.generateGridSizeStyles = generateGridSizeStyles;
const generateGridOffsetStyles = ({
theme,
ownerState
}) => {
const styles = {};
(0, _traverseBreakpoints.traverseBreakpoints)(theme.breakpoints, ownerState.offset, (appendStyle, value) => {
let style = {};
if (value === 'auto') {
style = {
marginLeft: 'auto'
};
}
if (typeof value === 'number') {
style = {
marginLeft: value === 0 ? '0px' : `calc(100% * ${value} / var(${parentColumnsVar}) + var(${getParentSpacingVar('column')}) * ${value} / var(${parentColumnsVar}))`
};
}
appendStyle(styles, style);
});
return styles;
};
exports.generateGridOffsetStyles = generateGridOffsetStyles;
const generateGridColumnsStyles = ({
theme,
ownerState
}) => {
if (!ownerState.container) {
return {};
}
const styles = {
[selfColumnsVar]: 12
};
(0, _traverseBreakpoints.traverseBreakpoints)(theme.breakpoints, ownerState.columns, (appendStyle, value) => {
const columns = value ?? 12;
appendStyle(styles, {
[selfColumnsVar]: columns,
'> *': {
[parentColumnsVar]: columns
}
});
});
return styles;
};
exports.generateGridColumnsStyles = generateGridColumnsStyles;
const generateGridRowSpacingStyles = ({
theme,
ownerState
}) => {
if (!ownerState.container) {
return {};
}
const styles = {};
(0, _traverseBreakpoints.traverseBreakpoints)(theme.breakpoints, ownerState.rowSpacing, (appendStyle, value) => {
const spacing = typeof value === 'string' ? value : theme.spacing?.(value);
appendStyle(styles, {
[getSelfSpacingVar('row')]: spacing,
'> *': {
[getParentSpacingVar('row')]: spacing
}
});
});
return styles;
};
exports.generateGridRowSpacingStyles = generateGridRowSpacingStyles;
const generateGridColumnSpacingStyles = ({
theme,
ownerState
}) => {
if (!ownerState.container) {
return {};
}
const styles = {};
(0, _traverseBreakpoints.traverseBreakpoints)(theme.breakpoints, ownerState.columnSpacing, (appendStyle, value) => {
const spacing = typeof value === 'string' ? value : theme.spacing?.(value);
appendStyle(styles, {
[getSelfSpacingVar('column')]: spacing,
'> *': {
[getParentSpacingVar('column')]: spacing
}
});
});
return styles;
};
exports.generateGridColumnSpacingStyles = generateGridColumnSpacingStyles;
const generateGridDirectionStyles = ({
theme,
ownerState
}) => {
if (!ownerState.container) {
return {};
}
const styles = {};
(0, _traverseBreakpoints.traverseBreakpoints)(theme.breakpoints, ownerState.direction, (appendStyle, value) => {
appendStyle(styles, {
flexDirection: value
});
});
return styles;
};
exports.generateGridDirectionStyles = generateGridDirectionStyles;
const generateGridStyles = ({
ownerState
}) => {
return {
minWidth: 0,
boxSizing: 'border-box',
...(ownerState.container && {
display: 'flex',
flexWrap: 'wrap',
...(ownerState.wrap && ownerState.wrap !== 'wrap' && {
flexWrap: ownerState.wrap
}),
gap: `var(${getSelfSpacingVar('row')}) var(${getSelfSpacingVar('column')})`
})
};
};
exports.generateGridStyles = generateGridStyles;
const generateSizeClassNames = size => {
const classNames = [];
Object.entries(size).forEach(([key, value]) => {
if (value !== false && value !== undefined) {
classNames.push(`grid-${key}-${String(value)}`);
}
});
return classNames;
};
exports.generateSizeClassNames = generateSizeClassNames;
const generateSpacingClassNames = (spacing, smallestBreakpoint = 'xs') => {
function isValidSpacing(val) {
if (val === undefined) {
return false;
}
return typeof val === 'string' && !Number.isNaN(Number(val)) || typeof val === 'number' && val > 0;
}
if (isValidSpacing(spacing)) {
return [`spacing-${smallestBreakpoint}-${String(spacing)}`];
}
if (typeof spacing === 'object' && !Array.isArray(spacing)) {
const classNames = [];
Object.entries(spacing).forEach(([key, value]) => {
if (isValidSpacing(value)) {
classNames.push(`spacing-${key}-${String(value)}`);
}
});
return classNames;
}
return [];
};
exports.generateSpacingClassNames = generateSpacingClassNames;
const generateDirectionClasses = direction => {
if (direction === undefined) {
return [];
}
if (typeof direction === 'object') {
return Object.entries(direction).map(([key, value]) => `direction-${key}-${value}`);
}
return [`direction-xs-${String(direction)}`];
};
exports.generateDirectionClasses = generateDirectionClasses;
@@ -0,0 +1,193 @@
import { traverseBreakpoints } from "./traverseBreakpoints.mjs";
function getSelfSpacingVar(axis) {
return `--Grid-${axis}Spacing`;
}
function getParentSpacingVar(axis) {
return `--Grid-parent-${axis}Spacing`;
}
const selfColumnsVar = '--Grid-columns';
const parentColumnsVar = '--Grid-parent-columns';
export const generateGridSizeStyles = ({
theme,
ownerState
}) => {
const styles = {};
traverseBreakpoints(theme.breakpoints, ownerState.size, (appendStyle, value) => {
let style = {};
if (value === 'grow') {
style = {
flexBasis: 0,
flexGrow: 1,
maxWidth: '100%'
};
}
if (value === 'auto') {
style = {
flexBasis: 'auto',
flexGrow: 0,
flexShrink: 0,
maxWidth: 'none',
width: 'auto'
};
}
if (typeof value === 'number') {
style = {
flexGrow: 0,
flexBasis: 'auto',
width: `calc(100% * ${value} / var(${parentColumnsVar}) - (var(${parentColumnsVar}) - ${value}) * (var(${getParentSpacingVar('column')}) / var(${parentColumnsVar})))`
};
}
appendStyle(styles, style);
});
return styles;
};
export const generateGridOffsetStyles = ({
theme,
ownerState
}) => {
const styles = {};
traverseBreakpoints(theme.breakpoints, ownerState.offset, (appendStyle, value) => {
let style = {};
if (value === 'auto') {
style = {
marginLeft: 'auto'
};
}
if (typeof value === 'number') {
style = {
marginLeft: value === 0 ? '0px' : `calc(100% * ${value} / var(${parentColumnsVar}) + var(${getParentSpacingVar('column')}) * ${value} / var(${parentColumnsVar}))`
};
}
appendStyle(styles, style);
});
return styles;
};
export const generateGridColumnsStyles = ({
theme,
ownerState
}) => {
if (!ownerState.container) {
return {};
}
const styles = {
[selfColumnsVar]: 12
};
traverseBreakpoints(theme.breakpoints, ownerState.columns, (appendStyle, value) => {
const columns = value ?? 12;
appendStyle(styles, {
[selfColumnsVar]: columns,
'> *': {
[parentColumnsVar]: columns
}
});
});
return styles;
};
export const generateGridRowSpacingStyles = ({
theme,
ownerState
}) => {
if (!ownerState.container) {
return {};
}
const styles = {};
traverseBreakpoints(theme.breakpoints, ownerState.rowSpacing, (appendStyle, value) => {
const spacing = typeof value === 'string' ? value : theme.spacing?.(value);
appendStyle(styles, {
[getSelfSpacingVar('row')]: spacing,
'> *': {
[getParentSpacingVar('row')]: spacing
}
});
});
return styles;
};
export const generateGridColumnSpacingStyles = ({
theme,
ownerState
}) => {
if (!ownerState.container) {
return {};
}
const styles = {};
traverseBreakpoints(theme.breakpoints, ownerState.columnSpacing, (appendStyle, value) => {
const spacing = typeof value === 'string' ? value : theme.spacing?.(value);
appendStyle(styles, {
[getSelfSpacingVar('column')]: spacing,
'> *': {
[getParentSpacingVar('column')]: spacing
}
});
});
return styles;
};
export const generateGridDirectionStyles = ({
theme,
ownerState
}) => {
if (!ownerState.container) {
return {};
}
const styles = {};
traverseBreakpoints(theme.breakpoints, ownerState.direction, (appendStyle, value) => {
appendStyle(styles, {
flexDirection: value
});
});
return styles;
};
export const generateGridStyles = ({
ownerState
}) => {
return {
minWidth: 0,
boxSizing: 'border-box',
...(ownerState.container && {
display: 'flex',
flexWrap: 'wrap',
...(ownerState.wrap && ownerState.wrap !== 'wrap' && {
flexWrap: ownerState.wrap
}),
gap: `var(${getSelfSpacingVar('row')}) var(${getSelfSpacingVar('column')})`
})
};
};
export const generateSizeClassNames = size => {
const classNames = [];
Object.entries(size).forEach(([key, value]) => {
if (value !== false && value !== undefined) {
classNames.push(`grid-${key}-${String(value)}`);
}
});
return classNames;
};
export const generateSpacingClassNames = (spacing, smallestBreakpoint = 'xs') => {
function isValidSpacing(val) {
if (val === undefined) {
return false;
}
return typeof val === 'string' && !Number.isNaN(Number(val)) || typeof val === 'number' && val > 0;
}
if (isValidSpacing(spacing)) {
return [`spacing-${smallestBreakpoint}-${String(spacing)}`];
}
if (typeof spacing === 'object' && !Array.isArray(spacing)) {
const classNames = [];
Object.entries(spacing).forEach(([key, value]) => {
if (isValidSpacing(value)) {
classNames.push(`spacing-${key}-${String(value)}`);
}
});
return classNames;
}
return [];
};
export const generateDirectionClasses = direction => {
if (direction === undefined) {
return [];
}
if (typeof direction === 'object') {
return Object.entries(direction).map(([key, value]) => `direction-${key}-${value}`);
}
return [`direction-xs-${String(direction)}`];
};
@@ -0,0 +1,7 @@
export { default } from "./Grid.mjs";
export { default as createGrid } from "./createGrid.mjs";
export * from "./GridProps.mjs";
export { default as gridClasses } from "./gridClasses.mjs";
export * from "./gridClasses.mjs";
export { traverseBreakpoints as unstable_traverseBreakpoints } from "./traverseBreakpoints.mjs";
export { generateDirectionClasses as unstable_generateDirectionClasses, generateSizeClassNames as unstable_generateSizeClassNames, generateSpacingClassNames as unstable_generateSpacingClassNames } from "./gridGenerator.mjs";
@@ -0,0 +1,7 @@
export { default } from "./Grid.js";
export { default as createGrid } from "./createGrid.js";
export * from "./GridProps.js";
export { default as gridClasses } from "./gridClasses.js";
export * from "./gridClasses.js";
export { traverseBreakpoints as unstable_traverseBreakpoints } from "./traverseBreakpoints.js";
export { generateDirectionClasses as unstable_generateDirectionClasses, generateSizeClassNames as unstable_generateSizeClassNames, generateSpacingClassNames as unstable_generateSpacingClassNames } from "./gridGenerator.js";
@@ -0,0 +1,85 @@
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
createGrid: true,
gridClasses: true,
unstable_traverseBreakpoints: true,
unstable_generateDirectionClasses: true,
unstable_generateSizeClassNames: true,
unstable_generateSpacingClassNames: true
};
Object.defineProperty(exports, "createGrid", {
enumerable: true,
get: function () {
return _createGrid.default;
}
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _Grid.default;
}
});
Object.defineProperty(exports, "gridClasses", {
enumerable: true,
get: function () {
return _gridClasses.default;
}
});
Object.defineProperty(exports, "unstable_generateDirectionClasses", {
enumerable: true,
get: function () {
return _gridGenerator.generateDirectionClasses;
}
});
Object.defineProperty(exports, "unstable_generateSizeClassNames", {
enumerable: true,
get: function () {
return _gridGenerator.generateSizeClassNames;
}
});
Object.defineProperty(exports, "unstable_generateSpacingClassNames", {
enumerable: true,
get: function () {
return _gridGenerator.generateSpacingClassNames;
}
});
Object.defineProperty(exports, "unstable_traverseBreakpoints", {
enumerable: true,
get: function () {
return _traverseBreakpoints.traverseBreakpoints;
}
});
var _Grid = _interopRequireDefault(require("./Grid"));
var _createGrid = _interopRequireDefault(require("./createGrid"));
var _GridProps = require("./GridProps");
Object.keys(_GridProps).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _GridProps[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _GridProps[key];
}
});
});
var _gridClasses = _interopRequireWildcard(require("./gridClasses"));
Object.keys(_gridClasses).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _gridClasses[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridClasses[key];
}
});
});
var _traverseBreakpoints = require("./traverseBreakpoints");
var _gridGenerator = require("./gridGenerator");
@@ -0,0 +1,7 @@
export { default } from "./Grid.mjs";
export { default as createGrid } from "./createGrid.mjs";
export * from "./GridProps.mjs";
export { default as gridClasses } from "./gridClasses.mjs";
export * from "./gridClasses.mjs";
export { traverseBreakpoints as unstable_traverseBreakpoints } from "./traverseBreakpoints.mjs";
export { generateDirectionClasses as unstable_generateDirectionClasses, generateSizeClassNames as unstable_generateSizeClassNames, generateSpacingClassNames as unstable_generateSpacingClassNames } from "./gridGenerator.mjs";
@@ -0,0 +1,7 @@
import { Breakpoints, Breakpoint } from "../createBreakpoints/createBreakpoints.mjs";
export declare const filterBreakpointKeys: (breakpointsKeys: Breakpoint[], responsiveKeys: string[]) => Breakpoint[];
interface Iterator<T> {
(appendStyle: (responsiveStyles: Record<string, any>, style: object) => void, value: T): void;
}
export declare const traverseBreakpoints: <T = unknown>(breakpoints: Breakpoints, responsive: T | T[] | Record<string, any> | undefined, iterator: Iterator<T>) => void;
export {};
@@ -0,0 +1,7 @@
import { Breakpoints, Breakpoint } from "../createBreakpoints/createBreakpoints.js";
export declare const filterBreakpointKeys: (breakpointsKeys: Breakpoint[], responsiveKeys: string[]) => Breakpoint[];
interface Iterator<T> {
(appendStyle: (responsiveStyles: Record<string, any>, style: object) => void, value: T): void;
}
export declare const traverseBreakpoints: <T = unknown>(breakpoints: Breakpoints, responsive: T | T[] | Record<string, any> | undefined, iterator: Iterator<T>) => void;
export {};
@@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.traverseBreakpoints = exports.filterBreakpointKeys = void 0;
const filterBreakpointKeys = (breakpointsKeys, responsiveKeys) => breakpointsKeys.filter(key => responsiveKeys.includes(key));
exports.filterBreakpointKeys = filterBreakpointKeys;
const traverseBreakpoints = (breakpoints, responsive, iterator) => {
const smallestBreakpoint = breakpoints.keys[0]; // the keys is sorted from smallest to largest by `createBreakpoints`.
if (Array.isArray(responsive)) {
responsive.forEach((breakpointValue, index) => {
iterator((responsiveStyles, style) => {
if (index <= breakpoints.keys.length - 1) {
if (index === 0) {
Object.assign(responsiveStyles, style);
} else {
responsiveStyles[breakpoints.up(breakpoints.keys[index])] = style;
}
}
}, breakpointValue);
});
} else if (responsive && typeof responsive === 'object') {
// prevent null
// responsive could be a very big object, pick the smallest responsive values
const keys = Object.keys(responsive).length > breakpoints.keys.length ? breakpoints.keys : filterBreakpointKeys(breakpoints.keys, Object.keys(responsive));
keys.forEach(key => {
if (breakpoints.keys.includes(key)) {
// @ts-ignore already checked that responsive is an object
const breakpointValue = responsive[key];
if (breakpointValue !== undefined) {
iterator((responsiveStyles, style) => {
if (smallestBreakpoint === key) {
Object.assign(responsiveStyles, style);
} else {
responsiveStyles[breakpoints.up(key)] = style;
}
}, breakpointValue);
}
}
});
} else if (typeof responsive === 'number' || typeof responsive === 'string') {
iterator((responsiveStyles, style) => {
Object.assign(responsiveStyles, style);
}, responsive);
}
};
exports.traverseBreakpoints = traverseBreakpoints;
@@ -0,0 +1,42 @@
export const filterBreakpointKeys = (breakpointsKeys, responsiveKeys) => breakpointsKeys.filter(key => responsiveKeys.includes(key));
export const traverseBreakpoints = (breakpoints, responsive, iterator) => {
const smallestBreakpoint = breakpoints.keys[0]; // the keys is sorted from smallest to largest by `createBreakpoints`.
if (Array.isArray(responsive)) {
responsive.forEach((breakpointValue, index) => {
iterator((responsiveStyles, style) => {
if (index <= breakpoints.keys.length - 1) {
if (index === 0) {
Object.assign(responsiveStyles, style);
} else {
responsiveStyles[breakpoints.up(breakpoints.keys[index])] = style;
}
}
}, breakpointValue);
});
} else if (responsive && typeof responsive === 'object') {
// prevent null
// responsive could be a very big object, pick the smallest responsive values
const keys = Object.keys(responsive).length > breakpoints.keys.length ? breakpoints.keys : filterBreakpointKeys(breakpoints.keys, Object.keys(responsive));
keys.forEach(key => {
if (breakpoints.keys.includes(key)) {
// @ts-ignore already checked that responsive is an object
const breakpointValue = responsive[key];
if (breakpointValue !== undefined) {
iterator((responsiveStyles, style) => {
if (smallestBreakpoint === key) {
Object.assign(responsiveStyles, style);
} else {
responsiveStyles[breakpoints.up(key)] = style;
}
}, breakpointValue);
}
}
});
} else if (typeof responsive === 'number' || typeof responsive === 'string') {
iterator((responsiveStyles, style) => {
Object.assign(responsiveStyles, style);
}, responsive);
}
};
@@ -0,0 +1,49 @@
import * as React from 'react';
export declare const DEFAULT_MODE_STORAGE_KEY = "mode";
export declare const DEFAULT_COLOR_SCHEME_STORAGE_KEY = "color-scheme";
export declare const DEFAULT_ATTRIBUTE = "data-color-scheme";
export interface InitColorSchemeScriptProps {
/**
* The default mode when the storage is empty (user's first visit).
* @default 'system'
*/
defaultMode?: 'system' | 'light' | 'dark' | undefined;
/**
* The default color scheme to be used on the light mode.
* @default 'light'
*/
defaultLightColorScheme?: string | undefined;
/**
* The default color scheme to be used on the dark mode.
* * @default 'dark'
*/
defaultDarkColorScheme?: string | undefined;
/**
* The node (provided as string) used to attach the color-scheme attribute.
* @default 'document.documentElement'
*/
colorSchemeNode?: string | undefined;
/**
* localStorage key used to store `mode`.
* @default 'mode'
*/
modeStorageKey?: string | undefined;
/**
* localStorage key used to store `colorScheme`.
* @default 'color-scheme'
*/
colorSchemeStorageKey?: string | undefined;
/**
* DOM attribute for applying color scheme.
* @default 'data-color-scheme'
* @example '.mode-%s' // for class based color scheme
* @example '[data-mode-%s]' // for data-attribute without '='
*/
attribute?: 'class' | 'data' | string | undefined;
/**
* Nonce string to pass to the inline script for CSP headers.
*/
nonce?: string | undefined;
}
export declare function buildInitColorSchemeScript(options?: InitColorSchemeScriptProps): React.JSX.Element;
export default function InitColorSchemeScript(options?: InitColorSchemeScriptProps): React.JSX.Element | null;
@@ -0,0 +1,49 @@
import * as React from 'react';
export declare const DEFAULT_MODE_STORAGE_KEY = "mode";
export declare const DEFAULT_COLOR_SCHEME_STORAGE_KEY = "color-scheme";
export declare const DEFAULT_ATTRIBUTE = "data-color-scheme";
export interface InitColorSchemeScriptProps {
/**
* The default mode when the storage is empty (user's first visit).
* @default 'system'
*/
defaultMode?: 'system' | 'light' | 'dark' | undefined;
/**
* The default color scheme to be used on the light mode.
* @default 'light'
*/
defaultLightColorScheme?: string | undefined;
/**
* The default color scheme to be used on the dark mode.
* * @default 'dark'
*/
defaultDarkColorScheme?: string | undefined;
/**
* The node (provided as string) used to attach the color-scheme attribute.
* @default 'document.documentElement'
*/
colorSchemeNode?: string | undefined;
/**
* localStorage key used to store `mode`.
* @default 'mode'
*/
modeStorageKey?: string | undefined;
/**
* localStorage key used to store `colorScheme`.
* @default 'color-scheme'
*/
colorSchemeStorageKey?: string | undefined;
/**
* DOM attribute for applying color scheme.
* @default 'data-color-scheme'
* @example '.mode-%s' // for class based color scheme
* @example '[data-mode-%s]' // for data-attribute without '='
*/
attribute?: 'class' | 'data' | string | undefined;
/**
* Nonce string to pass to the inline script for CSP headers.
*/
nonce?: string | undefined;
}
export declare function buildInitColorSchemeScript(options?: InitColorSchemeScriptProps): React.JSX.Element;
export default function InitColorSchemeScript(options?: InitColorSchemeScriptProps): React.JSX.Element | null;
@@ -0,0 +1,114 @@
"use strict";
'use client';
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DEFAULT_MODE_STORAGE_KEY = exports.DEFAULT_COLOR_SCHEME_STORAGE_KEY = exports.DEFAULT_ATTRIBUTE = void 0;
exports.buildInitColorSchemeScript = buildInitColorSchemeScript;
exports.default = InitColorSchemeScript;
var React = _interopRequireWildcard(require("react"));
var _jsxRuntime = require("react/jsx-runtime");
const DEFAULT_MODE_STORAGE_KEY = exports.DEFAULT_MODE_STORAGE_KEY = 'mode';
const DEFAULT_COLOR_SCHEME_STORAGE_KEY = exports.DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';
const DEFAULT_ATTRIBUTE = exports.DEFAULT_ATTRIBUTE = 'data-color-scheme';
// React 17 has no `useSyncExternalStore`; spread into a plain object so reading the
// missing property returns `undefined` instead of throwing under strict ESM. See #41190 (comment).
const safeReact = {
...React
};
const maybeReactUseSyncExternalStore = safeReact.useSyncExternalStore;
const subscribe = () => () => {};
/**
* `true` during the server render and the matching hydration render, `false`
* on every client render afterwards. React warns when a `<script>` is
* created during a client render (such scripts never execute), so the inline
* script is only emitted on the server pass and dropped after hydration — the
* attribute it already set on the document persists. React <18 has no
* `useSyncExternalStore` and no such warning, so the script is always emitted.
*/
function useIsServerRender() {
if (maybeReactUseSyncExternalStore === undefined) {
return true;
}
return maybeReactUseSyncExternalStore(subscribe, () => false, () => true);
}
function buildInitColorSchemeScript(options) {
const {
defaultMode = 'system',
defaultLightColorScheme = 'light',
defaultDarkColorScheme = 'dark',
modeStorageKey = DEFAULT_MODE_STORAGE_KEY,
colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,
attribute: initialAttribute = DEFAULT_ATTRIBUTE,
colorSchemeNode = 'document.documentElement',
nonce
} = options || {};
let setter = '';
let attribute = initialAttribute;
if (initialAttribute === 'class') {
attribute = '.%s';
}
if (initialAttribute === 'data') {
attribute = '[data-%s]';
}
if (attribute.startsWith('.')) {
const selector = attribute.substring(1);
setter += `${colorSchemeNode}.classList.remove('${selector}'.replace('%s', light), '${selector}'.replace('%s', dark));
${colorSchemeNode}.classList.add('${selector}'.replace('%s', colorScheme));`;
}
const matches = attribute.match(/\[([^[\]]+)\]/); // case [data-color-scheme='%s'] or [data-color-scheme]
if (matches) {
const [attr, value] = matches[1].split('=');
if (!value) {
setter += `${colorSchemeNode}.removeAttribute('${attr}'.replace('%s', light));
${colorSchemeNode}.removeAttribute('${attr}'.replace('%s', dark));`;
}
setter += `
${colorSchemeNode}.setAttribute('${attr}'.replace('%s', colorScheme), ${value ? `${value}.replace('%s', colorScheme)` : '""'});`;
} else if (attribute !== '.%s') {
setter += `${colorSchemeNode}.setAttribute('${attribute}', colorScheme);`;
}
return /*#__PURE__*/(0, _jsxRuntime.jsx)("script", {
suppressHydrationWarning: true,
nonce: typeof window === 'undefined' ? nonce : ''
// eslint-disable-next-line react/no-danger
,
dangerouslySetInnerHTML: {
__html: `(function() {
try {
let colorScheme = '';
const mode = localStorage.getItem('${modeStorageKey}') || '${defaultMode}';
const dark = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
const light = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
if (mode === 'system') {
// handle system mode
const mql = window.matchMedia('(prefers-color-scheme: dark)');
if (mql.matches) {
colorScheme = dark
} else {
colorScheme = light
}
}
if (mode === 'light') {
colorScheme = light;
}
if (mode === 'dark') {
colorScheme = dark;
}
if (colorScheme) {
${setter}
}
} catch(e){}})();`
}
}, "mui-color-scheme-init");
}
function InitColorSchemeScript(options) {
const isServerRender = useIsServerRender();
if (!isServerRender) {
return null;
}
return buildInitColorSchemeScript(options);
}
@@ -0,0 +1,106 @@
'use client';
import * as React from 'react';
import { jsx as _jsx } from "react/jsx-runtime";
export const DEFAULT_MODE_STORAGE_KEY = 'mode';
export const DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';
export const DEFAULT_ATTRIBUTE = 'data-color-scheme';
// React 17 has no `useSyncExternalStore`; spread into a plain object so reading the
// missing property returns `undefined` instead of throwing under strict ESM. See #41190 (comment).
const safeReact = {
...React
};
const maybeReactUseSyncExternalStore = safeReact.useSyncExternalStore;
const subscribe = () => () => {};
/**
* `true` during the server render and the matching hydration render, `false`
* on every client render afterwards. React warns when a `<script>` is
* created during a client render (such scripts never execute), so the inline
* script is only emitted on the server pass and dropped after hydration — the
* attribute it already set on the document persists. React <18 has no
* `useSyncExternalStore` and no such warning, so the script is always emitted.
*/
function useIsServerRender() {
if (maybeReactUseSyncExternalStore === undefined) {
return true;
}
return maybeReactUseSyncExternalStore(subscribe, () => false, () => true);
}
export function buildInitColorSchemeScript(options) {
const {
defaultMode = 'system',
defaultLightColorScheme = 'light',
defaultDarkColorScheme = 'dark',
modeStorageKey = DEFAULT_MODE_STORAGE_KEY,
colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,
attribute: initialAttribute = DEFAULT_ATTRIBUTE,
colorSchemeNode = 'document.documentElement',
nonce
} = options || {};
let setter = '';
let attribute = initialAttribute;
if (initialAttribute === 'class') {
attribute = '.%s';
}
if (initialAttribute === 'data') {
attribute = '[data-%s]';
}
if (attribute.startsWith('.')) {
const selector = attribute.substring(1);
setter += `${colorSchemeNode}.classList.remove('${selector}'.replace('%s', light), '${selector}'.replace('%s', dark));
${colorSchemeNode}.classList.add('${selector}'.replace('%s', colorScheme));`;
}
const matches = attribute.match(/\[([^[\]]+)\]/); // case [data-color-scheme='%s'] or [data-color-scheme]
if (matches) {
const [attr, value] = matches[1].split('=');
if (!value) {
setter += `${colorSchemeNode}.removeAttribute('${attr}'.replace('%s', light));
${colorSchemeNode}.removeAttribute('${attr}'.replace('%s', dark));`;
}
setter += `
${colorSchemeNode}.setAttribute('${attr}'.replace('%s', colorScheme), ${value ? `${value}.replace('%s', colorScheme)` : '""'});`;
} else if (attribute !== '.%s') {
setter += `${colorSchemeNode}.setAttribute('${attribute}', colorScheme);`;
}
return /*#__PURE__*/_jsx("script", {
suppressHydrationWarning: true,
nonce: typeof window === 'undefined' ? nonce : ''
// eslint-disable-next-line react/no-danger
,
dangerouslySetInnerHTML: {
__html: `(function() {
try {
let colorScheme = '';
const mode = localStorage.getItem('${modeStorageKey}') || '${defaultMode}';
const dark = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
const light = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
if (mode === 'system') {
// handle system mode
const mql = window.matchMedia('(prefers-color-scheme: dark)');
if (mql.matches) {
colorScheme = dark
} else {
colorScheme = light
}
}
if (mode === 'light') {
colorScheme = light;
}
if (mode === 'dark') {
colorScheme = dark;
}
if (colorScheme) {
${setter}
}
} catch(e){}})();`
}
}, "mui-color-scheme-init");
}
export default function InitColorSchemeScript(options) {
const isServerRender = useIsServerRender();
if (!isServerRender) {
return null;
}
return buildInitColorSchemeScript(options);
}
@@ -0,0 +1,2 @@
export { default } from "./InitColorSchemeScript.mjs";
export type { InitColorSchemeScriptProps } from "./InitColorSchemeScript.mjs";
@@ -0,0 +1,2 @@
export { default } from "./InitColorSchemeScript.js";
export type { InitColorSchemeScriptProps } from "./InitColorSchemeScript.js";
@@ -0,0 +1,13 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _InitColorSchemeScript.default;
}
});
var _InitColorSchemeScript = _interopRequireDefault(require("./InitColorSchemeScript"));
@@ -0,0 +1 @@
export { default } from "./InitColorSchemeScript.mjs";
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2014 Call-Em-All
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+19
View File
@@ -0,0 +1,19 @@
# MUI System
MUI System is a set of CSS utilities to help you build custom designs more efficiently. It makes it possible to rapidly lay out custom designs.
## Installation
Install the package in your project directory with:
<!-- #npm-tag-reference -->
```bash
npm install @mui/system @emotion/react @emotion/styled
```
## Documentation
<!-- #host-reference -->
Visit [https://mui.com/system/getting-started/](https://mui.com/system/getting-started/) to view the full documentation.
@@ -0,0 +1,8 @@
import * as React from 'react';
interface RtlProviderProps {
children?: React.ReactNode;
value?: boolean | undefined;
}
declare const RtlProvider: React.FC<RtlProviderProps>;
export const useRtl: () => boolean;
export default RtlProvider;
@@ -0,0 +1,8 @@
import * as React from 'react';
interface RtlProviderProps {
children?: React.ReactNode;
value?: boolean | undefined;
}
declare const RtlProvider: React.FC<RtlProviderProps>;
export const useRtl: () => boolean;
export default RtlProvider;
@@ -0,0 +1,32 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useRtl = exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _jsxRuntime = require("react/jsx-runtime");
const RtlContext = /*#__PURE__*/React.createContext();
function RtlProvider({
value,
...props
}) {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RtlContext.Provider, {
value: value ?? true,
...props
});
}
process.env.NODE_ENV !== "production" ? RtlProvider.propTypes = {
children: _propTypes.default.node,
value: _propTypes.default.bool
} : void 0;
const useRtl = () => {
const value = React.useContext(RtlContext);
return value ?? false;
};
exports.useRtl = useRtl;
var _default = exports.default = RtlProvider;
@@ -0,0 +1,24 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import { jsx as _jsx } from "react/jsx-runtime";
const RtlContext = /*#__PURE__*/React.createContext();
function RtlProvider({
value,
...props
}) {
return /*#__PURE__*/_jsx(RtlContext.Provider, {
value: value ?? true,
...props
});
}
process.env.NODE_ENV !== "production" ? RtlProvider.propTypes = {
children: PropTypes.node,
value: PropTypes.bool
} : void 0;
export const useRtl = () => {
const value = React.useContext(RtlContext);
return value ?? false;
};
export default RtlProvider;
@@ -0,0 +1,13 @@
/**
*
* Demos:
*
* - [Stack (Material UI)](https://mui.com/material-ui/react-stack/)
* - [Stack (MUI System)](https://mui.com/system/react-stack/)
*
* API:
*
* - [Stack API](https://mui.com/system/api/stack/)
*/
declare const Stack: import("@mui/types").OverridableComponent<import("./StackProps.mjs").StackTypeMap<{}, "div">>;
export default Stack;
@@ -0,0 +1,13 @@
/**
*
* Demos:
*
* - [Stack (Material UI)](https://mui.com/material-ui/react-stack/)
* - [Stack (MUI System)](https://mui.com/system/react-stack/)
*
* API:
*
* - [Stack API](https://mui.com/system/api/stack/)
*/
declare const Stack: import("@mui/types").OverridableComponent<import("./StackProps.js").StackTypeMap<{}, "div">>;
export default Stack;
@@ -0,0 +1,67 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _propTypes = _interopRequireDefault(require("prop-types"));
var _createStack = _interopRequireDefault(require("./createStack"));
/**
*
* Demos:
*
* - [Stack (Material UI)](https://mui.com/material-ui/react-stack/)
* - [Stack (MUI System)](https://mui.com/system/react-stack/)
*
* API:
*
* - [Stack API](https://mui.com/system/api/stack/)
*/
const Stack = (0, _createStack.default)();
process.env.NODE_ENV !== "production" ? Stack.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* The content of the component.
*/
children: _propTypes.default.node,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: _propTypes.default.elementType,
/**
* Defines the `flex-direction` style property.
* It is applied for all screen sizes.
* @default 'column'
*/
direction: _propTypes.default.oneOfType([_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), _propTypes.default.arrayOf(_propTypes.default.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), _propTypes.default.object]),
/**
* Add an element between each child.
*/
divider: _propTypes.default.node,
/**
* Defines the space between immediate children.
* @default 0
*/
spacing: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.string]),
/**
* The system prop, which allows defining system overrides as well as additional CSS styles.
*/
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
/**
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
*
* While CSS `gap` removes the known limitations,
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
*
* To enable this flag globally, follow the theme's default props configuration.
* @default false
*/
useFlexGap: _propTypes.default.bool
} : void 0;
var _default = exports.default = Stack;
@@ -0,0 +1,61 @@
'use client';
import PropTypes from 'prop-types';
import createStack from "./createStack.mjs";
/**
*
* Demos:
*
* - [Stack (Material UI)](https://mui.com/material-ui/react-stack/)
* - [Stack (MUI System)](https://mui.com/system/react-stack/)
*
* API:
*
* - [Stack API](https://mui.com/system/api/stack/)
*/
const Stack = createStack();
process.env.NODE_ENV !== "production" ? Stack.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* The content of the component.
*/
children: PropTypes.node,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: PropTypes.elementType,
/**
* Defines the `flex-direction` style property.
* It is applied for all screen sizes.
* @default 'column'
*/
direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
/**
* Add an element between each child.
*/
divider: PropTypes.node,
/**
* Defines the space between immediate children.
* @default 0
*/
spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
/**
* The system prop, which allows defining system overrides as well as additional CSS styles.
*/
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
/**
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
*
* While CSS `gap` removes the known limitations,
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
*
* To enable this flag globally, follow the theme's default props configuration.
* @default false
*/
useFlexGap: PropTypes.bool
} : void 0;
export default Stack;
@@ -0,0 +1,52 @@
import * as React from 'react';
import { OverrideProps } from '@mui/types';
import { ResponsiveStyleValue, SxProps } from "../styleFunctionSx/index.mjs";
import { Theme } from "../createTheme/index.mjs";
export interface StackBaseProps {
/**
* The content of the component.
*/
children?: React.ReactNode;
/**
* Defines the `flex-direction` style property.
* It is applied for all screen sizes.
* @default 'column'
*/
direction?: ResponsiveStyleValue<'row' | 'row-reverse' | 'column' | 'column-reverse'> | undefined;
/**
* Defines the space between immediate children.
* @default 0
*/
spacing?: ResponsiveStyleValue<number | string> | undefined;
/**
* Add an element between each child.
*/
divider?: React.ReactNode;
/**
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
*
* While CSS `gap` removes the known limitations,
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
*
* To enable this flag globally, follow the theme's default props configuration.
* @default false
*/
useFlexGap?: boolean | undefined;
}
export interface StackTypeMap<AdditionalProps = {}, DefaultComponent extends React.ElementType = 'div'> {
props: AdditionalProps & StackBaseProps & {
/**
* The system prop, which allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme> | undefined;
};
defaultComponent: DefaultComponent;
}
export type StackProps<RootComponent extends React.ElementType = StackTypeMap['defaultComponent'], AdditionalProps = {
component?: React.ElementType | undefined;
}> = OverrideProps<StackTypeMap<AdditionalProps, RootComponent>, RootComponent>;
export interface StackOwnerState {
direction: StackProps['direction'];
spacing: StackProps['spacing'];
useFlexGap: boolean;
}
@@ -0,0 +1,52 @@
import * as React from 'react';
import { OverrideProps } from '@mui/types';
import { ResponsiveStyleValue, SxProps } from "../styleFunctionSx/index.js";
import { Theme } from "../createTheme/index.js";
export interface StackBaseProps {
/**
* The content of the component.
*/
children?: React.ReactNode;
/**
* Defines the `flex-direction` style property.
* It is applied for all screen sizes.
* @default 'column'
*/
direction?: ResponsiveStyleValue<'row' | 'row-reverse' | 'column' | 'column-reverse'> | undefined;
/**
* Defines the space between immediate children.
* @default 0
*/
spacing?: ResponsiveStyleValue<number | string> | undefined;
/**
* Add an element between each child.
*/
divider?: React.ReactNode;
/**
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
*
* While CSS `gap` removes the known limitations,
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
*
* To enable this flag globally, follow the theme's default props configuration.
* @default false
*/
useFlexGap?: boolean | undefined;
}
export interface StackTypeMap<AdditionalProps = {}, DefaultComponent extends React.ElementType = 'div'> {
props: AdditionalProps & StackBaseProps & {
/**
* The system prop, which allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme> | undefined;
};
defaultComponent: DefaultComponent;
}
export type StackProps<RootComponent extends React.ElementType = StackTypeMap['defaultComponent'], AdditionalProps = {
component?: React.ElementType | undefined;
}> = OverrideProps<StackTypeMap<AdditionalProps, RootComponent>, RootComponent>;
export interface StackOwnerState {
direction: StackProps['direction'];
spacing: StackProps['spacing'];
useFlexGap: boolean;
}
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});

Some files were not shown because too many files have changed in this diff Show More