MCPcopy Create free account
hub / github.com/adobe/react-spectrum / resolveDirection

Function resolveDirection

packages/react-aria-components/src/Sheet.tsx:514–525  ·  view source on GitHub ↗
(
  value: T | 'start' | 'end',
  direction: 'ltr' | 'rtl'
)

Source from the content-addressed store, hash-verified

512}
513
514function resolveDirection<T extends string>(
515 value: T | 'start' | 'end',
516 direction: 'ltr' | 'rtl'
517): T | 'left' | 'right' {
518 if (value === 'start') {
519 return direction === 'rtl' ? 'right' : 'left';
520 }
521 if (value === 'end') {
522 return direction === 'rtl' ? 'left' : 'right';
523 }
524 return value as T;
525}
526
527type Axis = 'x' | 'y';
528

Callers 1

Sheet.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected