Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react-ui-kit): add folder, multiple files, and text file icons [WPB-15686] #6859

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions packages/react-ui-kit/src/Icon/Files/FolderIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Wire
* Copyright (C) 2025 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*
*/

import {SVGIcon, SVGIconProps} from '../SVGIcon';

export const FolderIcon = ({...props}: SVGIconProps) => {
return (
<SVGIcon realWidth={14} realHeight={16} fill="none" {...props}>
<path
fill="var(--folder-icon-bg)"
d="M11.798 12c.318 0 .623-.124.848-.345.225-.22.352-.52.352-.832V4.941c0-.312-.127-.611-.352-.832a1.212 1.212 0 0 0-.848-.344h-4.74a1.22 1.22 0 0 1-.576-.138 1.192 1.192 0 0 1-.438-.392l-.486-.706a1.191 1.191 0 0 0-.433-.388A1.22 1.22 0 0 0 4.555 2H2.199c-.318 0-.624.124-.849.345-.225.22-.351.52-.351.831v7.647c0 .313.126.612.351.832.225.221.53.345.849.345h9.6ZM.998 6.095h12-12Z"
/>
<path
stroke="var(--folder-icon-stroke)"
d="M.998 6.095h12M11.798 12c.318 0 .623-.124.848-.345.225-.22.352-.52.352-.832V4.941c0-.312-.127-.611-.352-.832a1.212 1.212 0 0 0-.848-.344h-4.74a1.22 1.22 0 0 1-.576-.138 1.192 1.192 0 0 1-.438-.392l-.486-.706a1.191 1.191 0 0 0-.433-.388A1.22 1.22 0 0 0 4.555 2H2.199c-.318 0-.624.124-.849.345-.225.22-.351.52-.351.831v7.647c0 .313.126.612.351.832.225.221.53.345.849.345h9.6Z"
/>
</SVGIcon>
);
};
37 changes: 37 additions & 0 deletions packages/react-ui-kit/src/Icon/Files/MultipleFilesIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Wire
* Copyright (C) 2025 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*
*/

import {SVGIcon, SVGIconProps} from '../SVGIcon';

export const MultipleFilesIcon = ({...props}: SVGIconProps) => {
return (
<SVGIcon realWidth={14} realHeight={16} fill="none" {...props}>
<path
fill="var(--multiple-file-icon-bg)"
stroke="var(--multiple-file-icon-stroke)"
d="M5.498 2.538c0-.573.465-1.038 1.038-1.038h4.923c.574 0 1.039.465 1.039 1.038v5.543c0 .353-.14.692-.387.944l-.905.92a1.346 1.346 0 0 1-.96.401h-3.71a1.039 1.039 0 0 1-1.038-1.038v-6.77Z"
/>
<path
stroke="var(--multiple-file-icon-stroke)"
d="M11.998 8.077a1.926 1.926 0 0 0-2 1.923M3.498 4.5v6.461c0 .85.689 1.539 1.538 1.539h4.462"
/>
<path stroke="var(--multiple-file-icon-stroke)" d="M1.498 7.5v5.461c0 .85.689 1.539 1.538 1.539h4.462" />
</SVGIcon>
);
};
41 changes: 41 additions & 0 deletions packages/react-ui-kit/src/Icon/Files/TextFileIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Wire
* Copyright (C) 2025 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*
*/

import {SVGIcon, SVGIconProps} from '../SVGIcon';

export const TextFileIcon = ({...props}: SVGIconProps) => {
return (
<SVGIcon realWidth={14} realHeight={16} fill="none" {...props}>
<path
d="M0.5 3.5C0.5 2.39543 1.39543 1.5 2.5 1.5H10.5C11.6046 1.5 12.5 2.39543 12.5 3.5V11.5063C12.5 12.1626 12.2419 12.7926 11.7815 13.2603L10.3108 14.754C9.84094 15.2312 9.19916 15.5 8.52938 15.5H2.5C1.39543 15.5 0.5 14.6046 0.5 13.5V3.5Z"
fill="var(--text-file-icon-bg)"
stroke="var(--text-file-icon-stroke)"
/>
<path d="M12.5 11.5V11.5C10.2909 11.5 8.5 13.2909 8.5 15.5V15.5" stroke="var(--text-file-icon-stroke)" />
<path d="M7 2L7 1" stroke="var(--text-file-icon-stroke)" strokeLinecap="round" />
<path d="M11 2L11 1" stroke="var(--text-file-icon-stroke)" strokeLinecap="round" />
<path d="M5 2L5 1" stroke="var(--text-file-icon-stroke)" strokeLinecap="round" />
<path d="M9 2L9 1" stroke="var(--text-file-icon-stroke)" strokeLinecap="round" />
<path d="M3 2L3 1" stroke="var(--text-file-icon-stroke)" strokeLinecap="round" />
<path d="M3 5H9" stroke="var(--text-file-icon-stroke)" strokeLinecap="round" />
<path d="M3 8H9" stroke="var(--text-file-icon-stroke)" strokeLinecap="round" />
<path d="M3 11H6" stroke="var(--text-file-icon-stroke)" strokeLinecap="round" />
</SVGIcon>
);
};
10 changes: 9 additions & 1 deletion packages/react-ui-kit/src/Icon/SVGIcon.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ import {
CodeInlineIcon,
CodeBlockIcon,
BlockquoteIcon,
TextFileIcon,
FolderIcon,
MultipleFilesIcon,
} from '@wireapp/react-ui-kit';

const icons = [
Expand Down Expand Up @@ -218,6 +221,9 @@ const fileIcons = [
OtherFileIcon,
PdfFileIcon,
VideoFileIcon,
TextFileIcon,
FolderIcon,
MultipleFilesIcon,
];

<Container>
Expand Down Expand Up @@ -254,6 +260,7 @@ const fileIcons = [
</span>
))}
</div>

<Line />
<H1>Brand Icons</H1>
<div
Expand All @@ -270,13 +277,14 @@ const fileIcons = [
</span>
))}
</div>

<Line />
<H1>File Icons</H1>
<div
style={{
display: 'grid',
gridGap: 16,
gridTemplateColumns: `repeat(${fileIcons.length}, 1fr)`,
gridTemplateColumns: 'repeat(auto-fill, minmax(50px, 1fr)',
justifyItems: 'center',
}}
>
Expand Down
3 changes: 3 additions & 0 deletions packages/react-ui-kit/src/Icon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,6 @@ export * from './Files/PdfFileIcon';
export * from './Files/PresentationFileIcon';
export * from './Files/SpreadsheetFileIcon';
export * from './Files/VideoFileIcon';
export * from './Files/TextFileIcon';
export * from './Files/FolderIcon';
export * from './Files/MultipleFilesIcon';
26 changes: 25 additions & 1 deletion packages/react-ui-kit/src/Theme/GlobalCssVariables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,21 @@ const light: () => CSSObject = () => ({
'--video-file-icon-bg': COLOR_V2.RED_LIGHT_50,
'--video-file-icon-stroke': COLOR_V2.RED_LIGHT_700,

// Text File Icon
'--text-file-icon-bg': COLOR_V2.AMBER_LIGHT_50,
'--text-file-icon-stroke': COLOR_V2.AMBER_LIGHT_700,

// Other File Icon
'--other-file-icon-bg': COLOR_V2.WHITE,
'--other-file-icon-stroke': COLOR_V2.GRAY_70,

// Folder Icon
'--folder-icon-bg': COLOR_V2.BLUE_LIGHT_50,
'--folder-icon-stroke': COLOR_V2.BLUE_LIGHT_700,

// Multiple File Icon
'--multiple-file-icon-bg': COLOR_V2.WHITE,
'--multiple-file-icon-stroke': COLOR_V2.GRAY_70,
});

const dark: () => CSSObject = () => ({
Expand Down Expand Up @@ -196,9 +208,21 @@ const dark: () => CSSObject = () => ({
'--video-file-icon-bg': COLOR_V2.RED_DARK_50,
'--video-file-icon-stroke': COLOR_V2.RED_DARK_700,

// Text File Icon
'--text-file-icon-bg': COLOR_V2.AMBER_DARK_50,
'--text-file-icon-stroke': COLOR_V2.AMBER_DARK_700,

// Other File Icon
'--other-file-icon-bg': COLOR_V2.GRAY_10,
'--other-file-icon-bg': COLOR_V2.GRAY_95,
'--other-file-icon-stroke': COLOR_V2.GRAY_60,

// Folder Icon
'--folder-icon-bg': COLOR_V2.BLUE_DARK_50,
'--folder-icon-stroke': COLOR_V2.BLUE_DARK_700,

// Multiple File Icon
'--multiple-file-icon-bg': COLOR_V2.GRAY_95,
'--multiple-file-icon-stroke': COLOR_V2.GRAY_60,
});

const accentColors: () => CSSObject = () => ({
Expand Down
Loading