@xyo-network/react-chain-blockies 2.0.18 → 3.0.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.
@@ -1,12 +1,8 @@
1
- import React from 'react';
2
- import type { BlockiesOptions } from './blockies.ts';
3
1
  /**
4
- * @deprecated Use {@link BlockiesAccountProps} from `@xyo-network/xl1-blockies` instead.
2
+ * @deprecated Moved to `@xyo-network/xl1-blockies`. Import from there instead.
3
+ * This re-export exists only for backward compatibility and will be removed
4
+ * in a future release.
5
5
  */
6
- export interface BlockiesAccountProps extends Partial<BlockiesOptions> {
7
- }
8
- /**
9
- * @deprecated Use {@link BlockiesAccount} from `@xyo-network/xl1-blockies` instead.
10
- */
11
- export declare const BlockiesAccount: React.FC<BlockiesAccountProps>;
6
+ export type { BlockiesAccountProps } from '@xyo-network/xl1-blockies';
7
+ export { BlockiesAccount } from '@xyo-network/xl1-blockies';
12
8
  //# sourceMappingURL=Account.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../../../src/components/blockies/Account.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,eAAe,CAAC;CAAG;AAEzE;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAQ1D,CAAA"}
1
+ {"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../../../src/components/blockies/Account.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA"}
@@ -1,41 +1,8 @@
1
- import type { AvatarProps, BadgeProps } from '@mui/material';
2
- import React from 'react';
3
- import type { BlockiesOptions } from './blockies.ts';
4
1
  /**
5
- * @deprecated Use {@link BlockiesAvatarProps} from `@xyo-network/xl1-blockies` instead.
2
+ * @deprecated Moved to `@xyo-network/xl1-blockies`. Import from there instead.
3
+ * This re-export exists only for backward compatibility and will be removed
4
+ * in a future release.
6
5
  */
7
- export interface BlockiesAvatarProps extends AvatarProps {
8
- blockiesOptions?: Partial<BlockiesOptions>;
9
- }
10
- /**
11
- * @deprecated Use {@link BlockiesAvatar} from `@xyo-network/xl1-blockies` instead.
12
- */
13
- export declare const BlockiesAvatar: React.FC<BlockiesAvatarProps>;
14
- /**
15
- * @deprecated Use {@link BlockiesAvatarAddressProps} from `@xyo-network/xl1-blockies` instead.
16
- */
17
- export interface BlockiesAvatarAddressProps extends AvatarProps {
18
- /** The Address to display */
19
- address?: string;
20
- /** Size of the border is the size prop * borderSizeFactor and rounded up */
21
- borderSizeFactor?: number;
22
- /** The size of the avatar in pixels, defaults to 24 */
23
- size?: number;
24
- }
25
- /**
26
- * @deprecated Use {@link BlockiesAvatarAddress} from `@xyo-network/xl1-blockies` instead.
27
- */
28
- export declare const BlockiesAvatarAddress: React.FC<BlockiesAvatarAddressProps>;
29
- /**
30
- * @deprecated Use {@link BlockiesAvatarAddressApprovedProps} from `@xyo-network/xl1-blockies` instead.
31
- */
32
- export interface BlockiesAvatarAddressApprovedProps extends BlockiesAvatarAddressProps {
33
- /** Whether to show the approved badge */
34
- approved?: boolean;
35
- badgeVariant?: BadgeProps['variant'];
36
- }
37
- /**
38
- * @deprecated Use {@link BlockiesAvatarAddressApproved} from `@xyo-network/xl1-blockies` instead.
39
- */
40
- export declare const BlockiesAvatarAddressApproved: React.FC<BlockiesAvatarAddressApprovedProps>;
6
+ export type { BlockiesAvatarAddressApprovedProps, BlockiesAvatarAddressProps, BlockiesAvatarProps, } from '@xyo-network/xl1-blockies';
7
+ export { BlockiesAvatar, BlockiesAvatarAddress } from '@xyo-network/xl1-blockies';
41
8
  //# sourceMappingURL=Avatar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/blockies/Avatar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM5D,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAC3C;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAUxD,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,0BAA2B,SAAQ,WAAW;IAC7D,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAsBtE,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,kCAAmC,SAAQ,0BAA0B;IACpF,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;CACrC;AAED;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAE,KAAK,CAAC,EAAE,CAAC,kCAAkC,CAyBtF,CAAA"}
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/blockies/Avatar.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,kCAAkC,EAClC,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA"}
@@ -1,27 +1,8 @@
1
1
  /**
2
- * inspired by https://github.com/download13/blockies/blob/master/src/blockies.mjs
2
+ * @deprecated Moved to `@xyo-network/xl1-blockies`. Import from there instead.
3
+ * This re-export exists only for backward compatibility and will be removed
4
+ * in a future release.
3
5
  */
