-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathindex.js
105 lines (87 loc) · 2.28 KB
/
index.js
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
export default {
root: {
class: [
'relative',
// Alignment
'inline-flex',
'align-bottom',
// Size
'w-4',
'h-4',
// Misc
'cursor-default',
'select-none'
]
},
box: ({ props, context }) => ({
class: [
// Alignment
'flex',
'items-center',
'justify-center',
// Size
'w-4',
'h-4',
// Shape
'rounded',
'border',
// Colors
'text-surface-600',
{
'border-surface-300 bg-surface-0 dark:border-surface-700 dark:bg-surface-900': !context.checked,
'border-primary-500 bg-primary-500 dark:border-primary-400 dark:bg-primary-400': context.checked
},
{
'ring-2 ring-primary-500 dark:ring-primary-400': !props.disabled && context.focused,
'cursor-default opacity-60': props.disabled
},
// States
{
'peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500 dark:peer-focus-visible:ring-primary-400': !props.disabled,
'cursor-default opacity-60': props.disabled
},
// Transitions
'transition-colors',
'duration-200'
]
}),
input: {
class: [
'peer',
// Size
'w-full ',
'h-full',
// Position
'absolute',
'top-0 left-0',
'z-10',
// Spacing
'p-0',
'm-0',
// Shape
'rounded',
'border',
// Shape
'opacity-0',
'rounded-md',
'outline-none',
'border-2 border-surface-300 dark:border-surface-700',
// Misc
'appareance-none'
]
},
icon: {
class: [
// Font
'text-normal',
// Size
'w-3',
'h-3',
// Colors
'text-white dark:text-surface-900',
// Transitions
'transition-all',
'duration-200'
]
}
};