UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

38 lines (37 loc) 1.14 kB
"use client"; import React, { useContext } from 'react'; import Context from "../../shared/Context.js"; import { extendPropsWithContext } from "../../shared/component-helper.js"; import { prerenderIcon, prepareIcon } from "../icon/Icon.js"; import * as primary_icons from "../../icons/dnb/primary_icons.js"; import * as primary_icons_medium from "../../icons/dnb/primary_icons_medium.js"; export * from "../icon/Icon.js"; const icons = { ...primary_icons, ...primary_icons_medium }; export default function IconPrimary(localProps) { const context = useContext(Context); const props = extendPropsWithContext(localProps, {}, { skeleton: context?.skeleton }, context.Icon, context.IconPrimary); const { icon, size, wrapperParams, iconParams, alt } = prepareIcon(props, context); const IconContainer = prerenderIcon({ icon, size, alt, listOfIcons: icons }); if (!IconContainer) { return null; } return React.createElement("span", wrapperParams, React.createElement(IconContainer, iconParams)); } IconPrimary._supportsSpacingProps = true; //# sourceMappingURL=IconPrimary.js.map