@maggioli-design-system/magma 1.12.1 → 1.12.3

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.
Files changed (34) hide show
  1. package/dist/cjs/mds-button_3.cjs.entry.js +59 -36
  2. package/dist/cjs/mds-calendar_2.cjs.entry.js +1 -1
  3. package/dist/cjs/mds-input-date.cjs.entry.js +1 -1
  4. package/dist/collection/components/mds-calendar/mds-calendar.css +4 -2
  5. package/dist/collection/components/mds-icon/services/icons-set.service.js +38 -16
  6. package/dist/collection/components/mds-input-date/mds-input-date.css +3 -2
  7. package/dist/collection/components/mds-input-date/test/mds-input-date.stories.js +75 -0
  8. package/dist/components/mds-calendar2.js +1 -1
  9. package/dist/components/mds-icon2.js +59 -36
  10. package/dist/components/mds-input-date.js +1 -1
  11. package/dist/documentation.json +1 -1
  12. package/dist/esm/mds-button_3.entry.js +59 -36
  13. package/dist/esm/mds-calendar_2.entry.js +1 -1
  14. package/dist/esm/mds-input-date.entry.js +1 -1
  15. package/dist/esm-es5/mds-button_3.entry.js +1 -1
  16. package/dist/esm-es5/mds-calendar_2.entry.js +1 -1
  17. package/dist/esm-es5/mds-input-date.entry.js +1 -1
  18. package/dist/hydrate/index.js +61 -38
  19. package/dist/hydrate/index.mjs +61 -38
  20. package/dist/magma-components/magma-components.esm.js +1 -1
  21. package/dist/magma-components/{p-20e0f9e3.entry.js → p-19522afa.entry.js} +1 -1
  22. package/dist/magma-components/p-25c84410.system.entry.js +1 -0
  23. package/dist/magma-components/p-26cd6ec8.system.js +1 -1
  24. package/dist/magma-components/{p-c6785782.entry.js → p-3183791a.entry.js} +1 -1
  25. package/dist/magma-components/p-44889d04.system.entry.js +1 -0
  26. package/dist/magma-components/p-5214b07e.entry.js +1 -0
  27. package/dist/magma-components/{p-68dde65c.system.entry.js → p-8465aa1a.system.entry.js} +1 -1
  28. package/dist/stats.json +40 -40
  29. package/dist/types/components/mds-icon/services/icons-set.service.d.ts +9 -9
  30. package/dist/types/components/mds-input-date/test/mds-input-date.stories.d.ts +4 -0
  31. package/package.json +2 -2
  32. package/dist/magma-components/p-3e72a9f4.entry.js +0 -1
  33. package/dist/magma-components/p-a776c78c.system.entry.js +0 -1
  34. package/dist/magma-components/p-ca4ee5b5.system.entry.js +0 -1
@@ -238,37 +238,44 @@ function promisifyRequest(request) {
238
238
  // @ts-ignore - file size hacks
239
239
  request.oncomplete = request.onsuccess = function () {
240
240
  return resolve(request.result);
241
- }; // @ts-ignore - file size hacks
242
-
243
-
241
+ };
242
+ // @ts-ignore - file size hacks
244
243
  request.onabort = request.onerror = function () {
245
244
  return reject(request.error);
246
245
  };
247
246
  });
248
247
  }
