Before repair nav components
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s

This commit is contained in:
2026-04-25 11:24:39 +02:00
parent e842ed8041
commit 910c6ab3c7
71 changed files with 4260 additions and 2819 deletions

View File

@@ -0,0 +1,49 @@
// components/Tabs.js
import { h, each } from "sigpro";
export const Tabs = (props, children) => {
children === undefined && (children = props, props = {});
return h("div", { ...props, class: `tabs ${props.class ?? ''}` }, children);
};
export const Tab = (props, children) => {
children === undefined && (children = props, props = {});
return h("a", { ...props, role: "tab", class: `tab ${props.class ?? ''}` }, children);
};
export const TabContent = (props, children) => {
children === undefined && (children = props, props = {});
return h("div", { ...props, class: `tab-content ${props.class ?? ''}` }, children);
};
export const TabClose = (props) => h("a", { ...props, role: "tab", class: `tab ${props.class ?? ''}` }, [
h("span", { class: "flex items-center" }, [
props.label,
h("span", {
class: "icon-[lucide--x] w-3.5 h-3.5 ml-2 cursor-pointer hover:opacity-70",
onclick: (e) => { e.stopPropagation(); props.onClose?.(e); }
})
])
]);
export const TabItems = (props) => {
const items = typeof props.items === "function" ? props.items : () => props.items || [];
return each(
items,
(item, idx) => {
const TabComp = item.closable ? TabClose : Tab;
return [
TabComp({
...item,
class: () => props.activeIndex() === idx ? `tab-active ${item.class ?? ''}` : item.class,
onclick: (e) => { e.preventDefault(); props.activeIndex(idx); item.onclick?.(e); },
onClose: () => props.onClose?.(idx, item)
}),
TabContent({
style: () => `display: ${props.activeIndex() === idx ? "block" : "none"};`
}, typeof item.content === "function" ? item.content() : item.content)
];
},
(item, idx) => item.id ?? idx
);
};