@digdir/designsystemet 1.6.1 → 1.7.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 (47) hide show
  1. package/README.md +1 -1
  2. package/configs/test-tokens.config.json +9 -0
  3. package/dist/bin/config.js +12 -14
  4. package/dist/bin/designsystemet.js +44 -317
  5. package/dist/color.base.template-QGZJKXMN.json +22 -0
  6. package/dist/config.schema.json +23 -7
  7. package/dist/src/colors/colorMetadata.d.ts +2 -0
  8. package/dist/src/colors/colorMetadata.d.ts.map +1 -1
  9. package/dist/src/colors/colorMetadata.js +8 -5
  10. package/dist/src/colors/index.js +9 -17
  11. package/dist/src/colors/theme.d.ts.map +1 -1
  12. package/dist/src/colors/theme.js +14 -18
  13. package/dist/src/colors/types.d.ts +1 -1
  14. package/dist/src/colors/types.d.ts.map +1 -1
  15. package/dist/src/config.d.ts +18 -0
  16. package/dist/src/config.d.ts.map +1 -1
  17. package/dist/src/config.js +12 -14
  18. package/dist/src/index.d.ts +1 -0
  19. package/dist/src/index.d.ts.map +1 -1
  20. package/dist/src/index.js +211 -416
  21. package/dist/src/scripts/createJsonSchema.js +12 -14
  22. package/dist/src/scripts/update-preview-tokens.js +33 -294
  23. package/dist/src/scripts/update-template.d.ts.map +1 -1
  24. package/dist/src/scripts/update-template.js +349 -71
  25. package/dist/src/tokens/build.js +5 -5
  26. package/dist/src/tokens/create/generators/$designsystemet.js +5 -5
  27. package/dist/src/tokens/create/generators/$metadata.d.ts.map +1 -1
  28. package/dist/src/tokens/create/generators/$metadata.js +1 -4
  29. package/dist/src/tokens/create/generators/$themes.js +0 -1
  30. package/dist/src/tokens/create/generators/color.d.ts +0 -1
  31. package/dist/src/tokens/create/generators/color.d.ts.map +1 -1
  32. package/dist/src/tokens/create/generators/color.js +20 -23
  33. package/dist/src/tokens/create/generators/semantic.d.ts +1 -265
  34. package/dist/src/tokens/create/generators/semantic.d.ts.map +1 -1
  35. package/dist/src/tokens/create/generators/semantic.js +261 -270
  36. package/dist/src/tokens/create/generators/theme.d.ts.map +1 -1
  37. package/dist/src/tokens/create/generators/theme.js +265 -5
  38. package/dist/src/tokens/create/write.js +6 -10
  39. package/dist/src/tokens/create.d.ts.map +1 -1
  40. package/dist/src/tokens/create.js +33 -293
  41. package/dist/src/tokens/format.js +38 -299
  42. package/dist/src/tokens/index.js +38 -299
  43. package/dist/src/tokens/process/output/declarations.js +5 -5
  44. package/dist/src/tokens/process/output/theme.js +5 -5
  45. package/dist/src/tokens/template/design-tokens/semantic/color.base.template.js +1 -1
  46. package/package.json +5 -5
  47. package/dist/color.base.template-M7BHS4OV.json +0 -286
package/dist/src/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  // src/colors/colorMetadata.ts
2
2
  import * as R from "ramda";
3
3
  var baseColors = {
4
- blue: "#0A71C0",
5
- green: "#068718",
6
- orange: "#EA9B1B",
7
- purple: "#663299",
8
- red: "#C01B1B"
4
+ info: "#0A71C0",
5
+ success: "#068718",
6
+ warning: "#EA9B1B",
7
+ danger: "#C01B1B"
9
8
  };
