UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

27 lines (26 loc) 808 B
import { DT_STACK_DIRECTION, DT_STACK_GAP } from "./stack_constants.js"; import { directionPropType } from "./utils.js"; function directionValidator(direction) { if (directionPropType(direction) === "string") { return Object.keys(DT_STACK_DIRECTION).includes(direction); } else if (directionPropType(direction) === "object") { const { default: defaultStyle } = direction; return Object.keys(DT_STACK_DIRECTION).includes(defaultStyle); } else { return null; } } function gapValidator(gap) { if (typeof gap === "string") { return DT_STACK_GAP.includes(gap); } if (typeof gap === "object") { const { default: defaultStyle } = gap; return DT_STACK_GAP.includes(defaultStyle); } } export { directionValidator, gapValidator }; //# sourceMappingURL=validators.js.map