@honeyicons/react 0.0.4 → 0.0.6

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 (163) hide show
  1. package/README.md +76 -18
  2. package/dist/catalog.js +39 -39
  3. package/dist/categories.d.ts +1 -1
  4. package/dist/categories.js +0 -2
  5. package/dist/create-icon.d.ts +4 -2
  6. package/dist/create-icon.js +12 -5
  7. package/dist/icon-base.d.ts +14 -0
  8. package/dist/icon-base.js +61 -0
  9. package/dist/icon.d.ts +13 -19
  10. package/dist/icon.js +11 -68
  11. package/dist/icons/add.js +1 -2
  12. package/dist/icons/alert-triangle.d.ts +0 -2
  13. package/dist/icons/alert-triangle.js +1 -3
  14. package/dist/icons/archive-alt.js +1 -3
  15. package/dist/icons/archive.d.ts +0 -2
  16. package/dist/icons/archive.js +1 -3
  17. package/dist/icons/arrow-down.d.ts +0 -2
  18. package/dist/icons/arrow-down.js +2 -5
  19. package/dist/icons/arrow-left.d.ts +0 -2
  20. package/dist/icons/arrow-left.js +2 -5
  21. package/dist/icons/arrow-right.d.ts +0 -2
  22. package/dist/icons/arrow-right.js +2 -5
  23. package/dist/icons/arrow-up.d.ts +0 -2
  24. package/dist/icons/arrow-up.js +2 -5
  25. package/dist/icons/bold.js +1 -2
  26. package/dist/icons/bookmarks.d.ts +0 -2
  27. package/dist/icons/bookmarks.js +2 -5
  28. package/dist/icons/brain.js +1 -2
  29. package/dist/icons/broadcast.d.ts +0 -2
  30. package/dist/icons/broadcast.js +1 -3
  31. package/dist/icons/bug.js +1 -11
  32. package/dist/icons/building.js +1 -3
  33. package/dist/icons/calendar-mark.js +1 -3
  34. package/dist/icons/calendar-x.js +1 -2
  35. package/dist/icons/calendar.d.ts +0 -2
  36. package/dist/icons/calendar.js +2 -5
  37. package/dist/icons/cart-large.js +1 -5
  38. package/dist/icons/check-double.d.ts +0 -2
  39. package/dist/icons/check-double.js +0 -2
  40. package/dist/icons/chevrons-down.d.ts +0 -2
  41. package/dist/icons/chevrons-down.js +0 -2
  42. package/dist/icons/chevrons-left.d.ts +0 -2
  43. package/dist/icons/chevrons-left.js +0 -2
  44. package/dist/icons/chevrons-right.d.ts +0 -2
  45. package/dist/icons/chevrons-right.js +0 -2
  46. package/dist/icons/chevrons-up.d.ts +0 -2
  47. package/dist/icons/chevrons-up.js +0 -2
  48. package/dist/icons/clapperboard-text.js +1 -3
  49. package/dist/icons/close.js +1 -2
  50. package/dist/icons/cloud-download.js +1 -3
  51. package/dist/icons/cloud-upload.js +1 -3
  52. package/dist/icons/computer.js +1 -2
  53. package/dist/icons/copy.js +1 -2
  54. package/dist/icons/crop.js +1 -2
  55. package/dist/icons/dislike.js +1 -2
  56. package/dist/icons/door-open.d.ts +0 -2
  57. package/dist/icons/door-open.js +1 -3
  58. package/dist/icons/download.js +1 -3
  59. package/dist/icons/edit-off.js +1 -4
  60. package/dist/icons/edit.d.ts +0 -2
  61. package/dist/icons/edit.js +1 -3
  62. package/dist/icons/eye-closed.d.ts +0 -2
  63. package/dist/icons/eye-closed.js +1 -3
  64. package/dist/icons/file-add.js +1 -3
  65. package/dist/icons/file-code.js +1 -3
  66. package/dist/icons/file-remove.js +1 -3
  67. package/dist/icons/file-text.js +1 -3
  68. package/dist/icons/file.js +1 -2
  69. package/dist/icons/folder.d.ts +0 -2
  70. package/dist/icons/folder.js +1 -3
  71. package/dist/icons/gift.js +1 -4
  72. package/dist/icons/git-branch.js +1 -5
  73. package/dist/icons/git-diff.js +1 -6
  74. package/dist/icons/git-fork.js +1 -5
  75. package/dist/icons/git-graph.js +1 -6
  76. package/dist/icons/git-pull-request.js +1 -6
  77. package/dist/icons/hand-wave.d.ts +0 -2
  78. package/dist/icons/hand-wave.js +0 -2
  79. package/dist/icons/heading.js +1 -3
  80. package/dist/icons/headphones.d.ts +0 -2
  81. package/dist/icons/headphones.js +0 -2
  82. package/dist/icons/history.js +1 -3
  83. package/dist/icons/image-add.d.ts +0 -2
  84. package/dist/icons/image-add.js +2 -6
  85. package/dist/icons/image-edit.js +1 -3
  86. package/dist/icons/image.d.ts +0 -2
  87. package/dist/icons/image.js +2 -6
  88. package/dist/icons/index.d.ts +39 -39
  89. package/dist/icons/index.js +39 -78
  90. package/dist/icons/instagram.d.ts +0 -2
  91. package/dist/icons/instagram.js +0 -2
  92. package/dist/icons/integration.js +1 -5
  93. package/dist/icons/italic.js +1 -3
  94. package/dist/icons/key.js +1 -3
  95. package/dist/icons/life-buoy.js +1 -3
  96. package/dist/icons/like.js +1 -2
  97. package/dist/icons/lock-open.d.ts +0 -2
  98. package/dist/icons/lock-open.js +2 -6
  99. package/dist/icons/lock.js +1 -3
  100. package/dist/icons/login.js +1 -3
  101. package/dist/icons/map-pin.d.ts +0 -2
  102. package/dist/icons/map-pin.js +0 -2
  103. package/dist/icons/map.js +1 -2
  104. package/dist/icons/market-analysis.js +1 -9
  105. package/dist/icons/menu.d.ts +0 -2
  106. package/dist/icons/menu.js +0 -2
  107. package/dist/icons/microphone-off.js +1 -7
  108. package/dist/icons/microphone.js +1 -3
  109. package/dist/icons/microsoft-copilot.d.ts +0 -2
  110. package/dist/icons/microsoft-copilot.js +1 -3
  111. package/dist/icons/move.js +1 -8
  112. package/dist/icons/music-note.js +1 -3
  113. package/dist/icons/package.js +1 -4
  114. package/dist/icons/redo.js +1 -2
  115. package/dist/icons/repeat.js +2 -4
  116. package/dist/icons/search.js +1 -2
  117. package/dist/icons/send.d.ts +0 -2
  118. package/dist/icons/send.js +2 -5
  119. package/dist/icons/sidebar-bottom.js +1 -2
  120. package/dist/icons/sidebar-left.js +1 -2
  121. package/dist/icons/sidebar-right.js +1 -2
  122. package/dist/icons/sidebar-top.js +1 -2
  123. package/dist/icons/sim-card.d.ts +0 -2
  124. package/dist/icons/sim-card.js +0 -2
  125. package/dist/icons/spinner-arc.d.ts +0 -2
  126. package/dist/icons/spinner-arc.js +1 -3
  127. package/dist/icons/spinner-wave.d.ts +0 -2
  128. package/dist/icons/spinner-wave.js +0 -2
  129. package/dist/icons/square-pen.d.ts +0 -2
  130. package/dist/icons/square-pen.js +0 -2
  131. package/dist/icons/stopwatch.js +1 -2
  132. package/dist/icons/strikethrough.js +1 -2
  133. package/dist/icons/supabase.js +1 -2
  134. package/dist/icons/ticket.js +1 -2
  135. package/dist/icons/transfer-horizontal.js +1 -3
  136. package/dist/icons/transfer-vertical.js +1 -3
  137. package/dist/icons/typescript.d.ts +0 -2
  138. package/dist/icons/typescript.js +0 -2
  139. package/dist/icons/undo.js +1 -2
  140. package/dist/icons/upload.js +1 -3
  141. package/dist/icons/user-check.js +1 -2
  142. package/dist/icons/user-x.js +1 -2
  143. package/dist/icons/video-camera.d.ts +0 -2
  144. package/dist/icons/video-camera.js +2 -6
  145. package/dist/icons/video-frame.js +1 -3
  146. package/dist/icons/volume-high.d.ts +0 -2
  147. package/dist/icons/volume-high.js +1 -3
  148. package/dist/icons/volume-low.d.ts +0 -2
  149. package/dist/icons/volume-low.js +0 -2
  150. package/dist/icons/volume-off.d.ts +0 -2
  151. package/dist/icons/volume-off.js +0 -2
  152. package/dist/icons/zoom-in.d.ts +0 -2
  153. package/dist/icons/zoom-in.js +1 -4
  154. package/dist/icons/zoom-out.d.ts +0 -2
  155. package/dist/icons/zoom-out.js +1 -4
  156. package/dist/index.d.ts +1 -0
  157. package/dist/registry.d.ts +654 -0
  158. package/dist/registry.js +653 -0
  159. package/dist/types.d.ts +1 -1
  160. package/dist/types.js +1 -1
  161. package/icons.json +5008 -0
  162. package/package.json +64 -64
  163. package/MIGRATION.md +0 -69
