@liveblocks/react-ui
Version:
A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.
68 lines (63 loc) • 2.06 kB
JavaScript
"use client";
;
var jsxRuntime = require('react/jsx-runtime');
var react = require('react');
var ChevronDown = require('../../icons/ChevronDown.cjs');
var cn = require('../../utils/cn.cjs');
const CustomButton = react.forwardRef(
({
variant = "default",
size = "default",
disableable = true,
className,
children,
...props
}, forwardedRef) => {
return /* @__PURE__ */ jsxRuntime.jsx(
"button",
{
type: "button",
className: cn.cn(
"lb-button",
!disableable && "lb-button:non-disableable",
className
),
"data-variant": variant,
"data-size": size,
...props,
ref: forwardedRef,
children
}
);
}
);
const Button = react.forwardRef(
({ icon, children, ...props }, forwardedRef) => {
return /* @__PURE__ */ jsxRuntime.jsxs(CustomButton, { ...props, ref: forwardedRef, children: [
icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lb-icon-container", children: icon }) : null,
children ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lb-button-label", children }) : null
] });
}
);
const SelectButton = react.forwardRef(
({ icon, children, className, ...props }, forwardedRef) => {
return /* @__PURE__ */ jsxRuntime.jsxs(
CustomButton,
{
...props,
type: "button",
className: cn.cn("lb-select-button", className),
ref: forwardedRef,
children: [
icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lb-icon-container", children: icon }) : null,
children ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lb-button-label", children }) : null,
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "lb-select-button-chevron", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDown.ChevronDownIcon, {}) })
]
}
);
}
);
exports.Button = Button;
exports.CustomButton = CustomButton;
exports.SelectButton = SelectButton;
//# sourceMappingURL=Button.cjs.map