docs: update to next 15 + eslint 9 (#9839)
* update next * updated react * update eslint * finish updating eslint * fix content lint errors * fix docs test * fix vale action * fix installation errors
This commit is contained in:
@@ -20,7 +20,7 @@ To create a component that shows this menu in your customizations, create the fi
|
||||
import {
|
||||
DropdownMenu,
|
||||
IconButton,
|
||||
clx
|
||||
clx,
|
||||
} from "@medusajs/ui"
|
||||
import { EllipsisHorizontal } from "@medusajs/icons"
|
||||
import { Link } from "react-router-dom"
|
||||
@@ -202,10 +202,10 @@ const ProductWidget = () => {
|
||||
label: "Edit",
|
||||
onClick: () => {
|
||||
alert("You clicked the edit action!")
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
]} />
|
||||
</Container>
|
||||
)
|
||||
@@ -250,13 +250,13 @@ const ProductWidget = () => {
|
||||
label: "Edit",
|
||||
onClick: () => {
|
||||
alert("You clicked the edit action!")
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Container>
|
||||
|
||||
@@ -17,7 +17,7 @@ To create a component that uses the same container styling in your widgets or UI
|
||||
```tsx
|
||||
import {
|
||||
Container as UiContainer,
|
||||
clx
|
||||
clx,
|
||||
} from "@medusajs/ui"
|
||||
|
||||
type ContainerProps = React.ComponentProps<typeof UiContainer>
|
||||
|
||||
@@ -38,24 +38,24 @@ import {
|
||||
Heading,
|
||||
Label,
|
||||
Input,
|
||||
Button
|
||||
Button,
|
||||
} from "@medusajs/ui"
|
||||
import {
|
||||
useForm,
|
||||
FormProvider,
|
||||
Controller
|
||||
Controller,
|
||||
} from "react-hook-form"
|
||||
import * as zod from "zod"
|
||||
|
||||
const schema = zod.object({
|
||||
name: zod.string()
|
||||
name: zod.string(),
|
||||
})
|
||||
|
||||
export const CreateForm = () => {
|
||||
const form = useForm<zod.infer<typeof schema>>({
|
||||
defaultValues: {
|
||||
name: ""
|
||||
}
|
||||
name: "",
|
||||
},
|
||||
})
|
||||
|
||||
const handleSubmit = form.handleSubmit(({ name }) => {
|
||||
@@ -137,7 +137,7 @@ In `src/admin/components/create-form.tsx`, create a validation schema with Zod f
|
||||
import * as zod from "zod"
|
||||
|
||||
const schema = zod.object({
|
||||
name: zod.string()
|
||||
name: zod.string(),
|
||||
})
|
||||
```
|
||||
|
||||
@@ -158,8 +158,8 @@ import { useForm } from "react-hook-form"
|
||||
export const CreateForm = () => {
|
||||
const form = useForm<zod.infer<typeof schema>>({
|
||||
defaultValues: {
|
||||
name: ""
|
||||
}
|
||||
name: "",
|
||||
},
|
||||
})
|
||||
|
||||
const handleSubmit = form.handleSubmit(({ name }) => {
|
||||
@@ -190,11 +190,11 @@ import {
|
||||
Heading,
|
||||
Label,
|
||||
Input,
|
||||
Button
|
||||
Button,
|
||||
} from "@medusajs/ui"
|
||||
import {
|
||||
FormProvider,
|
||||
Controller
|
||||
Controller,
|
||||
} from "react-hook-form"
|
||||
|
||||
export const CreateForm = () => {
|
||||
@@ -290,8 +290,8 @@ const ProductWidget = () => {
|
||||
actions={[
|
||||
{
|
||||
type: "custom",
|
||||
children: <CreateForm />
|
||||
}
|
||||
children: <CreateForm />,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Container>
|
||||
@@ -323,24 +323,24 @@ import {
|
||||
Heading,
|
||||
Label,
|
||||
Input,
|
||||
Button
|
||||
Button,
|
||||
} from "@medusajs/ui"
|
||||
import {
|
||||
useForm,
|
||||
FormProvider,
|
||||
Controller
|
||||
Controller,
|
||||
} from "react-hook-form"
|
||||
import * as zod from "zod"
|
||||
|
||||
const schema = zod.object({
|
||||
name: zod.string()
|
||||
name: zod.string(),
|
||||
})
|
||||
|
||||
export const EditForm = () => {
|
||||
const form = useForm<zod.infer<typeof schema>>({
|
||||
defaultValues: {
|
||||
name: ""
|
||||
}
|
||||
name: "",
|
||||
},
|
||||
})
|
||||
|
||||
const handleSubmit = form.handleSubmit(({ name }) => {
|
||||
@@ -416,7 +416,7 @@ In `src/admin/components/edit-form.tsx`, create a validation schema with Zod for
|
||||
import * as zod from "zod"
|
||||
|
||||
const schema = zod.object({
|
||||
name: zod.string()
|
||||
name: zod.string(),
|
||||
})
|
||||
```
|
||||
|
||||
@@ -437,8 +437,8 @@ import { useForm } from "react-hook-form"
|
||||
export const EditForm = () => {
|
||||
const form = useForm<zod.infer<typeof schema>>({
|
||||
defaultValues: {
|
||||
name: ""
|
||||
}
|
||||
name: "",
|
||||
},
|
||||
})
|
||||
|
||||
const handleSubmit = form.handleSubmit(({ name }) => {
|
||||
@@ -469,11 +469,11 @@ import {
|
||||
Heading,
|
||||
Label,
|
||||
Input,
|
||||
Button
|
||||
Button,
|
||||
} from "@medusajs/ui"
|
||||
import {
|
||||
FormProvider,
|
||||
Controller
|
||||
Controller,
|
||||
} from "react-hook-form"
|
||||
|
||||
export const EditForm = () => {
|
||||
@@ -563,8 +563,8 @@ const ProductWidget = () => {
|
||||
actions={[
|
||||
{
|
||||
type: "custom",
|
||||
children: <EditForm />
|
||||
}
|
||||
children: <EditForm />,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Container>
|
||||
|
||||
@@ -45,7 +45,7 @@ export type HeadingProps = {
|
||||
export const Header = ({
|
||||
title,
|
||||
subtitle,
|
||||
actions = []
|
||||
actions = [],
|
||||
}: HeadingProps) => {
|
||||
return (
|
||||
<div className="flex items-center justify-between px-6 py-4">
|
||||
@@ -172,9 +172,9 @@ const ProductWidget = () => {
|
||||
variant: "secondary",
|
||||
onClick: () => {
|
||||
alert("You clicked the button.")
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Container>
|
||||
|
||||
@@ -222,7 +222,7 @@ import { JsonViewSection } from "../components/json-view-section"
|
||||
|
||||
const ProductWidget = () => {
|
||||
return <JsonViewSection data={{
|
||||
name: "John"
|
||||
name: "John",
|
||||
}} />
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ export const Table = ({
|
||||
pageSize,
|
||||
count,
|
||||
currentPage,
|
||||
setCurrentPage
|
||||
setCurrentPage,
|
||||
}: TableProps) => {
|
||||
const pageCount = useMemo(() => {
|
||||
return Math.ceil(data.length / pageSize)
|
||||
@@ -200,7 +200,7 @@ const ProductWidget = () => {
|
||||
columns={[
|
||||
{
|
||||
key: "name",
|
||||
label: "Name"
|
||||
label: "Name",
|
||||
},
|
||||
{
|
||||
key: "is_enabled",
|
||||
@@ -213,18 +213,18 @@ const ProductWidget = () => {
|
||||
{isEnabled ? "Enabled" : "Disabled"}
|
||||
</StatusBadge>
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
]}
|
||||
data={[
|
||||
{
|
||||
name: "John",
|
||||
is_enabled: true
|
||||
is_enabled: true,
|
||||
},
|
||||
{
|
||||
name: "Jane",
|
||||
is_enabled: false
|
||||
}
|
||||
is_enabled: false,
|
||||
},
|
||||
]}
|
||||
pageSize={2}
|
||||
count={2}
|
||||
|
||||
Reference in New Issue
Block a user