@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 +39 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +39 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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) =>
|
|
3719
|
-
"
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
"span",
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
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 = {
|