@martinsura/ui 0.1.4 → 0.1.5

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
@@ -3715,42 +3715,45 @@ var Tabs = ({
3715
3715
  props.className,
3716
3716
  props.classNames?.list
3717
3717
  ),
3718
- children: props.options.map((opt) => /* @__PURE__ */ jsxs(
3719
- "button",
3720
- {
3721
- type: "button",
3722
- role: "tab",
3723
- "aria-selected": props.value === opt.value,
3724
- disabled: opt.disabled,
3725
- onClick: () => !opt.disabled && props.onChange(opt.value),
3726
- className: twMerge(
3727
- "flex-1 min-w-0 transition-all duration-150 cursor-pointer select-none whitespace-nowrap",
3728
- "inline-flex items-center justify-center gap-2",
3729
- tabSizeClass[size],
3730
- tabVariantClass[variant],
3731
- props.value === opt.value ? activeVariantClass[variant] : inactiveVariantClass[variant],
3732
- opt.disabled && "cursor-not-allowed opacity-45 hover:border-(--ui-border) hover:text-(--ui-text-muted)",
3733
- props.classNames?.tab,
3734
- props.value === opt.value ? props.classNames?.activeTab : props.classNames?.inactiveTab
3735
- ),
3736
- children: [
3737
- opt.icon && /* @__PURE__ */ jsx("span", { className: twMerge("shrink-0", props.classNames?.icon), children: opt.icon }),
3738
- /* @__PURE__ */ jsx("span", { className: "truncate", children: opt.label }),
3739
- opt.badge && /* @__PURE__ */ jsx(
3740
- "span",
3741
- {
3742
- className: twMerge(
3743
- "shrink-0 rounded-full px-2 py-0.5 text-[11px] leading-none",
3744
- props.value === opt.value ? "bg-(--ui-primary) text-(--ui-primary-text)" : "bg-(--ui-surface-muted) text-(--ui-text-muted)",
3745
- props.classNames?.badge
3746
- ),
3747
- children: opt.badge
3748
- }
3749
- )
3750
- ]
3751
- },
3752
- opt.value
3753
- ))
3718
+ children: props.options.map((opt) => {
3719
+ const isSimpleLabel = typeof opt.label === "string" || typeof opt.label === "number";
3720
+ return /* @__PURE__ */ jsxs(
3721
+ "button",
3722
+ {
3723
+ type: "button",
3724
+ role: "tab",
3725
+ "aria-selected": props.value === opt.value,
3726
+ disabled: opt.disabled,
3727
+ onClick: () => !opt.disabled && props.onChange(opt.value),
3728
+ className: twMerge(
3729
+ "flex-1 min-w-0 transition-all duration-150 cursor-pointer select-none whitespace-nowrap",
3730
+ "inline-flex items-center justify-center gap-2",
3731
+ tabSizeClass[size],
3732
+ tabVariantClass[variant],
3733
+ props.value === opt.value ? activeVariantClass[variant] : inactiveVariantClass[variant],
3734
+ opt.disabled && "cursor-not-allowed opacity-45 hover:border-(--ui-border) hover:text-(--ui-text-muted)",
3735
+ props.classNames?.tab,
3736
+ props.value === opt.value ? props.classNames?.activeTab : props.classNames?.inactiveTab
3737
+ ),
3738
+ children: [
3739
+ opt.icon && /* @__PURE__ */ jsx("span", { className: twMerge("shrink-0", props.classNames?.icon), children: opt.icon }),
3740
+ /* @__PURE__ */ jsx("span", { className: twMerge("min-w-0", isSimpleLabel && "truncate"), children: opt.label }),
3741
+ opt.badge && /* @__PURE__ */ jsx(
3742
+ "span",
3743
+ {
3744
+ className: twMerge(
3745
+ "shrink-0 rounded-full px-2 py-0.5 text-[11px] leading-none",
3746
+ props.value === opt.value ? "bg-(--ui-primary) text-(--ui-primary-text)" : "bg-(--ui-surface-muted) text-(--ui-text-muted)",
3747
+ props.classNames?.badge
3748
+ ),
3749
+ children: opt.badge
3750
+ }
3751
+ )
3752
+ ]
3753
+ },
3754
+ opt.value
3755
+ );
3756
+ })
3754
3757
  }
3755
3758
  );
3756
3759
  var colorClasses = {