{"version":3,"file":"LoadingSpinner.mjs","names":[],"sources":["../../../src/loading-spinner/LoadingSpinner.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 PolymorphicCommonProps } from '../_common/types';\n\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype LoadingSpinnerProps = {\n  // TODO v6: Change default text to \"Loading\" and implement as a hidden text element instead of aria-label\n  /**\n   * The aria label for the loading spinner. If not provided, defaults to \"Loading content\".\n   */\n  loadingMessage?: string;\n  /**\n   * The size of the loading spinner.\n   */\n  size?: 'small' | 'medium' | 'large';\n};\n\n/**\n *\n *\n * LoadingSpinner Component\n *\n *\n */\n\nexport const LoadingSpinner = <T extends React.ElementType = 'div'>({\n  as,\n  loadingMessage = 'Loading content',\n  size = 'small',\n  className,\n  htmlAttributes,\n  ref,\n  ...restProps\n}: PolymorphicCommonProps<T, LoadingSpinnerProps>) => {\n  const Component: React.ElementType = as || 'div';\n  const classes = classNames('ndl-spin-wrapper', className, {\n    'ndl-large': size === 'large',\n    'ndl-medium': size === 'medium',\n    'ndl-small': size === 'small',\n  });\n\n  return (\n    <Component\n      className={classes}\n      role=\"status\"\n      aria-label={loadingMessage}\n      aria-live=\"polite\"\n      ref={ref}\n      {...restProps}\n      {...htmlAttributes}\n    >\n      <div className=\"ndl-spin\" />\n    </Component>\n  );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;CAsDE;CACA;CACA;CACA;CACA;CACA;;;;;;;;;AANF,MAAa,kBAAuD,SAQd;CARc,IAAA,EAClE,IACA,iBAAiB,mBACjB,OAAO,SACP,WACA,gBACA,QAAA,MACG,YAAA,yBAAA,MAAA,SAAA;CAEH,MAAM,YAA+B,MAAM;CAC3C,MAAM,UAAU,WAAW,oBAAoB,WAAW;EACxD,aAAa,SAAS;EACtB,cAAc,SAAS;EACvB,aAAa,SAAS;CACxB,CAAC;CAED,OACE,oBAAC,WAAA,eAAA,eAAA,eAAA;EACC,WAAW;EACX,MAAK;EACL,cAAY;EACZ,aAAU;EACL;CACD,GAAA,SAAA,GACA,cAAA,GAAA,CAAA,GAAA,EAAA,UAEJ,oBAAC,OAAD,EAAK,WAAU,WAAY,CAAA,EAAA,CAClB,CAAA;AAEf"}