@oslokommune/punkt-css 12.2.0 → 12.3.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 (36) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +4 -12
  3. package/dist/css/components/calendar.css +106 -75
  4. package/dist/css/components/calendar.min.css +1 -1
  5. package/dist/css/components/card.css +70 -0
  6. package/dist/css/components/card.min.css +1 -0
  7. package/dist/css/components/icon.css +6 -8
  8. package/dist/css/components/icon.min.css +1 -1
  9. package/dist/css/components/preview.css +4 -0
  10. package/dist/css/components/preview.min.css +1 -1
  11. package/dist/css/components/tabs.css +2 -2
  12. package/dist/css/components/tabs.min.css +1 -1
  13. package/dist/css/components/textinput.css +27 -1
  14. package/dist/css/components/textinput.min.css +1 -1
  15. package/dist/css/pkt-base.css +26 -8
  16. package/dist/css/pkt-base.min.css +1 -1
  17. package/dist/css/pkt-components.css +216 -86
  18. package/dist/css/pkt-components.min.css +1 -1
  19. package/dist/css/pkt-elements.css +43 -12
  20. package/dist/css/pkt-elements.min.css +1 -1
  21. package/dist/css/pkt-normalise.css +23 -0
  22. package/dist/css/pkt-normalise.min.css +1 -1
  23. package/dist/css/pkt.css +282 -105
  24. package/dist/css/pkt.min.css +1 -1
  25. package/dist/scss/abstracts/variables/_index.scss +1 -1
  26. package/dist/scss/base/_typography.scss +31 -8
  27. package/dist/scss/components/_calendar.scss +61 -32
  28. package/dist/scss/components/_card.scss +92 -0
  29. package/dist/scss/components/_icon.scss +3 -1
  30. package/dist/scss/components/_index.scss +1 -0
  31. package/dist/scss/components/_preview.scss +4 -0
  32. package/dist/scss/components/_tabs.scss +1 -1
  33. package/dist/scss/elements/_button.scss +11 -4
  34. package/dist/scss/elements/_input.scss +29 -1
  35. package/dist/scss/normalise/_index.scss +24 -0
  36. package/package.json +2 -2
@@ -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.2/icons' !default;
9
+ $icon-path: 'https://punkt-cdn.oslo.kommune.no/12.3/icons' !default;
10
10
 
11
11
  // Borders
12
12
  $border-width: (
@@ -44,6 +44,11 @@ a,
44
44
  word-wrap: break-word;
45
45
  cursor: pointer;
46
46
 
47
+ span {
48
+ color: inherit;
49
+ text-decoration: inherit;
50
+ }
51
+
47
52
  // visited
48
53
  &:visited:not(.pkt-linkcard):not(.pkt-btn):not(.pkt-tabs__link) {
49
54
  color: inherit;
@@ -59,7 +64,8 @@ a,
59
64
  // focus
60
65
  &:focus-visible,
61
66
  &.pkt-link--focus {
62
- box-shadow: 0px 0px 0px 0.125rem var(--pkt-color-text-action-active),
67
+ box-shadow:
68
+ 0px 0px 0px 0.125rem var(--pkt-color-text-action-active),
63
69
  0px 0px 0px 0.375rem var(--pkt-color-border-states-focus);
64
70
  outline: none;
65
71
  color: var(--pkt-color-text-action-active);
@@ -81,26 +87,33 @@ a,
81
87
  .pkt-link {
82
88
  display: inline;
83
89
  text-align: left;
84
- align-items: center;
90
+ align-items: baseline;
91
+ }
85
92
 
93
+ .pkt-link {
86
94
  &__icon {
87
95
  --fg-color: currentColor;
88
96
  width: 1.5rem;
89
97
  height: 1.5rem;
90
98
  flex-shrink: 0;
91
- margin-right: 0.5rem;
99
+ margin-right: 0.25rem;
100
+ margin-left: 0.25rem;
101
+ align-self: center;
92
102
  }
93
103
 
94
- &--icon-left {
104
+ &--icon-left,
105
+ &--icon-right {
95
106
  display: inline-flex;
96
- flex-direction: row;
97
107
  text-decoration: none;
108
+ align-items: baseline;
109
+ }
110
+
111
+ &--icon-left {
112
+ flex-direction: row;
98
113
  }
99
114
 
100
115
  &--icon-right {
101
- display: inline-flex;
102
116
  flex-direction: row-reverse;
103
- text-decoration: none;
104
117
  }
105
118
 
106
119
  &--external::after {
@@ -113,9 +126,11 @@ a,
113
126
  width: 1.125rem;
114
127
  height: 1.125rem;
115
128
  vertical-align: middle;
129
+ align-self: center;
116
130
  }
117
131
 
118
- &--external:hover::after {
132
+ &--external:hover::after,
133
+ &:hover pkt-icon {
119
134
  // #1f42aa
120
135
  filter: brightness(0) saturate(100%) invert(16%) sepia(99%) saturate(2420%) hue-rotate(222deg) brightness(93%)
121
136
  contrast(90%);
@@ -194,3 +209,11 @@ button.pkt-link {
194
209
  .pkt-truncate-text {
195
210
  @include typography.truncate-text();
196
211
  }
212
+
213
+ /*
214
+ * Display contents and disregard layout
215
+ */
216
+ .pkt-display-contents,
217
+ .pkt-contents {
218
+ display: contents;
219
+ }
@@ -4,7 +4,10 @@
4
4
  @use '../abstracts/mixins/typography';
5
5
 
6
6
  .pkt-calendar,
7
- pkt-el-calendar {
7
+ pkt-calendar {
8
+ z-index: 2;
9
+ display: block;
10
+ position: relative;
8
11
  max-width: 25rem;
9
12
  .pkt-cal-month-nav {
10
13
  display: flex;
@@ -28,46 +31,42 @@ pkt-el-calendar {
28
31
 
29
32
  .pkt-cal-month-nav,
30
33
  .pkt-cal-days {
34
+ td {
35
+ border: 0;
36
+ }
31
37
  .pkt-btn,
32
- li {
38
+ td > div {
33
39
  font: inherit;
34
40
  aspect-ratio: 1 / 1;
35
41
  display: flex;
36
42
  justify-content: center;
37
43
  align-items: center;
44
+ border: 0;
38
45
  }
39
46
  .pkt-btn {
40
- margin: 1px;
41
- z-index: 1;
47
+ margin: 0;
42
48
  border-radius: 50%;
43
49
  &:focus,
44
50
  &:active {
45
51
  outline: 0;
46
52
  border: 0;
47
53
  }
48
- &:disabled {
49
- background-color: transparent;
50
- border: 0;
51
- cursor: not-allowed;
52
- }
53
54
  }
54
55
  }
55
56
 
56
57
  .pkt-cal-days {
57
- list-style: none;
58
- display: grid;
59
- grid-template-columns: repeat(7, 14.285%);
60
58
  margin: 0;
61
59
  padding-left: 0;
62
- justify-content: center;
63
- align-items: center;
64
- > li {
60
+ border-spacing: 0;
61
+ td {
62
+ padding: 0;
63
+ }
64
+ div {
65
65
  aspect-ratio: 1 / 1;
66
66
  justify-content: center;
67
67
  align-items: center;
68
68
  position: relative;
69
69
  text-align: center;
70
- z-index: 1;
71
70
  &:before,
72
71
  &:after {
73
72
  content: '';
@@ -75,7 +74,7 @@ pkt-el-calendar {
75
74
  position: absolute;
76
75
  top: 0;
77
76
  bottom: 0;
78
- z-index: 0;
77
+ z-index: -1;
79
78
  }
80
79
  &:before {
81
80
  left: 0;
@@ -92,7 +91,9 @@ pkt-el-calendar {
92
91
  grid-template-columns: repeat(8, 12.5%);
93
92
  }
94
93
 
95
- .pkt-cal-other {
94
+ .pkt-cal-other,
95
+ .pkt-cal-days [data-disabled] {
96
+ cursor: not-allowed;
96
97
  color: var(--pkt-color-grays-gray-200);
97
98
  .pkt-btn {
98
99
  color: inherit;
@@ -102,34 +103,32 @@ pkt-el-calendar {
102
103
  }
103
104
  .pkt-cal-today {
104
105
  .pkt-btn {
105
- z-index: 2;
106
106
  text-decoration: underline;
107
107
  outline: 1px solid var(--pkt-color-border-default);
108
+ outline-offset: -1px;
108
109
  }
109
110
  }
110
111
  .pkt-cal-selected {
111
112
  .pkt-btn,
112
- .pkt-btn:focus {
113
+ .pkt-btn:focus,
114
+ .pkt-btn:hover {
113
115
  background-color: var(--pkt-color-surface-strong-blue);
114
- &:hover {
115
- border-color: var(--pkt-color-surface-strong-blue);
116
- }
117
116
  }
118
117
  }
119
118
  .pkt-cal-in-range {
120
- &:before,
121
- &:after,
122
- &-first:after,
123
- &-last:before {
119
+ :before,
120
+ :after,
121
+ &-first :after,
122
+ &-last :before {
124
123
  background-color: var(--pkt-color-surface-default-light-blue);
125
124
  }
126
- &-first:before,
127
- &-last:after {
125
+ &-first :before,
126
+ &-last :after {
128
127
  background-color: transparent;
129
128
  }
130
129
  }
131
130
  .pkt-cal-range-hover {
132
- &:before,
131
+ :before,
133
132
  .pkt-btn {
134
133
  background-color: var(--pkt-color-surface-default-light-blue);
135
134
  }
@@ -139,9 +138,39 @@ pkt-el-calendar {
139
138
  }
140
139
  .pkt-cal-excluded {
141
140
  background-color: var(--pkt-color-brand-neutrals-100);
142
- &:before,
143
- &:after {
141
+ :before,
142
+ :after {
144
143
  background-color: transparent;
145
144
  }
146
145
  }
147
146
  }
147
+
148
+ pkt-datepicker {
149
+ display: block;
150
+ position: relative;
151
+ .pkt-datepicker {
152
+ position: relative;
153
+ &__tags {
154
+ .pkt-tag {
155
+ margin: 0 0.25rem 0.5rem 0;
156
+ }
157
+ }
158
+ }
159
+ }
160
+ .pkt-datepicker__inputs {
161
+ width: 100%;
162
+ position: relative;
163
+ }
164
+ .pkt-calendar-popup {
165
+ top: 100%;
166
+ left: 0;
167
+ z-index: 2;
168
+ margin: 0;
169
+ padding: 0.5rem;
170
+ position: absolute;
171
+ width: max-content;
172
+ background: var(--pkt-color-background-default);
173
+ box-shadow:
174
+ 0px 2px 4px -2px rgba(0, 0, 0, 0.1),
175
+ 0px 4px 6px -1px rgba(0, 0, 0, 0.1);
176
+ }
@@ -0,0 +1,92 @@
1
+ /*
2
+ * Cardcomponent
3
+ */
4
+ @use 'sass:map';
5
+ @use '../abstracts/variables';
6
+ @use '../abstracts/mixins/breakpoints' as *;
7
+ @use '../abstracts/' as *;
8
+
9
+ .pkt-card {
10
+ padding: map.get(variables.$spacing, 'size-32');
11
+ display: flex;
12
+ gap: 3rem;
13
+
14
+ &__wrapper {
15
+ display: flex;
16
+ flex-direction: column;
17
+ gap: 1rem;
18
+ }
19
+
20
+ &__tags {
21
+ display: flex;
22
+ gap: 1rem;
23
+ }
24
+
25
+ // DIRECTION
26
+ &--landscape {
27
+ flex-direction: row;
28
+ max-width: 950px;
29
+
30
+ .pkt-card__image {
31
+ min-width: 320px;
32
+ overflow: hidden;
33
+ img {
34
+ height: 100%;
35
+ width: 100%;
36
+ object-fit: cover;
37
+ object-position: center;
38
+ }
39
+ }
40
+ }
41
+
42
+ &--portrait {
43
+ flex-direction: column;
44
+ max-width: 500px;
45
+
46
+ .pkt-card__image {
47
+ max-height: 400px;
48
+ overflow: hidden;
49
+ img {
50
+ width: 100%;
51
+ height: 100%;
52
+ object-fit: cover;
53
+ object-position: center;
54
+ }
55
+ }
56
+ }
57
+
58
+ // SKINS
59
+
60
+ &--outlined {
61
+ border: 3px solid var(--pkt-color-grays-gray-100);
62
+ background-color: var(--pkt-color-background-default);
63
+ }
64
+
65
+ &--gray {
66
+ background-color: var(--pkt-color-background-subtle);
67
+ }
68
+
69
+ &--blue {
70
+ background-color: var(--pkt-color-brand-blue-300);
71
+ }
72
+
73
+ &--green {
74
+ background-color: var(--pkt-color-brand-light-green-400);
75
+ }
76
+
77
+ &--beige {
78
+ background-color: var(--pkt-color-brand-light-beige-1000);
79
+ }
80
+
81
+ // Removes auto paddings and margins that comes with these elements so that we can control
82
+ // the gaps between each elements ourseles
83
+ h1,
84
+ h2,
85
+ h3,
86
+ h4,
87
+ h5,
88
+ p {
89
+ padding: 0;
90
+ margin: 0;
91
+ }
92
+ }
@@ -8,7 +8,7 @@
8
8
  @use '../abstracts/variables';
9
9
 
10
10
  .pkt-icon,
11
- pkt-el-icon {
11
+ pkt-icon {
12
12
  display: inline-flex;
13
13
  min-height: 1rem;
14
14
  min-width: 1rem;
@@ -19,7 +19,9 @@ pkt-el-icon {
19
19
  max-height: 100%;
20
20
  max-width: 100%;
21
21
  }
22
+ }
22
23
 
24
+ .pkt-icon {
23
25
  &--small {
24
26
  height: 1rem;
25
27
  width: 1rem;
@@ -4,6 +4,7 @@
4
4
  @forward 'badge';
5
5
  @forward 'breadcrumbs';
6
6
  @forward 'calendar';
7
+ @forward 'card';
7
8
  @forward 'footer';
8
9
  @forward 'header';
9
10
  @forward 'icon';
@@ -72,3 +72,7 @@
72
72
  .astro-code.github-light {
73
73
  background-color: var(--pkt-color-surface-default-gray) !important;
74
74
  }
75
+
76
+ .preview-content {
77
+ display: contents;
78
+ }
@@ -37,7 +37,7 @@
37
37
  @include typography.get-text('pkt-txt-16');
38
38
  white-space: nowrap;
39
39
  .pkt-icon,
40
- pkt-el-icon {
40
+ pkt-icon {
41
41
  --fg-color: currentColor;
42
42
  }
43
43
  &,
@@ -158,7 +158,7 @@ $-skins: (
158
158
  ),
159
159
  );
160
160
 
161
- .pkt-btn__icon > svg {
161
+ .pkt-btn__icon svg {
162
162
  --ring-color: var(--pkt-color-brand-dark-blue-700);
163
163
  --spinner-color: var(--pkt-color-brand-blue-1000);
164
164
 
@@ -184,7 +184,8 @@ $-skins: (
184
184
  line-height: map.get($o, 'line-height');
185
185
  padding: map.get($o, 'padding');
186
186
 
187
- &__icon {
187
+ &__icon,
188
+ &__icon .pkt-icon {
188
189
  height: map.get($o, 'icon-size');
189
190
  margin: map.get($o, 'icon-margin');
190
191
  width: map.get($o, 'icon-size');
@@ -224,7 +225,8 @@ $-skins: (
224
225
  padding: map.get($o, 'padding');
225
226
  }
226
227
 
227
- &--#{$name} &__icon {
228
+ &--#{$name} &__icon,
229
+ &--#{$name} &__icon .pkt-icon {
228
230
  height: map.get($o, 'icon-size');
229
231
  margin: map.get($o, 'icon-margin');
230
232
  width: map.get($o, 'icon-size');
@@ -373,6 +375,7 @@ $-skins: (
373
375
  }
374
376
 
375
377
  @at-root a.#{$-module-name}:focus,
378
+ div.#{$-module-name}:not([data-disabled]):focus,
376
379
  &:enabled:focus,
377
380
  &.#{$-module-name}--focus {
378
381
  background-color: var(--pkt-color-button-background-focus);
@@ -383,6 +386,7 @@ $-skins: (
383
386
  }
384
387
 
385
388
  @at-root a.#{$-module-name}:hover,
389
+ div.#{$-module-name}:not([data-disabled]):hover,
386
390
  &:enabled:hover,
387
391
  &.#{$-module-name}--hover {
388
392
  background-color: var(--pkt-color-button-background-hover);
@@ -393,6 +397,7 @@ $-skins: (
393
397
  }
394
398
 
395
399
  @at-root a.#{$-module-name}:active,
400
+ div.#{$-module-name}:not([data-disabled]):active,
396
401
  &:enabled:active,
397
402
  &.#{$-module-name}--active,
398
403
  &.#{$-module-name}--active:hover {
@@ -403,7 +408,9 @@ $-skins: (
403
408
  text-decoration: none;
404
409
  }
405
410
 
406
- &:disabled {
411
+ &:disabled,
412
+ &[disabled],
413
+ &[data-disabled] {
407
414
  background-color: var(--pkt-color-button-background-disabled);
408
415
  border-color: var(--pkt-color-button-border-disabled);
409
416
  color: var(--pkt-color-button-text-disabled);
@@ -55,6 +55,10 @@
55
55
  margin: 0;
56
56
  padding: 0.5rem 1rem;
57
57
 
58
+ &:not(&-compact) {
59
+ min-height: 3rem;
60
+ }
61
+
58
62
  &-compact#{&} {
59
63
  border: 0;
60
64
  border-bottom: 1px solid var(--pkt-color-input-border-normal);
@@ -93,7 +97,9 @@
93
97
  background-image: var(--svg);
94
98
  background-repeat: no-repeat;
95
99
  background-position: right 0.7rem top 50%;
96
- background-size: 1.5rem auto, 100%;
100
+ background-size:
101
+ 1.5rem auto,
102
+ 100%;
97
103
  }
98
104
 
99
105
  option {
@@ -270,4 +276,26 @@
270
276
  color: var(--pkt-color-input-text-error);
271
277
  }
272
278
  }
279
+
280
+ &__range-inputs {
281
+ container: range / inline-size;
282
+ }
283
+ }
284
+ @container range (width < 30rem) {
285
+ .pkt-input__container {
286
+ border: 2px solid var(--pkt-color-input-border-normal);
287
+ display: grid;
288
+ grid-template-rows: auto auto;
289
+ grid-template-columns: min-content auto 4rem;
290
+ gap: 0;
291
+ > :nth-child(2) {
292
+ grid-column-start: span 2;
293
+ }
294
+ .pkt-input-prefix,
295
+ .pkt-input-suffix,
296
+ .pkt-input-icon,
297
+ .pkt-input {
298
+ border: 0;
299
+ }
300
+ }
273
301
  }
@@ -202,6 +202,30 @@ textarea {
202
202
  height: auto;
203
203
  }
204
204
 
205
+ /**
206
+ * Remove the default appearance of date and time inputs
207
+ */
208
+
209
+ input[type='date'],
210
+ input[type='time'],
211
+ input[type='datetime-local'],
212
+ input[type='month'] {
213
+ -webkit-appearance: textfield;
214
+ }
215
+
216
+ input::-webkit-datetime-edit {
217
+ margin-bottom: -4px;
218
+ }
219
+
220
+ /**
221
+ * Remove the calendar icon in date inputs
222
+ */
223
+ input[type='date']::-webkit-inner-spin-button,
224
+ input[type='date']::-webkit-calendar-picker-indicator {
225
+ display: none;
226
+ -webkit-appearance: none;
227
+ }
228
+
205
229
  /**
206
230
  * 1. Correct the odd appearance in Chrome and Safari.
207
231
  * 2. Correct the outline style in Safari.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "12.2.0",
3
+ "version": "12.3.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": "6eb4f246d43111da9142a7c98526d2d5d7dfda4e"
57
+ "gitHead": "464d3d6b9981108d7a53912cb58e14fc73c9be10"
58
58
  }