@edux-design/utils
v0.1.0
Published
Small helper utilities shared across the design system packages.
Downloads
554
Readme
@edux-design/utils
Small helper utilities shared across the design system packages.
Current exports:
cx(...classes)– lightweight className joiner that skips falsy values (similar toclsx).filterChildrenByDisplayName(children, displayName)– pulls specific slotted components out of a React tree (used by alerts, cards, etc.).
Installation
pnpm add @edux-design/utils
# or
npm install @edux-design/utilsUse it in any package/app that needs the same helpers.
Usage
import { cx, filterChildrenByDisplayName } from "@edux-design/utils";
function Panel({ children }) {
const title = filterChildrenByDisplayName(children, "PanelTitle")[0];
return (
<section className={cx("rounded-xl p-6", !title && "pt-2")}>
{title}
{children}
</section>
);
}Development
pnpm --filter @edux-design/utils lint
pnpm --filter @edux-design/utils check-types
pnpm --filter @edux-design/utils buildAdd new helpers sparingly—anything exported here becomes part of the public API and should include tests + docs.
