-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathshell-panel.scss
executable file
·376 lines (319 loc) · 11.1 KB
/
shell-panel.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
/**
* CSS Custom Properties
*
* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-shell-panel-width: Specifies the width of the component.
* @prop --calcite-shell-panel-max-width: Specifies the maximum width of the component.
* @prop --calcite-shell-panel-min-width: Specifies the minimum width of the component.
* @prop --calcite-shell-panel-height: When `layout` is `horizontal`, or `layout` is `vertical` and `displayMode` is `float-content` or `float`, specifies the height of the component.
* @prop --calcite-shell-panel-max-height: When `layout` is `horizontal`, or `layout` is `vertical` and `displayMode` is `float-content` or `float`, specifies the maximum height of the component.
* @prop --calcite-shell-panel-min-height: When `layout` is `horizontal`, or `layout` is `vertical` and `displayMode` is `float-content` or `float`, specifies the minimum height of the component.
* @prop --calcite-shell-panel-z-index: Specifies the z-index value for the component.
* @prop --calcite-shell-panel-border-color: When `displayMode` is `"float-all"`, specifies the component's border color.
* @prop --calcite-shell-panel-corner-radius: When `displayMode` is `"float-all"`, specifies the component's corner radius
* @prop --calcite-shell-panel-shadow: When `displayMode` is `"float-all"`, specifies the component's shadow.
*
*/
:host {
@apply relative
pointer-events-none
flex
flex-initial
items-stretch;
z-index: var(--calcite-shell-panel-z-index, theme("zIndex.default"));
--calcite-shell-panel-max-height: unset;
--calcite-internal-shell-panel-shadow-block-start:
0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
--calcite-internal-shell-panel-shadow-block-end:
0 -4px 8px -1px rgba(0, 0, 0, 0.08), 0 -2px 4px -1px rgba(0, 0, 0, 0.04);
--calcite-internal-shell-panel-shadow-inline-start:
4px 0 8px -1px rgba(0, 0, 0, 0.08), 2px 0 4px -1px rgba(0, 0, 0, 0.04);
--calcite-internal-shell-panel-shadow-inline-end:
-4px 0 8px -1px rgba(0, 0, 0, 0.08), -2px 0 4px -1px rgba(0, 0, 0, 0.04);
}
.calcite--rtl.content--overlay {
--calcite-internal-shell-panel-shadow-inline-start:
-4px 0 8px -1px rgba(0, 0, 0, 0.08), -2px 0 4px -1px rgba(0, 0, 0, 0.04);
--calcite-internal-shell-panel-shadow-inline-end:
4px 0 8px -1px rgba(0, 0, 0, 0.08), 2px 0 4px -1px rgba(0, 0, 0, 0.04);
}
:host([layout="vertical"]) {
z-index: var(--calcite-shell-panel-z-index, calc(theme("zIndex.default") + 1));
}
:host([layout="vertical"][display-mode="overlay"]) {
z-index: var(--calcite-shell-panel-z-index, calc(theme("zIndex.header") + 1));
}
:host([layout="vertical"][display-mode="float-all"]) .content {
flex: 2;
}
:host([layout="vertical"]:not([display-mode="float-all"])) .width-s {
--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 12vw);
--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 300px);
--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 150px);
}
:host([layout="vertical"][display-mode="float-all"]) .width-s {
--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 12vw);
--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 150px);
}
:host([layout="vertical"]:not([display-mode="float-all"])) .width-m {
--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 20vw);
--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 420px);
--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 240px);
}
:host([layout="vertical"][display-mode="float-all"]) .width-m {
--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 20vw);
--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 240px);
}
:host([layout="vertical"]:not([display-mode="float-all"])) .width-l {
--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 45vw);
--calcite-internal-shell-panel-max-width: var(--calcite-shell-panel-max-width, 680px);
--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 340px);
}
:host([layout="vertical"][display-mode="float-all"]) .width-l {
--calcite-internal-shell-panel-width: var(--calcite-shell-panel-width, 45vw);
--calcite-internal-shell-panel-min-width: var(--calcite-shell-panel-min-width, 340px);
}
:host([layout="horizontal"]) .height-s {
--calcite-internal-shell-panel-max-height: var(
--calcite-shell-panel-max-height,
var(--calcite-shell-panel-detached-max-height, 20vh)
);
}
:host([layout="horizontal"]) .content {
--calcite-internal-shell-panel-min-height: var(--calcite-shell-panel-min-height, 5vh);
--calcite-internal-shell-panel-max-height: var(--calcite-shell-panel-max-height, 30vh);
}
:host([layout="horizontal"]) .height-l {
--calcite-internal-shell-panel-max-height: var(
--calcite-shell-panel-max-height,
var(--calcite-shell-panel-detached-max-height, 40vh)
);
}
.container {
@apply text-color-2
text-n1
pointer-events-none
box-border
flex
flex-auto
items-stretch
bg-transparent
h-full;
* {
@apply box-border;
}
&.float-all {
margin-block: 0.5rem;
margin-inline: 0.5rem;
}
}
.float-all {
max-block-size: var(--calcite-internal-shell-panel-max-height, calc(100% - 1rem));
box-shadow: var(--calcite-shell-panel-shadow, var(--calcite-shadow-sm));
border-radius: var(--calcite-shell-panel-corner-radius, var(--calcite-corner-radius-round));
overflow: hidden;
}
:host([layout="vertical"][position="start"]) .float-all {
border-inline-start: 1px solid var(--calcite-shell-panel-border-color, var(--calcite-color-border-3));
}
:host([layout="vertical"][position="end"]) .float-all {
border-inline-end: 1px solid var(--calcite-shell-panel-border-color, var(--calcite-color-border-3));
}
:host([layout="horizontal"]) .float-all {
border-inline: 1px solid var(--calcite-shell-panel-border-color, var(--calcite-color-border-3));
}
:host([layout="horizontal"]) .container {
@apply w-full h-auto;
flex-direction: column;
}
:host(:hover),
:host(:focus-within) {
.separator:not(:hover):not(:focus) {
@apply opacity-100;
background-color: var(--calcite-color-border-3);
}
}
.separator {
@apply transition-default
pointer-events-auto
absolute
flex
bg-transparent
opacity-0;
cursor: col-resize;
outline: none;
&:hover {
@apply opacity-100;
background-color: var(--calcite-color-border-2);
}
&:focus {
@apply bg-brand opacity-100;
}
}
:host([layout="vertical"]) .separator {
@apply bottom-0
top-0 h-full
w-0.5;
cursor: col-resize;
}
:host([layout="horizontal"][position="start"]) .separator {
@apply bottom-0;
}
:host([layout="horizontal"][position="end"]) .separator {
@apply top-0;
}
:host([layout="horizontal"]) .separator {
@apply end-0 w-full
h-0.5;
cursor: row-resize;
}
:host([layout="vertical"][position="start"]) .separator {
inset-inline-end: -2px;
}
:host([layout="horizontal"][position="start"]) .separator {
inset-block-end: -2px;
}
:host([layout="vertical"][position="end"]) .separator {
inset-inline-start: -2px;
}
:host([layout="horizontal"][position="end"]) .separator {
inset-block-start: -2px;
}
::slotted(calcite-panel),
::slotted(calcite-flow) {
@apply h-full w-full flex-auto;
max-block-size: unset;
max-inline-size: unset;
}
::slotted(.calcite-match-height) {
@apply flex flex-auto overflow-hidden;
}
.content {
@apply bg-background
pointer-events-auto
flex
flex-col
flex-nowrap
items-stretch
self-stretch
p-0;
transition:
max-block-size var(--calcite-animation-timing),
max-inline-size var(--calcite-animation-timing);
}
:host([layout="vertical"]:not([display-mode="float-all"])) .content {
inline-size: var(--calcite-internal-shell-panel-width);
max-inline-size: var(--calcite-internal-shell-panel-max-width);
min-inline-size: var(--calcite-internal-shell-panel-min-width);
}
:host([layout="vertical"][display-mode="float-all"]) .content {
inline-size: var(--calcite-internal-shell-panel-width);
min-inline-size: var(--calcite-internal-shell-panel-min-width);
}
:host([layout="horizontal"]) .content {
block-size: var(--calcite-internal-shell-panel-height);
max-block-size: var(--calcite-internal-shell-panel-max-height);
min-block-size: var(--calcite-internal-shell-panel-min-height);
}
.content__header {
@apply flex
flex-initial
flex-col
flex-nowrap
items-stretch;
}
.content__body {
@apply flex
flex-auto
flex-col
overflow-hidden;
}
.content--overlay {
@apply absolute
shadow-0;
}
:host([layout="vertical"]) .content--overlay {
@apply top-0 h-full;
}
:host([layout="horizontal"]) .content--overlay {
@apply start-0 w-full;
}
:host([layout="vertical"][position="start"]) .content--overlay {
inset-inline-start: 100%;
box-shadow: var(--calcite-internal-shell-panel-shadow-inline-start);
}
:host([layout="vertical"][position="end"]) .content--overlay {
inset-inline-end: 100%;
box-shadow: var(--calcite-internal-shell-panel-shadow-inline-end);
}
:host([layout="horizontal"][position="start"]) .content--overlay {
inset-block-start: 100%;
box-shadow: var(--calcite-internal-shell-panel-shadow-block-start);
}
:host([layout="horizontal"][position="end"]) .content--overlay {
inset-block-end: 100%;
box-shadow: var(--calcite-internal-shell-panel-shadow-block-end);
}
.float--content {
@apply shadow-0
mx-2
mt-2
mb-auto
h-auto
overflow-hidden
rounded;
max-block-size: var(--calcite-internal-shell-panel-max-height, calc(100% - 1rem));
::slotted(calcite-panel),
::slotted(calcite-flow) {
max-block-size: unset;
}
}
:host([layout="horizontal"]) .float--content {
@apply my-2;
}
:host([position="start"]) .float--content,
:host([position="end"]) .float--content {
::slotted(calcite-panel),
::slotted(calcite-flow) {
@apply border-none;
}
}
.content[hidden] {
@apply hidden;
}
slot[name="action-bar"]::slotted(calcite-action-bar),
.content ::slotted(calcite-flow),
.content ::slotted(calcite-panel:not([closed])) {
@apply border-color-3 border border-solid;
}
:host([position="start"]:not([slot="panel-end"])),
:host([position="end"][slot="panel-start"]) {
slot[name="action-bar"]::slotted(calcite-action-bar),
.content ::slotted(calcite-flow),
.content ::slotted(calcite-panel) {
border-inline-start: none;
}
}
:host([position="end"]:not([slot="panel-start"])),
:host([position="start"][slot="panel-end"]) {
slot[name="action-bar"]::slotted(calcite-action-bar),
.content ::slotted(calcite-flow),
.content ::slotted(calcite-panel) {
border-inline-end: none;
}
}
:host([layout="horizontal"]) slot[name="action-bar"]::slotted(calcite-action-bar) {
border-inline: 0;
}
:host([layout="horizontal"][position="start"]) .content ::slotted(calcite-flow),
:host([layout="horizontal"][position="start"]) .content ::slotted(calcite-panel) {
border-inline: 0;
border-block-start: 0;
}
:host([layout="horizontal"][position="end"]) .content ::slotted(calcite-flow),
:host([layout="horizontal"][position="end"]) .content ::slotted(calcite-panel) {
border-inline: 0;
border-block-end: 0;
}
@include base-component();