UNPKG

recastui

Version:

Solidjs components library focused on usability, whitelabel theming, accessibility and developer experience

40 lines (32 loc) 1.11 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var Box_styleProps = require('./Box/style-props.js'); function getAllUsedStyleProps(props) { return Object.keys(props).filter(key => __isBoxStyledSystemProp(key)); } function isEmptyObject(obj) { console.log('isEmptyObject', obj); return typeof obj === 'object' && Object.keys(obj).length === 0; } const __isBoxStyledSystemProp = prop => Box_styleProps.boxSystemStyleProps.includes(prop); const getProps = test => props => { const next = {}; for (const key in props) { if (test(key || '')) next[key] = props[key]; } return next; }; const MRE = /^m[terblxy]?$/; const getMargin = getProps(k => MRE.test(k)); const omitMargin = getProps(k => !MRE.test(k)); /** @internal */ function __internalProps(props) { return props; } exports.__internalProps = __internalProps; exports.__isBoxStyledSystemProp = __isBoxStyledSystemProp; exports.getAllUsedStyleProps = getAllUsedStyleProps; exports.getMargin = getMargin; exports.getProps = getProps; exports.isEmptyObject = isEmptyObject; exports.omitMargin = omitMargin;