{"version":3,"sources":["../src/Banner/Banner.tsx"],"sourcesContent":["import * as React from 'react';\nimport { clsx } from 'clsx';\nimport { AlertCircle, AlertTriangle, Info, X } from 'lucide-react';\n\nexport type BannerVariant = 'warning' | 'destructive' | 'information' | 'neutral';\n\nexport interface BannerProps {\n  /**\n   * Banner variant - determines color scheme\n   */\n  variant?: BannerVariant;\n  /**\n   * Optional title text\n   */\n  title?: string;\n  /**\n   * Main message/description text\n   */\n  message: string;\n  /**\n   * Optional icon (pass false to hide default icon, or pass custom ReactNode)\n   */\n  icon?: React.ReactNode | boolean;\n  /**\n   * Optional action button label\n   */\n  actionLabel?: string;\n  /**\n   * Action button click handler\n   */\n  onAction?: () => void;\n  /**\n   * Optional close button\n   */\n  onClose?: () => void;\n  /**\n   * Custom className\n   */\n  className?: string;\n  /**\n   * Custom style\n   */\n  style?: React.CSSProperties;\n  /**\n   * Test ID for testing\n   */\n  'data-testid'?: string;\n}\n\nconst containerStyles: React.CSSProperties = {\n  display: 'flex',\n  alignItems: 'flex-start',\n  padding: '16px',\n  borderRadius: '8px',\n  border: '1px solid',\n  width: '100%',\n  fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n};\n\nconst iconContainerStyles: React.CSSProperties = {\n  flexShrink: 0,\n  width: '24px',\n  height: '24px',\n  display: 'flex',\n  alignItems: 'center',\n  justifyContent: 'center',\n};\n\nconst contentContainerStyles: React.CSSProperties = {\n  flex: 1,\n  display: 'flex',\n  flexDirection: 'column',\n  minWidth: 0,\n};\n\nconst titleStyles: React.CSSProperties = {\n  fontSize: '18px',\n  fontWeight: 600,\n  lineHeight: '1.25',\n  marginBottom: '8px',\n};\n\nconst messageStyles: React.CSSProperties = {\n  fontSize: '13px',\n  fontWeight: 400,\n  lineHeight: '1.5',\n  margin: 0,\n};\n\nconst actionContainerStyles: React.CSSProperties = {\n  display: 'flex',\n  flexDirection: 'column',\n  justifyContent: 'flex-end',\n  alignItems: 'flex-end',\n  alignSelf: 'stretch',\n  flexShrink: 0,\n};\n\nconst actionButtonStyles: React.CSSProperties = {\n  background: 'none',\n  border: 'none',\n  padding: 0,\n  fontSize: '13px',\n  fontWeight: 600,\n  lineHeight: '1.5',\n  textDecoration: 'underline',\n  textUnderlinePosition: 'from-font',\n  cursor: 'pointer',\n  fontFamily: 'inherit',\n};\n\nconst closeButtonStyles: React.CSSProperties = {\n  background: 'none',\n  border: 'none',\n  padding: '4px',\n  cursor: 'pointer',\n  display: 'flex',\n  alignItems: 'center',\n  justifyContent: 'center',\n  flexShrink: 0,\n  marginLeft: '8px',\n};\n\nconst variantConfig = {\n  warning: {\n    backgroundColor: '#fffaf5',\n    borderColor: '#e4720d',\n    textColor: '#611f00',\n    actionColor: '#a74102',\n    icon: AlertTriangle,\n  },\n  destructive: {\n    backgroundColor: '#fff5f5',\n    borderColor: '#c93232',\n    textColor: '#610202',\n    actionColor: '#920a0a',\n    icon: AlertCircle,\n  },\n  information: {\n    backgroundColor: '#f5fbff',\n    borderColor: '#2c8bca',\n    textColor: '#053a61',\n    actionColor: '#024f83',\n    icon: Info,\n  },\n  neutral: {\n    backgroundColor: 'transparent',\n    borderColor: '#b3b3b3',\n    textColor: '#2f2f2f',\n    actionColor: '#2f2f2f',\n    icon: Info,\n  },\n};\n\n/**\n * Banner component - Arbor Design System\n *\n * Informational banners with 4 variants (warning, destructive, information, neutral)\n * and optional title, icon, and action button.\n *\n * IMPORTANT: Banners are always displayed inline with page content (not overlays).\n * They flow with the document layout and push other content down.\n *\n * For overlay notifications in the top-right corner, use the Toast component instead.\n */\nexport const Banner = React.forwardRef<HTMLDivElement, BannerProps>(\n  (\n    {\n      variant = 'information',\n      title,\n      message,\n      icon = true,\n      actionLabel,\n      onAction,\n      onClose,\n      className,\n      style,\n      'data-testid': dataTestId,\n    },\n    ref\n  ) => {\n    const config = variantConfig[variant];\n    const DefaultIcon = config.icon;\n\n    // Determine what icon to show\n    const showIcon = icon !== false;\n    const iconElement =\n      icon === true || icon === undefined ? (\n        <DefaultIcon size={20} strokeWidth={2} />\n      ) : (\n        icon\n      );\n\n    const containerStylesCombined: React.CSSProperties = {\n      ...containerStyles,\n      backgroundColor: config.backgroundColor,\n      borderColor: config.borderColor,\n      color: config.textColor,\n      gap: showIcon ? '16px' : '0px',\n      ...style,\n    };\n\n    const titleStylesCombined: React.CSSProperties = {\n      ...titleStyles,\n      color: config.textColor,\n    };\n\n    const messageStylesCombined: React.CSSProperties = {\n      ...messageStyles,\n      color: config.textColor,\n    };\n\n    const actionButtonStylesCombined: React.CSSProperties = {\n      ...actionButtonStyles,\n      color: config.actionColor,\n    };\n\n    const closeButtonStylesCombined: React.CSSProperties = {\n      ...closeButtonStyles,\n      color: config.textColor,\n    };\n\n    return (\n      <div\n        ref={ref}\n        className={clsx('arbor-banner', `arbor-banner--${variant}`, className)}\n        style={containerStylesCombined}\n        data-testid={dataTestId}\n        role=\"alert\"\n      >\n        {showIcon && (\n          <div style={{ ...iconContainerStyles, color: config.textColor }}>\n            {iconElement}\n          </div>\n        )}\n\n        <div style={contentContainerStyles}>\n          {title && <div style={titleStylesCombined}>{title}</div>}\n          <p style={messageStylesCombined}>{message}</p>\n        </div>\n\n        {actionLabel && onAction && (\n          <div style={actionContainerStyles}>\n            <button\n              type=\"button\"\n              onClick={onAction}\n              style={actionButtonStylesCombined}\n            >\n              {actionLabel}\n            </button>\n          </div>\n        )}\n\n        {onClose && (\n          <button\n            type=\"button\"\n            onClick={onClose}\n            style={closeButtonStylesCombined}\n            aria-label=\"Close banner\"\n          >\n            <X size={20} />\n          </button>\n        )}\n      </div>\n    );\n  }\n);\n\nBanner.displayName = 'Banner';\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,aAAa,eAAe,MAAM,SAAS;AA0L5C,cAgDA,YAhDA;AA3IR,IAAM,kBAAuC;AAAA,EAC3C,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,cAAc;AAAA,EACd,QAAQ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