Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Update Stepper inner text components and colors #776

Merged
merged 3 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions packages/yoga/src/Stepper/Stepper.theme.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Stepper = ({ colors, spacing, fontSizes, fontWeights, radii }) => ({
const Stepper = ({ colors, spacing, radii }) => ({
padding: {
left: spacing.xxlarge,
right: spacing.xxlarge,
Expand All @@ -7,26 +7,22 @@ const Stepper = ({ colors, spacing, fontSizes, fontWeights, radii }) => ({
backgroundColor: {
active: colors.primary,
inactive: colors.elements.backgroundAndDisabled,
secondary: colors.medium,
secondary: colors.secondary,
},
},
dot: {
radius: radii.circle,
backgroundColor: {
active: colors.primary,
inactive: colors.elements.backgroundAndDisabled,
secondary: colors.medium,
secondary: colors.secondary,
},
},
label: {
font: {
weight: fontWeights.bold,
size: fontSizes.xsmall,
},
color: {
active: colors.primary,
inactive: colors.elements.selectionAndIcons,
secondary: colors.medium,
secondary: colors.secondary,
},
},
});
Expand Down
5 changes: 2 additions & 3 deletions packages/yoga/src/Stepper/native/Dots.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { arrayOf, bool, number, string } from 'prop-types';
import React from 'react';
import { arrayOf, bool, number, string } from 'prop-types';
import styled, { css } from 'styled-components';

import Text from '../../Text';
Expand Down Expand Up @@ -39,7 +39,7 @@ const Dot = styled.View(
},
);

const Label = styled(Text.Bold)(
const Label = styled(Text.Overline)(
({
active,
secondary,
Expand All @@ -58,7 +58,6 @@ const Label = styled(Text.Bold)(
color: ${active
? stepper.label.color[state]
: stepper.label.color.inactive};
font-size: ${stepper.label.font.size}px;
text-align: center;
`;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ exports[`<Stepper /> Snapshots should match snapshot with first step active 1`]
"color": "#D8385E",
"fontFamily": "Rubik",
"fontSize": 12,
"fontWeight": "700",
"fontWeight": "500",
"lineHeight": 16,
"marginLeft": -40,
"marginTop": 10,
"textAlign": "center",
Expand Down Expand Up @@ -149,7 +150,8 @@ exports[`<Stepper /> Snapshots should match snapshot with first step active 1`]
"color": "#9898A6",
"fontFamily": "Rubik",
"fontSize": 12,
"fontWeight": "700",
"fontWeight": "500",
"lineHeight": 16,
"marginLeft": -40,
"marginTop": 10,
"textAlign": "center",
Expand Down Expand Up @@ -194,7 +196,8 @@ exports[`<Stepper /> Snapshots should match snapshot with first step active 1`]
"color": "#9898A6",
"fontFamily": "Rubik",
"fontSize": 12,
"fontWeight": "700",
"fontWeight": "500",
"lineHeight": 16,
"marginLeft": -40,
"marginTop": 10,
"textAlign": "center",
Expand Down Expand Up @@ -275,7 +278,7 @@ exports[`<Stepper /> Snapshots should match snapshot with first step active and
style={
[
{
"backgroundColor": "#9898A6",
"backgroundColor": "#231B22",
"height": 4,
"position": "absolute",
"top": 0,
Expand Down Expand Up @@ -311,7 +314,7 @@ exports[`<Stepper /> Snapshots should match snapshot with first step active and
style={
[
{
"backgroundColor": "#9898A6",
"backgroundColor": "#231B22",
"borderRadius": 9999,
"height": 15,
"marginTop": -6,
Expand All @@ -326,10 +329,11 @@ exports[`<Stepper /> Snapshots should match snapshot with first step active and
style={
[
{
"color": "#9898A6",
"color": "#231B22",
"fontFamily": "Rubik",
"fontSize": 12,
"fontWeight": "700",
"fontWeight": "500",
"lineHeight": 16,
"marginLeft": -40,
"marginTop": 10,
"textAlign": "center",
Expand Down Expand Up @@ -374,7 +378,8 @@ exports[`<Stepper /> Snapshots should match snapshot with first step active and
"color": "#9898A6",
"fontFamily": "Rubik",
"fontSize": 12,
"fontWeight": "700",
"fontWeight": "500",
"lineHeight": 16,
"marginLeft": -40,
"marginTop": 10,
"textAlign": "center",
Expand Down Expand Up @@ -419,7 +424,8 @@ exports[`<Stepper /> Snapshots should match snapshot with first step active and
"color": "#9898A6",
"fontFamily": "Rubik",
"fontSize": 12,
"fontWeight": "700",
"fontWeight": "500",
"lineHeight": 16,
"marginLeft": -40,
"marginTop": 10,
"textAlign": "center",
Expand Down Expand Up @@ -554,7 +560,8 @@ exports[`<Stepper /> Snapshots should match snapshot with second step active 1`]
"color": "#D8385E",
"fontFamily": "Rubik",
"fontSize": 12,
"fontWeight": "700",
"fontWeight": "500",
"lineHeight": 16,
"marginLeft": -40,
"marginTop": 10,
"textAlign": "center",
Expand Down Expand Up @@ -599,7 +606,8 @@ exports[`<Stepper /> Snapshots should match snapshot with second step active 1`]
"color": "#D8385E",
"fontFamily": "Rubik",
"fontSize": 12,
"fontWeight": "700",
"fontWeight": "500",
"lineHeight": 16,
"marginLeft": -40,
"marginTop": 10,
"textAlign": "center",
Expand Down Expand Up @@ -644,7 +652,8 @@ exports[`<Stepper /> Snapshots should match snapshot with second step active 1`]
"color": "#9898A6",
"fontFamily": "Rubik",
"fontSize": 12,
"fontWeight": "700",
"fontWeight": "500",
"lineHeight": 16,
"marginLeft": -40,
"marginTop": 10,
"textAlign": "center",
Expand Down
20 changes: 5 additions & 15 deletions packages/yoga/src/Stepper/web/Dots.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { number, arrayOf, string, bool } from 'prop-types';
import { arrayOf, bool, number, string } from 'prop-types';
import styled, { css } from 'styled-components';

import activeDot from '../activeDot';
import Text from '../../Text';
import activeDot from '../activeDot';

const Dot = styled.div`
${({
Expand All @@ -20,20 +20,10 @@ const Dot = styled.div`
`}
`;

const Label = styled(Text.Bold)`
${({
theme: {
yoga: {
components: { stepper },
},
},
}) => css`
width: 95px;
const Label = styled(Text.Overline)`
width: 95px;

font-size: ${stepper.label.font.size}px;

transform: translateX(-50%);
`}
transform: translateX(-50%);
`;

const DotWrapper = styled.div`
Expand Down
28 changes: 14 additions & 14 deletions packages/yoga/src/Stepper/web/__snapshots__/Stepper.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ exports[`<Stepper /> Snapshots should match snapshot with first step active 1`]
.c8 {
margin: 0;
padding: 0;
font-size: 16px;
font-size: 12px;
line-height: 16px;
color: #231B22;
font-family: Rubik;
font-weight: 700;
font-weight: 500;
width: 95px;
font-size: 12px;
-webkit-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
Expand Down Expand Up @@ -174,12 +174,12 @@ exports[`<Stepper /> Snapshots should match snapshot with first step active and
.c8 {
margin: 0;
padding: 0;
font-size: 16px;
font-size: 12px;
line-height: 16px;
color: #231B22;
font-family: Rubik;
font-weight: 700;
font-weight: 500;
width: 95px;
font-size: 12px;
-webkit-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
Expand Down Expand Up @@ -227,13 +227,13 @@ exports[`<Stepper /> Snapshots should match snapshot with first step active and
position: absolute;
left: 50%;
top: 10px;
color: #9898A6;
color: #231B22;
}

.c4 .c5 {
position: absolute;
top: -10px;
background-color: #9898A6;
background-color: #231B22;
}

.c3 {
Expand All @@ -258,7 +258,7 @@ exports[`<Stepper /> Snapshots should match snapshot with first step active and
content: '';
width: 0%;
height: 4px;
background-color: #9898A6;
background-color: #231B22;
}

.c10 {
Expand Down Expand Up @@ -351,12 +351,12 @@ exports[`<Stepper /> Snapshots should match snapshot with second step active 1`]
.c8 {
margin: 0;
padding: 0;
font-size: 16px;
font-size: 12px;
line-height: 16px;
color: #231B22;
font-family: Rubik;
font-weight: 700;
font-weight: 500;
width: 95px;
font-size: 12px;
-webkit-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
Expand Down Expand Up @@ -404,13 +404,13 @@ exports[`<Stepper /> Snapshots should match snapshot with second step active 1`]
position: absolute;
left: 50%;
top: 10px;
color: #9898A6;
color: #231B22;
}

.c11 .c5 {
position: absolute;
top: -10px;
background-color: #9898A6;
background-color: #231B22;
}

.c3 {
Expand Down
Loading