@maggioli-design-system/mds-progress 2.5.0 → 2.6.1

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 (78) hide show
  1. package/dist/cjs/{index-1d846f7a.js → index-91e137c8.js} +216 -47
  2. package/dist/cjs/loader.cjs.js +3 -12
  3. package/dist/cjs/mds-progress.cjs.entry.js +2 -2
  4. package/dist/cjs/mds-progress.cjs.js +3 -3
  5. package/dist/collection/collection-manifest.json +3 -3
  6. package/dist/collection/common/aria.js +9 -1
  7. package/dist/collection/common/unit.js +10 -0
  8. package/dist/collection/components/mds-progress/mds-progress.css +4 -10
  9. package/dist/collection/components/mds-progress/mds-progress.js +5 -3
  10. package/dist/collection/components/mds-progress/test/mds-progress.e2e.js +10 -0
  11. package/dist/collection/components/mds-progress/test/mds-progress.stories.js +3 -3
  12. package/dist/collection/dictionary/button.js +5 -1
  13. package/dist/collection/dictionary/icon.js +2 -2
  14. package/dist/collection/dictionary/variant.js +9 -1
  15. package/dist/components/index.d.ts +5 -3
  16. package/dist/components/index.js +1 -2
  17. package/dist/components/mds-progress.js +5 -2
  18. package/dist/documentation.d.ts +361 -88
  19. package/dist/documentation.json +49 -5
  20. package/dist/esm/{index-b254472d.js → index-fbed50ee.js} +216 -47
  21. package/dist/esm/loader.js +4 -13
  22. package/dist/esm/mds-progress.entry.js +2 -2
  23. package/dist/esm/mds-progress.js +4 -4
  24. package/dist/esm-es5/index-fbed50ee.js +2 -0
  25. package/dist/esm-es5/loader.js +1 -1
  26. package/dist/esm-es5/mds-progress.entry.js +1 -1
  27. package/dist/esm-es5/mds-progress.js +1 -1
  28. package/dist/mds-progress/mds-progress.esm.js +1 -1
  29. package/dist/mds-progress/mds-progress.js +2 -6
  30. package/dist/mds-progress/p-0f4e300d.entry.js +1 -0
  31. package/dist/mds-progress/p-83f968eb.js +2 -0
  32. package/dist/mds-progress/p-bce00c63.system.entry.js +1 -0
  33. package/dist/mds-progress/p-e8e08781.system.js +2 -0
  34. package/dist/mds-progress/p-fdd5b8c4.system.js +1 -0
  35. package/dist/stats.json +44 -40
  36. package/dist/types/common/aria.d.ts +2 -1
  37. package/dist/types/common/unit.d.ts +2 -0
  38. package/dist/types/components.d.ts +2 -0
  39. package/dist/types/dictionary/button.d.ts +2 -1
  40. package/dist/types/dictionary/variant.d.ts +2 -1
  41. package/dist/types/stencil-public-runtime.d.ts +32 -17
  42. package/dist/types/type/button.d.ts +1 -0
  43. package/dist/types/type/variant.d.ts +1 -0
  44. package/documentation.json +391 -7
  45. package/loader/index.d.ts +2 -2
  46. package/package.json +4 -4
  47. package/readme.md +3 -1
  48. package/src/common/aria.ts +12 -0
  49. package/src/common/unit.ts +14 -0
  50. package/src/components/mds-progress/mds-progress.css +6 -11
  51. package/src/components/mds-progress/readme.md +1 -1
  52. package/src/components.d.ts +2 -0
  53. package/src/dictionary/button.ts +7 -1
  54. package/src/dictionary/variant.ts +10 -0
  55. package/src/fixtures/icons.json +41 -0
  56. package/src/fixtures/iconsauce.json +38 -0
  57. package/src/type/button.ts +4 -0
  58. package/src/type/variant.ts +9 -0
  59. package/www/build/mds-progress.esm.js +1 -1
  60. package/www/build/mds-progress.js +2 -6
  61. package/www/build/p-0f4e300d.entry.js +1 -0
  62. package/www/build/p-83f968eb.js +2 -0
  63. package/www/build/p-bce00c63.system.entry.js +1 -0
  64. package/www/build/p-e8e08781.system.js +2 -0
  65. package/www/build/p-fdd5b8c4.system.js +1 -0
  66. package/dist/esm/polyfills/css-shim.js +0 -1
  67. package/dist/esm-es5/index-b254472d.js +0 -2
  68. package/dist/mds-progress/p-86f204e8.system.js +0 -2
  69. package/dist/mds-progress/p-a3294ed0.system.js +0 -1
  70. package/dist/mds-progress/p-a8e1043f.entry.js +0 -1
  71. package/dist/mds-progress/p-d657b3ae.js +0 -2
  72. package/dist/mds-progress/p-de434aaf.system.entry.js +0 -1
  73. package/src/components/mds-progress/test/mds-progress.spec.tsx +0 -19
  74. package/www/build/p-86f204e8.system.js +0 -2
  75. package/www/build/p-a3294ed0.system.js +0 -1
  76. package/www/build/p-a8e1043f.entry.js +0 -1
  77. package/www/build/p-d657b3ae.js +0 -2
  78. package/www/build/p-de434aaf.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);
