@strands.gg/accui 2.11.22 → 2.11.23

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
@@ -1430,6 +1430,18 @@ const X = createLucideIcon("x", [
1430
1430
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
1431
1431
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
1432
1432
  ]);
1433
+ function hasSlotContent(slots, slotName) {
1434
+ const slot = slots[slotName];
1435
+ if (!slot) return false;
1436
+ const content = slot();
1437
+ if (!content || content.length === 0) return false;
1438
+ return content.some((vnode) => {
1439
+ if (vnode.children && vnode.children !== "") return true;
1440
+ if (vnode.type && typeof vnode.type === "object") return true;
1441
+ if (vnode.props && Object.keys(vnode.props).length > 0) return true;
1442
+ return false;
1443
+ });
1444
+ }
1433
1445
  const _hoisted_1$N = {
1434
1446
  key: 0,
1435
1447
  class: "input-leading-icon"
@@ -1481,8 +1493,11 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
1481
1493
  }
1482
1494
  return props.type;
1483
1495
  });
1496
+ const hasLeadingIcon = computed(() => {
1497
+ return hasSlotContent(slots, "leading-icon");
1498
+ });
1484
1499
  const hasTrailingIcon = computed(() => {
1485
- return slots["trailing-icon"] || props.type === "password" || props.type === "search" && props.modelValue;
1500
+ return hasSlotContent(slots, "trailing-icon") || props.type === "password" || props.type === "search" && props.modelValue;
1486
1501
  });
