@nice2dev/icons-filetypes 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -0
- package/dist/index.cjs +2956 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +504 -0
- package/dist/index.mjs +2956 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +69 -0
package/README.md
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# @nice2dev/icons-filetypes
|
|
2
|
+
|
|
3
|
+
Comprehensive file type icons for React applications. Features over 150 icons covering documents, code, media, images, archives, fonts, databases, 3D models, CAD files, and Adobe applications.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @nice2dev/icons-filetypes
|
|
9
|
+
# or
|
|
10
|
+
npm install @nice2dev/icons-filetypes
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **150+ file type icons** covering all common formats
|
|
16
|
+
- **3 variants**: `filled`, `outlined`, `colored`
|
|
17
|
+
- **Consistent sizing** with customizable dimensions
|
|
18
|
+
- **Brand-accurate colors** for colored variants
|
|
19
|
+
- **TypeScript support** with full type definitions
|
|
20
|
+
- **Tree-shakeable** - import only what you need
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### Basic Usage
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { PdfIcon, JsIcon, DocxIcon } from '@nice2dev/icons-filetypes';
|
|
28
|
+
|
|
29
|
+
function FileList() {
|
|
30
|
+
return (
|
|
31
|
+
<div>
|
|
32
|
+
<PdfIcon />
|
|
33
|
+
<JsIcon variant="colored" />
|
|
34
|
+
<DocxIcon size={32} color="#333" />
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Icon Variants
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { PdfIcon } from '@nice2dev/icons-filetypes';
|
|
44
|
+
|
|
45
|
+
// Filled (default)
|
|
46
|
+
<PdfIcon variant="filled" />
|
|
47
|
+
|
|
48
|
+
// Outlined
|
|
49
|
+
<PdfIcon variant="outlined" />
|
|
50
|
+
|
|
51
|
+
// Colored (with extension badge)
|
|
52
|
+
<PdfIcon variant="colored" />
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Customization
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { ZipIcon } from '@nice2dev/icons-filetypes';
|
|
59
|
+
|
|
60
|
+
<ZipIcon
|
|
61
|
+
size={48} // Icon size in pixels (default: 24)
|
|
62
|
+
color="#1a1a1a" // Base color for filled/outlined
|
|
63
|
+
extensionColor="#ff00ff" // Override extension badge color
|
|
64
|
+
className="my-icon" // Custom CSS class
|
|
65
|
+
/>;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Available Icons
|
|
69
|
+
|
|
70
|
+
### Documents (16 icons)
|
|
71
|
+
|
|
72
|
+
`DocIcon`, `DocxIcon`, `XlsIcon`, `XlsxIcon`, `PptIcon`, `PptxIcon`, `PdfIcon`, `TxtIcon`, `RtfIcon`, `CsvIcon`, `OdtIcon`, `OdsIcon`, `OdpIcon`, `PagesIcon`, `NumbersIcon`, `KeynoteIcon`
|
|
73
|
+
|
|
74
|
+
### Media - Video (13 icons)
|
|
75
|
+
|
|
76
|
+
`Mp4Icon`, `AviIcon`, `MkvIcon`, `MovIcon`, `WebmIcon`, `WmvIcon`, `FlvIcon`, `M4vIcon`, `MpgIcon`, `MpegIcon`, `ThreeGpIcon`, `TsIcon`, `VobIcon`
|
|
77
|
+
|
|
78
|
+
### Media - Audio (10 icons)
|
|
79
|
+
|
|
80
|
+
`Mp3Icon`, `WavIcon`, `FlacIcon`, `OggIcon`, `AacIcon`, `M4aIcon`, `WmaIcon`, `AiffIcon`, `MidIcon`, `MidiIcon`
|
|
81
|
+
|
|
82
|
+
### Images (16 icons)
|
|
83
|
+
|
|
84
|
+
`JpgIcon`, `JpegIcon`, `PngIcon`, `GifIcon`, `SvgIcon`, `WebpIcon`, `BmpIcon`, `TiffIcon`, `IcoIcon`, `RawIcon`, `Cr2Icon`, `NefIcon`, `HeicIcon`, `HeifIcon`, `AvifIcon`, `EpsIcon`
|
|
85
|
+
|
|
86
|
+
### Code (37 icons)
|
|
87
|
+
|
|
88
|
+
`JsIcon`, `TsIcon`, `JsxIcon`, `TsxIcon`, `PyIcon`, `JavaIcon`, `CsIcon`, `CppIcon`, `CIcon`, `HIcon`, `GoIcon`, `RsIcon`, `RbIcon`, `PhpIcon`, `SwiftIcon`, `KtIcon`, `ScalaIcon`, `RLangIcon`, `HtmlIcon`, `CssIcon`, `ScssIcon`, `LessIcon`, `JsonIcon`, `XmlIcon`, `YamlIcon`, `YmlIcon`, `TomlIcon`, `MdIcon`, `VueIcon`, `SvelteIcon`, `DartIcon`, `LuaIcon`, `ShIcon`, `BashIcon`, `Ps1Icon`, `BatIcon`, `SqlIcon`
|
|
89
|
+
|
|
90
|
+
### Archives (10 icons)
|
|
91
|
+
|
|
92
|
+
`ZipIcon`, `RarIcon`, `SevenZIcon`, `TarIcon`, `GzIcon`, `Bz2Icon`, `XzIcon`, `IsoIcon`, `DmgIcon`, `PkgIcon`
|
|
93
|
+
|
|
94
|
+
### Fonts (5 icons)
|
|
95
|
+
|
|
96
|
+
`TtfIcon`, `OtfIcon`, `WoffIcon`, `Woff2Icon`, `EotIcon`
|
|
97
|
+
|
|
98
|
+
### Databases (4 icons)
|
|
99
|
+
|
|
100
|
+
`DbIcon`, `SqliteIcon`, `MdbIcon`, `AccdbIcon`
|
|
101
|
+
|
|
102
|
+
### 3D Models (9 icons)
|
|
103
|
+
|
|
104
|
+
`ObjIcon`, `FbxIcon`, `GltfIcon`, `GlbIcon`, `StlIcon`, `BlendIcon`, `MaxIcon`, `MayaIcon`, `C4dIcon`
|
|
105
|
+
|
|
106
|
+
### CAD (6 icons)
|
|
107
|
+
|
|
108
|
+
`DwgIcon`, `DxfIcon`, `StepIcon`, `IgesIcon`, `SldprtIcon`, `CatpartIcon`
|
|
109
|
+
|
|
110
|
+
### Adobe (12 icons)
|
|
111
|
+
|
|
112
|
+
`PsdIcon`, `AiIcon`, `InddIcon`, `XdIcon`, `AeIcon`, `PrIcon`, `LrIcon`, `BrIcon`, `DwIcon`, `AnIcon`, `AuIcon`, `FlIcon`
|
|
113
|
+
|
|
114
|
+
## Extension Lookup
|
|
115
|
+
|
|
116
|
+
Use the `FILE_TYPE_ICONS` map to get icon names by file extension:
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
import { FILE_TYPE_ICONS } from '@nice2dev/icons-filetypes';
|
|
120
|
+
|
|
121
|
+
const extension = 'pdf';
|
|
122
|
+
const iconName = FILE_TYPE_ICONS[extension]; // 'PdfIcon'
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Custom Icons
|
|
126
|
+
|
|
127
|
+
Create custom file type icons using the factory function:
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
import { createFiletypeIcon, renderFileBase, renderExtensionBadge } from '@nice2dev/icons-filetypes';
|
|
131
|
+
|
|
132
|
+
export const CustomIcon = createFiletypeIcon(
|
|
133
|
+
({ color, extensionColor, variant }) => (
|
|
134
|
+
<>
|
|
135
|
+
{renderFileBase(color, variant, variant === 'colored' ? '#E3F2FD' : undefined)}
|
|
136
|
+
{/* Add custom inner content */}
|
|
137
|
+
{variant === 'colored' && renderExtensionBadge('CUSTOM', extensionColor!)}
|
|
138
|
+
</>
|
|
139
|
+
),
|
|
140
|
+
{ displayName: 'CustomIcon', extension: 'custom', defaultExtensionColor: '#FF5722' },
|
|
141
|
+
);
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## TypeScript
|
|
145
|
+
|
|
146
|
+
Full type definitions included:
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
import type { FiletypeIconProps, FiletypeVariant, FiletypeCategory } from '@nice2dev/icons-filetypes';
|
|
150
|
+
|
|
151
|
+
interface MyComponentProps {
|
|
152
|
+
variant: FiletypeVariant; // 'filled' | 'outlined' | 'colored'
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## License
|
|
157
|
+
|
|
158
|
+
MIT © Nice2Dev
|