{"version":3,"file":"Suggestion.mjs","names":[],"sources":["../../../../src/ai/suggestion/Suggestion.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';\n\nimport { type CommonProps } from '../../_common/types';\n\ntype SuggestionProps = {\n  /** The content of the suggestion */\n  children?: React.ReactNode;\n  /** The visual to display before the content. Should be an icon. */\n  leadingVisual?: React.ReactNode;\n  /** Whether the suggestion is primary. Renders an animated border. */\n  isPrimary?: boolean;\n  /** Callback function triggered when the suggestion is clicked */\n  onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n  /** The size of the suggestion */\n  size?: 'small' | 'large';\n};\n\n/**\n * The component is used to display a suggestion in a chat, or in a prompt.\n * It can be primary, which animates its border.\n *\n * @alpha - Changes to this component may be breaking.\n */\nconst Suggestion = ({\n  children,\n  leadingVisual,\n  isPrimary,\n  onClick,\n  size = 'small',\n  ref,\n  className,\n  style,\n  htmlAttributes,\n  ...restProps\n}: CommonProps<'button', SuggestionProps>) => {\n  const classes = classNames('ndl-ai-suggestion', className, {\n    'ndl-ai-suggestion-special': isPrimary,\n    'ndl-disabled': htmlAttributes?.disabled,\n    'ndl-large': size === 'large',\n    'ndl-small': size === 'small',\n  });\n\n  return (\n    <button\n      type=\"button\"\n      ref={ref}\n      className={classes}\n      style={style}\n      onClick={onClick}\n      {...restProps}\n      {...htmlAttributes}\n    >\n      <div className=\"ndl-ai-suggestion-inner\">\n        {Boolean(leadingVisual) && (\n          <div className=\"ndl-ai-suggestion-leading\">{leadingVisual}</div>\n        )}\n        {children}\n      </div>\n    </button>\n  );\n};\n\nexport { Suggestion };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;CA6CE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;;;;;AATF,MAAM,cAAc,SAW0B;CAX1B,IAAA,EAClB,UACA,eACA,WACA,SACA,OAAO,SACP,KACA,WACA,OACA,mBAAA,MACG,YAAA,yBAAA,MAAA,SAAA;CAEH,MAAM,UAAU,WAAW,qBAAqB,WAAW;EACzD,6BAA6B;EAC7B,gBAAA,mBAAA,QAAA,mBAAA,KAAA,IAAA,KAAA,IAAgB,eAAgB;EAChC,aAAa,SAAS;EACtB,aAAa,SAAS;CACxB,CAAC;CAED,OACE,oBAAC,UAAA,eAAA,eAAA,eAAA;EACC,MAAK;EACA;EACL,WAAW;EACJ;EACE;CACL,GAAA,SAAA,GACA,cAAA,GAAA,CAAA,GAAA,EAAA,UAEJ,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACG,QAAQ,aAAa,KACpB,oBAAC,OAAD;GAAK,WAAU;GAA6B,UAAA;EAAmB,CAAA,GAEhE,QACE;CACC,CAAA,EAAA,CAAA,CAAA;AAEZ"}