@brightlocal/icons 0.2.0 → 1.0.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/CHANGELOG.md +13 -1
- package/README.md +19 -44
- package/dist/custom/star-rating.cjs +1 -1
- package/dist/custom/star-rating.d.ts.map +1 -1
- package/dist/custom/star-rating.js +27 -24
- package/dist/dynamic.d.ts +1 -1
- package/dist/dynamic.d.ts.map +1 -1
- package/dist/flag/dynamic-imports.d.ts.map +1 -1
- package/dist/flag/dynamic-imports.js +72 -24
- package/dist/flag/index.d.ts +1 -1
- package/dist/icons/lucide-exports.cjs +1 -0
- package/dist/icons/lucide-exports.d.ts +1 -5269
- package/dist/icons/lucide-exports.d.ts.map +1 -1
- package/dist/icons/lucide-exports.js +3531 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2522 -767
- package/dist/social-media/dynamic-imports.d.ts.map +1 -1
- package/dist/social-media/dynamic-imports.js +243 -81
- package/dist/social-media/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/custom/star-rating.tsx +9 -4
- package/src/dynamic.ts +1 -4
- package/src/flag/dynamic-imports.ts +435 -257
- package/src/flag/index.ts +1 -1
- package/src/icons/lucide-exports.ts +1 -3514
- package/src/index.ts +7 -11
- package/src/social-media/dynamic-imports.ts +408 -124
- package/src/social-media/index.ts +1 -1
- package/dist/icons/icon.cjs +0 -1
- package/dist/icons/icon.d.ts +0 -47
- package/dist/icons/icon.d.ts.map +0 -1
- package/dist/icons/icon.js +0 -46
- package/src/icons/icon.tsx +0 -107
package/dist/icons/icon.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/icons/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,WAAW,CAAC;AAEhD,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,MAAM,CAAC;IAClE;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC7B;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;IAChE;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,IAAI,iFAwDhB,CAAC"}
|
package/dist/icons/icon.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import * as I from "react";
|
|
3
|
-
import * as l from "lucide-react";
|
|
4
|
-
const m = I.forwardRef(
|
|
5
|
-
({ name: o, customIcon: i, className: t, size: n = 16, strokeWidth: f = 1.33, ...c }, r) => {
|
|
6
|
-
if (i)
|
|
7
|
-
return /* @__PURE__ */ u(
|
|
8
|
-
i,
|
|
9
|
-
{
|
|
10
|
-
ref: r,
|
|
11
|
-
className: t,
|
|
12
|
-
height: n,
|
|
13
|
-
width: n,
|
|
14
|
-
...c
|
|
15
|
-
}
|
|
16
|
-
);
|
|
17
|
-
if (!o)
|
|
18
|
-
return null;
|
|
19
|
-
if (typeof o == "function")
|
|
20
|
-
return /* @__PURE__ */ u(
|
|
21
|
-
o,
|
|
22
|
-
{
|
|
23
|
-
ref: r,
|
|
24
|
-
className: t,
|
|
25
|
-
size: n,
|
|
26
|
-
strokeWidth: f,
|
|
27
|
-
...c
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
const e = l[o];
|
|
31
|
-
return e ? /* @__PURE__ */ u(
|
|
32
|
-
e,
|
|
33
|
-
{
|
|
34
|
-
ref: r,
|
|
35
|
-
className: t,
|
|
36
|
-
size: n,
|
|
37
|
-
strokeWidth: f,
|
|
38
|
-
...c
|
|
39
|
-
}
|
|
40
|
-
) : (console.warn(`Icon "${o}" not found in lucide-react`), null);
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
|
-
m.displayName = "Icon";
|
|
44
|
-
export {
|
|
45
|
-
m as Icon
|
|
46
|
-
};
|
package/src/icons/icon.tsx
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { LucideIcon, LucideProps } from "lucide-react";
|
|
3
|
-
import * as LucideIcons from "lucide-react";
|
|
4
|
-
|
|
5
|
-
export type IconName = keyof typeof LucideIcons;
|
|
6
|
-
|
|
7
|
-
export interface IconProps extends Omit<LucideProps, "ref" | "name"> {
|
|
8
|
-
/**
|
|
9
|
-
* The name of the Lucide icon to render
|
|
10
|
-
* Can be a string (e.g., "Check", "ChevronDown") or a Lucide icon component
|
|
11
|
-
*/
|
|
12
|
-
name?: IconName | LucideIcon;
|
|
13
|
-
/**
|
|
14
|
-
* Custom icon component to render instead of a Lucide icon
|
|
15
|
-
*/
|
|
16
|
-
customIcon?: React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
17
|
-
/**
|
|
18
|
-
* Additional class names to apply to the icon
|
|
19
|
-
*/
|
|
20
|
-
className?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Icon size in pixels
|
|
23
|
-
* @default 16
|
|
24
|
-
*/
|
|
25
|
-
size?: number;
|
|
26
|
-
/**
|
|
27
|
-
* Stroke width for line icons
|
|
28
|
-
* @default 1.33
|
|
29
|
-
*/
|
|
30
|
-
strokeWidth?: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Icon component that renders Lucide icons or custom SVG icons
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* // Using Lucide icon by name
|
|
38
|
-
* <Icon name="Check" className="w-4 h-4" />
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* // Using Lucide icon component
|
|
42
|
-
* import { Check } from "lucide-react";
|
|
43
|
-
* <Icon name={Check} />
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* // Using custom icon
|
|
47
|
-
* <Icon customIcon={MyCustomIcon} className="w-6 h-6" />
|
|
48
|
-
*/
|
|
49
|
-
export const Icon = React.forwardRef<SVGSVGElement, IconProps>(
|
|
50
|
-
(
|
|
51
|
-
{ name, customIcon, className, size = 16, strokeWidth = 1.33, ...props },
|
|
52
|
-
ref
|
|
53
|
-
) => {
|
|
54
|
-
// Render custom icon if provided
|
|
55
|
-
if (customIcon) {
|
|
56
|
-
const CustomIcon = customIcon;
|
|
57
|
-
return (
|
|
58
|
-
<CustomIcon
|
|
59
|
-
ref={ref}
|
|
60
|
-
className={className}
|
|
61
|
-
height={size}
|
|
62
|
-
width={size}
|
|
63
|
-
{...(props as React.SVGProps<SVGSVGElement>)}
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Return null if no icon is specified
|
|
69
|
-
if (!name) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// Handle Lucide icon component directly
|
|
74
|
-
if (typeof name === "function") {
|
|
75
|
-
const LucideIconComponent = name as LucideIcon;
|
|
76
|
-
return (
|
|
77
|
-
<LucideIconComponent
|
|
78
|
-
ref={ref}
|
|
79
|
-
className={className}
|
|
80
|
-
size={size}
|
|
81
|
-
strokeWidth={strokeWidth}
|
|
82
|
-
{...props}
|
|
83
|
-
/>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Handle Lucide icon by string name
|
|
88
|
-
const LucideIconComponent = LucideIcons[name] as LucideIcon;
|
|
89
|
-
|
|
90
|
-
if (!LucideIconComponent) {
|
|
91
|
-
console.warn(`Icon "${name}" not found in lucide-react`);
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return (
|
|
96
|
-
<LucideIconComponent
|
|
97
|
-
ref={ref}
|
|
98
|
-
className={className}
|
|
99
|
-
size={size}
|
|
100
|
-
strokeWidth={strokeWidth}
|
|
101
|
-
{...props}
|
|
102
|
-
/>
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
Icon.displayName = "Icon";
|