@udixio/theme 1.2.0 → 1.3.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/bin.cjs +1 -1
  3. package/dist/bin.js +1 -1
  4. package/dist/browser.cjs +3 -4
  5. package/dist/browser.js +11 -12
  6. package/dist/color/color.manager.d.ts.map +1 -1
  7. package/dist/color/default-color.d.ts.map +1 -1
  8. package/dist/{define-config-CGG8l3fb.js → define-config-B1QPKKY_.js} +32 -2
  9. package/dist/{define-config-BFo7Sy7c.cjs → define-config-BGgVazsr.cjs} +32 -2
  10. package/dist/{load-from-path-CFpw2P_Y.js → load-from-path-BSrT4DOj.js} +1 -1
  11. package/dist/{load-from-path-BvdfXUD0.cjs → load-from-path-BuN8RpOs.cjs} +2 -2
  12. package/dist/loader/loader.d.ts.map +1 -1
  13. package/dist/{loader-C_BIrsO2.js → loader-Bc0bstAD.js} +129 -119
  14. package/dist/{loader-TksB6_mM.cjs → loader-YNN5hAF3.cjs} +121 -111
  15. package/dist/material-color-utilities/dynamic_color.d.ts +9 -15
  16. package/dist/material-color-utilities/dynamic_color.d.ts.map +1 -1
  17. package/dist/material-color-utilities/toneDeltaPair.d.ts +9 -2
  18. package/dist/material-color-utilities/toneDeltaPair.d.ts.map +1 -1
  19. package/dist/node.cjs +4 -5
  20. package/dist/node.js +13 -14
  21. package/dist/theme/scheme.d.ts +1 -1
  22. package/dist/theme/scheme.d.ts.map +1 -1
  23. package/dist/theme/variants/fidelity.variant.d.ts +3 -0
  24. package/dist/theme/variants/fidelity.variant.d.ts.map +1 -0
  25. package/dist/theme/variants/index.d.ts +1 -0
  26. package/dist/theme/variants/index.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/src/color/color.manager.ts +10 -8
  29. package/src/color/default-color.ts +82 -34
  30. package/src/loader/loader.ts +1 -5
  31. package/src/material-color-utilities/dynamic_color.ts +18 -120
  32. package/src/material-color-utilities/toneDeltaPair.ts +91 -2
  33. package/src/theme/scheme.ts +7 -1
  34. package/src/theme/variants/fidelity.variant.ts +38 -0
  35. package/src/theme/variants/index.ts +2 -0
@@ -0,0 +1,38 @@
1
+ import { getPiecewiseHue, getRotatedHue, Variant } from '../variant';
2
+ import { TonalPalette } from '@material/material-color-utilities';
3
+
4
+ export const fidelityVariant: Variant = {
5
+ name: 'fidelity',
6
+ palettes: {
7
+ primary: ({ sourceColorHct, isDark }) =>
8
+ TonalPalette.fromHueAndChroma(sourceColorHct.hue, sourceColorHct.chroma),
9
+ secondary: ({ sourceColorHct }) =>
10
+ TonalPalette.fromHueAndChroma(
11
+ sourceColorHct.hue,
12
+ sourceColorHct.chroma * 0.5,
13
+ ),
14
+ tertiary: ({ sourceColorHct }) =>
15
+ TonalPalette.fromHueAndChroma(
16
+ getRotatedHue(
17
+ sourceColorHct,
18
+ [0, 20, 71, 161, 333, 360],
19
+ [-40, 48, -32, 40, -32],
20
+ ),
21
+ sourceColorHct.chroma,
22
+ ),
23
+ neutral: ({ sourceColorHct }) =>
24
+ TonalPalette.fromHueAndChroma(sourceColorHct.hue, 5),
25
+ neutralVariant: ({ sourceColorHct }) =>
26
+ TonalPalette.fromHueAndChroma(sourceColorHct.hue, 5 * 1.7),
27
+ error: ({ sourceColorHct }) => {
28
+ const errorHue = getPiecewiseHue(
29
+ sourceColorHct,
30
+ [0, 3, 13, 23, 33, 43, 153, 273, 360],
31
+ [12, 22, 32, 12, 22, 32, 22, 12],
32
+ );
33
+ return TonalPalette.fromHueAndChroma(errorHue, 60);
34
+ },
35
+ },
36
+ customPalettes: ({ colorHct }) =>
37
+ TonalPalette.fromHueAndChroma(colorHct.hue, colorHct.chroma),
38
+ };
@@ -2,6 +2,7 @@ import { expressiveVariant } from './expressive.variant';
2
2
  import { neutralVariant } from './neutral.variant';
3
3
  import { tonalSpotVariant } from './tonal-spot.variant';
4
4
  import { vibrantVariant } from './vibrant.variant';
5
+ import { fidelityVariant } from './fidelity.variant';
5
6
 
6
7
  export * from './tonal-spot.variant';
7
8
  export * from './vibrant.variant';
@@ -13,4 +14,5 @@ export const Variants = {
13
14
  Neutral: neutralVariant,
14
15
  TonalSpot: tonalSpotVariant,
15
16
  Vibrant: vibrantVariant,
17
+ Fidelity: fidelityVariant,
16
18
  };