{
  "version": 3,
  "sources": ["../../../../src/core/content/LmAlert.tsx"],
  "sourcesContent": ["import { Card, CardProps, ColorProp, ColorTokens, Paragraph, useThemeName, XStack } from 'tamagui'\nimport { CheckCircle, Info, Warning, WarningCircle } from 'tamagui-phosphor-icons'\n\ntype Severity = 'default' | 'error' | 'info' | 'warning' | 'success'\nexport type LmAlertProps = CardProps & {\n  severity?: Severity\n  text?: string\n  outlined?: boolean\n  hideIcon?: boolean\n}\n\nconst severityColor: { [k in Severity]: ColorProp } = {\n  default: '$gray3',\n  error: '$red10',\n  info: '$blue10',\n  warning: '$orange10',\n  success: '$green10',\n}\n\ntype AlertIconProps = {\n  severity?: Severity\n  outlined?: boolean\n  shouldInvert?: boolean\n}\n\nfunction AlertIcon({ severity = 'default', outlined, shouldInvert }: AlertIconProps) {\n  const props: { color?: ColorTokens } = {}\n  if (outlined) {\n    props.color = severityColor[severity] as ColorTokens\n  } else if (shouldInvert) {\n    props.color = 'white'\n  }\n  return {\n    default: <Info {...props} />,\n    error: <WarningCircle {...props} />,\n    info: <Info {...props} />,\n    warning: <Warning {...props} />,\n    success: <CheckCircle {...props} />,\n  }[severity]\n}\n\nexport function LmAlert({\n  severity = 'default',\n  text,\n  hideIcon,\n  outlined,\n  children,\n  ...rest\n}: LmAlertProps) {\n  const theme = useThemeName()\n  let shouldInverse = theme === 'light' && severity !== 'default' && !outlined\n  return (\n    <Card\n      // themeInverse={shouldInverse}\n      bordered={outlined}\n      {...(outlined\n        ? {\n            // border: `1px solid ${severityColor[severity]}`,\n            borderColor: severityColor[severity],\n            color: severityColor[severity],\n          }\n        : {\n            backgroundColor: severityColor[severity],\n          })}\n      padding={rest.padding || '$4'}\n    >\n      <XStack space alignItems={'center'}>\n        <AlertIcon shouldInvert={shouldInverse} severity={severity} outlined={outlined} />\n        {text && (\n          <Paragraph\n            fontWeight={outlined ? 'bold' : undefined}\n            color={outlined ? severityColor[severity] : shouldInverse ? 'white' : undefined}\n          >\n            {text}\n          </Paragraph>\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