@oslokommune/punkt-css 12.10.2 → 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.
- package/CHANGELOG.md +193 -0
- package/dist/css/components/calendar.css +4 -0
- package/dist/css/components/calendar.min.css +1 -1
- package/dist/css/components/modal.css +124 -0
- package/dist/css/components/modal.min.css +1 -0
- package/dist/css/components/textinput.css +1 -1
- package/dist/css/components/textinput.min.css +1 -1
- package/dist/css/pkt-base.css +1 -1
- package/dist/css/pkt-base.min.css +1 -1
- package/dist/css/pkt-components.css +129 -1
- package/dist/css/pkt-components.min.css +1 -1
- package/dist/css/pkt-elements.css +3 -3
- package/dist/css/pkt-elements.min.css +1 -1
- package/dist/css/pkt.css +132 -4
- package/dist/css/pkt.min.css +1 -1
- package/dist/scss/abstracts/variables/_index.scss +1 -1
- package/dist/scss/components/_calendar.scss +3 -0
- package/dist/scss/components/_index.scss +1 -0
- package/dist/scss/components/_modal.scss +166 -0
- package/package.json +2 -2
|
@@ -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.
|
|
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": "
|
|
57
|
+
"gitHead": "727c8399a34e90ebfb7e843f0adfe0c4f828fa9f"
|
|
58
58
|
}
|