Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: bump style-dictionary and @tokens-studio/sd-transforms to latest #11636

Draft
wants to merge 98 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
f61e0ec
WIP: styledictionary4 config setup
alisonailea Dec 13, 2024
24896e2
revert(icons): restore deleted icon
alisonailea Dec 17, 2024
10ee40f
fix(tsconfig): resolve build error
alisonailea Dec 17, 2024
2aa4daf
feat(shadow): transform design token shadow values
alisonailea Dec 17, 2024
86b384e
chore(registerTransforms): add transforms
alisonailea Dec 17, 2024
30b9e4e
chore: clean up old design token files
alisonailea Dec 17, 2024
d1cb55c
feat: add design token filters
alisonailea Dec 17, 2024
8588a09
feat: add StyleDictionary actions
alisonailea Dec 17, 2024
b41dab9
chore: cleanup old transformers
alisonailea Dec 17, 2024
9e7b4df
chore(container-size): type should be breakpoint
alisonailea Dec 17, 2024
c05313c
feat: add StyleDictionary header for calcite
alisonailea Dec 17, 2024
6eac994
chore: add light dark platforms for old files
alisonailea Dec 17, 2024
52b64ea
feat: build StyleDictionary4 design tokens for Calcite
alisonailea Dec 17, 2024
caed514
fix: remove unused StyleDictionary value transformers
alisonailea Dec 17, 2024
f78d989
chore(scss): update platform config
alisonailea Dec 17, 2024
c6084b7
chore(package): update dependencies
alisonailea Dec 17, 2024
e8dce39
fix: remove old style dictionary 3 transformer files
alisonailea Dec 17, 2024
f98ddf1
fix: remove old StyleDictionary3 types files
alisonailea Dec 17, 2024
9c63540
Revert "fix: remove unused StyleDictionary value transformers"
alisonailea Dec 17, 2024
b4b7fa3
fix(mathSum): update function names for value transformer in tokens
alisonailea Dec 18, 2024
519072c
fix(shadow): correctly output shadow tokens for css
alisonailea Dec 21, 2024
ae41e10
fix(mathSum): allow tokens to be transformed after references and fix…
alisonailea Dec 21, 2024
ac7b224
feat(removeDefault): add transformation to remove default from token …
alisonailea Dec 21, 2024
ddedd8e
fix(calciteHeader): remove superfluous comments
alisonailea Dec 21, 2024
5dfc40d
feat(calciteTransformationGroup): move token transforms under a singl…
alisonailea Dec 21, 2024
a1ee0a0
feat(pxToRem): transform token values from px to rems
alisonailea Dec 21, 2024
a3ae510
chore(registerTransforms): add transform registerations
alisonailea Dec 21, 2024
a413034
chore(buildTokens): add to typeMap
alisonailea Dec 21, 2024
09294ca
chore(scss): clean up scss config
alisonailea Dec 21, 2024
b747942
chore(shadow): align tokens with DTCG
alisonailea Dec 21, 2024
fc44598
feat(css): add css token platform
alisonailea Dec 23, 2024
a64966a
chore(scss): add fileExtension to scss token platform
alisonailea Dec 23, 2024
314ed6e
chore(generateBreakpoints): make file more flexible for multiple plat…
alisonailea Dec 23, 2024
f09055d
feat(buildTokens): add CSS token platform to token build
alisonailea Dec 23, 2024
58f07a2
chore(package-lock): update dev dependencies
alisonailea Dec 23, 2024
7d62d7c
WIP token studio changeover
alisonailea Jan 3, 2025
4492b73
WIP: style-dictionary changeover exporting all CSS and SCSS
alisonailea Jan 3, 2025
7e44357
Merge branch 'dev' of github.com:Esri/calcite-design-system into astu…
alisonailea Jan 3, 2025
05c422f
Merge branch 'astump/tokens' of github.com:Esri/calcite-design-system…
alisonailea Jan 3, 2025
6804aa5
WIP(tokens): move to new semantic folder
alisonailea Jan 7, 2025
e6bdaf4
fix(tokens): align with sd and ts 4
alisonailea Jan 7, 2025
b5da7c2
chore(tokens): move to new semantic folder
alisonailea Jan 7, 2025
2ee008e
chore(filter): filter tokens export file
alisonailea Jan 7, 2025
10d386b
chore(semantic): single tokens config file
alisonailea Jan 7, 2025
b02a872
chore(tokens): export themed color sets
alisonailea Jan 9, 2025
2ccdd1e
chore(tokens): add back es6
alisonailea Jan 22, 2025
c86a0e5
add foreground-1 test
matgalla Jan 23, 2025
12e528d
initial categories created for light
matgalla Jan 24, 2025
6a98514
chore(tokens): add back es6 dist assets
alisonailea Jan 25, 2025
0c7f9b3
Merge branch 'astump/style-dictionary-4.x' of github.com:Esri/calcite…
alisonailea Jan 25, 2025
4be3cb0
light and dark theme color tokens created
matgalla Jan 27, 2025
ee9ad81
chore(tokens): add back js and docs asset builds
alisonailea Jan 28, 2025
fa96e22
chore(tokens): cleanup remove old build files
alisonailea Jan 28, 2025
62a8dcb
chore(tokens): move calcite tokens build script next to token files
alisonailea Jan 28, 2025
324add3
Merge branch 'astump/style-dictionary-4.x' of github.com:Esri/calcite…
alisonailea Jan 28, 2025
d5dfdf8
fix(font tokens): clean up file
alisonailea Jan 28, 2025
c41ea58
fix(shadow tokens): references
alisonailea Jan 29, 2025
66c9b68
fix(color tokens): remove extra themes
alisonailea Jan 29, 2025
09cdaa3
chore(token transformers): clean up build scripts
alisonailea Jan 29, 2025
b1d79b0
dark mode current token fixed (temporarily a hexcode)
matgalla Jan 29, 2025
3c57f87
added medium-saturation core tokens
matgalla Jan 30, 2025
b990a4c
Merge branch 'astump/style-dictionary-4.x' of github.com:Esri/calcite…
alisonailea Jan 30, 2025
d038b55
chore(tokens): fix build
alisonailea Jan 30, 2025
d62ee28
chore(tokens): simplify build
alisonailea Jan 30, 2025
6faa16e
chore(tokens): ts to js
alisonailea Feb 3, 2025
8017a84
WIP: es6 merge
alisonailea Feb 3, 2025
c5da2b8
added .status category to the info, success, warning, and danger tokens
matgalla Feb 6, 2025
830f58c
chore(tokens): remove unnecessary folder level for token files
alisonailea Feb 10, 2025
786a227
chore(tokens): build script to merge es6 token files forh color-light…
alisonailea Feb 10, 2025
941b244
Merge branch 'astump/style-dictionary-4.x' of github.com:Esri/calcite…
alisonailea Feb 10, 2025
adfa14b
choe(tokens): clean up files
alisonailea Feb 13, 2025
32f463d
Initial box shadow updates:
matgalla Feb 14, 2025
9941fe1
- Duplicate `color` label removed
matgalla Feb 15, 2025
02e5cc5
Testing emojis in theme names
matgalla Feb 18, 2025
8122c1d
Core color hex code bug fixes
matgalla Feb 18, 2025
fc4e17a
Added low-saturation structure to core colors
matgalla Feb 19, 2025
a77ef60
low-saturation core color tokens added
matgalla Feb 19, 2025
f33e2e0
Modified core structure to align with Figma variables
matgalla Feb 19, 2025
4c6d87d
Modified core structure for container-size, font, opacity, shadow, si…
matgalla Feb 19, 2025
bc576d5
Reanmed core TS theme to align with Figma variables
matgalla Feb 19, 2025
4f84e44
Updated core theme to only export the tokens used in Figma
matgalla Feb 20, 2025
fe22e00
Core themes stablished
matgalla Feb 21, 2025
dcbc113
WIP: build token index files
alisonailea Feb 21, 2025
85d66b7
fix(typography): correctly formatted mixins and classes files
alisonailea Feb 21, 2025
625f5f2
fix(shadow): update cssShadow transform to handle weird TS format for…
alisonailea Feb 21, 2025
8bc47d9
feat(index): add dist build files index files for scss and css platforms
alisonailea Feb 21, 2025
551a8dc
feat(light,dark): add js and docs builds
alisonailea Feb 21, 2025
44a94af
Merge branch 'astump/style-dictionary-4.x' of github.com:Esri/calcite…
alisonailea Feb 21, 2025
3034e85
fix(font): correct build, tokens can not share paths
alisonailea Feb 21, 2025
73e95d9
fix(shadow): correct token structure
alisonailea Feb 21, 2025
8791bf1
feat(semantic-old): delete old color tokens forever
alisonailea Feb 21, 2025
33bf622
feat(tokens): remove calcite-schema attributes
alisonailea Feb 21, 2025
c707016
feat(global.es6): merge light and dark colors into single object for …
alisonailea Feb 22, 2025
cf8fdd3
feat(platformNames): add attribute transformer
alisonailea Feb 22, 2025
0e571aa
feat(docs): add human readable name
alisonailea Feb 24, 2025
38701e2
WIP: token build
alisonailea Feb 24, 2025
14fbede
Added core>color>opacity tokens
matgalla Feb 26, 2025
0721ad7
Changed core>color>opacity colors to rgba instead of hex and fixed al…
matgalla Feb 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
874 changes: 511 additions & 363 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@storybook/preview-api": "8.4.7",
"@storybook/storybook-deployer": "2.8.16",
"@storybook/web-components-vite": "8.4.7",
"@tokens-studio/sd-transforms": "0.12.2",
"@tokens-studio/sd-transforms": "1.2.9",
"@types/dedent": "0.7.2",
"@types/eslint": "9.6.1",
"@types/estree": "1.0.6",
Expand Down Expand Up @@ -118,7 +118,7 @@
"shell-quote": "1.8.2",
"storybook": "8.4.7",
"storybook-addon-rtl": "1.0.1",
"style-dictionary": "3.9.2",
"style-dictionary": "4.3.0",
"stylelint": "16.12.0",
"stylelint-config-recommended-scss": "14.1.0",
"stylelint-use-logical-spec": "5.0.1",
Expand Down
5 changes: 2 additions & 3 deletions packages/calcite-design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"license": "SEE LICENSE.md",
"scripts": {
"build": "tsx support/run.ts",
"build": "tsx src/buildTokens.ts",
"clean": "rimraf dist",
"lint:json": "prettier --write \"**/*.json\" >/dev/null",
"lint:md": "prettier --write \"**/*.md\" >/dev/null && markdownlint \"**/*.md\" --fix --dot --ignore-path ../../.gitignore",
Expand All @@ -37,8 +37,7 @@
"util:update-test-snapshots": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --updateSnapshot"
},
"devDependencies": {
"ts-jest-resolver": "2.0.1",
"ts-node": "10.9.2"
"ts-jest-resolver": "2.0.1"
},
"volta": {
"extends": "../../package.json"
Expand Down
61 changes: 0 additions & 61 deletions packages/calcite-design-tokens/src/$config.ts

This file was deleted.

25 changes: 25 additions & 0 deletions packages/calcite-design-tokens/src/$metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"tokenSetOrder": [
"core/color",
"core/container-size",
"core/font",
"core/opacity",
"core/shadow",
"core/size",
"core/z-index",
"core/$metadata",
"core/$themes",
"semantic/border",
"semantic/container-size",
"semantic/corner",
"semantic/font",
"semantic/opacity",
"semantic/shadow",
"semantic/size",
"semantic/space",
"semantic/z-index",
"semantic/calcite/dark",
"semantic/calcite/light",
"semantic/typography"
]
}
693 changes: 693 additions & 0 deletions packages/calcite-design-tokens/src/$themes.json

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions packages/calcite-design-tokens/src/buildTokens.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import StyleDictionary from "style-dictionary";
import { register as registerTokenStudioTransformers } from "@tokens-studio/sd-transforms";
import { registerCalciteTokenTransformers } from "../support/index.js";

