UNPKG

@atlaskit/navigation-system

Version:

The latest navigation system for Atlassian apps.

19 lines (18 loc) • 692 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPanelGrowthSide = getPanelGrowthSide; /** * Returns the physical side the panel grows towards when the splitter is dragged away from it. * * `position: 'end'` grows towards the inline-end, which is the right in left-to-right languages, and * `position: 'start'` grows towards the inline-start. */ function getPanelGrowthSide(_ref) { var position = _ref.position, textDirection = _ref.textDirection; var isGrowingTowardsInlineEnd = position === 'end'; var isInlineEndOnTheRight = textDirection === 'ltr'; return isGrowingTowardsInlineEnd === isInlineEndOnTheRight ? 'right' : 'left'; }