import { $, html } from "sigpro"; $.component( "c-tab", (props, { emit, slot }) => { const groupName = `tab-group-${Math.random().toString(36).substring(2, 9)}`; const items = () => props.items() || []; return html`
`tabs ${props.class() ?? "tabs-lifted"}`}> ${() => items().map( (item) => html` props.value() === item.value} @change=${() => { if (typeof props.value === "function") props.value(item.value); emit("change", item.value); }} />
${item.icon ? html` ` : ""} ${slot(item.label)}
`, )}
`; }, ["items", "value", "class"], );