@oslokommune/punkt-css 12.21.5 → 12.22.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.
@@ -6,7 +6,7 @@
6
6
  @forward 'spacing';
7
7
 
8
8
  // Default icon path
9
- $icon-path: 'https://punkt-cdn.oslo.kommune.no/12.21/icons' !default;
9
+ $icon-path: 'https://punkt-cdn.oslo.kommune.no/12.22/icons' !default;
10
10
 
11
11
  // Borders
12
12
  $border-width: (
@@ -6,54 +6,100 @@
6
6
  @use '../abstracts/mixins/breakpoints' as *;
7
7
  @use '../abstracts/' as *;
8
8
 
9
+ $pkt-modal-gap: map.get(variables.$spacing, 'size-32');
10
+ $pkt-modal-padding-sides: map.get(variables.$spacing, 'size-40');
11
+
9
12
  .pkt-modal {
10
13
  &[open] {
11
- padding: map.get(variables.$spacing, 'size-24') map.get(variables.$spacing, 'size-40');
14
+ background-color: transparent;
12
15
  border: none;
13
- background: white;
14
16
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
15
- max-height: max-content;
16
- display: flex;
17
- flex-direction: column;
18
- gap: map.get(variables.$spacing, 'size-32');
19
- align-items: center;
20
- position: fixed;
21
-
22
- max-height: 80vh;
17
+ padding: 0;
18
+ min-height: 30vh;
19
+ max-height: 90vh;
23
20
 
24
- &::backdrop {
21
+ &::backdrop,
22
+ & + .backdrop {
25
23
  background-color: rgba(0, 0, 0, 0.55);
26
24
  }
27
25
 
26
+ .pkt-modal__container {
27
+ padding-top: $pkt-modal-gap;
28
+ background: var(--pkt-color-background-default);
29
+ overflow-y: auto;
30
+ max-height: calc(100vh - 4rem);
31
+ }
32
+
28
33
  .pkt-modal__header {
29
- display: flex;
30
- justify-content: space-between;
31
- align-items: center;
34
+ display: grid;
35
+ grid-template-columns: 1fr auto;
36
+ grid-template-rows: auto;
37
+ justify-content: flex-start;
32
38
  width: 100%;
33
39
  }
34
40
 
35
- .pkt-modal__headingText {
36
- margin-bottom: 0;
37
- margin-right: 3rem;
41
+ .pkt-modal__header-background {
42
+ background: var(--pkt-color-background-default);
43
+ grid-column: 1 / 2;
44
+ grid-row: 1 / 2;
45
+
46
+ width: 100%;
47
+ height: 100%;
38
48
  }
39
49
 
40
- &.pkt-modal--noHeadingText {
41
- gap: 5rem;
50
+ .pkt-modal__headingText {
51
+ grid-column: 1 / 2;
52
+ grid-row: 1 / 2;
53
+ padding: $pkt-modal-gap 0 0 $pkt-modal-padding-sides;
54
+ margin: 0;
55
+ color: var(--pkt-color-text-body-default);
42
56
  }
43
57
 
44
58
  .pkt-modal__closeButton {
45
- position: absolute;
46
- right: 1.25rem;
47
- top: 1.25rem;
59
+ grid-column: 2 / 3;
60
+ grid-row: 1 / 2;
61
+
62
+ display: flex;
63
+ flex-direction: row-reverse;
64
+ align-self: flex-start;
65
+ }
66
+
67
+ .pkt-modal__closeButton--blue {
68
+ height: 100%;
69
+ background: var(--pkt-color-background-default);
70
+ .pkt-btn {
71
+ margin: map.get(variables.$spacing, 'size-4');
72
+ }
73
+ }
74
+
75
+ .pkt-modal__closeButton--yellow-filled {
76
+ .pkt-btn {
77
+ border: none;
78
+ border-radius: 50%;
79
+ color: var(--pkt-color-surface-strong-dark-blue);
80
+ background-color: var(--pkt-color-brand-yellow-1000);
81
+
82
+ &:hover,
83
+ &:focus {
84
+ background-color: var(--pkt-color-brand-warm-blue-1000);
85
+ color: var(--pkt-color-background-default);
86
+ .pkt-icon {
87
+ color: var(--pkt-color-background-default);
88
+ }
89
+ }
90
+ }
48
91
  }
49
92
 
50
93
  .pkt-modal__content {
51
94
  display: flex;
52
95
  flex-direction: column;
96
+ flex-grow: 1;
53
97
  gap: map.get(variables.$spacing, 'size-16');
54
- overflow: auto;
55
- overscroll-behavior: contain;
98
+ overflow-y: auto;
99
+ padding: map.get(variables.$spacing, 'size-32') map.get(variables.$spacing, 'size-40');
100
+ padding-top: 0;
56
101
  position: relative;
102
+ color: var(--pkt-color-text-body-default);
57
103
  background:
58
104
  linear-gradient(var(--pkt-color-white) 30%, transparent) top,
59
105
  linear-gradient(transparent, var(--pkt-color-border-subtle) 60%) bottom,
@@ -66,6 +112,7 @@
66
112
  100% 50px,
67
113
  100% 16px,
68
114
  100% 16px;
115
+ max-height: calc(100vh - 10rem);
69
116
  }
70
117
  }
71
118
  }
@@ -90,25 +137,17 @@ body.pkt-modal--open {
90
137
  width: 640px;
91
138
  }
92
139
 
93
- .pkt-modal__btn {
94
- &--wrapper {
95
- padding-top: map.get(variables.$spacing, 'size-24');
96
- display: flex;
97
- justify-content: space-between;
98
- gap: map.get(variables.$spacing, 'size-16');
99
- flex-wrap: wrap;
100
- width: 100%;
101
- justify-self: flex-end;
102
- }
103
-
104
- &--right-side {
105
- display: flex;
106
- justify-self: flex-end;
107
- gap: map.get(variables.$spacing, 'size-16');
108
- flex-wrap: wrap;
109
- }
140
+ .pkt-modal__btn-wrapper {
141
+ padding-top: map.get(variables.$spacing, 'size-24');
142
+ display: flex;
143
+ justify-content: flex-start;
144
+ gap: map.get(variables.$spacing, 'size-16');
145
+ flex-wrap: wrap;
146
+ width: 100%;
110
147
  }
111
148
 
149
+ // Small screen
150
+
112
151
  @media screen and (max-width: 640px) {
113
152
  .pkt-modal {
114
153
  &[open] {
@@ -119,6 +158,10 @@ body.pkt-modal--open {
119
158
  font-size: map.get(variables.$font-size, 'size-22');
120
159
  }
121
160
 
161
+ .pkt-modal__closeButton {
162
+ background-color: var(--pkt-color-background-default);
163
+ }
164
+
122
165
  .pkt-modal__content {
123
166
  letter-spacing: map.get(variables.$letter-spacing, 'tight');
124
167
  font-size: map.get(variables.$font-size, 'size-16');
@@ -154,18 +197,47 @@ body.pkt-modal--open {
154
197
  // Make sure the buttons are centered and stacked on mobile
155
198
  @media screen and (max-width: 480px) {
156
199
  .pkt-modal__btn {
157
- &--wrapper {
158
- flex-direction: column-reverse;
200
+ &-wrapper {
201
+ display: grid;
202
+ grid-template-columns: 1fr;
159
203
  justify-content: center;
160
204
  align-items: center;
161
- }
162
205
 
163
- &--right-side {
164
- justify-content: center;
206
+ .pkt-btn {
207
+ justify-content: center;
208
+ }
165
209
  }
166
210
  }
167
211
  }
168
212
 
213
+ // Adjustments for padding
214
+
169
215
  .pkt-modal.pkt-modal--removePadding {
170
- padding: 0;
216
+ .pkt-modal__headingText,
217
+ .pkt-modal__content,
218
+ .pkt-modal__container {
219
+ padding: 0;
220
+ }
221
+ }
222
+
223
+ .pkt-modal.pkt-modal--noHeadingText {
224
+ .pkt-modal__container {
225
+ padding-top: 1rem;
226
+ }
227
+ }
228
+
229
+ // Make sure the header has a background color if the close button is not yellow
230
+ // :has() is not supported in Safari thus we must set :is so that it is ignored in Safari and not crash at least.
231
+ .pkt-modal__header:is(:has(.pkt-modal__closeButton:not(.pkt-modal__closeButton--yellow-filled))) {
232
+ background-color: var(--pkt-color-background-default);
233
+ }
234
+
235
+ // In Modal docs, margin is being added on buttons because of some global style, thus we need to override it here so that our docs example is consistent with the component.
236
+ .pkt-modal
237
+ .pkt-modal__container
238
+ .pkt-modal__btn-wrapper
239
+ button.pkt-btn:not(.pkt-inputwrapper__helptext-expandable > .pkt-btn):not(.pkt-header__user-btn):not(
240
+ .pkt-searchinput__button
241
+ ) {
242
+ margin: 0;
171
243
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "12.21.5",
3
+ "version": "12.22.0",
4
4
  "description": "CSS-rammeverket til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -20,7 +20,7 @@
20
20
  "preview": "astro preview"
21
21
  },
22
22
  "devDependencies": {
23
- "@oslokommune/punkt-assets": "^12.21.5",
23
+ "@oslokommune/punkt-assets": "^12.21.6",
24
24
  "edit-json-file": "^1.8.0",
25
25
  "fs-extra": "^11.2.0",
26
26
  "prettier": "^3.3.3",
@@ -54,5 +54,5 @@
54
54
  "url": "https://github.com/oslokommune/punkt/issues"
55
55
  },
56
56
  "license": "MIT",
57
- "gitHead": "dc336f095afddad756ac311a7bf0bdbcc03db50e"
57
+ "gitHead": "33ada1308d3f9b91fe54079e2f43e1370aed6a98"
58
58
  }