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

Function resolveDirection

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

Source from the content-addressed store, hash-verified

490}
491
492function resolveDirection<T extends string>(
493 value: T | 'start' | 'end',
494 direction: 'ltr' | 'rtl'
495): T | 'left' | 'right' {
496 if (value === 'start') {
497 return direction === 'rtl' ? 'right' : 'left';
498 }
499 if (value === 'end') {
500 return direction === 'rtl' ? 'left' : 'right';
501 }
502 return value as T;
503}
504
505type Axis = 'x' | 'y';
506

Callers 1

Sheet.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected