@maggioli-design-system/mds-progress 2.4.0 → 2.6.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.
Files changed (82) hide show
  1. package/dist/cjs/{index-1d846f7a.js → index-8d1e9d2a.js} +172 -33
  2. package/dist/cjs/loader.cjs.js +2 -11
  3. package/dist/cjs/mds-progress.cjs.entry.js +4 -4
  4. package/dist/cjs/mds-progress.cjs.js +2 -2
  5. package/dist/collection/collection-manifest.json +3 -3
  6. package/dist/collection/common/aria.js +4 -2
  7. package/dist/collection/common/keyboard-manager.js +1 -1
  8. package/dist/collection/common/unit.js +10 -0
  9. package/dist/collection/components/mds-progress/mds-progress.css +22 -22
  10. package/dist/collection/components/mds-progress/mds-progress.js +12 -10
  11. package/dist/collection/components/mds-progress/test/mds-progress.e2e.js +10 -0
  12. package/dist/collection/components/mds-progress/test/mds-progress.stories.js +3 -3
  13. package/dist/collection/dictionary/button.js +5 -1
  14. package/dist/collection/dictionary/icon.js +2 -2
  15. package/dist/collection/dictionary/variant.js +9 -1
  16. package/dist/components/index.d.ts +5 -3
  17. package/dist/components/index.js +1 -2
  18. package/dist/components/mds-progress.js +4 -4
  19. package/dist/documentation.d.ts +421 -0
  20. package/dist/documentation.json +200 -0
  21. package/dist/esm/{index-b254472d.js → index-b34e0eee.js} +172 -33
  22. package/dist/esm/loader.js +3 -12
  23. package/dist/esm/mds-progress.entry.js +4 -4
  24. package/dist/esm/mds-progress.js +3 -3
  25. package/dist/esm-es5/index-b34e0eee.js +2 -0
  26. package/dist/esm-es5/loader.js +1 -1
  27. package/dist/esm-es5/mds-progress.entry.js +1 -1
  28. package/dist/esm-es5/mds-progress.js +1 -1
  29. package/dist/mds-progress/mds-progress.esm.js +1 -1
  30. package/dist/mds-progress/mds-progress.js +2 -6
  31. package/dist/mds-progress/p-1b808e2f.entry.js +1 -0
  32. package/dist/mds-progress/p-747d7cb5.system.js +2 -0
  33. package/dist/mds-progress/p-82d66bad.js +2 -0
  34. package/dist/mds-progress/p-b7abdcbf.system.entry.js +1 -0
  35. package/dist/mds-progress/{p-ae3a1868.system.js → p-da577edc.system.js} +1 -1
  36. package/dist/stats.json +54 -50
  37. package/dist/types/common/unit.d.ts +2 -0
  38. package/dist/types/components/mds-progress/mds-progress.d.ts +3 -3
  39. package/dist/types/components.d.ts +5 -3
  40. package/dist/types/dictionary/button.d.ts +2 -1
  41. package/dist/types/dictionary/variant.d.ts +2 -1
  42. package/dist/types/interface/input-value.d.ts +1 -1
  43. package/dist/types/stencil-public-runtime.d.ts +32 -17
  44. package/dist/types/type/button.d.ts +1 -0
  45. package/dist/types/type/variant.d.ts +1 -0
  46. package/documentation.json +545 -0
  47. package/loader/index.d.ts +2 -2
  48. package/package.json +10 -4
  49. package/readme.md +2 -2
  50. package/src/common/aria.ts +2 -2
  51. package/src/common/keyboard-manager.ts +1 -1
  52. package/src/common/unit.ts +14 -0
  53. package/src/components/mds-progress/css/mds-progress-variant.css +21 -21
  54. package/src/components/mds-progress/mds-progress.css +2 -2
  55. package/src/components/mds-progress/mds-progress.tsx +4 -4
  56. package/src/components/mds-progress/readme.md +2 -2
  57. package/src/components.d.ts +5 -3
  58. package/src/dictionary/button.ts +7 -1
  59. package/src/dictionary/variant.ts +10 -0
  60. package/src/fixtures/icons.json +40 -0
  61. package/src/fixtures/iconsauce.json +38 -0
  62. package/src/interface/input-value.ts +1 -1
  63. package/src/type/button.ts +4 -0
  64. package/src/type/variant.ts +9 -0
  65. package/www/build/mds-progress.esm.js +1 -1
  66. package/www/build/mds-progress.js +2 -6
  67. package/www/build/p-1b808e2f.entry.js +1 -0
  68. package/www/build/p-747d7cb5.system.js +2 -0
  69. package/www/build/p-82d66bad.js +2 -0
  70. package/www/build/p-b7abdcbf.system.entry.js +1 -0
  71. package/www/build/{p-ae3a1868.system.js → p-da577edc.system.js} +1 -1
  72. package/dist/esm/polyfills/css-shim.js +0 -1
  73. package/dist/esm-es5/index-b254472d.js +0 -2
  74. package/dist/mds-progress/p-86f204e8.system.js +0 -2
  75. package/dist/mds-progress/p-d657b3ae.js +0 -2
  76. package/dist/mds-progress/p-e2e4d70b.entry.js +0 -1
  77. package/dist/mds-progress/p-fc6f1e41.system.entry.js +0 -1
  78. package/src/components/mds-progress/test/mds-progress.spec.tsx +0 -19
  79. package/www/build/p-86f204e8.system.js +0 -2
  80. package/www/build/p-d657b3ae.js +0 -2
  81. package/www/build/p-e2e4d70b.entry.js +0 -1
  82. package/www/build/p-fc6f1e41.system.entry.js +0 -1
