@oslokommune/punkt-css 11.12.1 → 11.12.8

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.
@@ -3,7 +3,8 @@
3
3
  @use '../abstracts/functions';
4
4
  @use '../abstracts/mixins/typography';
5
5
 
6
- .pkt-calendar {
6
+ .pkt-calendar,
7
+ pkt-el-calendar {
7
8
  max-width: 25rem;
8
9
  .pkt-cal-month-nav {
9
10
  display: flex;
@@ -8,7 +8,7 @@
8
8
  @use '../abstracts/variables';
9
9
 
10
10
  .pkt-icon,
11
- pkt-icon {
11
+ pkt-el-icon {
12
12
  display: inline-flex;
13
13
  min-height: 1rem;
14
14
  min-width: 1rem;
@@ -37,7 +37,7 @@
37
37
  @include typography.get-text('pkt-txt-16');
38
38
  white-space: nowrap;
39
39
  .pkt-icon,
40
- pkt-icon {
40
+ pkt-el-icon {
41
41
  --fg-color: currentColor;
42
42
  }
43
43
  &,
@@ -1,84 +1,166 @@
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;
36
45
  }
37
46
 
38
- th,
47
+ &__data-cell,
39
48
  td {
40
- padding: 0.5rem;
41
- text-align: left;
42
- border-bottom: 1px solid $-defaultColor;
49
+ padding: $-spacing-size-16;
43
50
  }
51
+ }
44
52
 
45
- td.strong {
46
- border-top: 1px solid $-defaultColor;
47
- font-weight: 500;
48
- }
53
+ // To be used when the table contains several elements, such as Tags
54
+ .pkt-table__cell-wrapper {
55
+ text-align: left;
56
+ vertical-align: top;
57
+ display: inline-flex;
58
+ gap: $-spacing-size-8;
59
+ }
49
60
 
50
- tbody tr:hover {
51
- &>td {
52
- background: rgba(map.get(variables.$pkt-colors, 'brand-dark-blue-1000'), 0.02);
53
- }
54
- }
61
+ /**
62
+ * Compact table
63
+ */
55
64
 
56
- &--info .pkt-table__th {
57
- background: rgba($-infoColor, 0.25);
58
- border-bottom: 1px solid $-infoColor;
65
+ .pkt-table.pkt-table--compact {
66
+ .pkt-table__header-cell,
67
+ th {
68
+ padding: $-spacing-size-8 $-spacing-size-16;
59
69
  }
70
+ }
60
71
 
61
- &--success .pkt-table__th {
62
- background: rgba($-successColor, 0.25);
63
- border-bottom: 1px solid $-successColor;
72
+ /**
73
+ * Skin: basic
74
+ */
75
+ .pkt-table.pkt-table--basic {
76
+ .pkt-table__row,
77
+ tr {
78
+ border-bottom: 2px solid var(--pkt-color-surface-strong-gray);
64
79
  }
80
+ }
65
81
 
66
- &--strong .pkt-table__th {
67
- background: rgba($-strongColor, 0.25);
68
- border-bottom: 1px solid $-strongColor;
82
+ /**
83
+ * Skin: zebra-grey
84
+ */
85
+ .pkt-table.pkt-table--zebra-grey {
86
+ .pkt-table__body,
87
+ tbody {
88
+ .pkt-table__row:nth-child(odd),
89
+ tr:nth-child(odd) {
90
+ background: var(--pkt-color-surface-default-gray);
91
+ }
69
92
  }
93
+ }
70
94
 
71
- &--shadow {
72
- background: white;
73
- box-shadow: $-boxShadow;
74
-
75
- &>tbody tr:last-of-type td {
76
- border-bottom: none;
95
+ /**
96
+ * Skin: zebra blue
97
+ */
98
+ .pkt-table.pkt-table--zebra-blue {
99
+ .pkt-table__body,
100
+ tbody {
101
+ .pkt-table__row:nth-child(odd),
102
+ tr:nth-child(odd) {
103
+ background: var(--pkt-color-surface-subtle-pale-blue);
77
104
  }
78
105
  }
79
106
  }
80
107
 
81
- .pkt-table-container {
82
- margin: 1rem 0;
83
- overflow-x: auto;
108
+ /**
109
+ * Responsive Mobile view if class is set
110
+ */
111
+
112
+ @media screen and (max-width: map.get(variables.$breakpoints, 'tablet')) {
113
+ .pkt-table.pkt-table--responsive {
114
+ .pkt-table {
115
+ &__row,
116
+ tr {
117
+ display: grid;
118
+ grid-template-columns: max-content 1fr;
119
+ gap: $-spacing-size-16;
120
+ padding: $-spacing-size-16 $-spacing-size-16;
121
+
122
+ .pkt-table__header-cell,
123
+ th {
124
+ display: none;
125
+ }
126
+ }
127
+
128
+ &__cell-wrapper {
129
+ grid-column: 2/3;
130
+ }
131
+
132
+ &__data-cell,
133
+ td {
134
+ padding: $-spacing-size-8 $-spacing-size-16;
135
+ display: contents;
136
+
137
+ &::before {
138
+ grid-column: 1/2;
139
+ content: attr(data-label);
140
+ font-weight: map.get(variables.$font-weight, 'medium');
141
+ }
142
+ }
143
+
144
+ &__compact {
145
+ .pkt-table__row,
146
+ tr {
147
+ padding: $-spacing-size-8 $-spacing-size-8;
148
+ gap: $-spacing-size-8;
149
+ }
150
+ }
151
+
152
+ &__zebra-grey {
153
+ .pkt-table__row:nth-child(odd),
154
+ tr:nth-child(odd) {
155
+ background: var(--pkt-color-surface-subtle-pale-gray);
156
+ }
157
+ }
158
+ &__zebra-blue {
159
+ .pkt-table__row:nth-child(odd),
160
+ tr:nth-child(odd) {
161
+ background: var(--pkt-color-surface-subtle-pale-blue);
162
+ }
163
+ }
164
+ }
165
+ }
84
166
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "11.12.1",
3
+ "version": "11.12.8",
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": "8546814ef0972d8aeb88791a57e2df10abe8a91a"
58
+ "gitHead": "5e5e6bc584d883a6f35e9008be199d690a1765e9"
59
59
  }