/
calcite-combobox.scss
193 lines (160 loc) · 3.46 KB
/
calcite-combobox.scss
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
/**
* CSS Custom Properties
*
* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-combobox-input-height: the height of the combobox input
*/
:host {
@apply block relative;
}
:host([disabled]) {
@apply pointer-events-none select-none opacity-50;
}
:host([scale="s"]) {
@apply text--2;
--calcite-combobox-item-spacing-unit-l: theme("spacing.2");
--calcite-combobox-item-spacing-unit-s: theme("spacing.1");
--calcite-combobox-input-height: theme("spacing.6");
}
:host([scale="m"]) {
@apply text--1;
--calcite-combobox-item-spacing-unit-l: theme("spacing.3");
--calcite-combobox-item-spacing-unit-s: theme("spacing.2");
--calcite-combobox-input-height: theme("spacing.8");
}
:host([scale="l"]) {
@apply text-0;
--calcite-combobox-item-spacing-unit-l: theme("spacing.4");
--calcite-combobox-item-spacing-unit-s: theme("spacing.3");
--calcite-combobox-input-height: theme("spacing.11");
}
.wrapper {
@apply flex
bg-foreground-1
text-color-1
focus-base;
box-shadow: inset 0 0 0 1px var(--calcite-ui-border-input);
padding: 0 var(--calcite-combobox-item-spacing-unit-l) 0 var(--calcite-combobox-item-spacing-unit-l);
}
:host(:focus-within) .wrapper,
.wrapper--active {
@apply focus-inset;
}
.wrapper--single {
padding: 0 var(--calcite-combobox-item-spacing-unit-l);
@apply cursor-pointer flex-nowrap;
}
.grid-input {
@apply flex
flex-grow
flex-wrap
items-center
p-0
truncate;
}
.input {
@apply flex-grow
font-inherit
p-0
bg-transparent
border-none
text-color-1
appearance-none;
font-size: inherit;
height: var(--calcite-combobox-input-height);
line-height: var(--calcite-combobox-input-height);
min-width: 120px;
margin-bottom: var(--calcite-combobox-item-spacing-unit-s);
&:focus {
@apply outline-none;
}
}
.input--transparent {
@apply opacity-0;
}
.input--single {
@apply mb-0 mt-0 p-0;
}
.wrapper--active .input-single {
@apply cursor-text;
}
.input--hidden {
@apply w-0
min-w-0
opacity-0
pointer-events-none;
}
.input--icon {
padding: 0 var(--calcite-combobox-item-spacing-unit-l);
}
.input-wrap {
@apply flex flex-grow;
}
.input-wrap--single {
@apply flex-auto overflow-hidden;
}
.label {
@apply p-0
flex
font-normal
flex-auto
pointer-events-none
truncate
max-w-full;
height: var(--calcite-combobox-input-height);
line-height: var(--calcite-combobox-input-height);
}
.label--spaced {
@apply py-0;
padding-left: var(--calcite-combobox-item-spacing-unit-l);
padding-right: var(--calcite-combobox-item-spacing-unit-l);
}
.icon-end,
.icon-start {
@apply cursor-pointer
flex items-center
w-4;
}
.icon-end {
@apply flex-none;
}
.popper-container {
@apply w-full;
@include popperContainer();
@include popperWrapper();
}
@include popperElemAnim(".popper-container");
.popper-container--active {
@include popperWrapperActive();
}
.screen-readers-only {
@apply sr-only;
}
.list-container {
@apply overflow-y-auto
max-h-screen
bg-foreground-1;
width: var(--calcite-dropdown-width);
}
.list {
@apply block m-0 p-0;
}
.list--hide {
@apply h-0 overflow-hidden;
}
.chip {
margin-block: calc(var(--calcite-combobox-item-spacing-unit-s) / 2) 0;
margin-inline: 0 var(--calcite-combobox-item-spacing-unit-s);
max-width: 100%;
}
.chip--active {
@apply bg-foreground-3;
}
.chip:last-of-type {
margin-inline-end: 0;
}
.item {
@apply block;
}
@include hidden-form-input();