1487
1502
  const buttonTabindex = computed(() => {
1488
1503
  if (props.tabindex === void 0) return;
@@ -1537,7 +1552,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
1537
1552
  return openBlock(), createElementBlock("div", {
1538
1553
  class: normalizeClass(["input-field-wrapper", wrapperClasses.value])
1539
1554
  }, [
1540
- _ctx.$slots["leading-icon"] ? (openBlock(), createElementBlock("div", _hoisted_1$N, [
1555
+ hasLeadingIcon.value ? (openBlock(), createElementBlock("div", _hoisted_1$N, [
1541
1556
  renderSlot(_ctx.$slots, "leading-icon", {}, void 0, true)
1542
1557
  ])) : createCommentVNode("", true),
1543
1558
  createElementVNode("input", {
@@ -1599,7 +1614,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
1599
1614
  };
1600
1615
  }
1601
1616
  });
1602
- const UiInputText = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-67ba177d"]]);
1617
+ const UiInputText = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-99563a41"]]);
1603
1618
  const _hoisted_1$M = {
1604
1619
  key: 0,
1605
1620
  class: "input-leading-icon"
@@ -1636,6 +1651,8 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
1636
1651
  const props = __props;
1637
1652
  const emit = __emit;
1638
1653
  const slots = useSlots();
1654
+ const hasLeadingIcon = computed(() => hasSlotContent(slots, "leading-icon"));
1655
+ const hasTrailingIcon = computed(() => hasSlotContent(slots, "trailing-icon"));
1639
1656
  const wrapperClasses = computed(() => {
1640
1657
  const classes = [];
1641
1658
  if (props.error) classes.push("input-error");
@@ -1646,12 +1663,12 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
1646
1663
  });
1647
1664
  const paddingClasses = computed(() => {
1648
1665
  const classes = [];
1649
- if (slots["leading-icon"]) {
1666
+ if (hasLeadingIcon.value) {
1650
1667
  classes.push("input-padding-left-icon");
1651
1668
  } else {
1652
1669
  classes.push("input-padding-left");
1653
1670
  }
1654
- if (slots["trailing-icon"]) {
1671
+ if (hasTrailingIcon.value) {
1655
1672
  classes.push("input-padding-right-icon");
1656
1673
  } else {
1657
1674
  classes.push("input-padding-right");
@@ -1675,7 +1692,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
1675
1692
  return openBlock(), createElementBlock("div", {
1676
1693
  class: normalizeClass(["input-field-wrapper input-textarea", wrapperClasses.value])
1677
1694
  }, [
1678
- _ctx.$slots["leading-icon"] ? (openBlock(), createElementBlock("div", _hoisted_1$M, [
1695
+ hasLeadingIcon.value ? (openBlock(), createElementBlock("div", _hoisted_1$M, [
1679
1696
  renderSlot(_ctx.$slots, "leading-icon", {}, void 0, true)
1680
1697
  ])) : createCommentVNode("", true),
1681
1698
  createElementVNode("div", {
@@ -1703,14 +1720,14 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
1703
1720
  onKeydown: handleKeydown
1704
1721
  }, null, 42, _hoisted_2$G)
1705
1722
  ], 2),
1706
- _ctx.$slots["trailing-icon"] ? (openBlock(), createElementBlock("div", _hoisted_3$D, [
1723
+ hasTrailingIcon.value ? (openBlock(), createElementBlock("div", _hoisted_3$D, [
1707
1724
  renderSlot(_ctx.$slots, "trailing-icon", {}, void 0, true)
1708
1725
  ])) : createCommentVNode("", true)
1709
1726
  ], 2);
1710
1727
  };
1711
1728
  }
1712
1729
  });
1713
- const UiInputTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-b18ddba2"]]);
1730
+ const UiInputTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-ffd4ab5c"]]);
1714
1731
  function useFloatingPosition(options) {
1715
1732
  const {
1716
1733
  trigger,
@@ -25553,18 +25570,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
25553
25570
  const emit = __emit;
25554
25571
  const slots = useSlots();
25555
25572
  const inputId = computed(() => `input-${Math.random().toString(36).substring(2, 11)}`);
25556
- const hasSlotContent = (slotName) => {
25557
- const slot = slots[slotName];
25558
- if (!slot) return false;
25559
- const content = slot();
25560
- if (!content || content.length === 0) return false;
25561
- return content.some((vnode) => {
25562
- if (vnode.children && vnode.children !== "") return true;
25563
- if (vnode.type && typeof vnode.type === "object") return true;
25564
- if (vnode.props && Object.keys(vnode.props).length > 0) return true;
25565
- return false;
25566
- });
25567
- };
25573
+ const hasSlotContent$1 = (slotName) => hasSlotContent(slots, slotName);
25568
25574
  const isTextInput = computed(() => {
25569
25575
  const textTypes = ["text", "email", "password", "number", "tel", "url", "search"];
25570
25576
  const inputType = props.type || "text";
@@ -25630,14 +25636,14 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
25630
25636
  onFocus: handleFocus,
25631
25637
  onKeydown: handleKeydown
25632
25638
  }, createSlots({ _: 2 }, [
25633
- hasSlotContent("leading-icon") ? {
25639
+ hasSlotContent$1("leading-icon") ? {
25634
25640
  name: "leading-icon",
25635
25641
  fn: withCtx(() => [
25636
25642
  renderSlot(_ctx.$slots, "leading-icon", {}, void 0, true)
25637
25643
  ]),
25638
25644
  key: "0"
25639
25645
  } : void 0,
25640
- hasSlotContent("trailing-icon") ? {
25646
+ hasSlotContent$1("trailing-icon") ? {
25641
25647
  name: "trailing-icon",
25642
25648
  fn: withCtx(() => [
25643
25649
  renderSlot(_ctx.$slots, "trailing-icon", {}, void 0, true)
@@ -25666,14 +25672,14 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
25666
25672
  onFocus: handleFocus,
25667
25673
  onKeydown: handleKeydown
25668
25674
  }, createSlots({ _: 2 }, [
25669
- hasSlotContent("leading-icon") ? {
25675
+ hasSlotContent$1("leading-icon") ? {
25670
25676
  name: "leading-icon",
25671
25677
  fn: withCtx(() => [
25672
25678
  renderSlot(_ctx.$slots, "leading-icon", {}, void 0, true)
25673
25679
  ]),
25674
25680
  key: "0"
25675
25681
  } : void 0,
25676
- hasSlotContent("trailing-icon") ? {
25682
+ hasSlotContent$1("trailing-icon") ? {
25677
25683
  name: "trailing-icon",
25678
25684
  fn: withCtx(() => [
25679
25685
  renderSlot(_ctx.$slots, "trailing-icon", {}, void 0, true)
@@ -25700,14 +25706,14 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
25700
25706
  onBlur: handleBlur,
25701
25707
  onFocus: handleFocus
25702
25708
  }, createSlots({ _: 2 }, [
25703
- hasSlotContent("leading-icon") ? {
25709
+ hasSlotContent$1("leading-icon") ? {
25704
25710
  name: "leading-icon",
25705
25711
  fn: withCtx(() => [
25706
25712
  renderSlot(_ctx.$slots, "leading-icon", {}, void 0, true)
25707
25713
  ]),
25708
25714
  key: "0"
25709
25715
  } : void 0,
25710
- hasSlotContent("trailing-icon") ? {
25716
+ hasSlotContent$1("trailing-icon") ? {
25711
25717
  name: "trailing-icon",
25712
25718
  fn: withCtx(() => [
25713
25719
  renderSlot(_ctx.$slots, "trailing-icon", {}, void 0, true)
@@ -25735,14 +25741,14 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
25735
25741
  onBlur: handleBlur,
25736
25742
  onFocus: handleFocus
25737
25743
  }, createSlots({ _: 2 }, [
25738
- hasSlotContent("leading-icon") ? {
25744
+ hasSlotContent$1("leading-icon") ? {
25739
25745
  name: "leading-icon",
25740
25746
  fn: withCtx(() => [
25741
25747
  renderSlot(_ctx.$slots, "leading-icon", {}, void 0, true)
25742
25748
  ]),
25743
25749
  key: "0"
25744
25750
  } : void 0,
25745
- hasSlotContent("trailing-icon") ? {
25751
+ hasSlotContent$1("trailing-icon") ? {
25746
25752
  name: "trailing-icon",
25747
25753
  fn: withCtx(() => [
25748
25754
  renderSlot(_ctx.$slots, "trailing-icon", {}, void 0, true)
@@ -25826,14 +25832,14 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
25826
25832
  onFocus: handleFocus,
25827
25833
  onComplete: handlePincodeComplete
25828
25834
  }, createSlots({ _: 2 }, [
25829
- hasSlotContent("leading-icon") ? {
25835
+ hasSlotContent$1("leading-icon") ? {
25830
25836
  name: "leading-icon",
25831
25837
  fn: withCtx(() => [
25832
25838
  renderSlot(_ctx.$slots, "leading-icon", {}, void 0, true)
25833
25839
  ]),
25834
25840
  key: "0"
25835
25841
  } : void 0,
25836
- hasSlotContent("trailing-icon") ? {
25842
+ hasSlotContent$1("trailing-icon") ? {
25837
25843
  name: "trailing-icon",
25838
25844
  fn: withCtx(() => [
25839
25845
  renderSlot(_ctx.$slots, "trailing-icon", {}, void 0, true)
@@ -25850,7 +25856,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
25850
25856
  };
25851
25857
  }
25852
25858
  });
25853
- const StrandsUiInput = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-6486063c"]]);
25859
+ const StrandsUiInput = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-55d725f7"]]);
25854
25860
  const _hoisted_1$D = ["disabled", "aria-disabled"];
25855
25861
  const _hoisted_2$y = ["href", "target", "rel", "aria-disabled"];
25856
25862
  const _sfc_main$G = /* @__PURE__ */ defineComponent({
@@ -0,0 +1,9 @@
1
+ import type { Slots } from 'vue';
2
+ /**
3
+ * Check if a slot has actual content (not just empty/whitespace)
4
+ *
5
+ * @param slots - Vue slots object from useSlots()
6
+ * @param slotName - Name of the slot to check
7
+ * @returns true if slot has content, false otherwise
8
+ */
9
+ export declare function hasSlotContent(slots: Slots, slotName: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strands.gg/accui",
3
- "version": "2.11.22",
3
+ "version": "2.11.23",
4
4
  "description": "Strands Authentication UI Components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",