@payfit/unity-icons 2.47.4 → 2.47.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.
- package/dist/esm/components/icon/Icon.js +107 -111
- package/dist/esm/components/icon/parts/IconSprite.js +12 -9
- package/dist/esm/components/icons-provider/UnityIconsProvider.js +48 -37
- package/dist/esm/generated/index.js +4 -4
- package/dist/esm/generated/sprite.js +4 -0
- package/dist/esm/index.js +4 -10
- package/dist/esm/utils.js +19 -30
- package/package.json +6 -6
- package/dist/esm/generated/sprite.svg.js +0 -4
package/dist/esm/index.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { iconNames as e } from "./generated/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import { IconSprite as
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
6
|
-
n as Icon,
|
|
7
|
-
m as IconSprite,
|
|
8
|
-
x as UnityIconsProvider,
|
|
9
|
-
e as iconNames,
|
|
10
|
-
f as useIconsContext
|
|
11
|
-
};
|
|
2
|
+
import { UnityIconsProvider as t, useIconsContext as n } from "./components/icons-provider/UnityIconsProvider.js";
|
|
3
|
+
import { IconSprite as r } from "./components/icon/parts/IconSprite.js";
|
|
4
|
+
import { Icon as i } from "./components/icon/Icon.js";
|
|
5
|
+
export { i as Icon, r as IconSprite, t as UnityIconsProvider, e as iconNames, n as useIconsContext };
|
package/dist/esm/utils.js
CHANGED
|
@@ -1,32 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import e from "./generated/sprite.js";
|
|
2
|
+
//#region src/utils.ts
|
|
3
|
+
var t = e, n = class extends Error {
|
|
4
|
+
constructor(e) {
|
|
5
|
+
super(e), this.name = "SpriteInjectionError";
|
|
6
|
+
}
|
|
7
|
+
}, r = !1;
|
|
8
|
+
function i() {
|
|
9
|
+
if (typeof document > "u") throw new n("Cannot inject sprite in non-browser environment");
|
|
10
|
+
if (!r) try {
|
|
11
|
+
let e = document.createElement("div");
|
|
12
|
+
e.setAttribute("data-testid", "unity-sprite-container"), e.style.display = "none", e.innerHTML = t, document.body.appendChild(e), r = !0;
|
|
13
|
+
} catch (e) {
|
|
14
|
+
throw new n(`Failed to inject sprite: ${e instanceof Error ? e.message : "Unknown error"}`);
|
|
15
|
+
}
|
|
7
16
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (typeof document > "u")
|
|
11
|
-
throw new n(
|
|
12
|
-
"Cannot inject sprite in non-browser environment"
|
|
13
|
-
);
|
|
14
|
-
if (!t)
|
|
15
|
-
try {
|
|
16
|
-
const e = document.createElement("div");
|
|
17
|
-
e.setAttribute("data-testid", "unity-sprite-container"), e.style.display = "none", e.innerHTML = o, document.body.appendChild(e), t = !0;
|
|
18
|
-
} catch (e) {
|
|
19
|
-
throw new n(
|
|
20
|
-
`Failed to inject sprite: ${e instanceof Error ? e.message : "Unknown error"}`
|
|
21
|
-
);
|
|
22
|
-
}
|
|
17
|
+
function a() {
|
|
18
|
+
return typeof document < "u" && r;
|
|
23
19
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
n as SpriteInjectionError,
|
|
29
|
-
c as injectSprite,
|
|
30
|
-
d as isSpriteInDocument,
|
|
31
|
-
o as spriteContent
|
|
32
|
-
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { i as injectSprite, a as isSpriteInDocument };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/unity-icons",
|
|
3
|
-
"version": "2.47.
|
|
3
|
+
"version": "2.47.6",
|
|
4
4
|
"module": "./dist/esm/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -47,26 +47,26 @@
|
|
|
47
47
|
"@types/libsodium-wrappers": "0.7.14",
|
|
48
48
|
"@types/react": "18.3.18",
|
|
49
49
|
"@types/react-dom": "18.3.5",
|
|
50
|
-
"@vitest/browser": "4.1.
|
|
50
|
+
"@vitest/browser": "4.1.9",
|
|
51
51
|
"glob": "11.1.0",
|
|
52
52
|
"libsodium-wrappers": "0.7.15",
|
|
53
53
|
"playwright": "1.55.1",
|
|
54
54
|
"storybook": "10.4.4",
|
|
55
55
|
"tailwindcss": "4.3.0",
|
|
56
56
|
"tsx": "4.20.5",
|
|
57
|
-
"vite": "
|
|
58
|
-
"vitest": "4.1.
|
|
57
|
+
"vite": "8.0.16",
|
|
58
|
+
"vitest": "4.1.9",
|
|
59
59
|
"@payfit/figma-tools": "0.0.0-use.local",
|
|
60
60
|
"@payfit/hr-app-eslint": "0.0.0-use.local",
|
|
61
61
|
"@payfit/hr-apps-tsconfigs": "0.0.0-use.local",
|
|
62
62
|
"@payfit/storybook-config": "0.0.0-use.local",
|
|
63
|
-
"@payfit/unity-themes": "2.47.
|
|
63
|
+
"@payfit/unity-themes": "2.47.6",
|
|
64
64
|
"@payfit/vite-configs": "0.0.0-use.local"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"react": "18.3.1",
|
|
68
68
|
"react-dom": "18.3.1",
|
|
69
|
-
"@payfit/unity-themes": "2.47.
|
|
69
|
+
"@payfit/unity-themes": "2.47.6"
|
|
70
70
|
},
|
|
71
71
|
"keywords": [
|
|
72
72
|
"tanstack-intent"
|