@oslokommune/punkt-css 5.1.19 → 5.2.1

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 (34) hide show
  1. package/CHANGELOG.md +91 -0
  2. package/dist/css/components/alert.css +3 -3
  3. package/dist/css/components/alert.min.css +1 -1
  4. package/dist/css/components/backlink.css +1 -1
  5. package/dist/css/components/backlink.min.css +1 -1
  6. package/dist/css/components/footer.css +3 -3
  7. package/dist/css/components/footer.min.css +1 -1
  8. package/dist/css/components/header.css +4 -4
  9. package/dist/css/components/header.min.css +1 -1
  10. package/dist/css/components/linkcard.css +2 -2
  11. package/dist/css/components/linkcard.min.css +1 -1
  12. package/dist/css/components/messagebox.css +2 -2
  13. package/dist/css/components/messagebox.min.css +1 -1
  14. package/dist/css/components/tag.css +4 -4
  15. package/dist/css/components/tag.min.css +1 -1
  16. package/dist/css/components/textinput.css +304 -0
  17. package/dist/css/components/textinput.min.css +1 -0
  18. package/dist/css/pkt-base.css +2 -2
  19. package/dist/css/pkt-base.min.css +1 -1
  20. package/dist/css/pkt-components.css +324 -19
  21. package/dist/css/pkt-components.min.css +1 -1
  22. package/dist/css/pkt-elements.css +8 -5
  23. package/dist/css/pkt-elements.min.css +1 -1
  24. package/dist/css/pkt.css +334 -26
  25. package/dist/css/pkt.min.css +1 -1
  26. package/dist/scss/abstracts/mixins/_typography.scss +12 -21
  27. package/dist/scss/abstracts/variables/_typography.scss +69 -131
  28. package/dist/scss/base/_typography.scss +1 -1
  29. package/dist/scss/components/_index.scss +1 -0
  30. package/dist/scss/components/_textinput.scss +365 -0
  31. package/dist/scss/elements/_checkbox-radio.scss +1 -1
  32. package/dist/scss/elements/_form.scss +3 -0
  33. package/dist/scss/elements/_select.scss +1 -1
  34. package/package.json +2 -2
