@unifesto/unicon 0.1.2 → 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.
Files changed (124) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +59 -32
  3. package/dist/icons/account.png +0 -0
  4. package/dist/icons/appearance.png +0 -0
  5. package/dist/icons/apple.png +0 -0
  6. package/dist/icons/at.png +0 -0
  7. package/dist/icons/google.png +0 -0
  8. package/dist/icons/instagram.png +0 -0
  9. package/dist/icons/mail.png +0 -0
  10. package/dist/icons/notification.png +0 -0
  11. package/dist/icons/permission.png +0 -0
  12. package/dist/icons/phone.png +0 -0
  13. package/dist/icons/rate.png +0 -0
  14. package/dist/icons/signout.png +0 -0
  15. package/dist/icons/support.png +0 -0
  16. package/dist/index.d.ts +133 -0
  17. package/dist/manifest.json +158 -0
  18. package/dist/react/index.js +124 -0
  19. package/dist/react-native/index.js +145 -0
  20. package/package.json +71 -8
  21. package/dist/1024/account.png +0 -0
  22. package/dist/1024/appearance.png +0 -0
  23. package/dist/1024/apple.png +0 -0
  24. package/dist/1024/at.png +0 -0
  25. package/dist/1024/google.png +0 -0
  26. package/dist/1024/instagram.png +0 -0
  27. package/dist/1024/mail.png +0 -0
  28. package/dist/1024/notification.png +0 -0
  29. package/dist/1024/permission.png +0 -0
  30. package/dist/1024/phone.png +0 -0
  31. package/dist/1024/rate.png +0 -0
  32. package/dist/1024/signout.png +0 -0
  33. package/dist/1024/support.png +0 -0
  34. package/dist/128/account.png +0 -0
  35. package/dist/128/appearance.png +0 -0
  36. package/dist/128/apple.png +0 -0
  37. package/dist/128/at.png +0 -0
  38. package/dist/128/google.png +0 -0
  39. package/dist/128/instagram.png +0 -0
  40. package/dist/128/mail.png +0 -0
  41. package/dist/128/notification.png +0 -0
  42. package/dist/128/permission.png +0 -0
  43. package/dist/128/phone.png +0 -0
  44. package/dist/128/rate.png +0 -0
  45. package/dist/128/signout.png +0 -0
  46. package/dist/128/support.png +0 -0
  47. package/dist/24/account.png +0 -0
  48. package/dist/24/appearance.png +0 -0
  49. package/dist/24/apple.png +0 -0
  50. package/dist/24/at.png +0 -0
  51. package/dist/24/google.png +0 -0
  52. package/dist/24/instagram.png +0 -0
  53. package/dist/24/mail.png +0 -0
  54. package/dist/24/notification.png +0 -0
  55. package/dist/24/permission.png +0 -0
  56. package/dist/24/phone.png +0 -0
  57. package/dist/24/rate.png +0 -0
  58. package/dist/24/signout.png +0 -0
  59. package/dist/24/support.png +0 -0
  60. package/dist/256/account.png +0 -0
  61. package/dist/256/appearance.png +0 -0
  62. package/dist/256/apple.png +0 -0
  63. package/dist/256/at.png +0 -0
  64. package/dist/256/google.png +0 -0
  65. package/dist/256/instagram.png +0 -0
  66. package/dist/256/mail.png +0 -0
  67. package/dist/256/notification.png +0 -0
  68. package/dist/256/permission.png +0 -0
  69. package/dist/256/phone.png +0 -0
  70. package/dist/256/rate.png +0 -0
  71. package/dist/256/signout.png +0 -0
  72. package/dist/256/support.png +0 -0
  73. package/dist/32/account.png +0 -0
  74. package/dist/32/appearance.png +0 -0
  75. package/dist/32/apple.png +0 -0
  76. package/dist/32/at.png +0 -0
  77. package/dist/32/google.png +0 -0
  78. package/dist/32/instagram.png +0 -0
  79. package/dist/32/mail.png +0 -0
  80. package/dist/32/notification.png +0 -0
  81. package/dist/32/permission.png +0 -0
  82. package/dist/32/phone.png +0 -0
  83. package/dist/32/rate.png +0 -0
  84. package/dist/32/signout.png +0 -0
  85. package/dist/32/support.png +0 -0
  86. package/dist/48/account.png +0 -0
  87. package/dist/48/appearance.png +0 -0
  88. package/dist/48/apple.png +0 -0
  89. package/dist/48/at.png +0 -0
  90. package/dist/48/google.png +0 -0
  91. package/dist/48/instagram.png +0 -0
  92. package/dist/48/mail.png +0 -0
  93. package/dist/48/notification.png +0 -0
  94. package/dist/48/permission.png +0 -0
  95. package/dist/48/phone.png +0 -0
  96. package/dist/48/rate.png +0 -0
  97. package/dist/48/signout.png +0 -0
  98. package/dist/48/support.png +0 -0
  99. package/dist/512/account.png +0 -0
  100. package/dist/512/appearance.png +0 -0
  101. package/dist/512/apple.png +0 -0
  102. package/dist/512/at.png +0 -0
  103. package/dist/512/google.png +0 -0
  104. package/dist/512/instagram.png +0 -0
  105. package/dist/512/mail.png +0 -0
  106. package/dist/512/notification.png +0 -0
  107. package/dist/512/permission.png +0 -0
  108. package/dist/512/phone.png +0 -0
  109. package/dist/512/rate.png +0 -0
  110. package/dist/512/signout.png +0 -0
  111. package/dist/512/support.png +0 -0
  112. package/dist/64/account.png +0 -0
  113. package/dist/64/appearance.png +0 -0
  114. package/dist/64/apple.png +0 -0
  115. package/dist/64/at.png +0 -0
  116. package/dist/64/google.png +0 -0
  117. package/dist/64/instagram.png +0 -0
  118. package/dist/64/mail.png +0 -0
  119. package/dist/64/notification.png +0 -0
  120. package/dist/64/permission.png +0 -0
  121. package/dist/64/phone.png +0 -0
  122. package/dist/64/rate.png +0 -0
  123. package/dist/64/signout.png +0 -0
  124. package/dist/64/support.png +0 -0
