@fluixi-css/core 0.1.0-next.0 → 1.0.0-next.1

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.
Files changed (36) hide show
  1. package/dist/package.json +1 -1
  2. package/dist/reset.css +10 -1
  3. package/dist/src/engine/atom.js +6 -1
  4. package/dist/src/engine/atom.js.map +1 -1
  5. package/dist/src/engine/directives.js +44 -1
  6. package/dist/src/engine/directives.js.map +1 -1
  7. package/dist/src/engine/index.js +4 -0
  8. package/dist/src/engine/index.js.map +1 -1
  9. package/dist/src/engine/scanner.js +34 -6
  10. package/dist/src/engine/scanner.js.map +1 -1
  11. package/dist/src/engine/transform.js +2 -0
  12. package/dist/src/engine/transform.js.map +1 -1
  13. package/dist/src/engine/utilities/filters.d.ts +2 -0
  14. package/dist/src/engine/utilities/filters.js +86 -0
  15. package/dist/src/engine/utilities/filters.js.map +1 -0
  16. package/dist/src/engine/utilities/gradients.d.ts +2 -0
  17. package/dist/src/engine/utilities/gradients.js +40 -0
  18. package/dist/src/engine/utilities/gradients.js.map +1 -0
  19. package/dist/src/engine/utilities/index.js +8 -0
  20. package/dist/src/engine/utilities/index.js.map +1 -1
  21. package/dist/src/engine/utilities/transforms.d.ts +2 -0
  22. package/dist/src/engine/utilities/transforms.js +63 -0
  23. package/dist/src/engine/utilities/transforms.js.map +1 -0
  24. package/dist/src/engine/utilities/transitions.d.ts +2 -0
  25. package/dist/src/engine/utilities/transitions.js +61 -0
  26. package/dist/src/engine/utilities/transitions.js.map +1 -0
  27. package/dist/src/engine/variants.d.ts +1 -0
  28. package/dist/src/engine/variants.js +12 -5
  29. package/dist/src/engine/variants.js.map +1 -1
  30. package/dist/src/index.cjs +419 -20
  31. package/dist/src/index.cjs.map +1 -1
  32. package/dist/src/index.mjs +419 -21
  33. package/dist/src/index.mjs.map +1 -1
  34. package/dist/tsconfig.tsbuildinfo +1 -1
  35. package/package.json +1 -1
  36. package/reset.css +10 -1
@@ -419,7 +419,11 @@ function splitModifier(base) {
419
419
 
420
420
  // In arbitrary values `_` stands in for a space; `\_` is a literal underscore.
421
421
  function decodeUnderscores(value) {
422
- return value.replace(/\\_/g, '\0').replace(/_/g, ' ').replace(/\0/g, '_');
422
+ // `_` → space, `\_` → literal `_`. But a URL may legitimately contain underscores,
423
+ // so leave the inside of `url(...)` verbatim (the split keeps url() at odd indices).
424
+ return value.split(/(url\([^)]*\))/g).map(function (part, i) {
425
+ return i % 2 === 1 ? part : part.replace(/\\_/g, '\0').replace(/_/g, ' ').replace(/\0/g, '_');
426
+ }).join('');
423
427
  }
424
428
 
425
429
  // An arbitrary value may lead with a `type:` hint, e.g. `[length:12px]`.
