@cal.macconnachie/web-components 1.0.5 → 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
  }
@@ -2457,12 +2457,12 @@ const $ = Rt(class extends zt {
2457
2457
  return ae;
2458
2458
  }
2459
2459
  });
2460
- 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) => {
2461
2461
  for (var i = o > 1 ? void 0 : o ? Lo(t, r) : t, s = e.length - 1, a; s >= 0; s--)
2462
2462
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
2463
2463
  return o && i && Bo(t, r, i), i;
2464
2464
  };
2465
- let ie = class extends B {
2465
+ let se = class extends B {
2466
2466
  constructor() {
2467
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";
2468
2468
  }
@@ -2512,7 +2512,7 @@ let ie = class extends B {
2512
2512
  `;
2513
2513
  }
2514
2514
  };
2515
- ie.styles = J`
2515
+ se.styles = J`
2516
2516
  :host {
2517
2517
  display: inline-block;
2518
2518
  }
@@ -2932,36 +2932,36 @@ ie.styles = J`
2932
2932
  }
2933
2933
  }
2934
2934
  `;
2935
- ue([
2935
+ fe([
2936
2936
  b({ type: String, attribute: "size" })
2937
- ], ie.prototype, "size", 2);
2938
- ue([
2937
+ ], se.prototype, "size", 2);
2938
+ fe([
2939
2939
  b({ type: String, attribute: "variant" })
2940
- ], ie.prototype, "variant", 2);
2941
- ue([
2940
+ ], se.prototype, "variant", 2);
2941
+ fe([
2942
2942
  b({ type: String, attribute: "hover" })
2943
- ], ie.prototype, "hover", 2);
2944
- ue([
2943
+ ], se.prototype, "hover", 2);
2944
+ fe([
2945
2945
  b({ type: Boolean, reflect: !0 })
2946
- ], ie.prototype, "disabled", 2);
2947
- ue([
2946
+ ], se.prototype, "disabled", 2);
2947
+ fe([
2948
2948
  b({ type: Boolean, reflect: !0, attribute: "full-width" })
2949
- ], ie.prototype, "fullWidth", 2);
2950
- ue([
2949
+ ], se.prototype, "fullWidth", 2);
2950
+ fe([
2951
2951
  b({ type: Boolean, reflect: !0, attribute: "loading" })
2952
- ], ie.prototype, "loading", 2);
2953
- ue([
2952
+ ], se.prototype, "loading", 2);
2953
+ fe([
2954
2954
  b({ type: String, attribute: "type" })
2955
- ], ie.prototype, "type", 2);
2956
- ie = ue([
2955
+ ], se.prototype, "type", 2);
2956
+ se = fe([
2957
2957
  W("base-button")
2958
- ], ie);
2958
+ ], se);
2959
2959
  var qo = Object.defineProperty, Fo = Object.getOwnPropertyDescriptor, Oe = (e, t, r, o) => {
2960
2960
  for (var i = o > 1 ? void 0 : o ? Fo(t, r) : t, s = e.length - 1, a; s >= 0; s--)
2961
2961
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
2962
2962
  return o && i && qo(t, r, i), i;
2963
2963
  };
2964
- let de = class extends B {
2964
+ let he = class extends B {
2965
2965
  constructor() {
2966
2966
  super(...arguments), this.variant = "default", this.padding = "none", this.hoverable = !1, this.expandable = !1, this.isExpanded = !1;
2967
2967
  }
@@ -3019,9 +3019,11 @@ let de = class extends B {
3019
3019
  ` : t;
3020
3020
  }
3021
3021
  };
3022
- de.styles = J`
3022
+ he.styles = J`
3023
3023
  :host {
3024
3024
  display: block;
3025
+ min-width: 0;
3026
+ margin: var(--space-4);
3025
3027
  }
3026
3028
 
