File size: 2,667 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
import { defineSlotRecipe } from "../def"
export const toastSlotRecipe = defineSlotRecipe({
slots: [
"root",
"title",
"description",
"indicator",
"closeTrigger",
"actionTrigger",
],
className: "toast",
base: {
root: {
width: "full",
display: "flex",
alignItems: "flex-start",
position: "relative",
gap: "3",
py: "4",
ps: "4",
pe: "6",
borderRadius: "l2",
translate: "var(--x) var(--y)",
scale: "var(--scale)",
zIndex: "var(--z-index)",
height: "var(--height)",
opacity: "var(--opacity)",
willChange: "translate, opacity, scale",
transition:
"translate 400ms, scale 400ms, opacity 400ms, height 400ms, box-shadow 200ms",
transitionTimingFunction: "cubic-bezier(0.21, 1.02, 0.73, 1)",
_closed: {
transition: "translate 400ms, scale 400ms, opacity 200ms",
transitionTimingFunction: "cubic-bezier(0.06, 0.71, 0.55, 1)",
},
bg: "bg.panel",
color: "fg",
boxShadow: "xl",
"--toast-trigger-bg": "colors.bg.muted",
"&[data-type=warning]": {
bg: "orange.solid",
color: "orange.contrast",
"--toast-trigger-bg": "{white/10}",
"--toast-border-color": "{white/40}",
},
"&[data-type=success]": {
bg: "green.solid",
color: "green.contrast",
"--toast-trigger-bg": "{white/10}",
"--toast-border-color": "{white/40}",
},
"&[data-type=error]": {
bg: "red.solid",
color: "red.contrast",
"--toast-trigger-bg": "{white/10}",
"--toast-border-color": "{white/40}",
},
},
title: {
fontWeight: "medium",
textStyle: "sm",
marginEnd: "2",
},
description: {
display: "inline",
textStyle: "sm",
opacity: "0.8",
},
indicator: {
flexShrink: "0",
boxSize: "5",
},
actionTrigger: {
textStyle: "sm",
fontWeight: "medium",
height: "8",
px: "3",
borderRadius: "l2",
alignSelf: "center",
borderWidth: "1px",
borderColor: "var(--toast-border-color, inherit)",
transition: "background 200ms",
_hover: {
bg: "var(--toast-trigger-bg)",
},
},
closeTrigger: {
position: "absolute",
top: "1",
insetEnd: "1",
padding: "1",
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
color: "{currentColor/60}",
borderRadius: "l2",
textStyle: "md",
transition: "background 200ms",
_icon: {
boxSize: "1em",
},
},
},
})
|