UNPKG

@payfit/unity-components

Version:

33 lines (32 loc) • 1.08 kB
import { DropzoneContextProvider as e } from "./Dropzone.context.js"; import { dropzone as t } from "./Dropzone.variants.js"; import { forwardRef as n, useId as r } from "react"; import { jsx as i } from "react/jsx-runtime"; import { DropZone as a } from "react-aria-components"; //#region src/core/components/dropzone/Dropzone.tsx var o = n(({ state: n = "default", className: o, "aria-describedby": s, "aria-labelledby": c, ...l }, u) => { let d = r(), f = `unity-dropzone-${d}__label`, p = `unity-dropzone-${d}__description`, m = n === "disabled"; return /* @__PURE__ */ i(e, { value: { descriptionId: p, labelId: f }, children: /* @__PURE__ */ i(a, { ...l, ref: u, isDisabled: m, "aria-invalid": n === "invalid" || void 0, "aria-describedby": [s, p].filter(Boolean).join(" ") || void 0, "aria-labelledby": [c, f].filter(Boolean).join(" ") || void 0, className: t({ state: n, className: o }), "data-unity-slot": "dropzone", "data-dropzone-state": n }) }); }); o.displayName = "Dropzone"; //#endregion export { o as Dropzone };