Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Remove 'use client' from index files #331

Merged
merged 9 commits into from
Sep 18, 2024
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

michaldudak marked this conversation as resolved.
Show resolved Hide resolved
import * as React from 'react';
import PropTypes from 'prop-types';
import { FloatingPortal } from '@floating-ui/react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { AlertDialogCloseOwnerState, AlertDialogCloseProps } from './AlertDialogClose.types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import type {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { FloatingFocusManager, FloatingPortal } from '@floating-ui/react';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/AlertDialog/Root/AlertDialogRoot.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { AlertDialogRootProps } from './AlertDialogRoot.types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import type { AlertDialogRootContextValue } from './AlertDialogRoot.types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import type { AlertDialogTitleOwnerState, AlertDialogTitleProps } from './AlertDialogTitle.types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { useDialogTrigger } from '../../Dialog/Trigger/useDialogTrigger';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import type { CheckboxIndicatorProps } from './CheckboxIndicator.types';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Checkbox/Root/CheckboxContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import type { CheckboxContextValue } from './CheckboxRoot.types';

Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Checkbox/Root/CheckboxRoot.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { CheckboxContext } from './CheckboxContext';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Checkbox/Root/CheckboxRootContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import type { CheckboxContextValue } from './CheckboxRoot.types';

Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Checkbox/Root/useCheckboxRoot.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import type { UseCheckboxRootParameters, UseCheckboxRootReturnValue } from './CheckboxRoot.types';
import { useControlled } from '../../utils/useControlled';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Checkbox/index.barrel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { CheckboxRoot } from './Root/CheckboxRoot';
export { useCheckboxRoot } from './Root/useCheckboxRoot';
export { CheckboxContext } from './Root/CheckboxContext';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Checkbox/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { CheckboxRoot as Root } from './Root/CheckboxRoot';
export { useCheckboxRoot } from './Root/useCheckboxRoot';
export { CheckboxContext } from './Root/CheckboxContext';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Checkbox/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import type { CheckboxRootOwnerState } from './Root/CheckboxRoot.types';
import { getStyleHookProps } from '../utils/getStyleHookProps';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import { useId } from '../../utils/useId';
import { useEventCallback } from '../../utils/useEventCallback';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { useComponentRenderer } from '../../utils/useComponentRenderer';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import { UseCheckboxGroupParent } from '../Parent/useCheckboxGroupParent';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import { mergeReactProps } from '../../utils/mergeReactProps';
import { useControlled } from '../../utils/useControlled';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { BaseUIComponentProps } from '../../utils/types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { mergeReactProps } from '../../utils/mergeReactProps';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import type { CollapsibleRoot } from './CollapsibleRoot';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import { expect } from 'chai';
import { spy } from 'sinon';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Collapsible/Root/CollapsibleRoot.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { BaseUIComponentProps } from '../../utils/types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import { useControlled } from '../../utils/useControlled';
import { useEventCallback } from '../../utils/useEventCallback';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { useComponentRenderer } from '../../utils/useComponentRenderer';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import { mergeReactProps } from '../../utils/mergeReactProps';
/**
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Composite/Item/CompositeItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { useComponentRenderer } from '../../utils/useComponentRenderer';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Composite/Item/useCompositeItem.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import { useCompositeRootContext } from '../Root/CompositeRootContext';
import { useCompositeListItem } from '../List/useCompositeListItem';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Composite/List/CompositeList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-bitwise */
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { useEnhancedEffect } from '../../utils/useEnhancedEffect';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';

export interface CompositeListContextValue {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import { useEnhancedEffect } from '../../utils/useEnhancedEffect';
import { useCompositeListContext } from './CompositeListContext';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Composite/Root/CompositeRoot.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { useComponentRenderer } from '../../utils/useComponentRenderer';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';

export const CompositeRootContext = React.createContext<CompositeRootContext.Value | null>(null);
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Composite/Root/useCompositeRoot.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import { useEventCallback } from '../../utils/useEventCallback';
import { mergeReactProps } from '../../utils/mergeReactProps';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Dialog/Backdrop/DialogBackdrop.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { FloatingPortal } from '@floating-ui/react';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Dialog/Backdrop/useDialogBackdrop.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import type { UseDialogBackdropParams, UseDialogBackdropReturnValue } from './DialogBackdrop.types';
import { mergeReactProps } from '../../utils/mergeReactProps';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Dialog/Close/DialogClose.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { DialogCloseProps } from './DialogClose.types';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Dialog/Close/useDialogClose.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import { mergeReactProps } from '../../utils/mergeReactProps';
import type { UseDialogCloseParameters, UseDialogCloseReturnValue } from './DialogClose.types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import type { DialogDescriptionProps } from './DialogDescription.types';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Dialog/Popup/DialogPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { FloatingFocusManager, FloatingPortal } from '@floating-ui/react';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Dialog/Popup/useDialogPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import { useFloating, useInteractions, useDismiss } from '@floating-ui/react';
import { UseDialogPopupParameters, UseDialogPopupReturnValue } from './DialogPopup.types';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Dialog/Root/DialogRoot.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { DialogRootProps } from './DialogRoot.types';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Dialog/Root/DialogRootContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import type { DialogRootContextValue } from './DialogRoot.types';

Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Dialog/Root/useDialogRoot.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import type { UseDialogRootParameters, UseDialogRootReturnValue } from './DialogRoot.types';
import { useControlled } from '../../utils/useControlled';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Dialog/Title/DialogTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import type { DialogTitleProps } from './DialogTitle.types';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Dialog/Trigger/DialogTrigger.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { useDialogTrigger } from './useDialogTrigger';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Dialog/Trigger/useDialogTrigger.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import { mergeReactProps } from '../../utils/mergeReactProps';
import type {
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Field/Control/FieldControl.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { useComponentRenderer } from '../../utils/useComponentRenderer';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Field/Control/useFieldControl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import { mergeReactProps } from '../../utils/mergeReactProps';
import { useEnhancedEffect } from '../../utils/useEnhancedEffect';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import { useEventCallback } from '../../utils/useEventCallback';
import { useFieldRootContext } from '../Root/FieldRootContext';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { useComponentRenderer } from '../../utils/useComponentRenderer';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import { mergeReactProps } from '../../utils/mergeReactProps';
import { useId } from '../../utils/useId';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Field/Error/FieldError.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { useComponentRenderer } from '../../utils/useComponentRenderer';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Field/Error/useFieldError.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import { mergeReactProps } from '../../utils/mergeReactProps';
import { useId } from '../../utils/useId';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Field/Label/FieldLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { useComponentRenderer } from '../../utils/useComponentRenderer';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Field/Label/useFieldLabel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import { mergeReactProps } from '../../utils/mergeReactProps';
import { useFieldRootContext } from '../Root/FieldRootContext';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Field/Root/FieldRoot.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { useComponentRenderer } from '../../utils/useComponentRenderer';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Field/Root/FieldRootContext.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import { DEFAULT_VALIDITY_STATE } from '../utils/constants';
import type { FieldRootOwnerState, FieldValidityData } from './FieldRoot.types';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Field/Validity/FieldValidity.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import { useFieldRootContext } from '../Root/FieldRootContext';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Fieldset/Legend/FieldsetLegend.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import type { FieldsetLegendOwnerState, FieldsetLegendProps } from './FieldsetLegend.types';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Fieldset/Legend/useFieldsetLegend.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import { mergeReactProps } from '../../utils/mergeReactProps';
import { useId } from '../../utils/useId';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Fieldset/Root/FieldsetRoot.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import PropTypes from 'prop-types';
import type { FieldsetRootOwnerState, FieldsetRootProps } from './FieldsetRoot.types';
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Fieldset/Root/FieldsetRootContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';

export interface FieldsetRootContextValue {
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-base/src/Fieldset/Root/useFieldsetRoot.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import * as React from 'react';
import { mergeReactProps } from '../../utils/mergeReactProps';
/**
Expand Down
Loading
Loading