@metamask-previews/design-system-react 0.2.0-preview.ec6504c → 0.3.1-preview.1775c68
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 +29 -1
- package/dist/components/AvatarAccount/AvatarAccount.cjs +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.cjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.mjs +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.mjs.map +1 -1
- package/dist/components/Text/Text.cjs +1 -1
- package/dist/components/Text/Text.cjs.map +1 -1
- package/dist/components/Text/Text.constants.cjs +5 -5
- 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 +5 -5
- package/dist/components/Text/Text.constants.mjs.map +1 -1
- package/dist/components/Text/Text.d.cts.map +1 -1
- package/dist/components/Text/Text.d.mts.map +1 -1
- package/dist/components/Text/Text.mjs +1 -1
- package/dist/components/Text/Text.mjs.map +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.cjs +1 -1
- 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 +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.mjs.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.cjs +14 -6
- package/dist/components/temp-components/Maskicon/Maskicon.cjs.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.d.cts +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.d.cts.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.d.mts +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.d.mts.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.mjs +15 -7
- package/dist/components/temp-components/Maskicon/Maskicon.mjs.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.types.cjs.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.types.d.cts +6 -1
- package/dist/components/temp-components/Maskicon/Maskicon.types.d.cts.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.types.d.mts +6 -1
- package/dist/components/temp-components/Maskicon/Maskicon.types.d.mts.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.types.mjs.map +1 -1
- package/dist/utils/tw-merge.cjs +12 -0
- 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 +12 -0
- package/dist/utils/tw-merge.mjs.map +1 -1
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.3.1]
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Removed DOMPurify dependency from Maskicon component ([#812](https://github.com/MetaMask/metamask-design-system/pull/812))
|
|
15
|
+
- Aligned React peer dependencies with MetaMask extension React 17 ([#809](https://github.com/MetaMask/metamask-design-system/pull/809))
|
|
16
|
+
|
|
17
|
+
## [0.3.0]
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- New icons (AppleLogo, Backspace, Candlestick, Clear, MetamaskFoxOutline) ([#798](https://github.com/MetaMask/metamask-design-system/pull/798))
|
|
22
|
+
|
|
23
|
+
- Figma code connect files for all components ([#766](https://github.com/MetaMask/metamask-design-system/pull/766)), ([#791](https://github.com/MetaMask/metamask-design-system/pull/791)), ([#795](https://github.com/MetaMask/metamask-design-system/pull/795)), ([#796](https://github.com/MetaMask/metamask-design-system/pull/796)), ([#794](https://github.com/MetaMask/metamask-design-system/pull/794)), ([#792](https://github.com/MetaMask/metamask-design-system/pull/792))
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Update AvatarAccount shape from circle to square ([#800](https://github.com/MetaMask/metamask-design-system/pull/800))
|
|
28
|
+
- Update README.mdx files for template alignment ([#771](https://github.com/MetaMask/metamask-design-system/pull/771))
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- Adding new text classnames to twmerge to avoid conflicts ([#802](https://github.com/MetaMask/metamask-design-system/pull/802))
|
|
33
|
+
- Optimize icon SVGs and remove hardcoded colors ([#799](https://github.com/MetaMask/metamask-design-system/pull/799))
|
|
34
|
+
- Add ref support to Box component using forwardRef ([#790](https://github.com/MetaMask/metamask-design-system/pull/790))
|
|
35
|
+
|
|
10
36
|
## [0.2.0]
|
|
11
37
|
|
|
12
38
|
### Added
|
|
@@ -43,6 +69,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
43
69
|
- Full TypeScript support with type definitions and enums
|
|
44
70
|
- Tailwind CSS integration with design token support
|
|
45
71
|
|
|
46
|
-
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.
|
|
72
|
+
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.3.1...HEAD
|
|
73
|
+
[0.3.1]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.3.0...@metamask/design-system-react@0.3.1
|
|
74
|
+
[0.3.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.2.0...@metamask/design-system-react@0.3.0
|
|
47
75
|
[0.2.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.1.0...@metamask/design-system-react@0.2.0
|
|
48
76
|
[0.1.0]: https://github.com/MetaMask/metamask-design-system/releases/tag/@metamask/design-system-react@0.1.0
|
|
@@ -45,7 +45,7 @@ exports.AvatarAccount = (0, react_1.forwardRef)(({ address, variant = types_1.Av
|
|
|
45
45
|
AvatarArtComponent = (react_1.default.createElement(Jazzicon_1.Jazzicon, { address: address, size: AvatarAccount_constants_1.MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size], ...jazziconProps }));
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
|
-
return (react_1.default.createElement(AvatarBase_1.AvatarBase, { ref: ref, shape: types_1.AvatarBaseShape.
|
|
48
|
+
return (react_1.default.createElement(AvatarBase_1.AvatarBase, { ref: ref, shape: types_1.AvatarBaseShape.Square, size: size, className: className, ...props }, AvatarArtComponent));
|
|
49
49
|
});
|
|
50
50
|
exports.AvatarAccount.displayName = 'AvatarAccount';
|
|
51
51
|
//# sourceMappingURL=AvatarAccount.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarAccount.cjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,iDAIqB;AACrB,wDAA2C;AAC3C,oEAAuD;AACvD,oEAAuD;AACvD,oEAAuD;AAEvD,2EAA8E;AAGjE,QAAA,aAAa,GAAG,IAAA,kBAAU,EACrC,CACE,EACE,OAAO,EACP,OAAO,GAAG,4BAAoB,CAAC,QAAQ,EACvC,SAAS,EACT,IAAI,GAAG,yBAAiB,CAAC,EAAE,EAC3B,aAAa,EACb,aAAa,EACb,aAAa,EACb,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,IAAI,kBAAkB,CAAC;IACvB,QAAQ,OAAO,EAAE;QACf,KAAK,4BAAoB,CAAC,QAAQ;YAChC,kBAAkB,GAAG,CACnB,8BAAC,mBAAQ,IACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,2DAAiC,CAAC,IAAI,CAAC,KACzC,aAAa,GACjB,CACH,CAAC;YACF,MAAM;QACR,KAAK,4BAAoB,CAAC,QAAQ;YAChC,kBAAkB,GAAG,CACnB,8BAAC,mBAAQ,IACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,2DAAiC,CAAC,IAAI,CAAC,KACzC,aAAa,GACjB,CACH,CAAC;YACF,MAAM;QACR,KAAK,4BAAoB,CAAC,QAAQ,CAAC;QACnC;YACE,kBAAkB,GAAG,CACnB,8BAAC,mBAAQ,IACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,2DAAiC,CAAC,IAAI,CAAC,KACzC,aAAa,GACjB,CACH,CAAC;YACF,MAAM;KACT;IAED,OAAO,CACL,8BAAC,uBAAU,IACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,uBAAe,CAAC,MAAM,EAC7B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,KAChB,KAAK,IAER,kBAAkB,CACR,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport {\n AvatarAccountVariant,\n AvatarAccountSize,\n AvatarBaseShape,\n} from '../../types';\nimport { AvatarBase } from '../AvatarBase';\nimport { Blockies } from '../temp-components/Blockies';\nimport { Jazzicon } from '../temp-components/Jazzicon';\nimport { Maskicon } from '../temp-components/Maskicon';\n\nimport { MAP_AVATARACCOUNT_SIZE_SIZENUMBER } from './AvatarAccount.constants';\nimport type { AvatarAccountProps } from './AvatarAccount.types';\n\nexport const AvatarAccount = forwardRef<HTMLDivElement, AvatarAccountProps>(\n (\n {\n address,\n variant = AvatarAccountVariant.Jazzicon,\n className,\n size = AvatarAccountSize.Md,\n blockiesProps,\n jazziconProps,\n maskiconProps,\n ...props\n },\n ref,\n ) => {\n let AvatarArtComponent;\n switch (variant) {\n case AvatarAccountVariant.Blockies:\n AvatarArtComponent = (\n <Blockies\n address={address}\n size={MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size]}\n {...blockiesProps}\n />\n );\n break;\n case AvatarAccountVariant.Maskicon:\n AvatarArtComponent = (\n <Maskicon\n address={address}\n size={MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size]}\n {...maskiconProps}\n />\n );\n break;\n case AvatarAccountVariant.Jazzicon:\n default:\n AvatarArtComponent = (\n <Jazzicon\n address={address}\n size={MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size]}\n {...jazziconProps}\n />\n );\n break;\n }\n\n return (\n <AvatarBase\n ref={ref}\n shape={AvatarBaseShape.
|
|
1
|
+
{"version":3,"file":"AvatarAccount.cjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,iDAIqB;AACrB,wDAA2C;AAC3C,oEAAuD;AACvD,oEAAuD;AACvD,oEAAuD;AAEvD,2EAA8E;AAGjE,QAAA,aAAa,GAAG,IAAA,kBAAU,EACrC,CACE,EACE,OAAO,EACP,OAAO,GAAG,4BAAoB,CAAC,QAAQ,EACvC,SAAS,EACT,IAAI,GAAG,yBAAiB,CAAC,EAAE,EAC3B,aAAa,EACb,aAAa,EACb,aAAa,EACb,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,IAAI,kBAAkB,CAAC;IACvB,QAAQ,OAAO,EAAE;QACf,KAAK,4BAAoB,CAAC,QAAQ;YAChC,kBAAkB,GAAG,CACnB,8BAAC,mBAAQ,IACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,2DAAiC,CAAC,IAAI,CAAC,KACzC,aAAa,GACjB,CACH,CAAC;YACF,MAAM;QACR,KAAK,4BAAoB,CAAC,QAAQ;YAChC,kBAAkB,GAAG,CACnB,8BAAC,mBAAQ,IACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,2DAAiC,CAAC,IAAI,CAAC,KACzC,aAAa,GACjB,CACH,CAAC;YACF,MAAM;QACR,KAAK,4BAAoB,CAAC,QAAQ,CAAC;QACnC;YACE,kBAAkB,GAAG,CACnB,8BAAC,mBAAQ,IACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,2DAAiC,CAAC,IAAI,CAAC,KACzC,aAAa,GACjB,CACH,CAAC;YACF,MAAM;KACT;IAED,OAAO,CACL,8BAAC,uBAAU,IACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,uBAAe,CAAC,MAAM,EAC7B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,KAChB,KAAK,IAER,kBAAkB,CACR,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport {\n AvatarAccountVariant,\n AvatarAccountSize,\n AvatarBaseShape,\n} from '../../types';\nimport { AvatarBase } from '../AvatarBase';\nimport { Blockies } from '../temp-components/Blockies';\nimport { Jazzicon } from '../temp-components/Jazzicon';\nimport { Maskicon } from '../temp-components/Maskicon';\n\nimport { MAP_AVATARACCOUNT_SIZE_SIZENUMBER } from './AvatarAccount.constants';\nimport type { AvatarAccountProps } from './AvatarAccount.types';\n\nexport const AvatarAccount = forwardRef<HTMLDivElement, AvatarAccountProps>(\n (\n {\n address,\n variant = AvatarAccountVariant.Jazzicon,\n className,\n size = AvatarAccountSize.Md,\n blockiesProps,\n jazziconProps,\n maskiconProps,\n ...props\n },\n ref,\n ) => {\n let AvatarArtComponent;\n switch (variant) {\n case AvatarAccountVariant.Blockies:\n AvatarArtComponent = (\n <Blockies\n address={address}\n size={MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size]}\n {...blockiesProps}\n />\n );\n break;\n case AvatarAccountVariant.Maskicon:\n AvatarArtComponent = (\n <Maskicon\n address={address}\n size={MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size]}\n {...maskiconProps}\n />\n );\n break;\n case AvatarAccountVariant.Jazzicon:\n default:\n AvatarArtComponent = (\n <Jazzicon\n address={address}\n size={MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size]}\n {...jazziconProps}\n />\n );\n break;\n }\n\n return (\n <AvatarBase\n ref={ref}\n shape={AvatarBaseShape.Square}\n size={size}\n className={className}\n {...props}\n >\n {AvatarArtComponent}\n </AvatarBase>\n );\n },\n);\n\nAvatarAccount.displayName = 'AvatarAccount';\n"]}
|
|
@@ -26,7 +26,7 @@ export const AvatarAccount = forwardRef(({ address, variant = AvatarAccountVaria
|
|
|
26
26
|
AvatarArtComponent = (React.createElement(Jazzicon, { address: address, size: MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size], ...jazziconProps }));
|
|
27
27
|
break;
|
|
28
28
|
}
|
|
29
|
-
return (React.createElement(AvatarBase, { ref: ref, shape: AvatarBaseShape.
|
|
29
|
+
return (React.createElement(AvatarBase, { ref: ref, shape: AvatarBaseShape.Square, size: size, className: className, ...props }, AvatarArtComponent));
|
|
30
30
|
});
|
|
31
31
|
AvatarAccount.displayName = 'AvatarAccount';
|
|
32
32
|
//# sourceMappingURL=AvatarAccount.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarAccount.mjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EAChB,8BAAoB;AACrB,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,QAAQ,EAAE,8CAAoC;AACvD,OAAO,EAAE,QAAQ,EAAE,8CAAoC;AACvD,OAAO,EAAE,QAAQ,EAAE,8CAAoC;AAEvD,OAAO,EAAE,iCAAiC,EAAE,sCAAkC;AAG9E,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CACrC,CACE,EACE,OAAO,EACP,OAAO,GAAG,oBAAoB,CAAC,QAAQ,EACvC,SAAS,EACT,IAAI,GAAG,iBAAiB,CAAC,EAAE,EAC3B,aAAa,EACb,aAAa,EACb,aAAa,EACb,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,IAAI,kBAAkB,CAAC;IACvB,QAAQ,OAAO,EAAE;QACf,KAAK,oBAAoB,CAAC,QAAQ;YAChC,kBAAkB,GAAG,CACnB,oBAAC,QAAQ,IACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,iCAAiC,CAAC,IAAI,CAAC,KACzC,aAAa,GACjB,CACH,CAAC;YACF,MAAM;QACR,KAAK,oBAAoB,CAAC,QAAQ;YAChC,kBAAkB,GAAG,CACnB,oBAAC,QAAQ,IACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,iCAAiC,CAAC,IAAI,CAAC,KACzC,aAAa,GACjB,CACH,CAAC;YACF,MAAM;QACR,KAAK,oBAAoB,CAAC,QAAQ,CAAC;QACnC;YACE,kBAAkB,GAAG,CACnB,oBAAC,QAAQ,IACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,iCAAiC,CAAC,IAAI,CAAC,KACzC,aAAa,GACjB,CACH,CAAC;YACF,MAAM;KACT;IAED,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,eAAe,CAAC,MAAM,EAC7B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,KAChB,KAAK,IAER,kBAAkB,CACR,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport {\n AvatarAccountVariant,\n AvatarAccountSize,\n AvatarBaseShape,\n} from '../../types';\nimport { AvatarBase } from '../AvatarBase';\nimport { Blockies } from '../temp-components/Blockies';\nimport { Jazzicon } from '../temp-components/Jazzicon';\nimport { Maskicon } from '../temp-components/Maskicon';\n\nimport { MAP_AVATARACCOUNT_SIZE_SIZENUMBER } from './AvatarAccount.constants';\nimport type { AvatarAccountProps } from './AvatarAccount.types';\n\nexport const AvatarAccount = forwardRef<HTMLDivElement, AvatarAccountProps>(\n (\n {\n address,\n variant = AvatarAccountVariant.Jazzicon,\n className,\n size = AvatarAccountSize.Md,\n blockiesProps,\n jazziconProps,\n maskiconProps,\n ...props\n },\n ref,\n ) => {\n let AvatarArtComponent;\n switch (variant) {\n case AvatarAccountVariant.Blockies:\n AvatarArtComponent = (\n <Blockies\n address={address}\n size={MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size]}\n {...blockiesProps}\n />\n );\n break;\n case AvatarAccountVariant.Maskicon:\n AvatarArtComponent = (\n <Maskicon\n address={address}\n size={MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size]}\n {...maskiconProps}\n />\n );\n break;\n case AvatarAccountVariant.Jazzicon:\n default:\n AvatarArtComponent = (\n <Jazzicon\n address={address}\n size={MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size]}\n {...jazziconProps}\n />\n );\n break;\n }\n\n return (\n <AvatarBase\n ref={ref}\n shape={AvatarBaseShape.
|
|
1
|
+
{"version":3,"file":"AvatarAccount.mjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EAChB,8BAAoB;AACrB,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,QAAQ,EAAE,8CAAoC;AACvD,OAAO,EAAE,QAAQ,EAAE,8CAAoC;AACvD,OAAO,EAAE,QAAQ,EAAE,8CAAoC;AAEvD,OAAO,EAAE,iCAAiC,EAAE,sCAAkC;AAG9E,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CACrC,CACE,EACE,OAAO,EACP,OAAO,GAAG,oBAAoB,CAAC,QAAQ,EACvC,SAAS,EACT,IAAI,GAAG,iBAAiB,CAAC,EAAE,EAC3B,aAAa,EACb,aAAa,EACb,aAAa,EACb,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,IAAI,kBAAkB,CAAC;IACvB,QAAQ,OAAO,EAAE;QACf,KAAK,oBAAoB,CAAC,QAAQ;YAChC,kBAAkB,GAAG,CACnB,oBAAC,QAAQ,IACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,iCAAiC,CAAC,IAAI,CAAC,KACzC,aAAa,GACjB,CACH,CAAC;YACF,MAAM;QACR,KAAK,oBAAoB,CAAC,QAAQ;YAChC,kBAAkB,GAAG,CACnB,oBAAC,QAAQ,IACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,iCAAiC,CAAC,IAAI,CAAC,KACzC,aAAa,GACjB,CACH,CAAC;YACF,MAAM;QACR,KAAK,oBAAoB,CAAC,QAAQ,CAAC;QACnC;YACE,kBAAkB,GAAG,CACnB,oBAAC,QAAQ,IACP,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,iCAAiC,CAAC,IAAI,CAAC,KACzC,aAAa,GACjB,CACH,CAAC;YACF,MAAM;KACT;IAED,OAAO,CACL,oBAAC,UAAU,IACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,eAAe,CAAC,MAAM,EAC7B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,KAChB,KAAK,IAER,kBAAkB,CACR,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import React, { forwardRef } from 'react';\n\nimport {\n AvatarAccountVariant,\n AvatarAccountSize,\n AvatarBaseShape,\n} from '../../types';\nimport { AvatarBase } from '../AvatarBase';\nimport { Blockies } from '../temp-components/Blockies';\nimport { Jazzicon } from '../temp-components/Jazzicon';\nimport { Maskicon } from '../temp-components/Maskicon';\n\nimport { MAP_AVATARACCOUNT_SIZE_SIZENUMBER } from './AvatarAccount.constants';\nimport type { AvatarAccountProps } from './AvatarAccount.types';\n\nexport const AvatarAccount = forwardRef<HTMLDivElement, AvatarAccountProps>(\n (\n {\n address,\n variant = AvatarAccountVariant.Jazzicon,\n className,\n size = AvatarAccountSize.Md,\n blockiesProps,\n jazziconProps,\n maskiconProps,\n ...props\n },\n ref,\n ) => {\n let AvatarArtComponent;\n switch (variant) {\n case AvatarAccountVariant.Blockies:\n AvatarArtComponent = (\n <Blockies\n address={address}\n size={MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size]}\n {...blockiesProps}\n />\n );\n break;\n case AvatarAccountVariant.Maskicon:\n AvatarArtComponent = (\n <Maskicon\n address={address}\n size={MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size]}\n {...maskiconProps}\n />\n );\n break;\n case AvatarAccountVariant.Jazzicon:\n default:\n AvatarArtComponent = (\n <Jazzicon\n address={address}\n size={MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size]}\n {...jazziconProps}\n />\n );\n break;\n }\n\n return (\n <AvatarBase\n ref={ref}\n shape={AvatarBaseShape.Square}\n size={size}\n className={className}\n {...props}\n >\n {AvatarArtComponent}\n </AvatarBase>\n );\n },\n);\n\nAvatarAccount.displayName = 'AvatarAccount';\n"]}
|
|
@@ -13,7 +13,7 @@ const Text = ({ variant = types_1.TextVariant.BodyMd, children, className, fontW
|
|
|
13
13
|
// When asChild is true, use Radix Slot to merge props onto the child component.
|
|
14
14
|
// Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).
|
|
15
15
|
const Component = asChild ? react_slot_1.Slot : Text_constants_1.MAP_TEXT_VARIANT_TAG[variant];
|
|
16
|
-
const mergedClassName = `${(0, tw_merge_1.twMerge)(color, Text_constants_1.CLASSMAP_TEXT_VARIANT_FONTSTYLE[variant], fontWeight || Text_constants_1.CLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant], fontStyle, textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className)}
|
|
16
|
+
const mergedClassName = `${(0, tw_merge_1.twMerge)(color, Text_constants_1.CLASSMAP_TEXT_VARIANT_FONTSTYLE[variant], fontWeight || Text_constants_1.CLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant], fontStyle, fontFamily, textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className)}`;
|
|
17
17
|
return (react_1.default.createElement(Component, { className: mergedClassName, style: style, ...props }, children));
|
|
18
18
|
};
|
|
19
19
|
exports.Text = Text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,qDAA4C;AAC5C,kDAA0B;AAE1B,iDAAiE;AACjE,uDAA+C;AAE/C,yDAI0B;AAGnB,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,mBAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GAAG,kBAAU,CAAC,OAAO,EAC/B,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,iBAAS,CAAC,WAAW,EAC7B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,gFAAgF;IAChF,sFAAsF;IACtF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAI,CAAC,CAAC,CAAC,qCAAoB,CAAC,OAAO,CAAC,CAAC;IAEjE,MAAM,eAAe,GAAG,GAAG,IAAA,kBAAO,EAChC,KAAK,EACL,gDAA+B,CAAC,OAAO,CAAC,EACxC,UAAU,IAAI,iDAAgC,CAAC,OAAO,CAAC,EACvD,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,IAAI,UAAU,EACtB,SAAS,CACV,
|
|
1
|
+
{"version":3,"file":"Text.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,qDAA4C;AAC5C,kDAA0B;AAE1B,iDAAiE;AACjE,uDAA+C;AAE/C,yDAI0B;AAGnB,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,mBAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GAAG,kBAAU,CAAC,OAAO,EAC/B,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,iBAAS,CAAC,WAAW,EAC7B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,gFAAgF;IAChF,sFAAsF;IACtF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAI,CAAC,CAAC,CAAC,qCAAoB,CAAC,OAAO,CAAC,CAAC;IAEjE,MAAM,eAAe,GAAG,GAAG,IAAA,kBAAO,EAChC,KAAK,EACL,gDAA+B,CAAC,OAAO,CAAC,EACxC,UAAU,IAAI,iDAAgC,CAAC,OAAO,CAAC,EACvD,SAAS,EACT,UAAU,EACV,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,IAAI,UAAU,EACtB,SAAS,CACV,EAAE,CAAC;IAEJ,OAAO,CACL,8BAAC,SAAS,IAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK,IAC3D,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC;AAtCW,QAAA,IAAI,QAsCf","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { FontFamily, TextColor, TextVariant } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\n\nimport {\n CLASSMAP_TEXT_VARIANT_FONTSTYLE,\n CLASSMAP_TEXT_VARIANT_FONTWEIGHT,\n MAP_TEXT_VARIANT_TAG,\n} from './Text.constants';\nimport type { TextProps } from './Text.types';\n\nexport const Text: React.FC<TextProps> = ({\n variant = TextVariant.BodyMd,\n children,\n className,\n fontWeight,\n fontFamily = FontFamily.Default,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis,\n asChild,\n color = TextColor.TextDefault,\n style,\n ...props\n}) => {\n // When asChild is true, use Radix Slot to merge props onto the child component.\n // Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).\n const Component = asChild ? Slot : MAP_TEXT_VARIANT_TAG[variant];\n\n const mergedClassName = `${twMerge(\n color,\n CLASSMAP_TEXT_VARIANT_FONTSTYLE[variant],\n fontWeight || CLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant],\n fontStyle,\n fontFamily,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis && 'truncate',\n className,\n )}`;\n\n return (\n <Component className={mergedClassName} style={style} {...props}>\n {children}\n </Component>\n );\n};\n"]}
|
|
@@ -28,11 +28,11 @@ exports.CLASSMAP_TEXT_VARIANT_FONTWEIGHT = {
|
|
|
28
28
|
[types_1.TextVariant.BodyMd]: 'font-regular',
|
|
29
29
|
[types_1.TextVariant.BodySm]: 'font-regular',
|
|
30
30
|
[types_1.TextVariant.BodyXs]: 'font-regular',
|
|
31
|
-
[types_1.TextVariant.PageHeading]: 'font-
|
|
32
|
-
[types_1.TextVariant.SectionHeading]: 'font-
|
|
33
|
-
[types_1.TextVariant.ButtonLabelMd]: 'font-
|
|
34
|
-
[types_1.TextVariant.ButtonLabelLg]: 'font-
|
|
35
|
-
[types_1.TextVariant.AmountDisplayLg]: 'font-
|
|
31
|
+
[types_1.TextVariant.PageHeading]: 'font-bold',
|
|
32
|
+
[types_1.TextVariant.SectionHeading]: 'font-bold',
|
|
33
|
+
[types_1.TextVariant.ButtonLabelMd]: 'font-medium',
|
|
34
|
+
[types_1.TextVariant.ButtonLabelLg]: 'font-medium',
|
|
35
|
+
[types_1.TextVariant.AmountDisplayLg]: 'font-bold md:font-medium',
|
|
36
36
|
};
|
|
37
37
|
exports.MAP_TEXT_VARIANT_TAG = {
|
|
38
38
|
[types_1.TextVariant.DisplayLg]: 'h1',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":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CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE,cAAc;IACpC,CAAC,mBAAW,CAAC,WAAW,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"Text.constants.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";;;AAAA,iDAA0C;AAE7B,QAAA,+BAA+B,GAAgC;IAC1E,CAAC,mBAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,mBAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,mBAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,mBAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,mBAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,mBAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,mBAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,mBAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,mBAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,mBAAW,CAAC,WAAW,CAAC,EACvB,gJAAgJ;IAClJ,CAAC,mBAAW,CAAC,cAAc,CAAC,EAC1B,kKAAkK;IACpK,CAAC,mBAAW,CAAC,aAAa,CAAC,EACzB,kKAAkK;IACpK,CAAC,mBAAW,CAAC,aAAa,CAAC,EACzB,kKAAkK;IACpK,CAAC,mBAAW,CAAC,eAAe,CAAC,EAC3B,8KAA8K;CACjL,CAAC;AAEW,QAAA,gCAAgC,GAAgC;IAC3E,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,0BAA0B;IACnD,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,0BAA0B;IACnD,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,WAAW;IACpC,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,WAAW;IACpC,CAAC,mBAAW,CAAC,SAAS,CAAC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'../../types';\n\nexport const CLASSMAP_TEXT_VARIANT_FONTSTYLE: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]:\n 'text-s-display-lg leading-s-display-lg tracking-s-display-lg md:text-l-display-lg md:leading-l-display-lg md:tracking-l-display-lg',\n [TextVariant.DisplayMd]:\n 'text-s-display-md leading-s-display-md tracking-s-display-md md:text-l-display-md md:leading-l-display-md md:tracking-l-display-md',\n [TextVariant.HeadingLg]:\n 'text-s-heading-lg leading-s-heading-lg tracking-s-heading-lg md:text-l-heading-lg md:leading-l-heading-lg md:tracking-l-heading-lg',\n [TextVariant.HeadingMd]:\n 'text-s-heading-md leading-s-heading-md tracking-s-heading-md md:text-l-heading-md md:leading-l-heading-md md:tracking-l-heading-md',\n [TextVariant.HeadingSm]:\n 'text-s-heading-sm leading-s-heading-sm tracking-s-heading-sm md:text-l-heading-sm md:leading-l-heading-sm md:tracking-l-heading-sm',\n [TextVariant.BodyLg]:\n 'text-s-body-lg leading-s-body-lg tracking-s-body-lg md:text-l-body-lg md:leading-l-body-lg md:tracking-l-body-lg',\n [TextVariant.BodyMd]:\n 'text-s-body-md leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md',\n [TextVariant.BodySm]:\n 'text-s-body-sm leading-s-body-sm tracking-s-body-sm md:text-l-body-sm md:leading-l-body-sm md:tracking-l-body-sm',\n [TextVariant.BodyXs]:\n 'text-s-body-xs leading-s-body-xs tracking-s-body-xs md:text-l-body-xs md:leading-l-body-xs md:tracking-l-body-xs',\n [TextVariant.PageHeading]:\n 'text-s-page-heading leading-s-page-heading tracking-s-page-heading md:text-l-page-heading md:leading-l-page-heading md:tracking-l-page-heading',\n [TextVariant.SectionHeading]:\n 'text-s-section-heading leading-s-section-heading tracking-s-section-heading md:text-l-section-heading md:leading-l-section-heading md:tracking-l-section-heading',\n [TextVariant.ButtonLabelMd]:\n 'text-s-button-label-md leading-s-button-label-md tracking-s-button-label-md md:text-l-button-label-md md:leading-l-button-label-md md:tracking-l-button-label-md',\n [TextVariant.ButtonLabelLg]:\n 'text-s-button-label-lg leading-s-button-label-lg tracking-s-button-label-lg md:text-l-button-label-lg md:leading-l-button-label-lg md:tracking-l-button-label-lg',\n [TextVariant.AmountDisplayLg]:\n 'text-s-amount-display-lg leading-s-amount-display-lg tracking-s-amount-display-lg md:text-l-amount-display-lg md:leading-l-amount-display-lg md:tracking-l-amount-display-lg',\n};\n\nexport const CLASSMAP_TEXT_VARIANT_FONTWEIGHT: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]: 'font-bold md:font-medium',\n [TextVariant.DisplayMd]: 'font-bold md:font-medium',\n [TextVariant.HeadingLg]: 'font-bold',\n [TextVariant.HeadingMd]: 'font-bold',\n [TextVariant.HeadingSm]: 'font-bold',\n [TextVariant.BodyLg]: 'font-medium',\n [TextVariant.BodyMd]: 'font-regular',\n [TextVariant.BodySm]: 'font-regular',\n [TextVariant.BodyXs]: 'font-regular',\n [TextVariant.PageHeading]: 'font-bold',\n [TextVariant.SectionHeading]: 'font-bold',\n [TextVariant.ButtonLabelMd]: 'font-medium',\n [TextVariant.ButtonLabelLg]: 'font-medium',\n [TextVariant.AmountDisplayLg]: 'font-bold md:font-medium',\n};\n\nexport const MAP_TEXT_VARIANT_TAG: Record<\n TextVariant,\n keyof JSX.IntrinsicElements\n> = {\n [TextVariant.DisplayLg]: 'h1',\n [TextVariant.DisplayMd]: 'h1',\n [TextVariant.HeadingLg]: 'h2',\n [TextVariant.HeadingMd]: 'h3',\n [TextVariant.HeadingSm]: 'h4',\n [TextVariant.BodyLg]: 'p',\n [TextVariant.BodyMd]: 'p',\n [TextVariant.BodySm]: 'p',\n [TextVariant.BodyXs]: 'p',\n [TextVariant.PageHeading]: 'h1',\n [TextVariant.SectionHeading]: 'h2',\n [TextVariant.ButtonLabelMd]: 'span',\n [TextVariant.ButtonLabelLg]: 'span',\n [TextVariant.AmountDisplayLg]: 'span',\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAE1C,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CA6BvE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Text.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAE1C,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CA6BvE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAexE,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,WAAW,EACX,MAAM,GAAG,CAAC,iBAAiB,CAgB5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAE1C,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CA6BvE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Text.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAE1C,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CA6BvE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAexE,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,WAAW,EACX,MAAM,GAAG,CAAC,iBAAiB,CAgB5B,CAAC"}
|
|
@@ -25,11 +25,11 @@ export const CLASSMAP_TEXT_VARIANT_FONTWEIGHT = {
|
|
|
25
25
|
[TextVariant.BodyMd]: 'font-regular',
|
|
26
26
|
[TextVariant.BodySm]: 'font-regular',
|
|
27
27
|
[TextVariant.BodyXs]: 'font-regular',
|
|
28
|
-
[TextVariant.PageHeading]: 'font-
|
|
29
|
-
[TextVariant.SectionHeading]: 'font-
|
|
30
|
-
[TextVariant.ButtonLabelMd]: 'font-
|
|
31
|
-
[TextVariant.ButtonLabelLg]: 'font-
|
|
32
|
-
[TextVariant.AmountDisplayLg]: 'font-
|
|
28
|
+
[TextVariant.PageHeading]: 'font-bold',
|
|
29
|
+
[TextVariant.SectionHeading]: 'font-bold',
|
|
30
|
+
[TextVariant.ButtonLabelMd]: 'font-medium',
|
|
31
|
+
[TextVariant.ButtonLabelLg]: 'font-medium',
|
|
32
|
+
[TextVariant.AmountDisplayLg]: 'font-bold md:font-medium',
|
|
33
33
|
};
|
|
34
34
|
export const MAP_TEXT_VARIANT_TAG = {
|
|
35
35
|
[TextVariant.DisplayLg]: 'h1',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAE1C,MAAM,CAAC,MAAM,+BAA+B,GAAgC;IAC1E,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,WAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,WAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,WAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,WAAW,CAAC,MAAM,CAAC,EAClB,kHAAkH;IACpH,CAAC,WAAW,CAAC,WAAW,CAAC,EACvB,gJAAgJ;IAClJ,CAAC,WAAW,CAAC,cAAc,CAAC,EAC1B,kKAAkK;IACpK,CAAC,WAAW,CAAC,aAAa,CAAC,EACzB,kKAAkK;IACpK,CAAC,WAAW,CAAC,aAAa,CAAC,EACzB,kKAAkK;IACpK,CAAC,WAAW,CAAC,eAAe,CAAC,EAC3B,8KAA8K;CACjL,CAAC;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAAgC;IAC3E,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,0BAA0B;IACnD,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,0BAA0B;IACnD,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,WAAW;IACpC,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,WAAW;IACpC,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,WAAW;IACpC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,aAAa;IACnC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,cAAc;IACpC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,cAAc;IACpC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,cAAc;IACpC,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"Text.constants.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAE1C,MAAM,CAAC,MAAM,+BAA+B,GAAgC;IAC1E,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,oIAAoI;IACtI,CAAC,WAAW,CAAC,SAAS,CAAC,EACrB,oI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a,CAAC,EAAE,aAAa;IAC1C,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,aAAa;IAC1C,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,0BAA0B;CAC1D,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAG7B;IACF,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI;IAC7B,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG;IACzB,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,IAAI;IAC/B,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,IAAI;IAClC,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,MAAM;IACnC,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,MAAM;CACtC,CAAC","sourcesContent":["import { TextVariant } from '../../types';\n\nexport const CLASSMAP_TEXT_VARIANT_FONTSTYLE: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]:\n 'text-s-display-lg leading-s-display-lg tracking-s-display-lg md:text-l-display-lg md:leading-l-display-lg md:tracking-l-display-lg',\n [TextVariant.DisplayMd]:\n 'text-s-display-md leading-s-display-md tracking-s-display-md md:text-l-display-md md:leading-l-display-md md:tracking-l-display-md',\n [TextVariant.HeadingLg]:\n 'text-s-heading-lg leading-s-heading-lg tracking-s-heading-lg md:text-l-heading-lg md:leading-l-heading-lg md:tracking-l-heading-lg',\n [TextVariant.HeadingMd]:\n 'text-s-heading-md leading-s-heading-md tracking-s-heading-md md:text-l-heading-md md:leading-l-heading-md md:tracking-l-heading-md',\n [TextVariant.HeadingSm]:\n 'text-s-heading-sm leading-s-heading-sm tracking-s-heading-sm md:text-l-heading-sm md:leading-l-heading-sm md:tracking-l-heading-sm',\n [TextVariant.BodyLg]:\n 'text-s-body-lg leading-s-body-lg tracking-s-body-lg md:text-l-body-lg md:leading-l-body-lg md:tracking-l-body-lg',\n [TextVariant.BodyMd]:\n 'text-s-body-md leading-s-body-md tracking-s-body-md md:text-l-body-md md:leading-l-body-md md:tracking-l-body-md',\n [TextVariant.BodySm]:\n 'text-s-body-sm leading-s-body-sm tracking-s-body-sm md:text-l-body-sm md:leading-l-body-sm md:tracking-l-body-sm',\n [TextVariant.BodyXs]:\n 'text-s-body-xs leading-s-body-xs tracking-s-body-xs md:text-l-body-xs md:leading-l-body-xs md:tracking-l-body-xs',\n [TextVariant.PageHeading]:\n 'text-s-page-heading leading-s-page-heading tracking-s-page-heading md:text-l-page-heading md:leading-l-page-heading md:tracking-l-page-heading',\n [TextVariant.SectionHeading]:\n 'text-s-section-heading leading-s-section-heading tracking-s-section-heading md:text-l-section-heading md:leading-l-section-heading md:tracking-l-section-heading',\n [TextVariant.ButtonLabelMd]:\n 'text-s-button-label-md leading-s-button-label-md tracking-s-button-label-md md:text-l-button-label-md md:leading-l-button-label-md md:tracking-l-button-label-md',\n [TextVariant.ButtonLabelLg]:\n 'text-s-button-label-lg leading-s-button-label-lg tracking-s-button-label-lg md:text-l-button-label-lg md:leading-l-button-label-lg md:tracking-l-button-label-lg',\n [TextVariant.AmountDisplayLg]:\n 'text-s-amount-display-lg leading-s-amount-display-lg tracking-s-amount-display-lg md:text-l-amount-display-lg md:leading-l-amount-display-lg md:tracking-l-amount-display-lg',\n};\n\nexport const CLASSMAP_TEXT_VARIANT_FONTWEIGHT: Record<TextVariant, string> = {\n [TextVariant.DisplayLg]: 'font-bold md:font-medium',\n [TextVariant.DisplayMd]: 'font-bold md:font-medium',\n [TextVariant.HeadingLg]: 'font-bold',\n [TextVariant.HeadingMd]: 'font-bold',\n [TextVariant.HeadingSm]: 'font-bold',\n [TextVariant.BodyLg]: 'font-medium',\n [TextVariant.BodyMd]: 'font-regular',\n [TextVariant.BodySm]: 'font-regular',\n [TextVariant.BodyXs]: 'font-regular',\n [TextVariant.PageHeading]: 'font-bold',\n [TextVariant.SectionHeading]: 'font-bold',\n [TextVariant.ButtonLabelMd]: 'font-medium',\n [TextVariant.ButtonLabelLg]: 'font-medium',\n [TextVariant.AmountDisplayLg]: 'font-bold md:font-medium',\n};\n\nexport const MAP_TEXT_VARIANT_TAG: Record<\n TextVariant,\n keyof JSX.IntrinsicElements\n> = {\n [TextVariant.DisplayLg]: 'h1',\n [TextVariant.DisplayMd]: 'h1',\n [TextVariant.HeadingLg]: 'h2',\n [TextVariant.HeadingMd]: 'h3',\n [TextVariant.HeadingSm]: 'h4',\n [TextVariant.BodyLg]: 'p',\n [TextVariant.BodyMd]: 'p',\n [TextVariant.BodySm]: 'p',\n [TextVariant.BodyXs]: 'p',\n [TextVariant.PageHeading]: 'h1',\n [TextVariant.SectionHeading]: 'h2',\n [TextVariant.ButtonLabelMd]: 'span',\n [TextVariant.ButtonLabelLg]: 'span',\n [TextVariant.AmountDisplayLg]: 'span',\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAU1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"Text.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAU1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAsCpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAU1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"Text.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAU1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAsCpC,CAAC"}
|
|
@@ -14,7 +14,7 @@ export const Text = ({ variant = TextVariant.BodyMd, children, className, fontWe
|
|
|
14
14
|
// When asChild is true, use Radix Slot to merge props onto the child component.
|
|
15
15
|
// Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).
|
|
16
16
|
const Component = asChild ? Slot : MAP_TEXT_VARIANT_TAG[variant];
|
|
17
|
-
const mergedClassName = `${twMerge(color, CLASSMAP_TEXT_VARIANT_FONTSTYLE[variant], fontWeight || CLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant], fontStyle, textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className)}
|
|
17
|
+
const mergedClassName = `${twMerge(color, CLASSMAP_TEXT_VARIANT_FONTSTYLE[variant], fontWeight || CLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant], fontStyle, fontFamily, textTransform, textAlign, overflowWrap, ellipsis && 'truncate', className)}`;
|
|
18
18
|
return (React.createElement(Component, { className: mergedClassName, style: style, ...props }, children));
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=Text.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,6BAA6B;AAC5C,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,8BAAoB;AACjE,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAE/C,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EAChC,oBAAoB,EACrB,6BAAyB;AAG1B,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,WAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GAAG,UAAU,CAAC,OAAO,EAC/B,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,SAAS,CAAC,WAAW,EAC7B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,gFAAgF;IAChF,sFAAsF;IACtF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAEjE,MAAM,eAAe,GAAG,GAAG,OAAO,CAChC,KAAK,EACL,+BAA+B,CAAC,OAAO,CAAC,EACxC,UAAU,IAAI,gCAAgC,CAAC,OAAO,CAAC,EACvD,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,IAAI,UAAU,EACtB,SAAS,CACV,
|
|
1
|
+
{"version":3,"file":"Text.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,6BAA6B;AAC5C,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,8BAAoB;AACjE,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAE/C,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EAChC,oBAAoB,EACrB,6BAAyB;AAG1B,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,WAAW,CAAC,MAAM,EAC5B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,GAAG,UAAU,CAAC,OAAO,EAC/B,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,KAAK,GAAG,SAAS,CAAC,WAAW,EAC7B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,gFAAgF;IAChF,sFAAsF;IACtF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAEjE,MAAM,eAAe,GAAG,GAAG,OAAO,CAChC,KAAK,EACL,+BAA+B,CAAC,OAAO,CAAC,EACxC,UAAU,IAAI,gCAAgC,CAAC,OAAO,CAAC,EACvD,SAAS,EACT,UAAU,EACV,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,IAAI,UAAU,EACtB,SAAS,CACV,EAAE,CAAC;IAEJ,OAAO,CACL,oBAAC,SAAS,IAAC,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK,IAC3D,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport React from 'react';\n\nimport { FontFamily, TextColor, TextVariant } from '../../types';\nimport { twMerge } from '../../utils/tw-merge';\n\nimport {\n CLASSMAP_TEXT_VARIANT_FONTSTYLE,\n CLASSMAP_TEXT_VARIANT_FONTWEIGHT,\n MAP_TEXT_VARIANT_TAG,\n} from './Text.constants';\nimport type { TextProps } from './Text.types';\n\nexport const Text: React.FC<TextProps> = ({\n variant = TextVariant.BodyMd,\n children,\n className,\n fontWeight,\n fontFamily = FontFamily.Default,\n fontStyle,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis,\n asChild,\n color = TextColor.TextDefault,\n style,\n ...props\n}) => {\n // When asChild is true, use Radix Slot to merge props onto the child component.\n // Otherwise, render the semantic HTML element mapped to this variant (e.g. h1-h4, p).\n const Component = asChild ? Slot : MAP_TEXT_VARIANT_TAG[variant];\n\n const mergedClassName = `${twMerge(\n color,\n CLASSMAP_TEXT_VARIANT_FONTSTYLE[variant],\n fontWeight || CLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant],\n fontStyle,\n fontFamily,\n textTransform,\n textAlign,\n overflowWrap,\n ellipsis && 'truncate',\n className,\n )}`;\n\n return (\n <Component className={mergedClassName} style={style} {...props}>\n {children}\n </Component>\n );\n};\n"]}
|
|
@@ -94,7 +94,7 @@ const Jazzicon = ({ address, size = 32, className, ...props }) => {
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
}, [address, size]);
|
|
97
|
-
return (react_1.default.createElement("div", { ref: containerRef, className: (0, tw_merge_1.twMerge)('flex', className), ...props }));
|
|
97
|
+
return (react_1.default.createElement("div", { ref: containerRef, className: (0, tw_merge_1.twMerge)('flex [&>div]:!rounded-none', className), ...props }));
|
|
98
98
|
};
|
|
99
99
|
exports.Jazzicon = Jazzicon;
|
|
100
100
|
exports.Jazzicon.displayName = 'Jazzicon';
|
|
@@ -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;IA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EAAE,CAAC,KAAK,CAAC,GAAG,EAAE;YAC5B,iDAAiD;QACnD,CAAC,CAAC,CAAC;QAEH,UAAU;QACV,OAAO,GAAG,EAAE;YACV,WAAW,GAAG,IAAI,CAAC;YACnB,IAAI,YAAY,CAAC,OAAO,EAAE;gBACxB,OAAO,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE;oBACtC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;iBACnE;aACF;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAEpB,OAAO,CACL,uCACE,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,IAAA,kBAAO,EAAC,4BAA4B,EAAE,SAAS,CAAC,KACvD,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC;AA/EW,QAAA,QAAQ,YA+EnB;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\n ref={containerRef}\n className={twMerge('flex [&>div]:!rounded-none', className)}\n {...props}\n />\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;;CA0Ef,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;;CA0Ef,CAAC"}
|
|
@@ -73,7 +73,7 @@ export const Jazzicon = ({ address, size = 32, className, ...props }) => {
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
}, [address, size]);
|
|
76
|
-
return (React.createElement("div", { ref: containerRef, className: twMerge('flex', className), ...props }));
|
|
76
|
+
return (React.createElement("div", { ref: containerRef, className: twMerge('flex [&>div]:!rounded-none', className), ...props }));
|
|
77
77
|
};
|
|
78
78
|
Jazzicon.displayName = 'Jazzicon';
|
|
79
79
|
//# sourceMappingURL=Jazzicon.mjs.map
|
|
@@ -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,C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,IAAI,CAAC,WAAW,IAAI,YAAY,CAAC,OAAO,EAAE;gBACxC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;aAC3D;QACH,CAAC,CAAC;QAEF,gBAAgB,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE;YAC5B,iDAAiD;QACnD,CAAC,CAAC,CAAC;QAEH,UAAU;QACV,OAAO,GAAG,EAAE;YACV,WAAW,GAAG,IAAI,CAAC;YACnB,IAAI,YAAY,CAAC,OAAO,EAAE;gBACxB,OAAO,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE;oBACtC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;iBACnE;aACF;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAEpB,OAAO,CACL,6BACE,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,OAAO,CAAC,4BAA4B,EAAE,SAAS,CAAC,KACvD,KAAK,GACT,CACH,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\n ref={containerRef}\n className={twMerge('flex [&>div]:!rounded-none', className)}\n {...props}\n />\n );\n};\n\nJazzicon.displayName = 'Jazzicon';\n"]}
|
|
@@ -24,11 +24,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Maskicon = void 0;
|
|
27
|
-
const dompurify = __importStar(require("dompurify"));
|
|
28
27
|
const react_1 = __importStar(require("react"));
|
|
29
28
|
const Maskicon_utilities_1 = require("./Maskicon.utilities.cjs");
|
|
30
|
-
const
|
|
31
|
-
const Maskicon = ({ address, size = 32, style, ...props }) => {
|
|
29
|
+
const Maskicon = ({ address, size = 32, className, ...props }) => {
|
|
32
30
|
const [svgString, setSvgString] = (0, react_1.useState)('');
|
|
33
31
|
(0, react_1.useEffect)(() => {
|
|
34
32
|
let cancelled = false;
|
|
@@ -43,10 +41,20 @@ const Maskicon = ({ address, size = 32, style, ...props }) => {
|
|
|
43
41
|
cancelled = true;
|
|
44
42
|
};
|
|
45
43
|
}, [address, size]);
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
const dataUri = (0, react_1.useMemo)(() => {
|
|
45
|
+
if (!svgString) {
|
|
46
|
+
return '';
|
|
47
|
+
}
|
|
48
|
+
// Normalize whitespace and encode the SVG for safe data URI usage
|
|
49
|
+
const cleanedSvg = svgString.replace(/\s+/gu, ' ').trim();
|
|
50
|
+
const encoded = encodeURIComponent(cleanedSvg);
|
|
51
|
+
return `data:image/svg+xml,${encoded}`;
|
|
52
|
+
}, [svgString]);
|
|
53
|
+
if (!dataUri) {
|
|
54
|
+
// Return an img element with transparent placeholder to maintain consistent typing
|
|
55
|
+
return (react_1.default.createElement("img", { alt: "maskicon", width: size, height: size, className: className, src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E", ...props }));
|
|
48
56
|
}
|
|
49
|
-
return (react_1.default.createElement("
|
|
57
|
+
return (react_1.default.createElement("img", { alt: "maskicon", width: size, height: size, className: className, src: dataUri, ...props }));
|
|
50
58
|
};
|
|
51
59
|
exports.Maskicon = Maskicon;
|
|
52
60
|
exports.Maskicon.displayName = 'Maskicon';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Maskicon.cjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"Maskicon.cjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4D;AAG5D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AAO,CACL,uCACE,GAAG,EAAC,UAAU,EACd,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,OAAO,KACR,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC;AAxDW,QAAA,QAAQ,YAwDnB;AAEF,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\n\nimport type { MaskiconProps } from './Maskicon.types';\nimport { getMaskiconSVG } from './Maskicon.utilities';\n\nexport const Maskicon = ({\n address,\n size = 32,\n className,\n ...props\n}: MaskiconProps) => {\n const [svgString, setSvgString] = useState('');\n\n useEffect(() => {\n let cancelled = false;\n // eslint-disable-next-line no-void\n void (async () => {\n const newSvg = await getMaskiconSVG(address, size);\n if (!cancelled) {\n setSvgString(newSvg);\n }\n })();\n return () => {\n cancelled = true;\n };\n }, [address, size]);\n\n const dataUri = useMemo(() => {\n if (!svgString) {\n return '';\n }\n // Normalize whitespace and encode the SVG for safe data URI usage\n const cleanedSvg = svgString.replace(/\\s+/gu, ' ').trim();\n const encoded = encodeURIComponent(cleanedSvg);\n return `data:image/svg+xml,${encoded}`;\n }, [svgString]);\n\n if (!dataUri) {\n // Return an img element with transparent placeholder to maintain consistent typing\n return (\n <img\n alt=\"maskicon\"\n width={size}\n height={size}\n className={className}\n src=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E\"\n {...props}\n />\n );\n }\n\n return (\n <img\n alt=\"maskicon\"\n width={size}\n height={size}\n className={className}\n src={dataUri}\n {...props}\n />\n );\n};\n\nMaskicon.displayName = 'Maskicon';\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { MaskiconProps } from "./Maskicon.types.cjs";
|
|
3
3
|
export declare const Maskicon: {
|
|
4
|
-
({ address, size,
|
|
4
|
+
({ address, size, className, ...props }: MaskiconProps): React.JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=Maskicon.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Maskicon.d.cts","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Maskicon.d.cts","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,cAAc;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAGtD,eAAO,MAAM,QAAQ;6CAKlB,aAAa;;CAmDf,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { MaskiconProps } from "./Maskicon.types.mjs";
|
|
3
3
|
export declare const Maskicon: {
|
|
4
|
-
({ address, size,
|
|
4
|
+
({ address, size, className, ...props }: MaskiconProps): React.JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=Maskicon.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Maskicon.d.mts","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Maskicon.d.mts","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,cAAc;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,6BAAyB;AAGtD,eAAO,MAAM,QAAQ;6CAKlB,aAAa;;CAmDf,CAAC"}
|
|
@@ -4,12 +4,10 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
-
import
|
|
8
|
-
import $React, { useEffect, useState } from "react";
|
|
7
|
+
import $React, { useEffect, useMemo, useState } from "react";
|
|
9
8
|
const React = $importDefault($React);
|
|
10
9
|
import { getMaskiconSVG } from "./Maskicon.utilities.mjs";
|
|
11
|
-
const
|
|
12
|
-
export const Maskicon = ({ address, size = 32, style, ...props }) => {
|
|
10
|
+
export const Maskicon = ({ address, size = 32, className, ...props }) => {
|
|
13
11
|
const [svgString, setSvgString] = useState('');
|
|
14
12
|
useEffect(() => {
|
|
15
13
|
let cancelled = false;
|
|
@@ -24,10 +22,20 @@ export const Maskicon = ({ address, size = 32, style, ...props }) => {
|
|
|
24
22
|
cancelled = true;
|
|
25
23
|
};
|
|
26
24
|
}, [address, size]);
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const dataUri = useMemo(() => {
|
|
26
|
+
if (!svgString) {
|
|
27
|
+
return '';
|
|
28
|
+
}
|
|
29
|
+
// Normalize whitespace and encode the SVG for safe data URI usage
|
|
30
|
+
const cleanedSvg = svgString.replace(/\s+/gu, ' ').trim();
|
|
31
|
+
const encoded = encodeURIComponent(cleanedSvg);
|
|
32
|
+
return `data:image/svg+xml,${encoded}`;
|
|
33
|
+
}, [svgString]);
|
|
34
|
+
if (!dataUri) {
|
|
35
|
+
// Return an img element with transparent placeholder to maintain consistent typing
|
|
36
|
+
return (React.createElement("img", { alt: "maskicon", width: size, height: size, className: className, src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E", ...props }));
|
|
29
37
|
}
|
|
30
|
-
return (React.createElement("
|
|
38
|
+
return (React.createElement("img", { alt: "maskicon", width: size, height: size, className: className, src: dataUri, ...props }));
|
|
31
39
|
};
|
|
32
40
|
Maskicon.displayName = 'Maskicon';
|
|
33
41
|
//# sourceMappingURL=Maskicon.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Maskicon.mjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Maskicon.mjs","sourceRoot":"","sources":["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AU,EACd,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,SAAS,EAAE,SAAS,EACpB,GAAG,EAAC,kEAAkE,KAClE,KAAK,GACT,CACH,CAAC;KACH;IAED,OAAO,CACL,6BACE,GAAG,EAAC,UAAU,EACd,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,OAAO,KACR,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["import React, { useEffect, useMemo, useState } from 'react';\n\nimport type { MaskiconProps } from './Maskicon.types';\nimport { getMaskiconSVG } from './Maskicon.utilities';\n\nexport const Maskicon = ({\n address,\n size = 32,\n className,\n ...props\n}: MaskiconProps) => {\n const [svgString, setSvgString] = useState('');\n\n useEffect(() => {\n let cancelled = false;\n // eslint-disable-next-line no-void\n void (async () => {\n const newSvg = await getMaskiconSVG(address, size);\n if (!cancelled) {\n setSvgString(newSvg);\n }\n })();\n return () => {\n cancelled = true;\n };\n }, [address, size]);\n\n const dataUri = useMemo(() => {\n if (!svgString) {\n return '';\n }\n // Normalize whitespace and encode the SVG for safe data URI usage\n const cleanedSvg = svgString.replace(/\\s+/gu, ' ').trim();\n const encoded = encodeURIComponent(cleanedSvg);\n return `data:image/svg+xml,${encoded}`;\n }, [svgString]);\n\n if (!dataUri) {\n // Return an img element with transparent placeholder to maintain consistent typing\n return (\n <img\n alt=\"maskicon\"\n width={size}\n height={size}\n className={className}\n src=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E\"\n {...props}\n />\n );\n }\n\n return (\n <img\n alt=\"maskicon\"\n width={size}\n height={size}\n className={className}\n src={dataUri}\n {...props}\n />\n );\n};\n\nMaskicon.displayName = 'Maskicon';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Maskicon.types.cjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\n/**\n * Maskicon component props.\n */\nexport type MaskiconProps = ComponentProps<'
|
|
1
|
+
{"version":3,"file":"Maskicon.types.cjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\n/**\n * Maskicon component props.\n */\nexport type MaskiconProps = Omit<ComponentProps<'img'>, 'width' | 'height'> & {\n /**\n * Required address used as a unique identifier to generate the Maskicon.\n */\n address: string;\n /**\n * Optional prop to control the size of the Maskicon.\n * This will set both width and height.\n */\n size?: number;\n /**\n * Optional CSS class name to apply to the Maskicon.\n */\n className?: string;\n /**\n * Optional prop to add a test id to the icon\n */\n 'data-testid'?: string;\n};\n"]}
|
|
@@ -2,15 +2,20 @@ import type { ComponentProps } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* Maskicon component props.
|
|
4
4
|
*/
|
|
5
|
-
export type MaskiconProps = ComponentProps<'
|
|
5
|
+
export type MaskiconProps = Omit<ComponentProps<'img'>, 'width' | 'height'> & {
|
|
6
6
|
/**
|
|
7
7
|
* Required address used as a unique identifier to generate the Maskicon.
|
|
8
8
|
*/
|
|
9
9
|
address: string;
|
|
10
10
|
/**
|
|
11
11
|
* Optional prop to control the size of the Maskicon.
|
|
12
|
+
* This will set both width and height.
|
|
12
13
|
*/
|
|
13
14
|
size?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Optional CSS class name to apply to the Maskicon.
|
|
17
|
+
*/
|
|
18
|
+
className?: string;
|
|
14
19
|
/**
|
|
15
20
|
* Optional prop to add a test id to the icon
|
|
16
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Maskicon.types.d.cts","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"Maskicon.types.d.cts","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,GAAG;IAC5E;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
|
|
@@ -2,15 +2,20 @@ import type { ComponentProps } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* Maskicon component props.
|
|
4
4
|
*/
|
|
5
|
-
export type MaskiconProps = ComponentProps<'
|
|
5
|
+
export type MaskiconProps = Omit<ComponentProps<'img'>, 'width' | 'height'> & {
|
|
6
6
|
/**
|
|
7
7
|
* Required address used as a unique identifier to generate the Maskicon.
|
|
8
8
|
*/
|
|
9
9
|
address: string;
|
|
10
10
|
/**
|
|
11
11
|
* Optional prop to control the size of the Maskicon.
|
|
12
|
+
* This will set both width and height.
|
|
12
13
|
*/
|
|
13
14
|
size?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Optional CSS class name to apply to the Maskicon.
|
|
17
|
+
*/
|
|
18
|
+
className?: string;
|
|
14
19
|
/**
|
|
15
20
|
* Optional prop to add a test id to the icon
|
|
16
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Maskicon.types.d.mts","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"Maskicon.types.d.mts","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,GAAG;IAC5E;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Maskicon.types.mjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\n/**\n * Maskicon component props.\n */\nexport type MaskiconProps = ComponentProps<'
|
|
1
|
+
{"version":3,"file":"Maskicon.types.mjs","sourceRoot":"","sources":["../../../../src/components/temp-components/Maskicon/Maskicon.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\n/**\n * Maskicon component props.\n */\nexport type MaskiconProps = Omit<ComponentProps<'img'>, 'width' | 'height'> & {\n /**\n * Required address used as a unique identifier to generate the Maskicon.\n */\n address: string;\n /**\n * Optional prop to control the size of the Maskicon.\n * This will set both width and height.\n */\n size?: number;\n /**\n * Optional CSS class name to apply to the Maskicon.\n */\n className?: string;\n /**\n * Optional prop to add a test id to the icon\n */\n 'data-testid'?: string;\n};\n"]}
|
package/dist/utils/tw-merge.cjs
CHANGED
|
@@ -21,6 +21,16 @@ const variantClassGroups = [
|
|
|
21
21
|
'l-body-md',
|
|
22
22
|
'l-body-sm',
|
|
23
23
|
'l-body-xs',
|
|
24
|
+
's-page-heading',
|
|
25
|
+
's-section-heading',
|
|
26
|
+
's-button-label-md',
|
|
27
|
+
's-button-label-lg',
|
|
28
|
+
's-amount-display-lg',
|
|
29
|
+
'l-page-heading',
|
|
30
|
+
'l-section-heading',
|
|
31
|
+
'l-button-label-md',
|
|
32
|
+
'l-button-label-lg',
|
|
33
|
+
'l-amount-display-lg',
|
|
24
34
|
];
|
|
25
35
|
/**
|
|
26
36
|
* Custom Tailwind Merge configuration to handle our design system's typography classes.
|
|
@@ -42,6 +52,7 @@ exports.twMerge = (0, tailwind_merge_1.extendTailwindMerge)({
|
|
|
42
52
|
text: variantClassGroups,
|
|
43
53
|
},
|
|
44
54
|
],
|
|
55
|
+
'font-family': ['font-default', 'font-accent', 'font-hero'],
|
|
45
56
|
'font-weight': [
|
|
46
57
|
'font-thin',
|
|
47
58
|
'font-extralight',
|
|
@@ -58,6 +69,7 @@ exports.twMerge = (0, tailwind_merge_1.extendTailwindMerge)({
|
|
|
58
69
|
conflictingClassGroups: {
|
|
59
70
|
'text-color': ['text-color'],
|
|
60
71
|
'font-size': ['font-size'],
|
|
72
|
+
'font-family': ['font-family'],
|
|
61
73
|
'font-weight': ['font-weight'],
|
|
62
74
|
},
|
|
63
75
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tw-merge.cjs","sourceRoot":"","sources":["../../src/utils/tw-merge.ts"],"names":[],"mappings":";;;AAAA,mDAAqD;AAErD,MAAM,kBAAkB,GAAG;IACzB,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;
|
|
1
|
+
{"version":3,"file":"tw-merge.cjs","sourceRoot":"","sources":["../../src/utils/tw-merge.ts"],"names":[],"mappings":";;;AAAA,mDAAqD;AAErD,MAAM,kBAAkB,GAAG;IACzB,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;IACrB,gBAAgB;IAChB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;CACtB,CAAC;AAEF;;;;;;;;;;GAUG;AACU,QAAA,OAAO,GAAG,IAAA,oCAAmB,EAAC;IACzC,MAAM,EAAE;QACN,WAAW,EAAE;YACX,YAAY,EAAE,CAAC,cAAc,EAAE,kBAAkB,EAAE,YAAY,CAAC;YAChE,WAAW,EAAE;gBACX;oBACE,IAAI,EAAE,kBAAkB;iBACzB;aACF;YACD,aAAa,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,WAAW,CAAC;YAC3D,aAAa,EAAE;gBACb,WAAW;gBACX,iBAAiB;gBACjB,YAAY;gBACZ,aAAa;gBACb,cAAc;gBACd,aAAa;gBACb,eAAe;gBACf,WAAW;gBACX,gBAAgB;gBAChB,YAAY;aACb;SACF;QACD,sBAAsB,EAAE;YACtB,YAAY,EAAE,CAAC,YAAY,CAAC;YAC5B,WAAW,EAAE,CAAC,WAAW,CAAC;YAC1B,aAAa,EAAE,CAAC,aAAa,CAAC;YAC9B,aAAa,EAAE,CAAC,aAAa,CAAC;SAC/B;KACF;CACF,CAAC,CAAC","sourcesContent":["import { extendTailwindMerge } from 'tailwind-merge';\n\nconst variantClassGroups = [\n 's-display-lg',\n 's-display-md',\n 's-heading-lg',\n 's-heading-md',\n 's-heading-sm',\n 's-body-lg',\n 's-body-md',\n 's-body-sm',\n 's-body-xs',\n 'l-display-lg',\n 'l-display-md',\n 'l-heading-lg',\n 'l-heading-md',\n 'l-heading-sm',\n 'l-body-lg',\n 'l-body-md',\n 'l-body-sm',\n 'l-body-xs',\n 's-page-heading',\n 's-section-heading',\n 's-button-label-md',\n 's-button-label-lg',\n 's-amount-display-lg',\n 'l-page-heading',\n 'l-section-heading',\n 'l-button-label-md',\n 'l-button-label-lg',\n 'l-amount-display-lg',\n];\n\n/**\n * Custom Tailwind Merge configuration to handle our design system's typography classes.\n * This extends the default Tailwind Merge behavior to properly handle conflicts between:\n * 1. Custom text color classes (text-default, text-alternative, text-muted)\n * 2. Typography variant classes for font sizes (e.g., s-body-md, l-heading-lg)\n * 3. Standard and custom font weight classes\n *\n * Without this configuration, Tailwind Merge wouldn't know these classes are meant\n * to override each other, potentially leading to multiple conflicting classes\n * being applied simultaneously.\n */\nexport const twMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n 'text-color': ['text-default', 'text-alternative', 'text-muted'],\n 'font-size': [\n {\n text: variantClassGroups,\n },\n ],\n 'font-family': ['font-default', 'font-accent', 'font-hero'],\n 'font-weight': [\n 'font-thin',\n 'font-extralight',\n 'font-light',\n 'font-normal',\n 'font-regular',\n 'font-medium',\n 'font-semibold',\n 'font-bold',\n 'font-extrabold',\n 'font-black',\n ],\n },\n conflictingClassGroups: {\n 'text-color': ['text-color'],\n 'font-size': ['font-size'],\n 'font-family': ['font-family'],\n 'font-weight': ['font-weight'],\n },\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tw-merge.d.cts","sourceRoot":"","sources":["../../src/utils/tw-merge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tw-merge.d.cts","sourceRoot":"","sources":["../../src/utils/tw-merge.ts"],"names":[],"mappings":"AAiCA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,sEA8BlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tw-merge.d.mts","sourceRoot":"","sources":["../../src/utils/tw-merge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tw-merge.d.mts","sourceRoot":"","sources":["../../src/utils/tw-merge.ts"],"names":[],"mappings":"AAiCA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,sEA8BlB,CAAC"}
|
package/dist/utils/tw-merge.mjs
CHANGED
|
@@ -18,6 +18,16 @@ const variantClassGroups = [
|
|
|
18
18
|
'l-body-md',
|
|
19
19
|
'l-body-sm',
|
|
20
20
|
'l-body-xs',
|
|
21
|
+
's-page-heading',
|
|
22
|
+
's-section-heading',
|
|
23
|
+
's-button-label-md',
|
|
24
|
+
's-button-label-lg',
|
|
25
|
+
's-amount-display-lg',
|
|
26
|
+
'l-page-heading',
|
|
27
|
+
'l-section-heading',
|
|
28
|
+
'l-button-label-md',
|
|
29
|
+
'l-button-label-lg',
|
|
30
|
+
'l-amount-display-lg',
|
|
21
31
|
];
|
|
22
32
|
/**
|
|
23
33
|
* Custom Tailwind Merge configuration to handle our design system's typography classes.
|
|
@@ -39,6 +49,7 @@ export const twMerge = extendTailwindMerge({
|
|
|
39
49
|
text: variantClassGroups,
|
|
40
50
|
},
|
|
41
51
|
],
|
|
52
|
+
'font-family': ['font-default', 'font-accent', 'font-hero'],
|
|
42
53
|
'font-weight': [
|
|
43
54
|
'font-thin',
|
|
44
55
|
'font-extralight',
|
|
@@ -55,6 +66,7 @@ export const twMerge = extendTailwindMerge({
|
|
|
55
66
|
conflictingClassGroups: {
|
|
56
67
|
'text-color': ['text-color'],
|
|
57
68
|
'font-size': ['font-size'],
|
|
69
|
+
'font-family': ['font-family'],
|
|
58
70
|
'font-weight': ['font-weight'],
|
|
59
71
|
},
|
|
60
72
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tw-merge.mjs","sourceRoot":"","sources":["../../src/utils/tw-merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,uBAAuB;AAErD,MAAM,kBAAkB,GAAG;IACzB,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;
|
|
1
|
+
{"version":3,"file":"tw-merge.mjs","sourceRoot":"","sources":["../../src/utils/tw-merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,uBAAuB;AAErD,MAAM,kBAAkB,GAAG;IACzB,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;IACrB,gBAAgB;IAChB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;CACtB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAAC;IACzC,MAAM,EAAE;QACN,WAAW,EAAE;YACX,YAAY,EAAE,CAAC,cAAc,EAAE,kBAAkB,EAAE,YAAY,CAAC;YAChE,WAAW,EAAE;gBACX;oBACE,IAAI,EAAE,kBAAkB;iBACzB;aACF;YACD,aAAa,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,WAAW,CAAC;YAC3D,aAAa,EAAE;gBACb,WAAW;gBACX,iBAAiB;gBACjB,YAAY;gBACZ,aAAa;gBACb,cAAc;gBACd,aAAa;gBACb,eAAe;gBACf,WAAW;gBACX,gBAAgB;gBAChB,YAAY;aACb;SACF;QACD,sBAAsB,EAAE;YACtB,YAAY,EAAE,CAAC,YAAY,CAAC;YAC5B,WAAW,EAAE,CAAC,WAAW,CAAC;YAC1B,aAAa,EAAE,CAAC,aAAa,CAAC;YAC9B,aAAa,EAAE,CAAC,aAAa,CAAC;SAC/B;KACF;CACF,CAAC,CAAC","sourcesContent":["import { extendTailwindMerge } from 'tailwind-merge';\n\nconst variantClassGroups = [\n 's-display-lg',\n 's-display-md',\n 's-heading-lg',\n 's-heading-md',\n 's-heading-sm',\n 's-body-lg',\n 's-body-md',\n 's-body-sm',\n 's-body-xs',\n 'l-display-lg',\n 'l-display-md',\n 'l-heading-lg',\n 'l-heading-md',\n 'l-heading-sm',\n 'l-body-lg',\n 'l-body-md',\n 'l-body-sm',\n 'l-body-xs',\n 's-page-heading',\n 's-section-heading',\n 's-button-label-md',\n 's-button-label-lg',\n 's-amount-display-lg',\n 'l-page-heading',\n 'l-section-heading',\n 'l-button-label-md',\n 'l-button-label-lg',\n 'l-amount-display-lg',\n];\n\n/**\n * Custom Tailwind Merge configuration to handle our design system's typography classes.\n * This extends the default Tailwind Merge behavior to properly handle conflicts between:\n * 1. Custom text color classes (text-default, text-alternative, text-muted)\n * 2. Typography variant classes for font sizes (e.g., s-body-md, l-heading-lg)\n * 3. Standard and custom font weight classes\n *\n * Without this configuration, Tailwind Merge wouldn't know these classes are meant\n * to override each other, potentially leading to multiple conflicting classes\n * being applied simultaneously.\n */\nexport const twMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n 'text-color': ['text-default', 'text-alternative', 'text-muted'],\n 'font-size': [\n {\n text: variantClassGroups,\n },\n ],\n 'font-family': ['font-default', 'font-accent', 'font-hero'],\n 'font-weight': [\n 'font-thin',\n 'font-extralight',\n 'font-light',\n 'font-normal',\n 'font-regular',\n 'font-medium',\n 'font-semibold',\n 'font-bold',\n 'font-extrabold',\n 'font-black',\n ],\n },\n conflictingClassGroups: {\n 'text-color': ['text-color'],\n 'font-size': ['font-size'],\n 'font-family': ['font-family'],\n 'font-weight': ['font-weight'],\n },\n },\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/design-system-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1-preview.1775c68",
|
|
4
4
|
"description": "Design system react ui components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -53,13 +53,12 @@
|
|
|
53
53
|
"@metamask/jazzicon": "^2.0.0",
|
|
54
54
|
"@radix-ui/react-slot": "^1.1.0",
|
|
55
55
|
"blo": "^2.0.0",
|
|
56
|
-
"dompurify": "^3.2.5",
|
|
57
56
|
"tailwind-merge": "^2.0.0"
|
|
58
57
|
},
|
|
59
58
|
"devDependencies": {
|
|
60
59
|
"@figma/code-connect": "^1.0.0",
|
|
61
60
|
"@jest/globals": "^29.7.0",
|
|
62
|
-
"@metamask-previews/design-system-tailwind-preset": "0.6.
|
|
61
|
+
"@metamask-previews/design-system-tailwind-preset": "0.6.1-preview.1775c68",
|
|
63
62
|
"@metamask/auto-changelog": "^5.0.2",
|
|
64
63
|
"@metamask/utils": "^11.4.2",
|
|
65
64
|
"@solana/addresses": "^2.0.0",
|
|
@@ -87,8 +86,8 @@
|
|
|
87
86
|
"@metamask/utils": "^11.4.2",
|
|
88
87
|
"@solana/addresses": "^2.0.0",
|
|
89
88
|
"bitcoin-address-validation": ">=2.0.0",
|
|
90
|
-
"react": "^
|
|
91
|
-
"react-dom": "^
|
|
89
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
90
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
92
91
|
"tailwindcss": "^3.0.0"
|
|
93
92
|
},
|
|
94
93
|
"engines": {
|