diff --git a/src/components/Accordion/Accordion.tsx b/src/components/Accordion/Accordion.tsx index 5016f59..490843e 100644 --- a/src/components/Accordion/Accordion.tsx +++ b/src/components/Accordion/Accordion.tsx @@ -2,7 +2,6 @@ import clsx from 'clsx'; import { Card, CardVariant } from 'components/Card/Card'; import { Icon } from 'components/Icon/Icon'; import { IconButton } from 'components/IconButton/IconButton'; -import { ArrowDropdownDownIcon } from 'components/Icons/ArrowDropdownDownIcon'; import { useRef, useState } from 'react'; import { CSSTransition } from 'react-transition-group'; diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index bb3e42a..953063f 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -72,7 +72,7 @@ export const Button: React.FC = ({ {variant === 'spotlight' && spotlightActive && ( -
+
)} ); diff --git a/src/components/Carousel/Carousel.tsx b/src/components/Carousel/Carousel.tsx index cbdcba2..d37b1e8 100644 --- a/src/components/Carousel/Carousel.tsx +++ b/src/components/Carousel/Carousel.tsx @@ -1,6 +1,5 @@ import clsx from 'clsx'; -import ArrowLeftIcon from 'components/Icons/ArrowLeftIcon'; -import ArrowRightIcon from 'components/Icons/ArrowRightIcon'; +import { Icon } from 'components/Icon/Icon'; import { cloneElement, HTMLAttributes, @@ -140,7 +139,7 @@ export function Carousel({ size='sm' onClick={handlePrev} > - + - + )} diff --git a/src/components/Dialog/Dialog.tsx b/src/components/Dialog/Dialog.tsx index c29ccb7..282662a 100644 --- a/src/components/Dialog/Dialog.tsx +++ b/src/components/Dialog/Dialog.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx'; import { Card } from 'components/Card/Card'; -import CloseIcon from 'components/Icons/CloseIcon'; +import { Icon } from 'components/Icon/Icon'; import { useOnClickOutside } from 'hooks/useOnClickOutside'; import React, { useEffect, useRef } from 'react'; import { CSSTransition } from 'react-transition-group'; @@ -58,8 +58,9 @@ export const Dialog: React.FC = ({ )} > {!hideCloseIcon && ( - )} diff --git a/src/components/ExternalLink/ExternalLink.tsx b/src/components/ExternalLink/ExternalLink.tsx index 089d7dc..d98f3d1 100644 --- a/src/components/ExternalLink/ExternalLink.tsx +++ b/src/components/ExternalLink/ExternalLink.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx'; -import { ArrowLinkOffIcon } from 'components/Icons/ArrowLinkOffIcon'; +import { Icon } from 'components/Icon/Icon'; export interface ExternalLinkProps { className?: string; @@ -30,7 +30,7 @@ export const ExternalLink: React.FC = ({ target='_blank' > {text} - {!withoutIcon && } + {!withoutIcon && } ); }; diff --git a/src/components/IconButton/IconButton.stories.tsx b/src/components/IconButton/IconButton.stories.tsx index 161a8c3..d4c72c3 100644 --- a/src/components/IconButton/IconButton.stories.tsx +++ b/src/components/IconButton/IconButton.stories.tsx @@ -1,6 +1,6 @@ import { ComponentMeta, ComponentStory } from '@storybook/react'; -import CloseIcon from '../Icons/CloseIcon'; +import { Icon } from '../Icon/Icon'; import { IconButton } from './IconButton'; export default { @@ -11,7 +11,7 @@ export default { const Template: ComponentStory = (args) => ( - + ); diff --git a/src/components/Icons/ArrowDropdownDownIcon.tsx b/src/components/Icons/ArrowDropdownDownIcon.tsx deleted file mode 100644 index 8c32bca..0000000 --- a/src/components/Icons/ArrowDropdownDownIcon.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { SVGIconProps } from './types'; - -export const ArrowDropdownDownIcon = ({ onClick, className }: SVGIconProps) => ( - - - -); diff --git a/src/components/Icons/ArrowDropdownLeftIcon.tsx b/src/components/Icons/ArrowDropdownLeftIcon.tsx deleted file mode 100644 index ec359f8..0000000 --- a/src/components/Icons/ArrowDropdownLeftIcon.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { SVGIconProps } from './types'; - -export default function ArrowDropdownLeftIcon({ active, onClick, className }: SVGIconProps) { - return ( - - - - ); -} diff --git a/src/components/Icons/ArrowDropdownRightIcon.tsx b/src/components/Icons/ArrowDropdownRightIcon.tsx deleted file mode 100644 index 679ee10..0000000 --- a/src/components/Icons/ArrowDropdownRightIcon.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { SVGIconProps } from './types'; - -export default function ArrowDropdownRightIcon({ active, onClick, className }: SVGIconProps) { - return ( - - - - ); -} diff --git a/src/components/Icons/ArrowLeftIcon.tsx b/src/components/Icons/ArrowLeftIcon.tsx deleted file mode 100644 index a106b97..0000000 --- a/src/components/Icons/ArrowLeftIcon.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { SVGIconProps } from './types'; - -export default function ArrowLeftIcon({ active, onClick }: SVGIconProps) { - return ( - - - - - ); -} diff --git a/src/components/Icons/ArrowLinkOffIcon.tsx b/src/components/Icons/ArrowLinkOffIcon.tsx deleted file mode 100644 index edb5004..0000000 --- a/src/components/Icons/ArrowLinkOffIcon.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { SVGIconProps } from './types'; - -export const ArrowLinkOffIcon = ({ onClick, className }: SVGIconProps) => { - return ( - - - - - ); -}; diff --git a/src/components/Icons/ArrowRightIcon.tsx b/src/components/Icons/ArrowRightIcon.tsx deleted file mode 100644 index 3b15768..0000000 --- a/src/components/Icons/ArrowRightIcon.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { SVGIconProps } from './types'; - -export default function ArrowRightIcon({ active, onClick }: SVGIconProps) { - return ( - - - - - ); -} diff --git a/src/components/Icons/CloseIcon.tsx b/src/components/Icons/CloseIcon.tsx deleted file mode 100644 index d8be7cb..0000000 --- a/src/components/Icons/CloseIcon.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; - -import { SVGIconProps } from './types'; - -export default function CloseIcon({ onClick, className }: SVGIconProps) { - return ( - - - - - ); -} diff --git a/src/components/Icons/SkipLeftIcon.tsx b/src/components/Icons/SkipLeftIcon.tsx deleted file mode 100644 index dcaaa5f..0000000 --- a/src/components/Icons/SkipLeftIcon.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { SVGIconProps } from './types'; - -export default function SkipLeftIcon({ active, onClick, className }: SVGIconProps) { - return ( - - - - - ); -} diff --git a/src/components/Icons/SkipRightIcon.tsx b/src/components/Icons/SkipRightIcon.tsx deleted file mode 100644 index f4f3e8d..0000000 --- a/src/components/Icons/SkipRightIcon.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { SVGIconProps } from './types'; - -export default function SkipRightIcon({ active, onClick, className }: SVGIconProps) { - return ( - - - - - ); -} diff --git a/src/components/Icons/types.ts b/src/components/Icons/types.ts deleted file mode 100644 index 301cd09..0000000 --- a/src/components/Icons/types.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface SVGIconProps { - active?: boolean; - onClick?: () => void; - className?: string; -} diff --git a/src/components/Pagination/Pagination.tsx b/src/components/Pagination/Pagination.tsx index 7965f94..026baaf 100644 --- a/src/components/Pagination/Pagination.tsx +++ b/src/components/Pagination/Pagination.tsx @@ -1,8 +1,5 @@ import clsx from 'clsx'; -import ArrowDropdownLeftIcon from 'components/Icons/ArrowDropdownLeftIcon'; -import ArrowDropdownRightIcon from 'components/Icons/ArrowDropdownRightIcon'; -import SkipLeftIcon from 'components/Icons/SkipLeftIcon'; -import SkipRightIcon from 'components/Icons/SkipRightIcon'; +import { Icon } from 'components/Icon/Icon'; export interface PaginationLocalization { of?: string; @@ -38,34 +35,46 @@ export const Pagination: React.FC = ({ return (
- gotoPage(0)} /> - gotoPage(Math.max(pageIndex - 1, 0))} /> +
{startIndex + 1}-{endIndex}   {localization.of}  {length}
- canNextPage && gotoPage(pageIndex + 1)} /> - gotoPage(pageCount - 1)} />
diff --git a/src/components/Select/Select.tsx b/src/components/Select/Select.tsx index cfcbd5b..b85af4e 100644 --- a/src/components/Select/Select.tsx +++ b/src/components/Select/Select.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx'; import { FieldAttributes, FieldAttributesProps } from 'components/FieldAttributes/FieldAttributes'; -import { ArrowDropdownDownIcon } from 'components/Icons/ArrowDropdownDownIcon'; +import { Icon } from 'components/Icon/Icon'; import { useOnClickOutside } from 'hooks/useOnClickOutside'; import { ReactElement, useMemo, useRef, useState } from 'react'; import { Option } from 'types/option'; @@ -86,10 +86,11 @@ export const Select = ({ > {value ? label : {placeholder}} - {isOpen && (
Action - + ) }; diff --git a/src/components/Selector/Selector.tsx b/src/components/Selector/Selector.tsx index 5954bd2..9471396 100644 --- a/src/components/Selector/Selector.tsx +++ b/src/components/Selector/Selector.tsx @@ -10,7 +10,7 @@ export type SelectorProps = { export const Selector: React.FC = ({ text, onClick, className }) => (