@drivy/cobalt 3.0.4 → 3.0.5

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.5",
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,40 @@
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
+ &::before,
18
+ &::after {
19
+ content: none;
20
+ }
21
+ }
11
22
 
12
- width: 100%;
23
+ // Top spacing : 10vh by default, can shrink to 32px
24
+ &::before {
25
+ flex: 0 1 var(--dialog-margin-top);
26
+ min-height: var(--dialog-margin-min);
27
+
28
+ content: "";
29
+ }
30
+
31
+ // Bottom spacing : can shrink to 32px when max-height is reached
32
+ &::after {
33
+ flex: 1 1 var(--dialog-margin-top);
34
+ min-height: var(--dialog-margin-min);
35
+
36
+ content: "";
37
+ }
13
38
 
14
39
  &__overlay {
15
40
  @apply c-z-modal-below;
@@ -35,12 +60,14 @@
35
60
  .cobalt-modal__content:not([hidden]) {
36
61
  @apply c-bg-surfaceBright;
37
62
 
38
- position: fixed;
63
+ position: relative;
64
+
65
+ flex: 0 0 auto;
39
66
 
40
67
  display: flex;
41
68
  flex-direction: column;
42
69
 
43
- max-height: calc(100% - 2 * var(--dialog-margin-top));
70
+ max-height: calc(100% - 2 * var(--dialog-margin-min));
44
71
  width: 80vw;
45
72
 
46
73
  box-shadow: 0 6px 36px fade-out(black, 0.8);
@@ -51,9 +78,6 @@
51
78
  }
52
79
 
53
80
  @include breakpoint($until: "md") {
54
- position: fixed;
55
- bottom: 0;
56
-
57
81
  width: 100%;
58
82
  max-height: calc(100% - theme("spacing.xl"));
59
83
 
@@ -76,10 +100,17 @@
76
100
  }
77
101
 
78
102
  &--fullHeight {
79
- height: 100%;
103
+ &::before {
104
+ flex: 0 0 var(--dialog-margin-min);
105
+ }
106
+
107
+ &::after {
108
+ flex: 0 0 var(--dialog-margin-min);
109
+ }
80
110
 
81
111
  .cobalt-modal__content:not([hidden]) {
82
- height: 100%;
112
+ flex: 1 1 0;
113
+ max-height: calc(100% - 2 * var(--dialog-margin-min));
83
114
  }
84
115
  }
85
116
 
@@ -90,10 +121,14 @@
90
121
  }
91
122
 
92
123
  &--fullScreen {
93
- height: 100%;
124
+ &::before,
125
+ &::after {
126
+ content: none;
127
+ }
94
128
 
95
129
  .cobalt-modal__content:not([hidden]) {
96
- height: 100%;
130
+ flex: 1 1 0;
131
+ width: 100%;
97
132
  max-width: unset;
98
133
  max-height: unset;
99
134