9
+ var dsLinkColor = "#663299";
10
10
  var colorMetadata = {
11
11
  "background-default": {
12
12
  number: 1,
@@ -254,6 +254,7 @@ var getColorMetadataByNumber = (number) => {
254
254
  return colorMetadataByNumber[number];
255
255
  };
256
256
  var colorNames = Object.keys(colorMetadata);
257
+ var baseColorNames = Object.keys(baseColors);
257
258
 
258
259
  // src/colors/theme.ts
259
260
  import chroma2 from "chroma-js";
@@ -399,18 +400,7 @@ var convertColor = (cssColor, format) => {
399
400
  };
400
401
 
401
402
  // src/colors/theme.ts
402
- var RESERVED_COLORS = [
403
- "neutral",
404
- "success",
405
- "warning",
406
- "danger",
407
- "info",
408
- "blue",
409
- "green",
410
- "orange",
411
- "purple",
412
- "red"
413
- ];
403
+ var RESERVED_COLORS = ["neutral", "success", "warning", "danger", "info"];
414
404
  var generateColorScale = (color, colorScheme2) => {
415
405
  let interpolationColor = color;
416
406
  if (colorScheme2 === "dark") {
@@ -475,6 +465,12 @@ var getCssVariable = (colorType, colorNumber) => {
475
465
  return `--ds-color-${colorType}-${getColorMetadataByNumber(colorNumber).displayName.toLowerCase().replace(/\s/g, "-")}`;
476
466
  };
477
467
 
468
+ // src/config.ts
469
+ import pc from "picocolors";
470
+ import * as R7 from "ramda";
471
+ import { z } from "zod";
472
+ import { fromError } from "zod-validation-error";
473
+
478
474
  // src/tokens/create/defaults.ts
479
475
  import * as R3 from "ramda";
480
476
 
@@ -1517,27 +1513,24 @@ var generateColorScheme = (themeName, colorScheme2, colors, overrides) => {
1517
1513
  colors.support
1518
1514
  );
1519
1515
  const neutral = generateColor(generateColorScale(colors.neutral, colorScheme2), createColorOverrides("neutral"));
1516
+ const baseColorsWithOverrides = {
1517
+ ...baseColors,
1518
+ ...overrides?.severity
1519
+ };
1520
+ const globalColors = R4.mapObjIndexed(
1521
+ (color, colorName) => generateColor(generateColorScale(color, colorScheme2), createColorOverrides(colorName)),
1522
+ baseColorsWithOverrides
1523
+ );
1524
+ const linkColor = generateColor(generateColorScale(dsLinkColor, colorScheme2));
1520
1525
  return {
1521
1526
  [themeName]: {
1522
1527
  ...main,
1523
1528
  ...support,
1524
- neutral
1525
- }
1526
- };
1527
- };
1528
- var generateColorGlobal = (colorScheme2) => {
1529
- const blueScale = generateColorScale(baseColors.blue, colorScheme2);
1530
- const greenScale = generateColorScale(baseColors.green, colorScheme2);
1531
- const orangeScale = generateColorScale(baseColors.orange, colorScheme2);
1532
- const purpleScale = generateColorScale(baseColors.purple, colorScheme2);
1533
- const redScale = generateColorScale(baseColors.red, colorScheme2);
1534
- return {
1535
- global: {
1536
- blue: generateColor(blueScale),
1537
- green: generateColor(greenScale),
1538
- orange: generateColor(orangeScale),
1539
- purple: generateColor(purpleScale),
1540
- red: generateColor(redScale)
1529
+ neutral,
1530
+ ...globalColors,
1531
+ link: {
1532
+ visited: linkColor[12]
1533
+ }
1541
1534
  }
1542
1535
  };
1543
1536
  };
@@ -1548,270 +1541,6 @@ import * as R5 from "ramda";
1548
1541
  // src/tokens/template/design-tokens/semantic/color.base.template.json with { type: 'json' }
1549
1542
  var color_base_template_default = {
1550
1543
  color: {
1551
- success: {
1552
- "background-default": {
1553
- $type: "color",
1554
- $value: "{global.green.1}"
1555
- },
1556
- "background-tinted": {
1557
- $type: "color",
1558
- $value: "{global.green.2}"
1559
- },
1560
- "surface-default": {
1561
- $type: "color",
1562
- $value: "{global.green.3}"
1563
- },
1564
- "surface-tinted": {
1565
- $type: "color",
1566
- $value: "{global.green.4}"
1567
- },
1568
- "surface-hover": {
1569
- $type: "color",
1570
- $value: "{global.green.5}"
1571
- },
1572
- "surface-active": {
1573
- $type: "color",
1574
- $value: "{global.green.6}"
1575
- },
1576
- "border-subtle": {
1577
- $type: "color",
1578
- $value: "{global.green.7}"
1579
- },
1580
- "border-default": {
1581
- $type: "color",
1582
- $value: "{global.green.8}"
1583
- },
1584
- "border-strong": {
1585
- $type: "color",
1586
- $value: "{global.green.9}"
1587
- },
1588
- "text-subtle": {
1589
- $type: "color",
1590
- $value: "{global.green.10}"
1591
- },
1592
- "text-default": {
1593
- $type: "color",
1594
- $value: "{global.green.11}"
1595
- },
1596
- "base-default": {
1597
- $type: "color",
1598
- $value: "{global.green.12}"
1599
- },
1600
- "base-hover": {
1601
- $type: "color",
1602
- $value: "{global.green.13}"
1603
- },
1604
- "base-active": {
1605
- $type: "color",
1606
- $value: "{global.green.14}"
1607
- },
1608
- "base-contrast-subtle": {
1609
- $type: "color",
1610
- $value: "{global.green.15}"
1611
- },
1612
- "base-contrast-default": {
1613
- $type: "color",
1614
- $value: "{global.green.16}"
1615
- }
1616
- },
1617
- danger: {
1618
- "background-default": {
1619
- $type: "color",
1620
- $value: "{global.red.1}"
1621
- },
1622
- "background-tinted": {
1623
- $type: "color",
1624
- $value: "{global.red.2}"
1625
- },
1626
- "surface-default": {
1627
- $type: "color",
1628
- $value: "{global.red.3}"
1629
- },
1630
- "surface-tinted": {
1631
- $type: "color",
1632
- $value: "{global.red.4}"
1633
- },
1634
- "surface-hover": {
1635
- $type: "color",
1636
- $value: "{global.red.5}"
1637
- },
1638
- "surface-active": {
1639
- $type: "color",
1640
- $value: "{global.red.6}"
1641
- },
1642
- "border-subtle": {
1643
- $type: "color",
1644
- $value: "{global.red.7}"
1645
- },
1646
- "border-default": {
1647
- $type: "color",
1648
- $value: "{global.red.8}"
1649
- },
1650
- "border-strong": {
1651
- $type: "color",
1652
- $value: "{global.red.9}"
1653
- },
1654
- "text-subtle": {
1655
- $type: "color",
1656
- $value: "{global.red.10}"
1657
- },
1658
- "text-default": {
1659
- $type: "color",
1660
- $value: "{global.red.11}"
1661
- },
1662
- "base-default": {
1663
- $type: "color",
1664
- $value: "{global.red.12}"
1665
- },
1666
- "base-hover": {
1667
- $type: "color",
1668
- $value: "{global.red.13}"
1669
- },
1670
- "base-active": {
1671
- $type: "color",
1672
- $value: "{global.red.14}"
1673
- },
1674
- "base-contrast-subtle": {
1675
- $type: "color",
1676
- $value: "{global.red.15}"
1677
- },
1678
- "base-contrast-default": {
1679
- $type: "color",
1680
- $value: "{global.red.16}"
1681
- }
1682
- },
1683
- info: {
1684
- "background-default": {
1685
- $type: "color",
1686
- $value: "{global.blue.1}"
1687
- },
1688
- "background-tinted": {
1689
- $type: "color",
1690
- $value: "{global.blue.2}"
1691
- },
1692
- "surface-default": {
1693
- $type: "color",
1694
- $value: "{global.blue.3}"
1695
- },
1696
- "surface-tinted": {
1697
- $type: "color",
1698
- $value: "{global.blue.4}"
1699
- },
1700
- "surface-hover": {
1701
- $type: "color",
1702
- $value: "{global.blue.5}"
1703
- },
1704
- "surface-active": {
1705
- $type: "color",
1706
- $value: "{global.blue.6}"
1707
- },
1708
- "border-subtle": {
1709
- $type: "color",
1710
- $value: "{global.blue.7}"
1711
- },
1712
- "border-default": {
1713
- $type: "color",
1714
- $value: "{global.blue.8}"
1715
- },
1716
- "border-strong": {
1717
- $type: "color",
1718
- $value: "{global.blue.9}"
1719
- },
1720
- "text-subtle": {
1721
- $type: "color",
1722
- $value: "{global.blue.10}"
1723
- },
1724
- "text-default": {
1725
- $type: "color",
1726
- $value: "{global.blue.11}"
1727
- },
1728
- "base-default": {
1729
- $type: "color",
1730
- $value: "{global.blue.12}"
1731
- },
1732
- "base-hover": {
1733
- $type: "color",
1734
- $value: "{global.blue.13}"
1735
- },
1736
- "base-active": {
1737
- $type: "color",
1738
- $value: "{global.blue.14}"
1739
- },
1740
- "base-contrast-subtle": {
1741
- $type: "color",
1742
- $value: "{global.blue.15}"
1743
- },
1744
- "base-contrast-default": {
1745
- $type: "color",
1746
- $value: "{global.blue.16}"
1747
- }
1748
- },
1749
- warning: {
1750
- "background-default": {
1751
- $type: "color",
1752
- $value: "{global.orange.1}"
1753
- },
1754
- "background-tinted": {
1755
- $type: "color",
1756
- $value: "{global.orange.2}"
1757
- },
1758
- "surface-default": {
1759
- $type: "color",
1760
- $value: "{global.orange.3}"
1761
- },
1762
- "surface-tinted": {
1763
- $type: "color",
1764
- $value: "{global.orange.4}"
1765
- },
1766
- "surface-hover": {
1767
- $type: "color",
1768
- $value: "{global.orange.5}"
1769
- },
1770
- "surface-active": {
1771
- $type: "color",
1772
- $value: "{global.orange.6}"
1773
- },
1774
- "border-subtle": {
1775
- $type: "color",
1776
- $value: "{global.orange.7}"
1777
- },
1778
- "border-default": {
1779
- $type: "color",
1780
- $value: "{global.orange.8}"
1781
- },
1782
- "border-strong": {
1783
- $type: "color",
1784
- $value: "{global.orange.9}"
1785
- },
1786
- "text-subtle": {
1787
- $type: "color",
1788
- $value: "{global.orange.10}"
1789
- },
1790
- "text-default": {
1791
- $type: "color",
1792
- $value: "{global.orange.11}"
1793
- },
1794
- "base-default": {
1795
- $type: "color",
1796
- $value: "{global.orange.12}"
1797
- },
1798
- "base-hover": {
1799
- $type: "color",
1800
- $value: "{global.orange.13}"
1801
- },
1802
- "base-active": {
1803
- $type: "color",
1804
- $value: "{global.orange.14}"
1805
- },
1806
- "base-contrast-subtle": {
1807
- $type: "color",
1808
- $value: "{global.orange.15}"
1809
- },
1810
- "base-contrast-default": {
1811
- $type: "color",
1812
- $value: "{global.orange.16}"
1813
- }
1814
- },
1815
1544
  focus: {
1816
1545
  inner: {
1817
1546
  $type: "color",
@@ -1827,7 +1556,7 @@ var color_base_template_default = {
1827
1556
  color: {
1828
1557
  visited: {
1829
1558
  $type: "color",
1830
- $value: "{global.purple.12}"
1559
+ $value: "{color.link.visited}"
1831
1560
  }
1832
1561
  }
1833
1562
  }
@@ -1970,7 +1699,7 @@ var color_template_default2 = {
1970
1699
  };
1971
1700
 
1972
1701
  // src/tokens/create/generators/semantic.ts
1973
- var generateSemantic = (colors) => {
1702
+ var generateSemantic = (colors, _themeName) => {
1974
1703
  const mainColorNames = Object.keys(colors.main);
1975
1704
  const supportColorNames = Object.keys(colors.support);
1976
1705
  const modes = {
@@ -2004,7 +1733,8 @@ var generateSemantic = (colors) => {
2004
1733
  }
2005
1734
  }
2006
1735
  const customColors = [...mainColorNames, "neutral", ...supportColorNames];
2007
- const semanticColorTokens = customColors.map(
1736
+ const allColors = [...customColors, ...baseColorNames];
1737
+ const semanticColorTokens = allColors.map(
2008
1738
  (colorName) => [
2009
1739
  colorName,
2010
1740
  R5.map((x) => ({ ...x, $value: x.$value.replace("<color>", colorName) }), color_template_default)
@@ -2155,7 +1885,7 @@ var theme_template_default = {
2155
1885
  var generateTheme = (colors, themeName, borderRadius) => {
2156
1886
  const mainColorNames = Object.keys(colors.main);
2157
1887
  const supportColorNames = Object.keys(colors.support);
2158
- const customColors = [...mainColorNames, "neutral", ...supportColorNames];
1888
+ const customColors = [...mainColorNames, "neutral", ...supportColorNames, ...baseColorNames];
2159
1889
  const themeColorTokens = Object.fromEntries(
2160
1890
  customColors.map(
2161
1891
  (colorName) => [
@@ -2168,7 +1898,13 @@ var generateTheme = (colors, themeName, borderRadius) => {
2168
1898
  const themeFile = {
2169
1899
  color: {
2170
1900
  ...themeColorTokens,
2171
- ...themeBaseFileColor
1901
+ ...themeBaseFileColor,
1902
+ link: {
1903
+ visited: {
1904
+ $type: "color",
1905
+ $value: `{${themeName}.link.visited}`
1906
+ }
1907
+ }
2172
1908
  },
2173
1909
  ...remainingThemeFile
2174
1910
  };
@@ -2240,7 +1976,7 @@ var cliOptions = {
2240
1976
  var createTokens = async (opts) => {
2241
1977
  const { colors, typography: typography2, name, borderRadius, overrides } = opts;
2242
1978
  const colorSchemes = ["light", "dark"];
2243
- const semantic2 = generateSemantic(colors);
1979
+ const semantic2 = generateSemantic(colors, name);
2244
1980
  const tokenSets = new Map([
2245
1981
  ...getDefaultTokens([
2246
1982
  "primitives/globals",
@@ -2255,7 +1991,6 @@ var createTokens = async (opts) => {
2255
1991
  [`primitives/modes/typography/primary/${name}`, generateTypography(name, typography2)],
2256
1992
  [`primitives/modes/typography/secondary/${name}`, generateTypography(name, typography2)],
2257
1993
  ...colorSchemes.flatMap((scheme) => [
2258
- [`primitives/modes/color-scheme/${scheme}/global`, generateColorGlobal(scheme)],
2259
1994
  [`primitives/modes/color-scheme/${scheme}/${name}`, generateColorScheme(name, scheme, colors, overrides)]
2260
1995
  ]),
2261
1996
  [`themes/${name}`, generateTheme(colors, name, borderRadius)],
@@ -2269,8 +2004,66 @@ var createTokens = async (opts) => {
2269
2004
  return { tokenSets };
2270
2005
  };
2271
2006
 
2007
+ // src/config.ts
2008
+ var hexPatterns = [
2009
+ // Hex colors: #000, #0000, #000000, #00000000
2010
+ `#[0-9a-fA-F]{3}`,
2011
+ `#[0-9a-fA-F]{4}`,
2012
+ `#[0-9a-fA-F]{6}`,
2013
+ `#[0-9a-fA-F]{8}`
2014
+ ];
2015
+ var reservedColorsPattern = `^(?!(?:${RESERVED_COLORS.join("|")})$)`;
2016
+ var colorRegex = new RegExp(`^${hexPatterns.join("|")}$`);
2017
+ var colorSchema = z.string().regex(colorRegex).transform(convertToHex).describe(
2018
+ `A hex color, which is used for creating a color scale. Invalid color names: ${RESERVED_COLORS.join(", ")}`
2019
+ );
2020
+ var colorCategorySchema = z.record(
2021
+ z.string().regex(new RegExp(reservedColorsPattern, "i"), {
2022
+ error: `Color names cannot include reserved names: ${RESERVED_COLORS.join(", ")}`
2023
+ }),
2024
+ colorSchema,
2025
+ {
2026
+ error: "Color definitions must be hex color values"
2027
+ }
2028
+ ).refine((colors) => !Object.keys(colors).some((key) => RESERVED_COLORS.includes(key.toLowerCase())), {
2029
+ error: `Color names cannot include reserved names: ${RESERVED_COLORS.join(", ")}`
2030
+ }).describe("An object with one or more color definitions. The property name is used as the color name.");
2031
+ var colorModeOverrideSchema = z.object({
2032
+ light: colorSchema.optional(),
2033
+ dark: colorSchema.optional()
2034
+ }).describe('Override values for semantic color tokens like "background-subtle", "border-default", etc.');
2035
+ var colorWeightOverrideSchema = z.partialRecord(z.enum([...colorNames]), colorModeOverrideSchema).describe('The name of the color to add overrides for, e.g. "accent"');
2036
+ var semanticColorOverrideSchema = z.record(z.string(), colorWeightOverrideSchema).describe("An object with color names as keys");
2037
+ var severityColorOverrideSchema = z.partialRecord(z.enum(baseColorNames), colorSchema.describe("A hex color, which is used for creating a color scale")).optional().describe("An object with severity color names as keys");
2038
+ var overridesSchema = z.object({
2039
+ colors: semanticColorOverrideSchema.optional(),
2040
+ severity: severityColorOverrideSchema.optional()
2041
+ }).describe("Overrides for generated design tokens. Currently only supports colors defined in your theme").optional();
2042
+ var themeSchema = z.object({
2043
+ colors: z.object({
2044
+ main: colorCategorySchema,
2045
+ support: colorCategorySchema.optional().default({}),
2046
+ neutral: colorSchema
2047
+ }).meta({ description: "Defines the colors for this theme" }),
2048
+ typography: z.object({
2049
+ fontFamily: z.string().meta({ description: "Sets the font-family for this theme" })
2050
+ }).describe("Defines the typography for a given theme").optional(),
2051
+ borderRadius: z.number().meta({ description: "Defines the border-radius for this theme" }).optional(),
2052
+ overrides: overridesSchema
2053
+ }).meta({ description: "An object defining a theme. The property name holding the object becomes the theme name." });
2054
+ var commonConfig = z.object({
2055
+ clean: z.boolean().meta({ description: "Delete the output directory before building or creating tokens" }).optional()
2056
+ });
2057
+ var _configFileCreateSchema = z.object({
2058
+ outDir: z.string().meta({ description: "Path to the output directory for the created design tokens" }),
2059
+ themes: z.record(z.string(), themeSchema).meta({
2060
+ description: "An object with one or more themes. Each property defines a theme, and the property name is used as the theme name."
2061
+ })
2062
+ }).required();
2063
+ var configFileCreateSchema = _configFileCreateSchema.extend(commonConfig.shape);
2064
+
2272
2065
  // src/tokens/format.ts
2273
- import * as R23 from "ramda";
2066
+ import * as R24 from "ramda";
2274
2067
 
2275
2068
  // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
2276
2069
  var BoxShadowTypes;
@@ -2526,7 +2319,6 @@ function generateColorSchemesGroup(colorSchemes, themes) {
2526
2319
  (scheme) => ({
2527
2320
  ...colorSchemeDefaults[scheme],
2528
2321
  selectedTokenSets: Object.fromEntries([
2529
- [`primitives/modes/color-scheme/${scheme}/global`, TokenSetStatus.ENABLED],
2530
2322
  ...themes.map((theme) => [`primitives/modes/color-scheme/${scheme}/${theme}`, TokenSetStatus.ENABLED])
2531
2323
  ]),
2532
2324
  group: "Color scheme"
@@ -2604,13 +2396,13 @@ function generateTypographyGroup(themes) {
2604
2396
  }
2605
2397
 
2606
2398
  // src/tokens/process/output/theme.ts
2607
- import pc from "picocolors";
2608
- import * as R8 from "ramda";
2399
+ import pc2 from "picocolors";
2400
+ import * as R9 from "ramda";
2609
2401
 
2610
2402
  // package.json
2611
2403
  var package_default = {
2612
2404
  name: "@digdir/designsystemet",
2613
- version: "1.6.1",
2405
+ version: "1.7.0",
2614
2406
  description: "CLI for Designsystemet",
2615
2407
  author: "Designsystemet team",
2616
2408
  engines: {
@@ -2683,9 +2475,9 @@ var package_default = {
2683
2475
  "object-hash": "^3.0.0",
2684
2476
  picocolors: "^1.1.1",
2685
2477
  postcss: "^8.5.6",
2686
- ramda: "^0.31.3",
2687
- "style-dictionary": "^5.1.0",
2688
- zod: "^4.1.11",
2478
+ ramda: "^0.32.0",
2479
+ "style-dictionary": "^5.1.1",
2480
+ zod: "^4.1.12",
2689
2481
  "zod-validation-error": "^4.0.2"
2690
2482
  },
2691
2483
  devDependencies: {
@@ -2693,7 +2485,7 @@ var package_default = {
2693
2485
  "@types/apca-w3": "^0.1.3",
2694
2486
  "@types/chroma-js": "^3.1.1",
2695
2487
  "@types/fs-extra": "^11.0.4",
2696
- "@types/node": "^22.18.8",
2488
+ "@types/node": "^22.18.11",
2697
2489
  "@types/object-hash": "^3.0.6",
2698
2490
  "@types/ramda": "^0.31.1",
2699
2491
  "fs-extra": "^11.3.2",
@@ -2705,7 +2497,7 @@ var package_default = {
2705
2497
  };
2706
2498
 
2707
2499
  // src/tokens/utils.ts
2708
- import * as R7 from "ramda";
2500
+ import * as R8 from "ramda";
2709
2501
 
2710
2502
  // src/tokens/types.ts
2711
2503
  var colorCategories = {
@@ -2714,27 +2506,27 @@ var colorCategories = {
2714
2506
  };
2715
2507
 
2716
2508
  // src/tokens/utils.ts
2717
- var mapToLowerCase = R7.map(R7.toLower);
2718
- var hasAnyTruth = R7.any(R7.equals(true));
2509
+ var mapToLowerCase = R8.map(R8.toLower);
2510
+ var hasAnyTruth = R8.any(R8.equals(true));
2719
2511
  var getType = (token) => (token.$type ?? token.type) || "";
2720
2512
  var getValue = (token) => token.$value ?? token.value;
2721
- var typeEquals = R7.curry(
2513
+ var typeEquals = R8.curry(
2722
2514
  (types, token) => {
2723
- if (R7.isNil(token)) {
2515
+ if (R8.isNil(token)) {
2724
2516
  return false;
2725
2517
  }
2726
- return R7.includes(R7.toLower(getType(token)), R7.map(R7.toLower, Array.isArray(types) ? types : [types]));
2518
+ return R8.includes(R8.toLower(getType(token)), R8.map(R8.toLower, Array.isArray(types) ? types : [types]));
2727
2519
  }
2728
2520
  );
2729
- var pathStartsWithOneOf = R7.curry(
2521
+ var pathStartsWithOneOf = R8.curry(
2730
2522
  (paths, token) => {
2731
- if (R7.isNil(token)) {
2523
+ if (R8.isNil(token)) {
2732
2524
  return false;
2733
2525
  }
2734
2526
  const tokenPath = mapToLowerCase(token.path);
2735
- const matchPathsStartingWith = R7.map((pathOrString) => {
2736
- const path = typeof pathOrString === "string" ? [pathOrString] : pathOrString;
2737
- return R7.startsWith(mapToLowerCase(path), tokenPath);
2527
+ const matchPathsStartingWith = R8.map((pathOrString) => {
2528
+ const path2 = typeof pathOrString === "string" ? [pathOrString] : pathOrString;
2529
+ return R8.startsWith(mapToLowerCase(path2), tokenPath);
2738
2530
  }, paths);
2739
2531
  return hasAnyTruth(matchPathsStartingWith);
2740
2532
  }
@@ -2743,7 +2535,7 @@ function isSemanticToken(token) {
2743
2535
  return token.filePath.includes("semantic/");
2744
2536
  }
2745
2537
  function isSemanticColorToken(token, color) {
2746
- return token.filePath.includes("semantic/") && R7.startsWith(["color", color], token.path);
2538
+ return token.filePath.includes("semantic/") && R8.startsWith(["color", color], token.path);
2747
2539
  }
2748
2540
  function isGlobalColorToken(token) {
2749
2541
  return typeEquals("color", token) && pathStartsWithOneOf(["global"], token);
@@ -2754,7 +2546,7 @@ function isColorCategoryToken(token, category) {
2754
2546
  (colorCategory2) => isColorCategoryToken(token, colorCategory2)
2755
2547
  );
2756
2548
  }
2757
- return R7.startsWith(["color", category], token.path);
2549
+ return R8.startsWith(["color", category], token.path);
2758
2550
  }
2759
2551
  var isDigit = (s) => /^\d+$/.test(s);
2760
2552
  function traverseObj(obj, fn) {
@@ -2770,7 +2562,7 @@ function traverseObj(obj, fn) {
2770
2562
  return obj;
2771
2563
  }
2772
2564
  function inlineTokens(shouldInline, tokens) {
2773
- const [inlineableTokens, otherTokens] = R7.partition(shouldInline, tokens);
2565
+ const [inlineableTokens, otherTokens] = R8.partition(shouldInline, tokens);
2774
2566
  return otherTokens.map((token) => {
2775
2567
  let transformed = getValue(token.original);
2776
2568
  for (const ref of inlineableTokens) {
@@ -2779,7 +2571,7 @@ function inlineTokens(shouldInline, tokens) {
2779
2571
  transformed = transformed.replaceAll(`{${refName}}`, getValue(ref.original));
2780
2572
  }
2781
2573
  }
2782
- const tokenWithInlinedRefs = R7.set(R7.lensPath(["original", "$value"]), transformed, token);
2574
+ const tokenWithInlinedRefs = R8.set(R8.lensPath(["original", "$value"]), transformed, token);
2783
2575
  return tokenWithInlinedRefs;
2784
2576
  });
2785
2577
  }
@@ -2798,13 +2590,13 @@ var sizeComparator = (size2) => {
2798
2590
  return sortIndex ?? 0;
2799
2591
  };
2800
2592
  function orderBySize(sizes) {
2801
- return R7.sortBy(sizeComparator, sizes);
2593
+ return R8.sortBy(sizeComparator, sizes);
2802
2594
  }
2803
2595
 
2804
2596
  // src/tokens/process/output/theme.ts
2805
2597
  var defaultFileHeader = `build: v${package_default.version}`;
2806
- var getFileNameWithoutExtension = (path) => {
2807
- const pathSegments = path.split("/");
2598
+ var getFileNameWithoutExtension = (path2) => {
2599
+ const pathSegments = path2.split("/");
2808
2600
  return pathSegments[pathSegments.length - 1].split(".").slice(0, -1).join(".");
2809
2601
  };
2810
2602
  var createThemeCSSFiles = ({
@@ -2816,9 +2608,9 @@ var createThemeCSSFiles = ({
2816
2608
  for (const buildResult of buildResults) {
2817
2609
  const themeName = buildResult.permutation.theme;
2818
2610
  const newOutputs = buildResult.formatted;
2819
- if (R8.isNotEmpty(newOutputs)) {
2611
+ if (R9.isNotEmpty(newOutputs)) {
2820
2612
  const currentOutputs = groupedByTheme[themeName] ?? [];
2821
- groupedByTheme[themeName] = R8.concat(currentOutputs, newOutputs);
2613
+ groupedByTheme[themeName] = R9.concat(currentOutputs, newOutputs);
2822
2614
  }
2823
2615
  }
2824
2616
  }
@@ -2834,7 +2626,7 @@ var createThemeCSSFiles = ({
2834
2626
  "typography/primary",
2835
2627
  "color/"
2836
2628
  ];
2837
- const sortByDefinedOrder = R8.sortBy((file) => {
2629
+ const sortByDefinedOrder = R9.sortBy((file) => {
2838
2630
  const filePath = file.destination || "";
2839
2631
  const sortIndex = sortOrder.findIndex((sortElement) => {
2840
2632
  if (sortElement.endsWith("/")) {
@@ -2844,10 +2636,10 @@ var createThemeCSSFiles = ({
2844
2636
  });
2845
2637
  if (sortIndex === -1) {
2846
2638
  console.error(
2847
- pc.yellow(`WARNING: CSS section does not have a defined sort order: ${filePath.replace(".css", "")}`)
2639
+ pc2.yellow(`WARNING: CSS section does not have a defined sort order: ${filePath.replace(".css", "")}`)
2848
2640
  );
2849
2641
  console.log(
2850
- pc.dim(
2642
+ pc2.dim(
2851
2643
  `
2852
2644
  The section will currently be added to the end of the entry file, but the exact
2853
2645
  order may change due to nondeterminism.`.trim()
@@ -2863,17 +2655,17 @@ ${fileHeader}
2863
2655
  */
2864
2656
 
2865
2657
  `;
2866
- const sortAlphabetically = R8.sort(R8.ascend((x) => x.destination || ""));
2867
- const sortBySize = R8.sortBy(
2868
- R8.pipe((s) => getFileNameWithoutExtension(s.destination ?? ""), sizeComparator)
2658
+ const sortAlphabetically = R9.sort(R9.ascend((x) => x.destination || ""));
2659
+ const sortBySize = R9.sortBy(
2660
+ R9.pipe((s) => getFileNameWithoutExtension(s.destination ?? ""), sizeComparator)
2869
2661
  );
2870
- const pickOutputs = R8.map(R8.view(R8.lensProp("output")));
2871
- const themeCSSFile = R8.pipe(
2662
+ const pickOutputs = R9.map(R9.view(R9.lensProp("output")));
2663
+ const themeCSSFile = R9.pipe(
2872
2664
  sortAlphabetically,
2873
2665
  sortBySize,
2874
2666
  sortByDefinedOrder,
2875
2667
  pickOutputs,
2876
- R8.join("\n"),
2668
+ R9.join("\n"),
2877
2669
  (content) => header + content
2878
2670
  );
2879
2671
  const themeCSSFiles = Object.entries(groupedByTheme).map(([theme, files]) => ({
@@ -2884,20 +2676,20 @@ ${fileHeader}
2884
2676
  };
2885
2677
 
2886
2678
  // src/tokens/process/platform.ts
2887
- import pc3 from "picocolors";
2888
- import * as R22 from "ramda";
2679
+ import pc4 from "picocolors";
2680
+ import * as R23 from "ramda";
2889
2681
  import StyleDictionary2 from "style-dictionary";
2890
2682
 
2891
2683
  // src/tokens/process/configs.ts
2892
2684
  import { register } from "@tokens-studio/sd-transforms";
2893
- import * as R21 from "ramda";
2685
+ import * as R22 from "ramda";
2894
2686
  import StyleDictionary from "style-dictionary";
2895
2687
 
2896
2688
  // src/tokens/process/configs/color.ts
2897
- import * as R16 from "ramda";
2689
+ import * as R17 from "ramda";
2898
2690
 
2899
2691
  // src/tokens/process/formats/css/color.ts
2900
- import * as R9 from "ramda";
2692
+ import * as R10 from "ramda";
2901
2693
  import { createPropertyFormatter } from "style-dictionary/utils";
2902
2694
  var prefersColorScheme = (colorScheme2, content) => `
2903
2695
  @media (prefers-color-scheme: ${colorScheme2}) {
@@ -2921,8 +2713,8 @@ var colorScheme = {
2921
2713
  color-scheme: ${colorScheme_};
2922
2714
  ` : "";
2923
2715
  const filteredAllTokens = allTokens.filter(
2924
- R9.allPass([
2925
- R9.anyPass([
2716
+ R10.allPass([
2717
+ R10.anyPass([
2926
2718
  // Include semantic tokens in the output
2927
2719
  isSemanticToken,
2928
2720
  // Include global color tokens
@@ -2936,13 +2728,13 @@ var colorScheme = {
2936
2728
  token,
2937
2729
  formatted: format(token)
2938
2730
  }));
2939
- const formattedTokens = formattedMap.map(R9.view(R9.lensProp("formatted"))).join("\n");
2731
+ const formattedTokens = formattedMap.map(R10.view(R10.lensProp("formatted"))).join("\n");
2940
2732
  const content = `{
2941
2733
  ${formattedTokens}
2942
2734
  ${colorSchemeProperty}}
2943
2735
  `;
2944
2736
  const autoSelectorContent = ["light", "dark"].includes(colorScheme_) ? prefersColorScheme(colorScheme_, content) : "";
2945
- const body = R9.isNotNil(layer) ? `@layer ${layer} {
2737
+ const body = R10.isNotNil(layer) ? `@layer ${layer} {
2946
2738
  ${selector} ${content} ${autoSelectorContent}
2947
2739
  }
2948
2740
  ` : `${selector} ${content} ${autoSelectorContent}
@@ -2956,7 +2748,7 @@ var colorCategory = {
2956
2748
  const { outputReferences, usesDtcg } = options;
2957
2749
  const { selector, layer } = platform;
2958
2750
  const destination = file.destination;
2959
- const format = R9.compose(
2751
+ const format = R10.compose(
2960
2752
  createPropertyFormatter({
2961
2753
  outputReferences,
2962
2754
  dictionary,
@@ -2977,12 +2769,12 @@ var colorCategory = {
2977
2769
  formatted: format(token)
2978
2770
  }));
2979
2771
  buildOptions.buildTokenFormats[destination] = formattedMap;
2980
- const formattedTokens = formattedMap.map(R9.view(R9.lensProp("formatted"))).join("\n");
2772
+ const formattedTokens = formattedMap.map(R10.view(R10.lensProp("formatted"))).join("\n");
2981
2773
  const content = `{
2982
2774
  ${formattedTokens}
2983
2775
  }
2984
2776
  `;
2985
- const body = R9.isNotNil(layer) ? `@layer ${layer} {
2777
+ const body = R10.isNotNil(layer) ? `@layer ${layer} {
2986
2778
  ${selector} ${content}
2987
2779
  }
2988
2780
  ` : `${selector} ${content}
@@ -2992,16 +2784,16 @@ ${selector} ${content}
2992
2784
  };
2993
2785
 
2994
2786
  // src/tokens/process/formats/css/semantic.ts
2995
- import * as R11 from "ramda";
2787
+ import * as R12 from "ramda";
2996
2788
  import { createPropertyFormatter as createPropertyFormatter3 } from "style-dictionary/utils";
2997
2789
 
2998
2790
  // src/tokens/process/formats/css/size.ts
2999
- import * as R10 from "ramda";
2791
+ import * as R11 from "ramda";
3000
2792
  import { createPropertyFormatter as createPropertyFormatter2 } from "style-dictionary/utils";
3001
2793
  var isNumericBorderRadiusToken = (t) => t.path[0] === "border-radius" && isDigit(t.path[1]);
3002
2794
  var isNumericSizeToken = (t) => pathStartsWithOneOf(["size"], t) && isDigit(t.path[1]);
3003
2795
  var isSizeToken = (t) => pathStartsWithOneOf(["size"], t);
3004
- var isInlineTokens = R10.anyPass([isNumericBorderRadiusToken, isNumericSizeToken, isSizeToken]);
2796
+ var isInlineTokens = R11.anyPass([isNumericBorderRadiusToken, isNumericSizeToken, isSizeToken]);
3005
2797
  var overrideSizingFormula = (format, token) => {
3006
2798
  const [name, value] = format(token).replace(/;$/, "").split(": ");
3007
2799
  let calc;
@@ -3020,7 +2812,7 @@ var overrideSizingFormula = (format, token) => {
3020
2812
  calc
3021
2813
  };
3022
2814
  };
3023
- var formatSizingTokens = (format, tokens) => R10.reduce(
2815
+ var formatSizingTokens = (format, tokens) => R11.reduce(
3024
2816
  (acc, token) => {
3025
2817
  const { round, calc, name } = overrideSizingFormula(format, token);
3026
2818
  return {
@@ -3054,8 +2846,8 @@ var size = {
3054
2846
  usesDtcg
3055
2847
  });
3056
2848
  const tokens = inlineTokens(isInlineTokens, dictionary.allTokens);
3057
- const filteredTokens = R10.reject((token) => R10.equals(["_size", "mode-font-size"], token.path), tokens);
3058
- const [sizingTokens, restTokens] = R10.partition(
2849
+ const filteredTokens = R11.reject((token) => R11.equals(["_size", "mode-font-size"], token.path), tokens);
2850
+ const [sizingTokens, restTokens] = R11.partition(
3059
2851
  (t) => pathStartsWithOneOf(["_size"], t) && (isDigit(t.path[1]) || t.path[1] === "unit"),
3060
2852
  filteredTokens
3061
2853
  );
@@ -3069,12 +2861,12 @@ var size = {
3069
2861
  formatted: t
3070
2862
  }));
3071
2863
  buildOptions.buildTokenFormats[destination] = [...formattedMap, ...formattedSizingMap];
3072
- const formattedTokens = [formattedMap.map(R10.prop("formatted")).join("\n"), sizingTemplate(formattedSizingTokens)];
2864
+ const formattedTokens = [formattedMap.map(R11.prop("formatted")).join("\n"), sizingTemplate(formattedSizingTokens)];
3073
2865
  const content = `${selector} {
3074
2866
  ${formattedTokens.join("\n")}
3075
2867
  }
3076
2868
  `;
3077
- const body = R10.isNotNil(layer) ? `@layer ${layer} {
2869
+ const body = R11.isNotNil(layer) ? `@layer ${layer} {
3078
2870
  ${content}
3079
2871
  }
3080
2872
  ` : `${content}
@@ -3102,12 +2894,12 @@ var semantic = {
3102
2894
  formatted: format(token)
3103
2895
  }));
3104
2896
  buildOptions.buildTokenFormats[destination] = formattedMap;
3105
- const formattedTokens = formattedMap.map(R11.prop("formatted")).join("\n");
2897
+ const formattedTokens = formattedMap.map(R12.prop("formatted")).join("\n");
3106
2898
  const content = `${selector} {
3107
2899
  ${formattedTokens}
3108
2900
  }
3109
2901
  `;
3110
- const body = R11.isNotNil(layer) ? `@layer ${layer} {
2902
+ const body = R12.isNotNil(layer) ? `@layer ${layer} {
3111
2903
  ${content}
3112
2904
  }
3113
2905
  ` : `${content}
@@ -3117,13 +2909,13 @@ ${content}
3117
2909
  };
3118
2910
 
3119
2911
  // src/tokens/process/formats/css/size-mode.ts
3120
- import * as R13 from "ramda";
2912
+ import * as R14 from "ramda";
3121
2913
  import { createPropertyFormatter as createPropertyFormatter4 } from "style-dictionary/utils";
3122
2914
 
3123
2915
  // src/tokens/process/transformers.ts
3124
2916
  import { checkAndEvaluateMath } from "@tokens-studio/sd-transforms";
3125
- import * as R12 from "ramda";
3126
- var isPx = R12.test(/\b\d+px\b/g);
2917
+ import * as R13 from "ramda";
2918
+ var isPx = R13.test(/\b\d+px\b/g);
3127
2919
  var sizeRem = {
3128
2920
  name: "ds/size/toRem",
3129
2921
  type: "value",
@@ -3242,13 +3034,13 @@ ${sizes.map((size3) => ` var(--ds-size--${size3}, var(--ds-size-mode-font-siz
3242
3034
  const sharedContent = `${sizingToggles}
3243
3035
 
3244
3036
  ${sizingHelpers}`;
3245
- const sharedBody = shortSizeName(size2) === R13.last(sizes) ? `
3037
+ const sharedBody = shortSizeName(size2) === R14.last(sizes) ? `
3246
3038
  ${wrapInLayer(sharedContent, layer)}` : "";
3247
3039
  return body + sharedBody;
3248
3040
  }
3249
3041
  };
3250
3042
  function wrapInLayer(content, layer) {
3251
- return R13.isNotNil(layer) ? `@layer ${layer} {
3043
+ return R14.isNotNil(layer) ? `@layer ${layer} {
3252
3044
  ${content}
3253
3045
  }
3254
3046
  ` : `${content}
@@ -3256,11 +3048,11 @@ ${content}
3256
3048
  }
3257
3049
 
3258
3050
  // src/tokens/process/formats/css/typography.ts
3259
- import * as R14 from "ramda";
3051
+ import * as R15 from "ramda";
3260
3052
  import { createPropertyFormatter as createPropertyFormatter5 } from "style-dictionary/utils";
3261
- var typographyFontFamilyPredicate = R14.allPass([
3262
- R14.pathSatisfies(R14.includes("typography"), ["path"]),
3263
- R14.pathSatisfies(R14.includes("fontFamily"), ["path"])
3053
+ var typographyFontFamilyPredicate = R15.allPass([
3054
+ R15.pathSatisfies(R15.includes("typography"), ["path"]),
3055
+ R15.pathSatisfies(R15.includes("fontFamily"), ["path"])
3264
3056
  ]);
3265
3057
  var typography = {
3266
3058
  name: "ds/css-typography",
@@ -3274,17 +3066,17 @@ var typography = {
3274
3066
  format: "css",
3275
3067
  usesDtcg
3276
3068
  });
3277
- const filteredTokens = R14.reject(typographyFontFamilyPredicate, dictionary.allTokens);
3069
+ const filteredTokens = R15.reject(typographyFontFamilyPredicate, dictionary.allTokens);
3278
3070
  const formattedMap = filteredTokens.map((token) => ({
3279
3071
  token,
3280
3072
  formatted: format(token)
3281
3073
  }));
3282
3074
  buildOptions.buildTokenFormats[destination] = formattedMap;
3283
- const formattedTokens = formattedMap.map(R14.view(R14.lensProp("formatted"))).join("\n");
3075
+ const formattedTokens = formattedMap.map(R15.view(R15.lensProp("formatted"))).join("\n");
3284
3076
  const content = selector ? `${selector} {
3285
3077
  ${formattedTokens}
3286
3078
  }` : formattedTokens;
3287
- const body = R14.isNotNil(layer) ? `@layer ${layer} {
3079
+ const body = R15.isNotNil(layer) ? `@layer ${layer} {
3288
3080
  ${content}
3289
3081
  }` : content;
3290
3082
  return body;
@@ -3292,17 +3084,17 @@ ${content}
3292
3084
  };
3293
3085
 
3294
3086
  // src/tokens/process/formats/css/type-scale.ts
3295
- import * as R15 from "ramda";
3087
+ import * as R16 from "ramda";
3296
3088
  import { createPropertyFormatter as createPropertyFormatter6 } from "style-dictionary/utils";
3297
- var isTypographyFontFamilyToken = R15.allPass([
3298
- R15.pathSatisfies(R15.includes("typography"), ["path"]),
3299
- R15.pathSatisfies(R15.includes("fontFamily"), ["path"])
3089
+ var isTypographyFontFamilyToken = R16.allPass([
3090
+ R16.pathSatisfies(R16.includes("typography"), ["path"]),
3091
+ R16.pathSatisfies(R16.includes("fontFamily"), ["path"])
3300
3092
  ]);
3301
3093
  var formatTypographySizeToken = (format, token) => {
3302
3094
  const [name, value] = format(token).replace(/;$/, "").split(": ");
3303
3095
  let calc;
3304
3096
  let round;
3305
- if (R15.startsWith(["font-size"], token.path)) {
3097
+ if (R16.startsWith(["font-size"], token.path)) {
3306
3098
  calc = `calc(${value} * var(--_ds-font-size-factor))`;
3307
3099
  round = `round(${calc}, 1px)`;
3308
3100
  } else {
@@ -3310,7 +3102,7 @@ var formatTypographySizeToken = (format, token) => {
3310
3102
  }
3311
3103
  return { name, calc, round: round ?? calc };
3312
3104
  };
3313
- var formatTypographySizeTokens = (format, tokens) => R15.reduce(
3105
+ var formatTypographySizeTokens = (format, tokens) => R16.reduce(
3314
3106
  (acc, token) => {
3315
3107
  const { name, calc, round } = formatTypographySizeToken(format, token);
3316
3108
  acc.tokens.push(token);
@@ -3333,7 +3125,7 @@ var typeScale = {
3333
3125
  format: "css",
3334
3126
  usesDtcg
3335
3127
  });
3336
- const filteredTokens = R15.reject(R15.anyPass([isTypographyFontFamilyToken]), dictionary.allTokens);
3128
+ const filteredTokens = R16.reject(R16.anyPass([isTypographyFontFamilyToken]), dictionary.allTokens);
3337
3129
  const formattedTokens = formatTypographySizeTokens(format, filteredTokens);
3338
3130
  const formattedMap = formattedTokens.round.map((t, i) => ({
3339
3131
  token: formattedTokens.tokens[i],
@@ -3344,7 +3136,7 @@ var typeScale = {
3344
3136
  const content = `${selector} {
3345
3137
  ${sizeFactor}${sizingTemplate(formattedTokens)}
3346
3138
  }`;
3347
- const body = R15.isNotNil(layer) ? `@layer ${layer} {
3139
+ const body = R16.isNotNil(layer) ? `@layer ${layer} {
3348
3140
  ${content}
3349
3141
  }` : content;
3350
3142
  return body;
@@ -3383,7 +3175,7 @@ var colorSchemeVariables = ({ "color-scheme": colorScheme2 = "light", theme }) =
3383
3175
  {
3384
3176
  destination: `color-scheme/${colorScheme2}.css`,
3385
3177
  format: formats.colorScheme.name,
3386
- filter: (token) => typeEquals("color", token) && !R16.startsWith(["global"], token.path)
3178
+ filter: (token) => typeEquals("color", token) && !R17.startsWith(["global"], token.path)
3387
3179
  }
3388
3180
  ],
3389
3181
  options: {
@@ -3434,7 +3226,7 @@ var colorCategoryVariables = (opts) => ({ "color-scheme": colorScheme2, theme, .
3434
3226
  };
3435
3227
 
3436
3228
  // src/tokens/process/configs/semantic.ts
3437
- import * as R17 from "ramda";
3229
+ import * as R18 from "ramda";
3438
3230
  import { outputReferencesFilter } from "style-dictionary/utils";
3439
3231
  var semanticVariables = ({ theme }) => {
3440
3232
  const selector = `:root`;
@@ -3457,8 +3249,8 @@ var semanticVariables = ({ theme }) => {
3457
3249
  destination: `semantic.css`,
3458
3250
  format: formats.semantic.name,
3459
3251
  filter: (token) => {
3460
- const isUwantedToken = R17.anyPass([R17.includes("primitives/global")])(token.filePath);
3461
- const isPrivateToken = R17.includes("_", token.path);
3252
+ const isUwantedToken = R18.anyPass([R18.includes("primitives/global")])(token.filePath);
3253
+ const isPrivateToken = R18.includes("_", token.path);
3462
3254
  const unwantedPaths = pathStartsWithOneOf(
3463
3255
  ["size", "_size", "font-size", "line-height", "letter-spacing"],
3464
3256
  token
@@ -3481,7 +3273,7 @@ var semanticVariables = ({ theme }) => {
3481
3273
  };
3482
3274
 
3483
3275
  // src/tokens/process/configs/size.ts
3484
- import * as R18 from "ramda";
3276
+ import * as R19 from "ramda";
3485
3277
  import { outputReferencesFilter as outputReferencesFilter2 } from "style-dictionary/utils";
3486
3278
  var sizeVariables = ({ theme }) => {
3487
3279
  const selector = `:root, [data-size]`;
@@ -3504,8 +3296,8 @@ var sizeVariables = ({ theme }) => {
3504
3296
  destination: `size.css`,
3505
3297
  format: formats.size.name,
3506
3298
  filter: (token) => {
3507
- const isUwantedToken = R18.anyPass([R18.includes("primitives/global")])(token.filePath);
3508
- const isPrivateToken = R18.includes("_", token.path);
3299
+ const isUwantedToken = R19.anyPass([R19.includes("primitives/global")])(token.filePath);
3300
+ const isPrivateToken = R19.includes("_", token.path);
3509
3301
  return pathStartsWithOneOf(["size", "_size"], token) && !(isUwantedToken || isPrivateToken);
3510
3302
  }
3511
3303
  }
@@ -3522,7 +3314,7 @@ var sizeVariables = ({ theme }) => {
3522
3314
  };
3523
3315
 
3524
3316
  // src/tokens/process/configs/size-mode.ts
3525
- import * as R19 from "ramda";
3317
+ import * as R20 from "ramda";
3526
3318
  var sizeModeVariables = ({ theme, size: size2 }) => {
3527
3319
  const selector = `:root`;
3528
3320
  const layer = `ds.theme.size-mode`;
@@ -3545,7 +3337,7 @@ var sizeModeVariables = ({ theme, size: size2 }) => {
3545
3337
  destination: `size-mode/${size2}.css`,
3546
3338
  format: formats.sizeMode.name,
3547
3339
  filter: (token) => {
3548
- return R19.equals(["_size", "mode-font-size"], token.path);
3340
+ return R20.equals(["_size", "mode-font-size"], token.path);
3549
3341
  }
3550
3342
  }
3551
3343
  ]
@@ -3645,18 +3437,18 @@ var typographyVariables = ({ theme, typography: typography2 }) => {
3645
3437
 
3646
3438
  // src/tokens/process/utils/getMultidimensionalThemes.ts
3647
3439
  import { kebabCase } from "change-case";
3648
- import pc2 from "picocolors";
3649
- import * as R20 from "ramda";
3440
+ import pc3 from "picocolors";
3441
+ import * as R21 from "ramda";
3650
3442
  var getMultidimensionalThemes = (processed$themes, dimensions) => {
3651
3443
  const verboseLogging = buildOptions?.verbose;
3652
3444
  const grouped$themes = groupThemes(processed$themes);
3653
3445
  const permutations = permutateThemes(grouped$themes);
3654
3446
  const ALL_DEPENDENT_ON = ["theme"];
3655
- const keys2 = R20.keys(grouped$themes);
3447
+ const keys2 = R21.keys(grouped$themes);
3656
3448
  const nonDependentKeys = keys2.filter((x) => ![...ALL_DEPENDENT_ON, ...dimensions].includes(x));
3657
3449
  if (verboseLogging) {
3658
- console.log(pc2.cyan(`\u{1F50E} Finding theme permutations for ${dimensions}`));
3659
- console.log(pc2.cyan(` (ignoring permutations for ${nonDependentKeys})`));
3450
+ console.log(pc3.cyan(`\u{1F50E} Finding theme permutations for ${dimensions}`));
3451
+ console.log(pc3.cyan(` (ignoring permutations for ${nonDependentKeys})`));
3660
3452
  }
3661
3453
  return permutations.filter((val) => {
3662
3454
  const filters = nonDependentKeys.map((x) => val.permutation[x] === grouped$themes[x][0].name);
@@ -3692,7 +3484,7 @@ function groupThemes(themes) {
3692
3484
  }
3693
3485
  return groups;
3694
3486
  }
3695
- var hasUnknownProps = R20.pipe(R20.values, R20.none(R20.equals("unknown")), R20.not);
3487
+ var hasUnknownProps = R21.pipe(R21.values, R21.none(R21.equals("unknown")), R21.not);
3696
3488
  function permutateThemes(groups) {
3697
3489
  const separator = "_";
3698
3490
  const permutations = cartesian(Object.values(groups));
@@ -3702,8 +3494,8 @@ function permutateThemes(groups) {
3702
3494
  const { group, name, selectedTokenSets } = theme;
3703
3495
  let updatedPermutation = acc.permutation;
3704
3496
  if (group) {
3705
- const groupProp = R20.lensProp(group);
3706
- updatedPermutation = R20.set(groupProp, name, updatedPermutation);
3497
+ const groupProp = R21.lensProp(group);
3498
+ updatedPermutation = R21.set(groupProp, name, updatedPermutation);
3707
3499
  }
3708
3500
  const updatedName = `${String(acc.name)}${acc ? separator : ""}${name}`;
3709
3501
  const sets = [...acc.selectedTokenSets, ...filterTokenSets(selectedTokenSets)];
@@ -3794,7 +3586,7 @@ var getConfigsForThemeDimensions = (getConfig, processed$themes, dimensions, opt
3794
3586
  obj.filePath = tokenSet;
3795
3587
  }
3796
3588
  });
3797
- tokenSource.tokens = R21.mergeDeepRight(tokenSource.tokens, tokensWithFilePath);
3589
+ tokenSource.tokens = R22.mergeDeepRight(tokenSource.tokens, tokensWithFilePath);
3798
3590
  }
3799
3591
  }
3800
3592
  } else {
@@ -3886,18 +3678,18 @@ async function processPlatform(options) {
3886
3678
  const UNSAFE_DEFAULT_COLOR = process.env.UNSAFE_DEFAULT_COLOR ?? "";
3887
3679
  if (UNSAFE_DEFAULT_COLOR) {
3888
3680
  console.warn(
3889
- pc3.yellow(
3681
+ pc4.yellow(
3890
3682
  `
3891
- \u26A0\uFE0F UNSAFE_DEFAULT_COLOR is set to ${pc3.blue(UNSAFE_DEFAULT_COLOR)}. This will override the default color.`
3683
+ \u26A0\uFE0F UNSAFE_DEFAULT_COLOR is set to ${pc4.blue(UNSAFE_DEFAULT_COLOR)}. This will override the default color.`
3892
3684
  )
3893
3685
  );
3894
3686
  }
3895
3687
  const UNSAFE_COLOR_GROUPS = Array.from(process.env.UNSAFE_COLOR_GROUPS?.split(",") ?? []);
3896
3688
  if (UNSAFE_COLOR_GROUPS.length > 0) {
3897
3689
  console.warn(
3898
- pc3.yellow(
3690
+ pc4.yellow(
3899
3691
  `
3900
- \u26A0\uFE0F UNSAFE_COLOR_GROUPS is set to ${pc3.blue(`[${UNSAFE_COLOR_GROUPS.join(", ")}]`)}. This will override the default color groups.`
3692
+ \u26A0\uFE0F UNSAFE_COLOR_GROUPS is set to ${pc4.blue(`[${UNSAFE_COLOR_GROUPS.join(", ")}]`)}. This will override the default color groups.`
3901
3693
  )
3902
3694
  );
3903
3695
  }
@@ -3907,24 +3699,24 @@ async function processPlatform(options) {
3907
3699
  buildOptions.colorGroups = colorGroups;
3908
3700
  if (!buildOptions.defaultColor) {
3909
3701
  const customColors = getCustomColors(processed$themes, colorGroups);
3910
- const firstMainColor = R22.head(customColors);
3702
+ const firstMainColor = R23.head(customColors);
3911
3703
  buildOptions.defaultColor = firstMainColor;
3912
3704
  }
3913
3705
  if (buildOptions.defaultColor) {
3914
3706
  console.log(`
3915
- \u{1F3A8} Using ${pc3.blue(buildOptions.defaultColor)} as default color`);
3707
+ \u{1F3A8} Using ${pc4.blue(buildOptions.defaultColor)} as default color`);
3916
3708
  }
3917
3709
  const sizeModes = processed$themes.filter((x) => x.group === "size").map((x) => x.name);
3918
3710
  buildOptions.sizeModes = sizeModes;
3919
3711
  if (!buildOptions.defaultSize) {
3920
- const defaultSize = R22.head(sizeModes);
3712
+ const defaultSize = R23.head(sizeModes);
3921
3713
  buildOptions.defaultSize = defaultSize;
3922
3714
  }
3923
3715
  if (buildOptions.defaultSize) {
3924
3716
  console.log(`
3925
- \u{1F4CF} Using ${pc3.blue(buildOptions.defaultSize)} as default size`);
3717
+ \u{1F4CF} Using ${pc4.blue(buildOptions.defaultSize)} as default size`);
3926
3718
  }
3927
- const buildAndSdConfigs = R22.map((buildConfig) => {
3719
+ const buildAndSdConfigs = R23.map((buildConfig) => {
3928
3720
  const sdConfigs = getConfigsForThemeDimensions(buildConfig.getConfig, processed$themes, buildConfig.dimensions, {
3929
3721
  tokensDir,
3930
3722
  tokenSets
@@ -3958,19 +3750,19 @@ async function processPlatform(options) {
3958
3750
  typeScale: [initResult]
3959
3751
  };
3960
3752
  try {
3961
- for (const [buildName, { buildConfig, sdConfigs }] of R22.toPairs(buildAndSdConfigs)) {
3753
+ for (const [buildName, { buildConfig, sdConfigs }] of R23.toPairs(buildAndSdConfigs)) {
3962
3754
  if (!(buildConfig.enabled?.() ?? true)) {
3963
3755
  continue;
3964
3756
  }
3965
3757
  if (sdConfigs.length > 0) {
3966
3758
  console.log(`
3967
- \u{1F371} Building ${pc3.green(buildConfig.name ?? buildName)}`);
3759
+ \u{1F371} Building ${pc4.green(buildConfig.name ?? buildName)}`);
3968
3760
  const results = await Promise.all(
3969
3761
  sdConfigs.map(async (sdConfig) => {
3970
3762
  const { config, permutation } = sdConfig;
3971
3763
  const modes = ["theme", ...buildConfig.dimensions];
3972
3764
  const modeMessage = modes.map((x) => permutation[x]).join(" - ");
3973
- const logMessage = R22.isNil(buildConfig.log) ? modeMessage : buildConfig?.log(sdConfig);
3765
+ const logMessage = R23.isNil(buildConfig.log) ? modeMessage : buildConfig?.log(sdConfig);
3974
3766
  console.log(logMessage);
3975
3767
  const sdOptions = { cache: true };
3976
3768
  const sdExtended = await sd.extend(config);
@@ -4019,20 +3811,23 @@ var formatTheme = async (themeConfig) => {
4019
3811
  var formatThemeCSS = async (themeConfig) => {
4020
3812
  const processedBuilds = await formatTheme(themeConfig);
4021
3813
  const themeCSSFiles = createThemeCSSFiles({ processedBuilds });
4022
- return R23.head(themeCSSFiles)?.output ?? "";
3814
+ return R24.head(themeCSSFiles)?.output ?? "";
4023
3815
  };
4024
3816
  export {
4025
3817
  HSLToHex,
4026
3818
  RESERVED_COLORS,
4027
3819
  areColorsContrasting,
3820
+ baseColorNames,
4028
3821
  baseColors,
4029
3822
  canTextBeUsedOnColors,
4030
3823
  cliOptions,
4031
3824
  colorMetadata,
4032
3825
  colorNames,
3826
+ configFileCreateSchema as configSchema,
4033
3827
  convertColor,
4034
3828
  convertToHex,
4035
3829
  createTokens,
3830
+ dsLinkColor,
4036
3831
  formatThemeCSS,
4037
3832
  formatTokens,
4038
3833
  generateColorContrast,