Skip to content

Commit

Permalink
Merge branch 'master' into feat/Select
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Oct 14, 2024
2 parents 1ef2828 + a85a514 commit 022163d
Show file tree
Hide file tree
Showing 19 changed files with 287 additions and 223 deletions.
8 changes: 4 additions & 4 deletions .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ samsung 22
# snapshot of `npx browserslist "maintained node versions"`
# On update check all #stable-snapshot markers
[node]
node 18.0
node 14.0

# same as `node`
[coverage]
node 18.0
node 14.0

# same as `node`
[development]
node 18.0
node 14.0

# same as `node`
[test]
node 18.0
node 14.0
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ jobs:
<<: *default-job
resource_class: 'medium+'
docker:
- image: mcr.microsoft.com/playwright:v1.47.2-focal
- image: mcr.microsoft.com/playwright:v1.48.0-focal
steps:
- checkout
- install_js:
Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:
test_profile:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.47.2-focal
- image: mcr.microsoft.com/playwright:v1.48.0-focal
steps:
- checkout
- install_js:
Expand All @@ -343,7 +343,7 @@ jobs:
test_regressions:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.47.2-focal
- image: mcr.microsoft.com/playwright:v1.48.0-focal
steps:
- checkout
- install_js:
Expand All @@ -358,7 +358,7 @@ jobs:
test_e2e:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.47.2-focal
- image: mcr.microsoft.com/playwright:v1.48.0-focal
steps:
- checkout
- install_js:
Expand Down
10 changes: 5 additions & 5 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"@emotion/server": "^11.11.0",
"@emotion/styled": "^11.13.0",
"@mdx-js/mdx": "^3.0.1",
"@mui/system": "6.1.1",
"@mui/utils": "6.1.1",
"@mui/system": "6.1.3",
"@mui/utils": "6.1.3",
"@react-spring/web": "^9.7.4",
"@stefanprobst/rehype-extract-toc": "^2.2.0",
"@types/mdx": "^2.0.13",
Expand Down Expand Up @@ -62,9 +62,9 @@
"devDependencies": {
"@babel/plugin-transform-react-constant-elements": "^7.25.1",
"@babel/preset-typescript": "^7.24.7",
"@mui/internal-docs-utils": "^1.0.13",
"@mui/internal-scripts": "^1.0.21",
"@mui/internal-test-utils": "1.0.14",
"@mui/internal-docs-utils": "^1.0.14",
"@mui/internal-scripts": "^1.0.23",
"@mui/internal-test-utils": "1.0.16",
"@types/chai": "^4.3.20",
"@types/gtag.js": "^0.0.20",
"@types/hast": "^3.0.4",
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@babel/register": "^7.24.6",
"@mui/internal-docs-utils": "^1.0.13",
"@mui/internal-markdown": "^1.0.14",
"@mui/internal-scripts": "^1.0.21",
"@mui/internal-test-utils": "1.0.14",
"@mui/internal-docs-utils": "^1.0.14",
"@mui/internal-markdown": "^1.0.16",
"@mui/internal-scripts": "^1.0.23",
"@mui/internal-test-utils": "1.0.16",
"@mui/monorepo": "github:mui/material-ui#v6.1.1",
"@mui/utils": "6.1.1",
"@mui/utils": "6.1.3",
"@next/eslint-plugin-next": "^14.2.13",
"@octokit/rest": "^20.1.1",
"@playwright/test": "1.47.2",
"@playwright/test": "1.48.0",
"@types/fs-extra": "^11.0.4",
"@types/lodash": "^4.17.9",
"@types/mocha": "^10.0.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@
"directory": "build"
},
"engines": {
"node": ">=12.0.0"
"node": ">=14.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/mui-base/src/AlertDialog/Root/AlertDialogRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useDialogRoot } from '../../Dialog/Root/useDialogRoot';
*
* - [AlertDialogRoot API](https://base-ui.netlify.app/components/react-alert-dialog/#api-reference-AlertDialogRoot)
*/
function AlertDialogRoot(props: AlertDialogRoot.Props) {
const AlertDialogRoot: React.FC<AlertDialogRoot.Props> = function AlertDialogRoot(props) {
const { children, defaultOpen, onOpenChange, open: openProp, animated = true } = props;

const dialogRootContext = React.useContext(AlertDialogRootContext);
Expand All @@ -41,7 +41,7 @@ function AlertDialogRoot(props: AlertDialogRoot.Props) {
{children}
</AlertDialogRootContext.Provider>
);
}
};

namespace AlertDialogRoot {
export type Props = Omit<DialogRoot.Props, 'modal' | 'dismissible'>;
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/Field/Validity/FieldValidity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { FieldValidityData } from '../Root/FieldRoot';
*
* - [FieldValidity API](https://base-ui.netlify.app/components/react-field/#api-reference-FieldValidity)
*/
function FieldValidity(props: FieldValidity.Props) {
const FieldValidity: React.FC<FieldValidity.Props> = function FieldValidity(props) {
const { validityData, invalid } = useFieldRootContext(false);

const fieldValidityState: FieldValidityState = React.useMemo(() => {
Expand All @@ -28,7 +28,7 @@ function FieldValidity(props: FieldValidity.Props) {
}, [validityData, invalid]);

return <React.Fragment>{props.children(fieldValidityState)}</React.Fragment>;
}
};

export interface FieldValidityState extends Omit<FieldValidityData, 'state'> {
validity: FieldValidityData['state'];
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/Menu/Root/MenuRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { MenuDirection, MenuOrientation, useMenuRoot } from './useMenuRoot';
*
* - [MenuRoot API](https://base-ui.netlify.app/components/react-menu/#api-reference-MenuRoot)
*/
function MenuRoot(props: MenuRoot.Props) {
const MenuRoot: React.FC<MenuRoot.Props> = function MenuRoot(props) {
const {
animated = true,
children,
Expand Down Expand Up @@ -89,7 +89,7 @@ function MenuRoot(props: MenuRoot.Props) {
}

return <MenuRootContext.Provider value={context}>{children}</MenuRootContext.Provider>;
}
};

namespace MenuRoot {
export interface Props {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as React from 'react';
import * as Popover from '@base_ui/react/Popover';
import { createRenderer, describeConformance } from '#test-utils';
import { screen } from '@mui/internal-test-utils';
import { expect } from 'chai';

describe('<Popover.Positioner />', () => {
const { render } = createRenderer();
Expand All @@ -15,4 +17,26 @@ describe('<Popover.Positioner />', () => {
);
},
}));

describe('prop: keepMounted', () => {
it('has inert attribute when closed', async () => {
await render(
<Popover.Root animated={false}>
<Popover.Positioner keepMounted data-testid="positioner" />
</Popover.Root>,
);

expect(screen.getByTestId('positioner')).to.have.attribute('inert');
});

it('does not have inert attribute when open', async () => {
await render(
<Popover.Root open animated={false}>
<Popover.Positioner keepMounted data-testid="positioner" />
</Popover.Root>,
);

expect(screen.getByTestId('positioner')).not.to.have.attribute('inert');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function usePopoverPositioner(
return mergeReactProps<'div'>(externalProps, {
role: 'presentation',
// @ts-ignore
inert: getInertValue(open),
inert: getInertValue(!open),
style: {
...positionerStyles,
...hiddenStyles,
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/Popover/Root/PopoverRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { OPEN_DELAY } from '../utils/constants';
*
* - [PopoverRoot API](https://base-ui.netlify.app/components/react-popover/#api-reference-PopoverRoot)
*/
function PopoverRoot(props: PopoverRoot.Props) {
const PopoverRoot: React.FC<PopoverRoot.Props> = function PopoverRoot(props) {
const { openOnHover = false, delayType = 'rest', delay, closeDelay = 0, animated = true } = props;

const delayWithDefault = delay ?? OPEN_DELAY;
Expand Down Expand Up @@ -105,7 +105,7 @@ function PopoverRoot(props: PopoverRoot.Props) {
return (
<PopoverRootContext.Provider value={contextValue}>{props.children}</PopoverRootContext.Provider>
);
}
};

namespace PopoverRoot {
export interface OwnerState {}
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/PreviewCard/Root/PreviewCardRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { CLOSE_DELAY, OPEN_DELAY } from '../utils/constants';
*
* - [PreviewCardRoot API](https://base-ui.netlify.app/components/react-preview-card/#api-reference-PreviewCardRoot)
*/
function PreviewCardRoot(props: PreviewCardRoot.Props) {
const PreviewCardRoot: React.FC<PreviewCardRoot.Props> = function PreviewCardRoot(props) {
const { delayType = 'rest', delay, closeDelay, animated = true } = props;

const delayWithDefault = delay ?? OPEN_DELAY;
Expand Down Expand Up @@ -92,7 +92,7 @@ function PreviewCardRoot(props: PreviewCardRoot.Props) {
{props.children}
</PreviewCardRootContext.Provider>
);
}
};

namespace PreviewCardRoot {
export interface OwnerState {}
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/Slider/Root/SliderProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function useSliderContext() {
*
* @ignore - do not document.
*/
function SliderProvider(props: SliderProviderProps) {
const SliderProvider: React.FC<SliderProviderProps> = function SliderProvider(props) {
const { value: valueProp, children } = props;

const { compoundComponentContextValue, ...contextValue } = valueProp;
Expand All @@ -38,7 +38,7 @@ function SliderProvider(props: SliderProviderProps) {
<SliderContext.Provider value={contextValue}>{children}</SliderContext.Provider>
</CompoundComponentContext.Provider>
);
}
};

SliderProvider.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/Tabs/Root/TabsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface TabsProviderProps {
*
* @ignore - do not document.
*/
function TabsProvider(props: TabsProviderProps) {
const TabsProvider: React.FC<TabsProviderProps> = function TabsProvider(props) {
const { value: valueProp, children } = props;
const {
direction,
Expand Down Expand Up @@ -76,7 +76,7 @@ function TabsProvider(props: TabsProviderProps) {
<TabsRootContext.Provider value={tabsContextValue}>{children}</TabsRootContext.Provider>
</CompoundComponentContext.Provider>
);
}
};

TabsProvider.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/Tabs/TabsList/TabsListProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface TabsListProviderProps {
*
* @ignore - do not document.
*/
function TabsListProvider(props: TabsListProviderProps) {
const TabsListProvider: React.FC<TabsListProviderProps> = function TabsListProvider(props) {
const { value, children } = props;
const {
dispatch,
Expand Down Expand Up @@ -65,7 +65,7 @@ function TabsListProvider(props: TabsListProviderProps) {
</ListContext.Provider>
</CompoundComponentContext.Provider>
);
}
};

TabsListProvider.propTypes /* remove-proptypes */ = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/Tooltip/Provider/TooltipProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import { FloatingDelayGroup } from '@floating-ui/react';
*
* - [TooltipProvider API](https://base-ui.netlify.app/components/react-tooltip/#api-reference-TooltipProvider)
*/
function TooltipProvider(props: TooltipProvider.Props) {
const TooltipProvider: React.FC<TooltipProvider.Props> = function TooltipProvider(props) {
const { delay, closeDelay, timeout = 400 } = props;
return (
<FloatingDelayGroup delay={{ open: delay ?? 0, close: closeDelay ?? 0 }} timeoutMs={timeout}>
{props.children}
</FloatingDelayGroup>
);
}
};

namespace TooltipProvider {
export interface Props {
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/Tooltip/Root/TooltipRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { OPEN_DELAY } from '../utils/constants';
*
* - [TooltipRoot API](https://base-ui.netlify.app/components/react-tooltip/#api-reference-TooltipRoot)
*/
function TooltipRoot(props: TooltipRoot.Props) {
const TooltipRoot: React.FC<TooltipRoot.Props> = function TooltipRoot(props) {
const {
delayType = 'rest',
delay,
Expand Down Expand Up @@ -102,7 +102,7 @@ function TooltipRoot(props: TooltipRoot.Props) {
return (
<TooltipRootContext.Provider value={contextValue}>{props.children}</TooltipRootContext.Provider>
);
}
};

namespace TooltipRoot {
export interface OwnerState {}
Expand Down
Loading

0 comments on commit 022163d

Please sign in to comment.