@wordpress/components
Version:
UI components for WordPress.
22 lines (21 loc) • 798 B
JavaScript
import * as Ariakit from "@ariakit/react";
import { forwardRef } from "@wordpress/element";
import { jsx } from "react/jsx-runtime";
// packages/components/src/disclosure/index.tsx
/**
* Accessible Disclosure component that controls visibility of a section of
* content. It follows the WAI-ARIA Disclosure Pattern.
*/
const UnforwardedDisclosureContent = ({ visible, children, ...props }, ref) => {
const disclosure = Ariakit.useDisclosureStore({ open: visible });
return /* @__PURE__ */ jsx(Ariakit.DisclosureContent, {
store: disclosure,
ref,
...props,
children
});
};
const DisclosureContent = forwardRef(UnforwardedDisclosureContent);
DisclosureContent.displayName = "DisclosureContent";
export { DisclosureContent, DisclosureContent as default };
//# sourceMappingURL=index.mjs.map