@viasat/beam-styles 2.27.0 → 2.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/panel.module.scss +64 -11
- package/package.json +1 -1
|
@@ -9,16 +9,20 @@ $panelBaseClass: '#{constants.$prefix}panel';
|
|
|
9
9
|
$panelOffsetXVar: '--#{constants.$prefix}comp-panel-offset-x';
|
|
10
10
|
$panelOffsetYVar: '--#{constants.$prefix}comp-panel-offset-y';
|
|
11
11
|
$panel-transition-duration: 0.4s;
|
|
12
|
-
$panel-width: 20rem; // TO DO: Temporary fixed width, to be mapped to spec props later
|
|
13
12
|
$panel-max-height: 90dvh;
|
|
14
13
|
$panel-full-height: 100dvh;
|
|
15
14
|
|
|
15
|
+
$panel-sizes: (
|
|
16
|
+
'sm': tokens.$bm-comp-panel-size-sm,
|
|
17
|
+
'md': tokens.$bm-comp-panel-size-md,
|
|
18
|
+
'lg': tokens.$bm-comp-panel-size-lg,
|
|
19
|
+
'full': 100%,
|
|
20
|
+
);
|
|
21
|
+
|
|
16
22
|
.#{$panelBaseClass} {
|
|
17
23
|
display: flex;
|
|
18
24
|
flex-direction: column;
|
|
19
25
|
|
|
20
|
-
width: $panel-width;
|
|
21
|
-
|
|
22
26
|
background-color: tokens.$bm-sem-color-surface-01;
|
|
23
27
|
|
|
24
28
|
&--inline {
|
|
@@ -104,8 +108,10 @@ $panel-full-height: 100dvh;
|
|
|
104
108
|
}
|
|
105
109
|
}
|
|
106
110
|
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
@each $size, $width in $panel-sizes {
|
|
112
|
+
&--size-#{$size} {
|
|
113
|
+
width: $width;
|
|
114
|
+
}
|
|
109
115
|
}
|
|
110
116
|
|
|
111
117
|
// Applies to both inline and overlay bottom panels:
|
|
@@ -264,6 +270,54 @@ $panel-full-height: 100dvh;
|
|
|
264
270
|
right: 0;
|
|
265
271
|
}
|
|
266
272
|
}
|
|
273
|
+
|
|
274
|
+
&__resize-handle {
|
|
275
|
+
position: absolute;
|
|
276
|
+
opacity: 0;
|
|
277
|
+
z-index: 100;
|
|
278
|
+
transition: opacity 0.2s ease-in-out;
|
|
279
|
+
|
|
280
|
+
@media (prefers-reduced-motion: reduce) {
|
|
281
|
+
transition: none;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
&:hover,
|
|
285
|
+
&:active {
|
|
286
|
+
opacity: 1;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// Inline resizable: aside fills animated wrapper width
|
|
291
|
+
&--inline#{&}--resizable {
|
|
292
|
+
width: 100%;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
$panelResizeHandleSize: 0.75rem;
|
|
297
|
+
|
|
298
|
+
$resize-handle-positions: (
|
|
299
|
+
'start': (cursor: col-resize, size-prop: width, stretch: inset-block, placement: inset-inline-end, border-side: inline-end),
|
|
300
|
+
'end': (cursor: col-resize, size-prop: width, stretch: inset-block, placement: inset-inline-start, border-side: inline-start),
|
|
301
|
+
'bottom': (cursor: row-resize, size-prop: height, stretch: inset-inline, placement: inset-block-start, border-side: block-start),
|
|
302
|
+
);
|
|
303
|
+
|
|
304
|
+
@each $pos, $cfg in $resize-handle-positions {
|
|
305
|
+
.#{$panelBaseClass}--resizable.#{$panelBaseClass}--position-#{$pos} {
|
|
306
|
+
.#{$panelBaseClass}__resize-handle {
|
|
307
|
+
cursor: map.get($cfg, cursor);
|
|
308
|
+
#{map.get($cfg, size-prop)}: $panelResizeHandleSize;
|
|
309
|
+
#{map.get($cfg, stretch)}: 0;
|
|
310
|
+
#{map.get($cfg, placement)}: 0;
|
|
311
|
+
border-#{map.get($cfg, border-side)}-width: tokens.$bm-sem-border-width-md;
|
|
312
|
+
border-#{map.get($cfg, border-side)}-style: solid;
|
|
313
|
+
border-#{map.get($cfg, border-side)}-color: tokens.$bm-sem-color-border-selected;
|
|
314
|
+
|
|
315
|
+
&:hover,
|
|
316
|
+
&:active {
|
|
317
|
+
border-#{map.get($cfg, border-side)}-width: tokens.$bm-sem-border-width-lg;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
267
321
|
}
|
|
268
322
|
|
|
269
323
|
@mixin panel-slide($prop, $hidden, $visible, $duration: $panel-transition-duration) {
|
|
@@ -302,9 +356,11 @@ $panel-full-height: 100dvh;
|
|
|
302
356
|
transition: width $panel-transition-duration ease-in;
|
|
303
357
|
}
|
|
304
358
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
359
|
+
@each $size, $width in $panel-sizes {
|
|
360
|
+
&--size-#{$size}[data-status='open'] {
|
|
361
|
+
width: $width;
|
|
362
|
+
transition: width $panel-transition-duration ease-out;
|
|
363
|
+
}
|
|
308
364
|
}
|
|
309
365
|
|
|
310
366
|
&[data-position='bottom'][data-status] {
|
|
@@ -323,9 +379,6 @@ $panel-full-height: 100dvh;
|
|
|
323
379
|
transition: transform $panel-transition-duration ease-out;
|
|
324
380
|
}
|
|
325
381
|
|
|
326
|
-
&--full[data-status='open'] {
|
|
327
|
-
width: 100%;
|
|
328
|
-
}
|
|
329
382
|
}
|
|
330
383
|
|
|
331
384
|
.#{$panelBaseClass}__inline-wrapper-content {
|