{"version":3,"sources":["../src/SubSectionHeading/SubSectionHeading.tsx"],"sourcesContent":["import * as React from 'react';\nimport { clsx } from 'clsx';\n\nexport interface SubSectionHeadingProps {\n  /**\n   * The heading text (required)\n   */\n  title: string;\n  /**\n   * Show an info icon next to the heading text\n   * @default false\n   */\n  icon?: boolean;\n  /**\n   * Button variant to display on the right\n   * - 'primary': Green button with white text\n   * - 'tertiary': Gray button with dark text\n   * - undefined: No button\n   */\n  button?: 'primary' | 'tertiary';\n  /**\n   * Text to display in the button (required if button is specified)\n   */\n  buttonText?: string;\n  /**\n   * Icon to display in the button (renders before button text)\n   */\n  buttonIcon?: React.ReactNode;\n  /**\n   * Click handler for the button\n   */\n  onButtonClick?: () => void;\n  /**\n   * Additional CSS class name\n   */\n  className?: string;\n  /**\n   * Additional inline styles\n   */\n  style?: React.CSSProperties;\n}\n\n// Info icon (circle with i)\nconst InfoIcon = () => (\n  <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n    <circle cx=\"8\" cy=\"8\" r=\"6.5\" stroke=\"#2f2f2f\" strokeWidth=\"1.2\" />\n    <path\n      d=\"M8 7V11\"\n      stroke=\"#2f2f2f\"\n      strokeWidth=\"1.2\"\n      strokeLinecap=\"round\"\n    />\n    <circle cx=\"8\" cy=\"5\" r=\"0.75\" fill=\"#2f2f2f\" />\n  </svg>\n);\n\n// Default plus icon for buttons\nconst PlusIcon = ({ color = '#2f2f2f' }: { color?: string }) => (\n  <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path\n      d=\"M8 3V13M3 8H13\"\n      stroke={color}\n      strokeWidth=\"1.2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    />\n  </svg>\n);\n\n// Arbor Design System sub-section heading styles\nconst subSectionHeadingStyles = {\n  container: {\n    display: 'flex',\n    alignItems: 'center',\n    width: '100%',\n    borderBottom: '1px solid #efefef',\n    fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n    boxSizing: 'border-box' as const,\n  },\n  containerNoButton: {\n    padding: '12px 8px',\n    gap: '0px',\n  },\n  containerWithButton: {\n    padding: '8px',\n    gap: '12px',\n    justifyContent: 'space-between',\n  },\n  textContainer: {\n    display: 'flex',\n    alignItems: 'center',\n    gap: '8px',\n    flex: 1,\n    minHeight: '16px',\n  },\n  title: {\n    fontSize: '18px',\n    fontWeight: '600',\n    color: '#2f2f2f',\n    lineHeight: '1.25',\n    margin: 0,\n    whiteSpace: 'nowrap' as const,\n  },\n  iconWrapper: {\n    display: 'flex',\n    alignItems: 'center',\n    justifyContent: 'center',\n    width: '16px',\n    height: '16px',\n    flexShrink: 0,\n  },\n  buttonBase: {\n    display: 'flex',\n    alignItems: 'center',\n    justifyContent: 'center',\n    gap: '8px',\n    height: '32px',\n    minHeight: '32px',\n    padding: '0 16px',\n    borderRadius: '99px',\n    border: 'none',\n    cursor: 'pointer',\n    fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n    fontSize: '13px',\n    fontWeight: '600',\n    lineHeight: '1.5',\n    whiteSpace: 'nowrap' as const,\n    flexShrink: 0,\n    transition: 'background-color 0.15s ease-in-out, opacity 0.15s ease-in-out',\n  },\n  buttonPrimary: {\n    backgroundColor: '#0e8a0e',\n    color: '#ffffff',\n  },\n  buttonPrimaryHover: {\n    backgroundColor: '#0a6b0a',\n  },\n  buttonTertiary: {\n    backgroundColor: '#efefef',\n    color: '#2f2f2f',\n  },\n  buttonTertiaryHover: {\n    backgroundColor: '#e5e5e5',\n  },\n  buttonIconWrapper: {\n    display: 'flex',\n    alignItems: 'center',\n    justifyContent: 'center',\n    width: '16px',\n    height: '16px',\n    flexShrink: 0,\n  },\n};\n\n/**\n * SubSectionHeading component - Arbor Design System\n *\n * A sub-section heading component for dividing content within sections.\n * Supports optional icon next to text and optional button on the right.\n *\n * @example\n * ```tsx\n * // Basic sub-section heading\n * <SubSectionHeading title=\"Details\" />\n *\n * // With info icon\n * <SubSectionHeading title=\"Details\" icon />\n *\n * // With primary button\n * <SubSectionHeading\n *   title=\"Items\"\n *   button=\"primary\"\n *   buttonText=\"Add Item\"\n *   onButtonClick={() => handleAdd()}\n * />\n *\n * // With tertiary button and icon\n * <SubSectionHeading\n *   title=\"Settings\"\n *   icon\n *   button=\"tertiary\"\n *   buttonText=\"Configure\"\n *   onButtonClick={() => handleConfigure()}\n * />\n * ```\n */\nexport const SubSectionHeading = React.forwardRef<HTMLDivElement, SubSectionHeadingProps>(\n  (\n    {\n      title,\n      icon = false,\n      button,\n      buttonText = 'Button Text',\n      buttonIcon,\n      onButtonClick,\n      className,\n      style,\n      ...props\n    },\n    ref\n  ) => {\n    const [isButtonHovered, setIsButtonHovered] = React.useState(false);\n\n    const containerStyle: React.CSSProperties = {\n      ...subSectionHeadingStyles.container,\n      ...(button\n        ? subSectionHeadingStyles.containerWithButton\n        : subSectionHeadingStyles.containerNoButton),\n      ...style,\n    };\n\n    const getButtonStyle = (): React.CSSProperties => {\n      const baseStyle = { ...subSectionHeadingStyles.buttonBase };\n\n      if (button === 'primary') {\n        return {\n          ...baseStyle,\n          ...subSectionHeadingStyles.buttonPrimary,\n          ...(isButtonHovered && subSectionHeadingStyles.buttonPrimaryHover),\n        };\n      }\n\n      if (button === 'tertiary') {\n        return {\n          ...baseStyle,\n          ...subSectionHeadingStyles.buttonTertiary,\n          ...(isButtonHovered && subSectionHeadingStyles.buttonTertiaryHover),\n        };\n      }\n\n      return baseStyle;\n    };\n\n    const renderButtonIcon = () => {\n      if (buttonIcon) {\n        return (\n          <span style={subSectionHeadingStyles.buttonIconWrapper}>{buttonIcon}</span>\n        );\n      }\n      // Default icon based on button type\n      return (\n        <span style={subSectionHeadingStyles.buttonIconWrapper}>\n          <PlusIcon color={button === 'primary' ? '#ffffff' : '#2f2f2f'} />\n        </span>\n      );\n    };\n\n    return (\n      <div\n        ref={ref}\n        className={clsx('arbor-sub-section-heading', className)}\n        style={containerStyle}\n        {...props}\n      >\n        <div style={subSectionHeadingStyles.textContainer}>\n          <h3 style={subSectionHeadingStyles.title}>{title}</h3>\n          {icon && (\n            <span style={subSectionHeadingStyles.iconWrapper}>\n              <InfoIcon />\n            </span>\n          )}\n        </div>\n        {button && (\n          <button\n            type=\"button\"\n            style={getButtonStyle()}\n            onClick={onButtonClick}\n            onMouseEnter={() => setIsButtonHovered(true)}\n            onMouseLeave={() => setIsButtonHovered(false)}\n          >\n            {renderButtonIcon()}\n            <span>{buttonText}</span>\n          </button>\n        )}\n      </div>\n    );\n  }\n);\n\nSubSectionHeading.displayName = 'SubSectionHeading';\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AA2CnB,SACE,KADF;AADF,IAAM,WAAW,MACf,qBAAC,SAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAChE;AAAA,sBAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,OAAM,QAAO,WAAU,aAAY,OAAM;AAAA,EACjE;AAAA,IAAC;AAAA;AAAA,MACC,GAAE;AAAA,MACF,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA;AAAA,EAChB;AAAA,EACA,oBAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,QAAO,MAAK,WAAU;AAAA,GAChD;AAIF,IAAM,WAAW,CAAC,EAAE,QAAQ,UAAU,MACpC,oBAAC,SAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAChE;AAAA,EAAC;AAAA;AAAA,IACC,GAAE;AAAA,IACF,QAAQ;AAAA,IACR,aAAY;AAAA,IACZ,eAAc;AAAA,IACd,gBAAe;AAAA;AACjB,GACF;AAIF,IAAM,0BAA0B;AAAA,EAC9B,WAAW;AAAA,IACT,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,OAAO;AAAA,IACP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