@udixio/theme 2.1.7 → 2.1.9

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/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## 2.1.9 (2026-01-09)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **theme:** refactor `udixio` variant for improved clarity and maintainability ([0c1266d](https://github.com/Udixio/UI/commit/0c1266d))
6
+
7
+ ### ❤️ Thank You
8
+
9
+ - Joël VIGREUX
10
+
11
+ ## 2.1.8 (2026-01-07)
12
+
13
+ ### 🩹 Fixes
14
+
15
+ - **theme:** simplify tone adjustment logic for `udixio` variant ([8f90d7f](https://github.com/Udixio/UI/commit/8f90d7f))
16
+
17
+ ### ❤️ Thank You
18
+
19
+ - Joël VIGREUX
20
+
1
21
  ## 2.1.7 (2026-01-07)
2
22
 
3
23
  This was a version bump only for @udixio/theme to align it with other projects, there were no code changes.
package/dist/bin.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  const commander = require("commander");
3
3
  const chokidar = require("chokidar");
4
4
  const chalk = require("chalk");
5
- const loadFromPath = require("./load-from-path-C3UAcZqv.cjs");
5
+ const loadFromPath = require("./load-from-path-BCkiZx6_.cjs");
6
6
  const program = new commander.Command();
7
7
  async function runOnce(configPath) {
8
8
  try {
package/dist/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Command } from "commander";
2
2
  import chokidar from "chokidar";
3
3
  import chalk from "chalk";
4
- import { l as loadFromPath } from "./load-from-path-BCh7ss_Z.js";
4
+ import { l as loadFromPath } from "./load-from-path-C4axFso4.js";
5
5
  const program = new Command();
6
6
  async function runOnce(configPath) {
7
7
  try {
package/dist/browser.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const loader = require("./loader-BbjdPvAo.cjs");
4
- const font_plugin = require("./font.plugin-CkYgSR9K.cjs");
3
+ const loader = require("./loader-1Pp2rd0P.cjs");
4
+ const font_plugin = require("./font.plugin-B0SKfA9r.cjs");
5
5
  exports.API = loader.API;
6
6
  exports.AppContainer = loader.AppContainer;
7
7
  exports.AppModule = loader.AppModule;
package/dist/browser.js CHANGED
@@ -1,5 +1,5 @@
1
- import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader-C-8QkFag.js";
2
- import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-BU5iUqHq.js";
1
+ import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader--tJzL1CC.js";
2
+ import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-BReTQTWQ.js";
3
3
  export {
4
4
  A as API,
5
5
  a as AppContainer,
@@ -2,7 +2,7 @@
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- require("./loader-BbjdPvAo.cjs");
5
+ require("./loader-1Pp2rd0P.cjs");
6
6
  class PluginAbstract {
7
7
  constructor(options) {
8
8
  __publicField(this, "options");
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import "./loader-C-8QkFag.js";
4
+ import "./loader--tJzL1CC.js";
5
5
  class PluginAbstract {
6
6
  constructor(options) {
7
7
  __publicField(this, "options");
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
22
  mod
23
23
  ));
24
- const loader = require("./loader-BbjdPvAo.cjs");
24
+ const loader = require("./loader-1Pp2rd0P.cjs");
25
25
  const fs = require("node:fs");
26
26
  var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
27
27
  function _interopNamespaceDefault(e) {
@@ -44,7 +44,7 @@ const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
44
44
  async function resolveConfig(configPath = "./theme.config") {
45
45
  const { createJiti } = await import("jiti");
46
46
  const { resolve } = await import("pathe");
47
- const jiti = createJiti(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("load-from-path-C3UAcZqv.cjs", document.baseURI).href, {
47
+ const jiti = createJiti(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("load-from-path-BCkiZx6_.cjs", document.baseURI).href, {
48
48
  debug: process.env.NODE_ENV === "development",
49
49
  fsCache: true,
50
50
  interopDefault: true
@@ -1,4 +1,4 @@
1
- import { p as loader } from "./loader-C-8QkFag.js";
1
+ import { p as loader } from "./loader--tJzL1CC.js";
2
2
  import * as fs from "node:fs";
3
3
  async function resolveConfig(configPath = "./theme.config") {
4
4
  const { createJiti } = await import("jiti");
@@ -3254,7 +3254,7 @@ const udixioVariant = variant({
3254
3254
  });
3255
3255
  return colors;
3256
3256
  },
3257
- colors: ({ colors, context: c, palettes }) => {
3257
+ colors: ({ colors, context: ctx, palettes }) => {
3258
3258
  const getColor = (key) => {
3259
3259
  return colors.get(key);
3260
3260
  };
@@ -3265,7 +3265,7 @@ const udixioVariant = variant({
3265
3265
  surface: {
3266
3266
  palette: () => palettes.get("neutral"),
3267
3267
  tone: () => {
3268
- if (c.isDark) {
3268
+ if (ctx.isDark) {
3269
3269
  return 2;
3270
3270
  } else {
3271
3271
  return 99;
@@ -3273,76 +3273,48 @@ const udixioVariant = variant({
3273
3273
  },
3274
3274
  isBackground: true
3275
3275
  },
3276
- // surfaceDim: {
3277
- // palette: () => palettes.get('neutral'),
3278
- // tone: () => {
3279
- // if (c.isDark) {
3280
- // return 4;
3281
- // } else {
3282
- // if (Hct.isYellow(palettes.get('neutral').hue)) {
3283
- // return 90;
3284
- // } else if (c.variant.name === 'vibrant') {
3285
- // return 85;
3286
- // } else {
3287
- // return 87;
3288
- // }
3289
- // }
3290
- // },
3291
- // isBackground: true,
3292
- // chromaMultiplier: () => {
3293
- // if (!c.isDark) {
3294
- // if (c.variant.name === 'neutral') {
3295
- // return 2.5;
3296
- // } else if (c.variant.name === 'tonalSpot') {
3297
- // return 1.7;
3298
- // } else if (c.variant.name === 'expressive') {
3299
- // return Hct.isYellow(palettes.get('neutral').hue) ? 2.7 : 1.75;
3300
- // } else if (c.variant.name === 'vibrant') {
3301
- // return 1.36;
3302
- // }
3303
- // }
3304
- // return 1;
3305
- // },
3306
- // },
3307
- // surfaceBright: {
3308
- // palette: () => palettes.get('neutral'),
3309
- // tone: () => {
3310
- // if (c.isDark) {
3311
- // return 18;
3312
- // } else {
3313
- // if (Hct.isYellow(palettes.get('neutral').hue)) {
3314
- // return 99;
3315
- // } else if (c.variant.name === 'vibrant') {
3316
- // return 97;
3317
- // } else {
3318
- // return 98;
3319
- // }
3320
- // }
3321
- // },
3322
- // isBackground: true,
3323
- // chromaMultiplier: () => {
3324
- // if (c.isDark) {
3325
- // if (c.variant.name === 'neutral') {
3326
- // return 2.5;
3327
- // } else if (c.variant.name === 'tonalSpot') {
3328
- // return 1.7;
3329
- // } else if (c.variant.name === 'expressive') {
3330
- // return Hct.isYellow(palettes.get('neutral').hue) ? 2.7 : 1.75;
3331
- // } else if (c.variant.name === 'vibrant') {
3332
- // return 1.36;
3333
- // }
3334
- // }
3335
- // return 1;
3336
- // },
3337
- // },
3276
+ surfaceDim: {
3277
+ palette: () => palettes.get("neutral"),
3278
+ tone: () => {
3279
+ if (ctx.isDark) {
3280
+ return surfaceContainerTone(0.5, { palettes, context: ctx });
3281
+ } else {
3282
+ return surfaceContainerTone(5, { palettes, context: ctx });
3283
+ }
3284
+ },
3285
+ isBackground: true,
3286
+ chromaMultiplier: () => {
3287
+ if (!ctx.isDark) {
3288
+ return 1.7;
3289
+ }
3290
+ return 1;
3291
+ }
3292
+ },
3293
+ surfaceBright: {
3294
+ palette: () => palettes.get("neutral"),
3295
+ tone: () => {
3296
+ if (ctx.isDark) {
3297
+ return surfaceContainerTone(5, { palettes, context: ctx });
3298
+ } else {
3299
+ return surfaceContainerTone(0.5, { palettes, context: ctx });
3300
+ }
3301
+ },
3302
+ isBackground: true,
3303
+ chromaMultiplier: () => {
3304
+ if (ctx.isDark) {
3305
+ return 1.7;
3306
+ }
3307
+ return 1;
3308
+ }
3309
+ },
3338
3310
  surfaceContainerLowest: {
3339
3311
  palette: () => palettes.get("neutral"),
3340
- tone: () => surfaceContainerTone(0, { palettes, context: c }),
3312
+ tone: () => surfaceContainerTone(0, { palettes, context: ctx }),
3341
3313
  isBackground: true
3342
3314
  },
3343
3315
  surfaceContainerLow: {
3344
3316
  palette: () => palettes.get("neutral"),
3345
- tone: () => surfaceContainerTone(1, { palettes, context: c }),
3317
+ tone: () => surfaceContainerTone(1, { palettes, context: ctx }),
3346
3318
  isBackground: true,
3347
3319
  chromaMultiplier: () => {
3348
3320
  return 1.25;
@@ -3350,7 +3322,7 @@ const udixioVariant = variant({
3350
3322
  },
3351
3323
  surfaceContainer: {
3352
3324
  palette: () => palettes.get("neutral"),
3353
- tone: () => surfaceContainerTone(2, { palettes, context: c }),
3325
+ tone: () => surfaceContainerTone(2, { palettes, context: ctx }),
3354
3326
  isBackground: true,
3355
3327
  chromaMultiplier: () => {
3356
3328
  return 1.4;
@@ -3358,7 +3330,7 @@ const udixioVariant = variant({
3358
3330
  },
3359
3331
  surfaceContainerHigh: {
3360
3332
  palette: () => palettes.get("neutral"),
3361
- tone: () => surfaceContainerTone(3, { palettes, context: c }),
3333
+ tone: () => surfaceContainerTone(3, { palettes, context: ctx }),
3362
3334
  isBackground: true,
3363
3335
  chromaMultiplier: () => {
3364
3336
  return 1.5;
@@ -3366,7 +3338,7 @@ const udixioVariant = variant({
3366
3338
  },
3367
3339
  surfaceContainerHighest: {
3368
3340
  palette: () => palettes.get("neutral"),
3369
- tone: () => surfaceContainerTone(4, { palettes, context: c }),
3341
+ tone: () => surfaceContainerTone(4, { palettes, context: ctx }),
3370
3342
  isBackground: true,
3371
3343
  chromaMultiplier: () => {
3372
3344
  return 1.7;
@@ -3375,28 +3347,28 @@ const udixioVariant = variant({
3375
3347
  onSurface: {
3376
3348
  palette: () => palettes.get("neutral"),
3377
3349
  tone: () => {
3378
- return getInitialToneFromBackground(highestSurface(c, colors));
3350
+ return getInitialToneFromBackground(highestSurface(ctx, colors));
3379
3351
  },
3380
3352
  chromaMultiplier: () => {
3381
3353
  return 1.7;
3382
3354
  },
3383
- background: () => highestSurface(c, colors),
3384
- contrastCurve: () => c.isDark ? getCurve(11) : getCurve(9)
3355
+ background: () => highestSurface(ctx, colors),
3356
+ contrastCurve: () => ctx.isDark ? getCurve(11) : getCurve(9)
3385
3357
  },
3386
3358
  onSurfaceVariant: {
3387
3359
  palette: () => palettes.get("neutralVariant"),
3388
3360
  chromaMultiplier: () => {
3389
3361
  return 1.7;
3390
3362
  },
3391
- background: () => highestSurface(c, colors),
3392
- contrastCurve: () => c.isDark ? getCurve(6) : getCurve(4.5)
3363
+ background: () => highestSurface(ctx, colors),
3364
+ contrastCurve: () => ctx.isDark ? getCurve(6) : getCurve(4.5)
3393
3365
  },
3394
3366
  outline: {
3395
3367
  palette: () => palettes.get("neutralVariant"),
3396
3368
  chromaMultiplier: () => {
3397
3369
  return 1.7;
3398
3370
  },
3399
- background: () => highestSurface(c, colors),
3371
+ background: () => highestSurface(ctx, colors),
3400
3372
  contrastCurve: () => getCurve(3)
3401
3373
  },
3402
3374
  outlineVariant: {
@@ -3404,7 +3376,7 @@ const udixioVariant = variant({
3404
3376
  chromaMultiplier: () => {
3405
3377
  return 1.7;
3406
3378
  },
3407
- background: () => highestSurface(c, colors),
3379
+ background: () => highestSurface(ctx, colors),
3408
3380
  contrastCurve: () => getCurve(1.5)
3409
3381
  },
3410
3382
  inverseSurface: {
@@ -3414,7 +3386,7 @@ const udixioVariant = variant({
3414
3386
  },
3415
3387
  inverseOnSurface: {
3416
3388
  palette: () => palettes.get("neutral"),
3417
- tone: () => c.isDark ? 20 : 95,
3389
+ tone: () => ctx.isDark ? 20 : 95,
3418
3390
  background: () => colors.get("inverseSurface"),
3419
3391
  contrastCurve: () => getCurve(7)
3420
3392
  },
@@ -3424,10 +3396,10 @@ const udixioVariant = variant({
3424
3396
  primary: {
3425
3397
  palette: () => palettes.get("primary"),
3426
3398
  tone: () => {
3427
- return c.sourceColor.tone;
3399
+ return ctx.sourceColor.tone;
3428
3400
  },
3429
3401
  isBackground: true,
3430
- background: () => highestSurface(c, colors),
3402
+ background: () => highestSurface(ctx, colors),
3431
3403
  contrastCurve: () => getCurve(4.5),
3432
3404
  adjustTone: () => () => {
3433
3405
  const surfaceTone = colors.get("surface").getTone();
@@ -3477,19 +3449,19 @@ const udixioVariant = variant({
3477
3449
  primaryContainer: {
3478
3450
  palette: () => palettes.get("primary"),
3479
3451
  tone: () => {
3480
- return c.isDark ? tMinC(palettes.get("primary"), 35, 93) : tMaxC(palettes.get("primary"), 0, 90);
3452
+ return ctx.isDark ? tMinC(palettes.get("primary"), 35, 93) : tMaxC(palettes.get("primary"), 0, 90);
3481
3453
  },
3482
3454
  isBackground: true,
3483
- background: () => highestSurface(c, colors),
3484
- adjustTone: () => c.variant.name == "fidelity" ? toneDeltaPair(
3455
+ background: () => highestSurface(ctx, colors),
3456
+ adjustTone: () => toneDeltaPair(
3485
3457
  colors.get("primary"),
3486
3458
  colors.get("primaryContainer"),
3487
3459
  15,
3488
3460
  "relative_darker",
3489
3461
  true,
3490
3462
  "farther"
3491
- ) : void 0,
3492
- contrastCurve: () => c.contrastLevel > 0 ? getCurve(1.5) : void 0
3463
+ ),
3464
+ contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
3493
3465
  },
3494
3466
  onPrimaryContainer: {
3495
3467
  palette: () => palettes.get("primary"),
@@ -3550,10 +3522,10 @@ const udixioVariant = variant({
3550
3522
  secondary: {
3551
3523
  palette: () => palettes.get("secondary"),
3552
3524
  tone: () => {
3553
- return c.isDark ? 80 : tMaxC(palettes.get("secondary"));
3525
+ return ctx.isDark ? 80 : tMaxC(palettes.get("secondary"));
3554
3526
  },
3555
3527
  isBackground: true,
3556
- background: () => highestSurface(c, colors),
3528
+ background: () => highestSurface(ctx, colors),
3557
3529
  contrastCurve: () => getCurve(4.5),
3558
3530
  adjustTone: () => toneDeltaPair(
3559
3531
  getColor("secondaryContainer"),
@@ -3594,12 +3566,12 @@ const udixioVariant = variant({
3594
3566
  secondaryContainer: {
3595
3567
  palette: () => palettes.get("secondary"),
3596
3568
  tone: () => {
3597
- return c.isDark ? 25 : 90;
3569
+ return ctx.isDark ? 25 : 90;
3598
3570
  },
3599
3571
  isBackground: true,
3600
- background: () => highestSurface(c, colors),
3572
+ background: () => highestSurface(ctx, colors),
3601
3573
  adjustTone: () => void 0,
3602
- contrastCurve: () => c.contrastLevel > 0 ? getCurve(1.5) : void 0
3574
+ contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
3603
3575
  },
3604
3576
  onSecondaryContainer: {
3605
3577
  palette: () => palettes.get("secondary"),
@@ -3654,10 +3626,10 @@ const udixioVariant = variant({
3654
3626
  tertiary: {
3655
3627
  palette: () => palettes.get("tertiary"),
3656
3628
  tone: () => {
3657
- return c.isDark ? tMaxC(palettes.get("tertiary"), 0, 98) : tMaxC(palettes.get("tertiary"));
3629
+ return ctx.isDark ? tMaxC(palettes.get("tertiary"), 0, 98) : tMaxC(palettes.get("tertiary"));
3658
3630
  },
3659
3631
  isBackground: true,
3660
- background: () => highestSurface(c, colors),
3632
+ background: () => highestSurface(ctx, colors),
3661
3633
  contrastCurve: () => getCurve(4.5),
3662
3634
  adjustTone: () => toneDeltaPair(
3663
3635
  getColor("tertiaryContainer"),
@@ -3698,12 +3670,12 @@ const udixioVariant = variant({
3698
3670
  tertiaryContainer: {
3699
3671
  palette: () => palettes.get("tertiary"),
3700
3672
  tone: () => {
3701
- return tMaxC(palettes.get("tertiary"), 0, c.isDark ? 93 : 100);
3673
+ return tMaxC(palettes.get("tertiary"), 0, ctx.isDark ? 93 : 100);
3702
3674
  },
3703
3675
  isBackground: true,
3704
- background: () => highestSurface(c, colors),
3676
+ background: () => highestSurface(ctx, colors),
3705
3677
  adjustTone: () => void 0,
3706
- contrastCurve: () => c.contrastLevel > 0 ? getCurve(1.5) : void 0
3678
+ contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
3707
3679
  },
3708
3680
  onTertiaryContainer: {
3709
3681
  palette: () => palettes.get("tertiary"),
@@ -3758,10 +3730,10 @@ const udixioVariant = variant({
3758
3730
  error: {
3759
3731
  palette: () => palettes.get("error"),
3760
3732
  tone: () => {
3761
- return c.isDark ? tMinC(palettes.get("error"), 0, 98) : tMaxC(palettes.get("error"));
3733
+ return ctx.isDark ? tMinC(palettes.get("error"), 0, 98) : tMaxC(palettes.get("error"));
3762
3734
  },
3763
3735
  isBackground: true,
3764
- background: () => highestSurface(c, colors),
3736
+ background: () => highestSurface(ctx, colors),
3765
3737
  contrastCurve: () => getCurve(4.5),
3766
3738
  adjustTone: () => toneDeltaPair(
3767
3739
  colors.get("errorContainer"),
@@ -3796,12 +3768,12 @@ const udixioVariant = variant({
3796
3768
  errorContainer: {
3797
3769
  palette: () => palettes.get("error"),
3798
3770
  tone: () => {
3799
- return c.isDark ? tMinC(palettes.get("error"), 30, 93) : tMaxC(palettes.get("error"), 0, 90);
3771
+ return ctx.isDark ? tMinC(palettes.get("error"), 30, 93) : tMaxC(palettes.get("error"), 0, 90);
3800
3772
  },
3801
3773
  isBackground: true,
3802
- background: () => highestSurface(c, colors),
3774
+ background: () => highestSurface(ctx, colors),
3803
3775
  adjustTone: () => void 0,
3804
- contrastCurve: () => c.contrastLevel > 0 ? getCurve(1.5) : void 0
3776
+ contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
3805
3777
  },
3806
3778
  onErrorContainer: {
3807
3779
  palette: () => palettes.get("error"),
@@ -3255,7 +3255,7 @@ const udixioVariant = variant({
3255
3255
  });
3256
3256
  return colors;
3257
3257
  },
3258
- colors: ({ colors, context: c, palettes }) => {
3258
+ colors: ({ colors, context: ctx, palettes }) => {
3259
3259
  const getColor = (key) => {
3260
3260
  return colors.get(key);
3261
3261
  };
@@ -3266,7 +3266,7 @@ const udixioVariant = variant({
3266
3266
  surface: {
3267
3267
  palette: () => palettes.get("neutral"),
3268
3268
  tone: () => {
3269
- if (c.isDark) {
3269
+ if (ctx.isDark) {
3270
3270
  return 2;
3271
3271
  } else {
3272
3272
  return 99;
@@ -3274,76 +3274,48 @@ const udixioVariant = variant({
3274
3274
  },
3275
3275
  isBackground: true
3276
3276
  },
3277
- // surfaceDim: {
3278
- // palette: () => palettes.get('neutral'),
3279
- // tone: () => {
3280
- // if (c.isDark) {
3281
- // return 4;
3282
- // } else {
3283
- // if (Hct.isYellow(palettes.get('neutral').hue)) {
3284
- // return 90;
3285
- // } else if (c.variant.name === 'vibrant') {
3286
- // return 85;
3287
- // } else {
3288
- // return 87;
3289
- // }
3290
- // }
3291
- // },
3292
- // isBackground: true,
3293
- // chromaMultiplier: () => {
3294
- // if (!c.isDark) {
3295
- // if (c.variant.name === 'neutral') {
3296
- // return 2.5;
3297
- // } else if (c.variant.name === 'tonalSpot') {
3298
- // return 1.7;
3299
- // } else if (c.variant.name === 'expressive') {
3300
- // return Hct.isYellow(palettes.get('neutral').hue) ? 2.7 : 1.75;
3301
- // } else if (c.variant.name === 'vibrant') {
3302
- // return 1.36;
3303
- // }
3304
- // }
3305
- // return 1;
3306
- // },
3307
- // },
3308
- // surfaceBright: {
3309
- // palette: () => palettes.get('neutral'),
3310
- // tone: () => {
3311
- // if (c.isDark) {
3312
- // return 18;
3313
- // } else {
3314
- // if (Hct.isYellow(palettes.get('neutral').hue)) {
3315
- // return 99;
3316
- // } else if (c.variant.name === 'vibrant') {
3317
- // return 97;
3318
- // } else {
3319
- // return 98;
3320
- // }
3321
- // }
3322
- // },
3323
- // isBackground: true,
3324
- // chromaMultiplier: () => {
3325
- // if (c.isDark) {
3326
- // if (c.variant.name === 'neutral') {
3327
- // return 2.5;
3328
- // } else if (c.variant.name === 'tonalSpot') {
3329
- // return 1.7;
3330
- // } else if (c.variant.name === 'expressive') {
3331
- // return Hct.isYellow(palettes.get('neutral').hue) ? 2.7 : 1.75;
3332
- // } else if (c.variant.name === 'vibrant') {
3333
- // return 1.36;
3334
- // }
3335
- // }
3336
- // return 1;
3337
- // },
3338
- // },
3277
+ surfaceDim: {
3278
+ palette: () => palettes.get("neutral"),
3279
+ tone: () => {
3280
+ if (ctx.isDark) {
3281
+ return surfaceContainerTone(0.5, { palettes, context: ctx });
3282
+ } else {
3283
+ return surfaceContainerTone(5, { palettes, context: ctx });
3284
+ }
3285
+ },
3286
+ isBackground: true,
3287
+ chromaMultiplier: () => {
3288
+ if (!ctx.isDark) {
3289
+ return 1.7;
3290
+ }
3291
+ return 1;
3292
+ }
3293
+ },
3294
+ surfaceBright: {
3295
+ palette: () => palettes.get("neutral"),
3296
+ tone: () => {
3297
+ if (ctx.isDark) {
3298
+ return surfaceContainerTone(5, { palettes, context: ctx });
3299
+ } else {
3300
+ return surfaceContainerTone(0.5, { palettes, context: ctx });
3301
+ }
3302
+ },
3303
+ isBackground: true,
3304
+ chromaMultiplier: () => {
3305
+ if (ctx.isDark) {
3306
+ return 1.7;
3307
+ }
3308
+ return 1;
3309
+ }
3310
+ },
3339
3311
  surfaceContainerLowest: {
3340
3312
  palette: () => palettes.get("neutral"),
3341
- tone: () => surfaceContainerTone(0, { palettes, context: c }),
3313
+ tone: () => surfaceContainerTone(0, { palettes, context: ctx }),
3342
3314
  isBackground: true
3343
3315
  },
3344
3316
  surfaceContainerLow: {
3345
3317
  palette: () => palettes.get("neutral"),
3346
- tone: () => surfaceContainerTone(1, { palettes, context: c }),
3318
+ tone: () => surfaceContainerTone(1, { palettes, context: ctx }),
3347
3319
  isBackground: true,
3348
3320
  chromaMultiplier: () => {
3349
3321
  return 1.25;
@@ -3351,7 +3323,7 @@ const udixioVariant = variant({
3351
3323
  },
3352
3324
  surfaceContainer: {
3353
3325
  palette: () => palettes.get("neutral"),
3354
- tone: () => surfaceContainerTone(2, { palettes, context: c }),
3326
+ tone: () => surfaceContainerTone(2, { palettes, context: ctx }),
3355
3327
  isBackground: true,
3356
3328
  chromaMultiplier: () => {
3357
3329
  return 1.4;
@@ -3359,7 +3331,7 @@ const udixioVariant = variant({
3359
3331
  },
3360
3332
  surfaceContainerHigh: {
3361
3333
  palette: () => palettes.get("neutral"),
3362
- tone: () => surfaceContainerTone(3, { palettes, context: c }),
3334
+ tone: () => surfaceContainerTone(3, { palettes, context: ctx }),
3363
3335
  isBackground: true,
3364
3336
  chromaMultiplier: () => {
3365
3337
  return 1.5;
@@ -3367,7 +3339,7 @@ const udixioVariant = variant({
3367
3339
  },
3368
3340
  surfaceContainerHighest: {
3369
3341
  palette: () => palettes.get("neutral"),
3370
- tone: () => surfaceContainerTone(4, { palettes, context: c }),
3342
+ tone: () => surfaceContainerTone(4, { palettes, context: ctx }),
3371
3343
  isBackground: true,
3372
3344
  chromaMultiplier: () => {
3373
3345
  return 1.7;
@@ -3376,28 +3348,28 @@ const udixioVariant = variant({
3376
3348
  onSurface: {
3377
3349
  palette: () => palettes.get("neutral"),
3378
3350
  tone: () => {
3379
- return getInitialToneFromBackground(highestSurface(c, colors));
3351
+ return getInitialToneFromBackground(highestSurface(ctx, colors));
3380
3352
  },
3381
3353
  chromaMultiplier: () => {
3382
3354
  return 1.7;
3383
3355
  },
3384
- background: () => highestSurface(c, colors),
3385
- contrastCurve: () => c.isDark ? getCurve(11) : getCurve(9)
3356
+ background: () => highestSurface(ctx, colors),
3357
+ contrastCurve: () => ctx.isDark ? getCurve(11) : getCurve(9)
3386
3358
  },
3387
3359
  onSurfaceVariant: {
3388
3360
  palette: () => palettes.get("neutralVariant"),
3389
3361
  chromaMultiplier: () => {
3390
3362
  return 1.7;
3391
3363
  },
3392
- background: () => highestSurface(c, colors),
3393
- contrastCurve: () => c.isDark ? getCurve(6) : getCurve(4.5)
3364
+ background: () => highestSurface(ctx, colors),
3365
+ contrastCurve: () => ctx.isDark ? getCurve(6) : getCurve(4.5)
3394
3366
  },
3395
3367
  outline: {
3396
3368
  palette: () => palettes.get("neutralVariant"),
3397
3369
  chromaMultiplier: () => {
3398
3370
  return 1.7;
3399
3371
  },
3400
- background: () => highestSurface(c, colors),
3372
+ background: () => highestSurface(ctx, colors),
3401
3373
  contrastCurve: () => getCurve(3)
3402
3374
  },
3403
3375
  outlineVariant: {
@@ -3405,7 +3377,7 @@ const udixioVariant = variant({
3405
3377
  chromaMultiplier: () => {
3406
3378
  return 1.7;
3407
3379
  },
3408
- background: () => highestSurface(c, colors),
3380
+ background: () => highestSurface(ctx, colors),
3409
3381
  contrastCurve: () => getCurve(1.5)
3410
3382
  },
3411
3383
  inverseSurface: {
@@ -3415,7 +3387,7 @@ const udixioVariant = variant({
3415
3387
  },
3416
3388
  inverseOnSurface: {
3417
3389
  palette: () => palettes.get("neutral"),
3418
- tone: () => c.isDark ? 20 : 95,
3390
+ tone: () => ctx.isDark ? 20 : 95,
3419
3391
  background: () => colors.get("inverseSurface"),
3420
3392
  contrastCurve: () => getCurve(7)
3421
3393
  },
@@ -3425,10 +3397,10 @@ const udixioVariant = variant({
3425
3397
  primary: {
3426
3398
  palette: () => palettes.get("primary"),
3427
3399
  tone: () => {
3428
- return c.sourceColor.tone;
3400
+ return ctx.sourceColor.tone;
3429
3401
  },
3430
3402
  isBackground: true,
3431
- background: () => highestSurface(c, colors),
3403
+ background: () => highestSurface(ctx, colors),
3432
3404
  contrastCurve: () => getCurve(4.5),
3433
3405
  adjustTone: () => () => {
3434
3406
  const surfaceTone = colors.get("surface").getTone();
@@ -3478,19 +3450,19 @@ const udixioVariant = variant({
3478
3450
  primaryContainer: {
3479
3451
  palette: () => palettes.get("primary"),
3480
3452
  tone: () => {
3481
- return c.isDark ? tMinC(palettes.get("primary"), 35, 93) : tMaxC(palettes.get("primary"), 0, 90);
3453
+ return ctx.isDark ? tMinC(palettes.get("primary"), 35, 93) : tMaxC(palettes.get("primary"), 0, 90);
3482
3454
  },
3483
3455
  isBackground: true,
3484
- background: () => highestSurface(c, colors),
3485
- adjustTone: () => c.variant.name == "fidelity" ? toneDeltaPair(
3456
+ background: () => highestSurface(ctx, colors),
3457
+ adjustTone: () => toneDeltaPair(
3486
3458
  colors.get("primary"),
3487
3459
  colors.get("primaryContainer"),
3488
3460
  15,
3489
3461
  "relative_darker",
3490
3462
  true,
3491
3463
  "farther"
3492
- ) : void 0,
3493
- contrastCurve: () => c.contrastLevel > 0 ? getCurve(1.5) : void 0
3464
+ ),
3465
+ contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
3494
3466
  },
3495
3467
  onPrimaryContainer: {
3496
3468
  palette: () => palettes.get("primary"),
@@ -3551,10 +3523,10 @@ const udixioVariant = variant({
3551
3523
  secondary: {
3552
3524
  palette: () => palettes.get("secondary"),
3553
3525
  tone: () => {
3554
- return c.isDark ? 80 : tMaxC(palettes.get("secondary"));
3526
+ return ctx.isDark ? 80 : tMaxC(palettes.get("secondary"));
3555
3527
  },
3556
3528
  isBackground: true,
3557
- background: () => highestSurface(c, colors),
3529
+ background: () => highestSurface(ctx, colors),
3558
3530
  contrastCurve: () => getCurve(4.5),
3559
3531
  adjustTone: () => toneDeltaPair(
3560
3532
  getColor("secondaryContainer"),
@@ -3595,12 +3567,12 @@ const udixioVariant = variant({
3595
3567
  secondaryContainer: {
3596
3568
  palette: () => palettes.get("secondary"),
3597
3569
  tone: () => {
3598
- return c.isDark ? 25 : 90;
3570
+ return ctx.isDark ? 25 : 90;
3599
3571
  },
3600
3572
  isBackground: true,
3601
- background: () => highestSurface(c, colors),
3573
+ background: () => highestSurface(ctx, colors),
3602
3574
  adjustTone: () => void 0,
3603
- contrastCurve: () => c.contrastLevel > 0 ? getCurve(1.5) : void 0
3575
+ contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
3604
3576
  },
3605
3577
  onSecondaryContainer: {
3606
3578
  palette: () => palettes.get("secondary"),
@@ -3655,10 +3627,10 @@ const udixioVariant = variant({
3655
3627
  tertiary: {
3656
3628
  palette: () => palettes.get("tertiary"),
3657
3629
  tone: () => {
3658
- return c.isDark ? tMaxC(palettes.get("tertiary"), 0, 98) : tMaxC(palettes.get("tertiary"));
3630
+ return ctx.isDark ? tMaxC(palettes.get("tertiary"), 0, 98) : tMaxC(palettes.get("tertiary"));
3659
3631
  },
3660
3632
  isBackground: true,
3661
- background: () => highestSurface(c, colors),
3633
+ background: () => highestSurface(ctx, colors),
3662
3634
  contrastCurve: () => getCurve(4.5),
3663
3635
  adjustTone: () => toneDeltaPair(
3664
3636
  getColor("tertiaryContainer"),
@@ -3699,12 +3671,12 @@ const udixioVariant = variant({
3699
3671
  tertiaryContainer: {
3700
3672
  palette: () => palettes.get("tertiary"),
3701
3673
  tone: () => {
3702
- return tMaxC(palettes.get("tertiary"), 0, c.isDark ? 93 : 100);
3674
+ return tMaxC(palettes.get("tertiary"), 0, ctx.isDark ? 93 : 100);
3703
3675
  },
3704
3676
  isBackground: true,
3705
- background: () => highestSurface(c, colors),
3677
+ background: () => highestSurface(ctx, colors),
3706
3678
  adjustTone: () => void 0,
3707
- contrastCurve: () => c.contrastLevel > 0 ? getCurve(1.5) : void 0
3679
+ contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
3708
3680
  },
3709
3681
  onTertiaryContainer: {
3710
3682
  palette: () => palettes.get("tertiary"),
@@ -3759,10 +3731,10 @@ const udixioVariant = variant({
3759
3731
  error: {
3760
3732
  palette: () => palettes.get("error"),
3761
3733
  tone: () => {
3762
- return c.isDark ? tMinC(palettes.get("error"), 0, 98) : tMaxC(palettes.get("error"));
3734
+ return ctx.isDark ? tMinC(palettes.get("error"), 0, 98) : tMaxC(palettes.get("error"));
3763
3735
  },
3764
3736
  isBackground: true,
3765
- background: () => highestSurface(c, colors),
3737
+ background: () => highestSurface(ctx, colors),
3766
3738
  contrastCurve: () => getCurve(4.5),
3767
3739
  adjustTone: () => toneDeltaPair(
3768
3740
  colors.get("errorContainer"),
@@ -3797,12 +3769,12 @@ const udixioVariant = variant({
3797
3769
  errorContainer: {
3798
3770
  palette: () => palettes.get("error"),
3799
3771
  tone: () => {
3800
- return c.isDark ? tMinC(palettes.get("error"), 30, 93) : tMaxC(palettes.get("error"), 0, 90);
3772
+ return ctx.isDark ? tMinC(palettes.get("error"), 30, 93) : tMaxC(palettes.get("error"), 0, 90);
3801
3773
  },
3802
3774
  isBackground: true,
3803
- background: () => highestSurface(c, colors),
3775
+ background: () => highestSurface(ctx, colors),
3804
3776
  adjustTone: () => void 0,
3805
- contrastCurve: () => c.contrastLevel > 0 ? getCurve(1.5) : void 0
3777
+ contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
3806
3778
  },
3807
3779
  onErrorContainer: {
3808
3780
  palette: () => palettes.get("error"),
package/dist/node.cjs CHANGED
@@ -22,9 +22,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  mod
23
23
  ));
24
24
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
25
- const loader = require("./loader-BbjdPvAo.cjs");
26
- const font_plugin = require("./font.plugin-CkYgSR9K.cjs");
27
- const loadFromPath = require("./load-from-path-C3UAcZqv.cjs");
25
+ const loader = require("./loader-1Pp2rd0P.cjs");
26
+ const font_plugin = require("./font.plugin-B0SKfA9r.cjs");
27
+ const loadFromPath = require("./load-from-path-BCkiZx6_.cjs");
28
28
  let unpluginInstance = null;
29
29
  const createUnpluginTheme = async () => {
30
30
  if (unpluginInstance) {
package/dist/node.js CHANGED
@@ -1,7 +1,7 @@
1
- import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader-C-8QkFag.js";
2
- import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-BU5iUqHq.js";
3
- import { l as loadFromPath } from "./load-from-path-BCh7ss_Z.js";
4
- import { r as r2 } from "./load-from-path-BCh7ss_Z.js";
1
+ import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader--tJzL1CC.js";
2
+ import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-BReTQTWQ.js";
3
+ import { l as loadFromPath } from "./load-from-path-C4axFso4.js";
4
+ import { r as r2 } from "./load-from-path-C4axFso4.js";
5
5
  let unpluginInstance = null;
6
6
  const createUnpluginTheme = async () => {
7
7
  if (unpluginInstance) {
@@ -1 +1 @@
1
- {"version":3,"file":"udixio.variant.d.ts","sourceRoot":"","sources":["../../../src/variant/variants/udixio.variant.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,OAAO,EAAE,MAAM,YAAY,CAAC;AAuD9E,eAAO,MAAM,aAAa,EAAE,OA8wB1B,CAAC"}
1
+ {"version":3,"file":"udixio.variant.d.ts","sourceRoot":"","sources":["../../../src/variant/variants/udixio.variant.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,OAAO,EAAE,MAAM,YAAY,CAAC;AAuD9E,eAAO,MAAM,aAAa,EAAE,OAovB1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@udixio/theme",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
4
4
  "type": "module",
5
5
  "main": "./dist/node.js",
6
6
  "module": "./dist/node.js",
@@ -231,7 +231,7 @@ export const udixioVariant: Variant = variant({
231
231
 
232
232
  return colors;
233
233
  },
234
- colors: ({ colors, context: c, palettes }) => {
234
+ colors: ({ colors, context: ctx, palettes }) => {
235
235
  const getColor = (key: DynamicColorKey) => {
236
236
  return colors.get(key);
237
237
  };
@@ -243,7 +243,7 @@ export const udixioVariant: Variant = variant({
243
243
  surface: {
244
244
  palette: () => palettes.get('neutral'),
245
245
  tone: () => {
246
- if (c.isDark) {
246
+ if (ctx.isDark) {
247
247
  return 2;
248
248
  } else {
249
249
  return 99;
@@ -251,76 +251,48 @@ export const udixioVariant: Variant = variant({
251
251
  },
252
252
  isBackground: true,
253
253
  },
254
- // surfaceDim: {
255
- // palette: () => palettes.get('neutral'),
256
- // tone: () => {
257
- // if (c.isDark) {
258
- // return 4;
259
- // } else {
260
- // if (Hct.isYellow(palettes.get('neutral').hue)) {
261
- // return 90;
262
- // } else if (c.variant.name === 'vibrant') {
263
- // return 85;
264
- // } else {
265
- // return 87;
266
- // }
267
- // }
268
- // },
269
- // isBackground: true,
270
- // chromaMultiplier: () => {
271
- // if (!c.isDark) {
272
- // if (c.variant.name === 'neutral') {
273
- // return 2.5;
274
- // } else if (c.variant.name === 'tonalSpot') {
275
- // return 1.7;
276
- // } else if (c.variant.name === 'expressive') {
277
- // return Hct.isYellow(palettes.get('neutral').hue) ? 2.7 : 1.75;
278
- // } else if (c.variant.name === 'vibrant') {
279
- // return 1.36;
280
- // }
281
- // }
282
- // return 1;
283
- // },
284
- // },
285
- // surfaceBright: {
286
- // palette: () => palettes.get('neutral'),
287
- // tone: () => {
288
- // if (c.isDark) {
289
- // return 18;
290
- // } else {
291
- // if (Hct.isYellow(palettes.get('neutral').hue)) {
292
- // return 99;
293
- // } else if (c.variant.name === 'vibrant') {
294
- // return 97;
295
- // } else {
296
- // return 98;
297
- // }
298
- // }
299
- // },
300
- // isBackground: true,
301
- // chromaMultiplier: () => {
302
- // if (c.isDark) {
303
- // if (c.variant.name === 'neutral') {
304
- // return 2.5;
305
- // } else if (c.variant.name === 'tonalSpot') {
306
- // return 1.7;
307
- // } else if (c.variant.name === 'expressive') {
308
- // return Hct.isYellow(palettes.get('neutral').hue) ? 2.7 : 1.75;
309
- // } else if (c.variant.name === 'vibrant') {
310
- // return 1.36;
311
- // }
312
- // }
313
- // return 1;
314
- // },
315
- // },
254
+ surfaceDim: {
255
+ palette: () => palettes.get('neutral'),
256
+ tone: () => {
257
+ if (ctx.isDark) {
258
+ return surfaceContainerTone(0.5, { palettes, context: ctx });
259
+ } else {
260
+ return surfaceContainerTone(5, { palettes, context: ctx });
261
+ }
262
+ },
263
+ isBackground: true,
264
+ chromaMultiplier: () => {
265
+ if (!ctx.isDark) {
266
+ return 1.7;
267
+ }
268
+ return 1;
269
+ },
270
+ },
271
+ surfaceBright: {
272
+ palette: () => palettes.get('neutral'),
273
+ tone: () => {
274
+ if (ctx.isDark) {
275
+ return surfaceContainerTone(5, { palettes, context: ctx });
276
+ } else {
277
+ return surfaceContainerTone(0.5, { palettes, context: ctx });
278
+ }
279
+ },
280
+ isBackground: true,
281
+ chromaMultiplier: () => {
282
+ if (ctx.isDark) {
283
+ return 1.7;
284
+ }
285
+ return 1;
286
+ },
287
+ },
316
288
  surfaceContainerLowest: {
317
289
  palette: () => palettes.get('neutral'),
318
- tone: () => surfaceContainerTone(0, { palettes, context: c }),
290
+ tone: () => surfaceContainerTone(0, { palettes, context: ctx }),
319
291
  isBackground: true,
320
292
  },
321
293
  surfaceContainerLow: {
322
294
  palette: () => palettes.get('neutral'),
323
- tone: () => surfaceContainerTone(1, { palettes, context: c }),
295
+ tone: () => surfaceContainerTone(1, { palettes, context: ctx }),
324
296
  isBackground: true,
325
297
  chromaMultiplier: () => {
326
298
  return 1.25;
@@ -328,7 +300,7 @@ export const udixioVariant: Variant = variant({
328
300
  },
329
301
  surfaceContainer: {
330
302
  palette: () => palettes.get('neutral'),
331
- tone: () => surfaceContainerTone(2, { palettes, context: c }),
303
+ tone: () => surfaceContainerTone(2, { palettes, context: ctx }),
332
304
  isBackground: true,
333
305
  chromaMultiplier: () => {
334
306
  return 1.4;
@@ -336,7 +308,7 @@ export const udixioVariant: Variant = variant({
336
308
  },
337
309
  surfaceContainerHigh: {
338
310
  palette: () => palettes.get('neutral'),
339
- tone: () => surfaceContainerTone(3, { palettes, context: c }),
311
+ tone: () => surfaceContainerTone(3, { palettes, context: ctx }),
340
312
  isBackground: true,
341
313
  chromaMultiplier: () => {
342
314
  return 1.5;
@@ -344,7 +316,7 @@ export const udixioVariant: Variant = variant({
344
316
  },
345
317
  surfaceContainerHighest: {
346
318
  palette: () => palettes.get('neutral'),
347
- tone: () => surfaceContainerTone(4, { palettes, context: c }),
319
+ tone: () => surfaceContainerTone(4, { palettes, context: ctx }),
348
320
  isBackground: true,
349
321
  chromaMultiplier: () => {
350
322
  return 1.7;
@@ -353,28 +325,28 @@ export const udixioVariant: Variant = variant({
353
325
  onSurface: {
354
326
  palette: () => palettes.get('neutral'),
355
327
  tone: () => {
356
- return getInitialToneFromBackground(highestSurface(c, colors));
328
+ return getInitialToneFromBackground(highestSurface(ctx, colors));
357
329
  },
358
330
  chromaMultiplier: () => {
359
331
  return 1.7;
360
332
  },
361
- background: () => highestSurface(c, colors),
362
- contrastCurve: () => (c.isDark ? getCurve(11) : getCurve(9)),
333
+ background: () => highestSurface(ctx, colors),
334
+ contrastCurve: () => (ctx.isDark ? getCurve(11) : getCurve(9)),
363
335
  },
364
336
  onSurfaceVariant: {
365
337
  palette: () => palettes.get('neutralVariant'),
366
338
  chromaMultiplier: () => {
367
339
  return 1.7;
368
340
  },
369
- background: () => highestSurface(c, colors),
370
- contrastCurve: () => (c.isDark ? getCurve(6) : getCurve(4.5)),
341
+ background: () => highestSurface(ctx, colors),
342
+ contrastCurve: () => (ctx.isDark ? getCurve(6) : getCurve(4.5)),
371
343
  },
372
344
  outline: {
373
345
  palette: () => palettes.get('neutralVariant'),
374
346
  chromaMultiplier: () => {
375
347
  return 1.7;
376
348
  },
377
- background: () => highestSurface(c, colors),
349
+ background: () => highestSurface(ctx, colors),
378
350
  contrastCurve: () => getCurve(3),
379
351
  },
380
352
  outlineVariant: {
@@ -382,7 +354,7 @@ export const udixioVariant: Variant = variant({
382
354
  chromaMultiplier: () => {
383
355
  return 1.7;
384
356
  },
385
- background: () => highestSurface(c, colors),
357
+ background: () => highestSurface(ctx, colors),
386
358
  contrastCurve: () => getCurve(1.5),
387
359
  },
388
360
  inverseSurface: {
@@ -392,7 +364,7 @@ export const udixioVariant: Variant = variant({
392
364
  },
393
365
  inverseOnSurface: {
394
366
  palette: () => palettes.get('neutral'),
395
- tone: () => (c.isDark ? 20 : 95),
367
+ tone: () => (ctx.isDark ? 20 : 95),
396
368
  background: () => colors.get('inverseSurface'),
397
369
  contrastCurve: () => getCurve(7),
398
370
  },
@@ -402,10 +374,10 @@ export const udixioVariant: Variant = variant({
402
374
  primary: {
403
375
  palette: () => palettes.get('primary'),
404
376
  tone: () => {
405
- return c.sourceColor.tone;
377
+ return ctx.sourceColor.tone;
406
378
  },
407
379
  isBackground: true,
408
- background: () => highestSurface(c, colors),
380
+ background: () => highestSurface(ctx, colors),
409
381
  contrastCurve: () => getCurve(4.5),
410
382
  adjustTone: () => () => {
411
383
  const surfaceTone = colors.get('surface').getTone();
@@ -456,24 +428,23 @@ export const udixioVariant: Variant = variant({
456
428
  primaryContainer: {
457
429
  palette: () => palettes.get('primary'),
458
430
  tone: () => {
459
- return c.isDark
431
+ return ctx.isDark
460
432
  ? tMinC(palettes.get('primary'), 35, 93)
461
433
  : tMaxC(palettes.get('primary'), 0, 90);
462
434
  },
463
435
  isBackground: true,
464
- background: () => highestSurface(c, colors),
436
+ background: () => highestSurface(ctx, colors),
465
437
  adjustTone: () =>
466
- c.variant.name == 'fidelity'
467
- ? toneDeltaPair(
468
- colors.get('primary'),
469
- colors.get('primaryContainer'),
470
- 15,
471
- 'relative_darker',
472
- true,
473
- 'farther',
474
- )
475
- : undefined,
476
- contrastCurve: () => (c.contrastLevel > 0 ? getCurve(1.5) : undefined),
438
+ toneDeltaPair(
439
+ colors.get('primary'),
440
+ colors.get('primaryContainer'),
441
+ 15,
442
+ 'relative_darker',
443
+ true,
444
+ 'farther',
445
+ ),
446
+ contrastCurve: () =>
447
+ ctx.contrastLevel > 0 ? getCurve(1.5) : undefined,
477
448
  },
478
449
  onPrimaryContainer: {
479
450
  palette: () => palettes.get('primary'),
@@ -539,10 +510,10 @@ export const udixioVariant: Variant = variant({
539
510
  secondary: {
540
511
  palette: () => palettes.get('secondary'),
541
512
  tone: () => {
542
- return c.isDark ? 80 : tMaxC(palettes.get('secondary'));
513
+ return ctx.isDark ? 80 : tMaxC(palettes.get('secondary'));
543
514
  },
544
515
  isBackground: true,
545
- background: () => highestSurface(c, colors),
516
+ background: () => highestSurface(ctx, colors),
546
517
  contrastCurve: () => getCurve(4.5),
547
518
  adjustTone: () =>
548
519
  toneDeltaPair(
@@ -584,12 +555,13 @@ export const udixioVariant: Variant = variant({
584
555
  secondaryContainer: {
585
556
  palette: () => palettes.get('secondary'),
586
557
  tone: () => {
587
- return c.isDark ? 25 : 90;
558
+ return ctx.isDark ? 25 : 90;
588
559
  },
589
560
  isBackground: true,
590
- background: () => highestSurface(c, colors),
561
+ background: () => highestSurface(ctx, colors),
591
562
  adjustTone: () => undefined,
592
- contrastCurve: () => (c.contrastLevel > 0 ? getCurve(1.5) : undefined),
563
+ contrastCurve: () =>
564
+ ctx.contrastLevel > 0 ? getCurve(1.5) : undefined,
593
565
  },
594
566
  onSecondaryContainer: {
595
567
  palette: () => palettes.get('secondary'),
@@ -649,12 +621,12 @@ export const udixioVariant: Variant = variant({
649
621
  tertiary: {
650
622
  palette: () => palettes.get('tertiary'),
651
623
  tone: () => {
652
- return c.isDark
624
+ return ctx.isDark
653
625
  ? tMaxC(palettes.get('tertiary'), 0, 98)
654
626
  : tMaxC(palettes.get('tertiary'));
655
627
  },
656
628
  isBackground: true,
657
- background: () => highestSurface(c, colors),
629
+ background: () => highestSurface(ctx, colors),
658
630
  contrastCurve: () => getCurve(4.5),
659
631
  adjustTone: () =>
660
632
  toneDeltaPair(
@@ -696,12 +668,13 @@ export const udixioVariant: Variant = variant({
696
668
  tertiaryContainer: {
697
669
  palette: () => palettes.get('tertiary'),
698
670
  tone: () => {
699
- return tMaxC(palettes.get('tertiary'), 0, c.isDark ? 93 : 100);
671
+ return tMaxC(palettes.get('tertiary'), 0, ctx.isDark ? 93 : 100);
700
672
  },
701
673
  isBackground: true,
702
- background: () => highestSurface(c, colors),
674
+ background: () => highestSurface(ctx, colors),
703
675
  adjustTone: () => undefined,
704
- contrastCurve: () => (c.contrastLevel > 0 ? getCurve(1.5) : undefined),
676
+ contrastCurve: () =>
677
+ ctx.contrastLevel > 0 ? getCurve(1.5) : undefined,
705
678
  },
706
679
  onTertiaryContainer: {
707
680
  palette: () => palettes.get('tertiary'),
@@ -762,12 +735,12 @@ export const udixioVariant: Variant = variant({
762
735
  error: {
763
736
  palette: () => palettes.get('error'),
764
737
  tone: () => {
765
- return c.isDark
738
+ return ctx.isDark
766
739
  ? tMinC(palettes.get('error'), 0, 98)
767
740
  : tMaxC(palettes.get('error'));
768
741
  },
769
742
  isBackground: true,
770
- background: () => highestSurface(c, colors),
743
+ background: () => highestSurface(ctx, colors),
771
744
  contrastCurve: () => getCurve(4.5),
772
745
  adjustTone: () =>
773
746
  toneDeltaPair(
@@ -803,14 +776,15 @@ export const udixioVariant: Variant = variant({
803
776
  errorContainer: {
804
777
  palette: () => palettes.get('error'),
805
778
  tone: () => {
806
- return c.isDark
779
+ return ctx.isDark
807
780
  ? tMinC(palettes.get('error'), 30, 93)
808
781
  : tMaxC(palettes.get('error'), 0, 90);
809
782
  },
810
783
  isBackground: true,
811
- background: () => highestSurface(c, colors),
784
+ background: () => highestSurface(ctx, colors),
812
785
  adjustTone: () => undefined,
813
- contrastCurve: () => (c.contrastLevel > 0 ? getCurve(1.5) : undefined),
786
+ contrastCurve: () =>
787
+ ctx.contrastLevel > 0 ? getCurve(1.5) : undefined,
814
788
  },
815
789
  onErrorContainer: {
816
790
  palette: () => palettes.get('error'),