@@ -0,0 +1,365 @@
1
+ /* textinput */
2
+ @use 'sass:map';
3
+ @use '../abstracts/variables';
4
+ @use '../abstracts/functions';
5
+ @use '../abstracts/mixins/typography';
6
+
7
+ .pkt-textinput {
8
+ &__label {
9
+ @include typography.get-text('pkt-txt-18-medium');
10
+ display: flex;
11
+ flex-direction: column;
12
+ align-items: flex-start;
13
+ gap: map.get(variables.$spacing, 'size-8');
14
+ > h2 {
15
+ font-size: inherit;
16
+ font-weight: inherit;
17
+ letter-spacing: inherit;
18
+ line-height: inherit;
19
+ display: inline;
20
+ margin-bottom: 0;
21
+ }
22
+ }
23
+
24
+ &__helptext {
25
+ display: flex;
26
+ flex-direction: column;
27
+ align-items: flex-start;
28
+ gap: map.get(variables.$spacing, 'size-4');
29
+ @include typography.get-text('pkt-txt-14-light');
30
+
31
+ &-expandable {
32
+ display: inline-flex;
33
+ text-align: left;
34
+ align-items: center;
35
+
36
+ &-heading {
37
+ @include typography.get-text('pkt-txt-18-medium');
38
+ margin: 0;
39
+ }
40
+
41
+ &-open {
42
+ width: 100%;
43
+ display: block;
44
+ }
45
+
46
+ &-closed {
47
+ display: none;
48
+ }
49
+ }
50
+ }
51
+
52
+ &__input {
53
+ @include typography.get-text('pkt-txt-18-light');
54
+ display: flex;
55
+ align-items: center;
56
+ appearance: none; // Fix appearance on date inputs in Safari
57
+ background-color: var(--color-white);
58
+ border: 2px solid var(--color-blue-dark);
59
+ border-radius: 0;
60
+ color: var(--color-blue-dark);
61
+ margin: 0;
62
+ padding: 0.5rem 1rem;
63
+ width: 100%;
64
+
65
+ // 1. Override Firefox's default opacity
66
+ &::placeholder {
67
+ color: var(--color-grayscale-50);
68
+ opacity: 1; // 1
69
+ }
70
+
71
+ // states
72
+ &:hover,
73
+ &.pkt-textinput__textinput--hover {
74
+ border-color: var(--color-hover);
75
+ }
76
+
77
+ &:focus-visible + .pkt-textinput-suffix,
78
+ &.pkt-textinput__textinput--focus {
79
+ box-shadow: 0 0 0 2px var(--color-active);
80
+ border-color: var(--color-active);
81
+ }
82
+
83
+ &:focus {
84
+ outline: none;
85
+ box-shadow: 0 0 0 2px var(--color-active);
86
+ border-color: var(--color-active);
87
+ }
88
+
89
+ &:disabled,
90
+ &:disabled::placeholder,
91
+ &[readonly] {
92
+ background-color: var(--color-disabled-light);
93
+ border-color: var(--color-disabled);
94
+ cursor: inherit;
95
+ }
96
+
97
+ &:disabled:active {
98
+ border: 2px solid var(--color-disabled);
99
+ }
100
+
101
+ &-prefix-wrapper {
102
+ display: flex;
103
+ align-items: center;
104
+ align-self: stretch;
105
+
106
+ :not(:first-child) {
107
+ border-left: none;
108
+ }
109
+
110
+ :first-child {
111
+ border-right: none;
112
+ }
113
+
114
+ //states
115
+ & input:focus {
116
+ box-shadow: none;
117
+ }
118
+
119
+ &:hover .pkt-textinput__input,
120
+ &:hover .pkt-textinput__input-prefix {
121
+ border-color: var(--color-hover);
122
+ }
123
+
124
+ &:focus-within {
125
+ outline: 2px solid var(--color-active);
126
+ }
127
+
128
+ &:focus-within .pkt-textinput__input,
129
+ &:focus-within .pkt-textinput__input-prefix {
130
+ border-color: var(--color-active);
131
+ }
132
+ }
133
+
134
+ &-prefix {
135
+ @include typography.get-text('pkt-txt-18-light');
136
+ align-items: center;
137
+ display: flex;
138
+ width: auto;
139
+ height: 3rem;
140
+ border: 2px solid var(--color-blue-dark);
141
+ padding: 0.5rem 0rem 0.5rem 1rem;
142
+
143
+ &::after {
144
+ content: '';
145
+ width: 1px;
146
+ margin-left: 0.5rem;
147
+ height: 100%;
148
+ background-color: var(--color-blue-dark);
149
+ }
150
+ }
151
+
152
+ &-suffix-wrapper {
153
+ display: flex;
154
+ align-items: center;
155
+ align-self: stretch;
156
+
157
+ :not(:first-child) {
158
+ border-left: none;
159
+ }
160
+
161
+ :first-child {
162
+ border-right: none;
163
+ }
164
+
165
+ p {
166
+ margin: 0;
167
+ }
168
+
169
+ //states
170
+ & input:focus {
171
+ box-shadow: none;
172
+ }
173
+
174
+ &:hover .pkt-textinput__input,
175
+ &:hover .pkt-textinput__input-suffix,
176
+ &:hover .pkt-textinput__input-icon {
177
+ border-color: var(--color-hover);
178
+ }
179
+
180
+ &:focus-within {
181
+ outline: 2px solid var(--color-active);
182
+ }
183
+
184
+ &:focus-within .pkt-textinput__input-icon,
185
+ &:focus-within .pkt-textinput__input,
186
+ &:focus-within .pkt-textinput__input-suffix,
187
+ &:focus-within .pkt-textinput__input-icon {
188
+ border-color: var(--color-active);
189
+ }
190
+ }
191
+
192
+ &-suffix {
193
+ @include typography.get-text('pkt-txt-18-light');
194
+ display: flex;
195
+ align-items: center;
196
+ width: auto;
197
+ border: 2px solid var(--color-blue-dark);
198
+ padding: 0.5rem 1rem 0.5rem 0rem;
199
+ flex-shrink: 0;
200
+
201
+ svg {
202
+ width: 1.5rem;
203
+ height: 1.5rem;
204
+ margin-left: 0.5rem;
205
+ }
206
+
207
+ &::before {
208
+ content: '';
209
+ width: 1px;
210
+ margin-right: 0.5rem;
211
+ height: 1.5rem;
212
+ background-color: var(--color-blue-dark);
213
+ }
214
+ }
215
+
216
+ &-icon {
217
+ @include typography.get-text('pkt-txt-18-light');
218
+ display: flex;
219
+ flex-shrink: 0;
220
+ padding: 0.5rem 1rem;
221
+ align-items: center;
222
+ align-self: stretch;
223
+ border: 2px solid var(--color-blue-dark);
224
+
225
+ & svg {
226
+ width: 1.5rem;
227
+ height: 1.5rem;
228
+ margin-left: 0.5rem;
229
+ }
230
+ }
231
+ }
232
+
233
+ // Modifiers
234
+ &--disabled {
235
+ color: var(--color-disabled);
236
+ cursor: inherit;
237
+
238
+ .pkt-tag {
239
+ background-color: var(--color-disabled-light);
240
+ }
241
+
242
+ .pkt-alert {
243
+ background-color: var(--color-disabled-light);
244
+ border-color: var(--color-disabled);
245
+ }
246
+
247
+ .pkt-textinput__input,
248
+ .pkt-textinput__input-prefix,
249
+ .pkt-textinput__input-suffix,
250
+ .pkt-textinput__input-icon {
251
+ border-color: var(--color-disabled);
252
+ background-color: var(--color-disabled-light);
253
+ }
254
+
255
+ .pkt-textinput__input-prefix-wrapper:hover .pkt-textinput__input,
256
+ .pkt-textinput__input-suffix-wrapper:hover .pkt-textinput__input,
257
+ .pkt-textinput__input-prefix-wrapper:hover .pkt-textinput__input-prefix,
258
+ .pkt-textinput__input-suffix-wrapper:hover .pkt-textinput__input-suffix,
259
+ .pkt-textinput__input-suffix-wrapper:hover .pkt-textinput__input-icon {
260
+ border-color: var(--color-disabled);
261
+ }
262
+
263
+ .pkt-textinput__input:hover {
264
+ border-color: var(--color-disabled);
265
+ box-shadow: none;
266
+ }
267
+
268
+ .pkt-textinput__input:focus {
269
+ border-color: var(--color-disabled);
270
+ box-shadow: none;
271
+ outline: none;
272
+ }
273
+
274
+ .pkt-textinput__input-suffix-wrapper:active .pkt-textinput__input {
275
+ border-right: none;
276
+ box-shadow: none;
277
+ outline: none;
278
+ }
279
+ }
280
+
281
+ &--error {
282
+ .pkt-textinput__input,
283
+ .pkt-textinput__input-prefix,
284
+ .pkt-textinput__input-suffix,
285
+ .pkt-textinput__input-icon {
286
+ border-color: var(--color-red);
287
+ }
288
+
289
+ .pkt-textinput__input:hover,
290
+ .pkt-textinput__input-prefix-wrapper:hover .pkt-textinput__input,
291
+ .pkt-textinput__input-suffix-wrapper:hover .pkt-textinput__input,
292
+ .pkt-textinput__input-prefix-wrapper:hover .pkt-textinput__input-prefix,
293
+ .pkt-textinput__input-suffix-wrapper:hover .pkt-textinput__input-suffix,
294
+ .pkt-textinput__input-suffix-wrapper:hover .pkt-textinput__input-icon {
295
+ border-color: var(--color-red);
296
+ }
297
+
298
+ .pkt-textinput__input:focus-within,
299
+ .pkt-textinput__input-prefix-wrapper:focus-within
300
+ .pkt-textinput__input-icon,
301
+ .pkt-textinput__input-prefix-wrapper:focus-within .pkt-textinput__input,
302
+ .pkt-textinput__input-prefix-wrapper:focus-within
303
+ .pkt-textinput__input-prefix,
304
+ .pkt-textinput__input-prefix-wrapper:focus-within
305
+ .pkt-textinput__input-icon,
306
+ .pkt-textinput__input-suffix-wrapper:focus-within
307
+ .pkt-textinput__input-icon,
308
+ .pkt-textinput__input-suffix-wrapper:focus-within .pkt-textinput__input,
309
+ .pkt-textinput__input-suffix-wrapper:focus-within
310
+ .pkt-textinput__input-suffix,
311
+ .pkt-textinput__input-suffix-wrapper:focus-within
312
+ .pkt-textinput__input-icon {
313
+ border-color: var(--color-red);
314
+ }
315
+ }
316
+
317
+ &--inline {
318
+ display: inline-block;
319
+ vertical-align: middle;
320
+ margin-right: 8px;
321
+ }
322
+
323
+ // Dark mode
324
+ @at-root [data-mode='dark'] {
325
+ .pkt-textinput__input-prefix,
326
+ .pkt-textinput__input-suffix,
327
+ .pkt-textinput__input-icon {
328
+ background-color: var(--color-white);
329
+ color: var(--color-blue-dark);
330
+ }
331
+ }
332
+
333
+ // Alert
334
+ .pkt-alert {
335
+ width: 100%;
336
+ padding: 0.75rem 1rem 0.75rem calc(8px - 4px);
337
+ margin: 0 0 0.5rem 0;
338
+
339
+ &--error {
340
+ margin: 0.5rem 0 0.5rem 0;
341
+ }
342
+
343
+ &__icon {
344
+ width: 1.375rem;
345
+ height: 1.375rem;
346
+ top: 0.81rem;
347
+ left: 1.25rem;
348
+ }
349
+
350
+ &__text {
351
+ @include typography.get-text('pkt-txt-16-light');
352
+ margin: 0 0 0 2.875rem;
353
+ }
354
+ }
355
+
356
+ // Tag
357
+ .pkt-tag {
358
+ margin-left: 8px;
359
+ }
360
+
361
+ .pkt-btn {
362
+ @include typography.get-text('pkt-txt-14-light');
363
+ padding: 0;
364
+ }
365
+ }
@@ -81,7 +81,7 @@ $-module-name: 'pkt-form-check-input';
81
81
  }
