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 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ActionButton} from '../button/ActionButton';\n\nimport {AriaLabelingProps, DOMProps, FocusableRef, StyleProps} from '@react-types/shared';\nimport {classNames} from '../utils/classNames';\nimport {ClearSlots, SlotProvider} from '../utils/Slots';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport HelpOutline from '@spectrum-icons/workflow/HelpOutline';\nimport helpStyles from '@adobe/spectrum-css-temp/components/contextualhelp/vars.css';\nimport InfoOutline from '@spectrum-icons/workflow/InfoOutline';\n// @ts-ignore\nimport intlMessages from '../../intl/contextualhelp/*.json';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {OverlayTriggerProps} from 'react-stately/useOverlayTriggerState';\nimport {Placement, PositionProps} from 'react-aria/useOverlayPosition';\nimport React, {ReactNode} from 'react';\nimport {useLabels} from 'react-aria/private/utils/useLabels';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\nexport interface SpectrumContextualHelpProps extends OverlayTriggerProps, PositionProps, StyleProps, DOMProps, AriaLabelingProps {\n  /** Contents of the Contextual Help popover. */\n  children: ReactNode,\n  /**\n   * Indicates whether contents are informative or provides helpful guidance.\n   * @default 'help'\n   */\n  variant?: 'help' | 'info',\n  /**\n   * The placement of the popover with respect to the action button.\n   * @default 'bottom start'\n   */\n  placement?: Placement\n}\n\n/**\n * Contextual help shows a user extra information about the state of an adjacent component, or a total view.\n */\nexport const ContextualHelp = React.forwardRef(function ContextualHelp(props: SpectrumContextualHelpProps, ref: FocusableRef<HTMLButtonElement>) {\n  let {\n    variant = 'help',\n    placement = 'bottom start',\n    children,\n    ...otherProps\n  } = props;\n\n  let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/contextualhelp');\n\n  let icon = variant === 'info' ? <InfoOutline /> : <HelpOutline />;\n\n  let slots = {\n    content: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-content']},\n    footer: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-footer']}\n  };\n\n  let labelProps = useLabels(otherProps, stringFormatter.format(variant));\n\n  return (\n    <DialogTrigger {...otherProps} type=\"popover\" placement={placement} hideArrow>\n      <ActionButton\n        {...mergeProps(otherProps, labelProps, {isDisabled: false})}\n        ref={ref}\n        UNSAFE_className={classNames(helpStyles, 'react-spectrum-ContextualHelp-button', otherProps.UNSAFE_className)}\n        isQuiet>\n        {icon}\n      </ActionButton>\n      <ClearSlots>\n        <SlotProvider slots={slots}>\n          <Dialog UNSAFE_className={classNames(helpStyles, 'react-spectrum-ContextualHelp-dialog')}>\n            {children}\n          </Dialog>\n        </SlotProvider>\n      </ClearSlots>\n    </DialogTrigger>\n  );\n});\n"],"names":[],"version":3,"file":"ContextualHelp.cjs.map"}