From f9cfa64a4a1510c8507e0a4c53457d070743d538 Mon Sep 17 00:00:00 2001 From: Haider Alshamma Date: Wed, 6 Nov 2024 13:41:24 -0500 Subject: [PATCH] fix: format theme after generating it --- package.json | 2 +- src/theme.ts | 836 +++++++++++++++++++++++++-------------------------- 2 files changed, 419 insertions(+), 419 deletions(-) diff --git a/package.json b/package.json index 7a02913ef..9da3aa249 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "scripts": { "ci": "yarn && yarn build && yarn test && yarn run check", "new": "plop", - "generate:theme": "npx tsx src/scripts/generateTheme.ts", + "generate:theme": "npx tsx src/scripts/generateTheme.ts && prettier -w src/theme.ts", "start": "concurrently \"yarn build --watch\" \"yarn start:storybook\"", "start:cypress": "yarn concurrently --kill-others \"yarn start --ci\" \"yarn wait-on http://localhost:9999 && cypress open\"", "start:storybook": "start-storybook -p 9999", diff --git a/src/theme.ts b/src/theme.ts index a319c8d9f..e34aeacab 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -5,426 +5,426 @@ import { DefaultNDSThemeType } from "./theme.type"; type ThemeKey = "desktop" | "tablet" | "phone"; export const themes: Record = { - "desktop": { - "colors": { - "black": "#011e38", - "blackBlue": "#122b47", - "darkBlue": "#00438f", - "blue": "#216beb", - "lightBlue": "#e1ebfa", - "darkGrey": "#434d59", - "midGrey": "#6c7784", - "grey": "#c0c8d1", - "lightGrey": "#e4e7eb", - "whiteGrey": "#f0f2f5", - "white": "#ffffff", - "yellow": "#ffbb00", - "lightYellow": "#fcf5e3", - "green": "#008059", - "lightGreen": "#e9f7f2", - "red": "#cc1439", - "lightRed": "#fae6ea", - "categorical1": "#19c4e6", - "categorical2": "#8033cc", - "categorical3": "#e372d0", - "categorical4": "#55ddb0", - "categorical5": "#ee5513", - "categorical6": "#d3d322" - }, - "fontWeights": { - "light": 300, - "normal": 400, - "medium": 500, - "bold": 600 - }, - "fonts": { - "base": "'IBM Plex Sans', sans-serif", - "mono": "'IBM Plex Mono', monospace", - "sc": "'Noto Sans SC', sans-serif" - }, - "shadows": { - "small": "0px 1px 2px 0px rgba(1, 30, 56, 0.25)", - "medium": "0px 3px 8px 0px rgba(1, 30, 56, 0.18)", - "large": "0px 6px 12px 2px rgba(1, 30, 56, 0.15)", - "focus": "0px 0px 5px 0px rgba(33, 107, 235, .9)", - "error": "0px 0px 5px 0px rgba(204, 20, 57, .9)" - }, - "breakpoints": { - "extraSmall": "0px", - "small": "768px", - "medium": "1024px", - "large": "1360px", - "extraLarge": "1920px" - }, - "zIndices": { - "content": 100, - "tabsScollIndicator": 200, - "tabsBar": 210, - "overlay": 1000, - "aboveOverlay": 1010, - "tableHeader": 10, - "modalHeaderAndFooter": 2, - "openControl": 1000, - "navBar": 900, - "sidebar": 800 - }, - "fontSizes": { - "smaller": "12px", - "small": "14px", - "medium": "16px", - "large": "24px", - "larger": "30px", - "largest": "32px", - "heading1": "32px", - "heading2": "30px", - "heading3": "24px", - "heading4": "18px" - }, - "lineHeights": { - "baseRelaxed": "1.75", - "smallRelaxed": "1.7142857142857142", - "smallerRelaxed": "1.6666666666666667", - "base": "1.5", - "smallTextBase": "1.71428571", - "smallTextCompressed": "1.14285714", - "smallerText": "1.33333333", - "heading1": "1.25", - "heading2": "1.33", - "heading3": "1.33", - "heading4": "1.33", - "title": "1.25", - "sectionTitle": "1.33", - "subsectionTitle": "1.33" - }, - "space": { - "none": "0px", - "half": "4px", - "x0": "0px", - "x0_25": "2px", - "x0_5": "4px", - "x0_75": "6px", - "x1": "8px", - "x1_25": "10px", - "x1_5": "12px", - "x1_75": "14px", - "x2": "16px", - "x2_5": "20px", - "x3": "24px", - "x4": "32px", - "x5": "40px", - "x6": "48px", - "x7": "56px", - "x8": "64px" - }, - "sizes": { - "none": "0px", - "half": "4px", - "x0": "0px", - "x0_25": "2px", - "x0_5": "4px", - "x0_75": "6px", - "x1": "8px", - "x1_25": "10px", - "x1_5": "12px", - "x1_75": "14px", - "x2": "16px", - "x2_5": "20px", - "x3": "24px", - "x4": "32px", - "x5": "40px", - "x6": "48px", - "x7": "56px", - "x8": "64px" - }, - "radii": { - "small": "2px", - "medium": "4px", - "large": "8px", - "circle": "50%", - "rounded": "9999px" - }, - "borders": [] + desktop: { + colors: { + black: "#011e38", + blackBlue: "#122b47", + darkBlue: "#00438f", + blue: "#216beb", + lightBlue: "#e1ebfa", + darkGrey: "#434d59", + midGrey: "#6c7784", + grey: "#c0c8d1", + lightGrey: "#e4e7eb", + whiteGrey: "#f0f2f5", + white: "#ffffff", + yellow: "#ffbb00", + lightYellow: "#fcf5e3", + green: "#008059", + lightGreen: "#e9f7f2", + red: "#cc1439", + lightRed: "#fae6ea", + categorical1: "#19c4e6", + categorical2: "#8033cc", + categorical3: "#e372d0", + categorical4: "#55ddb0", + categorical5: "#ee5513", + categorical6: "#d3d322", + }, + fontWeights: { + light: 300, + normal: 400, + medium: 500, + bold: 600, + }, + fonts: { + base: "'IBM Plex Sans', sans-serif", + mono: "'IBM Plex Mono', monospace", + sc: "'Noto Sans SC', sans-serif", + }, + shadows: { + small: "0px 1px 2px 0px rgba(1, 30, 56, 0.25)", + medium: "0px 3px 8px 0px rgba(1, 30, 56, 0.18)", + large: "0px 6px 12px 2px rgba(1, 30, 56, 0.15)", + focus: "0px 0px 5px 0px rgba(33, 107, 235, .9)", + error: "0px 0px 5px 0px rgba(204, 20, 57, .9)", + }, + breakpoints: { + extraSmall: "0px", + small: "768px", + medium: "1024px", + large: "1360px", + extraLarge: "1920px", + }, + zIndices: { + content: 100, + tabsScollIndicator: 200, + tabsBar: 210, + overlay: 1000, + aboveOverlay: 1010, + tableHeader: 10, + modalHeaderAndFooter: 2, + openControl: 1000, + navBar: 900, + sidebar: 800, + }, + fontSizes: { + smaller: "12px", + small: "14px", + medium: "16px", + large: "24px", + larger: "30px", + largest: "32px", + heading1: "32px", + heading2: "30px", + heading3: "24px", + heading4: "18px", + }, + lineHeights: { + baseRelaxed: "1.75", + smallRelaxed: "1.7142857142857142", + smallerRelaxed: "1.6666666666666667", + base: "1.5", + smallTextBase: "1.71428571", + smallTextCompressed: "1.14285714", + smallerText: "1.33333333", + heading1: "1.25", + heading2: "1.33", + heading3: "1.33", + heading4: "1.33", + title: "1.25", + sectionTitle: "1.33", + subsectionTitle: "1.33", + }, + space: { + none: "0px", + half: "4px", + x0: "0px", + x0_25: "2px", + x0_5: "4px", + x0_75: "6px", + x1: "8px", + x1_25: "10px", + x1_5: "12px", + x1_75: "14px", + x2: "16px", + x2_5: "20px", + x3: "24px", + x4: "32px", + x5: "40px", + x6: "48px", + x7: "56px", + x8: "64px", + }, + sizes: { + none: "0px", + half: "4px", + x0: "0px", + x0_25: "2px", + x0_5: "4px", + x0_75: "6px", + x1: "8px", + x1_25: "10px", + x1_5: "12px", + x1_75: "14px", + x2: "16px", + x2_5: "20px", + x3: "24px", + x4: "32px", + x5: "40px", + x6: "48px", + x7: "56px", + x8: "64px", + }, + radii: { + small: "2px", + medium: "4px", + large: "8px", + circle: "50%", + rounded: "9999px", + }, + borders: [], }, - "tablet": { - "colors": { - "black": "#011e38", - "blackBlue": "#122b47", - "darkBlue": "#00438f", - "blue": "#216beb", - "lightBlue": "#e1ebfa", - "darkGrey": "#434d59", - "midGrey": "#6c7784", - "grey": "#c0c8d1", - "lightGrey": "#e4e7eb", - "whiteGrey": "#f0f2f5", - "white": "#ffffff", - "yellow": "#ffbb00", - "lightYellow": "#fcf5e3", - "green": "#008059", - "lightGreen": "#e9f7f2", - "red": "#cc1439", - "lightRed": "#fae6ea", - "categorical1": "#19c4e6", - "categorical2": "#8033cc", - "categorical3": "#e372d0", - "categorical4": "#55ddb0", - "categorical5": "#ee5513", - "categorical6": "#d3d322" - }, - "fontWeights": { - "light": 300, - "normal": 400, - "medium": 500, - "bold": 600 - }, - "fonts": { - "base": "'IBM Plex Sans', sans-serif", - "mono": "'IBM Plex Mono', monospace", - "sc": "'Noto Sans SC', sans-serif" - }, - "shadows": { - "small": "0px 1px 2px 0px rgba(1, 30, 56, 0.25)", - "medium": "0px 3px 8px 0px rgba(1, 30, 56, 0.18)", - "large": "0px 6px 12px 2px rgba(1, 30, 56, 0.15)", - "focus": "0px 0px 5px 0px rgba(33, 107, 235, .9)", - "error": "0px 0px 5px 0px rgba(204, 20, 57, .9)" - }, - "breakpoints": { - "extraSmall": "0px", - "small": "768px", - "medium": "1024px", - "large": "1360px", - "extraLarge": "1920px" - }, - "zIndices": { - "content": 100, - "tabsScollIndicator": 200, - "tabsBar": 210, - "overlay": 1000, - "aboveOverlay": 1010, - "tableHeader": 10, - "modalHeaderAndFooter": 2, - "openControl": 1000, - "navBar": 900, - "sidebar": 800 - }, - "fontSizes": { - "smaller": "16.799999999999997px", - "small": "21px", - "medium": "25.2px", - "large": "29.4px", - "larger": "33.599999999999994px", - "largest": "42px", - "heading1": "29.4px", - "heading2": "25.2px", - "heading3": "21px", - "heading4": "16.799999999999997px" - }, - "lineHeights": { - "base": "1.333333333333333", - "baseRelaxed": "1.5555555555555554", - "smallTextBase": "1.3333333333333333", - "smallTextCompressed": "1.3333333333333333", - "smallRelaxed": "1.5999999999999996", - "smallerText": "1.3333333333333335", - "smallerRelaxed": "1.666666666666667", - "heading1": "1.3333333333333333", - "heading2": "1.333333333333333", - "heading3": "1.3333333333333333", - "heading4": "1.3333333333333335", - "title": "1.3333333333333333", - "sectionTitle": "1.333333333333333", - "subsectionTitle": "1.3333333333333333" - }, - "space": { - "none": "0px", - "x0": "0px", - "x0_25": "2.8px", - "half": "5.6px", - "x0_5": "5.6px", - "x0_75": "8.399999999999999px", - "x1": "11.2px", - "x1_25": "14px", - "x1_5": "16.799999999999997px", - "x1_75": "19.599999999999998px", - "x2": "22.4px", - "x2_5": "28px", - "x3": "33.599999999999994px", - "x4": "44.8px", - "x5": "56px", - "x6": "67.19999999999999px", - "x7": "78.39999999999999px", - "x8": "89.6px" - }, - "sizes": { - "none": "0px", - "x0": "0px", - "x0_25": "2.8px", - "half": "5.6px", - "x0_5": "5.6px", - "x0_75": "8.399999999999999px", - "x1": "11.2px", - "x1_25": "14px", - "x1_5": "16.799999999999997px", - "x1_75": "19.599999999999998px", - "x2": "22.4px", - "x2_5": "28px", - "x3": "33.599999999999994px", - "x4": "44.8px", - "x5": "56px", - "x6": "67.19999999999999px", - "x7": "78.39999999999999px", - "x8": "89.6px" - }, - "radii": { - "small": "2.8px", - "medium": "5.6px", - "large": "11.2px", - "circle": "50%", - "rounded": "99999px" - }, - "borders": [] + tablet: { + colors: { + black: "#011e38", + blackBlue: "#122b47", + darkBlue: "#00438f", + blue: "#216beb", + lightBlue: "#e1ebfa", + darkGrey: "#434d59", + midGrey: "#6c7784", + grey: "#c0c8d1", + lightGrey: "#e4e7eb", + whiteGrey: "#f0f2f5", + white: "#ffffff", + yellow: "#ffbb00", + lightYellow: "#fcf5e3", + green: "#008059", + lightGreen: "#e9f7f2", + red: "#cc1439", + lightRed: "#fae6ea", + categorical1: "#19c4e6", + categorical2: "#8033cc", + categorical3: "#e372d0", + categorical4: "#55ddb0", + categorical5: "#ee5513", + categorical6: "#d3d322", + }, + fontWeights: { + light: 300, + normal: 400, + medium: 500, + bold: 600, + }, + fonts: { + base: "'IBM Plex Sans', sans-serif", + mono: "'IBM Plex Mono', monospace", + sc: "'Noto Sans SC', sans-serif", + }, + shadows: { + small: "0px 1px 2px 0px rgba(1, 30, 56, 0.25)", + medium: "0px 3px 8px 0px rgba(1, 30, 56, 0.18)", + large: "0px 6px 12px 2px rgba(1, 30, 56, 0.15)", + focus: "0px 0px 5px 0px rgba(33, 107, 235, .9)", + error: "0px 0px 5px 0px rgba(204, 20, 57, .9)", + }, + breakpoints: { + extraSmall: "0px", + small: "768px", + medium: "1024px", + large: "1360px", + extraLarge: "1920px", + }, + zIndices: { + content: 100, + tabsScollIndicator: 200, + tabsBar: 210, + overlay: 1000, + aboveOverlay: 1010, + tableHeader: 10, + modalHeaderAndFooter: 2, + openControl: 1000, + navBar: 900, + sidebar: 800, + }, + fontSizes: { + smaller: "16.799999999999997px", + small: "21px", + medium: "25.2px", + large: "29.4px", + larger: "33.599999999999994px", + largest: "42px", + heading1: "29.4px", + heading2: "25.2px", + heading3: "21px", + heading4: "16.799999999999997px", + }, + lineHeights: { + base: "1.333333333333333", + baseRelaxed: "1.5555555555555554", + smallTextBase: "1.3333333333333333", + smallTextCompressed: "1.3333333333333333", + smallRelaxed: "1.5999999999999996", + smallerText: "1.3333333333333335", + smallerRelaxed: "1.666666666666667", + heading1: "1.3333333333333333", + heading2: "1.333333333333333", + heading3: "1.3333333333333333", + heading4: "1.3333333333333335", + title: "1.3333333333333333", + sectionTitle: "1.333333333333333", + subsectionTitle: "1.3333333333333333", + }, + space: { + none: "0px", + x0: "0px", + x0_25: "2.8px", + half: "5.6px", + x0_5: "5.6px", + x0_75: "8.399999999999999px", + x1: "11.2px", + x1_25: "14px", + x1_5: "16.799999999999997px", + x1_75: "19.599999999999998px", + x2: "22.4px", + x2_5: "28px", + x3: "33.599999999999994px", + x4: "44.8px", + x5: "56px", + x6: "67.19999999999999px", + x7: "78.39999999999999px", + x8: "89.6px", + }, + sizes: { + none: "0px", + x0: "0px", + x0_25: "2.8px", + half: "5.6px", + x0_5: "5.6px", + x0_75: "8.399999999999999px", + x1: "11.2px", + x1_25: "14px", + x1_5: "16.799999999999997px", + x1_75: "19.599999999999998px", + x2: "22.4px", + x2_5: "28px", + x3: "33.599999999999994px", + x4: "44.8px", + x5: "56px", + x6: "67.19999999999999px", + x7: "78.39999999999999px", + x8: "89.6px", + }, + radii: { + small: "2.8px", + medium: "5.6px", + large: "11.2px", + circle: "50%", + rounded: "99999px", + }, + borders: [], + }, + phone: { + colors: { + black: "#011e38", + blackBlue: "#122b47", + darkBlue: "#00438f", + blue: "#216beb", + lightBlue: "#e1ebfa", + darkGrey: "#434d59", + midGrey: "#6c7784", + grey: "#c0c8d1", + lightGrey: "#e4e7eb", + whiteGrey: "#f0f2f5", + white: "#ffffff", + yellow: "#ffbb00", + lightYellow: "#fcf5e3", + green: "#008059", + lightGreen: "#e9f7f2", + red: "#cc1439", + lightRed: "#fae6ea", + categorical1: "#19c4e6", + categorical2: "#8033cc", + categorical3: "#e372d0", + categorical4: "#55ddb0", + categorical5: "#ee5513", + categorical6: "#d3d322", + }, + fontWeights: { + light: 300, + normal: 400, + medium: 500, + bold: 600, + }, + fonts: { + base: "'IBM Plex Sans', sans-serif", + mono: "'IBM Plex Mono', monospace", + sc: "'Noto Sans SC', sans-serif", + }, + shadows: { + small: "0px 1px 2px 0px rgba(1, 30, 56, 0.25)", + medium: "0px 3px 8px 0px rgba(1, 30, 56, 0.18)", + large: "0px 6px 12px 2px rgba(1, 30, 56, 0.15)", + focus: "0px 0px 5px 0px rgba(33, 107, 235, .9)", + error: "0px 0px 5px 0px rgba(204, 20, 57, .9)", + }, + breakpoints: { + extraSmall: "0px", + small: "768px", + medium: "1024px", + large: "1360px", + extraLarge: "1920px", + }, + zIndices: { + content: 100, + tabsScollIndicator: 200, + tabsBar: 210, + overlay: 1000, + aboveOverlay: 1010, + tableHeader: 10, + modalHeaderAndFooter: 2, + openControl: 1000, + navBar: 900, + sidebar: 800, + }, + fontSizes: { + smaller: "10.8px", + small: "13.5px", + medium: "16.2px", + large: "18.900000000000002px", + larger: "21.6px", + largest: "27px", + heading1: "18.900000000000002px", + heading2: "16.2px", + heading3: "13.5px", + heading4: "10.8px", + }, + lineHeights: { + base: "1.3333333333333335", + baseRelaxed: "1.5555555555555556", + smallTextBase: "1.3333333333333333", + smallTextCompressed: "1.3333333333333333", + smallRelaxed: "1.6", + smallerText: "1.3333333333333333", + smallerRelaxed: "1.6666666666666665", + heading1: "1.333333333333333", + heading2: "1.3333333333333335", + heading3: "1.3333333333333333", + heading4: "1.3333333333333333", + title: "1.333333333333333", + sectionTitle: "1.3333333333333335", + subsectionTitle: "1.3333333333333333", + }, + space: { + none: "0px", + x0: "0px", + x0_25: "1.8px", + half: "3.6px", + x0_5: "3.6px", + x0_75: "5.4px", + x1: "7.2px", + x1_25: "9px", + x1_5: "10.8px", + x1_75: "12.6px", + x2: "14.4px", + x2_5: "18px", + x3: "21.6px", + x4: "28.8px", + x5: "36px", + x6: "43.2px", + x7: "50.4px", + x8: "57.6px", + }, + sizes: { + none: "0px", + x0: "0px", + x0_25: "1.8px", + half: "3.6px", + x0_5: "3.6px", + x0_75: "5.4px", + x1: "7.2px", + x1_25: "9px", + x1_5: "10.8px", + x1_75: "12.6px", + x2: "14.4px", + x2_5: "18px", + x3: "21.6px", + x4: "28.8px", + x5: "36px", + x6: "43.2px", + x7: "50.4px", + x8: "57.6px", + }, + radii: { + small: "1.8px", + medium: "3.6px", + large: "7.2px", + circle: "50%", + rounded: "99999px", + }, + borders: [], }, - "phone": { - "colors": { - "black": "#011e38", - "blackBlue": "#122b47", - "darkBlue": "#00438f", - "blue": "#216beb", - "lightBlue": "#e1ebfa", - "darkGrey": "#434d59", - "midGrey": "#6c7784", - "grey": "#c0c8d1", - "lightGrey": "#e4e7eb", - "whiteGrey": "#f0f2f5", - "white": "#ffffff", - "yellow": "#ffbb00", - "lightYellow": "#fcf5e3", - "green": "#008059", - "lightGreen": "#e9f7f2", - "red": "#cc1439", - "lightRed": "#fae6ea", - "categorical1": "#19c4e6", - "categorical2": "#8033cc", - "categorical3": "#e372d0", - "categorical4": "#55ddb0", - "categorical5": "#ee5513", - "categorical6": "#d3d322" - }, - "fontWeights": { - "light": 300, - "normal": 400, - "medium": 500, - "bold": 600 - }, - "fonts": { - "base": "'IBM Plex Sans', sans-serif", - "mono": "'IBM Plex Mono', monospace", - "sc": "'Noto Sans SC', sans-serif" - }, - "shadows": { - "small": "0px 1px 2px 0px rgba(1, 30, 56, 0.25)", - "medium": "0px 3px 8px 0px rgba(1, 30, 56, 0.18)", - "large": "0px 6px 12px 2px rgba(1, 30, 56, 0.15)", - "focus": "0px 0px 5px 0px rgba(33, 107, 235, .9)", - "error": "0px 0px 5px 0px rgba(204, 20, 57, .9)" - }, - "breakpoints": { - "extraSmall": "0px", - "small": "768px", - "medium": "1024px", - "large": "1360px", - "extraLarge": "1920px" - }, - "zIndices": { - "content": 100, - "tabsScollIndicator": 200, - "tabsBar": 210, - "overlay": 1000, - "aboveOverlay": 1010, - "tableHeader": 10, - "modalHeaderAndFooter": 2, - "openControl": 1000, - "navBar": 900, - "sidebar": 800 - }, - "fontSizes": { - "smaller": "10.8px", - "small": "13.5px", - "medium": "16.2px", - "large": "18.900000000000002px", - "larger": "21.6px", - "largest": "27px", - "heading1": "18.900000000000002px", - "heading2": "16.2px", - "heading3": "13.5px", - "heading4": "10.8px" - }, - "lineHeights": { - "base": "1.3333333333333335", - "baseRelaxed": "1.5555555555555556", - "smallTextBase": "1.3333333333333333", - "smallTextCompressed": "1.3333333333333333", - "smallRelaxed": "1.6", - "smallerText": "1.3333333333333333", - "smallerRelaxed": "1.6666666666666665", - "heading1": "1.333333333333333", - "heading2": "1.3333333333333335", - "heading3": "1.3333333333333333", - "heading4": "1.3333333333333333", - "title": "1.333333333333333", - "sectionTitle": "1.3333333333333335", - "subsectionTitle": "1.3333333333333333" - }, - "space": { - "none": "0px", - "x0": "0px", - "x0_25": "1.8px", - "half": "3.6px", - "x0_5": "3.6px", - "x0_75": "5.4px", - "x1": "7.2px", - "x1_25": "9px", - "x1_5": "10.8px", - "x1_75": "12.6px", - "x2": "14.4px", - "x2_5": "18px", - "x3": "21.6px", - "x4": "28.8px", - "x5": "36px", - "x6": "43.2px", - "x7": "50.4px", - "x8": "57.6px" - }, - "sizes": { - "none": "0px", - "x0": "0px", - "x0_25": "1.8px", - "half": "3.6px", - "x0_5": "3.6px", - "x0_75": "5.4px", - "x1": "7.2px", - "x1_25": "9px", - "x1_5": "10.8px", - "x1_75": "12.6px", - "x2": "14.4px", - "x2_5": "18px", - "x3": "21.6px", - "x4": "28.8px", - "x5": "36px", - "x6": "43.2px", - "x7": "50.4px", - "x8": "57.6px" - }, - "radii": { - "small": "1.8px", - "medium": "3.6px", - "large": "7.2px", - "circle": "50%", - "rounded": "99999px" - }, - "borders": [] - } }; export const { desktop, tablet, phone } = themes;