@metamask-previews/design-system-react 0.1.0-preview.a448767 → 0.2.0-preview.a7d80d5
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 +21 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.cjs +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.cjs.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.mjs +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.mjs.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.cjs +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.cjs.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.mjs +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.mjs.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.cjs +1 -1
- package/dist/components/AvatarToken/AvatarToken.cjs.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.mjs +1 -1
- package/dist/components/AvatarToken/AvatarToken.mjs.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.cjs +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.cjs.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.mjs +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.mjs.map +1 -1
- package/dist/components/Box/Box.cjs +16 -2
- package/dist/components/Box/Box.cjs.map +1 -1
- package/dist/components/Box/Box.constants.cjs +218 -1
- package/dist/components/Box/Box.constants.cjs.map +1 -1
- package/dist/components/Box/Box.constants.d.cts +16 -1
- package/dist/components/Box/Box.constants.d.cts.map +1 -1
- package/dist/components/Box/Box.constants.d.mts +16 -1
- package/dist/components/Box/Box.constants.d.mts.map +1 -1
- package/dist/components/Box/Box.constants.mjs +217 -0
- package/dist/components/Box/Box.constants.mjs.map +1 -1
- package/dist/components/Box/Box.d.cts +1 -1
- package/dist/components/Box/Box.d.cts.map +1 -1
- package/dist/components/Box/Box.d.mts +1 -1
- package/dist/components/Box/Box.d.mts.map +1 -1
- package/dist/components/Box/Box.mjs +17 -3
- package/dist/components/Box/Box.mjs.map +1 -1
- package/dist/components/Box/Box.types.cjs.map +1 -1
- package/dist/components/Box/Box.types.d.cts +84 -1
- package/dist/components/Box/Box.types.d.cts.map +1 -1
- package/dist/components/Box/Box.types.d.mts +84 -1
- package/dist/components/Box/Box.types.d.mts.map +1 -1
- package/dist/components/Box/Box.types.mjs.map +1 -1
- package/dist/components/Box/index.cjs +3 -1
- package/dist/components/Box/index.cjs.map +1 -1
- package/dist/components/Box/index.d.cts +1 -1
- package/dist/components/Box/index.d.cts.map +1 -1
- package/dist/components/Box/index.d.mts +1 -1
- package/dist/components/Box/index.d.mts.map +1 -1
- package/dist/components/Box/index.mjs +1 -1
- package/dist/components/Box/index.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.cjs +4 -4
- package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.mjs +4 -4
- package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.cjs +2 -2
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.mjs +2 -2
- package/dist/components/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/components/Text/Text.constants.cjs +15 -0
- package/dist/components/Text/Text.constants.cjs.map +1 -1
- package/dist/components/Text/Text.constants.d.cts.map +1 -1
- package/dist/components/Text/Text.constants.d.mts.map +1 -1
- package/dist/components/Text/Text.constants.mjs +15 -0
- package/dist/components/Text/Text.constants.mjs.map +1 -1
- package/dist/components/index.cjs +4 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.cjs +5 -2
- package/dist/components/temp-components/Jazzicon/Jazzicon.cjs.map +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.d.cts.map +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.d.mts.map +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.mjs +5 -2
- package/dist/components/temp-components/Jazzicon/Jazzicon.mjs.map +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.cjs +6 -3
- package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.cjs.map +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.d.cts +6 -3
- package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.d.cts.map +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.d.mts +6 -3
- package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.d.mts.map +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.mjs +6 -3
- package/dist/components/temp-components/Jazzicon/Jazzicon.utilities.mjs.map +1 -1
- package/dist/types/index.cjs +143 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +138 -1
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +138 -1
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +142 -0
- package/dist/types/index.mjs.map +1 -1
- package/dist/utils/tw-merge.cjs +1 -5
- package/dist/utils/tw-merge.cjs.map +1 -1
- package/dist/utils/tw-merge.d.cts.map +1 -1
- package/dist/utils/tw-merge.d.mts.map +1 -1
- package/dist/utils/tw-merge.mjs +1 -5
- package/dist/utils/tw-merge.mjs.map +1 -1
- package/package.json +7 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Jazzicon.cjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAA0C;AAC1C,2CAAqD;AACrD,+CAAiD;AAEjD,0DAAkD;AAGlD,iEAI8B;AAE9B;;;GAGG;AACH,MAAM,SAAS,GAAmC,EAAE,CAAC;AAE9C,MAAM,QAAQ,GAAG,CAAC,EACvB,OAAO,EACP,IAAI,GAAG,EAAE,EACT,SAAS,EACT,GAAG,KAAK,EACM,EAAE,EAAE;IAClB,MAAM,YAAY,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAElD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,WAAW,GAAG,KAAK,CAAC;QAExB,
|
|
1
|
+
{"version":3,"file":"Jazzicon.cjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAA0C;AAC1C,2CAAqD;AACrD,+CAAiD;AAEjD,0DAAkD;AAGlD,iEAI8B;AAE9B;;;GAGG;AACH,MAAM,SAAS,GAAmC,EAAE,CAAC;AAE9C,MAAM,QAAQ,GAAG,CAAC,EACvB,OAAO,EACP,IAAI,GAAG,EAAE,EACT,SAAS,EACT,GAAG,KAAK,EACM,EAAE,EAAE;IAClB,MAAM,YAAY,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAElD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,WAAW,GAAG,KAAK,CAAC;QAExB,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;YAClC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;gBACzB,OAAO;aACR;YACD,6BAA6B;YAC7B,OAAO,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE;gBACtC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;aACnE;YAED,kBAAkB;YAClB,MAAM,QAAQ,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC;YACpD,IAAI,SAAS,C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,CAAC,UAAU,CAAC,CAAC;iBACnE;aACF;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAEpB,OAAO,CACL,uCAAK,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,IAAA,kBAAO,EAAC,MAAM,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAC7E,CAAC;AACJ,CAAC,CAAC;AA3EW,QAAA,QAAQ,YA2EnB;AAEF,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import jazzicon from '@metamask/jazzicon';\nimport { KnownCaipNamespace } from '@metamask/utils';\nimport React, { useEffect, useRef } from 'react';\n\nimport { twMerge } from '../../../utils/tw-merge';\n\nimport type { JazziconProps } from './Jazzicon.types';\nimport {\n generateSeedEthereum,\n generateSeedNonEthereum,\n getCaipNamespaceFromAddress,\n} from './Jazzicon.utilities';\n\n/**\n * Cache for storing generated SVG elements by `address:diameter` so\n * we don't regenerate them repeatedly.\n */\nconst iconCache: Record<string, HTMLDivElement> = {};\n\nexport const Jazzicon = ({\n address,\n size = 32,\n className,\n ...props\n}: JazziconProps) => {\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n let isCancelled = false;\n\n const generateJazzicon = async () => {\n if (!containerRef.current) {\n return;\n }\n // Clear any existing content\n while (containerRef.current.firstChild) {\n containerRef.current.removeChild(containerRef.current.firstChild);\n }\n\n // Check the cache\n const cacheKey = `${address.toLowerCase()}:${size}`;\n if (iconCache[cacheKey]) {\n // If cached, just append a clone\n if (!isCancelled) {\n const clone = iconCache[cacheKey].cloneNode(true) as HTMLDivElement;\n containerRef.current.appendChild(clone);\n }\n return;\n }\n\n // Determine the CAIP namespace\n const namespace = await getCaipNamespaceFromAddress(address);\n if (isCancelled) {\n return;\n }\n\n // Pick seeding strategy based on namespace\n let seed: number | number[];\n if (namespace === KnownCaipNamespace.Eip155) {\n seed = generateSeedEthereum(address);\n } else {\n seed = generateSeedNonEthereum(address);\n }\n\n // Create Jazzicon\n const newIcon = jazzicon(size, seed) as HTMLDivElement;\n\n // Cache it\n iconCache[cacheKey] = newIcon as HTMLDivElement;\n\n // Append a fresh clone\n if (!isCancelled && containerRef.current) {\n containerRef.current.appendChild(newIcon.cloneNode(true));\n }\n };\n\n generateJazzicon().catch(() => {\n // Silently ignore errors during async generation\n });\n\n // Cleanup\n return () => {\n isCancelled = true;\n if (containerRef.current) {\n while (containerRef.current.firstChild) {\n containerRef.current.removeChild(containerRef.current.firstChild);\n }\n }\n };\n }, [address, size]);\n\n return (\n <div ref={containerRef} className={twMerge('flex', className)} {...props} />\n );\n};\n\nJazzicon.displayName = 'Jazzicon';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Jazzicon.d.cts","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,cAAc;AAIjD,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAatD,eAAO,MAAM,QAAQ;6CAKlB,aAAa;;
|
|
1
|
+
{"version":3,"file":"Jazzicon.d.cts","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,cAAc;AAIjD,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAatD,eAAO,MAAM,QAAQ;6CAKlB,aAAa;;CAsEf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Jazzicon.d.mts","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,cAAc;AAIjD,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAatD,eAAO,MAAM,QAAQ;6CAKlB,aAAa;;
|
|
1
|
+
{"version":3,"file":"Jazzicon.d.mts","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,cAAc;AAIjD,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAatD,eAAO,MAAM,QAAQ;6CAKlB,aAAa;;CAsEf,CAAC"}
|
|
@@ -20,7 +20,7 @@ export const Jazzicon = ({ address, size = 32, className, ...props }) => {
|
|
|
20
20
|
const containerRef = useRef(null);
|
|
21
21
|
useEffect(() => {
|
|
22
22
|
let isCancelled = false;
|
|
23
|
-
|
|
23
|
+
const generateJazzicon = async () => {
|
|
24
24
|
if (!containerRef.current) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
@@ -59,7 +59,10 @@ export const Jazzicon = ({ address, size = 32, className, ...props }) => {
|
|
|
59
59
|
if (!isCancelled && containerRef.current) {
|
|
60
60
|
containerRef.current.appendChild(newIcon.cloneNode(true));
|
|
61
61
|
}
|
|
62
|
-
}
|
|
62
|
+
};
|
|
63
|
+
generateJazzicon().catch(() => {
|
|
64
|
+
// Silently ignore errors during async generation
|
|
65
|
+
});
|
|
63
66
|
// Cleanup
|
|
64
67
|
return () => {
|
|
65
68
|
isCancelled = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Jazzicon.mjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,SAAQ,2BAA2B;;AAC1C,OAAO,EAAE,kBAAkB,EAAE,wBAAwB;AACrD,OAAO,QAAO,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc;;AAEjD,OAAO,EAAE,OAAO,EAAE,oCAAgC;AAGlD,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAC5B,iCAA6B;AAE9B;;;GAGG;AACH,MAAM,SAAS,GAAmC,EAAE,CAAC;AAErD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EACvB,OAAO,EACP,IAAI,GAAG,EAAE,EACT,SAAS,EACT,GAAG,KAAK,EACM,EAAE,EAAE;IAClB,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,WAAW,GAAG,KAAK,CAAC;QAExB,
|
|
1
|
+
{"version":3,"file":"Jazzicon.mjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,SAAQ,2BAA2B;;AAC1C,OAAO,EAAE,kBAAkB,EAAE,wBAAwB;AACrD,OAAO,QAAO,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc;;AAEjD,OAAO,EAAE,OAAO,EAAE,oCAAgC;AAGlD,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAC5B,iCAA6B;AAE9B;;;GAGG;AACH,MAAM,SAAS,GAAmC,EAAE,CAAC;AAErD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EACvB,OAAO,EACP,IAAI,GAAG,EAAE,EACT,SAAS,EACT,GAAG,KAAK,EACM,EAAE,EAAE;IAClB,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,WAAW,GAAG,KAAK,CAAC;QAExB,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;YAClC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;gBACzB,OAAO;aACR;YACD,6BAA6B;YAC7B,OAAO,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE;gBACtC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;aACnE;YAED,kBAAkB;YAClB,MAAM,QAAQ,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC;YACpD,IAAI,SAAS,CAAC,QAAQ,CAAC,EAAE;gBACvB,iCAAiC;gBACjC,IAAI,CAAC,WAAW,EAAE;oBA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C,CAAC,CAAC;IAEpB,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAC7E,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import jazzicon from '@metamask/jazzicon';\nimport { KnownCaipNamespace } from '@metamask/utils';\nimport React, { useEffect, useRef } from 'react';\n\nimport { twMerge } from '../../../utils/tw-merge';\n\nimport type { JazziconProps } from './Jazzicon.types';\nimport {\n generateSeedEthereum,\n generateSeedNonEthereum,\n getCaipNamespaceFromAddress,\n} from './Jazzicon.utilities';\n\n/**\n * Cache for storing generated SVG elements by `address:diameter` so\n * we don't regenerate them repeatedly.\n */\nconst iconCache: Record<string, HTMLDivElement> = {};\n\nexport const Jazzicon = ({\n address,\n size = 32,\n className,\n ...props\n}: JazziconProps) => {\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n let isCancelled = false;\n\n const generateJazzicon = async () => {\n if (!containerRef.current) {\n return;\n }\n // Clear any existing content\n while (containerRef.current.firstChild) {\n containerRef.current.removeChild(containerRef.current.firstChild);\n }\n\n // Check the cache\n const cacheKey = `${address.toLowerCase()}:${size}`;\n if (iconCache[cacheKey]) {\n // If cached, just append a clone\n if (!isCancelled) {\n const clone = iconCache[cacheKey].cloneNode(true) as HTMLDivElement;\n containerRef.current.appendChild(clone);\n }\n return;\n }\n\n // Determine the CAIP namespace\n const namespace = await getCaipNamespaceFromAddress(address);\n if (isCancelled) {\n return;\n }\n\n // Pick seeding strategy based on namespace\n let seed: number | number[];\n if (namespace === KnownCaipNamespace.Eip155) {\n seed = generateSeedEthereum(address);\n } else {\n seed = generateSeedNonEthereum(address);\n }\n\n // Create Jazzicon\n const newIcon = jazzicon(size, seed) as HTMLDivElement;\n\n // Cache it\n iconCache[cacheKey] = newIcon as HTMLDivElement;\n\n // Append a fresh clone\n if (!isCancelled && containerRef.current) {\n containerRef.current.appendChild(newIcon.cloneNode(true));\n }\n };\n\n generateJazzicon().catch(() => {\n // Silently ignore errors during async generation\n });\n\n // Cleanup\n return () => {\n isCancelled = true;\n if (containerRef.current) {\n while (containerRef.current.firstChild) {\n containerRef.current.removeChild(containerRef.current.firstChild);\n }\n }\n };\n }, [address, size]);\n\n return (\n <div ref={containerRef} className={twMerge('flex', className)} {...props} />\n );\n};\n\nJazzicon.displayName = 'Jazzicon';\n"]}
|
|
@@ -6,7 +6,8 @@ const addresses_1 = require("@solana/addresses");
|
|
|
6
6
|
/**
|
|
7
7
|
* Generates a numeric seed for Ethereum (eip155) addresses.
|
|
8
8
|
*
|
|
9
|
-
* @param address
|
|
9
|
+
* @param address - The Ethereum address to generate a seed from
|
|
10
|
+
* @returns A numeric seed for jazzicon generation
|
|
10
11
|
*/
|
|
11
12
|
function generateSeedEthereum(address) {
|
|
12
13
|
// Example: parse the first 8 chars of the address after '0x'
|
|
@@ -17,7 +18,8 @@ exports.generateSeedEthereum = generateSeedEthereum;
|
|
|
17
18
|
/**
|
|
18
19
|
* Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).
|
|
19
20
|
*
|
|
20
|
-
* @param address
|
|
21
|
+
* @param address - The address to generate a byte array seed from
|
|
22
|
+
* @returns An array of numbers representing the bytes of the address
|
|
21
23
|
*/
|
|
22
24
|
function generateSeedNonEthereum(address) {
|
|
23
25
|
return Array.from((0, utils_1.stringToBytes)(address.normalize('NFKC').toLowerCase()));
|
|
@@ -27,7 +29,8 @@ exports.generateSeedNonEthereum = generateSeedNonEthereum;
|
|
|
27
29
|
* Dynamically checks if the address is Bitcoin or Solana; otherwise default to Ethereum.
|
|
28
30
|
* Returns a Promise that resolves to one of the known CAIP-2 namespaces.
|
|
29
31
|
*
|
|
30
|
-
* @param address
|
|
32
|
+
* @param address - The address to determine the CAIP namespace for
|
|
33
|
+
* @returns A Promise that resolves to a KnownCaipNamespace
|
|
31
34
|
*/
|
|
32
35
|
async function getCaipNamespaceFromAddress(address) {
|
|
33
36
|
// Check for CAIP-10 formatted addresses
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Jazzicon.utilities.cjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.utilities.ts"],"names":[],"mappings":";;;AAAA,2CAAoE;AACpE,iDAAiE;AAEjE
|
|
1
|
+
{"version":3,"file":"Jazzicon.utilities.cjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.utilities.ts"],"names":[],"mappings":";;;AAAA,2CAAoE;AACpE,iDAAiE;AAEjE;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,OAAe;IAClD,6DAA6D;IAC7D,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;;;;;;GAMG;AACI,KAAK,UAAU,2BAA2B,CAC/C,OAAe;IAEf,wCAAwC;IACxC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACzB,MAAM,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,QAAQ,EAAE;YACxC,OAAO,0BAAkB,CAAC,MAAM,CAAC;SAClC;QACD,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,QAAQ,EAAE;YACxC,OAAO,0BAAkB,CAAC,MAAM,CAAC;SAClC;QACD,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,QAAQ,EAAE;YACxC,OAAO,0BAAkB,CAAC,MAAM,CAAC;SAClC;QACD,kCAAkC;KACnC;IAED,IAAI;QACF,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,8BAA8B,CAAC;QACzE,IACE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;YAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAClC;YACA,OAAO,0BAAkB,CAAC,MAAM,CAAC;SAClC;KACF;IAAC,MAAM;QACN,mEAAmE;KACpE;IAED,IAAI,IAAA,qBAAe,EAAC,OAAO,CAAC,EAAE;QAC5B,OAAO,0BAAkB,CAAC,MAAM,CAAC;KAClC;IAED,sBAAsB;IACtB,OAAO,0BAAkB,CAAC,MAAM,CAAC;AACnC,CAAC;AApCD,kEAoCC","sourcesContent":["import { stringToBytes, KnownCaipNamespace } from '@metamask/utils';\nimport { isAddress as isSolanaAddress } from '@solana/addresses';\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 jazzicon generation\n */\nexport function generateSeedEthereum(address: string): number {\n // Example: 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 * Dynamically checks if the address is Bitcoin or Solana; otherwise default to Ethereum.\n * Returns a Promise that resolves to one of the known CAIP-2 namespaces.\n *\n * @param address - The address to determine the CAIP namespace for\n * @returns A Promise that resolves to a KnownCaipNamespace\n */\nexport async function getCaipNamespaceFromAddress(\n address: string,\n): Promise<KnownCaipNamespace> {\n // Check for CAIP-10 formatted addresses\n if (address.includes(':')) {\n const [namespace] = address.split(':');\n if (namespace.toLowerCase() === 'bip122') {\n return KnownCaipNamespace.Bip122;\n }\n if (namespace.toLowerCase() === 'solana') {\n return KnownCaipNamespace.Solana;\n }\n if (namespace.toLowerCase() === 'eip155') {\n return KnownCaipNamespace.Eip155;\n }\n // Add other namespaces as needed.\n }\n\n try {\n const { validate, Network } = await import('bitcoin-address-validation');\n if (\n validate(address, Network.mainnet) ||\n validate(address, Network.testnet)\n ) {\n return KnownCaipNamespace.Bip122;\n }\n } catch {\n // If the import fails or 'validate' is not available, fall through\n }\n\n if (isSolanaAddress(address)) {\n return KnownCaipNamespace.Solana;\n }\n\n // Default to Ethereum\n return KnownCaipNamespace.Eip155;\n}\n"]}
|
|
@@ -2,20 +2,23 @@ import { KnownCaipNamespace } from "@metamask/utils";
|
|
|
2
2
|
/**
|
|
3
3
|
* Generates a numeric seed for Ethereum (eip155) addresses.
|
|
4
4
|
*
|
|
5
|
-
* @param address
|
|
5
|
+
* @param address - The Ethereum address to generate a seed from
|
|
6
|
+
* @returns A numeric seed for jazzicon generation
|
|
6
7
|
*/
|
|
7
8
|
export declare function generateSeedEthereum(address: string): number;
|
|
8
9
|
/**
|
|
9
10
|
* Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).
|
|
10
11
|
*
|
|
11
|
-
* @param address
|
|
12
|
+
* @param address - The address to generate a byte array seed from
|
|
13
|
+
* @returns An array of numbers representing the bytes of the address
|
|
12
14
|
*/
|
|
13
15
|
export declare function generateSeedNonEthereum(address: string): number[];
|
|
14
16
|
/**
|
|
15
17
|
* Dynamically checks if the address is Bitcoin or Solana; otherwise default to Ethereum.
|
|
16
18
|
* Returns a Promise that resolves to one of the known CAIP-2 namespaces.
|
|
17
19
|
*
|
|
18
|
-
* @param address
|
|
20
|
+
* @param address - The address to determine the CAIP namespace for
|
|
21
|
+
* @returns A Promise that resolves to a KnownCaipNamespace
|
|
19
22
|
*/
|
|
20
23
|
export declare function getCaipNamespaceFromAddress(address: string): Promise<KnownCaipNamespace>;
|
|
21
24
|
//# sourceMappingURL=Jazzicon.utilities.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Jazzicon.utilities.d.cts","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAE,wBAAwB;AAGpE
|
|
1
|
+
{"version":3,"file":"Jazzicon.utilities.d.cts","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAE,wBAAwB;AAGpE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAEjE;AAED;;;;;;GAMG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,CAkC7B"}
|
|
@@ -2,20 +2,23 @@ import { KnownCaipNamespace } from "@metamask/utils";
|
|
|
2
2
|
/**
|
|
3
3
|
* Generates a numeric seed for Ethereum (eip155) addresses.
|
|
4
4
|
*
|
|
5
|
-
* @param address
|
|
5
|
+
* @param address - The Ethereum address to generate a seed from
|
|
6
|
+
* @returns A numeric seed for jazzicon generation
|
|
6
7
|
*/
|
|
7
8
|
export declare function generateSeedEthereum(address: string): number;
|
|
8
9
|
/**
|
|
9
10
|
* Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).
|
|
10
11
|
*
|
|
11
|
-
* @param address
|
|
12
|
+
* @param address - The address to generate a byte array seed from
|
|
13
|
+
* @returns An array of numbers representing the bytes of the address
|
|
12
14
|
*/
|
|
13
15
|
export declare function generateSeedNonEthereum(address: string): number[];
|
|
14
16
|
/**
|
|
15
17
|
* Dynamically checks if the address is Bitcoin or Solana; otherwise default to Ethereum.
|
|
16
18
|
* Returns a Promise that resolves to one of the known CAIP-2 namespaces.
|
|
17
19
|
*
|
|
18
|
-
* @param address
|
|
20
|
+
* @param address - The address to determine the CAIP namespace for
|
|
21
|
+
* @returns A Promise that resolves to a KnownCaipNamespace
|
|
19
22
|
*/
|
|
20
23
|
export declare function getCaipNamespaceFromAddress(address: string): Promise<KnownCaipNamespace>;
|
|
21
24
|
//# sourceMappingURL=Jazzicon.utilities.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Jazzicon.utilities.d.mts","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAE,wBAAwB;AAGpE
|
|
1
|
+
{"version":3,"file":"Jazzicon.utilities.d.mts","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAE,wBAAwB;AAGpE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAEjE;AAED;;;;;;GAMG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,CAkC7B"}
|
|
@@ -3,7 +3,8 @@ import { isAddress as isSolanaAddress } from "@solana/addresses";
|
|
|
3
3
|
/**
|
|
4
4
|
* Generates a numeric seed for Ethereum (eip155) addresses.
|
|
5
5
|
*
|
|
6
|
-
* @param address
|
|
6
|
+
* @param address - The Ethereum address to generate a seed from
|
|
7
|
+
* @returns A numeric seed for jazzicon generation
|
|
7
8
|
*/
|
|
8
9
|
export function generateSeedEthereum(address) {
|
|
9
10
|
// Example: parse the first 8 chars of the address after '0x'
|
|
@@ -13,7 +14,8 @@ export function generateSeedEthereum(address) {
|
|
|
13
14
|
/**
|
|
14
15
|
* Generates a byte-array seed for non-Ethereum addresses (Solana, Bitcoin, etc.).
|
|
15
16
|
*
|
|
16
|
-
* @param address
|
|
17
|
+
* @param address - The address to generate a byte array seed from
|
|
18
|
+
* @returns An array of numbers representing the bytes of the address
|
|
17
19
|
*/
|
|
18
20
|
export function generateSeedNonEthereum(address) {
|
|
19
21
|
return Array.from(stringToBytes(address.normalize('NFKC').toLowerCase()));
|
|
@@ -22,7 +24,8 @@ export function generateSeedNonEthereum(address) {
|
|
|
22
24
|
* Dynamically checks if the address is Bitcoin or Solana; otherwise default to Ethereum.
|
|
23
25
|
* Returns a Promise that resolves to one of the known CAIP-2 namespaces.
|
|
24
26
|
*
|
|
25
|
-
* @param address
|
|
27
|
+
* @param address - The address to determine the CAIP namespace for
|
|
28
|
+
* @returns A Promise that resolves to a KnownCaipNamespace
|
|
26
29
|
*/
|
|
27
30
|
export async function getCaipNamespaceFromAddress(address) {
|
|
28
31
|
// Check for CAIP-10 formatted addresses
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Jazzicon.utilities.mjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,wBAAwB;AACpE,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,0BAA0B;AAEjE
|
|
1
|
+
{"version":3,"file":"Jazzicon.utilities.mjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Jazzicon/Jazzicon.utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,wBAAwB;AACpE,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,0BAA0B;AAEjE;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,6D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,CAAC;KAClC;IAED,sBAAsB;IACtB,OAAO,kBAAkB,CAAC,MAAM,CAAC;AACnC,CAAC","sourcesContent":["import { stringToBytes, KnownCaipNamespace } from '@metamask/utils';\nimport { isAddress as isSolanaAddress } from '@solana/addresses';\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 jazzicon generation\n */\nexport function generateSeedEthereum(address: string): number {\n // Example: 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 * Dynamically checks if the address is Bitcoin or Solana; otherwise default to Ethereum.\n * Returns a Promise that resolves to one of the known CAIP-2 namespaces.\n *\n * @param address - The address to determine the CAIP namespace for\n * @returns A Promise that resolves to a KnownCaipNamespace\n */\nexport async function getCaipNamespaceFromAddress(\n address: string,\n): Promise<KnownCaipNamespace> {\n // Check for CAIP-10 formatted addresses\n if (address.includes(':')) {\n const [namespace] = address.split(':');\n if (namespace.toLowerCase() === 'bip122') {\n return KnownCaipNamespace.Bip122;\n }\n if (namespace.toLowerCase() === 'solana') {\n return KnownCaipNamespace.Solana;\n }\n if (namespace.toLowerCase() === 'eip155') {\n return KnownCaipNamespace.Eip155;\n }\n // Add other namespaces as needed.\n }\n\n try {\n const { validate, Network } = await import('bitcoin-address-validation');\n if (\n validate(address, Network.mainnet) ||\n validate(address, Network.testnet)\n ) {\n return KnownCaipNamespace.Bip122;\n }\n } catch {\n // If the import fails or 'validate' is not available, fall through\n }\n\n if (isSolanaAddress(address)) {\n return KnownCaipNamespace.Solana;\n }\n\n // Default to Ethereum\n return KnownCaipNamespace.Eip155;\n}\n"]}
|
package/dist/types/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IconName = exports.IconColor = exports.IconSize = exports.TextButtonSize = exports.FontFamily = exports.TextTransform = exports.FontStyle = exports.OverflowWrap = exports.FontWeight = exports.TextAlign = exports.TextColor = exports.TextVariant = exports.ButtonIconSize = exports.ButtonVariant = exports.ButtonSize = exports.ButtonTertiarySize = exports.ButtonSecondarySize = exports.ButtonPrimarySize = exports.ButtonBaseSize = exports.BoxJustifyContent = exports.BoxAlignItems = exports.BoxFlexWrap = exports.BoxFlexDirection = exports.BadgeWrapperPosition = exports.BadgeWrapperPositionAnchorShape = exports.BadgeStatusSize = exports.BadgeStatusStatus = exports.BadgeCountSize = exports.AvatarGroupVariant = exports.AvatarIconSeverity = exports.AvatarAccountVariant = exports.AvatarBaseShape = exports.AvatarShape = exports.AvatarSize = exports.AvatarTokenSize = exports.AvatarNetworkSize = exports.AvatarIconSize = exports.AvatarGroupSize = exports.AvatarFaviconSize = exports.AvatarAccountSize = exports.AvatarBaseSize = void 0;
|
|
3
|
+
exports.IconName = exports.IconColor = exports.IconSize = exports.TextButtonSize = exports.FontFamily = exports.TextTransform = exports.FontStyle = exports.OverflowWrap = exports.FontWeight = exports.TextAlign = exports.TextColor = exports.TextVariant = exports.ButtonIconSize = exports.ButtonVariant = exports.ButtonSize = exports.ButtonTertiarySize = exports.ButtonSecondarySize = exports.ButtonPrimarySize = exports.ButtonBaseSize = exports.BoxBorderColor = exports.BoxBackgroundColor = exports.BoxJustifyContent = exports.BoxAlignItems = exports.BoxFlexWrap = exports.BoxFlexDirection = exports.BadgeWrapperPosition = exports.BadgeWrapperPositionAnchorShape = exports.BadgeStatusSize = exports.BadgeStatusStatus = exports.BadgeCountSize = exports.AvatarGroupVariant = exports.AvatarIconSeverity = exports.AvatarAccountVariant = exports.AvatarBaseShape = exports.AvatarShape = exports.AvatarSize = exports.AvatarTokenSize = exports.AvatarNetworkSize = exports.AvatarIconSize = exports.AvatarGroupSize = exports.AvatarFaviconSize = exports.AvatarAccountSize = exports.AvatarBaseSize = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* AvatarBase - size
|
|
6
6
|
*/
|
|
@@ -58,6 +58,7 @@ var AvatarIconSeverity;
|
|
|
58
58
|
AvatarIconSeverity["Neutral"] = "neutral";
|
|
59
59
|
AvatarIconSeverity["Info"] = "info";
|
|
60
60
|
AvatarIconSeverity["Success"] = "success";
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
61
62
|
AvatarIconSeverity["Error"] = "error";
|
|
62
63
|
AvatarIconSeverity["Warning"] = "warning";
|
|
63
64
|
})(AvatarIconSeverity || (exports.AvatarIconSeverity = AvatarIconSeverity = {}));
|
|
@@ -170,6 +171,136 @@ var BoxJustifyContent;
|
|
|
170
171
|
BoxJustifyContent["Around"] = "justify-around";
|
|
171
172
|
BoxJustifyContent["Evenly"] = "justify-evenly";
|
|
172
173
|
})(BoxJustifyContent || (exports.BoxJustifyContent = BoxJustifyContent = {}));
|
|
174
|
+
/**
|
|
175
|
+
* Box - backgroundColor
|
|
176
|
+
*/
|
|
177
|
+
var BoxBackgroundColor;
|
|
178
|
+
(function (BoxBackgroundColor) {
|
|
179
|
+
/** Default background color */
|
|
180
|
+
BoxBackgroundColor["BackgroundDefault"] = "bg-default";
|
|
181
|
+
/** Alternative background color */
|
|
182
|
+
BoxBackgroundColor["BackgroundAlternative"] = "bg-alternative";
|
|
183
|
+
/** Section background color */
|
|
184
|
+
BoxBackgroundColor["BackgroundSection"] = "bg-section";
|
|
185
|
+
/** Subsection background color */
|
|
186
|
+
BoxBackgroundColor["BackgroundSubsection"] = "bg-subsection";
|
|
187
|
+
/** Muted background color */
|
|
188
|
+
BoxBackgroundColor["BackgroundMuted"] = "bg-muted";
|
|
189
|
+
/** Primary default background color */
|
|
190
|
+
BoxBackgroundColor["PrimaryDefault"] = "bg-primary-default";
|
|
191
|
+
/** Primary alternative background color */
|
|
192
|
+
BoxBackgroundColor["PrimaryAlternative"] = "bg-primary-alternative";
|
|
193
|
+
/** Primary muted background color */
|
|
194
|
+
BoxBackgroundColor["PrimaryMuted"] = "bg-primary-muted";
|
|
195
|
+
/** Primary inverse background color */
|
|
196
|
+
BoxBackgroundColor["PrimaryInverse"] = "bg-primary-inverse";
|
|
197
|
+
/** Error default background color */
|
|
198
|
+
BoxBackgroundColor["ErrorDefault"] = "bg-error-default";
|
|
199
|
+
/** Error alternative background color */
|
|
200
|
+
BoxBackgroundColor["ErrorAlternative"] = "bg-error-alternative";
|
|
201
|
+
/** Error muted background color */
|
|
202
|
+
BoxBackgroundColor["ErrorMuted"] = "bg-error-muted";
|
|
203
|
+
/** Error inverse background color */
|
|
204
|
+
BoxBackgroundColor["ErrorInverse"] = "bg-error-inverse";
|
|
205
|
+
/** Warning default background color */
|
|
206
|
+
BoxBackgroundColor["WarningDefault"] = "bg-warning-default";
|
|
207
|
+
/** Warning alternative background color */
|
|
208
|
+
BoxBackgroundColor["WarningAlternative"] = "bg-warning-alternative";
|
|
209
|
+
/** Warning muted background color */
|
|
210
|
+
BoxBackgroundColor["WarningMuted"] = "bg-warning-muted";
|
|
211
|
+
/** Warning inverse background color */
|
|
212
|
+
BoxBackgroundColor["WarningInverse"] = "bg-warning-inverse";
|
|
213
|
+
/** Success default background color */
|
|
214
|
+
BoxBackgroundColor["SuccessDefault"] = "bg-success-default";
|
|
215
|
+
/** Success alternative background color */
|
|
216
|
+
BoxBackgroundColor["SuccessAlternative"] = "bg-success-alternative";
|
|
217
|
+
/** Success muted background color */
|
|
218
|
+
BoxBackgroundColor["SuccessMuted"] = "bg-success-muted";
|
|
219
|
+
/** Success inverse background color */
|
|
220
|
+
BoxBackgroundColor["SuccessInverse"] = "bg-success-inverse";
|
|
221
|
+
/** Info default background color */
|
|
222
|
+
BoxBackgroundColor["InfoDefault"] = "bg-info-default";
|
|
223
|
+
/** Info muted background color */
|
|
224
|
+
BoxBackgroundColor["InfoMuted"] = "bg-info-muted";
|
|
225
|
+
/** Info inverse background color */
|
|
226
|
+
BoxBackgroundColor["InfoInverse"] = "bg-info-inverse";
|
|
227
|
+
/** Flask default background color */
|
|
228
|
+
BoxBackgroundColor["FlaskDefault"] = "bg-flask-default";
|
|
229
|
+
/** Flask inverse background color */
|
|
230
|
+
BoxBackgroundColor["FlaskInverse"] = "bg-flask-inverse";
|
|
231
|
+
/** Overlay alternative background color */
|
|
232
|
+
BoxBackgroundColor["OverlayAlternative"] = "bg-overlay-alternative";
|
|
233
|
+
/** Overlay default background color */
|
|
234
|
+
BoxBackgroundColor["OverlayDefault"] = "bg-overlay-default";
|
|
235
|
+
/** Overlay inverse background color */
|
|
236
|
+
BoxBackgroundColor["OverlayInverse"] = "bg-overlay-inverse";
|
|
237
|
+
/** Transparent background color */
|
|
238
|
+
BoxBackgroundColor["Transparent"] = "bg-transparent";
|
|
239
|
+
})(BoxBackgroundColor || (exports.BoxBackgroundColor = BoxBackgroundColor = {}));
|
|
240
|
+
/**
|
|
241
|
+
* Box - borderColor
|
|
242
|
+
*/
|
|
243
|
+
var BoxBorderColor;
|
|
244
|
+
(function (BoxBorderColor) {
|
|
245
|
+
/** Background default for cut out effect */
|
|
246
|
+
BoxBorderColor["BackgroundDefault"] = "border-background-default";
|
|
247
|
+
/** Default border color */
|
|
248
|
+
BoxBorderColor["BorderDefault"] = "border-default";
|
|
249
|
+
/** Muted border color */
|
|
250
|
+
BoxBorderColor["BorderMuted"] = "border-muted";
|
|
251
|
+
/** Primary default border color */
|
|
252
|
+
BoxBorderColor["PrimaryDefault"] = "border-primary-default";
|
|
253
|
+
/** Primary alternative border color */
|
|
254
|
+
BoxBorderColor["PrimaryAlternative"] = "border-primary-alternative";
|
|
255
|
+
/** Primary muted border color */
|
|
256
|
+
BoxBorderColor["PrimaryMuted"] = "border-primary-muted";
|
|
257
|
+
/** Primary inverse border color */
|
|
258
|
+
BoxBorderColor["PrimaryInverse"] = "border-primary-inverse";
|
|
259
|
+
/** Error default border color */
|
|
260
|
+
BoxBorderColor["ErrorDefault"] = "border-error-default";
|
|
261
|
+
/** Error alternative border color */
|
|
262
|
+
BoxBorderColor["ErrorAlternative"] = "border-error-alternative";
|
|
263
|
+
/** Error muted border color */
|
|
264
|
+
BoxBorderColor["ErrorMuted"] = "border-error-muted";
|
|
265
|
+
/** Error inverse border color */
|
|
266
|
+
BoxBorderColor["ErrorInverse"] = "border-error-inverse";
|
|
267
|
+
/** Warning default border color */
|
|
268
|
+
BoxBorderColor["WarningDefault"] = "border-warning-default";
|
|
269
|
+
/** Warning alternative border color */
|
|
270
|
+
BoxBorderColor["WarningAlternative"] = "border-warning-alternative";
|
|
271
|
+
/** Warning muted border color */
|
|
272
|
+
BoxBorderColor["WarningMuted"] = "border-warning-muted";
|
|
273
|
+
/** Warning inverse border color */
|
|
274
|
+
BoxBorderColor["WarningInverse"] = "border-warning-inverse";
|
|
275
|
+
/** Success default border color */
|
|
276
|
+
BoxBorderColor["SuccessDefault"] = "border-success-default";
|
|
277
|
+
/** Success alternative border color */
|
|
278
|
+
BoxBorderColor["SuccessAlternative"] = "border-success-alternative";
|
|
279
|
+
/** Success muted border color */
|
|
280
|
+
BoxBorderColor["SuccessMuted"] = "border-success-muted";
|
|
281
|
+
/** Success inverse border color */
|
|
282
|
+
BoxBorderColor["SuccessInverse"] = "border-success-inverse";
|
|
283
|
+
/** Info default border color */
|
|
284
|
+
BoxBorderColor["InfoDefault"] = "border-info-default";
|
|
285
|
+
/** Info alternative border color */
|
|
286
|
+
BoxBorderColor["InfoAlternative"] = "border-info-alternative";
|
|
287
|
+
/** Info muted border color */
|
|
288
|
+
BoxBorderColor["InfoMuted"] = "border-info-muted";
|
|
289
|
+
/** Info inverse border color */
|
|
290
|
+
BoxBorderColor["InfoInverse"] = "border-info-inverse";
|
|
291
|
+
/** Flask default border color */
|
|
292
|
+
BoxBorderColor["FlaskDefault"] = "border-flask-default";
|
|
293
|
+
/** Flask inverse border color */
|
|
294
|
+
BoxBorderColor["FlaskInverse"] = "border-flask-inverse";
|
|
295
|
+
/** Overlay alternative border color */
|
|
296
|
+
BoxBorderColor["OverlayAlternative"] = "border-overlay-alternative";
|
|
297
|
+
/** Overlay default border color */
|
|
298
|
+
BoxBorderColor["OverlayDefault"] = "border-overlay-default";
|
|
299
|
+
/** Overlay inverse border color */
|
|
300
|
+
BoxBorderColor["OverlayInverse"] = "border-overlay-inverse";
|
|
301
|
+
/** Transparent border color */
|
|
302
|
+
BoxBorderColor["Transparent"] = "border-transparent";
|
|
303
|
+
})(BoxBorderColor || (exports.BoxBorderColor = BoxBorderColor = {}));
|
|
173
304
|
/**
|
|
174
305
|
* ButtonBase - size
|
|
175
306
|
*/
|
|
@@ -241,6 +372,12 @@ var TextVariant;
|
|
|
241
372
|
TextVariant["BodyMd"] = "body-md";
|
|
242
373
|
TextVariant["BodySm"] = "body-sm";
|
|
243
374
|
TextVariant["BodyXs"] = "body-xs";
|
|
375
|
+
// Special Typography Variants
|
|
376
|
+
TextVariant["PageHeading"] = "page-heading";
|
|
377
|
+
TextVariant["SectionHeading"] = "section-heading";
|
|
378
|
+
TextVariant["ButtonLabelMd"] = "button-label-md";
|
|
379
|
+
TextVariant["ButtonLabelLg"] = "button-label-lg";
|
|
380
|
+
TextVariant["AmountDisplayLg"] = "amount-display-lg";
|
|
244
381
|
})(TextVariant || (exports.TextVariant = TextVariant = {}));
|
|
245
382
|
/**
|
|
246
383
|
* Text - color
|
|
@@ -348,8 +485,11 @@ var FontStyle;
|
|
|
348
485
|
*/
|
|
349
486
|
var TextTransform;
|
|
350
487
|
(function (TextTransform) {
|
|
488
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
351
489
|
TextTransform["Uppercase"] = "uppercase";
|
|
490
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
352
491
|
TextTransform["Lowercase"] = "lowercase";
|
|
492
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
353
493
|
TextTransform["Capitalize"] = "capitalize";
|
|
354
494
|
TextTransform["Normal"] = "normal-case";
|
|
355
495
|
})(TextTransform || (exports.TextTransform = TextTransform = {}));
|
|
@@ -429,6 +569,7 @@ var IconColor;
|
|
|
429
569
|
/**
|
|
430
570
|
* Icon - name
|
|
431
571
|
*/
|
|
572
|
+
/* eslint-disable @typescript-eslint/no-shadow */
|
|
432
573
|
var IconName;
|
|
433
574
|
(function (IconName) {
|
|
434
575
|
IconName["Accessibility"] = "Accessibility";
|
|
@@ -702,4 +843,5 @@ var IconName;
|
|
|
702
843
|
IconName["WifiOff"] = "WifiOff";
|
|
703
844
|
IconName["X"] = "X";
|
|
704
845
|
})(IconName || (exports.IconName = IconName = {}));
|
|
846
|
+
/* eslint-enable @typescript-eslint/no-shadow */
|
|
705
847
|
//# sourceMappingURL=index.cjs.map
|