@brightlocal/icons 0.1.1 → 0.1.2
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/CHANGELOG.md +16 -0
- package/dist/icons/dynamic-icon.cjs +1 -1
- package/dist/icons/dynamic-icon.d.ts +6 -0
- package/dist/icons/dynamic-icon.d.ts.map +1 -1
- package/dist/icons/dynamic-icon.js +7 -7
- package/dist/icons/icon.cjs +1 -1
- package/dist/icons/icon.d.ts +5 -0
- package/dist/icons/icon.d.ts.map +1 -1
- package/dist/icons/icon.js +9 -7
- package/dist/icons/lucide-exports.cjs +1 -0
- package/dist/icons/lucide-exports.d.ts +10552 -0
- package/dist/icons/lucide-exports.d.ts.map +1 -0
- package/dist/icons/lucide-exports.js +7042 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4278 -765
- package/package.json +9 -2
- package/src/icons/dynamic-icon.tsx +8 -2
- package/src/icons/icon.tsx +8 -1
- package/src/icons/lucide-exports.ts +7074 -0
- package/src/index.ts +7 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightlocal/icons",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "BrightLocal Design System Icons - Lucide defaults and custom icons",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"dist",
|
|
11
11
|
"src",
|
|
12
12
|
"README.md",
|
|
13
|
+
"CHANGELOG.md",
|
|
13
14
|
"LICENSE",
|
|
14
15
|
"package.json"
|
|
15
16
|
],
|
|
@@ -109,11 +110,17 @@
|
|
|
109
110
|
},
|
|
110
111
|
"scripts": {
|
|
111
112
|
"generate:icons": "tsx scripts/generate-icons.ts",
|
|
113
|
+
"generate:lucide-exports": "tsx scripts/generate-lucide-exports.ts",
|
|
112
114
|
"lint": "eslint . --max-warnings 0",
|
|
113
115
|
"lint:fix": "eslint . --max-warnings 0 --fix",
|
|
114
116
|
"typecheck": "tsc --noEmit",
|
|
115
117
|
"clean": "rm -rf dist",
|
|
116
|
-
"build": "pnpm run clean && vite build"
|
|
118
|
+
"build": "pnpm run clean && vite build",
|
|
119
|
+
"rel:patch": "node scripts/changeset-create.mjs patch",
|
|
120
|
+
"rel:minor": "node scripts/changeset-create.mjs minor",
|
|
121
|
+
"rel:major": "node scripts/changeset-create.mjs major",
|
|
122
|
+
"version:bump": "node scripts/version-bump.mjs",
|
|
123
|
+
"release": "node scripts/release.mjs"
|
|
117
124
|
},
|
|
118
125
|
"peerDependencies": {
|
|
119
126
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
@@ -27,6 +27,12 @@ export interface DynamicIconProps extends React.ComponentProps<"svg"> {
|
|
|
27
27
|
* @default 1.33
|
|
28
28
|
*/
|
|
29
29
|
strokeWidth?: number;
|
|
30
|
+
/**
|
|
31
|
+
* When true, keeps stroke width consistent regardless of icon size.
|
|
32
|
+
* Uses formula: strokeWidth * 24 / size
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
absoluteStrokeWidth?: boolean;
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
/**
|
|
@@ -77,7 +83,7 @@ for (const [name, loader] of Object.entries(iconImports)) {
|
|
|
77
83
|
* </React.Suspense>
|
|
78
84
|
*/
|
|
79
85
|
export const DynamicIcon = React.forwardRef<SVGSVGElement, DynamicIconProps>(
|
|
80
|
-
({ name, size = 24, ...props }, ref) => {
|
|
86
|
+
({ name, size = 24, strokeWidth = 1.33, absoluteStrokeWidth = true, ...props }, ref) => {
|
|
81
87
|
const Icon = lazyIcons[name];
|
|
82
88
|
|
|
83
89
|
if (!Icon) {
|
|
@@ -87,7 +93,7 @@ export const DynamicIcon = React.forwardRef<SVGSVGElement, DynamicIconProps>(
|
|
|
87
93
|
|
|
88
94
|
return (
|
|
89
95
|
<React.Suspense fallback={null}>
|
|
90
|
-
<Icon ref={ref} size={size} {...props} />
|
|
96
|
+
<Icon ref={ref} absoluteStrokeWidth={absoluteStrokeWidth} size={size} strokeWidth={strokeWidth} {...props} />
|
|
91
97
|
</React.Suspense>
|
|
92
98
|
);
|
|
93
99
|
}
|
package/src/icons/icon.tsx
CHANGED
|
@@ -18,6 +18,11 @@ export interface IconProps extends Omit<LucideProps, "ref" | "name"> {
|
|
|
18
18
|
* Additional class names to apply to the icon
|
|
19
19
|
*/
|
|
20
20
|
className?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Stroke width for line icons
|
|
23
|
+
* @default 1.33
|
|
24
|
+
*/
|
|
25
|
+
strokeWidth?: number;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
/**
|
|
@@ -37,7 +42,7 @@ export interface IconProps extends Omit<LucideProps, "ref" | "name"> {
|
|
|
37
42
|
* <Icon customIcon={MyCustomIcon} className="w-6 h-6" />
|
|
38
43
|
*/
|
|
39
44
|
export const Icon = React.forwardRef<SVGSVGElement, IconProps>(
|
|
40
|
-
({ name, customIcon, className, size = 24, ...props }, ref) => {
|
|
45
|
+
({ name, customIcon, className, size = 24, strokeWidth = 1.33, ...props }, ref) => {
|
|
41
46
|
// Render custom icon if provided
|
|
42
47
|
if (customIcon) {
|
|
43
48
|
const CustomIcon = customIcon;
|
|
@@ -65,6 +70,7 @@ export const Icon = React.forwardRef<SVGSVGElement, IconProps>(
|
|
|
65
70
|
ref={ref}
|
|
66
71
|
className={className}
|
|
67
72
|
size={size}
|
|
73
|
+
strokeWidth={strokeWidth}
|
|
68
74
|
{...props}
|
|
69
75
|
/>
|
|
70
76
|
);
|
|
@@ -83,6 +89,7 @@ export const Icon = React.forwardRef<SVGSVGElement, IconProps>(
|
|
|
83
89
|
ref={ref}
|
|
84
90
|
className={className}
|
|
85
91
|
size={size}
|
|
92
|
+
strokeWidth={strokeWidth}
|
|
86
93
|
{...props}
|
|
87
94
|
/>
|
|
88
95
|
);
|