@squidlab/phosphor-solid 1.1.0 → 1.1.1
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/README.md +7 -4
- package/package.json +2 -2
- package/src/lib/mod.tsx +22 -0
- package/src/mod.tsx +0 -18
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ bun add @squidlab/phosphor-solid
|
|
|
26
26
|
## Quick start
|
|
27
27
|
|
|
28
28
|
```tsx
|
|
29
|
-
import { HouseIcon } from "@squidlab/phosphor-solid";
|
|
29
|
+
import { HouseIcon } from "@squidlab/phosphor-solid/house";
|
|
30
30
|
|
|
31
31
|
function App() {
|
|
32
32
|
return <HouseIcon weight="bold" class="w-6 h-6 text-white" />;
|
|
@@ -56,7 +56,9 @@ type IconWeight = "thin" | "light" | "regular" | "bold" | "fill" | "duotone";
|
|
|
56
56
|
Use `IconProvider` to set default props for all descendant icons, avoiding repetition:
|
|
57
57
|
|
|
58
58
|
```tsx
|
|
59
|
-
import { IconProvider
|
|
59
|
+
import { IconProvider } from "@squidlab/phosphor-solid";
|
|
60
|
+
import { HouseIcon } from "@squidlab/phosphor-solid/house";
|
|
61
|
+
import { GearIcon } from "@squidlab/phosphor-solid/gear";
|
|
60
62
|
|
|
61
63
|
function App() {
|
|
62
64
|
return (
|
|
@@ -83,20 +85,21 @@ Props passed directly to an icon take precedence over context values.
|
|
|
83
85
|
Each icon is exposed as its own entry point for the best possible tree-shaking:
|
|
84
86
|
|
|
85
87
|
```ts
|
|
88
|
+
import { IconProvider } from "@squidlab/phosphor-solid";
|
|
86
89
|
import { ArrowRightIcon } from "@squidlab/phosphor-solid/arrow-right";
|
|
87
90
|
import { GithubLogoIcon } from "@squidlab/phosphor-solid/github-logo";
|
|
88
91
|
```
|
|
89
92
|
|
|
90
93
|
### Barrel import
|
|
91
94
|
|
|
92
|
-
Import
|
|
95
|
+
Import all icons at once via the `/icons` subpath. This will include every icon in your bundle, so use it only when you genuinely need the full set:
|
|
93
96
|
|
|
94
97
|
```ts
|
|
95
98
|
import {
|
|
96
99
|
ArrowRightIcon,
|
|
97
100
|
GithubLogoIcon,
|
|
98
101
|
HouseIcon,
|
|
99
|
-
} from "@squidlab/phosphor-solid";
|
|
102
|
+
} from "@squidlab/phosphor-solid/icons";
|
|
100
103
|
```
|
|
101
104
|
|
|
102
105
|
### Namespace import
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squidlab/phosphor-solid",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Phosphor is a flexible icon family for SolidJS, featuring 1,500+ icons across six weights: thin, light, regular, bold, fill, and duotone.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
|
-
".": "./src/mod.tsx",
|
|
8
|
+
".": "./src/lib/mod.tsx",
|
|
9
9
|
"./icons": "./src/icons/mod.tsx",
|
|
10
10
|
"./acorn": "./src/icons/Acorn.tsx",
|
|
11
11
|
"./address-book": "./src/icons/AddressBook.tsx",
|
package/src/lib/mod.tsx
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core utilities for Phosphor Icons in SolidJS.
|
|
3
|
+
*
|
|
4
|
+
* Provides the {@linkcode IconProvider} context provider and shared types.
|
|
5
|
+
* Import individual icons from their dedicated subpaths (e.g.
|
|
6
|
+
* `@squidlab/phosphor-solid/arrow-right`) for optimal tree-shaking.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { IconProvider } from "@squidlab/phosphor-solid";
|
|
12
|
+
* import { ArrowRightIcon } from "@squidlab/phosphor-solid/arrow-right";
|
|
13
|
+
*
|
|
14
|
+
* <IconProvider weight="bold" size={24}>
|
|
15
|
+
* <ArrowRightIcon />
|
|
16
|
+
* </IconProvider>;
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export { IconProvider } from "./IconProvider.tsx";
|
|
21
|
+
export { IconContext, type IconContextValue } from "./context.ts";
|
|
22
|
+
export type { IconProps, IconWeight } from "./types.ts";
|
package/src/mod.tsx
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Phosphor Icons for SolidJS.
|
|
3
|
-
*
|
|
4
|
-
* A flexible icon family for the SolidJS ecosystem. Import individual icons
|
|
5
|
-
* for optimal tree-shaking, or use the `./icons` entrypoint to access all icons.
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
* @example
|
|
9
|
-
* ```tsx
|
|
10
|
-
* import { ArrowRightIcon } from "@squidlab/phosphor-solid";
|
|
11
|
-
*
|
|
12
|
-
* <ArrowRightIcon weight="bold" size={24} />;
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
export * from "./icons/mod.tsx";
|
|
17
|
-
export { IconProvider } from "./lib/IconProvider.tsx";
|
|
18
|
-
export type { IconProps, IconWeight } from "./lib/types.ts";
|