@oslokommune/punkt-css 13.21.0 → 14.0.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/css/components/card.css +3 -3
  3. package/dist/css/components/card.min.css +1 -1
  4. package/dist/css/components/header-service-mobile.css +184 -0
  5. package/dist/css/components/header-service-mobile.min.css +1 -0
  6. package/dist/css/components/header-service.css +413 -0
  7. package/dist/css/components/header-service.min.css +1 -0
  8. package/dist/css/components/header-user-menu.css +128 -0
  9. package/dist/css/components/header-user-menu.min.css +1 -0
  10. package/dist/css/components/textinput.css +1 -1
  11. package/dist/css/components/textinput.min.css +1 -1
  12. package/dist/css/elements/checkbox-radio.css +3 -3
  13. package/dist/css/elements/checkbox-radio.min.css +1 -1
  14. package/dist/css/elements/input.css +1 -1
  15. package/dist/css/elements/input.min.css +1 -1
  16. package/dist/css/elements/select.css +1 -1
  17. package/dist/css/elements/select.min.css +1 -1
  18. package/dist/css/pkt-base.css +7 -2
  19. package/dist/css/pkt-base.min.css +1 -1
  20. package/dist/css/pkt-components.css +732 -4
  21. package/dist/css/pkt-components.min.css +1 -1
  22. package/dist/css/pkt-docs.css +742 -9
  23. package/dist/css/pkt-docs.min.css +1 -1
  24. package/dist/css/pkt-elements.css +4 -4
  25. package/dist/css/pkt-elements.min.css +1 -1
  26. package/dist/css/pkt.css +742 -9
  27. package/dist/css/pkt.min.css +1 -1
  28. package/dist/scss/abstracts/mixins/_container-queries.scss +37 -0
  29. package/dist/scss/abstracts/mixins/_index.scss +1 -0
  30. package/dist/scss/abstracts/variables/_index.scss +1 -1
  31. package/dist/scss/base/_typography.scss +4 -1
  32. package/dist/scss/components/_card.scss +3 -3
  33. package/dist/scss/components/_header-service-mobile.scss +211 -0
  34. package/dist/scss/components/_header-service.scss +378 -0
  35. package/dist/scss/components/_header-user-menu.scss +127 -0
  36. package/dist/scss/components/_index.scss +3 -0
  37. package/package.json +3 -3
@@ -0,0 +1,37 @@
1
+ // Container Queries mixin
2
+ //
3
+ // Provides container queries with media query fallback for browsers without support.
4
+ // Container queries allow components to respond to their container's size rather than the viewport.
5
+ //
6
+ // Usage:
7
+ // .my-component {
8
+ // container-type: inline-size;
9
+ // container-name: my-container;
10
+ //
11
+ // @include cq('my-container', 48rem) {
12
+ // // Styles for containers >= 768px wide
13
+ // }
14
+ // }
15
+ //
16
+ // @param $container-name - The name of the container to query
17
+ // @param $min-width - The minimum width threshold (in rem or other CSS units)
18
+
19
+ @mixin cq($container-name, $min-width) {
20
+ // Media query fallback for browsers without container query support
21
+ @media screen and (min-width: $min-width) {
22
+ @content;
23
+ }
24
+
25
+ // Container query for modern browsers (overrides media query when supported)
26
+ @container #{$container-name} (min-width: #{$min-width}) {
27
+ @content;
28
+ }
29
+ }
30
+
31
+ // Common breakpoint values (matching the bp mixin values)
32
+ $cq-bp-mobile: 0rem; // 0px
33
+ $cq-bp-phablet: 35.938rem; // 575px
34
+ $cq-bp-tablet: 48rem; // 768px
35
+ $cq-bp-tablet-big: 64rem; // 1024px
36
+ $cq-bp-laptop: 80rem; // 1280px
37
+ $cq-bp-desktop: 100rem; // 1600px
@@ -1,2 +1,3 @@
1
1
  @forward 'breakpoints';
2
+ @forward 'container-queries';
2
3
  @forward 'typography';
@@ -6,7 +6,7 @@
6
6
  @forward 'spacing';
