From 655aa20454b68098ccaae753c4643adc8b549f63 Mon Sep 17 00:00:00 2001 From: Mukul Bansal Date: Sun, 15 Oct 2023 18:00:16 +0530 Subject: [PATCH] feat: add new nofile icon affects: @medly-components/icons --- packages/icons/src/Icons.stories.mdx | 33 ++++++++++++------- .../icons/src/assets/File/no_file_24px.svg | 11 +++++++ packages/icons/src/icons/File/NoFileIcon.tsx | 21 ++++++++++++ packages/icons/src/index.ts | 1 + 4 files changed, 54 insertions(+), 12 deletions(-) create mode 100644 packages/icons/src/assets/File/no_file_24px.svg create mode 100644 packages/icons/src/icons/File/NoFileIcon.tsx diff --git a/packages/icons/src/Icons.stories.mdx b/packages/icons/src/Icons.stories.mdx index 6fae8d65f..1dc908803 100644 --- a/packages/icons/src/Icons.stories.mdx +++ b/packages/icons/src/Icons.stories.mdx @@ -541,6 +541,7 @@ import DownloadDoneIcon from './icons/File/DownloadDoneIcon'; import FolderIcon from './icons/File/FolderIcon'; import FolderOpenIcon from './icons/File/FolderOpenIcon'; import FolderSharedIcon from './icons/File/FolderSharedIcon'; +import NoFileIcon from './icons/File/NoFileIcon'; import PrintIcon from './icons/File/PrintIcon'; import UploadIcon from './icons/File/UploadIcon'; import Administratio338LineIcon from './icons/GSDD/Administratio338LineIcon'; @@ -1477,9 +1478,9 @@ import ToggleOnIcon from './icons/Toggle/ToggleOnIcon'; # Icons -The `Icon` component is a collection of SVG icons exported as React components. +A collection of icons exported as React components (SVG icons). -## How to use? +### How to use ```tsx import { AddIcon } from '@medly-components/icons'; @@ -1487,14 +1488,14 @@ import { AddIcon } from '@medly-components/icons'; ; ``` -## Variants +### Variants -Two variants are available for all the icons: `solid` | `flat`. +There are two variants available for all the icons `solid` | `flat`. -- The `solid` variant will reserve the space around the icon to show the background color. You must use the `withHoverEffect` prop to show the hover effect. -- The `flat` (default variant) will show the icon without the hover effect and space around it. +- `solid` variant will reserve the space around the icon to show the background color. Also you can use the `withHoverEffect` prop to show the hover effect also. +- `flat` (default variant) will show the icon without the hover effect and space around it. -The `pointer` cursor appears when you pass the `onClick` prop. +`pointer` cursor will only appear when you pass the `onClick` prop. @@ -1512,15 +1513,13 @@ The `pointer` cursor appears when you pass the `onClick` prop. -## Props +### Props -While none of the props are necessary, you can still style all the icons according to your requirement using the following props mentioned in the table below: +None of the props is required but still you can style all the icons according to your requirement using below props. -## Theme - -This component offers the following themes mentioned in the table below: +### Theme @@ -6952,6 +6951,16 @@ This component offers the following themes mentioned in the table below: hoverIconColor={color('Hover icon color', defaultTheme.icon.colors.hovered.iconColor)} hoverBgColor={color('Hover background color', defaultTheme.icon.colors.hovered.bgColor)} /> + + + + + + + + + + + diff --git a/packages/icons/src/icons/File/NoFileIcon.tsx b/packages/icons/src/icons/File/NoFileIcon.tsx new file mode 100644 index 000000000..259e06acf --- /dev/null +++ b/packages/icons/src/icons/File/NoFileIcon.tsx @@ -0,0 +1,21 @@ +import { WithStyle } from '@medly-components/utils'; +import type { FC } from 'react'; +import { memo } from 'react'; +import SvgIcon, { SvgIconProps } from '../../SvgIcon'; +import NoFileIconSvg from '../../assets/File/no_file_24px.svg'; + +const Component: FC = memo(props => { + const { size, variant, iconColor, bgColor, hoverBgColor, hoverIconColor, withHoverEffect, margin, fillOpacity, ...restProps } = props; + return ( + + + + ); +}); +Component.displayName = 'NoFileIcon'; + +const NoFileIcon: FC & WithStyle = Object.assign(Component, { Style: SvgIcon }); + +export default NoFileIcon; diff --git a/packages/icons/src/index.ts b/packages/icons/src/index.ts index 44fbf773e..db5b05c48 100644 --- a/packages/icons/src/index.ts +++ b/packages/icons/src/index.ts @@ -534,6 +534,7 @@ export { default as DownloadDoneIcon } from './icons/File/DownloadDoneIcon'; export { default as FolderIcon } from './icons/File/FolderIcon'; export { default as FolderOpenIcon } from './icons/File/FolderOpenIcon'; export { default as FolderSharedIcon } from './icons/File/FolderSharedIcon'; +export { default as NoFileIcon } from './icons/File/NoFileIcon'; export { default as PrintIcon } from './icons/File/PrintIcon'; export { default as UploadIcon } from './icons/File/UploadIcon'; export { default as Administratio338LineIcon } from './icons/GSDD/Administratio338LineIcon';