UNPKG

@chakra-ui/core

Version:

Responsive and accessible React UI components built with React and Emotion

18 lines (14 loc) 608 B
var rootOptions = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight", "marginY", "marginX", "flex", "flexBasis", "width", "minWidth", "maxWidth", "maxW", "minW", "w", "zIndex", "top", "right", "bottom", "left", "position", "pos"]; var splitProps = function splitProps(props) { var rootProps = {}; var selectProps = {}; for (var key in props) { if (rootOptions.includes(key)) { rootProps[key] = props[key]; } else { selectProps[key] = props[key]; } } return [rootProps, selectProps]; }; export default splitProps;