From 37a1bd8acd54bb3714f9cdeabe1c2f0945c762e9 Mon Sep 17 00:00:00 2001 From: Andrew Holloway Date: Wed, 3 Jan 2024 12:57:58 -0600 Subject: [PATCH] refactor(tokens): adjust tokens to be import/export compatible (#1819) - update token file usages in storybook - add in missing tokens attributes to close needed gaps on import - updates to usages NOT resulting in visual changes - add "group" values to exportable tokens to mark types - standardize deprecation comments - remove usages of tokens matching the named value --- .../components/DesignTokens/Tier1/Colors.tsx | 3 - .../components/DesignTokens/Tier1/Sizes.jsx | 2 +- .../Tier3/TypographyComponents.stories.tsx | 13 +- .../Docs/Guidelines/Typography.stories.mdx | 13 +- .storybook/data/tokens.json | 144 ++-- README.md | 2 +- docs/CONTRIBUTING.md | 8 +- src/components/Avatar/Avatar.module.css | 2 +- src/components/Badge/Badge.module.css | 2 +- src/components/DragDrop/DragDrop.module.css | 6 +- src/components/Drawer/Drawer.module.css | 2 +- src/components/Layout/Layout.module.css | 4 +- .../LayoutContainer.module.css | 2 +- .../LayoutLinelengthContainer.module.css | 2 +- src/components/Modal/Modal.module.css | 2 +- .../NumberIcon/NumberIcon.module.css | 2 +- .../PopoverContainer.module.css | 2 +- .../PopoverListItem.module.css | 2 +- src/components/Select/Select.module.css | 2 +- src/components/Skeleton/Skeleton.module.css | 2 +- .../TimelineNav/TimelineNav.module.css | 8 +- src/components/Toggle/Toggle.module.css | 2 +- .../tier-1-definitions/animation.json | 3 +- .../tier-1-definitions/borders.json | 6 +- .../tier-1-definitions/colors.json | 108 +-- .../tier-1-definitions/layout.json | 6 +- .../tier-1-definitions/size.json | 55 +- .../tier-1-definitions/typography.json | 179 ++--- .../tier-1-definitions/z-index.json | 18 +- .../tier-2-usage/colors-background.json | 66 +- .../tier-2-usage/colors-border.json | 78 +- .../tier-2-usage/colors-icon.json | 78 +- .../tier-2-usage/colors-text.json | 54 +- .../tier-2-usage/colors-transparent.json | 12 +- .../tier-2-usage/typography.json | 17 +- .../{body.json => body-colors.json} | 6 +- ...dcrumb.json => breadcrumb-typography.json} | 0 .../tier-3-component/buttons-box.json | 15 + .../tier-3-component/buttons-colors.json | 674 ++++++++++++++++++ .../tier-3-component/buttons-typography.json | 26 + .../tier-3-component/buttons.json | 565 --------------- .../{checkbox.json => checkbox-colors.json} | 3 +- .../tier-3-component/data-bar.json | 16 - .../tier-3-component/dataBar-colors.json | 20 + .../{focus-ring.json => focusRing-box.json} | 10 - .../tier-3-component/focusRing-colors.json | 18 + .../tier-3-component/forms-colors.json | 34 + .../tier-3-component/forms-form.json | 16 + .../tier-3-component/forms-typography.json | 16 + src/design-tokens/tier-3-component/forms.json | 49 -- .../{link.json => link-colors.json} | 58 +- .../tier-3-component/link-typography.json | 22 + .../{modals.json => modals-colors.json} | 3 +- ...gress-bar.json => progressBar-colors.json} | 0 .../{radio.json => radio-colors.json} | 3 +- .../{slider.json => slider-size.json} | 0 .../{tab.json => tab-typography.json} | 0 .../{tag.json => tag-typography.json} | 0 ...ghlight.json => textHighlight-colors.json} | 6 +- .../{toggle.json => toggle-colors.json} | 18 +- src/tokens-dist/css/variables.css | 238 ++++--- src/tokens-dist/json/variables-nested.json | 144 ++-- src/tokens-dist/ts/colors.ts | 58 +- 63 files changed, 1653 insertions(+), 1272 deletions(-) rename src/design-tokens/tier-3-component/{body.json => body-colors.json} (55%) rename src/design-tokens/tier-3-component/{breadcrumb.json => breadcrumb-typography.json} (100%) create mode 100644 src/design-tokens/tier-3-component/buttons-box.json create mode 100644 src/design-tokens/tier-3-component/buttons-colors.json create mode 100644 src/design-tokens/tier-3-component/buttons-typography.json delete mode 100644 src/design-tokens/tier-3-component/buttons.json rename src/design-tokens/tier-3-component/{checkbox.json => checkbox-colors.json} (69%) delete mode 100644 src/design-tokens/tier-3-component/data-bar.json create mode 100644 src/design-tokens/tier-3-component/dataBar-colors.json rename src/design-tokens/tier-3-component/{focus-ring.json => focusRing-box.json} (57%) create mode 100644 src/design-tokens/tier-3-component/focusRing-colors.json create mode 100644 src/design-tokens/tier-3-component/forms-colors.json create mode 100644 src/design-tokens/tier-3-component/forms-form.json create mode 100644 src/design-tokens/tier-3-component/forms-typography.json delete mode 100644 src/design-tokens/tier-3-component/forms.json rename src/design-tokens/tier-3-component/{link.json => link-colors.json} (76%) create mode 100644 src/design-tokens/tier-3-component/link-typography.json rename src/design-tokens/tier-3-component/{modals.json => modals-colors.json} (73%) rename src/design-tokens/tier-3-component/{progress-bar.json => progressBar-colors.json} (100%) rename src/design-tokens/tier-3-component/{radio.json => radio-colors.json} (69%) rename src/design-tokens/tier-3-component/{slider.json => slider-size.json} (100%) rename src/design-tokens/tier-3-component/{tab.json => tab-typography.json} (100%) rename src/design-tokens/tier-3-component/{tag.json => tag-typography.json} (100%) rename src/design-tokens/tier-3-component/{text-highlight.json => textHighlight-colors.json} (53%) rename src/design-tokens/tier-3-component/{toggle.json => toggle-colors.json} (67%) diff --git a/.storybook/components/DesignTokens/Tier1/Colors.tsx b/.storybook/components/DesignTokens/Tier1/Colors.tsx index 82693bd01..3621486b0 100755 --- a/.storybook/components/DesignTokens/Tier1/Colors.tsx +++ b/.storybook/components/DesignTokens/Tier1/Colors.tsx @@ -29,9 +29,6 @@ export const Tier1Colors = () => { listItems={getListItems('eds-color-other-yellow', 'yellow')} /> - ); diff --git a/.storybook/components/DesignTokens/Tier1/Sizes.jsx b/.storybook/components/DesignTokens/Tier1/Sizes.jsx index 1d0a85cfd..fffb98f2f 100755 --- a/.storybook/components/DesignTokens/Tier1/Sizes.jsx +++ b/.storybook/components/DesignTokens/Tier1/Sizes.jsx @@ -12,7 +12,7 @@ export class Tier1Sizes extends Component { {filterTokens('eds-size-base').map((listItem) => (