File size: 2,496 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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
import { defineSlotRecipe } from "../def"
export const fileUploadSlotRecipe = defineSlotRecipe({
className: "file-upload",
slots: [
"root",
"dropzone",
"item",
"itemDeleteTrigger",
"itemGroup",
"itemName",
"itemPreview",
"itemPreviewImage",
"itemSizeText",
"label",
"trigger",
"clearTrigger",
"itemContent",
"dropzoneContent",
"fileText",
],
base: {
root: {
display: "flex",
flexDirection: "column",
gap: "4",
width: "100%",
alignItems: "flex-start",
},
label: {
fontWeight: "medium",
textStyle: "sm",
},
dropzone: {
background: "bg",
borderRadius: "l3",
borderWidth: "2px",
borderStyle: "dashed",
display: "flex",
alignItems: "center",
flexDirection: "column",
gap: "4",
justifyContent: "center",
minHeight: "2xs",
px: "3",
py: "2",
transition: "backgrounds",
focusVisibleRing: "outside",
_hover: {
bg: "bg.subtle",
},
_dragging: {
bg: "colorPalette.subtle",
borderStyle: "solid",
borderColor: "colorPalette.solid",
},
},
dropzoneContent: {
display: "flex",
flexDirection: "column",
alignItems: "center",
textAlign: "center",
gap: "1",
textStyle: "sm",
},
item: {
pos: "relative",
textStyle: "sm",
animationName: "fade-in",
animationDuration: "moderate",
background: "bg",
borderRadius: "l2",
borderWidth: "1px",
width: "100%",
display: "flex",
alignItems: "center",
gap: "3",
p: "4",
},
itemGroup: {
width: "100%",
display: "flex",
flexDirection: "column",
gap: "3",
_empty: {
display: "none",
},
},
itemName: {
color: "fg",
fontWeight: "medium",
lineClamp: "1",
},
itemContent: {
display: "flex",
flexDirection: "column",
gap: "0.5",
flex: "1",
},
itemSizeText: {
color: "fg.muted",
textStyle: "xs",
},
itemDeleteTrigger: {
display: "flex",
alignItems: "center",
justifyContent: "center",
alignSelf: "flex-start",
boxSize: "5",
p: "2px",
color: "fg.muted",
cursor: "button",
},
itemPreview: {
color: "fg.muted",
_icon: {
boxSize: "4.5",
},
},
},
defaultVariants: {},
})
|