7
7
 
8
8
  // Default icon path
9
- $icon-path: 'https://punkt-cdn.oslo.kommune.no/13.21/icons' !default;
9
+ $icon-path: 'https://punkt-cdn.oslo.kommune.no/14.0/icons' !default;
10
10
 
11
11
  // Borders
12
12
  $border-width: (
@@ -62,6 +62,9 @@ a,
62
62
  &.pkt-link--hover {
63
63
  color: var(--pkt-color-text-action-active);
64
64
  text-decoration: underline;
65
+ svg {
66
+ --fg-color: currentColor;
67
+ }
65
68
  }
66
69
 
67
70
  // focus
@@ -95,7 +98,7 @@ a,
95
98
 
96
99
  .pkt-link {
97
100
  &__icon {
98
- --fg-color: var(--pkt-color-text-action-normal);
101
+ --fg-color: currentColor;
99
102
  width: 1.5rem;
100
103
  height: 1.5rem;
101
104
  flex-shrink: 0;
@@ -256,15 +256,15 @@ pkt-card {
256
256
  &--outlined,
257
257
  &--outlined-beige {
258
258
  background-color: var(--pkt-color-background-default);
259
- outline-offset: -4px;
259
+ outline-offset: -2px;
260
260
  }
261
261
 
262
262
  &--outlined {
263
- outline: 4px solid var(--pkt-color-grays-gray-100);
263
+ outline: 2px solid var(--pkt-color-grays-gray-100);
264
264
  }
265
265
 
266
266
  &--outlined-beige {
267
- outline: 4px solid var(--pkt-color-brand-light-beige-1000);
267
+ outline: 2px solid var(--pkt-color-brand-light-beige-1000);
268
268
  }
269
269
 
270
270
  &--gray {
@@ -0,0 +1,211 @@
1
+ @use 'sass:map';
2
+ @use '../abstracts/variables';
3
+ @use '../abstracts/mixins/breakpoints' as *;
4
+ @use '../abstracts/mixins/' as *;
5
+
6
+ .pkt-header-service.pkt-header-service--mobile {
7
+ grid-template-rows: map.get(variables.$spacing, 'size-64') auto;
8
+ grid-template-columns: 1fr auto;
9
+
10
+ @include bp('laptop-up') {
11
+ grid-template-rows: map.get(variables.$spacing, 'size-72') auto;
12
+ }
13
+
14
+ .pkt-header-service {
15
+ &--compact {
16
+ grid-template-rows: map.get(variables.$spacing, 'size-64') auto;
17
+ }
18
+
19
+ &__logo-area,
20
+ &__content,
21
+ &__user {
22
+ column-gap: map.get(variables.$spacing, 'size-16');
23
+ }
24
+
25
+ &__logo-area {
26
+ grid-column: 1;
27
+ grid-row: 1;
28
+ }
29
+
30
+ &__content {
31
+ grid-column: 2;
32
+ grid-row: 1;
33
+ padding-right: map.get(variables.$spacing, 'size-16');
34
+ }
35
+
36
+ &__user {
37
+ grid-column: 1 / -1;
38
+ grid-row: 2;
39
+ justify-self: stretch;
40
+ padding: 0;
41
+ }
42
+
43
+ &__logo {
44
+ svg {
45
+ height: map.get(variables.$spacing, 'size-32');
46
+ }
47
+ }
48
+
49
+ &__service-name {
50
+ @include get-text('pkt-txt-16-medium');
51
+ }
52
+
53
+ &__mobile-menu {
54
+ background-color: var(--pkt-color-background-default);
55
+ }
56
+
57
+ &__user-container {
58
+ background-color: var(--pkt-color-background-default);
59
+ height: map.get(variables.$spacing, 'size-56');
60
+ width: 100%;
61
+ }
62
+
63
+ &__user-button {
64
+ &:is(button),
65
+ & button {
66
+ height: 100%;
67
+ padding: 0 map.get(variables.$spacing, 'size-24');
68
+ width: 100%;
69
+ max-width: 100%;
70
+ border: none;
71
+ border-top: 1px solid var(--pkt-color-border-subtle, #f2f2f2);
72
+ border-bottom: 1px solid var(--pkt-color-border-subtle, #f2f2f2);
73
+ }
74
+ &:not(button) {
75
+ display: contents;
76
+ }
77
+ }
78
+
79
+ &__user-menu {
80
+ max-width: 100%;
81
+ position: unset;
82
+ }
83
+
84
+ &__slot-content {
85
+ display: none;
86
+ }
87
+
88
+ &__slot-container.is-open {
89
+ .pkt-header-service__slot-content {
90
+ position: absolute;
91
+ top: map.get(variables.$spacing, 'size-64');
92
+ left: 0;
93
+ right: 0;
94
+ max-width: 100vw;
95
+
96
+ @include bp('laptop-up') {
97
+ top: map.get(variables.$spacing, 'size-72');
98
+ }
99
+ }
100
+ }
101
+
102
+ &__search-container {
103
+ &.is-open {
104
+ .pkt-header-service__mobile-menu {
105
+ position: absolute;
106
+ top: map.get(variables.$spacing, 'size-64');
107
+ left: 0;
108
+ right: 0;
109
+
110
+ @include bp('laptop-up') {
111
+ top: map.get(variables.$spacing, 'size-72');
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ &__search-input {
118
+ padding: 1rem;
119
+ }
120
+ }
121
+ }
122
+
123
+ .pkt-header-service.pkt-header-service--mobile,
124
+ .pkt-header-service.pkt-header-service--tablet {
125
+ .pkt-header-service {
126
+ &__slot-container.is-open .pkt-header-service__slot-content,
127
+ &__search-container.is-open .pkt-header-service__mobile-menu,
128
+ &__mobile-menu.is-open {
129
+ background-color: var(--pkt-color-background-default);
130
+ z-index: 100;
131
+ border-top: 1px solid var(--pkt-color-border-subtle, #f2f2f2);
132
+ border-bottom: 1px solid var(--pkt-color-border-subtle, #f2f2f2);
133
+
134
+ &::after {
135
+ content: '';
136
+ position: absolute;
137
+ bottom: 0;
138
+ left: 0;
139
+ right: 0;
140
+ height: 1.25rem;
141
+ pointer-events: none;
142
+ background: linear-gradient(to top, transparent, rgba(0, 0, 0, 0.06));
143
+ transform: translateY(100%);
144
+ z-index: 101;
145
+ }
146
+ }
147
+
148
+ &__slot-container.is-open .pkt-header-service__slot-content {
149
+ height: max-content;
150
+ max-height: calc(100dvh - var(--pkt-header-height));
151
+ overflow: visible;
152
+
153
+ &,
154
+ & > .pkt-contents {
155
+ display: flex;
156
+ flex-direction: column;
157
+ align-items: stretch;
158
+ &,
159
+ > ul {
160
+ margin-left: 0;
161
+ gap: map.get(variables.$spacing, 'size-24');
162
+ > * {
163
+ margin-left: 0;
164
+ }
165
+ }
166
+ }
167
+ .pkt-contents {
168
+ padding: 2rem;
169
+ overflow-y: auto;
170
+ -webkit-overflow-scrolling: touch;
171
+ }
172
+ }
173
+ }
174
+ }
175
+
176
+ .pkt-header-service.pkt-header-service--tablet:not(.pkt-header-service--mobile) {
177
+ .pkt-header-service {
178
+ &__slot-content {
179
+ display: none;
180
+ }
181
+
182
+ &__slot-container,
183
+ &__search-container {
184
+ position: relative;
185
+
186
+ &.is-open {
187
+ .pkt-header-service__slot-content,
188
+ .pkt-header-service__mobile-menu {
189
+ display: block;
190
+ position: absolute;
191
+ top: 100%;
192
+ left: 0;
193
+ min-width: 19rem;
194
+ width: fit-content;
195
+ max-width: 100%;
196
+ right: auto;
197
+ border: 2px solid var(--pkt-color-border-subtle);
198
+
199
+ &.align-right {
200
+ left: auto;
201
+ right: 0;
202
+ }
203
+ }
204
+ }
205
+ }
206
+
207
+ &__search-input {
208
+ padding: 1rem;
209
+ }
210
+ }
211
+ }
@@ -0,0 +1,378 @@
1
+ /*
2
+ * HeaderService component
3
+ * Uses container queries with media query fallback for responsive behavior
4
+ */
5
+
6
+ @use 'sass:map';
7
+ @use '../abstracts/variables';
8
+ @use '../abstracts/mixins/breakpoints' as *;
9
+ @use '../abstracts/mixins/container-queries' as *;
10
+ @use '../abstracts/mixins/' as *;
11
+
12
+ @mixin header-cq($min-width) {
13
+ @include cq('header-service', $min-width) {
14
+ @content;
15
+ }
16
+ }
17
+
18
+ .pkt-header-service-spacer {
19
+ height: 80px;
20
+
21
+ @include header-cq($cq-bp-tablet) {
22
+ height: map.get(variables.$spacing, 'size-88');
23
+ }
24
+
25
+ @include header-cq($cq-bp-laptop) {
26
+ height: map.get(variables.$spacing, 'size-104');
27
+ }
28
+
29
+ &--mobile {
30
+ height: 80px;
31
+ }
32
+
33
+ &--has-user {
34
+ height: 128px;
35
+
36
+ @include header-cq($cq-bp-tablet) {
37
+ height: map.get(variables.$spacing, 'size-88');
38
+ }
39
+
40
+ @include header-cq($cq-bp-laptop) {
41
+ height: map.get(variables.$spacing, 'size-104');
42
+ }
43
+
44
+ &.pkt-header-service-spacer--mobile {
45
+ height: 128px;
46
+ }
47
+ }
48
+
49
+ &--compact {
50
+ height: map.get(variables.$spacing, 'size-64');
51
+
52
+ @include header-cq($cq-bp-tablet) {
53
+ height: map.get(variables.$spacing, 'size-64');
54
+ }
55
+
56
+ @include header-cq($cq-bp-laptop) {
57
+ height: map.get(variables.$spacing, 'size-72');
58
+ }
59
+
60
+ &.pkt-header-service-spacer--mobile {
61
+ height: map.get(variables.$spacing, 'size-64');
62
+ }
63
+ }
64
+
65
+ &--compact#{&}--has-user {
66
+ height: 104px;
67
+
68
+ @include header-cq($cq-bp-tablet) {
69
+ height: map.get(variables.$spacing, 'size-64');
70
+ }
71
+
72
+ @include header-cq($cq-bp-laptop) {
73
+ height: map.get(variables.$spacing, 'size-72');
74
+ }
75
+
76
+ &.pkt-header-service-spacer--mobile {
77
+ height: 104px;
78
+ }
79
+ }
80
+ }
81
+
82
+ .pkt-header-service {
83
+ --pkt-header-height: #{map.get(variables.$spacing, 'size-72')};
84
+
85
+ position: relative;
86
+
87
+ @include header-cq($cq-bp-tablet) {
88
+ --pkt-header-height: #{map.get(variables.$spacing, 'size-88')};
89
+ }
90
+
91
+ @include header-cq($cq-bp-laptop) {
92
+ --pkt-header-height: #{map.get(variables.$spacing, 'size-104')};
93
+ }
94
+
95
+ &--compact {
96
+ --pkt-header-height: #{map.get(variables.$spacing, 'size-64')};
97
+
98
+ @include header-cq($cq-bp-laptop) {
99
+ --pkt-header-height: #{map.get(variables.$spacing, 'size-72')};
100
+ }
101
+ }
102
+
103
+ &--mobile {
104
+ --pkt-header-height: #{map.get(variables.$spacing, 'size-64')};
105
+
106
+ @include bp('laptop-up') {
107
+ --pkt-header-height: #{map.get(variables.$spacing, 'size-72')};
108
+ }
109
+ }
110
+
111
+ background-color: var(--pkt-color-background-default);
112
+ container-type: inline-size;
113
+ container-name: header-service;
114
+ display: grid;
115
+ align-items: center;
116
+ grid-template-columns: 1fr auto auto;
117
+ grid-template-rows: map.get(variables.$spacing, 'size-72') auto;
118
+ column-gap: map.get(variables.$spacing, 'size-16');
119
+
120
+ @include header-cq($cq-bp-tablet) {
121
+ grid-template-rows: map.get(variables.$spacing, 'size-88') auto;
122
+ column-gap: map.get(variables.$spacing, 'size-24');
123
+ }
124
+
125
+ @include header-cq($cq-bp-laptop) {
126
+ grid-template-rows: map.get(variables.$spacing, 'size-104') auto;
127
+ column-gap: map.get(variables.$spacing, 'size-32');
128
+ }
129
+
130
+ &--compact {
131
+ grid-template-rows: map.get(variables.$spacing, 'size-72') auto;
132
+ }
133
+
134
+ &--fixed {
135
+ width: 100vw;
136
+ position: fixed;
137
+ top: 0;
138
+ left: 0;
139
+ z-index: 10;
140
+ }
141
+
142
+ &--scroll-to-hide {
143
+ transform: translate3d(0, 0, 0);
144
+ transition: 0.5s transform ease-in-out;
145
+ }
146
+
147
+ &--hidden {
148
+ transform: translate3d(0, -100%, 0);
149
+ }
150
+
151
+ &__logo-area,
152
+ &__content,
153
+ &__user {
154
+ display: inline-flex;
155
+ column-gap: map.get(variables.$spacing, 'size-24');
156
+ min-width: 0;
157
+
158
+ @include header-cq($cq-bp-laptop) {
159
+ column-gap: map.get(variables.$spacing, 'size-32');
160
+ }
161
+ }
162
+
163
+ &__logo-area {
164
+ grid-column: 1;
165
+ grid-row: 1;
166
+ align-items: center;
167
+ display: inline-flex;
168
+ padding-left: map.get(variables.$spacing, 'size-16');
169
+
170
+ @include header-cq($cq-bp-laptop) {
171
+ padding-left: map.get(variables.$spacing, 'size-32');
172
+ }
173
+ }
174
+
175
+ &__content,
176
+ &__user {
177
+ grid-row: 1;
178
+ align-items: center;
179
+
180
+ .pkt-header-service__user-button .pkt-btn__text {
181
+ min-width: 0;
182
+ overflow: hidden;
183
+ text-overflow: ellipsis;
184
+ white-space: nowrap;
185
+ }
186
+
187
+ .pkt-link {
188
+ @include get-text('pkt-txt-18-medium');
189
+ }
190
+ }
191
+
192
+ &__content {
193
+ grid-column: 2;
194
+ }
195
+
196
+ &__user {
197
+ grid-column: 3;
198
+ justify-self: end;
199
+ padding-right: map.get(variables.$spacing, 'size-16');
200
+
201
+ @include header-cq($cq-bp-laptop) {
202
+ padding-right: map.get(variables.$spacing, 'size-32');
203
+ }
204
+ }
205
+
206
+ &__logo {
207
+ --fg-color: var(--pkt-color-text-body-default);
208
+ flex: 0 0 auto;
209
+ display: flex;
210
+ align-items: center;
211
+ gap: 0.5rem;
212
+
213
+ a,
214
+ button {
215
+ display: flex;
216
+ align-items: center;
217
+ }
218
+
219
+ svg {
220
+ height: map.get(variables.$spacing, 'size-40');
221
+ .pkt-header-service__logo-area--without-service & {
222
+ height: map.get(variables.$spacing, 'size-64');
223
+ }
224
+ }
225
+ }
226
+
227
+ &__service-name {
228
+ @include get-text('pkt-txt-22-medium');
229
+
230
+ padding-top: 4px;
231
+ white-space: normal;
232
+ display: -webkit-box;
233
+ -webkit-box-orient: vertical;
234
+ -webkit-line-clamp: 2;
235
+ overflow: hidden;
236
+ text-overflow: ellipsis;
237
+ min-width: 0;
238
+
239
+ text-wrap: balance;
240
+ }
241
+
242
+ &__service-link {
243
+ color: var(--pkt-color-text-body-default);
244
+
245
+ .pkt-link {
246
+ text-decoration: none;
247
+ }
248
+ }
249
+
250
+ .pkt-link {
251
+ text-decoration: none;
252
+
253
+ &--active {
254
+ text-decoration: underline;
255
+ text-underline-position: from-font;
256
+ }
257
+
258
+ &:active {
259
+ text-decoration: underline;
260
+ text-underline-position: from-font;
261
+ }
262
+
263
+ &:hover {
264
+ text-decoration: underline;
265
+ text-underline-position: from-font;
266
+ }
267
+
268
+ &.pkt-header-service--mobile {
269
+ @include get-text('pkt-txt-16-medium');
270
+ }
271
+ }
272
+
273
+ &__search-input {
274
+ background-color: var(--pkt-color-background-default);
275
+ .pkt-input-icon:not(button) svg {
276
+ margin-left: 0;
277
+ }
278
+ }
279
+
280
+ &__slot-container,
281
+ &__search-container {
282
+ display: flex;
283
+ flex-direction: row;
284
+ align-items: baseline;
285
+ }
286
+
287
+ &__slot-container,
288
+ &__slot-container .pkt-contents {
289
+ display: flex;
290
+ flex-direction: row;
291
+ align-items: center;
292
+ > * + * {
293
+ margin-left: map.get(variables.$spacing, 'size-32');
294
+ }
295
+
296
+ > .pkt-link + .pkt-link,
297
+ > pkt-link + pkt-link,
298
+ > a + a {
299
+ margin-left: map.get(variables.$spacing, 'size-24');
300
+ }
301
+ }
302
+
303
+ &__user-container,
304
+ &__search-container,
305
+ &__slot-container,
306
+ &__user-menu,
307
+ &__mobile-menu {
308
+ &.is-open {
309
+ z-index: 100;
310
+ }
311
+ }
312
+
313
+ &__user-container {
314
+ position: relative;
315
+ }
316
+
317
+ &__user-button {
318
+ max-width: 28.5rem;
319
+
320
+ .pkt-btn__text {
321
+ overflow: hidden;
322
+ text-overflow: ellipsis;
323
+ white-space: nowrap;
324
+ min-width: 0;
325
+ flex: 1 1 auto;
326
+ }
327
+ }
328
+
329
+ &__user-menu,
330
+ &__slot-menu {
331
+ position: absolute;
332
+ right: 0;
333
+ width: max(15.5rem, 100%);
334
+ max-width: min(32rem, 90vw);
335
+ }
336
+
337
+ &__logout-button {
338
+ flex: 0 0 auto;
339
+ }
340
+
341
+ &__mobile-menu-container {
342
+ grid-column: 1 / -1;
343
+ grid-row: 2;
344
+ }
345
+
346
+ &__mobile-menu {
347
+ overflow: hidden;
348
+ max-height: 0;
349
+ opacity: 0;
350
+ transform: translateY(-6px);
351
+ transition:
352
+ max-height 200ms ease,
353
+ opacity 150ms ease,
354
+ transform 200ms ease;
355
+ will-change: max-height, transform;
356
+ pointer-events: none;
357
+ }
358
+
359
+ &__mobile-menu.is-open {
360
+ max-height: calc(100dvh - var(--pkt-header-height) - #{map.get(variables.$spacing, 'size-56')});
361
+ opacity: 1;
362
+ overflow: visible;
363
+ pointer-events: auto;
364
+ transform: translateY(0);
365
+ > * {
366
+ max-height: calc(100dvh - var(--pkt-header-height) - #{map.get(variables.$spacing, 'size-56')});
367
+ overflow-y: auto;
368
+ -webkit-overflow-scrolling: touch;
369
+ }
370
+ }
371
+
372
+ @media (prefers-reduced-motion: reduce) {
373
+ &__mobile-menu {
374
+ transition: none;
375
+ transform: none;
376
+ }
377
+ }
378
+ }