Skip to content

Commit

Permalink
chore: react v19 (#4558)
Browse files Browse the repository at this point in the history
* chore: react v19

* fix: some type error

Signed-off-by: Alexandre Philibeaux <aphilibeaux@scaleway.com>

* fix: type error

* fix: type error

Signed-off-by: Alexandre Philibeaux <aphilibeaux@scaleway.com>

---------

Signed-off-by: Alexandre Philibeaux <aphilibeaux@scaleway.com>
Co-authored-by: Alexandre Philibeaux <aphilibeaux@scaleway.com>
  • Loading branch information
matthprost and philibea authored Dec 19, 2024
1 parent dcafecf commit 293aa2c
Show file tree
Hide file tree
Showing 82 changed files with 763 additions and 909 deletions.
8 changes: 8 additions & 0 deletions .changeset/chatty-donuts-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@ultraviolet/icons": minor
"@ultraviolet/form": minor
"@ultraviolet/plus": minor
"@ultraviolet/ui": minor
---

Upgrade from react 18 to react 19
11 changes: 1 addition & 10 deletions examples/next-advanced/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,13 @@ const nextConfig = () => {
},
poweredByHeader: false,
reactStrictMode: true,
swcMinify: true,
compiler: {
emotion: true,
},
eslint: {
ignoreDuringBuilds: true,
},
experimental: {
esmExternals: 'loose', // See https://github.com/Hacker0x01/react-datepicker/issues/3834
},
transpilePackages: [
'@ultraviolet/ui',
'@ultraviolet/form',
'@ultraviolet/icons',
'react-syntax-highlighter',
],
transpilePackages: ['react-syntax-highlighter'],
}

return config
Expand Down
6 changes: 3 additions & 3 deletions examples/next-advanced/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"@emotion/styled": "11.14.0",
"@ultraviolet/ui": "workspace:*",
"next": "15.1.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-schemaorg": "2.0.0",
"react-syntax-highlighter": "15.6.1",
"react-use-clipboard": "1.0.9",
Expand All @@ -29,7 +29,7 @@
"devDependencies": {
"@babel/core": "7.26.0",
"@types/node": "22.10.2",
"@types/react": "18.3.17",
"@types/react": "19.0.0",
"@types/react-syntax-highlighter": "15.5.13",
"next-transpile-modules": "10.0.1"
}
Expand Down
9 changes: 0 additions & 9 deletions examples/next-login/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,12 @@ const nextConfig = () => {
},
poweredByHeader: false,
reactStrictMode: true,
swcMinify: true,
compiler: {
emotion: true,
},
eslint: {
ignoreDuringBuilds: true,
},
experimental: {
esmExternals: 'loose', // See https://github.com/Hacker0x01/react-datepicker/issues/3834
},
transpilePackages: [
'@ultraviolet/ui',
'@ultraviolet/form',
'@ultraviolet/icons',
],
}
return config
}
Expand Down
7 changes: 4 additions & 3 deletions examples/next-login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
"dependencies": {
"@emotion/react": "11.14.0",
"@emotion/styled": "11.14.0",
"@ultraviolet/fonts": "workspace:*",
"@ultraviolet/form": "workspace:*",
"@ultraviolet/icons": "workspace:*",
"@ultraviolet/ui": "workspace:*",
"next": "15.1.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-schemaorg": "2.0.0",
"react-syntax-highlighter": "15.6.1",
"react-use-clipboard": "1.0.9",
Expand All @@ -31,7 +32,7 @@
"devDependencies": {
"@babel/core": "7.26.0",
"@types/node": "22.10.2",
"@types/react": "18.3.17",
"@types/react": "19.0.0",
"@types/react-syntax-highlighter": "15.5.13",
"next-transpile-modules": "10.0.1"
}
Expand Down
9 changes: 0 additions & 9 deletions examples/next-simple/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,12 @@ const nextConfig = () => {
},
poweredByHeader: false,
reactStrictMode: true,
swcMinify: true,
compiler: {
emotion: true,
},
eslint: {
ignoreDuringBuilds: true,
},
experimental: {
esmExternals: 'loose', // See https://github.com/Hacker0x01/react-datepicker/issues/3834
},
transpilePackages: [
'@ultraviolet/ui',
'@ultraviolet/form',
'@ultraviolet/icons',
],
}

