docs: added documentation for toast component changes (#7141)
* docs: added documentation for toast component changes * added redirect from use-toast docs to upgrade guide * remove unused file * content linting fixes * update UI package version * updated ui preset * fix upgrade guides main page
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
import { HookTable } from "@/components/hook-table"
|
||||
import { HookDataMap } from "@/types/hooks"
|
||||
|
||||
const ToasterToastValues: HookDataMap = [
|
||||
{
|
||||
value: "id",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
value: "title",
|
||||
type: "ReactNode",
|
||||
},
|
||||
{
|
||||
value: "description",
|
||||
type: "ReactNode",
|
||||
},
|
||||
{
|
||||
value: "variant",
|
||||
type: {
|
||||
type: "enum",
|
||||
values: ["info", "success", "warning", "error", "loading"],
|
||||
},
|
||||
description: `Defaults to "info"`,
|
||||
},
|
||||
{
|
||||
value: "action",
|
||||
type: {
|
||||
type: "object",
|
||||
name: "ToastActionElement",
|
||||
shape:
|
||||
"{\n label: string\n altText: string\n onClick: () => void | Promise<void>\n}",
|
||||
},
|
||||
},
|
||||
{
|
||||
value: "disableDismiss",
|
||||
type: "boolean",
|
||||
},
|
||||
]
|
||||
|
||||
const Props = () => {
|
||||
return <HookTable props={ToasterToastValues} />
|
||||
}
|
||||
|
||||
export default Props
|
||||
@@ -1,34 +0,0 @@
|
||||
import { HookTable } from "@/components/hook-table"
|
||||
import { HookDataMap } from "@/types/hooks"
|
||||
|
||||
const useToastValues: HookDataMap = [
|
||||
{
|
||||
value: "toast",
|
||||
type: {
|
||||
type: "function",
|
||||
signature: `(toast: Omit<ToasterToast, "id">) => {\n id: string,\n dismiss: () => void,\n update: (toast: ToasterToast) => void\n}`,
|
||||
},
|
||||
description:
|
||||
"Function used to display new toasts. For the toast options, please check the ToasterToast reference below.",
|
||||
},
|
||||
{
|
||||
value: "dismiss",
|
||||
type: {
|
||||
type: "function",
|
||||
signature: "(toastId?: string) => void",
|
||||
},
|
||||
description: "Function used to hide a toast based on its id.",
|
||||
},
|
||||
{
|
||||
value: "toasts",
|
||||
type: "ToasterToast[]",
|
||||
description:
|
||||
"All the toasts that have been pushed to the context this hook was invoked in.",
|
||||
},
|
||||
]
|
||||
|
||||
const Props = () => {
|
||||
return <HookTable props={useToastValues} />
|
||||
}
|
||||
|
||||
export default Props
|
||||
Reference in New Issue
Block a user