4
- /**
5
- * @deprecated Use {@link BlockiesOptions} from `@xyo-network/xl1-blockies` instead.
6
- */
7
- export interface BlockiesOptions {
8
- bgcolor: string;
9
- color: string;
10
- scale: number;
11
- seed: string;
12
- size: number;
13
- spotcolor: string;
14
- }
15
- /**
16
- * @deprecated Use {@link buildOpts} from `@xyo-network/xl1-blockies` instead.
17
- */
18
- export declare function buildOpts(opts: Partial<BlockiesOptions>): BlockiesOptions;
19
- /**
20
- * @deprecated Use {@link renderIcon} from `@xyo-network/xl1-blockies` instead.
21
- */
22
- export declare function renderIcon(opts: Partial<BlockiesOptions>, canvas: HTMLCanvasElement): HTMLCanvasElement;
23
- /**
24
- * @deprecated Use {@link createIcon} from `@xyo-network/xl1-blockies` instead.
25
- */
26
- export declare function createIcon(opts: Partial<BlockiesOptions>): HTMLCanvasElement;
6
+ export type { BlockiesOptions } from '@xyo-network/xl1-blockies';
7
+ export { buildOpts, createIcon, renderIcon, } from '@xyo-network/xl1-blockies';
27
8
  //# sourceMappingURL=blockies.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"blockies.d.ts","sourceRoot":"","sources":["../../../../src/components/blockies/blockies.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiEH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAczE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,iBAAiB,qBA2BnF;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,qBAMxD"}