@@ -966,6 +1090,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
966
1090
  * @returns a reference to the same constructor passed in (but now mutated)
967
1091
  */
968
1092
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1093
+ var _a;
969
1094
  if (cmpMeta.$members$) {
970
1095
  if (Cstr.watchers) {
971
1096
  cmpMeta.$watchers$ = Cstr.watchers;
@@ -993,7 +1118,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
993
1118
  });
994
1119
  if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
995
1120
  const attrNameToPropName = new Map();
996
- prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1121
+ prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
997
1122
  plt.jmp(() => {
998
1123
  const propName = attrNameToPropName.get(attrName);
999
1124
  // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
@@ -1016,12 +1141,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1016
1141
  // customElements.define('my-component', MyComponent);
1017
1142
  // </script>
1018
1143
  // ```
1019
- // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
1144
+ // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
1020
1145
  // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1021
1146
  // 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"
1147
+ // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
1023
1148
  //
1024
- // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
1149
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
1025
1150
  // by connectedCallback as this attributeChangedCallback will not fire.
1026
1151
  //
1027
1152
  // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
@@ -1041,21 +1166,49 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1041
1166
  // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1042
1167
  return;
1043
1168
  }
1169
+ else if (propName == null) {
1170
+ // At this point we should know this is not a "member", so we can treat it like watching an attribute
1171
+ // on a vanilla web component
1172
+ const hostRef = getHostRef(this);
1173
+ const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
1174
+ // We only want to trigger the callback(s) if:
1175
+ // 1. The instance is ready
1176
+ // 2. The watchers are ready
1177
+ // 3. The value has changed
1178
+ if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1179
+ flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1180
+ newValue !== oldValue) {
1181
+ const instance = hostRef.$lazyInstance$ ;
1182
+ const entry = cmpMeta.$watchers$[attrName];
1183
+ entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1184
+ if (instance[callbackName] != null) {
1185
+ instance[callbackName].call(instance, newValue, oldValue, attrName);
1186
+ }
1187
+ });
1188
+ }
1189
+ return;
1190
+ }
1044
1191
  this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1045
1192
  });
1046
1193
  };