249
-
250
248
  function createStore(dbName, storeName) {
251
- var request = indexedDB.open(dbName);
252
-
253
- request.onupgradeneeded = function () {
254
- return request.result.createObjectStore(storeName);
249
+ var dbp;
250
+ var getDB = function getDB() {
251
+ if (dbp) return dbp;
252
+ var request = indexedDB.open(dbName);
253
+ request.onupgradeneeded = function () {
254
+ return request.result.createObjectStore(storeName);
255
+ };
256
+ dbp = promisifyRequest(request);
257
+ dbp.then(function (db) {
258
+ // It seems like Safari sometimes likes to just close the connection.
259
+ // It's supposed to fire this event when that happens. Let's hope it does!
260
+ db.onclose = function () {
261
+ return dbp = undefined;
262
+ };
263
+ }, function () {
264
+ dbp = undefined;
265
+ });
266
+ return dbp;
255
267
  };
256
-
257
- var dbp = promisifyRequest(request);
258
268
  return function (txMode, callback) {
259
- return dbp.then(function (db) {
269
+ return getDB().then(function (db) {
260
270
  return callback(db.transaction(storeName, txMode).objectStore(storeName));
261
271
  });
262
272
  };
263
273
  }
264
-
265
274
  var defaultGetStoreFunc;
266
-
267
275
  function defaultGetStore() {
268
276
  if (!defaultGetStoreFunc) {
269
277
  defaultGetStoreFunc = createStore('keyval-store', 'keyval');
270
278
  }
271
-
272
279
  return defaultGetStoreFunc;
273
280
  }
274
281
  /**
@@ -277,8 +284,6 @@ function defaultGetStore() {
277
284
  * @param key
278
285
  * @param customStore Method to get a custom store. Use with caution (see the docs).
279
286
  */
280
-
281
-
282
287
  function get(key) {
283
288
  var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();
284
289
  return customStore('readonly', function (store) {
@@ -292,8 +297,6 @@ function get(key) {
292
297
  * @param value
293
298
  * @param customStore Method to get a custom store. Use with caution (see the docs).
294
299
  */
295
-
296
-
297
300
  function set(key, value) {
298
301
  var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultGetStore();
299
302
  return customStore('readwrite', function (store) {
@@ -307,8 +310,6 @@ function set(key, value) {
307
310
  * @param key
308
311
  * @param customStore Method to get a custom store. Use with caution (see the docs).
309
312
  */
310
-
311
-
312
313
  function del(key) {
313
314
  var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore();
314
315
  return customStore('readwrite', function (store) {
@@ -410,29 +411,46 @@ class IconsSetController {
410
411
  return { set: this._iconsSets.get(iconName.split('/')[0]) };
411
412
  }
412
413
  /**
413
- * recognize svg path pattern and set host and svgPath variable
414
+ * Sets the directory of the svg files. Query and fragment are dropped: the icon name is
415
+ * appended to the path.
414
416
  *
415
- * input path: https://www.abc.com/svg/path
416
- * svgPath = https://www.abc.com/svg/path
417
+ * input path: https://www.abc.com/svg/path/
418
+ * svgPath = https://www.abc.com/svg/path/
417
419
  *
418
- * input path: localhost:9000/svg/path
419
- * svgPath = localhost:9000/svg/path
420
+ * input path: localhost:9000/svg/path/
421
+ * svgPath = //localhost:9000/svg/path/ (with the protocol of the page)
420
422
  *
421
- * input path: /svg/path
422
- * svgPath = {window.location.host}/svg/path
423
+ * input path: /svg/path/ or svg/path/
424
+ * svgPath = unchanged, resolved by `fetch` against the document base URL on each request
423
425
  *
424
- * input path: svg/path
426
+ * input path: empty or not a URL
425
427
  * throw error
426
- *
427
428
  */
428
429
  setSvgPath(svgPath) {
429
- const reg = /^(((https?:\/\/)?[.\w]+(:\d+)?)|\/)([\w/-]+)*/;
430
- const match = reg.exec(svgPath);
431
- if (!match) {
432
- throw Error(`Svg path not recognize ${svgPath}, ensure is a absolute path starting with '/' or a url`);
430
+ const error = Error(`Svg path not recognize ${svgPath}, ensure is a absolute path starting with '/' or a url`);
431
+ if (typeof svgPath !== 'string' || svgPath.trim() === '') {
432
+ throw error;
433
+ }
434
+ const value = svgPath.trim();
435
+ // a host with a port and no scheme (`localhost:9000/svg/`) would be read as the scheme `localhost:`
436
+ const path = /^[\w.-]+:\d+(\/|$)/.test(value) ? `//${value}` : value;
437
+ let url;
438
+ try {
439
+ // the placeholder base only validates a path, which is kept as it is
440
+ url = new URL(path, 'http://localhost/');
441
+ }
442
+ catch (_a) {
443
+ throw error;
433
444
  }
434
445
  if (typeof window !== 'undefined') {
435
- this._svgPath = match[1] ? match[0] : window.location.origin.concat(match[0]);
446
+ if (/^[a-z][a-z\d+.-]*:/i.test(path)) {
447
+ url.search = '';
448
+ url.hash = '';
449
+ this._svgPath = url.href;
450
+ }
451
+ else {
452
+ this._svgPath = path.replace(/[?#].*$/, '');
453
+ }
436
454
  window.dispatchEvent(new Event(this._svgPathUpdate));
437
455
  }
438
456
  }
@@ -460,9 +478,14 @@ class IconsSetController {
460
478
  this.setSvgPath((_a = window.sessionStorage.getItem(IconsSetService._svgPathKey)) !== null && _a !== void 0 ? _a : '');
461
479
  }
462
480
  const src = this._svgPath && !name.startsWith('http') ? this._svgPath.concat(name, '.svg') : name;
481
+ // Memory first: every instance of an icon already loaded skips the IndexedDB round-trip
482
+ if (this.memoryCache[src]) {
483
+ return this.memoryCache[src];
484
+ }
463
485
  const lsCache = await this.isCacheAvailable(src);
464
- if (this.memoryCache[src] || lsCache) {
465
- return this.memoryCache[src] || lsCache;
486
+ if (lsCache) {
487
+ this.memoryCache[src] = lsCache;
488
+ return lsCache;
466
489
  }
467
490
  const response = await fetch(src);
468
491
  if (!response.ok) {
@@ -13,7 +13,7 @@ const miBaselineForwardIos = `<svg xmlns="http://www.w3.org/2000/svg" width="24"
13
13
 
14
14
  const miBaselineBackIosNew = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M17.77 3.77L16 2L6 12l10 10l1.77-1.77L9.54 12z"/></svg>`;
15
15
 
16
- const mdsCalendarCss = ":host{--mds-calendar-day-number-other-month-color:rgb(var(--tone-neutral-07));--mds-calendar-day-number-color:rgb(var(--tone-neutral-01));--mds-calendar-cell-gap:0.125rem;--mds-calendar-cell-other-month-visibility:visible;--mds-calendar-border-radius:0.5rem;--mds-calendar-background:rgb(var(--tone-neutral));--mds-calendar-padding:1rem;--mds-calendar-select-month-or-year-height:2.25rem;--mds-calendar-select-month-or-year-width:14rem;background-color:rgb(var(--tone-neutral-09));border-radius:var(--mds-calendar-border-radius);cursor:auto;display:-ms-inline-flexbox;display:inline-flex;max-width:380px;min-width:-moz-min-content;min-width:-webkit-min-content;min-width:min-content;overflow:hidden}.calendar-view{background-color:var(--mds-calendar-background);border-radius:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:grid;-ms-flex:1 1 auto;flex:1 1 auto;padding:var(--mds-calendar-padding)}.calendar-preselection{display:none;gap:0.125rem;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content;padding:var(--mds-calendar-padding)}.calendar-preselection--has-preselection{display:grid}nav{display:-ms-flexbox;display:flex;gap:0.5rem;-ms-flex-pack:justify;justify-content:space-between;min-width:0}.action{padding-left:0.5rem;padding-right:0.5rem;-ms-flex-pack:left;justify-content:left;min-width:-moz-min-content;min-width:-webkit-min-content;min-width:min-content}.action-back,.action-forward{-ms-flex-negative:0;flex-shrink:0}.select-month-or-year{-ms-flex-align:stretch;align-items:stretch;background-color:rgb(var(--tone-neutral-09));block-size:var(--mds-calendar-select-month-or-year-height);border-radius:var(--mds-calendar-border-radius);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex:0 0 var(--mds-calendar-select-month-or-year-width);flex:0 0 var(--mds-calendar-select-month-or-year-width);height:var(--mds-calendar-select-month-or-year-height);-ms-flex-pack:start;justify-content:flex-start;inline-size:var(--mds-calendar-select-month-or-year-width);max-block-size:var(--mds-calendar-select-month-or-year-height);max-height:var(--mds-calendar-select-month-or-year-height);max-inline-size:var(--mds-calendar-select-month-or-year-width);min-block-size:var(--mds-calendar-select-month-or-year-height);min-height:var(--mds-calendar-select-month-or-year-height);min-inline-size:var(--mds-calendar-select-month-or-year-width);overflow:hidden}.action-month,.action-year{--mds-button-radius:0;-ms-flex-item-align:stretch;align-self:stretch;block-size:100%;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:default;height:100%;max-block-size:100%;max-height:100%;min-block-size:0;min-height:0;padding-left:0.5rem;padding-right:0.5rem}.action-month{-ms-flex:1 1 auto;flex:1 1 auto;min-width:0}.action-year{-ms-flex:0 0 4.5rem;flex:0 0 4.5rem}.action-month::part(label),.action-year::part(label){overflow:visible;text-overflow:clip;white-space:nowrap}.week-day-name{-ms-flex-align:center;align-items:center;aspect-ratio:1;min-height:auto;padding:0}.month-view{display:grid}.month-view__days-names,.month-view__cells{display:grid;gap:var(--mds-calendar-cell-gap);grid-template-columns:repeat(7, minmax(1px, 100%));min-width:0}.month-view{display:grid}.month-view__month-names,.month-view__years{display:grid;gap:var(--mds-calendar-cell-gap);grid-template-columns:repeat(3, minmax(1px, 100%));min-width:0}";
16
+ const mdsCalendarCss = ":host{--mds-calendar-day-number-other-month-color:rgb(var(--tone-neutral-07));--mds-calendar-day-number-color:rgb(var(--tone-neutral-01));--mds-calendar-cell-gap:0.125rem;--mds-calendar-cell-other-month-visibility:visible;--mds-calendar-border-radius:0.5rem;--mds-calendar-background:rgb(var(--tone-neutral));--mds-calendar-padding:1rem;--mds-calendar-select-month-or-year-height:2.25rem;--mds-calendar-select-month-or-year-width:14rem;background-color:rgb(var(--tone-neutral-09));border-radius:var(--mds-calendar-border-radius);cursor:auto;display:-ms-inline-flexbox;display:inline-flex;inline-size:100%;max-width:380px;min-width:-moz-min-content;min-width:-webkit-min-content;min-width:min-content;overflow:hidden}.calendar-view{background-color:var(--mds-calendar-background);border-radius:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:grid;-ms-flex:1 1 auto;flex:1 1 auto;padding:var(--mds-calendar-padding)}.calendar-preselection{display:none;gap:0.125rem;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content;padding:var(--mds-calendar-padding)}.calendar-preselection--has-preselection{display:grid}nav{display:-ms-flexbox;display:flex;gap:0.5rem;-ms-flex-pack:justify;justify-content:space-between;min-width:0}.action{padding-left:0.5rem;padding-right:0.5rem;-ms-flex-pack:left;justify-content:left;min-width:-moz-min-content;min-width:-webkit-min-content;min-width:min-content}.action-back,.action-forward{-ms-flex-negative:0;flex-shrink:0}.select-month-or-year{-ms-flex-align:stretch;align-items:stretch;background-color:rgb(var(--tone-neutral-09));block-size:var(--mds-calendar-select-month-or-year-height);border-radius:var(--mds-calendar-border-radius);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex:0 0 var(--mds-calendar-select-month-or-year-width);flex:0 0 var(--mds-calendar-select-month-or-year-width);height:var(--mds-calendar-select-month-or-year-height);inline-size:var(--mds-calendar-select-month-or-year-width);-ms-flex-pack:start;justify-content:flex-start;max-block-size:var(--mds-calendar-select-month-or-year-height);max-height:var(--mds-calendar-select-month-or-year-height);max-inline-size:var(--mds-calendar-select-month-or-year-width);min-block-size:var(--mds-calendar-select-month-or-year-height);min-height:var(--mds-calendar-select-month-or-year-height);min-inline-size:var(--mds-calendar-select-month-or-year-width);overflow:hidden}.action-month,.action-year{--mds-button-radius:0;-ms-flex-item-align:stretch;align-self:stretch;block-size:100%;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:default;height:100%;max-block-size:100%;max-height:100%;min-block-size:0;min-height:0;padding-left:0.5rem;padding-right:0.5rem}.action-month{-ms-flex:1 1 auto;flex:1 1 auto;min-width:0}.action-year{-ms-flex:0 0 4.5rem;flex:0 0 4.5rem}.action-month::part(label),.action-year::part(label){overflow:visible;text-overflow:clip;white-space:nowrap}.week-day-name{-ms-flex-align:center;align-items:center;block-size:3rem;inline-size:100%;min-height:auto;padding:0}.month-view{display:grid}.month-view__days-names,.month-view__cells{display:grid;gap:var(--mds-calendar-cell-gap);grid-template-columns:repeat(7, minmax(1px, 100%));min-width:0}.month-view{display:grid}.month-view__month-names,.month-view__years{display:grid;gap:var(--mds-calendar-cell-gap);grid-template-columns:repeat(3, minmax(1px, 100%));min-width:0}";
17
17
  const MdsCalendarStyle0 = mdsCalendarCss;
18
18
 
19
19
  const MdsCalendar = class {
@@ -8,7 +8,7 @@ const luxon = require('./luxon-75bef749.js');
8
8
  const locale = require('./locale-ff33b626.js');
9
9
  require('./_commonjsHelpers-e6ff1d6e.js');
10
10
 
11
- const mdsInputDateCss = "@tailwind utilities; :host{--mds-input-date-background:rgb(var(--tone-neutral));--mds-input-date-field-background-empty:rgb(var(--status-error-10));--mds-input-date-field-color-empty:rgb(var(--status-error-06));--mds-input-date-icon-color:var(--mds-input-date-variant-color);--mds-input-date-ring:0 0 0 1px rgb(var(--mds-input-date-variant-color) / 0.1);--mds-input-date-shadow:0 1px 3px 0 rgb(var(--mds-input-date-variant-color) / 0.1), 0 1px 2px 0 rgb(var(--mds-input-date-variant-color) / 0.06);--mds-input-date-variant-color:0 0 0;min-height:1.5rem;font-family:Karla, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;gap:0.5rem;color:rgb(var(--tone-neutral-02));container-type:inline-size;display:-ms-flexbox;display:flex;overflow:visible;position:relative}.input::-webkit-calendar-picker-indicator{-webkit-appearance:none;appearance:none;-moz-appearance:textfield;display:none}.input{min-height:1.25rem;font-family:'Roboto Mono', 'Courier New', monospace;font-size:0.875rem;line-height:1.25rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0rem;-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);background-color:transparent;border:0;border-radius:0.5rem;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;overflow:hidden;text-overflow:ellipsis;-webkit-transition-property:background-color, border-color, color, fill, margin, opacity, padding, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, margin, opacity, padding, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, margin, opacity, padding, transform;transition-property:background-color, border-color, box-shadow, color, fill, margin, opacity, padding, transform, -webkit-box-shadow, -webkit-transform;width:-moz-min-content;width:-webkit-min-content;width:min-content}:host([empty]) .input{background-color:var(--mds-input-date-field-background-empty);color:var(--mds-input-date-field-color-empty)}:host([slot]){color:inherit;display:contents}:host([slot]) .input{cursor:text;text-align:center}:host(:not([slot])) .input{border-radius:0.5rem;padding-top:0.75rem;padding-bottom:0.75rem;padding-left:1rem;padding-right:3rem;background-color:var(--mds-input-date-background);-webkit-box-shadow:var(--mds-input-date-ring), var(--mds-input-date-shadow);box-shadow:var(--mds-input-date-ring), var(--mds-input-date-shadow);min-height:3rem;width:100%}:host(:focus-within) .input{outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);--mds-input-date-ring:0 0 0 3px rgb(var(--mds-input-date-variant-color) / 1);--mds-input-date-shadow:0 4px 6px 3px rgb(var(--mds-input-date-variant-color) / 0.1), 0 2px 4px -1px rgb(var(--mds-input-date-variant-color) / 0.06)}.input:focus{outline:2px solid transparent;outline-offset:2px;-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);--mds-input-date-ring:0 0 0 3px rgb(var(--mds-input-date-variant-color) / 1);--mds-input-date-shadow:0 4px 6px 3px rgb(var(--mds-input-date-variant-color) / 0.1), 0 2px 4px -1px rgb(var(--mds-input-date-variant-color) / 0.06)}.input::-moz-placeholder{color:rgb(var(--tone-neutral-04))}.input::-webkit-input-placeholder{color:rgb(var(--tone-neutral-04))}.input:-ms-input-placeholder{color:rgb(var(--tone-neutral-04))}.input::-ms-input-placeholder{color:rgb(var(--tone-neutral-04))}.input::placeholder{color:rgb(var(--tone-neutral-04))}.input::-webkit-outer-spin-button,.input::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;display:none;margin:0}.input:disabled{background-color:rgb(var(--tone-neutral-10))}.input:disabled::-moz-placeholder{color:rgb(var(--tone-neutral-05))}.input:disabled::-webkit-input-placeholder{color:rgb(var(--tone-neutral-05))}.input:disabled:-ms-input-placeholder{color:rgb(var(--tone-neutral-05))}.input:disabled::-ms-input-placeholder{color:rgb(var(--tone-neutral-05))}.input:disabled,.input:disabled::placeholder{color:rgb(var(--tone-neutral-05))}.action-open-calendar{--mds-button-color:rgb(var(--mds-input-date-icon-color));aspect-ratio:1;bottom:0;position:absolute;right:0;top:0}:host([disabled]:not([disabled=\"false\"])) .action-open-calendar{-webkit-transform:translate(0.625rem, 0.5rem);transform:translate(0.625rem, 0.5rem)}mds-calendar{min-width:-moz-max-content;min-width:-webkit-max-content;min-width:max-content}mds-dropdown{padding:0}:host(:not(:is([hydrated],.hydrated))){-webkit-animation-duration:0s;animation-duration:0s;border-color:transparent;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;opacity:0;outline-color:transparent;-webkit-transition-delay:0s;transition-delay:0s;-webkit-transition-duration:0s;transition-duration:0s;visibility:hidden}mds-accordion:not(:is([hydrated],.hydrated)),mds-accordion-item:not(:is([hydrated],.hydrated)),mds-accordion-timer:not(:is([hydrated],.hydrated)),mds-accordion-timer-item:not(:is([hydrated],.hydrated)),mds-author:not(:is([hydrated],.hydrated)),mds-avatar:not(:is([hydrated],.hydrated)),mds-badge:not(:is([hydrated],.hydrated)),mds-banner:not(:is([hydrated],.hydrated)),mds-benchmark-bar:not(:is([hydrated],.hydrated)),mds-bibliography:not(:is([hydrated],.hydrated)),mds-breadcrumb:not(:is([hydrated],.hydrated)),mds-breadcrumb-item:not(:is([hydrated],.hydrated)),mds-button:not(:is([hydrated],.hydrated)),mds-card:not(:is([hydrated],.hydrated)),mds-card-content:not(:is([hydrated],.hydrated)),mds-card-footer:not(:is([hydrated],.hydrated)),mds-card-header:not(:is([hydrated],.hydrated)),mds-card-media:not(:is([hydrated],.hydrated)),mds-chip:not(:is([hydrated],.hydrated)),mds-details:not(:is([hydrated],.hydrated)),mds-dropdown:not(:is([hydrated],.hydrated)),mds-entity:not(:is([hydrated],.hydrated)),mds-file:not(:is([hydrated],.hydrated)),mds-file-preview:not(:is([hydrated],.hydrated)),mds-filter:not(:is([hydrated],.hydrated)),mds-filter-item:not(:is([hydrated],.hydrated)),mds-header:not(:is([hydrated],.hydrated)),mds-header-bar:not(:is([hydrated],.hydrated)),mds-help:not(:is([hydrated],.hydrated)),mds-horizontal-scroll:not(:is([hydrated],.hydrated)),mds-hr:not(:is([hydrated],.hydrated)),mds-icon:not(:is([hydrated],.hydrated)),mds-img:not(:is([hydrated],.hydrated)),mds-input:not(:is([hydrated],.hydrated)),mds-input-field:not(:is([hydrated],.hydrated)),mds-input-range:not(:is([hydrated],.hydrated)),mds-input-select:not(:is([hydrated],.hydrated)),mds-input-switch:not(:is([hydrated],.hydrated)),mds-input-tip:not(:is([hydrated],.hydrated)),mds-input-tip-item:not(:is([hydrated],.hydrated)),mds-input-upload:not(:is([hydrated],.hydrated)),mds-keyboard:not(:is([hydrated],.hydrated)),mds-keyboard-key:not(:is([hydrated],.hydrated)),mds-kpi:not(:is([hydrated],.hydrated)),mds-kpi-item:not(:is([hydrated],.hydrated)),mds-label:not(:is([hydrated],.hydrated)),mds-list:not(:is([hydrated],.hydrated)),mds-list-item:not(:is([hydrated],.hydrated)),mds-modal:not(:is([hydrated],.hydrated)),mds-note:not(:is([hydrated],.hydrated)),mds-notification:not(:is([hydrated],.hydrated)),mds-paginator:not(:is([hydrated],.hydrated)),mds-paginator-item:not(:is([hydrated],.hydrated)),mds-pref:not(:is([hydrated],.hydrated)),mds-pref-animation:not(:is([hydrated],.hydrated)),mds-pref-consumption:not(:is([hydrated],.hydrated)),mds-pref-contrast:not(:is([hydrated],.hydrated)),mds-pref-language:not(:is([hydrated],.hydrated)),mds-pref-language-item:not(:is([hydrated],.hydrated)),mds-pref-theme:not(:is([hydrated],.hydrated)),mds-price-table:not(:is([hydrated],.hydrated)),mds-price-table-features:not(:is([hydrated],.hydrated)),mds-price-table-features-cell:not(:is([hydrated],.hydrated)),mds-price-table-features-row:not(:is([hydrated],.hydrated)),mds-price-table-header:not(:is([hydrated],.hydrated)),mds-price-table-list:not(:is([hydrated],.hydrated)),mds-price-table-list-item:not(:is([hydrated],.hydrated)),mds-progress:not(:is([hydrated],.hydrated)),mds-push-notification:not(:is([hydrated],.hydrated)),mds-push-notifications:not(:is([hydrated],.hydrated)),mds-quote:not(:is([hydrated],.hydrated)),mds-separator:not(:is([hydrated],.hydrated)),mds-spinner:not(:is([hydrated],.hydrated)),mds-stepper-bar:not(:is([hydrated],.hydrated)),mds-stepper-bar-item:not(:is([hydrated],.hydrated)),mds-tab:not(:is([hydrated],.hydrated)),mds-tab-bar:not(:is([hydrated],.hydrated)),mds-tab-bar-item:not(:is([hydrated],.hydrated)),mds-tab-item:not(:is([hydrated],.hydrated)),mds-table:not(:is([hydrated],.hydrated)),mds-table-body:not(:is([hydrated],.hydrated)),mds-table-cell:not(:is([hydrated],.hydrated)),mds-table-footer:not(:is([hydrated],.hydrated)),mds-table-header:not(:is([hydrated],.hydrated)),mds-table-header-cell:not(:is([hydrated],.hydrated)),mds-table-row:not(:is([hydrated],.hydrated)),mds-text:not(:is([hydrated],.hydrated)),mds-toast:not(:is([hydrated],.hydrated)),mds-tooltip:not(:is([hydrated],.hydrated)),mds-tree:not(:is([hydrated],.hydrated)),mds-tree-item:not(:is([hydrated],.hydrated)),mds-url-view:not(:is([hydrated],.hydrated)),mds-usage:not(:is([hydrated],.hydrated)),mds-video-wall:not(:is([hydrated],.hydrated)),mds-zero:not(:is([hydrated],.hydrated)){-webkit-animation-duration:0s;animation-duration:0s;border-color:transparent;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;opacity:0;outline-color:transparent;-webkit-transition-delay:0s;transition-delay:0s;-webkit-transition-duration:0s;transition-duration:0s;visibility:hidden}:host-context(.pref-animation-reduce) .input{-webkit-transition-duration:0s;transition-duration:0s}@media (prefers-reduced-motion){:host-context(.pref-animation-system) .input{-webkit-transition-duration:0s;transition-duration:0s}}:host-context(.pref-theme-dark){--mds-input-date-ring:0 0 0 2px rgb(var(--tone-neutral-01) / 0.3);--mds-input-date-background:rgb(var(--tone-neutral-09));--mds-input-date-controls-border:2px solid rgb(var(--tone-neutral-06))}:host-context(.pref-theme-dark) .counter-button:hover{--mds-button-background:rgb(var(--tone-neutral-08))}@media (prefers-color-scheme: dark){:host-context(.pref-theme-system){--mds-input-date-ring:0 0 0 2px rgb(var(--tone-neutral-01) / 0.3);--mds-input-date-background:rgb(var(--tone-neutral-09));--mds-input-date-controls-border:2px solid rgb(var(--tone-neutral-06))}:host-context(.pref-theme-system) .counter-button:hover{--mds-button-background:rgb(var(--tone-neutral-08))}}:host-context(.pref-contrast-more){--mds-input-date-ring:0 0 0 2px rgb(var(--tone-neutral-01) / 0.6);--mds-input-date-background:rgb(var(--tone-neutral-09));--mds-input-date-controls-border:2px solid rgb(var(--tone-neutral-05))}:host-context(.pref-contrast-more) .input::-moz-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input::-webkit-input-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input:-ms-input-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input::-ms-input-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input::placeholder{color:rgb(var(--tone-neutral-03))}@media (prefers-contrast: more){:host-context(.pref-contrast-system){--mds-input-date-ring:0 0 0 2px rgb(var(--tone-neutral-01) / 0.6);--mds-input-date-background:rgb(var(--tone-neutral-09));--mds-input-date-controls-border:2px solid rgb(var(--tone-neutral-05))}:host-context(.pref-contrast-more) .input::-moz-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input::-webkit-input-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input:-ms-input-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input::-ms-input-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input::placeholder{color:rgb(var(--tone-neutral-03))}}@supports (-moz-appearance: none){.action-open-calendar{display:none}:host(:not([slot])) .input{padding-right:1rem}}:host{--mds-input-date-icon-color:var(--variant-primary-03);--mds-input-date-variant-color:0 0 0}:host(:focus-within){--mds-input-date-variant-color:var(--variant-primary-04)}:host([variant=\"info\"]){--mds-input-date-icon-color:var(--status-info-05);--mds-input-date-tip-background:var(--status-info-05);--mds-input-date-variant-color:0 0 0}:host([variant=\"info\"]:focus-within){--mds-input-date-icon-color:var(--status-info-04);--mds-input-date-variant-color:var(--status-info-05)}:host([variant=\"success\"]){--mds-input-date-icon-color:var(--status-success-05);--mds-input-date-tip-background:var(--status-success-05);--mds-input-date-variant-color:0 0 0}:host([variant=\"success\"]:focus-within){--mds-input-date-icon-color:var(--status-success-04);--mds-input-date-variant-color:var(--status-success-05)}:host([variant=\"warning\"]){--mds-input-date-icon-color:var(--status-warning-05);--mds-input-date-tip-background:var(--status-warning-05);--mds-input-date-variant-color:0 0 0}:host([variant=\"warning\"]:focus-within){--mds-input-date-icon-color:var(--status-warning-04);--mds-input-date-variant-color:var(--status-warning-05)}:host([variant=\"error\"]){--mds-input-date-icon-color:var(--status-error-05);--mds-input-date-tip-background:var(--status-error-05);--mds-input-date-variant-color:0 0 0}:host([variant=\"error\"]:focus-within){--mds-input-date-icon-color:var(--status-error-04);--mds-input-date-variant-color:var(--status-error-05)}";
11
+ const mdsInputDateCss = "@tailwind utilities; :host{--mds-input-date-background:rgb(var(--tone-neutral));--mds-input-date-field-background-empty:rgb(var(--status-error-10));--mds-input-date-field-color-empty:rgb(var(--status-error-06));--mds-input-date-icon-color:var(--mds-input-date-variant-color);--mds-input-date-ring:0 0 0 1px rgb(var(--mds-input-date-variant-color) / 0.1);--mds-input-date-shadow:0 1px 3px 0 rgb(var(--mds-input-date-variant-color) / 0.1), 0 1px 2px 0 rgb(var(--mds-input-date-variant-color) / 0.06);--mds-input-date-variant-color:0 0 0;min-height:1.5rem;font-family:Karla, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;font-size:1rem;line-height:1.5rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;gap:0.5rem;color:rgb(var(--tone-neutral-02));container-type:inline-size;display:-ms-flexbox;display:flex;overflow:visible;position:relative}.input::-webkit-calendar-picker-indicator{-webkit-appearance:none;appearance:none;-moz-appearance:textfield;display:none}.input{min-height:1.25rem;font-family:'Roboto Mono', 'Courier New', monospace;font-size:0.875rem;line-height:1.25rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0rem;-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);background-color:transparent;border:0;border-radius:0.5rem;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;overflow:hidden;text-overflow:ellipsis;-webkit-transition-property:background-color, border-color, color, fill, margin, opacity, padding, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, margin, opacity, padding, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, margin, opacity, padding, transform;transition-property:background-color, border-color, box-shadow, color, fill, margin, opacity, padding, transform, -webkit-box-shadow, -webkit-transform;width:-moz-min-content;width:-webkit-min-content;width:min-content}:host([empty]) .input{background-color:var(--mds-input-date-field-background-empty);color:var(--mds-input-date-field-color-empty)}:host([slot]){color:inherit;display:contents}:host([slot]) .input{cursor:text;text-align:center}:host(:not([slot])) .input{border-radius:0.5rem;padding-top:0.75rem;padding-bottom:0.75rem;padding-left:1rem;padding-right:3rem;background-color:var(--mds-input-date-background);-webkit-box-shadow:var(--mds-input-date-ring), var(--mds-input-date-shadow);box-shadow:var(--mds-input-date-ring), var(--mds-input-date-shadow);min-height:3rem;width:100%}:host(:focus-within) .input{outline:2px solid transparent;outline-offset:2px;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);--mds-input-date-ring:0 0 0 3px rgb(var(--mds-input-date-variant-color) / 1);--mds-input-date-shadow:0 4px 6px 3px rgb(var(--mds-input-date-variant-color) / 0.1), 0 2px 4px -1px rgb(var(--mds-input-date-variant-color) / 0.06)}.input:focus{outline:2px solid transparent;outline-offset:2px;-webkit-transition-duration:300ms;transition-duration:300ms;-webkit-transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);transition-timing-function:cubic-bezier(0.19, 1, 0.22, 1);--mds-input-date-ring:0 0 0 3px rgb(var(--mds-input-date-variant-color) / 1);--mds-input-date-shadow:0 4px 6px 3px rgb(var(--mds-input-date-variant-color) / 0.1), 0 2px 4px -1px rgb(var(--mds-input-date-variant-color) / 0.06)}.input::-moz-placeholder{color:rgb(var(--tone-neutral-04))}.input::-webkit-input-placeholder{color:rgb(var(--tone-neutral-04))}.input:-ms-input-placeholder{color:rgb(var(--tone-neutral-04))}.input::-ms-input-placeholder{color:rgb(var(--tone-neutral-04))}.input::placeholder{color:rgb(var(--tone-neutral-04))}.input::-webkit-outer-spin-button,.input::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;display:none;margin:0}.input:disabled{background-color:rgb(var(--tone-neutral-10))}.input:disabled::-moz-placeholder{color:rgb(var(--tone-neutral-05))}.input:disabled::-webkit-input-placeholder{color:rgb(var(--tone-neutral-05))}.input:disabled:-ms-input-placeholder{color:rgb(var(--tone-neutral-05))}.input:disabled::-ms-input-placeholder{color:rgb(var(--tone-neutral-05))}.input:disabled,.input:disabled::placeholder{color:rgb(var(--tone-neutral-05))}.action-open-calendar{--mds-button-color:rgb(var(--mds-input-date-icon-color));aspect-ratio:1;bottom:0;position:absolute;right:0;top:0}:host([disabled]:not([disabled=\"false\"])) .action-open-calendar{-webkit-transform:translate(0.625rem, 0.5rem);transform:translate(0.625rem, 0.5rem)}mds-calendar{min-width:-moz-min-content;min-width:-webkit-min-content;min-width:min-content;width:100cqw}mds-dropdown{padding:0}:host(:not(:is([hydrated],.hydrated))){-webkit-animation-duration:0s;animation-duration:0s;border-color:transparent;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;opacity:0;outline-color:transparent;-webkit-transition-delay:0s;transition-delay:0s;-webkit-transition-duration:0s;transition-duration:0s;visibility:hidden}mds-accordion:not(:is([hydrated],.hydrated)),mds-accordion-item:not(:is([hydrated],.hydrated)),mds-accordion-timer:not(:is([hydrated],.hydrated)),mds-accordion-timer-item:not(:is([hydrated],.hydrated)),mds-author:not(:is([hydrated],.hydrated)),mds-avatar:not(:is([hydrated],.hydrated)),mds-badge:not(:is([hydrated],.hydrated)),mds-banner:not(:is([hydrated],.hydrated)),mds-benchmark-bar:not(:is([hydrated],.hydrated)),mds-bibliography:not(:is([hydrated],.hydrated)),mds-breadcrumb:not(:is([hydrated],.hydrated)),mds-breadcrumb-item:not(:is([hydrated],.hydrated)),mds-button:not(:is([hydrated],.hydrated)),mds-card:not(:is([hydrated],.hydrated)),mds-card-content:not(:is([hydrated],.hydrated)),mds-card-footer:not(:is([hydrated],.hydrated)),mds-card-header:not(:is([hydrated],.hydrated)),mds-card-media:not(:is([hydrated],.hydrated)),mds-chip:not(:is([hydrated],.hydrated)),mds-details:not(:is([hydrated],.hydrated)),mds-dropdown:not(:is([hydrated],.hydrated)),mds-entity:not(:is([hydrated],.hydrated)),mds-file:not(:is([hydrated],.hydrated)),mds-file-preview:not(:is([hydrated],.hydrated)),mds-filter:not(:is([hydrated],.hydrated)),mds-filter-item:not(:is([hydrated],.hydrated)),mds-header:not(:is([hydrated],.hydrated)),mds-header-bar:not(:is([hydrated],.hydrated)),mds-help:not(:is([hydrated],.hydrated)),mds-horizontal-scroll:not(:is([hydrated],.hydrated)),mds-hr:not(:is([hydrated],.hydrated)),mds-icon:not(:is([hydrated],.hydrated)),mds-img:not(:is([hydrated],.hydrated)),mds-input:not(:is([hydrated],.hydrated)),mds-input-field:not(:is([hydrated],.hydrated)),mds-input-range:not(:is([hydrated],.hydrated)),mds-input-select:not(:is([hydrated],.hydrated)),mds-input-switch:not(:is([hydrated],.hydrated)),mds-input-tip:not(:is([hydrated],.hydrated)),mds-input-tip-item:not(:is([hydrated],.hydrated)),mds-input-upload:not(:is([hydrated],.hydrated)),mds-keyboard:not(:is([hydrated],.hydrated)),mds-keyboard-key:not(:is([hydrated],.hydrated)),mds-kpi:not(:is([hydrated],.hydrated)),mds-kpi-item:not(:is([hydrated],.hydrated)),mds-label:not(:is([hydrated],.hydrated)),mds-list:not(:is([hydrated],.hydrated)),mds-list-item:not(:is([hydrated],.hydrated)),mds-modal:not(:is([hydrated],.hydrated)),mds-note:not(:is([hydrated],.hydrated)),mds-notification:not(:is([hydrated],.hydrated)),mds-paginator:not(:is([hydrated],.hydrated)),mds-paginator-item:not(:is([hydrated],.hydrated)),mds-pref:not(:is([hydrated],.hydrated)),mds-pref-animation:not(:is([hydrated],.hydrated)),mds-pref-consumption:not(:is([hydrated],.hydrated)),mds-pref-contrast:not(:is([hydrated],.hydrated)),mds-pref-language:not(:is([hydrated],.hydrated)),mds-pref-language-item:not(:is([hydrated],.hydrated)),mds-pref-theme:not(:is([hydrated],.hydrated)),mds-price-table:not(:is([hydrated],.hydrated)),mds-price-table-features:not(:is([hydrated],.hydrated)),mds-price-table-features-cell:not(:is([hydrated],.hydrated)),mds-price-table-features-row:not(:is([hydrated],.hydrated)),mds-price-table-header:not(:is([hydrated],.hydrated)),mds-price-table-list:not(:is([hydrated],.hydrated)),mds-price-table-list-item:not(:is([hydrated],.hydrated)),mds-progress:not(:is([hydrated],.hydrated)),mds-push-notification:not(:is([hydrated],.hydrated)),mds-push-notifications:not(:is([hydrated],.hydrated)),mds-quote:not(:is([hydrated],.hydrated)),mds-separator:not(:is([hydrated],.hydrated)),mds-spinner:not(:is([hydrated],.hydrated)),mds-stepper-bar:not(:is([hydrated],.hydrated)),mds-stepper-bar-item:not(:is([hydrated],.hydrated)),mds-tab:not(:is([hydrated],.hydrated)),mds-tab-bar:not(:is([hydrated],.hydrated)),mds-tab-bar-item:not(:is([hydrated],.hydrated)),mds-tab-item:not(:is([hydrated],.hydrated)),mds-table:not(:is([hydrated],.hydrated)),mds-table-body:not(:is([hydrated],.hydrated)),mds-table-cell:not(:is([hydrated],.hydrated)),mds-table-footer:not(:is([hydrated],.hydrated)),mds-table-header:not(:is([hydrated],.hydrated)),mds-table-header-cell:not(:is([hydrated],.hydrated)),mds-table-row:not(:is([hydrated],.hydrated)),mds-text:not(:is([hydrated],.hydrated)),mds-toast:not(:is([hydrated],.hydrated)),mds-tooltip:not(:is([hydrated],.hydrated)),mds-tree:not(:is([hydrated],.hydrated)),mds-tree-item:not(:is([hydrated],.hydrated)),mds-url-view:not(:is([hydrated],.hydrated)),mds-usage:not(:is([hydrated],.hydrated)),mds-video-wall:not(:is([hydrated],.hydrated)),mds-zero:not(:is([hydrated],.hydrated)){-webkit-animation-duration:0s;animation-duration:0s;border-color:transparent;-webkit-box-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;opacity:0;outline-color:transparent;-webkit-transition-delay:0s;transition-delay:0s;-webkit-transition-duration:0s;transition-duration:0s;visibility:hidden}:host-context(.pref-animation-reduce) .input{-webkit-transition-duration:0s;transition-duration:0s}@media (prefers-reduced-motion){:host-context(.pref-animation-system) .input{-webkit-transition-duration:0s;transition-duration:0s}}:host-context(.pref-theme-dark){--mds-input-date-ring:0 0 0 2px rgb(var(--tone-neutral-01) / 0.3);--mds-input-date-background:rgb(var(--tone-neutral-09));--mds-input-date-controls-border:2px solid rgb(var(--tone-neutral-06))}:host-context(.pref-theme-dark) .counter-button:hover{--mds-button-background:rgb(var(--tone-neutral-08))}@media (prefers-color-scheme: dark){:host-context(.pref-theme-system){--mds-input-date-ring:0 0 0 2px rgb(var(--tone-neutral-01) / 0.3);--mds-input-date-background:rgb(var(--tone-neutral-09));--mds-input-date-controls-border:2px solid rgb(var(--tone-neutral-06))}:host-context(.pref-theme-system) .counter-button:hover{--mds-button-background:rgb(var(--tone-neutral-08))}}:host-context(.pref-contrast-more){--mds-input-date-ring:0 0 0 2px rgb(var(--tone-neutral-01) / 0.6);--mds-input-date-background:rgb(var(--tone-neutral-09));--mds-input-date-controls-border:2px solid rgb(var(--tone-neutral-05))}:host-context(.pref-contrast-more) .input::-moz-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input::-webkit-input-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input:-ms-input-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input::-ms-input-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input::placeholder{color:rgb(var(--tone-neutral-03))}@media (prefers-contrast: more){:host-context(.pref-contrast-system){--mds-input-date-ring:0 0 0 2px rgb(var(--tone-neutral-01) / 0.6);--mds-input-date-background:rgb(var(--tone-neutral-09));--mds-input-date-controls-border:2px solid rgb(var(--tone-neutral-05))}:host-context(.pref-contrast-more) .input::-moz-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input::-webkit-input-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input:-ms-input-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input::-ms-input-placeholder{color:rgb(var(--tone-neutral-03))}:host-context(.pref-contrast-more) .input::placeholder{color:rgb(var(--tone-neutral-03))}}@supports (-moz-appearance: none){.action-open-calendar{display:none}:host(:not([slot])) .input{padding-right:1rem}}:host{--mds-input-date-icon-color:var(--variant-primary-03);--mds-input-date-variant-color:0 0 0}:host(:focus-within){--mds-input-date-variant-color:var(--variant-primary-04)}:host([variant=\"info\"]){--mds-input-date-icon-color:var(--status-info-05);--mds-input-date-tip-background:var(--status-info-05);--mds-input-date-variant-color:0 0 0}:host([variant=\"info\"]:focus-within){--mds-input-date-icon-color:var(--status-info-04);--mds-input-date-variant-color:var(--status-info-05)}:host([variant=\"success\"]){--mds-input-date-icon-color:var(--status-success-05);--mds-input-date-tip-background:var(--status-success-05);--mds-input-date-variant-color:0 0 0}:host([variant=\"success\"]:focus-within){--mds-input-date-icon-color:var(--status-success-04);--mds-input-date-variant-color:var(--status-success-05)}:host([variant=\"warning\"]){--mds-input-date-icon-color:var(--status-warning-05);--mds-input-date-tip-background:var(--status-warning-05);--mds-input-date-variant-color:0 0 0}:host([variant=\"warning\"]:focus-within){--mds-input-date-icon-color:var(--status-warning-04);--mds-input-date-variant-color:var(--status-warning-05)}:host([variant=\"error\"]){--mds-input-date-icon-color:var(--status-error-05);--mds-input-date-tip-background:var(--status-error-05);--mds-input-date-variant-color:0 0 0}:host([variant=\"error\"]:focus-within){--mds-input-date-icon-color:var(--status-error-04);--mds-input-date-variant-color:var(--status-error-05)}";
12
12
  const MdsInputDateStyle0 = mdsInputDateCss;
13
13
 
14
14
  const MdsInputDate = class {
@@ -15,6 +15,7 @@
15
15
  border-radius: var(--mds-calendar-border-radius);
16
16
  cursor: auto;
17
17
  display: inline-flex;
18
+ inline-size: 100%;
18
19
  max-width: 380px;
19
20
  min-width: -moz-min-content;
20
21
  min-width: min-content;
@@ -71,8 +72,8 @@ nav {
71
72
  display: flex;
72
73
  flex: 0 0 var(--mds-calendar-select-month-or-year-width);
73
74
  height: var(--mds-calendar-select-month-or-year-height);
74
- justify-content: flex-start;
75
75
  inline-size: var(--mds-calendar-select-month-or-year-width);
76
+ justify-content: flex-start;
76
77
  max-block-size: var(--mds-calendar-select-month-or-year-height);
77
78
  max-height: var(--mds-calendar-select-month-or-year-height);
78
79
  max-inline-size: var(--mds-calendar-select-month-or-year-width);
@@ -118,7 +119,8 @@ nav {
118
119
 
119
120
  .week-day-name {
120
121
  align-items: center;
121
- aspect-ratio: 1;
122
+ block-size: 3rem;
123
+ inline-size: 100%;
122
124
  min-height: auto;
123
125
  padding: 0;
124
126
  }
@@ -64,29 +64,46 @@ class IconsSetController {
64
64
  return { set: this._iconsSets.get(iconName.split('/')[0]) };
65
65
  }
66
66
  /**
67
- * recognize svg path pattern and set host and svgPath variable
67
+ * Sets the directory of the svg files. Query and fragment are dropped: the icon name is
68
+ * appended to the path.
68
69
  *
69
- * input path: https://www.abc.com/svg/path
70
- * svgPath = https://www.abc.com/svg/path
70
+ * input path: https://www.abc.com/svg/path/
71
+ * svgPath = https://www.abc.com/svg/path/
71
72
  *
72
- * input path: localhost:9000/svg/path
73
- * svgPath = localhost:9000/svg/path
73
+ * input path: localhost:9000/svg/path/
74
+ * svgPath = //localhost:9000/svg/path/ (with the protocol of the page)
74
75
  *
75
- * input path: /svg/path
76
- * svgPath = {window.location.host}/svg/path
76
+ * input path: /svg/path/ or svg/path/
77
+ * svgPath = unchanged, resolved by `fetch` against the document base URL on each request
77
78
  *
78
- * input path: svg/path
79
+ * input path: empty or not a URL
79
80
  * throw error
80
- *
81
81
  */
82
82
  setSvgPath(svgPath) {
83
- const reg = /^(((https?:\/\/)?[.\w]+(:\d+)?)|\/)([\w/-]+)*/;
84
- const match = reg.exec(svgPath);
85
- if (!match) {
86
- throw Error(`Svg path not recognize ${svgPath}, ensure is a absolute path starting with '/' or a url`);
83
+ const error = Error(`Svg path not recognize ${svgPath}, ensure is a absolute path starting with '/' or a url`);
84
+ if (typeof svgPath !== 'string' || svgPath.trim() === '') {
85
+ throw error;
86
+ }
87
+ const value = svgPath.trim();
88
+ // a host with a port and no scheme (`localhost:9000/svg/`) would be read as the scheme `localhost:`
89
+ const path = /^[\w.-]+:\d+(\/|$)/.test(value) ? `//${value}` : value;
90
+ let url;
91
+ try {
92
+ // the placeholder base only validates a path, which is kept as it is
93
+ url = new URL(path, 'http://localhost/');
94
+ }
95
+ catch (_a) {
96
+ throw error;
87
97
  }
88
98
  if (typeof window !== 'undefined') {
89
- this._svgPath = match[1] ? match[0] : window.location.origin.concat(match[0]);
99
+ if (/^[a-z][a-z\d+.-]*:/i.test(path)) {
100
+ url.search = '';
101
+ url.hash = '';
102
+ this._svgPath = url.href;
103
+ }
104
+ else {
105
+ this._svgPath = path.replace(/[?#].*$/, '');
106
+ }
90
107
  window.dispatchEvent(new Event(this._svgPathUpdate));
91
108
  }
92
109
  }
@@ -114,9 +131,14 @@ class IconsSetController {
114
131
  this.setSvgPath((_a = window.sessionStorage.getItem(IconsSetService._svgPathKey)) !== null && _a !== void 0 ? _a : '');
115
132
  }
116
133
  const src = this._svgPath && !name.startsWith('http') ? this._svgPath.concat(name, '.svg') : name;
134
+ // Memory first: every instance of an icon already loaded skips the IndexedDB round-trip
135
+ if (this.memoryCache[src]) {
136
+ return this.memoryCache[src];
137
+ }
117
138
  const lsCache = await this.isCacheAvailable(src);
118
- if (this.memoryCache[src] || lsCache) {
119
- return this.memoryCache[src] || lsCache;
139
+ if (lsCache) {
140
+ this.memoryCache[src] = lsCache;
141
+ return lsCache;
120
142
  }
121
143
  const response = await fetch(src);
122
144
  if (!response.ok) {
@@ -160,8 +160,9 @@
160
160
  }
161
161
 
162
162
  mds-calendar {
163
- min-width: -moz-max-content;
164
- min-width: max-content;
163
+ min-width: -moz-min-content;
164
+ min-width: min-content;
165
+ width: 100cqw;
165
166
  }
166
167
 
167
168
  mds-dropdown {
@@ -1,4 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
+ import { useEffect, useState } from "react";
3
+ import { expect, waitFor } from "storybook/test";
2
4
  export default {
3
5
  title: 'Form / Input Date',
4
6
  argTypes: {
@@ -68,3 +70,76 @@ export const Disabled = {
68
70
  disabled: true,
69
71
  },
70
72
  };
73
+ // A date field inside a modal with a custom window (mds-banner in slot="window", so the calendar
74
+ // pops out of the window instead of being clipped by the default window). The play opens the
75
+ // modal and the calendar and checks that the calendar takes the field width, capped by
76
+ // the calendar max-width, with seven evenly sized columns, anchored to the end of the field.
77
+ const InsideModalTemplate = () => {
78
+ const [opened, setOpened] = useState(false);
79
+ useEffect(() => {
80
+ const modalElement = document.querySelector('#date-modal');
81
+ const close = () => setOpened(false);
82
+ modalElement === null || modalElement === void 0 ? void 0 : modalElement.addEventListener('mdsModalClose', close);
83
+ modalElement === null || modalElement === void 0 ? void 0 : modalElement.addEventListener('mdsModalHide', close);
84
+ return () => {
85
+ modalElement === null || modalElement === void 0 ? void 0 : modalElement.removeEventListener('mdsModalClose', close);
86
+ modalElement === null || modalElement === void 0 ? void 0 : modalElement.removeEventListener('mdsModalHide', close);
87
+ };
88
+ }, []);
89
+ return (h("div", null, h("mds-button", { id: "open-modal", onClick: () => setOpened(true) }, "Apri la modale"), h("mds-modal", { id: "date-modal", opened: opened ? true : undefined, position: "center" }, h("mds-banner", { slot: "window", class: "max-w-[480px]" }, h("mds-button", { icon: "mi/baseline/close", variant: "dark", tone: "quiet", style: { position: 'absolute', right: '0.5rem', top: '0.5rem' }, onClick: () => setOpened(false) }), h("mds-input-field", { label: "Preparato da" }, h("mds-input", { value: "Mario Rossi" })), h("mds-input-field", { label: "il" }, h("mds-input-date", { id: "modal-date", value: getDate() })), h("mds-input-field", { label: "Commento" }, h("mds-input", { type: "textarea", placeholder: "Commento" }))))));
90
+ };
91
+ // Waits for the dropdown opening transition to stand still before measuring.
92
+ const waitForSettled = (element) => waitFor(() => {
93
+ const { opacity, transform } = getComputedStyle(element);
94
+ expect(opacity).toBe('1');
95
+ expect(['none', 'matrix(1, 0, 0, 1, 0, 0)']).toContain(transform);
96
+ }, { timeout: 5000 });
97
+ // The play starts on the React render, before the Stencil hydration: wait for the components,
98
+ // then for mdsModalShow (the end of the window's opening transition) before opening the calendar.
99
+ const openModalAndCalendar = async ({ canvasElement, userEvent }) => {
100
+ var _a, _b;
101
+ const modal = canvasElement.querySelector('#date-modal');
102
+ const host = canvasElement.querySelector('#modal-date');
103
+ await Promise.all([modal.componentOnReady(), host.componentOnReady()]);
104
+ const dropdown = (_a = host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('mds-dropdown');
105
+ await dropdown.componentOnReady();
106
+ let shown = false;
107
+ modal.addEventListener('mdsModalShow', () => {
108
+ shown = true;
109
+ }, { once: true });
110
+ await userEvent.click(canvasElement.querySelector('#open-modal'));
111
+ await waitFor(() => expect(shown).toBe(true), { timeout: 5000 });
112
+ await userEvent.click((_b = host.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('#calendar-dropdown'));
113
+ await waitFor(() => expect(dropdown).toHaveAttribute('visible'), { timeout: 5000 });
114
+ await waitForSettled(dropdown);
115
+ return {
116
+ host,
117
+ dropdown,
118
+ calendar: dropdown.querySelector('mds-calendar'),
119
+ };
120
+ };
121
+ // The calendar takes the field width (100cqw of the input-date host) capped by its own max-width,
122
+ // with seven evenly sized columns; the dropdown ends at the field's right edge (placement
123
+ // bottom-end), pushed past it by at most the dropdown arrow padding.
124
+ const expectCalendarSizedToField = ({ host, dropdown, calendar }) => {
125
+ var _a;
126
+ const { width: fieldWidth, right: fieldRight } = host.getBoundingClientRect();
127
+ const maxWidth = parseFloat(getComputedStyle(calendar).maxWidth);
128
+ const { width } = calendar.getBoundingClientRect();
129
+ expect(maxWidth).toBeGreaterThan(0);
130
+ expect(width).toBeCloseTo(Math.min(fieldWidth, maxWidth), 0);
131
+ const cells = (_a = calendar.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.month-view__cells');
132
+ const tracks = getComputedStyle(cells).gridTemplateColumns.split(' ').map(parseFloat);
133
+ expect(tracks).toHaveLength(7);
134
+ tracks.forEach(track => expect(track).toBeCloseTo(tracks[0], 0));
135
+ // sub-pixel rounding aside, the dropdown never starts before the field's end
136
+ const overshoot = dropdown.getBoundingClientRect().right - fieldRight;
137
+ expect(overshoot).toBeGreaterThanOrEqual(-1);
138
+ expect(overshoot).toBeLessThanOrEqual(dropdown.arrowPadding);
139
+ };
140
+ export const UseCaseInsideModal = {
141
+ render: InsideModalTemplate,
142
+ play: async (context) => {
143
+ expectCalendarSizedToField(await openModalAndCalendar(context));
144
+ },
145
+ };
@@ -8650,7 +8650,7 @@ luxon.SystemZone = SystemZone;
8650
8650
  luxon.VERSION = VERSION;
8651
8651
  luxon.Zone = Zone;
8652
8652
 
8653
- const mdsCalendarCss = ":host{--mds-calendar-day-number-other-month-color:rgb(var(--tone-neutral-07));--mds-calendar-day-number-color:rgb(var(--tone-neutral-01));--mds-calendar-cell-gap:0.125rem;--mds-calendar-cell-other-month-visibility:visible;--mds-calendar-border-radius:0.5rem;--mds-calendar-background:rgb(var(--tone-neutral));--mds-calendar-padding:1rem;--mds-calendar-select-month-or-year-height:2.25rem;--mds-calendar-select-month-or-year-width:14rem;background-color:rgb(var(--tone-neutral-09));border-radius:var(--mds-calendar-border-radius);cursor:auto;display:-ms-inline-flexbox;display:inline-flex;max-width:380px;min-width:-moz-min-content;min-width:-webkit-min-content;min-width:min-content;overflow:hidden}.calendar-view{background-color:var(--mds-calendar-background);border-radius:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:grid;-ms-flex:1 1 auto;flex:1 1 auto;padding:var(--mds-calendar-padding)}.calendar-preselection{display:none;gap:0.125rem;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content;padding:var(--mds-calendar-padding)}.calendar-preselection--has-preselection{display:grid}nav{display:-ms-flexbox;display:flex;gap:0.5rem;-ms-flex-pack:justify;justify-content:space-between;min-width:0}.action{padding-left:0.5rem;padding-right:0.5rem;-ms-flex-pack:left;justify-content:left;min-width:-moz-min-content;min-width:-webkit-min-content;min-width:min-content}.action-back,.action-forward{-ms-flex-negative:0;flex-shrink:0}.select-month-or-year{-ms-flex-align:stretch;align-items:stretch;background-color:rgb(var(--tone-neutral-09));block-size:var(--mds-calendar-select-month-or-year-height);border-radius:var(--mds-calendar-border-radius);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex:0 0 var(--mds-calendar-select-month-or-year-width);flex:0 0 var(--mds-calendar-select-month-or-year-width);height:var(--mds-calendar-select-month-or-year-height);-ms-flex-pack:start;justify-content:flex-start;inline-size:var(--mds-calendar-select-month-or-year-width);max-block-size:var(--mds-calendar-select-month-or-year-height);max-height:var(--mds-calendar-select-month-or-year-height);max-inline-size:var(--mds-calendar-select-month-or-year-width);min-block-size:var(--mds-calendar-select-month-or-year-height);min-height:var(--mds-calendar-select-month-or-year-height);min-inline-size:var(--mds-calendar-select-month-or-year-width);overflow:hidden}.action-month,.action-year{--mds-button-radius:0;-ms-flex-item-align:stretch;align-self:stretch;block-size:100%;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:default;height:100%;max-block-size:100%;max-height:100%;min-block-size:0;min-height:0;padding-left:0.5rem;padding-right:0.5rem}.action-month{-ms-flex:1 1 auto;flex:1 1 auto;min-width:0}.action-year{-ms-flex:0 0 4.5rem;flex:0 0 4.5rem}.action-month::part(label),.action-year::part(label){overflow:visible;text-overflow:clip;white-space:nowrap}.week-day-name{-ms-flex-align:center;align-items:center;aspect-ratio:1;min-height:auto;padding:0}.month-view{display:grid}.month-view__days-names,.month-view__cells{display:grid;gap:var(--mds-calendar-cell-gap);grid-template-columns:repeat(7, minmax(1px, 100%));min-width:0}.month-view{display:grid}.month-view__month-names,.month-view__years{display:grid;gap:var(--mds-calendar-cell-gap);grid-template-columns:repeat(3, minmax(1px, 100%));min-width:0}";
8653
+ const mdsCalendarCss = ":host{--mds-calendar-day-number-other-month-color:rgb(var(--tone-neutral-07));--mds-calendar-day-number-color:rgb(var(--tone-neutral-01));--mds-calendar-cell-gap:0.125rem;--mds-calendar-cell-other-month-visibility:visible;--mds-calendar-border-radius:0.5rem;--mds-calendar-background:rgb(var(--tone-neutral));--mds-calendar-padding:1rem;--mds-calendar-select-month-or-year-height:2.25rem;--mds-calendar-select-month-or-year-width:14rem;background-color:rgb(var(--tone-neutral-09));border-radius:var(--mds-calendar-border-radius);cursor:auto;display:-ms-inline-flexbox;display:inline-flex;inline-size:100%;max-width:380px;min-width:-moz-min-content;min-width:-webkit-min-content;min-width:min-content;overflow:hidden}.calendar-view{background-color:var(--mds-calendar-background);border-radius:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:grid;-ms-flex:1 1 auto;flex:1 1 auto;padding:var(--mds-calendar-padding)}.calendar-preselection{display:none;gap:0.125rem;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content;padding:var(--mds-calendar-padding)}.calendar-preselection--has-preselection{display:grid}nav{display:-ms-flexbox;display:flex;gap:0.5rem;-ms-flex-pack:justify;justify-content:space-between;min-width:0}.action{padding-left:0.5rem;padding-right:0.5rem;-ms-flex-pack:left;justify-content:left;min-width:-moz-min-content;min-width:-webkit-min-content;min-width:min-content}.action-back,.action-forward{-ms-flex-negative:0;flex-shrink:0}.select-month-or-year{-ms-flex-align:stretch;align-items:stretch;background-color:rgb(var(--tone-neutral-09));block-size:var(--mds-calendar-select-month-or-year-height);border-radius:var(--mds-calendar-border-radius);-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex:0 0 var(--mds-calendar-select-month-or-year-width);flex:0 0 var(--mds-calendar-select-month-or-year-width);height:var(--mds-calendar-select-month-or-year-height);inline-size:var(--mds-calendar-select-month-or-year-width);-ms-flex-pack:start;justify-content:flex-start;max-block-size:var(--mds-calendar-select-month-or-year-height);max-height:var(--mds-calendar-select-month-or-year-height);max-inline-size:var(--mds-calendar-select-month-or-year-width);min-block-size:var(--mds-calendar-select-month-or-year-height);min-height:var(--mds-calendar-select-month-or-year-height);min-inline-size:var(--mds-calendar-select-month-or-year-width);overflow:hidden}.action-month,.action-year{--mds-button-radius:0;-ms-flex-item-align:stretch;align-self:stretch;block-size:100%;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:default;height:100%;max-block-size:100%;max-height:100%;min-block-size:0;min-height:0;padding-left:0.5rem;padding-right:0.5rem}.action-month{-ms-flex:1 1 auto;flex:1 1 auto;min-width:0}.action-year{-ms-flex:0 0 4.5rem;flex:0 0 4.5rem}.action-month::part(label),.action-year::part(label){overflow:visible;text-overflow:clip;white-space:nowrap}.week-day-name{-ms-flex-align:center;align-items:center;block-size:3rem;inline-size:100%;min-height:auto;padding:0}.month-view{display:grid}.month-view__days-names,.month-view__cells{display:grid;gap:var(--mds-calendar-cell-gap);grid-template-columns:repeat(7, minmax(1px, 100%));min-width:0}.month-view{display:grid}.month-view__month-names,.month-view__years{display:grid;gap:var(--mds-calendar-cell-gap);grid-template-columns:repeat(3, minmax(1px, 100%));min-width:0}";
8654
8654
  const MdsCalendarStyle0 = mdsCalendarCss;
8655
8655
 
8656
8656
  const MdsCalendar = /*@__PURE__*/ proxyCustomElement(class MdsCalendar extends HTMLElement {