1
+ {"version":3,"file":"blockies.d.ts","sourceRoot":"","sources":["../../../../src/components/blockies/blockies.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EACL,SAAS,EAAE,UAAU,EAAE,UAAU,GAClC,MAAM,2BAA2B,CAAA"}
@@ -1,177 +1,19 @@
1
1
  // src/components/blockies/Account.tsx
2
- import { useMemo } from "react";
3
-
4
- // src/components/blockies/blockies.ts
5
- var randomSeed = Array.from({ length: 4 });
6
- function seedRandom(seed) {
7
- for (let i = 0; i < randomSeed.length; i++) {
8
- randomSeed[i] = 0;
9
- }
10
- for (let i = 0; i < seed.length; i++) {
11
- randomSeed[i % 4] = (randomSeed[i % 4] << 5) - randomSeed[i % 4] + seed.codePointAt(i);
12
- }
13
- }
14
- function rand() {
15
- const t = randomSeed[0] ^ randomSeed[0] << 11;
16
- randomSeed[0] = randomSeed[1];
17
- randomSeed[1] = randomSeed[2];
18
- randomSeed[2] = randomSeed[3];
19
- randomSeed[3] = randomSeed[3] ^ randomSeed[3] >> 19 ^ t ^ t >> 8;
20
- return (randomSeed[3] >>> 0) / (1 << 31 >>> 0);
21
- }
22
- function createColor() {
23
- const h = Math.floor(rand() * 360);
24
- const s = rand() * 60 + 40 + "%";
25
- const l = (rand() + rand() + rand() + rand()) * 25 + "%";
26
- return "hsl(" + h + "," + s + "," + l + ")";
27
- }
28
- function createImageData(size) {
29
- const width = size;
30
- const height = size;
31
- const dataWidth = Math.ceil(width / 2);
32
- const mirrorWidth = width - dataWidth;
33
- const data = [];
34
- for (let y = 0; y < height; y++) {
35
- let row = [];
36
- for (let x = 0; x < dataWidth; x++) {
37
- row[x] = Math.floor(rand() * 2.3);
38
- }
39
- const r = row.slice(0, mirrorWidth);
40
- r.reverse();
41
- row = [...row, ...r];
42
- for (const element of row) {
43
- data.push(element);
44
- }
45
- }
46
- return data;
47
- }
48
- function buildOpts(opts) {
49
- const newOpts = {};
50
- newOpts.seed = opts.seed ?? Math.floor(Math.random() * Math.pow(10, 16)).toString(16);
51
- seedRandom(newOpts.seed);
52
- newOpts.size = opts.size ?? 8;
53
- newOpts.scale = opts.scale ?? 4;
54
- newOpts.color = opts.color ?? createColor();
55
- newOpts.bgcolor = opts.bgcolor ?? createColor();
56
- newOpts.spotcolor = opts.spotcolor ?? createColor();
57
- return newOpts;
58
- }
59
- function renderIcon(opts, canvas) {
60
- const updatedOptions = buildOpts(opts ?? {});
61
- const imageData = createImageData(updatedOptions.size);
62
- const width = Math.sqrt(imageData.length);
63
- canvas.width = canvas.height = updatedOptions.size * updatedOptions.scale;
64
- const cc = canvas.getContext("2d");
65
- if (cc === null) throw new Error("unable to get 2d context");
66
- cc.fillStyle = updatedOptions.bgcolor;
67
- cc.fillRect(0, 0, canvas.width, canvas.height);
68
- cc.fillStyle = updatedOptions.color;
69
- for (const [i, imageDatum] of imageData.entries()) {
70
- if (imageDatum > 0) {
71
- const row = Math.floor(i / width);
72
- const col = i % width;
73
- cc.fillStyle = imageDatum == 1 ? updatedOptions.color : updatedOptions.spotcolor;
74
- cc.fillRect(col * updatedOptions.scale, row * updatedOptions.scale, updatedOptions.scale, updatedOptions.scale);
75
- }
76
- }
77
- return canvas;
78
- }
79
- function createIcon(opts) {
80
- const canvas = document.createElement("canvas");
81
- renderIcon(opts, canvas);
82
- return canvas;
83
- }
84
-
85
- // src/components/blockies/Account.tsx
86
- import { jsx } from "react/jsx-runtime";
87
- var BlockiesAccount = ({ ...options }) => {
88
- const img = useMemo(() => {
89
- if (options.seed !== void 0) {
90
- return createIcon(options).toDataURL();
91
- }
92
- }, [options]);
93
- return /* @__PURE__ */ jsx("img", { src: img });
94
- };
2
+ import { BlockiesAccount } from "@xyo-network/xl1-blockies";
95
3
 
96
4
  // src/components/blockies/Avatar.tsx
97
- import { Circle } from "@mui/icons-material";
5
+ import { BlockiesAvatar, BlockiesAvatarAddress } from "@xyo-network/xl1-blockies";
6
+
7
+ // src/components/blockies/blockies.ts
98
8
  import {
99
- Avatar,
100
- Badge,
101
- useTheme
102
- } from "@mui/material";
103
- import { grey } from "@mui/material/colors";
104
- import { alphaCss } from "@xylabs/react-theme";
105
- import { useMemo as useMemo2 } from "react";
106
- import { jsx as jsx2 } from "react/jsx-runtime";
107
- var BlockiesAvatar = ({ blockiesOptions, ...props }) => {
108
- const img = useMemo2(() => {
109
- if (blockiesOptions?.seed !== void 0) {
110
- return createIcon(blockiesOptions).toDataURL();
111
- }
112
- }, [blockiesOptions]);
113
- return /* @__PURE__ */ jsx2(Avatar, { component: "span", src: img, ...props });
114
- };
115
- var BlockiesAvatarAddress = ({
116
- address,
117
- borderSizeFactor = 0.0833,
118
- size = 24,
119
- sx,
120
- ...props
121
- }) => {
122
- const theme = useTheme();
123
- const options = useMemo2(() => {
124
- if (address !== void 0) {
125
- return { seed: address };
126
- }
127
- }, [address]);
128
- return /* @__PURE__ */ jsx2(
129
- BlockiesAvatar,
130
- {
131
- blockiesOptions: options,
132
- sx: {
133
- width: size,
134
- height: size,
135
- border: `${Math.ceil(size * borderSizeFactor)}px solid ${alphaCss(theme.vars?.palette.text.primary ?? grey[500], 0.8)}`,
136
- ...sx
137
- },
138
- ...props
139
- }
140
- );
141
- };
142
- var BlockiesAvatarAddressApproved = ({
143
- approved,
144
- badgeVariant,
145
- ...props
146
- }) => {
147
- const sx = badgeVariant === "dot" ? {} : {
148
- bgcolor: "white",
149
- borderRadius: 12,
150
- fontSize: "0.83333rem"
151
- };
152
- const dotPlacement = badgeVariant === "dot" ? 3 : 5;
153
- return /* @__PURE__ */ jsx2(
154
- Badge,
155
- {
156
- color: badgeVariant === "dot" ? "success" : "default",
157
- variant: badgeVariant,
158
- invisible: !approved,
159
- badgeContent: approved ? /* @__PURE__ */ jsx2(Circle, { color: "success", sx }) : "",
160
- sx: {
161
- "& .MuiBadge-badge": {
162
- top: dotPlacement,
163
- right: dotPlacement
164
- }
165
- },
166
- children: /* @__PURE__ */ jsx2(BlockiesAvatarAddress, { ...props })
167
- }
168
- );
169
- };
9
+ buildOpts,
10
+ createIcon,
11
+ renderIcon
12
+ } from "@xyo-network/xl1-blockies";
170
13
  export {
171
14
  BlockiesAccount,
172
15
  BlockiesAvatar,
173
16
  BlockiesAvatarAddress,
174
- BlockiesAvatarAddressApproved,
175
17
  buildOpts,
176
18
  createIcon,
177
19
  renderIcon
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/components/blockies/Account.tsx", "../../src/components/blockies/blockies.ts", "../../src/components/blockies/Avatar.tsx"],
4
- "sourcesContent": ["import React, { useMemo } from 'react'\n\nimport type { BlockiesOptions } from './blockies.ts'\nimport { createIcon } from './blockies.ts'\n\n/**\n * @deprecated Use {@link BlockiesAccountProps} from `@xyo-network/xl1-blockies` instead.\n */\nexport interface BlockiesAccountProps extends Partial<BlockiesOptions> {}\n\n/**\n * @deprecated Use {@link BlockiesAccount} from `@xyo-network/xl1-blockies` instead.\n */\nexport const BlockiesAccount: React.FC<BlockiesAccountProps> = ({ ...options }) => {\n const img = useMemo(() => {\n if (options.seed !== undefined) {\n return createIcon(options).toDataURL()\n }\n }, [options])\n\n return <img src={img} />\n}\n", "/**\n * inspired by https://github.com/download13/blockies/blob/master/src/blockies.mjs\n */\n\n// The random number is a js implementation of the Xorshift PRNG\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst randomSeed: any[] = Array.from({ length: 4 }) // Xorshift: [x, y, z, w] 32 bit values\n\nfunction seedRandom(seed: string) {\n for (let i = 0; i < randomSeed.length; i++) {\n randomSeed[i] = 0\n }\n for (let i = 0; i < seed.length; i++) {\n randomSeed[i % 4] = ((randomSeed[i % 4] << 5) - randomSeed[i % 4]) + seed.codePointAt(i)!\n }\n}\n\nfunction rand() {\n // based on Java's String.hashCode(), expanded to 4 32bit values\n const t = randomSeed[0] ^ (randomSeed[0] << 11)\n\n randomSeed[0] = randomSeed[1]\n randomSeed[1] = randomSeed[2]\n randomSeed[2] = randomSeed[3]\n randomSeed[3] = (randomSeed[3] ^ (randomSeed[3] >> 19) ^ t ^ (t >> 8))\n\n return (randomSeed[3] >>> 0) / ((1 << 31) >>> 0)\n}\n\nfunction createColor() {\n // saturation is the whole color spectrum\n const h = Math.floor(rand() * 360)\n // saturation goes from 40 to 100, it avoids greyish colors\n const s = ((rand() * 60) + 40) + '%'\n // lightness can be anything from 0 to 100, but probabilities are a bell curve around 50%\n const l = ((rand() + rand() + rand() + rand()) * 25) + '%'\n\n return 'hsl(' + h + ',' + s + ',' + l + ')'\n}\n\nfunction createImageData(size: number) {\n const width = size // Only support square icons for now\n const height = size\n\n const dataWidth = Math.ceil(width / 2)\n const mirrorWidth = width - dataWidth\n\n const data = []\n for (let y = 0; y < height; y++) {\n let row = []\n for (let x = 0; x < dataWidth; x++) {\n // this makes foreground and background color to have a 43% (1/2.3) probability\n // spot color has 13% chance\n row[x] = Math.floor(rand() * 2.3)\n }\n const r = row.slice(0, mirrorWidth)\n r.reverse()\n row = [...row, ...r]\n\n for (const element of row) {\n data.push(element)\n }\n }\n\n return data\n}\n\n/**\n * @deprecated Use {@link BlockiesOptions} from `@xyo-network/xl1-blockies` instead.\n */\nexport interface BlockiesOptions {\n bgcolor: string\n color: string\n scale: number\n seed: string\n size: number\n spotcolor: string\n}\n\n/**\n * @deprecated Use {@link buildOpts} from `@xyo-network/xl1-blockies` instead.\n */\nexport function buildOpts(opts: Partial<BlockiesOptions>): BlockiesOptions {\n const newOpts = {} as BlockiesOptions\n\n newOpts.seed = opts.seed ?? Math.floor((Math.random() * Math.pow(10, 16))).toString(16)\n\n seedRandom(newOpts.seed)\n\n newOpts.size = opts.size ?? 8\n newOpts.scale = opts.scale ?? 4\n newOpts.color = opts.color ?? createColor()\n newOpts.bgcolor = opts.bgcolor ?? createColor()\n newOpts.spotcolor = opts.spotcolor ?? createColor()\n\n return newOpts\n}\n\n/**\n * @deprecated Use {@link renderIcon} from `@xyo-network/xl1-blockies` instead.\n */\nexport function renderIcon(opts: Partial<BlockiesOptions>, canvas: HTMLCanvasElement) {\n const updatedOptions = buildOpts(opts ?? {})\n const imageData = createImageData(updatedOptions.size)\n const width = Math.sqrt(imageData.length)\n\n canvas.width = canvas.height = updatedOptions.size * updatedOptions.scale\n\n const cc = canvas.getContext('2d')\n if (cc === null) throw new Error('unable to get 2d context')\n cc.fillStyle = updatedOptions.bgcolor\n cc.fillRect(0, 0, canvas.width, canvas.height)\n cc.fillStyle = updatedOptions.color\n\n for (const [i, imageDatum] of imageData.entries()) {\n // if data is 0, leave the background\n if (imageDatum > 0) {\n const row = Math.floor(i / width)\n const col = i % width\n\n // if data is 2, choose spot color, if 1 choose foreground\n cc.fillStyle = (imageDatum == 1) ? updatedOptions.color : updatedOptions.spotcolor\n\n cc.fillRect(col * updatedOptions.scale, row * updatedOptions.scale, updatedOptions.scale, updatedOptions.scale)\n }\n }\n\n return canvas\n}\n\n/**\n * @deprecated Use {@link createIcon} from `@xyo-network/xl1-blockies` instead.\n */\nexport function createIcon(opts: Partial<BlockiesOptions>) {\n const canvas = document.createElement('canvas')\n\n renderIcon(opts, canvas)\n\n return canvas\n}\n", "import { Circle } from '@mui/icons-material'\nimport type { AvatarProps, BadgeProps } from '@mui/material'\nimport {\n Avatar, Badge, useTheme,\n} from '@mui/material'\nimport { grey } from '@mui/material/colors'\nimport { alphaCss } from '@xylabs/react-theme'\nimport React, { useMemo } from 'react'\n\nimport type { BlockiesOptions } from './blockies.ts'\nimport { createIcon } from './blockies.ts'\n\n/**\n * @deprecated Use {@link BlockiesAvatarProps} from `@xyo-network/xl1-blockies` instead.\n */\nexport interface BlockiesAvatarProps extends AvatarProps {\n blockiesOptions?: Partial<BlockiesOptions>\n}\n\n/**\n * @deprecated Use {@link BlockiesAvatar} from `@xyo-network/xl1-blockies` instead.\n */\nexport const BlockiesAvatar: React.FC<BlockiesAvatarProps> = ({ blockiesOptions, ...props }) => {\n const img = useMemo(() => {\n if (blockiesOptions?.seed !== undefined) {\n return createIcon(blockiesOptions).toDataURL()\n }\n }, [blockiesOptions])\n\n return (\n <Avatar component=\"span\" src={img} {...props} />\n )\n}\n\n/**\n * @deprecated Use {@link BlockiesAvatarAddressProps} from `@xyo-network/xl1-blockies` instead.\n */\nexport interface BlockiesAvatarAddressProps extends AvatarProps {\n /** The Address to display */\n address?: string\n /** Size of the border is the size prop * borderSizeFactor and rounded up */\n borderSizeFactor?: number\n /** The size of the avatar in pixels, defaults to 24 */\n size?: number\n}\n\n/**\n * @deprecated Use {@link BlockiesAvatarAddress} from `@xyo-network/xl1-blockies` instead.\n */\nexport const BlockiesAvatarAddress: React.FC<BlockiesAvatarAddressProps> = ({\n address, borderSizeFactor = 0.0833, size = 24, sx, ...props\n}) => {\n const theme = useTheme()\n const options = useMemo(() => {\n if (address !== undefined) {\n return { seed: address }\n }\n }, [address])\n\n return (\n <BlockiesAvatar\n blockiesOptions={options}\n sx={{\n width: size,\n height: size,\n border: `${Math.ceil(size * borderSizeFactor)}px solid ${alphaCss(theme.vars?.palette.text.primary ?? grey[500], 0.8)}`,\n ...sx,\n }}\n {...props}\n />\n )\n}\n\n/**\n * @deprecated Use {@link BlockiesAvatarAddressApprovedProps} from `@xyo-network/xl1-blockies` instead.\n */\nexport interface BlockiesAvatarAddressApprovedProps extends BlockiesAvatarAddressProps {\n /** Whether to show the approved badge */\n approved?: boolean\n badgeVariant?: BadgeProps['variant']\n}\n\n/**\n * @deprecated Use {@link BlockiesAvatarAddressApproved} from `@xyo-network/xl1-blockies` instead.\n */\nexport const BlockiesAvatarAddressApproved: React.FC<BlockiesAvatarAddressApprovedProps> = ({\n approved, badgeVariant, ...props\n}) => {\n const sx = badgeVariant === 'dot'\n ? {}\n : {\n bgcolor: 'white', borderRadius: 12, fontSize: '0.83333rem',\n }\n const dotPlacement = badgeVariant === 'dot' ? 3 : 5\n return (\n <Badge\n color={badgeVariant === 'dot' ? 'success' : 'default'}\n variant={badgeVariant}\n invisible={!approved}\n badgeContent={approved ? <Circle color=\"success\" sx={sx} /> : ''}\n sx={{\n '& .MuiBadge-badge': {\n top: dotPlacement,\n right: dotPlacement,\n },\n }}\n >\n <BlockiesAvatarAddress {...props} />\n </Badge>\n )\n}\n"],
5
- "mappings": ";AAAA,SAAgB,eAAe;;;ACM/B,IAAM,aAAoB,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC;AAElD,SAAS,WAAW,MAAc;AAChC,WAAS,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;AAC1C,eAAW,CAAC,IAAI;AAAA,EAClB;AACA,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,eAAW,IAAI,CAAC,KAAM,WAAW,IAAI,CAAC,KAAK,KAAK,WAAW,IAAI,CAAC,IAAK,KAAK,YAAY,CAAC;AAAA,EACzF;AACF;AAEA,SAAS,OAAO;AAEd,QAAM,IAAI,WAAW,CAAC,IAAK,WAAW,CAAC,KAAK;AAE5C,aAAW,CAAC,IAAI,WAAW,CAAC;AAC5B,aAAW,CAAC,IAAI,WAAW,CAAC;AAC5B,aAAW,CAAC,IAAI,WAAW,CAAC;AAC5B,aAAW,CAAC,IAAK,WAAW,CAAC,IAAK,WAAW,CAAC,KAAK,KAAM,IAAK,KAAK;AAEnE,UAAQ,WAAW,CAAC,MAAM,MAAO,KAAK,OAAQ;AAChD;AAEA,SAAS,cAAc;AAErB,QAAM,IAAI,KAAK,MAAM,KAAK,IAAI,GAAG;AAEjC,QAAM,IAAM,KAAK,IAAI,KAAM,KAAM;AAEjC,QAAM,KAAM,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,KAAK,KAAM;AAE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useMemo"]
3
+ "sources": ["../../src/components/blockies/Account.tsx", "../../src/components/blockies/Avatar.tsx", "../../src/components/blockies/blockies.ts"],
4
+ "sourcesContent": ["/**\n * @deprecated Moved to `@xyo-network/xl1-blockies`. Import from there instead.\n * This re-export exists only for backward compatibility and will be removed\n * in a future release.\n */\n\nexport type { BlockiesAccountProps } from '@xyo-network/xl1-blockies'\nexport { BlockiesAccount } from '@xyo-network/xl1-blockies'\n", "/**\n * @deprecated Moved to `@xyo-network/xl1-blockies`. Import from there instead.\n * This re-export exists only for backward compatibility and will be removed\n * in a future release.\n */\n\nexport type {\n BlockiesAvatarAddressApprovedProps,\n BlockiesAvatarAddressProps,\n BlockiesAvatarProps,\n} from '@xyo-network/xl1-blockies'\nexport { BlockiesAvatar, BlockiesAvatarAddress } from '@xyo-network/xl1-blockies'\n", "/**\n * @deprecated Moved to `@xyo-network/xl1-blockies`. Import from there instead.\n * This re-export exists only for backward compatibility and will be removed\n * in a future release.\n */\n\nexport type { BlockiesOptions } from '@xyo-network/xl1-blockies'\nexport {\n buildOpts, createIcon, renderIcon,\n} from '@xyo-network/xl1-blockies'\n"],
5
+ "mappings": ";AAOA,SAAS,uBAAuB;;;ACIhC,SAAS,gBAAgB,6BAA6B;;;ACJtD;AAAA,EACE;AAAA,EAAW;AAAA,EAAY;AAAA,OAClB;",
6
+ "names": []
7
7
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/package.json",
3
3
  "name": "@xyo-network/react-chain-blockies",
4
- "version": "2.0.18",
4
+ "version": "3.0.1",
5
5
  "description": "XYO Layer One React SDK Blockies",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -44,22 +44,34 @@
44
44
  "@opentelemetry/api": "^1.9.1",
45
45
  "@opentelemetry/sdk-trace-base": "^2.8.0",
46
46
  "@react-spring/web": "~10.1.1",
47
- "@storybook/react-vite": "^10.4.4",
47
+ "@storybook/react-vite": "^10.4.6",
48
48
  "@types/react": "^19.2.17",
49
- "@xylabs/react-theme": "^9.1.0",
50
- "@xylabs/sdk-js": "^6.1.1",
51
- "@xylabs/toolchain": "~8.1.20",
52
- "@xylabs/tsconfig": "~8.1.20",
53
- "@xylabs/tsconfig-dom": "~8.1.20",
54
- "@xylabs/tsconfig-react": "~8.1.20",
49
+ "@xylabs/eth-address": "^6.1.3",
50
+ "@xylabs/pixel": "^6.1.3",
51
+ "@xylabs/sdk-js": "^6.1.3",
52
+ "@xylabs/sdk-react": "^9.1.2",
53
+ "@xylabs/toolchain": "~8.3.0",
54
+ "@xylabs/tsconfig": "~8.3.0",
55
+ "@xylabs/tsconfig-dom": "~8.3.0",
56
+ "@xylabs/tsconfig-react": "~8.3.0",
57
+ "@xyo-network/xl1-blockies": "~3.0.6",
55
58
  "async-mutex": "^0.5.0",
