From 5ba88cf4140f8f06c2320f935174c3286c6816d2 Mon Sep 17 00:00:00 2001 From: delangle Date: Tue, 10 Sep 2024 15:54:45 +0200 Subject: [PATCH 1/6] [pickers] Add use client directive --- package.json | 1 + packages/rsc-builder/buildRsc.ts | 138 ++++++++++++++++++ packages/rsc-builder/package.json | 14 ++ packages/rsc-builder/tsconfig.json | 27 ++++ .../DateRangeCalendar/DateRangeCalendar.tsx | 1 + .../src/DateRangeCalendar/useDragRange.ts | 1 + .../src/DateRangePicker/DateRangePicker.tsx | 1 + .../DateRangePickerToolbar.tsx | 1 + .../DateRangePickerDay/DateRangePickerDay.tsx | 1 + .../DateTimeRangePicker.tsx | 1 + .../DateTimeRangePickerTabs.tsx | 1 + .../DateTimeRangePickerTimeWrapper.tsx | 1 + .../DateTimeRangePickerToolbar.tsx | 1 + .../DesktopDateRangePicker.tsx | 1 + .../DesktopDateTimeRangePicker.tsx | 1 + .../MobileDateRangePicker.tsx | 1 + .../MobileDateTimeRangePicker.tsx | 1 + .../MultiInputDateRangeField.tsx | 1 + .../MultiInputDateTimeRangeField.tsx | 1 + .../MultiInputTimeRangeField.tsx | 1 + .../PickersRangeCalendarHeader.tsx | 1 + .../SingleInputDateRangeField.tsx | 1 + .../useSingleInputDateRangeField.ts | 1 + .../SingleInputDateTimeRangeField.tsx | 1 + .../useSingleInputDateTimeRangeField.ts | 1 + .../SingleInputTimeRangeField.tsx | 1 + .../useSingleInputTimeRangeField.ts | 1 + .../StaticDateRangePicker.tsx | 1 + .../internals/hooks/models/useRangePicker.ts | 1 + .../useDesktopRangePicker.tsx | 1 + .../hooks/useEnrichedRangePickerFieldProps.ts | 1 + .../useMobileRangePicker.tsx | 1 + .../useMultiInputFieldSelectedSections.ts | 1 + .../useMultiInputDateRangeField.ts | 1 + .../useMultiInputDateTimeRangeField.ts | 1 + .../useMultiInputTimeRangeField.ts | 1 + .../src/internals/hooks/useRangePosition.ts | 1 + .../useStaticRangePicker.tsx | 1 + .../src/DateCalendar/DateCalendar.tsx | 1 + .../src/DateCalendar/DayCalendar.tsx | 1 + .../PickersFadeTransitionGroup.tsx | 1 + .../DateCalendar/PickersSlideTransition.tsx | 1 + .../src/DateCalendar/useCalendarState.tsx | 1 + .../src/DateCalendar/useIsDateDisabled.ts | 1 + .../src/DateField/DateField.tsx | 1 + .../src/DateField/useDateField.ts | 1 + .../src/DatePicker/DatePicker.tsx | 1 + .../src/DatePicker/DatePickerToolbar.tsx | 1 + .../x-date-pickers/src/DatePicker/shared.tsx | 1 + .../src/DateTimeField/DateTimeField.tsx | 1 + .../src/DateTimeField/useDateTimeField.ts | 1 + .../src/DateTimePicker/DateTimePicker.tsx | 1 + .../src/DateTimePicker/DateTimePickerTabs.tsx | 1 + .../DateTimePicker/DateTimePickerToolbar.tsx | 1 + .../src/DateTimePicker/shared.tsx | 1 + .../DayCalendarSkeleton.tsx | 1 + .../DesktopDatePicker/DesktopDatePicker.tsx | 1 + .../DesktopDateTimePicker.tsx | 1 + .../DesktopDateTimePickerLayout.tsx | 1 + .../DesktopTimePicker/DesktopTimePicker.tsx | 1 + .../src/DigitalClock/DigitalClock.tsx | 1 + .../LocalizationProvider.tsx | 1 + .../src/MobileDatePicker/MobileDatePicker.tsx | 1 + .../MobileDateTimePicker.tsx | 1 + .../src/MobileTimePicker/MobileTimePicker.tsx | 1 + .../src/MonthCalendar/MonthCalendar.tsx | 1 + .../src/MonthCalendar/PickersMonth.tsx | 1 + .../MultiSectionDigitalClock.tsx | 1 + .../MultiSectionDigitalClockSection.tsx | 1 + .../src/PickersActionBar/PickersActionBar.tsx | 1 + .../PickersCalendarHeader.tsx | 1 + .../src/PickersDay/PickersDay.tsx | 1 + .../src/PickersLayout/PickersLayout.tsx | 1 + .../src/PickersLayout/usePickerLayout.tsx | 1 + .../PickersSectionList/PickersSectionList.tsx | 1 + .../src/PickersShortcuts/PickersShortcuts.tsx | 1 + .../PickersFilledInput/PickersFilledInput.tsx | 1 + .../PickersInput/PickersInput.tsx | 1 + .../PickersInputBase/PickersInputBase.tsx | 1 + .../PickersOutlinedInput/Outline.tsx | 1 + .../PickersOutlinedInput.tsx | 1 + .../src/PickersTextField/PickersTextField.tsx | 1 + .../src/StaticDatePicker/StaticDatePicker.tsx | 1 + .../StaticDateTimePicker.tsx | 1 + .../src/StaticTimePicker/StaticTimePicker.tsx | 1 + .../x-date-pickers/src/TimeClock/Clock.tsx | 1 + .../src/TimeClock/ClockNumber.tsx | 1 + .../src/TimeClock/ClockNumbers.tsx | 1 + .../src/TimeClock/ClockPointer.tsx | 1 + .../src/TimeClock/TimeClock.tsx | 1 + .../src/TimeField/TimeField.tsx | 1 + .../src/TimeField/useTimeField.ts | 1 + .../src/TimePicker/TimePicker.tsx | 1 + .../src/TimePicker/TimePickerToolbar.tsx | 1 + .../src/YearCalendar/PickersYear.tsx | 1 + .../src/YearCalendar/YearCalendar.tsx | 1 + .../dateViewRenderers/dateViewRenderers.tsx | 1 + .../src/hooks/useClearableField.tsx | 1 + .../src/hooks/usePickersTranslations.ts | 1 + .../PickerViewRoot/PickerViewRoot.tsx | 1 + .../PickersArrowSwitcher.tsx | 1 + .../components/PickersModalDialog.tsx | 1 + .../internals/components/PickersPopper.tsx | 1 + .../internals/components/PickersToolbar.tsx | 1 + .../components/PickersToolbarButton.tsx | 1 + .../components/PickersToolbarText.tsx | 1 + .../src/internals/demo/DemoContainer.tsx | 1 + .../internals/hooks/useClockReferenceDate.ts | 1 + .../hooks/useDefaultReduceAnimations.ts | 1 + .../useDesktopPicker/useDesktopPicker.tsx | 1 + .../src/internals/hooks/useField/useField.ts | 1 + .../useField/useFieldCharacterEditing.ts | 1 + .../internals/hooks/useField/useFieldState.ts | 1 + .../src/internals/hooks/useIsLandscape.tsx | 1 + .../hooks/useMobilePicker/useMobilePicker.tsx | 1 + .../src/internals/hooks/useOpenState.ts | 1 + .../internals/hooks/usePicker/usePicker.ts | 1 + .../hooks/usePicker/usePickerLayoutProps.ts | 1 + .../hooks/usePicker/usePickerValue.ts | 1 + .../hooks/usePicker/usePickerViews.ts | 1 + .../hooks/useStaticPicker/useStaticPicker.tsx | 1 + .../src/internals/hooks/useUtils.ts | 1 + .../src/internals/hooks/useValidation.ts | 1 + .../internals/hooks/useValueWithTimezone.ts | 1 + .../src/internals/hooks/useViews.tsx | 1 + pnpm-lock.yaml | 16 ++ 126 files changed, 317 insertions(+) create mode 100644 packages/rsc-builder/buildRsc.ts create mode 100644 packages/rsc-builder/package.json create mode 100644 packages/rsc-builder/tsconfig.json diff --git a/package.json b/package.json index 46c718e6f6f07..ddaff5b6b55e7 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "prettier:all": "prettier --write . --ignore-path .eslintignore", "prettier:check": "prettier --check . --ignore-path .eslintignore", "proptypes": "cross-env BABEL_ENV=development babel-node -i \"/node_modules/(?!@mui)/\" -x .ts,.tsx,.js ./docs/scripts/generateProptypes.ts", + "rsc:build": "tsx ./packages/rsc-builder/buildRsc.ts", "size:snapshot": "node --max-old-space-size=2048 ./scripts/sizeSnapshot/create", "size:why": "pnpm size:snapshot --analyze --accurateBundles", "tc": "node test/cli.js", diff --git a/packages/rsc-builder/buildRsc.ts b/packages/rsc-builder/buildRsc.ts new file mode 100644 index 0000000000000..db2894d3c7194 --- /dev/null +++ b/packages/rsc-builder/buildRsc.ts @@ -0,0 +1,138 @@ +import path from 'path'; +import * as yargs from 'yargs'; +import * as fse from 'fs-extra'; +import findComponents from '@mui-internal/api-docs-builder/utils/findComponents'; +import findHooks from '@mui-internal/api-docs-builder/utils/findHooks'; + +type CommandOptions = { grep?: string }; + +type Project = { + name: string; + rootPath: string; + additionalPaths?: string[]; + additionalFiles?: string[]; + ignorePaths?: string[]; +}; + +const PROJECTS: Project[] = [ + { + name: 'x-date-pickers', + rootPath: path.join(process.cwd(), 'packages/x-date-pickers'), + }, + { + name: 'x-date-pickers-pro', + rootPath: path.join(process.cwd(), 'packages/x-date-pickers-pro'), + }, +]; + +async function processFile( + filename: string, + options: { + lineToPrepend?: string; + } = {}, +) { + if (!fse.statSync(filename).isFile()) { + return; + } + + const { lineToPrepend = `'use client';` } = options; + const contents = await fse.readFile(filename, 'utf8'); + + const lines = contents.split(/\r?\n/); + if (lines[0] === lineToPrepend) { + return; + } + + const newContents = `${lineToPrepend}\n${contents}`; + + await fse.writeFile(filename, newContents); +} + +async function findAll( + directories: string[], + grep: RegExp | null, + findFn: typeof findComponents | typeof findHooks, +) { + const result = await Promise.all( + directories.map((dir) => { + return findFn(dir).filter((item) => { + if (grep === null) { + return true; + } + return grep.test(item.filename); + }); + }), + ); + + return result.flat(); +} + +async function run(argv: yargs.ArgumentsCamelCase) { + const grep = argv.grep == null ? null : new RegExp(argv.grep); + + await PROJECTS.reduce(async (resolvedPromise, project) => { + await resolvedPromise; + + const projectSrc = path.join(project.rootPath, 'src'); + + let directories = [projectSrc]; + + if (Array.isArray(project?.additionalPaths)) { + directories = [ + ...directories, + ...project.additionalPaths.map((p) => path.join(project.rootPath, p)), + ]; + } + + const components = await findAll(directories, grep, findComponents); + + components.forEach(async (component) => { + try { + if (!project.ignorePaths?.some((p) => component.filename.includes(p))) { + processFile(component.filename); + } + } catch (error: any) { + error.message = `${path.relative(process.cwd(), component.filename)}: ${error.message}`; + throw error; + } + }); + + const hooks = await findAll(directories, grep, findHooks); + + hooks.forEach(async (hook) => { + try { + processFile(hook.filename); + } catch (error: any) { + error.message = `${path.relative(process.cwd(), hook.filename)}: ${error.message}`; + throw error; + } + }); + + if (Array.isArray(project?.additionalFiles)) { + project.additionalFiles.forEach(async (file) => { + const fullPath = path.join(project.rootPath, file); + processFile(fullPath); + }); + } + + return Promise.resolve(); + }, Promise.resolve()); +} + +yargs + .command({ + command: '$0', + describe: 'prepends the use client directive to components', + builder: (command) => { + return command.option('grep', { + description: + 'Only process files for component filenames matching the pattern. The string is treated as a RegExp.', + type: 'string', + }); + }, + handler: run, + }) + .help() + .strict(true) + .version(false) + .parse(); diff --git a/packages/rsc-builder/package.json b/packages/rsc-builder/package.json new file mode 100644 index 0000000000000..62d32f1d7207a --- /dev/null +++ b/packages/rsc-builder/package.json @@ -0,0 +1,14 @@ +{ + "name": "rsc-builder", + "version": "1.0.0", + "private": "true", + "main": "./buildRsc.ts", + "dependencies": { + "fs-extra": "^11.2.0", + "yargs": "^17.7.2" + }, + "devDependencies": { + "@types/mocha": "^10.0.7", + "@types/node": "^20.14.8" + } +} diff --git a/packages/rsc-builder/tsconfig.json b/packages/rsc-builder/tsconfig.json new file mode 100644 index 0000000000000..b75961018edf4 --- /dev/null +++ b/packages/rsc-builder/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "allowJs": true, + "isolatedModules": true, + "noEmit": true, + "noUnusedLocals": false, + "resolveJsonModule": true, + "skipLibCheck": true, + "esModuleInterop": true, + "types": ["node", "mocha"], + "target": "ES2020", + "module": "CommonJS", + "moduleResolution": "node", + "strict": true, + "baseUrl": "./", + "paths": { + "@mui-internal/api-docs-builder": [ + "../../node_modules/@mui/monorepo/packages/api-docs-builder/index.ts" + ], + "@mui-internal/api-docs-builder/*": [ + "../../node_modules/@mui/monorepo/packages/api-docs-builder/*" + ] + } + }, + "include": ["./**/*.ts", "./**/*.js"], + "exclude": ["node_modules"] +} diff --git a/packages/x-date-pickers-pro/src/DateRangeCalendar/DateRangeCalendar.tsx b/packages/x-date-pickers-pro/src/DateRangeCalendar/DateRangeCalendar.tsx index f5ca4c0dcb02b..d46019e3c753b 100644 --- a/packages/x-date-pickers-pro/src/DateRangeCalendar/DateRangeCalendar.tsx +++ b/packages/x-date-pickers-pro/src/DateRangeCalendar/DateRangeCalendar.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers-pro/src/DateRangeCalendar/useDragRange.ts b/packages/x-date-pickers-pro/src/DateRangeCalendar/useDragRange.ts index c14b500c8abeb..25db9f81dcb13 100644 --- a/packages/x-date-pickers-pro/src/DateRangeCalendar/useDragRange.ts +++ b/packages/x-date-pickers-pro/src/DateRangeCalendar/useDragRange.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useEventCallback from '@mui/utils/useEventCallback'; import { MuiPickersAdapter, PickersTimezone, PickerValidDate } from '@mui/x-date-pickers/models'; diff --git a/packages/x-date-pickers-pro/src/DateRangePicker/DateRangePicker.tsx b/packages/x-date-pickers-pro/src/DateRangePicker/DateRangePicker.tsx index f24af1d702eb4..c6a5c6e350c83 100644 --- a/packages/x-date-pickers-pro/src/DateRangePicker/DateRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/DateRangePicker/DateRangePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import useMediaQuery from '@mui/material/useMediaQuery'; diff --git a/packages/x-date-pickers-pro/src/DateRangePicker/DateRangePickerToolbar.tsx b/packages/x-date-pickers-pro/src/DateRangePicker/DateRangePickerToolbar.tsx index e712df9885088..bd0064bc58e57 100644 --- a/packages/x-date-pickers-pro/src/DateRangePicker/DateRangePickerToolbar.tsx +++ b/packages/x-date-pickers-pro/src/DateRangePicker/DateRangePickerToolbar.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers-pro/src/DateRangePickerDay/DateRangePickerDay.tsx b/packages/x-date-pickers-pro/src/DateRangePickerDay/DateRangePickerDay.tsx index 2c466c3680a0b..965e7d3c75a7c 100644 --- a/packages/x-date-pickers-pro/src/DateRangePickerDay/DateRangePickerDay.tsx +++ b/packages/x-date-pickers-pro/src/DateRangePickerDay/DateRangePickerDay.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePicker.tsx b/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePicker.tsx index 6985cce40ca0c..64a1316f3b781 100644 --- a/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { refType } from '@mui/utils'; diff --git a/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerTabs.tsx b/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerTabs.tsx index a5b56f8eaeacc..60e1a9f533f2b 100644 --- a/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerTabs.tsx +++ b/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerTabs.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import PropTypes from 'prop-types'; diff --git a/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.tsx b/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.tsx index e8f096ffcef58..8df770392f7a7 100644 --- a/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.tsx +++ b/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { PickerSelectionState, diff --git a/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerToolbar.tsx b/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerToolbar.tsx index 3d8c07b23c6fe..9a16f3cba0691 100644 --- a/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerToolbar.tsx +++ b/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerToolbar.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers-pro/src/DesktopDateRangePicker/DesktopDateRangePicker.tsx b/packages/x-date-pickers-pro/src/DesktopDateRangePicker/DesktopDateRangePicker.tsx index f76e7d1ad76ba..5e4e0470d1210 100644 --- a/packages/x-date-pickers-pro/src/DesktopDateRangePicker/DesktopDateRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/DesktopDateRangePicker/DesktopDateRangePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { extractValidationProps, PickerViewRendererLookup } from '@mui/x-date-pickers/internals'; diff --git a/packages/x-date-pickers-pro/src/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.tsx b/packages/x-date-pickers-pro/src/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.tsx index b25801087ea91..a74953bff4c91 100644 --- a/packages/x-date-pickers-pro/src/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { diff --git a/packages/x-date-pickers-pro/src/MobileDateRangePicker/MobileDateRangePicker.tsx b/packages/x-date-pickers-pro/src/MobileDateRangePicker/MobileDateRangePicker.tsx index 6cb841389f50c..a8e55f3bcc818 100644 --- a/packages/x-date-pickers-pro/src/MobileDateRangePicker/MobileDateRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/MobileDateRangePicker/MobileDateRangePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { extractValidationProps, PickerViewRendererLookup } from '@mui/x-date-pickers/internals'; diff --git a/packages/x-date-pickers-pro/src/MobileDateTimeRangePicker/MobileDateTimeRangePicker.tsx b/packages/x-date-pickers-pro/src/MobileDateTimeRangePicker/MobileDateTimeRangePicker.tsx index 63637dbce3747..2f4c62f045580 100644 --- a/packages/x-date-pickers-pro/src/MobileDateTimeRangePicker/MobileDateTimeRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/MobileDateTimeRangePicker/MobileDateTimeRangePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { refType } from '@mui/utils'; diff --git a/packages/x-date-pickers-pro/src/MultiInputDateRangeField/MultiInputDateRangeField.tsx b/packages/x-date-pickers-pro/src/MultiInputDateRangeField/MultiInputDateRangeField.tsx index 24417abcd17f6..838d39e1ab116 100644 --- a/packages/x-date-pickers-pro/src/MultiInputDateRangeField/MultiInputDateRangeField.tsx +++ b/packages/x-date-pickers-pro/src/MultiInputDateRangeField/MultiInputDateRangeField.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.tsx b/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.tsx index 3b4cdd1aa8648..ae95abc153588 100644 --- a/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.tsx +++ b/packages/x-date-pickers-pro/src/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/MultiInputTimeRangeField.tsx b/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/MultiInputTimeRangeField.tsx index 16344a1013828..8bd5276f356b8 100644 --- a/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/MultiInputTimeRangeField.tsx +++ b/packages/x-date-pickers-pro/src/MultiInputTimeRangeField/MultiInputTimeRangeField.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { clsx } from 'clsx'; diff --git a/packages/x-date-pickers-pro/src/PickersRangeCalendarHeader/PickersRangeCalendarHeader.tsx b/packages/x-date-pickers-pro/src/PickersRangeCalendarHeader/PickersRangeCalendarHeader.tsx index 13270808e6eae..46c70f5f5de0c 100644 --- a/packages/x-date-pickers-pro/src/PickersRangeCalendarHeader/PickersRangeCalendarHeader.tsx +++ b/packages/x-date-pickers-pro/src/PickersRangeCalendarHeader/PickersRangeCalendarHeader.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { styled } from '@mui/material/styles'; diff --git a/packages/x-date-pickers-pro/src/SingleInputDateRangeField/SingleInputDateRangeField.tsx b/packages/x-date-pickers-pro/src/SingleInputDateRangeField/SingleInputDateRangeField.tsx index e9df9fc89acfd..2326ebf18ee0f 100644 --- a/packages/x-date-pickers-pro/src/SingleInputDateRangeField/SingleInputDateRangeField.tsx +++ b/packages/x-date-pickers-pro/src/SingleInputDateRangeField/SingleInputDateRangeField.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import MuiTextField from '@mui/material/TextField'; diff --git a/packages/x-date-pickers-pro/src/SingleInputDateRangeField/useSingleInputDateRangeField.ts b/packages/x-date-pickers-pro/src/SingleInputDateRangeField/useSingleInputDateRangeField.ts index acd9177c5fa67..04b6eab9d08ba 100644 --- a/packages/x-date-pickers-pro/src/SingleInputDateRangeField/useSingleInputDateRangeField.ts +++ b/packages/x-date-pickers-pro/src/SingleInputDateRangeField/useSingleInputDateRangeField.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { useField, diff --git a/packages/x-date-pickers-pro/src/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.tsx b/packages/x-date-pickers-pro/src/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.tsx index 579c6a62010f6..417e2631f65e5 100644 --- a/packages/x-date-pickers-pro/src/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.tsx +++ b/packages/x-date-pickers-pro/src/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import MuiTextField from '@mui/material/TextField'; diff --git a/packages/x-date-pickers-pro/src/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.ts b/packages/x-date-pickers-pro/src/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.ts index c27ab9b259b30..78b98c3e7e293 100644 --- a/packages/x-date-pickers-pro/src/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.ts +++ b/packages/x-date-pickers-pro/src/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { useField, diff --git a/packages/x-date-pickers-pro/src/SingleInputTimeRangeField/SingleInputTimeRangeField.tsx b/packages/x-date-pickers-pro/src/SingleInputTimeRangeField/SingleInputTimeRangeField.tsx index 73bf67c73ac39..640d3670867e2 100644 --- a/packages/x-date-pickers-pro/src/SingleInputTimeRangeField/SingleInputTimeRangeField.tsx +++ b/packages/x-date-pickers-pro/src/SingleInputTimeRangeField/SingleInputTimeRangeField.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import MuiTextField from '@mui/material/TextField'; diff --git a/packages/x-date-pickers-pro/src/SingleInputTimeRangeField/useSingleInputTimeRangeField.ts b/packages/x-date-pickers-pro/src/SingleInputTimeRangeField/useSingleInputTimeRangeField.ts index 98d9703e7eb85..5163f5f0e80d2 100644 --- a/packages/x-date-pickers-pro/src/SingleInputTimeRangeField/useSingleInputTimeRangeField.ts +++ b/packages/x-date-pickers-pro/src/SingleInputTimeRangeField/useSingleInputTimeRangeField.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { useField, diff --git a/packages/x-date-pickers-pro/src/StaticDateRangePicker/StaticDateRangePicker.tsx b/packages/x-date-pickers-pro/src/StaticDateRangePicker/StaticDateRangePicker.tsx index 5283f9efdac60..0f026015a4e03 100644 --- a/packages/x-date-pickers-pro/src/StaticDateRangePicker/StaticDateRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/StaticDateRangePicker/StaticDateRangePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { PickerViewRendererLookup } from '@mui/x-date-pickers/internals'; diff --git a/packages/x-date-pickers-pro/src/internals/hooks/models/useRangePicker.ts b/packages/x-date-pickers-pro/src/internals/hooks/models/useRangePicker.ts index f78eda4c15195..0808af9168b6d 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/models/useRangePicker.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/models/useRangePicker.ts @@ -1,3 +1,4 @@ +'use client'; import { UsePickerParams, BasePickerProps, diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.tsx b/packages/x-date-pickers-pro/src/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.tsx index cb635fdba2ca8..90baf58a62f11 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useSlotProps from '@mui/utils/useSlotProps'; import { useLicenseVerifier } from '@mui/x-license'; diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useEnrichedRangePickerFieldProps.ts b/packages/x-date-pickers-pro/src/internals/hooks/useEnrichedRangePickerFieldProps.ts index 92161a1d50daa..f17dab830c418 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useEnrichedRangePickerFieldProps.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/useEnrichedRangePickerFieldProps.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import Stack, { StackProps } from '@mui/material/Stack'; import Typography, { TypographyProps } from '@mui/material/Typography'; diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useMobileRangePicker/useMobileRangePicker.tsx b/packages/x-date-pickers-pro/src/internals/hooks/useMobileRangePicker/useMobileRangePicker.tsx index 8c0ff74043266..66cbcdeaa17f8 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useMobileRangePicker/useMobileRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/internals/hooks/useMobileRangePicker/useMobileRangePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useSlotProps from '@mui/utils/useSlotProps'; import { useLicenseVerifier } from '@mui/x-license'; diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputFieldSelectedSections.ts b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputFieldSelectedSections.ts index 4f6987aa23612..95dd77e83aaae 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputFieldSelectedSections.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputFieldSelectedSections.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useForkRef from '@mui/utils/useForkRef'; import useEventCallback from '@mui/utils/useEventCallback'; diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.ts b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.ts index 84dfaeeb86312..a7c060ed124f7 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.ts @@ -1,3 +1,4 @@ +'use client'; import useEventCallback from '@mui/utils/useEventCallback'; import { unstable_useDateField as useDateField, diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.ts b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.ts index cecc16b5cc6eb..957d49c16083b 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.ts @@ -1,3 +1,4 @@ +'use client'; import useEventCallback from '@mui/utils/useEventCallback'; import { unstable_useDateTimeField as useDateTimeField, diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.ts b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.ts index a27dcb41a897f..a8d3f5a004cce 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.ts @@ -1,3 +1,4 @@ +'use client'; import useEventCallback from '@mui/utils/useEventCallback'; import { unstable_useTimeField as useTimeField, diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useRangePosition.ts b/packages/x-date-pickers-pro/src/internals/hooks/useRangePosition.ts index c5029471e4e88..ed77e99136f2a 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useRangePosition.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/useRangePosition.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useControlled from '@mui/utils/useControlled'; import useEventCallback from '@mui/utils/useEventCallback'; diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useStaticRangePicker/useStaticRangePicker.tsx b/packages/x-date-pickers-pro/src/internals/hooks/useStaticRangePicker/useStaticRangePicker.tsx index fbb9d3a4f76cb..34324e62a0149 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useStaticRangePicker/useStaticRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/internals/hooks/useStaticRangePicker/useStaticRangePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/DateCalendar/DateCalendar.tsx b/packages/x-date-pickers/src/DateCalendar/DateCalendar.tsx index 380dae01c035e..c876f0f556691 100644 --- a/packages/x-date-pickers/src/DateCalendar/DateCalendar.tsx +++ b/packages/x-date-pickers/src/DateCalendar/DateCalendar.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers/src/DateCalendar/DayCalendar.tsx b/packages/x-date-pickers/src/DateCalendar/DayCalendar.tsx index 31d01710d5bfe..198fb4a84c6a2 100644 --- a/packages/x-date-pickers/src/DateCalendar/DayCalendar.tsx +++ b/packages/x-date-pickers/src/DateCalendar/DayCalendar.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useEventCallback from '@mui/utils/useEventCallback'; import Typography from '@mui/material/Typography'; diff --git a/packages/x-date-pickers/src/DateCalendar/PickersFadeTransitionGroup.tsx b/packages/x-date-pickers/src/DateCalendar/PickersFadeTransitionGroup.tsx index 584a245ad0157..69d8337c10809 100644 --- a/packages/x-date-pickers/src/DateCalendar/PickersFadeTransitionGroup.tsx +++ b/packages/x-date-pickers/src/DateCalendar/PickersFadeTransitionGroup.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import { TransitionGroup } from 'react-transition-group'; diff --git a/packages/x-date-pickers/src/DateCalendar/PickersSlideTransition.tsx b/packages/x-date-pickers/src/DateCalendar/PickersSlideTransition.tsx index e560306b50331..a552306612ced 100644 --- a/packages/x-date-pickers/src/DateCalendar/PickersSlideTransition.tsx +++ b/packages/x-date-pickers/src/DateCalendar/PickersSlideTransition.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled, useTheme, useThemeProps } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/DateCalendar/useCalendarState.tsx b/packages/x-date-pickers/src/DateCalendar/useCalendarState.tsx index 5da5597f0f0c8..29fff983fe3df 100644 --- a/packages/x-date-pickers/src/DateCalendar/useCalendarState.tsx +++ b/packages/x-date-pickers/src/DateCalendar/useCalendarState.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useEventCallback from '@mui/utils/useEventCallback'; import { SlideDirection } from './PickersSlideTransition'; diff --git a/packages/x-date-pickers/src/DateCalendar/useIsDateDisabled.ts b/packages/x-date-pickers/src/DateCalendar/useIsDateDisabled.ts index 7fbde8e847724..9e8d5f8ebc6c8 100644 --- a/packages/x-date-pickers/src/DateCalendar/useIsDateDisabled.ts +++ b/packages/x-date-pickers/src/DateCalendar/useIsDateDisabled.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { DateComponentValidationProps, diff --git a/packages/x-date-pickers/src/DateField/DateField.tsx b/packages/x-date-pickers/src/DateField/DateField.tsx index 7f6a1ec7ed458..2e99c220e38fa 100644 --- a/packages/x-date-pickers/src/DateField/DateField.tsx +++ b/packages/x-date-pickers/src/DateField/DateField.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import MuiTextField from '@mui/material/TextField'; diff --git a/packages/x-date-pickers/src/DateField/useDateField.ts b/packages/x-date-pickers/src/DateField/useDateField.ts index a6ea87980fdd4..7e375a050f5d2 100644 --- a/packages/x-date-pickers/src/DateField/useDateField.ts +++ b/packages/x-date-pickers/src/DateField/useDateField.ts @@ -1,3 +1,4 @@ +'use client'; import { singleItemFieldValueManager, singleItemValueManager, diff --git a/packages/x-date-pickers/src/DatePicker/DatePicker.tsx b/packages/x-date-pickers/src/DatePicker/DatePicker.tsx index a75adf37b6e27..1b59fdbaa3434 100644 --- a/packages/x-date-pickers/src/DatePicker/DatePicker.tsx +++ b/packages/x-date-pickers/src/DatePicker/DatePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import useMediaQuery from '@mui/material/useMediaQuery'; diff --git a/packages/x-date-pickers/src/DatePicker/DatePickerToolbar.tsx b/packages/x-date-pickers/src/DatePicker/DatePickerToolbar.tsx index e90974b9ac843..b3f2a082907e9 100644 --- a/packages/x-date-pickers/src/DatePicker/DatePickerToolbar.tsx +++ b/packages/x-date-pickers/src/DatePicker/DatePickerToolbar.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import PropTypes from 'prop-types'; diff --git a/packages/x-date-pickers/src/DatePicker/shared.tsx b/packages/x-date-pickers/src/DatePicker/shared.tsx index abfb67d545de6..7f4d142a0840b 100644 --- a/packages/x-date-pickers/src/DatePicker/shared.tsx +++ b/packages/x-date-pickers/src/DatePicker/shared.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { useThemeProps } from '@mui/material/styles'; import { DefaultizedProps } from '../internals/models/helpers'; diff --git a/packages/x-date-pickers/src/DateTimeField/DateTimeField.tsx b/packages/x-date-pickers/src/DateTimeField/DateTimeField.tsx index ab78822ead2cb..311209132dddc 100644 --- a/packages/x-date-pickers/src/DateTimeField/DateTimeField.tsx +++ b/packages/x-date-pickers/src/DateTimeField/DateTimeField.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import MuiTextField from '@mui/material/TextField'; diff --git a/packages/x-date-pickers/src/DateTimeField/useDateTimeField.ts b/packages/x-date-pickers/src/DateTimeField/useDateTimeField.ts index b92124fe93731..147e746a4eaa9 100644 --- a/packages/x-date-pickers/src/DateTimeField/useDateTimeField.ts +++ b/packages/x-date-pickers/src/DateTimeField/useDateTimeField.ts @@ -1,3 +1,4 @@ +'use client'; import { singleItemFieldValueManager, singleItemValueManager, diff --git a/packages/x-date-pickers/src/DateTimePicker/DateTimePicker.tsx b/packages/x-date-pickers/src/DateTimePicker/DateTimePicker.tsx index fc5cab3f50edd..beed0975c5cad 100644 --- a/packages/x-date-pickers/src/DateTimePicker/DateTimePicker.tsx +++ b/packages/x-date-pickers/src/DateTimePicker/DateTimePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import useMediaQuery from '@mui/material/useMediaQuery'; diff --git a/packages/x-date-pickers/src/DateTimePicker/DateTimePickerTabs.tsx b/packages/x-date-pickers/src/DateTimePicker/DateTimePickerTabs.tsx index 4e04145fcf473..a9042194162d7 100644 --- a/packages/x-date-pickers/src/DateTimePicker/DateTimePickerTabs.tsx +++ b/packages/x-date-pickers/src/DateTimePicker/DateTimePickerTabs.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import PropTypes from 'prop-types'; diff --git a/packages/x-date-pickers/src/DateTimePicker/DateTimePickerToolbar.tsx b/packages/x-date-pickers/src/DateTimePicker/DateTimePickerToolbar.tsx index fc46e8bf0083b..6dc4a2e2d75b9 100644 --- a/packages/x-date-pickers/src/DateTimePicker/DateTimePickerToolbar.tsx +++ b/packages/x-date-pickers/src/DateTimePicker/DateTimePickerToolbar.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { useRtl } from '@mui/system/RtlProvider'; diff --git a/packages/x-date-pickers/src/DateTimePicker/shared.tsx b/packages/x-date-pickers/src/DateTimePicker/shared.tsx index 4c34b61987e96..0f5f801d932c5 100644 --- a/packages/x-date-pickers/src/DateTimePicker/shared.tsx +++ b/packages/x-date-pickers/src/DateTimePicker/shared.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { useThemeProps } from '@mui/material/styles'; import { DefaultizedProps } from '../internals/models/helpers'; diff --git a/packages/x-date-pickers/src/DayCalendarSkeleton/DayCalendarSkeleton.tsx b/packages/x-date-pickers/src/DayCalendarSkeleton/DayCalendarSkeleton.tsx index a42de4d0dc78e..60ff3c131f085 100644 --- a/packages/x-date-pickers/src/DayCalendarSkeleton/DayCalendarSkeleton.tsx +++ b/packages/x-date-pickers/src/DayCalendarSkeleton/DayCalendarSkeleton.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePicker.tsx b/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePicker.tsx index fcea15c593a76..996f8f161aef1 100644 --- a/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePicker.tsx +++ b/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import resolveComponentProps from '@mui/utils/resolveComponentProps'; diff --git a/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePicker.tsx b/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePicker.tsx index 259a84364176f..f10a1e062cb87 100644 --- a/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePicker.tsx +++ b/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import resolveComponentProps from '@mui/utils/resolveComponentProps'; diff --git a/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePickerLayout.tsx b/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePickerLayout.tsx index f2ff16a8b4474..24efd0807a72c 100644 --- a/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePickerLayout.tsx +++ b/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePickerLayout.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers/src/DesktopTimePicker/DesktopTimePicker.tsx b/packages/x-date-pickers/src/DesktopTimePicker/DesktopTimePicker.tsx index 42919188531c3..57cbccd30dba9 100644 --- a/packages/x-date-pickers/src/DesktopTimePicker/DesktopTimePicker.tsx +++ b/packages/x-date-pickers/src/DesktopTimePicker/DesktopTimePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import resolveComponentProps from '@mui/utils/resolveComponentProps'; diff --git a/packages/x-date-pickers/src/DigitalClock/DigitalClock.tsx b/packages/x-date-pickers/src/DigitalClock/DigitalClock.tsx index 5119b2b0b6436..b9c0e5bd1941e 100644 --- a/packages/x-date-pickers/src/DigitalClock/DigitalClock.tsx +++ b/packages/x-date-pickers/src/DigitalClock/DigitalClock.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import PropTypes from 'prop-types'; diff --git a/packages/x-date-pickers/src/LocalizationProvider/LocalizationProvider.tsx b/packages/x-date-pickers/src/LocalizationProvider/LocalizationProvider.tsx index 9e177e149985d..8993b434ec0c1 100644 --- a/packages/x-date-pickers/src/LocalizationProvider/LocalizationProvider.tsx +++ b/packages/x-date-pickers/src/LocalizationProvider/LocalizationProvider.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { useThemeProps } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/MobileDatePicker/MobileDatePicker.tsx b/packages/x-date-pickers/src/MobileDatePicker/MobileDatePicker.tsx index 34fece6808b94..764e2c5a9cba1 100644 --- a/packages/x-date-pickers/src/MobileDatePicker/MobileDatePicker.tsx +++ b/packages/x-date-pickers/src/MobileDatePicker/MobileDatePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import resolveComponentProps from '@mui/utils/resolveComponentProps'; diff --git a/packages/x-date-pickers/src/MobileDateTimePicker/MobileDateTimePicker.tsx b/packages/x-date-pickers/src/MobileDateTimePicker/MobileDateTimePicker.tsx index b04083666c4e2..4c6b119d19236 100644 --- a/packages/x-date-pickers/src/MobileDateTimePicker/MobileDateTimePicker.tsx +++ b/packages/x-date-pickers/src/MobileDateTimePicker/MobileDateTimePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import resolveComponentProps from '@mui/utils/resolveComponentProps'; diff --git a/packages/x-date-pickers/src/MobileTimePicker/MobileTimePicker.tsx b/packages/x-date-pickers/src/MobileTimePicker/MobileTimePicker.tsx index 7a398cc43d1a1..775702347d3f6 100644 --- a/packages/x-date-pickers/src/MobileTimePicker/MobileTimePicker.tsx +++ b/packages/x-date-pickers/src/MobileTimePicker/MobileTimePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import resolveComponentProps from '@mui/utils/resolveComponentProps'; diff --git a/packages/x-date-pickers/src/MonthCalendar/MonthCalendar.tsx b/packages/x-date-pickers/src/MonthCalendar/MonthCalendar.tsx index 8dd82e718275f..c4e8e501391e0 100644 --- a/packages/x-date-pickers/src/MonthCalendar/MonthCalendar.tsx +++ b/packages/x-date-pickers/src/MonthCalendar/MonthCalendar.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers/src/MonthCalendar/PickersMonth.tsx b/packages/x-date-pickers/src/MonthCalendar/PickersMonth.tsx index 9c1bcf3bcf3d6..6c6914b68ce8b 100644 --- a/packages/x-date-pickers/src/MonthCalendar/PickersMonth.tsx +++ b/packages/x-date-pickers/src/MonthCalendar/PickersMonth.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled, alpha, useThemeProps } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClock.tsx b/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClock.tsx index dabbbb69619bf..f9db7217d2387 100644 --- a/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClock.tsx +++ b/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClock.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import PropTypes from 'prop-types'; diff --git a/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClockSection.tsx b/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClockSection.tsx index cbc6a60df7a0b..7eb0542d9d2ea 100644 --- a/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClockSection.tsx +++ b/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClockSection.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import { alpha, styled, useThemeProps } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/PickersActionBar/PickersActionBar.tsx b/packages/x-date-pickers/src/PickersActionBar/PickersActionBar.tsx index 3b12b4353d024..0392de6be15b9 100644 --- a/packages/x-date-pickers/src/PickersActionBar/PickersActionBar.tsx +++ b/packages/x-date-pickers/src/PickersActionBar/PickersActionBar.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import Button from '@mui/material/Button'; diff --git a/packages/x-date-pickers/src/PickersCalendarHeader/PickersCalendarHeader.tsx b/packages/x-date-pickers/src/PickersCalendarHeader/PickersCalendarHeader.tsx index 84cdf31ad41db..51a7224b66f9a 100644 --- a/packages/x-date-pickers/src/PickersCalendarHeader/PickersCalendarHeader.tsx +++ b/packages/x-date-pickers/src/PickersCalendarHeader/PickersCalendarHeader.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers/src/PickersDay/PickersDay.tsx b/packages/x-date-pickers/src/PickersDay/PickersDay.tsx index b4bcfb74e7310..43b8fe282cc0d 100644 --- a/packages/x-date-pickers/src/PickersDay/PickersDay.tsx +++ b/packages/x-date-pickers/src/PickersDay/PickersDay.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers/src/PickersLayout/PickersLayout.tsx b/packages/x-date-pickers/src/PickersLayout/PickersLayout.tsx index a61368d59aa93..64562ee5255f7 100644 --- a/packages/x-date-pickers/src/PickersLayout/PickersLayout.tsx +++ b/packages/x-date-pickers/src/PickersLayout/PickersLayout.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers/src/PickersLayout/usePickerLayout.tsx b/packages/x-date-pickers/src/PickersLayout/usePickerLayout.tsx index e9fab40f161f8..7f9b8ad28ddfe 100644 --- a/packages/x-date-pickers/src/PickersLayout/usePickerLayout.tsx +++ b/packages/x-date-pickers/src/PickersLayout/usePickerLayout.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useSlotProps from '@mui/utils/useSlotProps'; import composeClasses from '@mui/utils/composeClasses'; diff --git a/packages/x-date-pickers/src/PickersSectionList/PickersSectionList.tsx b/packages/x-date-pickers/src/PickersSectionList/PickersSectionList.tsx index ada0fed9cd078..362fecaaa716b 100644 --- a/packages/x-date-pickers/src/PickersSectionList/PickersSectionList.tsx +++ b/packages/x-date-pickers/src/PickersSectionList/PickersSectionList.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import useSlotProps from '@mui/utils/useSlotProps'; diff --git a/packages/x-date-pickers/src/PickersShortcuts/PickersShortcuts.tsx b/packages/x-date-pickers/src/PickersShortcuts/PickersShortcuts.tsx index 991a4d5ae7a41..b164341349a33 100644 --- a/packages/x-date-pickers/src/PickersShortcuts/PickersShortcuts.tsx +++ b/packages/x-date-pickers/src/PickersShortcuts/PickersShortcuts.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import List, { ListProps } from '@mui/material/List'; diff --git a/packages/x-date-pickers/src/PickersTextField/PickersFilledInput/PickersFilledInput.tsx b/packages/x-date-pickers/src/PickersTextField/PickersFilledInput/PickersFilledInput.tsx index 74e10a3bd0506..a1a799e0d7446 100644 --- a/packages/x-date-pickers/src/PickersTextField/PickersFilledInput/PickersFilledInput.tsx +++ b/packages/x-date-pickers/src/PickersTextField/PickersFilledInput/PickersFilledInput.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { FormControlState, useFormControl } from '@mui/material/FormControl'; diff --git a/packages/x-date-pickers/src/PickersTextField/PickersInput/PickersInput.tsx b/packages/x-date-pickers/src/PickersTextField/PickersInput/PickersInput.tsx index 877d9dde9221a..c035692508373 100644 --- a/packages/x-date-pickers/src/PickersTextField/PickersInput/PickersInput.tsx +++ b/packages/x-date-pickers/src/PickersTextField/PickersInput/PickersInput.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { FormControlState, useFormControl } from '@mui/material/FormControl'; diff --git a/packages/x-date-pickers/src/PickersTextField/PickersInputBase/PickersInputBase.tsx b/packages/x-date-pickers/src/PickersTextField/PickersInputBase/PickersInputBase.tsx index e7813d3adbf84..8b03187a4cf43 100644 --- a/packages/x-date-pickers/src/PickersTextField/PickersInputBase/PickersInputBase.tsx +++ b/packages/x-date-pickers/src/PickersTextField/PickersInputBase/PickersInputBase.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { FormControlState, useFormControl } from '@mui/material/FormControl'; diff --git a/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/Outline.tsx b/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/Outline.tsx index 9195cb4bc84a8..b3a3f142b1fff 100644 --- a/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/Outline.tsx +++ b/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/Outline.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { styled } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.tsx b/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.tsx index 9ab29a6dfb616..625628f51e334 100644 --- a/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.tsx +++ b/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { FormControlState, useFormControl } from '@mui/material/FormControl'; diff --git a/packages/x-date-pickers/src/PickersTextField/PickersTextField.tsx b/packages/x-date-pickers/src/PickersTextField/PickersTextField.tsx index 1ba9e2b3f1d1d..f0be340101ddb 100644 --- a/packages/x-date-pickers/src/PickersTextField/PickersTextField.tsx +++ b/packages/x-date-pickers/src/PickersTextField/PickersTextField.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers/src/StaticDatePicker/StaticDatePicker.tsx b/packages/x-date-pickers/src/StaticDatePicker/StaticDatePicker.tsx index 4338718c441bc..4f8e4c8f675a0 100644 --- a/packages/x-date-pickers/src/StaticDatePicker/StaticDatePicker.tsx +++ b/packages/x-date-pickers/src/StaticDatePicker/StaticDatePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { StaticDatePickerProps } from './StaticDatePicker.types'; diff --git a/packages/x-date-pickers/src/StaticDateTimePicker/StaticDateTimePicker.tsx b/packages/x-date-pickers/src/StaticDateTimePicker/StaticDateTimePicker.tsx index a93916d40fcd1..2f928efff3fca 100644 --- a/packages/x-date-pickers/src/StaticDateTimePicker/StaticDateTimePicker.tsx +++ b/packages/x-date-pickers/src/StaticDateTimePicker/StaticDateTimePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { StaticDateTimePickerProps } from './StaticDateTimePicker.types'; diff --git a/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.tsx b/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.tsx index 49466bcc21232..a0ac216310090 100644 --- a/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.tsx +++ b/packages/x-date-pickers/src/StaticTimePicker/StaticTimePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { PickerValidDate, TimeView } from '../models'; diff --git a/packages/x-date-pickers/src/TimeClock/Clock.tsx b/packages/x-date-pickers/src/TimeClock/Clock.tsx index d7fc0a8b2e608..87981b1b082ec 100644 --- a/packages/x-date-pickers/src/TimeClock/Clock.tsx +++ b/packages/x-date-pickers/src/TimeClock/Clock.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import IconButton from '@mui/material/IconButton'; diff --git a/packages/x-date-pickers/src/TimeClock/ClockNumber.tsx b/packages/x-date-pickers/src/TimeClock/ClockNumber.tsx index c407a02a7adf7..ef4362aa489c8 100644 --- a/packages/x-date-pickers/src/TimeClock/ClockNumber.tsx +++ b/packages/x-date-pickers/src/TimeClock/ClockNumber.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled, useThemeProps } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/TimeClock/ClockNumbers.tsx b/packages/x-date-pickers/src/TimeClock/ClockNumbers.tsx index 28c34d15caf5b..de888cece85b8 100644 --- a/packages/x-date-pickers/src/TimeClock/ClockNumbers.tsx +++ b/packages/x-date-pickers/src/TimeClock/ClockNumbers.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { ClockNumber } from './ClockNumber'; import { MuiPickersAdapter, PickerValidDate } from '../models'; diff --git a/packages/x-date-pickers/src/TimeClock/ClockPointer.tsx b/packages/x-date-pickers/src/TimeClock/ClockPointer.tsx index db50723091b6d..37ca9c3287b07 100644 --- a/packages/x-date-pickers/src/TimeClock/ClockPointer.tsx +++ b/packages/x-date-pickers/src/TimeClock/ClockPointer.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled, useThemeProps } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/TimeClock/TimeClock.tsx b/packages/x-date-pickers/src/TimeClock/TimeClock.tsx index 44a9581ea1026..699514c015e44 100644 --- a/packages/x-date-pickers/src/TimeClock/TimeClock.tsx +++ b/packages/x-date-pickers/src/TimeClock/TimeClock.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import PropTypes from 'prop-types'; diff --git a/packages/x-date-pickers/src/TimeField/TimeField.tsx b/packages/x-date-pickers/src/TimeField/TimeField.tsx index d609f295ecd63..9dd69bdf8a68e 100644 --- a/packages/x-date-pickers/src/TimeField/TimeField.tsx +++ b/packages/x-date-pickers/src/TimeField/TimeField.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import MuiTextField from '@mui/material/TextField'; diff --git a/packages/x-date-pickers/src/TimeField/useTimeField.ts b/packages/x-date-pickers/src/TimeField/useTimeField.ts index bd81134e599f9..b57fdb6718c58 100644 --- a/packages/x-date-pickers/src/TimeField/useTimeField.ts +++ b/packages/x-date-pickers/src/TimeField/useTimeField.ts @@ -1,3 +1,4 @@ +'use client'; import { singleItemFieldValueManager, singleItemValueManager, diff --git a/packages/x-date-pickers/src/TimePicker/TimePicker.tsx b/packages/x-date-pickers/src/TimePicker/TimePicker.tsx index 534bead56e177..b6749e642eba1 100644 --- a/packages/x-date-pickers/src/TimePicker/TimePicker.tsx +++ b/packages/x-date-pickers/src/TimePicker/TimePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import useMediaQuery from '@mui/material/useMediaQuery'; diff --git a/packages/x-date-pickers/src/TimePicker/TimePickerToolbar.tsx b/packages/x-date-pickers/src/TimePicker/TimePickerToolbar.tsx index 6bc310619603d..2e6c844f72561 100644 --- a/packages/x-date-pickers/src/TimePicker/TimePickerToolbar.tsx +++ b/packages/x-date-pickers/src/TimePicker/TimePickerToolbar.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import PropTypes from 'prop-types'; diff --git a/packages/x-date-pickers/src/YearCalendar/PickersYear.tsx b/packages/x-date-pickers/src/YearCalendar/PickersYear.tsx index 4cfd69ba8232a..44d7f0f951661 100644 --- a/packages/x-date-pickers/src/YearCalendar/PickersYear.tsx +++ b/packages/x-date-pickers/src/YearCalendar/PickersYear.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled, alpha, useThemeProps } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/YearCalendar/YearCalendar.tsx b/packages/x-date-pickers/src/YearCalendar/YearCalendar.tsx index 5cf5d7ec126ea..3e83737057c2b 100644 --- a/packages/x-date-pickers/src/YearCalendar/YearCalendar.tsx +++ b/packages/x-date-pickers/src/YearCalendar/YearCalendar.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers/src/dateViewRenderers/dateViewRenderers.tsx b/packages/x-date-pickers/src/dateViewRenderers/dateViewRenderers.tsx index fa043429c5999..cd7f90703eafa 100644 --- a/packages/x-date-pickers/src/dateViewRenderers/dateViewRenderers.tsx +++ b/packages/x-date-pickers/src/dateViewRenderers/dateViewRenderers.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { DateCalendar, DateCalendarProps } from '../DateCalendar'; import { DateView, PickerValidDate } from '../models'; diff --git a/packages/x-date-pickers/src/hooks/useClearableField.tsx b/packages/x-date-pickers/src/hooks/useClearableField.tsx index 52e3838e15b34..08bceb35a493d 100644 --- a/packages/x-date-pickers/src/hooks/useClearableField.tsx +++ b/packages/x-date-pickers/src/hooks/useClearableField.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { SlotComponentProps } from '@mui/utils'; import useSlotProps from '@mui/utils/useSlotProps'; diff --git a/packages/x-date-pickers/src/hooks/usePickersTranslations.ts b/packages/x-date-pickers/src/hooks/usePickersTranslations.ts index 6ad1a7d4bcc28..e6acceff1df02 100644 --- a/packages/x-date-pickers/src/hooks/usePickersTranslations.ts +++ b/packages/x-date-pickers/src/hooks/usePickersTranslations.ts @@ -1,3 +1,4 @@ +'use client'; import { PickerValidDate } from '../models'; import { useLocalizationContext } from '../internals/hooks/useUtils'; diff --git a/packages/x-date-pickers/src/internals/components/PickerViewRoot/PickerViewRoot.tsx b/packages/x-date-pickers/src/internals/components/PickerViewRoot/PickerViewRoot.tsx index 0fb7abdd9db51..673e72b1507a7 100644 --- a/packages/x-date-pickers/src/internals/components/PickerViewRoot/PickerViewRoot.tsx +++ b/packages/x-date-pickers/src/internals/components/PickerViewRoot/PickerViewRoot.tsx @@ -1,3 +1,4 @@ +'use client'; import { styled } from '@mui/material/styles'; import { DIALOG_WIDTH, VIEW_HEIGHT } from '../../constants/dimensions'; diff --git a/packages/x-date-pickers/src/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.tsx b/packages/x-date-pickers/src/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.tsx index a5dd5873308f4..5eba443f7c415 100644 --- a/packages/x-date-pickers/src/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.tsx +++ b/packages/x-date-pickers/src/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import Typography from '@mui/material/Typography'; diff --git a/packages/x-date-pickers/src/internals/components/PickersModalDialog.tsx b/packages/x-date-pickers/src/internals/components/PickersModalDialog.tsx index 5b89bb61cf1be..82756c0107d58 100644 --- a/packages/x-date-pickers/src/internals/components/PickersModalDialog.tsx +++ b/packages/x-date-pickers/src/internals/components/PickersModalDialog.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import DialogContent from '@mui/material/DialogContent'; import Fade from '@mui/material/Fade'; diff --git a/packages/x-date-pickers/src/internals/components/PickersPopper.tsx b/packages/x-date-pickers/src/internals/components/PickersPopper.tsx index 81d3d1d5b4480..968df4e7c31a3 100644 --- a/packages/x-date-pickers/src/internals/components/PickersPopper.tsx +++ b/packages/x-date-pickers/src/internals/components/PickersPopper.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useSlotProps from '@mui/utils/useSlotProps'; import Grow from '@mui/material/Grow'; diff --git a/packages/x-date-pickers/src/internals/components/PickersToolbar.tsx b/packages/x-date-pickers/src/internals/components/PickersToolbar.tsx index 3f42795403360..92e1c2141724d 100644 --- a/packages/x-date-pickers/src/internals/components/PickersToolbar.tsx +++ b/packages/x-date-pickers/src/internals/components/PickersToolbar.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import Typography from '@mui/material/Typography'; diff --git a/packages/x-date-pickers/src/internals/components/PickersToolbarButton.tsx b/packages/x-date-pickers/src/internals/components/PickersToolbarButton.tsx index e79c5cec63460..aea2d90484e40 100644 --- a/packages/x-date-pickers/src/internals/components/PickersToolbarButton.tsx +++ b/packages/x-date-pickers/src/internals/components/PickersToolbarButton.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import Button, { ButtonProps } from '@mui/material/Button'; diff --git a/packages/x-date-pickers/src/internals/components/PickersToolbarText.tsx b/packages/x-date-pickers/src/internals/components/PickersToolbarText.tsx index a3b0c533e77eb..d3bb408d0b32c 100644 --- a/packages/x-date-pickers/src/internals/components/PickersToolbarText.tsx +++ b/packages/x-date-pickers/src/internals/components/PickersToolbarText.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import Typography, { TypographyProps } from '@mui/material/Typography'; diff --git a/packages/x-date-pickers/src/internals/demo/DemoContainer.tsx b/packages/x-date-pickers/src/internals/demo/DemoContainer.tsx index b94218a3e360c..b23f1e3e96f52 100644 --- a/packages/x-date-pickers/src/internals/demo/DemoContainer.tsx +++ b/packages/x-date-pickers/src/internals/demo/DemoContainer.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import Stack, { StackProps, stackClasses } from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; diff --git a/packages/x-date-pickers/src/internals/hooks/useClockReferenceDate.ts b/packages/x-date-pickers/src/internals/hooks/useClockReferenceDate.ts index 03afe046d50c6..00a52029a7140 100644 --- a/packages/x-date-pickers/src/internals/hooks/useClockReferenceDate.ts +++ b/packages/x-date-pickers/src/internals/hooks/useClockReferenceDate.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { MuiPickersAdapter, PickersTimezone, PickerValidDate } from '../../models'; import { singleItemValueManager } from '../utils/valueManagers'; diff --git a/packages/x-date-pickers/src/internals/hooks/useDefaultReduceAnimations.ts b/packages/x-date-pickers/src/internals/hooks/useDefaultReduceAnimations.ts index 72a400bf4ee58..6b88a436e6579 100644 --- a/packages/x-date-pickers/src/internals/hooks/useDefaultReduceAnimations.ts +++ b/packages/x-date-pickers/src/internals/hooks/useDefaultReduceAnimations.ts @@ -1,3 +1,4 @@ +'use client'; import useMediaQuery from '@mui/material/useMediaQuery'; const PREFERS_REDUCED_MOTION = '@media (prefers-reduced-motion: reduce)'; diff --git a/packages/x-date-pickers/src/internals/hooks/useDesktopPicker/useDesktopPicker.tsx b/packages/x-date-pickers/src/internals/hooks/useDesktopPicker/useDesktopPicker.tsx index 97fb108f87334..967841d808918 100644 --- a/packages/x-date-pickers/src/internals/hooks/useDesktopPicker/useDesktopPicker.tsx +++ b/packages/x-date-pickers/src/internals/hooks/useDesktopPicker/useDesktopPicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useSlotProps from '@mui/utils/useSlotProps'; import MuiInputAdornment from '@mui/material/InputAdornment'; diff --git a/packages/x-date-pickers/src/internals/hooks/useField/useField.ts b/packages/x-date-pickers/src/internals/hooks/useField/useField.ts index 1d8bc5fdcffb3..64ef808f96329 100644 --- a/packages/x-date-pickers/src/internals/hooks/useField/useField.ts +++ b/packages/x-date-pickers/src/internals/hooks/useField/useField.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useEnhancedEffect from '@mui/utils/useEnhancedEffect'; import useEventCallback from '@mui/utils/useEventCallback'; diff --git a/packages/x-date-pickers/src/internals/hooks/useField/useFieldCharacterEditing.ts b/packages/x-date-pickers/src/internals/hooks/useField/useFieldCharacterEditing.ts index e028983db3f20..9c7ffacfe2e2c 100644 --- a/packages/x-date-pickers/src/internals/hooks/useField/useFieldCharacterEditing.ts +++ b/packages/x-date-pickers/src/internals/hooks/useField/useFieldCharacterEditing.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useEventCallback from '@mui/utils/useEventCallback'; import { FieldSectionType, FieldSection, PickersTimezone, PickerValidDate } from '../../../models'; diff --git a/packages/x-date-pickers/src/internals/hooks/useField/useFieldState.ts b/packages/x-date-pickers/src/internals/hooks/useField/useFieldState.ts index 23e6bbc669000..da1577a9a3d47 100644 --- a/packages/x-date-pickers/src/internals/hooks/useField/useFieldState.ts +++ b/packages/x-date-pickers/src/internals/hooks/useField/useFieldState.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useControlled from '@mui/utils/useControlled'; import { useRtl } from '@mui/system/RtlProvider'; diff --git a/packages/x-date-pickers/src/internals/hooks/useIsLandscape.tsx b/packages/x-date-pickers/src/internals/hooks/useIsLandscape.tsx index 200bb74b7cd23..0bbd8cf126afc 100644 --- a/packages/x-date-pickers/src/internals/hooks/useIsLandscape.tsx +++ b/packages/x-date-pickers/src/internals/hooks/useIsLandscape.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils'; import { arrayIncludes } from '../utils/utils'; diff --git a/packages/x-date-pickers/src/internals/hooks/useMobilePicker/useMobilePicker.tsx b/packages/x-date-pickers/src/internals/hooks/useMobilePicker/useMobilePicker.tsx index 15b31e4fc63a2..7ae90ff6acc34 100644 --- a/packages/x-date-pickers/src/internals/hooks/useMobilePicker/useMobilePicker.tsx +++ b/packages/x-date-pickers/src/internals/hooks/useMobilePicker/useMobilePicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useSlotProps from '@mui/utils/useSlotProps'; import useForkRef from '@mui/utils/useForkRef'; diff --git a/packages/x-date-pickers/src/internals/hooks/useOpenState.ts b/packages/x-date-pickers/src/internals/hooks/useOpenState.ts index 558814e5be267..18459bb08f4d6 100644 --- a/packages/x-date-pickers/src/internals/hooks/useOpenState.ts +++ b/packages/x-date-pickers/src/internals/hooks/useOpenState.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; export interface OpenStateProps { diff --git a/packages/x-date-pickers/src/internals/hooks/usePicker/usePicker.ts b/packages/x-date-pickers/src/internals/hooks/usePicker/usePicker.ts index 4ac218f211b09..98953f8b27ebf 100644 --- a/packages/x-date-pickers/src/internals/hooks/usePicker/usePicker.ts +++ b/packages/x-date-pickers/src/internals/hooks/usePicker/usePicker.ts @@ -1,3 +1,4 @@ +'use client'; import { warnOnce } from '@mui/x-internals/warning'; import { UsePickerParams, UsePickerProps, UsePickerResponse } from './usePicker.types'; import { usePickerValue } from './usePickerValue'; diff --git a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerLayoutProps.ts b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerLayoutProps.ts index f4084f8b32222..e9b5fc44452bf 100644 --- a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerLayoutProps.ts +++ b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerLayoutProps.ts @@ -1,3 +1,4 @@ +'use client'; import { useRtl } from '@mui/system/RtlProvider'; import { useIsLandscape } from '../useIsLandscape'; import { UsePickerValueLayoutResponse } from './usePickerValue.types'; diff --git a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerValue.ts b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerValue.ts index 3bd7a5eb08a23..b649053bac85b 100644 --- a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerValue.ts +++ b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerValue.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useEventCallback from '@mui/utils/useEventCallback'; import { useOpenState } from '../useOpenState'; diff --git a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerViews.ts b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerViews.ts index e96e3754fe946..57e3f07ff49cf 100644 --- a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerViews.ts +++ b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerViews.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { SxProps } from '@mui/system'; import { Theme } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/internals/hooks/useStaticPicker/useStaticPicker.tsx b/packages/x-date-pickers/src/internals/hooks/useStaticPicker/useStaticPicker.tsx index 08873f535dd21..bfc5cdfab709a 100644 --- a/packages/x-date-pickers/src/internals/hooks/useStaticPicker/useStaticPicker.tsx +++ b/packages/x-date-pickers/src/internals/hooks/useStaticPicker/useStaticPicker.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/internals/hooks/useUtils.ts b/packages/x-date-pickers/src/internals/hooks/useUtils.ts index a7c2e1d541307..8a7ea51f60f25 100644 --- a/packages/x-date-pickers/src/internals/hooks/useUtils.ts +++ b/packages/x-date-pickers/src/internals/hooks/useUtils.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { MuiPickersAdapterContext, diff --git a/packages/x-date-pickers/src/internals/hooks/useValidation.ts b/packages/x-date-pickers/src/internals/hooks/useValidation.ts index ce2fb99cfb297..c863bdde1e319 100644 --- a/packages/x-date-pickers/src/internals/hooks/useValidation.ts +++ b/packages/x-date-pickers/src/internals/hooks/useValidation.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { useLocalizationContext } from './useUtils'; import { MuiPickersAdapterContextValue } from '../../LocalizationProvider/LocalizationProvider'; diff --git a/packages/x-date-pickers/src/internals/hooks/useValueWithTimezone.ts b/packages/x-date-pickers/src/internals/hooks/useValueWithTimezone.ts index dd892c5d1c9da..488558491cc74 100644 --- a/packages/x-date-pickers/src/internals/hooks/useValueWithTimezone.ts +++ b/packages/x-date-pickers/src/internals/hooks/useValueWithTimezone.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useEventCallback from '@mui/utils/useEventCallback'; import useControlled from '@mui/utils/useControlled'; diff --git a/packages/x-date-pickers/src/internals/hooks/useViews.tsx b/packages/x-date-pickers/src/internals/hooks/useViews.tsx index e76c9f792049c..a35e5504c3d37 100644 --- a/packages/x-date-pickers/src/internals/hooks/useViews.tsx +++ b/packages/x-date-pickers/src/internals/hooks/useViews.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useEventCallback from '@mui/utils/useEventCallback'; import { unstable_useControlled as useControlled } from '@mui/utils'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d00160344186f..445136093ae2c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -709,6 +709,22 @@ importers: specifier: ^7.18.0 version: 7.18.0(eslint@8.57.0)(typescript@5.5.4) + packages/rsc-builder: + dependencies: + fs-extra: + specifier: ^11.2.0 + version: 11.2.0 + yargs: + specifier: ^17.7.2 + version: 17.7.2 + devDependencies: + '@types/mocha': + specifier: ^10.0.7 + version: 10.0.7 + '@types/node': + specifier: ^20.14.8 + version: 20.16.3 + packages/x-charts: dependencies: '@babel/runtime': From 2099284a645881de9b6a8059fd8b935c78a0ee66 Mon Sep 17 00:00:00 2001 From: delangle Date: Tue, 10 Sep 2024 18:04:36 +0200 Subject: [PATCH 2/6] Review Lukas --- packages/x-date-pickers/src/DatePicker/shared.tsx | 1 - packages/x-date-pickers/src/DateTimePicker/shared.tsx | 1 - .../x-date-pickers/src/dateViewRenderers/dateViewRenderers.tsx | 1 - 3 files changed, 3 deletions(-) diff --git a/packages/x-date-pickers/src/DatePicker/shared.tsx b/packages/x-date-pickers/src/DatePicker/shared.tsx index 7f4d142a0840b..abfb67d545de6 100644 --- a/packages/x-date-pickers/src/DatePicker/shared.tsx +++ b/packages/x-date-pickers/src/DatePicker/shared.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import { useThemeProps } from '@mui/material/styles'; import { DefaultizedProps } from '../internals/models/helpers'; diff --git a/packages/x-date-pickers/src/DateTimePicker/shared.tsx b/packages/x-date-pickers/src/DateTimePicker/shared.tsx index 0f5f801d932c5..4c34b61987e96 100644 --- a/packages/x-date-pickers/src/DateTimePicker/shared.tsx +++ b/packages/x-date-pickers/src/DateTimePicker/shared.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import { useThemeProps } from '@mui/material/styles'; import { DefaultizedProps } from '../internals/models/helpers'; diff --git a/packages/x-date-pickers/src/dateViewRenderers/dateViewRenderers.tsx b/packages/x-date-pickers/src/dateViewRenderers/dateViewRenderers.tsx index cd7f90703eafa..fa043429c5999 100644 --- a/packages/x-date-pickers/src/dateViewRenderers/dateViewRenderers.tsx +++ b/packages/x-date-pickers/src/dateViewRenderers/dateViewRenderers.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import { DateCalendar, DateCalendarProps } from '../DateCalendar'; import { DateView, PickerValidDate } from '../models'; From 5506daedc5b0f1836deff9b2cd242fcf7d9c75d0 Mon Sep 17 00:00:00 2001 From: delangle Date: Tue, 10 Sep 2024 18:08:48 +0200 Subject: [PATCH 3/6] Skip internal components and hooks --- packages/rsc-builder/buildRsc.ts | 9 +++++++++ .../DateTimeRangePickerTimeWrapper.tsx | 1 - .../src/internals/hooks/models/useRangePicker.ts | 1 - .../useDesktopRangePicker/useDesktopRangePicker.tsx | 1 - .../internals/hooks/useEnrichedRangePickerFieldProps.ts | 1 - .../hooks/useMobileRangePicker/useMobileRangePicker.tsx | 1 - .../hooks/useMultiInputFieldSelectedSections.ts | 1 - .../useMultiInputDateRangeField.ts | 1 - .../useMultiInputDateTimeRangeField.ts | 1 - .../useMultiInputTimeRangeField.ts | 1 - .../src/internals/hooks/useRangePosition.ts | 1 - .../hooks/useStaticRangePicker/useStaticRangePicker.tsx | 1 - packages/x-date-pickers/src/DateCalendar/DayCalendar.tsx | 1 - .../src/DateCalendar/PickersFadeTransitionGroup.tsx | 1 - .../src/DateCalendar/PickersSlideTransition.tsx | 1 - .../DesktopDateTimePickerLayout.tsx | 1 - .../x-date-pickers/src/MonthCalendar/PickersMonth.tsx | 1 - .../MultiSectionDigitalClockSection.tsx | 1 - .../PickersFilledInput/PickersFilledInput.tsx | 1 - .../src/PickersTextField/PickersInput/PickersInput.tsx | 1 - .../PickersInputBase/PickersInputBase.tsx | 1 - .../PickersTextField/PickersOutlinedInput/Outline.tsx | 1 - .../PickersOutlinedInput/PickersOutlinedInput.tsx | 1 - packages/x-date-pickers/src/TimeClock/Clock.tsx | 1 - packages/x-date-pickers/src/TimeClock/ClockNumber.tsx | 1 - packages/x-date-pickers/src/TimeClock/ClockNumbers.tsx | 1 - packages/x-date-pickers/src/TimeClock/ClockPointer.tsx | 1 - packages/x-date-pickers/src/YearCalendar/PickersYear.tsx | 1 - .../components/PickerViewRoot/PickerViewRoot.tsx | 1 - .../PickersArrowSwitcher/PickersArrowSwitcher.tsx | 1 - .../src/internals/components/PickersModalDialog.tsx | 1 - .../src/internals/components/PickersPopper.tsx | 1 - .../src/internals/components/PickersToolbar.tsx | 1 - .../src/internals/components/PickersToolbarButton.tsx | 1 - .../src/internals/components/PickersToolbarText.tsx | 1 - .../x-date-pickers/src/internals/demo/DemoContainer.tsx | 1 - .../src/internals/hooks/useClockReferenceDate.ts | 1 - .../src/internals/hooks/useDefaultReduceAnimations.ts | 1 - .../hooks/useDesktopPicker/useDesktopPicker.tsx | 1 - .../src/internals/hooks/useField/useField.ts | 1 - .../internals/hooks/useField/useFieldCharacterEditing.ts | 1 - .../src/internals/hooks/useField/useFieldState.ts | 1 - .../src/internals/hooks/useIsLandscape.tsx | 1 - .../internals/hooks/useMobilePicker/useMobilePicker.tsx | 1 - .../x-date-pickers/src/internals/hooks/useOpenState.ts | 1 - .../src/internals/hooks/usePicker/usePicker.ts | 1 - .../internals/hooks/usePicker/usePickerLayoutProps.ts | 1 - .../src/internals/hooks/usePicker/usePickerValue.ts | 1 - .../src/internals/hooks/usePicker/usePickerViews.ts | 1 - .../internals/hooks/useStaticPicker/useStaticPicker.tsx | 1 - packages/x-date-pickers/src/internals/hooks/useUtils.ts | 1 - .../x-date-pickers/src/internals/hooks/useValidation.ts | 1 - .../src/internals/hooks/useValueWithTimezone.ts | 1 - packages/x-date-pickers/src/internals/hooks/useViews.tsx | 1 - 54 files changed, 9 insertions(+), 53 deletions(-) diff --git a/packages/rsc-builder/buildRsc.ts b/packages/rsc-builder/buildRsc.ts index db2894d3c7194..bcb03db4fb4e6 100644 --- a/packages/rsc-builder/buildRsc.ts +++ b/packages/rsc-builder/buildRsc.ts @@ -38,6 +38,15 @@ async function processFile( const { lineToPrepend = `'use client';` } = options; const contents = await fse.readFile(filename, 'utf8'); + if ( + filename.indexOf('internal') !== -1 || + !!contents.match(/@ignore - internal component\./) || + !!contents.match(/@ignore - internal hook\./) || + !!contents.match(/@ignore - do not document\./) + ) { + return; + } + const lines = contents.split(/\r?\n/); if (lines[0] === lineToPrepend) { return; diff --git a/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.tsx b/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.tsx index 8df770392f7a7..e8f096ffcef58 100644 --- a/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.tsx +++ b/packages/x-date-pickers-pro/src/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import { PickerSelectionState, diff --git a/packages/x-date-pickers-pro/src/internals/hooks/models/useRangePicker.ts b/packages/x-date-pickers-pro/src/internals/hooks/models/useRangePicker.ts index 0808af9168b6d..f78eda4c15195 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/models/useRangePicker.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/models/useRangePicker.ts @@ -1,4 +1,3 @@ -'use client'; import { UsePickerParams, BasePickerProps, diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.tsx b/packages/x-date-pickers-pro/src/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.tsx index 90baf58a62f11..cb635fdba2ca8 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useSlotProps from '@mui/utils/useSlotProps'; import { useLicenseVerifier } from '@mui/x-license'; diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useEnrichedRangePickerFieldProps.ts b/packages/x-date-pickers-pro/src/internals/hooks/useEnrichedRangePickerFieldProps.ts index f17dab830c418..92161a1d50daa 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useEnrichedRangePickerFieldProps.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/useEnrichedRangePickerFieldProps.ts @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import Stack, { StackProps } from '@mui/material/Stack'; import Typography, { TypographyProps } from '@mui/material/Typography'; diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useMobileRangePicker/useMobileRangePicker.tsx b/packages/x-date-pickers-pro/src/internals/hooks/useMobileRangePicker/useMobileRangePicker.tsx index 66cbcdeaa17f8..8c0ff74043266 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useMobileRangePicker/useMobileRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/internals/hooks/useMobileRangePicker/useMobileRangePicker.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useSlotProps from '@mui/utils/useSlotProps'; import { useLicenseVerifier } from '@mui/x-license'; diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputFieldSelectedSections.ts b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputFieldSelectedSections.ts index 95dd77e83aaae..4f6987aa23612 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputFieldSelectedSections.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputFieldSelectedSections.ts @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useForkRef from '@mui/utils/useForkRef'; import useEventCallback from '@mui/utils/useEventCallback'; diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.ts b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.ts index a7c060ed124f7..84dfaeeb86312 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.ts @@ -1,4 +1,3 @@ -'use client'; import useEventCallback from '@mui/utils/useEventCallback'; import { unstable_useDateField as useDateField, diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.ts b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.ts index 957d49c16083b..cecc16b5cc6eb 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.ts @@ -1,4 +1,3 @@ -'use client'; import useEventCallback from '@mui/utils/useEventCallback'; import { unstable_useDateTimeField as useDateTimeField, diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.ts b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.ts index a8d3f5a004cce..a27dcb41a897f 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.ts @@ -1,4 +1,3 @@ -'use client'; import useEventCallback from '@mui/utils/useEventCallback'; import { unstable_useTimeField as useTimeField, diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useRangePosition.ts b/packages/x-date-pickers-pro/src/internals/hooks/useRangePosition.ts index ed77e99136f2a..c5029471e4e88 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useRangePosition.ts +++ b/packages/x-date-pickers-pro/src/internals/hooks/useRangePosition.ts @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useControlled from '@mui/utils/useControlled'; import useEventCallback from '@mui/utils/useEventCallback'; diff --git a/packages/x-date-pickers-pro/src/internals/hooks/useStaticRangePicker/useStaticRangePicker.tsx b/packages/x-date-pickers-pro/src/internals/hooks/useStaticRangePicker/useStaticRangePicker.tsx index 34324e62a0149..fbb9d3a4f76cb 100644 --- a/packages/x-date-pickers-pro/src/internals/hooks/useStaticRangePicker/useStaticRangePicker.tsx +++ b/packages/x-date-pickers-pro/src/internals/hooks/useStaticRangePicker/useStaticRangePicker.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/DateCalendar/DayCalendar.tsx b/packages/x-date-pickers/src/DateCalendar/DayCalendar.tsx index 198fb4a84c6a2..31d01710d5bfe 100644 --- a/packages/x-date-pickers/src/DateCalendar/DayCalendar.tsx +++ b/packages/x-date-pickers/src/DateCalendar/DayCalendar.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useEventCallback from '@mui/utils/useEventCallback'; import Typography from '@mui/material/Typography'; diff --git a/packages/x-date-pickers/src/DateCalendar/PickersFadeTransitionGroup.tsx b/packages/x-date-pickers/src/DateCalendar/PickersFadeTransitionGroup.tsx index 69d8337c10809..584a245ad0157 100644 --- a/packages/x-date-pickers/src/DateCalendar/PickersFadeTransitionGroup.tsx +++ b/packages/x-date-pickers/src/DateCalendar/PickersFadeTransitionGroup.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import { TransitionGroup } from 'react-transition-group'; diff --git a/packages/x-date-pickers/src/DateCalendar/PickersSlideTransition.tsx b/packages/x-date-pickers/src/DateCalendar/PickersSlideTransition.tsx index a552306612ced..e560306b50331 100644 --- a/packages/x-date-pickers/src/DateCalendar/PickersSlideTransition.tsx +++ b/packages/x-date-pickers/src/DateCalendar/PickersSlideTransition.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled, useTheme, useThemeProps } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePickerLayout.tsx b/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePickerLayout.tsx index 24efd0807a72c..f2ff16a8b4474 100644 --- a/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePickerLayout.tsx +++ b/packages/x-date-pickers/src/DesktopDateTimePicker/DesktopDateTimePickerLayout.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; diff --git a/packages/x-date-pickers/src/MonthCalendar/PickersMonth.tsx b/packages/x-date-pickers/src/MonthCalendar/PickersMonth.tsx index 6c6914b68ce8b..9c1bcf3bcf3d6 100644 --- a/packages/x-date-pickers/src/MonthCalendar/PickersMonth.tsx +++ b/packages/x-date-pickers/src/MonthCalendar/PickersMonth.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled, alpha, useThemeProps } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClockSection.tsx b/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClockSection.tsx index 7eb0542d9d2ea..cbc6a60df7a0b 100644 --- a/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClockSection.tsx +++ b/packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClockSection.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import { alpha, styled, useThemeProps } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/PickersTextField/PickersFilledInput/PickersFilledInput.tsx b/packages/x-date-pickers/src/PickersTextField/PickersFilledInput/PickersFilledInput.tsx index a1a799e0d7446..74e10a3bd0506 100644 --- a/packages/x-date-pickers/src/PickersTextField/PickersFilledInput/PickersFilledInput.tsx +++ b/packages/x-date-pickers/src/PickersTextField/PickersFilledInput/PickersFilledInput.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { FormControlState, useFormControl } from '@mui/material/FormControl'; diff --git a/packages/x-date-pickers/src/PickersTextField/PickersInput/PickersInput.tsx b/packages/x-date-pickers/src/PickersTextField/PickersInput/PickersInput.tsx index c035692508373..877d9dde9221a 100644 --- a/packages/x-date-pickers/src/PickersTextField/PickersInput/PickersInput.tsx +++ b/packages/x-date-pickers/src/PickersTextField/PickersInput/PickersInput.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { FormControlState, useFormControl } from '@mui/material/FormControl'; diff --git a/packages/x-date-pickers/src/PickersTextField/PickersInputBase/PickersInputBase.tsx b/packages/x-date-pickers/src/PickersTextField/PickersInputBase/PickersInputBase.tsx index 8b03187a4cf43..e7813d3adbf84 100644 --- a/packages/x-date-pickers/src/PickersTextField/PickersInputBase/PickersInputBase.tsx +++ b/packages/x-date-pickers/src/PickersTextField/PickersInputBase/PickersInputBase.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { FormControlState, useFormControl } from '@mui/material/FormControl'; diff --git a/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/Outline.tsx b/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/Outline.tsx index b3a3f142b1fff..9195cb4bc84a8 100644 --- a/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/Outline.tsx +++ b/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/Outline.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import { styled } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.tsx b/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.tsx index 625628f51e334..9ab29a6dfb616 100644 --- a/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.tsx +++ b/packages/x-date-pickers/src/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import PropTypes from 'prop-types'; import { FormControlState, useFormControl } from '@mui/material/FormControl'; diff --git a/packages/x-date-pickers/src/TimeClock/Clock.tsx b/packages/x-date-pickers/src/TimeClock/Clock.tsx index 87981b1b082ec..d7fc0a8b2e608 100644 --- a/packages/x-date-pickers/src/TimeClock/Clock.tsx +++ b/packages/x-date-pickers/src/TimeClock/Clock.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import IconButton from '@mui/material/IconButton'; diff --git a/packages/x-date-pickers/src/TimeClock/ClockNumber.tsx b/packages/x-date-pickers/src/TimeClock/ClockNumber.tsx index ef4362aa489c8..c407a02a7adf7 100644 --- a/packages/x-date-pickers/src/TimeClock/ClockNumber.tsx +++ b/packages/x-date-pickers/src/TimeClock/ClockNumber.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled, useThemeProps } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/TimeClock/ClockNumbers.tsx b/packages/x-date-pickers/src/TimeClock/ClockNumbers.tsx index de888cece85b8..28c34d15caf5b 100644 --- a/packages/x-date-pickers/src/TimeClock/ClockNumbers.tsx +++ b/packages/x-date-pickers/src/TimeClock/ClockNumbers.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import { ClockNumber } from './ClockNumber'; import { MuiPickersAdapter, PickerValidDate } from '../models'; diff --git a/packages/x-date-pickers/src/TimeClock/ClockPointer.tsx b/packages/x-date-pickers/src/TimeClock/ClockPointer.tsx index 37ca9c3287b07..db50723091b6d 100644 --- a/packages/x-date-pickers/src/TimeClock/ClockPointer.tsx +++ b/packages/x-date-pickers/src/TimeClock/ClockPointer.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled, useThemeProps } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/YearCalendar/PickersYear.tsx b/packages/x-date-pickers/src/YearCalendar/PickersYear.tsx index 44d7f0f951661..4cfd69ba8232a 100644 --- a/packages/x-date-pickers/src/YearCalendar/PickersYear.tsx +++ b/packages/x-date-pickers/src/YearCalendar/PickersYear.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled, alpha, useThemeProps } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/internals/components/PickerViewRoot/PickerViewRoot.tsx b/packages/x-date-pickers/src/internals/components/PickerViewRoot/PickerViewRoot.tsx index 673e72b1507a7..0fb7abdd9db51 100644 --- a/packages/x-date-pickers/src/internals/components/PickerViewRoot/PickerViewRoot.tsx +++ b/packages/x-date-pickers/src/internals/components/PickerViewRoot/PickerViewRoot.tsx @@ -1,4 +1,3 @@ -'use client'; import { styled } from '@mui/material/styles'; import { DIALOG_WIDTH, VIEW_HEIGHT } from '../../constants/dimensions'; diff --git a/packages/x-date-pickers/src/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.tsx b/packages/x-date-pickers/src/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.tsx index 5eba443f7c415..a5dd5873308f4 100644 --- a/packages/x-date-pickers/src/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.tsx +++ b/packages/x-date-pickers/src/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import Typography from '@mui/material/Typography'; diff --git a/packages/x-date-pickers/src/internals/components/PickersModalDialog.tsx b/packages/x-date-pickers/src/internals/components/PickersModalDialog.tsx index 82756c0107d58..5b89bb61cf1be 100644 --- a/packages/x-date-pickers/src/internals/components/PickersModalDialog.tsx +++ b/packages/x-date-pickers/src/internals/components/PickersModalDialog.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import DialogContent from '@mui/material/DialogContent'; import Fade from '@mui/material/Fade'; diff --git a/packages/x-date-pickers/src/internals/components/PickersPopper.tsx b/packages/x-date-pickers/src/internals/components/PickersPopper.tsx index 968df4e7c31a3..81d3d1d5b4480 100644 --- a/packages/x-date-pickers/src/internals/components/PickersPopper.tsx +++ b/packages/x-date-pickers/src/internals/components/PickersPopper.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useSlotProps from '@mui/utils/useSlotProps'; import Grow from '@mui/material/Grow'; diff --git a/packages/x-date-pickers/src/internals/components/PickersToolbar.tsx b/packages/x-date-pickers/src/internals/components/PickersToolbar.tsx index 92e1c2141724d..3f42795403360 100644 --- a/packages/x-date-pickers/src/internals/components/PickersToolbar.tsx +++ b/packages/x-date-pickers/src/internals/components/PickersToolbar.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import Typography from '@mui/material/Typography'; diff --git a/packages/x-date-pickers/src/internals/components/PickersToolbarButton.tsx b/packages/x-date-pickers/src/internals/components/PickersToolbarButton.tsx index aea2d90484e40..e79c5cec63460 100644 --- a/packages/x-date-pickers/src/internals/components/PickersToolbarButton.tsx +++ b/packages/x-date-pickers/src/internals/components/PickersToolbarButton.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import Button, { ButtonProps } from '@mui/material/Button'; diff --git a/packages/x-date-pickers/src/internals/components/PickersToolbarText.tsx b/packages/x-date-pickers/src/internals/components/PickersToolbarText.tsx index d3bb408d0b32c..a3b0c533e77eb 100644 --- a/packages/x-date-pickers/src/internals/components/PickersToolbarText.tsx +++ b/packages/x-date-pickers/src/internals/components/PickersToolbarText.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import Typography, { TypographyProps } from '@mui/material/Typography'; diff --git a/packages/x-date-pickers/src/internals/demo/DemoContainer.tsx b/packages/x-date-pickers/src/internals/demo/DemoContainer.tsx index b23f1e3e96f52..b94218a3e360c 100644 --- a/packages/x-date-pickers/src/internals/demo/DemoContainer.tsx +++ b/packages/x-date-pickers/src/internals/demo/DemoContainer.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import Stack, { StackProps, stackClasses } from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; diff --git a/packages/x-date-pickers/src/internals/hooks/useClockReferenceDate.ts b/packages/x-date-pickers/src/internals/hooks/useClockReferenceDate.ts index 00a52029a7140..03afe046d50c6 100644 --- a/packages/x-date-pickers/src/internals/hooks/useClockReferenceDate.ts +++ b/packages/x-date-pickers/src/internals/hooks/useClockReferenceDate.ts @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import { MuiPickersAdapter, PickersTimezone, PickerValidDate } from '../../models'; import { singleItemValueManager } from '../utils/valueManagers'; diff --git a/packages/x-date-pickers/src/internals/hooks/useDefaultReduceAnimations.ts b/packages/x-date-pickers/src/internals/hooks/useDefaultReduceAnimations.ts index 6b88a436e6579..72a400bf4ee58 100644 --- a/packages/x-date-pickers/src/internals/hooks/useDefaultReduceAnimations.ts +++ b/packages/x-date-pickers/src/internals/hooks/useDefaultReduceAnimations.ts @@ -1,4 +1,3 @@ -'use client'; import useMediaQuery from '@mui/material/useMediaQuery'; const PREFERS_REDUCED_MOTION = '@media (prefers-reduced-motion: reduce)'; diff --git a/packages/x-date-pickers/src/internals/hooks/useDesktopPicker/useDesktopPicker.tsx b/packages/x-date-pickers/src/internals/hooks/useDesktopPicker/useDesktopPicker.tsx index 967841d808918..97fb108f87334 100644 --- a/packages/x-date-pickers/src/internals/hooks/useDesktopPicker/useDesktopPicker.tsx +++ b/packages/x-date-pickers/src/internals/hooks/useDesktopPicker/useDesktopPicker.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useSlotProps from '@mui/utils/useSlotProps'; import MuiInputAdornment from '@mui/material/InputAdornment'; diff --git a/packages/x-date-pickers/src/internals/hooks/useField/useField.ts b/packages/x-date-pickers/src/internals/hooks/useField/useField.ts index 64ef808f96329..1d8bc5fdcffb3 100644 --- a/packages/x-date-pickers/src/internals/hooks/useField/useField.ts +++ b/packages/x-date-pickers/src/internals/hooks/useField/useField.ts @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useEnhancedEffect from '@mui/utils/useEnhancedEffect'; import useEventCallback from '@mui/utils/useEventCallback'; diff --git a/packages/x-date-pickers/src/internals/hooks/useField/useFieldCharacterEditing.ts b/packages/x-date-pickers/src/internals/hooks/useField/useFieldCharacterEditing.ts index 9c7ffacfe2e2c..e028983db3f20 100644 --- a/packages/x-date-pickers/src/internals/hooks/useField/useFieldCharacterEditing.ts +++ b/packages/x-date-pickers/src/internals/hooks/useField/useFieldCharacterEditing.ts @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useEventCallback from '@mui/utils/useEventCallback'; import { FieldSectionType, FieldSection, PickersTimezone, PickerValidDate } from '../../../models'; diff --git a/packages/x-date-pickers/src/internals/hooks/useField/useFieldState.ts b/packages/x-date-pickers/src/internals/hooks/useField/useFieldState.ts index da1577a9a3d47..23e6bbc669000 100644 --- a/packages/x-date-pickers/src/internals/hooks/useField/useFieldState.ts +++ b/packages/x-date-pickers/src/internals/hooks/useField/useFieldState.ts @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useControlled from '@mui/utils/useControlled'; import { useRtl } from '@mui/system/RtlProvider'; diff --git a/packages/x-date-pickers/src/internals/hooks/useIsLandscape.tsx b/packages/x-date-pickers/src/internals/hooks/useIsLandscape.tsx index 0bbd8cf126afc..200bb74b7cd23 100644 --- a/packages/x-date-pickers/src/internals/hooks/useIsLandscape.tsx +++ b/packages/x-date-pickers/src/internals/hooks/useIsLandscape.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils'; import { arrayIncludes } from '../utils/utils'; diff --git a/packages/x-date-pickers/src/internals/hooks/useMobilePicker/useMobilePicker.tsx b/packages/x-date-pickers/src/internals/hooks/useMobilePicker/useMobilePicker.tsx index 7ae90ff6acc34..15b31e4fc63a2 100644 --- a/packages/x-date-pickers/src/internals/hooks/useMobilePicker/useMobilePicker.tsx +++ b/packages/x-date-pickers/src/internals/hooks/useMobilePicker/useMobilePicker.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useSlotProps from '@mui/utils/useSlotProps'; import useForkRef from '@mui/utils/useForkRef'; diff --git a/packages/x-date-pickers/src/internals/hooks/useOpenState.ts b/packages/x-date-pickers/src/internals/hooks/useOpenState.ts index 18459bb08f4d6..558814e5be267 100644 --- a/packages/x-date-pickers/src/internals/hooks/useOpenState.ts +++ b/packages/x-date-pickers/src/internals/hooks/useOpenState.ts @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; export interface OpenStateProps { diff --git a/packages/x-date-pickers/src/internals/hooks/usePicker/usePicker.ts b/packages/x-date-pickers/src/internals/hooks/usePicker/usePicker.ts index 98953f8b27ebf..4ac218f211b09 100644 --- a/packages/x-date-pickers/src/internals/hooks/usePicker/usePicker.ts +++ b/packages/x-date-pickers/src/internals/hooks/usePicker/usePicker.ts @@ -1,4 +1,3 @@ -'use client'; import { warnOnce } from '@mui/x-internals/warning'; import { UsePickerParams, UsePickerProps, UsePickerResponse } from './usePicker.types'; import { usePickerValue } from './usePickerValue'; diff --git a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerLayoutProps.ts b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerLayoutProps.ts index e9b5fc44452bf..f4084f8b32222 100644 --- a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerLayoutProps.ts +++ b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerLayoutProps.ts @@ -1,4 +1,3 @@ -'use client'; import { useRtl } from '@mui/system/RtlProvider'; import { useIsLandscape } from '../useIsLandscape'; import { UsePickerValueLayoutResponse } from './usePickerValue.types'; diff --git a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerValue.ts b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerValue.ts index b649053bac85b..3bd7a5eb08a23 100644 --- a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerValue.ts +++ b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerValue.ts @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useEventCallback from '@mui/utils/useEventCallback'; import { useOpenState } from '../useOpenState'; diff --git a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerViews.ts b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerViews.ts index 57e3f07ff49cf..e96e3754fe946 100644 --- a/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerViews.ts +++ b/packages/x-date-pickers/src/internals/hooks/usePicker/usePickerViews.ts @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import { SxProps } from '@mui/system'; import { Theme } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/internals/hooks/useStaticPicker/useStaticPicker.tsx b/packages/x-date-pickers/src/internals/hooks/useStaticPicker/useStaticPicker.tsx index bfc5cdfab709a..08873f535dd21 100644 --- a/packages/x-date-pickers/src/internals/hooks/useStaticPicker/useStaticPicker.tsx +++ b/packages/x-date-pickers/src/internals/hooks/useStaticPicker/useStaticPicker.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import clsx from 'clsx'; import { styled } from '@mui/material/styles'; diff --git a/packages/x-date-pickers/src/internals/hooks/useUtils.ts b/packages/x-date-pickers/src/internals/hooks/useUtils.ts index 8a7ea51f60f25..a7c2e1d541307 100644 --- a/packages/x-date-pickers/src/internals/hooks/useUtils.ts +++ b/packages/x-date-pickers/src/internals/hooks/useUtils.ts @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import { MuiPickersAdapterContext, diff --git a/packages/x-date-pickers/src/internals/hooks/useValidation.ts b/packages/x-date-pickers/src/internals/hooks/useValidation.ts index c863bdde1e319..ce2fb99cfb297 100644 --- a/packages/x-date-pickers/src/internals/hooks/useValidation.ts +++ b/packages/x-date-pickers/src/internals/hooks/useValidation.ts @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import { useLocalizationContext } from './useUtils'; import { MuiPickersAdapterContextValue } from '../../LocalizationProvider/LocalizationProvider'; diff --git a/packages/x-date-pickers/src/internals/hooks/useValueWithTimezone.ts b/packages/x-date-pickers/src/internals/hooks/useValueWithTimezone.ts index 488558491cc74..dd892c5d1c9da 100644 --- a/packages/x-date-pickers/src/internals/hooks/useValueWithTimezone.ts +++ b/packages/x-date-pickers/src/internals/hooks/useValueWithTimezone.ts @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useEventCallback from '@mui/utils/useEventCallback'; import useControlled from '@mui/utils/useControlled'; diff --git a/packages/x-date-pickers/src/internals/hooks/useViews.tsx b/packages/x-date-pickers/src/internals/hooks/useViews.tsx index a35e5504c3d37..e76c9f792049c 100644 --- a/packages/x-date-pickers/src/internals/hooks/useViews.tsx +++ b/packages/x-date-pickers/src/internals/hooks/useViews.tsx @@ -1,4 +1,3 @@ -'use client'; import * as React from 'react'; import useEventCallback from '@mui/utils/useEventCallback'; import { unstable_useControlled as useControlled } from '@mui/utils'; From 68f3c979b790a3225eb5e2487da52bb7c8dd4927 Mon Sep 17 00:00:00 2001 From: delangle Date: Tue, 10 Sep 2024 18:11:13 +0200 Subject: [PATCH 4/6] Add CI step --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5ef43ce3e635d..4ae6693ce1fcc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -212,6 +212,12 @@ jobs: - run: name: '`pnpm l10n` changes committed?' command: git add -A && git diff --exit-code --staged + - run: + name: Sync RSC "use client" directives + command: pnpm rsc:build + - run: + name: '`pnpm rsc:build` changes committed?' + command: git add -A && git diff --exit-code --staged - run: name: '`pnpm docs:link-check` changes committed?' command: | From 863f0fe661f02a14048295b9ebf55968e31bfea3 Mon Sep 17 00:00:00 2001 From: delangle Date: Wed, 11 Sep 2024 13:37:12 +0200 Subject: [PATCH 5/6] Regen --- packages/x-date-pickers/src/hooks/useSplitFieldProps.ts | 1 + packages/x-date-pickers/src/validation/useValidation.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/x-date-pickers/src/hooks/useSplitFieldProps.ts b/packages/x-date-pickers/src/hooks/useSplitFieldProps.ts index 3498bbf38df11..35a29a7bc094f 100644 --- a/packages/x-date-pickers/src/hooks/useSplitFieldProps.ts +++ b/packages/x-date-pickers/src/hooks/useSplitFieldProps.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import { FieldValueType } from '../models'; import { diff --git a/packages/x-date-pickers/src/validation/useValidation.ts b/packages/x-date-pickers/src/validation/useValidation.ts index 392d6780725a3..7de1f1b83a08d 100644 --- a/packages/x-date-pickers/src/validation/useValidation.ts +++ b/packages/x-date-pickers/src/validation/useValidation.ts @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import useEventCallback from '@mui/utils/useEventCallback'; import { useLocalizationContext } from '../internals/hooks/useUtils'; From b66fdabd3570016883418cdd86fb62108e20cedb Mon Sep 17 00:00:00 2001 From: delangle Date: Wed, 11 Sep 2024 13:44:28 +0200 Subject: [PATCH 6/6] Fix CI --- pnpm-lock.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8f810813d7694..431e6f5febafb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -725,8 +725,8 @@ importers: specifier: ^10.0.7 version: 10.0.7 '@types/node': - specifier: ^20.14.8 - version: 20.16.3 + specifier: ^20.16.5 + version: 20.16.5 packages/x-charts: dependencies: