@oslokommune/punkt-css 16.4.0 → 16.7.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/16.4/icons' !default;
9
+ $icon-path: 'https://punkt-cdn.oslo.kommune.no/16.7/icons' !default;
10
10
 
11
11
  // Borders
12
12
  $border-width: (
@@ -101,14 +101,12 @@ pkt-datepicker-multiple {
101
101
  top: 100%;
102
102
  left: 0;
103
103
  z-index: 2;
104
- margin: 0;
104
+ margin-top: 0.5rem;
105
105
  padding: 0.5rem;
106
106
  position: absolute;
107
107
  width: max-content;
108
108
  background: var(--pkt-color-background-default);
109
- box-shadow:
110
- 0px 2px 4px -2px rgba(0, 0, 0, 0.1),
111
- 0px 4px 6px -1px rgba(0, 0, 0, 0.1);
109
+ border: 2px solid var(--pkt-color-border-gray);
112
110
  }
113
111
  .pkt-datepicker__input:not(.pkt-datepicker--multiple):not(.pkt-datepicker--range) {
114
112
  width: 8.3rem;
@@ -125,18 +123,23 @@ pkt-datepicker-multiple {
125
123
 
126
124
  // Firefox specific styles :(
127
125
  @-moz-document url-prefix() {
128
- .pkt-datepicker__input:not(.pkt-datepicker--multiple) {
129
- width: 10.5rem;
130
- }
131
- .pkt-datepicker__input.pkt-input--fullwidth:not(.pkt-datepicker--multiple) {
132
- width: auto;
133
- flex: 1;
134
- }
135
- .pkt-datepicker__inputs button.pkt-input-icon {
136
- display: none;
137
- }
138
- .pkt-datepicker__inputs
126
+ .pkt-datepicker__inputs {
127
+ .pkt-datepicker__input {
128
+ padding-right: 0.5rem;
129
+ }
130
+ .pkt-datepicker__input:not(.pkt-datepicker--multiple) {
131
+ width: 10.5rem;
132
+ max-width: calc(100%);
133
+ }
134
+ .pkt-datepicker__input.pkt-input--fullwidth:not(.pkt-datepicker--multiple) {
135
+ width: auto;
136
+ flex: 1;
137
+ }
138
+ button.pkt-input-icon {
139
+ display: none;
140
+ }
139
141
  input.pkt-datepicker__input:has(~ button):not(:has(~ .pkt-input-separator)):not(:has(~ .pkt-input-prefix)) {
140
- border-right-width: 2px !important;
142
+ border-right-width: 2px !important;
143
+ }
141
144
  }
142
145
  }
@@ -31,3 +31,4 @@
31
31
  @forward 'tag';
32
32
  @forward 'teaserlist';
33
33
  @forward 'textinput';
34
+ @forward 'timepicker';
@@ -0,0 +1,230 @@
1
+ /* Component: pkt-timepicker */
2
+
3
+ @use 'sass:map';
4
+ @use '../abstracts/variables';
5
+ @use '../abstracts/mixins/typography';
6
+
7
+ pkt-timepicker {
8
+ display: block;
9
+ }
10
+
11
+ .pkt-timepicker,
12
+ pkt-timepicker {
13
+ &__anchor {
14
+ position: relative;
15
+ }
16
+
17
+ .pkt-input__container {
18
+ border: 2px solid var(--pkt-color-input-border-normal);
19
+ background-color: var(--pkt-color-input-background-normal);
20
+ width: fit-content;
21
+ padding: 0 0 0 1rem;
22
+
23
+ .pkt-input,
24
+ .pkt-input-icon,
25
+ .pkt-input-separator {
26
+ border: 0;
27
+ min-height: auto;
28
+ }
29
+
30
+ &:hover {
31
+ border-color: var(--pkt-color-input-border-active);
32
+ }
33
+
34
+ &:focus-within {
35
+ border-color: var(--pkt-color-input-border-active);
36
+ outline: 2px solid var(--pkt-color-input-border-active);
37
+ }
38
+
39
+ &:has(input:disabled) {
40
+ border-color: var(--pkt-color-input-border-disabled);
41
+ background-color: var(--pkt-color-surface-default-gray);
42
+
43
+ .pkt-timepicker__icon,
44
+ .pkt-timepicker__button {
45
+ --fg-color: var(--pkt-color-input-text-disabled);
46
+ }
47
+ }
48
+
49
+ button.pkt-timepicker__button {
50
+ height: auto;
51
+ padding: 0 0.75rem;
52
+
53
+ pkt-icon {
54
+ width: 1.5rem;
55
+ height: 1.5rem;
56
+ }
57
+
58
+ &:hover {
59
+ background-color: inherit !important;
60
+ border-color: inherit !important;
61
+ svg {
62
+ --fg-color: inherit;
63
+ }
64
+ }
65
+ &.pkt-timepicker__button--prev {
66
+ margin-right: 0.25rem;
67
+ }
68
+ &.pkt-timepicker__button--next {
69
+ margin-left: 0.25rem;
70
+ }
71
+ }
72
+ }
73
+
74
+ // Stepper variant: no left padding — the prev button takes that space
75
+ &--stepper .pkt-input__container {
76
+ padding-left: 0;
77
+ }
78
+
79
+ // Fullwidth modifier
80
+ &--fullwidth {
81
+ .pkt-timepicker__anchor,
82
+ .pkt-input__container {
83
+ width: 100%;
84
+ }
85
+ }
86
+
87
+ // Default / hide-picker fullwidth: button or decorative icon pushed to right
88
+ &--fullwidth:not(.pkt-timepicker--stepper) {
89
+ .pkt-input__container {
90
+ .pkt-input-icon {
91
+ margin-left: auto;
92
+ }
93
+ }
94
+ }
95
+
96
+ // Stepper fullwidth: center HH:MM between prev and next buttons
97
+ &--fullwidth.pkt-timepicker--stepper {
98
+ .pkt-input__container {
99
+ .pkt-timepicker__button--prev + .pkt-timepicker__input {
100
+ margin-left: auto;
101
+ }
102
+
103
+ .pkt-timepicker__separator + .pkt-timepicker__input {
104
+ margin-right: auto;
105
+ }
106
+ }
107
+ }
108
+
109
+ .pkt-inputwrapper--error .pkt-input__container,
110
+ .pkt-input__container.pkt-timepicker--error {
111
+ border-color: var(--pkt-color-brand-red-1000);
112
+
113
+ &:hover,
114
+ &:focus-within {
115
+ border-color: var(--pkt-color-brand-red-1000);
116
+ }
117
+ }
118
+
119
+ .pkt-inputwrapper--disabled .pkt-input__container,
120
+ .pkt-input__container.pkt-timepicker--disabled {
121
+ border-color: var(--pkt-color-border-states-disabled);
122
+ background-color: var(--pkt-color-surface-default-gray);
123
+
124
+ &:hover,
125
+ &:focus-within {
126
+ border-color: var(--pkt-color-border-states-disabled);
127
+ box-shadow: none;
128
+ outline: none;
129
+ }
130
+
131
+ .pkt-timepicker__icon {
132
+ --fg-color: var(--pkt-color-input-text-disabled);
133
+ }
134
+ }
135
+
136
+ &__input {
137
+ width: 1.5rem;
138
+ text-align: center;
139
+ padding: 0.5rem 0;
140
+
141
+ &::-webkit-inner-spin-button,
142
+ &::-webkit-outer-spin-button {
143
+ -webkit-appearance: none;
144
+ margin: 0;
145
+ }
146
+
147
+ -moz-appearance: textfield;
148
+ appearance: textfield;
149
+ }
150
+
151
+ &__separator {
152
+ @include typography.get-text('pkt-txt-18-medium');
153
+
154
+ padding: 0.5rem 0;
155
+ user-select: none;
156
+ }
157
+
158
+ &__icon {
159
+ height: auto;
160
+ padding: 0 0.75rem 0 0;
161
+ pointer-events: none;
162
+
163
+ pkt-icon {
164
+ width: 1.5rem;
165
+ height: 1.5rem;
166
+ }
167
+ }
168
+
169
+ &-popup {
170
+ position: absolute;
171
+ top: 100%;
172
+ left: 0;
173
+ z-index: 2;
174
+ margin-top: 0.5rem;
175
+ display: flex;
176
+ padding: 0;
177
+ background: var(--pkt-color-background-default);
178
+ border: 2px solid var(--pkt-color-border-gray);
179
+ justify-content: center;
180
+
181
+ &[hidden] {
182
+ display: none;
183
+ }
184
+
185
+ &__col {
186
+ display: flex;
187
+ flex-direction: column;
188
+ align-items: center;
189
+ overflow-y: auto;
190
+ max-height: 23rem;
191
+ padding: 0.5rem 0.6rem;
192
+ }
193
+
194
+ &__option {
195
+ flex-shrink: 0;
196
+ width: 2.5rem;
197
+ height: 2.5rem;
198
+ margin: 0;
199
+ padding: 0;
200
+ border: 0;
201
+ font: inherit;
202
+ aspect-ratio: 1 / 1;
203
+ border-radius: 50%;
204
+
205
+ &,
206
+ &:hover {
207
+ background-color: transparent;
208
+ color: inherit;
209
+ border-color: transparent;
210
+ }
211
+
212
+ &:hover {
213
+ background-color: var(--pkt-color-surface-default-light-blue);
214
+ color: var(--pkt-color-brand-dark-blue-1000);
215
+ }
216
+
217
+ &:focus-visible {
218
+ outline: 2px solid var(--pkt-color-input-border-active);
219
+ outline-offset: -2px;
220
+ }
221
+
222
+ &--selected,
223
+ &--selected:hover,
224
+ &--selected:focus {
225
+ background-color: var(--pkt-color-surface-strong-blue);
226
+ color: var(--pkt-color-brand-dark-blue-1000);
227
+ }
228
+ }
229
+ }
230
+ }
@@ -41,7 +41,7 @@ pkt-select {
41
41
  &:not(textarea[cols]):not(input[size]):not(&--fullwidth):not(.pkt-datepicker__input:not(.pkt-datepicker--multiple)),
42
42
  &__container:not(:is(:has(.pkt-datepicker__input:not(.pkt-datepicker--multiple)))):not(:is(:has(textarea[cols]))):not(
43
43
  :is(:has(input[size]))
44
- ):not(:is(:has(&--fullwidth))) {
44
+ ):not(:is(:has(&--fullwidth))):not(:is(:has(.pkt-timepicker__input))) {
45
45
  width: min(31rem, 100%);
46
46
  }
47
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-css",
3
- "version": "16.4.0",
3
+ "version": "16.7.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",
@@ -19,6 +19,11 @@
19
19
  "dev": "astro dev",
20
20
  "preview": "astro preview"
21
21
  },
22
+ "nx": {
23
+ "implicitDependencies": [
24
+ "@oslokommune/punkt-elements"
25
+ ]
26
+ },
22
27
  "devDependencies": {
23
28
  "@oslokommune/punkt-assets": "^16.0.0",
24
29
  "astro": "^5.7.5",
@@ -55,5 +60,5 @@
55
60
  "url": "https://github.com/oslokommune/punkt/issues"
56
61
  },
57
62
  "license": "MIT",
58
- "gitHead": "7ea157177224bb319ade35eb479b90e10940fdc6"
63
+ "gitHead": "782a591e43ea062ca4ef23fe5415aca5f2d523b5"
59
64
  }