{"version":3,"file":"IndicatorIcon.cjs","names":[],"sources":["../../../../src/components/Icon/IndicatorIcon/IndicatorIcon.tsx"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { type PropsWithChildren, forwardRef } from \"react\";\nimport classnames from \"classnames\";\n\nimport styles from \"./IndicatorIcon.module.css\";\n\ntype IconButtonProps = {\n  /**\n   * The CSS class name.\n   */\n  className?: string;\n  /**\n   * The icon size in CSS units, e.g. `\"24px\"`.\n   * @default 100%\n   */\n  size?: CSSStyleDeclaration[\"height\"];\n  /**\n   * The icon colour.\n   */\n  colour?: string;\n  /**\n   * The indicator dot displayed on the top right\n   * Names based on the colours used for the dot, or undefined for no dot.\n   */\n  indicator?: \"default\" | \"success\" | \"critical\";\n};\n\nexport const IndicatorIcon = forwardRef<\n  HTMLDivElement,\n  PropsWithChildren<IconButtonProps>\n>(function IconButton(\n  { children, className, size = \"100%\", colour, indicator },\n  ref,\n) {\n  const classes = classnames(styles[\"indicator-icon\"], className);\n  return (\n    <div\n      ref={ref}\n      className={classes}\n      data-indicator={indicator}\n      style={\n        {\n          \"--cpd-icon-button-size\": size,\n          \"--cpd-color-icon-tertiary\": colour,\n        } as React.CSSProperties\n      }\n    >\n      {React.Children.only(children)}\n    </div>\n  );\n});\n"],"mappings":";;;;;;;;AAiCA,IAAa,iBAAA,GAAA,MAAA,YAGX,SAAS,WACT,EAAE,UAAU,WAAW,OAAO,QAAQ,QAAQ,aAC9C,KACA;AAEA,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACO;EACL,YAAA,GAAA,WAAA,SAJuB,6BAAA,QAAO,mBAAmB,UAAU;EAK3D,kBAAgB;EAChB,OACE;GACE,0BAA0B;GAC1B,6BAA6B;GAC9B;YAGF,MAAA,QAAM,SAAS,KAAK,SAAS;EAC1B,CAAA;EAER"}