@web-portfolio/icons-sanity 1.0.2 → 3.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jatin Rao
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -19,6 +19,19 @@ to see exactly what your editors will be choosing from.
19
19
 
20
20
  ## Recent changes
21
21
 
22
+ **v2.0.0 — ESM-only, built with `@sanity/plugin-kit`**
23
+ - The build now uses [`@sanity/plugin-kit`](https://github.com/sanity-io/plugins/tree/main/packages/@sanity/plugin-kit)
24
+ and [`@sanity/pkg-utils`](https://github.com/sanity-io/pkg-utils) instead
25
+ of a hand-rolled `tsup` config — the same toolchain Sanity's own plugin
26
+ ecosystem uses.
27
+ - **Breaking:** the package is now ESM-only. The `require()`/CJS entry point
28
+ (`main`, `module` fields, and the `require` export condition) has been
29
+ removed — Sanity Studio v3+ is pure ESM, so this plugin was never actually
30
+ loaded via `require()` in practice. If you import this package with
31
+ `require()` directly (outside a Studio config), switch to `import`.
32
+ - No other behavior changed: same `sanityIconPicker()` export, same `iconRef`
33
+ schema type, same peer dependencies.
34
+
22
35
  **97% smaller package**
23
36
  - This plugin no longer bundles its own copy of the 633-icon SVG registry.
24
37
  It now renders icon previews through `@web-portfolio/icons`'s `<Icon>`
package/dist/index.d.ts CHANGED
@@ -1,12 +1,8 @@
1
- import * as sanity from 'sanity';
2
- import { StringInputProps } from 'sanity';
3
- import * as react from 'react';
4
-
1
+ import { StringInputProps } from "sanity";
5
2
  declare const iconRef: {
6
- type: "string";
7
- name: "iconRef";
8
- } & Omit<sanity.StringDefinition, "preview">;
9
-
3
+ type: "string";
4
+ name: "iconRef";
5
+ } & Omit<import("sanity").StringDefinition, "preview">;
10
6
  /**
11
7
  * The shape of one metadata entry, redeclared here rather than re-exported
12
8
  * from icons-core. icons-core is private and unpublished, so any reference to
@@ -21,9 +17,9 @@ declare const iconRef: {
21
17
  * needs to bundle it.
22
18
  */
23
19
  interface IconEntry {
24
- label: string;
25
- tags: string[];
26
- category: string | null;
20
+ label: string;
21
+ tags: string[];
22
+ category: string | null;
27
23
  }
28
24
  declare function matchesQuery(name: string, entry: IconEntry, query: string): boolean;
29
25
  /**
@@ -33,8 +29,6 @@ declare function matchesQuery(name: string, entry: IconEntry, query: string): bo
33
29
  */
34
30
  declare function rankMatch(name: string, entry: IconEntry, query: string): number;
35
31
  declare function formatCategoryLabel(category: string): string;
36
- declare function IconPickerInput(props: StringInputProps): react.JSX.Element;
37
-
38
- declare const sanityIconPicker: sanity.Plugin<void>;
39
-
40
- export { type IconEntry, IconPickerInput, formatCategoryLabel, iconRef, matchesQuery, rankMatch, sanityIconPicker };
32
+ declare function IconPickerInput(props: StringInputProps): import("react").JSX.Element;
33
+ declare const sanityIconPicker: import("sanity").Plugin<void>;
34
+ export { type IconEntry, IconPickerInput, formatCategoryLabel, iconRef, matchesQuery, rankMatch, sanityIconPicker };