File size: 3,238 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import { defineSlotRecipe } from "../def"

export const pinInputSlotRecipe = defineSlotRecipe({
  className: "pin-input",
  slots: ["root", "label", "input", "control"],
  base: {
    input: {
      width: "var(--input-height)",
      minWidth: "0",
      outline: "0",
      position: "relative",
      appearance: "none",
      textAlign: "center",
      borderRadius: "l2",
      _disabled: {
        layerStyle: "disabled",
      },
      height: "var(--input-height)",
      minW: "var(--input-height)",
      "--focus-color": "colors.colorPalette.focusRing",
      "--error-color": "colors.border.error",
      _invalid: {
        focusRingColor: "var(--error-color)",
        borderColor: "var(--error-color)",
      },
    },
    control: {
      display: "inline-flex",
      gap: "2",
      isolation: "isolate",
    },
  },
  variants: {
    size: {
      "2xs": {
        input: {
          textStyle: "xs",
          px: "1",
          "--input-height": "sizes.7",
        },
      },
      xs: {
        input: {
          textStyle: "xs",
          px: "1",
          "--input-height": "sizes.8",
        },
      },
      sm: {
        input: {
          textStyle: "sm",
          px: "1",
          "--input-height": "sizes.9",
        },
      },
      md: {
        input: {
          textStyle: "sm",
          px: "1",
          "--input-height": "sizes.10",
        },
      },
      lg: {
        input: {
          textStyle: "md",
          px: "1",
          "--input-height": "sizes.11",
        },
      },
      xl: {
        input: {
          textStyle: "md",
          px: "1",
          "--input-height": "sizes.12",
        },
      },
      "2xl": {
        input: {
          textStyle: "lg",
          px: "1",
          "--input-height": "sizes.16",
        },
      },
    },
    variant: {
      outline: {
        input: {
          bg: "transparent",
          borderWidth: "1px",
          borderColor: "border",
          focusVisibleRing: "inside",
          focusRingColor: "var(--focus-color)",
        },
      },
      subtle: {
        input: {
          borderWidth: "1px",
          borderColor: "transparent",
          bg: "bg.muted",
          focusVisibleRing: "inside",
          focusRingColor: "var(--focus-color)",
        },
      },
      flushed: {
        input: {
          bg: "transparent",
          borderBottomWidth: "1px",
          borderBottomColor: "border",
          borderRadius: "0",
          px: "0",
          _focusVisible: {
            borderColor: "var(--focus-color)",
            boxShadow: "0px 1px 0px 0px var(--focus-color)",
            _invalid: {
              borderColor: "var(--error-color)",
              boxShadow: "0px 1px 0px 0px var(--error-color)",
            },
          },
        },
      },
    },
    attached: {
      true: {
        control: {
          gap: "0",
          spaceX: "-1px",
        },
        input: {
          _notFirst: {
            borderStartRadius: "0",
          },
          _notLast: {
            borderEndRadius: "0",
          },
          _focusVisible: {
            zIndex: "1",
          },
        },
      },
    },
  },
  defaultVariants: {
    size: "md",
    variant: "outline",
  },
})