UNPKG

@cerberus-design/react

Version:

The Cerberus Design React component library.

67 lines (65 loc) 1.95 kB
import { Avatar } from "./chunk-AOLWIMWV.js"; import { Show } from "./chunk-NUXMADXV.js"; import { useCerberusContext } from "./chunk-GITT5645.js"; // src/components/file-upload/file-uploader.tsx import { cx } from "styled-system/css"; import { vstack } from "styled-system/patterns"; import { fileUploader } from "styled-system/recipes"; import { jsx, jsxs } from "react/jsx-runtime"; function FileUploader(props) { const { icons } = useCerberusContext(); const styles = fileUploader(); const { waitingFileUploader: Icon } = icons; return /* @__PURE__ */ jsxs( "div", { ...props.disabled ? { "aria-disabled": true } : {}, className: cx( vstack({ justify: "center" }), styles.container ), children: [ /* @__PURE__ */ jsx("div", { className: styles.icon, children: /* @__PURE__ */ jsx(Avatar, { gradient: "charon-light", fallback: /* @__PURE__ */ jsx(Icon, {}) }) }), /* @__PURE__ */ jsxs( "label", { className: cx( vstack({ justify: "center" }), styles.label ), htmlFor: props.name, children: [ /* @__PURE__ */ jsx(Show, { when: props.heading, children: /* @__PURE__ */ jsx("p", { className: styles.heading, children: props.heading }) }), "Import ", props.accept?.replace(",", ", "), " files", /* @__PURE__ */ jsx("p", { className: styles.description, children: "Click to select files" }), /* @__PURE__ */ jsx( "input", { ...props, className: cx(props.className, styles.input), type: "file" } ) ] } ) ] } ); } export { FileUploader }; //# sourceMappingURL=chunk-CHEYITRR.js.map