diff --git a/packages/react-components/src/components/Icon/Icon.mdx b/packages/react-components/src/components/Icon/Icon.mdx index 3e37b3030..abfaf572b 100644 --- a/packages/react-components/src/components/Icon/Icon.mdx +++ b/packages/react-components/src/components/Icon/Icon.mdx @@ -2,6 +2,8 @@ import { Canvas, Story, ArgsTable, Meta, Title } from '@storybook/blocks'; import { Figma } from '@storybook/addon-designs/blocks'; import * as IconStories from './Icon.stories'; import { IconsShowcase } from './IconsShowcase/IconsShowcase'; +import { getIconsByGroup } from './IconsShowcase/helpers'; +import { IconGroup } from './IconsShowcase/types'; @@ -27,9 +29,25 @@ To use them, import the icon you need and pass it to the `source` prop of the `I ℹ️ Click on the icon to copy its name to clipboard. - - - +### Arrows + + + +### Text + + + +### File Type + + + +### General + + + +### Brands + + ## Component API diff --git a/packages/react-components/src/components/Icon/IconsShowcase/IconsShowcase.tsx b/packages/react-components/src/components/Icon/IconsShowcase/IconsShowcase.tsx index 0af05a199..e6de15158 100644 --- a/packages/react-components/src/components/Icon/IconsShowcase/IconsShowcase.tsx +++ b/packages/react-components/src/components/Icon/IconsShowcase/IconsShowcase.tsx @@ -4,7 +4,9 @@ import * as DSIcons from '@livechat/design-system-icons'; import { handleCopyText } from '../../../stories/helpers'; import { Icon, IconSource } from '../index'; + import './style.scss'; +import { IconName } from './types'; export type IconsMap = { [key: string]: IconSource; @@ -12,10 +14,13 @@ export type IconsMap = { const Icons = DSIcons as IconsMap; -export const IconsShowcase: React.FC = () => { +interface IProps { + data: IconName[]; +} +export const IconsShowcase: React.FC = ({ data }) => { return ( -
- {Object.keys(Icons).map((item) => { +
+ {data.map((item) => { const iconSource = Icons[item]; return ( diff --git a/packages/react-components/src/components/Icon/IconsShowcase/constans.ts b/packages/react-components/src/components/Icon/IconsShowcase/constans.ts new file mode 100644 index 000000000..fd48071d6 --- /dev/null +++ b/packages/react-components/src/components/Icon/IconsShowcase/constans.ts @@ -0,0 +1,443 @@ +import { IconGroup, IconName } from './types'; + +export const IconsData: Record = { + ChipCopilotColored: IconGroup.General, + ChipCopilotMono: IconGroup.General, + ChipCopilotOutlined: IconGroup.General, + H1Filled: IconGroup.General, + H1: IconGroup.General, + H2Filled: IconGroup.General, + H2: IconGroup.General, + H3Filled: IconGroup.General, + H3: IconGroup.General, + AccountCircleFilled: IconGroup.General, + AccountCircle: IconGroup.General, + ActivitiesFilled: IconGroup.General, + Activities: IconGroup.General, + AddFilled: IconGroup.General, + Add: IconGroup.General, + AddCircleFilled: IconGroup.General, + AddCircle: IconGroup.General, + AddEmoji: IconGroup.General, + AddTemplateFilled: IconGroup.General, + AddTemplate: IconGroup.General, + AdjustFilled: IconGroup.General, + Adjust: IconGroup.General, + AiSummaryFilled: IconGroup.General, + AiSummary: IconGroup.General, + AlertSpamFilled: IconGroup.General, + AlertSpam: IconGroup.General, + Android: IconGroup.General, + AndroidColored: IconGroup.General, + AnimalsFilled: IconGroup.General, + Animals: IconGroup.General, + AppSettingsFilled: IconGroup.General, + AppSettings: IconGroup.General, + Apple: IconGroup.General, + AppleMessagesForBusinessColored: IconGroup.General, + AppsFilled: IconGroup.General, + Apps: IconGroup.General, + ArchivesFilled: IconGroup.General, + Archives: IconGroup.General, + ArrowBarLeft: IconGroup.General, + ArrowBarRight: IconGroup.General, + ArrowBackFilled: IconGroup.General, + ArrowBack: IconGroup.General, + ArrowDownwardFilled: IconGroup.General, + ArrowDownward: IconGroup.General, + ArrowFork: IconGroup.General, + ArrowForwardFilled: IconGroup.General, + ArrowForward: IconGroup.General, + ArrowReverseFilled: IconGroup.General, + ArrowReverse: IconGroup.General, + ArrowUpwardFilled: IconGroup.General, + ArrowUpward: IconGroup.General, + ArrowsDiagonalCollapseFilled: IconGroup.General, + ArrowsDiagonalCollapse: IconGroup.General, + ArrowsVertical: IconGroup.General, + AssessmentFilled: IconGroup.General, + Assessment: IconGroup.General, + AssignmentFilled: IconGroup.General, + Assignment: IconGroup.General, + AttachmentFilled: IconGroup.General, + Attachment: IconGroup.General, + AudiotrackFilled: IconGroup.General, + Audiotrack: IconGroup.General, + AutomationFilled: IconGroup.General, + Automation: IconGroup.General, + BallpenFilled: IconGroup.General, + Ballpen: IconGroup.General, + BellExclamationFilled: IconGroup.General, + BellExclamation: IconGroup.General, + BigCommerceColored: IconGroup.General, + BlockFilled: IconGroup.General, + Block: IconGroup.General, + BoldFilled: IconGroup.General, + Bold: IconGroup.General, + Book: IconGroup.General, + BookmarkFilled: IconGroup.General, + Bookmark: IconGroup.General, + BotFilled: IconGroup.General, + Bot: IconGroup.General, + BriefcaseFilled: IconGroup.General, + Briefcase: IconGroup.General, + BugReportFilled: IconGroup.General, + BugReport: IconGroup.General, + CalendarFilled: IconGroup.General, + Calendar: IconGroup.General, + CallFilled: IconGroup.General, + Call: IconGroup.General, + CalloutFilled: IconGroup.General, + Callout: IconGroup.General, + CameraFilled: IconGroup.General, + Camera: IconGroup.General, + CannedResponseFilled: IconGroup.General, + CannedResponse: IconGroup.General, + ChannelsFilled: IconGroup.General, + Channels: IconGroup.General, + ChartFilled: IconGroup.General, + Chart: IconGroup.General, + ChatBotColored: IconGroup.General, + ChatBotMono: IconGroup.General, + ChatDotsFilled: IconGroup.General, + ChatDots: IconGroup.General, + ChatMissedFilled: IconGroup.General, + ChatMissed: IconGroup.General, + ChatTakeoverFilled: IconGroup.General, + ChatTakeover: IconGroup.General, + ChatsFilled: IconGroup.General, + Chats: IconGroup.General, + CheckFilled: IconGroup.General, + Check: IconGroup.General, + CheckBoxFilled: IconGroup.General, + CheckBox: IconGroup.General, + CheckCircleFilled: IconGroup.General, + CheckCircle: IconGroup.General, + ChevronDownFilled: IconGroup.General, + ChevronDown: IconGroup.General, + ChevronLeftFilled: IconGroup.General, + ChevronLeft: IconGroup.General, + ChevronRightFilled: IconGroup.General, + ChevronRight: IconGroup.General, + ChevronUpFilled: IconGroup.General, + ChevronUp: IconGroup.General, + CircleMinus: IconGroup.General, + ClipboardCheck: IconGroup.General, + ClipboardX: IconGroup.General, + CloseFilled: IconGroup.General, + Close: IconGroup.General, + CloseCircleFilled: IconGroup.General, + CloseCircle: IconGroup.General, + CloudFilled: IconGroup.General, + Cloud: IconGroup.General, + CloudflareColored: IconGroup.General, + CodeFilled: IconGroup.General, + Code: IconGroup.General, + CodeBlackFilled: IconGroup.General, + CodeBlack: IconGroup.General, + ColumnsFilled: IconGroup.General, + Columns: IconGroup.General, + ContactFilled: IconGroup.General, + Contact: IconGroup.General, + ContentCopyFilled: IconGroup.General, + ContentCopy: IconGroup.General, + CreditCardOutlineFilled: IconGroup.General, + CreditCardOutline: IconGroup.General, + CurrencyDollar: IconGroup.General, + DayModeFilled: IconGroup.General, + DayMode: IconGroup.General, + DeleteFilled: IconGroup.General, + Delete: IconGroup.General, + DescriptionFilled: IconGroup.General, + Description: IconGroup.General, + DeviceDesktopFilled: IconGroup.General, + DeviceDesktop: IconGroup.General, + DeviceLaptopFilled: IconGroup.General, + DeviceLaptop: IconGroup.General, + DeviceMobileCheck: IconGroup.General, + DeviceMobileFilled: IconGroup.General, + DeviceMobile: IconGroup.General, + DeviceMobileCheckFilled: IconGroup.General, + DeviceMobileCogFilled: IconGroup.General, + DeviceMobileCog: IconGroup.General, + DevicesFilled: IconGroup.General, + Devices: IconGroup.General, + DirectionsFilled: IconGroup.General, + Directions: IconGroup.General, + DiscountFilled: IconGroup.General, + Discount: IconGroup.General, + DismissChatFilled: IconGroup.General, + DismissChat: IconGroup.General, + DoubleArrowLeftFilled: IconGroup.General, + DoubleArrowLeft: IconGroup.General, + DoubleArrowRightFilled: IconGroup.General, + DoubleArrowRight: IconGroup.General, + DragIndicatorFilled: IconGroup.General, + DragIndicator: IconGroup.General, + DropDownFilled: IconGroup.General, + DropDown: IconGroup.General, + DrupalColored: IconGroup.General, + EdgeColored: IconGroup.General, + EditFilled: IconGroup.General, + Edit: IconGroup.General, + EmailAtFilled: IconGroup.General, + EmailAt: IconGroup.General, + EmailLetterFilled: IconGroup.General, + EmailLetter: IconGroup.General, + EmojiFilled: IconGroup.General, + Emoji: IconGroup.General, + ErrorFilled: IconGroup.General, + Error: IconGroup.General, + ExtensionFilled: IconGroup.General, + Extension: IconGroup.General, + FacebookColored: IconGroup.General, + Facebook: IconGroup.General, + FileCopyFilled: IconGroup.General, + FileCopy: IconGroup.General, + FileDownloadFilled: IconGroup.General, + FileDownload: IconGroup.General, + FileUploadFilled: IconGroup.General, + FileUpload: IconGroup.General, + FiletypeExe: IconGroup.General, + FiletypeHtml: IconGroup.General, + FiletypeJpg: IconGroup.General, + FiletypeMp3: IconGroup.General, + FiletypeOther: IconGroup.General, + FiletypePdf: IconGroup.General, + FiletypePpt: IconGroup.General, + FiletypeTxt: IconGroup.General, + FiletypeVideo: IconGroup.General, + FiletypeXls: IconGroup.General, + FiletypeZip: IconGroup.General, + FilterFilled: IconGroup.General, + Filter: IconGroup.General, + FirefoxColored: IconGroup.General, + FlagsFilled: IconGroup.General, + Flags: IconGroup.General, + FolderFilled: IconGroup.General, + Folder: IconGroup.General, + FoodsFilled: IconGroup.General, + Foods: IconGroup.General, + FrequentlyUsedFilled: IconGroup.General, + FrequentlyUsed: IconGroup.General, + GlassesFilled: IconGroup.General, + Glasses: IconGroup.General, + GoogleChromeColored: IconGroup.General, + GoogleDarkModeColored: IconGroup.General, + GoogleLightModeColored: IconGroup.General, + GoogleTagManagerColored: IconGroup.General, + GreetingCardFilled: IconGroup.General, + GreetingCard: IconGroup.General, + GreetingPlainTextFilled: IconGroup.General, + GreetingPlainText: IconGroup.General, + GreetingQuickReplyFilled: IconGroup.General, + GreetingQuickReply: IconGroup.General, + GridDotsFilled: IconGroup.General, + GridDots: IconGroup.General, + GroupFilled: IconGroup.General, + Group: IconGroup.General, + HandWaveFilled: IconGroup.General, + HandWave: IconGroup.General, + HelpFilled: IconGroup.General, + Help: IconGroup.General, + HelpDeskColored: IconGroup.General, + HelpDeskMono: IconGroup.General, + HomeFilled: IconGroup.General, + Home: IconGroup.General, + HourglassFilled: IconGroup.General, + HourglassLowFilled: IconGroup.General, + HourglassLow: IconGroup.General, + Hourglass: IconGroup.General, + ImageFilled: IconGroup.General, + Image: IconGroup.General, + InfoFilled: IconGroup.General, + Info: IconGroup.General, + Instagram: IconGroup.General, + InstagramColored: IconGroup.General, + InternetExplorerColored: IconGroup.General, + ItalicFilled: IconGroup.General, + Italic: IconGroup.General, + JoomlaColored: IconGroup.General, + Key: IconGroup.General, + KeyboardFilled: IconGroup.General, + Keyboard: IconGroup.General, + KnowledgeBaseColored: IconGroup.General, + KnowledgeBaseMono: IconGroup.General, + Line: IconGroup.General, + LineColored: IconGroup.General, + LinkFilled: IconGroup.General, + Link: IconGroup.General, + Linux: IconGroup.General, + ListFilled: IconGroup.General, + List: IconGroup.General, + LiveChatColored: IconGroup.General, + LiveChatMono: IconGroup.General, + LockBlackFilled: IconGroup.General, + LockBlack: IconGroup.General, + LockOpenFilled: IconGroup.General, + LockOpen: IconGroup.General, + LogoutFilled: IconGroup.General, + Logout: IconGroup.General, + MagentoColored: IconGroup.General, + MessagesFilled: IconGroup.General, + Messages: IconGroup.General, + MessengerColored: IconGroup.General, + Messenger: IconGroup.General, + MoodAngry: IconGroup.General, + MoodEmpty: IconGroup.General, + MoodNeutral: IconGroup.General, + MoodSad: IconGroup.General, + MoodVerySad: IconGroup.General, + MoreHorizFilled: IconGroup.General, + MoreHoriz: IconGroup.General, + MoveToFilled: IconGroup.General, + MoveTo: IconGroup.General, + NightModeFilled: IconGroup.General, + NightMode: IconGroup.General, + NoteAddFilled: IconGroup.General, + NoteAdd: IconGroup.General, + NotificationsFilled: IconGroup.General, + Notifications: IconGroup.General, + NumberedListFilled: IconGroup.General, + NumberedList: IconGroup.General, + ObjectsFilled: IconGroup.General, + Objects: IconGroup.General, + OktaColored: IconGroup.General, + OpenInNewFilled: IconGroup.General, + OpenInNew: IconGroup.General, + OpenWidgetColored: IconGroup.General, + OpenWidgetMono: IconGroup.General, + OperaColored: IconGroup.General, + PaletteFilled: IconGroup.General, + Palette: IconGroup.General, + PawFilled: IconGroup.General, + Paw: IconGroup.General, + PeopleFilled: IconGroup.General, + People: IconGroup.General, + PersonFilled: IconGroup.General, + Person: IconGroup.General, + PersonAddFilled: IconGroup.General, + PersonAdd: IconGroup.General, + PinnedFilled: IconGroup.General, + Pinned: IconGroup.General, + PlaceFilled: IconGroup.General, + Place: IconGroup.General, + PlayArrowFilled: IconGroup.General, + PlayArrow: IconGroup.General, + PlayCircleFilled: IconGroup.General, + PlayCircle: IconGroup.General, + PlayerRecordFilled: IconGroup.General, + PlayerRecord: IconGroup.General, + PositionFilled: IconGroup.General, + Position: IconGroup.General, + PowerSettingsFilled: IconGroup.General, + PowerSettings: IconGroup.General, + QuoteFilled: IconGroup.General, + Quote: IconGroup.General, + RefreshFilled: IconGroup.General, + Refresh: IconGroup.General, + RemoveFilled: IconGroup.General, + Remove: IconGroup.General, + Repeat: IconGroup.General, + Replace: IconGroup.General, + ReplyFilled: IconGroup.General, + Reply: IconGroup.General, + ReportFilled: IconGroup.General, + Report: IconGroup.General, + Rocket: IconGroup.General, + SafariColored: IconGroup.General, + SearchFilled: IconGroup.General, + Search: IconGroup.General, + SegmentColored: IconGroup.General, + SendFilled: IconGroup.General, + Send: IconGroup.General, + SettingsFilled: IconGroup.General, + Settings: IconGroup.General, + ShareFilled: IconGroup.General, + Share: IconGroup.General, + ShieldLockFilled: IconGroup.General, + ShieldLock: IconGroup.General, + ShopifyColored: IconGroup.General, + ShoppingCartFilled: IconGroup.General, + ShoppingCart: IconGroup.General, + SmilesFilled: IconGroup.General, + Smiles: IconGroup.General, + SoundOffFilled: IconGroup.General, + SoundOff: IconGroup.General, + SoundOnFilled: IconGroup.General, + SoundOn: IconGroup.General, + SourceCode: IconGroup.General, + SpyFilled: IconGroup.General, + Spy: IconGroup.General, + StrikethroughFilled: IconGroup.General, + Strikethrough: IconGroup.General, + SymbolsFilled: IconGroup.General, + Symbols: IconGroup.General, + TableFilled: IconGroup.General, + Table: IconGroup.General, + TagFilled: IconGroup.General, + Tag: IconGroup.General, + TargetArrowFilled: IconGroup.General, + TargetArrow: IconGroup.General, + TelegramColored: IconGroup.General, + TelegramMono: IconGroup.General, + TextBlockFilled: IconGroup.General, + TextBlock: IconGroup.General, + TextFieldsFilled: IconGroup.General, + TextFields: IconGroup.General, + TextFormattingFilled: IconGroup.General, + TextFormatting: IconGroup.General, + TextLogo: IconGroup.General, + TextLogoFilled: IconGroup.General, + ThumbDownFilled: IconGroup.General, + ThumbDown: IconGroup.General, + ThumbUpFilled: IconGroup.General, + ThumbUp: IconGroup.General, + TicketsFilled: IconGroup.General, + Tickets: IconGroup.General, + TimeFilled: IconGroup.General, + Time: IconGroup.General, + TimelineFilled: IconGroup.General, + Timeline: IconGroup.General, + TipsAndUpdatesFilled: IconGroup.General, + TipsAndUpdates: IconGroup.General, + ToggleLeftFilled: IconGroup.General, + ToggleLeft: IconGroup.General, + ToolsFilled: IconGroup.General, + Tools: IconGroup.General, + TrafficFilled: IconGroup.General, + Traffic: IconGroup.General, + TravelsFilled: IconGroup.General, + Travels: IconGroup.General, + UnderlineFilled: IconGroup.General, + Underline: IconGroup.General, + UndoFilled: IconGroup.General, + Undo: IconGroup.General, + UsersGroup: IconGroup.General, + UsersGroupFilled: IconGroup.General, + VerifiedUserFilled: IconGroup.General, + VerifiedUser: IconGroup.General, + VideoFilled: IconGroup.General, + Video: IconGroup.General, + ViewSidebarFilled: IconGroup.General, + ViewSidebar: IconGroup.General, + VisibilityOffFilled: IconGroup.General, + VisibilityOff: IconGroup.General, + VisibilityOnFilled: IconGroup.General, + VisibilityOn: IconGroup.General, + WaitingFilled: IconGroup.General, + Waiting: IconGroup.General, + WandFilled: IconGroup.General, + Wand: IconGroup.General, + WarningFilled: IconGroup.General, + Warning: IconGroup.General, + Webhook: IconGroup.General, + WeeblyColored: IconGroup.General, + WindowsColored: IconGroup.General, + Windows: IconGroup.General, + WoocommerceColored: IconGroup.General, + WordpressColored: IconGroup.General, + WorldFilled: IconGroup.General, + World: IconGroup.General, + XApp: IconGroup.General, +}; diff --git a/packages/react-components/src/components/Icon/IconsShowcase/helpers.ts b/packages/react-components/src/components/Icon/IconsShowcase/helpers.ts new file mode 100644 index 000000000..67e8ad9b0 --- /dev/null +++ b/packages/react-components/src/components/Icon/IconsShowcase/helpers.ts @@ -0,0 +1,8 @@ +import { IconsData } from './constans'; +import { IconGroup, IconName } from './types'; + +export const getIconsByGroup = (group: IconGroup): IconName[] => { + return Object.entries(IconsData) + .filter(([_, iconGroup]) => iconGroup === group) + .map(([iconName]) => iconName as IconName); +}; diff --git a/packages/react-components/src/components/Icon/IconsShowcase/types.ts b/packages/react-components/src/components/Icon/IconsShowcase/types.ts new file mode 100644 index 000000000..24ea671f6 --- /dev/null +++ b/packages/react-components/src/components/Icon/IconsShowcase/types.ts @@ -0,0 +1,11 @@ +import * as DSIcons from '@livechat/design-system-icons'; + +export type IconName = keyof typeof DSIcons; + +export enum IconGroup { + Arrows, + Text, + FileType, + General, + Brands, +}