Skip to content

Commit

Permalink
Add missing 'use client' and make styling consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
michaldudak committed Sep 4, 2024
1 parent 3f2de1f commit fe8662f
Show file tree
Hide file tree
Showing 217 changed files with 262 additions and 0 deletions.
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/AlertDialog/Close/AlertDialogClose.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 { 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
2 changes: 2 additions & 0 deletions packages/mui-base/src/AlertDialog/Popup/AlertDialogPopup.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/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
2 changes: 2 additions & 0 deletions packages/mui-base/src/AlertDialog/Title/AlertDialogTitle.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 { 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,4 +1,5 @@
'use client';

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

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

Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Checkbox/Root/CheckboxRoot.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 { 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
1 change: 1 addition & 0 deletions packages/mui-base/src/Checkbox/Root/useCheckboxRoot.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import * as React from 'react';
import type { UseCheckboxRootParameters, UseCheckboxRootReturnValue } from './CheckboxRoot.types';
import { useControlled } from '../../utils/useControlled';
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
2 changes: 2 additions & 0 deletions packages/mui-base/src/Composite/List/CompositeListContext.ts
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
2 changes: 2 additions & 0 deletions packages/mui-base/src/Composite/Root/CompositeRootContext.ts
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
1 change: 1 addition & 0 deletions packages/mui-base/src/Menu/Arrow/MenuArrow.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 { useMenuArrow } from './useMenuArrow';
Expand Down
1 change: 1 addition & 0 deletions packages/mui-base/src/Menu/Arrow/useMenuArrow.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 type { GenericHTMLProps } from '../../utils/types';
Expand Down
Loading

0 comments on commit fe8662f

Please sign in to comment.