@oslokommune/punkt-css 11.12.3 → 11.13.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.
@@ -6,7 +6,7 @@
6
6
  @forward 'spacing';
7
7
 
8
8
  // Default icon path
9
- $icon-path: 'https://punkt-cdn.oslo.kommune.no/11.12/icons' !default;
9
+ $icon-path: 'https://punkt-cdn.oslo.kommune.no/11.13/icons' !default;
10
10
 
11
11
  // Borders
12
12
  $border-width: (
@@ -1,84 +1,149 @@
1
- /*
1
+ /*
2
2
  * Table elements
3
3
  */
4
4
 
5
5
  @use 'sass:map';
6
6
  @use '../abstracts/variables';
7
-
8
- $-borderRadius: 2px;
9
- $-boxShadow: 0 1px 3px rgba(map.get(variables.$pkt-colors, 'brand-dark-blue-1000'), 0.25);
10
-
11
- $-defaultColor: map.get(variables.$pkt-colors, 'brand-neutrals-200');
12
- $-infoColor: map.get(variables.$pkt-colors, 'brand-yellow-1000');
13
- $-successColor: map.get(variables.$pkt-colors, 'brand-light-green-1000');
14
- $-strongColor: map.get(variables.$pkt-colors, 'brand-dark-blue-1000');
7
+ @use '../abstracts/mixins/typography';
8
+ @use '../abstracts/mixins/breakpoints' as *;
9
+ @use '../abstracts/' as *;
10
+ $-borderRadius: map.get(variables.$border-radius, 'size-4');
11
+ $-spacing-size-8: map.get(variables.$spacing, 'size-8');
12
+ $-spacing-size-12: map.get(variables.$spacing, 'size-12');
13
+ $-spacing-size-16: map.get(variables.$spacing, 'size-16');
15
14
 
16
15
  .pkt-table {
17
16
  width: 100%;
18
- font-size: map.get(variables.$font-size, 'size-14');
19
17
  border-radius: $-borderRadius;
20
18
  border-collapse: collapse;
21
19
 
22
- &__th {
23
- color: black;
24
- font-weight: 500;
20
+ &__header,
21
+ thead {
25
22
  text-align: left;
26
- background: $-defaultColor;
27
- border-bottom: 1px solid $-defaultColor;
23
+ vertical-align: top;
24
+ font-size: map.get(variables.$font-size, 'size-18');
25
+ font-weight: map.get(variables.$font-weight, 'medium');
26
+ }
28
27
 
29
- &:first-child {
30
- border-top-left-radius: $-borderRadius;
28
+ &__body,
29
+ tbody {
30
+ text-align: left;
31
+ vertical-align: top;
32
+ font-size: map.get(variables.$font-size, 'size-16');
33
+ font-weight: map.get(variables.$font-weight, 'light');
34
+
35
+ .pkt-table__row:hover {
36
+ & > .pkt-table__data-cell {
37
+ background: rgba(map.get(variables.$pkt-colors, 'brand-dark-blue-1000'), 0.01);
38
+ }
31
39
  }
40
+ }
32
41
 
33
- &:last-child {
34
- border-top-right-radius: $-borderRadius;
35
- }
42
+ &__header-cell,
43
+ th {
44
+ padding: $-spacing-size-16;
45
+ border-bottom: none;
36
46
  }
37
47
 
38
- th,
48
+ &__data-cell,
39
49
  td {
40
- padding: 0.5rem;
41
- text-align: left;
42
- border-bottom: 1px solid $-defaultColor;
50
+ padding: $-spacing-size-16;
51
+ border-bottom: none;
43
52
  }
53
+ }
44
54
 
45
- td.strong {
46
- border-top: 1px solid $-defaultColor;
47
- font-weight: 500;
48
- }
55
+ // To be used when the table contains several elements, such as Tags
56
+ .pkt-table__cell-wrapper {
57
+ text-align: left;
58
+ vertical-align: top;
59
+ display: inline-flex;
60
+ gap: $-spacing-size-8;
61
+ }
49
62
 
50
- tbody tr:hover {
51
- &>td {
52
- background: rgba(map.get(variables.$pkt-colors, 'brand-dark-blue-1000'), 0.02);
53
- }
54
- }
63
+ /**
64
+ * Compact table
65
+ */
55
66
 
56
- &--info .pkt-table__th {
57
- background: rgba($-infoColor, 0.25);
58
- border-bottom: 1px solid $-infoColor;
67
+ .pkt-table.pkt-table--compact {
68
+ .pkt-table__header-cell,
69
+ th {
70
+ padding: $-spacing-size-8 $-spacing-size-16;
59
71
  }
72
+ }
60
73
 
61
- &--success .pkt-table__th {
62
- background: rgba($-successColor, 0.25);
63
- border-bottom: 1px solid $-successColor;
74
+ /**
75
+ * Skin: basic
76
+ */
77
+ .pkt-table.pkt-table--basic {
78
+ .pkt-table__row,
79
+ tr {
80
+ border-bottom: 2px solid var(--pkt-color-surface-strong-gray);
64
81
  }
82
+ }
65
83
 
66
- &--strong .pkt-table__th {
67
- background: rgba($-strongColor, 0.25);
68
- border-bottom: 1px solid $-strongColor;
84
+ /**
85
+ * Skin: zebra blue
86
+ */
87
+ .pkt-table.pkt-table--zebra-blue {
88
+ .pkt-table__body,
89
+ tbody {
90
+ .pkt-table__row:nth-child(odd),
91
+ tr:nth-child(odd) {
92
+ background: var(--pkt-color-surface-subtle-pale-blue);
93
+ }
69
94
  }
95
+ }
70
96
 
71
- &--shadow {
72
- background: white;
73
- box-shadow: $-boxShadow;
97
+ /**
98
+ * Responsive Mobile view if class is set
99
+ */
74
100
 
75
- &>tbody tr:last-of-type td {
76
- border-bottom: none;
101
+ @media screen and (max-width: map.get(variables.$breakpoints, 'tablet')) {
102
+ .pkt-table.pkt-table--responsive {
103
+ .pkt-table {
104
+ &__row,
105
+ tr {
106
+ display: grid;
107
+ grid-template-columns: max-content 1fr;
108
+ gap: $-spacing-size-16;
109
+ padding: $-spacing-size-16 $-spacing-size-16;
110
+
111
+ .pkt-table__header-cell,
112
+ th {
113
+ display: none;
114
+ }
115
+ }
116
+
117
+ &__cell-wrapper {
118
+ grid-column: 2/3;
119
+ }
120
+
121
+ &__data-cell,
122
+ td {
123
+ padding: $-spacing-size-8 $-spacing-size-16;
124
+ display: contents;
125
+
126
+ &::before {
127
+ grid-column: 1/2;
128
+ content: attr(data-label);
129
+ font-weight: map.get(variables.$font-weight, 'medium');
130
+ }
131
+ }
132
+
133
+ &__compact {
134
+ .pkt-table__row,
135
+ tr {
136
+ padding: $-spacing-size-8 $-spacing-size-8;
137
+ gap: $-spacing-size-8;
138
+ }
139
+ }
140
+
141
+ &__zebra-blue {
142
+ .pkt-table__row:nth-child(odd),
143
+ tr:nth-child(odd) {
144
+ background: var(--pkt-color-surface-subtle-pale-blue);
145
+ }
146
+ }
77
147
  }
78
148
  }
79
149
  }
80
-
81
- .pkt-table-container {
82
- margin: 1rem 0;
83
- overflow-x: auto;
84
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "11.12.3",
3
+ "version": "11.13.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",
@@ -55,5 +55,5 @@
55
55
  "url": "https://github.com/oslokommune/punkt/issues"
56
56
  },
57
57
  "license": "MIT",
58
- "gitHead": "3d1c0ec4fee5ae98b0e26d1068b76faec73406b0"
58
+ "gitHead": "50259618f1329f0e1c61286f14a37f8c352f8a97"
59
59
  }