diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 4520849..7601b59 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -13,19 +13,23 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # Used for conventional commit ranges - - - uses: Workday/canvas-kit-actions/install@v1 - with: - node_version: 18.x + + - name: Install + shell: bash + run: yarn install + # - uses: Workday/canvas-kit-actions/install@v1 + # with: + # node_version: 18.x - name: Build Tokens + shell: bash run: yarn build:tokens --no-cache # Build Storybook and extract component stories for Storybook aggregation. This will be used # for Chromatic rebaselining and publishing to GH Pages. - name: Build Storybook shell: bash - run: yarn build-storybook --no-cache --verbose + run: yarn build-storybook - name: Publish Storybook uses: JamesIves/github-pages-deploy-action@v4.4.1 diff --git a/packages/canvas-tokens-docs/stories/system/examples/FontFamily.tsx b/packages/canvas-tokens-docs/stories/system/examples/FontFamily.tsx index 253e63f..3dba2db 100644 --- a/packages/canvas-tokens-docs/stories/system/examples/FontFamily.tsx +++ b/packages/canvas-tokens-docs/stories/system/examples/FontFamily.tsx @@ -12,7 +12,7 @@ const fontFamilyTokens: FontFamilyToken[] = Object.values(system.fontFamily).map return { label: varName, - value: value, + value: value.replace(/"/g, ''), }; }); diff --git a/packages/canvas-tokens-docs/stories/system/examples/Shape.tsx b/packages/canvas-tokens-docs/stories/system/examples/Shape.tsx index 8191a25..7882d74 100644 --- a/packages/canvas-tokens-docs/stories/system/examples/Shape.tsx +++ b/packages/canvas-tokens-docs/stories/system/examples/Shape.tsx @@ -11,8 +11,10 @@ interface ShapeToken { } function multiplyCalcValues(value: string) { + // Matches numbers such as .25, 0.25, or 25 + const numberRegExp = new RegExp(/(0*\.)?\d+/g); // Find the numbers in the string value - const matches = value.match(/(0.)?\d+/g); + const matches = value.match(numberRegExp); if (matches) { // Multiply the matched values return matches.reduce((acc, current) => acc * Number(current), 1); @@ -24,6 +26,7 @@ function multiplyCalcValues(value: string) { const shapeTokens: ShapeToken[] = Object.values(system.shape).map(varName => { const value = getComputedStyle(document.documentElement).getPropertyValue(varName); const computedValue = multiplyCalcValues(value); + return { label: varName, value: value, diff --git a/packages/canvas-tokens-docs/stories/system/examples/Space.tsx b/packages/canvas-tokens-docs/stories/system/examples/Space.tsx index de55b39..0f36939 100644 --- a/packages/canvas-tokens-docs/stories/system/examples/Space.tsx +++ b/packages/canvas-tokens-docs/stories/system/examples/Space.tsx @@ -11,8 +11,10 @@ interface SpaceToken { } function multiplyCalcValues(value: string) { + // Matches numbers such as .25, 0.25, or 25 + const numberRegExp = new RegExp(/(0*\.)?\d+/g); // Find the numbers in the string value - const matches = value.match(/(0.)?\d+/g); + const matches = value.match(numberRegExp); if (matches) { // Multiply the matched values return matches.reduce((acc, current) => acc * Number(current), 1);