File tree 3 files changed +28
-5
lines changed
3 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -149,4 +149,5 @@ import { Accordion } from 'webcoreui/react'
149
149
- [ Spinner] ( https://github.com/Frontendland/webcoreui/tree/main/src/components/Spinner )
150
150
- [ Switch] ( https://github.com/Frontendland/webcoreui/tree/main/src/components/Switch )
151
151
- [ Tabs] ( https://github.com/Frontendland/webcoreui/tree/main/src/components/Tabs )
152
+ - [ Toast] ( https://github.com/Frontendland/webcoreui/tree/main/src/components/Toast )
152
153
- [ Tooltip] ( https://github.com/Frontendland/webcoreui/blob/main/src/pages/tooltip.astro )
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import type { ToastProps } from ' ./toast'
3
+ import Alert from ' ../Alert/Alert.svelte'
3
4
import ' ./toast.scss'
4
5
5
6
export let className: ToastProps [' className' ] = ' '
8
9
' w-toast' ,
9
10
className
10
11
].filter (Boolean ).join (' ' )
11
- </script >
12
+ </script >
13
+
14
+ <Alert {...$$restProps } className ={classes }>
15
+ {#if $$slots .icon }
16
+ <slot name =" icon" />
17
+ {/if }
18
+ <slot />
19
+ </Alert >
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
import type { ToastProps } from './toast'
3
+ import Alert from '../Alert/Alert.tsx'
3
4
4
5
import './toast.scss'
5
6
7
+ type ReactToastProps = {
8
+ children : React . ReactNode
9
+ icon ?: string
10
+ } & ToastProps
11
+
6
12
const Toast = ( {
7
- className
8
- } : ToastProps ) => {
13
+ icon,
14
+ className,
15
+ children,
16
+ ...rest
17
+ } : ReactToastProps ) => {
9
18
const classes = [
10
19
'w-toast' ,
11
20
className
12
21
] . filter ( Boolean ) . join ( ' ' )
13
22
14
- return < div > Toast</ div >
23
+ return (
24
+ < Alert { ...rest } className = { classes } icon = { icon } >
25
+ { children }
26
+ </ Alert >
27
+
28
+ )
15
29
}
16
30
17
- export default Toast
31
+ export default Toast
You can’t perform that action at this time.
0 commit comments