@mgdis/stencil-helpers 2.0.0 → 2.1.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.
@@ -5,6 +5,12 @@
5
5
  * @returns ID
6
6
  */
7
7
  export declare const createID: (prefix?: string, length?: number) => string;
8
+ /**
9
+ * Validate html `id` format
10
+ * @param newValue - id value to validate
11
+ * @returns true if `id` is valid
12
+ */
13
+ export declare const isValideID: (newValue: unknown) => boolean;
8
14
  /**
9
15
  * Class to manage component classlist
10
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,wCAA+B,MAWnD,CAAC;AAEF;;GAEG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;gBAEN,SAAS,GAAE,MAAM,EAAO;IAIpC;;;OAGG;IACH,GAAG,cAAe,MAAM,KAAG,IAAI,CAI7B;IAEF;;;OAGG;IACH,MAAM,cAAe,MAAM,KAAG,IAAI,CAKhC;IAEF;;;;OAIG;IACH,GAAG,cAAe,MAAM,KAAG,OAAO,CAEhC;IAEF;;;OAGG;IACH,IAAI,QAAO,MAAM,CAEf;CACH;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,UAAW,OAAO,sBAA6F,CAAC;AAE9I;;;;;GAKG;AACH,eAAO,MAAM,SAAS,YAAa,OAAO,YAAY,MAAM,EAAE,KAAG,OAEhE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,kHAAgH,CAAC;AAE/I;;;;GAIG;AACH,eAAO,MAAM,UAAU,gBAAiB,MAAM,KAAG,MAAM,EAItD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,gBAAiB,MAAM,YAAW,MAAM,EAAE,KAAQ,MAAM,EAgBpF,CAAC;AAkBF;;;;GAIG;AACH,eAAO,MAAM,aAAa,UAAW,OAAO,oBAAsE,CAAC;AAEnH;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UAAW,OAAO,KAAG,MAGzC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,MAMjC,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,QAAQ,aAAoB,MAAM,IAAI,KAAG,QAAQ,IAAI,CAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,wCAA+B,MAWnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,aAAc,OAAO,KAAG,OAA+F,CAAC;AAE/I;;GAEG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;gBAEN,SAAS,GAAE,MAAM,EAAO;IAIpC;;;OAGG;IACH,GAAG,cAAe,MAAM,KAAG,IAAI,CAI7B;IAEF;;;OAGG;IACH,MAAM,cAAe,MAAM,KAAG,IAAI,CAKhC;IAEF;;;;OAIG;IACH,GAAG,cAAe,MAAM,KAAG,OAAO,CAEhC;IAEF;;;OAGG;IACH,IAAI,QAAO,MAAM,CAEf;CACH;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,UAAW,OAAO,KAAG,KAAK,IAAI,MAAM,EAA2E,CAAC;AAE9I;;;;;GAKG;AACH,eAAO,MAAM,SAAS,YAAa,OAAO,YAAY,MAAM,EAAE,KAAG,OAEhE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,kHAAgH,CAAC;AAE/I;;;;GAIG;AACH,eAAO,MAAM,UAAU,gBAAiB,MAAM,KAAG,MAAM,EAItD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,gBAAiB,MAAM,YAAW,MAAM,EAAE,KAAQ,MAAM,EAgBpF,CAAC;AAkBF;;;;GAIG;AACH,eAAO,MAAM,aAAa,UAAW,OAAO,KAAG,KAAK,IAAI,MAA0D,CAAC;AAEnH;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UAAW,OAAO,KAAG,MAGzC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,MAMjC,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,QAAQ,aAAoB,MAAM,IAAI,KAAG,OAAO,CAAC,IAAI,CAAe,CAAC"}
package/dist/index.es.js CHANGED
@@ -4,14 +4,14 @@ var X = (e) => {
4
4
  };
5
5
  var he = (e, t, s) => t in e ? ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
6
6
  var g = (e, t, s) => he(e, typeof t != "symbol" ? t + "" : t, s), ye = (e, t, s) => t.has(e) || X("Cannot " + s);
7
- var k = (e, t, s) => (ye(e, t, "read from private field"), s ? s.call(e) : t.get(e)), P = (e, t, s) => t.has(e) ? X("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s);
8
- const ze = (e = "", t = 10) => {
7
+ var k = (e, t, s) => (ye(e, t, "read from private field"), s ? s.call(e) : t.get(e)), w = (e, t, s) => t.has(e) ? X("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s);
8
+ const Ie = (e = "", t = 10) => {
9
9
  const s = new Uint8Array(t);
10
10
  crypto.getRandomValues(s);
11
11
  const r = Array.from(s).map((o) => o.toString(16).padStart(2, "0")).join("").slice(0, t);
12
12
  return e !== "" ? `${e}-${r}` : r;
13
- };
14
- class Ie {
13
+ }, Ge = (e) => me(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null;
14
+ class Xe {
15
15
  constructor(t = []) {
16
16
  /**
17
17
  * Available classes
@@ -46,7 +46,7 @@ class Ie {
46
46
  this.classes = t;
47
47
  }
48
48
  }
49
- const Ge = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Xe = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), Je = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Ke = (e) => {
49
+ const Je = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Ke = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), Qe = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Ze = (e) => {
50
50
  const t = te(e), s = se(e);
51
51
  return [e, ...t, ...s];
52
52
  }, te = (e, t = []) => {
@@ -63,7 +63,7 @@ const Ge = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Xe =
63
63
  for (const s of Array.from(e.frames))
64
64
  t.push(s), se(s, t);
65
65
  return t;
66
- }, Qe = (e) => typeof e == "string" && e.trim() !== "", Ze = (e) => typeof e == "object" ? JSON.stringify(e) : `${e}`, Ye = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, Ve = async (e) => e();
66
+ }, me = (e) => typeof e == "string" && e.trim() !== "", Ye = (e) => typeof e == "object" ? JSON.stringify(e) : `${e}`, Ve = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, et = async (e) => e();
67
67
  var E = {
68
68
  allRenderFn: !1,
69
69
  cmpDidLoad: !0,
@@ -153,11 +153,11 @@ var E = {
153
153
  attachStyles: !0,
154
154
  // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
155
155
  experimentalSlotFixes: !1
156
- }, me = Object.defineProperty, be = (e, t) => {
156
+ }, be = Object.defineProperty, Se = (e, t) => {
157
157
  for (var s in t)
158
- me(e, s, { get: t[s], enumerable: !0 });
159
- }, J = (e, t) => t in e, K = "http://www.w3.org/1999/xlink", q = typeof window < "u" ? window : {}, _ = q.document || { head: {} };
160
- q.HTMLElement;
158
+ be(e, s, { get: t[s], enumerable: !0 });
159
+ }, J = (e, t) => t in e, K = "http://www.w3.org/1999/xlink", B = typeof window < "u" ? window : {}, _ = B.document || { head: {} };
160
+ B.HTMLElement;
161
161
  var L = {
162
162
  $flags$: 0,
163
163
  $resourcesUrl$: "",
@@ -166,13 +166,13 @@ var L = {
166
166
  ael: (e, t, s, r) => e.addEventListener(t, s, r),
167
167
  rel: (e, t, s, r) => e.removeEventListener(t, s, r),
168
168
  ce: (e, t) => new CustomEvent(e, t)
169
- }, Q = {}, Se = "http://www.w3.org/2000/svg", Te = "http://www.w3.org/1999/xhtml", ke = (e) => e != null, re = (e) => (e = typeof e, e === "object" || e === "function"), xe = {};
170
- be(xe, {
169
+ }, Q = {}, Te = "http://www.w3.org/2000/svg", ke = "http://www.w3.org/1999/xhtml", xe = (e) => e != null, re = (e) => (e = typeof e, e === "object" || e === "function"), Ae = {};
170
+ Se(Ae, {
171
171
  err: () => oe,
172
- map: () => Ae,
172
+ map: () => Ee,
173
173
  ok: () => U,
174
- unwrap: () => Ee,
175
- unwrapErr: () => Le
174
+ unwrap: () => Le,
175
+ unwrapErr: () => je
176
176
  });
177
177
  var U = (e) => ({
178
178
  isOk: !0,
@@ -183,7 +183,7 @@ var U = (e) => ({
183
183
  isErr: !0,
184
184
  value: e
185
185
  });
186
- function Ae(e, t) {
186
+ function Ee(e, t) {
187
187
  if (e.isOk) {
188
188
  const s = t(e.value);
189
189
  return s instanceof Promise ? s.then((r) => U(r)) : U(s);
@@ -194,15 +194,15 @@ function Ae(e, t) {
194
194
  }
195
195
  throw "should never get here";
196
196
  }
197
- var Ee = (e) => {
197
+ var Le = (e) => {
198
198
  if (e.isOk)
199
199
  return e.value;
200
200
  throw e.value;
201
- }, Le = (e) => {
201
+ }, je = (e) => {
202
202
  if (e.isErr)
203
203
  return e.value;
204
204
  throw e.value;
205
- }, je = (e, t, ...s) => {
205
+ }, Re = (e, t, ...s) => {
206
206
  let r = null, o = null, n = null, l = !1, a = !1;
207
207
  const c = [], d = (i) => {
208
208
  for (let $ = 0; $ < i.length; $++)
@@ -220,7 +220,7 @@ var Ee = (e) => {
220
220
  $children$: null
221
221
  };
222
222
  return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;
223
- }, Re = {}, Oe = (e) => e && e.$tag$ === Re, Z = (e, t, s, r, o, n) => {
223
+ }, Oe = {}, Me = (e) => e && e.$tag$ === Oe, Z = (e, t, s, r, o, n) => {
224
224
  if (s !== r) {
225
225
  let l = J(e, t), a = t.toLowerCase();
226
226
  if (t === "class") {
@@ -234,9 +234,9 @@ var Ee = (e) => {
234
234
  } else if (t !== "key") if (t === "ref")
235
235
  r && r(e);
236
236
  else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n") {
237
- if (t[2] === "-" ? t = t.slice(3) : J(q, a) ? t = a.slice(2) : t = a[2] + t.slice(3), s || r) {
237
+ if (t[2] === "-" ? t = t.slice(3) : J(B, a) ? t = a.slice(2) : t = a[2] + t.slice(3), s || r) {
238
238
  const c = t.endsWith(ne);
239
- t = t.replace(_e, ""), s && L.rel(e, t, s, c), r && L.ael(e, t, r, c);
239
+ t = t.replace(Ne, ""), s && L.rel(e, t, s, c), r && L.ael(e, t, r, c);
240
240
  }
241
241
  } else {
242
242
  const c = re(r);
@@ -254,7 +254,7 @@ var Ee = (e) => {
254
254
  a !== (a = a.replace(/^xlink\:?/, "")) && (t = a, d = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === "") && (d ? e.removeAttributeNS(K, t) : e.removeAttribute(t)) : (!l || n & 4 || o) && !c && (r = r === !0 ? "" : r, d ? e.setAttributeNS(K, t, r) : e.setAttribute(t, r));
255
255
  }
256
256
  }
257
- }, Me = /\s/, Y = (e) => e ? e.split(Me) : [], ne = "Capture", _e = new RegExp(ne + "$"), le = (e, t, s) => {
257
+ }, _e = /\s/, Y = (e) => e ? e.split(_e) : [], ne = "Capture", Ne = new RegExp(ne + "$"), le = (e, t, s) => {
258
258
  const r = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || Q, n = t.$attrs$ || Q;
259
259
  for (const l of V(Object.keys(o)))
260
260
  l in n || Z(r, l, o[l], void 0, s, t.$flags$);
@@ -270,11 +270,11 @@ function V(e) {
270
270
  e
271
271
  );
272
272
  }
273
- var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
273
+ var x, H, j, N = !1, F = !1, q = !1, h = !1, C = (e, t, s, r) => {
274
274
  var o;
275
275
  const n = t.$children$[s];
276
276
  let l = 0, a, c, d;
277
- if (N || (z = !0, n.$tag$ === "slot" && (x && r.classList.add(x + "-s"), n.$flags$ |= n.$children$ ? (
277
+ if (N || (q = !0, n.$tag$ === "slot" && (x && r.classList.add(x + "-s"), n.$flags$ |= n.$children$ ? (
278
278
  // slot element has fallback content
279
279
  // still create an element that "mocks" the slot element
280
280
  2
@@ -289,9 +289,9 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
289
289
  a = n.$elm$ = _.createTextNode("");
290
290
  else {
291
291
  if (h || (h = n.$tag$ === "svg"), a = n.$elm$ = _.createElementNS(
292
- h ? Se : Te,
292
+ h ? Te : ke,
293
293
  !N && E.slotRelocation && n.$flags$ & 2 ? "slot-fb" : n.$tag$
294
- ), h && n.$tag$ === "foreignObject" && (h = !1), le(null, n, h), !!a.getRootNode().querySelector("body") && E.scoped && ke(x) && a["s-si"] !== x && a.classList.add(a["s-si"] = x), G(a, r), n.$children$)
294
+ ), h && n.$tag$ === "foreignObject" && (h = !1), le(null, n, h), !!a.getRootNode().querySelector("body") && E.scoped && xe(x) && a["s-si"] !== x && a.classList.add(a["s-si"] = x), G(a, r), n.$children$)
295
295
  for (l = 0; l < n.$children$.length; ++l)
296
296
  c = C(e, n, l, a), c && a.appendChild(c);
297
297
  n.$tag$ === "svg" ? h = !1 : a.tagName === "foreignObject" && (h = !0);
@@ -307,7 +307,7 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
307
307
  }
308
308
  for (let r = s.length - 1; r >= 0; r--) {
309
309
  const o = s[r];
310
- o["s-hn"] !== j && o["s-ol"] && (T(ce(o), o, I(o)), o["s-ol"].remove(), o["s-ol"] = void 0, o["s-sh"] = void 0, z = !0), t && R(o, t);
310
+ o["s-hn"] !== j && o["s-ol"] && (T(ce(o), o, I(o)), o["s-ol"].remove(), o["s-ol"] = void 0, o["s-sh"] = void 0, q = !0), t && R(o, t);
311
311
  }
312
312
  L.$flags$ &= -2;
313
313
  }, ie = (e, t, s, r, o, n) => {
@@ -322,7 +322,7 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
322
322
  $e(o), n && (F = !0, n["s-ol"] ? n["s-ol"].remove() : R(n, !0), n.remove());
323
323
  }
324
324
  }
325
- }, Ne = (e, t, s, r, o = !1) => {
325
+ }, Fe = (e, t, s, r, o = !1) => {
326
326
  let n = 0, l = 0, a = 0, c = 0, d = t.length - 1, f = t[0], i = t[d], $ = r.length - 1, u = r[0], p = r[$], m, y;
327
327
  for (; n <= d && l <= $; )
328
328
  if (f == null)
@@ -366,7 +366,7 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
366
366
  ) : s ? !0 : e.$key$ === t.$key$ : !1, I = (e) => e && e["s-ol"] || e, ce = (e) => (e["s-ol"] ? e["s-ol"] : e).parentNode, A = (e, t, s = !1) => {
367
367
  const r = t.$elm$ = e.$elm$, o = e.$children$, n = t.$children$, l = t.$tag$, a = t.$text$;
368
368
  let c;
369
- a === null ? (h = l === "svg" ? !0 : l === "foreignObject" ? !1 : h, l === "slot" && !N || le(e, t, h), o !== null && n !== null ? Ne(r, o, t, n, s) : n !== null ? (e.$text$ !== null && (r.textContent = ""), ie(r, null, t, n, 0, n.length - 1)) : (
369
+ a === null ? (h = l === "svg" ? !0 : l === "foreignObject" ? !1 : h, l === "slot" && !N || le(e, t, h), o !== null && n !== null ? Fe(r, o, t, n, s) : n !== null ? (e.$text$ !== null && (r.textContent = ""), ie(r, null, t, n, 0, n.length - 1)) : (
370
370
  // don't do this on initial render as it can cause non-hydrated content to be removed
371
371
  !s && E.updatable && o !== null && ae(o, 0, o.length - 1)
372
372
  ), h && l === "svg" && (h = !1)) : (c = r["s-cr"]) ? c.parentNode.textContent = a : e.$text$ !== a && (r.data = a);
@@ -435,9 +435,9 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
435
435
  for (const n of Array.from(e.childNodes))
436
436
  G(n, e, !0);
437
437
  }
438
- }, Fe = (e, t, s = !1) => {
438
+ }, Ce = (e, t, s = !1) => {
439
439
  var r, o, n, l, a;
440
- const c = e.$hostElement$, d = e.$cmpMeta$, f = e.$vnode$ || W(null, null), i = Oe(t) ? t : je(null, null, t);
440
+ const c = e.$hostElement$, d = e.$cmpMeta$, f = e.$vnode$ || W(null, null), i = Me(t) ? t : Re(null, null, t);
441
441
  if (j = c.tagName, d.$attrsToReflect$ && (i.$attrs$ = i.$attrs$ || {}, d.$attrsToReflect$.map(
442
442
  ([$, u]) => i.$attrs$[u] = c[$]
443
443
  )), s && i.$attrs$)
@@ -445,7 +445,7 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
445
445
  c.hasAttribute($) && !["key", "ref", "style", "class"].includes($) && (i.$attrs$[$] = c[$]);
446
446
  i.$tag$ = null, i.$flags$ |= 4, e.$vnode$ = i, i.$elm$ = f.$elm$ = c.shadowRoot || c, x = c["s-sc"], N = (d.$flags$ & 1) !== 0, H = c["s-cr"], F = !1, A(f, i, s);
447
447
  {
448
- if (L.$flags$ |= 1, z) {
448
+ if (L.$flags$ |= 1, q) {
449
449
  ue(i.$elm$);
450
450
  for (const $ of b) {
451
451
  const u = $.$nodeToRelocate$;
@@ -486,19 +486,19 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
486
486
  $["s-hn"] !== j && !$["s-sh"] && (s && $["s-ih"] == null && ($["s-ih"] = (a = $.hidden) != null ? a : !1), $.hidden = !0);
487
487
  H = void 0;
488
488
  };
489
- const Ce = (e, t, s) => {
489
+ const De = (e, t, s) => {
490
490
  [null, void 0, "", !1].includes(s) || ["innerHTML", "style"].includes(t) || e.setAttribute(t, ["object", "function"].includes(typeof s) ? "/!\\ Object props are not rendered in the code example" : s);
491
491
  }, pe = (e, t, s, r, o) => {
492
492
  if (t && typeof t == "string") {
493
493
  const n = document.createElement(t);
494
494
  Object.keys(s || {}).forEach((l) => {
495
- Ce(n, l, s[l]);
495
+ De(n, l, s[l]);
496
496
  }), r == null || r.forEach((l) => {
497
497
  pe(n, l.$tag$, l.$attrs$, l.$children$, l.$text$);
498
498
  }), s != null && s.innerHTML && (n.innerHTML = s.innerHTML), e.appendChild(n);
499
499
  }
500
500
  o && (e.innerHTML = o);
501
- }, et = (e, t) => {
501
+ }, tt = (e, t) => {
502
502
  const s = {};
503
503
  if (typeof e != "object")
504
504
  throw new Error("filterArgs - args isn't an object.");
@@ -508,11 +508,11 @@ const Ce = (e, t, s) => {
508
508
  (!t || !Object.keys(t).includes(r) || t[r] !== o) && (s[n] = o);
509
509
  }
510
510
  return s;
511
- }, tt = (e, t) => {
511
+ }, st = (e, t) => {
512
512
  var r, o;
513
513
  const s = document.getElementById("storybook-root");
514
514
  if (s !== null)
515
- return (o = document.querySelector("[lang]")) == null || o.setAttribute("lang", ((r = t.globals) == null ? void 0 : r.locale) || "en"), Fe(
515
+ return (o = document.querySelector("[lang]")) == null || o.setAttribute("lang", ((r = t.globals) == null ? void 0 : r.locale) || "en"), Ce(
516
516
  {
517
517
  $ancestorComponent$: void 0,
518
518
  $flags$: 0,
@@ -525,7 +525,7 @@ const Ce = (e, t, s) => {
525
525
  },
526
526
  e(t)
527
527
  ), s.children[s.children.length - 1];
528
- }, st = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {
528
+ }, rt = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {
529
529
  const o = document.createElement("div");
530
530
  return pe(o, e, t, s, r), o.innerHTML;
531
531
  }, D = (e, t) => {
@@ -534,8 +534,8 @@ const Ce = (e, t, s) => {
534
534
  const s = t.split("/");
535
535
  return `${e}${s.slice(2, s.length - 1).join("-")}--docs`;
536
536
  };
537
- var S, w;
538
- class rt {
537
+ var S, P;
538
+ class ot {
539
539
  constructor(t) {
540
540
  /**
541
541
  * JsonDocs
@@ -546,14 +546,14 @@ class rt {
546
546
  * @param tagName - tag name we want to get the data from
547
547
  * @returns component data
548
548
  */
