UNPKG

@arolariu/components

Version:

🎨 70+ beautiful, accessible React components built on Base UI. TypeScript-first, CSS Modules styling, tree-shakeable, SSR-ready. Perfect for modern web apps, design systems & rapid prototyping. Zero config, maximum flexibility! ⚡

141 lines (140 loc) • 5.11 kB
"use client"; import { jsx, jsxs } from "react/jsx-runtime"; import { Dialog } from "@base-ui/react/dialog"; import { mergeProps } from "@base-ui/react/merge-props"; import { useRender } from "@base-ui/react/use-render"; import { X } from "lucide-react"; import { cn } from "../../lib/utilities.js"; import sheet_module from "./sheet.module.js"; import * as __rspack_external_react from "react"; function Sheet(props) { return /*#__PURE__*/ jsx(Dialog.Root, { ...props }); } const SheetPortal = Dialog.Portal; const SheetClose = Dialog.Close; const SheetTrigger = /*#__PURE__*/ __rspack_external_react.forwardRef((props, ref)=>{ const { asChild = false, children, className, render, ...otherProps } = props; const renderProp = asChild && /*#__PURE__*/ __rspack_external_react.isValidElement(children) ? children : render; return /*#__PURE__*/ jsx(Dialog.Trigger, { ref: ref, ...otherProps, render: useRender({ defaultTagName: "button", render: renderProp, props: mergeProps({ className }, {}) }), children: renderProp ? void 0 : children }); }); function SheetOverlay(props) { const { className, render, ...otherProps } = props; return /*#__PURE__*/ jsx(Dialog.Backdrop, { ...otherProps, render: useRender({ defaultTagName: "div", render: render, props: mergeProps({ className: cn(sheet_module.backdrop, className) }, {}) }) }); } const SheetContent = /*#__PURE__*/ __rspack_external_react.forwardRef((props, ref)=>{ const { className, children, render, side = "right", ...otherProps } = props; return /*#__PURE__*/ jsxs(SheetPortal, { children: [ /*#__PURE__*/ jsx(SheetOverlay, {}), /*#__PURE__*/ jsxs(Dialog.Popup, { ref: ref, ...otherProps, render: useRender({ defaultTagName: "div", render: render, props: mergeProps({ className: cn(sheet_module.popup, sheet_module[side], className) }, {}) }), children: [ /*#__PURE__*/ jsx(Dialog.Close, { "aria-label": "Close", className: sheet_module.close, children: /*#__PURE__*/ jsx(X, { className: sheet_module.closeIcon }) }), children ] }) ] }); }); function SheetHeader(props) { const { asChild = false, children, className, render, ...otherProps } = props; const renderProp = asChild && /*#__PURE__*/ __rspack_external_react.isValidElement(children) ? children : render; return useRender({ defaultTagName: "div", render: renderProp, props: mergeProps({ className: cn(sheet_module.header, className) }, otherProps, { children: renderProp ? void 0 : children }) }); } function SheetFooter(props) { const { asChild = false, children, className, render, ...otherProps } = props; const renderProp = asChild && /*#__PURE__*/ __rspack_external_react.isValidElement(children) ? children : render; return useRender({ defaultTagName: "div", render: renderProp, props: mergeProps({ className: cn(sheet_module.footer, className) }, otherProps, { children: renderProp ? void 0 : children }) }); } function SheetTitle(props) { const { className, children, render, ...otherProps } = props; return /*#__PURE__*/ jsx(Dialog.Title, { ...otherProps, render: useRender({ defaultTagName: "h2", render: render, props: mergeProps({ className: cn(sheet_module.title, className) }, {}) }), children: children }); } function SheetDescription(props) { const { className, children, render, ...otherProps } = props; return /*#__PURE__*/ jsx(Dialog.Description, { ...otherProps, render: useRender({ defaultTagName: "p", render: render, props: mergeProps({ className: cn(sheet_module.description, className) }, {}) }), children: children }); } Sheet.displayName = "Sheet"; SheetPortal.displayName = "SheetPortal"; SheetClose.displayName = "SheetClose"; SheetTrigger.displayName = "SheetTrigger"; SheetOverlay.displayName = "SheetOverlay"; SheetContent.displayName = "SheetContent"; SheetHeader.displayName = "SheetHeader"; SheetFooter.displayName = "SheetFooter"; SheetTitle.displayName = "SheetTitle"; SheetDescription.displayName = "SheetDescription"; export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger }; //# sourceMappingURL=sheet.js.map