@drivy/cobalt 3.0.4 → 3.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drivy/cobalt",
3
- "version": "3.0.4",
3
+ "version": "3.0.6",
4
4
  "description": "Opinionated design system for Drivy's projects.",
5
5
  "main": "index.js",
6
6
  "types": "types/src/index.d.ts",
@@ -1,15 +1,43 @@
1
1
  .cobalt-modal {
2
2
  --dialog-margin-top: 10vh;
3
+ --dialog-margin-min: 32px;
3
4
 
4
5
  @apply c-p-none c-z-modal;
6
+
5
7
  position: fixed;
6
- left: 0;
7
- top: var(--dialog-margin-top);
8
8
 
9
9
  display: flex;
10
- justify-content: center;
10
+ flex-direction: column;
11
+ align-items: center;
12
+ inset: 0;
13
+
14
+ @include breakpoint($until: "md") {
15
+ justify-content: flex-end;
16
+ }
17
+
18
+ // Top spacing : 10vh by default, can shrink to 32px
19
+ &::before {
20
+ flex: 0 1 var(--dialog-margin-top);
21
+ min-height: var(--dialog-margin-min);
22
+
23
+ content: "";
24
+
25
+ @include breakpoint($until: "md") {
26
+ content: none;
27
+ }
28
+ }
29
+
30
+ // Bottom spacing : can shrink to 32px when max-height is reached
31
+ &::after {
32
+ flex: 1 1 var(--dialog-margin-top);
33
+ min-height: var(--dialog-margin-min);
34
+
35
+ content: "";
11
36
 
12
- width: 100%;
37
+ @include breakpoint($until: "md") {
38
+ content: none;
39
+ }
40
+ }
13
41
 
14
42
  &__overlay {
15
43
  @apply c-z-modal-below;
@@ -35,12 +63,14 @@
35
63
  .cobalt-modal__content:not([hidden]) {
36
64
  @apply c-bg-surfaceBright;
37
65
 
38
- position: fixed;
66
+ position: relative;
67
+
68
+ flex: 0 0 auto;
39
69
 
40
70
  display: flex;
41
71
  flex-direction: column;
42
72
 
43
- max-height: calc(100% - 2 * var(--dialog-margin-top));
73
+ max-height: calc(100% - 2 * var(--dialog-margin-min));
44
74
  width: 80vw;
45
75
 
46
76
  box-shadow: 0 6px 36px fade-out(black, 0.8);
@@ -51,9 +81,6 @@
51
81
  }
52
82
 
53
83
  @include breakpoint($until: "md") {
54
- position: fixed;
55
- bottom: 0;
56
-
57
84
  width: 100%;
58
85
  max-height: calc(100% - theme("spacing.xl"));
59
86
 
@@ -76,10 +103,21 @@
76
103
  }
77
104
 
78
105
  &--fullHeight {
79
- height: 100%;
106
+ &::before {
107
+ flex: 0 0 var(--dialog-margin-min);
108
+ }
109
+
110
+ &::after {
111
+ flex: 0 0 var(--dialog-margin-min);
112
+ }
80
113
 
81
114
  .cobalt-modal__content:not([hidden]) {
82
- height: 100%;
115
+ flex: 1 1 0;
116
+ max-height: calc(100% - 2 * var(--dialog-margin-min));
117
+
118
+ @include breakpoint($until: "md") {
119
+ max-height: calc(100% - theme("spacing.xl"));
120
+ }
83
121
  }
84
122
  }
85
123
 
@@ -90,10 +128,14 @@
90
128
  }
91
129
 
92
130
  &--fullScreen {
93
- height: 100%;
131
+ &::before,
132
+ &::after {
133
+ content: none;
134
+ }
94
135
 
95
136
  .cobalt-modal__content:not([hidden]) {
96
- height: 100%;
137
+ flex: 1 1 0;
138
+ width: 100%;
97
139
  max-width: unset;
98
140
  max-height: unset;
99
141