<commit_before>import { useTransition } from '@react-spring/core'
import { animated } from '@react-spring/web'
import React, { useCallback, useRef } from 'react'
import { UseTransitionProps } from 'react-spring'
import styled from 'styled-components'
import { assertUnreachable } from '../../common/assert-unreachable'
import { useElementRect, useObservedDimensions } from '../dom/dimension-hooks'
import KeyListener from '../keyboard/key-listener'
import { usePreviousDefined } from '../state-hooks'
import { CardLayer } from '../styles/colors'
import { Portal } from './portal'
import { shadow10dp } from './shadows'
import { defaultSpring } from './springs'
import { zIndexMenu } from './zindex'

const ESCAPE = 'Escape'

const PositioningArea = styled.div`
  // TODO(tec27): Allow safe zone to be customized
  --sb-popover-safe-top: calc(var(--sb-system-bar-height, 0) + 8px);
  --sb-popover-safe-right: 8px;
  --sb-popover-safe-bottom: 8px;
  --sb-popover-safe-left: 8px;

  top: var(--sb-popover-safe-top);
  right: var(--sb-popover-safe-right);
  bottom: var(--sb-popover-safe-bottom);
  left: var(--sb-popover-safe-left);
  position: fixed;

  contain: layout;
  pointer-events: none;
  z-index: ${zIndexMenu};
`

const Container = styled(animated.div)`
  position: absolute;
  top: var(--sb-popover-top, unset);
  right: var(--sb-popover-right, unset);
  bottom: var(--sb-popover-bottom, unset);
  left: var(--sb-popover-left, unset);

  display: inline-block;
  max-width: var(--sb-popover-max-width, none);
  max-height: var(--sb-popover-max-height, none);

  border-radius: 2px;
  contain: layout;
  pointer-events: auto;
  transform-origin: var(--sb-transform-origin);
`

const Card = styled(CardLayer)`
  ${shadow10dp};
  contain: content;
`

/** An origin point on the X axis. */
export type OriginX = 'left' | 'center' | 'right'
/** An origin point on the Y axis. */<commit_msg>Give popovers a default border-radius, which they should have had before, whoops.<commit_after>import { useTransition } from '@react-spring/core'
import { animated } from '@react-spring/web'
import React, { useCallback, useRef } from 'react'
import { UseTransitionProps } from 'react-spring'
import styled from 'styled-components'
import { assertUnreachable } from '../../common/assert-unreachable'
import { useElementRect, useObservedDimensions } from '../dom/dimension-hooks'
import KeyListener from '../keyboard/key-listener'
import { usePreviousDefined } from '../state-hooks'
import { CardLayer } from '../styles/colors'
import { Portal } from './portal'
import { shadow10dp } from './shadows'
import { defaultSpring } from './springs'
import { zIndexMenu } from './zindex'

const ESCAPE = 'Escape'

const PositioningArea = styled.div`
  // TODO(tec27): Allow safe zone to be customized
  --sb-popover-safe-top: calc(var(--sb-system-bar-height, 0) + 8px);
  --sb-popover-safe-right: 8px;
  --sb-popover-safe-bottom: 8px;
  --sb-popover-safe-left: 8px;

  top: var(--sb-popover-safe-top);
  right: var(--sb-popover-safe-right);
  bottom: var(--sb-popover-safe-bottom);
  left: var(--sb-popover-safe-left);
  position: fixed;

  contain: layout;
  pointer-events: none;
  z-index: ${zIndexMenu};
`

const Container = styled(animated.div)`
  position: absolute;
  top: var(--sb-popover-top, unset);
  right: var(--sb-popover-right, unset);
  bottom: var(--sb-popover-bottom, unset);
  left: var(--sb-popover-left, unset);

  display: inline-block;
  max-width: var(--sb-popover-max-width, none);
  max-height: var(--sb-popover-max-height, none);

  border-radius: 2px;
  contain: layout;
  pointer-events: auto;
  transform-origin: var(--sb-transform-origin);
`

const Card = styled(CardLayer)`
  ${shadow10dp};
  border-radius: 2px;
  contain: content;
`

/** An origin point on the X axis. */
export type OriginX = 'left' | 'center' | 'right'
/** An origin point on the Y axis. */
{'fraction_non_alphanumeric': 0.16580711707065499, 'fraction_numerical': 0.006446621970087674, 'mean_word_length': 3.8306351183063514, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3279287', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1326, 'n_words': 327}