UUUUPPPPP work

This commit is contained in:
2026-03-25 02:03:59 +01:00
parent c857900860
commit df8bd891a2
32 changed files with 1126 additions and 233 deletions

31
components_/Button.js Normal file
View File

@@ -0,0 +1,31 @@
import { $, html } from "sigpro";
$.component(
"c-button",
(props, { emit, slot }) => {
const spinner = () => html`
<span .class="${() => `loading loading-spinner loading-xs ${props.loading() ? "" : "hidden"}`}"></span>
`;
return html`
<div class="${props.tooltip() ? "tooltip" : ""}" data-tip=${() => props.tooltip() ?? ""}>
<button
class="${() => `btn ${props.cls() ?? ""} ${props.badge() ? "indicator" : ""}`}"
?disabled=${props.loading}
@click=${(e) => {
e.stopPropagation();
if (!props.loading()) emit("click", e);
}}>
${spinner} ${slot()}
${() =>
props.badge()
? html`
<span class="indicator-item badge badge-secondary">${props.badge()}</span>
`
: null}
</button>
</div>
`;
},
["cls", "loading", "badge", "tooltip"],
);