package/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ Copyright © Unifesto Private Limited
2
+
3
+ All rights reserved.
4
+
5
+ This software and associated documentation files (the "Software") are the proprietary
6
+ and confidential property of Unifesto Private Limited.
7
+
8
+ NOTICE: This Software is licensed for internal use by Unifesto Private Limited only.
9
+
10
+ Unauthorized copying, modification, distribution, or use of this Software, via any
11
+ medium, is strictly prohibited without prior written permission from Unifesto Private
12
+ Limited.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL UNIFESTO PRIVATE LIMITED
17
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
18
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
19
+ OR OTHER DEALINGS IN THE SOFTWARE.
20
+
21
+ For licensing inquiries, please contact:
22
+ Unifesto Private Limited
23
+ Email: legal@unifesto.com
package/README.md CHANGED
@@ -1,13 +1,6 @@
1
- # UnIcon
1
+ # @unifesto/unicon
2
2
 
3
- Cross-platform icon library built with Apple Icon Composer.
4
-
5
- UnIcon provides a collection of beautiful, high-quality icons for:
6
-
7
- * Next.js
8
- * React
9
- * Expo
10
- * React Native
3
+ Cross-platform icon library for React, Next.js, Expo, and React Native.
11
4
 
12
5
  ## Installation
13
6
 
@@ -15,9 +8,7 @@ UnIcon provides a collection of beautiful, high-quality icons for:
15
8
  npm install @unifesto/unicon
16
9
  ```
17
10
 
18
- ## Usage
19
-
20
- ### React / Next.js
11
+ ## React / Next.js
21
12
 
22
13
  ```tsx
23
14
  import { UnIcon } from "@unifesto/unicon/react";
@@ -32,7 +23,7 @@ export default function App() {
32
23
  }
33
24
  ```
34
25
 
35
- ### Expo / React Native
26
+ ## React Native / Expo
36
27
 
37
28
  ```tsx
