{"version":3,"file":"StatusIndicator.mjs","names":[],"sources":["../../../src/status-indicator/StatusIndicator.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 */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type CommonProps } from '../_common/types';\n\ntype StatusIndicatorProps = {\n  /** Type of the status indicator. */\n  variant?: 'unknown' | 'success' | 'info' | 'warning' | 'danger';\n};\n\nconst statusConfig = {\n  danger: {\n    element: 'path',\n    props: {\n      // oxlint-disable-next-line id-length\n      d: 'M0.188426 4.45553C0.067771 4.33472 0 4.17097 0 4.00024C0 3.8295 0.067771 3.66575 0.188426 3.54494L3.54489 0.188838C3.6046 0.128979 3.67554 0.0814871 3.75363 0.0490833C3.83173 0.0166795 3.91545 0 4 0C4.08455 0 4.16827 0.0166795 4.24637 0.0490833C4.32446 0.0814871 4.3954 0.128979 4.45511 0.188838L7.81157 3.54494C7.93223 3.66575 8 3.8295 8 4.00024C8 4.17097 7.93223 4.33472 7.81157 4.45553L4.45511 7.81163C4.33437 7.93226 4.17068 8.00003 4 8.00003C3.82932 8.00003 3.66563 7.93226 3.54489 7.81163L0.188426 4.45553Z',\n      fill: 'var(--theme-color-danger-bg-status)',\n    },\n  },\n  info: {\n    element: 'circle',\n    props: {\n      cx: '4',\n      cy: '4',\n      fill: 'var(--theme-color-primary-bg-status)',\n      r: '4', // oxlint-disable-line id-length\n    },\n  },\n  success: {\n    element: 'circle',\n    props: {\n      cx: '4',\n      cy: '4',\n      fill: 'var(--theme-color-success-bg-status)',\n      r: '4', // oxlint-disable-line id-length\n    },\n  },\n  unknown: {\n    element: 'rect',\n    props: {\n      fill: 'var(--theme-color-neutral-bg-status)',\n      height: '8',\n      rx: '1',\n      width: '8',\n    },\n  },\n  warning: {\n    element: 'path',\n    props: {\n      // oxlint-disable-next-line id-length\n      d: 'M4.57641 0.35903C4.52349 0.251301 4.44144 0.160559 4.33957 0.0970988C4.23769 0.0336384 4.12007 0 4.00005 0C3.88002 0 3.7624 0.0336384 3.66053 0.0970988C3.55865 0.160559 3.4766 0.251301 3.42368 0.35903L0.0554707 7.22061C0.0149262 7.30309 -0.00393024 7.39454 0.000681349 7.48633C0.00529294 7.57812 0.0332205 7.66722 0.0818275 7.74522C0.130434 7.82322 0.198117 7.88754 0.278487 7.93212C0.358856 7.9767 0.44926 8.00006 0.541165 8H7.45893C7.55083 8.00006 7.64124 7.9767 7.7216 7.93212C7.80197 7.88754 7.86966 7.82322 7.91826 7.74522C7.96687 7.66722 7.9948 7.57812 7.99941 7.48633C8.00402 7.39454 7.98517 7.30309 7.94462 7.22061L4.57641 0.35903Z',\n      fill: 'var(--theme-color-warning-bg-status)',\n    },\n  },\n} as const;\n\nexport const StatusIndicator = ({\n  className,\n  style,\n  variant = 'unknown',\n  htmlAttributes,\n  ref,\n  ...restProps\n}: CommonProps<'svg', StatusIndicatorProps>) => {\n  const classes = classNames('ndl-status-indicator', className);\n  const config = statusConfig[variant];\n  const Element = config.element as keyof React.JSX.IntrinsicElements;\n\n  return (\n    <svg\n      ref={ref}\n      width=\"8\"\n      height=\"8\"\n      viewBox=\"0 0 8 8\"\n      fill=\"none\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      aria-hidden=\"true\"\n      className={classes}\n      style={style}\n      {...restProps}\n      {...htmlAttributes}\n    >\n      <Element {...config.props} />\n    </svg>\n  );\n};\n\nStatusIndicator.displayName = 'StatusIndicator';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;CA6EE;CACA;CACA;CACA;CACA;;AAnDF,MAAM,eAAe;CACnB,QAAQ;EACN,SAAS;EACT,OAAO;GAEL,GAAG;GACH,MAAM;EACR;CACF;CACA,MAAM;EACJ,SAAS;EACT,OAAO;GACL,IAAI;GACJ,IAAI;GACJ,MAAM;GACN,GAAG;EACL;CACF;CACA,SAAS;EACP,SAAS;EACT,OAAO;GACL,IAAI;GACJ,IAAI;GACJ,MAAM;GACN,GAAG;EACL;CACF;CACA,SAAS;EACP,SAAS;EACT,OAAO;GACL,MAAM;GACN,QAAQ;GACR,IAAI;GACJ,OAAO;EACT;CACF;CACA,SAAS;EACP,SAAS;EACT,OAAO;GAEL,GAAG;GACH,MAAM;EACR;CACF;AACF;AAEA,MAAa,mBAAmB,SAOgB;CAPhB,IAAA,EAC9B,WACA,OACA,UAAU,WACV,gBACA,QAAA,MACG,YAAA,yBAAA,MAAA,SAAA;CAEH,MAAM,UAAU,WAAW,wBAAwB,SAAS;CAC5D,MAAM,SAAS,aAAa;CAC5B,MAAM,UAAU,OAAO;CAEvB,OACE,oBAAC,OAAA,eAAA,eAAA,eAAA;EACM;EACL,OAAM;EACN,QAAO;EACP,SAAQ;EACR,MAAK;EACL,OAAM;EACN,eAAY;EACZ,WAAW;EACJ;CACH,GAAA,SAAA,GACA,cAAA,GAAA,CAAA,GAAA,EAAA,UAEJ,oBAAC,SAAA,eAAA,CAAA,GAAY,OAAO,KAAQ,CAAA,EAAA,CACzB,CAAA;AAET;AAEA,gBAAgB,cAAc"}