Skip to content

Commit

Permalink
Use new JSX transform
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Apr 26, 2024
1 parent 2bfffbd commit ba47d64
Show file tree
Hide file tree
Showing 37 changed files with 15 additions and 42 deletions.
2 changes: 1 addition & 1 deletion packages/react-calendar/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "wojtekmaj/react-no-automatic-runtime"
"extends": "wojtekmaj/react"
}
2 changes: 1 addition & 1 deletion packages/react-calendar/src/Calendar.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import React, { createRef } from 'react';
import { createRef } from 'react';
import { act, render } from '@testing-library/react';
import { getMonthStart } from '@wojtekmaj/date-utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-calendar/src/Calendar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import React, { forwardRef, useCallback, useImperativeHandle, useState } from 'react';
import { forwardRef, useCallback, useImperativeHandle, useState } from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';

Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/Calendar/Navigation.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';
import React from 'react';
import { fireEvent, render } from '@testing-library/react';

import Navigation from './Navigation.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/Calendar/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use client';

import React from 'react';
import { getUserLocale } from 'get-user-locale';

import {
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/CenturyView.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { describe, expect, it } from 'vitest';
import React from 'react';
import { render } from '@testing-library/react';
import { getDecadeStart, getDecadeEnd } from '@wojtekmaj/date-utils';

Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/CenturyView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';

import Decades from './CenturyView/Decades.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-calendar/src/CenturyView/Decade.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import React from 'react';

import { fireEvent, render } from '@testing-library/react';

import Decade from './Decade.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/CenturyView/Decade.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { getDecadeStart, getDecadeEnd, getCenturyStart } from '@wojtekmaj/date-utils';

import Tile from '../Tile.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/CenturyView/Decades.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { getDecadeStart } from '@wojtekmaj/date-utils';

import TileGroup from '../TileGroup.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-calendar/src/DecadeView.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import React from 'react';

import { render } from '@testing-library/react';

import DecadeView from './DecadeView.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/DecadeView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';

import Years from './DecadeView/Years.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-calendar/src/DecadeView/Year.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import React from 'react';

import { fireEvent, render } from '@testing-library/react';

import Year from './Year.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/DecadeView/Year.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { getYearStart, getYearEnd, getDecadeStart } from '@wojtekmaj/date-utils';

import Tile from '../Tile.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/DecadeView/Years.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { getYearStart } from '@wojtekmaj/date-utils';

import TileGroup from '../TileGroup.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-calendar/src/Flex.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import React from 'react';

import { render } from '@testing-library/react';

import Flex from './Flex.js';
Expand Down
6 changes: 3 additions & 3 deletions packages/react-calendar/src/Flex.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import { Children, cloneElement } from 'react';

type FlexProps = React.HTMLAttributes<HTMLDivElement> & {
children: React.ReactElement[];
Expand Down Expand Up @@ -35,10 +35,10 @@ export default function Flex({
}}
{...otherProps}
>
{React.Children.map(children, (child, index) => {
{Children.map(children, (child, index) => {
const marginInlineStart = offset && index === 0 ? toPercent((100 * offset) / count) : null;

return React.cloneElement(child, {
return cloneElement(child, {
...child.props,
style: {
flexBasis: toPercent(100 / count),
Expand Down
2 changes: 1 addition & 1 deletion packages/react-calendar/src/MonthView.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import React from 'react';

import { render } from '@testing-library/react';

import MonthView from './MonthView.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/MonthView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-calendar/src/MonthView/Day.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import React from 'react';

import { fireEvent, render } from '@testing-library/react';

import Day from './Day.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/MonthView/Day.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { getDayStart, getDayEnd } from '@wojtekmaj/date-utils';

import Tile from '../Tile.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/MonthView/Days.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { getYear, getMonth, getDaysInMonth, getDayStart } from '@wojtekmaj/date-utils';

import TileGroup from '../TileGroup.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/MonthView/WeekNumber.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { describe, expect, it } from 'vitest';
import React from 'react';
import { render } from '@testing-library/react';

import WeekNumber from './WeekNumber.js';
Expand Down
2 changes: 0 additions & 2 deletions packages/react-calendar/src/MonthView/WeekNumber.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import type { OnClickWeekNumberFunc } from '../shared/types.js';

const className = 'react-calendar__tile';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/MonthView/WeekNumbers.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { describe, expect, it, vi } from 'vitest';
import React from 'react';
import { fireEvent, render } from '@testing-library/react';

import WeekNumbers from './WeekNumbers.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/MonthView/WeekNumbers.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { getYear, getMonth, getDate, getDaysInMonth } from '@wojtekmaj/date-utils';

import WeekNumber from './WeekNumber.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/MonthView/Weekdays.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { describe, expect, it } from 'vitest';
import React from 'react';
import { render } from '@testing-library/react';

import Weekdays from './Weekdays.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/MonthView/Weekdays.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import clsx from 'clsx';
import { getYear, getMonth, getMonthStart } from '@wojtekmaj/date-utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-calendar/src/Tile.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import React from 'react';

import { fireEvent, render } from '@testing-library/react';

import Tile from './Tile.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-calendar/src/Tile.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo } from 'react';
import { useMemo } from 'react';
import clsx from 'clsx';

import type {
Expand Down
2 changes: 0 additions & 2 deletions packages/react-calendar/src/TileGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import Flex from './Flex.js';

import { getTileClasses } from './shared/utils.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/YearView.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { describe, expect, it } from 'vitest';
import React from 'react';
import { render } from '@testing-library/react';

import YearView from './YearView.js';
Expand Down
2 changes: 0 additions & 2 deletions packages/react-calendar/src/YearView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import Months from './YearView/Months.js';

import { tileGroupProps } from './shared/propTypes.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/YearView/Month.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { describe, expect, it, vi } from 'vitest';
import React from 'react';
import { fireEvent, render } from '@testing-library/react';

import Month from './Month.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/YearView/Month.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { getMonthStart, getMonthEnd } from '@wojtekmaj/date-utils';

import Tile from '../Tile.js';
Expand Down
1 change: 0 additions & 1 deletion packages/react-calendar/src/YearView/Months.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { getMonthStart, getYear } from '@wojtekmaj/date-utils';

import TileGroup from '../TileGroup.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-calendar/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"declaration": true,
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react",
"jsx": "react-jsx",
"module": "nodenext",
"noEmit": true,
"noUncheckedIndexedAccess": true,
Expand Down

0 comments on commit ba47d64

Please sign in to comment.