@unocss/preset-wind 0.55.6 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2,11 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const presetMini = require('@unocss/preset-mini');
6
5
  const core = require('@unocss/core');
6
+ const presetMini = require('@unocss/preset-mini');
7
7
  const utils = require('@unocss/preset-mini/utils');
8
8
  const _ = require('@unocss/preset-mini/rules');
9
9
  const theme$1 = require('@unocss/preset-mini/theme');
10
+ const ruleUtils = require('@unocss/rule-utils');
10
11
  const variants$1 = require('@unocss/preset-mini/variants');
11
12
 
12
13
  function _interopNamespaceCompat(e) {
@@ -98,17 +99,17 @@ const animations = [
98
99
 
99
100
  function bgGradientToValue(cssColor) {
100
101
  if (cssColor)
101
- return utils.colorToString(cssColor, 0);
102
+ return ruleUtils.colorToString(cssColor, 0);
102
103
  return "rgba(255,255,255,0)";
103
104
  }
104
105
  function bgGradientColorValue(mode, cssColor, color, alpha) {
105
106
  if (cssColor) {
106
107
  if (alpha != null)
107
- return utils.colorToString(cssColor, alpha);
108
+ return ruleUtils.colorToString(cssColor, alpha);
108
109
  else
109
- return utils.colorToString(cssColor, `var(--un-${mode}-opacity, ${utils.colorOpacityToString(cssColor)})`);
110
+ return ruleUtils.colorToString(cssColor, `var(--un-${mode}-opacity, ${ruleUtils.colorOpacityToString(cssColor)})`);
110
111
  }
111
- return utils.colorToString(color, alpha);
112
+ return ruleUtils.colorToString(color, alpha);
112
113
  }
113
114
  function bgGradientColorResolver() {
114
115
  return ([, mode, body], { theme }) => {
@@ -1276,7 +1277,7 @@ function variants(options) {
1276
1277
  ];
1277
1278
  }
1278
1279
 
1279
- function presetWind(options = {}) {
1280
+ const presetWind = core.definePreset((options = {}) => {
1280
1281
  return {
1281
1282
  ...presetMini.presetMini(options),
1282
1283
  name: "@unocss/preset-wind",
@@ -1285,7 +1286,7 @@ function presetWind(options = {}) {
1285
1286
  shortcuts,
1286
1287
  variants: variants(options)
1287
1288
  };
1288
- }
1289
+ });
1289
1290
 
1290
1291
  exports.colors = presetMini.colors;
1291
1292
  exports.preflights = presetMini.preflights;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _unocss_core from '@unocss/core';
2
- import { Rule, Variant, Preset } from '@unocss/core';
2
+ import { Rule, Variant } from '@unocss/core';
3
3
  import * as _unocss_preset_mini from '@unocss/preset-mini';
4
4
  import { Theme, PresetMiniOptions } from '@unocss/preset-mini';
5
5
  export { Theme, colors, preflights } from '@unocss/preset-mini';
@@ -14,6 +14,6 @@ declare function variants(options: PresetWindOptions): Variant<Theme>[];
14
14
 
15
15
  interface PresetWindOptions extends PresetMiniOptions {
16
16
  }
17
- declare function presetWind(options?: PresetWindOptions): Preset<Theme>;
17
+ declare const presetWind: _unocss_core.PresetFactory<object, PresetWindOptions>;
18
18
 
19
19
  export { type PresetWindOptions, presetWind as default, presetWind, rules, shortcuts, theme, variants };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _unocss_core from '@unocss/core';
2
- import { Rule, Variant, Preset } from '@unocss/core';
2
+ import { Rule, Variant } from '@unocss/core';
3
3
  import * as _unocss_preset_mini from '@unocss/preset-mini';
4
4
  import { Theme, PresetMiniOptions } from '@unocss/preset-mini';
5
5
  export { Theme, colors, preflights } from '@unocss/preset-mini';
@@ -14,6 +14,6 @@ declare function variants(options: PresetWindOptions): Variant<Theme>[];
14
14
 
15
15
  interface PresetWindOptions extends PresetMiniOptions {
16
16
  }
17
- declare function presetWind(options?: PresetWindOptions): Preset<Theme>;
17
+ declare const presetWind: _unocss_core.PresetFactory<object, PresetWindOptions>;
18
18
 
19
19
  export { type PresetWindOptions, presetWind as default, presetWind, rules, shortcuts, theme, variants };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _unocss_core from '@unocss/core';
2
- import { Rule, Variant, Preset } from '@unocss/core';
2
+ import { Rule, Variant } from '@unocss/core';
3
3
  import * as _unocss_preset_mini from '@unocss/preset-mini';
4
4
  import { Theme, PresetMiniOptions } from '@unocss/preset-mini';
5
5
  export { Theme, colors, preflights } from '@unocss/preset-mini';
@@ -14,6 +14,6 @@ declare function variants(options: PresetWindOptions): Variant<Theme>[];
14
14
 
15
15
  interface PresetWindOptions extends PresetMiniOptions {
16
16
  }
17
- declare function presetWind(options?: PresetWindOptions): Preset<Theme>;
17
+ declare const presetWind: _unocss_core.PresetFactory<object, PresetWindOptions>;
18
18
 
19
19
  export { type PresetWindOptions, presetWind as default, presetWind, rules, shortcuts, theme, variants };
package/dist/index.mjs CHANGED
@@ -1,10 +1,11 @@
1
+ import { isString, warnOnce, definePreset } from '@unocss/core';
1
2
  import { presetMini } from '@unocss/preset-mini';
2
3
  export { colors, preflights } from '@unocss/preset-mini';
3
- import { isString, warnOnce } from '@unocss/core';
4
- import { h, globalKeywords, makeGlobalStaticRules, positionMap, parseColor, colorToString, colorOpacityToString, colorResolver, resolveBreakpoints, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher, hasParseableColor } from '@unocss/preset-mini/utils';
4
+ import { h, globalKeywords, makeGlobalStaticRules, positionMap, parseColor, colorResolver, resolveBreakpoints, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher, hasParseableColor } from '@unocss/preset-mini/utils';
5
5
  import * as _ from '@unocss/preset-mini/rules';
6
6
  import { varEmpty, borderStyles, transformBase, boxShadowsBase, ringBase } from '@unocss/preset-mini/rules';
7
7
  import { theme as theme$1 } from '@unocss/preset-mini/theme';
8
+ import { colorToString, colorOpacityToString } from '@unocss/rule-utils';
8
9
  import { variants as variants$1 } from '@unocss/preset-mini/variants';
9
10
 
10
11
  const animations = [
@@ -1260,7 +1261,7 @@ function variants(options) {
1260
1261
  ];
1261
1262
  }
1262
1263
 
1263
- function presetWind(options = {}) {
1264
+ const presetWind = definePreset((options = {}) => {
1264
1265
  return {
1265
1266
  ...presetMini(options),
1266
1267
  name: "@unocss/preset-wind",
@@ -1269,6 +1270,6 @@ function presetWind(options = {}) {
1269
1270
  shortcuts,
1270
1271
  variants: variants(options)
1271
1272
  };
1272
- }
1273
+ });
1273
1274
 
1274
1275
  export { presetWind as default, presetWind, rules, shortcuts, theme, variants };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-wind",
3
- "version": "0.55.6",
3
+ "version": "0.56.0",
4
4
  "description": "Tailwind / Windi CSS compact preset for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -35,8 +35,9 @@
35
35
  "*.css"
36
36
  ],
37
37
  "dependencies": {
38
- "@unocss/core": "0.55.6",
39
- "@unocss/preset-mini": "0.55.6"
38
+ "@unocss/core": "0.56.0",
39
+ "@unocss/preset-mini": "0.56.0",
40
+ "@unocss/rule-utils": "0.56.0"
40
41
  },
41
42
  "scripts": {
42
43
  "build": "unbuild",