549
- P(this, S, (t) => this.jsonDoc.components.find((s) => s.tag === t));
549
+ w(this, S, (t) => this.jsonDoc.components.find((s) => s.tag === t));
550
550
  /**
551
551
  * Get the control for the given prop
552
552
  * Based on https://storybook.js.org/docs/api/arg-types#controltype
553
553
  * @param prop - prop to get control for
554
554
  * @returns control type and options if applicable
555
555
  */
556
- P(this, w, (t) => {
556
+ w(this, P, (t) => {
557
557
  const s = t.type.replace(/"([^"]+)"/g, "$1").replace(/\s/g, "").replace(/\(.*?\)/g, (r) => r.replace(/\|/g, " OR ")).split("|").map((r) => r.trim().replace(/ OR /g, "|"));
558
558
  return t.type === "string" ? { control: { type: "text" } } : t.type === "number" ? { control: { type: "number" } } : t.type === "boolean" ? { control: { type: "boolean" } } : t.type.startsWith("{") && t.type.endsWith("}") ? { control: { type: "object" } } : s.length > 1 ? s.includes("string") ? { control: { type: "text" } } : s.every((r) => r == null ? void 0 : r.includes("[]")) ? { control: { type: "object" } } : (s.unshift(void 0), { control: { type: "select" }, options: s }) : { control: { type: "object" } };
559
559
  });
@@ -564,7 +564,7 @@ class rt {
564
564
  */
565
565
  g(this, "extractArgTypes", (t) => {
566
566
  const s = k(this, S).call(this, t), r = s == null ? void 0 : s.props.reduce((f, i) => {
567
- const { control: $, options: u } = k(this, w).call(this, i);
567
+ const { control: $, options: u } = k(this, P).call(this, i);
568
568
  return {
569
569
  ...f,
570
570
  [i.name]: {
@@ -682,8 +682,8 @@ class rt {
682
682
  this.jsonDoc = t;
683
683
  }
684
684
  }
685
- S = new WeakMap(), w = new WeakMap();
686
- const De = (e, t) => {
685
+ S = new WeakMap(), P = new WeakMap();
686
+ const Pe = (e, t) => {
687
687
  if (t)
688
688
  return `${e}${t}`;
689
689
  }, ge = (e) => {
@@ -712,9 +712,9 @@ const De = (e, t) => {
712
712
  `, t += e.slots.map(({ name: o, docs: n }) => `- \`${o}\`: ${n}
713
713
  `).join(""), t += `
714
714
  `), t;
715
- }, B = (e) => `${e.docs}
715
+ }, z = (e) => `${e.docs}
716
716
 
717
- Type: \`${e.type}\``, ot = (e, t, s, r) => ({
717
+ Type: \`${e.type}\``, nt = (e, t, s, r) => ({
718
718
  $schema: "https://json.schemastore.org/web-types",
719
719
  name: e,
720
720
  version: t,
@@ -729,7 +729,7 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
729
729
  "doc-url": n,
730
730
  attributes: o.props.filter((l) => l.attr).map((l) => ({
731
731
  name: l.attr,
732
- description: B(l),
732
+ description: z(l),
733
733
  "doc-url": n,
734
734
  value: {
735
735
  type: l.type,
@@ -740,7 +740,7 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
740
740
  js: {
741
741
  properties: o.props.map((l) => ({
742
742
  name: l.name,
743
- description: B(l),
743
+ description: z(l),
744
744
  "doc-url": n,
745
745
  value: {
746
746
  type: l.type,
@@ -765,11 +765,11 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
765
765
  }
766
766
  }), we = (e, t, s) => [
767
767
  { name: "Storybook", url: D(e, s) },
768
- { name: "Sources", url: De(t, s) }
769
- ], Pe = (e) => {
768
+ { name: "Sources", url: Pe(t, s) }
769
+ ], Ue = (e) => {
770
770
  if (!e.values.some(({ value: t }) => t === void 0))
771
771
  return e.values.map(({ value: t }) => ({ name: t }));
772
- }, nt = (e, t, s) => ({
772
+ }, lt = (e, t, s) => ({
773
773
  version: 1.1,
774
774
  tags: e.components.map((r) => {
775
775
  const o = we(t, s, r.filePath);
@@ -778,8 +778,8 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
778
778
  description: ge(r),
779
779
  attributes: r.props.map((n) => ({
780
780
  name: n.attr || n.name,
781
- description: B(n),
782
- values: Pe(n),
781
+ description: z(n),
782
+ values: Ue(n),
783
783
  references: o
784
784
  })),
785
785
  references: o
@@ -787,7 +787,7 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
787
787
  }),
788
788
  globalAttributes: [],
789
789
  valueSets: []
790
- }), lt = (e) => ({
790
+ }), it = (e) => ({
791
791
  version: 1.1,
792
792
  properties: e.components.flatMap(
793
793
  (t) => t.styles.map((s) => ({
@@ -795,16 +795,16 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
795
795
  description: s.docs
796
796
  }))
797
797
  )
798
- }), it = (e) => {
798
+ }), at = (e) => {
799
799
  const t = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
800
- return He([t.value, s.value, r.value].join("-"), e, { timeZone: "UTC" }).replace(t.value, t.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);
801
- }, at = (e) => e.toISOString().split("T")[0], Ue = (e, t, s) => {
800
+ return ze([t.value, s.value, r.value].join("-"), e, { timeZone: "UTC" }).replace(t.value, t.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);
801
+ }, ct = (e) => e.toISOString().split("T")[0], We = (e, t, s) => {
802
802
  const r = e.closest("[lang]"), o = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), n = o.length > 0 && typeof o[0] == "string" ? o[0] : navigator.language || s, l = n.split("-").shift();
803
803
  return {
804
804
  locale: n,
805
805
  messages: t[l] || t[s]
806
806
  };
807
- }, ct = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), ft = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), We = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, He = (e, t, s) => typeof e != "string" || e === "" || !We.test(e) ? "" : new Intl.DateTimeFormat(t, s).format(new Date(e)), ut = (e, t) => (s) => Ue(s, e, t), $t = ({ disconnect: e, observe: t, takeRecords: s }) => {
807
+ }, ft = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), ut = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), He = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, ze = (e, t, s) => typeof e != "string" || e === "" || !He.test(e) ? "" : new Intl.DateTimeFormat(t, s).format(new Date(e)), $t = (e, t) => (s) => We(s, e, t), dt = ({ disconnect: e, observe: t, takeRecords: s }) => {
808
808
  class r {
809
809
  constructor(n) {
810
810
  /**
@@ -833,7 +833,7 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
833
833
  value: r
834
834
  });
835
835
  }), r;
836
- }, dt = ({ disconnect: e, observe: t }) => {
836
+ }, pt = ({ disconnect: e, observe: t }) => {
837
837
  class s {
838
838
  constructor(o) {
839
839
  /**
@@ -873,7 +873,7 @@ class Be extends Event {
873
873
  g(this, "detail");
874
874
  }
875
875
  }
876
- const pt = () => {
876
+ const gt = () => {
877
877
  class e extends Be {
878
878
  }
879
879
  return [window, global].forEach((t) => {
@@ -885,34 +885,35 @@ const pt = () => {
885
885
  }), e;
886
886
  };
887
887
  export {
888
- Ie as ClassList,
889
- rt as StorybookPreview,
890
- Ge as allItemsAreString,
891
- Ye as cleanString,
892
- ze as createID,
893
- We as dateRegExp,
894
- at as dateToString,
895
- ut as defineLocales,
896
- et as filterArgs,
897
- Je as focusableElements,
898
- it as getLocaleDatePattern,
888
+ Xe as ClassList,
889
+ ot as StorybookPreview,
890
+ Je as allItemsAreString,
891
+ Ve as cleanString,
892
+ Ie as createID,
893
+ He as dateRegExp,
894
+ ct as dateToString,
895
+ $t as defineLocales,
896
+ tt as filterArgs,
897
+ Qe as focusableElements,
898
+ at as getLocaleDatePattern,
899
899
  te as getParentWindows,
900
- st as getStoryHTML,
900
+ rt as getStoryHTML,
901
901
  D as getStorybookUrl,
902
- Ke as getWindows,
903
- Xe as isTagName,
904
- Qe as isValidString,
905
- ct as localeCurrency,
906
- He as localeDate,
907
- ft as localeNumber,
908
- Ve as nextTick,
909
- $t as setupMutationObserverMock,
910
- dt as setupResizeObserverMock,
911
- pt as setupSubmitEventMock,
912
- tt as stencilWrapper,
913
- Ze as toString,
914
- lt as vsCodeCssGenerator,
915
- nt as vsCodeGenerator,
916
- ot as webTypesGenerator
902
+ Ze as getWindows,
903
+ Ke as isTagName,
904
+ me as isValidString,
905
+ Ge as isValideID,
906
+ ft as localeCurrency,
907
+ ze as localeDate,
908
+ ut as localeNumber,
909
+ et as nextTick,
910
+ dt as setupMutationObserverMock,
911
+ pt as setupResizeObserverMock,
912
+ gt as setupSubmitEventMock,
913
+ st as stencilWrapper,
914
+ Ye as toString,
915
+ it as vsCodeCssGenerator,
916
+ lt as vsCodeGenerator,
917
+ nt as webTypesGenerator
917
918
  };
918
919
  //# sourceMappingURL=index.es.js.map