@strands.gg/accui 2.10.1 → 2.10.3

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.es.js CHANGED
@@ -837,8 +837,9 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
837
837
  unref(attrs)["class"]
838
838
  ]])
839
839
  }, [
840
- _ctx.$slots["header"] || _ctx.title || _ctx.subtitle ? (openBlock(), createElementBlock("div", _hoisted_1$O, [
840
+ _ctx.$slots["header"] || _ctx.title || _ctx.subtitle || _ctx.$slots["leading-icon"] || _ctx.$slots["trailing-icon"] ? (openBlock(), createElementBlock("div", _hoisted_1$O, [
841
841
  renderSlot(_ctx.$slots, "header", {}, () => [
842
+ renderSlot(_ctx.$slots, "leading-icon", {}, void 0, true),
842
843
  _ctx.title || _ctx.$slots["title"] || _ctx.subtitle || _ctx.$slots["subtitle"] ? (openBlock(), createElementBlock("div", _hoisted_2$I, [
843
844
  _ctx.title || _ctx.$slots["title"] ? renderSlot(_ctx.$slots, "title", { key: 0 }, () => [
844
845
  _ctx.title ? (openBlock(), createElementBlock("h2", _hoisted_3$F, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true)
@@ -847,6 +848,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
847
848
  _ctx.subtitle ? (openBlock(), createElementBlock("p", _hoisted_4$D, toDisplayString(_ctx.subtitle), 1)) : createCommentVNode("", true)
848
849
  ], true) : createCommentVNode("", true)
849
850
  ])) : createCommentVNode("", true),
851
+ renderSlot(_ctx.$slots, "trailing-icon", {}, void 0, true),
850
852
  renderSlot(_ctx.$slots, "actions", {}, void 0, true)
851
853
  ], true)
852
854
  ])) : createCommentVNode("", true),
@@ -860,7 +862,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
860
862
  };
861
863
  }
862
864
  });
863
- const StrandsUiCard = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-cc3144c9"]]);
865
+ const StrandsUiCard = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-d53b5273"]]);
864
866
  /**
865
867
  * @license lucide-vue-next v0.542.0 - ISC
866
868
  *
@@ -2620,12 +2622,25 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
2620
2622
  },
2621
2623
  emits: ["update:modelValue"],
2622
2624
  setup(__props, { emit: __emit }) {
2623
- const isDevToolsOpen = () => {
2624
- try {
2625
- return window.outerHeight - window.innerHeight > 160 || window.outerWidth - window.innerWidth > 160;
2626
- } catch {
2625
+ let lastCalculationTime = 0;
2626
+ let calculationInProgress = false;
2627
+ const isSafeToCalculate = () => {
2628
+ if (calculationInProgress) {
2629
+ return false;
2630
+ }
2631
+ const now = Date.now();
2632
+ const timeSinceLastCalc = now - lastCalculationTime;
2633
+ if (timeSinceLastCalc < 16) {
2627
2634
  return false;
2628
2635
  }
2636
+ return true;
2637
+ };
2638
+ const startCalculation = () => {
2639
+ calculationInProgress = true;
2640
+ lastCalculationTime = Date.now();
2641
+ };
2642
+ const endCalculation = () => {
2643
+ calculationInProgress = false;
2629
2644
  };
2630
2645
  const props = __props;
2631
2646
  const emit = __emit;
@@ -2653,17 +2668,35 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
2653
2668
  let currentTabIndex = -1;
2654
2669
  let isAnimating = false;
2655
2670
  const calculateUnderlineDimensions = (tabElement, containerElement) => {
2656
- if (isDevToolsOpen()) {
2671
+ if (!tabElement || !containerElement) {
2657
2672
  return {
2658
- width: 100,
2673
+ width: 0,
2659
2674
  left: 0,
2660
- height: 3,
2675
+ height: 0,
2661
2676
  top: 0
2662
2677
  };
2663
2678
  }
2679
+ if (!isSafeToCalculate()) {
2680
+ return {
2681
+ width: 0,
2682
+ left: 0,
2683
+ height: 0,
2684
+ top: 0
2685
+ };
2686
+ }
2687
+ startCalculation();
2664
2688
  try {
2665
2689
  const tabRect = tabElement.getBoundingClientRect();
2666
2690
  const containerRect = containerElement.getBoundingClientRect();
2691
+ if (!tabRect || !containerRect || tabRect.width === 0 || containerRect.width === 0) {
2692
+ endCalculation();
2693
+ return {
2694
+ width: 0,
2695
+ left: 0,
2696
+ height: 0,
2697
+ top: 0
2698
+ };
2699
+ }
2667
2700
  const computedStyle = getComputedStyle(containerElement);
2668
2701
  const underlineThickness = parseFloat(computedStyle.getPropertyValue("--underline-thickness") || "5");
2669
2702
  let actualPadding = 5;
@@ -2676,6 +2709,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
2676
2709
  if (props.orientation === "vertical") {
2677
2710
  const tabTop = tabRect.top - containerRect.top;
2678
2711
  const tabHeight = tabRect.height;
2712
+ endCalculation();
2679
2713
  return {
2680
2714
  height: tabHeight - actualPadding * 4,
2681
2715
  // More padding for shorter underline
@@ -2690,6 +2724,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
2690
2724
  const tabLeft = tabRect.left - containerRect.left;
2691
2725
  const tabWidth = tabRect.width;
2692
2726
  if (props.underlineWidth === "full") {
2727
+ endCalculation();
2693
2728
  return {
2694
2729
  width: tabWidth - 30,
2695
2730
  // Fixed 15px margin on each side for horizontal tabs
@@ -2713,6 +2748,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
2713
2748
  underlineWidth = parseFloat(props.underlineWidth) || tabWidth;
2714
2749
  }
2715
2750
  const offset = (tabWidth - underlineWidth) / 2;
2751
+ endCalculation();
2716
2752
  return {
2717
2753
  width: underlineWidth,
2718
2754
  left: tabLeft + offset,
@@ -2722,11 +2758,12 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
2722
2758
  };
2723
2759
  }
2724
2760
  } catch (error) {
2761
+ endCalculation();
2725
2762
  console.warn("Tab dimension calculation failed, using fallback values:", error);
2726
2763
  return {
2727
- width: 100,
2764
+ width: 0,
2728
2765
  left: 0,
2729
- height: 3,
2766
+ height: 0,
2730
2767
  top: 0
2731
2768
  };
2732
2769
  }
@@ -3040,7 +3077,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
3040
3077
  };
3041
3078
  }
3042
3079
  });
3043
- const StrandsUiTabs = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-8e8f1aec"]]);
3080
+ const StrandsUiTabs = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-497967b5"]]);
3044
3081
  const _hoisted_1$I = {
3045
3082
  key: 0,
3046
3083
  class: "ui-divider-text"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strands.gg/accui",
3
- "version": "2.10.1",
3
+ "version": "2.10.3",
4
4
  "description": "Strands Authentication UI Components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",