Skip to content

Commit

Permalink
Merge branch 'master' into cobranded-footer
Browse files Browse the repository at this point in the history
  • Loading branch information
admmasters authored Aug 20, 2024
2 parents c19bb2c + 017e0cc commit 07fcdbf
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## [5.49.0](https://github.com/zopaUK/react-components/compare/v5.48.3...v5.49.0) (2023-08-17)

## 5.71.2

### Patch Changes

- f97372d: New icon for ErrorMessage

## 5.71.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@zopauk/react-components",
"sideEffects": false,
"description": "Shared react styled components for all the Zopa projects.",
"version": "5.71.1",
"version": "5.71.2",
"license": "MIT",
"author": "Zopa Ltd <[email protected]> (https://zopa.com)",
"main": "cjs/src/index.js",
Expand Down
8 changes: 2 additions & 6 deletions src/components/atoms/ErrorMessage/ErrorMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import { typography } from '../../../constants/typography';
import Text from '../Text/Text';
import Icon from '../Icon/Icon';
import { useThemeContext } from '../../styles/Theme';
import TriangleExclamationIcon from '../../styles/icons/triangleExclamation';
import CircleExclamationIcon from '../../styles/icons/circleExclamation';
import InfoCircleIcon from '../../styles/icons/infoCircle';
import CircleExclamation2Icon from '../../styles/icons/circleExclamation2';

const StyledErrorMessage = styled(Text).attrs({
role: 'alert',
Expand Down Expand Up @@ -52,9 +50,7 @@ const ErrorMessage = ({ children, className, id, ...rest }: ErrorMessageProps) =

if (theme.errorMessage.iconVariant) {
const iconMap = {
'circle-exclamation': CircleExclamationIcon,
'triangle-exclamation': TriangleExclamationIcon,
'info-circle': InfoCircleIcon,
'circle-exclamation2': CircleExclamation2Icon,
};

const iconVariant = theme.errorMessage.iconVariant;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Object {
class="py-6"
>
<h5
class="sc-gipzik jmoHBR mb-2"
class="sc-iRbamj gTdRfb mb-2"
>
Form Section
</h5>
Expand Down
6 changes: 3 additions & 3 deletions src/components/styles/Theme/ThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Severity } from '../../atoms/Alert/Alert';
import { spacing } from '../../../constants';
import { ProductTemplateV2 } from '../../templates/ProductTemplate/ProductTemplate/ProductTemplateV2';

export type CustomIconVariant = 'circle-exclamation' | 'info-circle' | 'triangle-exclamation';
export type CustomIconVariant = 'circle-exclamation' | 'circle-exclamation2' | 'info-circle' | 'triangle-exclamation';

export interface ButtonTheme {
text: string;
Expand Down Expand Up @@ -66,7 +66,7 @@ export type AlertTheme = Record<
text: string;
component?: () => ReactElement;
faVariant?: { prefix: IconPrefix; iconName: IconName };
customVariant?: { iconName: CustomIconVariant; color: string };
customVariant?: { iconName: Exclude<CustomIconVariant, 'circle-exclamation2'>; color: string };
}
>;

Expand All @@ -86,7 +86,7 @@ export interface ErrorMessageTheme {
backgroundColor: string;
padding: string;
icon: boolean;
iconVariant?: { name: CustomIconVariant; color: string };
iconVariant?: { name: Extract<CustomIconVariant, 'circle-exclamation2'>; color: string };
}

export interface FooterTheme {
Expand Down
24 changes: 24 additions & 0 deletions src/components/styles/icons/circleExclamation2.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import * as React from 'react';
import styled from 'styled-components';

const CircleExclamationIconWrapper = styled.div`
width: 22.5px;
height: 22.5px;
`;

const CircleExclamation2Icon = ({ color }: { color: string }) => (
<CircleExclamationIconWrapper>
<svg xmlns="http://www.w3.org/2000/svg" width={16} height={16} fill="none">
<g fill={color} clipPath="url(#a)">
<path d="M8 1.28c3.72 0 6.72 3.04 6.72 6.72 0 3.68-3 6.72-6.72 6.72-3.72 0-6.72-3-6.72-6.72 0-3.72 3-6.72 6.72-6.72ZM8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Z" />
<path d="M8.8 3.92H7.12V9.4H8.8V3.92ZM7.96 10.36a.82.82 0 0 0-.84.84c0 .48.36.84.84.84s.84-.36.84-.84a.82.82 0 0 0-.84-.84Z" />
</g>
<defs>
<clipPath id="a">
<path fill="#fff" d="M0 0h16v16H0z" />
</clipPath>
</defs>
</svg>
</CircleExclamationIconWrapper>
);
export default CircleExclamation2Icon;

0 comments on commit 07fcdbf

Please sign in to comment.