From 2326fa273be5c3d42d18b2943ec095723294092c Mon Sep 17 00:00:00 2001 From: rzpcibot <64553331+rzpcibot@users.noreply.github.com> Date: Thu, 16 Jan 2025 10:54:55 +0530 Subject: [PATCH] feat(tokens): add new tokens (#2467) * feat(tokens): add new tokens * chore: update snap * chore: update react native snaps * fix: build errors * chore: update react native snaps * chore: update snap web * Create thin-horses-attack.md --------- Co-authored-by: tewarig Co-authored-by: Saurabh Daware --- .changeset/thin-horses-attack.md | 5 ++ .../BaseButton.native.test.tsx.snap | 48 ++++++------- .../BaseButton.web.test.tsx.snap | 40 +++++------ .../__snapshots__/Button.native.test.tsx.snap | 36 +++++----- .../__snapshots__/Button.web.test.tsx.snap | 30 ++++---- .../ButtonGroup.web.test.tsx.snap | 32 ++++----- .../FileUpload.web.test.tsx.snap | 4 +- .../BaseLink.native.test.tsx.snap | 2 +- .../__snapshots__/BaseLink.web.test.tsx.snap | 2 +- .../__snapshots__/Link.native.test.tsx.snap | 2 +- .../__snapshots__/Link.web.test.tsx.snap | 2 +- .../__snapshots__/Switch.native.test.tsx.snap | 2 +- .../__snapshots__/Switch.web.test.tsx.snap | 2 +- .../__snapshots__/Code.native.test.tsx.snap | 2 +- .../__snapshots__/Code.web.test.tsx.snap | 2 +- packages/blade/src/tokens/global/colors.ts | 70 ++++++++++++++++++- .../createTheme.native.test.tsx.snap | 26 +++---- .../createTheme.web.test.tsx.snap | 26 +++---- packages/blade/src/tokens/theme/bladeTheme.ts | 24 +++---- .../blade/src/tokens/theme/createTheme.ts | 1 + 20 files changed, 217 insertions(+), 141 deletions(-) create mode 100644 .changeset/thin-horses-attack.md diff --git a/.changeset/thin-horses-attack.md b/.changeset/thin-horses-attack.md new file mode 100644 index 00000000000..4d4f06444c3 --- /dev/null +++ b/.changeset/thin-horses-attack.md @@ -0,0 +1,5 @@ +--- +"@razorpay/blade": patch +--- + +feat(tokens): change token values to match figma diff --git a/packages/blade/src/components/Button/BaseButton/__tests__/__snapshots__/BaseButton.native.test.tsx.snap b/packages/blade/src/components/Button/BaseButton/__tests__/__snapshots__/BaseButton.native.test.tsx.snap index 141647131d8..1145c89aa01 100644 --- a/packages/blade/src/components/Button/BaseButton/__tests__/__snapshots__/BaseButton.native.test.tsx.snap +++ b/packages/blade/src/components/Button/BaseButton/__tests__/__snapshots__/BaseButton.native.test.tsx.snap @@ -1480,13 +1480,13 @@ exports[` should render disabled button 1`] = ` buttonPaddingTop="0px" collapsable={false} data-blade-component="button" - defaultBackgroundColor="hsla(227, 100%, 59%, 0.09)" + defaultBackgroundColor="hsla(227, 100%, 59%, 0.18)" defaultBorderColor="hsla(227, 100%, 59%, 0.18)" - focusBackgroundColor="hsla(227, 100%, 59%, 0.09)" + focusBackgroundColor="hsla(227, 100%, 59%, 0.18)" focusBorderColor="hsla(227, 100%, 59%, 0.18)" focusRingColor="hsla(227, 100%, 59%, 0.18)" focusable={true} - hoverBackgroundColor="hsla(227, 100%, 59%, 0.09)" + hoverBackgroundColor="hsla(227, 100%, 59%, 0.18)" hoverBorderColor="hsla(227, 100%, 59%, 0.18)" isFullWidth={false} isLoading={false} @@ -1515,7 +1515,7 @@ exports[` should render disabled button 1`] = ` { "alignItems": "center", "alignSelf": "center", - "backgroundColor": "hsla(227, 100%, 59%, 0.09)", + "backgroundColor": "hsla(227, 100%, 59%, 0.18)", "borderColor": "hsla(227, 100%, 59%, 0.18)", "borderRadius": 4, "borderStyle": "solid", @@ -1536,7 +1536,7 @@ exports[` should render disabled button 1`] = ` "width": "auto", }, { - "backgroundColor": "hsla(227, 100%, 59%, 0.09)", + "backgroundColor": "hsla(227, 100%, 59%, 0.18)", "borderColor": "hsla(227, 100%, 59%, 0.18)", }, ] @@ -1590,7 +1590,7 @@ exports[` should render disabled button 1`] = ` style={ [ { - "color": "hsla(227, 100%, 59%, 0.18)", + "color": "hsla(227, 100%, 59%, 0.32)", "fontFamily": "Inter", "fontSize": 14, "fontStyle": "normal", @@ -3416,13 +3416,13 @@ exports[` should render disabled primary color primary button 1`] buttonPaddingTop="0px" collapsable={false} data-blade-component="button" - defaultBackgroundColor="hsla(227, 100%, 59%, 0.09)" + defaultBackgroundColor="hsla(227, 100%, 59%, 0.18)" defaultBorderColor="hsla(227, 100%, 59%, 0.18)" - focusBackgroundColor="hsla(227, 100%, 59%, 0.09)" + focusBackgroundColor="hsla(227, 100%, 59%, 0.18)" focusBorderColor="hsla(227, 100%, 59%, 0.18)" focusRingColor="hsla(227, 100%, 59%, 0.18)" focusable={true} - hoverBackgroundColor="hsla(227, 100%, 59%, 0.09)" + hoverBackgroundColor="hsla(227, 100%, 59%, 0.18)" hoverBorderColor="hsla(227, 100%, 59%, 0.18)" isFullWidth={false} isLoading={false} @@ -3451,7 +3451,7 @@ exports[` should render disabled primary color primary button 1`] { "alignItems": "center", "alignSelf": "center", - "backgroundColor": "hsla(227, 100%, 59%, 0.09)", + "backgroundColor": "hsla(227, 100%, 59%, 0.18)", "borderColor": "hsla(227, 100%, 59%, 0.18)", "borderRadius": 4, "borderStyle": "solid", @@ -3472,7 +3472,7 @@ exports[` should render disabled primary color primary button 1`] "width": "auto", }, { - "backgroundColor": "hsla(227, 100%, 59%, 0.09)", + "backgroundColor": "hsla(227, 100%, 59%, 0.18)", "borderColor": "hsla(227, 100%, 59%, 0.18)", }, ] @@ -3526,7 +3526,7 @@ exports[` should render disabled primary color primary button 1`] style={ [ { - "color": "hsla(227, 100%, 59%, 0.18)", + "color": "hsla(227, 100%, 59%, 0.32)", "fontFamily": "Inter", "fontSize": 14, "fontStyle": "normal", @@ -3702,7 +3702,7 @@ exports[` should render disabled primary color secondary button 1` style={ [ { - "color": "hsla(227, 100%, 59%, 0.18)", + "color": "hsla(227, 100%, 59%, 0.32)", "fontFamily": "Inter", "fontSize": 14, "fontStyle": "normal", @@ -3768,13 +3768,13 @@ exports[` should render disabled primary color tertiary button 1`] buttonPaddingTop="0px" collapsable={false} data-blade-component="button" - defaultBackgroundColor="hsla(211, 20%, 52%, 0.09)" + defaultBackgroundColor="hsla(211, 20%, 52%, 0.18)" defaultBorderColor="hsla(214, 40%, 92%, 1)" - focusBackgroundColor="hsla(211, 20%, 52%, 0.09)" + focusBackgroundColor="hsla(211, 20%, 52%, 0.18)" focusBorderColor="hsla(214, 40%, 92%, 1)" focusRingColor="hsla(227, 100%, 59%, 0.18)" focusable={true} - hoverBackgroundColor="hsla(211, 20%, 52%, 0.09)" + hoverBackgroundColor="hsla(211, 20%, 52%, 0.18)" hoverBorderColor="hsla(214, 40%, 92%, 1)" isFullWidth={false} isLoading={false} @@ -3803,7 +3803,7 @@ exports[` should render disabled primary color tertiary button 1`] { "alignItems": "center", "alignSelf": "center", - "backgroundColor": "hsla(211, 20%, 52%, 0.09)", + "backgroundColor": "hsla(211, 20%, 52%, 0.18)", "borderColor": "hsla(214, 40%, 92%, 1)", "borderRadius": 4, "borderStyle": "solid", @@ -3824,7 +3824,7 @@ exports[` should render disabled primary color tertiary button 1`] "width": "auto", }, { - "backgroundColor": "hsla(211, 20%, 52%, 0.09)", + "backgroundColor": "hsla(211, 20%, 52%, 0.18)", }, ] } @@ -4998,13 +4998,13 @@ exports[` should render loading button 1`] = ` buttonPaddingTop="0px" collapsable={false} data-blade-component="button" - defaultBackgroundColor="hsla(227, 100%, 59%, 0.09)" + defaultBackgroundColor="hsla(227, 100%, 59%, 0.18)" defaultBorderColor="hsla(227, 100%, 59%, 0.18)" - focusBackgroundColor="hsla(227, 100%, 59%, 0.09)" + focusBackgroundColor="hsla(227, 100%, 59%, 0.18)" focusBorderColor="hsla(227, 100%, 59%, 0.18)" focusRingColor="hsla(227, 100%, 59%, 0.18)" focusable={true} - hoverBackgroundColor="hsla(227, 100%, 59%, 0.09)" + hoverBackgroundColor="hsla(227, 100%, 59%, 0.18)" hoverBorderColor="hsla(227, 100%, 59%, 0.18)" isFullWidth={false} isLoading={true} @@ -5033,7 +5033,7 @@ exports[` should render loading button 1`] = ` { "alignItems": "center", "alignSelf": "center", - "backgroundColor": "hsla(227, 100%, 59%, 0.09)", + "backgroundColor": "hsla(227, 100%, 59%, 0.18)", "borderColor": "hsla(227, 100%, 59%, 0.18)", "borderRadius": 4, "borderStyle": "solid", @@ -5054,7 +5054,7 @@ exports[` should render loading button 1`] = ` "width": "auto", }, { - "backgroundColor": "hsla(227, 100%, 59%, 0.09)", + "backgroundColor": "hsla(227, 100%, 59%, 0.18)", "borderColor": "hsla(227, 100%, 59%, 0.18)", }, ] @@ -5275,7 +5275,7 @@ exports[` should render loading button 1`] = ` style={ [ { - "color": "hsla(227, 100%, 59%, 0.18)", + "color": "hsla(227, 100%, 59%, 0.32)", "fontFamily": "Inter", "fontSize": 14, "fontStyle": "normal", diff --git a/packages/blade/src/components/Button/BaseButton/__tests__/__snapshots__/BaseButton.web.test.tsx.snap b/packages/blade/src/components/Button/BaseButton/__tests__/__snapshots__/BaseButton.web.test.tsx.snap index 10d7352daea..4445e93ec95 100644 --- a/packages/blade/src/components/Button/BaseButton/__tests__/__snapshots__/BaseButton.web.test.tsx.snap +++ b/packages/blade/src/components/Button/BaseButton/__tests__/__snapshots__/BaseButton.web.test.tsx.snap @@ -68,7 +68,7 @@ exports[` should announce button loading accessibilityLabel 1`] = min-height: 36px; width: auto; cursor: not-allowed; - background-color: hsla(227,100%,59%,0.09); + background-color: hsla(227,100%,59%,0.18); border-color: hsla(227,100%,59%,0.18); border-width: 0px; border-radius: 4px; @@ -102,17 +102,17 @@ exports[` should announce button loading accessibilityLabel 1`] = } .c5.c5.c5.c5.c5:hover { - background-color: hsla(227,100%,59%,0.09); + background-color: hsla(227,100%,59%,0.18); border-color: hsla(227,100%,59%,0.18); } .c5.c5.c5.c5.c5:active { - background-color: hsla(227,100%,59%,0.09); + background-color: hsla(227,100%,59%,0.18); border-color: hsla(227,100%,59%,0.18); } .c5.c5.c5.c5.c5:focus-visible { - background-color: hsla(227,100%,59%,0.09); + background-color: hsla(227,100%,59%,0.18); border-color: hsla(227,100%,59%,0.18); outline: 1px solid hsla(227,100%,59%,0.09); box-shadow: 0px 0px 0px 4px hsla(227,100%,59%,0.18); @@ -213,7 +213,7 @@ exports[` should announce button loading accessibilityLabel 1`] = } .c10.c10.c10.c10.c10 { - color: hsla(227,100%,59%,0.18); + color: hsla(227,100%,59%,0.32); font-family: "Inter","Inter Fallback Arial",Arial; font-size: 0.875rem; font-weight: 500; @@ -1393,7 +1393,7 @@ exports[` should render disabled button 1`] = ` min-height: 36px; width: auto; cursor: not-allowed; - background-color: hsla(227,100%,59%,0.09); + background-color: hsla(227,100%,59%,0.18); border-color: hsla(227,100%,59%,0.18); border-width: 0px; border-radius: 4px; @@ -1427,17 +1427,17 @@ exports[` should render disabled button 1`] = ` } .c0.c0.c0.c0.c0:hover { - background-color: hsla(227,100%,59%,0.09); + background-color: hsla(227,100%,59%,0.18); border-color: hsla(227,100%,59%,0.18); } .c0.c0.c0.c0.c0:active { - background-color: hsla(227,100%,59%,0.09); + background-color: hsla(227,100%,59%,0.18); border-color: hsla(227,100%,59%,0.18); } .c0.c0.c0.c0.c0:focus-visible { - background-color: hsla(227,100%,59%,0.09); + background-color: hsla(227,100%,59%,0.18); border-color: hsla(227,100%,59%,0.18); outline: 1px solid hsla(227,100%,59%,0.09); box-shadow: 0px 0px 0px 4px hsla(227,100%,59%,0.18); @@ -1485,7 +1485,7 @@ exports[` should render disabled button 1`] = ` } .c4.c4.c4.c4.c4 { - color: hsla(227,100%,59%,0.18); + color: hsla(227,100%,59%,0.32); font-family: "Inter","Inter Fallback Arial",Arial; font-size: 0.875rem; font-weight: 500; @@ -2999,7 +2999,7 @@ exports[` should render disabled primary color primary button 1`] min-height: 36px; width: auto; cursor: not-allowed; - background-color: hsla(227,100%,59%,0.09); + background-color: hsla(227,100%,59%,0.18); border-color: hsla(227,100%,59%,0.18); border-width: 0px; border-radius: 4px; @@ -3033,17 +3033,17 @@ exports[` should render disabled primary color primary button 1`] } .c0.c0.c0.c0.c0:hover { - background-color: hsla(227,100%,59%,0.09); + background-color: hsla(227,100%,59%,0.18); border-color: hsla(227,100%,59%,0.18); } .c0.c0.c0.c0.c0:active { - background-color: hsla(227,100%,59%,0.09); + background-color: hsla(227,100%,59%,0.18); border-color: hsla(227,100%,59%,0.18); } .c0.c0.c0.c0.c0:focus-visible { - background-color: hsla(227,100%,59%,0.09); + background-color: hsla(227,100%,59%,0.18); border-color: hsla(227,100%,59%,0.18); outline: 1px solid hsla(227,100%,59%,0.09); box-shadow: 0px 0px 0px 4px hsla(227,100%,59%,0.18); @@ -3091,7 +3091,7 @@ exports[` should render disabled primary color primary button 1`] } .c4.c4.c4.c4.c4 { - color: hsla(227,100%,59%,0.18); + color: hsla(227,100%,59%,0.32); font-family: "Inter","Inter Fallback Arial",Arial; font-size: 0.875rem; font-weight: 500; @@ -3237,7 +3237,7 @@ exports[` should render disabled primary color secondary button 1` } .c4.c4.c4.c4.c4 { - color: hsla(227,100%,59%,0.18); + color: hsla(227,100%,59%,0.32); font-family: "Inter","Inter Fallback Arial",Arial; font-size: 0.875rem; font-weight: 500; @@ -3291,7 +3291,7 @@ exports[` should render disabled primary color tertiary button 1`] min-height: 36px; width: auto; cursor: not-allowed; - background-color: hsla(211,20%,52%,0.09); + background-color: hsla(211,20%,52%,0.18); border-color: hsla(214,40%,92%,1); border-width: 0px; border-radius: 4px; @@ -3325,15 +3325,15 @@ exports[` should render disabled primary color tertiary button 1`] } .c0.c0.c0.c0.c0:hover { - background-color: hsla(211,20%,52%,0.09); + background-color: hsla(211,20%,52%,0.18); } .c0.c0.c0.c0.c0:active { - background-color: hsla(211,20%,52%,0.09); + background-color: hsla(211,20%,52%,0.18); } .c0.c0.c0.c0.c0:focus-visible { - background-color: hsla(211,20%,52%,0.09); + background-color: hsla(211,20%,52%,0.18); outline: 1px solid hsla(227,100%,59%,0.09); box-shadow: 0px 0px 0px 4px hsla(227,100%,59%,0.18); } diff --git a/packages/blade/src/components/Button/Button/__tests__/__snapshots__/Button.native.test.tsx.snap b/packages/blade/src/components/Button/Button/__tests__/__snapshots__/Button.native.test.tsx.snap index 5baac5b6bc6..7c374772eb9 100644 --- a/packages/blade/src/components/Button/Button/__tests__/__snapshots__/Button.native.test.tsx.snap +++ b/packages/blade/src/components/Button/Button/__tests__/__snapshots__/Button.native.test.tsx.snap @@ -950,13 +950,13 @@ exports[`