diff --git a/packages/react-native-web/src/modules/InteractionPropTypes/index.js b/packages/react-native-web/src/modules/InteractionPropTypes/index.js index c65858f5..023f1735 100644 --- a/packages/react-native-web/src/modules/InteractionPropTypes/index.js +++ b/packages/react-native-web/src/modules/InteractionPropTypes/index.js @@ -7,24 +7,68 @@ * @flow */ -import { oneOf, string } from 'prop-types'; +import { oneOf, oneOfType, string } from 'prop-types'; + +const cursorEnum = [ + 'auto', + 'default', + 'none', + 'context-menu', + 'help', + 'pointer', + 'progress', + 'wait', + 'cell', + 'crosshair', + 'text', + 'vertical-text', + 'alias', + 'copy', + 'move', + 'no-drop', + 'not-allowed', + 'e-resize', + 'n-resize', + 'ne-resize', + 'nw-resize', + 's-resize', + 'se-resize', + 'sw-resize', + 'w-resize', + 'ew-resize', + 'ns-resize', + 'nesw-resize', + 'nwse-resize', + 'col-resize', + 'row-resize', + 'all-scroll', + 'zoom-in', + 'zoom-out', + 'grab', + 'grabbing ' +]; +const touchActionEnum = [ + 'auto', + 'inherit', + 'manipulation', + 'none', + 'pan-down', + 'pan-left', + 'pan-right', + 'pan-up', + 'pan-x', + 'pan-y', + 'pinch-zoom' +]; +const userSelectEnum = ['auto', 'text', 'none', 'contain', 'all']; const InteractionPropTypes = { - cursor: string, - touchAction: oneOf([ - 'auto', - 'inherit', - 'manipulation', - 'none', - 'pan-down', - 'pan-left', - 'pan-right', - 'pan-up', - 'pan-x', - 'pan-y', - 'pinch-zoom' - ]), - userSelect: string, + // https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Formal_syntax + cursor: oneOfType([string, oneOf(cursorEnum)]), + // https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action#Formal_syntax + touchAction: oneOf(touchActionEnum), + // https://developer.mozilla.org/en-US/docs/Web/CSS/user-select#Formal_syntax_2 + userSelect: oneOf(userSelectEnum), willChange: string };