Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into meenu-create-new-cta-variant
Browse files Browse the repository at this point in the history
  • Loading branch information
meenakshi-deriv authored Feb 14, 2024
2 parents d00a0fb + 9ce5f15 commit 76a3607
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 78 deletions.
13 changes: 13 additions & 0 deletions libs/blocks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [0.93.0](https://github.com/deriv-com/deriv-com-v2/compare/blocks-0.92.0...blocks-0.93.0) (2024-02-14)


### Bug Fixes

* ts fix ([4b304fc](https://github.com/deriv-com/deriv-com-v2/commit/4b304fcd5c37f2fcbbbf5ab918e45a3aa386d0fd))

## [0.92.0](https://github.com/deriv-com/deriv-com-v2/compare/blocks-0.91.0...blocks-0.92.0) (2024-02-08)

## [0.91.0](https://github.com/deriv-com/deriv-com-v2/compare/blocks-0.90.0...blocks-0.91.0) (2024-02-08)

## [0.90.0](https://github.com/deriv-com/deriv-com-v2/compare/blocks-0.89.0...blocks-0.90.0) (2024-02-07)

## [0.89.0](https://github.com/deriv-com/deriv-com-v2/compare/blocks-0.88.0...blocks-0.89.0) (2024-02-02)

## [0.88.0](https://github.com/deriv-com/deriv-com-v2/compare/blocks-0.87.0...blocks-0.88.0) (2024-02-02)
Expand Down
2 changes: 1 addition & 1 deletion libs/blocks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deriv-com/blocks",
"version": "0.89.0",
"version": "0.93.0",
"private": false,
"main": "./index.js",
"exports": {
Expand Down
21 changes: 2 additions & 19 deletions libs/blocks/src/lib/features/card-feature/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,8 @@ import {
Text,
qtMerge,
} from '@deriv/quill-design';
import { ComponentProps, ReactNode } from 'react';
import {
CardContent,
CardVariantType,
CardsContainer,
} from '@deriv-com/components';

type SectionProps = Omit<ComponentProps<typeof Section>, 'title'>;

export type FeatureCardProps = SectionProps & {
title?: ReactNode;
description?: ReactNode;
cta?: ReactNode;
className?: string;
cards?: CardContent[];
cols?: 'two' | 'three' | 'four';
variant?: CardVariantType;
hasPadding?: boolean;
};
import { CardsContainer } from '@deriv-com/components';
import { FeatureCardProps } from '../types';

const Card = ({
title,
Expand Down
11 changes: 1 addition & 10 deletions libs/blocks/src/lib/features/content-left/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import { FluidContainer, Heading, Section, Text } from '@deriv/quill-design';
import clsx from 'clsx';
import React, { ReactNode } from 'react';

export interface ContentLeftProps {
title: ReactNode;
className?: string;
description?: ReactNode;
content?: React.FC;
children?: ReactNode;
variant?: 'content-left' | 'content-right';
}
import { ContentLeftProps } from '../types';

// trigger deployment - 5
const ContentLeft = ({
Expand Down
3 changes: 2 additions & 1 deletion libs/blocks/src/lib/features/content-right/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ContentLeft, { ContentLeftProps } from '../content-left';
import ContentLeft from '../content-left';
import { ContentLeftProps } from '../types';

const ContentRight = ({
title,
Expand Down
16 changes: 2 additions & 14 deletions libs/blocks/src/lib/features/content-slider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import clsx from 'clsx';
import { FluidContainer, Heading, Section, Text } from '@deriv/quill-design';
import { ReactNode } from 'react';
import {
CardSlider,
CardSliderProps,
CardVariantType,
} from '@deriv-com/components';

export interface ContentSliderProps<T extends CardVariantType> {
title?: ReactNode;
description?: ReactNode;
cta?: () => ReactNode;
className?: string;
cardSliderProps?: CardSliderProps<T>;
}
import { CardSlider, CardVariantType } from '@deriv-com/components';
import { ContentSliderProps } from '../types';

const ContentSlider = <T extends CardVariantType>({
title,
Expand Down
2 changes: 2 additions & 0 deletions libs/blocks/src/lib/features/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ Features.ContentRight = ContentRight;
Features.ContentSlider = ContentSlider;

export default Features;

export * from './types';
37 changes: 37 additions & 0 deletions libs/blocks/src/lib/features/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {
CardContent,
CardSliderProps,
CardVariantType,
} from '@deriv-com/components';
import { Section } from '@deriv/quill-design';
import { ComponentProps, ReactNode } from 'react';

type SectionProps = Omit<ComponentProps<typeof Section>, 'title'>;

export type FeatureCardProps = SectionProps & {
title?: ReactNode;
description?: ReactNode;
cta?: ReactNode;
className?: string;
cards?: CardContent[];
cols?: 'two' | 'three' | 'four';
variant?: CardVariantType;
hasPadding?: boolean;
};

export interface ContentLeftProps {
title: ReactNode;
className?: string;
description?: ReactNode;
content?: React.FC;
children?: ReactNode;
variant?: 'content-left' | 'content-right';
}

export interface ContentSliderProps<T extends CardVariantType> {
title?: ReactNode;
description?: ReactNode;
cta?: () => ReactNode;
className?: string;
cardSliderProps?: CardSliderProps<T>;
}
4 changes: 2 additions & 2 deletions libs/blocks/src/lib/hero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import ContentLess from './content-less';
import { ReactNode } from 'react';

export type HeroBlockProps = {
title?: string;
description?: string;
title?: ReactNode | string;
description?: ReactNode | string;
containerClassName?: string;
content?: ReactNode;
children?: ReactNode;
Expand Down
17 changes: 2 additions & 15 deletions libs/blocks/src/lib/platform/card/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
import { ReactNode } from 'react';
import {
FluidContainer,
Heading,
Section,
Text,
qtMerge,
} from '@deriv/quill-design';
import {
CardContent,
CardVariantType,
CardsContainer,
} from '@deriv-com/components';

export type PlatformBlockCardProps = {
header?: ReactNode;
description?: ReactNode;
className?: string;
cards?: CardContent[];
cols?: 'two' | 'three' | 'four';
variant?: CardVariantType;
};
import { CardsContainer } from '@deriv-com/components';
import { PlatformBlockCardProps } from '../types';

const PlatformBlockCard = ({
header,
Expand Down
2 changes: 2 additions & 0 deletions libs/blocks/src/lib/platform/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { ReactNode } from 'react';
import PlatformBlockTab from './tab';
import PlatformBlockCard from './card';

export * from './types';

export type PlatformBlockType = {
Tab: typeof PlatformBlockTab;
Card: typeof PlatformBlockCard;
Expand Down
9 changes: 1 addition & 8 deletions libs/blocks/src/lib/platform/tab/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ComponentProps, ReactNode } from 'react';
import {
FluidContainer,
Heading,
Expand All @@ -7,13 +6,7 @@ import {
qtMerge,
} from '@deriv/quill-design';
import { Tab } from '@deriv-com/components';

export type PlatformBlockTabProps = ComponentProps<typeof Tab.Base> & {
header?: ReactNode;
description?: ReactNode;
className?: string;
children: ReactNode;
};
import { PlatformBlockTabProps } from '../types';

const PlatformBlockTab = ({
header,
Expand Down
19 changes: 19 additions & 0 deletions libs/blocks/src/lib/platform/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { CardContent, CardVariantType, Tab } from '@deriv-com/components';

import { ComponentProps, ReactNode } from 'react';

export type PlatformBlockCardProps = {
header?: ReactNode;
description?: ReactNode;
className?: string;
cards?: CardContent[];
cols?: 'two' | 'three' | 'four';
variant?: CardVariantType;
};

export type PlatformBlockTabProps = ComponentProps<typeof Tab.Base> & {
header?: ReactNode;
description?: ReactNode;
className?: string;
children: ReactNode;
};
16 changes: 16 additions & 0 deletions libs/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [0.54.0](https://github.com/deriv-com/deriv-com-v2/compare/components-0.53.0...components-0.54.0) (2024-02-13)


### Bug Fixes

* added width ([d3b4d40](https://github.com/deriv-com/deriv-com-v2/commit/d3b4d4035b85536b16e3e9aafcb239bb25895bc5))

## [0.53.0](https://github.com/deriv-com/deriv-com-v2/compare/components-0.52.0...components-0.53.0) (2024-02-13)


### Bug Fixes

* added condition for horizontal ([fdde7e8](https://github.com/deriv-com/deriv-com-v2/commit/fdde7e88cc511af024fb131368f5ef2f190cf2d0))
* refactor ([ff65319](https://github.com/deriv-com/deriv-com-v2/commit/ff65319a8bce259dae1b0de04025cdae5d177811))
* removed icon class name ([143c428](https://github.com/deriv-com/deriv-com-v2/commit/143c428ce48a05a71522fa3e0e7264b9ac3af15b))

## [0.52.0](https://github.com/deriv-com/deriv-com-v2/compare/components-0.51.0...components-0.52.0) (2024-01-31)


Expand Down
2 changes: 1 addition & 1 deletion libs/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deriv-com/components",
"version": "0.52.0",
"version": "0.54.0",
"private": false,
"main": "./index.js",
"exports": {
Expand Down
18 changes: 11 additions & 7 deletions libs/components/src/lib/rating/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ const StarBox = ({ percent, colorKey = 0, size = 'md' }: StarBoxProps) => {
md: 'lg:px-700 lg:py-800 px-500 py-400',
};

const iconProps = {
fill: '#ffffff',
fillOpacity: 1,
width: 100,
...(size === 'md' && {
height: 100,
className: StarClassName[size],
}),
};

return (
<div
className={qtMerge(
Expand All @@ -88,13 +98,7 @@ const StarBox = ({ percent, colorKey = 0, size = 'md' }: StarBoxProps) => {
)}
/>
<div className="absolute left-50 top-50 flex h-full w-full items-center justify-center">
<LabelPairedTrustpilotMdIcon
width={100}
height={100}
className={StarClassName[size]}
fill="#ffffff"
fillOpacity={1}
/>
<LabelPairedTrustpilotMdIcon {...iconProps} />
</div>
</div>
);
Expand Down

0 comments on commit 76a3607

Please sign in to comment.