38
29
  import { UnIcon } from "@unifesto/unicon/react-native";
@@ -47,38 +38,74 @@ export default function App() {
47
38
  }
48
39
  ```
49
40
 
50
- ## Available Icons
41
+ ## Direct Asset Usage
51
42
 
52
- * at
53
- * ticket
54
- * event
55
- * venue
56
- * organizer
43
+ ### Next.js
44
+
45
+ ```tsx
46
+ import Image from "next/image";
47
+ import atIcon from "@unifesto/unicon/icons/at.png";
57
48
 
58
- More icons are added regularly.
49
+ export default function App() {
50
+ return (
51
+ <Image
52
+ src={atIcon}
53
+ alt="At"
54
+ width={24}
55
+ height={24}
56
+ />
57
+ );
58
+ }
59
+ ```
59
60
 
60
- ## Development
61
+ ### React Native
61
62
 
62
- Build icons:
63
+ ```tsx
64
+ import { Image } from "react-native";
63
65
 
64
- ```bash
65
- npm run build
66
+ export default function App() {
67
+ return (
68
+ <Image
69
+ source={require("@unifesto/unicon/icons/at.png")}
70
+ style={{
71
+ width: 24,
72
+ height: 24,
73
+ }}
74
+ />
75
+ );
76
+ }
66
77
  ```
67
78
 
68
- Publish package:
79
+ ## TypeScript
69
80
 
