@vanilla-extract/sprinkles
Advanced tools
Comparing version 1.1.1 to 1.1.2
# @vanilla-extract/sprinkles | ||
## 1.1.2 | ||
### Patch Changes | ||
- [#326](https://github.com/seek-oss/vanilla-extract/pull/326) [`2d9b4c3`](https://github.com/seek-oss/vanilla-extract/commit/2d9b4c3e711310e55dbefe4b3430a771d95d62fd) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Avoid calling `composeStyles` when using the atoms function at runtime | ||
## 1.1.1 | ||
@@ -4,0 +10,0 @@ |
@@ -7,2 +7,3 @@ 'use strict'; | ||
var recipe = require('@vanilla-extract/css/recipe'); | ||
var fileScope = require('@vanilla-extract/css/fileScope'); | ||
var createAtomsFn$1 = require('./createAtomsFn-80ff2752.cjs.dev.js'); | ||
@@ -101,4 +102,11 @@ var createUtils_dist_vanillaExtractSprinklesCreateUtils = require('../createUtils/dist/vanilla-extract-sprinkles-createUtils.cjs.dev.js'); | ||
} | ||
const mockComposeStyles = classList => classList; | ||
function createAtomsFn(...config) { | ||
const atoms = createAtomsFn$1.createAtomsFn(css.composeStyles)(...config); | ||
// When using Sprinkles with the runtime (e.g. within a jest test) | ||
// `style` can be called (only for composition) outside of a fileScope. | ||
// Checking we're within a fileScope ensures this doesn't blow up and is | ||
// safe as compositions don't make sense at runtime | ||
const atoms = createAtomsFn$1.createAtomsFn(fileScope.hasFileScope() ? css.composeStyles : mockComposeStyles)(...config); | ||
return recipe.addRecipe(atoms, { | ||
@@ -105,0 +113,0 @@ importPath: '@vanilla-extract/sprinkles/createRuntimeAtomsFn', |
@@ -7,2 +7,3 @@ 'use strict'; | ||
var recipe = require('@vanilla-extract/css/recipe'); | ||
var fileScope = require('@vanilla-extract/css/fileScope'); | ||
var createAtomsFn$1 = require('./createAtomsFn-746320e7.cjs.prod.js'); | ||
@@ -101,4 +102,11 @@ var createUtils_dist_vanillaExtractSprinklesCreateUtils = require('../createUtils/dist/vanilla-extract-sprinkles-createUtils.cjs.prod.js'); | ||
} | ||
const mockComposeStyles = classList => classList; | ||
function createAtomsFn(...config) { | ||
const atoms = createAtomsFn$1.createAtomsFn(css.composeStyles)(...config); | ||
// When using Sprinkles with the runtime (e.g. within a jest test) | ||
// `style` can be called (only for composition) outside of a fileScope. | ||
// Checking we're within a fileScope ensures this doesn't blow up and is | ||
// safe as compositions don't make sense at runtime | ||
const atoms = createAtomsFn$1.createAtomsFn(fileScope.hasFileScope() ? css.composeStyles : mockComposeStyles)(...config); | ||
return recipe.addRecipe(atoms, { | ||
@@ -105,0 +113,0 @@ importPath: '@vanilla-extract/sprinkles/createRuntimeAtomsFn', |
@@ -1,3 +0,4 @@ | ||
import { style, composeStyles } from '@vanilla-extract/css'; | ||
import { composeStyles, style } from '@vanilla-extract/css'; | ||
import { addRecipe } from '@vanilla-extract/css/recipe'; | ||
import { hasFileScope } from '@vanilla-extract/css/fileScope'; | ||
import { c as createAtomsFn$1 } from './createAtomsFn-9c3ffe50.esm.js'; | ||
@@ -96,4 +97,11 @@ export { createMapValueFn, createNormalizeValueFn } from '../createUtils/dist/vanilla-extract-sprinkles-createUtils.esm.js'; | ||
} | ||
const mockComposeStyles = classList => classList; | ||
function createAtomsFn(...config) { | ||
const atoms = createAtomsFn$1(composeStyles)(...config); | ||
// When using Sprinkles with the runtime (e.g. within a jest test) | ||
// `style` can be called (only for composition) outside of a fileScope. | ||
// Checking we're within a fileScope ensures this doesn't blow up and is | ||
// safe as compositions don't make sense at runtime | ||
const atoms = createAtomsFn$1(hasFileScope() ? composeStyles : mockComposeStyles)(...config); | ||
return addRecipe(atoms, { | ||
@@ -100,0 +108,0 @@ importPath: '@vanilla-extract/sprinkles/createRuntimeAtomsFn', |
{ | ||
"name": "@vanilla-extract/sprinkles", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Zero-runtime atomic CSS framework for vanilla-extract", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79102
1136