From 03a25993eeba27290f62750891a12b9fb65e9a39 Mon Sep 17 00:00:00 2001 From: jdm1219 Date: Wed, 6 Mar 2024 16:46:30 +0900 Subject: [PATCH 1/2] refactor: change 'className' to 'class' --- README.md | 8 ++++---- src/components/Styling.vue | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 03abd9a..9581c3f 100644 --- a/README.md +++ b/README.md @@ -288,8 +288,8 @@ You can style your toasts globally with the `toastOptions` prop in the `Toaster` ``` @@ -301,8 +301,8 @@ toast('Event has been created', { style: { background: 'red' }, - className: 'my-toast', - descriptionClassName: 'my-toast-description' + class: 'my-toast', + descriptionClass: 'my-toast-description' }) ``` diff --git a/src/components/Styling.vue b/src/components/Styling.vue index 85f642d..c05ef9c 100644 --- a/src/components/Styling.vue +++ b/src/components/Styling.vue @@ -65,16 +65,16 @@ const renderedCode = computed(() => { ? `` : `toast('Event has been created', { style: { background: '#6ee7b7' }, - className: 'my-toast', - descriptionClassName: 'my-toast-description' + class: 'my-toast', + descriptionClass: 'my-toast-description' })` }) @@ -84,8 +84,8 @@ const handleClick = (action: string) => { style: { background: currentAction.value === 'all' ? '#fda4af' : '#6ee7b7' }, - className: 'my-toast', - descriptionClassName: 'my-toast-description' + class: 'my-toast', + descriptionClass: 'my-toast-description' }) } From af28d1c7909c190a7a60505ad0fbc3538f8e9ae6 Mon Sep 17 00:00:00 2001 From: jdm1219 Date: Wed, 6 Mar 2024 16:46:40 +0900 Subject: [PATCH 2/2] refactor: change class types --- packages/types.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/types.ts b/packages/types.ts index 356b237..0bb2da6 100644 --- a/packages/types.ts +++ b/packages/types.ts @@ -22,7 +22,7 @@ export type PromiseData = ExternalToast & { finally?: () => void | Promise } -export interface ToastClassnames { +export interface ToastClasses { toast?: string title?: string description?: string @@ -77,8 +77,8 @@ export type ToastT = { actionButtonStyle?: CSSProperties style?: CSSProperties unstyled?: boolean - class?: any - classes?: ToastClassnames + class?: string + classes?: ToastClasses descriptionClass?: string position?: Position } @@ -98,15 +98,15 @@ export interface HeightT { } export interface ToastOptions { - class?: any + class?: string closeButton?: boolean - descriptionClass?: any + descriptionClass?: string style?: CSSProperties cancelButtonStyle?: CSSProperties actionButtonStyle?: CSSProperties duration?: number unstyled?: boolean - classes?: ToastClassnames + classes?: ToastClasses } export type CnFunction = (...classes: Array) => string @@ -123,7 +123,7 @@ export interface ToasterProps { visibleToasts?: number closeButton?: boolean toastOptions?: ToastOptions - class?: any + class?: string style?: CSSProperties offset?: string | number dir?: 'rtl' | 'ltr' | 'auto' @@ -147,14 +147,14 @@ export interface ToastProps { closeButton: boolean interacting: boolean duration?: number - descriptionClass?: any + descriptionClass?: string style?: CSSProperties cancelButtonStyle?: CSSProperties actionButtonStyle?: CSSProperties unstyled?: boolean loadingIcon?: Component - class: any - classes?: ToastClassnames + class: string + classes?: ToastClasses icons?: ToastIcons closeButtonAriaLabel?: string pauseWhenPageIsHidden: boolean