return config
Expand Down
6 changes: 3 additions & 3 deletions examples/next-simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"@emotion/styled": "11.14.0",
"@ultraviolet/ui": "workspace:*",
"next": "15.1.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-schemaorg": "2.0.0",
"react-syntax-highlighter": "15.6.1",
"react-use-clipboard": "1.0.9",
Expand All @@ -30,7 +30,7 @@
"devDependencies": {
"@babel/core": "7.26.0",
"@types/node": "22.10.2",
"@types/react": "18.3.17",
"@types/react": "19.0.0",
"@types/react-syntax-highlighter": "15.5.13",
"next-transpile-modules": "10.0.1"
}
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
},
"peerDependencyRules": {
"allowedVersions": {
"react": "18",
"react-dom": "18"
"react": "18 || 19",
"react-dom": "18 || 19"
}
}
},
Expand Down Expand Up @@ -136,9 +136,9 @@
"@testing-library/react": "16.1.0",
"@testing-library/user-event": "14.5.2",
"@types/node": "22.10.2",
"@types/react": "18.3.17",
"@types/react": "19.0.0",
"@types/react-datepicker": "6.2.0",
"@types/react-dom": "18.3.5",
"@types/react-dom": "19.0.0",
"@types/zxcvbn": "4.4.5",
"@ultraviolet/fonts": "workspace:*",
"@ultraviolet/themes": "workspace:*",
Expand Down Expand Up @@ -170,8 +170,8 @@
"oxlint": "0.15.0",
"postcss": "8.4.49",
"publint": "0.2.12",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"read-pkg": "9.0.1",
"regenerator-runtime": "0.14.1",
"remark-gfm": "4.0.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@
"peerDependencies": {
"@emotion/react": "11.14.0",
"@emotion/styled": "11.14.0",
"react": "18.x",
"react-dom": "18.x"
"react": "18.x || 19.x",
"react-dom": "18.x || 19.x"
},
"devDependencies": {
"@babel/core": "7.26.0",
"@emotion/react": "11.14.0",
"@emotion/styled": "11.14.0",
"@types/final-form-focus": "1.1.7",
"@types/react": "18.3.17",
"@types/react-dom": "18.3.5",
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"@utils/test": "workspace:*",
"react": "18.3.1",
"react-dom": "18.3.1"
"react": "19.0.0",
"react-dom": "19.0.0"
},
"dependencies": {
"@babel/runtime": "7.26.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ exports[`CheckboxField > should render correctly 1`] = `
id=":r0:"
name="test"
type="checkbox"
value=""
/>
<svg
class="emotion-4 emotion-5"
Expand Down Expand Up @@ -633,7 +632,6 @@ exports[`CheckboxField > should render correctly checked without value 1`] = `
id=":r6:"
name="checked"
type="checkbox"
value=""
/>
<svg
class="emotion-4 emotion-5"
Expand Down Expand Up @@ -971,7 +969,6 @@ exports[`CheckboxField > should render correctly disabled 1`] = `
id=":r4:"
name="test"
type="checkbox"
value=""
/>
<svg
class="emotion-4 emotion-5"
Expand Down Expand Up @@ -1308,7 +1305,6 @@ exports[`CheckboxField > should render correctly not checked without value 1`] =
id=":r8:"
name="checked"
type="checkbox"
value=""
/>
<svg
class="emotion-4 emotion-5"
Expand Down Expand Up @@ -1646,7 +1642,6 @@ exports[`CheckboxField > should render correctly with aria-label 1`] = `
id=":r2:"
name="test"
type="checkbox"
value=""
/>
<svg
class="emotion-4 emotion-5"
Expand Down Expand Up @@ -2011,7 +2006,6 @@ exports[`CheckboxField > should render correctly with errors 1`] = `
id=":rd:"
name="test"
type="checkbox"
value=""
/>
<svg
class="emotion-4 emotion-5"
Expand Down Expand Up @@ -2377,7 +2371,6 @@ exports[`CheckboxField > should trigger events correctly 1`] = `
id=":ra:"
name="test"
type="checkbox"
value=""
/>
<svg
class="emotion-4 emotion-5"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { StoryFn } from '@storybook/react'
import { Stack } from '@ultraviolet/ui'
import type { ComponentProps } from 'react'
import { CheckboxGroupField } from '..'
import { useFormContext } from '../../..'

export const DirectionStory: StoryFn<typeof CheckboxGroupField> = args => {
const DirectionTemplate = (args: ComponentProps<typeof CheckboxGroupField>) => {
const { watch } = useFormContext()

return (
Expand All @@ -27,7 +28,7 @@ export const DirectionStory: StoryFn<typeof CheckboxGroupField> = args => {
}

export const Direction: StoryFn<typeof CheckboxGroupField> = args => (
<DirectionStory {...args} />
<DirectionTemplate {...args} />
)

Direction.parameters = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import type { StoryFn } from '@storybook/react'
import { Stack } from '@ultraviolet/ui'
import type { ComponentProps } from 'react'
import { CheckboxGroupField } from '..'
import { Submit } from '../..'

export const NotRequiredStory: StoryFn<typeof CheckboxGroupField> = args => (
export const NotRequiredTemplate = (
args: ComponentProps<typeof CheckboxGroupField>,
) => (
<Stack gap={1}>
<CheckboxGroupField {...args}>
<CheckboxGroupField.Checkbox
Expand All @@ -24,7 +27,7 @@ export const NotRequiredStory: StoryFn<typeof CheckboxGroupField> = args => (
)

export const NotRequired: StoryFn<typeof CheckboxGroupField> = args => (
<NotRequiredStory {...args} />
<NotRequiredTemplate {...args} />
)

NotRequired.parameters = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type { StoryFn } from '@storybook/react'
import { Stack } from '@ultraviolet/ui'
import type { ComponentProps } from 'react'
import { CheckboxGroupField } from '..'
import { Submit } from '../..'

export const PartiallyRequiredStory: StoryFn<
typeof CheckboxGroupField
> = args => (
const PartiallyRequiredStory = (
args: ComponentProps<typeof CheckboxGroupField>,
) => (
<Stack gap={1}>
<CheckboxGroupField {...args}>
<CheckboxGroupField.Checkbox
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import type { StoryFn } from '@storybook/react'
import { Stack } from '@ultraviolet/ui'
import type { ComponentProps } from 'react'
import { CheckboxGroupField } from '..'
import { Submit } from '../..'

export const RequiredStory: StoryFn<typeof CheckboxGroupField> = args => (
export const RequiredTemplate = (
args: ComponentProps<typeof CheckboxGroupField>,
) => (
<Stack gap={1}>
<CheckboxGroupField {...args}>
<CheckboxGroupField.Checkbox
Expand All @@ -21,7 +24,7 @@ export const RequiredStory: StoryFn<typeof CheckboxGroupField> = args => (
)

export const Required: StoryFn<typeof CheckboxGroupField> = args => (
<RequiredStory {...args} />
<RequiredTemplate {...args} />
)

Required.parameters = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import type { StoryFn } from '@storybook/react'
import { Stack } from '@ultraviolet/ui'
import type { ComponentProps } from 'react'
import { CheckboxGroupField } from '..'

const CheckboxGroupFieldStory: StoryFn<typeof CheckboxGroupField> = args => (
const CheckboxGroupTemplate = (
args: ComponentProps<typeof CheckboxGroupField>,
) => (
<Stack gap={2}>
<CheckboxGroupField {...args}>
<CheckboxGroupField.Checkbox
Expand All @@ -19,7 +22,7 @@ const CheckboxGroupFieldStory: StoryFn<typeof CheckboxGroupField> = args => (
)

export const Template: StoryFn<typeof CheckboxGroupField> = args => (
<CheckboxGroupFieldStory {...args} />
<CheckboxGroupTemplate {...args} />
)

Template.args = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ exports[`DateField > should render correctly 1`] = `
id=":r1:"
name="test"
type="text"
value=""
/>
<div
class="emotion-10 emotion-11"
Expand Down Expand Up @@ -446,7 +445,6 @@ exports[`DateField > should render correctly disabled 1`] = `
id=":r4:"
name="test"
type="text"
value=""
/>
<div
class="emotion-10 emotion-11"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ exports[`NumberInputFieldV2 > should render correctly 1`] = `
name="test"
placeholder=""
type="number"
value=""
/>
</div>
<div
Expand Down Expand Up @@ -737,7 +736,6 @@ exports[`NumberInputFieldV2 > should render correctly disabled 1`] = `
name="test"
placeholder=""
type="number"
value=""
/>
</div>
<div
Expand Down
Loading

0 comments on commit 293aa2c

Please sign in to comment.