UNPKG

@compositive/foundation

Version:

Compositive framework foundation package.

29 lines (26 loc) 1.2 kB
import { __decorate, __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib'; import { Memoized } from '@compositive/commons-memoize'; import { Style } from '@compositive/primitives'; import { resolveThemedStyleProperties } from './resolveThemedStyleProperties.js'; var _ThemedStyle_themedStyleProperties; class ThemedStyle { constructor(themedStyleProperties) { _ThemedStyle_themedStyleProperties.set(this, void 0); __classPrivateFieldSet(this, _ThemedStyle_themedStyleProperties, themedStyleProperties, "f"); } // TODO: Copying this static method here is not the best API design decision. // It would be better to find a better structure to separate "Style" manipulation from // the "SxProp" manipulation static concat(...sxProps) { return Style.concat(...sxProps); } toStaticStyle(theme) { return new Style(resolveThemedStyleProperties(__classPrivateFieldGet(this, _ThemedStyle_themedStyleProperties, "f"), theme)); } } _ThemedStyle_themedStyleProperties = new WeakMap(); __decorate([ Memoized([WeakMap]) ], ThemedStyle.prototype, "toStaticStyle", null); export { ThemedStyle }; //# sourceMappingURL=ThemedStyle.js.map