59
+ "clsx": "^2.1.1",
56
60
  "eslint": "^10.5.0",
61
+ "ethers": "^6.17.0",
62
+ "lru-cache": "^11.5.1",
63
+ "md5": "^2.3.0",
64
+ "numeral": "^2.0.6",
65
+ "query-string": "^9.4.0",
57
66
  "react": "^19.2.7",
58
67
  "react-dom": "^19.2.7",
59
- "storybook": "^10.4.4",
68
+ "react-router-dom": "^7.18.0",
69
+ "storybook": "^10.4.6",
60
70
  "typescript": "~6.0.3",
71
+ "viem": "^2.53.1",
61
72
  "vite": "^8.0.16",
62
- "zod": "~4.4.3"
73
+ "zod": "~4.4.3",
74
+ "zustand": "^5.0.14"
63
75
  },
64
76
  "peerDependencies": {
65
77
  "@mui/icons-material": "^9.1",
@@ -67,12 +79,24 @@
67
79
  "@opentelemetry/api": "^1.9",
68
80
  "@opentelemetry/sdk-trace-base": "^2.7",
69
81
  "@react-spring/web": "~10.1",
70
- "@xylabs/react-theme": "^9.1",
82
+ "@xylabs/eth-address": "^6.1.0",
83
+ "@xylabs/pixel": "^6.0",
71
84
  "@xylabs/sdk-js": "^6.0",
85
+ "@xylabs/sdk-react": "^9.1",
86
+ "@xyo-network/xl1-blockies": "^3.0",
72
87
  "async-mutex": "^0.5",
88
+ "clsx": "^2.1",
89
+ "ethers": "^6.16",
90
+ "lru-cache": "^11.3",
91
+ "md5": "^2.3",
92
+ "numeral": "^2.0",
93
+ "query-string": "^9.3",
73
94
  "react": "^19.2",
74
95
  "react-dom": "^19.2",
75
- "zod": "~4.4"
96
+ "react-router-dom": "^7.15",
97
+ "viem": "^2.48",
98
+ "zod": "~4.4",
99
+ "zustand": "^5.0"
76
100
  },
77
101
  "engines": {
78
102
  "node": ">=24"