@oslokommune/punkt-css 12.10.1 → 12.11.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.10/icons' !default;
9
+ $icon-path: 'https://punkt-cdn.oslo.kommune.no/12.11/icons' !default;
10
10
 
11
11
  // Borders
12
12
  $border-width: (
@@ -62,6 +62,7 @@ $-border-thickness: map.get(variables.$spacing, 'size-4');
62
62
  &__text {
63
63
  @include get-text('pkt-txt-18-light');
64
64
  margin: 0 0 0 2.5rem;
65
+ overflow-wrap: break-word;
65
66
 
66
67
  p {
67
68
  margin-bottom: map.get(variables.$spacing, 'size-16');
@@ -125,6 +125,9 @@ pkt-calendar {
125
125
  .pkt-btn {
126
126
  background-color: var(--pkt-color-surface-default-light-blue);
127
127
  }
128
+ ::after {
129
+ background-color: transparent;
130
+ }
128
131
  .pkt-btn {
129
132
  border-color: var(--pkt-color-surface-default-light-blue);
130
133
  }
@@ -11,6 +11,7 @@
11
11
  @forward 'inputwrapper';
12
12
  @forward 'linkcard';
13
13
  @forward 'loader';
14
+ @forward 'modal';
14
15
  @forward 'messagebox';
15
16
  @forward 'preview';
16
17
  @forward 'progressbar';
@@ -0,0 +1,166 @@
1
+ /*
2
+ * Modal component
3
+ */
4
+ @use 'sass:map';
5
+ @use '../abstracts/variables';
6
+ @use '../abstracts/mixins/breakpoints' as *;
7
+ @use '../abstracts/' as *;
8
+
9
+ .pkt-modal {
10
+ &[open] {
11
+ padding: map.get(variables.$spacing, 'size-24') map.get(variables.$spacing, 'size-40');
12
+ border: none;
13
+ background: white;
14
+ 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-16');
19
+ align-items: center;
20
+ position: fixed;
21
+
22
+ max-height: 80vh;
23
+
24
+ &::backdrop {
25
+ background-color: rgba(0, 0, 0, 0.55);
26
+ }
27
+
28
+ .pkt-modal__header {
29
+ display: flex;
30
+ justify-content: space-between;
31
+ align-items: center;
32
+ width: 100%;
33
+ }
34
+
35
+ .pkt-modal__headingText {
36
+ margin-bottom: 0;
37
+ margin-right: 3rem;
38
+ }
39
+
40
+ .pkt-modal__closeButton {
41
+ position: absolute;
42
+ right: 1.25rem;
43
+ top: 1.25rem;
44
+ }
45
+
46
+ .pkt-modal__content {
47
+ display: flex;
48
+ flex-direction: column;
49
+ gap: map.get(variables.$spacing, 'size-16');
50
+ overflow: auto;
51
+ overscroll-behavior: contain;
52
+ position: relative;
53
+ background:
54
+ linear-gradient(var(--pkt-color-white) 30%, transparent) top,
55
+ linear-gradient(transparent, var(--pkt-color-border-subtle) 60%) bottom,
56
+ radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.3), transparent) top,
57
+ radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.3), transparent) bottom;
58
+ background-attachment: local, local, scroll, scroll;
59
+ background-repeat: no-repeat;
60
+ background-size:
61
+ 100% 40px,
62
+ 100% 50px,
63
+ 100% 16px,
64
+ 100% 16px;
65
+ padding: 1rem 0;
66
+ }
67
+ }
68
+ }
69
+
70
+ // Prevent scroll when modal is open
71
+ body.pkt-modal--open {
72
+ overflow: hidden;
73
+ scrollbar-gutter: stable;
74
+ }
75
+
76
+ // SIZES
77
+ .pkt-modal--small {
78
+ width: 480px;
79
+ padding: map.get(variables.$spacing, 'size-16') map.get(variables.$spacing, 'size-32');
80
+ }
81
+
82
+ .pkt-modal--medium {
83
+ width: map.get(variables.$breakpoints, 'phablet');
84
+ }
85
+
86
+ .pkt-modal--large {
87
+ width: 640px;
88
+ }
89
+
90
+ .pkt-modal__btn {
91
+ &--wrapper {
92
+ padding-top: map.get(variables.$spacing, 'size-24');
93
+ display: flex;
94
+ justify-content: space-between;
95
+ gap: map.get(variables.$spacing, 'size-16');
96
+ flex-wrap: wrap;
97
+ width: 100%;
98
+ justify-self: flex-end;
99
+ }
100
+
101
+ &--right-side {
102
+ display: flex;
103
+ justify-self: flex-end;
104
+ gap: map.get(variables.$spacing, 'size-16');
105
+ flex-wrap: wrap;
106
+ }
107
+ }
108
+
109
+ @media screen and (max-width: 640px) {
110
+ .pkt-modal {
111
+ &[open] {
112
+ gap: map.get(variables.$spacing, 'size-16') 0;
113
+
114
+ .pkt-modal__headingText {
115
+ font-size: map.get(variables.$font-size, 'size-20');
116
+ letter-spacing: map.get(variables.$letter-spacing, 'tight');
117
+ line-height: map.get(variables.$line-height, 'lh-24');
118
+ }
119
+
120
+ .pkt-modal__content {
121
+ font-size: map.get(variables.$font-size, 'size-16');
122
+ letter-spacing: map.get(variables.$letter-spacing, 'tight');
123
+ line-height: map.get(variables.$line-height, 'lh-24');
124
+ }
125
+ }
126
+
127
+ &--large {
128
+ position: absolute;
129
+ width: 100vh;
130
+ padding: map.get(variables.$spacing, 'size-16') map.get(variables.$spacing, 'size-24');
131
+ }
132
+ }
133
+ }
134
+
135
+ @media screen and (max-width: 480px) {
136
+ .pkt-modal {
137
+ &--small {
138
+ position: absolute;
139
+ width: 100vh;
140
+ }
141
+ }
142
+ }
143
+
144
+ @media screen and (max-width: map.get(variables.$breakpoints, 'phablet')) {
145
+ .pkt-modal {
146
+ &--medium {
147
+ position: absolute;
148
+ width: 100vh;
149
+ }
150
+ }
151
+ }
152
+
153
+ // Make sure the buttons are centered and stacked on mobile
154
+ @media screen and (max-width: 480px) {
155
+ .pkt-modal__btn {
156
+ &--wrapper {
157
+ flex-direction: column-reverse;
158
+ justify-content: center;
159
+ align-items: center;
160
+ }
161
+
162
+ &--right-side {
163
+ justify-content: center;
164
+ }
165
+ }
166
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "12.10.1",
3
+ "version": "12.11.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",
@@ -54,5 +54,5 @@
54
54
  "url": "https://github.com/oslokommune/punkt/issues"
55
55
  },
56
56
  "license": "MIT",
57
- "gitHead": "dffc9a6674efa752dc97af0ebdda1278346460ba"
57
+ "gitHead": "727c8399a34e90ebfb7e843f0adfe0c4f828fa9f"
58
58
  }