@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.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) =>
|
|
3725
|
-
"
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
"span",
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
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 = {
|