UNPKG

@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.

77 lines (73 loc) 1.99 kB
"use client"; import { jsx, jsxs } from 'react/jsx-runtime'; import { forwardRef } from 'react'; import { ChevronDownIcon } from '../../icons/ChevronDown.js'; import { classNames } from '../../utils/class-names.js'; const CustomButton = forwardRef( ({ variant = "default", size = "default", disableable = true, className, children, ...props }, forwardedRef) => { return /* @__PURE__ */ jsx("button", { type: "button", className: classNames( "lb-button", !disableable && "lb-button:non-disableable", className ), "data-variant": variant, "data-size": size, ...props, ref: forwardedRef, children }); } ); const Button = forwardRef( ({ icon, children, ...props }, forwardedRef) => { return /* @__PURE__ */ jsxs(CustomButton, { ...props, ref: forwardedRef, children: [ icon ? /* @__PURE__ */ jsx("span", { className: "lb-icon-container", children: icon }) : null, children ? /* @__PURE__ */ jsx("span", { className: "lb-button-label", children }) : null ] }); } ); const SelectButton = forwardRef( ({ icon, children, className, ...props }, forwardedRef) => { return /* @__PURE__ */ jsxs(CustomButton, { ...props, type: "button", className: classNames("lb-select-button", className), ref: forwardedRef, children: [ icon ? /* @__PURE__ */ jsx("span", { className: "lb-icon-container", children: icon }) : null, children ? /* @__PURE__ */ jsx("span", { className: "lb-button-label", children }) : null, /* @__PURE__ */ jsx("span", { className: "lb-select-button-chevron", children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) }) ] }); } ); export { Button, CustomButton, SelectButton }; //# sourceMappingURL=Button.js.map