package/README.md CHANGED
@@ -6,23 +6,50 @@ Inspired by [Hugeicons](https://hugeicons.com) and
6
6
  [Solar Icons](https://github.com/480-Design/Solar-Icon-Set), with smooth curves
7
7
  and rounded corners. See [NOTICE.md](./NOTICE.md) for source attribution and licenses.
8
8
 
9
+ ## Set up with your coding agent
10
+
11
+ Give your coding agent this prompt:
12
+
13
+ ```
14
+ Set up @honeyicons/react using https://icons.0xhoney.com/setup.md
15
+ ```
16
+
17
+ Or install the package yourself:
18
+
9
19
  ```sh
10
20
  pnpm add @honeyicons/react
11
21
  ```
12
22
 
23
+ ## Usage
24
+
13
25
  ```tsx
14
- import { Bell, Search } from "@honeyicons/react";
26
+ import { Icon } from "@honeyicons/react";
15
27
 
16
28
  export function Toolbar() {
17
29
  return (
18
- <div>
19
- <Bell size={24} title="Notifications" />
20
- <Search size={16} color="currentColor" />
21
- </div>
30
+ <nav>
31
+ <Icon icon="home" />
32
+ <Icon icon="moon" variant="bold" size={20} />
33
+ <Icon icon="search" strokeWidth={1.5} color="gray" title="Search" />
34
+ </nav>
22
35
  );
23
36
  }
24
37
  ```
25
38
 
39
+ `icon` accepts the kebab-case icon names, typed as `IconName`, so editors
40
+ autocomplete them and typos fail type checking. Unknown names throw at runtime.
41
+ `variant` only accepts the variants that icon provides. `Icon` includes the full
42
+ collection in your bundle.
43
+
44
+ For fixed icons, named imports let bundlers remove unused icons:
45
+
46
+ ```tsx
47
+ import { Bell, Search } from "@honeyicons/react";
48
+
49
+ <Bell size={20} />
50
+ <Search size={16} />
51
+ ```
52
+
26
53
  Requires React 18 or later. Icons accept SVG props, `size` (default `24`),
27
54
  `color` (default `currentColor`), and `strokeWidth` (default `1.8`).
28
55
  Use `title`, `aria-label`, or `aria-labelledby` to give an icon an accessible
@@ -32,12 +59,12 @@ name. Icons without a name are decorative by default. Explicit `role` and
32
59
  For an icon-only button, put the accessible name on the button:
33
60
 
34
61
  ```tsx
35
- import { Bell } from "@honeyicons/react";
62
+ import { Icon } from "@honeyicons/react";
36
63
 
37
64
  export function NotificationsButton() {
38
65
  return (
39
66
  <button type="button" aria-label="Notifications">
40
- <Bell size={20} />
67
+ <Icon icon="bell" size={20} />
41
68
  </button>
42
69
  );
43
70
  }
@@ -48,22 +75,53 @@ or CSS lengths such as `"1em"`). Icons inherit the surrounding text color and
48
75
  forward `ref` to the SVG element. Standard SVG props, event handlers, and
49
76
  children such as `<desc>` are supported.
50
77
 
51
- Linear is the default variant. Selected icons also support other variants;
52
- check the component's `variants` property before choosing one. Stroke width
53
- affects stroked geometry; filled outlines retain their original geometry.
54
- Unsupported variants fall back to the first available variant.
78
+ Icons come in `linear` and `bold`. Each icon defaults to its first variant:
79
+ `linear`, or `bold` for icons drawn only in bold, such as most brand logos.
80
+ Passing a variant the icon does not have throws. Stroke width affects stroked
81
+ geometry; filled outlines retain their original geometry.
82
+
83
+ To type your own props, import `IconName`, `IconProps`, and `IconVariantMap`
84
+ from `@honeyicons/react`. `@honeyicons/react/icons.json` lists each icon's name,
85
+ export, category, variants, and tags, and `@honeyicons/react/catalog` exports the
86
+ same data with components for icon pickers.
87
+
88
+ To draw your own icon with the same props, pass its SVG elements to `createIcon`:
89
+
90
+ ```tsx
91
+ import { createIcon } from "@honeyicons/react";
92
+
93
+ export const Divider = createIcon("Divider", {
94
+ linear: [["path", { d: "M4 12h16", stroke: "currentColor" }]],
95
+ });
96
+ ```
97
+
98
+ ## Upgrading to 0.0.5
99
+
100
+ - The low-level `Icon iconNode={...}` API is replaced by `Icon icon="name"`.
101
+ Use `createIcon` for custom SVG nodes.
102
+ - Deprecated icon aliases have been removed. Use the canonical exports listed
103
+ in `icons.json`.
104
+ - Only `linear` and `bold` are supported. Unsupported variants throw instead of
105
+ substituting another style. Unused `secondaryColor` and `secondaryOpacity`
106
+ props have been removed.
107
+ - Shapes are now in `objects`, and spinners are in `status`.
108
+
109
+ ## Agent skill
110
+
111
+ Coding agents such as Claude Code, Codex, and Cursor can install the Honeyicons
112
+ skill. It looks up real icon names in the published icon index and covers usage
113
+ and best practices:
114
+
115
+ ```sh
116
+ npx skills add arjunkambj/honeyicons
117
+ ```
55
118
 
56
- Catalog data is available as the named `catalog` export from
57
- `@honeyicons/react/catalog`. For reusable components, import the `HoneyIcon`
58
- and `HoneyIconProps` types from `@honeyicons/react`.
119
+ ## Development
59
120
 
60
121
  The published package contains ESM JavaScript and TypeScript declarations.
61
- Named icon imports support tree shaking; importing the catalog includes the
62
- full collection.
63
122
 
64
123
  To build or package from this repository, run `pnpm run build` or `pnpm pack`
65
124
  inside `packages/react`. Packing builds the package automatically. The web app
66
125
  and shared UI resolve the source through TypeScript paths during development.
67
126
 
68
- See [NOTICE.md](./NOTICE.md) for third-party icon licenses and attribution,
69
- and [MIGRATION.md](./MIGRATION.md) for renamed exports.
127
+ See [NOTICE.md](./NOTICE.md) for third-party icon licenses and attribution.
package/dist/catalog.js CHANGED
@@ -416,7 +416,7 @@ const catalog = [
416
416
  name: "arrow-down",
417
417
  pascalName: "ArrowDown",
418
418
  category: "arrows",
419
- tags: ["arrow", "down", "direction", "navigation", "arrow-down-02", "hugeicons", "ArrowDown02"],
419
+ tags: ["arrow", "down", "direction", "navigation", "arrow-down-02", "hugeicons"],
420
420
  variants: ["linear"],
421
421
  component: ArrowDown
422
422
  },
@@ -440,7 +440,7 @@ const catalog = [
440
440
  name: "arrow-left",
441
441
  pascalName: "ArrowLeft",
442
442
  category: "arrows",
443
- tags: ["arrow", "left", "direction", "navigation", "arrow-left-02", "hugeicons", "ArrowLeft02"],
443
+ tags: ["arrow", "left", "direction", "navigation", "arrow-left-02", "hugeicons"],
444
444
  variants: ["linear"],
445
445
  component: ArrowLeft
446
446
  },
@@ -448,7 +448,7 @@ const catalog = [
448
448
  name: "arrow-right",
449
449
  pascalName: "ArrowRight",
450
450
  category: "arrows",
451
- tags: ["arrow", "right", "direction", "navigation", "arrow-right-02", "hugeicons", "ArrowRight02"],
451
+ tags: ["arrow", "right", "direction", "navigation", "arrow-right-02", "hugeicons"],
452
452
  variants: ["linear"],
453
453
  component: ArrowRight
454
454
  },
@@ -456,7 +456,7 @@ const catalog = [
456
456
  name: "arrow-up",
457
457
  pascalName: "ArrowUp",
458
458
  category: "arrows",
459
- tags: ["arrow", "up", "direction", "navigation", "arrow-up-02", "hugeicons", "ArrowUp02"],
459
+ tags: ["arrow", "up", "direction", "navigation", "arrow-up-02", "hugeicons"],
460
460
  variants: ["linear"],
461
461
  component: ArrowUp
462
462
  },
@@ -616,7 +616,7 @@ const catalog = [
616
616
  name: "calendar",
617
617
  pascalName: "Calendar",
618
618
  category: "time",
619
- tags: ["calendar", "date", "schedule", "event", "month", "hugeicons", "calendar-03", "Calendar03"],
619
+ tags: ["calendar", "date", "schedule", "event", "month", "hugeicons", "calendar-03"],
620
620
  variants: ["linear"],
621
621
  component: Calendar
622
622
  },
@@ -736,7 +736,7 @@ const catalog = [
736
736
  name: "check-double",
737
737
  pascalName: "CheckDouble",
738
738
  category: "status",
739
- tags: ["double-check", "tick", "done", "read", "receipt", "delivered", "hugeicons", "check-check", "CheckCheck"],
739
+ tags: ["double-check", "tick", "done", "read", "receipt", "delivered", "hugeicons", "check-check"],
740
740
  variants: ["linear"],
741
741
  component: CheckDouble
742
742
  },
@@ -744,7 +744,7 @@ const catalog = [
744
744
  name: "chevron-down",
745
745
  pascalName: "ChevronDown",
746
746
  category: "arrows",
747
- tags: ["chevron", "down", "bottom", "expand", "arrow-down-01", "hugeicons", "arrow-down", "ArrowDown"],
747
+ tags: ["chevron", "down", "bottom", "expand", "arrow-down-01", "hugeicons", "arrow-down"],
748
748
  variants: ["linear"],
749
749
  component: ChevronDown
750
750
  },
@@ -752,7 +752,7 @@ const catalog = [
752
752
  name: "chevron-left",
753
753
  pascalName: "ChevronLeft",
754
754
  category: "arrows",
755
- tags: ["chevron", "left", "back", "previous", "arrow-left-01", "hugeicons", "arrow-left", "ArrowLeft"],
755
+ tags: ["chevron", "left", "back", "previous", "arrow-left-01", "hugeicons", "arrow-left"],
756
756
  variants: ["linear"],
757
757
  component: ChevronLeft
758
758
  },
@@ -760,7 +760,7 @@ const catalog = [
760
760
  name: "chevron-right",
761
761
  pascalName: "ChevronRight",
762
762
  category: "arrows",
763
- tags: ["chevron", "right", "forward", "next", "arrow-right-01", "hugeicons", "arrow-right", "ArrowRight"],
763
+ tags: ["chevron", "right", "forward", "next", "arrow-right-01", "hugeicons", "arrow-right"],
764
764
  variants: ["linear"],
765
765
  component: ChevronRight
766
766
  },
@@ -768,7 +768,7 @@ const catalog = [
768
768
  name: "chevron-up",
769
769
  pascalName: "ChevronUp",
770
770
  category: "arrows",
771
- tags: ["chevron", "up", "top", "collapse", "arrow-up-01", "hugeicons", "arrow-up", "ArrowUp"],
771
+ tags: ["chevron", "up", "top", "collapse", "arrow-up-01", "hugeicons", "arrow-up"],
772
772
  variants: ["linear"],
773
773
  component: ChevronUp
774
774
  },
@@ -776,7 +776,7 @@ const catalog = [
776
776
  name: "chevrons-down",
777
777
  pascalName: "ChevronsDown",
778
778
  category: "arrows",
779
- tags: ["chevron", "double", "down", "bottom", "hugeicons", "arrow-down-double", "ArrowDownDouble"],
779
+ tags: ["chevron", "double", "down", "bottom", "hugeicons", "arrow-down-double"],
780
780
  variants: ["linear"],
781
781
  component: ChevronsDown
782
782
  },
@@ -784,7 +784,7 @@ const catalog = [
784
784
  name: "chevrons-left",
785
785
  pascalName: "ChevronsLeft",
786
786
  category: "arrows",
787
- tags: ["chevron", "double", "left", "first", "hugeicons", "arrow-left-double", "ArrowLeftDouble"],
787
+ tags: ["chevron", "double", "left", "first", "hugeicons", "arrow-left-double"],
788
788
  variants: ["linear"],
789
789
  component: ChevronsLeft
790
790
  },
@@ -792,7 +792,7 @@ const catalog = [
792
792
  name: "chevrons-right",
793
793
  pascalName: "ChevronsRight",
794
794
  category: "arrows",
795
- tags: ["chevron", "double", "right", "last", "hugeicons", "arrow-right-double", "ArrowRightDouble"],
795
+ tags: ["chevron", "double", "right", "last", "hugeicons", "arrow-right-double"],
796
796
  variants: ["linear"],
797
797
  component: ChevronsRight
798
798
  },
@@ -800,7 +800,7 @@ const catalog = [
800
800
  name: "chevrons-up",
801
801
  pascalName: "ChevronsUp",
802
802
  category: "arrows",
803
- tags: ["chevron", "double", "up", "top", "hugeicons", "arrow-up-double", "ArrowUpDouble"],
803
+ tags: ["chevron", "double", "up", "top", "hugeicons", "arrow-up-double"],
804
804
  variants: ["linear"],
805
805
  component: ChevronsUp
806
806
  },
@@ -1007,7 +1007,7 @@ const catalog = [
1007
1007
  {
1008
1008
  name: "diamond",
1009
1009
  pascalName: "Diamond",
1010
- category: "shapes",
1010
+ category: "objects",
1011
1011
  tags: ["diamond", "shape", "geometry", "rhombus", "hugeicons"],
1012
1012
  variants: ["linear"],
1013
1013
  component: Diamond
@@ -1056,7 +1056,7 @@ const catalog = [
1056
1056
  name: "edit",
1057
1057
  pascalName: "Edit",
1058
1058
  category: "editor",
1059
- tags: ["edit", "pencil", "write", "draw", "hugeicons", "edit-01", "Edit01"],
1059
+ tags: ["edit", "pencil", "write", "draw", "hugeicons", "edit-01"],
1060
1060
  variants: ["linear"],
1061
1061
  component: Edit
1062
1062
  },
@@ -1192,7 +1192,7 @@ const catalog = [
1192
1192
  name: "folder",
1193
1193
  pascalName: "Folder",
1194
1194
  category: "files",
1195
- tags: ["folder", "directory", "files", "storage", "folder-01", "Folder01", "solar"],
1195
+ tags: ["folder", "directory", "files", "storage", "folder-01", "solar"],
1196
1196
  variants: ["linear"],
1197
1197
  component: Folder
1198
1198
  },
@@ -1432,7 +1432,7 @@ const catalog = [
1432
1432
  name: "home",
1433
1433
  pascalName: "Home",
1434
1434
  category: "maps",
1435
- tags: [],
1435
+ tags: ["house", "homepage", "dashboard", "start"],
1436
1436
  variants: ["linear"],
1437
1437
  component: Home
1438
1438
  },
@@ -1456,7 +1456,7 @@ const catalog = [
1456
1456
  name: "image-add",
1457
1457
  pascalName: "ImageAdd",
1458
1458
  category: "media",
1459
- tags: ["image", "gallery", "upload", "photo", "plus", "gallery-add", "solar", "images-add", "ImagesAdd"],
1459
+ tags: ["image", "gallery", "upload", "photo", "plus", "gallery-add", "solar", "images-add"],
1460
1460
  variants: ["linear"],
1461
1461
  component: ImageAdd
1462
1462
  },
@@ -1704,7 +1704,7 @@ const catalog = [
1704
1704
  name: "lock-open",
1705
1705
  pascalName: "LockOpen",
1706
1706
  category: "security",
1707
- tags: ["lock-open", "unlock", "security", "access", "solar", "lock-unlock", "LockUnlock"],
1707
+ tags: ["lock-open", "unlock", "security", "access", "solar", "lock-unlock"],
1708
1708
  variants: ["linear"],
1709
1709
  component: LockOpen
1710
1710
  },
@@ -1832,7 +1832,7 @@ const catalog = [
1832
1832
  name: "microsoft-copilot",
1833
1833
  pascalName: "MicrosoftCopilot",
1834
1834
  category: "brands",
1835
- tags: ["microsoft", "copilot", "ai", "assistant", "brand", "ms-copilot", "MsCopilot"],
1835
+ tags: ["microsoft", "copilot", "ai", "assistant", "brand", "ms-copilot"],
1836
1836
  variants: ["bold"],
1837
1837
  component: MicrosoftCopilot
1838
1838
  },
@@ -2183,7 +2183,7 @@ const catalog = [
2183
2183
  {
2184
2184
  name: "rhombus",
2185
2185
  pascalName: "Rhombus",
2186
- category: "shapes",
2186
+ category: "objects",
2187
2187
  tags: ["rhombus", "shape", "geometry", "diamond", "hugeicons"],
2188
2188
  variants: ["linear"],
2189
2189
  component: Rhombus
@@ -2208,7 +2208,7 @@ const catalog = [
2208
2208
  name: "search",
2209
2209
  pascalName: "Search",
2210
2210
  category: "actions",
2211
- tags: [],
2211
+ tags: ["find", "magnifier", "lookup", "zoom"],
2212
2212
  variants: ["linear"],
2213
2213
  component: Search
2214
2214
  },
@@ -2360,7 +2360,7 @@ const catalog = [
2360
2360
  name: "snapchat",
2361
2361
  pascalName: "Snapchat",
2362
2362
  category: "brands",
2363
- tags: [],
2363
+ tags: ["brand", "social", "snap", "ghost"],
2364
2364
  variants: ["linear", "bold"],
2365
2365
  component: Snapchat
2366
2366
  },
@@ -2383,7 +2383,7 @@ const catalog = [
2383
2383
  {
2384
2384
  name: "spinner",
2385
2385
  pascalName: "Spinner",
2386
- category: "spinner",
2386
+ category: "status",
2387
2387
  tags: ["loader", "loading", "progress", "wait", "busy", "rotate"],
2388
2388
  variants: ["linear"],
2389
2389
  component: Spinner
@@ -2391,15 +2391,15 @@ const catalog = [
2391
2391
  {
2392
2392
  name: "spinner-arc",
2393
2393
  pascalName: "SpinnerArc",
2394
- category: "spinner",
2395
- tags: ["loader", "loading", "progress", "wait", "rotate", "arc", "long", "spinner-large", "SpinnerLarge"],
2394
+ category: "status",
2395
+ tags: ["loader", "loading", "progress", "wait", "rotate", "arc", "long", "spinner-large"],
2396
2396
  variants: ["linear"],
2397
2397
  component: SpinnerArc
2398
2398
  },
2399
2399
  {
2400
2400
  name: "spinner-diagonal",
2401
2401
  pascalName: "SpinnerDiagonal",
2402
- category: "spinner",
2402
+ category: "status",
2403
2403
  tags: ["loader", "loading", "progress", "wait", "grid", "pixel", "diagonal", "wave"],
2404
2404
  variants: ["linear"],
2405
2405
  component: SpinnerDiagonal
@@ -2407,7 +2407,7 @@ const catalog = [
2407
2407
  {
2408
2408
  name: "spinner-orbit",
2409
2409
  pascalName: "SpinnerOrbit",
2410
- category: "spinner",
2410
+ category: "status",
2411
2411
  tags: ["loader", "loading", "progress", "wait", "grid", "pixel", "comet"],
2412
2412
  variants: ["linear"],
2413
2413
  component: SpinnerOrbit
@@ -2415,8 +2415,8 @@ const catalog = [
2415
2415
  {
2416
2416
  name: "spinner-wave",
2417
2417
  pascalName: "SpinnerWave",
2418
- category: "spinner",
2419
- tags: ["loader", "loading", "progress", "wait", "grid", "pixel", "chevron", "wave", "spinner-tinker", "SpinnerTinker"],
2418
+ category: "status",
2419
+ tags: ["loader", "loading", "progress", "wait", "grid", "pixel", "chevron", "wave", "spinner-tinker"],
2420
2420
  variants: ["linear"],
2421
2421
  component: SpinnerWave
2422
2422
  },
@@ -2424,7 +2424,7 @@ const catalog = [
2424
2424
  name: "square-pen",
2425
2425
  pascalName: "SquarePen",
2426
2426
  category: "actions",
2427
- tags: ["send-message", "SendMessage", "compose", "edit", "write", "pencil"],
2427
+ tags: ["send-message", "compose", "edit", "write", "pencil"],
2428
2428
  variants: ["linear"],
2429
2429
  component: SquarePen
2430
2430
  },
@@ -2591,7 +2591,7 @@ const catalog = [
2591
2591
  {
2592
2592
  name: "three-squares",
2593
2593
  pascalName: "ThreeSquares",
2594
- category: "shapes",
2594
+ category: "objects",
2595
2595
  tags: ["three-squares", "squares", "stack", "layers", "solar"],
2596
2596
  variants: ["linear"],
2597
2597
  component: ThreeSquares
@@ -2640,7 +2640,7 @@ const catalog = [
2640
2640
  name: "trash",
2641
2641
  pascalName: "Trash",
2642
2642
  category: "actions",
2643
- tags: [],
2643
+ tags: ["delete", "remove", "bin", "discard"],
2644
2644
  variants: ["linear"],
2645
2645
  component: Trash
2646
2646
  },
@@ -2784,7 +2784,7 @@ const catalog = [
2784
2784
  name: "volume-high",
2785
2785
  pascalName: "VolumeHigh",
2786
2786
  category: "media",
2787
- tags: ["volume", "sound", "speaker", "audio", "unmute", "solar", "volume-loud", "VolumeLoud"],
2787
+ tags: ["volume", "sound", "speaker", "audio", "unmute", "solar", "volume-loud"],
2788
2788
  variants: ["linear"],
2789
2789
  component: VolumeHigh
2790
2790
  },
@@ -2815,7 +2815,7 @@ const catalog = [
2815
2815
  {
2816
2816
  name: "waves",
2817
2817
  pascalName: "Waves",
2818
- category: "shapes",
2818
+ category: "objects",
2819
2819
  tags: ["waves", "water", "sea", "ocean"],
2820
2820
  variants: ["linear"],
2821
2821
  component: Waves
@@ -2872,7 +2872,7 @@ const catalog = [
2872
2872
  name: "x",
2873
2873
  pascalName: "X",
2874
2874
  category: "brands",
2875
- tags: [],
2875
+ tags: ["brand", "social", "twitter"],
2876
2876
  variants: ["linear"],
2877
2877
  component: X
2878
2878
  },
@@ -2904,7 +2904,7 @@ const catalog = [
2904
2904
  name: "zoom-in",
2905
2905
  pascalName: "ZoomIn",
2906
2906
  category: "actions",
2907
- tags: ["magnifier", "magnifier-zoom-in", "zoom-in", "search", "enlarge", "plus", "solar", "search-plus", "SearchPlus"],
2907
+ tags: ["magnifier", "magnifier-zoom-in", "zoom-in", "search", "enlarge", "plus", "solar", "search-plus"],
2908
2908
  variants: ["linear"],
2909
2909
  component: ZoomIn
2910
2910
  },
@@ -2912,7 +2912,7 @@ const catalog = [
2912
2912
  name: "zoom-out",
2913
2913
  pascalName: "ZoomOut",
2914
2914
  category: "actions",
2915
- tags: ["magnifier", "minimalistic-magnifier-zoom-out", "zoom-out", "search", "shrink", "minus", "solar", "search-minus", "SearchMinus"],
2915
+ tags: ["magnifier", "minimalistic-magnifier-zoom-out", "zoom-out", "search", "shrink", "minus", "solar", "search-minus"],
2916
2916
  variants: ["linear"],
2917
2917
  component: ZoomOut
2918
2918
  }
@@ -1,2 +1,2 @@
1
- export declare const ICON_CATEGORIES: readonly ["actions", "ai", "arrows", "brands", "charts", "chat", "commerce", "development", "devices", "editor", "files", "layout", "maps", "media", "objects", "security", "settings", "shapes", "spinner", "status", "time", "user"];
1
+ export declare const ICON_CATEGORIES: readonly ["actions", "ai", "arrows", "brands", "charts", "chat", "commerce", "development", "devices", "editor", "files", "layout", "maps", "media", "objects", "security", "settings", "status", "time", "user"];
2
2
  export type IconCategory = (typeof ICON_CATEGORIES)[number];
@@ -16,8 +16,6 @@ const ICON_CATEGORIES = [
16
16
  "objects",
17
17
  "security",
18
18
  "settings",
19
- "shapes",
20
- "spinner",
21
19
  "status",
22
20
  "time",
23
21
  "user"
@@ -1,7 +1,9 @@
1
1
  import { type ForwardRefExoticComponent, type RefAttributes } from "react";
2
- import { type IconProps } from "./icon.js";
2
+ import { type IconBaseProps } from "./icon-base.js";
3
3
  import { type IconNodeMap, type IconVariant } from "./types.js";
4
- export type HoneyIconProps = Omit<IconProps, "iconNode">;
4
+ export type HoneyIconProps = Omit<IconBaseProps, "iconNode"> & {
5
+ variant?: IconVariant;
6
+ };
5
7
  export type HoneyIcon = ForwardRefExoticComponent<HoneyIconProps & RefAttributes<SVGSVGElement>> & {
6
8
  variants: readonly IconVariant[];
7
9
  };
@@ -2,17 +2,24 @@ import { jsx } from "react/jsx-runtime";
2
2
  import {
3
3
  forwardRef
4
4
  } from "react";
5
- import { Icon } from "./icon.js";
5
+ import { IconBase } from "./icon-base.js";
6
6
  import { ICON_VARIANTS } from "./types.js";
7
7
  function createIcon(name, nodes) {
8
8
  const variants = ICON_VARIANTS.filter((variant) => nodes[variant]);
9
+ const [defaultVariant] = variants;
10
+ if (!defaultVariant) {
11
+ throw new Error(`${name} has no icon data`);
12
+ }
9
13
  const Component = forwardRef(
10
- function HoneyIcon({ variant = "linear", ...props }, ref) {
11
- const iconNode = nodes[variant] ?? nodes[variants[0] ?? "linear"];
14
+ function HoneyIcon({ variant = defaultVariant, ...props }, ref) {
15
+ if (!Object.hasOwn(nodes, variant)) {
16
+ throw new Error(`${name} has no ${variant} variant`);
17
+ }
18
+ const iconNode = nodes[variant];
12
19
  if (!iconNode) {
13
- throw new Error(`Missing icon data for ${name}`);
20
+ throw new Error(`${name} has no ${variant} variant`);
14
21
  }
15
- return /* @__PURE__ */ jsx(Icon, { ref, iconNode, variant, ...props });
22
+ return /* @__PURE__ */ jsx(IconBase, { ref, iconNode, ...props });
16
23
  }
17
24
  );
18
25
  Component.displayName = name;
@@ -0,0 +1,14 @@
1
+ import { type SVGProps } from "react";
2
+ import type { IconNode } from "./types.js";
3
+ export type IconBaseProps = Omit<SVGProps<SVGSVGElement>, "ref" | "strokeWidth" | "width" | "height"> & {
4
+ iconNode: IconNode;
5
+ size?: number | string;
6
+ strokeWidth?: number;
7
+ title?: string;
8
+ };
9
+ export declare const IconBase: import("react").ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement>, "height" | "ref" | "strokeWidth" | "width"> & {
10
+ iconNode: IconNode;
11
+ size?: number | string;
12
+ strokeWidth?: number;
13
+ title?: string;
14
+ } & import("react").RefAttributes<SVGSVGElement>>;
@@ -0,0 +1,61 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { createElement, forwardRef } from "react";
3
+ function paintsStroke(attrs) {
4
+ const stroke = attrs.stroke;
5
+ return Boolean(stroke && stroke !== "none");
6
+ }
7
+ function paintsFill(attrs) {
8
+ const fill = attrs.fill;
9
+ return Boolean(fill && fill !== "none");
10
+ }
11
+ const IconBase = forwardRef(
12
+ function IconBase2({
13
+ iconNode,
14
+ size = 24,
15
+ color = "currentColor",
16
+ strokeWidth = 1.8,
17
+ title,
18
+ className,
19
+ style,
20
+ children,
21
+ ...props
22
+ }, ref) {
23
+ const hasStroke = iconNode.some(([, attrs]) => paintsStroke(attrs));
24
+ const hasAccessibleName = Boolean(
25
+ title || props["aria-label"] || props["aria-labelledby"]
26
+ );
27
+ return /* @__PURE__ */ jsxs(
28
+ "svg",
29
+ {
30
+ ref,
31
+ xmlns: "http://www.w3.org/2000/svg",
32
+ width: size,
33
+ height: size,
34
+ viewBox: "0 0 24 24",
35
+ fill: "none",
36
+ stroke: hasStroke ? "currentColor" : void 0,
37
+ strokeWidth: hasStroke ? strokeWidth : void 0,
38
+ strokeLinecap: hasStroke ? "round" : void 0,
39
+ strokeLinejoin: hasStroke ? "round" : void 0,
40
+ color,
41
+ className,
42
+ style,
43
+ role: hasAccessibleName ? "img" : "presentation",
44
+ "aria-hidden": hasAccessibleName ? void 0 : true,
45
+ "aria-label": title,
46
+ ...props,
47
+ children: [
48
+ title ? /* @__PURE__ */ jsx("title", { children: title }) : null,
49
+ iconNode.map(([tag, attrs], index) => {
50
+ const mapped = hasStroke && paintsFill(attrs) && !paintsStroke(attrs) ? { ...attrs, stroke: "none" } : attrs;
51
+ return createElement(tag, { ...mapped, key: index });
52
+ }),
53
+ children
54
+ ]
55
+ }
56
+ );
57
+ }
58
+ );
59
+ export {
60
+ IconBase
61
+ };
package/dist/icon.d.ts CHANGED
@@ -1,20 +1,14 @@
1
- import { type SVGProps } from "react";
2
- import type { IconNode, IconVariant } from "./types.js";
3
- export type IconProps = Omit<SVGProps<SVGSVGElement>, "ref" | "strokeWidth" | "width" | "height"> & {
4
- iconNode: IconNode;
5
- variant?: IconVariant;
6
- size?: number | string;
7
- strokeWidth?: number;
8
- secondaryColor?: string;
9
- secondaryOpacity?: number;
10
- title?: string;
1
+ import { type ReactElement, type RefAttributes } from "react";
2
+ import type { HoneyIconProps } from "./create-icon.js";
3
+ import { type IconName, type IconVariantMap } from "./registry.js";
4
+ export type IconProps<Name extends IconName = IconName> = Omit<HoneyIconProps, "variant"> & {
5
+ [Key in Name]: {
6
+ icon: Key;
7
+ variant?: IconVariantMap[Key];
8
+ };
9
+ }[Name];
10
+ type IconComponent = (<Name extends IconName>(props: IconProps<Name> & RefAttributes<SVGSVGElement>) => ReactElement) & {
11
+ displayName?: string;
11
12
  };
12
- export declare const Icon: import("react").ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement>, "height" | "ref" | "strokeWidth" | "width"> & {
13
- iconNode: IconNode;
14
- variant?: IconVariant;
15
- size?: number | string;
16
- strokeWidth?: number;
17
- secondaryColor?: string;
18
- secondaryOpacity?: number;
19
- title?: string;
20
- } & import("react").RefAttributes<SVGSVGElement>>;
13
+ export declare const Icon: IconComponent;
14
+ export {};