react-car-logo 0.2.0
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/LEGAL.md +22 -0
- package/LICENSE +26 -0
- package/README.md +106 -0
- package/dist/allLogos.d.ts +40 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.esm.js +694 -0
- package/dist/index.js +777 -0
- package/dist/logos/Abarth.d.ts +5 -0
- package/dist/logos/Abarth.js +20 -0
- package/dist/logos/AlfaRomeo.d.ts +5 -0
- package/dist/logos/AlfaRomeo.js +20 -0
- package/dist/logos/Alpine.d.ts +5 -0
- package/dist/logos/Alpine.js +20 -0
- package/dist/logos/Apollo.d.ts +5 -0
- package/dist/logos/Apollo.js +24 -0
- package/dist/logos/Arash.d.ts +5 -0
- package/dist/logos/Arash.js +20 -0
- package/dist/logos/AstonMartin.d.ts +5 -0
- package/dist/logos/AstonMartin.js +20 -0
- package/dist/logos/Audi.d.ts +5 -0
- package/dist/logos/Audi.js +20 -0
- package/dist/logos/BMW.d.ts +5 -0
- package/dist/logos/BMW.js +20 -0
- package/dist/logos/Bentley.d.ts +5 -0
- package/dist/logos/Bentley.js +20 -0
- package/dist/logos/Brabus.d.ts +5 -0
- package/dist/logos/Brabus.js +20 -0
- package/dist/logos/Bugatti.d.ts +5 -0
- package/dist/logos/Bugatti.js +20 -0
- package/dist/logos/Chevrolet.d.ts +5 -0
- package/dist/logos/Chevrolet.js +20 -0
- package/dist/logos/Czinger.d.ts +5 -0
- package/dist/logos/Czinger.js +24 -0
- package/dist/logos/Dallara.d.ts +5 -0
- package/dist/logos/Dallara.js +24 -0
- package/dist/logos/DeTomaso.d.ts +5 -0
- package/dist/logos/DeTomaso.js +20 -0
- package/dist/logos/Dodge.d.ts +5 -0
- package/dist/logos/Dodge.js +20 -0
- package/dist/logos/Ferrari.d.ts +5 -0
- package/dist/logos/Ferrari.js +20 -0
- package/dist/logos/Ford.d.ts +5 -0
- package/dist/logos/Ford.js +20 -0
- package/dist/logos/Glickenhaus.d.ts +5 -0
- package/dist/logos/Glickenhaus.js +24 -0
- package/dist/logos/Gumpert.d.ts +5 -0
- package/dist/logos/Gumpert.js +20 -0
- package/dist/logos/Hennessey.d.ts +5 -0
- package/dist/logos/Hennessey.js +20 -0
- package/dist/logos/Icona.d.ts +5 -0
- package/dist/logos/Icona.js +24 -0
- package/dist/logos/Italdesign.d.ts +5 -0
- package/dist/logos/Italdesign.js +24 -0
- package/dist/logos/Jaguar.d.ts +5 -0
- package/dist/logos/Jaguar.js +20 -0
- package/dist/logos/Koenigsegg.d.ts +5 -0
- package/dist/logos/Koenigsegg.js +20 -0
- package/dist/logos/Lamborghini.d.ts +5 -0
- package/dist/logos/Lamborghini.js +20 -0
- package/dist/logos/Lister.d.ts +5 -0
- package/dist/logos/Lister.js +24 -0
- package/dist/logos/Lotus.d.ts +5 -0
- package/dist/logos/Lotus.js +20 -0
- package/dist/logos/Lykan.d.ts +5 -0
- package/dist/logos/Lykan.js +24 -0
- package/dist/logos/Maserati.d.ts +5 -0
- package/dist/logos/Maserati.js +20 -0
- package/dist/logos/Maybach.d.ts +5 -0
- package/dist/logos/Maybach.js +20 -0
- package/dist/logos/McLaren.d.ts +5 -0
- package/dist/logos/McLaren.js +20 -0
- package/dist/logos/MercedesAMG.d.ts +5 -0
- package/dist/logos/MercedesAMG.js +20 -0
- package/dist/logos/Mosler.d.ts +5 -0
- package/dist/logos/Mosler.js +20 -0
- package/dist/logos/Noble.d.ts +5 -0
- package/dist/logos/Noble.js +24 -0
- package/dist/logos/Pagani.d.ts +5 -0
- package/dist/logos/Pagani.js +20 -0
- package/dist/logos/Pininfarina.d.ts +5 -0
- package/dist/logos/Pininfarina.js +20 -0
- package/dist/logos/Polestar.d.ts +5 -0
- package/dist/logos/Polestar.js +20 -0
- package/dist/logos/Porsche.d.ts +5 -0
- package/dist/logos/Porsche.js +20 -0
- package/dist/logos/RUF.d.ts +5 -0
- package/dist/logos/RUF.js +24 -0
- package/dist/logos/Radical.d.ts +5 -0
- package/dist/logos/Radical.js +20 -0
- package/dist/logos/Rimac.d.ts +5 -0
- package/dist/logos/Rimac.js +20 -0
- package/dist/logos/RollsRoyce.d.ts +5 -0
- package/dist/logos/RollsRoyce.js +20 -0
- package/dist/logos/SSC.d.ts +5 -0
- package/dist/logos/SSC.js +20 -0
- package/dist/logos/Saleen.d.ts +5 -0
- package/dist/logos/Saleen.js +20 -0
- package/dist/logos/Shelby.d.ts +5 -0
- package/dist/logos/Shelby.js +20 -0
- package/dist/logos/Spyker.d.ts +5 -0
- package/dist/logos/Spyker.js +20 -0
- package/dist/logos/TVR.d.ts +5 -0
- package/dist/logos/TVR.js +20 -0
- package/dist/logos/WMotors.d.ts +5 -0
- package/dist/logos/WMotors.js +20 -0
- package/dist/logos/Zenvo.d.ts +5 -0
- package/dist/logos/Zenvo.js +20 -0
- package/dist/types-B2mOhqdm.js +44 -0
- package/dist/types-DV3vCP6D.js +45 -0
- package/dist/types-DfZOvtAx.js +54 -0
- package/dist/types.d.ts +66 -0
- package/package.json +87 -0
- package/src/allLogos.ts +43 -0
- package/src/index.ts +47 -0
- package/src/logos/Abarth.tsx +39 -0
- package/src/logos/AlfaRomeo.tsx +39 -0
- package/src/logos/Alpine.tsx +39 -0
- package/src/logos/Arash.tsx +39 -0
- package/src/logos/AstonMartin.tsx +39 -0
- package/src/logos/Audi.tsx +39 -0
- package/src/logos/BMW.tsx +39 -0
- package/src/logos/Bentley.tsx +39 -0
- package/src/logos/Brabus.tsx +39 -0
- package/src/logos/Bugatti.tsx +39 -0
- package/src/logos/Chevrolet.tsx +39 -0
- package/src/logos/DeTomaso.tsx +39 -0
- package/src/logos/Dodge.tsx +39 -0
- package/src/logos/Ferrari.tsx +39 -0
- package/src/logos/Ford.tsx +39 -0
- package/src/logos/Gumpert.tsx +39 -0
- package/src/logos/Hennessey.tsx +39 -0
- package/src/logos/Jaguar.tsx +39 -0
- package/src/logos/Koenigsegg.tsx +39 -0
- package/src/logos/Lamborghini.tsx +39 -0
- package/src/logos/Lotus.tsx +39 -0
- package/src/logos/Maserati.tsx +39 -0
- package/src/logos/Maybach.tsx +39 -0
- package/src/logos/McLaren.tsx +39 -0
- package/src/logos/MercedesAMG.tsx +39 -0
- package/src/logos/Mosler.tsx +39 -0
- package/src/logos/Pagani.tsx +39 -0
- package/src/logos/Pininfarina.tsx +39 -0
- package/src/logos/Polestar.tsx +39 -0
- package/src/logos/Porsche.tsx +39 -0
- package/src/logos/Radical.tsx +39 -0
- package/src/logos/Rimac.tsx +39 -0
- package/src/logos/RollsRoyce.tsx +39 -0
- package/src/logos/SSC.tsx +39 -0
- package/src/logos/Saleen.tsx +39 -0
- package/src/logos/Shelby.tsx +39 -0
- package/src/logos/Spyker.tsx +39 -0
- package/src/logos/TVR.tsx +39 -0
- package/src/logos/WMotors.tsx +39 -0
- package/src/logos/Zenvo.tsx +39 -0
- package/src/types.ts +91 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CarLogoProps, CarLogoMeta } from "../types";
|
|
3
|
+
import { SIZE_MAP } from "../types";
|
|
4
|
+
|
|
5
|
+
export const meta: CarLogoMeta = {
|
|
6
|
+
title: "Shelby",
|
|
7
|
+
slug: "shelby",
|
|
8
|
+
pngUrl: "https://www.carlogos.org/logo/Shelby-logo.png",
|
|
9
|
+
country: "USA",
|
|
10
|
+
region: "American",
|
|
11
|
+
founded: 1962,
|
|
12
|
+
hex: "8B0000",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Shelby: React.FC<CarLogoProps> = ({
|
|
16
|
+
size = "md",
|
|
17
|
+
width,
|
|
18
|
+
height,
|
|
19
|
+
alt = "Shelby",
|
|
20
|
+
loading = "lazy",
|
|
21
|
+
style,
|
|
22
|
+
...props
|
|
23
|
+
}) => {
|
|
24
|
+
const renderPx = width ?? height ?? SIZE_MAP[size];
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<img
|
|
28
|
+
src="https://www.carlogos.org/logo/Shelby-logo.png"
|
|
29
|
+
alt={alt}
|
|
30
|
+
width={renderPx}
|
|
31
|
+
height={renderPx}
|
|
32
|
+
loading={loading}
|
|
33
|
+
style={{ objectFit: "contain", ...style }}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default Shelby;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CarLogoProps, CarLogoMeta } from "../types";
|
|
3
|
+
import { SIZE_MAP } from "../types";
|
|
4
|
+
|
|
5
|
+
export const meta: CarLogoMeta = {
|
|
6
|
+
title: "Spyker",
|
|
7
|
+
slug: "spyker",
|
|
8
|
+
pngUrl: "https://www.carlogos.org/logo/Spyker-logo.png",
|
|
9
|
+
country: "Netherlands",
|
|
10
|
+
region: "Other",
|
|
11
|
+
founded: 1999,
|
|
12
|
+
hex: "003087",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Spyker: React.FC<CarLogoProps> = ({
|
|
16
|
+
size = "md",
|
|
17
|
+
width,
|
|
18
|
+
height,
|
|
19
|
+
alt = "Spyker",
|
|
20
|
+
loading = "lazy",
|
|
21
|
+
style,
|
|
22
|
+
...props
|
|
23
|
+
}) => {
|
|
24
|
+
const renderPx = width ?? height ?? SIZE_MAP[size];
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<img
|
|
28
|
+
src="https://www.carlogos.org/logo/Spyker-logo.png"
|
|
29
|
+
alt={alt}
|
|
30
|
+
width={renderPx}
|
|
31
|
+
height={renderPx}
|
|
32
|
+
loading={loading}
|
|
33
|
+
style={{ objectFit: "contain", ...style }}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default Spyker;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CarLogoProps, CarLogoMeta } from "../types";
|
|
3
|
+
import { SIZE_MAP } from "../types";
|
|
4
|
+
|
|
5
|
+
export const meta: CarLogoMeta = {
|
|
6
|
+
title: "TVR",
|
|
7
|
+
slug: "tvr",
|
|
8
|
+
pngUrl: "https://www.carlogos.org/logo/TVR-logo.png",
|
|
9
|
+
country: "UK",
|
|
10
|
+
region: "British",
|
|
11
|
+
founded: 1947,
|
|
12
|
+
hex: "8B0000",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const TVR: React.FC<CarLogoProps> = ({
|
|
16
|
+
size = "md",
|
|
17
|
+
width,
|
|
18
|
+
height,
|
|
19
|
+
alt = "TVR",
|
|
20
|
+
loading = "lazy",
|
|
21
|
+
style,
|
|
22
|
+
...props
|
|
23
|
+
}) => {
|
|
24
|
+
const renderPx = width ?? height ?? SIZE_MAP[size];
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<img
|
|
28
|
+
src="https://www.carlogos.org/logo/TVR-logo.png"
|
|
29
|
+
alt={alt}
|
|
30
|
+
width={renderPx}
|
|
31
|
+
height={renderPx}
|
|
32
|
+
loading={loading}
|
|
33
|
+
style={{ objectFit: "contain", ...style }}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default TVR;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CarLogoProps, CarLogoMeta } from "../types";
|
|
3
|
+
import { SIZE_MAP } from "../types";
|
|
4
|
+
|
|
5
|
+
export const meta: CarLogoMeta = {
|
|
6
|
+
title: "W Motors",
|
|
7
|
+
slug: "w-motors",
|
|
8
|
+
pngUrl: "https://www.carlogos.org/logo/W-Motors-logo.png",
|
|
9
|
+
country: "UAE",
|
|
10
|
+
region: "Other",
|
|
11
|
+
founded: 2012,
|
|
12
|
+
hex: "1A1A1A",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const WMotors: React.FC<CarLogoProps> = ({
|
|
16
|
+
size = "md",
|
|
17
|
+
width,
|
|
18
|
+
height,
|
|
19
|
+
alt = "W Motors",
|
|
20
|
+
loading = "lazy",
|
|
21
|
+
style,
|
|
22
|
+
...props
|
|
23
|
+
}) => {
|
|
24
|
+
const renderPx = width ?? height ?? SIZE_MAP[size];
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<img
|
|
28
|
+
src="https://www.carlogos.org/logo/W-Motors-logo.png"
|
|
29
|
+
alt={alt}
|
|
30
|
+
width={renderPx}
|
|
31
|
+
height={renderPx}
|
|
32
|
+
loading={loading}
|
|
33
|
+
style={{ objectFit: "contain", ...style }}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default WMotors;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CarLogoProps, CarLogoMeta } from "../types";
|
|
3
|
+
import { SIZE_MAP } from "../types";
|
|
4
|
+
|
|
5
|
+
export const meta: CarLogoMeta = {
|
|
6
|
+
title: "Zenvo",
|
|
7
|
+
slug: "zenvo",
|
|
8
|
+
pngUrl: "https://www.carlogos.org/logo/Zenvo-logo.png",
|
|
9
|
+
country: "Denmark",
|
|
10
|
+
region: "Other",
|
|
11
|
+
founded: 2004,
|
|
12
|
+
hex: "1A1A1A",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Zenvo: React.FC<CarLogoProps> = ({
|
|
16
|
+
size = "md",
|
|
17
|
+
width,
|
|
18
|
+
height,
|
|
19
|
+
alt = "Zenvo",
|
|
20
|
+
loading = "lazy",
|
|
21
|
+
style,
|
|
22
|
+
...props
|
|
23
|
+
}) => {
|
|
24
|
+
const renderPx = width ?? height ?? SIZE_MAP[size];
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<img
|
|
28
|
+
src="https://www.carlogos.org/logo/Zenvo-logo.png"
|
|
29
|
+
alt={alt}
|
|
30
|
+
width={renderPx}
|
|
31
|
+
height={renderPx}
|
|
32
|
+
loading={loading}
|
|
33
|
+
style={{ objectFit: "contain", ...style }}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default Zenvo;
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ImgHTMLAttributes } from "react";
|
|
2
|
+
|
|
3
|
+
/** Available logo size presets */
|
|
4
|
+
export type LogoSize = "sm" | "md" | "lg";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Pixel dimensions for each size tier.
|
|
8
|
+
*/
|
|
9
|
+
export const SIZE_MAP: Record<LogoSize, number> = {
|
|
10
|
+
sm: 80, // Thumbnails, nav icons, table cells
|
|
11
|
+
md: 160, // Cards, lists, sidebars (default)
|
|
12
|
+
lg: 320, // Hero sections, detail views
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Width in pixels used when fetching logo images.
|
|
17
|
+
*/
|
|
18
|
+
export const CDN_WIDTH_MAP: Record<LogoSize, number> = {
|
|
19
|
+
sm: 640,
|
|
20
|
+
md: 640,
|
|
21
|
+
lg: 640,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Props accepted by every car logo component.
|
|
26
|
+
* Extends standard <img> HTML attributes (minus src/width/height which are controlled).
|
|
27
|
+
*/
|
|
28
|
+
export interface CarLogoProps
|
|
29
|
+
extends Omit<ImgHTMLAttributes<HTMLImageElement>, "src" | "width" | "height"> {
|
|
30
|
+
/**
|
|
31
|
+
* Size preset. Controls both the rendered dimension and the PNG resolution fetched.
|
|
32
|
+
* - `'sm'` -> renders at 80px, fetches 160px PNG (2x retina)
|
|
33
|
+
* - `'md'` -> renders at 160px, fetches 320px PNG (2x retina) -- DEFAULT
|
|
34
|
+
* - `'lg'` -> renders at 320px, fetches 640px PNG (2x retina)
|
|
35
|
+
*/
|
|
36
|
+
size?: LogoSize;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Custom pixel width. Overrides `size` if provided.
|
|
40
|
+
* The highest available PNG resolution (640px) will be fetched.
|
|
41
|
+
*/
|
|
42
|
+
width?: number;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Custom pixel height. Overrides `size` if provided.
|
|
46
|
+
* The highest available PNG resolution (640px) will be fetched.
|
|
47
|
+
*/
|
|
48
|
+
height?: number;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Accessible alt text for screen readers.
|
|
52
|
+
* Defaults to the brand's display name (e.g., "Ferrari").
|
|
53
|
+
*/
|
|
54
|
+
alt?: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Native browser image loading strategy.
|
|
58
|
+
* Defaults to 'lazy' for performance.
|
|
59
|
+
*/
|
|
60
|
+
loading?: "lazy" | "eager";
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Metadata object exported alongside each logo component.
|
|
65
|
+
* Useful for building dynamic UIs, lists, and filters.
|
|
66
|
+
*/
|
|
67
|
+
export interface CarLogoMeta {
|
|
68
|
+
/** Brand display name, e.g. "Rolls-Royce" */
|
|
69
|
+
title: string;
|
|
70
|
+
|
|
71
|
+
/** URL-safe slug, e.g. "rolls-royce" */
|
|
72
|
+
slug: string;
|
|
73
|
+
|
|
74
|
+
/** PNG logo URL */
|
|
75
|
+
pngUrl: string;
|
|
76
|
+
|
|
77
|
+
/** Country of origin, e.g. "Italy" */
|
|
78
|
+
country: string;
|
|
79
|
+
|
|
80
|
+
/** Regional grouping: "Italian" | "German" | "British" | "French" | "American" | "Swedish" | "Other" */
|
|
81
|
+
region: string;
|
|
82
|
+
|
|
83
|
+
/** Year the brand was founded */
|
|
84
|
+
founded: number;
|
|
85
|
+
|
|
86
|
+
/** Primary brand hex color (without #), e.g. "CD212A" */
|
|
87
|
+
hex: string;
|
|
88
|
+
|
|
89
|
+
/** Link to the brand's official guidelines page (if known) */
|
|
90
|
+
guidelines?: string;
|
|
91
|
+
}
|