File size: 1,360 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
import { qrCodeAnatomy } from "../../anatomy"
import { defineSlotRecipe } from "../../styled-system"

export const qrCodeSlotRecipe = defineSlotRecipe({
  slots: qrCodeAnatomy.keys(),
  className: "chakra-qr-code",

  base: {
    root: {
      position: "relative",
      width: "fit-content",
      "--qr-code-overlay-size": "calc(var(--qr-code-size) / 3)",
    },
    frame: {
      width: "var(--qr-code-size)",
      height: "var(--qr-code-size)",
      fill: "currentColor",
    },
    overlay: {
      display: "flex",
      alignItems: "center",
      justifyContent: "center",
      width: "var(--qr-code-overlay-size)",
      height: "var(--qr-code-overlay-size)",
      padding: "1",
      bg: "bg",
      rounded: "l1",
    },
  },

  variants: {
    size: {
      "2xs": {
        root: { "--qr-code-size": "40px" },
      },
      xs: {
        root: { "--qr-code-size": "64px" },
      },
      sm: {
        root: { "--qr-code-size": "80px" },
      },
      md: {
        root: { "--qr-code-size": "120px" },
      },
      lg: {
        root: { "--qr-code-size": "160px" },
      },
      xl: {
        root: { "--qr-code-size": "200px" },
      },
      "2xl": {
        root: { "--qr-code-size": "240px" },
      },
      full: {
        root: { "--qr-code-size": "100%" },
      },
    },
  },

  defaultVariants: {
    size: "md",
  },
})