@@ -58,6 +58,13 @@ const HYDRATED_CSS = '{visibility:hidden}[hydrated]{visibility:inherit}';
58
58
  */
59
59
  const EMPTY_OBJ = {};
60
60
  const isDef = (v) => v != null;
61
+ /**
62
+ * Check whether a value is a 'complex type', defined here as an object or a
63
+ * function.
64
+ *
65
+ * @param o the value to check
66
+ * @returns whether it's a complex type or not
67
+ */
61
68
  const isComplexType = (o) => {
62
69
  // https://jsperf.com/typeof-fn-object/5
63
70
  o = typeof o;
@@ -114,6 +121,7 @@ const h = (nodeName, vnodeData, ...children) => {
114
121
  };
115
122
  walk(children);
116
123
  if (vnodeData) {
124
+ // normalize class / className attributes
117
125
  {
118
126
  const classData = vnodeData.className || vnodeData.class;
119
127
  if (classData) {
@@ -234,9 +242,9 @@ const registerStyle = (scopeId, cssText, allowCS) => {
234
242
  }
235
243
  styles.set(scopeId, style);
236
244
  };
237
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
245
+ const addStyle = (styleContainerNode, cmpMeta, mode) => {
238
246
  var _a;
239
- let scopeId = getScopeId(cmpMeta);
247
+ const scopeId = getScopeId(cmpMeta);
240
248
  const style = styles.get(scopeId);
241
249
  // if an element is NOT connected then getRootNode() will return the wrong root node
242
250
  // so the fallback is to always use the document for the root node in those cases
@@ -251,10 +259,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
251
259
  }
252
260
  if (!appliedStyles.has(scopeId)) {
253
261
  {
254
- {
255
- styleElm = doc.createElement('style');
256
- styleElm.innerHTML = style;
257
- }
262
+ styleElm = doc.createElement('style');
263
+ styleElm.innerHTML = style;
258
264
  // Apply CSP nonce to the style tag if it exists
259
265
  const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
260
266
  if (nonce != null) {
@@ -301,6 +307,21 @@ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
301
307
  *
302
308
  * Modified for Stencil's compiler and vdom
303
309
  */
310
+ /**
311
+ * When running a VDom render set properties present on a VDom node onto the
312
+ * corresponding HTML element.
313
+ *
314
+ * Note that this function has special functionality for the `class`,
315
+ * `style`, `key`, and `ref` attributes, as well as event handlers (like
316
+ * `onClick`, etc). All others are just passed through as-is.
317
+ *
318
+ * @param elm the HTMLElement onto which attributes should be set
319
+ * @param memberName the name of the attribute to set
320
+ * @param oldValue the old value for the attribute
321
+ * @param newValue the new value for the attribute
322
+ * @param isSvg whether we're in an svg context or not
323
+ * @param flags bitflags for Vdom variables
324
+ */
304
325
  const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
305
326
  if (oldValue !== newValue) {
306
327
  let isProp = isMemberInElement(elm, memberName);
@@ -481,15 +502,16 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
481
502
  * @param vnodes a list of virtual DOM nodes to remove
482
503
  * @param startIdx the index at which to start removing nodes (inclusive)
483
504
  * @param endIdx the index at which to stop removing nodes (inclusive)
484
- * @param vnode a VNode
485
- * @param elm an element
486
505
  */
487
- const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
488
- for (; startIdx <= endIdx; ++startIdx) {
489
- if ((vnode = vnodes[startIdx])) {
490
- elm = vnode.$elm$;
491
- // remove the vnode's element from the dom
492
- elm.remove();
506
+ const removeVnodes = (vnodes, startIdx, endIdx) => {
507
+ for (let index = startIdx; index <= endIdx; ++index) {
508
+ const vnode = vnodes[index];
509
+ if (vnode) {
510
+ const elm = vnode.$elm$;
511
+ if (elm) {
512
+ // remove the vnode's element from the dom
513
+ elm.remove();
514
+ }
493
515
  }
494
516
  }
495
517
  };
@@ -737,17 +759,44 @@ const patch = (oldVNode, newVNode) => {
737
759
  * @param hostRef data needed to root and render the virtual DOM tree, such as
738
760
  * the DOM node into which it should be rendered.
739
761
  * @param renderFnResults the virtual DOM nodes to be rendered
762
+ * @param isInitialLoad whether or not this is the first call after page load
740
763
  */
741
- const renderVdom = (hostRef, renderFnResults) => {
764
+ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
742
765
  const hostElm = hostRef.$hostElement$;
743
766
  const cmpMeta = hostRef.$cmpMeta$;
744
767
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
768
+ // if `renderFnResults` is a Host node then we can use it directly. If not,
769
+ // we need to call `h` again to wrap the children of our component in a
770
+ // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
771
+ // implicitly that the top-level vdom node is 1) an only child and 2)
772
+ // contains attrs that need to be set on the host element.
745
773
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
746
774
  hostTagName = hostElm.tagName;
747
775
  if (cmpMeta.$attrsToReflect$) {
748
776
  rootVnode.$attrs$ = rootVnode.$attrs$ || {};
749
777
  cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
750
778
  }
779
+ // On the first render and *only* on the first render we want to check for
780
+ // any attributes set on the host element which are also set on the vdom
781
+ // node. If we find them, we override the value on the VDom node attrs with
782
+ // the value from the host element, which allows developers building apps
783
+ // with Stencil components to override e.g. the `role` attribute on a
784
+ // component even if it's already set on the `Host`.
785
+ if (isInitialLoad && rootVnode.$attrs$) {
786
+ for (const key of Object.keys(rootVnode.$attrs$)) {
787
+ // We have a special implementation in `setAccessor` for `style` and
788
+ // `class` which reconciles values coming from the VDom with values
789
+ // already present on the DOM element, so we don't want to override those
790
+ // attributes on the VDom tree with values from the host element if they
791
+ // are present.
792
+ //
793
+ // Likewise, `ref` and `key` are special internal values for the Stencil
794
+ // runtime and we don't want to override those either.
795
+ if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
796
+ rootVnode.$attrs$[key] = hostElm[key];
797
+ }
798
+ }
799
+ }
751
800
  rootVnode.$tag$ = null;
752
801
  rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
753
802
  hostRef.$vnode$ = rootVnode;
@@ -778,20 +827,86 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
778
827
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
779
828
  return writeTask(dispatch) ;
780
829
  };
830
+ /**
831
+ * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
832
+ * component lifecycle methods like `componentWillLoad` as well as
833
+ * {@link updateComponent}, which will kick off the virtual DOM re-render.
834
+ *
835
+ * @param hostRef a reference to a host DOM node
836
+ * @param isInitialLoad whether we're on the initial load or not
837
+ * @returns an empty Promise which is used to enqueue a series of operations for
838
+ * the component
839
+ */
781
840
  const dispatchHooks = (hostRef, isInitialLoad) => {
782
841
  const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
783
842
  const instance = hostRef.$lazyInstance$ ;
784
- let promise;
843
+ // We're going to use this variable together with `enqueue` to implement a
844
+ // little promise-based queue. We start out with it `undefined`. When we add
845
+ // the first function to the queue we'll set this variable to be that
846
+ // function's return value. When we attempt to add subsequent values to the
847
+ // queue we'll check that value and, if it was a `Promise`, we'll then chain
848
+ // the new function off of that `Promise` using `.then()`. This will give our
849
+ // queue two nice properties:
850
+ //
851
+ // 1. If all functions added to the queue are synchronous they'll be called
852
+ // synchronously right away.
853
+ // 2. If all functions added to the queue are asynchronous they'll all be
854
+ // called in order after `dispatchHooks` exits.
855
+ let maybePromise;
785
856
  if (isInitialLoad) {
786
857
  {
787
- promise = safeCall(instance, 'componentWillLoad');
858
+ // If `componentWillLoad` returns a `Promise` then we want to wait on
859
+ // whatever's going on in that `Promise` before we launch into
860
+ // rendering the component, doing other lifecycle stuff, etc. So
861
+ // in that case we assign the returned promise to the variable we
862
+ // declared above to hold a possible 'queueing' Promise
863
+ maybePromise = safeCall(instance, 'componentWillLoad');
788
864
  }
789
865
  }
790
866
  endSchedule();
791
- return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
867
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
792
868
  };
869
+ /**
870
+ * This function uses a Promise to implement a simple first-in, first-out queue
871
+ * of functions to be called.
872
+ *
873
+ * The queue is ordered on the basis of the first argument. If it's
874
+ * `undefined`, then nothing is on the queue yet, so the provided function can
875
+ * be called synchronously (although note that this function may return a
876
+ * `Promise`). The idea is that then the return value of that enqueueing
877
+ * operation is kept around, so that if it was a `Promise` then subsequent
878
+ * functions can be enqueued by calling this function again with that `Promise`
879
+ * as the first argument.
880
+ *
881
+ * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
882
+ * @param fn a function to enqueue
883
+ * @returns either a `Promise` or the return value of the provided function
884
+ */
885
+ const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
886
+ /**
887
+ * Check that a value is a `Promise`. To check, we first see if the value is an
888
+ * instance of the `Promise` global. In a few circumstances, in particular if
889
+ * the global has been overwritten, this is could be misleading, so we also do
890
+ * a little 'duck typing' check to see if the `.then` property of the value is
891
+ * defined and a function.
892
+ *
893
+ * @param maybePromise it might be a promise!
894
+ * @returns whether it is or not
895
+ */
896
+ const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
897
+ (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
898
+ /**
899
+ * Update a component given reference to its host elements and so on.
900
+ *
901
+ * @param hostRef an object containing references to the element's host node,
902
+ * VDom nodes, and other metadata
903
+ * @param instance a reference to the underlying host element where it will be
904
+ * rendered
905
+ * @param isInitialLoad whether or not this function is being called as part of
906
+ * the first render cycle
907
+ */
793
908
  const updateComponent = async (hostRef, instance, isInitialLoad) => {
794
- // updateComponent
909
+ var _a;
795
910
  const elm = hostRef.$hostElement$;
796
911
  const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
797
912
  const rc = elm['s-rc'];
@@ -801,7 +916,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
801
916
  }
802
917
  const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
803
918
  {
804
- callRender(hostRef, instance);
919
+ callRender(hostRef, instance, elm, isInitialLoad);
805
920
  }
806
921
  if (rc) {
807
922
  // ok, so turns out there are some child host elements
@@ -813,7 +928,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
813
928
  endRender();
814
929
  endUpdate();
815
930
  {
816
- const childrenPromises = elm['s-p'];
931
+ const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
817
932
  const postUpdate = () => postUpdateComponent(hostRef);
818
933
  if (childrenPromises.length === 0) {
819
934
  postUpdate();
@@ -825,7 +940,19 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
825
940
  }
826
941
  }
827
942
  };
828
- const callRender = (hostRef, instance, elm) => {
943
+ /**
944
+ * Handle making the call to the VDom renderer with the proper context given
945
+ * various build variables
946
+ *
947
+ * @param hostRef an object containing references to the element's host node,
948
+ * VDom nodes, and other metadata
949
+ * @param instance a reference to the underlying host element where it will be
950
+ * rendered
951
+ * @param elm the Host element for the component
952
+ * @param isInitialLoad whether or not this function is being called as part of
953
+ * @returns an empty promise
954
+ */
955
+ const callRender = (hostRef, instance, elm, isInitialLoad) => {
829
956
  try {
830
957
  instance = instance.render() ;
831
958
  {
@@ -840,7 +967,7 @@ const callRender = (hostRef, instance, elm) => {
840
967
  // or we need to update the css class/attrs on the host element
841
968
  // DOM WRITE!
842
969
  {
843
- renderVdom(hostRef, instance);
970
+ renderVdom(hostRef, instance, isInitialLoad);
844
971
  }
845
972
  }
846
973
  }
@@ -907,9 +1034,6 @@ const safeCall = (instance, method, arg) => {
907
1034
  }
908
1035
  return undefined;
909
1036
  };
910
- const then = (promise, thenFn) => {
911
- return promise && promise.then ? promise.then(thenFn) : thenFn();
912
- };
913
1037
  const addHydratedFlag = (elm) => elm.setAttribute('hydrated', '')
914
1038
  ;
915
1039
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
@@ -1016,12 +1140,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1016
1140
  // customElements.define('my-component', MyComponent);
1017
1141
  // </script>
1018
1142
  // ```
1019
- // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
1143
+ // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
1020
1144
  // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1021
1145
  // to the value that was set inline i.e. "some-value" from above example. When
1022
- // the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
1146
+ // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
1023
1147
  //
1024
- // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
1148
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
1025
1149
  // by connectedCallback as this attributeChangedCallback will not fire.
1026
1150
  //
1027
1151
  // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
@@ -1063,9 +1187,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1063
1187
  const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1064
1188
  // initializeComponent
1065
1189
  if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1190
+ // Let the runtime know that the component has been initialized
1191
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1066
1192
  {
1067
- // we haven't initialized this element yet
1068
- hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1069
1193
  // lazy loaded components
1070
1194
  // request the component's implementation to be
1071
1195
  // wired up with the host element
@@ -1138,6 +1262,8 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1138
1262
  schedule();
1139
1263
  }
1140
1264
  };
1265
+ const fireConnectedCallback = (instance) => {
1266
+ };
1141
1267
  const connectedCallback = (elm) => {
1142
1268
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1143
1269
  const hostRef = getHostRef(elm);
@@ -1176,12 +1302,25 @@ const connectedCallback = (elm) => {
1176
1302
  initializeComponent(elm, hostRef, cmpMeta);
1177
1303
  }
1178
1304
  }
1305
+ else {
1306
+ // fire off connectedCallback() on component instance
1307
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
1308
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1309
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1310
+ }
1311
+ }
1179
1312
  endConnected();
1180
1313
  }
1181
1314
  };
1182
- const disconnectedCallback = (elm) => {
1315
+ const disconnectInstance = (instance) => {
1316
+ };
1317
+ const disconnectedCallback = async (elm) => {
1183
1318
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1184
- getHostRef(elm);
1319
+ const hostRef = getHostRef(elm);
1320
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
1321
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1322
+ hostRef.$onReadyPromise$.then(() => disconnectInstance());
1323
+ }
1185
1324
  }
1186
1325
  };
1187
1326
  const bootstrapLazy = (lazyBundles, options = {}) => {
@@ -2,20 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1d846f7a.js');
6
-
7
- /*
8
- Stencil Client Patch Esm v2.22.2 | MIT Licensed | https://stenciljs.com
9
- */
10
- const patchEsm = () => {
11
- return index.promiseResolve();
12
- };
5
+ const index = require('./index-8d1e9d2a.js');
13
6
 
14
7
  const defineCustomElements = (win, options) => {
15
- if (typeof window === 'undefined') return Promise.resolve();
16
- return patchEsm().then(() => {
8
+ if (typeof window === 'undefined') return undefined;
17
9
  return index.bootstrapLazy([["mds-progress.cjs",[[1,"mds-progress",{"progress":[2],"direction":[513],"variant":[513],"steps":[1],"currentStep":[32]}]]]], options);
18
- });
19
10
  };
20
11
 
21
12
  exports.setNonce = index.setNonce;
@@ -2,18 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1d846f7a.js');
5
+ const index = require('./index-8d1e9d2a.js');
6
6
 
7
- const mdsProgressCss = "@tailwind utilities; :host{--mds-progress-background:rgb(var(--tone-neutral-08));--mds-progress-color:rgb(var(--brand-maggioli-03));--mds-progress-duration:750ms;--mds-progress-radius:0.5rem;--mds-progress-thickness:0.5rem;display:-ms-flexbox;display:flex;width:100%;overflow:hidden;-webkit-transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;-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:150ms;transition-duration:150ms;background-color:var(--mds-progress-background);border-radius:var(--mds-progress-radius);height:var(--mds-progress-thickness);min-width:var(--mds-progress-thickness)}:host([direction=vertical]){height:100%;width:auto;-ms-flex-direction:column;flex-direction:column;height:unset;min-height:var(--mds-progress-thickness);width:var(--mds-progress-thickness)}.progress{-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:var(--mds-progress-color);border-radius:var(--mds-progress-radius);-webkit-transition-duration:var(--mds-progress-duration);transition-duration:var(--mds-progress-duration);-webkit-transition-property:background-color, flex-grow;transition-property:background-color, flex-grow;transition-property:background-color, flex-grow, -ms-flex-positive}.fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([variant=dark]){--color:rgb(var(--tone-neutral-04));--background:rgb(var(--tone-neutral-08))}:host([variant=light]){--color:rgb(var(--tone-neutral));--background:rgb(var(--tone-neutral-05))}:host([variant=error]){--color:rgb(var(--status-error-06));--background:rgb(var(--status-error-09))}:host([variant=warning]){--color:rgb(var(--status-warning-06));--background:rgb(var(--status-warning-09))}:host([variant=success]){--color:rgb(var(--status-success-06));--background:rgb(var(--status-success-09))}:host([variant=info]){--color:rgb(var(--status-info-06));--background:rgb(var(--status-info-09))}:host([variant=primary]){--color:rgb(var(--brand-maggioli-03));--background:rgb(var(--tone-neutral-08))}";
7
+ const mdsProgressCss = "@tailwind utilities; :host{--mds-progress-background:rgb(var(--tone-neutral-08));--mds-progress-color:rgb(var(--brand-maggioli-03));--mds-progress-duration:750ms;--mds-progress-radius:0.5rem;--mds-progress-thickness:0.5rem;display:-ms-flexbox;display:flex;width:100%;overflow:hidden;-webkit-transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;-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:150ms;transition-duration:150ms;background-color:var(--mds-progress-background);border-radius:var(--mds-progress-radius);height:var(--mds-progress-thickness);min-width:var(--mds-progress-thickness)}:host([direction=\"vertical\"]){height:100%;width:auto;-ms-flex-direction:column;flex-direction:column;height:unset;min-height:var(--mds-progress-thickness);width:var(--mds-progress-thickness)}.progress{-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:var(--mds-progress-color);border-radius:var(--mds-progress-radius);-webkit-transition-duration:var(--mds-progress-duration);transition-duration:var(--mds-progress-duration);-webkit-transition-property:background-color, flex-grow;transition-property:background-color, flex-grow;transition-property:background-color, flex-grow, -ms-flex-positive}.fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([variant=\"dark\"]){--mds-progress-color:rgb(var(--tone-neutral-04));--mds-progress-background:rgb(var(--tone-neutral-08))}:host([variant=\"light\"]){--mds-progress-color:rgb(var(--tone-neutral));--mds-progress-background:rgb(var(--tone-neutral-05))}:host([variant=\"error\"]){--mds-progress-color:rgb(var(--status-error-06));--mds-progress-background:rgb(var(--status-error-09))}:host([variant=\"warning\"]){--mds-progress-color:rgb(var(--status-warning-06));--mds-progress-background:rgb(var(--status-warning-09))}:host([variant=\"success\"]){--mds-progress-color:rgb(var(--status-success-06));--mds-progress-background:rgb(var(--status-success-09))}:host([variant=\"info\"]){--mds-progress-color:rgb(var(--status-info-06));--mds-progress-background:rgb(var(--status-info-09))}:host([variant=\"primary\"]){--mds-progress-color:rgb(var(--brand-maggioli-03));--mds-progress-background:rgb(var(--tone-neutral-08))}";
8
8
 
9
9
  const MdsProgress = class {
10
10
  constructor(hostRef) {
11
11
  index.registerInstance(this, hostRef);
12
- this.stepsList = [];
12
+ this.stepsList = new Array();
13
13
  this.currentStep = undefined;
14
14
  this.progress = 0;
15
15
  this.direction = 'horizontal';
16
- this.variant = 'dark';
16
+ this.variant = 'primary';
17
17
  this.steps = 'Inizio,Un quarto,Metà,Tre quarti,Fine';
18
18
  }
19
19
  componentWillLoad() {
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1d846f7a.js');
5
+ const index = require('./index-8d1e9d2a.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Browser v2.22.2 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.2.1 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchBrowser = () => {
11
11
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-progress.cjs.js', document.baseURI).href));
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "entries": [
3
- "./components/mds-progress/mds-progress.js"
3
+ "components/mds-progress/mds-progress.js"
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "2.22.2",
8
- "typescriptVersion": "4.9.4"
7
+ "version": "4.2.1",
8
+ "typescriptVersion": "5.1.6"
9
9
  },
10
10
  "collections": [],
11
11
  "bundles": []
@@ -6,11 +6,13 @@ const hash = (s) => {
6
6
  return h.toString();
7
7
  };
8
8
  const unslugName = (name) => {
9
- return name.split('/').slice(-1).pop().replace(/-/g, ' ');
9
+ var _a, _b, _c;
10
+ return (_c = (_b = (_a = name.split('/')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.replace(/-/g, ' ')) !== null && _c !== void 0 ? _c : name;
10
11
  };
11
12
  const setAttributeIfEmpty = (element, attribute, value) => {
13
+ var _a;
12
14
  if (element.hasAttribute(attribute)) {
13
- return element.getAttribute(attribute);
15
+ return (_a = element.getAttribute(attribute)) !== null && _a !== void 0 ? _a : '';
14
16
  }
15
17
  element.setAttribute(attribute, value);
16
18
  return value;
@@ -31,7 +31,7 @@ export class KeyboardManager {
31
31
  }
32
32
  };
33
33
  this.detachEscapeBehavior = () => {
34
- this.escapeCallback = null;
34
+ this.escapeCallback = () => { return; };
35
35
  if (typeof window !== undefined) {
36
36
  window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
37
37
  }
@@ -0,0 +1,10 @@
1
+ const cssDurationToMilliseconds = (duration, defaultValue = 1000) => {
2
+ if (duration.includes('s')) {
3
+ return Number(duration.replace('s', '')) * 1000;
4
+ }
5
+ if (duration.includes('ms')) {
6
+ return Number(duration.replace('s', ''));
7
+ }
8
+ return defaultValue;
9
+ };
10
+ export { cssDurationToMilliseconds, };
@@ -28,7 +28,7 @@
28
28
  min-width: var(--mds-progress-thickness);
29
29
  }
30
30
 
31
- :host ( [direction=vertical] ){
31
+ :host( [direction="vertical"] ){
32
32
 
33
33
  height: 100%;
34
34
 
@@ -75,45 +75,45 @@
75
75
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
76
76
  }
77
77
 
78
- :host ( [variant=dark] ) {
78
+ :host( [variant="dark"] ) {
79
79
 
80
- --color: rgb(var(--tone-neutral-04));
81
- --background: rgb(var(--tone-neutral-08));
80
+ --mds-progress-color: rgb(var(--tone-neutral-04));
81
+ --mds-progress-background: rgb(var(--tone-neutral-08));
82
82
  }
83
83
 
84
- :host ( [variant=light] ) {
84
+ :host( [variant="light"] ) {
85
85
 
86
- --color: rgb(var(--tone-neutral));
87
- --background: rgb(var(--tone-neutral-05));
86
+ --mds-progress-color: rgb(var(--tone-neutral));
87
+ --mds-progress-background: rgb(var(--tone-neutral-05));
88
88
  }
89
89
 
90
- :host ( [variant=error] ) {
90
+ :host( [variant="error"] ) {
91
91
 
92
- --color: rgb(var(--status-error-06));
93
- --background: rgb(var(--status-error-09));
92
+ --mds-progress-color: rgb(var(--status-error-06));
93
+ --mds-progress-background: rgb(var(--status-error-09));
94
94
  }
95
95
 
96
- :host ( [variant=warning] ) {
96
+ :host( [variant="warning"] ) {
97
97
 
98
- --color: rgb(var(--status-warning-06));
99
- --background: rgb(var(--status-warning-09));
98
+ --mds-progress-color: rgb(var(--status-warning-06));
99
+ --mds-progress-background: rgb(var(--status-warning-09));
100
100
  }
101
101
 
102
- :host ( [variant=success] ) {
102
+ :host( [variant="success"] ) {
103
103
 
104
- --color: rgb(var(--status-success-06));
105
- --background: rgb(var(--status-success-09));
104
+ --mds-progress-color: rgb(var(--status-success-06));
105
+ --mds-progress-background: rgb(var(--status-success-09));
106
106
  }
107
107
 
108
- :host ( [variant=info] ) {
108
+ :host( [variant="info"] ) {
109
109
 
110
- --color: rgb(var(--status-info-06));
111
- --background: rgb(var(--status-info-09));
110
+ --mds-progress-color: rgb(var(--status-info-06));
111
+ --mds-progress-background: rgb(var(--status-info-09));
112
112
  }
113
113
 
114
- :host ( [variant=primary] ) {
114
+ :host( [variant="primary"] ) {
115
115
 
116
- --color: rgb(var(--brand-maggioli-03));
117
- --background: rgb(var(--tone-neutral-08));
116
+ --mds-progress-color: rgb(var(--brand-maggioli-03));
117
+ --mds-progress-background: rgb(var(--tone-neutral-08));
118
118
  }
119
119
 
@@ -1,11 +1,11 @@
1
- import { Host, h } from '@stencil/core';
1
+ import { Host, h } from "@stencil/core";
2
2
  export class MdsProgress {
3
3
  constructor() {
4
- this.stepsList = [];
4
+ this.stepsList = new Array();
5
5
  this.currentStep = undefined;
6
6
  this.progress = 0;
7
7
  this.direction = 'horizontal';
8
- this.variant = 'dark';
8
+ this.variant = 'primary';
9
9
  this.steps = 'Inizio,Un quarto,Metà,Tre quarti,Fine';
10
10
  }
11
11
  componentWillLoad() {
@@ -52,7 +52,7 @@ export class MdsProgress {
52
52
  "references": {}
53
53
  },
54
54
  "required": false,
55
- "optional": true,
55
+ "optional": false,
56
56
  "docs": {
57
57
  "tags": [],
58
58
  "text": "A value between 0 and 1 that rapresents the status progress"
@@ -66,11 +66,12 @@ export class MdsProgress {
66
66
  "mutable": false,
67
67
  "complexType": {
68
68
  "original": "DirectionType",
69
- "resolved": "\"horizontal\" | \"vertical\"",
69
+ "resolved": "\"horizontal\" | \"vertical\" | undefined",
70
70
  "references": {
71
71
  "DirectionType": {
72
72
  "location": "import",
73
- "path": "./meta/types"
73
+ "path": "./meta/types",
74
+ "id": "src/components/mds-progress/meta/types.ts::DirectionType"
74
75
  }
75
76
  }
76
77
  },
@@ -93,19 +94,20 @@ export class MdsProgress {
93
94
  "references": {
94
95
  "ThemeVariantType": {
95
96
  "location": "import",
96
- "path": "@type/variant"
97
+ "path": "@type/variant",
98
+ "id": "src/type/variant.ts::ThemeVariantType"
97
99
  }
98
100
  }
99
101
  },
100
102
  "required": false,
101
- "optional": true,
103
+ "optional": false,
102
104
  "docs": {
103
105
  "tags": [],
104
106
  "text": "Sets the theme variant colors"
105
107
  },
106
108
  "attribute": "variant",
107
109
  "reflect": true,
108
- "defaultValue": "'dark'"
110
+ "defaultValue": "'primary'"
109
111
  },
110
112
  "steps": {
111
113
  "type": "string",
@@ -116,7 +118,7 @@ export class MdsProgress {
116
118
  "references": {}
117
119
  },
118
120
  "required": false,
119
- "optional": true,
121
+ "optional": false,
120
122
  "docs": {
121
123
  "tags": [],
122
124
  "text": "Sets the steps that can be pronounced by accessibility technologies"
@@ -0,0 +1,10 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ describe('mds-progress', () => {
3
+ it('renders', async () => {
4
+ const page = await newE2EPage();
5
+ await page.setContent('<mds-progress></mds-progress>');
6
+ const element = await page.find('mds-progress');
7
+ expect(element).toHaveAttribute('hydrated');
8
+ expect(true).toBe(true);
9
+ });
10
+ });
@@ -1,6 +1,6 @@
1
- import { directionDictionary } from '../meta/dictionary';
2
- import { themeVariantDictionary } from '@dictionary/variant';
3
- import { h } from '@stencil/core';
1
+ import { directionDictionary } from "../meta/dictionary";
2
+ import { themeVariantDictionary } from "../../../dictionary/variant";
3
+ import { h } from "@stencil/core";
4
4
  export default {
5
5
  title: 'UI / Progress',
6
6
  argTypes: {