@oslokommune/punkt-css 11.10.1 → 11.12.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.
@@ -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.10/icons' !default;
9
+ $icon-path: 'https://punkt-cdn.oslo.kommune.no/11.12/icons' !default;
10
10
 
11
11
  // Borders
12
12
  $border-width: (
@@ -0,0 +1,169 @@
1
+ /*
2
+ * Accordion/Expandable component
3
+ */
4
+
5
+ @use 'sass:map';
6
+ @use '../abstracts/variables';
7
+ @use '../abstracts/mixins/breakpoints' as *;
8
+ @use '../abstracts/' as *;
9
+
10
+ .pkt-accordion {
11
+ display: grid;
12
+ grid-template-columns: 1fr;
13
+ grid-template-rows: 0fr;
14
+ row-gap: map.get(variables.$spacing, 'size-8');
15
+ transition: grid-template-rows 500ms;
16
+
17
+ font-size: map.get(variables.$font-size, 'size-24');
18
+ font-weight: map.get(variables.$font-weight, 'medium');
19
+ letter-spacing: map.get(variables.$letter-spacing, 'tight');
20
+ line-height: map.get(variables.$line-height, 'lh-36');
21
+
22
+ &:focus-visible {
23
+ border: 0.25rem solid var(--pkt-color-border-states-hover);
24
+ }
25
+ }
26
+
27
+ // Skin variations
28
+ .pkt-accordion--borderless {
29
+ .pkt-accordion-item {
30
+ border: none;
31
+
32
+ &[open] {
33
+ .pkt-accordion-item__title {
34
+ box-shadow: inset 0 0 0 0.25rem var(--pkt-color-border-states-active);
35
+ }
36
+ }
37
+ }
38
+ }
39
+
40
+ .pkt-accordion--outlined {
41
+ .pkt-accordion-item {
42
+ border: 3px solid var(--pkt-color-border-gray);
43
+ }
44
+ }
45
+
46
+ .pkt-accordion--beige {
47
+ row-gap: 0;
48
+
49
+ .pkt-accordion-item {
50
+ &:nth-child(odd) {
51
+ background-color: var(--pkt-color-surface-default-light-beige);
52
+ }
53
+ }
54
+ }
55
+
56
+ .pkt-accordion--blue {
57
+ row-gap: 0;
58
+
59
+ .pkt-accordion-item {
60
+ &:nth-child(odd) {
61
+ background-color: var(--pkt-color-surface-default-light-blue);
62
+ }
63
+ }
64
+ }
65
+
66
+ // COMPACT
67
+
68
+ .pkt-accordion--compact.pkt-accordion--borderless {
69
+ .pkt-accordion-item {
70
+ border: none;
71
+
72
+ &--open {
73
+ .pkt-accordion-item__title {
74
+ box-shadow: inset 0 0 0 0.125rem var(--pkt-color-border-states-active);
75
+ }
76
+ }
77
+ }
78
+ }
79
+ .pkt-accordion--compact > .pkt-accordion-item {
80
+ .pkt-accordion-item {
81
+ &__title {
82
+ padding: map.get(variables.$spacing, 'size-16');
83
+ font-size: map.get(variables.$font-size, 'size-16');
84
+ font-weight: map.get(variables.$font-weight, 'medium');
85
+ letter-spacing: map.get(variables.$letter-spacing, 'tight');
86
+ line-height: map.get(variables.$line-height, 'lh-24');
87
+ }
88
+
89
+ &__content {
90
+ padding: map.get(variables.$spacing, 'size-16');
91
+ font-size: map.get(variables.$font-size, 'size-16');
92
+ font-weight: map.get(variables.$font-weight, 'light');
93
+ letter-spacing: map.get(variables.$letter-spacing, 'tight');
94
+ line-height: map.get(variables.$line-height, 'lh-24');
95
+ }
96
+ }
97
+ }
98
+
99
+ // Accordion item
100
+ .pkt-accordion-item {
101
+ color: var(--pkt-color-brand-dark-blue-1000);
102
+ background-color: var(--pkt-color-brand-neutrals-white);
103
+ transition: transform 0.3s;
104
+ appearance: none;
105
+ text-align: left;
106
+
107
+ summary::-webkit-details-marker {
108
+ display: none;
109
+ }
110
+
111
+ &__title {
112
+ align-items: center;
113
+ cursor: pointer;
114
+ display: flex;
115
+ justify-content: space-between;
116
+ padding: map.get(variables.$spacing, 'size-24');
117
+
118
+ &:hover {
119
+ text-decoration: underline;
120
+
121
+ .pkt-accordion-item__icon {
122
+ transform: translateY(0.25rem);
123
+ }
124
+ }
125
+
126
+ &:focus-visible {
127
+ outline: 0.25rem solid var(--pkt-color-border-states-focus);
128
+ }
129
+ }
130
+
131
+ &__icon {
132
+ transition: transform 0.2s;
133
+ }
134
+
135
+ &__content {
136
+ border-top: none;
137
+ display: none;
138
+ font-size: map.get(variables.$font-size, 'size-18');
139
+ font-weight: map.get(variables.$font-weight, 'light');
140
+ letter-spacing: map.get(variables.$letter-spacing, 'tight');
141
+ line-height: map.get(variables.$line-height, 'lh-28');
142
+ padding: map.get(variables.$spacing, 'size-24');
143
+ }
144
+ }
145
+
146
+ // Accordion item when opened
147
+ .pkt-accordion-item[open] {
148
+ .pkt-accordion-item__title {
149
+ border-bottom: none;
150
+ &:hover {
151
+ .pkt-accordion-item__icon {
152
+ transform: rotate(180deg) translateY(0.25rem);
153
+ }
154
+ }
155
+ }
156
+
157
+ .pkt-accordion-item__content {
158
+ display: block;
159
+ }
160
+
161
+ .pkt-accordion-item__icon {
162
+ transform: rotate(180deg) translateY(0);
163
+ }
164
+ }
165
+
166
+ .pkt-icon.pkt-accordion-item__icon > svg {
167
+ min-height: 2rem;
168
+ min-width: 2rem;
169
+ }
@@ -0,0 +1,146 @@
1
+ @use 'sass:map';
2
+ @use '../abstracts/variables';
3
+ @use '../abstracts/functions';
4
+ @use '../abstracts/mixins/typography';
5
+
6
+ .pkt-calendar {
7
+ max-width: 25rem;
8
+ .pkt-cal-month-nav {
9
+ display: flex;
10
+ justify-content: space-between;
11
+ align-items: center;
12
+ margin-bottom: 1rem;
13
+ .pkt-cal-month-picker {
14
+ display: flex;
15
+ gap: 0.5rem;
16
+ .pkt-input {
17
+ @include typography.get-text('pkt-txt-16-medium');
18
+ &:is(select) {
19
+ text-align: right;
20
+ }
21
+ }
22
+ > .pkt-cal-input-year {
23
+ max-width: 4.5rem;
24
+ }
25
+ }
26
+ }
27
+
28
+ .pkt-cal-month-nav,
29
+ .pkt-cal-days {
30
+ .pkt-btn,
31
+ li {
32
+ font: inherit;
33
+ aspect-ratio: 1 / 1;
34
+ display: flex;
35
+ justify-content: center;
36
+ align-items: center;
37
+ }
38
+ .pkt-btn {
39
+ margin: 1px;
40
+ z-index: 1;
41
+ border-radius: 50%;
42
+ &:focus,
43
+ &:active {
44
+ outline: 0;
45
+ border: 0;
46
+ }
47
+ &:disabled {
48
+ background-color: transparent;
49
+ border: 0;
50
+ cursor: not-allowed;
51
+ }
52
+ }
53
+ }
54
+
55
+ .pkt-cal-days {
56
+ list-style: none;
57
+ display: grid;
58
+ grid-template-columns: repeat(7, 14.285%);
59
+ margin: 0;
60
+ padding-left: 0;
61
+ justify-content: center;
62
+ align-items: center;
63
+ > li {
64
+ aspect-ratio: 1 / 1;
65
+ justify-content: center;
66
+ align-items: center;
67
+ position: relative;
68
+ text-align: center;
69
+ z-index: 1;
70
+ &:before,
71
+ &:after {
72
+ content: '';
73
+ display: block;
74
+ position: absolute;
75
+ top: 0;
76
+ bottom: 0;
77
+ z-index: 0;
78
+ }
79
+ &:before {
80
+ left: 0;
81
+ right: 50%;
82
+ }
83
+ &:after {
84
+ left: 50%;
85
+ right: 0;
86
+ }
87
+ }
88
+ }
89
+ &.pkt-cal-weeknumbers .pkt-cal-day-names,
90
+ &.pkt-cal-weeknumbers .pkt-cal-days {
91
+ grid-template-columns: repeat(8, 12.5%);
92
+ }
93
+
94
+ .pkt-cal-other {
95
+ color: var(--pkt-color-grays-gray-200);
96
+ .pkt-btn {
97
+ color: inherit;
98
+ background: transparent;
99
+ border: none;
100
+ }
101
+ }
102
+ .pkt-cal-today {
103
+ .pkt-btn {
104
+ z-index: 2;
105
+ text-decoration: underline;
106
+ outline: 1px solid var(--pkt-color-border-default);
107
+ }
108
+ }
109
+ .pkt-cal-selected {
110
+ .pkt-btn,
111
+ .pkt-btn:focus {
112
+ background-color: var(--pkt-color-surface-strong-blue);
113
+ &:hover {
114
+ border-color: var(--pkt-color-surface-strong-blue);
115
+ }
116
+ }
117
+ }
118
+ .pkt-cal-in-range {
119
+ &:before,
120
+ &:after,
121
+ &-first:after,
122
+ &-last:before {
123
+ background-color: var(--pkt-color-surface-default-light-blue);
124
+ }
125
+ &-first:before,
126
+ &-last:after {
127
+ background-color: transparent;
128
+ }
129
+ }
130
+ .pkt-cal-range-hover {
131
+ &:before,
132
+ .pkt-btn {
133
+ background-color: var(--pkt-color-surface-default-light-blue);
134
+ }
135
+ .pkt-btn {
136
+ border-color: var(--pkt-color-surface-default-light-blue);
137
+ }
138
+ }
139
+ .pkt-cal-excluded {
140
+ background-color: var(--pkt-color-brand-neutrals-100);
141
+ &:before,
142
+ &:after {
143
+ background-color: transparent;
144
+ }
145
+ }
146
+ }
@@ -7,7 +7,8 @@
7
7
  @use 'sass:map';
8
8
  @use '../abstracts/variables';
9
9
 
10
- .pkt-icon {
10
+ .pkt-icon,
11
+ pkt-icon {
11
12
  display: inline-flex;
12
13
  min-height: 1rem;
13
14
  min-width: 1rem;
@@ -1,8 +1,10 @@
1
+ @forward 'accordion';
1
2
  @forward 'alert';
2
3
  @forward 'tag';
3
4
  @forward 'backlink';
4
5
  @forward 'badge';
5
6
  @forward 'breadcrumbs';
7
+ @forward 'calendar';
6
8
  @forward 'footer';
7
9
  @forward 'header';
8
10
  @forward 'icon';
@@ -34,7 +34,8 @@ $-linkcard-spacing-big: map.get(variables.$spacing, 'size-24');
34
34
 
35
35
  &:hover .pkt-link--external {
36
36
  &::after {
37
- filter: brightness(0) saturate(100%) invert(16%) sepia(99%) saturate(2420%) hue-rotate(222deg) brightness(93%) contrast(90%);
37
+ filter: brightness(0) saturate(100%) invert(16%) sepia(99%) saturate(2420%) hue-rotate(222deg) brightness(93%)
38
+ contrast(90%);
38
39
  }
39
40
  }
40
41
 
@@ -42,7 +43,7 @@ $-linkcard-spacing-big: map.get(variables.$spacing, 'size-24');
42
43
  @include get-text('pkt-txt-20-medium');
43
44
  margin-bottom: 0.5rem;
44
45
 
45
- &>p {
46
+ & > p {
46
47
  margin: 0;
47
48
  }
48
49
 
@@ -59,7 +60,8 @@ $-linkcard-spacing-big: map.get(variables.$spacing, 'size-24');
59
60
  }
60
61
 
61
62
  &.pkt-link {
62
- .pkt-icon.pkt-link__icon {
63
+ .pkt-icon.pkt-link__icon,
64
+ pkt-icon.pkt-link__icon {
63
65
  margin-top: 0.188rem;
64
66
 
65
67
  @include bp('phablet-up') {
@@ -89,7 +91,6 @@ $-linkcard-spacing-big: map.get(variables.$spacing, 'size-24');
89
91
  &:active {
90
92
  color: var(--pkt-color-brand-warm-blue-1000) !important;
91
93
  }
92
-
93
94
  }
94
95
 
95
96
  &--blue {
@@ -114,28 +115,30 @@ $-linkcard-spacing-big: map.get(variables.$spacing, 'size-24');
114
115
  }
115
116
 
116
117
  @at-root [data-mode='dark'] .#{$-module-name} {
117
-
118
118
  .pkt-link--external::after {
119
119
  // white
120
- filter: brightness(0) saturate(100%) invert(99%) sepia(0%) saturate(2190%) hue-rotate(285deg) brightness(109%) contrast(100%);
120
+ filter: brightness(0) saturate(100%) invert(99%) sepia(0%) saturate(2190%) hue-rotate(285deg) brightness(109%)
121
+ contrast(100%);
121
122
  }
122
123
 
123
124
  &:hover .pkt-link--external::after {
124
125
  // --pkt-color-brand-blue-500
125
- filter: brightness(0) saturate(100%) invert(93%) sepia(91%) saturate(6664%) hue-rotate(169deg) brightness(103%) contrast(107%);
126
+ filter: brightness(0) saturate(100%) invert(93%) sepia(91%) saturate(6664%) hue-rotate(169deg) brightness(103%)
127
+ contrast(107%);
126
128
  }
127
129
  }
128
130
 
129
-
130
- @at-root [data-mode='dark'] .#{$-module-name}--beige, .#{$-module-name}--blue {
131
-
131
+ @at-root [data-mode='dark'] .#{$-module-name}--beige,
132
+ .#{$-module-name}--blue {
132
133
  .pkt-link--external::after {
133
134
  // #2A2859
134
- filter: brightness(0) saturate(100%) invert(14%) sepia(64%) saturate(913%) hue-rotate(210deg) brightness(91%) contrast(95%) !important;
135
+ filter: brightness(0) saturate(100%) invert(14%) sepia(64%) saturate(913%) hue-rotate(210deg) brightness(91%)
136
+ contrast(95%) !important;
135
137
  }
136
138
 
137
139
  .pkt-link--external:hover::after {
138
140
  // --pkt-color-brand-blue-500
139
- filter: brightness(0) saturate(100%) invert(14%) sepia(64%) saturate(913%) hue-rotate(210deg) brightness(91%) contrast(95%) !important;
141
+ filter: brightness(0) saturate(100%) invert(14%) sepia(64%) saturate(913%) hue-rotate(210deg) brightness(91%)
142
+ contrast(95%) !important;
140
143
  }
141
144
  }
@@ -36,7 +36,8 @@
36
36
  border-bottom: 0.25rem solid transparent;
37
37
  @include typography.get-text('pkt-txt-16');
38
38
  white-space: nowrap;
39
- .pkt-icon {
39
+ .pkt-icon,
40
+ pkt-icon {
40
41
  --fg-color: currentColor;
41
42
  }
42
43
  &,
@@ -55,10 +55,19 @@
55
55
  margin: 0;
56
56
  padding: 0.5rem 1rem;
57
57
 
58
+ &-compact#{&} {
59
+ border: 0;
60
+ border-bottom: 1px solid var(--pkt-color-input-border-normal);
61
+ padding: 0 0 0.1rem 0;
62
+ @include typography.get-text('pkt-txt-16-light');
63
+ &:is(select):not([multiple]) {
64
+ background-position: right 0 top 50%;
65
+ padding-right: 2rem;
66
+ }
67
+ }
68
+
58
69
  &:not(textarea[cols]):not(input[size]):not(&--fullwidth),
59
- &__container:not(:is(:has(textarea[cols]))):not(:is(:has(input[size]))):not(
60
- :is(:has(&--fullwidth))
61
- ) {
70
+ &__container:not(:is(:has(textarea[cols]))):not(:is(:has(input[size]))):not(:is(:has(&--fullwidth))) {
62
71
  width: min(100%, 31rem);
63
72
  }
64
73
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "11.10.1",
3
+ "version": "11.12.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": "2309609a0e76e913954fbf3f6042786e1fb5c2e1"
58
+ "gitHead": "8546814ef0972d8aeb88791a57e2df10abe8a91a"
59
59
  }