@cal.macconnachie/web-components 1.0.4 → 1.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.
package/dist/index.d.ts CHANGED
@@ -354,18 +354,23 @@ export declare class BaseTabs extends BaseElement {
354
354
  variant: TabVariant;
355
355
  private tabs;
356
356
  private isExpanded;
357
+ private isMobile;
357
358
  private tabsNav?;
358
359
  private boundHashChangeHandler;
360
+ private boundResizeHandler;
361
+ private hasInitialized;
359
362
  static styles: CSSResult;
360
363
  connectedCallback(): void;
361
364
  disconnectedCallback(): void;
362
365
  firstUpdated(): void;
363
366
  private queryAndRegisterTabs;
367
+ willUpdate(changedProperties: Map<string, unknown>): void;
364
368
  updated(changedProperties: Map<string, unknown>): void;
365
369
  private handleTabRegister;
366
370
  private handleTabBadgeUpdate;
367
371
  private updateChildTabs;
368
372
  private handleHashChange;
373
+ private handleResize;
369
374
  private selectTab;
370
375
  private handleTabClick;
371
376
  private handleKeyDown;
package/dist/index.js CHANGED
@@ -247,7 +247,7 @@ let Ae = class extends HTMLElement {
247
247
  }
248
248
  };
249
249
  Ae.elementStyles = [], Ae.shadowRootOptions = { mode: "open" }, Ae[He("elementProperties")] = /* @__PURE__ */ new Map(), Ae[He("finalized")] = /* @__PURE__ */ new Map(), ho?.({ ReactiveElement: Ae }), (st.reactiveElementVersions ??= []).push("2.1.1");
