Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vanilla-extract/sprinkles

Package Overview
Dependencies
Maintainers
4
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vanilla-extract/sprinkles - npm Package Compare versions

Comparing version 0.0.0-sprinkles-type-explicit-undefined-202329123141 to 0.0.0-vite-plugin-new-20231228080614

createRuntimeSprinkles/dist/vanilla-extract-sprinkles-createRuntimeSprinkles.cjs.d.ts.map

10

createRuntimeSprinkles/dist/vanilla-extract-sprinkles-createRuntimeSprinkles.cjs.dev.js

@@ -5,13 +5,11 @@ 'use strict';

var createSprinkles$1 = require('../../dist/createSprinkles-66f18835.cjs.dev.js');
var createSprinkles$1 = require('../../dist/createSprinkles-faabd16d.cjs.dev.js');
var composeStyles = classList => classList;
var createSprinkles = function createSprinkles() {
return createSprinkles$1.createSprinkles(composeStyles)(...arguments);
};
const composeStyles = classList => classList;
const createSprinkles = (...args) => createSprinkles$1.createSprinkles(composeStyles)(...args);
/** @deprecated - Use `createSprinkles` */
var createAtomsFn = createSprinkles;
const createAtomsFn = createSprinkles;
exports.createAtomsFn = createAtomsFn;
exports.createSprinkles = createSprinkles;

@@ -5,13 +5,11 @@ 'use strict';

var createSprinkles$1 = require('../../dist/createSprinkles-e5dcc3fa.cjs.prod.js');
var createSprinkles$1 = require('../../dist/createSprinkles-352ae716.cjs.prod.js');
var composeStyles = classList => classList;
var createSprinkles = function createSprinkles() {
return createSprinkles$1.createSprinkles(composeStyles)(...arguments);
};
const composeStyles = classList => classList;
const createSprinkles = (...args) => createSprinkles$1.createSprinkles(composeStyles)(...args);
/** @deprecated - Use `createSprinkles` */
var createAtomsFn = createSprinkles;
const createAtomsFn = createSprinkles;
exports.createAtomsFn = createAtomsFn;
exports.createSprinkles = createSprinkles;

@@ -1,11 +0,9 @@

import { c as createSprinkles$1 } from '../../dist/createSprinkles-c8550e00.esm.js';
import { c as createSprinkles$1 } from '../../dist/createSprinkles-307ac22e.esm.js';
var composeStyles = classList => classList;
var createSprinkles = function createSprinkles() {
return createSprinkles$1(composeStyles)(...arguments);
};
const composeStyles = classList => classList;
const createSprinkles = (...args) => createSprinkles$1(composeStyles)(...args);
/** @deprecated - Use `createSprinkles` */
var createAtomsFn = createSprinkles;
const createAtomsFn = createSprinkles;
export { createAtomsFn, createSprinkles };

20

createUtils/dist/vanilla-extract-sprinkles-createUtils.cjs.dev.js

@@ -8,3 +8,3 @@ 'use strict';

