@oslokommune/punkt-css 17.0.10 → 17.1.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 (42) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/css/components/combobox.css +4 -3
  3. package/dist/css/components/combobox.min.css +1 -1
  4. package/dist/css/components/datepicker.css +31 -5
  5. package/dist/css/components/datepicker.min.css +1 -1
  6. package/dist/css/components/fileupload.css +24 -158
  7. package/dist/css/components/fileupload.min.css +1 -1
  8. package/dist/css/components/inputwrapper.css +8 -1
  9. package/dist/css/components/inputwrapper.min.css +1 -1
  10. package/dist/css/components/textarea.css +2 -10
  11. package/dist/css/components/textarea.min.css +1 -1
  12. package/dist/css/components/timepicker.css +54 -132
  13. package/dist/css/components/timepicker.min.css +1 -1
  14. package/dist/css/elements/button.css +0 -6
  15. package/dist/css/elements/button.min.css +1 -1
  16. package/dist/css/elements/checkbox-radio.css +5 -4
  17. package/dist/css/elements/checkbox-radio.min.css +1 -1
  18. package/dist/css/elements/input.css +38 -10
  19. package/dist/css/elements/input.min.css +1 -1
  20. package/dist/css/pkt-base.css +1 -1
  21. package/dist/css/pkt-base.min.css +1 -1
  22. package/dist/css/pkt-components.css +123 -309
  23. package/dist/css/pkt-components.min.css +1 -1
  24. package/dist/css/pkt-docs.css +168 -330
  25. package/dist/css/pkt-docs.min.css +1 -1
  26. package/dist/css/pkt-elements.css +44 -20
  27. package/dist/css/pkt-elements.min.css +1 -1
  28. package/dist/css/pkt.css +168 -330
  29. package/dist/css/pkt.layer.css +157 -327
  30. package/dist/css/pkt.layer.min.css +1 -1
  31. package/dist/css/pkt.min.css +1 -1
  32. package/dist/scss/abstracts/variables/_index.scss +1 -1
  33. package/dist/scss/components/_combobox.scss +5 -2
  34. package/dist/scss/components/_datepicker.scss +30 -5
  35. package/dist/scss/components/_fileupload.scss +9 -3
  36. package/dist/scss/components/_inputwrapper.scss +8 -2
  37. package/dist/scss/components/_textarea.scss +2 -13
  38. package/dist/scss/components/_timepicker.scss +3 -3
  39. package/dist/scss/elements/_button.scss +0 -6
  40. package/dist/scss/elements/_checkbox-radio.scss +2 -1
  41. package/dist/scss/elements/_input.scss +40 -18
  42. 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/17.0/icons' !default;
9
+ $icon-path: 'https://punkt-cdn.oslo.kommune.no/17.1/icons' !default;
10
10
 
11
11
  // Borders
