scb-wc 0.1.268 → 0.1.270

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc",
3
- "version": "0.1.268",
3
+ "version": "0.1.270",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -569,5 +569,5 @@
569
569
  "./scb-viz/*": null,
570
570
  "./mvc/*": "./mvc/*"
571
571
  },
572
- "buildHash": "D6F4134387935C01AB141DE3935BB94C33393D4FE3B3BC74B0D87A910E838624"
572
+ "buildHash": "1ACF2EAE706460A7A5B4DDD0CC3849CD53DB31A598803D0F22E5DF5F145F6938"
573
573
  }
@@ -230,10 +230,7 @@ var u = {
230
230
  gap: var(--scb-app-bar-current-gap);
231
231
  }
232
232
  .leading ::slotted(scb-icon-button),
233
- .trailing ::slotted(scb-icon-button) {
234
- /* Ikonknappens klickyta innehåller redan luften runt den synliga ytan. */
235
- margin: 0;
236
- }
233
+ .trailing ::slotted(scb-icon-button),
237
234
  .trailing ::slotted(scb-avatar) {
238
235
  margin: var(--spacing-2, 4px);
239
236
  }
@@ -183,10 +183,6 @@ var p = class extends e {
183
183
  */
184
184
  :host {
185
185
  display: inline-flex;
186
- align-items: center;
187
- justify-content: center;
188
- min-inline-size: var(--scb-buttons-touch-target-size, var(--scale-11, 48px));
189
- min-block-size: var(--scb-buttons-touch-target-size, var(--scale-11, 48px));
190
186
  block-size: var(--scb-button-block-size, auto);
191
187
  margin-block-start: var(--scb-button-spacing-block-start, 0);
192
188
  margin-block-end: var(--scb-button-spacing-block-end, 0);
@@ -278,7 +274,7 @@ var p = class extends e {
278
274
  inline-size: auto;
279
275
  padding-block: var(--scb-button-padding-block);
280
276
  padding-inline: var(--scb-button-padding-inline);
281
- overflow: visible;
277
+ overflow: hidden;
282
278
  border: 0;
283
279
  border-radius: inherit;
284
280
  background: transparent;
@@ -306,21 +302,12 @@ var p = class extends e {
306
302
  line-height: inherit !important;
307
303
  }
308
304
 
309
- /* Hosten reserverar plats så att klickytorna inte överlappar grannknappar. */
310
- .native-button::after {
311
- content: '';
312
- position: absolute;
313
- inset-block: min(0px, calc((100% - var(--scb-buttons-touch-target-size, var(--scale-11, 48px))) / 2));
314
- inset-inline: min(0px, calc((100% - var(--scb-buttons-touch-target-size, var(--scale-11, 48px))) / 2));
315
- }
316
-
317
305
  /* Interaktionslager. Opacity och motion ska gå via centrala tokens. */
318
306
  .native-button::before {
319
307
  content: '';
320
308
  position: absolute;
321
309
  inset: 0;
322
310
  z-index: -1;
323
- border-radius: inherit;
324
311
  background: currentColor;
325
312
  opacity: 0;
326
313
  pointer-events: none;
@@ -349,11 +336,7 @@ var p = class extends e {
349
336
  color: var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content));
350
337
  cursor: default;
351
338
  opacity: 1;
352
- }
353
-
354
- .native-button[aria-disabled='true']::before,
355
- .native-button:disabled::before {
356
- opacity: 0;
339
+ pointer-events: none;
357
340
  }
358
341
 
359
342
  /* Variantfärger. Ändra färgroller i src/tokens/source/colors.json. */
@@ -69,10 +69,9 @@ var f = class extends e {
69
69
  let e = this.renderRoot.querySelector(".datepicker-popup");
70
70
  if (!e) return;
71
71
  if (this._usesInPlaceLayout()) {
72
- s(e), e.style.position = "relative";
72
+ s(e);
73
73
  return;
74
74
  }
75
- e.style.removeProperty("position");
76
75
  let t = this.parentElement?.getBoundingClientRect();
77
76
  if (!t) return;
78
77
  let n = window.innerWidth, r = window.innerHeight, i = Math.max(220, n - this._viewportMargin * 2);
@@ -100,6 +100,10 @@ var m = class extends e {
100
100
  pointer-events: none;
101
101
  }
102
102
 
103
+ :host(:not([open])) .panel:not([popover]) {
104
+ display: none;
105
+ }
106
+
103
107
  .panel[popover] {
104
108
  box-sizing: border-box;
105
109
  margin: 0;
@@ -26,13 +26,13 @@ var m = class extends e {
26
26
  let t = e.composedPath()[0];
27
27
  t instanceof HTMLElement && t.matches(":focus-visible") && this.__ensureFocusRing();
28
28
  }, this.__ensureRipple = (e, t = !1) => {
29
- this.__rippleReady || this.disabled || this.getAttribute("aria-disabled") === "true" || (e && (this.__pendingRippleEvent = e), t && (this.__pendingRippleClick = !0), p().then(({ ensureRippleReady: e }) => e()).then(() => {
30
- this.disabled || this.getAttribute("aria-disabled") === "true" || (this.__rippleReady = !0, this.toggleAttribute("data-native-ripple-ready", !0), this.requestUpdate(), this.updateComplete.then(() => this.__replayRippleState()));
29
+ this.__rippleReady || this.disabled || (e && (this.__pendingRippleEvent = e), t && (this.__pendingRippleClick = !0), p().then(({ ensureRippleReady: e }) => e()).then(() => {
30
+ this.disabled || (this.__rippleReady = !0, this.toggleAttribute("data-native-ripple-ready", !0), this.requestUpdate(), this.updateComplete.then(() => this.__replayRippleState()));
31
31
  }));
32
32
  }, this.__onPointerInteraction = (e) => {
33
33
  this.__ensureRipple(e);
34
34
  }, this.__onClick = (e) => {
35
- this.disabled || this.getAttribute("aria-disabled") === "true" ? (e.preventDefault(), e.stopPropagation()) : (this.toggle && (this.selected = !this.selected, this.dispatchEvent(new CustomEvent("change", {
35
+ this.disabled ? (e.preventDefault(), e.stopPropagation()) : (this.toggle && (this.selected = !this.selected, this.dispatchEvent(new CustomEvent("change", {
36
36
  detail: { selected: this.selected },
37
37
  bubbles: !0,
38
38
  composed: !0
@@ -105,10 +105,6 @@ var m = class extends e {
105
105
  this.styles = t`
106
106
  :host {
107
107
  display: inline-flex;
108
- align-items: center;
109
- justify-content: center;
110
- min-inline-size: var(--scb-buttons-touch-target-size, var(--scale-11, 48px));
111
- min-block-size: var(--scb-buttons-touch-target-size, var(--scale-11, 48px));
112
108
  margin-block-start: var(--scb-icon-button-spacing-block-start, 0);
113
109
  margin-block-end: var(--scb-icon-button-spacing-block-end, 0);
114
110
  margin-inline-start: var(--scb-icon-button-spacing-inline-start, 0);
@@ -162,7 +158,6 @@ var m = class extends e {
162
158
  .native-icon-button-wrap {
163
159
  position: relative;
164
160
  display: inline-flex;
165
- flex-shrink: 0;
166
161
  inline-size: var(--scb-icon-button-container-size);
167
162
  block-size: var(--scb-icon-button-container-size);
168
163
  border-radius: var(--scb-icon-button-shape-radius);
@@ -180,7 +175,7 @@ var m = class extends e {
180
175
  min-inline-size: 0;
181
176
  min-block-size: 0;
182
177
  padding: 0;
183
- overflow: visible;
178
+ overflow: hidden;
184
179
  border: 0;
185
180
  border-radius: inherit;
186
181
  background: transparent;
@@ -195,20 +190,11 @@ var m = class extends e {
195
190
  touch-action: manipulation;
196
191
  }
197
192
 
198
- /* Hosten reserverar plats så att klickytorna inte överlappar grannknappar. */
199
- .native-icon-button::after {
200
- content: '';
201
- position: absolute;
202
- inset-block: min(0px, calc((100% - var(--scb-buttons-touch-target-size, var(--scale-11, 48px))) / 2));
203
- inset-inline: min(0px, calc((100% - var(--scb-buttons-touch-target-size, var(--scale-11, 48px))) / 2));
204
- }
205
-
206
193
  .native-icon-button::before {
207
194
  content: '';
208
195
  position: absolute;
209
196
  inset: 0;
210
197
  z-index: -1;
211
- border-radius: inherit;
212
198
  background: currentColor;
213
199
  opacity: 0;
214
200
  pointer-events: none;
@@ -307,11 +293,7 @@ var m = class extends e {
307
293
  .native-icon-button:disabled {
308
294
  color: var(--md-icon-button-disabled-icon-color, var(--_disabled-content-color, var(--scb-color-compat-disabled-content)));
309
295
  cursor: default;
310
- }
311
-
312
- .native-icon-button[aria-disabled='true']::before,
313
- .native-icon-button:disabled::before {
314
- opacity: 0;
296
+ pointer-events: none;
315
297
  }
316
298
 
317
299
  :host([variant='filled']) .native-icon-button[aria-disabled='true'],
@@ -74,9 +74,7 @@ var l = class extends e {
74
74
  border-radius: var(--scb-link-focus-radius, var(--radius-extra-small, 4px));
75
75
  outline: none;
76
76
  cursor: pointer;
77
- transition:
78
- color var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease),
79
- text-decoration-thickness var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease);
77
+ transition: color var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease);
80
78
 
81
79
  white-space: var(--scb-link-white-space, normal);
82
80
  }
@@ -76,9 +76,7 @@ var c = class extends e {
76
76
  text-underline-position: from-font;
77
77
  text-underline-offset: var(--scb-link-underline-offset, .1578em);
78
78
  text-decoration-thickness: var(--scb-link-underline-thickness, var(--stroke-border, 1px));
79
- transition:
80
- color var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease),
81
- text-decoration-thickness var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease);
79
+ transition: color var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease);
82
80
  }
83
81
 
84
82
  ::slotted(*) {
@@ -279,6 +279,20 @@ var m = class extends e {
279
279
  cursor: default;
280
280
  }
281
281
 
282
+ :host([disabled]),
283
+ :host([disabled]) .overline,
284
+ :host([disabled]) .label,
285
+ :host([disabled]) .supporting-text {
286
+ color: var(--scb-list-disabled-content-color, var(--md-sys-color-on-surface));
287
+ }
288
+
289
+ :host([disabled]) .leading,
290
+ :host([disabled]) .texts,
291
+ :host([disabled]:not([trailing-variant="checkbox"]):not([trailing-variant="switch"])) .trailing {
292
+ /* Checkbox och Switch har egna disabled-stilar. */
293
+ opacity: var(--scb-list-item-design-disabled-opacity);
294
+ }
295
+
282
296
  .link {
283
297
  text-decoration: none;
284
298
  color: inherit;
@@ -291,6 +305,10 @@ var m = class extends e {
291
305
  /* design:bindings:scb-list-item:start */
292
306
  /* Genererat från src/scb-components/scb-list/component.json. Kör component:finish efter ändring. */
293
307
  :host {
308
+ --scb-list-item-design-disabled-opacity-small: var(--scb-list-disabled-content-opacity, 38%);
309
+ --scb-list-item-design-disabled-opacity: var(--scb-list-item-design-disabled-opacity-small);
310
+ --scb-list-item-design-disabled-opacity-medium: var(--scb-list-disabled-content-opacity, 38%);
311
+ --scb-list-item-design-disabled-opacity-large: var(--scb-list-disabled-content-opacity, 38%);
294
312
  --scb-list-item-design-item-height-small: var(--scb-list-item-min-height-small, var(--scale-12, 56px));
295
313
  --scb-list-item-design-item-height-medium: var(--scb-list-item-min-height-medium, 64px);
296
314
  --scb-list-item-design-item-height-large: var(--scb-list-item-min-height-large, 72px);
@@ -398,6 +416,7 @@ var m = class extends e {
398
416
  --scb-list-item-design-text-gap-large: var(--scb-list-item-text-gap-large, var(--spacing-2, 4px));
399
417
  }
400
418
  :host([size="small"]) {
419
+ --scb-list-item-design-disabled-opacity: var(--scb-list-item-design-disabled-opacity-small);
401
420
  --scb-list-item-design-padding-inline: var(--scb-list-item-design-padding-inline-small);
402
421
  --scb-list-item-design-overline-font: var(--scb-list-item-design-overline-small-font);
403
422
  --scb-list-item-design-overline-size: var(--scb-list-item-design-overline-small-size);
@@ -412,6 +431,7 @@ var m = class extends e {
412
431
  --scb-list-item-design-list-item-link-gap: var(--scb-list-item-design-list-item-link-gap-small);
413
432
  }
414
433
  :host([size="medium"]) {
434
+ --scb-list-item-design-disabled-opacity: var(--scb-list-item-design-disabled-opacity-medium);
415
435
  --scb-list-item-design-padding-inline: var(--scb-list-item-design-padding-inline-medium);
416
436
  --scb-list-item-design-overline-font: var(--scb-list-item-design-overline-medium-font);
417
437
  --scb-list-item-design-overline-size: var(--scb-list-item-design-overline-medium-size);
@@ -426,6 +446,7 @@ var m = class extends e {
426
446
  --scb-list-item-design-list-item-link-gap: var(--scb-list-item-design-list-item-link-gap-medium);
427
447
  }
428
448
  :host([size="large"]) {
449
+ --scb-list-item-design-disabled-opacity: var(--scb-list-item-design-disabled-opacity-large);
429
450
  --scb-list-item-design-padding-inline: var(--scb-list-item-design-padding-inline-large);
430
451
  --scb-list-item-design-overline-font: var(--scb-list-item-design-overline-large-font);
431
452
  --scb-list-item-design-overline-size: var(--scb-list-item-design-overline-large-size);
@@ -84,6 +84,17 @@ var c = class extends e {
84
84
  align-items: center;
85
85
  gap: var(--scb-pagination-page-gap-current);
86
86
  }
87
+ .pagination.icon-text,
88
+ .pagination.icon-text .pagination-row,
89
+ .pagination.icon-text .pagination-row ol {
90
+ flex-wrap: wrap;
91
+ }
92
+ .pagination.icon-text .pagination-row {
93
+ max-width: 100%;
94
+ }
95
+ .pagination.icon-text {
96
+ row-gap: var(--spacing-3, 8px);
97
+ }
87
98
  .pagination-row .prev {
88
99
  display: flex;
89
100
  justify-content: flex-start;
@@ -241,7 +252,7 @@ var c = class extends e {
241
252
  pointer-events: none;
242
253
  }
243
254
 
244
- @media (max-width: 768px) {
255
+ @media (max-width: 480px) {
245
256
  .pagination.icon-text {
246
257
  flex-direction: column;
247
258
  align-items: stretch;
@@ -262,9 +273,6 @@ var c = class extends e {
262
273
  width: 100%;
263
274
  margin-top: 8px;
264
275
  }
265
- }
266
-
267
- @media (max-width: 480px) {
268
276
  .pagination.icon-text .pagination-row {
269
277
  flex-direction: column;
270
278
  align-items: stretch;