@@ -2392,7 +2396,15 @@ function registerVariant(atRule, reg) {
2392
2396
  var prelude = ((_atRule$preludeText2 = atRule.preludeText) !== null && _atRule$preludeText2 !== void 0 ? _atRule$preludeText2 : '').trim();
2393
2397
  if (!prelude) return;
2394
2398
 
2395
- // `name (condition)` shorthand — the block form isn't supported yet.
2399
+ // Block form: `@custom-variant name { &:hover { @slot } }` — the prelude is just
2400
+ // the name and the block describes the wrapping, marked by `@slot`.
2401
+ if (atRule.block) {
2402
+ var wrap = blockToWrap(atRule.block.children);
2403
+ if (prelude && wrap) reg.variant(prelude, wrap);
2404
+ return;
2405
+ }
2406
+
2407
+ // Shorthand: `@custom-variant name (condition)`.
2396
2408
  var paren = prelude.indexOf('(');
2397
2409
  if (paren === -1 || !prelude.endsWith(')')) return;
2398
2410
  var name = prelude.slice(0, paren).trim();
@@ -2400,6 +2412,43 @@ function registerVariant(atRule, reg) {
2400
2412
  if (!name || !condition) return;
2401
2413
  reg.variant(name, wrapFor(condition));
2402
2414
  }
2415
+
2416
+ // Walk the single path down to `@slot`, collecting the selector (nested rules,
2417
+ // combined by `&` substitution) and/or the wrapping at-rule (`@media`, `@supports`).
2418
+ // Supports one selector level, one at-rule level, or both nested.
2419
+ function blockToWrap(children) {
2420
+ var selector;
2421
+ var at;
2422
+ var node = firstBlockChild(children);
2423
+ while (node) {
2424
+ if (node.type === 'rule') {
2425
+ var _rawSelector, _children;
2426
+ var sel = ((_rawSelector = node.rawSelector) !== null && _rawSelector !== void 0 ? _rawSelector : '').trim();
2427
+ selector = selector ? sel.replace(/&/g, selector) : sel;
2428
+ node = firstBlockChild((_children = node.children) !== null && _children !== void 0 ? _children : []);
2429
+ } else if (node.type === 'atrule') {
2430
+ var _ar$preludeText;
2431
+ var ar = node;
2432
+ if (ar.name === 'slot') break;
2433
+ at = {
2434
+ name: ar.name,
2435
+ params: ((_ar$preludeText = ar.preludeText) !== null && _ar$preludeText !== void 0 ? _ar$preludeText : '').trim()
2436
+ };
2437
+ node = ar.block ? firstBlockChild(ar.block.children) : undefined;
2438
+ } else {
2439
+ node = undefined;
2440
+ }
2441
+ }
2442
+ var wrap = {};
2443
+ if (selector) wrap.selector = selector.includes('&') ? selector : "&".concat(selector);
2444
+ if (at) wrap.atRule = at;
2445
+ return wrap.selector || wrap.atRule ? wrap : null;
2446
+ }
2447
+ function firstBlockChild(children) {
2448
+ return children.find(function (c) {
2449
+ return c.type === 'rule' || c.type === 'atrule';
2450
+ });
2451
+ }
2403
2452
  function wrapFor(condition) {
2404
2453
  if (condition[0] === '@') {
2405
2454
  var cut = condition.search(/[\s(]/);
@@ -3178,10 +3227,10 @@ function registerEffects(reg) {
3178
3227
  reg.dynamicRule('shadow', function (_ref) {
3179
3228
  var value = _ref.value,
3180
3229
  theme = _ref.theme;
3181
- if (value === null) return wrap(theme.resolve('shadow', 'DEFAULT'));
3230
+ if (value === null) return wrap$1(theme.resolve('shadow', 'DEFAULT'));
3182
3231
  if (value.kind === 'arbitrary') return [decl('box-shadow', value.value)];
3183
3232
  if (value.value === 'none') return [decl('box-shadow', 'none')];
3184
- return wrap(theme.resolve('shadow', value.value));
3233
+ return wrap$1(theme.resolve('shadow', value.value));
3185
3234
  });
3186
3235
  reg.dynamicRule('opacity', function (_ref2) {
3187
3236
  var value = _ref2.value;
@@ -3225,7 +3274,7 @@ function registerEffects(reg) {
3225
3274
  auto: 'auto'
3226
3275
  });
3227
3276
  }
3228
- function wrap(shadow) {
3277
+ function wrap$1(shadow) {
3229
3278
  return shadow ? [decl('box-shadow', shadow)] : null;
3230
3279
  }
3231
3280
  var BLEND = {
@@ -3247,6 +3296,131 @@ var BLEND = {
3247
3296
  luminosity: 'luminosity'
3248
3297
  };
3249
3298
 
3299
+ // Same composition trick as transforms: each utility sets a `--flx-*` var and
3300
+ // re-declares the composed `filter`, with identity defaults so any one is valid
3301
+ // alone and several compose (`blur-sm grayscale`).
3302
+ var FILTER = 'blur(var(--flx-blur,0)) brightness(var(--flx-brightness,1)) contrast(var(--flx-contrast,1)) ' + 'grayscale(var(--flx-grayscale,0)) hue-rotate(var(--flx-hue-rotate,0)) invert(var(--flx-invert,0)) ' + 'saturate(var(--flx-saturate,1)) sepia(var(--flx-sepia,0)) drop-shadow(var(--flx-drop-shadow,0 0 #0000))';
3303
+ var BACKDROP = 'blur(var(--flx-backdrop-blur,0)) brightness(var(--flx-backdrop-brightness,1)) ' + 'contrast(var(--flx-backdrop-contrast,1)) grayscale(var(--flx-backdrop-grayscale,0)) ' + 'opacity(var(--flx-backdrop-opacity,1)) saturate(var(--flx-backdrop-saturate,1))';
3304
+ var compose$1 = function compose(prop, val) {
3305
+ return [decl(prop, val), decl('filter', FILTER)];
3306
+ };
3307
+ var backdrop = function backdrop(prop, val) {
3308
+ return [decl(prop, val), decl('backdrop-filter', BACKDROP)];
3309
+ };
3310
+ function registerFilters(reg) {
3311
+ reg.rule('filter-none', [decl('filter', 'none')]);
3312
+ reg.rule('backdrop-filter-none', [decl('backdrop-filter', 'none')]);
3313
+ reg.dynamicRule('blur', function (_ref) {
3314
+ var value = _ref.value;
3315
+ return v(compose$1, '--flx-blur', named$1(value, BLUR));
3316
+ });
3317
+ reg.dynamicRule('brightness', function (_ref2) {
3318
+ var value = _ref2.value;
3319
+ return v(compose$1, '--flx-brightness', ratio(value));
3320
+ });
3321
+ reg.dynamicRule('contrast', function (_ref3) {
3322
+ var value = _ref3.value;
3323
+ return v(compose$1, '--flx-contrast', ratio(value));
3324
+ });
3325
+ reg.dynamicRule('saturate', function (_ref4) {
3326
+ var value = _ref4.value;
3327
+ return v(compose$1, '--flx-saturate', ratio(value));
3328
+ });
3329
+ reg.dynamicRule('grayscale', function (_ref5) {
3330
+ var value = _ref5.value;
3331
+ return v(compose$1, '--flx-grayscale', pct(value));
3332
+ });
3333
+ reg.dynamicRule('invert', function (_ref6) {
3334
+ var value = _ref6.value;
3335
+ return v(compose$1, '--flx-invert', pct(value));
3336
+ });
3337
+ reg.dynamicRule('sepia', function (_ref7) {
3338
+ var value = _ref7.value;
3339
+ return v(compose$1, '--flx-sepia', pct(value));
3340
+ });
3341
+ reg.dynamicRule('hue-rotate', function (_ref8) {
3342
+ var value = _ref8.value,
3343
+ negative = _ref8.negative;
3344
+ return v(compose$1, '--flx-hue-rotate', deg(value, negative));
3345
+ });
3346
+ reg.dynamicRule('drop-shadow', function (_ref9) {
3347
+ var value = _ref9.value;
3348
+ return v(compose$1, '--flx-drop-shadow', named$1(value, DROP_SHADOW));
3349
+ });
3350
+ reg.dynamicRule('backdrop-blur', function (_ref0) {
3351
+ var value = _ref0.value;
3352
+ return v(backdrop, '--flx-backdrop-blur', named$1(value, BLUR));
3353
+ });
3354
+ reg.dynamicRule('backdrop-brightness', function (_ref1) {
3355
+ var value = _ref1.value;
3356
+ return v(backdrop, '--flx-backdrop-brightness', ratio(value));
3357
+ });
3358
+ reg.dynamicRule('backdrop-contrast', function (_ref10) {
3359
+ var value = _ref10.value;
3360
+ return v(backdrop, '--flx-backdrop-contrast', ratio(value));
3361
+ });
3362
+ reg.dynamicRule('backdrop-saturate', function (_ref11) {
3363
+ var value = _ref11.value;
3364
+ return v(backdrop, '--flx-backdrop-saturate', ratio(value));
3365
+ });
3366
+ reg.dynamicRule('backdrop-grayscale', function (_ref12) {
3367
+ var value = _ref12.value;
3368
+ return v(backdrop, '--flx-backdrop-grayscale', pct(value));
3369
+ });
3370
+ reg.dynamicRule('backdrop-opacity', function (_ref13) {
3371
+ var value = _ref13.value;
3372
+ return v(backdrop, '--flx-backdrop-opacity', ratio(value));
3373
+ });
3374
+ }
3375
+ function v(build, prop, val) {
3376
+ return val === null ? null : build(prop, val);
3377
+ }
3378
+
3379
+ /** number → decimal ratio (brightness-50 → 0.5); arbitrary passes through. */
3380
+ function ratio(value) {
3381
+ if (!value) return null;
3382
+ if (value.kind === 'arbitrary') return value.value;
3383
+ return /^\d+$/.test(value.value) ? "".concat(+value.value / 100) : null;
3384
+ }
3385
+
3386
+ /** bare → 100%, `0` → 0%, number → number% (grayscale/invert/sepia). */
3387
+ function pct(value) {
3388
+ if (!value) return '100%';
3389
+ if (value.kind === 'arbitrary') return value.value;
3390
+ return /^\d+$/.test(value.value) ? "".concat(value.value, "%") : null;
3391
+ }
3392
+ function deg(value, negative) {
3393
+ if (!value) return null;
3394
+ if (value.kind === 'arbitrary') return negative ? "calc(".concat(value.value, " * -1)") : value.value;
3395
+ return /^\d+$/.test(value.value) ? "".concat(negative ? '-' : '').concat(value.value, "deg") : null;
3396
+ }
3397
+ function named$1(value, map) {
3398
+ var _map$, _map$value$value;
3399
+ if (!value) return (_map$ = map['']) !== null && _map$ !== void 0 ? _map$ : null;
3400
+ if (value.kind === 'arbitrary') return value.value;
3401
+ return (_map$value$value = map[value.value]) !== null && _map$value$value !== void 0 ? _map$value$value : null;
3402
+ }
3403
+ var BLUR = {
3404
+ '': '8px',
3405
+ none: '0',
3406
+ xs: '2px',
3407
+ sm: '4px',
3408
+ md: '12px',
3409
+ lg: '16px',
3410
+ xl: '24px',
3411
+ '2xl': '40px',
3412
+ '3xl': '64px'
3413
+ };
3414
+ var DROP_SHADOW = {
3415
+ '': '0 1px 2px rgb(0 0 0 / 0.1)',
3416
+ none: '0 0 #0000',
3417
+ sm: '0 1px 1px rgb(0 0 0 / 0.05)',
3418
+ md: '0 4px 3px rgb(0 0 0 / 0.07)',
3419
+ lg: '0 10px 8px rgb(0 0 0 / 0.04)',
3420
+ xl: '0 20px 13px rgb(0 0 0 / 0.03)',
3421
+ '2xl': '0 25px 25px rgb(0 0 0 / 0.15)'
3422
+ };
3423
+
3250
3424
  function registerFlexGrid(reg) {
3251
3425
  props(reg, 'flex-direction', {
3252
3426
  'flex-row': 'row',
@@ -3409,6 +3583,44 @@ function line(reg, root, property) {
3409
3583
  });
3410
3584
  }
3411
3585
 
3586
+ function registerGradients(reg) {
3587
+ keywords(reg, 'bg-gradient-to', 'background-image', {
3588
+ t: 'linear-gradient(to top, var(--flx-gradient-stops))',
3589
+ tr: 'linear-gradient(to top right, var(--flx-gradient-stops))',
3590
+ r: 'linear-gradient(to right, var(--flx-gradient-stops))',
3591
+ br: 'linear-gradient(to bottom right, var(--flx-gradient-stops))',
3592
+ b: 'linear-gradient(to bottom, var(--flx-gradient-stops))',
3593
+ bl: 'linear-gradient(to bottom left, var(--flx-gradient-stops))',
3594
+ l: 'linear-gradient(to left, var(--flx-gradient-stops))',
3595
+ tl: 'linear-gradient(to top left, var(--flx-gradient-stops))'
3596
+ });
3597
+
3598
+ // Color stops build up `--flx-gradient-stops`. `from` seeds a two-stop list that
3599
+ // `to` fills in; `via` promotes it to three stops. A bare `to` with no `from`
3600
+ // still works because the from stop defaults to transparent.
3601
+ reg.dynamicRule('from', function (_ref) {
3602
+ var value = _ref.value,
3603
+ modifier = _ref.modifier,
3604
+ theme = _ref.theme;
3605
+ var color = colorValue(value, modifier, theme);
3606
+ return color ? [decl('--flx-gradient-from', color), decl('--flx-gradient-stops', 'var(--flx-gradient-from), var(--flx-gradient-to, transparent)')] : null;
3607
+ });
3608
+ reg.dynamicRule('via', function (_ref2) {
3609
+ var value = _ref2.value,
3610
+ modifier = _ref2.modifier,
3611
+ theme = _ref2.theme;
3612
+ var color = colorValue(value, modifier, theme);
3613
+ return color ? [decl('--flx-gradient-via', color), decl('--flx-gradient-stops', 'var(--flx-gradient-from, transparent), var(--flx-gradient-via), var(--flx-gradient-to, transparent)')] : null;
3614
+ });
3615
+ reg.dynamicRule('to', function (_ref3) {
3616
+ var value = _ref3.value,
3617
+ modifier = _ref3.modifier,
3618
+ theme = _ref3.theme;
3619
+ var color = colorValue(value, modifier, theme);
3620
+ return color ? [decl('--flx-gradient-to', color)] : null;
3621
+ });
3622
+ }
3623
+
3412
3624
  function registerLayout(reg) {
3413
3625
  props(reg, 'display', {
3414
3626
  block: 'block',
@@ -3601,6 +3813,154 @@ function spacing(reg, root, props, allowAuto) {
3601
3813
  });
3602
3814
  }
3603
3815
 
3816
+ // Each transform utility sets its own `--flx-*` var and re-declares the composed
3817
+ // `transform`. The vars carry identity defaults (0 / 1) as fallbacks, so any single
3818
+ // utility is valid on its own and several compose (`rotate-45 scale-90`) without an
3819
+ // ordering dependency or a shared base rule.
3820
+ var REST = 'rotate(var(--flx-rotate,0)) skewX(var(--flx-skew-x,0)) skewY(var(--flx-skew-y,0)) ' + 'scaleX(var(--flx-scale-x,1)) scaleY(var(--flx-scale-y,1))';
3821
+ var TRANSFORM = "translate(var(--flx-translate-x,0),var(--flx-translate-y,0)) ".concat(REST);
3822
+ var TRANSFORM_GPU = "translate3d(var(--flx-translate-x,0),var(--flx-translate-y,0),0) ".concat(REST);
3823
+ var compose = function compose(prop, val) {
3824
+ return [decl(prop, val), decl('transform', TRANSFORM)];
3825
+ };
3826
+ function registerTransforms(reg) {
3827
+ var rotate = function rotate(v, neg) {
3828
+ return angle(v, neg);
3829
+ };
3830
+ reg.dynamicRule('rotate', function (_ref) {
3831
+ var value = _ref.value,
3832
+ negative = _ref.negative;
3833
+ var v = rotate(value, negative);
3834
+ return v ? compose('--flx-rotate', v) : null;
3835
+ });
3836
+ reg.dynamicRule('skew-x', function (_ref2) {
3837
+ var value = _ref2.value,
3838
+ negative = _ref2.negative;
3839
+ return wrap('--flx-skew-x', angle(value, negative));
3840
+ });
3841
+ reg.dynamicRule('skew-y', function (_ref3) {
3842
+ var value = _ref3.value,
3843
+ negative = _ref3.negative;
3844
+ return wrap('--flx-skew-y', angle(value, negative));
3845
+ });
3846
+ reg.dynamicRule('scale', function (_ref4) {
3847
+ var value = _ref4.value,
3848
+ negative = _ref4.negative;
3849
+ var v = scaleVal(value, negative);
3850
+ return v ? [decl('--flx-scale-x', v), decl('--flx-scale-y', v), decl('transform', TRANSFORM)] : null;
3851
+ });
3852
+ reg.dynamicRule('scale-x', function (_ref5) {
3853
+ var value = _ref5.value,
3854
+ negative = _ref5.negative;
3855
+ return wrap('--flx-scale-x', scaleVal(value, negative));
3856
+ });
3857
+ reg.dynamicRule('scale-y', function (_ref6) {
3858
+ var value = _ref6.value,
3859
+ negative = _ref6.negative;
3860
+ return wrap('--flx-scale-y', scaleVal(value, negative));
3861
+ });
3862
+ reg.dynamicRule('translate-x', function (_ref7) {
3863
+ var value = _ref7.value,
3864
+ negative = _ref7.negative,
3865
+ theme = _ref7.theme;
3866
+ return wrap('--flx-translate-x', sizeValue(value, theme, {
3867
+ negative: negative
3868
+ }));
3869
+ });
3870
+ reg.dynamicRule('translate-y', function (_ref8) {
3871
+ var value = _ref8.value,
3872
+ negative = _ref8.negative,
3873
+ theme = _ref8.theme;
3874
+ return wrap('--flx-translate-y', sizeValue(value, theme, {
3875
+ negative: negative
3876
+ }));
3877
+ });
3878
+ reg.rule('transform-none', [decl('transform', 'none')]);
3879
+ reg.rule('transform-gpu', [decl('transform', TRANSFORM_GPU)]);
3880
+ reg.rule('transform-cpu', [decl('transform', TRANSFORM)]);
3881
+ keywords(reg, 'origin', 'transform-origin', {
3882
+ center: 'center',
3883
+ top: 'top',
3884
+ 'top-right': 'top right',
3885
+ right: 'right',
3886
+ 'bottom-right': 'bottom right',
3887
+ bottom: 'bottom',
3888
+ 'bottom-left': 'bottom left',
3889
+ left: 'left',
3890
+ 'top-left': 'top left'
3891
+ });
3892
+ }
3893
+ function wrap(prop, val) {
3894
+ return val ? compose(prop, val) : null;
3895
+ }
3896
+ function angle(value, negative) {
3897
+ if (!value) return null;
3898
+ if (value.kind === 'arbitrary') return negative ? "calc(".concat(value.value, " * -1)") : value.value;
3899
+ return "".concat(negative ? '-' : '').concat(value.value, "deg");
3900
+ }
3901
+ function scaleVal(value, negative) {
3902
+ if (!value) return null;
3903
+ if (value.kind === 'arbitrary') return negative ? "calc(".concat(value.value, " * -1)") : value.value;
3904
+ if (!/^\d+$/.test(value.value)) return null;
3905
+ var n = (negative ? -1 : 1) * (+value.value / 100);
3906
+ return "".concat(n);
3907
+ }
3908
+
3909
+ var DEFAULT_EASE = 'cubic-bezier(0.4, 0, 0.2, 1)';
3910
+ function registerTransitions(reg) {
3911
+ // `transition` (+ named property groups) also seeds a sensible default duration
3912
+ // and timing function, matching what a bare `transition` is expected to animate.
3913
+ reg.dynamicRule('transition', function (_ref) {
3914
+ var _PROPERTY_GROUPS$valu;
3915
+ var value = _ref.value;
3916
+ var property = value === null ? 'color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter' : (_PROPERTY_GROUPS$valu = PROPERTY_GROUPS[value.value]) !== null && _PROPERTY_GROUPS$valu !== void 0 ? _PROPERTY_GROUPS$valu : value.kind === 'arbitrary' ? value.value : null;
3917
+ if (property === null) return null;
3918
+ if (property === 'none') return [decl('transition-property', 'none')];
3919
+ return [decl('transition-property', property), decl('transition-timing-function', DEFAULT_EASE), decl('transition-duration', '150ms')];
3920
+ });
3921
+ reg.dynamicRule('duration', function (_ref2) {
3922
+ var value = _ref2.value;
3923
+ return time('transition-duration', value);
3924
+ });
3925
+ reg.dynamicRule('delay', function (_ref3) {
3926
+ var value = _ref3.value;
3927
+ return time('transition-delay', value);
3928
+ });
3929
+ keywords(reg, 'ease', 'transition-timing-function', {
3930
+ linear: 'linear',
3931
+ "in": 'cubic-bezier(0.4, 0, 1, 1)',
3932
+ out: 'cubic-bezier(0, 0, 0.2, 1)',
3933
+ 'in-out': DEFAULT_EASE
3934
+ });
3935
+ keywords(reg, 'animate', 'animation', {
3936
+ none: 'none',
3937
+ spin: 'spin 1s linear infinite',
3938
+ ping: 'ping 1s cubic-bezier(0, 0, 0.2, 1) infinite',
3939
+ pulse: 'pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite',
3940
+ bounce: 'bounce 1s infinite'
3941
+ });
3942
+ keywords(reg, 'will-change', 'will-change', {
3943
+ auto: 'auto',
3944
+ scroll: 'scroll-position',
3945
+ contents: 'contents',
3946
+ transform: 'transform'
3947
+ });
3948
+ }
3949
+ var PROPERTY_GROUPS = {
3950
+ none: 'none',
3951
+ all: 'all',
3952
+ colors: 'color, background-color, border-color, text-decoration-color, fill, stroke',
3953
+ opacity: 'opacity',
3954
+ shadow: 'box-shadow',
3955
+ transform: 'transform'
3956
+ };
3957
+ function time(prop, value) {
3958
+ if (!value) return null;
3959
+ if (value.kind === 'arbitrary') return [decl(prop, value.value)];
3960
+ if (/^\d+$/.test(value.value)) return [decl(prop, "".concat(value.value, "ms"))];
3961
+ return null;
3962
+ }
3963
+
3604
3964
  function registerTypography(reg) {
3605
3965
  // `text-` is overloaded: a colour token, a font-size token, or an arbitrary of
3606
3966
  // either kind. Alignment/overflow keywords (`text-center`, `text-ellipsis`) are
@@ -3742,6 +4102,10 @@ function registerUtilities(reg) {
3742
4102
  registerBackgrounds(reg);
3743
4103
  registerBorders(reg);
3744
4104
  registerEffects(reg);
4105
+ registerTransforms(reg);
4106
+ registerTransitions(reg);
4107
+ registerFilters(reg);
4108
+ registerGradients(reg);
3745
4109
  }
3746
4110
 
3747
4111
  function registerVariants(reg) {
@@ -3778,16 +4142,7 @@ function registerVariants(reg) {
3778
4142
  reg.variant('ltr', {
3779
4143
  selector: '&:where([dir="ltr"], [dir="ltr"] *)'
3780
4144
  });
3781
- for (var _i4 = 0, _arr = ['sm', 'md', 'lg', 'xl', '2xl']; _i4 < _arr.length; _i4++) {
3782
- var bp = _arr[_i4];
3783
- var min = reg.theme.get("--breakpoint-".concat(bp));
3784
- if (min) reg.variant(bp, {
3785
- atRule: {
3786
- name: 'media',
3787
- params: "(min-width: ".concat(min, ")")
3788
- }
3789
- });
3790
- }
4145
+ registerBreakpointVariants(reg);
3791
4146
 
3792
4147
  // `max-md`, `min-lg` resolve the named breakpoint from the theme; `max-[600px]`
3793
4148
  // takes the width verbatim. `max-*` overrides the `max-w`/`max-h` utilities here
@@ -3839,6 +4194,23 @@ function registerVariants(reg) {
3839
4194
  } : null;
3840
4195
  });
3841
4196
  }
4197
+
4198
+ // The named breakpoints (`sm:`/`md:`/…) are static variants, so their media params
4199
+ // bake the theme value at registration. A `@theme { --breakpoint-md: … }` override
4200
+ // loaded later wouldn't reach them — so compile() re-runs this after loadTheme to
4201
+ // pick up overrides. (The dynamic `min-*`/`max-*` already resolve at apply time.)
4202
+ function registerBreakpointVariants(reg) {
4203
+ for (var _i4 = 0, _arr = ['sm', 'md', 'lg', 'xl', '2xl']; _i4 < _arr.length; _i4++) {
4204
+ var bp = _arr[_i4];
4205
+ var min = reg.theme.get("--breakpoint-".concat(bp));
4206
+ if (min) reg.variant(bp, {
4207
+ atRule: {
4208
+ name: 'media',
4209
+ params: "(min-width: ".concat(min, ")")
4210
+ }
4211
+ });
4212
+ }
4213
+ }
3842
4214
  function mediaWidth(feature, value) {
3843
4215
  return value ? {
3844
4216
  atRule: {
@@ -3938,13 +4310,26 @@ function scanAtoms(source) {
3938
4310
  continue;
3939
4311
  }
3940
4312
  var j = i;
3941
- var depth = 0;
4313
+ var bracket = 0;
4314
+ var paren = 0;
3942
4315
  while (j < n) {
3943
4316
  var c = source[j];
3944
- if (c === '[') depth++;else if (c === ']') {
3945
- if (depth === 0) break;
3946
- depth--;
3947
- } else if (depth === 0 && BOUNDARY.has(c)) break;
4317
+ if (c === '[') {
4318
+ bracket++;
4319
+ } else if (c === ']') {
4320
+ if (bracket === 0) break;
4321
+ bracket--;
4322
+ } else if (bracket > 0) ; else if (c === '(') {
4323
+ // Keep a shorthand paren whole (`bg-(--brand)`, `text-(length:--x)`), but
4324
+ // treat a plain function call (`clsx(…)`) as a boundary so its args scan.
4325
+ if (paren === 0 && !isShorthandParen(source, j)) break;
4326
+ paren++;
4327
+ } else if (c === ')') {
4328
+ if (paren === 0) break;
4329
+ paren--;
4330
+ } else if (paren === 0 && BOUNDARY.has(c)) {
4331
+ break;
4332
+ }
3948
4333
  j++;
3949
4334
  }
3950
4335
  add(found, source.slice(i, j));
@@ -3952,6 +4337,15 @@ function scanAtoms(source) {
3952
4337
  }
3953
4338
  return _toConsumableArray(found);
3954
4339
  }
4340
+
4341
+ // A `(` opens a class shorthand when it holds a CSS var (`(--brand)`) or a typed
4342
+ // value (`(length:--x)`) — otherwise it's a function call and ends the token.
4343
+ function isShorthandParen(s, open) {
4344
+ if (s[open + 1] === '-' && s[open + 2] === '-') return true;
4345
+ var k = open + 1;
4346
+ while (k < s.length && /[a-zA-Z-]/.test(s[k])) k++;
4347
+ return k > open + 1 && s[k] === ':';
4348
+ }
3955
4349
  function add(found, token) {
3956
4350
  // Trailing sentence/markup punctuation is never part of a class.
3957
4351
  var cleaned = token.replace(/[.,;:]+$/, '');
@@ -4208,6 +4602,7 @@ function transform(input) {
4208
4602
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4209
4603
  var reg = (_options$registry = options.registry) !== null && _options$registry !== void 0 ? _options$registry : createRegistry();
4210
4604
  loadTheme(input, reg.theme);
4605
+ registerBreakpointVariants(reg); // pick up any @theme breakpoint overrides
4211
4606
  loadDirectives(input, reg);
4212
4607
  var classes = new Set((_options$classes = options.classes) !== null && _options$classes !== void 0 ? _options$classes : []);
4213
4608
  var _iterator = _createForOfIteratorHelper((_options$sources = options.sources) !== null && _options$sources !== void 0 ? _options$sources : []),
@@ -4378,6 +4773,9 @@ function compile(input) {
4378
4773
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4379
4774
  var reg = (_options$registry = options.registry) !== null && _options$registry !== void 0 ? _options$registry : createRegistry();
4380
4775
  loadTheme(input, reg.theme);
4776
+ // Re-seed the named breakpoint variants so a `@theme` breakpoint override reaches
4777
+ // `sm:`/`md:`/… (they baked the default value at registry-creation time).
4778
+ registerBreakpointVariants(reg);
4381
4779
  loadDirectives(input, reg);
4382
4780
  var classes = new Set((_options$classes = options.classes) !== null && _options$classes !== void 0 ? _options$classes : []);
4383
4781
  var _iterator2 = _createForOfIteratorHelper((_options$sources = options.sources) !== null && _options$sources !== void 0 ? _options$sources : []),
@@ -4476,5 +4874,5 @@ function compile(input) {
4476
4874
  };
4477
4875
  }
4478
4876
 
4479
- export { Registry, SPECIAL_COLORS, Theme, atRule, collectVarRefs, colorValue, compile, compileAtom, compileClasses, createRegistry, decl, decodeUnderscores, defaultTheme, emitTheme, emitUiTheme, escapeClass, keywords, loadDirectives, loadTheme, parseAtom, parseSources, parseVariant, props, raw, registerUtilities, registerVariants, resolveSourceFiles, rule, scanAtoms, scanSourceFiles, sizeValue, splitAtTopLevel, statics, stringify, stringifyWithMap, transform, uiTokenBridges };
4877
+ export { Registry, SPECIAL_COLORS, Theme, atRule, collectVarRefs, colorValue, compile, compileAtom, compileClasses, createRegistry, decl, decodeUnderscores, defaultTheme, emitTheme, emitUiTheme, escapeClass, keywords, loadDirectives, loadTheme, parseAtom, parseSources, parseVariant, props, raw, registerBreakpointVariants, registerUtilities, registerVariants, resolveSourceFiles, rule, scanAtoms, scanSourceFiles, sizeValue, splitAtTopLevel, statics, stringify, stringifyWithMap, transform, uiTokenBridges };
4480
4878
  //# sourceMappingURL=index.mjs.map