@cloud-ru/ds-block 1.0.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.
@@ -0,0 +1,59 @@
1
+ @use '@cloud-ru/ds-figma-variables/build/scss/styles/styles.module' as base;
2
+ @use '@cloud-ru/ds-figma-variables/build/scss/components/block.module' as block;
3
+ @use '@cloud-ru/ds-materials' as m;
4
+
5
+ $sizes: 's', 'm', 'l';
6
+
7
+ .acrylic {
8
+ pointer-events: none;
9
+ position: absolute;
10
+ inset: 0;
11
+ border-radius: inherit;
12
+ }
13
+
14
+ // Блок — подложка, а не layout-контейнер: раскладку содержимого задаёт потребитель на своём
15
+ // контенте. Собственный flex с вертикальным центрированием ломал вёрстку внутри блока.
16
+ .block {
17
+ position: relative;
18
+ display: block;
19
+ box-sizing: border-box;
20
+
21
+ &[data-view='outline'] {
22
+ .borderLayer {
23
+ position: absolute;
24
+ inset: 0;
25
+
26
+ border-color: base.$sn-theme-color-available-borderColor;
27
+ border-style: solid;
28
+ border-radius: inherit;
29
+ }
30
+ }
31
+
32
+ &[data-view='elevated'] {
33
+ &[data-size='l'] {
34
+ box-shadow: base.$sn-boxShadow-elevation-level2;
35
+ }
36
+
37
+ &[data-size='m'],
38
+ &[data-size='s'] {
39
+ box-shadow: base.$sn-boxShadow-elevation-level1;
40
+ }
41
+ }
42
+
43
+ @include m.with-material('acrylic', #{acrylic});
44
+
45
+ @each $size in $sizes {
46
+ &[data-size='#{$size}'] {
47
+ @include base.composite-var(block.$block, 'anatomy', $size);
48
+
49
+ &[data-view='outline'] .borderLayer {
50
+ border-width: base.simple-var(block.$block, 'anatomy', $size, 'border-width');
51
+ }
52
+ }
53
+ }
54
+ }
55
+
56
+ .content {
57
+ position: relative;
58
+ min-width: 0;
59
+ }
package/src/types.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { ValueOf } from '@cloud-ru/ds-utils';
2
+
3
+ import { SIZE, VIEW } from './constants';
4
+
5
+ export type Size = ValueOf<typeof SIZE>;
6
+ export type View = ValueOf<typeof VIEW>;