{"version":3,"file":"wrapIcon.mjs","names":[],"sources":["../../../src/icons/wrapIcon.tsx"],"sourcesContent":["/*!\n *\n *  Copyright (c) \"Neo4j\"\n *  Neo4j Sweden AB [http://neo4j.com]\n *\n *  This file is part of Neo4j.\n *\n *  Neo4j is free software: you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation, either version 3 of the License, or\n *  (at your option) any later version.\n *\n *  This program is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/**\n * Utility to add common Neo4j-Design styles / behaviour to any HeroIcon.\n *\n * This wrapper is kept in a single place so that the generated icon files\n * can stay **tiny** and tree-shakeable.\n */\nimport React from 'react';\n\nimport type { CommonProps } from '../_common/types';\n\nconst ICON_CLASSNAME = 'ndl-icon-svg';\n\nexport function wrapIcon<T extends React.ElementType>(Original: T) {\n  const Wrapped = ({\n    className = '',\n    style,\n    ref,\n    htmlAttributes,\n    ...restProps\n    // oxlint-disable-next-line @typescript-eslint/no-empty-object-type\n  }: CommonProps<T, {}>) => (\n    // @ts-expect-error – Original is of any type and we don't know what props it accepts\n    <Original\n      strokeWidth={1.5}\n      style={style}\n      className={`${ICON_CLASSNAME} ${className}`.trim()}\n      aria-hidden=\"true\"\n      {...restProps}\n      {...htmlAttributes}\n      ref={ref}\n    />\n  );\n\n  return React.memo(Wrapped);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCI;CACA;CACA;CACA;;AAPJ,MAAM,iBAAiB;AAEvB,SAAgB,SAAsC,UAAa;CACjE,MAAM,WAAW,SASf;EATe,IAAA,EACf,YAAY,IACZ,OACA,KACA,mBAAA,MACG,YAAA,yBAAA,MAAA,SAAA;EAIH,OAAA,oBAAC,UAAA,eAAA,eAAA,eAAA;GACC,aAAa;GACN;GACP,WAAW,GAAG,eAAe,GAAG,YAAY,KAAK;GACjD,eAAY;EACR,GAAA,SAAA,GACA,cAAA,GAAA,CAAA,GAAA,EACC,IAAA,CACN,CAAA;;CAGH,OAAO,MAAM,KAAK,OAAO;AAC3B"}