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