@rettangoli/ui 1.7.3 → 1.7.4

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": "@rettangoli/ui",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "A UI component library for building web interfaces.",
5
5
  "main": "dist/rettangoli-esm.min.js",
6
6
  "type": "module",
@@ -1,4 +1,4 @@
1
- import { css } from "../common.js";
1
+ import { css, mediaQueries } from "../common.js";
2
2
 
3
3
  const MIN_MARGIN_PX = 40;
4
4
  const MAX_LAYOUT_RETRIES = 6;
@@ -66,6 +66,16 @@ class RettangoliDialogElement extends HTMLElement {
66
66
  margin-right: 0;
67
67
  }
68
68
 
69
+ ${mediaQueries.md} {
70
+ :host(:not([w])[s="sm"]) slot[name="content"],
71
+ :host(:not([w])[s="md"]) slot[name="content"],
72
+ :host(:not([w])[s="lg"]) slot[name="content"] {
73
+ box-sizing: border-box;
74
+ width: calc(100vw - 2 * var(--spacing-lg));
75
+ max-width: calc(100vw - 2 * var(--spacing-lg));
76
+ }
77
+ }
78
+
69
79
  @keyframes dialog-in {
70
80
  from {
71
81
  opacity: 0;
@@ -199,10 +209,11 @@ class RettangoliDialogElement extends HTMLElement {
199
209
  } else if (newValue === null && this._dialogElement.open) {
200
210
  this._hideModal();
201
211
  }
212
+ } else if (name === 's') {
213
+ // Size is handled via CSS :host() selectors.
214
+ this._scheduleAdaptiveCentering({ resetRetries: true });
202
215
  } else if (name === 'w') {
203
216
  this._updateWidth();
204
- } else if (name === 's') {
205
- // Size is handled via CSS :host() selectors
206
217
  }
207
218
  }
208
219