diff --git a/apps/sim/app/(interfaces)/chat/components/message/components/file-download.tsx b/apps/sim/app/(interfaces)/chat/components/message/components/file-download.tsx index 4584d310f1d..938ea3f2b3c 100644 --- a/apps/sim/app/(interfaces)/chat/components/message/components/file-download.tsx +++ b/apps/sim/app/(interfaces)/chat/components/message/components/file-download.tsx @@ -2,10 +2,10 @@ import { useState } from 'react' import { Button, Download, Loader } from '@sim/emcn' -import { Music } from '@sim/emcn/icons' +import { DefaultFileIcon, Music } from '@sim/emcn/icons' import { createLogger } from '@sim/logger' import { sleep } from '@sim/utils/helpers' -import { DefaultFileIcon, getDocumentIcon } from '@/components/icons/document-icons' +import { getDocumentIcon } from '@/components/icons/document-icons' import { isSafeHttpUrl } from '@/lib/core/utils/urls' import { saveBlob } from '@/lib/uploads/client/download' import { tryInferContextFromKey } from '@/lib/uploads/utils/file-utils' diff --git a/apps/sim/app/(landing)/components/hero/components/hero-visual/workflow-data.ts b/apps/sim/app/(landing)/components/hero/components/hero-visual/workflow-data.ts index 06368ee4344..29bc4102838 100644 --- a/apps/sim/app/(landing)/components/hero/components/hero-visual/workflow-data.ts +++ b/apps/sim/app/(landing)/components/hero/components/hero-visual/workflow-data.ts @@ -1,11 +1,11 @@ import type { ComponentType, SVGProps } from 'react' +import { CsvIcon, DocxIcon, MarkdownIcon, PdfIcon } from '@sim/emcn/icons' import type { BLOCK_DIMENSIONS, CONNECTION_KNOB_PEAK_PX, HANDLE_POSITIONS, } from '@sim/workflow-renderer' import { AgentIcon, GithubIcon, JiraIcon } from '@/components/icons' -import { CsvIcon, DocxIcon, MarkdownIcon, PdfIcon } from '@/components/icons/document-icons' /** * Shared data + geometry for the hero visual - the single source of truth the diff --git a/apps/sim/app/(landing)/components/navbar/components/nav-menu-chip/components/nav-menu-preview/components/files-menu-preview/files-menu-preview.tsx b/apps/sim/app/(landing)/components/navbar/components/nav-menu-chip/components/nav-menu-preview/components/files-menu-preview/files-menu-preview.tsx index 61a40ccac3f..a10d7036879 100644 --- a/apps/sim/app/(landing)/components/navbar/components/nav-menu-chip/components/nav-menu-preview/components/files-menu-preview/files-menu-preview.tsx +++ b/apps/sim/app/(landing)/components/navbar/components/nav-menu-chip/components/nav-menu-preview/components/files-menu-preview/files-menu-preview.tsx @@ -1,6 +1,14 @@ import { Chip } from '@sim/emcn' -import { ArrowUpDown, Files, Folder, ListFilter, Search } from '@sim/emcn/icons' -import { CsvIcon, DocxIcon, PdfIcon } from '@/components/icons/document-icons' +import { + ArrowUpDown, + CsvIcon, + DocxIcon, + Files, + Folder, + ListFilter, + PdfIcon, + Search, +} from '@sim/emcn/icons' import { MenuPreviewFrame } from '@/app/(landing)/components/navbar/components/nav-menu-chip/components/nav-menu-preview/components/menu-preview-frame' import { MenuPreviewHeader, diff --git a/apps/sim/app/(landing)/components/navbar/components/nav-menu-chip/components/nav-menu-preview/components/knowledge-menu-preview/knowledge-menu-preview.tsx b/apps/sim/app/(landing)/components/navbar/components/nav-menu-chip/components/nav-menu-preview/components/knowledge-menu-preview/knowledge-menu-preview.tsx index d03ca17b04c..a22dc62efc2 100644 --- a/apps/sim/app/(landing)/components/navbar/components/nav-menu-chip/components/nav-menu-preview/components/knowledge-menu-preview/knowledge-menu-preview.tsx +++ b/apps/sim/app/(landing)/components/navbar/components/nav-menu-chip/components/nav-menu-preview/components/knowledge-menu-preview/knowledge-menu-preview.tsx @@ -1,6 +1,13 @@ import { Badge, Chip } from '@sim/emcn' -import { ArrowUpDown, ChevronRight, Database, ListFilter, Search } from '@sim/emcn/icons' -import { DocxIcon, PdfIcon } from '@/components/icons/document-icons' +import { + ArrowUpDown, + ChevronRight, + Database, + DocxIcon, + ListFilter, + PdfIcon, + Search, +} from '@sim/emcn/icons' import { MenuPreviewFrame } from '@/app/(landing)/components/navbar/components/nav-menu-chip/components/nav-menu-preview/components/menu-preview-frame' import { MenuPreviewHeader, diff --git a/apps/sim/app/(landing)/files/components/feature-graphics/file-library-graphic.tsx b/apps/sim/app/(landing)/files/components/feature-graphics/file-library-graphic.tsx index deeeab1edd9..86be34e5e21 100644 --- a/apps/sim/app/(landing)/files/components/feature-graphics/file-library-graphic.tsx +++ b/apps/sim/app/(landing)/files/components/feature-graphics/file-library-graphic.tsx @@ -1,6 +1,6 @@ import type { ComponentType } from 'react' import { ChipTag, cn } from '@sim/emcn' -import { DocxIcon, PdfIcon } from '@/components/icons/document-icons' +import { DocxIcon, PdfIcon } from '@sim/emcn/icons' import { FeatureGraphicShell } from '@/app/(landing)/enterprise/components/feature-graphics' import styles from '@/app/(landing)/files/components/feature-graphics/file-library-graphic.module.css' import { InteractiveLibraryFolder } from '@/app/(landing)/files/components/feature-graphics/interactive-library-folder' diff --git a/apps/sim/app/(landing)/files/components/files-hero-loop.tsx b/apps/sim/app/(landing)/files/components/files-hero-loop.tsx index a787c1d7ea9..eca5e2d6be5 100644 --- a/apps/sim/app/(landing)/files/components/files-hero-loop.tsx +++ b/apps/sim/app/(landing)/files/components/files-hero-loop.tsx @@ -3,9 +3,18 @@ import type { ReactNode } from 'react' import { useState } from 'react' import { cn } from '@sim/emcn' -import { ArrowUpDown, File, ListFilter, Plus, Search } from '@sim/emcn/icons' +import { + ArrowUpDown, + CsvIcon, + DocxIcon, + File, + ListFilter, + PdfIcon, + Plus, + Search, + ZipIcon, +} from '@sim/emcn/icons' import { AgentIcon } from '@/components/icons' -import { CsvIcon, DocxIcon, PdfIcon, ZipIcon } from '@/components/icons/document-icons' import { HeroLoopShell } from '@/app/(landing)/components/shared/hero-loop-shell' import { PLATFORM_LOOP_RESET_FADE_MS } from '@/app/(landing)/components/shared/platform-loop-constants' import { useMotionSafeCycle } from '@/app/(landing)/hooks/use-motion-safe-cycle' diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/drop-overlay/drop-overlay.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/drop-overlay/drop-overlay.tsx index 08bd1e957d5..de2e1b93d9b 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/drop-overlay/drop-overlay.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/drop-overlay/drop-overlay.tsx @@ -1,18 +1,18 @@ 'use client' import { memo } from 'react' -import { ImageUp } from '@sim/emcn/icons' import { AudioIcon, CsvIcon, DocxIcon, + ImageUp, JsonIcon, MarkdownIcon, PdfIcon, TxtIcon, VideoIcon, XlsxIcon, -} from '@/components/icons/document-icons' +} from '@sim/emcn/icons' const DROP_OVERLAY_ICONS = [ PdfIcon, diff --git a/apps/sim/components/icons/document-icons.test.ts b/apps/sim/components/icons/document-icons.test.ts index 2bbe3fc2288..1434c6b18b3 100644 --- a/apps/sim/components/icons/document-icons.test.ts +++ b/apps/sim/components/icons/document-icons.test.ts @@ -1,6 +1,7 @@ /** @vitest-environment node */ +import { DefaultFileIcon, ZipIcon } from '@sim/emcn/icons' import { describe, expect, it } from 'vitest' -import { DefaultFileIcon, getDocumentIcon, ZipIcon } from '@/components/icons/document-icons' +import { getDocumentIcon } from '@/components/icons/document-icons' describe('getDocumentIcon', () => { it('uses the zip icon for zip archives by extension or mime type', () => { diff --git a/apps/sim/components/icons/document-icons.tsx b/apps/sim/components/icons/document-icons.tsx index a35f97ba255..a87dc89371b 100644 --- a/apps/sim/components/icons/document-icons.tsx +++ b/apps/sim/components/icons/document-icons.tsx @@ -1,4 +1,20 @@ import type { SVGProps } from 'react' +import { + AudioIcon, + ChartFileIcon, + CsvIcon, + DefaultFileIcon, + DocxIcon, + HtmlIcon, + JsonIcon, + MarkdownIcon, + PdfIcon, + PptxIcon, + TxtIcon, + VideoIcon, + XlsxIcon, + ZipIcon, +} from '@sim/emcn/icons' import { SUPPORTED_ARCHIVE_EXTENSIONS, SUPPORTED_ARCHIVE_MIME_TYPES, @@ -6,260 +22,6 @@ import { SUPPORTED_VIDEO_EXTENSIONS, } from '@/lib/uploads/utils/validation' -export function PdfIcon(props: SVGProps) { - return ( - - - - PDF - - - ) -} - -export function DocxIcon(props: SVGProps) { - return ( - - - - - - - - ) -} - -export function XlsxIcon(props: SVGProps) { - return ( - - - - - - - - ) -} - -export function CsvIcon(props: SVGProps) { - return ( - - - - - - - - - ) -} - -export function TxtIcon(props: SVGProps) { - return ( - - - - - - - ) -} - -export function PptxIcon(props: SVGProps) { - return ( - - - - - - ) -} - -export function AudioIcon(props: SVGProps) { - return ( - - - - - - - - ) -} - -export function VideoIcon(props: SVGProps) { - return ( - - - - - ) -} - -export function ChartFileIcon(props: SVGProps) { - return ( - - - - - - - ) -} - -export function HtmlIcon(props: SVGProps) { - return ( - - - - - - ) -} - -export function JsonIcon(props: SVGProps) { - return ( - - - - - ) -} - -export function MarkdownIcon(props: SVGProps) { - return ( - - - - - - ) -} - -export function ZipIcon(props: SVGProps) { - return ( - - - - - - - - - ) -} - -export function DefaultFileIcon(props: SVGProps) { - return ( - - - - - ) -} - export function getDocumentIcon( rawMimeType: string, filename: string diff --git a/packages/emcn/src/icons/audio-icon.tsx b/packages/emcn/src/icons/audio-icon.tsx new file mode 100644 index 00000000000..88bb321f562 --- /dev/null +++ b/packages/emcn/src/icons/audio-icon.tsx @@ -0,0 +1,22 @@ +import type { SVGProps } from 'react' + +/** Audio icon. Callers provide size and color through SVG props. */ +export function AudioIcon(props: SVGProps) { + return ( + + + + + + + + ) +} diff --git a/packages/emcn/src/icons/chart-file-icon.tsx b/packages/emcn/src/icons/chart-file-icon.tsx new file mode 100644 index 00000000000..cf106eaa229 --- /dev/null +++ b/packages/emcn/src/icons/chart-file-icon.tsx @@ -0,0 +1,22 @@ +import type { SVGProps } from 'react' + +/** Chart icon. Callers provide size and color through SVG props. */ +export function ChartFileIcon(props: SVGProps) { + return ( + + + + + + + ) +} diff --git a/packages/emcn/src/icons/csv-icon.tsx b/packages/emcn/src/icons/csv-icon.tsx new file mode 100644 index 00000000000..cc976e7ed6d --- /dev/null +++ b/packages/emcn/src/icons/csv-icon.tsx @@ -0,0 +1,15 @@ +import type { SVGProps } from 'react' + +/** CSV icon. Callers provide size and color through SVG props. */ +export function CsvIcon(props: SVGProps) { + return ( + + + + + + + + + ) +} diff --git a/packages/emcn/src/icons/default-file-icon.tsx b/packages/emcn/src/icons/default-file-icon.tsx new file mode 100644 index 00000000000..5976e1456fa --- /dev/null +++ b/packages/emcn/src/icons/default-file-icon.tsx @@ -0,0 +1,20 @@ +import type { SVGProps } from 'react' + +/** Generic file icon. Callers provide size and color through SVG props. */ +export function DefaultFileIcon(props: SVGProps) { + return ( + + + + + ) +} diff --git a/packages/emcn/src/icons/docx-icon.tsx b/packages/emcn/src/icons/docx-icon.tsx new file mode 100644 index 00000000000..65424fafb71 --- /dev/null +++ b/packages/emcn/src/icons/docx-icon.tsx @@ -0,0 +1,23 @@ +import type { SVGProps } from 'react' + +/** Word document icon. Callers provide size and color through SVG props. */ +export function DocxIcon(props: SVGProps) { + return ( + + + + + + + + ) +} diff --git a/packages/emcn/src/icons/html-icon.tsx b/packages/emcn/src/icons/html-icon.tsx new file mode 100644 index 00000000000..c4f16266846 --- /dev/null +++ b/packages/emcn/src/icons/html-icon.tsx @@ -0,0 +1,21 @@ +import type { SVGProps } from 'react' + +/** HTML icon. Callers provide size and color through SVG props. */ +export function HtmlIcon(props: SVGProps) { + return ( + + + + + + ) +} diff --git a/packages/emcn/src/icons/index.ts b/packages/emcn/src/icons/index.ts index 2afc237ccba..568ea9c495a 100644 --- a/packages/emcn/src/icons/index.ts +++ b/packages/emcn/src/icons/index.ts @@ -7,6 +7,7 @@ export { ArrowUpDown } from './arrow-up-down' export { ArrowUpLeft } from './arrow-up-left' export { ArrowUpRight } from './arrow-up-right' export { Asterisk } from './asterisk' +export { AudioIcon } from './audio-icon' export { Ban } from './ban' export { Bell } from './bell' export { Blimp } from './blimp' @@ -23,6 +24,7 @@ export { Building } from './building' export { Calendar } from './calendar' export { Camera } from './camera' export { ChartColumn } from './chart-column' +export { ChartFileIcon } from './chart-file-icon' export { Check } from './check' export { ChevronDown } from './chevron-down' export { ChevronLeft } from './chevron-left' @@ -45,10 +47,13 @@ export { Columns3 } from './columns3' export { Compass } from './compass' export { Connections } from './connections' export { Credit } from './credit' +export { CsvIcon } from './csv-icon' export { Cursor } from './cursor' export { Database } from './database' export { DatabaseX } from './database-x' +export { DefaultFileIcon } from './default-file-icon' export { DocumentAttachment } from './document-attachment' +export { DocxIcon } from './docx-icon' export { Download } from './download' export { Duplicate } from './duplicate' export { Expand } from './expand' @@ -76,10 +81,12 @@ export { HelpCircle } from './help-circle' export { HexSimple } from './hex-simple' export { Highlighter } from './highlighter' export { Home } from './home' +export { HtmlIcon } from './html-icon' export { ImageUp } from './image-up' export { InfinityIcon, InfinityIcon as Infinity } from './infinity' export { Integration } from './integration' export { Italic } from './italic' +export { JsonIcon } from './json-icon' export { Key } from './key' export { KeySquare } from './key-square' export { Layout } from './layout' @@ -96,6 +103,7 @@ export { LogIn } from './log-in' export { LogOut } from './log-out' export { Mail } from './mail' export { ManageWorkspace } from './manage-workspace' +export { MarkdownIcon } from './markdown-icon' export { Menu } from './menu' export { MessageSquareText } from './message-square-text' export { Mic } from './mic' @@ -111,6 +119,7 @@ export { PanelLeft } from './panel-left' export { PanelRight } from './panel-right' export { Paperclip } from './paperclip' export { Pause } from './pause' +export { PdfIcon } from './pdf-icon' export { Pencil } from './pencil' export { Phone } from './phone' export { Pilcrow } from './pilcrow' @@ -119,6 +128,7 @@ export { Pin } from './pin' export { PinOff } from './pin-off' export { Play, PlayOutline } from './play' export { Plus } from './plus' +export { PptxIcon } from './pptx-icon' export { Redo } from './redo' export { RefreshCw } from './refresh-cw' export { Repeat } from './repeat' @@ -158,6 +168,7 @@ export { ThumbsUp } from './thumbs-up' export { ToggleLeft } from './toggle-left' export { Trash } from './trash' export { TriangleAlert } from './triangle-alert' +export { TxtIcon } from './txt-icon' export { TypeBoolean } from './type-boolean' export { TypeCurrency } from './type-currency' export { TypeJson } from './type-json' @@ -170,6 +181,7 @@ export { Unlock } from './unlock' export { Upload } from './upload' export { User } from './user' export { Users } from './users' +export { VideoIcon } from './video-icon' export { Wand } from './wand' export { Webhook } from './webhook' export { Workflow } from './workflow' @@ -178,6 +190,8 @@ export { Workspaces } from './workspaces' export { Wrap } from './wrap' export { Wrench } from './wrench' export { X } from './x' +export { XlsxIcon } from './xlsx-icon' export { Zap } from './zap' +export { ZipIcon } from './zip-icon' export { ZoomIn } from './zoom-in' export { ZoomOut } from './zoom-out' diff --git a/packages/emcn/src/icons/json-icon.tsx b/packages/emcn/src/icons/json-icon.tsx new file mode 100644 index 00000000000..e85d620c7dd --- /dev/null +++ b/packages/emcn/src/icons/json-icon.tsx @@ -0,0 +1,20 @@ +import type { SVGProps } from 'react' + +/** JSON icon. Callers provide size and color through SVG props. */ +export function JsonIcon(props: SVGProps) { + return ( + + + + + ) +} diff --git a/packages/emcn/src/icons/markdown-icon.tsx b/packages/emcn/src/icons/markdown-icon.tsx new file mode 100644 index 00000000000..10107edb996 --- /dev/null +++ b/packages/emcn/src/icons/markdown-icon.tsx @@ -0,0 +1,24 @@ +import type { SVGProps } from 'react' + +/** Markdown icon. Callers provide size and color through SVG props. */ +export function MarkdownIcon(props: SVGProps) { + return ( + + + + + + ) +} diff --git a/packages/emcn/src/icons/pdf-icon.tsx b/packages/emcn/src/icons/pdf-icon.tsx new file mode 100644 index 00000000000..203feb2c0b5 --- /dev/null +++ b/packages/emcn/src/icons/pdf-icon.tsx @@ -0,0 +1,23 @@ +import type { SVGProps } from 'react' + +/** PDF icon. Callers provide size and color through SVG props. */ +export function PdfIcon(props: SVGProps) { + return ( + + + + PDF + + + ) +} diff --git a/packages/emcn/src/icons/pptx-icon.tsx b/packages/emcn/src/icons/pptx-icon.tsx new file mode 100644 index 00000000000..12b26f157e1 --- /dev/null +++ b/packages/emcn/src/icons/pptx-icon.tsx @@ -0,0 +1,21 @@ +import type { SVGProps } from 'react' + +/** Presentation icon. Callers provide size and color through SVG props. */ +export function PptxIcon(props: SVGProps) { + return ( + + + + + + ) +} diff --git a/packages/emcn/src/icons/txt-icon.tsx b/packages/emcn/src/icons/txt-icon.tsx new file mode 100644 index 00000000000..1adc80b682e --- /dev/null +++ b/packages/emcn/src/icons/txt-icon.tsx @@ -0,0 +1,22 @@ +import type { SVGProps } from 'react' + +/** Plain text icon. Callers provide size and color through SVG props. */ +export function TxtIcon(props: SVGProps) { + return ( + + + + + + + ) +} diff --git a/packages/emcn/src/icons/video-icon.tsx b/packages/emcn/src/icons/video-icon.tsx new file mode 100644 index 00000000000..148ee2a149c --- /dev/null +++ b/packages/emcn/src/icons/video-icon.tsx @@ -0,0 +1,11 @@ +import type { SVGProps } from 'react' + +/** Video icon. Callers provide size and color through SVG props. */ +export function VideoIcon(props: SVGProps) { + return ( + + + + + ) +} diff --git a/packages/emcn/src/icons/xlsx-icon.tsx b/packages/emcn/src/icons/xlsx-icon.tsx new file mode 100644 index 00000000000..fc6c0c5b116 --- /dev/null +++ b/packages/emcn/src/icons/xlsx-icon.tsx @@ -0,0 +1,14 @@ +import type { SVGProps } from 'react' + +/** Spreadsheet icon. Callers provide size and color through SVG props. */ +export function XlsxIcon(props: SVGProps) { + return ( + + + + + + + + ) +} diff --git a/packages/emcn/src/icons/zip-icon.tsx b/packages/emcn/src/icons/zip-icon.tsx new file mode 100644 index 00000000000..ae7b1544187 --- /dev/null +++ b/packages/emcn/src/icons/zip-icon.tsx @@ -0,0 +1,24 @@ +import type { SVGProps } from 'react' + +/** Archive icon. Callers provide size and color through SVG props. */ +export function ZipIcon(props: SVGProps) { + return ( + + + + + + + + + ) +}