<commit_before>import * as React from 'react'
import * as ReactDOM from 'react-dom'
import { ObservableRef } from './observable-ref'
import { createUniqueId, releaseUniqueId } from './id-pool'
import classNames from 'classnames'
import { assertNever } from '../../lib/fatal-error'
import { rectEquals, rectContains } from './rect'

export type TooltipDirection = 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw'
const DefaultTooltipDelay = 400
const InteractiveTooltipHideDelay = 300

interface ITooltipProps<T> {
  /**
   * The target element for which to display a tooltip. Use
   * `createObservableRef` to create an `ObservableRef`. Note that
   * `ObservablRef` is compatible with `React.Ref`
   */
  readonly target: ObservableRef<T>

  /**
   * Whether or not to modify the target element when the tooltip is showing to
   * add the necessary `aria-` attributes for accessibility. It's not
   * recommended to disable this unless the target element is already adequately
   * described by `aria-label`.
   *
   * Defaults to true
   */
  readonly accessible?: boolean

  /**
   * Whether or not the tooltip should remain open when the user moves their
   * pointer device from the target onto the tooltip itself. Non interactive
   * tooltips are not pointer event targets.
   */
  readonly interactive?: boolean

  /**
   * The amount of time to wait (in milliseconds) while a user hovers over the
   * target before displaying the tooltip. There's typically no reason to
   * increase this but it may be used to show the tooltip without any delay (by
   * setting it to zero)
   *<commit_msg>Let TooltippedContent use the tooltip props<commit_after>import * as React from 'react'
import * as ReactDOM from 'react-dom'
import { ObservableRef } from './observable-ref'
import { createUniqueId, releaseUniqueId } from './id-pool'
import classNames from 'classnames'
import { assertNever } from '../../lib/fatal-error'
import { rectEquals, rectContains } from './rect'

export type TooltipDirection = 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw'
const DefaultTooltipDelay = 400
const InteractiveTooltipHideDelay = 300

export interface ITooltipProps<T> {
  /**
   * The target element for which to display a tooltip. Use
   * `createObservableRef` to create an `ObservableRef`. Note that
   * `ObservablRef` is compatible with `React.Ref`
   */
  readonly target: ObservableRef<T>

  /**
   * Whether or not to modify the target element when the tooltip is showing to
   * add the necessary `aria-` attributes for accessibility. It's not
   * recommended to disable this unless the target element is already adequately
   * described by `aria-label`.
   *
   * Defaults to true
   */
  readonly accessible?: boolean

  /**
   * Whether or not the tooltip should remain open when the user moves their
   * pointer device from the target onto the tooltip itself. Non interactive
   * tooltips are not pointer event targets.
   */
  readonly interactive?: boolean

  /**
   * The amount of time to wait (in milliseconds) while a user hovers over the
   * target before displaying the tooltip. There's typically no reason to
   * increase this but it may be used to show the tooltip without any delay (by
   * setting it to zero)
   *
{'fraction_non_alphanumeric': 0.08947855600123418, 'fraction_numerical': 0.0037025609379821045, 'mean_word_length': 3.559774964838256, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7557643', 'n_tokens_mistral': 913, 'n_tokens_neox': 884, 'n_words': 396}