@vinicunca/unocss-preset 1.7.0 → 1.8.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.
@@ -1,11 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  const utils = require('@unocss/preset-mini/utils');
4
- const index = require('../shared/unocss-preset.CfolHjpU.cjs');
4
+ const index = require('../shared/unocss-preset.QV10hHtz.cjs');
5
5
  require('@unocss/core');
6
6
  require('@vinicunca/perkakas');
7
- require('@unocss/preset-mini');
8
- require('unocss');
9
7
 
10
8
  const CSS_VARIABLE_PREFIX = "--vin";
11
9
  const ENTER_ANIMATION_NAME = "vin-in";
@@ -148,9 +146,9 @@ for (const rule of animationRules) {
148
146
  }
149
147
 
150
148
  function animationShortcuts(options) {
151
- function getSharedAnimationProperties() {
149
+ function getSharedAnimationProperties(theme) {
152
150
  return {
153
- "animation-duration": options.duration ? `${options.duration}${options.unit}` : "var(--defaults-transition-duration)",
151
+ "animation-duration": options.duration ? `${options.duration}${options.unit}` : theme.duration?.DEFAULT,
154
152
  ...options.delay && { "animation-delay": `${options.delay}${options.unit}` },
155
153
  ...options.direction && { "animation-direction": options.direction },
156
154
  ...options.fillMode && { "animation-fill-mode": options.fillMode },
@@ -162,11 +160,11 @@ function animationShortcuts(options) {
162
160
  return [
163
161
  [
164
162
  /^animate-in$/,
165
- () => [
163
+ (_, { theme }) => [
166
164
  `keyframes-${ENTER_ANIMATION_NAME}`,
167
165
  {
168
166
  "animation-name": ENTER_ANIMATION_NAME,
169
- ...getSharedAnimationProperties(),
167
+ ...getSharedAnimationProperties(theme),
170
168
  [`${CSS_VARIABLE_PREFIX}-enter-opacity`]: "initial",
171
169
  [`${CSS_VARIABLE_PREFIX}-enter-scale`]: "initial",
172
170
  [`${CSS_VARIABLE_PREFIX}-enter-rotate`]: "initial",
@@ -178,11 +176,11 @@ function animationShortcuts(options) {
178
176
  ],
179
177
  [
180
178
  /^animate-out$/,
181
- () => [
179
+ (_, { theme }) => [
182
180
  `keyframes-${EXIT_ANIMATION_NAME}`,
183
181
  {
184
182
  "animation-name": EXIT_ANIMATION_NAME,
185
- ...getSharedAnimationProperties(),
183
+ ...getSharedAnimationProperties(theme),
186
184
  [`${CSS_VARIABLE_PREFIX}-exit-opacity`]: "initial",
187
185
  [`${CSS_VARIABLE_PREFIX}-exit-scale`]: "initial",
188
186
  [`${CSS_VARIABLE_PREFIX}-exit-rotate`]: "initial",
@@ -1,9 +1,7 @@
1
1
  import { h } from '@unocss/preset-mini/utils';
2
- import { l as layerMeta } from '../shared/unocss-preset.DfGx7JFS.mjs';
2
+ import { l as layerMeta } from '../shared/unocss-preset.CzfTbObb.mjs';
3
3
  import '@unocss/core';
4
4
  import '@vinicunca/perkakas';
5
- import '@unocss/preset-mini';
6
- import 'unocss';
7
5
 
8
6
  const CSS_VARIABLE_PREFIX = "--vin";
9
7
  const ENTER_ANIMATION_NAME = "vin-in";
@@ -146,9 +144,9 @@ for (const rule of animationRules) {
146
144
  }
147
145
 
148
146
  function animationShortcuts(options) {
149
- function getSharedAnimationProperties() {
147
+ function getSharedAnimationProperties(theme) {
150
148
  return {
151
- "animation-duration": options.duration ? `${options.duration}${options.unit}` : "var(--defaults-transition-duration)",
149
+ "animation-duration": options.duration ? `${options.duration}${options.unit}` : theme.duration?.DEFAULT,
152
150
  ...options.delay && { "animation-delay": `${options.delay}${options.unit}` },
153
151
  ...options.direction && { "animation-direction": options.direction },
154
152
  ...options.fillMode && { "animation-fill-mode": options.fillMode },
@@ -160,11 +158,11 @@ function animationShortcuts(options) {
160
158
  return [
161
159
  [
162
160
  /^animate-in$/,
163
- () => [
161
+ (_, { theme }) => [
164
162
  `keyframes-${ENTER_ANIMATION_NAME}`,
165
163
  {
166
164
  "animation-name": ENTER_ANIMATION_NAME,
167
- ...getSharedAnimationProperties(),
165
+ ...getSharedAnimationProperties(theme),
168
166
  [`${CSS_VARIABLE_PREFIX}-enter-opacity`]: "initial",
169
167
  [`${CSS_VARIABLE_PREFIX}-enter-scale`]: "initial",
170
168
  [`${CSS_VARIABLE_PREFIX}-enter-rotate`]: "initial",
@@ -176,11 +174,11 @@ function animationShortcuts(options) {
176
174
  ],
177
175
  [
178
176
  /^animate-out$/,
179
- () => [
177
+ (_, { theme }) => [
180
178
  `keyframes-${EXIT_ANIMATION_NAME}`,
181
179
  {
182
180
  "animation-name": EXIT_ANIMATION_NAME,
183
- ...getSharedAnimationProperties(),
181
+ ...getSharedAnimationProperties(theme),
184
182
  [`${CSS_VARIABLE_PREFIX}-exit-opacity`]: "initial",
185
183
  [`${CSS_VARIABLE_PREFIX}-exit-scale`]: "initial",
186
184
  [`${CSS_VARIABLE_PREFIX}-exit-rotate`]: "initial",
package/dist/index.cjs CHANGED
@@ -1,10 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  require('@unocss/core');
4
- const index = require('./shared/unocss-preset.CfolHjpU.cjs');
4
+ const index = require('./shared/unocss-preset.QV10hHtz.cjs');
5
5
  require('@vinicunca/perkakas');
6
- require('@unocss/preset-mini');
7
- require('unocss');
8
6
 
9
7
 
10
8
 
package/dist/index.d.cts CHANGED
@@ -4,7 +4,7 @@ import { IconsOptions } from '@unocss/preset-icons';
4
4
  import { Theme } from '@unocss/preset-mini';
5
5
  import { TypographyOptions } from '@unocss/preset-typography';
6
6
  import { WebFontsOptions } from '@unocss/preset-web-fonts';
7
- import { PresetWind4Options } from '@unocss/preset-wind4';
7
+ import { PresetWind3Options } from '@unocss/preset-wind3';
8
8
  import { TransformerDirectivesOptions } from '@unocss/transformer-directives';
9
9
  import { TransformerVariantGroupOptions } from '@unocss/transformer-variant-group';
10
10
 
@@ -157,12 +157,6 @@ interface PreflightOptions {
157
157
  * @default true
158
158
  */
159
159
  reset: boolean;
160
- /**
161
- * Enable mini preflight
162
- *
163
- * @default true
164
- */
165
- mini?: boolean;
166
160
  }
167
161
  interface PresetVinicuncaOptions {
168
162
  /**
@@ -229,10 +223,10 @@ interface PresetVinicuncaOptions {
229
223
  * Enable the default preset
230
224
  * Only works when `presets` is not specified
231
225
  *
232
- * @about [@unocss/preset-wind4](https://unocss.dev/presets/wind)
226
+ * @about [@unocss/preset-wind3](https://unocss.dev/presets/wind)
233
227
  * @default true
234
228
  */
235
- wind?: boolean | PresetWind4Options;
229
+ wind?: boolean | PresetWind3Options;
236
230
  /**
237
231
  * Enable icons preset and the options of it
238
232
  * Only works when `presets` is not specified
package/dist/index.d.mts CHANGED
@@ -4,7 +4,7 @@ import { IconsOptions } from '@unocss/preset-icons';
4
4
  import { Theme } from '@unocss/preset-mini';
5
5
  import { TypographyOptions } from '@unocss/preset-typography';
6
6
  import { WebFontsOptions } from '@unocss/preset-web-fonts';
7
- import { PresetWind4Options } from '@unocss/preset-wind4';
7
+ import { PresetWind3Options } from '@unocss/preset-wind3';
8
8
  import { TransformerDirectivesOptions } from '@unocss/transformer-directives';
9
9
  import { TransformerVariantGroupOptions } from '@unocss/transformer-variant-group';
10
10
 
@@ -157,12 +157,6 @@ interface PreflightOptions {
157
157
  * @default true
158
158
  */
159
159
  reset: boolean;
160
- /**
161
- * Enable mini preflight
162
- *
163
- * @default true
164
- */
165
- mini?: boolean;
166
160
  }
167
161
  interface PresetVinicuncaOptions {
168
162
  /**
@@ -229,10 +223,10 @@ interface PresetVinicuncaOptions {
229
223
  * Enable the default preset
230
224
  * Only works when `presets` is not specified
231
225
  *
232
- * @about [@unocss/preset-wind4](https://unocss.dev/presets/wind)
226
+ * @about [@unocss/preset-wind3](https://unocss.dev/presets/wind)
233
227
  * @default true
234
228
  */
235
- wind?: boolean | PresetWind4Options;
229
+ wind?: boolean | PresetWind3Options;
236
230
  /**
237
231
  * Enable icons preset and the options of it
238
232
  * Only works when `presets` is not specified
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { IconsOptions } from '@unocss/preset-icons';
4
4
  import { Theme } from '@unocss/preset-mini';
5
5
  import { TypographyOptions } from '@unocss/preset-typography';
6
6
  import { WebFontsOptions } from '@unocss/preset-web-fonts';
7
- import { PresetWind4Options } from '@unocss/preset-wind4';
7
+ import { PresetWind3Options } from '@unocss/preset-wind3';
8
8
  import { TransformerDirectivesOptions } from '@unocss/transformer-directives';
9
9
  import { TransformerVariantGroupOptions } from '@unocss/transformer-variant-group';
10
10
 
@@ -157,12 +157,6 @@ interface PreflightOptions {
157
157
  * @default true
158
158
  */
159
159
  reset: boolean;
160
- /**
161
- * Enable mini preflight
162
- *
163
- * @default true
164
- */
165
- mini?: boolean;
166
160
  }
167
161
  interface PresetVinicuncaOptions {
168
162
  /**
@@ -229,10 +223,10 @@ interface PresetVinicuncaOptions {
229
223
  * Enable the default preset
230
224
  * Only works when `presets` is not specified
231
225
  *
232
- * @about [@unocss/preset-wind4](https://unocss.dev/presets/wind)
226
+ * @about [@unocss/preset-wind3](https://unocss.dev/presets/wind)
233
227
  * @default true
234
228
  */
235
- wind?: boolean | PresetWind4Options;
229
+ wind?: boolean | PresetWind3Options;
236
230
  /**
237
231
  * Enable icons preset and the options of it
238
232
  * Only works when `presets` is not specified
package/dist/index.mjs CHANGED
@@ -1,5 +1,3 @@
1
1
  import '@unocss/core';
2
- export { a as defineConfig, d as defineVinicuncaConfig, p as presetVinicunca } from './shared/unocss-preset.DfGx7JFS.mjs';
2
+ export { a as defineConfig, d as defineVinicuncaConfig, p as presetVinicunca } from './shared/unocss-preset.CzfTbObb.mjs';
3
3
  import '@vinicunca/perkakas';
4
- import '@unocss/preset-mini';
5
- import 'unocss';
@@ -1,7 +1,5 @@
1
1
  import { definePreset, mergeConfigs } from '@unocss/core';
2
2
  import { isString, isBoolean, isPlainObject, mergeDeep } from '@vinicunca/perkakas';
3
- import { theme } from '@unocss/preset-mini';
4
- import { entriesToCss } from 'unocss';
5
3
 
6
4
  const RE_RGB = /rgb\(([\d\s]+?)\s*\/\s*([^)]+)\)/;
7
5
  const RE_RGBA = /rgba\(([\d\s,]+),\s*([^)]+)\)/;
@@ -483,33 +481,15 @@ const resetPreflight = {
483
481
  };
484
482
 
485
483
  function getPreflights(options) {
486
- const miniPreflights = getMiniPreflights();
487
484
  if (isBoolean(options.preflights)) {
488
485
  return options.preflights ? [
489
- resetPreflight,
490
- miniPreflights
486
+ resetPreflight
491
487
  ] : [];
492
488
  }
493
489
  return [
494
- options.preflights.reset ? resetPreflight : void 0,
495
- options.preflights.mini ? miniPreflights : void 0
490
+ options.preflights.reset ? resetPreflight : void 0
496
491
  ].filter(Boolean);
497
492
  }
498
- function getMiniPreflights() {
499
- const entries = Object.entries({
500
- ...theme.preflightBase,
501
- "--un-inset-shadow": "0 0 rgb(0 0 0 / 0)",
502
- "--un-ring-shadow": "0 0 rgb(0 0 0 / 0)",
503
- "--un-inset-ring-shadow": "0 0 rgb(0 0 0 / 0)"
504
- });
505
- const css = entriesToCss(entries);
506
- const roots = ["*,::before,::after", "::backdrop"];
507
- const cssContent = roots.map((root) => `${root}{${css}}`).join("");
508
- return {
509
- layer: "preflights",
510
- getCSS: () => compressCSS(cssContent)
511
- };
512
- }
513
493
 
514
494
  const customShortcuts = [
515
495
  ["flex-center", "flex justify-center items-center"],
@@ -600,7 +580,7 @@ const defaultOptions = {
600
580
  preflights: true,
601
581
  // presets
602
582
  wind: {
603
- reset: false
583
+ preflight: true
604
584
  },
605
585
  icons: true,
606
586
  webFonts: false,
@@ -641,7 +621,7 @@ async function resolveOptions(options) {
641
621
  const presets = [];
642
622
  const transformers = [];
643
623
  const presetMap = {
644
- wind: import('@unocss/preset-wind4').then((mod) => mod.presetWind4),
624
+ wind: import('@unocss/preset-wind3').then((mod) => mod.presetWind3),
645
625
  icons: import('@unocss/preset-icons').then((mod) => mod.presetIcons),
646
626
  webFonts: import('@unocss/preset-web-fonts').then((mod) => mod.presetWebFonts),
647
627
  typography: import('@unocss/preset-typography').then((mod) => mod.presetTypography),
@@ -2,8 +2,6 @@
2
2
 
3
3
  const core = require('@unocss/core');
4
4
  const perkakas = require('@vinicunca/perkakas');
5
- const presetMini = require('@unocss/preset-mini');
6
- const unocss = require('unocss');
7
5
 
8
6
  const RE_RGB = /rgb\(([\d\s]+?)\s*\/\s*([^)]+)\)/;
9
7
  const RE_RGBA = /rgba\(([\d\s,]+),\s*([^)]+)\)/;
@@ -485,33 +483,15 @@ const resetPreflight = {
485
483
  };
486
484
 
487
485
  function getPreflights(options) {
488
- const miniPreflights = getMiniPreflights();
489
486
  if (perkakas.isBoolean(options.preflights)) {
490
487
  return options.preflights ? [
491
- resetPreflight,
492
- miniPreflights
488
+ resetPreflight
493
489
  ] : [];
494
490
  }
495
491
  return [
496
- options.preflights.reset ? resetPreflight : void 0,
497
- options.preflights.mini ? miniPreflights : void 0
492
+ options.preflights.reset ? resetPreflight : void 0
498
493
  ].filter(Boolean);
499
494
  }
500
- function getMiniPreflights() {
501
- const entries = Object.entries({
502
- ...presetMini.theme.preflightBase,
503
- "--un-inset-shadow": "0 0 rgb(0 0 0 / 0)",
504
- "--un-ring-shadow": "0 0 rgb(0 0 0 / 0)",
505
- "--un-inset-ring-shadow": "0 0 rgb(0 0 0 / 0)"
506
- });
507
- const css = unocss.entriesToCss(entries);
508
- const roots = ["*,::before,::after", "::backdrop"];
509
- const cssContent = roots.map((root) => `${root}{${css}}`).join("");
510
- return {
511
- layer: "preflights",
512
- getCSS: () => compressCSS(cssContent)
513
- };
514
- }
515
495
 
516
496
  const customShortcuts = [
517
497
  ["flex-center", "flex justify-center items-center"],
@@ -602,7 +582,7 @@ const defaultOptions = {
602
582
  preflights: true,
603
583
  // presets
604
584
  wind: {
605
- reset: false
585
+ preflight: true
606
586
  },
607
587
  icons: true,
608
588
  webFonts: false,
@@ -643,7 +623,7 @@ async function resolveOptions(options) {
643
623
  const presets = [];
644
624
  const transformers = [];
645
625
  const presetMap = {
646
- wind: import('@unocss/preset-wind4').then((mod) => mod.presetWind4),
626
+ wind: import('@unocss/preset-wind3').then((mod) => mod.presetWind3),
647
627
  icons: import('@unocss/preset-icons').then((mod) => mod.presetIcons),
648
628
  webFonts: import('@unocss/preset-web-fonts').then((mod) => mod.presetWebFonts),
649
629
  typography: import('@unocss/preset-typography').then((mod) => mod.presetTypography),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vinicunca/unocss-preset",
3
3
  "type": "module",
4
- "version": "1.7.0",
4
+ "version": "1.8.0",
5
5
  "description": "Opinionated UnoCSS preset",
6
6
  "author": "praburangki<https://github.com/praburangki>",
7
7
  "license": "MIT",
@@ -54,7 +54,7 @@
54
54
  "@unocss/preset-mini": "^66.1.0-beta.3",
55
55
  "@unocss/preset-typography": "^66.1.0-beta.3",
56
56
  "@unocss/preset-web-fonts": "^66.1.0-beta.3",
57
- "@unocss/preset-wind4": "^66.1.0-beta.3",
57
+ "@unocss/preset-wind3": "^66.1.0-beta.3",
58
58
  "@unocss/transformer-directives": "^66.1.0-beta.3",
59
59
  "@unocss/transformer-variant-group": "^66.1.0-beta.3",
60
60
  "postcss": "^8.5.3",