1047
- // create an array of attributes to observe
1048
- // and also create a map of html attribute name to js property name
1049
- Cstr.observedAttributes = members
1050
- .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
1051
- .map(([propName, m]) => {
1052
- const attrName = m[1] || propName;
1053
- attrNameToPropName.set(attrName, propName);
1054
- if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1055
- cmpMeta.$attrsToReflect$.push([propName, attrName]);
1056
- }
1057
- return attrName;
1058
- });
1194
+ // Create an array of attributes to observe
1195
+ // This list in comprised of all strings used within a `@Watch()` decorator
1196
+ // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
1197
+ // As such, there is no way to guarantee type-safety here that a user hasn't entered
1198
+ // an invalid attribute.
1199
+ Cstr.observedAttributes = Array.from(new Set([
1200
+ ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
1201
+ ...members
1202
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1203
+ .map(([propName, m]) => {
1204
+ const attrName = m[1] || propName;
1205
+ attrNameToPropName.set(attrName, propName);
1206
+ if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1207
+ cmpMeta.$attrsToReflect$.push([propName, attrName]);
1208
+ }
1209
+ return attrName;
1210
+ }),
1211
+ ]));
1059
1212
  }
1060
1213
  }
1061
1214
  return Cstr;
@@ -1063,9 +1216,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1063
1216
  const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1064
1217
  // initializeComponent
1065
1218
  if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1219
+ // Let the runtime know that the component has been initialized
1220
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1066
1221
  {
1067
- // we haven't initialized this element yet
1068
- hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1069
1222
  // lazy loaded components
1070
1223
  // request the component's implementation to be
1071
1224
  // wired up with the host element
@@ -1138,6 +1291,8 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1138
1291
  schedule();
1139
1292
  }
1140
1293
  };
1294
+ const fireConnectedCallback = (instance) => {
1295
+ };
1141
1296
  const connectedCallback = (elm) => {
1142
1297
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1143
1298
  const hostRef = getHostRef(elm);
@@ -1176,12 +1331,25 @@ const connectedCallback = (elm) => {
1176
1331
  initializeComponent(elm, hostRef, cmpMeta);
1177
1332
  }
1178
1333
  }
1334
+ else {
1335
+ // fire off connectedCallback() on component instance
1336
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
1337
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1338
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1339
+ }
1340
+ }
1179
1341
  endConnected();
1180
1342
  }
1181
1343
  };
1182
- const disconnectedCallback = (elm) => {
1344
+ const disconnectInstance = (instance) => {
1345
+ };
1346
+ const disconnectedCallback = async (elm) => {
1183
1347
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1184
- getHostRef(elm);
1348
+ const hostRef = getHostRef(elm);
1349
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) ;
1350
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1351
+ hostRef.$onReadyPromise$.then(() => disconnectInstance());
1352
+ }
1185
1353
  }
1186
1354
  };