3027
3029
  .base-card {
@@ -3032,7 +3034,9 @@ de.styles = J`
3032
3034
  display: flex;
3033
3035
  flex-direction: column;
3034
3036
  box-sizing: border-box;
3037
+ width: 100%;
3035
3038
  max-width: 100%;
3039
+ min-width: 0;
3036
3040
  }
3037
3041
 
3038
3042
  /* Variants */
@@ -3204,22 +3208,22 @@ de.styles = J`
3204
3208
  `;
3205
3209
  Oe([
3206
3210
  b({ type: String, attribute: "variant" })
3207
- ], de.prototype, "variant", 2);
3211
+ ], he.prototype, "variant", 2);
3208
3212
  Oe([
3209
3213
  b({ type: String, attribute: "padding" })
3210
- ], de.prototype, "padding", 2);
3214
+ ], he.prototype, "padding", 2);
3211
3215
  Oe([
3212
3216
  b({ type: Boolean, reflect: !0, attribute: "hoverable" })
3213
- ], de.prototype, "hoverable", 2);
3217
+ ], he.prototype, "hoverable", 2);
3214
3218
  Oe([
3215
3219
  b({ type: Boolean, reflect: !0, attribute: "expandable" })
3216
- ], de.prototype, "expandable", 2);
3220
+ ], he.prototype, "expandable", 2);
3217
3221
  Oe([
3218
3222
  w()
3219
- ], de.prototype, "isExpanded", 2);
3220
- de = Oe([
3223
+ ], he.prototype, "isExpanded", 2);
3224
+ he = Oe([
3221
3225
  W("base-card")
3222
- ], de);
3226
+ ], he);
3223
3227
  const ee = (e) => e ?? S;
3224
3228
  var jo = Object.defineProperty, Yo = Object.getOwnPropertyDescriptor, M = (e, t, r, o) => {
3225
3229
  for (var i = o > 1 ? void 0 : o ? Yo(t, r) : t, s = e.length - 1, a; s >= 0; s--)
@@ -6020,7 +6024,7 @@ var ei = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, De = (e, t
6020
6024
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
6021
6025
  return o && i && ei(t, r, i), i;
6022
6026
  };
6023
- let he = class extends B {
6027
+ let pe = class extends B {
6024
6028
  constructor() {
6025
6029
  super(...arguments), this.id = "", this.label = "", this.active = !1;
6026
6030
  }
@@ -6063,10 +6067,9 @@ let he = class extends B {
6063
6067
  `;
6064
6068
  }
6065
6069
  };
6066
- he.styles = J`
6070
+ pe.styles = J`
6067
6071
  :host {
6068
6072
  display: none;
6069
- width: 100%;
6070
6073
  }
6071
6074
 
