From f7befa84b48ab8877ea93de21f82f45de66ff973 Mon Sep 17 00:00:00 2001 From: taysea Date: Wed, 15 Jan 2025 15:07:31 -0800 Subject: [PATCH 1/6] Pull in updated color names --- .../tokens/component/component.default.json | 56 ++++---- design-tokens/tokens/semantic/color.dark.json | 126 ++++++++---------- .../tokens/semantic/color.light.json | 126 ++++++++---------- 3 files changed, 146 insertions(+), 162 deletions(-) diff --git a/design-tokens/tokens/component/component.default.json b/design-tokens/tokens/component/component.default.json index 85fc9c2c2..0ffe1fc2c 100644 --- a/design-tokens/tokens/component/component.default.json +++ b/design-tokens/tokens/component/component.default.json @@ -12,7 +12,7 @@ "position": 0 }, { - "color": "{color.background.primary.default.REST}", + "color": "{color.background.primary.strong.REST}", "position": 0.35 }, { @@ -20,7 +20,7 @@ "position": 0.7 }, { - "color": "{color.background.primary.default.REST}", + "color": "{color.background.primary.strong.REST}", "position": 1 } ] @@ -48,7 +48,7 @@ }, "textColor": { "$type": "color", - "$value": "{color.text.onPrimary.DEFAULT.REST}", + "$value": "{color.text.onPrimaryStrong.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -60,7 +60,7 @@ }, "iconColor": { "$type": "color", - "$value": "{color.icon.onPrimary.DEFAULT.REST}", + "$value": "{color.icon.onPrimaryStrong.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -84,7 +84,7 @@ }, "backgroundColor": { "$type": "color", - "$value": "{color.background.primary.default.REST}", + "$value": "{color.background.primary.strong.REST}", "$description": "", "$extensions": { "com.figma": { @@ -186,7 +186,7 @@ }, "textColor": { "$type": "color", - "$value": "{color.text.onPrimary.DEFAULT.REST}", + "$value": "{color.text.onPrimaryStrong.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -198,7 +198,7 @@ }, "iconColor": { "$type": "color", - "$value": "{color.icon.onPrimary.DEFAULT.REST}", + "$value": "{color.icon.onPrimaryStrong.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -1404,7 +1404,7 @@ }, "borderColor": { "$type": "color", - "$value": "{color.background.primary.default.REST}", + "$value": "{color.background.primary.strong.REST}", "$description": "", "$extensions": { "com.figma": { @@ -6206,7 +6206,7 @@ "rest": { "background": { "$type": "color", - "$value": "{color.background.selected.weak.enabled.DEFAULT.REST}", + "$value": "{color.background.selected.primary.weak.REST}", "$description": "", "$extensions": { "com.figma": { @@ -6230,7 +6230,7 @@ }, "textColor": { "$type": "color", - "$value": "{color.text.onSelected.DEFAULT.REST}", + "$value": "{color.text.onSelectedPrimary.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -6256,7 +6256,7 @@ "hover": { "background": { "$type": "color", - "$value": "{color.background.selected.weak.hover}", + "$value": "{color.background.selected.primary.weak.hover}", "$description": "", "$extensions": { "com.figma": { @@ -6280,7 +6280,7 @@ }, "textColor": { "$type": "color", - "$value": "{color.text.onSelected.DEFAULT.REST}", + "$value": "{color.text.onSelectedPrimary.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -6404,7 +6404,7 @@ "rest": { "background": { "$type": "color", - "$value": "{color.background.selected.strong.enabled.DEFAULT.REST}", + "$value": "{color.background.selected.primary.strong.REST}", "$description": "", "$extensions": { "com.figma": { @@ -6428,7 +6428,7 @@ }, "iconColor": { "$type": "color", - "$value": "{color.icon.onSelectedStrong.DEFAULT.REST}", + "$value": "{color.icon.onSelectedPrimaryStrong.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -6442,7 +6442,7 @@ "hover": { "background": { "$type": "color", - "$value": "{color.background.selected.strong.enabled.DEFAULT.REST}", + "$value": "{color.background.selected.primary.strong.REST}", "$description": "", "$extensions": { "com.figma": { @@ -6466,7 +6466,7 @@ }, "iconColor": { "$type": "color", - "$value": "{color.icon.onSelectedStrong.DEFAULT.REST}", + "$value": "{color.icon.onSelectedPrimaryStrong.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -6482,7 +6482,7 @@ "rest": { "background": { "$type": "color", - "$value": "{color.background.selected.strong.enabled.DEFAULT.REST}", + "$value": "{color.background.selected.primary.strong.REST}", "$description": "", "$extensions": { "com.figma": { @@ -6506,7 +6506,7 @@ }, "iconColor": { "$type": "color", - "$value": "{color.icon.onPrimary.DEFAULT.REST}", + "$value": "{color.icon.onPrimaryStrong.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -6520,7 +6520,7 @@ "hover": { "background": { "$type": "color", - "$value": "{color.background.selected.strong.enabled.DEFAULT.REST}", + "$value": "{color.background.selected.primary.strong.REST}", "$description": "", "$extensions": { "com.figma": { @@ -6544,7 +6544,7 @@ }, "iconColor": { "$type": "color", - "$value": "{color.icon.onPrimary.DEFAULT.REST}", + "$value": "{color.icon.onPrimaryStrong.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -6793,7 +6793,7 @@ "rest": { "background": { "$type": "color", - "$value": "{color.background.selected.strong.enabled.DEFAULT.REST}", + "$value": "{color.background.selected.primary.strong.REST}", "$description": "", "$extensions": { "com.figma": { @@ -6819,7 +6819,7 @@ "hover": { "background": { "$type": "color", - "$value": "{color.background.selected.strong.enabled.DEFAULT.REST}", + "$value": "{color.background.selected.primary.strong.REST}", "$description": "", "$extensions": { "com.figma": { @@ -7435,7 +7435,7 @@ "rest": { "textColor": { "$type": "color", - "$value": "{color.text.onSelected.DEFAULT.REST}", + "$value": "{color.text.onSelectedPrimary.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -7447,7 +7447,7 @@ }, "iconColor": { "$type": "color", - "$value": "{color.icon.onSelected.DEFAULT.REST}", + "$value": "{color.icon.onSelectedPrimary.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -7471,7 +7471,7 @@ }, "background": { "$type": "color", - "$value": "{color.background.selected.weak.enabled.DEFAULT.REST}", + "$value": "{color.background.selected.primary.weak.REST}", "$description": "", "$extensions": { "com.figma": { @@ -7485,7 +7485,7 @@ "hover": { "textColor": { "$type": "color", - "$value": "{color.text.onSelected.DEFAULT.REST}", + "$value": "{color.text.onSelectedPrimary.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -7497,7 +7497,7 @@ }, "iconColor": { "$type": "color", - "$value": "{color.icon.onSelected.DEFAULT.REST}", + "$value": "{color.icon.onSelectedPrimary.DEFAULT.REST}", "$description": "", "$extensions": { "com.figma": { @@ -7521,7 +7521,7 @@ }, "background": { "$type": "color", - "$value": "{color.background.selected.weak.hover}", + "$value": "{color.background.selected.primary.weak.hover}", "$description": "", "$extensions": { "com.figma": { diff --git a/design-tokens/tokens/semantic/color.dark.json b/design-tokens/tokens/semantic/color.dark.json index 8f341cfae..b55d480c5 100644 --- a/design-tokens/tokens/semantic/color.dark.json +++ b/design-tokens/tokens/semantic/color.dark.json @@ -218,7 +218,7 @@ } }, "primary": { - "default": { + "strong": { "REST": { "$type": "color", "$value": "{base.color.green.600}", @@ -230,9 +230,7 @@ "codeSyntax": {} } } - } - }, - "DEFAULT": { + }, "hover": { "$type": "color", "$value": "{base.color.green.600}", @@ -248,62 +246,56 @@ } }, "selected": { - "strong": { - "enabled": { - "DEFAULT": { - "REST": { - "$type": "color", - "$value": "{base.color.brand}", - "$description": "Selected (or checked) color. Used for ‘selected’ state. Examples include, checked checkboxes, checked radios, on toggle, active tabs.", - "$extensions": { - "com.figma": { - "hiddenFromPublishing": false, - "scopes": ["FRAME_FILL", "SHAPE_FILL"], - "codeSyntax": {} - } + "primary": { + "strong": { + "REST": { + "$type": "color", + "$value": "{base.color.brand}", + "$description": "Selected (or checked) color. Used for ‘selected’ state. Examples include, checked checkboxes, checked radios, on toggle, active tabs.", + "$extensions": { + "com.figma": { + "hiddenFromPublishing": false, + "scopes": ["FRAME_FILL", "SHAPE_FILL"], + "codeSyntax": {} } } - } - }, - "hover": { - "$type": "color", - "$value": "{base.color.brand}", - "$description": "Selected (or checked) color. Used for ‘selected’ state. Examples include, checked checkboxes, checked radios, on toggle, active tabs.", - "$extensions": { - "com.figma": { - "hiddenFromPublishing": false, - "scopes": ["FRAME_FILL", "SHAPE_FILL"], - "codeSyntax": {} - } - } - } - }, - "weak": { - "enabled": { - "DEFAULT": { - "REST": { - "$type": "color", - "$value": "{base.color.green.1000}", - "$description": "Lower emphasis variant of background-selected-strong.", - "$extensions": { - "com.figma": { - "hiddenFromPublishing": false, - "scopes": ["FRAME_FILL", "SHAPE_FILL"], - "codeSyntax": {} - } + }, + "hover": { + "$type": "color", + "$value": "{base.color.brand}", + "$description": "Selected (or checked) color. Used for ‘selected’ state. Examples include, checked checkboxes, checked radios, on toggle, active tabs.", + "$extensions": { + "com.figma": { + "hiddenFromPublishing": false, + "scopes": ["FRAME_FILL", "SHAPE_FILL"], + "codeSyntax": {} } } } }, - "hover": { - "$type": "color", - "$value": "{base.color.green.900}", - "$description": "Hover variant of background-selected-weak.", - "$extensions": { - "com.figma": { - "hiddenFromPublishing": false, - "scopes": ["FRAME_FILL", "SHAPE_FILL"], - "codeSyntax": {} + "weak": { + "REST": { + "$type": "color", + "$value": "{base.color.green.1000}", + "$description": "Lower emphasis variant of background-selected-strong.", + "$extensions": { + "com.figma": { + "hiddenFromPublishing": false, + "scopes": ["FRAME_FILL", "SHAPE_FILL"], + "codeSyntax": {} + } + } + }, + "hover": { + "$type": "color", + "$value": "{base.color.green.900}", + "$description": "Hover variant of background-selected-weak.", + "$extensions": { + "com.figma": { + "hiddenFromPublishing": false, + "scopes": ["FRAME_FILL", "SHAPE_FILL"], + "codeSyntax": {} + } } } } @@ -557,7 +549,7 @@ } } }, - "onPrimary": { + "onPrimaryStrong": { "DEFAULT": { "REST": { "$type": "color", @@ -670,7 +662,7 @@ } }, "heading": { - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{color.text.strong.REST}", @@ -685,7 +677,7 @@ } } }, - "onSelectedStrong": { + "onSelectedPrimaryStrong": { "DEFAULT": { "REST": { "$type": "color", @@ -701,7 +693,7 @@ } } }, - "onSelected": { + "onSelectedPrimary": { "DEFAULT": { "REST": { "$type": "color", @@ -718,7 +710,7 @@ } }, "onStrong": { - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{base.color.grey.1200}", @@ -748,7 +740,7 @@ } } }, - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{color.text.default.REST}", @@ -778,7 +770,7 @@ } } }, - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{color.text.default.REST}", @@ -808,7 +800,7 @@ } } }, - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{color.text.default.REST}", @@ -838,7 +830,7 @@ } } }, - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{color.text.default.REST}", @@ -868,7 +860,7 @@ } } }, - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{color.text.default.REST}", @@ -1039,7 +1031,7 @@ } } }, - "onPrimary": { + "onPrimaryStrong": { "DEFAULT": { "REST": { "$type": "color", @@ -1055,7 +1047,7 @@ } } }, - "onSelectedStrong": { + "onSelectedPrimaryStrong": { "DEFAULT": { "REST": { "$type": "color", @@ -1071,7 +1063,7 @@ } } }, - "onSelected": { + "onSelectedPrimary": { "DEFAULT": { "REST": { "$type": "color", diff --git a/design-tokens/tokens/semantic/color.light.json b/design-tokens/tokens/semantic/color.light.json index ad16bb1d0..46602018f 100644 --- a/design-tokens/tokens/semantic/color.light.json +++ b/design-tokens/tokens/semantic/color.light.json @@ -218,7 +218,7 @@ } }, "primary": { - "default": { + "strong": { "REST": { "$type": "color", "$value": "{base.color.green.600}", @@ -230,9 +230,7 @@ "codeSyntax": {} } } - } - }, - "DEFAULT": { + }, "hover": { "$type": "color", "$value": "{base.color.green.600}", @@ -248,62 +246,56 @@ } }, "selected": { - "strong": { - "enabled": { - "DEFAULT": { - "REST": { - "$type": "color", - "$value": "{base.color.brand}", - "$description": "Selected (or checked) color. Used for ‘selected’ state. Examples include, checked checkboxes, checked radios, on toggle, active tabs.", - "$extensions": { - "com.figma": { - "hiddenFromPublishing": false, - "scopes": ["FRAME_FILL", "SHAPE_FILL"], - "codeSyntax": {} - } + "primary": { + "strong": { + "REST": { + "$type": "color", + "$value": "{base.color.brand}", + "$description": "Selected (or checked) color. Used for ‘selected’ state. Examples include, checked checkboxes, checked radios, on toggle, active tabs.", + "$extensions": { + "com.figma": { + "hiddenFromPublishing": false, + "scopes": ["FRAME_FILL", "SHAPE_FILL"], + "codeSyntax": {} } } - } - }, - "hover": { - "$type": "color", - "$value": "{base.color.brand}", - "$description": "Selected (or checked) color. Used for ‘selected’ state. Examples include, checked checkboxes, checked radios, on toggle, active tabs.", - "$extensions": { - "com.figma": { - "hiddenFromPublishing": false, - "scopes": ["FRAME_FILL", "SHAPE_FILL"], - "codeSyntax": {} - } - } - } - }, - "weak": { - "enabled": { - "DEFAULT": { - "REST": { - "$type": "color", - "$value": "{base.color.green.100}", - "$description": "Lower emphasis variant of background-selected-strong.", - "$extensions": { - "com.figma": { - "hiddenFromPublishing": false, - "scopes": ["FRAME_FILL", "SHAPE_FILL"], - "codeSyntax": {} - } + }, + "hover": { + "$type": "color", + "$value": "{base.color.brand}", + "$description": "Selected (or checked) color. Used for ‘selected’ state. Examples include, checked checkboxes, checked radios, on toggle, active tabs.", + "$extensions": { + "com.figma": { + "hiddenFromPublishing": false, + "scopes": ["FRAME_FILL", "SHAPE_FILL"], + "codeSyntax": {} } } } }, - "hover": { - "$type": "color", - "$value": "{base.color.green.125}", - "$description": "Hover variant of background-selected-weak.", - "$extensions": { - "com.figma": { - "hiddenFromPublishing": false, - "scopes": ["FRAME_FILL", "SHAPE_FILL"], - "codeSyntax": {} + "weak": { + "REST": { + "$type": "color", + "$value": "{base.color.green.100}", + "$description": "Lower emphasis variant of background-selected-strong.", + "$extensions": { + "com.figma": { + "hiddenFromPublishing": false, + "scopes": ["FRAME_FILL", "SHAPE_FILL"], + "codeSyntax": {} + } + } + }, + "hover": { + "$type": "color", + "$value": "{base.color.green.125}", + "$description": "Hover variant of background-selected-weak.", + "$extensions": { + "com.figma": { + "hiddenFromPublishing": false, + "scopes": ["FRAME_FILL", "SHAPE_FILL"], + "codeSyntax": {} + } } } } @@ -557,7 +549,7 @@ } } }, - "onPrimary": { + "onPrimaryStrong": { "DEFAULT": { "REST": { "$type": "color", @@ -670,7 +662,7 @@ } }, "heading": { - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{color.text.strong.REST}", @@ -685,7 +677,7 @@ } } }, - "onSelectedStrong": { + "onSelectedPrimaryStrong": { "DEFAULT": { "REST": { "$type": "color", @@ -701,7 +693,7 @@ } } }, - "onSelected": { + "onSelectedPrimary": { "DEFAULT": { "REST": { "$type": "color", @@ -718,7 +710,7 @@ } }, "onStrong": { - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{base.color.white.100}", @@ -748,7 +740,7 @@ } } }, - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{color.text.default.REST}", @@ -778,7 +770,7 @@ } } }, - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{color.text.default.REST}", @@ -808,7 +800,7 @@ } } }, - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{color.text.default.REST}", @@ -838,7 +830,7 @@ } } }, - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{color.text.default.REST}", @@ -868,7 +860,7 @@ } } }, - "default": { + "DEFAULT": { "REST": { "$type": "color", "$value": "{color.text.default.REST}", @@ -1039,7 +1031,7 @@ } } }, - "onPrimary": { + "onPrimaryStrong": { "DEFAULT": { "REST": { "$type": "color", @@ -1055,7 +1047,7 @@ } } }, - "onSelectedStrong": { + "onSelectedPrimaryStrong": { "DEFAULT": { "REST": { "$type": "color", @@ -1071,7 +1063,7 @@ } } }, - "onSelected": { + "onSelectedPrimary": { "DEFAULT": { "REST": { "$type": "color", From 5cc62ce5f01c352ecdd990cf62dc3065445d4403 Mon Sep 17 00:00:00 2001 From: Taylor Seamans Date: Thu, 16 Jan 2025 10:19:45 -0800 Subject: [PATCH 2/6] Create good-gorillas-suffer.md --- .changeset/good-gorillas-suffer.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .changeset/good-gorillas-suffer.md diff --git a/.changeset/good-gorillas-suffer.md b/.changeset/good-gorillas-suffer.md new file mode 100644 index 000000000..1c87675c9 --- /dev/null +++ b/.changeset/good-gorillas-suffer.md @@ -0,0 +1,22 @@ +--- +"hpe-design-tokens": minor +--- + +- Renamed `color.background.primary.default` --> `color.background.primary.strong` +- Renamed `color.background.selected.strong.enabled` --> `color.background.selected.primary.strong` +- Renamed `color.background.selected.strong.hover` --> `color.background.selected.primary.strong.hover` +- Renamed `color.background.selected.weak.enabled` --> `color.background.selected.primary.weak` +- Renamed `color.background.selected.weak.hover` --> `color.background.selected.primary.weak.hover` +- Renamed `color.text.onPrimary` --> `color.text.onPrimaryStrong` +- Renamed `color.text.heading.default` --> `color.text.heading` +- Renamed `color.text.onSelectedStrong` --> `color.text.onSelectedPrimaryStrong` +- Renamed `color.text.onSelected` --> `color.text.onSelectedPrimary` +- Renamed `color.text.onStrong.default` --> `color.text.onStrong` +- Renamed `color.text.onCritical.default` --> `color.text.onCritical` +- Renamed `color.text.onWarning.default` --> `color.text.onWarning` +- Renamed `color.text.onOk.default` --> `color.text.onOk` +- Renamed `color.text.onInfo.default` --> `color.text.onInfo` +- Renamed `color.text.onUnknown.default` --> `color.text.onUnknown` +- Renamed `color.icon.onPrimary` --> `color.icon.onPrimaryStrong` +- Renamed `color.icon.onSelectedStrong` --> `color.icon.onSelectedPrimaryStrong` +- Renamed `color.icon.onSelected` --> `color.icon.onSelectedPrimary` From 658423268a6343ce71725391366bb4c65ec425c0 Mon Sep 17 00:00:00 2001 From: taysea Date: Thu, 16 Jan 2025 11:15:05 -0800 Subject: [PATCH 3/6] Rename primitive mode from base to default, update file exports from base to primitives --- .../pages/design-tokens/all-design-tokens.js | 4 +- .../src/scripts/build-style-dictionary.js | 20 +++++----- ...ives.base.json => primitives.default.json} | 0 design-tokens/tokens/semantic/color.dark.json | 38 +++++++++++++------ .../tokens/semantic/color.light.json | 38 +++++++++++++------ 5 files changed, 64 insertions(+), 36 deletions(-) rename design-tokens/tokens/primitive/{primitives.base.json => primitives.default.json} (100%) diff --git a/aries-site/src/pages/design-tokens/all-design-tokens.js b/aries-site/src/pages/design-tokens/all-design-tokens.js index 81fd412b9..cd0261c41 100644 --- a/aries-site/src/pages/design-tokens/all-design-tokens.js +++ b/aries-site/src/pages/design-tokens/all-design-tokens.js @@ -32,14 +32,14 @@ const structuredTokens = { }; Object.keys(tokens).forEach(mode => { - // base, component, light, dark, etc. + // primitives, component, light, dark, etc. Object.keys(tokens[mode]).forEach(token => { const currentToken = tokens[mode][token]; const parts = token.split('.'); const category = parts[1]; let level; - if (mode === 'base') level = 'primitive'; + if (mode === 'primitives') level = 'primitive'; else if (mode === 'components') level = 'component'; else level = 'semantic'; diff --git a/design-tokens/src/scripts/build-style-dictionary.js b/design-tokens/src/scripts/build-style-dictionary.js index 3102eb9e1..67714eb1b 100644 --- a/design-tokens/src/scripts/build-style-dictionary.js +++ b/design-tokens/src/scripts/build-style-dictionary.js @@ -20,7 +20,7 @@ let extendedDictionary = HPEStyleDictionary; * ----------------------------------- */ try { extendedDictionary = await HPEStyleDictionary.extend({ - source: [`${TOKENS_DIR}/primitive/primitives.base.json`], + source: [`${TOKENS_DIR}/primitive/primitives.default.json`], platforms: { grommet: { transformGroup: 'js/w3c', @@ -28,7 +28,7 @@ try { prefix: PREFIX, files: [ { - destination: 'base.js', + destination: 'primitives.js', format: 'javascript/esm', }, ], @@ -39,7 +39,7 @@ try { prefix: PREFIX, files: [ { - destination: 'base.js', + destination: 'primitives.js', format: 'javascript/esm', }, ], @@ -50,7 +50,7 @@ try { prefix: PREFIX, files: [ { - destination: 'base.cjs', + destination: 'primitives.cjs', format: 'javascript/commonJs', }, ], @@ -61,7 +61,7 @@ try { prefix: PREFIX, files: [ { - destination: 'base.css', + destination: 'primitives.css', format: 'css/variables', options: { outputReferences: true, @@ -73,7 +73,7 @@ try { transformGroup: 'js/w3c', buildPath: DOCS_DIR, prefix: PREFIX, - files: [{ destination: 'base.js', format: 'jsonFlat' }], + files: [{ destination: 'primitives.js', format: 'jsonFlat' }], }, }, }); @@ -88,7 +88,7 @@ try { try { extendedDictionary = await HPEStyleDictionary.extend({ source: [ - `${TOKENS_DIR}/primitive/primitives.base.json`, + `${TOKENS_DIR}/primitive/primitives.default.json`, `${TOKENS_DIR}/semantic/color.light.json`, // using light mode to have a reference name available `${TOKENS_DIR}/semantic/global.default.json`, ], @@ -186,7 +186,7 @@ try { colorModeFiles.forEach(async file => { const [theme, mode] = getThemeAndMode(file); extendedDictionary = await HPEStyleDictionary.extend({ - source: [`${TOKENS_DIR}/primitive/primitives.base.json`, file], + source: [`${TOKENS_DIR}/primitive/primitives.default.json`, file], platforms: { grommet: { transformGroup: 'js/w3c', @@ -288,7 +288,7 @@ try { const mode = res[1]; extendedDictionary = await HPEStyleDictionary.extend({ source: [ - `${TOKENS_DIR}/primitive/primitives.base.json`, + `${TOKENS_DIR}/primitive/primitives.default.json`, `${TOKENS_DIR}/semantic/color.light.json`, `${TOKENS_DIR}/semantic/global.default.json`, file, @@ -378,7 +378,7 @@ try { try { extendedDictionary = await HPEStyleDictionary.extend({ source: [ - `${TOKENS_DIR}/primitive/primitives.base.json`, + `${TOKENS_DIR}/primitive/primitives.default.json`, `${TOKENS_DIR}/semantic/global.default.json`, `${TOKENS_DIR}/semantic/color.light.json`, // using light mode to have a reference name available `${TOKENS_DIR}/semantic/dimension.medium.json`, // using medium mode to have a reference name available diff --git a/design-tokens/tokens/primitive/primitives.base.json b/design-tokens/tokens/primitive/primitives.default.json similarity index 100% rename from design-tokens/tokens/primitive/primitives.base.json rename to design-tokens/tokens/primitive/primitives.default.json diff --git a/design-tokens/tokens/semantic/color.dark.json b/design-tokens/tokens/semantic/color.dark.json index b55d480c5..56d572631 100644 --- a/design-tokens/tokens/semantic/color.dark.json +++ b/design-tokens/tokens/semantic/color.dark.json @@ -137,12 +137,12 @@ } } }, - "ok": { + "info": { "DEFAULT": { "REST": { "$type": "color", - "$value": "{base.color.green.500-Opacity30}", - "$description": "Use for backgrounds communicating success.", + "$value": "{base.color.blue.400-Opacity12}", + "$description": "Use for backgrounds communicating neutral information.", "$extensions": { "com.figma": { "hiddenFromPublishing": false, @@ -153,12 +153,12 @@ } } }, - "critical": { + "unknown": { "DEFAULT": { "REST": { "$type": "color", - "$value": "{base.color.red.800-Opacity30}", - "$description": "Use for backgrounds communicating errors or danger.", + "$value": "{base.color.white.opacity6}", + "$description": "Use for backgrounds communicating an unknown status.", "$extensions": { "com.figma": { "hiddenFromPublishing": false, @@ -169,12 +169,12 @@ } } }, - "unknown": { + "critical": { "DEFAULT": { "REST": { "$type": "color", - "$value": "{base.color.white.opacity6}", - "$description": "Use for backgrounds communicating an unknown status.", + "$value": "{base.color.red.800-Opacity30}", + "$description": "Use for backgrounds communicating errors or danger.", "$extensions": { "com.figma": { "hiddenFromPublishing": false, @@ -185,12 +185,12 @@ } } }, - "info": { + "ok": { "DEFAULT": { "REST": { "$type": "color", - "$value": "{base.color.blue.400-Opacity12}", - "$description": "Use for backgrounds communicating neutral information.", + "$value": "{base.color.green.500-Opacity30}", + "$description": "Use for backgrounds communicating success.", "$extensions": { "com.figma": { "hiddenFromPublishing": false, @@ -243,6 +243,20 @@ } } } + }, + "xstrong": { + "REST": { + "$type": "color", + "$value": "{base.color.green.1000}", + "$description": "Hover variant of background-primary.", + "$extensions": { + "com.figma": { + "hiddenFromPublishing": false, + "scopes": ["FRAME_FILL", "SHAPE_FILL"], + "codeSyntax": {} + } + } + } } }, "selected": { diff --git a/design-tokens/tokens/semantic/color.light.json b/design-tokens/tokens/semantic/color.light.json index 46602018f..a98f5d318 100644 --- a/design-tokens/tokens/semantic/color.light.json +++ b/design-tokens/tokens/semantic/color.light.json @@ -137,12 +137,12 @@ } } }, - "ok": { + "info": { "DEFAULT": { "REST": { "$type": "color", - "$value": "{base.color.green.400-Opacity24}", - "$description": "Use for backgrounds communicating success.", + "$value": "{base.color.blue.400-Opacity24}", + "$description": "Use for backgrounds communicating neutral information.", "$extensions": { "com.figma": { "hiddenFromPublishing": false, @@ -153,12 +153,12 @@ } } }, - "critical": { + "unknown": { "DEFAULT": { "REST": { "$type": "color", - "$value": "{base.color.red.500-Opacity24}", - "$description": "Use for backgrounds communicating errors or danger.", + "$value": "{base.color.black.opacity4}", + "$description": "Use for backgrounds communicating an unknown status.", "$extensions": { "com.figma": { "hiddenFromPublishing": false, @@ -169,12 +169,12 @@ } } }, - "unknown": { + "critical": { "DEFAULT": { "REST": { "$type": "color", - "$value": "{base.color.black.opacity4}", - "$description": "Use for backgrounds communicating an unknown status.", + "$value": "{base.color.red.500-Opacity24}", + "$description": "Use for backgrounds communicating errors or danger.", "$extensions": { "com.figma": { "hiddenFromPublishing": false, @@ -185,12 +185,12 @@ } } }, - "info": { + "ok": { "DEFAULT": { "REST": { "$type": "color", - "$value": "{base.color.blue.400-Opacity24}", - "$description": "Use for backgrounds communicating neutral information.", + "$value": "{base.color.green.400-Opacity24}", + "$description": "Use for backgrounds communicating success.", "$extensions": { "com.figma": { "hiddenFromPublishing": false, @@ -243,6 +243,20 @@ } } } + }, + "xstrong": { + "REST": { + "$type": "color", + "$value": "{base.color.green.1000}", + "$description": "Hover variant of background-primary.", + "$extensions": { + "com.figma": { + "hiddenFromPublishing": false, + "scopes": ["FRAME_FILL", "SHAPE_FILL"], + "codeSyntax": {} + } + } + } } }, "selected": { From 933c718e50ee06a5b64a56c3f3c6c673bd26f76c Mon Sep 17 00:00:00 2001 From: taysea Date: Thu, 16 Jan 2025 11:17:58 -0800 Subject: [PATCH 4/6] Remove default from component file export names --- design-tokens/src/scripts/build-style-dictionary.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/design-tokens/src/scripts/build-style-dictionary.js b/design-tokens/src/scripts/build-style-dictionary.js index 67714eb1b..3ea501f11 100644 --- a/design-tokens/src/scripts/build-style-dictionary.js +++ b/design-tokens/src/scripts/build-style-dictionary.js @@ -392,7 +392,7 @@ try { prefix: PREFIX, files: [ { - destination: 'components.default.js', + destination: 'components.js', filter: token => token.filePath.includes(`${TOKENS_DIR}/component/`), format: 'esmGrommetRefs', @@ -405,7 +405,7 @@ try { prefix: PREFIX, files: [ { - destination: 'components.default.js', + destination: 'components.js', filter: token => token.filePath.includes(`${TOKENS_DIR}/component/`), format: 'esmGrommetRefs', @@ -418,7 +418,7 @@ try { prefix: PREFIX, files: [ { - destination: 'components.default.cjs', + destination: 'components.cjs', filter: token => token.filePath.includes(`${TOKENS_DIR}/component/`), format: 'javascript/commonJs', From 110bbd368f0414192ec123ea33231b515d522bdd Mon Sep 17 00:00:00 2001 From: taysea Date: Thu, 16 Jan 2025 11:22:49 -0800 Subject: [PATCH 5/6] Remove unneeded modes for color and dimension ESM/CommonJS exports --- design-tokens/src/scripts/build-style-dictionary.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/design-tokens/src/scripts/build-style-dictionary.js b/design-tokens/src/scripts/build-style-dictionary.js index 3ea501f11..ed2fc70ec 100644 --- a/design-tokens/src/scripts/build-style-dictionary.js +++ b/design-tokens/src/scripts/build-style-dictionary.js @@ -208,9 +208,7 @@ try { prefix: PREFIX, files: [ { - destination: `color.${ - theme ? `${theme}-${mode}` : `${mode || ''}` - }.js`, + destination: 'color.js', format: 'javascript/esm', filter: token => token.filePath === file, }, @@ -222,9 +220,7 @@ try { prefix: PREFIX, files: [ { - destination: `color.${ - theme ? `${theme}-${mode}` : `${mode || ''}` - }.cjs`, + destination: 'color.cjs', format: 'javascript/commonJs', filter: token => token.filePath === file, }, @@ -312,7 +308,7 @@ try { prefix: PREFIX, files: [ { - destination: `dimension.${mode}.js`, + destination: 'dimension.js', format: 'javascript/esm', filter: token => token.filePath === file, }, @@ -324,7 +320,7 @@ try { prefix: PREFIX, files: [ { - destination: `dimension.${mode}.cjs`, + destination: 'dimension.cjs', format: 'javascript/commonJs', filter: token => token.filePath === file, }, From a9dcb587a97eb76a9b0b9fa75e7bee8e56c48c25 Mon Sep 17 00:00:00 2001 From: Taylor Seamans Date: Thu, 16 Jan 2025 11:35:35 -0800 Subject: [PATCH 6/6] Create cuddly-elephants-happen.md --- .changeset/cuddly-elephants-happen.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/cuddly-elephants-happen.md diff --git a/.changeset/cuddly-elephants-happen.md b/.changeset/cuddly-elephants-happen.md new file mode 100644 index 000000000..126c1500d --- /dev/null +++ b/.changeset/cuddly-elephants-happen.md @@ -0,0 +1,7 @@ +--- +"hpe-design-tokens": minor +--- + +- Renamed exports from "base" to "primitives" (e.g., "base.css" --> "primitives.css"). +- Removed "default" from CJS/ESM component token exports (e.g., "components.default.cjs" --> "components.js"). No effect on import. +- Removed light/dark, medium/small modes from ESM/CommonJS exports. Because these now return CSS variable refs, we don't need separate mode exports. (e.g., "color.light.js" --> "color.js").