250
- const _t = globalThis, ot = _t.trustedTypes, Gt = ot ? ot.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, kr = "$lit$", ce = `lit$${Math.random().toFixed(9).slice(2)}$`, Sr = "?" + ce, po = `<${Sr}>`, $e = document, Le = () => $e.createComment(""), qe = (e) => e === null || typeof e != "object" && typeof e != "function", Ot = Array.isArray, uo = (e) => Ot(e) || typeof e?.[Symbol.iterator] == "function", bt = `[
250
+ const _t = globalThis, ot = _t.trustedTypes, Gt = ot ? ot.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, kr = "$lit$", de = `lit$${Math.random().toFixed(9).slice(2)}$`, Sr = "?" + de, po = `<${Sr}>`, $e = document, Le = () => $e.createComment(""), qe = (e) => e === null || typeof e != "object" && typeof e != "function", Ot = Array.isArray, uo = (e) => Ot(e) || typeof e?.[Symbol.iterator] == "function", bt = `[
251
251
  \f\r]`, Ne = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Qt = /-->/g, Xt = />/g, me = RegExp(`>|${bt}(?:([^\\s"'>=/]+)(${bt}*=${bt}*(?:[^
252
252
  \f\r"'\`<>=]|("|')|))|$)`, "g"), Zt = /'/g, er = /"/g, Ar = /^(?:script|style|textarea|title)$/i, fo = (e) => (t, ...r) => ({ _$litType$: e, strings: t, values: r }), f = fo(1), ae = Symbol.for("lit-noChange"), S = Symbol.for("lit-nothing"), tr = /* @__PURE__ */ new WeakMap(), ye = $e.createTreeWalker($e, 129);
253
253
  function Er(e, t) {
@@ -262,7 +262,7 @@ const bo = (e, t) => {
262
262
  let d, c, p = -1, g = 0;
263
263
  for (; g < l.length && (a.lastIndex = g, c = a.exec(l), c !== null); ) g = a.lastIndex, a === Ne ? c[1] === "!--" ? a = Qt : c[1] !== void 0 ? a = Xt : c[2] !== void 0 ? (Ar.test(c[2]) && (i = RegExp("</" + c[2], "g")), a = me) : c[3] !== void 0 && (a = me) : a === me ? c[0] === ">" ? (a = i ?? Ne, p = -1) : c[1] === void 0 ? p = -2 : (p = a.lastIndex - c[2].length, d = c[1], a = c[3] === void 0 ? me : c[3] === '"' ? er : Zt) : a === er || a === Zt ? a = me : a === Qt || a === Xt ? a = Ne : (a = me, i = void 0);
264
264
  const y = a === me && e[n + 1].startsWith("/>") ? " " : "";
265
- s += a === Ne ? l + po : p >= 0 ? (o.push(d), l.slice(0, p) + kr + l.slice(p) + ce + y) : l + ce + (p === -2 ? n : y);
265
+ s += a === Ne ? l + po : p >= 0 ? (o.push(d), l.slice(0, p) + kr + l.slice(p) + de + y) : l + de + (p === -2 ? n : y);
266
266
  }
267
267
  return [Er(e, s + (e[r] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), o];
268
268
  };
@@ -279,11 +279,11 @@ class Fe {
279
279
  for (; (i = ye.nextNode()) !== null && l.length < n; ) {
280
280
  if (i.nodeType === 1) {
281
281
  if (i.hasAttributes()) for (const p of i.getAttributeNames()) if (p.endsWith(kr)) {
282
- const g = c[a++], y = i.getAttribute(p).split(ce), u = /([.?@])?(.*)/.exec(g);
282
+ const g = c[a++], y = i.getAttribute(p).split(de), u = /([.?@])?(.*)/.exec(g);
283
283
  l.push({ type: 1, index: s, name: u[2], strings: y, ctor: u[1] === "." ? mo : u[1] === "?" ? vo : u[1] === "@" ? yo : at }), i.removeAttribute(p);
284
- } else p.startsWith(ce) && (l.push({ type: 6, index: s }), i.removeAttribute(p));
284
+ } else p.startsWith(de) && (l.push({ type: 6, index: s }), i.removeAttribute(p));
285
285
  if (Ar.test(i.tagName)) {
286
- const p = i.textContent.split(ce), g = p.length - 1;
286
+ const p = i.textContent.split(de), g = p.length - 1;
287
287
  if (g > 0) {
288
288
  i.textContent = ot ? ot.emptyScript : "";
289
289
  for (let y = 0; y < g; y++) i.append(p[y], Le()), ye.nextNode(), l.push({ type: 2, index: ++s });
@@ -293,7 +293,7 @@ class Fe {
293
293
  } else if (i.nodeType === 8) if (i.data === Sr) l.push({ type: 2, index: s });
294
294
  else {
295
295
  let p = -1;
296
- for (; (p = i.data.indexOf(ce, p + 1)) !== -1; ) l.push({ type: 7, index: s }), p += ce.length - 1;
296
+ for (; (p = i.data.indexOf(de, p + 1)) !== -1; ) l.push({ type: 7, index: s }), p += de.length - 1;
297
297
  }
298
298
  s++;
299
299
  }
@@ -2196,6 +2196,7 @@ let A = class extends B {
2196
2196
  full-width
2197
2197
  ?loading=${this.isLoading}
2198
2198
  ?disabled=${this.isLoading}
2199
+ @click=${(e) => this.handleSubmit(e)}
2199
2200
  >
2200
2201
  ${this.isLoading ? "Sending..." : "Send Reset Code"}
2201
2202
  </base-button>
@@ -2208,6 +2209,7 @@ let A = class extends B {
2208
2209
  full-width
2209
2210
  ?loading=${this.isLoading}
2210
2211
  ?disabled=${this.isLoading}
2212
+ @click=${(t) => this.handleSubmit(t)}
2211
2213
  >
2212
2214
  ${this.isLoading ? "Resetting..." : "Reset Password"}
2213
2215
  </base-button>
@@ -2221,6 +2223,7 @@ let A = class extends B {
2221
2223
  full-width
2222
2224
  ?loading=${this.isLoading}
2223
2225
  ?disabled=${!e || this.isLoading}
2226
+ @click=${(t) => this.handleSubmit(t)}
2224
2227
  >
2225
2228
  ${this.isLoading ? "Completing..." : "Complete Registration"}
2226
2229
  </base-button>
@@ -2233,6 +2236,7 @@ let A = class extends B {
2233
2236
  full-width
2234
2237
  ?loading=${this.isLoading}
2235
2238
  ?disabled=${this.isLoading}
2239
+ @click=${(e) => this.handleSubmit(e)}
2236
2240
  >
2237
2241
  ${this.isLoading ? "Loading..." : this.mode === "signup" ? "Continue" : "Sign In"}
2238
2242
  </base-button>
@@ -2453,12 +2457,12 @@ const $ = Rt(class extends zt {
2453
2457
  return ae;
2454
2458
  }
2455
2459
  });
2456
- var Bo = Object.defineProperty, Lo = Object.getOwnPropertyDescriptor, ue = (e, t, r, o) => {
2460
+ var Bo = Object.defineProperty, Lo = Object.getOwnPropertyDescriptor, fe = (e, t, r, o) => {
2457
2461
  for (var i = o > 1 ? void 0 : o ? Lo(t, r) : t, s = e.length - 1, a; s >= 0; s--)
2458
2462
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
2459
2463
  return o && i && Bo(t, r, i), i;
2460
2464
  };
2461
- let ie = class extends B {
2465
+ let se = class extends B {
2462
2466
  constructor() {
2463
2467
  super(...arguments), this.size = "md", this.variant = "primary", this.hover = void 0, this.disabled = !1, this.fullWidth = !1, this.loading = !1, this.type = "button";
2464
2468
  }
@@ -2508,7 +2512,7 @@ let ie = class extends B {
2508
2512
  `;
2509
2513
  }
2510
2514
  };
2511
- ie.styles = J`
2515
+ se.styles = J`
2512
2516
  :host {
2513
2517
  display: inline-block;
2514
2518
  }
@@ -2928,36 +2932,36 @@ ie.styles = J`
2928
2932
  }
2929
2933
  }
2930
2934
  `;
2931
- ue([
2935
+ fe([
2932
2936
  b({ type: String, attribute: "size" })
2933
- ], ie.prototype, "size", 2);
2934
- ue([
2937
+ ], se.prototype, "size", 2);
2938
+ fe([
2935
2939
  b({ type: String, attribute: "variant" })
2936
- ], ie.prototype, "variant", 2);
2937
- ue([
2940
+ ], se.prototype, "variant", 2);
2941
+ fe([
2938
2942
  b({ type: String, attribute: "hover" })
2939
- ], ie.prototype, "hover", 2);
2940
- ue([
2943
+ ], se.prototype, "hover", 2);
2944
+ fe([
2941
2945
  b({ type: Boolean, reflect: !0 })
2942
- ], ie.prototype, "disabled", 2);
2943
- ue([
2946
+ ], se.prototype, "disabled", 2);
2947
+ fe([
2944
2948
  b({ type: Boolean, reflect: !0, attribute: "full-width" })
2945
- ], ie.prototype, "fullWidth", 2);
2946
- ue([
2949
+ ], se.prototype, "fullWidth", 2);
2950
+ fe([
2947
2951
  b({ type: Boolean, reflect: !0, attribute: "loading" })
2948
- ], ie.prototype, "loading", 2);
2949
- ue([
2952
+ ], se.prototype, "loading", 2);
2953
+ fe([
2950
2954
  b({ type: String, attribute: "type" })
2951
- ], ie.prototype, "type", 2);
2952
- ie = ue([
2955
+ ], se.prototype, "type", 2);
2956
+ se = fe([
2953
2957
  W("base-button")
2954
- ], ie);
2958
+ ], se);
2955
2959
  var qo = Object.defineProperty, Fo = Object.getOwnPropertyDescriptor, Oe = (e, t, r, o) => {
2956
2960
  for (var i = o > 1 ? void 0 : o ? Fo(t, r) : t, s = e.length - 1, a; s >= 0; s--)
2957
2961
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
2958
2962
  return o && i && qo(t, r, i), i;
2959
2963
  };
2960
- let de = class extends B {
2964
+ let he = class extends B {
2961
2965
  constructor() {
2962
2966
  super(...arguments), this.variant = "default", this.padding = "none", this.hoverable = !1, this.expandable = !1, this.isExpanded = !1;
2963
2967
  }
@@ -3015,9 +3019,11 @@ let de = class extends B {
3015
3019
  ` : t;
3016
3020
  }
3017
3021
  };
3018
- de.styles = J`
3022
+ he.styles = J`
3019
3023
  :host {
3020
3024
  display: block;
3025
+ min-width: 0;
3026
+ margin: var(--space-4);
3021
3027
  }
3022
3028
 
3023
3029
  .base-card {
@@ -3028,7 +3034,9 @@ de.styles = J`
3028
3034
  display: flex;
3029
3035
  flex-direction: column;
3030
3036
  box-sizing: border-box;
3037
+ width: 100%;
3031
3038
  max-width: 100%;
3039
+ min-width: 0;
3032
3040
  }
3033
3041
 
3034
3042
  /* Variants */
@@ -3200,22 +3208,22 @@ de.styles = J`
3200
3208
  `;
3201
3209
  Oe([
3202
3210
  b({ type: String, attribute: "variant" })
3203
- ], de.prototype, "variant", 2);
3211
+ ], he.prototype, "variant", 2);
3204
3212
  Oe([
3205
3213
  b({ type: String, attribute: "padding" })
3206
- ], de.prototype, "padding", 2);
3214
+ ], he.prototype, "padding", 2);
3207
3215
  Oe([
3208
3216
  b({ type: Boolean, reflect: !0, attribute: "hoverable" })
3209
- ], de.prototype, "hoverable", 2);
3217
+ ], he.prototype, "hoverable", 2);
3210
3218
  Oe([
3211
3219
  b({ type: Boolean, reflect: !0, attribute: "expandable" })
3212
- ], de.prototype, "expandable", 2);
3220
+ ], he.prototype, "expandable", 2);
3213
3221
  Oe([
3214
3222
  w()
3215
- ], de.prototype, "isExpanded", 2);
3216
- de = Oe([
3223
+ ], he.prototype, "isExpanded", 2);
3224
+ he = Oe([
3217
3225
  W("base-card")
3218
- ], de);
3226
+ ], he);
3219
3227
  const ee = (e) => e ?? S;
3220
3228
  var jo = Object.defineProperty, Yo = Object.getOwnPropertyDescriptor, M = (e, t, r, o) => {
3221
3229
  for (var i = o > 1 ? void 0 : o ? Yo(t, r) : t, s = e.length - 1, a; s >= 0; s--)
@@ -5308,6 +5316,7 @@ let K = class extends B {
5308
5316
  super(...arguments), this.value = "", this.type = "text", this.required = !1, this.disabled = !1, this.size = "md", this.inputId = `input-${Math.random().toString(36).substr(2, 9)}`;
5309
5317
  }
5310
5318
  handleInput(e) {
5319
+ e.stopPropagation();
5311
5320
  const t = e.target;
5312
5321
  this.value = t.value, this.dispatchEvent(
5313
5322
  new CustomEvent("input", {
@@ -6015,7 +6024,7 @@ var ei = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, De = (e, t
6015
6024
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
6016
6025
  return o && i && ei(t, r, i), i;
6017
6026
  };
6018
- let he = class extends B {
6027
+ let pe = class extends B {
6019
6028
  constructor() {
6020
6029
  super(...arguments), this.id = "", this.label = "", this.active = !1;
6021
6030
  }
@@ -6058,10 +6067,9 @@ let he = class extends B {
6058
6067
  `;
6059
6068
  }
6060
6069
  };
6061
- he.styles = J`
6070
+ pe.styles = J`
6062
6071
  :host {
6063
6072
  display: none;
6064
- width: 100%;
6065
6073
  }
6066
6074
 
6067
6075
  :host([active]) {
@@ -6074,22 +6082,22 @@ he.styles = J`
6074
6082
  `;
6075
6083
  De([
6076
6084
  b({ type: String, reflect: !0 })
6077
- ], he.prototype, "id", 2);
6085
+ ], pe.prototype, "id", 2);
6078
6086
  De([
6079
6087
  b({ type: String })
6080
- ], he.prototype, "label", 2);
6088
+ ], pe.prototype, "label", 2);
6081
6089
  De([
6082
6090
  b({ type: Number })
6083
- ], he.prototype, "badge", 2);
6091
+ ], pe.prototype, "badge", 2);
6084
6092
  De([
6085
6093
  b({ type: String })
6086
- ], he.prototype, "icon", 2);
6094
+ ], pe.prototype, "icon", 2);
6087
6095
  De([
6088
6096
  b({ type: Boolean, reflect: !0 })
6089
- ], he.prototype, "active", 2);
6090
- he = De([
6097
+ ], pe.prototype, "active", 2);
6098
+ pe = De([
6091
6099
  W("base-tab")
6092
- ], he);
6100
+ ], pe);
6093
6101
  class xt extends zt {
6094
6102
  constructor(t) {
6095
6103
  if (super(t), this.it = S, t.type !== Pt.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
@@ -6106,43 +6114,45 @@ class xt extends zt {
6106
6114
  }
6107
6115
  xt.directiveName = "unsafeHTML", xt.resultType = 1;
6108
6116
  const ri = Rt(xt);
6109
- var oi = Object.defineProperty, ii = Object.getOwnPropertyDescriptor, fe = (e, t, r, o) => {
6117
+ var oi = Object.defineProperty, ii = Object.getOwnPropertyDescriptor, ne = (e, t, r, o) => {
6110
6118
  for (var i = o > 1 ? void 0 : o ? ii(t, r) : t, s = e.length - 1, a; s >= 0; s--)
6111
6119
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
6112
6120
  return o && i && oi(t, r, i), i;
6113
6121
  };
6114
- let se = class extends B {
6122
+ let te = class extends B {
6115
6123
  constructor() {
6116
- super(...arguments), this.activeTab = "", this.ariaLabel = "Dashboard navigation", this.syncWithHash = !0, this.variant = "sidebar", this.tabs = [], this.isExpanded = !1, this.boundHashChangeHandler = this.handleHashChange.bind(this);
6124
+ super(...arguments), this.activeTab = "", this.ariaLabel = "Dashboard navigation", this.syncWithHash = !0, this.variant = "sidebar", this.tabs = [], this.isExpanded = !1, this.isMobile = !1, this.boundHashChangeHandler = this.handleHashChange.bind(this), this.boundResizeHandler = this.handleResize.bind(this), this.hasInitialized = !1;
6117
6125
  }
6118
6126
  connectedCallback() {
6119
- super.connectedCallback(), window.addEventListener("hashchange", this.boundHashChangeHandler), this.addEventListener("tab-register", this.handleTabRegister), this.addEventListener("tab-badge-update", this.handleTabBadgeUpdate);
6127
+ super.connectedCallback(), window.addEventListener("hashchange", this.boundHashChangeHandler), window.addEventListener("resize", this.boundResizeHandler), this.handleResize(), this.addEventListener("tab-register", this.handleTabRegister), this.addEventListener("tab-badge-update", this.handleTabBadgeUpdate);
6120
6128
  }
6121
6129
  disconnectedCallback() {
6122
- window.removeEventListener("hashchange", this.boundHashChangeHandler), this.removeEventListener("tab-register", this.handleTabRegister), this.removeEventListener("tab-badge-update", this.handleTabBadgeUpdate), super.disconnectedCallback();
6130
+ window.removeEventListener("hashchange", this.boundHashChangeHandler), window.removeEventListener("resize", this.boundResizeHandler), this.removeEventListener("tab-register", this.handleTabRegister), this.removeEventListener("tab-badge-update", this.handleTabBadgeUpdate), super.disconnectedCallback();
6123
6131
  }
6124
6132
  firstUpdated() {
6125
- this.queryAndRegisterTabs(), setTimeout(() => {
6126
- if (this.syncWithHash && window.location.hash) {
6127
- const e = window.location.hash.replace("#", "");
6128
- if (this.tabs.find((r) => r.id === e)) {
6129
- this.selectTab(e);
6130
- return;
6131
- }
6132
- }
6133
- !this.activeTab && this.tabs.length > 0 && this.selectTab(this.tabs[0].id);
6134
- }, 0);
6133
+ this.queryAndRegisterTabs();
6135
6134
  }
6136
6135
  queryAndRegisterTabs() {
6137
- this.querySelectorAll("base-tab").forEach((t) => {
6138
- const r = {
6139
- id: t.id,
6140
- label: t.getAttribute("label") || "",
6141
- badge: t.hasAttribute("badge") ? Number(t.getAttribute("badge")) : void 0,
6142
- icon: t.getAttribute("icon") || void 0
6136
+ const e = this.querySelectorAll("base-tab"), t = [];
6137
+ e.forEach((r) => {
6138
+ const o = {
6139
+ id: r.id,
6140
+ label: r.getAttribute("label") || "",
6141
+ badge: r.hasAttribute("badge") ? Number(r.getAttribute("badge")) : void 0,
6142
+ icon: r.getAttribute("icon") || void 0
6143
6143
  };
6144
- r.id && !this.tabs.find((o) => o.id === r.id) && (this.tabs = [...this.tabs, r]);
6145
- });
6144
+ o.id && !this.tabs.find((i) => i.id === o.id) && t.push(o);
6145
+ }), t.length > 0 && (this.tabs = [...this.tabs, ...t]);
6146
+ }
6147
+ willUpdate(e) {
6148
+ if (super.willUpdate(e), e.has("tabs") && this.tabs.length > 0 && !this.activeTab && !this.hasInitialized) {
6149
+ if (this.hasInitialized = !0, this.syncWithHash && window.location.hash) {
6150
+ const t = window.location.hash.replace("#", "");
6151
+ this.tabs.find((o) => o.id === t) ? this.activeTab = t : this.activeTab = this.tabs[0].id;
6152
+ } else
6153
+ this.activeTab = this.tabs[0].id;
6154
+ this.syncWithHash && this.activeTab && history.replaceState(null, "", `#${this.activeTab}`);
6155
+ }
6146
6156
  }
6147
6157
  updated(e) {
6148
6158
  super.updated(e), e.has("activeTab") && this.updateChildTabs();
@@ -6150,9 +6160,7 @@ let se = class extends B {
6150
6160
  handleTabRegister(e) {
6151
6161
  e.stopPropagation();
6152
6162
  const t = e.detail;
6153
- this.tabs.find((r) => r.id === t.id) || (this.tabs = [...this.tabs, t], this.tabs.length === 1 && !this.activeTab && setTimeout(() => {
6154
- this.selectTab(t.id);
6155
- }, 0));
6163
+ this.tabs.find((r) => r.id === t.id) || (this.tabs = [...this.tabs, t]);
6156
6164
  }
6157
6165
  handleTabBadgeUpdate(e) {
6158
6166
  e.stopPropagation();
@@ -6171,6 +6179,9 @@ let se = class extends B {
6171
6179
  const e = window.location.hash.replace("#", "");
6172
6180
  this.tabs.find((r) => r.id === e) && e !== this.activeTab && this.selectTab(e);
6173
6181
  }
6182
+ handleResize() {
6183
+ this.isMobile = window.innerWidth <= 768;
6184
+ }
6174
6185
  selectTab(e) {
6175
6186
  this.activeTab = e, this.syncWithHash && history.replaceState(null, "", `#${e}`), this.dispatchEvent(
6176
6187
  new CustomEvent("tab-change", {
@@ -6226,8 +6237,8 @@ let se = class extends B {
6226
6237
  @keydown=${(i) => this.handleKeyDown(i, t)}
6227
6238
  >
6228
6239
  ${e.icon && this.variant === "sidebar" ? f`<span class="tab-icon">${ri(e.icon)}</span>` : S}
6229
- ${this.isExpanded || this.variant !== "sidebar" ? f`<span class="tab-label">${e.label}</span>` : S}
6230
- ${e.badge !== void 0 && e.badge > 0 && (this.isExpanded || this.variant !== "sidebar") ? f`<span class="tab-badge">${e.badge}</span>` : S}
6240
+ ${this.isExpanded || this.variant !== "sidebar" || this.isMobile ? f`<span class="tab-label">${e.label}</span>` : S}
6241
+ ${e.badge !== void 0 && e.badge > 0 && (this.isExpanded || this.variant !== "sidebar" || this.isMobile) ? f`<span class="tab-badge">${e.badge}</span>` : S}
6231
6242
  </button>
6232
6243
  `;
6233
6244
  }
@@ -6285,14 +6296,16 @@ let se = class extends B {
6285
6296
  `;
6286
6297
  }
6287
6298
  };
6288
- se.styles = J`
6299
+ te.styles = J`
6289
6300
  :host {
6290
6301
  display: block;
6291
- width: 100%;
6302
+ min-width: 0;
6292
6303
  }
6293
6304
 
6294
6305
  .base-tabs {
6295
6306
  width: 100%;
6307
+ min-width: 0;
6308
+ overflow-x: hidden;
6296
6309
  }
6297
6310
 
6298
6311
  .base-tabs--vertical {
@@ -6300,6 +6313,8 @@ se.styles = J`
6300
6313
  gap: var(--space-6, 1.5rem);
6301
6314
  align-items: flex-start;
6302
6315
  padding: var(--space-4, 1rem);
6316
+ min-width: 0;
6317
+ overflow-x: hidden;
6303
6318
  }
6304
6319
 
6305
6320
  /* Sidebar Layout */
@@ -6558,27 +6573,38 @@ se.styles = J`
6558
6573
 
6559
6574
  /* Mobile responsive */
6560
6575
  @media (max-width: 768px) {
6576
+ :host {
6577
+ overflow-x: hidden;
6578
+ }
6579
+
6580
+ .base-tabs {
6581
+ overflow-x: hidden;
6582
+ }
6583
+
6561
6584
  .base-tabs--vertical {
6562
6585
  flex-direction: column;
6563
6586
  padding: 0;
6587
+ overflow-x: hidden;
6564
6588
  }
6565
6589
 
6566
6590
  .tabs-sidebar {
6567
- position: sticky;
6568
- top: 0;
6591
+ position: relative;
6569
6592
  width: 100%;
6570
6593
  max-height: none;
6571
- border-radius: 0;
6572
- border-left: none;
6573
- border-right: none;
6574
- padding: var(--space-3, 0.75rem);
6594
+ border-radius: var(--radius-lg);
6595
+ border-left: 1px solid var(--color-border, #e2e8f0);
6596
+ border-right: 1px solid var(--color-border, #e2e8f0);
6597
+ padding: var(--space-3);
6598
+ padding-left: 0;
6599
+ padding-right: 0;
6575
6600
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
6576
6601
  z-index: 10;
6577
6602
  display: grid;
6578
- grid-template-columns: 1fr auto;
6603
+ grid-template-columns: minmax(0, 1fr) auto;
6579
6604
  grid-template-rows: auto auto;
6580
6605
  gap: var(--space-3, 0.75rem);
6581
6606
  align-items: center;
6607
+ box-sizing: border-box;
6582
6608
  }
6583
6609
 
6584
6610
  .tabs-sidebar--expanded {
@@ -6625,6 +6651,7 @@ se.styles = J`
6625
6651
  scrollbar-width: none;
6626
6652
  -ms-overflow-style: none;
6627
6653
  padding: 0;
6654
+ min-width: 0;
6628
6655
  }
6629
6656
 
6630
6657
  .tabs-nav::-webkit-scrollbar {
@@ -6638,8 +6665,13 @@ se.styles = J`
6638
6665
  gap: var(--space-1, 0.25rem);
6639
6666
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
6640
6667
  min-width: 70px;
6668
+ width: auto;
6641
6669
  min-height: auto;
6642
6670
  position: relative;
6671
+ flex-shrink: 0;
6672
+ margin-left: var(--space-2);
6673
+ margin-right: var(--space-2);
6674
+ margin-bottom: var(--space-2);
6643
6675
  }
6644
6676
 
6645
6677
  .tabs-sidebar .tab-button .tab-label {
@@ -6652,6 +6684,7 @@ se.styles = J`
6652
6684
  .tabs-sidebar .tab-icon {
6653
6685
  width: 20px;
6654
6686
  height: 20px;
6687
+ margin-left: 0;
6655
6688
  }
6656
6689
 
6657
6690
  .tabs-sidebar .tab-badge {
@@ -6666,6 +6699,7 @@ se.styles = J`
6666
6699
  .base-tabs--vertical .tabs-content {
6667
6700
  width: 100%;
6668
6701
  padding: var(--space-4, 1rem) var(--space-3, 0.75rem);
6702
+ box-sizing: border-box;
6669
6703
  }
6670
6704
  }
6671
6705
 
@@ -6688,30 +6722,33 @@ se.styles = J`
6688
6722
  }
6689
6723
  }
6690
6724
  `;
6691
- fe([
6725
+ ne([
6692
6726
  b({ type: String, attribute: "active-tab" })
6693
- ], se.prototype, "activeTab", 2);
6694
- fe([
6727
+ ], te.prototype, "activeTab", 2);
6728
+ ne([
6695
6729
  b({ type: String, attribute: "aria-label" })
6696
- ], se.prototype, "ariaLabel", 2);
6697
- fe([
6730
+ ], te.prototype, "ariaLabel", 2);
6731
+ ne([
6698
6732
  b({ type: Boolean, attribute: "sync-with-hash" })
6699
- ], se.prototype, "syncWithHash", 2);
6700
- fe([
6733
+ ], te.prototype, "syncWithHash", 2);
6734
+ ne([
6701
6735
  b({ type: String })
6702
- ], se.prototype, "variant", 2);
6703
- fe([
6736
+ ], te.prototype, "variant", 2);
6737
+ ne([
6704
6738
  w()
6705
- ], se.prototype, "tabs", 2);
6706
- fe([
6739
+ ], te.prototype, "tabs", 2);
6740
+ ne([
6707
6741
  w()
6708
- ], se.prototype, "isExpanded", 2);
6709
- fe([
6742
+ ], te.prototype, "isExpanded", 2);
6743
+ ne([
6744
+ w()
6745
+ ], te.prototype, "isMobile", 2);
6746
+ ne([
6710
6747
  q(".tabs-nav")
6711
- ], se.prototype, "tabsNav", 2);
6712
- se = fe([
6748
+ ], te.prototype, "tabsNav", 2);
6749
+ te = ne([
6713
6750
  W("base-tabs")
6714
- ], se);
6751
+ ], te);
6715
6752
  var si = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, G = (e, t, r, o) => {
6716
6753
  for (var i = o > 1 ? void 0 : o ? ai(t, r) : t, s = e.length - 1, a; s >= 0; s--)
6717
6754
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
@@ -7532,7 +7569,7 @@ var ci = Object.defineProperty, di = Object.getOwnPropertyDescriptor, Pe = (e, t
7532
7569
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
7533
7570
  return o && i && ci(t, r, i), i;
7534
7571
  };
7535
- let pe = class extends B {
7572
+ let ue = class extends B {
7536
7573
  constructor() {
7537
7574
  super(...arguments), this.value = 0, this.min = 0, this.max = 99, this.size = "md", this.allowInput = !0;
7538
7575
  }
@@ -7610,7 +7647,7 @@ let pe = class extends B {
7610
7647
  `;
7611
7648
  }
7612
7649
  };
7613
- pe.styles = J`
7650
+ ue.styles = J`
7614
7651
  :host {
7615
7652
  display: inline-block;
7616
7653
  }
@@ -7758,22 +7795,22 @@ pe.styles = J`
7758
7795
  `;
7759
7796
  Pe([
7760
7797
  b({ type: Number })
7761
- ], pe.prototype, "value", 2);
7798
+ ], ue.prototype, "value", 2);
7762
7799
  Pe([
7763
7800
  b({ type: Number })
7764
- ], pe.prototype, "min", 2);
7801
+ ], ue.prototype, "min", 2);
7765
7802
  Pe([
7766
7803
  b({ type: Number })
7767
- ], pe.prototype, "max", 2);
7804
+ ], ue.prototype, "max", 2);
7768
7805
  Pe([
7769
7806
  b({ type: String })
7770
- ], pe.prototype, "size", 2);
7807
+ ], ue.prototype, "size", 2);
7771
7808
  Pe([
7772
7809
  b({ type: Boolean, attribute: "allow-input" })
7773
- ], pe.prototype, "allowInput", 2);
7774
- pe = Pe([
7810
+ ], ue.prototype, "allowInput", 2);
7811
+ ue = Pe([
7775
7812
  W("quantity-select")
7776
- ], pe);
7813
+ ], ue);
7777
7814
  var hi = Object.defineProperty, pi = Object.getOwnPropertyDescriptor, nt = (e, t, r, o) => {
7778
7815
  for (var i = o > 1 ? void 0 : o ? pi(t, r) : t, s = e.length - 1, a; s >= 0; s--)
7779
7816
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
@@ -8013,11 +8050,11 @@ function Dr(e, t) {
8013
8050
  const { toString: ui } = Object.prototype, { getPrototypeOf: Mt } = Object, { iterator: lt, toStringTag: Pr } = Symbol, ct = /* @__PURE__ */ ((e) => (t) => {
8014
8051
  const r = ui.call(t);
8015
8052
  return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
8016
- })(/* @__PURE__ */ Object.create(null)), te = (e) => (e = e.toLowerCase(), (t) => ct(t) === e), dt = (e) => (t) => typeof t === e, { isArray: Re } = Array, Ce = dt("undefined");
8053
+ })(/* @__PURE__ */ Object.create(null)), re = (e) => (e = e.toLowerCase(), (t) => ct(t) === e), dt = (e) => (t) => typeof t === e, { isArray: Re } = Array, Ce = dt("undefined");
8017
8054
  function je(e) {
8018
8055
  return e !== null && !Ce(e) && e.constructor !== null && !Ce(e.constructor) && j(e.constructor.isBuffer) && e.constructor.isBuffer(e);
8019
8056
  }
8020
- const Rr = te("ArrayBuffer");
8057
+ const Rr = re("ArrayBuffer");
8021
8058
  function fi(e) {
8022
8059
  let t;
8023
8060
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Rr(e.buffer), t;
@@ -8035,11 +8072,11 @@ const bi = dt("string"), j = dt("function"), zr = dt("number"), Ye = (e) => e !=
8035
8072
  } catch {
8036
8073
  return !1;
8037
8074
  }
8038
- }, vi = te("Date"), yi = te("File"), wi = te("Blob"), xi = te("FileList"), $i = (e) => Ye(e) && j(e.pipe), ki = (e) => {
8075
+ }, vi = re("Date"), yi = re("File"), wi = re("Blob"), xi = re("FileList"), $i = (e) => Ye(e) && j(e.pipe), ki = (e) => {
8039
8076
  let t;
8040
8077
  return e && (typeof FormData == "function" && e instanceof FormData || j(e.append) && ((t = ct(e)) === "formdata" || // detect form-data instance
8041
8078
  t === "object" && j(e.toString) && e.toString() === "[object FormData]"));
8042
- }, Si = te("URLSearchParams"), [Ai, Ei, Ti, Ci] = ["ReadableStream", "Request", "Response", "Headers"].map(te), _i = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
8079
+ }, Si = re("URLSearchParams"), [Ai, Ei, Ti, Ci] = ["ReadableStream", "Request", "Response", "Headers"].map(re), _i = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
8043
8080
  function Ve(e, t, { allOwnKeys: r = !1 } = {}) {
8044
8081
  if (e === null || typeof e > "u")
8045
8082
  return;
@@ -8119,12 +8156,12 @@ const Oi = (e, t, r, { allOwnKeys: o } = {}) => (Ve(t, (i, s) => {
8119
8156
  for (; (r = e.exec(t)) !== null; )
8120
8157
  o.push(r);
8121
8158
  return o;
8122
- }, Hi = te("HTMLFormElement"), Bi = (e) => e.toLowerCase().replace(
8159
+ }, Hi = re("HTMLFormElement"), Bi = (e) => e.toLowerCase().replace(
8123
8160
  /[-_\s]([a-z\d])(\w*)/g,
8124
8161
  function(r, o, i) {
8125
8162
  return o.toUpperCase() + i;
8126
8163
  }
8127
- ), sr = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), Li = te("RegExp"), Ir = (e, t) => {
8164
+ ), sr = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), Li = re("RegExp"), Ir = (e, t) => {
8128
8165
  const r = Object.getOwnPropertyDescriptors(e), o = {};
8129
8166
  Ve(r, (i, s) => {
8130
8167
  let a;
@@ -8176,7 +8213,7 @@ const Ki = (e) => {
8176
8213
  return o;
8177
8214
  };
8178
8215
  return r(e, 0);
8179
- }, Wi = te("AsyncFunction"), Ji = (e) => e && (Ye(e) || j(e)) && j(e.then) && j(e.catch), Ur = ((e, t) => e ? setImmediate : t ? ((r, o) => (we.addEventListener("message", ({ source: i, data: s }) => {
8216
+ }, Wi = re("AsyncFunction"), Ji = (e) => e && (Ye(e) || j(e)) && j(e.then) && j(e.catch), Ur = ((e, t) => e ? setImmediate : t ? ((r, o) => (we.addEventListener("message", ({ source: i, data: s }) => {
8180
8217
  i === we && s === r && o.length && o.shift()();
8181
8218
  }, !1), (i) => {
8182
8219
  o.push(i), we.postMessage(r, "*");
@@ -8217,7 +8254,7 @@ const Ki = (e) => {
8217
8254
  inherits: Pi,
8218
8255
  toFlatObject: Ri,
8219
8256
  kindOf: ct,
8220
- kindOfTest: te,
8257
+ kindOfTest: re,
8221
8258
  endsWith: zi,
8222
8259
  toArray: Mi,
8223
8260
  forEachEntry: Ii,
@@ -9247,67 +9284,67 @@ const Jr = (e) => {
9247
9284
  let qt;
9248
9285
  try {
9249
9286
  if (be && d && m !== "get" && m !== "head" && (qt = await y(ut, x)) !== 0) {
9250
- let le = new r(v, {
9287
+ let ce = new r(v, {
9251
9288
  method: "POST",
9252
9289
  body: x,
9253
9290
  duplex: "half"
9254
9291
  }), Se;
9255
- if (h.isFormData(x) && (Se = le.headers.get("content-type")) && ut.setContentType(Se), le.body) {
9292
+ if (h.isFormData(x) && (Se = ce.headers.get("content-type")) && ut.setContentType(Se), ce.body) {
9256
9293
  const [ft, Ge] = dr(
9257
9294
  qt,
9258
9295
  it(hr(be))
9259
9296
  );
9260
- x = ur(le.body, fr, ft, Ge);
9297
+ x = ur(ce.body, fr, ft, Ge);
9261
9298
  }
9262
9299
  }
9263
9300
  h.isString(We) || (We = We ? "include" : "omit");
9264
- const re = s && "credentials" in r.prototype, Ft = {
9301
+ const oe = s && "credentials" in r.prototype, Ft = {
9265
9302
  ...Bt,
9266
9303
  signal: Je,
9267
9304
  method: m.toUpperCase(),
9268
9305
  headers: ut.normalize().toJSON(),
9269
9306
  body: x,
9270
9307
  duplex: "half",
9271
- credentials: re ? We : void 0
9308
+ credentials: oe ? We : void 0
9272
9309
  };
9273
9310
  Me = s && new r(v, Ft);
9274
- let ne = await (s ? Lt(Me, Bt) : Lt(v, Ft));
9311
+ let le = await (s ? Lt(Me, Bt) : Lt(v, Ft));
9275
9312
  const jt = c && (Q === "stream" || Q === "response");
9276
9313
  if (c && (F || jt && ge)) {
9277
- const le = {};
9314
+ const ce = {};
9278
9315
  ["status", "statusText", "headers"].forEach((Yt) => {
9279
- le[Yt] = ne[Yt];
9316
+ ce[Yt] = le[Yt];
9280
9317
  });
9281
- const Se = h.toFiniteNumber(ne.headers.get("content-length")), [ft, Ge] = F && dr(
9318
+ const Se = h.toFiniteNumber(le.headers.get("content-length")), [ft, Ge] = F && dr(
9282
9319
  Se,
9283
9320
  it(hr(F), !0)
9284
9321
  ) || [];
9285
- ne = new o(
9286
- ur(ne.body, fr, ft, () => {
9322
+ le = new o(
9323
+ ur(le.body, fr, ft, () => {
9287
9324
  Ge && Ge(), ge && ge();
9288
9325
  }),
9289
- le
9326
+ ce
9290
9327
  );
9291
9328
  }
9292
9329
  Q = Q || "text";
9293
- let eo = await p[h.findKey(p, Q) || "text"](ne, u);
9294
- return !jt && ge && ge(), await new Promise((le, Se) => {
9295
- Kr(le, Se, {
9330
+ let eo = await p[h.findKey(p, Q) || "text"](le, u);
9331
+ return !jt && ge && ge(), await new Promise((ce, Se) => {
9332
+ Kr(ce, Se, {
9296
9333
  data: eo,
9297
- headers: Y.from(ne.headers),
9298
- status: ne.status,
9299
- statusText: ne.statusText,
9334
+ headers: Y.from(le.headers),
9335
+ status: le.status,
9336
+ statusText: le.statusText,
9300
9337
  config: u,
9301
9338
  request: Me
9302
9339
  });
9303
9340
  });
9304
- } catch (re) {
9305
- throw ge && ge(), re && re.name === "TypeError" && /Load failed|fetch/i.test(re.message) ? Object.assign(
9341
+ } catch (oe) {
9342
+ throw ge && ge(), oe && oe.name === "TypeError" && /Load failed|fetch/i.test(oe.message) ? Object.assign(
9306
9343
  new k("Network Error", k.ERR_NETWORK, u, Me),
9307
9344
  {
9308
- cause: re.cause || re
9345
+ cause: oe.cause || oe
9309
9346
  }
9310
- ) : k.from(re, re && re.code, u, Me);
9347
+ ) : k.from(oe, oe && oe.code, u, Me);
9311
9348
  }
9312
9349
  };
9313
9350
  }, Ms = /* @__PURE__ */ new Map(), Gr = (e) => {
@@ -9445,7 +9482,7 @@ function Us(e, t, r) {
9445
9482
  const tt = {
9446
9483
  assertOptions: Us,
9447
9484
  validators: pt
9448
- }, oe = tt.validators;
9485
+ }, ie = tt.validators;
9449
9486
  class xe {
9450
9487
  constructor(t) {
9451
9488
  this.defaults = t || {}, this.interceptors = {
@@ -9482,17 +9519,17 @@ class xe {
9482
9519
  typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r = ke(this.defaults, r);
9483
9520
  const { transitional: o, paramsSerializer: i, headers: s } = r;
9484
9521
  o !== void 0 && tt.assertOptions(o, {
9485
- silentJSONParsing: oe.transitional(oe.boolean),
9486
- forcedJSONParsing: oe.transitional(oe.boolean),
9487
- clarifyTimeoutError: oe.transitional(oe.boolean)
9522
+ silentJSONParsing: ie.transitional(ie.boolean),
9523
+ forcedJSONParsing: ie.transitional(ie.boolean),
9524
+ clarifyTimeoutError: ie.transitional(ie.boolean)
9488
9525
  }, !1), i != null && (h.isFunction(i) ? r.paramsSerializer = {
9489
9526
  serialize: i
9490
9527
  } : tt.assertOptions(i, {
9491
- encode: oe.function,
9492
- serialize: oe.function
9528
+ encode: ie.function,
9529
+ serialize: ie.function
9493
9530
  }, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), tt.assertOptions(r, {
9494
- baseUrl: oe.spelling("baseURL"),
9495
- withXsrfToken: oe.spelling("withXSRFToken")
9531
+ baseUrl: ie.spelling("baseURL"),
9532
+ withXsrfToken: ie.spelling("withXSRFToken")
9496
9533
  }, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
9497
9534
  let a = s && h.merge(
9498
9535
  s.common,
@@ -9821,18 +9858,18 @@ const Ls = ({ baseUrl: e, apiBaseUrl: t }) => {
9821
9858
  export {
9822
9859
  A as AuthForm,
9823
9860
  xr as AuthRefreshError,
9824
- ie as BaseButton,
9825
- de as BaseCard,
9861
+ se as BaseButton,
9862
+ he as BaseCard,
9826
9863
  P as BaseDatePicker,
9827
9864
  T as BaseDateTimePicker,
9828
9865
  V as BaseDrawer,
9829
9866
  K as BaseInput,
9830
9867
  R as BaseSelect,
9831
- he as BaseTab,
9832
- se as BaseTabs,
9868
+ pe as BaseTab,
9869
+ te as BaseTabs,
9833
9870
  L as BaseTextarea,
9834
9871
  N as BaseTimePicker,
9835
- pe as QuantitySelect,
9872
+ ue as QuantitySelect,
9836
9873
  Te as ThemeToggle,
9837
9874
  Vs as apiClient,
9838
9875
  Ls as createApiClient
package/package.json CHANGED
@@ -1,14 +1,12 @@
1
1
  {
2
2
  "name": "@cal.macconnachie/web-components",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "Web components hosted on a CDN",
5
5
  "keywords": [
6
- "lit",
7
6
  "web-components",
8
- "auth",
9
- "lit"
7
+ "auth"
10
8
  ],
11
- "homepage": "https://github.com/cal-macconnachie/web-components#readme",
9
+ "homepage": "https://cdn.cals-api.com/",
12
10
  "bugs": {
13
11
  "url": "https://github.com/cal-macconnachie/web-components/issues"
14
12
  },