Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ export default defineConfig(
'react-hooks/refs': 'off',
},
},
{
files: [`packages/**/*${EXTENSION_TS}`],
ignores: [`**/*${EXTENSION_TEST_FILE}`, `**/*.spec${EXTENSION_TS}`],
rules: {
'material-ui/disallow-react-api-in-server-components': ['error'],
},
},
{
files: [
// matching the pattern of the test runner
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@babel/plugin-transform-react-constant-elements": "^7.27.1",
"@base-ui-components/monorepo-tests": "workspace:*",
"@mui/internal-netlify-cache": "^0.0.2-canary.1",
"@mui/internal-code-infra": "^0.0.3-canary.49",
"@mui/internal-code-infra": "https://pkg.pr.new/mui/mui-public/@mui/internal-code-infra@e49bf36",
"@mui/internal-test-utils": "^2.0.15",
"@next/eslint-plugin-next": "15.5.6",
"@octokit/rest": "^22.0.1",
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/combobox/chip/ComboboxChipContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface ComboboxChipContext {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface ComboboxChipsContext {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface ComboboxGroupContext {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/combobox/item/ComboboxItemContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface ComboboxItemContext {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export const ComboboxPortalContext = React.createContext<boolean | undefined>(undefined);
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/combobox/root/ComboboxRootContext.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { ComboboxStore } from '../store';
import type { FloatingRootContext } from '../../floating-ui-react';
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/combobox/row/ComboboxRowContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export const ComboboxRowContext = React.createContext(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import type { ContextMenuRoot } from './ContextMenuRoot';

Expand Down
1 change: 1 addition & 0 deletions packages/react/src/dialog/portal/DialogPortalContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export const DialogPortalContext = React.createContext<boolean | undefined>(undefined);
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/field/item/FieldItemContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface FieldItemContext {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/field/useField.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as ReactDOM from 'react-dom';
import { useIsoLayoutEffect } from '@base-ui-components/utils/useIsoLayoutEffect';
import { useStableCallback } from '@base-ui-components/utils/useStableCallback';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { useTimeout, Timeout } from '@base-ui-components/utils/useTimeout';
import { useIsoLayoutEffect } from '@base-ui-components/utils/useIsoLayoutEffect';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { tabbable, isTabbable, focusable, type FocusableElement } from 'tabbable';
import { getNodeName, isHTMLElement } from '@floating-ui/utils/dom';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { isNode } from '@floating-ui/utils/dom';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

import { useId } from '@base-ui-components/utils/useId';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { getWindow } from '@floating-ui/utils/dom';
import { useStableCallback } from '@base-ui-components/utils/useStableCallback';
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/floating-ui-react/hooks/useDismiss.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { getOverflowAncestors } from '@floating-ui/react-dom';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { useFloating as usePosition, type VirtualElement } from '@floating-ui/react-dom';
import { isElement } from '@floating-ui/utils/dom';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { isElement } from '@floating-ui/utils/dom';
import { useStableCallback } from '@base-ui-components/utils/useStableCallback';
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/floating-ui-react/hooks/useFocus.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { getWindow, isElement, isHTMLElement } from '@floating-ui/utils/dom';
import { isMac, isSafari } from '@base-ui-components/utils/detectBrowser';
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/floating-ui-react/hooks/useHover.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { isElement } from '@floating-ui/utils/dom';
import { useTimeout } from '@base-ui-components/utils/useTimeout';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { isElement } from '@floating-ui/utils/dom';
import { useStableCallback } from '@base-ui-components/utils/useStableCallback';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { useTimeout } from '@base-ui-components/utils/useTimeout';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { isElement } from '@floating-ui/utils/dom';
import { useValueAsRef } from '@base-ui-components/utils/useValueAsRef';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { isHTMLElement } from '@floating-ui/utils/dom';
import { useValueAsRef } from '@base-ui-components/utils/useValueAsRef';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { useStableCallback } from '@base-ui-components/utils/useStableCallback';
import { useIsoLayoutEffect } from '@base-ui-components/utils/useIsoLayoutEffect';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface MenuCheckboxItemContext {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/menu/group/MenuGroupContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface MenuGroupContext {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/menu/portal/MenuPortalContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export const MenuPortalContext = React.createContext<boolean | undefined>(undefined);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import type { MenuRoot } from '../root/MenuRoot';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface MenuRadioItemContext {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { MenuStore } from '../store/MenuStore';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface NavigationMenuItemContextValue {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import type { ElementProps } from '../../floating-ui-react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export const NavigationMenuPortalContext = React.createContext<boolean | undefined>(undefined);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import type { FloatingRootContext } from '../../floating-ui-react';
import type { TransitionStatus } from '../../utils/useTransitionStatus';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface NumberFieldScrubAreaContext {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export const PopoverPortalContext = React.createContext<boolean | undefined>(undefined);
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/popover/viewport/PopoverViewport.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { inertValue } from '@base-ui-components/utils/inertValue';
import { useAnimationFrame } from '@base-ui-components/utils/useAnimationFrame';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export const PreviewCardPortalContext = React.createContext<boolean | undefined>(undefined);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import type { ScrollAreaRoot } from './ScrollAreaRoot';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface ScrollAreaScrollbarContext {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface ScrollAreaViewportContext {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/select/group/SelectGroupContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface SelectGroupContext {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/select/item/SelectItemContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface SelectItemContext {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/select/portal/SelectPortalContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export const SelectPortalContext = React.createContext<boolean | undefined>(undefined);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { type Side, useAnchorPositioning } from '../../utils/useAnchorPositioning';

Expand Down
1 change: 1 addition & 0 deletions packages/react/src/select/root/SelectRootContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { useFloatingRootContext, type FloatingRootContext } from '../../floating-ui-react';
import type { SelectStore } from '../store';
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/switch/root/SwitchRootContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import type { SwitchRoot } from './SwitchRoot';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import type {
ToastObject,
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/toast/root/ToastRootContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import type { ToastObject } from '../useToastManager';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface ToastViewportContext {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/toolbar/group/ToolbarGroupContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface ToolbarGroupContext {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export const TooltipPortalContext = React.createContext<boolean | undefined>(undefined);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export interface TooltipProviderContext {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/tooltip/viewport/TooltipViewport.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { inertValue } from '@base-ui-components/utils/inertValue';
import { useAnimationFrame } from '@base-ui-components/utils/useAnimationFrame';
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/utils/popupStoreUtils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { Store } from '@base-ui-components/utils/store';
import { useIsoLayoutEffect } from '@base-ui-components/utils/useIsoLayoutEffect';
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/utils/useMixedToggleClickHander.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { ownerDocument } from '@base-ui-components/utils/owner';
import { BaseUIEvent } from './types';
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/utils/usePopupAutoResize.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { useAnimationFrame } from '@base-ui-components/utils/useAnimationFrame';
import { useIsoLayoutEffect } from '@base-ui-components/utils/useIsoLayoutEffect';
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/utils/useValueChanged.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { useIsoLayoutEffect } from '@base-ui-components/utils/useIsoLayoutEffect';
import { useStableCallback } from '@base-ui-components/utils/useStableCallback';
Expand Down
1 change: 1 addition & 0 deletions packages/react/test/floating-ui-tests/ComplexGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import {
FloatingFocusManager,
Expand Down
1 change: 1 addition & 0 deletions packages/react/test/floating-ui-tests/EmojiPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import c from 'clsx';
import { useId } from '@base-ui-components/utils/useId';
Expand Down
1 change: 1 addition & 0 deletions packages/react/test/floating-ui-tests/Grid.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import {
FloatingFocusManager,
Expand Down
1 change: 1 addition & 0 deletions packages/react/test/floating-ui-tests/ListboxFocus.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { CompositeList } from '../../src/composite/list/CompositeList';
import { useCompositeListItem } from '../../src/composite/list/useCompositeListItem';
Expand Down
1 change: 1 addition & 0 deletions packages/react/test/floating-ui-tests/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import c from 'clsx';
import * as React from 'react';
import { useMergedRefsN } from '@base-ui-components/utils/useMergedRefs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import c from 'clsx';
import { useMergedRefsN } from '@base-ui-components/utils/useMergedRefs';
Expand Down
1 change: 1 addition & 0 deletions packages/react/test/floating-ui-tests/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import { useMergedRefs } from '@base-ui-components/utils/useMergedRefs';
import {
Expand Down
1 change: 1 addition & 0 deletions packages/react/test/floating-ui-tests/Popover.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/no-shadow */
'use client';
import * as React from 'react';
import type { Placement } from '../../src/floating-ui-react/types';
import {
Expand Down
1 change: 1 addition & 0 deletions packages/utils/src/store/ReactStore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* False positives - ESLint thinks we're calling a hook from a class component. */
/* eslint-disable react-hooks/rules-of-hooks */
'use client';
import * as React from 'react';
import { Store } from './Store';
import { useStore } from './useStore';
Expand Down
1 change: 1 addition & 0 deletions packages/utils/src/store/StoreInspector.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Store } from './Store';
Expand Down
1 change: 1 addition & 0 deletions packages/utils/src/useEnhancedClickHandler.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export type InteractionType = 'mouse' | 'touch' | 'pen' | 'keyboard' | '';
Expand Down
1 change: 1 addition & 0 deletions packages/utils/src/useOnFirstRender.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client';
import * as React from 'react';

export function useOnFirstRender(fn: Function) {
Expand Down
Loading