An open source design system that's fully customizable and agent ready
TypeScript
feat(theme-neutral): adopt approved palette (#5987)
rubyycheung75a4d1dee3ea
diff --git a/.changeset/neutral-theme-palette-adoption.md b/.changeset/neutral-theme-palette-adoption.mdnew file mode 100644index 0000000000..8bb1d319ea--- /dev/null+++ b/.changeset/neutral-theme-palette-adoption.md@@ -0,0 +1,10 @@+---+'@astryxdesign/theme-neutral': patch+'@astryxdesign/cli': patch+---++[new] Add Neutral's reproducible, theme-owned OKLCH palette without changing+its runtime token mappings. The request, receipt, generated result, and CLI+template artifacts are committed together for review.++@rubyycheungdiff --git a/packages/cli/assets/templates/themes/manifest.json b/packages/cli/assets/templates/themes/manifest.jsonindex 90fa0a2f27..ade41f6415 100644--- a/packages/cli/assets/templates/themes/manifest.json+++ b/packages/cli/assets/templates/themes/manifest.json@@ -9,10 +9,7 @@"maintained": false,"entry": "butterTheme.ts","exportName": "butterTheme",- "files": [- "butterTheme.ts",- "icons.tsx"- ]+ "files": ["butterTheme.ts", "icons.tsx"]},{"slug": "chocolate",@@ -21,10 +18,7 @@"maintained": false,"entry": "chocolateTheme.ts","exportName": "chocolateTheme",- "files": [- "chocolateTheme.ts",- "icons.tsx"- ]+ "files": ["chocolateTheme.ts", "icons.tsx"]},{"slug": "gothic",@@ -33,10 +27,7 @@"maintained": false,"entry": "gothicTheme.ts","exportName": "gothicTheme",- "files": [- "gothicTheme.ts",- "icons.tsx"- ]+ "files": ["gothicTheme.ts", "icons.tsx"]},{"slug": "matcha",@@ -45,10 +36,7 @@"maintained": false,"entry": "matchaTheme.ts","exportName": "matchaTheme",- "files": [- "matchaTheme.ts",- "icons.tsx"- ]+ "files": ["matchaTheme.ts", "icons.tsx"]},{"slug": "neutral",@@ -59,7 +47,11 @@"exportName": "neutralTheme","files": ["neutralTheme.ts",- "icons.tsx"+ "icons.tsx",+ "neutralPalettes.ts",+ "neutralPalettes.generated.ts",+ "neutralPalettes.generated.receipt.json",+ "palette.config.json"]},{@@ -69,10 +61,7 @@"maintained": false,"entry": "stoneTheme.ts","exportName": "stoneTheme",- "files": [- "stoneTheme.ts",- "icons.tsx"- ]+ "files": ["stoneTheme.ts", "icons.tsx"]},{"slug": "y2k",@@ -81,10 +70,7 @@"maintained": false,"entry": "y2kTheme.ts","exportName": "y2kTheme",- "files": [- "y2kTheme.ts",- "icons.tsx"- ]+ "files": ["y2kTheme.ts", "icons.tsx"]}]}diff --git a/packages/cli/assets/templates/themes/neutral/neutralPalettes.generated.receipt.json b/packages/cli/assets/templates/themes/neutral/neutralPalettes.generated.receipt.jsonnew file mode 100644index 0000000000..0191398191--- /dev/null+++ b/packages/cli/assets/templates/themes/neutral/neutralPalettes.generated.receipt.json@@ -0,0 +1,616 @@+{+ "schemaVersion": 1,+ "recipe": "astryx-oklch-v1",+ "candidateSha256": "847746fce1b7199c19ec270b76f096cd953df733630853d93cdc64fa4156f78e",+ "request": {+ "recipe": "astryx-oklch-v1",+ "vibrancy": 50,+ "neutralProfile": "neutral-v1",+ "modeStrategy": "light-and-dark",+ "stops": [+ 0,+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 60,+ 65,+ 70,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "families": [+ {+ "id": "neutral",+ "name": "Neutral",+ "seed": "#777777",+ "kind": "neutral",+ "anchors": []+ },+ {+ "id": "red",+ "name": "Red",+ "seed": "#d62830",+ "kind": "chromatic",+ "anchors": []+ },+ {+ "id": "orange",+ "name": "Orange",+ "seed": "#d57113",+ "kind": "chromatic",+ "anchors": []+ },+ {+ "id": "yellow",+ "name": "Yellow",+ "seed": "#f8c723",+ "kind": "chromatic",+ "anchors": [+ {+ "mode": "light",+ "stop": 80,+ "color": "#f8c723",+ "policy": "flexible"+ }+ ]+ },+ {+ "id": "green",+ "name": "Green",+ "seed": "#358a3a",+ "kind": "chromatic",+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#358a3a",+ "policy": "flexible"+ }+ ]+ },+ {+ "id": "teal",+ "name": "Teal",+ "seed": "#0c7365",+ "kind": "chromatic",+ "anchors": []+ },+ {+ "id": "cyan",+ "name": "Cyan",+ "seed": "#0c6f82",+ "kind": "chromatic",+ "anchors": []+ },+ {+ "id": "blue",+ "name": "Blue",+ "seed": "#0074e2",+ "kind": "chromatic",+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#0074e2",+ "policy": "exact"+ }+ ]+ },+ {+ "id": "purple",+ "name": "Purple",+ "seed": "#980fb2",+ "kind": "chromatic",+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#980fb2",+ "policy": "flexible"+ }+ ]+ },+ {+ "id": "pink",+ "name": "Pink",+ "seed": "#b10e69",+ "kind": "chromatic",+ "anchors": []+ }+ ]+ },+ "diagnostics": {+ "families": {+ "neutral": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.056735649681861,+ "maximumAdjacentDeltaE": 17.763777191722603,+ "maximumHueDrift": 0,+ "hueIdentityRisk": null,+ "gamutMappedStops": [],+ "anchors": []+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.056735649681861,+ "maximumAdjacentDeltaE": 17.763777191722603,+ "maximumHueDrift": 0,+ "hueIdentityRisk": null,+ "gamutMappedStops": [],+ "anchors": []+ }+ },+ "red": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.204099411570246,+ "maximumAdjacentDeltaE": 19.896679473359143,+ "maximumHueDrift": 3.9781468539510456,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 70,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.159661357539602,+ "maximumAdjacentDeltaE": 19.896679473359143,+ "maximumHueDrift": 3.8052933843198957,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 10,+ 15,+ 20,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ }+ },+ "orange": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.205755964742814,+ "maximumAdjacentDeltaE": 18.695314931199228,+ "maximumHueDrift": 17.283353703181774,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 60,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.205755964742814,+ "maximumAdjacentDeltaE": 18.695314931199228,+ "maximumHueDrift": 17.283353703181774,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ }+ },+ "yellow": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.29473924397966,+ "maximumAdjacentDeltaE": 18.108804228656158,+ "maximumHueDrift": 8.277463562561081,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 60,+ 65,+ 95,+ 100+ ],+ "anchors": [+ {+ "mode": "light",+ "stop": 80,+ "color": "#f8c723",+ "policy": "flexible",+ "generatedColor": "#eec448",+ "deltaE": 2.555748582763421+ }+ ]+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.163296946152699,+ "maximumAdjacentDeltaE": 18.108804228656158,+ "maximumHueDrift": 8.277463562561081,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 60,+ 95,+ 100+ ],+ "anchors": []+ }+ },+ "green": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.107684025645804,+ "maximumAdjacentDeltaE": 19.13154978272725,+ "maximumHueDrift": 1.8635734402253092,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 10,+ 15,+ 20,+ 100+ ],+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#358a3a",+ "policy": "flexible",+ "generatedColor": "#3c8a3f",+ "deltaE": 0.8561918662944262+ }+ ]+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.166930656117178,+ "maximumAdjacentDeltaE": 18.639066757439643,+ "maximumHueDrift": 0.6445863585763618,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 100+ ],+ "anchors": []+ }+ },+ "teal": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.166748465835485,+ "maximumAdjacentDeltaE": 18.230966590437585,+ "maximumHueDrift": 1.6736718288519796,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 100+ ],+ "anchors": []+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.144200511227181,+ "maximumAdjacentDeltaE": 18.230966590437585,+ "maximumHueDrift": 2.376056599037838,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 100+ ],+ "anchors": []+ }+ },+ "cyan": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.163846535832288,+ "maximumAdjacentDeltaE": 18.341697754919643,+ "maximumHueDrift": 1.448564967034713,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 60,+ 90,+ 95,+ 100+ ],+ "anchors": []+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.169974786485362,+ "maximumAdjacentDeltaE": 18.341697754919643,+ "maximumHueDrift": 1.329774925710467,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 95,+ 100+ ],+ "anchors": []+ }+ },+ "blue": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.114451923385638,+ "maximumAdjacentDeltaE": 19.354634049078946,+ "maximumHueDrift": 4.261077952851451,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 65,+ 70,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#0074e2",+ "policy": "exact",+ "generatedColor": "#0074e2",+ "deltaE": 0+ }+ ]+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.216746457814964,+ "maximumAdjacentDeltaE": 19.354634049078946,+ "maximumHueDrift": 4.232869197536161,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 70,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ }+ },+ "purple": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 3.581597545905899,+ "maximumAdjacentDeltaE": 19.96161232121409,+ "maximumHueDrift": 0.6423866859174723,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#980fb2",+ "policy": "flexible",+ "generatedColor": "#9f3cb5",+ "deltaE": 5.670039358248314+ }+ ]+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.242456796309444,+ "maximumAdjacentDeltaE": 19.160174226043452,+ "maximumHueDrift": 0.7664515813212347,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ }+ },+ "pink": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.24426147768217,+ "maximumAdjacentDeltaE": 19.77180068574261,+ "maximumHueDrift": 1.1308247093818409,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.168821172375738,+ "maximumAdjacentDeltaE": 19.521328561616023,+ "maximumHueDrift": 1.278567258732096,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 10,+ 15,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ }+ }+ },+ "coordination": [+ {+ "mode": "light",+ "stop": 50,+ "closestFamilies": [+ "Teal",+ "Cyan"+ ],+ "minimumFamilyDeltaE": 6.359490266320177,+ "strongestFamily": "Purple",+ "weakestFamily": "Cyan",+ "chromaRatio": 1.94639550592773+ },+ {+ "mode": "dark",+ "stop": 50,+ "closestFamilies": [+ "Teal",+ "Cyan"+ ],+ "minimumFamilyDeltaE": 6.19928035179563,+ "strongestFamily": "Red",+ "weakestFamily": "Cyan",+ "chromaRatio": 1.5905982159145873+ }+ ]+ }+}diff --git a/packages/cli/assets/templates/themes/neutral/neutralPalettes.generated.ts b/packages/cli/assets/templates/themes/neutral/neutralPalettes.generated.tsnew file mode 100644index 0000000000..76d86846cd--- /dev/null+++ b/packages/cli/assets/templates/themes/neutral/neutralPalettes.generated.ts@@ -0,0 +1,498 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++// Generated by astryx-oklch-v1. Review before committing.+// prettier-ignore+export const palette = {+ "neutral": {+ "name": "Neutral",+ "light": {+ "0": "#000000",+ "5": "#111111",+ "10": "#1b1b1b",+ "15": "#262626",+ "20": "#303030",+ "25": "#3b3b3b",+ "30": "#474747",+ "35": "#525252",+ "40": "#5e5e5e",+ "45": "#6a6a6a",+ "50": "#777777",+ "55": "#848484",+ "60": "#919191",+ "65": "#9e9e9e",+ "70": "#ababab",+ "75": "#b9b9b9",+ "80": "#c6c6c6",+ "85": "#d4d4d4",+ "90": "#e2e2e2",+ "95": "#f1f1f1",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#111111",+ "10": "#1b1b1b",+ "15": "#262626",+ "20": "#303030",+ "25": "#3b3b3b",+ "30": "#474747",+ "35": "#525252",+ "40": "#5e5e5e",+ "45": "#6a6a6a",+ "50": "#777777",+ "55": "#848484",+ "60": "#919191",+ "65": "#9e9e9e",+ "70": "#ababab",+ "75": "#b9b9b9",+ "80": "#c6c6c6",+ "85": "#d4d4d4",+ "90": "#e2e2e2",+ "95": "#f1f1f1",+ "100": "#ffffff"+ }+ },+ "red": {+ "name": "Red",+ "light": {+ "0": "#000000",+ "5": "#2c0000",+ "10": "#3e0002",+ "15": "#500004",+ "20": "#620008",+ "25": "#76000c",+ "30": "#8a0011",+ "35": "#9e0015",+ "40": "#af1320",+ "45": "#c0262c",+ "50": "#cf3738",+ "55": "#de4745",+ "60": "#ed5753",+ "65": "#fa6762",+ "70": "#ff7f77",+ "75": "#ff9890",+ "80": "#ffaea7",+ "85": "#ffc4be",+ "90": "#ffd8d4",+ "95": "#ffece9",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#2c0000",+ "10": "#3e0002",+ "15": "#500004",+ "20": "#620008",+ "25": "#74040f",+ "30": "#841118",+ "35": "#951f22",+ "40": "#a52c2c",+ "45": "#b53938",+ "50": "#c44743",+ "55": "#d35550",+ "60": "#e1645e",+ "65": "#ee736c",+ "70": "#fb837b",+ "75": "#ff9890",+ "80": "#ffaea7",+ "85": "#ffc4be",+ "90": "#ffd8d4",+ "95": "#ffece9",+ "100": "#ffffff"+ }+ },+ "orange": {+ "name": "Orange",+ "light": {+ "0": "#000000",+ "5": "#250500",+ "10": "#340d00",+ "15": "#431600",+ "20": "#521f00",+ "25": "#622700",+ "30": "#733100",+ "35": "#833a00",+ "40": "#944400",+ "45": "#a54f00",+ "50": "#b45c00",+ "55": "#c76600",+ "60": "#d97000",+ "65": "#e97e1d",+ "70": "#f58d3a",+ "75": "#ff9e55",+ "80": "#ffb37e",+ "85": "#ffc7a1",+ "90": "#ffdac2",+ "95": "#ffede1",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#250500",+ "10": "#340d00",+ "15": "#431600",+ "20": "#521f00",+ "25": "#622700",+ "30": "#733100",+ "35": "#833a00",+ "40": "#944400",+ "45": "#a54f00",+ "50": "#b45c00",+ "55": "#c46813",+ "60": "#d1762b",+ "65": "#df843f",+ "70": "#eb9352",+ "75": "#f7a266",+ "80": "#ffb37e",+ "85": "#ffc7a1",+ "90": "#ffdac2",+ "95": "#ffede1",+ "100": "#ffffff"+ }+ },+ "yellow": {+ "name": "Yellow",+ "light": {+ "0": "#000000",+ "5": "#190f00",+ "10": "#251a00",+ "15": "#312400",+ "20": "#3e2e00",+ "25": "#4b3900",+ "30": "#584400",+ "35": "#664f00",+ "40": "#745b00",+ "45": "#836700",+ "50": "#927300",+ "55": "#a17f00",+ "60": "#b18c00",+ "65": "#c29900",+ "70": "#d2a700",+ "75": "#e2b623",+ "80": "#eec448",+ "85": "#f8d36a",+ "90": "#ffe193",+ "95": "#fff0ca",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#190f00",+ "10": "#251a00",+ "15": "#312400",+ "20": "#3e2e00",+ "25": "#4b3900",+ "30": "#584400",+ "35": "#664f00",+ "40": "#745b00",+ "45": "#836700",+ "50": "#927300",+ "55": "#a17f00",+ "60": "#b18c00",+ "65": "#be9921",+ "70": "#cba73d",+ "75": "#d7b554",+ "80": "#e3c36c",+ "85": "#efd284",+ "90": "#fae19e",+ "95": "#fff0c8",+ "100": "#ffffff"+ }+ },+ "green": {+ "name": "Green",+ "light": {+ "0": "#000000",+ "5": "#001800",+ "10": "#002400",+ "15": "#003002",+ "20": "#003d05",+ "25": "#00490b",+ "30": "#0b5615",+ "35": "#17631e",+ "40": "#237028",+ "45": "#2f7d33",+ "50": "#3c8a3f",+ "55": "#4a984c",+ "60": "#59a55b",+ "65": "#6ab26b",+ "70": "#7dbe7e",+ "75": "#90ca90",+ "80": "#a4d6a3",+ "85": "#b7e2b6",+ "90": "#cbeeca",+ "95": "#defadd",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#001702",+ "10": "#012303",+ "15": "#032f07",+ "20": "#093b0e",+ "25": "#124817",+ "30": "#1c5420",+ "35": "#27612a",+ "40": "#326e34",+ "45": "#3e7b40",+ "50": "#4a884c",+ "55": "#589558",+ "60": "#65a266",+ "65": "#74af75",+ "70": "#85bb85",+ "75": "#97c897",+ "80": "#aad4a9",+ "85": "#bce0bb",+ "90": "#ceecce",+ "95": "#e1f8e0",+ "100": "#ffffff"+ }+ },+ "teal": {+ "name": "Teal",+ "light": {+ "0": "#000000",+ "5": "#001612",+ "10": "#00221c",+ "15": "#002e27",+ "20": "#003a32",+ "25": "#00463d",+ "30": "#005348",+ "35": "#006154",+ "40": "#006e60",+ "45": "#007c6d",+ "50": "#008b7a",+ "55": "#009986",+ "60": "#01a894",+ "65": "#34b5a1",+ "70": "#56c0ae",+ "75": "#74ccbb",+ "80": "#90d7c8",+ "85": "#a9e2d6",+ "90": "#c1eee4",+ "95": "#d7f9f2",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#001612",+ "10": "#00221c",+ "15": "#002e27",+ "20": "#003a32",+ "25": "#00463d",+ "30": "#005348",+ "35": "#006154",+ "40": "#006e60",+ "45": "#007c6d",+ "50": "#018a7a",+ "55": "#239886",+ "60": "#39a593",+ "65": "#4fb1a0",+ "70": "#68bdad",+ "75": "#81c9bb",+ "80": "#99d5c8",+ "85": "#b1e0d6",+ "90": "#c6ece3",+ "95": "#dbf8f1",+ "100": "#ffffff"+ }+ },+ "cyan": {+ "name": "Cyan",+ "light": {+ "0": "#000000",+ "5": "#00151b",+ "10": "#002028",+ "15": "#002c35",+ "20": "#003743",+ "25": "#004351",+ "30": "#00505f",+ "35": "#005d6e",+ "40": "#006a7d",+ "45": "#00788d",+ "50": "#00859d",+ "55": "#0093ad",+ "60": "#00a2be",+ "65": "#29afcb",+ "70": "#45bdd7",+ "75": "#5ecae3",+ "80": "#75d7ef",+ "85": "#8ee4f9",+ "90": "#afefff",+ "95": "#d9f7ff",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#00151b",+ "10": "#002028",+ "15": "#002c35",+ "20": "#003743",+ "25": "#004351",+ "30": "#00505f",+ "35": "#005d6e",+ "40": "#006a7d",+ "45": "#00788d",+ "50": "#00859d",+ "55": "#1e93aa",+ "60": "#35a0b7",+ "65": "#49adc4",+ "70": "#5dbad1",+ "75": "#71c7dd",+ "80": "#85d5e9",+ "85": "#9ae2f4",+ "90": "#b1eefe",+ "95": "#d9f7ff",+ "100": "#ffffff"+ }+ },+ "blue": {+ "name": "Blue",+ "light": {+ "0": "#000000",+ "5": "#000f30",+ "10": "#001a41",+ "15": "#002452",+ "20": "#002f65",+ "25": "#003978",+ "30": "#00458c",+ "35": "#0050a2",+ "40": "#005cb8",+ "45": "#0067ce",+ "50": "#0074e2",+ "55": "#1e81f0",+ "60": "#348ffd",+ "65": "#529fff",+ "70": "#6eaeff",+ "75": "#88bcff",+ "80": "#a1caff",+ "85": "#b9d7ff",+ "90": "#d0e5ff",+ "95": "#e8f2ff",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#000f30",+ "10": "#001a41",+ "15": "#002452",+ "20": "#002f65",+ "25": "#003978",+ "30": "#00458c",+ "35": "#0050a1",+ "40": "#0d5db1",+ "45": "#1d6ac1",+ "50": "#2c77d0",+ "55": "#3b84de",+ "60": "#4a92eb",+ "65": "#5aa0f8",+ "70": "#6eaeff",+ "75": "#88bcff",+ "80": "#a1caff",+ "85": "#b9d7ff",+ "90": "#d0e5ff",+ "95": "#e8f2ff",+ "100": "#ffffff"+ }+ },+ "purple": {+ "name": "Purple",+ "light": {+ "0": "#000000",+ "5": "#210028",+ "10": "#31003b",+ "15": "#3f004c",+ "20": "#4e045c",+ "25": "#5c0e6c",+ "30": "#6b187c",+ "35": "#781f8a",+ "40": "#842699",+ "45": "#9130a7",+ "50": "#9f3cb5",+ "55": "#ad4dc3",+ "60": "#bb5fd1",+ "65": "#ca72de",+ "70": "#d885eb",+ "75": "#e496f6",+ "80": "#efa8ff",+ "85": "#f3bfff",+ "90": "#f7d5ff",+ "95": "#fbeaff",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#1e0225",+ "10": "#2e0536",+ "15": "#3c0a46",+ "20": "#4a1256",+ "25": "#581c65",+ "30": "#662674",+ "35": "#743183",+ "40": "#823c91",+ "45": "#8f48a0",+ "50": "#9d55ae",+ "55": "#ab62bb",+ "60": "#b870c9",+ "65": "#c57ed5",+ "70": "#d28de2",+ "75": "#de9ced",+ "80": "#eaacf8",+ "85": "#f3bfff",+ "90": "#f7d5ff",+ "95": "#fbeaff",+ "100": "#ffffff"+ }+ },+ "pink": {+ "name": "Pink",+ "light": {+ "0": "#000000",+ "5": "#290013",+ "10": "#3b001e",+ "15": "#4b0028",+ "20": "#5d0034",+ "25": "#70003f",+ "30": "#83004b",+ "35": "#950457",+ "40": "#a61863",+ "45": "#b52970",+ "50": "#c5387c",+ "55": "#d44789",+ "60": "#e25796",+ "65": "#ef67a3",+ "70": "#fc78b1",+ "75": "#ff90bd",+ "80": "#ffa9ca",+ "85": "#ffc0d7",+ "90": "#ffd5e4",+ "95": "#ffeaf1",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#280013",+ "10": "#3b001e",+ "15": "#4b0028",+ "20": "#5c0034",+ "25": "#6d083f",+ "30": "#7d144b",+ "35": "#8d2056",+ "40": "#9d2d63",+ "45": "#ac396f",+ "50": "#bb477c",+ "55": "#c95588",+ "60": "#d76395",+ "65": "#e572a3",+ "70": "#f181b0",+ "75": "#fd92bd",+ "80": "#ffa9ca",+ "85": "#ffc0d7",+ "90": "#ffd5e4",+ "95": "#ffeaf1",+ "100": "#ffffff"+ }+ }+} as const;++export default palette;diff --git a/packages/cli/assets/templates/themes/neutral/neutralPalettes.ts b/packages/cli/assets/templates/themes/neutral/neutralPalettes.tsnew file mode 100644index 0000000000..a59f27d941--- /dev/null+++ b/packages/cli/assets/templates/themes/neutral/neutralPalettes.ts@@ -0,0 +1,7 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/** Neutral's reviewed palette, generated from ../palette.config.json. */+export {+ palette as neutralPalettes,+ palette as default,+} from './neutralPalettes.generated';diff --git a/packages/cli/assets/templates/themes/neutral/palette.config.json b/packages/cli/assets/templates/themes/neutral/palette.config.jsonnew file mode 100644index 0000000000..b67486eff7--- /dev/null+++ b/packages/cli/assets/templates/themes/neutral/palette.config.json@@ -0,0 +1,114 @@+{+ "recipe": "astryx-oklch-v1",+ "vibrancy": 50,+ "neutralProfile": "neutral-v1",+ "modeStrategy": "light-and-dark",+ "stops": [+ 0,+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 60,+ 65,+ 70,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "families": [+ {+ "id": "neutral",+ "name": "Neutral",+ "seed": "#777777",+ "kind": "neutral"+ },+ {+ "id": "red",+ "name": "Red",+ "seed": "#d62830"+ },+ {+ "id": "orange",+ "name": "Orange",+ "seed": "#d57113"+ },+ {+ "id": "yellow",+ "name": "Yellow",+ "seed": "#f8c723",+ "anchors": [+ {+ "mode": "light",+ "stop": 80,+ "color": "#f8c723",+ "policy": "flexible"+ }+ ]+ },+ {+ "id": "green",+ "name": "Green",+ "seed": "#358a3a",+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#358a3a",+ "policy": "flexible"+ }+ ]+ },+ {+ "id": "teal",+ "name": "Teal",+ "seed": "#0c7365"+ },+ {+ "id": "cyan",+ "name": "Cyan",+ "seed": "#0c6f82"+ },+ {+ "id": "blue",+ "name": "Blue",+ "seed": "#0074e2",+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#0074e2",+ "policy": "exact"+ }+ ]+ },+ {+ "id": "purple",+ "name": "Purple",+ "seed": "#980fb2",+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#980fb2",+ "policy": "flexible"+ }+ ]+ },+ {+ "id": "pink",+ "name": "Pink",+ "seed": "#b10e69"+ }+ ]+}diff --git a/packages/themes/neutral/README.md b/packages/themes/neutral/README.mdindex a560bc5dd6..a7f843fce2 100644--- a/packages/themes/neutral/README.md+++ b/packages/themes/neutral/README.md@@ -23,14 +23,37 @@ function App() {### Import paths-| Path | Use case |-| ------------------------------ | ------------------------------------------------------ |-| `@astryxdesign/theme-neutral` | Source build (StyleX compilation via `@astryxdesign/build`) |-| `@astryxdesign/theme-neutral/built` | Pre-built dist (Tailwind, plain CSS, or no build step) |-| `@astryxdesign/theme-neutral/theme.css` | Pre-built CSS file (import in your stylesheet) |+| Path | Use case |+| --------------------------------------- | ----------------------------------------------------------- |+| `@astryxdesign/theme-neutral` | Source build (StyleX compilation via `@astryxdesign/build`) |+| `@astryxdesign/theme-neutral/built` | Pre-built dist (Tailwind, plain CSS, or no build step) |+| `@astryxdesign/theme-neutral/theme.css` | Pre-built CSS file (import in your stylesheet) |If you're using `@astryxdesign/build` for StyleX source compilation, import from the bare path. Otherwise, use `/built`.+## Approved palette++The repository keeps Neutral's generation request in `palette.config.json`, the+exact `astryx-oklch-v1` output in `src/neutralPalettes.generated.ts`, and its+generation receipt beside that file. `src/neutralPalettes.ts` provides the stable+theme-local import. Neutral currently uses 21 numbered stops in each light and+dark ramp, but that layout is a Neutral decision rather than a requirement for+other themes.++Neutral is the reference implementation for palette-aware theme templates.+Templates may follow its ownership, review, and alignment workflow without+copying its colors or stop layout.++Use semantic theme tokens in components. Neutral's runtime theme does not import+the complete authoring palette. Mapping semantic tokens to reviewed stops is a+separate change, so palette generation and token adoption can be reviewed+independently.++The committed request and receipt preserve the generation inputs and provenance.+CLI regeneration is not yet a supported release workflow; until that tooling+ships, treat the generated module and receipt as reviewed artifacts rather than+editing them by hand.+### CSS importAdd the theme CSS to your stylesheet:@@ -45,8 +68,8 @@ This theme uses system fonts; no external font loading is required.## Related Packages-| Package | Description |-| ------------------------------------------------------------------------------------ | -------------------------------------- |-| [`@astryxdesign/core`](https://github.com/facebook/astryx/tree/main/packages/core) | Core components and theme system |-| [`@astryxdesign/build`](https://github.com/facebook/astryx/tree/main/packages/build) | Build plugins for StyleX source builds |+| Package | Description |+| ------------------------------------------------------------------------------------ | ----------------------------------------- |+| [`@astryxdesign/core`](https://github.com/facebook/astryx/tree/main/packages/core) | Core components and theme system |+| [`@astryxdesign/build`](https://github.com/facebook/astryx/tree/main/packages/build) | Build plugins for StyleX source builds || [`@astryxdesign/cli`](https://github.com/facebook/astryx/tree/main/packages/cli) | CLI tooling including `astryx docs theme` |diff --git a/packages/themes/neutral/neutral.spec.md b/packages/themes/neutral/neutral.spec.mdindex 16dcaa89cf..8e1fb13421 100644--- a/packages/themes/neutral/neutral.spec.md+++ b/packages/themes/neutral/neutral.spec.md@@ -3,9 +3,9 @@ schema_version: 2template_version: 1kind: themeid: theme:neutral-authority: draft-approved_by: null-approved_at: null+authority: current+approved_by: rubyycheung+approved_at: 2026-09-04review_triggers:[tokens, palette-values, component-mappings, contrast, artifacts]verified_by: [scripts/check-badge-contrast.test.mjs]@@ -23,11 +23,13 @@ references:# Neutral theme specification-This draft is a theme-record example and a factual inventory. It does not decide+This record is the current approved palette record. It does not decidecross-theme local-token, palette-generation, compiler, or artifact APIs;current `spec:AST-006` owns the accepted local-token contract. This record keeps-Neutral's package adoption separate: no value, mapping, rendered evidence, or-implementation is approved while this record remains draft.+Neutral's package adoption separate. DEC-2 ratifies the exact palette shipped+by this change. Token remapping, proposed local-token roles, and additional+component mappings remain separate work; they are not part of this release and+must not be treated as an approved public contract.## Intent and audience@@ -97,11 +99,13 @@ not authorize a broader meaning.## Tonal palette definitions-Candidate source work contains complete light and separately tuned dark ramps for-neutral, red, orange, yellow, green, teal, cyan, blue, purple, and pink. This is-useful theme-owned inventory and evidence, not a requirement to adopt a palette-generator or publish palette artifacts. Those cross-theme choices require a-separate draft system spec.+Candidate source work contains complete light and dark ramps for neutral, red,+orange, yellow, green, teal, cyan, blue, purple, and pink. The committed request,+generated module, and receipt make the reviewed `astryx-oklch-v1` result+reproducible. Draft `spec:AST-018` separately owns the cross-theme authoring and+validation contract. Regeneration is an explicit reviewed palette change and+never occurs during a normal theme build. Mapping runtime tokens to these stops+is reviewed in a separate stacked change.## Component and state mappings@@ -143,7 +147,7 @@ light mode and `#6d9cfe` in dark mode, but those values are not an accessibilityclaim by themselves. Adoption requires the actual Badge informational foregroundand background pairing to meet its threshold in rendered light and dark states;every later mapping needs receipts for its foreground, graphical-object,-interaction, and disabled states. No palette tone is accessible by itself, and+interaction, and disabled states. No palette stop is accessible by itself, andcolor cannot replace another signal required by the component contract. Thisrecord will own those pairings, exceptions, measurements, and known gaps afterthe shared methodology is current; it will not copy the methodology or shared@@ -151,9 +155,10 @@ measurement-tool implementation.## Build and artifact contract-The package manifest and existing build tests define Neutral's current runtime,-CSS, declaration, and export outputs. This record does not require new generated-palette or local-token artifacts.+The package manifest and build tests define Neutral's runtime, CSS, declaration,+and export outputs. The palette remains in a theme-owned source file for+authoring and audits. It is not part of `defineTheme`, the package's runtime+exports, generated CSS, or generic theme-build artifacts.## Verification map@@ -167,10 +172,10 @@ palette or local-token artifacts.## Decision log-The decision below records settled cross-theme ownership input from `cixzhang`.-The final Neutral value, mappings, and rendered-evidence ratification belong to-`rubyycheung`. This record remains `authority: draft`, `approved_by: null`, and-`approved_at: null` until OQ1 passes and Ruby gives exact-head approval.+The decisions below record settled input for the portions they name. This+record's approval covers the exact palette only. Token mappings, local-token+roles, and rendered-evidence questions stay explicitly separate for later+review and release.### DEC-1 — Own one exact Neutral filled-accent-status role@@ -194,6 +199,28 @@ Neither the proposed value nor any mapping is authorized until OQ1 passes andRejected: treating the role as global, treating it as disposable private output,or applying it merely because two contexts currently share a color.+### DEC-2 — Approve the Neutral palette as a decision anchor++**Reference:** `theme:neutral/DEC-2`++**Decider:** `rubyycheung`, `2026-09-02`++Neutral's exact palette values are approved as the stable starting point for+subsequent color and contrast decisions. The request, generated result, receipt,+and visual review must change together. Runtime token mappings are deliberately+excluded from this decision and reviewed in a separate stacked change. The+complete authoring palette is not added to the runtime theme object or generated+CSS.++Neutral is the repository reference implementation for palette-aware theme+templates. Templates may reuse its ownership, review, and alignment workflow;+they do not inherit Neutral's values, mappings, or stop layout as requirements.++Rejected: regenerating the palette during a normal build, silently changing+runtime token mappings as part of palette generation, or requiring complete+component-level contrast conformance before the palette can serve as the+baseline for measuring and improving those mappings.+## Open questions- **OQ1 — Is rendered light/dark evidence complete for the proposed tuple anddiff --git a/packages/themes/neutral/package.json b/packages/themes/neutral/package.jsonindex 8f4e4cc0d7..059ad8d4e7 100644--- a/packages/themes/neutral/package.json+++ b/packages/themes/neutral/package.json@@ -43,7 +43,8 @@},"files": ["dist",- "src"+ "src",+ "palette.config.json"],"scripts": {"build": "node ../../../scripts/clean-dist.mjs && astryx theme build src/neutralTheme.ts -o dist/theme.css --icons-specifier ./icons.mjs && tsup && tsc --project tsconfig.build.json && node ../../../scripts/check-fully-specified.mjs"diff --git a/packages/themes/neutral/palette.config.json b/packages/themes/neutral/palette.config.jsonnew file mode 100644index 0000000000..b67486eff7--- /dev/null+++ b/packages/themes/neutral/palette.config.json@@ -0,0 +1,114 @@+{+ "recipe": "astryx-oklch-v1",+ "vibrancy": 50,+ "neutralProfile": "neutral-v1",+ "modeStrategy": "light-and-dark",+ "stops": [+ 0,+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 60,+ 65,+ 70,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "families": [+ {+ "id": "neutral",+ "name": "Neutral",+ "seed": "#777777",+ "kind": "neutral"+ },+ {+ "id": "red",+ "name": "Red",+ "seed": "#d62830"+ },+ {+ "id": "orange",+ "name": "Orange",+ "seed": "#d57113"+ },+ {+ "id": "yellow",+ "name": "Yellow",+ "seed": "#f8c723",+ "anchors": [+ {+ "mode": "light",+ "stop": 80,+ "color": "#f8c723",+ "policy": "flexible"+ }+ ]+ },+ {+ "id": "green",+ "name": "Green",+ "seed": "#358a3a",+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#358a3a",+ "policy": "flexible"+ }+ ]+ },+ {+ "id": "teal",+ "name": "Teal",+ "seed": "#0c7365"+ },+ {+ "id": "cyan",+ "name": "Cyan",+ "seed": "#0c6f82"+ },+ {+ "id": "blue",+ "name": "Blue",+ "seed": "#0074e2",+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#0074e2",+ "policy": "exact"+ }+ ]+ },+ {+ "id": "purple",+ "name": "Purple",+ "seed": "#980fb2",+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#980fb2",+ "policy": "flexible"+ }+ ]+ },+ {+ "id": "pink",+ "name": "Pink",+ "seed": "#b10e69"+ }+ ]+}diff --git a/packages/themes/neutral/src/neutralPalettes.generated.receipt.json b/packages/themes/neutral/src/neutralPalettes.generated.receipt.jsonnew file mode 100644index 0000000000..0191398191--- /dev/null+++ b/packages/themes/neutral/src/neutralPalettes.generated.receipt.json@@ -0,0 +1,616 @@+{+ "schemaVersion": 1,+ "recipe": "astryx-oklch-v1",+ "candidateSha256": "847746fce1b7199c19ec270b76f096cd953df733630853d93cdc64fa4156f78e",+ "request": {+ "recipe": "astryx-oklch-v1",+ "vibrancy": 50,+ "neutralProfile": "neutral-v1",+ "modeStrategy": "light-and-dark",+ "stops": [+ 0,+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 60,+ 65,+ 70,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "families": [+ {+ "id": "neutral",+ "name": "Neutral",+ "seed": "#777777",+ "kind": "neutral",+ "anchors": []+ },+ {+ "id": "red",+ "name": "Red",+ "seed": "#d62830",+ "kind": "chromatic",+ "anchors": []+ },+ {+ "id": "orange",+ "name": "Orange",+ "seed": "#d57113",+ "kind": "chromatic",+ "anchors": []+ },+ {+ "id": "yellow",+ "name": "Yellow",+ "seed": "#f8c723",+ "kind": "chromatic",+ "anchors": [+ {+ "mode": "light",+ "stop": 80,+ "color": "#f8c723",+ "policy": "flexible"+ }+ ]+ },+ {+ "id": "green",+ "name": "Green",+ "seed": "#358a3a",+ "kind": "chromatic",+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#358a3a",+ "policy": "flexible"+ }+ ]+ },+ {+ "id": "teal",+ "name": "Teal",+ "seed": "#0c7365",+ "kind": "chromatic",+ "anchors": []+ },+ {+ "id": "cyan",+ "name": "Cyan",+ "seed": "#0c6f82",+ "kind": "chromatic",+ "anchors": []+ },+ {+ "id": "blue",+ "name": "Blue",+ "seed": "#0074e2",+ "kind": "chromatic",+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#0074e2",+ "policy": "exact"+ }+ ]+ },+ {+ "id": "purple",+ "name": "Purple",+ "seed": "#980fb2",+ "kind": "chromatic",+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#980fb2",+ "policy": "flexible"+ }+ ]+ },+ {+ "id": "pink",+ "name": "Pink",+ "seed": "#b10e69",+ "kind": "chromatic",+ "anchors": []+ }+ ]+ },+ "diagnostics": {+ "families": {+ "neutral": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.056735649681861,+ "maximumAdjacentDeltaE": 17.763777191722603,+ "maximumHueDrift": 0,+ "hueIdentityRisk": null,+ "gamutMappedStops": [],+ "anchors": []+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.056735649681861,+ "maximumAdjacentDeltaE": 17.763777191722603,+ "maximumHueDrift": 0,+ "hueIdentityRisk": null,+ "gamutMappedStops": [],+ "anchors": []+ }+ },+ "red": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.204099411570246,+ "maximumAdjacentDeltaE": 19.896679473359143,+ "maximumHueDrift": 3.9781468539510456,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 70,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.159661357539602,+ "maximumAdjacentDeltaE": 19.896679473359143,+ "maximumHueDrift": 3.8052933843198957,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 10,+ 15,+ 20,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ }+ },+ "orange": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.205755964742814,+ "maximumAdjacentDeltaE": 18.695314931199228,+ "maximumHueDrift": 17.283353703181774,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 60,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.205755964742814,+ "maximumAdjacentDeltaE": 18.695314931199228,+ "maximumHueDrift": 17.283353703181774,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ }+ },+ "yellow": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.29473924397966,+ "maximumAdjacentDeltaE": 18.108804228656158,+ "maximumHueDrift": 8.277463562561081,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 60,+ 65,+ 95,+ 100+ ],+ "anchors": [+ {+ "mode": "light",+ "stop": 80,+ "color": "#f8c723",+ "policy": "flexible",+ "generatedColor": "#eec448",+ "deltaE": 2.555748582763421+ }+ ]+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.163296946152699,+ "maximumAdjacentDeltaE": 18.108804228656158,+ "maximumHueDrift": 8.277463562561081,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 60,+ 95,+ 100+ ],+ "anchors": []+ }+ },+ "green": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.107684025645804,+ "maximumAdjacentDeltaE": 19.13154978272725,+ "maximumHueDrift": 1.8635734402253092,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 10,+ 15,+ 20,+ 100+ ],+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#358a3a",+ "policy": "flexible",+ "generatedColor": "#3c8a3f",+ "deltaE": 0.8561918662944262+ }+ ]+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.166930656117178,+ "maximumAdjacentDeltaE": 18.639066757439643,+ "maximumHueDrift": 0.6445863585763618,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 100+ ],+ "anchors": []+ }+ },+ "teal": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.166748465835485,+ "maximumAdjacentDeltaE": 18.230966590437585,+ "maximumHueDrift": 1.6736718288519796,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 100+ ],+ "anchors": []+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.144200511227181,+ "maximumAdjacentDeltaE": 18.230966590437585,+ "maximumHueDrift": 2.376056599037838,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 100+ ],+ "anchors": []+ }+ },+ "cyan": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.163846535832288,+ "maximumAdjacentDeltaE": 18.341697754919643,+ "maximumHueDrift": 1.448564967034713,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 55,+ 60,+ 90,+ 95,+ 100+ ],+ "anchors": []+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.169974786485362,+ "maximumAdjacentDeltaE": 18.341697754919643,+ "maximumHueDrift": 1.329774925710467,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 50,+ 95,+ 100+ ],+ "anchors": []+ }+ },+ "blue": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.114451923385638,+ "maximumAdjacentDeltaE": 19.354634049078946,+ "maximumHueDrift": 4.261077952851451,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 40,+ 45,+ 65,+ 70,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#0074e2",+ "policy": "exact",+ "generatedColor": "#0074e2",+ "deltaE": 0+ }+ ]+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.216746457814964,+ "maximumAdjacentDeltaE": 19.354634049078946,+ "maximumHueDrift": 4.232869197536161,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 35,+ 70,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ }+ },+ "purple": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 3.581597545905899,+ "maximumAdjacentDeltaE": 19.96161232121409,+ "maximumHueDrift": 0.6423866859174723,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": [+ {+ "mode": "light",+ "stop": 50,+ "color": "#980fb2",+ "policy": "flexible",+ "generatedColor": "#9f3cb5",+ "deltaE": 5.670039358248314+ }+ ]+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.242456796309444,+ "maximumAdjacentDeltaE": 19.160174226043452,+ "maximumHueDrift": 0.7664515813212347,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ }+ },+ "pink": {+ "light": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.24426147768217,+ "maximumAdjacentDeltaE": 19.77180068574261,+ "maximumHueDrift": 1.1308247093818409,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 5,+ 10,+ 15,+ 20,+ 25,+ 30,+ 75,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ },+ "dark": {+ "monotonic": true,+ "minimumAdjacentDeltaE": 4.168821172375738,+ "maximumAdjacentDeltaE": 19.521328561616023,+ "maximumHueDrift": 1.278567258732096,+ "hueIdentityRisk": null,+ "gamutMappedStops": [+ 10,+ 15,+ 80,+ 85,+ 90,+ 95,+ 100+ ],+ "anchors": []+ }+ }+ },+ "coordination": [+ {+ "mode": "light",+ "stop": 50,+ "closestFamilies": [+ "Teal",+ "Cyan"+ ],+ "minimumFamilyDeltaE": 6.359490266320177,+ "strongestFamily": "Purple",+ "weakestFamily": "Cyan",+ "chromaRatio": 1.94639550592773+ },+ {+ "mode": "dark",+ "stop": 50,+ "closestFamilies": [+ "Teal",+ "Cyan"+ ],+ "minimumFamilyDeltaE": 6.19928035179563,+ "strongestFamily": "Red",+ "weakestFamily": "Cyan",+ "chromaRatio": 1.5905982159145873+ }+ ]+ }+}diff --git a/packages/themes/neutral/src/neutralPalettes.generated.ts b/packages/themes/neutral/src/neutralPalettes.generated.tsnew file mode 100644index 0000000000..76d86846cd--- /dev/null+++ b/packages/themes/neutral/src/neutralPalettes.generated.ts@@ -0,0 +1,498 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++// Generated by astryx-oklch-v1. Review before committing.+// prettier-ignore+export const palette = {+ "neutral": {+ "name": "Neutral",+ "light": {+ "0": "#000000",+ "5": "#111111",+ "10": "#1b1b1b",+ "15": "#262626",+ "20": "#303030",+ "25": "#3b3b3b",+ "30": "#474747",+ "35": "#525252",+ "40": "#5e5e5e",+ "45": "#6a6a6a",+ "50": "#777777",+ "55": "#848484",+ "60": "#919191",+ "65": "#9e9e9e",+ "70": "#ababab",+ "75": "#b9b9b9",+ "80": "#c6c6c6",+ "85": "#d4d4d4",+ "90": "#e2e2e2",+ "95": "#f1f1f1",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#111111",+ "10": "#1b1b1b",+ "15": "#262626",+ "20": "#303030",+ "25": "#3b3b3b",+ "30": "#474747",+ "35": "#525252",+ "40": "#5e5e5e",+ "45": "#6a6a6a",+ "50": "#777777",+ "55": "#848484",+ "60": "#919191",+ "65": "#9e9e9e",+ "70": "#ababab",+ "75": "#b9b9b9",+ "80": "#c6c6c6",+ "85": "#d4d4d4",+ "90": "#e2e2e2",+ "95": "#f1f1f1",+ "100": "#ffffff"+ }+ },+ "red": {+ "name": "Red",+ "light": {+ "0": "#000000",+ "5": "#2c0000",+ "10": "#3e0002",+ "15": "#500004",+ "20": "#620008",+ "25": "#76000c",+ "30": "#8a0011",+ "35": "#9e0015",+ "40": "#af1320",+ "45": "#c0262c",+ "50": "#cf3738",+ "55": "#de4745",+ "60": "#ed5753",+ "65": "#fa6762",+ "70": "#ff7f77",+ "75": "#ff9890",+ "80": "#ffaea7",+ "85": "#ffc4be",+ "90": "#ffd8d4",+ "95": "#ffece9",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#2c0000",+ "10": "#3e0002",+ "15": "#500004",+ "20": "#620008",+ "25": "#74040f",+ "30": "#841118",+ "35": "#951f22",+ "40": "#a52c2c",+ "45": "#b53938",+ "50": "#c44743",+ "55": "#d35550",+ "60": "#e1645e",+ "65": "#ee736c",+ "70": "#fb837b",+ "75": "#ff9890",+ "80": "#ffaea7",+ "85": "#ffc4be",+ "90": "#ffd8d4",+ "95": "#ffece9",+ "100": "#ffffff"+ }+ },+ "orange": {+ "name": "Orange",+ "light": {+ "0": "#000000",+ "5": "#250500",+ "10": "#340d00",+ "15": "#431600",+ "20": "#521f00",+ "25": "#622700",+ "30": "#733100",+ "35": "#833a00",+ "40": "#944400",+ "45": "#a54f00",+ "50": "#b45c00",+ "55": "#c76600",+ "60": "#d97000",+ "65": "#e97e1d",+ "70": "#f58d3a",+ "75": "#ff9e55",+ "80": "#ffb37e",+ "85": "#ffc7a1",+ "90": "#ffdac2",+ "95": "#ffede1",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#250500",+ "10": "#340d00",+ "15": "#431600",+ "20": "#521f00",+ "25": "#622700",+ "30": "#733100",+ "35": "#833a00",+ "40": "#944400",+ "45": "#a54f00",+ "50": "#b45c00",+ "55": "#c46813",+ "60": "#d1762b",+ "65": "#df843f",+ "70": "#eb9352",+ "75": "#f7a266",+ "80": "#ffb37e",+ "85": "#ffc7a1",+ "90": "#ffdac2",+ "95": "#ffede1",+ "100": "#ffffff"+ }+ },+ "yellow": {+ "name": "Yellow",+ "light": {+ "0": "#000000",+ "5": "#190f00",+ "10": "#251a00",+ "15": "#312400",+ "20": "#3e2e00",+ "25": "#4b3900",+ "30": "#584400",+ "35": "#664f00",+ "40": "#745b00",+ "45": "#836700",+ "50": "#927300",+ "55": "#a17f00",+ "60": "#b18c00",+ "65": "#c29900",+ "70": "#d2a700",+ "75": "#e2b623",+ "80": "#eec448",+ "85": "#f8d36a",+ "90": "#ffe193",+ "95": "#fff0ca",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#190f00",+ "10": "#251a00",+ "15": "#312400",+ "20": "#3e2e00",+ "25": "#4b3900",+ "30": "#584400",+ "35": "#664f00",+ "40": "#745b00",+ "45": "#836700",+ "50": "#927300",+ "55": "#a17f00",+ "60": "#b18c00",+ "65": "#be9921",+ "70": "#cba73d",+ "75": "#d7b554",+ "80": "#e3c36c",+ "85": "#efd284",+ "90": "#fae19e",+ "95": "#fff0c8",+ "100": "#ffffff"+ }+ },+ "green": {+ "name": "Green",+ "light": {+ "0": "#000000",+ "5": "#001800",+ "10": "#002400",+ "15": "#003002",+ "20": "#003d05",+ "25": "#00490b",+ "30": "#0b5615",+ "35": "#17631e",+ "40": "#237028",+ "45": "#2f7d33",+ "50": "#3c8a3f",+ "55": "#4a984c",+ "60": "#59a55b",+ "65": "#6ab26b",+ "70": "#7dbe7e",+ "75": "#90ca90",+ "80": "#a4d6a3",+ "85": "#b7e2b6",+ "90": "#cbeeca",+ "95": "#defadd",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#001702",+ "10": "#012303",+ "15": "#032f07",+ "20": "#093b0e",+ "25": "#124817",+ "30": "#1c5420",+ "35": "#27612a",+ "40": "#326e34",+ "45": "#3e7b40",+ "50": "#4a884c",+ "55": "#589558",+ "60": "#65a266",+ "65": "#74af75",+ "70": "#85bb85",+ "75": "#97c897",+ "80": "#aad4a9",+ "85": "#bce0bb",+ "90": "#ceecce",+ "95": "#e1f8e0",+ "100": "#ffffff"+ }+ },+ "teal": {+ "name": "Teal",+ "light": {+ "0": "#000000",+ "5": "#001612",+ "10": "#00221c",+ "15": "#002e27",+ "20": "#003a32",+ "25": "#00463d",+ "30": "#005348",+ "35": "#006154",+ "40": "#006e60",+ "45": "#007c6d",+ "50": "#008b7a",+ "55": "#009986",+ "60": "#01a894",+ "65": "#34b5a1",+ "70": "#56c0ae",+ "75": "#74ccbb",+ "80": "#90d7c8",+ "85": "#a9e2d6",+ "90": "#c1eee4",+ "95": "#d7f9f2",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#001612",+ "10": "#00221c",+ "15": "#002e27",+ "20": "#003a32",+ "25": "#00463d",+ "30": "#005348",+ "35": "#006154",+ "40": "#006e60",+ "45": "#007c6d",+ "50": "#018a7a",+ "55": "#239886",+ "60": "#39a593",+ "65": "#4fb1a0",+ "70": "#68bdad",+ "75": "#81c9bb",+ "80": "#99d5c8",+ "85": "#b1e0d6",+ "90": "#c6ece3",+ "95": "#dbf8f1",+ "100": "#ffffff"+ }+ },+ "cyan": {+ "name": "Cyan",+ "light": {+ "0": "#000000",+ "5": "#00151b",+ "10": "#002028",+ "15": "#002c35",+ "20": "#003743",+ "25": "#004351",+ "30": "#00505f",+ "35": "#005d6e",+ "40": "#006a7d",+ "45": "#00788d",+ "50": "#00859d",+ "55": "#0093ad",+ "60": "#00a2be",+ "65": "#29afcb",+ "70": "#45bdd7",+ "75": "#5ecae3",+ "80": "#75d7ef",+ "85": "#8ee4f9",+ "90": "#afefff",+ "95": "#d9f7ff",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#00151b",+ "10": "#002028",+ "15": "#002c35",+ "20": "#003743",+ "25": "#004351",+ "30": "#00505f",+ "35": "#005d6e",+ "40": "#006a7d",+ "45": "#00788d",+ "50": "#00859d",+ "55": "#1e93aa",+ "60": "#35a0b7",+ "65": "#49adc4",+ "70": "#5dbad1",+ "75": "#71c7dd",+ "80": "#85d5e9",+ "85": "#9ae2f4",+ "90": "#b1eefe",+ "95": "#d9f7ff",+ "100": "#ffffff"+ }+ },+ "blue": {+ "name": "Blue",+ "light": {+ "0": "#000000",+ "5": "#000f30",+ "10": "#001a41",+ "15": "#002452",+ "20": "#002f65",+ "25": "#003978",+ "30": "#00458c",+ "35": "#0050a2",+ "40": "#005cb8",+ "45": "#0067ce",+ "50": "#0074e2",+ "55": "#1e81f0",+ "60": "#348ffd",+ "65": "#529fff",+ "70": "#6eaeff",+ "75": "#88bcff",+ "80": "#a1caff",+ "85": "#b9d7ff",+ "90": "#d0e5ff",+ "95": "#e8f2ff",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#000f30",+ "10": "#001a41",+ "15": "#002452",+ "20": "#002f65",+ "25": "#003978",+ "30": "#00458c",+ "35": "#0050a1",+ "40": "#0d5db1",+ "45": "#1d6ac1",+ "50": "#2c77d0",+ "55": "#3b84de",+ "60": "#4a92eb",+ "65": "#5aa0f8",+ "70": "#6eaeff",+ "75": "#88bcff",+ "80": "#a1caff",+ "85": "#b9d7ff",+ "90": "#d0e5ff",+ "95": "#e8f2ff",+ "100": "#ffffff"+ }+ },+ "purple": {+ "name": "Purple",+ "light": {+ "0": "#000000",+ "5": "#210028",+ "10": "#31003b",+ "15": "#3f004c",+ "20": "#4e045c",+ "25": "#5c0e6c",+ "30": "#6b187c",+ "35": "#781f8a",+ "40": "#842699",+ "45": "#9130a7",+ "50": "#9f3cb5",+ "55": "#ad4dc3",+ "60": "#bb5fd1",+ "65": "#ca72de",+ "70": "#d885eb",+ "75": "#e496f6",+ "80": "#efa8ff",+ "85": "#f3bfff",+ "90": "#f7d5ff",+ "95": "#fbeaff",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#1e0225",+ "10": "#2e0536",+ "15": "#3c0a46",+ "20": "#4a1256",+ "25": "#581c65",+ "30": "#662674",+ "35": "#743183",+ "40": "#823c91",+ "45": "#8f48a0",+ "50": "#9d55ae",+ "55": "#ab62bb",+ "60": "#b870c9",+ "65": "#c57ed5",+ "70": "#d28de2",+ "75": "#de9ced",+ "80": "#eaacf8",+ "85": "#f3bfff",+ "90": "#f7d5ff",+ "95": "#fbeaff",+ "100": "#ffffff"+ }+ },+ "pink": {+ "name": "Pink",+ "light": {+ "0": "#000000",+ "5": "#290013",+ "10": "#3b001e",+ "15": "#4b0028",+ "20": "#5d0034",+ "25": "#70003f",+ "30": "#83004b",+ "35": "#950457",+ "40": "#a61863",+ "45": "#b52970",+ "50": "#c5387c",+ "55": "#d44789",+ "60": "#e25796",+ "65": "#ef67a3",+ "70": "#fc78b1",+ "75": "#ff90bd",+ "80": "#ffa9ca",+ "85": "#ffc0d7",+ "90": "#ffd5e4",+ "95": "#ffeaf1",+ "100": "#ffffff"+ },+ "dark": {+ "0": "#000000",+ "5": "#280013",+ "10": "#3b001e",+ "15": "#4b0028",+ "20": "#5c0034",+ "25": "#6d083f",+ "30": "#7d144b",+ "35": "#8d2056",+ "40": "#9d2d63",+ "45": "#ac396f",+ "50": "#bb477c",+ "55": "#c95588",+ "60": "#d76395",+ "65": "#e572a3",+ "70": "#f181b0",+ "75": "#fd92bd",+ "80": "#ffa9ca",+ "85": "#ffc0d7",+ "90": "#ffd5e4",+ "95": "#ffeaf1",+ "100": "#ffffff"+ }+ }+} as const;++export default palette;diff --git a/packages/themes/neutral/src/neutralPalettes.test.ts b/packages/themes/neutral/src/neutralPalettes.test.tsnew file mode 100644index 0000000000..95b838c703--- /dev/null+++ b/packages/themes/neutral/src/neutralPalettes.test.ts@@ -0,0 +1,37 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++import {describe, expect, it} from 'vitest';+import {neutralPalettes} from './neutralPalettes';++const neutralPaletteStops = [+ 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95,+ 100,+] as const;++describe('neutral palette artifact', () => {+ it('keeps the approved palette structurally valid', () => {+ expect(Object.keys(neutralPalettes)).toEqual([+ 'neutral',+ 'red',+ 'orange',+ 'yellow',+ 'green',+ 'teal',+ 'cyan',+ 'blue',+ 'purple',+ 'pink',+ ]);++ for (const family of Object.values(neutralPalettes)) {+ for (const stop of neutralPaletteStops) {+ expect(family.light[stop]).toMatch(/^#[0-9a-f]{6}$/i);+ expect(family.dark[stop]).toMatch(/^#[0-9a-f]{6}$/i);+ }+ expect(family.light[0]).toBe('#000000');+ expect(family.dark[0]).toBe('#000000');+ expect(family.light[100]).toBe('#ffffff');+ expect(family.dark[100]).toBe('#ffffff');+ }+ });+});diff --git a/packages/themes/neutral/src/neutralPalettes.ts b/packages/themes/neutral/src/neutralPalettes.tsnew file mode 100644index 0000000000..a59f27d941--- /dev/null+++ b/packages/themes/neutral/src/neutralPalettes.ts@@ -0,0 +1,7 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/** Neutral's reviewed palette, generated from ../palette.config.json. */+export {+ palette as neutralPalettes,+ palette as default,+} from './neutralPalettes.generated';diff --git a/scripts/check-theme-template.test.mjs b/scripts/check-theme-template.test.mjsindex 5c8b84d462..c9c4b85bdb 100644--- a/scripts/check-theme-template.test.mjs+++ b/scripts/check-theme-template.test.mjs@@ -30,6 +30,7 @@import fs from 'node:fs';import path from 'node:path';+import {createHash} from 'node:crypto';import {fileURLToPath} from 'node:url';import {describe, it, expect} from 'vitest';@@ -39,6 +40,30 @@ const TEMPLATE = path.join(REPO_ROOT, 'packages/cli/assets/theme.template.ts');const THEME_SRC = path.join(REPO_ROOT, 'packages/core/src/theme');const CORE_SRC = path.join(REPO_ROOT, 'packages/core/src');const DOCS_DIR = path.join(REPO_ROOT, 'packages/cli/assets/docs');+const NEUTRAL_PALETTE = path.join(+ REPO_ROOT,+ 'packages/themes/neutral/src/neutralPalettes.ts',+);+const NEUTRAL_PALETTE_TEMPLATE = path.join(+ REPO_ROOT,+ 'packages/cli/assets/templates/themes/neutral/neutralPalettes.ts',+);+const NEUTRAL_GENERATED_PALETTE = path.join(+ REPO_ROOT,+ 'packages/themes/neutral/src/neutralPalettes.generated.ts',+);+const NEUTRAL_GENERATED_RECEIPT = path.join(+ REPO_ROOT,+ 'packages/themes/neutral/src/neutralPalettes.generated.receipt.json',+);+const NEUTRAL_PALETTE_CONFIG = path.join(+ REPO_ROOT,+ 'packages/themes/neutral/palette.config.json',+);+const NEUTRAL_TEMPLATE_DIR = path.join(+ REPO_ROOT,+ 'packages/cli/assets/templates/themes/neutral',+);const template = fs.readFileSync(TEMPLATE, 'utf-8');@@ -56,8 +81,14 @@ const SYNC_SOURCES = [// Live facts// ----------------------------------------------------------------------------const defineThemeSrc = fs.readFileSync(path.join(THEME_SRC, 'defineTheme.ts'), 'utf-8');-const tokensSrc = fs.readFileSync(path.join(THEME_SRC, 'tokens.stylex.ts'), 'utf-8');+const defineThemeSrc = fs.readFileSync(+ path.join(THEME_SRC, 'defineTheme.ts'),+ 'utf-8',+);+const tokensSrc = fs.readFileSync(+ path.join(THEME_SRC, 'tokens.stylex.ts'),+ 'utf-8',+);/** Field names declared on `DefineThemeInput`. */function defineThemeFields() {@@ -76,7 +107,9 @@ function tokenGroups() {const name = chunk.split(/[\s:=]/)[0];if (!name.endsWith('Defaults')) continue;const body = chunk.split('export const')[0];- groups[name] = [...body.matchAll(/'(--[a-zA-Z0-9-]+)'\s*:/g)].map(m => m[1]);+ groups[name] = [...body.matchAll(/'(--[a-zA-Z0-9-]+)'\s*:/g)].map(+ m => m[1],+ );}return groups;}@@ -89,9 +122,7 @@ function tokenGroups() {* this guard starts requiring the template to cover it.*/function settableTokenGroups() {- const union = defineThemeSrc.match(- /export type CoreTokenName =([\s\S]*?);/,- );+ const union = defineThemeSrc.match(/export type CoreTokenName =([\s\S]*?);/);if (!union) throw new Error('CoreTokenName not found in defineTheme.ts');return [...union[1].matchAll(/typeof (\w+Defaults)/g)].map(m => m[1]);}@@ -145,7 +176,9 @@ function docTopics() {*/function templateFields() {const set = [...template.matchAll(/^ {2}(\w+):/gm)].map(m => m[1]);- const commented = [...template.matchAll(/^ {2}\/\/ (\w+): .+,$/gm)].map(m => m[1]);+ const commented = [...template.matchAll(/^ {2}\/\/ (\w+): .+,$/gm)].map(+ m => m[1],+ );return [...new Set([...set, ...commented])];}@@ -156,7 +189,9 @@ function templateFields() {*/function templateVars() {const set = [...template.matchAll(/'(--[a-z][a-z0-9-]*)':/g)].map(m => m[1]);- const read = [...template.matchAll(/var\((--[a-z][a-z0-9-]*)\)/g)].map(m => m[1]);+ const read = [...template.matchAll(/var\((--[a-z][a-z0-9-]*)\)/g)].map(+ m => m[1],+ );return [...new Set([...set, ...read])];}@@ -197,7 +232,9 @@ function commonPrefix(names) {function templateComponentKeys() {const block = template.match(/\n {2}components: \{([\s\S]*?)\n {2}\},/);if (!block) throw new Error('components block not found in the template');- return [...block[1].matchAll(/^ {4}'?([a-z][a-z0-9-]*)'?: \{/gm)].map(m => m[1]);+ return [...block[1].matchAll(/^ {4}'?([a-z][a-z0-9-]*)'?: \{/gm)].map(+ m => m[1],+ );}// ---------------------------------------------------------------------------@@ -205,6 +242,49 @@ function templateComponentKeys() {// ---------------------------------------------------------------------------describe('theme template stays in sync with the theme system', () => {+ it('keeps the shipped Neutral palette template aligned with its owner', () => {+ for (const [source, output] of [+ [NEUTRAL_PALETTE, NEUTRAL_PALETTE_TEMPLATE],+ [+ NEUTRAL_GENERATED_PALETTE,+ path.join(NEUTRAL_TEMPLATE_DIR, 'neutralPalettes.generated.ts'),+ ],+ [+ NEUTRAL_GENERATED_RECEIPT,+ path.join(+ NEUTRAL_TEMPLATE_DIR,+ 'neutralPalettes.generated.receipt.json',+ ),+ ],+ [+ NEUTRAL_PALETTE_CONFIG,+ path.join(NEUTRAL_TEMPLATE_DIR, 'palette.config.json'),+ ],+ ]) {+ expect(fs.readFileSync(output, 'utf-8')).toBe(+ fs.readFileSync(source, 'utf-8'),+ );+ }+ });++ it('keeps Neutral generation inputs and output aligned with its receipt', () => {+ const config = JSON.parse(fs.readFileSync(NEUTRAL_PALETTE_CONFIG, 'utf-8'));+ const receipt = JSON.parse(+ fs.readFileSync(NEUTRAL_GENERATED_RECEIPT, 'utf-8'),+ );+ const generated = fs+ .readFileSync(NEUTRAL_GENERATED_PALETTE, 'utf-8')+ // Repository lint adds this license to committed TypeScript. The receipt+ // hashes the generator-owned bytes that follow it.+ .replace('// Copyright (c) Meta Platforms, Inc. and affiliates.\n\n', '');++ expect(receipt.recipe).toBe(config.recipe);+ expect(receipt.request).toMatchObject(config);+ expect(createHash('sha256').update(generated).digest('hex')).toBe(+ receipt.candidateSha256,+ );+ });+it('documents every defineTheme field', () => {const documented = new Set(templateFields());const missing = defineThemeFields().filter(f => !documented.has(f));@@ -277,7 +357,11 @@ describe('theme template stays in sync with the theme system', () => {it('cites only doc topics that exist', () => {const topics = new Set(docTopics());- const cited = [...new Set([...template.matchAll(/astryx docs ([a-z-]+)/g)].map(m => m[1]))];+ const cited = [+ ...new Set(+ [...template.matchAll(/astryx docs ([a-z-]+)/g)].map(m => m[1]),+ ),+ ];const dead = cited.filter(t => !topics.has(t));expect(dead,@@ -289,7 +373,10 @@ describe('theme template stays in sync with the theme system', () => {it('is still named by the SYNC comment in every theme source that points here', () => {const relTemplate = 'packages/cli/assets/theme.template.ts';const orphaned = SYNC_SOURCES.filter(- f => !fs.readFileSync(path.join(THEME_SRC, f), 'utf-8').includes(relTemplate),+ f =>+ !fs+ .readFileSync(path.join(THEME_SRC, f), 'utf-8')+ .includes(relTemplate),);expect(orphaned,diff --git a/scripts/generate-cli-themes.mjs b/scripts/generate-cli-themes.mjsindex cb6d14e784..3e8e98371e 100644--- a/scripts/generate-cli-themes.mjs+++ b/scripts/generate-cli-themes.mjs@@ -1,10 +1,11 @@// Copyright (c) Meta Platforms, Inc. and affiliates./**- * @file Bundles each theme's source (`src/<slug>Theme.ts` + `icons.tsx`) and a- * `manifest.json` into `packages/cli/assets/templates/themes/` so `astryx theme add`- * can scaffold a theme without the package installed — like page templates.- * Run from the repo root; commit the output so the published CLI carries it.+ * @file Bundles each theme's source, optional icons and palette-authoring+ * artifacts, and a `manifest.json` into+ * `packages/cli/assets/templates/themes/` so `astryx theme add` can scaffold a+ * complete, reproducible theme without the package installed. Run from the repo+ * root; commit the output so the published CLI carries it.*/import * as fs from 'node:fs';@@ -84,18 +85,38 @@ function main() {const themeFileName = `${id}Theme.ts`;const themeFile = path.join(srcDir, themeFileName);- // The theme file imports './icons', so bundle it too (optional).- const iconsFile = path.join(srcDir, 'icons.tsx');- const hasIcons = fs.existsSync(iconsFile);-const outDir = path.join(CLI_THEMES_OUT, slug);fs.mkdirSync(outDir, {recursive: true});const files = [themeFileName];fs.copyFileSync(themeFile, path.join(outDir, themeFileName));- if (hasIcons) {- files.push('icons.tsx');- fs.copyFileSync(iconsFile, path.join(outDir, 'icons.tsx'));++ // Keep optional theme-owned authoring artifacts with the template. A+ // palette-backed theme must remain reproducible after `theme add`, not+ // merely compile because a generated palette file happened to be copied.+ const optionalFiles = [+ {source: path.join(srcDir, 'icons.tsx'), output: 'icons.tsx'},+ {+ source: path.join(srcDir, `${id}Palettes.ts`),+ output: `${id}Palettes.ts`,+ },+ {+ source: path.join(srcDir, `${id}Palettes.generated.ts`),+ output: `${id}Palettes.generated.ts`,+ },+ {+ source: path.join(srcDir, `${id}Palettes.generated.receipt.json`),+ output: `${id}Palettes.generated.receipt.json`,+ },+ {+ source: path.join(THEMES_SRC_ROOT, slug, 'palette.config.json'),+ output: 'palette.config.json',+ },+ ];+ for (const file of optionalFiles) {+ if (!fs.existsSync(file.source)) continue;+ files.push(file.output);+ fs.copyFileSync(file.source, path.join(outDir, file.output));}// Pull the human description from the package.json (falls back to empty).