alinea
Version:
[](https://npmjs.org/package/alinea) [](https://packagephobia.com/result?p=alinea)
66 lines (62 loc) • 1.97 kB
JavaScript
import "../../chunks/chunk-U5RRZUYZ.js";
// src/dashboard/view/Create.tsx
import { HStack } from "alinea/ui";
import { IcRoundAddCircle } from "alinea/ui/icons/IcRoundAddCircle";
import { fromModule } from "alinea/ui/util/Styler";
import { link } from "../util/HashRouter.js";
// src/dashboard/view/Create.module.scss
var Create_module_default = {
"root": "alinea-Create",
"button": "alinea-Create-button",
"button-add": "alinea-Create-button-add",
"buttonAdd": "alinea-Create-button-add"
};
// src/dashboard/view/Create.tsx
import { jsx, jsxs } from "react/jsx-runtime";
var styles = fromModule(Create_module_default);
var Create;
((Create2) => {
Create2.Root = styles.root.toElement("div");
function Link({
children,
icon: Icon,
...props
}) {
return /* @__PURE__ */ jsx(
"a",
{
...props,
...link(props.href),
className: styles.button.mergeProps(props)(),
children: /* @__PURE__ */ jsxs(HStack, { center: true, gap: 8, children: [
/* @__PURE__ */ jsx(IcRoundAddCircle, { style: { flexShrink: 0 } }),
Icon && /* @__PURE__ */ jsx(Icon, {}),
children && /* @__PURE__ */ jsx("span", { children })
] })
}
);
}
Create2.Link = Link;
function Button({
children,
icon: Icon,
...props
}) {
return /* @__PURE__ */ jsx(
"button",
{
type: "button",
...props,
className: styles.button.mergeProps(props)(),
children: /* @__PURE__ */ jsxs(HStack, { center: true, gap: 8, children: [
Icon ? /* @__PURE__ */ jsx("div", { className: styles.button.add(), children: /* @__PURE__ */ jsx(Icon, {}) }) : /* @__PURE__ */ jsx("div", { className: styles.button.add(), children: /* @__PURE__ */ jsx(IcRoundAddCircle, {}) }),
children && /* @__PURE__ */ jsx("span", { children })
] })
}
);
}
Create2.Button = Button;
})(Create || (Create = {}));
export {
Create
};