UNPKG

@stratakit/bricks

Version:

Small, modular components for StrataKit

40 lines (39 loc) 1.36 kB
import { jsx } from "react/jsx-runtime"; import { createIconFromPath, forwardRef } from "@stratakit/foundations/secret-internals"; import cx from "classnames"; const disclosureIcons = { /** caret-down.svg */ down: createIconFromPath( "M9.646 6.896a.5.5 0 0 1 .707.707l-2 2a.5.5 0 0 1-.707 0l-2-2-.064-.078a.5.5 0 0 1 .693-.693l.078.064L8 8.543l1.646-1.647Z" ), /** caret-right.svg */ right: createIconFromPath( "M6.896 5.646a.501.501 0 0 1 .629-.064l.078.064 2 2a.5.5 0 0 1 0 .707l-2 2a.5.5 0 1 1-.707-.707L8.543 8 6.896 6.353l-.064-.078a.501.501 0 0 1 .064-.629Z" ) }; const DisclosureArrow = forwardRef( (props, forwardedRef) => { const { direction = "down", ...rest } = props; const Element = disclosureIcons[direction]; return /* @__PURE__ */ jsx( Element, { ...rest, className: cx("\u{1F95D}DisclosureArrow", props.className), ref: forwardedRef } ); } ); DEV: DisclosureArrow.displayName = "DisclosureArrow"; const CaretsUpDown = createIconFromPath( "M9.647 9.646a.5.5 0 0 1 .707.707l-2 2a.5.5 0 0 1-.707 0l-2-2a.5.5 0 1 1 .707-.707L8 11.292l1.647-1.646ZM7.725 3.582a.501.501 0 0 1 .629.064l2 2a.5.5 0 0 1-.707.707L8 4.707 6.354 6.353a.5.5 0 1 1-.707-.707l2-2 .078-.064Z" ); DEV: CaretsUpDown.displayName = "CaretsUpDown"; export { CaretsUpDown, DisclosureArrow };