import config from "../src/config/semantic.js";
import calciteLightConfig from "../src/config/calcite/light.js";
import calciteDarkConfig from "../src/config/calcite/dark.js";

await registerTokenStudioTransformers(StyleDictionary);
await registerCalciteTokenTransformers(StyleDictionary);

const sd = new StyleDictionary(config);
await sd.buildAllPlatforms();

const calciteLight = new StyleDictionary(calciteLightConfig);
await calciteLight.buildAllPlatforms();

const calciteDark = new StyleDictionary(calciteDarkConfig);
await calciteDark.buildAllPlatforms();
30 changes: 0 additions & 30 deletions packages/calcite-design-tokens/src/component/button.json

This file was deleted.

135 changes: 135 additions & 0 deletions packages/calcite-design-tokens/src/config/calcite/dark.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
import {
formats as sdFormats,
logBrokenReferenceLevels,
logWarningLevels,
logVerbosityLevels,
} from "style-dictionary/enums";
import { Config } from "style-dictionary/types";
import { expandTypesMap as sdTypes } from "@tokens-studio/sd-transforms";
import { transformers, filters, headers, formats } from "../../../support/index.js";

export default {
// configuration
source: ["src/semantic/calcite/dark.json"],
include: ["src/core/*.json"],
preprocessors: ["tokens-studio"],
platforms: {
scss: {
transformGroup: transformers.TransformCalciteGroup,
buildPath: "dist/scss/",
prefix: "calcite",
files: [
{
destination: "dark.scss",
format: sdFormats.scssVariables,
filter: filters.FilterSourceTokens,
},
],
options: {
fileExtension: ".scss",
fileHeader: headers.HeaderCalciteDefault,
},
},
css: {
transformGroup: transformers.TransformCalciteGroup,
buildPath: "dist/css/",
prefix: "calcite",
files: [
{
destination: "dark.css",
format: sdFormats.cssVariables,
filter: filters.FilterSourceTokens,
},
],
options: {
fileExtension: ".css",
fileHeader: headers.HeaderCalciteDefault,
},
},
es6: {
transformGroup: transformers.TransformCalciteGroup,
transforms: transformers.platformTransforms.es6,
buildPath: "dist/es6/",
prefix: "calcite",
options: {
fileExtension: ".js",
fileHeader: headers.HeaderCalciteDefault,
},
files: [
{
destination: "dark.js",
format: sdFormats.javascriptEs6,
filter: filters.FilterSourceTokens,
},
{
destination: "global.js",
format: formats.FormatESS6Merge,
filter: filters.FilterSourceTokens,
options: {
suffix: "Dark",
},
},
],
},
// js: {
// transformGroup: transformers.TransformCalciteGroup,
// transforms: transformers.platformTransforms.es6,
// buildPath: "dist/js/",
// prefix: "calcite",
// options: {
// fileExtension: ".js",
// fileHeader: headers.HeaderCalciteDefault,
// },
// files: [
// {
// destination: "dark.js",
// format: formats.FormatCalciteDocs,
// filter: filters.FilterSourceTokens,
// },
// {
// destination: "global.js",
// format: formats.FormatJSONMerge,
// filter: filters.FilterSourceTokens,
// options: {
// suffix: "Dark",
// },
// },
// ],
// },
docs: {
transformGroup: transformers.TransformCalciteGroup,
transforms: transformers.platformTransforms.es6,
buildPath: "dist/docs/",
prefix: "calcite",
options: {
fileExtension: ".json",
fileHeader: headers.HeaderCalciteDefault,
},
files: [
{
destination: "dark.json",
format: formats.FormatCalciteDocs,
filter: filters.FilterSourceTokens,
},
// {
// destination: "global.json",
// format: formats.FormatJSONMerge,
// filter: filters.FilterSourceTokens,
// options: {
// suffix: "Dark",
// },
// },
],
},
},
log: {
warnings: logWarningLevels.warn,
verbosity: logVerbosityLevels.verbose,
errors: {
brokenReferences: logBrokenReferenceLevels.throw,
},
},
expand: {
typesMap: sdTypes,
},
} as Config;
Loading