@bubo-squared/ui-framework 0.2.21 → 0.2.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.js CHANGED
@@ -692,13 +692,14 @@ var Badge = React9.forwardRef(
692
692
  ...rest
693
693
  } = props;
694
694
  const Comp = asChild ? Slot5 : "div";
695
+ const hasValue = typeof value === "string" ? value.trim() !== "" : value != null;
695
696
  return /* @__PURE__ */ jsx11(
696
697
  Comp,
697
698
  {
698
699
  ref,
699
700
  className: cn(badgeVariants({ size, variant }), className),
700
701
  ...rest,
701
- children: value ? /* @__PURE__ */ jsxs6(Fragment, { children: [
702
+ children: hasValue ? /* @__PURE__ */ jsxs6(Fragment, { children: [
702
703
  /* @__PURE__ */ jsx11("span", { className: "font-normal", children: label }),
703
704
  /* @__PURE__ */ jsx11("span", { className: "font-normal", children: ":" }),
704
705
  /* @__PURE__ */ jsx11("span", { className: "font-medium", children: value })
@@ -879,7 +880,7 @@ var Divider = (props) => {
879
880
  className: _className,
880
881
  ...divProps
881
882
  } = props;
882
- const textLabel = label ? label : "OR";
883
+ const textLabel = label ?? "OR";
883
884
  return /* @__PURE__ */ jsxs8(
884
885
  "div",
885
886
  {
@@ -1027,13 +1028,15 @@ var Field = (props) => {
1027
1028
  className,
1028
1029
  children
1029
1030
  } = props;
1031
+ const hasLabel = label != null;
1032
+ const hasHint = hint != null;
1030
1033
  const fieldId = React14.useId();
1031
- const labelId = label ? `${fieldId}-label` : void 0;
1032
- const hintId = hint ? `${fieldId}-hint` : void 0;
1034
+ const labelId = hasLabel ? `${fieldId}-label` : void 0;
1035
+ const hintId = hasHint ? `${fieldId}-hint` : void 0;
1033
1036
  const hintColorClass = disabled ? "text-primary-disabled" : status === "success" ? "text-(--color-success)" : status === "error" ? "text-(--color-error)" : "text-(--color-secondary)";
1034
1037
  const labelColorClass = disabled ? "text-primary-disabled" : "text-primary";
1035
1038
  return /* @__PURE__ */ jsxs9("div", { className: cn(fieldBase, className), children: [
1036
- label && /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between", children: [
1039
+ hasLabel && /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between", children: [
1037
1040
  /* @__PURE__ */ jsx16("label", { id: labelId, className: cn("paragraph-sm", labelColorClass), children: label }),
1038
1041
  labelRight
1039
1042
  ] }),
@@ -1041,9 +1044,9 @@ var Field = (props) => {
1041
1044
  !hideHint && /* @__PURE__ */ jsx16(
1042
1045
  "p",
1043
1046
  {
1044
- id: hint ? hintId : void 0,
1045
- className: cn("caption", hint ? hintColorClass : "invisible"),
1046
- children: hint || "\xA0"
1047
+ id: hasHint ? hintId : void 0,
1048
+ className: cn("caption", hasHint ? hintColorClass : "invisible"),
1049
+ children: hasHint ? hint : "\xA0"
1047
1050
  }
1048
1051
  )
1049
1052
  ] });
@@ -1063,6 +1066,7 @@ var Progress = React15.forwardRef(
1063
1066
  value,
1064
1067
  label,
1065
1068
  hint,
1069
+ ariaLabel,
1066
1070
  showProgressLabel = true,
1067
1071
  hideHint,
1068
1072
  size = "lg",
@@ -1073,12 +1077,13 @@ var Progress = React15.forwardRef(
1073
1077
  } = props;
1074
1078
  const clamped = Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 0;
1075
1079
  const percentageLabel = `${Math.round(clamped)}%`;
1080
+ const resolvedAriaLabel = ariaLabel ?? (typeof label === "string" ? label : void 0);
1076
1081
  const barHeightClasses = sizeToBarClasses[size];
1077
1082
  return /* @__PURE__ */ jsx17(
1078
1083
  Field,
1079
1084
  {
1080
1085
  label,
1081
- labelRight: showProgressLabel && label ? /* @__PURE__ */ jsx17("span", { className: "footnote text-(--color-secondary)", children: percentageLabel }) : void 0,
1086
+ labelRight: showProgressLabel && label != null ? /* @__PURE__ */ jsx17("span", { className: "footnote text-(--color-secondary)", children: percentageLabel }) : void 0,
1082
1087
  hint,
1083
1088
  hideHint,
1084
1089
  status,
@@ -1092,7 +1097,7 @@ var Progress = React15.forwardRef(
1092
1097
  "aria-valuenow": clamped,
1093
1098
  "aria-valuemin": 0,
1094
1099
  "aria-valuemax": 100,
1095
- "aria-label": label,
1100
+ "aria-label": resolvedAriaLabel,
1096
1101
  ...rest,
1097
1102
  children: /* @__PURE__ */ jsx17(
1098
1103
  "div",
@@ -1199,7 +1204,7 @@ import { Slot as Slot6 } from "@radix-ui/react-slot";
1199
1204
  import { cva as cva11 } from "class-variance-authority";
1200
1205
  import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
1201
1206
  var tagVariants = cva11(
1202
- "inline-flex flex-row items-center justify-center rounded-6 gap-2 px-3 overflow-hidden border-1 border-(--border-secondary) bg-(--background-neutral) hover:border-(--border-secondary-hover) focus:border-(--border-brand) focus-ring-primary ",
1207
+ "inline-flex flex-row items-center justify-center rounded-6 gap-2 px-3 overflow-hidden border-1 border-(--border-secondary) bg-(--background-neutral) focus:border-(--border-brand) focus-ring-primary ",
1203
1208
  {
1204
1209
  variants: {
1205
1210
  size: {
@@ -1225,6 +1230,7 @@ var Tag = React17.forwardRef(
1225
1230
  value,
1226
1231
  ...rest
1227
1232
  } = props;
1233
+ const hasValue = typeof value === "string" ? value.trim() !== "" : value != null;
1228
1234
  const Comp = asChild ? Slot6 : "div";
1229
1235
  const leading = props.leadingIcon && React17.isValidElement(props.leadingIcon) ? React17.cloneElement(props.leadingIcon, { disabled, ...props.leadingIcon.props }) : null;
1230
1236
  const trailing = props.trailingIcon && React17.isValidElement(props.trailingIcon) ? React17.cloneElement(props.trailingIcon, { disabled, ...props.trailingIcon.props }) : null;
@@ -1236,7 +1242,7 @@ var Tag = React17.forwardRef(
1236
1242
  ...rest,
1237
1243
  children: [
1238
1244
  leading && /* @__PURE__ */ jsx19("div", { className: iconClasses, children: leading }),
1239
- value ? /* @__PURE__ */ jsxs11("div", { className: "flex flex-row gap-1 items-center", children: [
1245
+ hasValue ? /* @__PURE__ */ jsxs11("div", { className: "flex flex-row gap-1 items-center", children: [
1240
1246
  /* @__PURE__ */ jsx19("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: label }),
1241
1247
  /* @__PURE__ */ jsx19("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: ":" }),
1242
1248
  /* @__PURE__ */ jsx19("span", { className: "text-primary paragraph-lg-medium mb-0! cursor-default font-medium", children: value })
@@ -1570,13 +1576,13 @@ var inputShellVariants = cva13(
1570
1576
  }
1571
1577
  },
1572
1578
  defaultVariants: {
1573
- size: "lg",
1579
+ size: "md",
1574
1580
  status: "default"
1575
1581
  }
1576
1582
  }
1577
1583
  );
1578
1584
  var InputShell = React21.forwardRef(
1579
- ({ size, status, disabled, className, ...rest }, ref) => {
1585
+ ({ size = "md", status, disabled, className, ...rest }, ref) => {
1580
1586
  return /* @__PURE__ */ jsx23(
1581
1587
  "div",
1582
1588
  {
@@ -1679,7 +1685,7 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
1679
1685
  hint,
1680
1686
  hideHint,
1681
1687
  status = "default",
1682
- size = "lg",
1688
+ size = "md",
1683
1689
  disabled,
1684
1690
  className,
1685
1691
  leadingIcon,
@@ -1694,6 +1700,7 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
1694
1700
  inputValue,
1695
1701
  defaultInputValue,
1696
1702
  onInputChange,
1703
+ freeSolo = false,
1697
1704
  dropdownClassName,
1698
1705
  listboxClassName,
1699
1706
  placeholder = "Search\u2026",
@@ -1744,6 +1751,12 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
1744
1751
  }
1745
1752
  onInputChange?.(next);
1746
1753
  };
1754
+ const commitTypedValue = (next) => {
1755
+ if (!isValueControlled) {
1756
+ setInternalValue(next);
1757
+ }
1758
+ onChange?.(next);
1759
+ };
1747
1760
  const commitValue = (next) => {
1748
1761
  if (!isValueControlled) {
1749
1762
  setInternalValue(next);
@@ -1760,6 +1773,9 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
1760
1773
  const next = event.target.value;
1761
1774
  setInputText(next);
1762
1775
  setActiveIndex(-1);
1776
+ if (freeSolo) {
1777
+ commitTypedValue(next);
1778
+ }
1763
1779
  };
1764
1780
  const handleFocus = (event) => {
1765
1781
  setIsFocused(true);
@@ -1768,6 +1784,12 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
1768
1784
  const handleBlur = (event) => {
1769
1785
  setIsFocused(false);
1770
1786
  setActiveIndex(-1);
1787
+ if (freeSolo) {
1788
+ const trimmed = currentInput.trim();
1789
+ if (trimmed.length > 0 && currentInput !== currentValue) {
1790
+ commitTypedValue(currentInput);
1791
+ }
1792
+ }
1771
1793
  onBlur?.(event);
1772
1794
  };
1773
1795
  const handleKeyDown = (event) => {
@@ -1801,6 +1823,17 @@ var Autocomplete = React23.forwardRef((props, forwardedRef) => {
1801
1823
  event.preventDefault();
1802
1824
  commitValue(options[activeIndex]);
1803
1825
  setIsFocused(false);
1826
+ break;
1827
+ }
1828
+ if (freeSolo) {
1829
+ const trimmed = currentInput.trim();
1830
+ if (trimmed.length > 0) {
1831
+ event.preventDefault();
1832
+ if (currentInput !== currentValue) {
1833
+ commitTypedValue(currentInput);
1834
+ }
1835
+ setIsFocused(false);
1836
+ }
1804
1837
  }
1805
1838
  break;
1806
1839
  }
@@ -1923,7 +1956,7 @@ import { cva as cva15 } from "class-variance-authority";
1923
1956
  import { ChevronDownIcon as ChevronDownIcon2 } from "@bubo-squared/icons";
1924
1957
  import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
1925
1958
  var selectTriggerVariants = cva15(
1926
- "group flex w-full items-center justify-between rounded-4 border bg-(--background-primary) p-2 text-left transition-colors cursor-pointer focus-ring-primary focus:border-(--border-brand) hover:bg-(--background-primary-hover) disabled:bg-(--background-primary) disabled:border-(--border-secondary-disabled) disabled:text-primary-disabled disabled:cursor-default",
1959
+ "group flex w-full items-center justify-between rounded-4 border bg-(--background-primary) p-2 text-left transition-colors cursor-pointer hover:bg-(--background-primary-hover) disabled:bg-(--background-primary-disabled) disabled:text-primary-disabled disabled:cursor-default",
1927
1960
  {
1928
1961
  variants: {
1929
1962
  size: {
@@ -1933,13 +1966,13 @@ var selectTriggerVariants = cva15(
1933
1966
  xl: "h-14"
1934
1967
  },
1935
1968
  status: {
1936
- default: "border-(--border-secondary)",
1937
- success: "border-(--border-success)",
1938
- error: "border-(--border-error)"
1969
+ default: "input-default",
1970
+ success: "input-success",
1971
+ error: "input-error"
1939
1972
  }
1940
1973
  },
1941
1974
  defaultVariants: {
1942
- size: "lg",
1975
+ size: "md",
1943
1976
  status: "default"
1944
1977
  }
1945
1978
  }
@@ -1961,7 +1994,7 @@ var textVariants = cva15("truncate", {
1961
1994
  }
1962
1995
  },
1963
1996
  defaultVariants: {
1964
- size: "lg",
1997
+ size: "md",
1965
1998
  hasValue: false
1966
1999
  }
1967
2000
  });
@@ -1979,7 +2012,7 @@ var selectIconVariants = cva15("flex items-center justify-center shrink-0", {
1979
2012
  }
1980
2013
  },
1981
2014
  defaultVariants: {
1982
- size: "lg",
2015
+ size: "md",
1983
2016
  disabled: false
1984
2017
  }
1985
2018
  });
@@ -2003,7 +2036,7 @@ var Select = React24.forwardRef((props, forwardedRef) => {
2003
2036
  hideHint = false,
2004
2037
  name,
2005
2038
  placeholder = "Placeholder text",
2006
- size = "lg",
2039
+ size = "md",
2007
2040
  status = "default",
2008
2041
  disabled,
2009
2042
  options,
@@ -2075,6 +2108,7 @@ var Select = React24.forwardRef((props, forwardedRef) => {
2075
2108
  type: "button",
2076
2109
  "aria-haspopup": "listbox",
2077
2110
  "aria-expanded": isOpen,
2111
+ "aria-disabled": disabled || void 0,
2078
2112
  disabled,
2079
2113
  className: cn(
2080
2114
  selectTriggerVariants({ size, status }),
@@ -2168,7 +2202,7 @@ var passwordTextVariants = cva16("truncate", {
2168
2202
  }
2169
2203
  },
2170
2204
  defaultVariants: {
2171
- size: "lg",
2205
+ size: "md",
2172
2206
  disabled: false
2173
2207
  }
2174
2208
  });
@@ -2216,7 +2250,7 @@ var PasswordInput = React25.forwardRef((props, forwardedRef) => {
2216
2250
  hint,
2217
2251
  hideHint,
2218
2252
  placeholder = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
2219
- size = "lg",
2253
+ size = "md",
2220
2254
  status = "default",
2221
2255
  variant = "icon",
2222
2256
  disabled,
@@ -2724,7 +2758,7 @@ var inputTextVariants2 = cva18("", {
2724
2758
  }
2725
2759
  },
2726
2760
  defaultVariants: {
2727
- size: "lg"
2761
+ size: "md"
2728
2762
  }
2729
2763
  });
2730
2764
  var dropdownWidthVariants = cva18("", {
@@ -2737,7 +2771,7 @@ var dropdownWidthVariants = cva18("", {
2737
2771
  }
2738
2772
  },
2739
2773
  defaultVariants: {
2740
- size: "lg"
2774
+ size: "md"
2741
2775
  }
2742
2776
  });
2743
2777
  var wrapperStatusClass = {
@@ -2757,7 +2791,7 @@ var countryOptionVariants = cva18(
2757
2791
  }
2758
2792
  },
2759
2793
  defaultVariants: {
2760
- size: "lg"
2794
+ size: "md"
2761
2795
  }
2762
2796
  }
2763
2797
  );
@@ -2771,7 +2805,7 @@ var PhoneInput = React31.forwardRef(
2771
2805
  hint,
2772
2806
  hideHint,
2773
2807
  placeholder,
2774
- size = "lg",
2808
+ size = "md",
2775
2809
  disabled = false,
2776
2810
  status = "default",
2777
2811
  ...rest
@@ -2829,7 +2863,7 @@ var CountrySelect = ({
2829
2863
  value: selectedCountry,
2830
2864
  options: countryList,
2831
2865
  onChange,
2832
- size = "lg"
2866
+ size = "md"
2833
2867
  }) => {
2834
2868
  const scrollAreaRef = React31.useRef(null);
2835
2869
  const [searchValue, setSearchValue] = React31.useState("");
@@ -2934,7 +2968,7 @@ var CountrySelectOption = (props) => {
2934
2968
  selectedCountry,
2935
2969
  onChange,
2936
2970
  onSelectComplete,
2937
- size = "lg"
2971
+ size = "md"
2938
2972
  } = props;
2939
2973
  const handleSelect = () => {
2940
2974
  onChange(country);
@@ -3097,7 +3131,7 @@ var searchTextVariants = cva19("truncate", {
3097
3131
  }
3098
3132
  },
3099
3133
  defaultVariants: {
3100
- size: "lg"
3134
+ size: "md"
3101
3135
  }
3102
3136
  });
3103
3137
  var iconWrapperVariants3 = cva19("flex items-center justify-center shrink-0 text-(--icon-primary)", {
@@ -3113,13 +3147,13 @@ var iconWrapperVariants3 = cva19("flex items-center justify-center shrink-0 text
3113
3147
  }
3114
3148
  },
3115
3149
  defaultVariants: {
3116
- size: "lg"
3150
+ size: "md"
3117
3151
  }
3118
3152
  });
3119
3153
  var SearchInput = React33.forwardRef((props, forwardedRef) => {
3120
3154
  const {
3121
3155
  placeholder = "Search...",
3122
- size = "lg",
3156
+ size = "md",
3123
3157
  disabled,
3124
3158
  className,
3125
3159
  leadingIcon,
@@ -3180,10 +3214,21 @@ SearchInput.displayName = "SearchInput";
3180
3214
  import * as React35 from "react";
3181
3215
 
3182
3216
  // src/components/Feedback/Tooltip.tsx
3183
- import "react";
3217
+ import * as React34 from "react";
3184
3218
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3185
3219
  import { jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
3186
3220
  var TooltipArrow = TooltipPrimitive.Arrow;
3221
+ var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
3222
+ var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
3223
+ var canAcceptRef = (child) => {
3224
+ const type = child.type;
3225
+ if (typeof child.type === "string") return true;
3226
+ if (type?.$$typeof === REACT_FORWARD_REF_TYPE) return true;
3227
+ if (type?.$$typeof === REACT_MEMO_TYPE && type.type?.$$typeof === REACT_FORWARD_REF_TYPE) {
3228
+ return true;
3229
+ }
3230
+ return false;
3231
+ };
3187
3232
  var mapPlacementToSideAndAlign = (placement) => {
3188
3233
  switch (placement) {
3189
3234
  case "top":
@@ -3230,6 +3275,9 @@ var Tooltip = (props) => {
3230
3275
  children,
3231
3276
  delayDuration = 200
3232
3277
  } = props;
3278
+ const trigger = React34.isValidElement(children) && canAcceptRef(children) ? children : /* @__PURE__ */ jsx36("span", { className: "inline-flex", tabIndex: 0, children });
3279
+ const hasStrapline = typeof strapline === "string" ? strapline.trim() !== "" : strapline != null;
3280
+ const hasDescription = typeof description === "string" ? description.trim() !== "" : description != null;
3233
3281
  const { side, align } = mapPlacementToSideAndAlign(placement);
3234
3282
  const tooltipClasses = "group bg-(--background-tooltip) max-w-[calc(100vw-2rem)] shadow-card-md border-none rounded-4 py-1.5 px-2.5 [&>span]:scale-200 data-[state=delayed-open]:animate-in data-[state=instant-open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=instant-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2";
3235
3283
  const tooltipArrowClasses = "relative fill-(--background-tooltip) transition-[filter,transform] group-data-[side=top]:top-[-2px] group-data-[side=top]:drop-shadow-[0px_1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=bottom]:drop-shadow-[0px_1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=left]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=right]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)]";
@@ -3242,7 +3290,7 @@ var Tooltip = (props) => {
3242
3290
  disableHoverableContent,
3243
3291
  delayDuration,
3244
3292
  children: [
3245
- /* @__PURE__ */ jsx36(TooltipPrimitive.Trigger, { asChild: true, children }),
3293
+ /* @__PURE__ */ jsx36(TooltipPrimitive.Trigger, { asChild: true, children: trigger }),
3246
3294
  /* @__PURE__ */ jsx36(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs24(
3247
3295
  TooltipPrimitive.Content,
3248
3296
  {
@@ -3253,9 +3301,9 @@ var Tooltip = (props) => {
3253
3301
  children: [
3254
3302
  showArrow && /* @__PURE__ */ jsx36(TooltipArrow, { className: tooltipArrowClasses }),
3255
3303
  /* @__PURE__ */ jsxs24("div", { className: "grid", children: [
3256
- (strapline ?? "") !== "" && /* @__PURE__ */ jsx36("span", { className: "caption text-secondary", children: strapline }),
3304
+ hasStrapline && /* @__PURE__ */ jsx36("span", { className: "caption text-secondary", children: strapline }),
3257
3305
  /* @__PURE__ */ jsx36("h4", { className: "paragraph-md text-primary", children: title }),
3258
- (description ?? "") !== "" && /* @__PURE__ */ jsx36("p", { className: "paragraph-sm text-primary", children: description })
3306
+ hasDescription && /* @__PURE__ */ jsx36("p", { className: "paragraph-sm text-primary", children: description })
3259
3307
  ] })
3260
3308
  ]
3261
3309
  }
@@ -3858,7 +3906,7 @@ var inputTextVariants3 = cva20("truncate", {
3858
3906
  }
3859
3907
  },
3860
3908
  defaultVariants: {
3861
- size: "lg"
3909
+ size: "md"
3862
3910
  }
3863
3911
  });
3864
3912
  var iconWrapperVariants4 = cva20(
@@ -3876,7 +3924,7 @@ var iconWrapperVariants4 = cva20(
3876
3924
  }
3877
3925
  },
3878
3926
  defaultVariants: {
3879
- size: "lg"
3927
+ size: "md"
3880
3928
  }
3881
3929
  }
3882
3930
  );
@@ -3886,7 +3934,7 @@ var TextInput = React37.forwardRef((props, forwardedRef) => {
3886
3934
  hint,
3887
3935
  hideHint,
3888
3936
  placeholder = "Placeholder text",
3889
- size = "lg",
3937
+ size = "md",
3890
3938
  status = "default",
3891
3939
  disabled = false,
3892
3940
  className,
@@ -4088,7 +4136,7 @@ var WebsiteInput = React39.forwardRef((props, forwardedRef) => {
4088
4136
  hierarchy = "leading",
4089
4137
  protocolLabel = "http://",
4090
4138
  icon,
4091
- size = "lg",
4139
+ size = "md",
4092
4140
  disabled,
4093
4141
  className,
4094
4142
  ...rest
@@ -4162,6 +4210,8 @@ var Popover2 = (props) => {
4162
4210
  offset = 10,
4163
4211
  children
4164
4212
  } = props;
4213
+ const hasStrapline = typeof strapline === "string" ? strapline.trim() !== "" : strapline != null;
4214
+ const hasDescription = typeof description === "string" ? description.trim() !== "" : description != null;
4165
4215
  const [open, setOpen] = React40.useState(false);
4166
4216
  const handleCancel = () => {
4167
4217
  onCancel?.();
@@ -4217,9 +4267,9 @@ var Popover2 = (props) => {
4217
4267
  showArrow && /* @__PURE__ */ jsx42(PopoverArrow, { className: popoverArrowClasses }),
4218
4268
  /* @__PURE__ */ jsxs30("div", { className: "grid gap-4", children: [
4219
4269
  /* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
4220
- /* @__PURE__ */ jsx42("span", { className: "caption text-secondary", children: strapline }),
4270
+ hasStrapline && /* @__PURE__ */ jsx42("span", { className: "caption text-secondary", children: strapline }),
4221
4271
  /* @__PURE__ */ jsx42("h4", { className: "subtitle-medium text-primary", children: title }),
4222
- /* @__PURE__ */ jsx42("p", { className: "paragraph-sm text-primary", children: description })
4272
+ hasDescription && /* @__PURE__ */ jsx42("p", { className: "paragraph-sm text-primary", children: description })
4223
4273
  ] }),
4224
4274
  /* @__PURE__ */ jsxs30("div", { className: "flex justify-start items-center gap-4 flex-wrap", children: [
4225
4275
  /* @__PURE__ */ jsx42(Button, { size: "sm", variant: "secondary", onClick: handleCancel, children: cancelText || "Cancel" }),