All files / atom/tooltip/src config.js

100% Statements 11/11
50% Branches 1/2
100% Functions 1/1
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77          1x         1x         1x         1x         1x         1x                         1x                     1x                                   1x   1x 1x  
import {Children} from 'react'
 
/**
 * Base class for the component
 */
export const BASE_CLASS = 'sui-AtomTooltip'
 
/**
 * Class for the inner element
 */
export const CLASS_INNER = `${BASE_CLASS}-inner`
 
/**
 * Class for the arrow element
 */
export const CLASS_ARROW = `${BASE_CLASS}-arrow`
 
/**
 * Class for the preffix placement
 */
export const PREFIX_PLACEMENT = `${BASE_CLASS}-`
 
/**
 * Class for the target element
 */
export const CLASS_TARGET = `${BASE_CLASS}-target`
 
/**
 * Available colors for the tooltip
 */
export const COLORS = {
  PRIMARY: 'primary',
  SECONDARY: 'secondary',
  ACCENT: 'accent',
  NEUTRAL: 'neutral',
  SUCCESS: 'success',
  ALERT: 'alert',
  ERROR: 'error'
}
 
/**
 * Available trigger behaviors for tooltip
 */
export const TRIGGERS = {
  CLICK: 'click',
  FOCUS: 'focus',
  HOVER: 'hover',
  LEGACY: 'legacy',
  MANUAL: 'manual'
}
 
/**
 * Available placements for the tooltip
 */
export const PLACEMENTS = {
  AUTO: 'auto',
  AUTO_START: 'auto-start',
  AUTO_END: 'auto-end',
  TOP: 'top',
  TOP_START: 'top-start',
  TOP_END: 'top-end',
  RIGHT: 'right',
  RIGHT_START: 'right-start',
  RIGHT_END: 'right-end',
  BOTTOM: 'bottom',
  BOTTOM_START: 'bottom-start',
  BOTTOM_END: 'bottom-end',
  LEFT: 'left',
  LEFT_START: 'left-start',
  LEFT_END: 'left-end'
}
 
export const DEFAULT_OFFSET = 'auto,4px'
 
export const getChildrenAsReactNode = element =>
  typeof element === 'string' ? <span key={1}>{element}</span> : Children.only(element)