82
82
 
83
83
  &[type='checkbox'] {
84
- --svg: url(https://punkt-cdn.oslo.kommune.no/5.1/icons/check-medium.svg);
84
+ --svg: url(https://punkt-cdn.oslo.kommune.no/5.2/icons/check-medium.svg);
85
85
  position: relative;
86
86
  background-color: blue;
87
87
  }
@@ -36,6 +36,9 @@
36
36
  */
37
37
  &-label {
38
38
  width: 100%;
39
+ > p:first-child {
40
+ display: inline;
41
+ }
39
42
  }
40
43
 
41
44
  &-help {
@@ -10,7 +10,7 @@
10
10
  @use '../abstracts/functions';
11
11
 
12
12
  .pkt-select {
13
- --svg: url(https://punkt-cdn.oslo.kommune.no/5.1/icons/chevron-thin-down.svg);
13
+ --svg: url(https://punkt-cdn.oslo.kommune.no/5.2/icons/chevron-thin-down.svg);
14
14
 
15
15
  display: block;
16
16
  background-color: var(--color-white);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "5.1.19",
3
+ "version": "5.2.1",
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",
@@ -55,5 +55,5 @@
55
55
  "url": "https://github.com/oslokommune/punkt/issues"
56
56
  },
57
57
  "license": "MIT",
58
- "gitHead": "3560fc1d72d67a49cf959925d5691d0fa0f60b02"
58
+ "gitHead": "582b1bb38c470e76cbdb5e0ec2dc98231f674291"
59
59
  }