6072
6075
  :host([active]) {
@@ -6079,22 +6082,22 @@ he.styles = J`
6079
6082
  `;
6080
6083
  De([
6081
6084
  b({ type: String, reflect: !0 })
6082
- ], he.prototype, "id", 2);
6085
+ ], pe.prototype, "id", 2);
6083
6086
  De([
6084
6087
  b({ type: String })
6085
- ], he.prototype, "label", 2);
6088
+ ], pe.prototype, "label", 2);
6086
6089
  De([
6087
6090
  b({ type: Number })
6088
- ], he.prototype, "badge", 2);
6091
+ ], pe.prototype, "badge", 2);
6089
6092
  De([
6090
6093
  b({ type: String })
6091
- ], he.prototype, "icon", 2);
6094
+ ], pe.prototype, "icon", 2);
6092
6095
  De([
6093
6096
  b({ type: Boolean, reflect: !0 })
6094
- ], he.prototype, "active", 2);
6095
- he = De([
6097
+ ], pe.prototype, "active", 2);
6098
+ pe = De([
6096
6099
  W("base-tab")
6097
- ], he);
6100
+ ], pe);
6098
6101
  class xt extends zt {
6099
6102
  constructor(t) {
6100
6103
  if (super(t), this.it = S, t.type !== Pt.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
@@ -6111,43 +6114,45 @@ class xt extends zt {
6111
6114
  }
6112
6115
  xt.directiveName = "unsafeHTML", xt.resultType = 1;
6113
6116
  const ri = Rt(xt);
6114
- 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) => {
6115
6118
  for (var i = o > 1 ? void 0 : o ? ii(t, r) : t, s = e.length - 1, a; s >= 0; s--)
6116
6119
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
6117
6120
  return o && i && oi(t, r, i), i;
6118
6121
  };
6119
- let se = class extends B {
6122
+ let te = class extends B {
6120
6123
  constructor() {
6121
- 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;
6122
6125
  }
6123
6126
  connectedCallback() {
6124
- 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);
6125
6128
  }
6126
6129
  disconnectedCallback() {
6127
- 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();
6128
6131
  }
6129
6132
  firstUpdated() {
6130
- this.queryAndRegisterTabs(), setTimeout(() => {
6131
- if (this.syncWithHash && window.location.hash) {
6132
- const e = window.location.hash.replace("#", "");
6133
- if (this.tabs.find((r) => r.id === e)) {
6134
- this.selectTab(e);
6135
- return;
6136
- }
6137
- }
6138
- !this.activeTab && this.tabs.length > 0 && this.selectTab(this.tabs[0].id);
6139
- }, 0);
6133
+ this.queryAndRegisterTabs();
6140
6134
  }
6141
6135
  queryAndRegisterTabs() {
6142
- this.querySelectorAll("base-tab").forEach((t) => {
6143
- const r = {
6144
- id: t.id,
6145
- label: t.getAttribute("label") || "",
6146
- badge: t.hasAttribute("badge") ? Number(t.getAttribute("badge")) : void 0,
6147
- 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
6148
6143
  };
6149
- r.id && !this.tabs.find((o) => o.id === r.id) && (this.tabs = [...this.tabs, r]);
6150
- });
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
+ }
6151
6156
  }
6152
6157
  updated(e) {
6153
6158
  super.updated(e), e.has("activeTab") && this.updateChildTabs();
@@ -6155,9 +6160,7 @@ let se = class extends B {
6155
6160
  handleTabRegister(e) {
6156
6161
  e.stopPropagation();
6157
6162
  const t = e.detail;
6158
- this.tabs.find((r) => r.id === t.id) || (this.tabs = [...this.tabs, t], this.tabs.length === 1 && !this.activeTab && setTimeout(() => {
6159
- this.selectTab(t.id);
6160
- }, 0));
6163
+ this.tabs.find((r) => r.id === t.id) || (this.tabs = [...this.tabs, t]);
6161
6164
  }
6162
6165
  handleTabBadgeUpdate(e) {
6163
6166
  e.stopPropagation();
@@ -6176,6 +6179,9 @@ let se = class extends B {
6176
6179
  const e = window.location.hash.replace("#", "");
6177
6180
  this.tabs.find((r) => r.id === e) && e !== this.activeTab && this.selectTab(e);
6178
6181
  }
6182
+ handleResize() {
6183
+ this.isMobile = window.innerWidth <= 768;
6184
+ }
6179
6185
  selectTab(e) {
6180
6186
  this.activeTab = e, this.syncWithHash && history.replaceState(null, "", `#${e}`), this.dispatchEvent(
6181
6187
  new CustomEvent("tab-change", {
@@ -6231,8 +6237,8 @@ let se = class extends B {
6231
6237
  @keydown=${(i) => this.handleKeyDown(i, t)}
6232
6238
  >
6233
6239
  ${e.icon && this.variant === "sidebar" ? f`<span class="tab-icon">${ri(e.icon)}</span>` : S}
6234
- ${this.isExpanded || this.variant !== "sidebar" ? f`<span class="tab-label">${e.label}</span>` : S}
6235
- ${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}
6236
6242
  </button>
6237
6243
  `;
6238
6244
  }
@@ -6290,14 +6296,16 @@ let se = class extends B {
6290
6296
  `;
6291
6297
  }
6292
6298
  };
6293
- se.styles = J`
6299
+ te.styles = J`
6294
6300
  :host {
6295
6301
  display: block;
6296
- width: 100%;
6302
+ min-width: 0;
6297
6303
  }
6298
6304
 
6299
6305
  .base-tabs {
6300
6306
  width: 100%;
6307
+ min-width: 0;
6308
+ overflow-x: hidden;
6301
6309
  }
6302
6310
 
6303
6311
  .base-tabs--vertical {
@@ -6305,6 +6313,8 @@ se.styles = J`
6305
6313
  gap: var(--space-6, 1.5rem);
6306
6314
  align-items: flex-start;
6307
6315
  padding: var(--space-4, 1rem);
6316
+ min-width: 0;
6317
+ overflow-x: hidden;
6308
6318
  }
6309
6319
 
6310
6320
  /* Sidebar Layout */
@@ -6563,27 +6573,38 @@ se.styles = J`
6563
6573
 
6564
6574
  /* Mobile responsive */
6565
6575
  @media (max-width: 768px) {
6576
+ :host {
6577
+ overflow-x: hidden;
6578
+ }
6579
+
6580
+ .base-tabs {
6581
+ overflow-x: hidden;
6582
+ }
6583
+
6566
6584
  .base-tabs--vertical {
6567
6585
  flex-direction: column;
6568
6586
  padding: 0;
6587
+ overflow-x: hidden;
6569
6588
  }
6570
6589
 
6571
6590
  .tabs-sidebar {
6572
- position: sticky;
6573
- top: 0;
6591
+ position: relative;
6574
6592
  width: 100%;
6575
6593
  max-height: none;
6576
- border-radius: 0;
6577
- border-left: none;
6578
- border-right: none;
6579
- 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;
6580
6600
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
6581
6601
  z-index: 10;
6582
6602
  display: grid;
6583
- grid-template-columns: 1fr auto;
6603
+ grid-template-columns: minmax(0, 1fr) auto;
6584
6604
  grid-template-rows: auto auto;
6585
6605
  gap: var(--space-3, 0.75rem);
6586
6606
  align-items: center;
6607
+ box-sizing: border-box;
6587
6608
  }
6588
6609
 
6589
6610
  .tabs-sidebar--expanded {
@@ -6630,6 +6651,7 @@ se.styles = J`
6630
6651
  scrollbar-width: none;
6631
6652
  -ms-overflow-style: none;
6632
6653
  padding: 0;
6654
+ min-width: 0;
6633
6655
  }
6634
6656
 
6635
6657
  .tabs-nav::-webkit-scrollbar {
@@ -6643,8 +6665,13 @@ se.styles = J`
6643
6665
  gap: var(--space-1, 0.25rem);
6644
6666
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
6645
6667
  min-width: 70px;
6668
+ width: auto;
6646
6669
  min-height: auto;
6647
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);
6648
6675
  }
6649
6676
 
6650
6677
  .tabs-sidebar .tab-button .tab-label {
@@ -6657,6 +6684,7 @@ se.styles = J`
6657
6684
  .tabs-sidebar .tab-icon {
6658
6685
  width: 20px;
6659
6686
  height: 20px;
6687
+ margin-left: 0;
6660
6688
  }
6661
6689
 
6662
6690
  .tabs-sidebar .tab-badge {
@@ -6671,6 +6699,7 @@ se.styles = J`
6671
6699
  .base-tabs--vertical .tabs-content {
6672
6700
  width: 100%;
6673
6701
  padding: var(--space-4, 1rem) var(--space-3, 0.75rem);
6702
+ box-sizing: border-box;
6674
6703
  }
6675
6704
  }
6676
6705
 
@@ -6693,30 +6722,33 @@ se.styles = J`
6693
6722
  }
6694
6723
  }
6695
6724
  `;
6696
- fe([
6725
+ ne([
6697
6726
  b({ type: String, attribute: "active-tab" })
6698
- ], se.prototype, "activeTab", 2);
6699
- fe([
6727
+ ], te.prototype, "activeTab", 2);
6728
+ ne([
6700
6729
  b({ type: String, attribute: "aria-label" })
6701
- ], se.prototype, "ariaLabel", 2);
6702
- fe([
6730
+ ], te.prototype, "ariaLabel", 2);
6731
+ ne([
6703
6732
  b({ type: Boolean, attribute: "sync-with-hash" })
6704
- ], se.prototype, "syncWithHash", 2);
6705
- fe([
6733
+ ], te.prototype, "syncWithHash", 2);
6734
+ ne([
6706
6735
  b({ type: String })
6707
- ], se.prototype, "variant", 2);
6708
- fe([
6736
+ ], te.prototype, "variant", 2);
6737
+ ne([
6709
6738
  w()
6710
- ], se.prototype, "tabs", 2);
6711
- fe([
6739
+ ], te.prototype, "tabs", 2);
6740
+ ne([
6712
6741
  w()
6713
- ], se.prototype, "isExpanded", 2);
6714
- fe([
6742
+ ], te.prototype, "isExpanded", 2);
6743
+ ne([
6744
+ w()
6745
+ ], te.prototype, "isMobile", 2);
6746
+ ne([
6715
6747
  q(".tabs-nav")
6716
- ], se.prototype, "tabsNav", 2);
6717
- se = fe([
6748
+ ], te.prototype, "tabsNav", 2);
6749
+ te = ne([
6718
6750
  W("base-tabs")
6719
- ], se);
6751
+ ], te);
6720
6752
  var si = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, G = (e, t, r, o) => {
6721
6753
  for (var i = o > 1 ? void 0 : o ? ai(t, r) : t, s = e.length - 1, a; s >= 0; s--)
6722
6754
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
@@ -7537,7 +7569,7 @@ var ci = Object.defineProperty, di = Object.getOwnPropertyDescriptor, Pe = (e, t
7537
7569
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
7538
7570
  return o && i && ci(t, r, i), i;
7539
7571
  };
7540
- let pe = class extends B {
7572
+ let ue = class extends B {
7541
7573
  constructor() {
7542
7574
  super(...arguments), this.value = 0, this.min = 0, this.max = 99, this.size = "md", this.allowInput = !0;
7543
7575
  }
@@ -7615,7 +7647,7 @@ let pe = class extends B {
7615
7647
  `;
7616
7648
  }
7617
7649
  };
7618
- pe.styles = J`
7650
+ ue.styles = J`
7619
7651
  :host {
7620
7652
  display: inline-block;
7621
7653
  }
@@ -7763,22 +7795,22 @@ pe.styles = J`
7763
7795
  `;
7764
7796
  Pe([
7765
7797
  b({ type: Number })
7766
- ], pe.prototype, "value", 2);
7798
+ ], ue.prototype, "value", 2);
7767
7799
  Pe([
7768
7800
  b({ type: Number })
7769
- ], pe.prototype, "min", 2);
7801
+ ], ue.prototype, "min", 2);
7770
7802
  Pe([
7771
7803
  b({ type: Number })
7772
- ], pe.prototype, "max", 2);
7804
+ ], ue.prototype, "max", 2);
7773
7805
  Pe([
7774
7806
  b({ type: String })
7775
- ], pe.prototype, "size", 2);
7807
+ ], ue.prototype, "size", 2);
7776
7808
  Pe([
7777
7809
  b({ type: Boolean, attribute: "allow-input" })
7778
- ], pe.prototype, "allowInput", 2);
7779
- pe = Pe([
7810
+ ], ue.prototype, "allowInput", 2);
7811
+ ue = Pe([
7780
7812
  W("quantity-select")
7781
- ], pe);
7813
+ ], ue);
7782
7814
  var hi = Object.defineProperty, pi = Object.getOwnPropertyDescriptor, nt = (e, t, r, o) => {
7783
7815
  for (var i = o > 1 ? void 0 : o ? pi(t, r) : t, s = e.length - 1, a; s >= 0; s--)
7784
7816
  (a = e[s]) && (i = (o ? a(t, r, i) : a(i)) || i);
@@ -8018,11 +8050,11 @@ function Dr(e, t) {
8018
8050
  const { toString: ui } = Object.prototype, { getPrototypeOf: Mt } = Object, { iterator: lt, toStringTag: Pr } = Symbol, ct = /* @__PURE__ */ ((e) => (t) => {
8019
8051
  const r = ui.call(t);
8020
8052
  return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
8021
- })(/* @__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");
8022
8054
  function je(e) {
8023
8055
  return e !== null && !Ce(e) && e.constructor !== null && !Ce(e.constructor) && j(e.constructor.isBuffer) && e.constructor.isBuffer(e);
8024
8056
  }
8025
- const Rr = te("ArrayBuffer");
8057
+ const Rr = re("ArrayBuffer");
8026
8058
  function fi(e) {
8027
8059
  let t;
8028
8060
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Rr(e.buffer), t;
@@ -8040,11 +8072,11 @@ const bi = dt("string"), j = dt("function"), zr = dt("number"), Ye = (e) => e !=
8040
8072
  } catch {
8041
8073
  return !1;
8042
8074
  }
8043
- }, 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) => {
8044
8076
  let t;
8045
8077
  return e && (typeof FormData == "function" && e instanceof FormData || j(e.append) && ((t = ct(e)) === "formdata" || // detect form-data instance
8046
8078
  t === "object" && j(e.toString) && e.toString() === "[object FormData]"));
8047
- }, 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, "");
8048
8080
  function Ve(e, t, { allOwnKeys: r = !1 } = {}) {
8049
8081
  if (e === null || typeof e > "u")
8050
8082
  return;
@@ -8124,12 +8156,12 @@ const Oi = (e, t, r, { allOwnKeys: o } = {}) => (Ve(t, (i, s) => {
8124
8156
  for (; (r = e.exec(t)) !== null; )
8125
8157
  o.push(r);
8126
8158
  return o;
8127
- }, Hi = te("HTMLFormElement"), Bi = (e) => e.toLowerCase().replace(
8159
+ }, Hi = re("HTMLFormElement"), Bi = (e) => e.toLowerCase().replace(
8128
8160
  /[-_\s]([a-z\d])(\w*)/g,
8129
8161
  function(r, o, i) {
8130
8162
  return o.toUpperCase() + i;
8131
8163
  }
8132
- ), 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) => {
8133
8165
  const r = Object.getOwnPropertyDescriptors(e), o = {};
8134
8166
  Ve(r, (i, s) => {
8135
8167
  let a;
@@ -8181,7 +8213,7 @@ const Ki = (e) => {
8181
8213
  return o;
8182
8214
  };
8183
8215
  return r(e, 0);
8184
- }, 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 }) => {
8185
8217
  i === we && s === r && o.length && o.shift()();
8186
8218
  }, !1), (i) => {
8187
8219
  o.push(i), we.postMessage(r, "*");
@@ -8222,7 +8254,7 @@ const Ki = (e) => {
8222
8254
  inherits: Pi,
8223
8255
  toFlatObject: Ri,
8224
8256
  kindOf: ct,
8225
- kindOfTest: te,
8257
+ kindOfTest: re,
8226
8258
  endsWith: zi,
8227
8259
  toArray: Mi,
8228
8260
  forEachEntry: Ii,
@@ -9252,67 +9284,67 @@ const Jr = (e) => {
9252
9284
  let qt;
9253
9285
  try {
9254
9286
  if (be && d && m !== "get" && m !== "head" && (qt = await y(ut, x)) !== 0) {
9255
- let le = new r(v, {
9287
+ let ce = new r(v, {
9256
9288
  method: "POST",
9257
9289
  body: x,
9258
9290
  duplex: "half"
9259
9291
  }), Se;
9260
- 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) {
9261
9293
  const [ft, Ge] = dr(
9262
9294
  qt,
9263
9295
  it(hr(be))
9264
9296
  );
9265
- x = ur(le.body, fr, ft, Ge);
9297
+ x = ur(ce.body, fr, ft, Ge);
9266
9298
  }
9267
9299
  }
9268
9300
  h.isString(We) || (We = We ? "include" : "omit");
9269
- const re = s && "credentials" in r.prototype, Ft = {
9301
+ const oe = s && "credentials" in r.prototype, Ft = {
9270
9302
  ...Bt,
9271
9303
  signal: Je,
9272
9304
  method: m.toUpperCase(),
9273
9305
  headers: ut.normalize().toJSON(),
9274
9306
  body: x,
9275
9307
  duplex: "half",
9276
- credentials: re ? We : void 0
9308
+ credentials: oe ? We : void 0
9277
9309
  };
9278
9310
  Me = s && new r(v, Ft);
9279
- let ne = await (s ? Lt(Me, Bt) : Lt(v, Ft));
9311
+ let le = await (s ? Lt(Me, Bt) : Lt(v, Ft));
9280
9312
  const jt = c && (Q === "stream" || Q === "response");
9281
9313
  if (c && (F || jt && ge)) {
9282
- const le = {};
9314
+ const ce = {};
9283
9315
  ["status", "statusText", "headers"].forEach((Yt) => {
9284
- le[Yt] = ne[Yt];
9316
+ ce[Yt] = le[Yt];
9285
9317
  });
9286
- 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(
9287
9319
  Se,
9288
9320
  it(hr(F), !0)
9289
9321
  ) || [];
9290
- ne = new o(
9291
- ur(ne.body, fr, ft, () => {
9322
+ le = new o(
9323
+ ur(le.body, fr, ft, () => {
9292
9324
  Ge && Ge(), ge && ge();
9293
9325
  }),
9294
- le
9326
+ ce
9295
9327
  );
9296
9328
  }
9297
9329
  Q = Q || "text";
9298
- let eo = await p[h.findKey(p, Q) || "text"](ne, u);
9299
- return !jt && ge && ge(), await new Promise((le, Se) => {
9300
- 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, {
9301
9333
  data: eo,
9302
- headers: Y.from(ne.headers),
9303
- status: ne.status,
9304
- statusText: ne.statusText,
9334
+ headers: Y.from(le.headers),
9335
+ status: le.status,
9336
+ statusText: le.statusText,
9305
9337
  config: u,
9306
9338
  request: Me
9307
9339
  });
9308
9340
  });
9309
- } catch (re) {
9310
- 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(
9311
9343
  new k("Network Error", k.ERR_NETWORK, u, Me),
9312
9344
  {
9313
- cause: re.cause || re
9345
+ cause: oe.cause || oe
9314
9346
  }
9315
- ) : k.from(re, re && re.code, u, Me);
9347
+ ) : k.from(oe, oe && oe.code, u, Me);
9316
9348
  }
9317
9349
  };
9318
9350
  }, Ms = /* @__PURE__ */ new Map(), Gr = (e) => {
@@ -9450,7 +9482,7 @@ function Us(e, t, r) {
9450
9482
  const tt = {
9451
9483
  assertOptions: Us,
9452
9484
  validators: pt
9453
- }, oe = tt.validators;
9485
+ }, ie = tt.validators;
9454
9486
  class xe {
9455
9487
  constructor(t) {
9456
9488
  this.defaults = t || {}, this.interceptors = {
@@ -9487,17 +9519,17 @@ class xe {
9487
9519
  typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r = ke(this.defaults, r);
9488
9520
  const { transitional: o, paramsSerializer: i, headers: s } = r;
9489
9521
  o !== void 0 && tt.assertOptions(o, {
9490
- silentJSONParsing: oe.transitional(oe.boolean),
9491
- forcedJSONParsing: oe.transitional(oe.boolean),
9492
- clarifyTimeoutError: oe.transitional(oe.boolean)
9522
+ silentJSONParsing: ie.transitional(ie.boolean),
9523
+ forcedJSONParsing: ie.transitional(ie.boolean),
9524
+ clarifyTimeoutError: ie.transitional(ie.boolean)
9493
9525
  }, !1), i != null && (h.isFunction(i) ? r.paramsSerializer = {
9494
9526
  serialize: i
9495
9527
  } : tt.assertOptions(i, {
9496
- encode: oe.function,
9497
- serialize: oe.function
9528
+ encode: ie.function,
9529
+ serialize: ie.function
9498
9530
  }, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), tt.assertOptions(r, {
9499
- baseUrl: oe.spelling("baseURL"),
9500
- withXsrfToken: oe.spelling("withXSRFToken")
9531
+ baseUrl: ie.spelling("baseURL"),
9532
+ withXsrfToken: ie.spelling("withXSRFToken")
9501
9533
  }, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
9502
9534
  let a = s && h.merge(
9503
9535
  s.common,
@@ -9826,18 +9858,18 @@ const Ls = ({ baseUrl: e, apiBaseUrl: t }) => {
9826
9858
  export {
9827
9859
  A as AuthForm,
9828
9860
  xr as AuthRefreshError,
9829
- ie as BaseButton,
9830
- de as BaseCard,
9861
+ se as BaseButton,
9862
+ he as BaseCard,
9831
9863
  P as BaseDatePicker,
9832
9864
  T as BaseDateTimePicker,
9833
9865
  V as BaseDrawer,
9834
9866
  K as BaseInput,
9835
9867
  R as BaseSelect,
9836
- he as BaseTab,
9837
- se as BaseTabs,
9868
+ pe as BaseTab,
9869
+ te as BaseTabs,
9838
9870
  L as BaseTextarea,
9839
9871
  N as BaseTimePicker,
9840
- pe as QuantitySelect,
9872
+ ue as QuantitySelect,
9841
9873
  Te as ThemeToggle,
9842
9874
  Vs as apiClient,
9843
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.5",
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
  },