ISSUE-068 - Now Styled-Components can self-label.
Updated babel-plugin-styled-components to a new version that works. Added extra option to macros settings to not bother showing the file names.
This commit is contained in:
1 parent
9ccaa5b3d6
commit
3b165c42e9
38 files changed
+66
-133
No files matched your search
@@ -1,8 +1,7 @@
|
||||
import styled from "styled-components";
|
||||
import styled from "styled-components/macro";
|
||||
|
||||
export const DoubleChyronContainer = styled.div`
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 1196px;
|
||||
`;
|
||||
DoubleChyronContainer.displayName = "DoubleChyronContainer";
|
||||
@@ -1,5 +1,5 @@
|
||||
import { animated } from "@react-spring/web";
|
||||
import styled, { css, keyframes } from "styled-components";
|
||||
import styled, { css, keyframes } from "styled-components/macro";
|
||||
|
||||
import { Placement, Px, TransitionArgs } from "../../../../types/style";
|
||||
import { Milliseconds } from "../../../../types/util";
|
||||
@@ -21,7 +21,6 @@ export const AnimatedBaseContainer = animated(styled.div<AnimatedBaseContainerPr
|
||||
width: ${({ width }) => `${width}px`};
|
||||
height: ${({ height }) => `${height}px`};
|
||||
`);
|
||||
AnimatedBaseContainer.displayName = "AnimatedBaseContainer";
|
||||
|
||||
const BaseShape = styled.div`
|
||||
position: absolute;
|
||||
@@ -44,7 +43,6 @@ export const AnimatedBaseOutline = animated(styled(BaseShape)<AnimatedBaseOutlin
|
||||
|
||||
${({ transitionProps }) => commonTransition(transitionProps)}
|
||||
`);
|
||||
AnimatedBaseOutline.displayName = "AnimatedBaseOutline";
|
||||
|
||||
export const BaseBlack = styled(BaseShape)<TransitionProps>`
|
||||
opacity: ${({ open }) => open ? 1 : 0.1};
|
||||
@@ -54,7 +52,6 @@ export const BaseBlack = styled(BaseShape)<TransitionProps>`
|
||||
|
||||
${({ transitionProps }) => commonTransition(transitionProps)}
|
||||
`;
|
||||
BaseBlack.displayName = "BaseBlack";
|
||||
|
||||
type BaseBackgroundColorProps = {
|
||||
teamColor: string,
|
||||
@@ -67,7 +64,6 @@ export const BaseBackgroundColor = styled(BaseShape)<BaseBackgroundColorProps &
|
||||
|
||||
${({ transitionProps }) => commonTransition(transitionProps)}
|
||||
`;
|
||||
BaseBackgroundColor.displayName = "BaseBackgroundColor";
|
||||
|
||||
export const BaseLayout = styled(BaseShape)<TransitionProps>`
|
||||
position: absolute;
|
||||
@@ -85,7 +81,6 @@ export const BaseLayout = styled(BaseShape)<TransitionProps>`
|
||||
|
||||
${({ transitionProps }) => commonTransition(transitionProps)}
|
||||
`;
|
||||
BaseLayout.displayName = "BaseLayout";
|
||||
|
||||
type TeamColorBarProps = {
|
||||
color: string,
|
||||
@@ -105,7 +100,6 @@ export const TeamColorBar = styled.div<TeamColorBarProps & TransitionProps>`
|
||||
|
||||
${({ transitionProps }) => commonTransition(transitionProps)}
|
||||
`;
|
||||
TeamColorBar.displayName = "TeamColorBar";
|
||||
|
||||
export const TextContainer = styled.div`
|
||||
position: relative;
|
||||
@@ -114,20 +108,17 @@ export const TextContainer = styled.div`
|
||||
|
||||
height: 100%;
|
||||
`;
|
||||
TextContainer.displayName = "TextContainer";
|
||||
|
||||
export const NameContainer = styled.div`
|
||||
position: relative;
|
||||
top: 5px;
|
||||
`;
|
||||
NameContainer.displayName = "NameContainer";
|
||||
|
||||
export const FirstName = styled.span`
|
||||
font-family: ${p => p.theme.fonts.f1Regular};
|
||||
color: #fff;
|
||||
font-size: 25px;
|
||||
`;
|
||||
FirstName.displayName = "FirstName";
|
||||
|
||||
export const LastName = styled.span`
|
||||
font-family: ${p => p.theme.fonts.f1Bold};
|
||||
@@ -136,7 +127,6 @@ export const LastName = styled.span`
|
||||
font-size: 25px;
|
||||
margin-left: 5px;
|
||||
`;
|
||||
LastName.displayName = "LastName";
|
||||
|
||||
export const NumberContainer = styled.div`
|
||||
position: relative;
|
||||
@@ -145,7 +135,6 @@ export const NumberContainer = styled.div`
|
||||
bottom: 3px;
|
||||
left: 10px;
|
||||
`;
|
||||
NumberContainer.displayName = "NumberContainer";
|
||||
|
||||
const blinkingAnimation = keyframes`
|
||||
0% { opacity: 0.4 }
|
||||
@@ -169,7 +158,6 @@ export const TeamName = styled.div<TeamNameProps>`
|
||||
animation: ${blinkingAnimation} ${duration}ms step-end ${delay}ms;
|
||||
`}
|
||||
`;
|
||||
TeamName.displayName = "TeamName";
|
||||
|
||||
type FlagContainerProps = {
|
||||
height: Px,
|
||||
@@ -194,7 +182,6 @@ export const FlagContainer = styled.div<FlagContainerProps & TransitionProps>`
|
||||
|
||||
${({ transitionProps }) => commonTransition(transitionProps)}
|
||||
`;
|
||||
FlagContainer.displayName = "FlagContainer";
|
||||
|
||||
type DriverPortraitContainerProps = TransitionProps & {
|
||||
placement: Placement,
|
||||
@@ -207,4 +194,3 @@ export const DriverPortraitContainer = styled.div<DriverPortraitContainerProps>`
|
||||
opacity: ${({ open }) => open ? 1 : 0};
|
||||
${({ transitionProps }) => commonTransition(transitionProps)}
|
||||
`;
|
||||
DriverPortraitContainer.displayName = "DriverPortraitContainer";
|
||||
@@ -1,4 +1,4 @@
|
||||
import styled, { css } from "styled-components";
|
||||
import styled, { css } from "styled-components/macro";
|
||||
import { TeamFlagStyle } from "../../../../domain/data/teams";
|
||||
import { Px } from "../../../../types/style";
|
||||
|
||||
@@ -25,7 +25,6 @@ export const Container = styled.div<ContainerProps>`
|
||||
transparent 100%
|
||||
);
|
||||
`;
|
||||
Container.displayName = "Container";
|
||||
|
||||
type FlagContainerProps = {
|
||||
height: Px,
|
||||
@@ -68,7 +67,6 @@ export const FlagContainer = styled.div<FlagContainerProps>`
|
||||
);
|
||||
`}
|
||||
`;
|
||||
FlagContainer.displayName = "FlagContainer";
|
||||
|
||||
type FlagDivBaseProps = {
|
||||
src: string,
|
||||
@@ -92,7 +90,6 @@ export const CountryFlagDiv = styled(FlagDivBase)<CountryFlagDivProps>`
|
||||
? css`background-position: center;`
|
||||
: css`background-position-x: ${xOffset}px`}
|
||||
`;
|
||||
CountryFlagDiv.displayName = "CountryFlagDiv";
|
||||
|
||||
type TeamFlagDivProps = {
|
||||
style: TeamFlagStyle,
|
||||
@@ -156,7 +153,6 @@ export const Sheen = styled.div<SlashProps>`
|
||||
|
||||
border-left: 0.015em solid rgba(255, 255, 255, 0.1);
|
||||
`;
|
||||
Sheen.displayName = "Sheen";
|
||||
|
||||
export const Slant = styled.div<SlashProps>`
|
||||
position: absolute;
|
||||
@@ -166,7 +162,6 @@ export const Slant = styled.div<SlashProps>`
|
||||
background: #1a1a28;
|
||||
transform: skewX(-45deg) translateX(${({ x = 0 }) => `${x}px`});
|
||||
`;
|
||||
Slant.displayName = "Slant";
|
||||
|
||||
export const FlagEdge = styled.div<SlashProps>`
|
||||
position: absolute;
|
||||
@@ -184,4 +179,3 @@ export const FlagEdge = styled.div<SlashProps>`
|
||||
black 100%
|
||||
);
|
||||
`;
|
||||
FlagEdge.displayName = "FlagEdge";
|
||||
@@ -1,10 +1,9 @@
|
||||
import styled from "styled-components";
|
||||
import styled from "styled-components/macro";
|
||||
|
||||
export const NumberContainer = styled.div`
|
||||
position: relative;
|
||||
display: inline;
|
||||
`;
|
||||
NumberContainer.displayName = "NumberContainer";
|
||||
|
||||
type NumberProps = {
|
||||
fontFamily: string,
|
||||
@@ -24,7 +23,6 @@ export const StrokeNumber = styled.span<StrokeNumberProps>`
|
||||
-webkit-text-stroke-color: ${({ strokeColor }) => strokeColor};
|
||||
-webkit-text-stroke-width: ${({ strokeWidth }) => strokeWidth};
|
||||
`;
|
||||
StrokeNumber.displayName = "StrokeNumber";
|
||||
|
||||
type ShadowNumberProps = NumberProps & {
|
||||
shadowProperties: string,
|
||||
@@ -37,4 +35,3 @@ export const ShadowNumber = styled.span<ShadowNumberProps>`
|
||||
|
||||
text-shadow: ${({ shadowProperties }) => shadowProperties};
|
||||
`;
|
||||
ShadowNumber.displayName = "ShadowNumber";
|
||||
@@ -1,4 +1,4 @@
|
||||
import styled from "styled-components";
|
||||
import styled from "styled-components/macro";
|
||||
|
||||
import { Percent, Px } from "../../../../types/style";
|
||||
|
||||
@@ -26,4 +26,3 @@ export const PortraitDiv = styled.div<PortraitDivProps>`
|
||||
mask-repeat: no-repeat;
|
||||
mask-position: var(--position);
|
||||
`;
|
||||
PortraitDiv.displayName = "PortraitDiv";
|
||||
@@ -1,4 +1,4 @@
|
||||
import styled from "styled-components";
|
||||
import styled from "styled-components/macro";
|
||||
import { Px } from "../../../../types/style";
|
||||
|
||||
type PositionFlagBoxProps = {
|
||||
@@ -17,7 +17,6 @@ export const PositionFlagBox = styled.div<PositionFlagBoxProps>`
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
`;
|
||||
PositionFlagBox.displayName = "PositionFlagBox";
|
||||
|
||||
type PositionNumberProps = {
|
||||
size: Px,
|
||||
@@ -29,4 +28,3 @@ export const PositionNumber = styled.span<PositionNumberProps>`
|
||||
color: ${({ color }) => color};
|
||||
margin-top: 2px;
|
||||
`;
|
||||
PositionNumber.displayName = "PositionNumber";
|
||||
@@ -1,4 +1,4 @@
|
||||
import styled from "styled-components";
|
||||
import styled from "styled-components/macro";
|
||||
|
||||
type SpacerProps = {
|
||||
width?: string,
|
||||
@@ -8,4 +8,3 @@ export const Spacer = styled.div<SpacerProps>`
|
||||
width: ${({ width = "0" }) => width};
|
||||
height: ${({ height = "0" }) => height};
|
||||
`;
|
||||
Spacer.displayName = "Spacer";
|
||||
@@ -1,4 +1,4 @@
|
||||
import styled from "styled-components";
|
||||
import styled from "styled-components/macro";
|
||||
import { TeamGemStyle } from "../../../../domain/data/teams";
|
||||
import { Px } from "../../../../types/style";
|
||||
|
||||
@@ -20,7 +20,6 @@ export const GemContainer = styled.div<GemContainerProps>`
|
||||
mask-image: linear-gradient(to left, black 0%, black 80%, transparent 100%);
|
||||
clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%, 0 50%);
|
||||
`;
|
||||
GemContainer.displayName = "GemContainer";
|
||||
|
||||
type GemColorDivProps = {
|
||||
height: Px,
|
||||
@@ -57,4 +56,3 @@ export const GemLogoDiv = styled.div<GemLogoDivProps>`
|
||||
)};
|
||||
background-repeat: no-repeat;
|
||||
`;
|
||||
GemLogoDiv.displayName = "GemDiv";
|
||||
@@ -1,5 +1,5 @@
|
||||
import { animated } from "@react-spring/web";
|
||||
import styled, { css, keyframes } from "styled-components";
|
||||
import styled, { css, keyframes } from "styled-components/macro";
|
||||
|
||||
import { Degrees, Px } from "../../../../types/style";
|
||||
import { Milliseconds } from "../../../../types/util";
|
||||
@@ -58,7 +58,5 @@ export const VenetianBlindsFilter = styled.div<VenetianBlindsFilterProps>`
|
||||
: null)
|
||||
}
|
||||
`;
|
||||
VenetianBlindsFilter.displayName = "VenetianBlindsFilter";
|
||||
|
||||
export const AnimatedVenetianBlindsFilter = animated(VenetianBlindsFilter);
|
||||
AnimatedVenetianBlindsFilter.displayName = "AnimatedVenetianBlindsFilter";
|
||||
@@ -1,4 +1,4 @@
|
||||
import styled from "styled-components";
|
||||
import styled from "styled-components/macro";
|
||||
import { BGStatusIndicatorModes } from "../../../../types/state";
|
||||
|
||||
import { DirectionalTransitionProps } from "../../../../types/style";
|
||||
@@ -15,7 +15,6 @@ export const StatusIndicatorBase = styled.div<DirectionalTransitionProps>`
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
StatusIndicatorBase.displayName = "StatusIndicatorBase";
|
||||
|
||||
|
||||
export const StatusIndicatorLayout = styled.div`
|
||||
@@ -23,7 +22,6 @@ export const StatusIndicatorLayout = styled.div`
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
`;
|
||||
StatusIndicatorLayout.displayName = "StatusIndicatorLayout";
|
||||
|
||||
type IndicatorModeProps = {
|
||||
mode: BGStatusIndicatorModes,
|
||||
@@ -64,7 +62,6 @@ export const LapLine = styled.div<LapLineProps>`
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
LapLine.displayName = "LapLine";
|
||||
|
||||
|
||||
type LapLabelProps = DirectionalTransitionProps & IndicatorModeProps;
|
||||
@@ -84,7 +81,6 @@ export const LapLabel = styled.span<LapLabelProps>`
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
LapLabel.displayName = "LapLabel";
|
||||
|
||||
|
||||
type LapCountProps = DirectionalTransitionProps & IndicatorModeProps;
|
||||
@@ -117,4 +113,3 @@ export const LapCount = styled.div<LapCountProps>`
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
LapCount.displayName = "LapCount";
|
||||
@@ -1,4 +1,4 @@
|
||||
import styled, { css } from "styled-components";
|
||||
import styled, { css } from "styled-components/macro";
|
||||
import { animated } from "@react-spring/web";
|
||||
|
||||
import {
|
||||
@@ -33,7 +33,6 @@ export const RowsContainer = styled.div<RowsContainerProps>`
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
RowsContainer.displayName = "RowsContainer";
|
||||
|
||||
type AnimatedRowContainerProps = {
|
||||
retired?: boolean,
|
||||
@@ -59,7 +58,6 @@ export const AnimatedRowContainer = animated(styled.div.attrs<AnimatedRowContain
|
||||
|
||||
${({ retired }) => retired && css`opacity: 0.7;`}
|
||||
`);
|
||||
AnimatedRowContainer.displayName = "AnimatedRowContainer";
|
||||
|
||||
type RoundedProp = {
|
||||
roundedCornerTop?: Px,
|
||||
@@ -86,7 +84,6 @@ export const RowLeftHalf = styled(Rounded)<DirectionalTransitionProps>`
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
RowLeftHalf.displayName = "RowLeftHalf";
|
||||
|
||||
type AnimatedRowLeftHalfOutlineProps = DirectionalTransitionProps & {
|
||||
startThickness: Px,
|
||||
@@ -110,7 +107,6 @@ export const AnimatedRowLeftHalfOutline = animated(styled(Rounded)<AnimatedRowLe
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`);
|
||||
AnimatedRowLeftHalfOutline.displayName = "AnimatedRowLeftHalfOutline";
|
||||
|
||||
export const RowLeftHalfLayout = styled.div`
|
||||
position: relative;
|
||||
@@ -123,7 +119,6 @@ export const RowLeftHalfLayout = styled.div`
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
`;
|
||||
RowLeftHalfLayout.displayName = "RowLeftHalfLayout";
|
||||
|
||||
type RowLeftHalfPosFlagContainerProps = {
|
||||
size: Px,
|
||||
@@ -133,7 +128,6 @@ export const RowLeftHalfPosFlagContainer = styled.div<RowLeftHalfPosFlagContaine
|
||||
height: ${({ size }) => size}px;
|
||||
width: ${({ size }) => size}px;
|
||||
`;
|
||||
RowLeftHalfPosFlagContainer.displayName = "RowLeftHalfPosFlagContainer";
|
||||
|
||||
export const RowLeftHalfPosFlagChangeContainer = styled.div<OpenProps>`
|
||||
position: absolute;
|
||||
@@ -142,7 +136,6 @@ export const RowLeftHalfPosFlagChangeContainer = styled.div<OpenProps>`
|
||||
|
||||
opacity: ${({ open }) => open ? 1 : 0};
|
||||
`;
|
||||
RowLeftHalfPosFlagChangeContainer.displayName = "RowLeftHalfPosFlagChangeContainer";
|
||||
|
||||
export const RowLeftHalfGemContainer = styled.div`
|
||||
position: absolute;
|
||||
@@ -150,7 +143,6 @@ export const RowLeftHalfGemContainer = styled.div`
|
||||
top: 0;
|
||||
margin-top: 2px;
|
||||
`;
|
||||
RowLeftHalfGemContainer.displayName = "RowLeftHalfGemContainer";
|
||||
|
||||
type RowRightHalfProps = DirectionalTransitionProps & {
|
||||
hugRight: boolean,
|
||||
@@ -176,7 +168,6 @@ export const RowRightHalf = styled(Rounded)<RowRightHalfProps>`
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
RowRightHalf.displayName = "RowRightHalf";
|
||||
|
||||
export const RowRightHalfLayout = styled.div`
|
||||
width: 100%;
|
||||
@@ -188,14 +179,12 @@ export const RowRightHalfLayout = styled.div`
|
||||
justify-content: flex-end;
|
||||
padding-right: 8px;
|
||||
`;
|
||||
RowRightHalfLayout.displayName = "RowRightHalfLayout";
|
||||
|
||||
export const DriverNameContainer = styled.div`
|
||||
position: relative;
|
||||
margin-left: ${p => p.theme.design.timingTower.nameLeftMarginPx}px;
|
||||
margin-top: ${p => p.theme.design.timingTower.nameTopMarginPx}px;
|
||||
`;
|
||||
DriverNameContainer.displayName = "DriverNameContainer";
|
||||
|
||||
export const DriverName = styled.span<DirectionalTransitionProps>`
|
||||
position: absolute;
|
||||
@@ -211,7 +200,6 @@ export const DriverName = styled.span<DirectionalTransitionProps>`
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
DriverName.displayName = "DriverName";
|
||||
|
||||
export const DriverNameWipe = styled.div<DirectionalTransitionProps>`
|
||||
width: ${({ open }) => open ? 800 : 200}px;
|
||||
@@ -224,7 +212,6 @@ export const DriverNameWipe = styled.div<DirectionalTransitionProps>`
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
DriverNameWipe.displayName = "DriverNameWipe";
|
||||
|
||||
type TimeDiffProps = DirectionalTransitionProps & {
|
||||
xScale: Fraction,
|
||||
@@ -245,7 +232,6 @@ export const TimeDiff = styled.span<TimeDiffProps>`
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
TimeDiff.displayName = "TimeDiff";
|
||||
|
||||
export const FastestLapContainer = styled.div`
|
||||
position: absolute;
|
||||
@@ -275,4 +261,3 @@ export const FastestLapGem = styled.div<TransitionProps>`
|
||||
|
||||
${({ transitionProps }) => commonTransition(transitionProps)}
|
||||
`;
|
||||
FastestLapGem.displayName = "FastestLapGem";
|
||||
@@ -1,4 +1,4 @@
|
||||
import styled from "styled-components";
|
||||
import styled from "styled-components/macro";
|
||||
|
||||
export const TimingBoardLayout = styled.div`
|
||||
position: relative;
|
||||
|
||||
Reference in new issue
Block a user