function createNormalizeValueFn(properties) {
var {
const {
conditions

@@ -28,4 +28,4 @@ } = properties;

}
var returnValue = {};
for (var index in conditions.responsiveArray) {
const returnValue = {};
for (const index in conditions.responsiveArray) {
if (value[index] != null) {

@@ -48,3 +48,3 @@ returnValue[conditions.responsiveArray[index]] = value[index];

function createMapValueFn(properties) {
var {
const {
conditions

@@ -55,3 +55,3 @@ } = properties;

}
var normalizeValue = createNormalizeValueFn(properties);
const normalizeValue = createNormalizeValueFn(properties);
function mapValue(value, mapFn) {

@@ -64,7 +64,7 @@ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {

}
var normalizedObject = Array.isArray(value) ? normalizeValue(value) : value;
var mappedObject = {};
for (var _key in normalizedObject) {
if (normalizedObject[_key] != null) {
mappedObject[_key] = mapFn(normalizedObject[_key], _key);
const normalizedObject = Array.isArray(value) ? normalizeValue(value) : value;
const mappedObject = {};
for (const key in normalizedObject) {
if (normalizedObject[key] != null) {
mappedObject[key] = mapFn(normalizedObject[key], key);
}

@@ -71,0 +71,0 @@ }

@@ -8,3 +8,3 @@ 'use strict';

function createNormalizeValueFn(properties) {
var {
const {
conditions

@@ -28,4 +28,4 @@ } = properties;

}
var returnValue = {};
for (var index in conditions.responsiveArray) {
const returnValue = {};
for (const index in conditions.responsiveArray) {
if (value[index] != null) {

@@ -48,3 +48,3 @@ returnValue[conditions.responsiveArray[index]] = value[index];

function createMapValueFn(properties) {
var {
const {
conditions

@@ -55,3 +55,3 @@ } = properties;

}
var normalizeValue = createNormalizeValueFn(properties);
const normalizeValue = createNormalizeValueFn(properties);
function mapValue(value, mapFn) {

@@ -64,7 +64,7 @@ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {

}
var normalizedObject = Array.isArray(value) ? normalizeValue(value) : value;
var mappedObject = {};
for (var _key in normalizedObject) {
if (normalizedObject[_key] != null) {
mappedObject[_key] = mapFn(normalizedObject[_key], _key);
const normalizedObject = Array.isArray(value) ? normalizeValue(value) : value;
const mappedObject = {};
for (const key in normalizedObject) {
if (normalizedObject[key] != null) {
mappedObject[key] = mapFn(normalizedObject[key], key);
}

@@ -71,0 +71,0 @@ }

import { addRecipe } from '@vanilla-extract/css/recipe';
function createNormalizeValueFn(properties) {
var {
const {
conditions

@@ -23,4 +23,4 @@ } = properties;

}
var returnValue = {};
for (var index in conditions.responsiveArray) {
const returnValue = {};
for (const index in conditions.responsiveArray) {
if (value[index] != null) {

@@ -43,3 +43,3 @@ returnValue[conditions.responsiveArray[index]] = value[index];

function createMapValueFn(properties) {
var {
const {
conditions

@@ -50,3 +50,3 @@ } = properties;

}
var normalizeValue = createNormalizeValueFn(properties);
const normalizeValue = createNormalizeValueFn(properties);
function mapValue(value, mapFn) {

@@ -59,7 +59,7 @@ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {

}
var normalizedObject = Array.isArray(value) ? normalizeValue(value) : value;
var mappedObject = {};
for (var _key in normalizedObject) {
if (normalizedObject[_key] != null) {
mappedObject[_key] = mapFn(normalizedObject[_key], _key);
const normalizedObject = Array.isArray(value) ? normalizeValue(value) : value;
const mappedObject = {};
for (const key in normalizedObject) {
if (normalizedObject[key] != null) {
mappedObject[key] = mapFn(normalizedObject[key], key);
}

@@ -66,0 +66,0 @@ }

@@ -116,5 +116,7 @@ import { CSSProperties, StyleRule } from '@vanilla-extract/css';

};
type AtomicProperties = {
type AtomicCSSProperties = {
[Property in keyof CSSProperties]?: Record<string, CSSProperties[Property] | Omit<StyleRule, ConditionKey>> | ReadonlyArray<CSSProperties[Property]>;
};
type AtomicCustomProperties = Record<string, Record<string | number, Omit<StyleRule, ConditionKey>>>;
type AtomicProperties = AtomicCSSProperties | AtomicCustomProperties;
type ShorthandOptions<Properties extends AtomicProperties, Shorthands extends {

@@ -126,2 +128,3 @@ [shorthandName: string]: Array<keyof Properties>;

type UnconditionalAtomicOptions<Properties extends AtomicProperties> = {
'@layer'?: string;
properties: Properties;

@@ -224,2 +227,2 @@ };

export { ConditionalValue, RequiredConditionalValue, ResponsiveArray, createAtomicStyles, createAtomsFn, createMapValueFn, createNormalizeValueFn, createSprinkles, defineProperties };
export { ConditionalValue, RequiredConditionalValue, ResponsiveArray, SprinklesProperties, createAtomicStyles, createAtomsFn, createMapValueFn, createNormalizeValueFn, createSprinkles, defineProperties };

@@ -8,14 +8,11 @@ 'use strict';

var fileScope = require('@vanilla-extract/css/fileScope');
var createSprinkles$1 = require('./createSprinkles-66f18835.cjs.dev.js');
var createSprinkles$1 = require('./createSprinkles-faabd16d.cjs.dev.js');
var createUtils_dist_vanillaExtractSprinklesCreateUtils = require('../createUtils/dist/vanilla-extract-sprinkles-createUtils.cjs.dev.js');
function defineProperties(options) {
var styles = 'shorthands' in options ? Object.fromEntries(Object.entries(options.shorthands).map(_ref => {
var [prop, mappings] = _ref;
return [prop, {
mappings
}];
})) : {};
var _loop = function _loop(key) {
var property = options.properties[key];
let styles = 'shorthands' in options ? Object.fromEntries(Object.entries(options.shorthands).map(([prop, mappings]) => [prop, {
mappings
}])) : {};
for (const key in options.properties) {
const property = options.properties[key];
styles[key] = {

@@ -27,3 +24,3 @@ values: {}

}
var processValue = (valueName, value) => {
const processValue = (valueName, value) => {
if ('conditions' in options) {

@@ -33,9 +30,9 @@ styles[key].values[valueName] = {

};
var defaultConditions = options.defaultCondition ? Array.isArray(options.defaultCondition) ? options.defaultCondition : [options.defaultCondition] : [];
var defaultClasses = [];
for (var _conditionName in options.conditions) {
var styleValue = typeof value === 'object' ? value : {
const defaultConditions = options.defaultCondition ? Array.isArray(options.defaultCondition) ? options.defaultCondition : [options.defaultCondition] : [];
const defaultClasses = [];
for (const conditionName in options.conditions) {
let styleValue = typeof value === 'object' ? value : {
[key]: value
};
var condition = options.conditions[_conditionName];
const condition = options.conditions[conditionName];
if (condition['@supports']) {

@@ -69,5 +66,12 @@ styleValue = {

}
var className = css.style(styleValue, "".concat(key, "_").concat(String(valueName), "_").concat(_conditionName));
styles[key].values[valueName].conditions[_conditionName] = className;
if (defaultConditions.indexOf(_conditionName) > -1) {
if (options['@layer']) {
styleValue = {
'@layer': {
[options['@layer']]: styleValue
}
};
}
const className = css.style(styleValue, `${key}_${String(valueName)}_${conditionName}`);
styles[key].values[valueName].conditions[conditionName] = className;
if (defaultConditions.indexOf(conditionName) > -1) {
defaultClasses.push(className);

@@ -80,7 +84,14 @@ }

} else {
var _styleValue = typeof value === 'object' ? value : {
let styleValue = typeof value === 'object' ? value : {
[key]: value
};
if (options['@layer']) {
styleValue = {
'@layer': {
[options['@layer']]: styleValue
}
};
}
styles[key].values[valueName] = {
defaultClass: css.style(_styleValue, "".concat(key, "_").concat(String(valueName)))
defaultClass: css.style(styleValue, `${key}_${String(valueName)}`)
};

@@ -90,16 +101,13 @@ }

if (Array.isArray(property)) {
for (var value of property) {
for (const value of property) {
processValue(value, value);
}
} else {
for (var valueName in property) {
var _value = property[valueName];
processValue(valueName, _value);
for (const valueName in property) {
const value = property[valueName];
processValue(valueName, value);
}
}
};
for (var key in options.properties) {
_loop(key);
}
var conditions = 'conditions' in options ? {
const conditions = 'conditions' in options ? {
defaultCondition: options.defaultCondition,

@@ -114,7 +122,4 @@ conditionNames: Object.keys(options.conditions),

}
var mockComposeStyles = classList => classList;
function createSprinkles() {
for (var _len = arguments.length, config = new Array(_len), _key = 0; _key < _len; _key++) {
config[_key] = arguments[_key];
}
const mockComposeStyles = classList => classList;
function createSprinkles(...config) {
// When using Sprinkles with the runtime (e.g. within a jest test)

@@ -124,3 +129,3 @@ // `style` can be called (only for composition) outside of a fileScope.

// safe as compositions don't make sense at runtime
var sprinkles = createSprinkles$1.createSprinkles(fileScope.hasFileScope() ? css.composeStyles : mockComposeStyles)(...config);
const sprinkles = createSprinkles$1.createSprinkles(fileScope.hasFileScope() ? css.composeStyles : mockComposeStyles)(...config);
return recipe.addRecipe(sprinkles, {

@@ -134,6 +139,6 @@ importPath: '@vanilla-extract/sprinkles/createRuntimeSprinkles',

/** @deprecated - Use `defineProperties` */
var createAtomicStyles = defineProperties;
const createAtomicStyles = defineProperties;
/** @deprecated - Use `createSprinkles` */
var createAtomsFn = createSprinkles;
const createAtomsFn = createSprinkles;

@@ -140,0 +145,0 @@ exports.createMapValueFn = createUtils_dist_vanillaExtractSprinklesCreateUtils.createMapValueFn;

@@ -8,14 +8,11 @@ 'use strict';

var fileScope = require('@vanilla-extract/css/fileScope');
var createSprinkles$1 = require('./createSprinkles-e5dcc3fa.cjs.prod.js');
var createSprinkles$1 = require('./createSprinkles-352ae716.cjs.prod.js');
var createUtils_dist_vanillaExtractSprinklesCreateUtils = require('../createUtils/dist/vanilla-extract-sprinkles-createUtils.cjs.prod.js');
function defineProperties(options) {
var styles = 'shorthands' in options ? Object.fromEntries(Object.entries(options.shorthands).map(_ref => {
var [prop, mappings] = _ref;
return [prop, {
mappings
}];
})) : {};
var _loop = function _loop(key) {
var property = options.properties[key];
let styles = 'shorthands' in options ? Object.fromEntries(Object.entries(options.shorthands).map(([prop, mappings]) => [prop, {
mappings
}])) : {};
for (const key in options.properties) {
const property = options.properties[key];
styles[key] = {

@@ -27,3 +24,3 @@ values: {}

}
var processValue = (valueName, value) => {
const processValue = (valueName, value) => {
if ('conditions' in options) {

@@ -33,9 +30,9 @@ styles[key].values[valueName] = {

};
var defaultConditions = options.defaultCondition ? Array.isArray(options.defaultCondition) ? options.defaultCondition : [options.defaultCondition] : [];
var defaultClasses = [];
for (var _conditionName in options.conditions) {
var styleValue = typeof value === 'object' ? value : {
const defaultConditions = options.defaultCondition ? Array.isArray(options.defaultCondition) ? options.defaultCondition : [options.defaultCondition] : [];
const defaultClasses = [];
for (const conditionName in options.conditions) {
let styleValue = typeof value === 'object' ? value : {
[key]: value
};
var condition = options.conditions[_conditionName];
const condition = options.conditions[conditionName];
if (condition['@supports']) {

@@ -69,5 +66,12 @@ styleValue = {

}
var className = css.style(styleValue, "".concat(key, "_").concat(String(valueName), "_").concat(_conditionName));
styles[key].values[valueName].conditions[_conditionName] = className;
if (defaultConditions.indexOf(_conditionName) > -1) {
if (options['@layer']) {
styleValue = {
'@layer': {
[options['@layer']]: styleValue
}
};
}
const className = css.style(styleValue, `${key}_${String(valueName)}_${conditionName}`);
styles[key].values[valueName].conditions[conditionName] = className;
if (defaultConditions.indexOf(conditionName) > -1) {
defaultClasses.push(className);

@@ -80,7 +84,14 @@ }

} else {
var _styleValue = typeof value === 'object' ? value : {
let styleValue = typeof value === 'object' ? value : {
[key]: value
};
if (options['@layer']) {
styleValue = {
'@layer': {
[options['@layer']]: styleValue
}
};
}
styles[key].values[valueName] = {
defaultClass: css.style(_styleValue, "".concat(key, "_").concat(String(valueName)))
defaultClass: css.style(styleValue, `${key}_${String(valueName)}`)
};

@@ -90,16 +101,13 @@ }

if (Array.isArray(property)) {
for (var value of property) {
for (const value of property) {
processValue(value, value);
}
} else {
for (var valueName in property) {
var _value = property[valueName];
processValue(valueName, _value);
for (const valueName in property) {
const value = property[valueName];
processValue(valueName, value);
}
}
};
for (var key in options.properties) {
_loop(key);
}
var conditions = 'conditions' in options ? {
const conditions = 'conditions' in options ? {
defaultCondition: options.defaultCondition,

@@ -114,7 +122,4 @@ conditionNames: Object.keys(options.conditions),

}
var mockComposeStyles = classList => classList;
function createSprinkles() {
for (var _len = arguments.length, config = new Array(_len), _key = 0; _key < _len; _key++) {
config[_key] = arguments[_key];
}
const mockComposeStyles = classList => classList;
function createSprinkles(...config) {
// When using Sprinkles with the runtime (e.g. within a jest test)

@@ -124,3 +129,3 @@ // `style` can be called (only for composition) outside of a fileScope.

// safe as compositions don't make sense at runtime
var sprinkles = createSprinkles$1.createSprinkles(fileScope.hasFileScope() ? css.composeStyles : mockComposeStyles)(...config);
const sprinkles = createSprinkles$1.createSprinkles(fileScope.hasFileScope() ? css.composeStyles : mockComposeStyles)(...config);
return recipe.addRecipe(sprinkles, {

@@ -134,6 +139,6 @@ importPath: '@vanilla-extract/sprinkles/createRuntimeSprinkles',

/** @deprecated - Use `defineProperties` */
var createAtomicStyles = defineProperties;
const createAtomicStyles = defineProperties;
/** @deprecated - Use `createSprinkles` */
var createAtomsFn = createSprinkles;
const createAtomsFn = createSprinkles;

@@ -140,0 +145,0 @@ exports.createMapValueFn = createUtils_dist_vanillaExtractSprinklesCreateUtils.createMapValueFn;

import { composeStyles, style } from '@vanilla-extract/css';
import { addRecipe } from '@vanilla-extract/css/recipe';
import { hasFileScope } from '@vanilla-extract/css/fileScope';
import { c as createSprinkles$1 } from './createSprinkles-c8550e00.esm.js';
import { c as createSprinkles$1 } from './createSprinkles-307ac22e.esm.js';
export { createMapValueFn, createNormalizeValueFn } from '../createUtils/dist/vanilla-extract-sprinkles-createUtils.esm.js';
function defineProperties(options) {
var styles = 'shorthands' in options ? Object.fromEntries(Object.entries(options.shorthands).map(_ref => {
var [prop, mappings] = _ref;
return [prop, {
mappings
}];
})) : {};
var _loop = function _loop(key) {
var property = options.properties[key];
let styles = 'shorthands' in options ? Object.fromEntries(Object.entries(options.shorthands).map(([prop, mappings]) => [prop, {
mappings
}])) : {};
for (const key in options.properties) {
const property = options.properties[key];
styles[key] = {

@@ -22,3 +19,3 @@ values: {}

}
var processValue = (valueName, value) => {
const processValue = (valueName, value) => {
if ('conditions' in options) {

@@ -28,9 +25,9 @@ styles[key].values[valueName] = {

};
var defaultConditions = options.defaultCondition ? Array.isArray(options.defaultCondition) ? options.defaultCondition : [options.defaultCondition] : [];
var defaultClasses = [];
for (var _conditionName in options.conditions) {
var styleValue = typeof value === 'object' ? value : {
const defaultConditions = options.defaultCondition ? Array.isArray(options.defaultCondition) ? options.defaultCondition : [options.defaultCondition] : [];
const defaultClasses = [];
for (const conditionName in options.conditions) {
let styleValue = typeof value === 'object' ? value : {
[key]: value
};
var condition = options.conditions[_conditionName];
const condition = options.conditions[conditionName];
if (condition['@supports']) {

@@ -64,5 +61,12 @@ styleValue = {

}
var className = style(styleValue, "".concat(key, "_").concat(String(valueName), "_").concat(_conditionName));
styles[key].values[valueName].conditions[_conditionName] = className;
if (defaultConditions.indexOf(_conditionName) > -1) {
if (options['@layer']) {
styleValue = {
'@layer': {
[options['@layer']]: styleValue
}
};
}
const className = style(styleValue, `${key}_${String(valueName)}_${conditionName}`);
styles[key].values[valueName].conditions[conditionName] = className;
if (defaultConditions.indexOf(conditionName) > -1) {
defaultClasses.push(className);

@@ -75,7 +79,14 @@ }

} else {
var _styleValue = typeof value === 'object' ? value : {
let styleValue = typeof value === 'object' ? value : {
[key]: value
};
if (options['@layer']) {
styleValue = {
'@layer': {
[options['@layer']]: styleValue
}
};
}
styles[key].values[valueName] = {
defaultClass: style(_styleValue, "".concat(key, "_").concat(String(valueName)))
defaultClass: style(styleValue, `${key}_${String(valueName)}`)
};

@@ -85,16 +96,13 @@ }

if (Array.isArray(property)) {
for (var value of property) {
for (const value of property) {
processValue(value, value);
}
} else {
for (var valueName in property) {
var _value = property[valueName];
processValue(valueName, _value);
for (const valueName in property) {
const value = property[valueName];
processValue(valueName, value);
}
}
};
for (var key in options.properties) {
_loop(key);
}
var conditions = 'conditions' in options ? {
const conditions = 'conditions' in options ? {
defaultCondition: options.defaultCondition,

@@ -109,7 +117,4 @@ conditionNames: Object.keys(options.conditions),

}
var mockComposeStyles = classList => classList;
function createSprinkles() {
for (var _len = arguments.length, config = new Array(_len), _key = 0; _key < _len; _key++) {
config[_key] = arguments[_key];
}
const mockComposeStyles = classList => classList;
function createSprinkles(...config) {
// When using Sprinkles with the runtime (e.g. within a jest test)

@@ -119,3 +124,3 @@ // `style` can be called (only for composition) outside of a fileScope.

// safe as compositions don't make sense at runtime
var sprinkles = createSprinkles$1(hasFileScope() ? composeStyles : mockComposeStyles)(...config);
const sprinkles = createSprinkles$1(hasFileScope() ? composeStyles : mockComposeStyles)(...config);
return addRecipe(sprinkles, {

@@ -129,7 +134,7 @@ importPath: '@vanilla-extract/sprinkles/createRuntimeSprinkles',

/** @deprecated - Use `defineProperties` */
var createAtomicStyles = defineProperties;
const createAtomicStyles = defineProperties;
/** @deprecated - Use `createSprinkles` */
var createAtomsFn = createSprinkles;
const createAtomsFn = createSprinkles;
export { createAtomicStyles, createAtomsFn, createSprinkles, defineProperties };
{
"name": "@vanilla-extract/sprinkles",
"version": "0.0.0-sprinkles-type-explicit-undefined-202329123141",
"version": "0.0.0-vite-plugin-new-20231228080614",
"description": "Zero-runtime atomic CSS framework for vanilla-extract",

@@ -43,7 +43,7 @@ "sideEffects": false,

"peerDependencies": {
"@vanilla-extract/css": "^1.0.0"
"@vanilla-extract/css": "0.0.0-vite-plugin-new-20231228080614"
},
"devDependencies": {
"@vanilla-extract/css": "^1.9.2"
"@vanilla-extract/css": "0.0.0-vite-plugin-new-20231228080614"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc