@metamask-previews/design-system-shared 0.45.0-preview.12867efa → 0.45.1-preview-473aecb

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/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.45.1]
11
+
12
+ ### Fixed
13
+
14
+ - Fixed the `MusdFilled` icon artwork to use the Phosphor `currency-circle-dollar` fill, so its dollar sign matches `Musd` ([#1677](https://github.com/MetaMask/metamask-design-system/pull/1677))
15
+ - The vertical stroke sits above and below the S, not through it
16
+ - `IconName.MusdFilled` is unchanged
17
+
10
18
  ## [0.45.0]
11
19
 
12
20
  ### Added
@@ -437,7 +445,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
437
445
  - **Initial release** - MetaMask Design System Shared
438
446
  - Adding CAIP-10 address utilities ([#817](https://github.com/MetaMask/metamask-design-system/pull/817))
439
447
 
440
- [Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-shared@0.45.0...HEAD
448
+ [Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-shared@0.45.1...HEAD
449
+ [0.45.1]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-shared@0.45.0...@metamask/design-system-shared@0.45.1
441
450
  [0.45.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-shared@0.44.0...@metamask/design-system-shared@0.45.0
442
451
  [0.44.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-shared@0.43.0...@metamask/design-system-shared@0.44.0
443
452
  [0.43.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-shared@0.42.0...@metamask/design-system-shared@0.43.0
@@ -1 +1 @@
1
- {"version":3,"file":"BoxColumn.types.cjs","sourceRoot":"","sources":["../../../src/types/BoxColumn/BoxColumn.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { TextOrChildrenPropsShared } from '../TextOrChildren';\n\n/**\n * BoxColumn component shared props (ADR-0004)\n * Platform-independent properties shared across React and React Native.\n */\nexport type BoxColumnPropsShared = TextOrChildrenPropsShared & {\n /**\n * Optional node rendered above the text/children.\n */\n topAccessory?: ReactNode;\n /**\n * Optional node rendered below the text/children.\n */\n bottomAccessory?: ReactNode;\n};\n"]}
1
+ {"version":3,"file":"BoxColumn.types.cjs","sourceRoot":"","sources":["../../../src/types/BoxColumn/BoxColumn.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { TextOrChildrenPropsShared } from '../TextOrChildren';\n\n/**\n * BoxColumn component shared props (ADR-0004)\n * Platform-independent properties shared across React and React Native.\n *\n * @deprecated `BoxColumn` is deprecated in favor of `Box`. This type will be removed in a future major version.\n */\nexport type BoxColumnPropsShared = TextOrChildrenPropsShared & {\n /**\n * Optional node rendered above the text/children.\n */\n topAccessory?: ReactNode;\n /**\n * Optional node rendered below the text/children.\n */\n bottomAccessory?: ReactNode;\n};\n"]}
@@ -3,6 +3,8 @@ import type { TextOrChildrenPropsShared } from "../TextOrChildren/index.cjs";
3
3
  /**
4
4
  * BoxColumn component shared props (ADR-0004)
5
5
  * Platform-independent properties shared across React and React Native.
6
+ *
7
+ * @deprecated `BoxColumn` is deprecated in favor of `Box`. This type will be removed in a future major version.
6
8
  */
7
9
  export type BoxColumnPropsShared = TextOrChildrenPropsShared & {
8
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"BoxColumn.types.d.cts","sourceRoot":"","sources":["../../../src/types/BoxColumn/BoxColumn.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AAEvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,oCAA0B;AAEnE;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAAG;IAC7D;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,CAAC"}
1
+ {"version":3,"file":"BoxColumn.types.d.cts","sourceRoot":"","sources":["../../../src/types/BoxColumn/BoxColumn.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AAEvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,oCAA0B;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAAG;IAC7D;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,CAAC"}
@@ -3,6 +3,8 @@ import type { TextOrChildrenPropsShared } from "../TextOrChildren/index.mjs";
3
3
  /**
4
4
  * BoxColumn component shared props (ADR-0004)
5
5
  * Platform-independent properties shared across React and React Native.
6
+ *
7
+ * @deprecated `BoxColumn` is deprecated in favor of `Box`. This type will be removed in a future major version.
6
8
  */
7
9
  export type BoxColumnPropsShared = TextOrChildrenPropsShared & {
8
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"BoxColumn.types.d.mts","sourceRoot":"","sources":["../../../src/types/BoxColumn/BoxColumn.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AAEvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,oCAA0B;AAEnE;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAAG;IAC7D;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,CAAC"}
1
+ {"version":3,"file":"BoxColumn.types.d.mts","sourceRoot":"","sources":["../../../src/types/BoxColumn/BoxColumn.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AAEvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,oCAA0B;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAAG;IAC7D;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BoxColumn.types.mjs","sourceRoot":"","sources":["../../../src/types/BoxColumn/BoxColumn.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { TextOrChildrenPropsShared } from '../TextOrChildren';\n\n/**\n * BoxColumn component shared props (ADR-0004)\n * Platform-independent properties shared across React and React Native.\n */\nexport type BoxColumnPropsShared = TextOrChildrenPropsShared & {\n /**\n * Optional node rendered above the text/children.\n */\n topAccessory?: ReactNode;\n /**\n * Optional node rendered below the text/children.\n */\n bottomAccessory?: ReactNode;\n};\n"]}
1
+ {"version":3,"file":"BoxColumn.types.mjs","sourceRoot":"","sources":["../../../src/types/BoxColumn/BoxColumn.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { TextOrChildrenPropsShared } from '../TextOrChildren';\n\n/**\n * BoxColumn component shared props (ADR-0004)\n * Platform-independent properties shared across React and React Native.\n *\n * @deprecated `BoxColumn` is deprecated in favor of `Box`. This type will be removed in a future major version.\n */\nexport type BoxColumnPropsShared = TextOrChildrenPropsShared & {\n /**\n * Optional node rendered above the text/children.\n */\n topAccessory?: ReactNode;\n /**\n * Optional node rendered below the text/children.\n */\n bottomAccessory?: ReactNode;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BoxRow.types.cjs","sourceRoot":"","sources":["../../../src/types/BoxRow/BoxRow.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { TextOrChildrenPropsShared } from '../TextOrChildren';\n\n/**\n * BoxRow component shared props (ADR-0004)\n * Platform-independent properties shared across React and React Native.\n */\nexport type BoxRowPropsShared = TextOrChildrenPropsShared & {\n /**\n * Optional node rendered before the text/children (e.g. icon, avatar).\n */\n startAccessory?: ReactNode;\n /**\n * Optional node rendered after the text/children (e.g. icon, badge).\n */\n endAccessory?: ReactNode;\n};\n"]}
1
+ {"version":3,"file":"BoxRow.types.cjs","sourceRoot":"","sources":["../../../src/types/BoxRow/BoxRow.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { TextOrChildrenPropsShared } from '../TextOrChildren';\n\n/**\n * BoxRow component shared props (ADR-0004)\n * Platform-independent properties shared across React and React Native.\n *\n * @deprecated `BoxRow` is deprecated in favor of `Box`. This type will be removed in a future major version.\n */\nexport type BoxRowPropsShared = TextOrChildrenPropsShared & {\n /**\n * Optional node rendered before the text/children (e.g. icon, avatar).\n */\n startAccessory?: ReactNode;\n /**\n * Optional node rendered after the text/children (e.g. icon, badge).\n */\n endAccessory?: ReactNode;\n};\n"]}
@@ -3,6 +3,8 @@ import type { TextOrChildrenPropsShared } from "../TextOrChildren/index.cjs";
3
3
  /**
4
4
  * BoxRow component shared props (ADR-0004)
5
5
  * Platform-independent properties shared across React and React Native.
6
+ *
7
+ * @deprecated `BoxRow` is deprecated in favor of `Box`. This type will be removed in a future major version.
6
8
  */
7
9
  export type BoxRowPropsShared = TextOrChildrenPropsShared & {
8
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"BoxRow.types.d.cts","sourceRoot":"","sources":["../../../src/types/BoxRow/BoxRow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AAEvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,oCAA0B;AAEnE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,yBAAyB,GAAG;IAC1D;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC"}
1
+ {"version":3,"file":"BoxRow.types.d.cts","sourceRoot":"","sources":["../../../src/types/BoxRow/BoxRow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AAEvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,oCAA0B;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,yBAAyB,GAAG;IAC1D;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC"}
@@ -3,6 +3,8 @@ import type { TextOrChildrenPropsShared } from "../TextOrChildren/index.mjs";
3
3
  /**
4
4
  * BoxRow component shared props (ADR-0004)
5
5
  * Platform-independent properties shared across React and React Native.
6
+ *
7
+ * @deprecated `BoxRow` is deprecated in favor of `Box`. This type will be removed in a future major version.
6
8
  */
7
9
  export type BoxRowPropsShared = TextOrChildrenPropsShared & {
8
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"BoxRow.types.d.mts","sourceRoot":"","sources":["../../../src/types/BoxRow/BoxRow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AAEvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,oCAA0B;AAEnE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,yBAAyB,GAAG;IAC1D;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC"}
1
+ {"version":3,"file":"BoxRow.types.d.mts","sourceRoot":"","sources":["../../../src/types/BoxRow/BoxRow.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AAEvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,oCAA0B;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,yBAAyB,GAAG;IAC1D;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BoxRow.types.mjs","sourceRoot":"","sources":["../../../src/types/BoxRow/BoxRow.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { TextOrChildrenPropsShared } from '../TextOrChildren';\n\n/**\n * BoxRow component shared props (ADR-0004)\n * Platform-independent properties shared across React and React Native.\n */\nexport type BoxRowPropsShared = TextOrChildrenPropsShared & {\n /**\n * Optional node rendered before the text/children (e.g. icon, avatar).\n */\n startAccessory?: ReactNode;\n /**\n * Optional node rendered after the text/children (e.g. icon, badge).\n */\n endAccessory?: ReactNode;\n};\n"]}
1
+ {"version":3,"file":"BoxRow.types.mjs","sourceRoot":"","sources":["../../../src/types/BoxRow/BoxRow.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { TextOrChildrenPropsShared } from '../TextOrChildren';\n\n/**\n * BoxRow component shared props (ADR-0004)\n * Platform-independent properties shared across React and React Native.\n *\n * @deprecated `BoxRow` is deprecated in favor of `Box`. This type will be removed in a future major version.\n */\nexport type BoxRowPropsShared = TextOrChildrenPropsShared & {\n /**\n * Optional node rendered before the text/children (e.g. icon, avatar).\n */\n startAccessory?: ReactNode;\n /**\n * Optional node rendered after the text/children (e.g. icon, badge).\n */\n endAccessory?: ReactNode;\n};\n"]}
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateIconSeed = exports.isEthereumAddress = exports.generateSeedNonEthereum = exports.generateSeedEthereum = exports.extractAccountAddress = void 0;
3
+ exports.extractAccountAddress = extractAccountAddress;
4
+ exports.generateSeedEthereum = generateSeedEthereum;
5
+ exports.generateSeedNonEthereum = generateSeedNonEthereum;
6
+ exports.isEthereumAddress = isEthereumAddress;
7
+ exports.generateIconSeed = generateIconSeed;
4
8
  const utils_1 = require("@metamask/utils");
5
9
  /**
6
10
  * Extracts the account address from a CAIP-10 formatted address string.
@@ -40,7 +44,6 @@ function extractAccountAddress(address) {
40
44
  // Return the address as-is if it's not CAIP-10 format
41
45
  return address;
42
46
  }
43
- exports.extractAccountAddress = extractAccountAddress;
44
47
  /**
45
48
  * Generates a numeric seed for Ethereum (eip155) addresses.
46
49
  *
@@ -52,7 +55,6 @@ function generateSeedEthereum(address) {
52
55
  const addr = address.slice(2, 10);
53
56
  return parseInt(addr, 16);
54
57
  }
55
- exports.generateSeedEthereum = generateSeedEthereum;
56
58
  /**
57
59
  * Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).
58
60
  *
@@ -62,7 +64,6 @@ exports.generateSeedEthereum = generateSeedEthereum;
62
64
  function generateSeedNonEthereum(address) {
63
65
  return Array.from((0, utils_1.stringToBytes)(address.normalize('NFKC').toLowerCase()));
64
66
  }
65
- exports.generateSeedNonEthereum = generateSeedNonEthereum;
66
67
  /**
67
68
  * Determines if an address is Ethereum format (starts with 0x).
68
69
  *
@@ -72,7 +73,6 @@ exports.generateSeedNonEthereum = generateSeedNonEthereum;
72
73
  function isEthereumAddress(address) {
73
74
  return address.startsWith('0x');
74
75
  }
75
- exports.isEthereumAddress = isEthereumAddress;
76
76
  /**
77
77
  * Generates an appropriate seed for icon generation based on address format.
78
78
  * Ethereum addresses (0x prefix) use hex parsing, others use byte array.
@@ -85,5 +85,4 @@ function generateIconSeed(address) {
85
85
  ? generateSeedEthereum(address)
86
86
  : generateSeedNonEthereum(address);
87
87
  }
88
- exports.generateIconSeed = generateIconSeed;
89
88
  //# sourceMappingURL=caip-address.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"caip-address.cjs","sourceRoot":"","sources":["../../src/utils/caip-address.ts"],"names":[],"mappings":";;;AAAA,2CAIyB;AAEzB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAgB,qBAAqB,CAAC,OAAe;IACnD,IAAI;QACF,gCAAgC;QAChC,IAAI,IAAA,uBAAe,EAAC,OAAO,CAAC,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAA,0BAAkB,EAAC,OAAO,CAAC,CAAC;YAC3C,OAAO,MAAM,CAAC,OAAO,CAAC;SACvB;KACF;IAAC,MAAM;QACN,4DAA4D;KAC7D;IAED,sDAAsD;IACtD,OAAO,OAAO,CAAC;AACjB,CAAC;AAbD,sDAaC;AAED;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,OAAe;IAClD,oDAAoD;IACpD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClC,OAAO,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC;AAJD,oDAIC;AAED;;;;;GAKG;AACH,SAAgB,uBAAuB,CAAC,OAAe;IACrD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAA,qBAAa,EAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAC5E,CAAC;AAFD,0DAEC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,OAAe;IAC/C,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAFD,8CAEC;AAED;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,OAAe;IAC9C,OAAO,iBAAiB,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC;AAJD,4CAIC","sourcesContent":["import {\n parseCaipAccountId,\n isCaipAccountId,\n stringToBytes,\n} from '@metamask/utils';\n\n/**\n * Extracts the account address from a CAIP-10 formatted address string.\n *\n * For CAIP-10 addresses like \"eip155:1:0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8\",\n * this returns just the address part: \"0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8\".\n *\n * This ensures that both legacy addresses and CAIP-10 addresses generate\n * the same icon, regardless of network specification.\n *\n * @param address - The address string (either legacy format or CAIP-10)\n * @returns The extracted account address\n *\n * @example\n * extractAccountAddress('0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8')\n * Returns: '0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8'\n *\n * @example\n * extractAccountAddress('eip155:1:0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8')\n * Returns: '0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8'\n *\n * @example\n * extractAccountAddress('solana:mainnet:4Nd1m3NnENa8h8Xte1Xr7s9jcvKqqm21z3FvY9hKg4s7')\n * Returns: '4Nd1m3NnENa8h8Xte1Xr7s9jcvKqqm21z3FvY9hKg4s7'\n */\nexport function extractAccountAddress(address: string): string {\n try {\n // Try to parse as CAIP-10 first\n if (isCaipAccountId(address)) {\n const parsed = parseCaipAccountId(address);\n return parsed.address;\n }\n } catch {\n // If parsing fails, fall through to return original address\n }\n\n // Return the address as-is if it's not CAIP-10 format\n return address;\n}\n\n/**\n * Generates a numeric seed for Ethereum (eip155) addresses.\n *\n * @param address - The Ethereum address to generate a seed from\n * @returns A numeric seed for icon generation\n */\nexport function generateSeedEthereum(address: string): number {\n // Parse the first 8 chars of the address after '0x'\n const addr = address.slice(2, 10);\n return parseInt(addr, 16);\n}\n\n/**\n * Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).\n *\n * @param address - The address to generate a byte array seed from\n * @returns An array of numbers representing the bytes of the address\n */\nexport function generateSeedNonEthereum(address: string): number[] {\n return Array.from(stringToBytes(address.normalize('NFKC').toLowerCase()));\n}\n\n/**\n * Determines if an address is Ethereum format (starts with 0x).\n *\n * @param address - The address to check\n * @returns True if Ethereum format, false otherwise\n */\nexport function isEthereumAddress(address: string): boolean {\n return address.startsWith('0x');\n}\n\n/**\n * Generates an appropriate seed for icon generation based on address format.\n * Ethereum addresses (0x prefix) use hex parsing, others use byte array.\n *\n * @param address - The address to generate a seed from (should be extracted first)\n * @returns A seed for icon generation (number for Ethereum, number[] for others)\n */\nexport function generateIconSeed(address: string): number | number[] {\n return isEthereumAddress(address)\n ? generateSeedEthereum(address)\n : generateSeedNonEthereum(address);\n}\n"]}
1
+ {"version":3,"file":"caip-address.cjs","sourceRoot":"","sources":["../../src/utils/caip-address.ts"],"names":[],"mappings":";;AA8BA,sDAaC;AAQD,oDAIC;AAQD,0DAEC;AAQD,8CAEC;AASD,4CAIC;AAxFD,2CAIyB;AAEzB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAgB,qBAAqB,CAAC,OAAe;IACnD,IAAI,CAAC;QACH,gCAAgC;QAChC,IAAI,IAAA,uBAAe,EAAC,OAAO,CAAC,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAA,0BAAkB,EAAC,OAAO,CAAC,CAAC;YAC3C,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,4DAA4D;IAC9D,CAAC;IAED,sDAAsD;IACtD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,OAAe;IAClD,oDAAoD;IACpD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClC,OAAO,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,SAAgB,uBAAuB,CAAC,OAAe;IACrD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAA,qBAAa,EAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,OAAe;IAC/C,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,OAAe;IAC9C,OAAO,iBAAiB,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import {\n parseCaipAccountId,\n isCaipAccountId,\n stringToBytes,\n} from '@metamask/utils';\n\n/**\n * Extracts the account address from a CAIP-10 formatted address string.\n *\n * For CAIP-10 addresses like \"eip155:1:0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8\",\n * this returns just the address part: \"0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8\".\n *\n * This ensures that both legacy addresses and CAIP-10 addresses generate\n * the same icon, regardless of network specification.\n *\n * @param address - The address string (either legacy format or CAIP-10)\n * @returns The extracted account address\n *\n * @example\n * extractAccountAddress('0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8')\n * Returns: '0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8'\n *\n * @example\n * extractAccountAddress('eip155:1:0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8')\n * Returns: '0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8'\n *\n * @example\n * extractAccountAddress('solana:mainnet:4Nd1m3NnENa8h8Xte1Xr7s9jcvKqqm21z3FvY9hKg4s7')\n * Returns: '4Nd1m3NnENa8h8Xte1Xr7s9jcvKqqm21z3FvY9hKg4s7'\n */\nexport function extractAccountAddress(address: string): string {\n try {\n // Try to parse as CAIP-10 first\n if (isCaipAccountId(address)) {\n const parsed = parseCaipAccountId(address);\n return parsed.address;\n }\n } catch {\n // If parsing fails, fall through to return original address\n }\n\n // Return the address as-is if it's not CAIP-10 format\n return address;\n}\n\n/**\n * Generates a numeric seed for Ethereum (eip155) addresses.\n *\n * @param address - The Ethereum address to generate a seed from\n * @returns A numeric seed for icon generation\n */\nexport function generateSeedEthereum(address: string): number {\n // Parse the first 8 chars of the address after '0x'\n const addr = address.slice(2, 10);\n return parseInt(addr, 16);\n}\n\n/**\n * Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).\n *\n * @param address - The address to generate a byte array seed from\n * @returns An array of numbers representing the bytes of the address\n */\nexport function generateSeedNonEthereum(address: string): number[] {\n return Array.from(stringToBytes(address.normalize('NFKC').toLowerCase()));\n}\n\n/**\n * Determines if an address is Ethereum format (starts with 0x).\n *\n * @param address - The address to check\n * @returns True if Ethereum format, false otherwise\n */\nexport function isEthereumAddress(address: string): boolean {\n return address.startsWith('0x');\n}\n\n/**\n * Generates an appropriate seed for icon generation based on address format.\n * Ethereum addresses (0x prefix) use hex parsing, others use byte array.\n *\n * @param address - The address to generate a seed from (should be extracted first)\n * @returns A seed for icon generation (number for Ethereum, number[] for others)\n */\nexport function generateIconSeed(address: string): number | number[] {\n return isEthereumAddress(address)\n ? generateSeedEthereum(address)\n : generateSeedNonEthereum(address);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"caip-address.mjs","sourceRoot":"","sources":["../../src/utils/caip-address.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,aAAa,EACd,wBAAwB;AAEzB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,IAAI;QACF,gCAAgC;QAChC,IAAI,eAAe,CAAC,OAAO,CAAC,EAAE;YAC5B,MAAM,MAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;YAC3C,OAAO,MAAM,CAAC,OAAO,CAAC;SACvB;KACF;IAAC,MAAM;QACN,4DAA4D;KAC7D;IAED,sDAAsD;IACtD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,oDAAoD;IACpD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClC,OAAO,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACrD,OAAO,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,OAAO,iBAAiB,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import {\n parseCaipAccountId,\n isCaipAccountId,\n stringToBytes,\n} from '@metamask/utils';\n\n/**\n * Extracts the account address from a CAIP-10 formatted address string.\n *\n * For CAIP-10 addresses like \"eip155:1:0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8\",\n * this returns just the address part: \"0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8\".\n *\n * This ensures that both legacy addresses and CAIP-10 addresses generate\n * the same icon, regardless of network specification.\n *\n * @param address - The address string (either legacy format or CAIP-10)\n * @returns The extracted account address\n *\n * @example\n * extractAccountAddress('0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8')\n * Returns: '0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8'\n *\n * @example\n * extractAccountAddress('eip155:1:0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8')\n * Returns: '0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8'\n *\n * @example\n * extractAccountAddress('solana:mainnet:4Nd1m3NnENa8h8Xte1Xr7s9jcvKqqm21z3FvY9hKg4s7')\n * Returns: '4Nd1m3NnENa8h8Xte1Xr7s9jcvKqqm21z3FvY9hKg4s7'\n */\nexport function extractAccountAddress(address: string): string {\n try {\n // Try to parse as CAIP-10 first\n if (isCaipAccountId(address)) {\n const parsed = parseCaipAccountId(address);\n return parsed.address;\n }\n } catch {\n // If parsing fails, fall through to return original address\n }\n\n // Return the address as-is if it's not CAIP-10 format\n return address;\n}\n\n/**\n * Generates a numeric seed for Ethereum (eip155) addresses.\n *\n * @param address - The Ethereum address to generate a seed from\n * @returns A numeric seed for icon generation\n */\nexport function generateSeedEthereum(address: string): number {\n // Parse the first 8 chars of the address after '0x'\n const addr = address.slice(2, 10);\n return parseInt(addr, 16);\n}\n\n/**\n * Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).\n *\n * @param address - The address to generate a byte array seed from\n * @returns An array of numbers representing the bytes of the address\n */\nexport function generateSeedNonEthereum(address: string): number[] {\n return Array.from(stringToBytes(address.normalize('NFKC').toLowerCase()));\n}\n\n/**\n * Determines if an address is Ethereum format (starts with 0x).\n *\n * @param address - The address to check\n * @returns True if Ethereum format, false otherwise\n */\nexport function isEthereumAddress(address: string): boolean {\n return address.startsWith('0x');\n}\n\n/**\n * Generates an appropriate seed for icon generation based on address format.\n * Ethereum addresses (0x prefix) use hex parsing, others use byte array.\n *\n * @param address - The address to generate a seed from (should be extracted first)\n * @returns A seed for icon generation (number for Ethereum, number[] for others)\n */\nexport function generateIconSeed(address: string): number | number[] {\n return isEthereumAddress(address)\n ? generateSeedEthereum(address)\n : generateSeedNonEthereum(address);\n}\n"]}
1
+ {"version":3,"file":"caip-address.mjs","sourceRoot":"","sources":["../../src/utils/caip-address.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,aAAa,EACd,wBAAwB;AAEzB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,IAAI,CAAC;QACH,gCAAgC;QAChC,IAAI,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;YAC3C,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,4DAA4D;IAC9D,CAAC;IAED,sDAAsD;IACtD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,oDAAoD;IACpD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClC,OAAO,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACrD,OAAO,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,OAAO,iBAAiB,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import {\n parseCaipAccountId,\n isCaipAccountId,\n stringToBytes,\n} from '@metamask/utils';\n\n/**\n * Extracts the account address from a CAIP-10 formatted address string.\n *\n * For CAIP-10 addresses like \"eip155:1:0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8\",\n * this returns just the address part: \"0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8\".\n *\n * This ensures that both legacy addresses and CAIP-10 addresses generate\n * the same icon, regardless of network specification.\n *\n * @param address - The address string (either legacy format or CAIP-10)\n * @returns The extracted account address\n *\n * @example\n * extractAccountAddress('0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8')\n * Returns: '0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8'\n *\n * @example\n * extractAccountAddress('eip155:1:0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8')\n * Returns: '0x9Cbf7c41B7787F6c621115010D3B044029FE2Ce8'\n *\n * @example\n * extractAccountAddress('solana:mainnet:4Nd1m3NnENa8h8Xte1Xr7s9jcvKqqm21z3FvY9hKg4s7')\n * Returns: '4Nd1m3NnENa8h8Xte1Xr7s9jcvKqqm21z3FvY9hKg4s7'\n */\nexport function extractAccountAddress(address: string): string {\n try {\n // Try to parse as CAIP-10 first\n if (isCaipAccountId(address)) {\n const parsed = parseCaipAccountId(address);\n return parsed.address;\n }\n } catch {\n // If parsing fails, fall through to return original address\n }\n\n // Return the address as-is if it's not CAIP-10 format\n return address;\n}\n\n/**\n * Generates a numeric seed for Ethereum (eip155) addresses.\n *\n * @param address - The Ethereum address to generate a seed from\n * @returns A numeric seed for icon generation\n */\nexport function generateSeedEthereum(address: string): number {\n // Parse the first 8 chars of the address after '0x'\n const addr = address.slice(2, 10);\n return parseInt(addr, 16);\n}\n\n/**\n * Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).\n *\n * @param address - The address to generate a byte array seed from\n * @returns An array of numbers representing the bytes of the address\n */\nexport function generateSeedNonEthereum(address: string): number[] {\n return Array.from(stringToBytes(address.normalize('NFKC').toLowerCase()));\n}\n\n/**\n * Determines if an address is Ethereum format (starts with 0x).\n *\n * @param address - The address to check\n * @returns True if Ethereum format, false otherwise\n */\nexport function isEthereumAddress(address: string): boolean {\n return address.startsWith('0x');\n}\n\n/**\n * Generates an appropriate seed for icon generation based on address format.\n * Ethereum addresses (0x prefix) use hex parsing, others use byte array.\n *\n * @param address - The address to generate a seed from (should be extracted first)\n * @returns A seed for icon generation (number for Ethereum, number[] for others)\n */\nexport function generateIconSeed(address: string): number | number[] {\n return isEthereumAddress(address)\n ? generateSeedEthereum(address)\n : generateSeedNonEthereum(address);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"merge-tw-class-name.d.cts","sourceRoot":"","sources":["../../src/utils/merge-tw-class-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,SAAU,MAAM,UAAU,MAAM,KAAG,MAC7B,CAAC"}
1
+ {"version":3,"file":"merge-tw-class-name.d.cts","sourceRoot":"","sources":["../../src/utils/merge-tw-class-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,MAC7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"merge-tw-class-name.d.mts","sourceRoot":"","sources":["../../src/utils/merge-tw-class-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,SAAU,MAAM,UAAU,MAAM,KAAG,MAC7B,CAAC"}
1
+ {"version":3,"file":"merge-tw-class-name.d.mts","sourceRoot":"","sources":["../../src/utils/merge-tw-class-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,MAC7B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/design-system-shared",
3
- "version": "0.45.0-preview.12867efa",
3
+ "version": "0.45.1-preview-473aecb",
4
4
  "description": "Shared types for design system libraries",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -64,7 +64,7 @@
64
64
  "react-test-renderer": "19.2.3",
65
65
  "ts-jest": "^29.2.5",
66
66
  "tsx": "^4.23.15",
67
- "typescript": "~5.2.2"
67
+ "typescript": "~5.9.3"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0"