{"version":3,"file":"IconIndicatorWrapper.mjs","names":[],"sources":["../../../src/_common/IconIndicatorWrapper.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\nimport classNames from 'classnames';\nimport { forwardRef } from 'react';\n\nimport { type HtmlAttributes } from './types';\n\nexport type IconIndicatorType = 'info' | 'warning' | 'danger';\n\ntype IconIndicatorWrapperProps = {\n  children: React.ReactNode;\n  type: IconIndicatorType;\n  className?: string;\n  style?: React.CSSProperties;\n  htmlAttributes?: HtmlAttributes<'div'>;\n};\n\nexport const IconIndicatorWrapper = forwardRef<\n  HTMLDivElement,\n  IconIndicatorWrapperProps\n>(({ children, type, className, style, htmlAttributes }, ref) => {\n  const classes = classNames('ndl-icon-indicator-wrapper', className);\n\n  return (\n    <div ref={ref} className={classes} style={style} {...htmlAttributes}>\n      {children}\n      <IconIndicator type={type} />\n    </div>\n  );\n});\n\ntype IconIndicatorProps = {\n  type?: IconIndicatorType;\n};\n\nconst IconIndicator = ({ type = 'info' }: IconIndicatorProps) => {\n  const classes = classNames('ndl-icon-indicator', {\n    'ndl-danger': type === 'danger',\n    'ndl-info': type === 'info',\n    'ndl-warning': type === 'warning',\n  });\n\n  return (\n    <svg\n      width=\"5\"\n      height=\"5\"\n      viewBox=\"0 0 5 5\"\n      fill=\"none\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      className={classes}\n    >\n      <circle cx=\"2.5\" cy=\"2.5\" r=\"2.5\" />\n    </svg>\n  );\n};\n\nIconIndicatorWrapper.displayName = 'IconIndicatorWrapper';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,uBAAuB,YAGjC,EAAE,UAAU,MAAM,WAAW,OAAO,kBAAkB,QAAQ;CAC/D,MAAM,UAAU,WAAW,8BAA8B,SAAS;CAElE,OACE,qBAAC,OAAA,eAAA,eAAA;EAAS;EAAK,WAAW;EAAgB;CAAW,GAAA,cAAA,GAAA,CAAA,GAAA,EAAA,UAArD,CACG,UACD,oBAAC,eAAD,EAAqB,KAAO,CAAA,CACzB,EAAA,CAAA,CAAA;AAET,CAAC;AAMD,MAAM,iBAAiB,EAAE,OAAO,aAAiC;CAC/D,MAAM,UAAU,WAAW,sBAAsB;EAC/C,cAAc,SAAS;EACvB,YAAY,SAAS;EACrB,eAAe,SAAS;CAC1B,CAAC;CAED,OACE,oBAAC,OAAD;EACE,OAAM;EACN,QAAO;EACP,SAAQ;EACR,MAAK;EACL,OAAM;EACN,WAAW;EAEX,UAAA,oBAAC,UAAD;GAAQ,IAAG;GAAM,IAAG;GAAM,GAAE;EAAO,CAAA;CAChC,CAAA;AAET;AAEA,qBAAqB,cAAc"}