1187
1355
  const bootstrapLazy = (lazyBundles, options = {}) => {
@@ -1200,6 +1368,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1200
1368
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1201
1369
  lazyBundles.map((lazyBundle) => {
1202
1370
  lazyBundle[1].map((compactMeta) => {
1371
+ var _a;
1203
1372
  const cmpMeta = {
1204
1373
  $flags$: compactMeta[0],
1205
1374
  $tagName$: compactMeta[1],
@@ -1213,7 +1382,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1213
1382
  cmpMeta.$attrsToReflect$ = [];
1214
1383
  }
1215
1384
  {
1216
- cmpMeta.$watchers$ = {};
1385
+ cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
1217
1386
  }
1218
1387
  const tagName = cmpMeta.$tagName$;
1219
1388
  const HostElement = class extends HTMLElement {
@@ -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.3 | MIT Licensed | https://stenciljs.com
9
- */
10
- const patchEsm = () => {
11
- return index.promiseResolve();
12
- };
5
+ const index = require('./index-91e137c8.js');
13
6
 
14
7
  const defineCustomElements = (win, options) => {
15
- if (typeof window === 'undefined') return Promise.resolve();
16
- return patchEsm().then(() => {
17
- return index.bootstrapLazy([["mds-progress.cjs",[[1,"mds-progress",{"progress":[2],"direction":[513],"variant":[513],"steps":[1],"currentStep":[32]}]]]], options);
18
- });
8
+ if (typeof window === 'undefined') return undefined;
9
+ return index.bootstrapLazy([["mds-progress.cjs",[[1,"mds-progress",{"progress":[2],"direction":[513],"variant":[513],"steps":[1],"currentStep":[32]},null,{"progress":["progressChanged"],"steps":["stepsChanged"]}]]]], options);
19
10
  };
20
11
 
21
12
  exports.setNonce = index.setNonce;
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1d846f7a.js');
5
+ const index = require('./index-91e137c8.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\"]){--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))}";
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;-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);display:-ms-flexbox;display:flex;height:var(--mds-progress-thickness);min-width:var(--mds-progress-thickness);overflow:hidden;width:100%}:host([direction=\"vertical\"]){-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) {
@@ -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-91e137c8.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.3.0 | 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));
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["mds-progress.cjs",[[1,"mds-progress",{"progress":[2],"direction":[513],"variant":[513],"steps":[1],"currentStep":[32]}]]]], options);
20
+ return index.bootstrapLazy([["mds-progress.cjs",[[1,"mds-progress",{"progress":[2],"direction":[513],"variant":[513],"steps":[1],"currentStep":[32]},null,{"progress":["progressChanged"],"steps":["stepsChanged"]}]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -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.3",
8
- "typescriptVersion": "4.9.4"
7
+ "version": "4.3.0",
8
+ "typescriptVersion": "5.1.6"
9
9
  },
10
10
  "collections": [],
11
11
  "bundles": []
@@ -5,6 +5,7 @@ const hash = (s) => {
5
5
  }
6
6
  return h.toString();
7
7
  };
8
+ const randomInt = (max) => Math.floor(Math.random() * max);
8
9
  const unslugName = (name) => {
9
10
  var _a, _b, _c;
10
11
  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;
@@ -18,4 +19,11 @@ const setAttributeIfEmpty = (element, attribute, value) => {
18
19
  return value;
19
20
  };
20
21
  const hashValue = (value) => `${value}-${hash(value)}`;
21
- export { unslugName, setAttributeIfEmpty, hashValue, };
22
+ const hashRandomValue = (value) => {
23
+ const randomValue = randomInt(1000000);
24
+ if (value) {
25
+ return `${value}-${hash(randomValue.toString())}`;
26
+ }
27
+ return hash(randomValue.toString());
28
+ };
29
+ export { unslugName, setAttributeIfEmpty, hashRandomValue, hashValue, };
@@ -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, };
@@ -15,27 +15,21 @@
15
15
  --mds-progress-duration: 750ms;
16
16
  --mds-progress-radius: 0.5rem;
17
17
  --mds-progress-thickness: 0.5rem;
18
- display: flex;
19
- width: 100%;
20
- overflow: hidden;
21
18
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
22
19
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
23
20
  transition-duration: 150ms;
24
21
 
25
22
  background-color: var(--mds-progress-background);
26
23
  border-radius: var(--mds-progress-radius);
24
+ display: flex;
27
25
  height: var(--mds-progress-thickness);
28
26
  min-width: var(--mds-progress-thickness);
27
+ overflow: hidden;
28
+ width: 100%;
29
29
  }
30
30
 
31
- :host( [direction="vertical"] ){
32
-
33
- height: 100%;
34
-
35
- width: auto;
36
-
31
+ :host( [direction="vertical"] ) {
37
32
  flex-direction: column;
38
-
39
33
  height: unset;
40
34
  min-height: var(--mds-progress-thickness);
41
35
  width: var(--mds-progress-thickness);
@@ -1,4 +1,4 @@
1
- import { Host, h } from '@stencil/core';
1
+ import { Host, h } from "@stencil/core";
2
2
  export class MdsProgress {
3
3
  constructor() {
4
4
  this.stepsList = new Array();
@@ -70,7 +70,8 @@ export class MdsProgress {
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,7 +94,8 @@ 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
  },
@@ -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: {