70
- ```bash
71
- npm publish --access public
81
+ ```ts
82
+ import type { IconName } from "@unifesto/unicon";
83
+
84
+ const icon: IconName = "at";
72
85
  ```
73
86
 
74
- ## License
87
+ ## Available Icons
75
88
 
76
- All rights reserved.
89
+ * account
90
+ * appearance
91
+ * apple
92
+ * at
93
+ * google
94
+ * instagram
95
+ * mail
96
+ * notification
97
+ * permission
98
+ * phone
99
+ * rate
100
+ * signout
101
+ * support
102
+
103
+ ## License
77
104
 
78
105
  Copyright © Unifesto Private Limited.
79
106
 
80
- This package and its contents, including all icons, graphics, assets, source files, and associated materials, are the intellectual property of Unifesto Private Limited.
107
+ All rights reserved.
81
108
 
82
- No part of this package may be copied, modified, redistributed, sold, sublicensed, or used in commercial products without prior written permission from Unifesto Private Limited.
109
+ This package and its contents, including all icons, graphics, assets, source files, and associated materials, are the intellectual property of Unifesto Private Limited.
83
110
 
84
- For licensing inquiries, contact Unifesto Private Limited.
111
+ No part of this package may be copied, modified, redistributed, sold, sublicensed, or used in commercial products without prior written permission from Unifesto Private Limited.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,133 @@
1
+ /**
2
+ * UnIcon v1.0.0 - TypeScript Definitions
3
+ * Copyright © Unifesto Private Limited
4
+ *
5
+ * Cross-platform icon library for React, Next.js, Expo and React Native
6
+ */
7
+
8
+ /**
9
+ * Available icon names in the UnIcon library
10
+ */
11
+ export type IconName =
12
+ | "account"
13
+ | "appearance"
14
+ | "apple"
15
+ | "at"
16
+ | "google"
17
+ | "instagram"
18
+ | "mail"
19
+ | "notification"
20
+ | "permission"
21
+ | "phone"
22
+ | "rate"
23
+ | "signout"
24
+ | "support";
25
+
26
+ /**
27
+ * Icon categories for organization and search
28
+ */
29
+ export type IconCategory =
30
+ | "account"
31
+ | "system"
32
+ | "social"
33
+ | "commerce";
34
+
35
+ /**
36
+ * Icon manifest entry with metadata
37
+ */
38
+ export interface IconManifest {
39
+ /** Relative path to the icon file */
40
+ path: string;
41
+ /** Icon format */
42
+ format: "png";
43
+ /** Icon width in pixels */
44
+ width: number;
45
+ /** Icon height in pixels */
46
+ height: number;
47
+ /** Icon category */
48
+ category: IconCategory;
49
+ /** Search tags for the icon */
50
+ tags: string[];
51
+ }
52
+
53
+ /**
54
+ * Complete icon manifest
55
+ */
56
+ export type Manifest = Record<IconName, IconManifest>;
57
+
58
+ /**
59
+ * Get the full manifest of all icons
60
+ */
61
+ export declare const manifest: Manifest;
62
+
63
+ /**
64
+ * Search icons by query string
65
+ *
66
+ * @param query - Search term (matches name, category, or tags)
67
+ * @returns Array of matching icon names
68
+ *
69
+ * @example
70
+ * searchIcons("account") // ["account", "at", "mail", ...]
71
+ * searchIcons("social") // ["apple", "google", "instagram"]
72
+ */
73
+ export declare function searchIcons(query: string): IconName[];
74
+
75
+ /**
76
+ * Get icons by category
77
+ *
78
+ * @param category - Icon category
79
+ * @returns Array of icon names in the category
80
+ *
81
+ * @example
82
+ * getIconsByCategory("account") // ["account", "at", "mail", ...]
83
+ */
84
+ export declare function getIconsByCategory(category: IconCategory): IconName[];
85
+
86
+ /**
87
+ * Get all available categories
88
+ *
89
+ * @returns Array of all icon categories
90
+ */
91
+ export declare function getCategories(): IconCategory[];
92
+
93
+ /**
94
+ * Props for UnIcon component
95
+ */
96
+ export interface UnIconProps {
97
+ /** Name of the icon to display */
98
+ name: IconName;
99
+ /** Size of the icon in pixels (default: 24) */
100
+ size?: number;
101
+ /** CSS class name (React/Next.js only) */
102
+ className?: string;
103
+ /** Inline styles */
104
+ style?: React.CSSProperties | object;
105
+ /** Alt text for accessibility */
106
+ alt?: string;
107
+ }
108
+
109
+ /**
110
+ * Universal icon component for React/Next.js
111
+ */
112
+ export declare const UnIcon: React.FC<UnIconProps>;
113
+
114
+ /**
115
+ * Props for UnIcon component (React Native)
116
+ */
117
+ export interface UnIconPropsNative {
118
+ /** Name of the icon to display */
119
+ name: IconName;
120
+ /** Size of the icon in pixels (default: 24) */
121
+ size?: number;
122
+ /** React Native image style */
123
+ style?: object;
124
+ /** Image resize mode (default: "contain") */
125
+ resizeMode?: "cover" | "contain" | "stretch" | "repeat" | "center";
126
+ }
127
+
128
+ /**
129
+ * Universal icon component for React Native/Expo
130
+ */
131
+ export declare const UnIconNative: React.FC<UnIconPropsNative>;
132
+
133
+ export default manifest;
@@ -0,0 +1,158 @@
1
+ {
2
+ "account": {
3
+ "path": "icons/account.png",
4
+ "format": "png",
5
+ "width": 1024,
6
+ "height": 1024,
7
+ "category": "account",
8
+ "tags": [
9
+ "user",
10
+ "profile",
11
+ "person"
12
+ ]
13
+ },
14
+ "appearance": {
15
+ "path": "icons/appearance.png",
16
+ "format": "png",
17
+ "width": 1024,
18
+ "height": 1024,
19
+ "category": "system",
20
+ "tags": [
21
+ "theme",
22
+ "display",
23
+ "settings"
24
+ ]
25
+ },
26
+ "apple": {
27
+ "path": "icons/apple.png",
28
+ "format": "png",
29
+ "width": 1024,
30
+ "height": 1024,
31
+ "category": "social",
32
+ "tags": [
33
+ "brand",
34
+ "logo",
35
+ "ios"
36
+ ]
37
+ },
38
+ "at": {
39
+ "path": "icons/at.png",
40
+ "format": "png",
41
+ "width": 1024,
42
+ "height": 1024,
43
+ "category": "account",
44
+ "tags": [
45
+ "username",
46
+ "handle",
47
+ "email"
48
+ ]
49
+ },
50
+ "google": {
51
+ "path": "icons/google.png",
52
+ "format": "png",
53
+ "width": 1024,
54
+ "height": 1024,
55
+ "category": "social",
56
+ "tags": [
57
+ "brand",
58
+ "logo",
59
+ "gmail"
60
+ ]
61
+ },
62
+ "instagram": {
63
+ "path": "icons/instagram.png",
64
+ "format": "png",
65
+ "width": 1024,
66
+ "height": 1024,
67
+ "category": "social",
68
+ "tags": [
69
+ "brand",
70
+ "logo",
71
+ "photo"
72
+ ]
73
+ },
74
+ "mail": {
75
+ "path": "icons/mail.png",
76
+ "format": "png",
77
+ "width": 1024,
78
+ "height": 1024,
79
+ "category": "account",
80
+ "tags": [
81
+ "email",
82
+ "message",
83
+ "contact"
84
+ ]
85
+ },
86
+ "notification": {
87
+ "path": "icons/notification.png",
88
+ "format": "png",
89
+ "width": 1024,
90
+ "height": 1024,
91
+ "category": "system",
92
+ "tags": [
93
+ "alert",
94
+ "bell",
95
+ "message"
96
+ ]
97
+ },
98
+ "permission": {
99
+ "path": "icons/permission.png",
100
+ "format": "png",
101
+ "width": 1024,
102
+ "height": 1024,
103
+ "category": "system",
104
+ "tags": [
105
+ "lock",
106
+ "security",
107
+ "access"
108
+ ]
109
+ },
110
+ "phone": {
111
+ "path": "icons/phone.png",
112
+ "format": "png",
113
+ "width": 1024,
114
+ "height": 1024,
115
+ "category": "account",
116
+ "tags": [
117
+ "mobile",
118
+ "call",
119
+ "contact"
120
+ ]
121
+ },
122
+ "rate": {
123
+ "path": "icons/rate.png",
124
+ "format": "png",
125
+ "width": 1024,
126
+ "height": 1024,
127
+ "category": "commerce",
128
+ "tags": [
129
+ "star",
130
+ "review",
131
+ "rating"
132
+ ]
133
+ },
134
+ "signout": {
135
+ "path": "icons/signout.png",
136
+ "format": "png",
137
+ "width": 1024,
138
+ "height": 1024,
139
+ "category": "account",
140
+ "tags": [
141
+ "logout",
142
+ "exit",
143
+ "leave"
144
+ ]
145
+ },
146
+ "support": {
147
+ "path": "icons/support.png",
148
+ "format": "png",
149
+ "width": 1024,
150
+ "height": 1024,
151
+ "category": "system",
152
+ "tags": [
153
+ "help",
154
+ "question",
155
+ "info"
156
+ ]
157
+ }
158
+ }
@@ -0,0 +1,124 @@
1
+ /**
2
+ * UnIcon v1.0.0 - React/Next.js Component
3
+ * Copyright © Unifesto Private Limited
4
+ */
5
+
6
+ import React from "react";
7
+ import manifest from "../manifest.json";
8
+
9
+ /**
10
+ * Search icons by query string
11
+ * Matches against icon name, category, and tags
12
+ */
13
+ export function searchIcons(query) {
14
+ if (!query || typeof query !== "string") return [];
15
+
16
+ const lowerQuery = query.toLowerCase().trim();
17
+ const results = [];
18
+
19
+ for (const [name, data] of Object.entries(manifest)) {
20
+ // Match name
21
+ if (name.toLowerCase().includes(lowerQuery)) {
22
+ results.push(name);
23
+ continue;
24
+ }
25
+
26
+ // Match category
27
+ if (data.category && data.category.toLowerCase().includes(lowerQuery)) {
28
+ results.push(name);
29
+ continue;
30
+ }
31
+
32
+ // Match tags
33
+ if (data.tags && data.tags.some(tag => tag.toLowerCase().includes(lowerQuery))) {
34
+ results.push(name);
35
+ }
36
+ }
37
+
38
+ return results.sort();
39
+ }
40
+
41
+ /**
42
+ * Get icons by category
43
+ */
44
+ export function getIconsByCategory(category) {
45
+ if (!category) return [];
46
+
47
+ return Object.entries(manifest)
48
+ .filter(([_, data]) => data.category === category)
49
+ .map(([name]) => name)
50
+ .sort();
51
+ }
52
+
53
+ /**
54
+ * Get all available categories
55
+ */
56
+ export function getCategories() {
57
+ const categories = new Set();
58
+ Object.values(manifest).forEach(data => {
59
+ if (data.category) categories.add(data.category);
60
+ });
61
+ return Array.from(categories).sort();
62
+ }
63
+
64
+ /**
65
+ * UnIcon - Universal Icon Component for React/Next.js
66
+ *
67
+ * @example
68
+ * import { UnIcon } from "@unifesto/unicon/react";
69
+ *
70
+ * <UnIcon name="at" size={24} />
71
+ * <UnIcon name="notification" size={32} className="text-blue-500" />
72
+ */
73
+ export function UnIcon({ name, size = 24, className = "", style = {}, alt }) {
74
+ const iconData = manifest[name];
75
+
76
+ if (!iconData) {
77
+ if (process.env.NODE_ENV !== "production") {
78
+ console.warn(`UnIcon: Icon "${name}" not found in manifest`);
79
+ }
80
+ return null;
81
+ }
82
+
83
+ // Use relative path from the package
84
+ const iconPath = `/@unifesto/unicon/dist/${iconData.path}`;
85
+
86
+ return (
87
+ <img
88
+ src={iconPath}
89
+ alt={alt || `${name} icon`}
90
+ width={size}
91
+ height={size}
92
+ className={className}
93
+ style={{
94
+ width: size,
95
+ height: size,
96
+ objectFit: "contain",
97
+ display: "inline-block",
98
+ verticalAlign: "middle",
99
+ ...style,
100
+ }}
101
+ loading="lazy"
102
+ />
103
+ );
104
+ }
105
+
106
+ // Export manifest and utilities
107
+ export { default as manifest } from "../manifest.json";
108
+ export const iconNames = [
109
+ "account",
110
+ "appearance",
111
+ "apple",
112
+ "at",
113
+ "google",
114
+ "instagram",
115
+ "mail",
116
+ "notification",
117
+ "permission",
118
+ "phone",
119
+ "rate",
120
+ "signout",
121
+ "support"
122
+ ];
123
+
124
+ export default UnIcon;
@@ -0,0 +1,145 @@
1
+ /**
2
+ * UnIcon v1.0.0 - React Native/Expo Component
3
+ * Copyright © Unifesto Private Limited
4
+ */
5
+
6
+ import React from "react";
7
+ import { Image } from "react-native";
8
+ import manifest from "../manifest.json";
9
+
10
+ // Pre-require all icons for Metro bundler
11
+ const iconMap = {
12
+ "account": require("../icons/account.png"),
13
+ "appearance": require("../icons/appearance.png"),
14
+ "apple": require("../icons/apple.png"),
15
+ "at": require("../icons/at.png"),
16
+ "google": require("../icons/google.png"),
17
+ "instagram": require("../icons/instagram.png"),
18
+ "mail": require("../icons/mail.png"),
19
+ "notification": require("../icons/notification.png"),
20
+ "permission": require("../icons/permission.png"),
21
+ "phone": require("../icons/phone.png"),
22
+ "rate": require("../icons/rate.png"),
23
+ "signout": require("../icons/signout.png"),
24
+ "support": require("../icons/support.png")
25
+ };
26
+
27
+ /**
28
+ * Search icons by query string
29
+ * Matches against icon name, category, and tags
30
+ */
31
+ export function searchIcons(query) {
32
+ if (!query || typeof query !== "string") return [];
33
+
34
+ const lowerQuery = query.toLowerCase().trim();
35
+ const results = [];
36
+
37
+ for (const [name, data] of Object.entries(manifest)) {
38
+ // Match name
39
+ if (name.toLowerCase().includes(lowerQuery)) {
40
+ results.push(name);
41
+ continue;
42
+ }
43
+
44
+ // Match category
45
+ if (data.category && data.category.toLowerCase().includes(lowerQuery)) {
46
+ results.push(name);
47
+ continue;
48
+ }
49
+
50
+ // Match tags
51
+ if (data.tags && data.tags.some(tag => tag.toLowerCase().includes(lowerQuery))) {
52
+ results.push(name);
53
+ }
54
+ }
55
+
56
+ return results.sort();
57
+ }
58
+
59
+ /**
60
+ * Get icons by category
61
+ */
62
+ export function getIconsByCategory(category) {
63
+ if (!category) return [];
64
+
65
+ return Object.entries(manifest)
66
+ .filter(([_, data]) => data.category === category)
67
+ .map(([name]) => name)
68
+ .sort();
69
+ }
70
+
71
+ /**
72
+ * Get all available categories
73
+ */
74
+ export function getCategories() {
75
+ const categories = new Set();
76
+ Object.values(manifest).forEach(data => {
77
+ if (data.category) categories.add(data.category);
78
+ });
79
+ return Array.from(categories).sort();
80
+ }
81
+
82
+ /**
83
+ * UnIcon - Universal Icon Component for React Native/Expo
84
+ *
85
+ * @example
86
+ * import { UnIcon } from "@unifesto/unicon/react-native";
87
+ *
88
+ * <UnIcon name="at" size={24} />
89
+ * <UnIcon name="notification" size={32} style={{ tintColor: "#3491ff" }} />
90
+ */
91
+ export function UnIcon({ name, size = 24, style = {}, resizeMode = "contain" }) {
92
+ const iconData = manifest[name];
93
+
94
+ if (!iconData) {
95
+ if (__DEV__) {
96
+ console.warn(`UnIcon: Icon "${name}" not found in manifest`);
97
+ }
98
+ return null;
99
+ }
100
+
101
+ const iconSource = iconMap[name];
102
+
103
+ if (!iconSource) {
104
+ if (__DEV__) {
105
+ console.warn(`UnIcon: Icon source for "${name}" not found`);
106
+ }
107
+ return null;
108
+ }
109
+
110
+ return (
111
+ <Image
112
+ source={iconSource}
113
+ style={[
114
+ {
115
+ width: size,
116
+ height: size,
117
+ },
118
+ style,
119
+ ]}
120
+ resizeMode={resizeMode}
121
+ accessibilityLabel={`${name} icon`}
122
+ accessibilityRole="image"
123
+ />
124
+ );
125
+ }
126
+
127
+ // Export manifest and utilities
128
+ export { default as manifest } from "../manifest.json";
129
+ export const iconNames = [
130
+ "account",
131
+ "appearance",
132
+ "apple",
133
+ "at",
134
+ "google",
135
+ "instagram",
136
+ "mail",
137
+ "notification",
138
+ "permission",
139
+ "phone",
140
+ "rate",
141
+ "signout",
142
+ "support"
143
+ ];
144
+
145
+ export default UnIcon;
package/package.json CHANGED
@@ -1,29 +1,92 @@
1
1
  {
2
2
  "name": "@unifesto/unicon",
3
- "version": "0.1.2",
3
+ "version": "1.0.0",
4
4
  "description": "Cross-platform icon library for React, Next.js, Expo and React Native",
5
+ "author": "Unifesto Private Limited",
5
6
  "license": "UNLICENSED",
7
+ "private": false,
6
8
  "type": "module",
9
+ "main": "./dist/manifest.json",
10
+ "types": "./dist/index.d.ts",
11
+ "sideEffects": false,
7
12
  "exports": {
8
- "./react": "./dist/react/index.js",
9
- "./react-native": "./dist/react-native/index.js"
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/manifest.json"
16
+ },
17
+ "./manifest": {
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/manifest.json"
20
+ },
21
+ "./react": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/react/index.js",
24
+ "default": "./dist/react/index.js"
25
+ },
26
+ "./react-native": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/react-native/index.js",
29
+ "default": "./dist/react-native/index.js"
30
+ },
31
+ "./icons/*": "./dist/icons/*",
32
+ "./package.json": "./package.json"
10
33
  },
11
34
  "files": [
12
- "dist"
35
+ "dist",
36
+ "README.md",
37
+ "LICENSE"
13
38
  ],
14
39
  "scripts": {
15
- "build": "node scripts/build.js"
40
+ "build": "node scripts/build.js",
41
+ "clean": "rm -rf dist",
42
+ "rebuild": "npm run clean && npm run build",
43
+ "prepublishOnly": "npm run build",
44
+ "pack:test": "npm pack --dry-run",
45
+ "version": "npm run build && git add -A dist",
46
+ "postversion": "git push && git push --tags"
16
47
  },
17
48
  "keywords": [
18
49
  "icons",
50
+ "icon-library",
19
51
  "react",
52
+ "react-icons",
20
53
  "nextjs",
21
54
  "expo",
22
55
  "react-native",
23
- "unifesto"
56
+ "react-native-icons",
57
+ "unifesto",
58
+ "cross-platform",
59
+ "typescript",
60
+ "ui",
61
+ "components",
62
+ "assets",
63
+ "png"
24
64
  ],
25
- "dependencies": {
26
- "fs": "^0.0.1-security",
65
+ "peerDependencies": {
66
+ "react": ">=16.8.0"
67
+ },
68
+ "peerDependenciesMeta": {
69
+ "react": {
70
+ "optional": true
71
+ }
72
+ },
73
+ "devDependencies": {
27
74
  "sharp": "^0.34.5"
75
+ },
76
+ "repository": {
77
+ "type": "git",
78
+ "url": "https://github.com/unifesto/unicon.git"
79
+ },
80
+ "bugs": {
81
+ "url": "https://github.com/unifesto/unicon/issues"
82
+ },
83
+ "homepage": "https://github.com/unifesto/unicon#readme",
84
+ "publishConfig": {
85
+ "access": "public",
86
+ "registry": "https://registry.npmjs.org/"
87
+ },
88
+ "engines": {
89
+ "node": ">=16.0.0",
90
+ "npm": ">=8.0.0"
28
91
  }
29
92
  }
Binary file
Binary file
Binary file
package/dist/1024/at.png DELETED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/128/at.png DELETED
Binary file
Binary file
Binary file
package/dist/128/mail.png DELETED
Binary file
Binary file
Binary file
Binary file
package/dist/128/rate.png DELETED
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/24/apple.png DELETED
Binary file
package/dist/24/at.png DELETED
Binary file
Binary file
Binary file
package/dist/24/mail.png DELETED
Binary file
Binary file
Binary file
package/dist/24/phone.png DELETED
Binary file
package/dist/24/rate.png DELETED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/256/at.png DELETED
Binary file
Binary file
Binary file
package/dist/256/mail.png DELETED
Binary file
Binary file
Binary file
Binary file
package/dist/256/rate.png DELETED
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/32/apple.png DELETED
Binary file
package/dist/32/at.png DELETED
Binary file
Binary file
Binary file
package/dist/32/mail.png DELETED
Binary file
Binary file
Binary file
package/dist/32/phone.png DELETED
Binary file
package/dist/32/rate.png DELETED
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/48/apple.png DELETED
Binary file
package/dist/48/at.png DELETED
Binary file
Binary file
Binary file
package/dist/48/mail.png DELETED
Binary file
Binary file
Binary file
package/dist/48/phone.png DELETED
Binary file
package/dist/48/rate.png DELETED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/512/at.png DELETED
Binary file
Binary file
Binary file
package/dist/512/mail.png DELETED
Binary file
Binary file
Binary file
Binary file
package/dist/512/rate.png DELETED
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/64/apple.png DELETED
Binary file
package/dist/64/at.png DELETED
Binary file
Binary file
Binary file
package/dist/64/mail.png DELETED
Binary file
Binary file
Binary file
package/dist/64/phone.png DELETED
Binary file
package/dist/64/rate.png DELETED
Binary file
Binary file
Binary file