12
12
  $border-width: (
@@ -8,12 +8,15 @@
8
8
  $-box-separator: map.get(variables.$spacing, 'size-8');
9
9
  $-input-spacing: map.get(variables.$spacing, 'size-4');
10
10
 
11
- pkt-combobox,
11
+ pkt-combobox {
12
+ display: block;
13
+ }
14
+
12
15
  .pkt-combobox-component {
13
16
  display: block;
14
17
  max-width: 31rem;
15
18
  width: 100%;
16
- &[fullwidth],
19
+
17
20
  &--fullwidth {
18
21
  max-width: 100%;
19
22
  }
@@ -6,6 +6,10 @@ pkt-datepicker {
6
6
  position: relative;
7
7
  }
8
8
 
9
+ .pkt-datepicker--fullwidth {
10
+ width: 100%;
11
+ }
12
+
9
13
  .pkt-datepicker__tags {
10
14
  button.pkt-tag {
11
15
  margin: 0 0.25rem 0.5rem 0;
@@ -21,12 +25,13 @@ pkt-datepicker-multiple {
21
25
  display: block;
22
26
  }
23
27
 
28
+ .pkt-datepicker__inputs .pkt-input__container:not(:has(.pkt-input--fullwidth)):not(:has(.pkt-datepicker--multiple)) {
29
+ width: fit-content;
30
+ }
31
+
24
32
  .pkt-datepicker__inputs {
25
33
  width: 100%;
26
34
  position: relative;
27
- .pkt-input__container:not(:has(.pkt-input--fullwidth)) {
28
- width: fit-content;
29
- }
30
35
  .pkt-input__container {
31
36
  border: 2px solid var(--pkt-color-input-border-normal);
32
37
  background-color: var(--pkt-color-input-background-normal);
@@ -89,6 +94,8 @@ pkt-datepicker-multiple {
89
94
  .pkt-datepicker__input {
90
95
  padding-inline-end: 0;
91
96
  background-image: none;
97
+ }
98
+ .pkt-datepicker__input:not(.pkt-datepicker--multiple) {
92
99
  width: 8.3rem;
93
100
  }
94
101
  .pkt-input-separator ~ .pkt-datepicker--range {
@@ -110,9 +117,18 @@ pkt-datepicker-multiple {
110
117
  width: 8.3rem;
111
118
  max-width: calc(100% - 3rem);
112
119
  }
113
- .pkt-datepicker__input.pkt-input--fullwidth:not(.pkt-datepicker--multiple) {
120
+ .pkt-datepicker__input.pkt-input--fullwidth:not(.pkt-datepicker--multiple):not(.pkt-datepicker--range) {
114
121
  flex: 1;
115
122
  }
123
+
124
+ .pkt-datepicker__input.pkt-input--fullwidth.pkt-datepicker--range {
125
+ flex: 0 0 auto;
126
+ width: 8.3rem;
127
+ }
128
+
129
+ .pkt-input__container:has(.pkt-datepicker--range.pkt-input--fullwidth) button.pkt-input-icon {
130
+ margin-inline-start: auto;
131
+ }
116
132
  .pkt-datepicker__input::-webkit-inner-spin-button,
117
133
  .pkt-datepicker__input::-webkit-calendar-picker-indicator {
118
134
  display: none;
@@ -167,6 +183,10 @@ pkt-datepicker-multiple {
167
183
  width: $input-width;
168
184
  }
169
185
 
186
+ .pkt-datepicker__input.pkt-input--fullwidth.pkt-datepicker--range {
187
+ width: $input-width;
188
+ }
189
+
170
190
  .pkt-datepicker__input:not(.pkt-datepicker--multiple):not(.pkt-datepicker--range) {
171
191
  max-width: calc(100% - $button-width);
172
192
  }
@@ -191,10 +211,15 @@ pkt-datepicker-multiple {
191
211
  width: auto;
192
212
  max-width: 100%;
193
213
  }
194
- .pkt-datepicker__input.pkt-input--fullwidth:not(.pkt-datepicker--multiple) {
214
+ .pkt-datepicker__input.pkt-input--fullwidth:not(.pkt-datepicker--multiple):not(.pkt-datepicker--range) {
195
215
  width: auto;
196
216
  flex: 1;
197
217
  }
218
+
219
+ .pkt-datepicker__input.pkt-input--fullwidth.pkt-datepicker--range {
220
+ width: auto;
221
+ flex: 0 0 auto;
222
+ }
198
223
  .pkt-input__container:has(.pkt-datepicker__input[type='date']) button.pkt-input-icon {
199
224
  display: none;
200
225
  }
@@ -6,7 +6,14 @@
6
6
 
7
7
  $-module-name: 'pkt-fileupload';
8
8
 
9
- pkt-fileupload,
9
+ pkt-fileupload {
10
+ display: block;
11
+ }
12
+
13
+ .pkt-fileupload-component {
14
+ display: block;
15
+ }
16
+
10
17
  .pkt-fileupload {
11
18
  display: block;
12
19
  width: min(100%, 31rem);
@@ -29,8 +36,7 @@ pkt-fileupload,
29
36
  // COMPONENT MODIFIERS
30
37
  // ============================================
31
38
 
32
- &--full-width,
33
- &[fullwidth] {
39
+ &--full-width {
34
40
  width: 100%;
35
41
 
36
42
  .pkt-fileupload__drop-zone,
@@ -6,6 +6,10 @@
6
6
 
7
7
  pkt-input-wrapper {
8
8
  display: block;
9
+
10
+ &[inline] {
11
+ display: inline-block;
12
+ }
9
13
  }
10
14
  @supports selector(:not(:has(*))) {
11
15
  // Skjul helptext-container hvis den ikke har innhold.
@@ -23,6 +27,8 @@ pkt-input-wrapper {
23
27
  }
24
28
  }
25
29
  .pkt-inputwrapper {
30
+ display: block;
31
+
26
32
  &__label {
27
33
  display: flex;
28
34
  flex-direction: row;
@@ -135,8 +141,9 @@ pkt-input-wrapper {
135
141
 
136
142
  &--inline {
137
143
  display: inline-block;
144
+ width: fit-content;
138
145
  vertical-align: middle;
139
- margin-right: 8px;
146
+ margin-inline-end: 8px;
140
147
  }
141
148
 
142
149
  .pkt-alert {
@@ -144,7 +151,6 @@ pkt-input-wrapper {
144
151
  margin: 0 0 0.5rem 0;
145
152
  }
146
153
 
147
- // Alert — stretch to match field width (fieldset uses align-items: flex-start)
148
154
  &__alert-wrapper {
149
155
  align-self: stretch;
150
156
  max-width: min(100%, 31rem);
@@ -9,22 +9,11 @@
9
9
  @use '../abstracts/variables';
10
10
  @use '../abstracts/mixins/typography';
11
11
 
12
- // Match textinput: cap at 31rem; field fills the wrapper.
13
- // React: .pkt-inputwrapper is the outer box. Elements: pkt-textarea is the flex child and
14
- // shrink-wraps unless capped here — inner .pkt-inputwrapper width: 100% then resolves correctly.
15
- pkt-textarea:not([fullwidth]):has(textarea.pkt-input:not([cols])) {
12
+ :where(.pkt-textarea:has(textarea.pkt-input:not(.pkt-input--fullwidth):not([cols]))) {
16
13
  width: min(31rem, 100%);
17
14
  }
18
15
 
19
- pkt-textarea[fullwidth] {
20
- width: 100%;
21
- }
22
-
23
- .pkt-inputwrapper:has(textarea.pkt-input:not(.pkt-input--fullwidth):not([cols])) {
24
- width: min(31rem, 100%);
25
- }
26
-
27
- .pkt-inputwrapper:has(textarea.pkt-input--fullwidth) {
16
+ .pkt-textarea:has(textarea.pkt-input--fullwidth) {
28
17
  width: 100%;
29
18
  }
30
19
 
@@ -6,7 +6,6 @@ pkt-timepicker {
6
6
  display: block;
7
7
  }
8
8
 
9
- /// Size overrides for small / xsmall. Base .pkt-input__container styles use medium (48px).
10
9
  @mixin timepicker-field-size($min-height, $text-style, $icon-size, $padding-inline: 0.5rem) {
11
10
  .pkt-input__container {
12
11
  min-height: $min-height;
@@ -34,8 +33,7 @@ pkt-timepicker {
34
33
  }
35
34
  }
36
35
 
37
- .pkt-timepicker,
38
- pkt-timepicker {
36
+ .pkt-timepicker {
39
37
  &__anchor {
40
38
  position: relative;
41
39
  }
@@ -155,6 +153,8 @@ pkt-timepicker {
155
153
  }
156
154
 
157
155
  &--fullwidth {
156
+ width: 100%;
157
+
158
158
  .pkt-timepicker__anchor,
159
159
  .pkt-input__container {
160
160
  width: 100%;
@@ -343,12 +343,6 @@ $-skins: (
343
343
  @include -skin($key, map.get($value, 'light'));
344
344
  }
345
345
 
346
- pkt-button[disabled],
347
- pkt-button[data-disabled],
348
- pkt-button[isLoading] {
349
- pointer-events: none;
350
- }
351
-
352
346
  // Selve knappe-klassen
353
347
  .pkt-btn {
354
348
  border-radius: 0;
@@ -55,11 +55,13 @@ $-module-name: 'pkt-input-check';
55
55
  }
56
56
 
57
57
  &[type='checkbox'][role='switch'] {
58
+ transition: all 0.15s ease-in-out;
58
59
  position: relative;
59
60
  height: calc(1.5rem + 2px);
60
61
  width: 2.5rem;
61
62
  border-radius: calc(0.75rem + 2px);
62
63
  &:after {
64
+ transition: all 0.15s ease-in-out;
63
65
  display: block;
64
66
  content: '';
65
67
  border: 2px solid var(--pkt-color-input-check-border);
@@ -92,7 +94,6 @@ $-module-name: 'pkt-input-check';
92
94
 
93
95
  &[type='checkbox']:active:not(:disabled) {
94
96
  --pkt-color-input-check-border: var(--pkt-color-input-border-active);
95
- outline: 6px solid var(--pkt-color-input-border-active);
96
97
  }
97
98
 
98
99
  &[type='checkbox']:focus-visible {
@@ -10,6 +10,26 @@ pkt-select {
10
10
  display: block;
11
11
  }
12
12
 
13
+ .pkt-textinput,
14
+ .pkt-textarea,
15
+ .pkt-select {
16
+ display: block;
17
+
18
+ &:has(> .pkt-inputwrapper--inline) {
19
+ display: inline-block;
20
+ width: fit-content;
21
+ }
22
+ }
23
+
24
+ :where(.pkt-textinput:has(.pkt-input:not(.pkt-input--fullwidth):not([size]):not([cols]))) {
25
+ width: min(31rem, 100%);
26
+ }
27
+
28
+ .pkt-textinput:has(.pkt-input--fullwidth),
29
+ .pkt-select:has(.pkt-input--fullwidth) {
30
+ width: 100%;
31
+ }
32
+
13
33
  .pkt-input {
14
34
  display: flex;
15
35
  align-items: center;
@@ -61,19 +81,25 @@ pkt-select {
61
81
  }
62
82
  }
63
83
 
64
- // Default field width cap (31rem). Exclusions:
65
- // - textarea: width set in _textarea.scss (needs wrapper/host, not this rule)
66
- // - [cols]: native HTML width; browser sizes from character count — do not override
67
- // - input[size]: same escape hatch for text inputs
68
- &:not(:is(textarea)):not(input[size]):not(&--fullwidth):not(.pkt-datepicker__input:not(.pkt-datepicker--multiple)),
69
- &__container:not(:is(:has(.pkt-datepicker__input:not(.pkt-datepicker--multiple)))):not(:is(:has(textarea[cols]))):not(
70
- :is(:has(input[size]))
71
- ):not(:is(:has(&--fullwidth))):not(:is(:has(.pkt-timepicker__input))) {
84
+ &__container {
72
85
  width: min(31rem, 100%);
73
86
  }
74
87
 
75
- &__container:is(:has(.pkt-datepicker__input:not(.pkt-datepicker--multiple))):not(:is(:has(&--fullwidth))) {
88
+ & {
89
+ width: min(31rem, 100%);
90
+ }
91
+
92
+ &:where([size], [cols]) {
93
+ width: auto;
94
+ }
95
+
96
+ &:where(select):not(.pkt-input--fullwidth) {
97
+ width: auto;
98
+ }
99
+
100
+ &__container:where(:has(> :is(input[size], textarea[cols]))) {
76
101
  width: fit-content;
102
+ align-self: flex-start;
77
103
  }
78
104
 
79
105
  &--fullwidth {
@@ -83,9 +109,6 @@ pkt-select {
83
109
  width: 100%;
84
110
  }
85
111
  }
86
- [fullwidth] &__counter {
87
- width: 100%;
88
- }
89
112
 
90
113
  // Med rows-attributt styrer rows høyden alene
91
114
  &:is(textarea:not([rows])) {
@@ -346,11 +369,6 @@ pkt-select {
346
369
  align-items: center;
347
370
  align-self: stretch;
348
371
 
349
- &:is(:has(input[size])),
350
- &:is(:has(textarea[cols])) {
351
- align-self: flex-start;
352
- }
353
-
354
372
  :first-child:not(:only-child) {
355
373
  border-right-width: 0;
356
374
  }
@@ -408,7 +426,7 @@ pkt-select {
408
426
  @include typography.get-text('pkt-txt-14-light');
409
427
 
410
428
  & {
411
- width: min(100%, 31rem);
429
+ width: min(31rem, 100%);
412
430
  text-align: right;
413
431
  }
414
432
 
@@ -451,3 +469,7 @@ pkt-select {
451
469
  }
452
470
  }
453
471
  }
472
+
473
+ .pkt-input__container:where(:has(> .pkt-input--fullwidth)) {
474
+ width: 100%;
475
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "17.0.10",
3
+ "version": "17.1.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",
@@ -62,5 +62,5 @@
62
62
  "dependencies": {
63
63
  "astro": "^7.2.0"
64
64
  },
65
- "gitHead": "d7aa97ec38415ce31bd73314e4669ca2ba04a8cf"
65
+ "gitHead": "20e21ac32f77c4b3981dcabfcace7cd0565c2f7a"
66
66
  }