@metamask/design-system-react 0.13.0 → 0.15.0
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 +23 -1
- package/dist/components/AvatarAccount/AvatarAccount.cjs +6 -6
- package/dist/components/AvatarAccount/AvatarAccount.cjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.cjs +6 -6
- package/dist/components/AvatarAccount/AvatarAccount.constants.cjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.mjs +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.mjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.d.cts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.d.mts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.mjs +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.mjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.types.cjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.types.d.cts +2 -18
- package/dist/components/AvatarAccount/AvatarAccount.types.d.cts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.types.d.mts +2 -18
- package/dist/components/AvatarAccount/AvatarAccount.types.d.mts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.types.mjs.map +1 -1
- package/dist/components/AvatarAccount/index.cjs +3 -3
- package/dist/components/AvatarAccount/index.cjs.map +1 -1
- package/dist/components/AvatarAccount/index.d.cts +1 -1
- package/dist/components/AvatarAccount/index.d.cts.map +1 -1
- package/dist/components/AvatarAccount/index.d.mts +1 -1
- package/dist/components/AvatarAccount/index.d.mts.map +1 -1
- package/dist/components/AvatarAccount/index.mjs +1 -1
- package/dist/components/AvatarAccount/index.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.cjs +3 -3
- package/dist/components/AvatarBase/AvatarBase.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.cjs +21 -21
- package/dist/components/AvatarBase/AvatarBase.constants.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.cts +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.mts +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.mts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.mjs +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.d.mts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.mjs +1 -1
- package/dist/components/AvatarBase/AvatarBase.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.d.cts +4 -42
- package/dist/components/AvatarBase/AvatarBase.types.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.d.mts +4 -42
- package/dist/components/AvatarBase/AvatarBase.types.d.mts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.mjs.map +1 -1
- package/dist/components/AvatarBase/index.cjs +3 -3
- package/dist/components/AvatarBase/index.cjs.map +1 -1
- package/dist/components/AvatarBase/index.d.cts +1 -1
- package/dist/components/AvatarBase/index.d.cts.map +1 -1
- package/dist/components/AvatarBase/index.d.mts +1 -1
- package/dist/components/AvatarBase/index.d.mts.map +1 -1
- package/dist/components/AvatarBase/index.mjs +1 -1
- package/dist/components/AvatarBase/index.mjs.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.cjs +2 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.cjs.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.d.cts.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.d.mts.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.mjs +2 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.mjs.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.cjs +2 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.cjs.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.d.cts.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.d.mts.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.mjs +2 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.mjs.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.cjs +3 -3
- package/dist/components/AvatarToken/AvatarToken.cjs.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.d.cts.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.d.mts.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.mjs +1 -1
- package/dist/components/AvatarToken/AvatarToken.mjs.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.types.cjs.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.types.d.cts +6 -6
- package/dist/components/AvatarToken/AvatarToken.types.d.cts.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.types.d.mts +6 -6
- package/dist/components/AvatarToken/AvatarToken.types.d.mts.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.types.mjs.map +1 -1
- package/dist/components/AvatarToken/index.cjs +2 -2
- package/dist/components/AvatarToken/index.cjs.map +1 -1
- package/dist/components/AvatarToken/index.d.cts +1 -1
- package/dist/components/AvatarToken/index.d.cts.map +1 -1
- package/dist/components/AvatarToken/index.d.mts +1 -1
- package/dist/components/AvatarToken/index.d.mts.map +1 -1
- package/dist/components/AvatarToken/index.mjs +1 -1
- package/dist/components/AvatarToken/index.mjs.map +1 -1
- package/dist/components/Icon/icons/NoPhotography.cjs +32 -0
- package/dist/components/Icon/icons/NoPhotography.cjs.map +1 -0
- package/dist/components/Icon/icons/NoPhotography.d.cts +4 -0
- package/dist/components/Icon/icons/NoPhotography.d.cts.map +1 -0
- package/dist/components/Icon/icons/NoPhotography.d.mts +4 -0
- package/dist/components/Icon/icons/NoPhotography.d.mts.map +1 -0
- package/dist/components/Icon/icons/NoPhotography.mjs +7 -0
- package/dist/components/Icon/icons/NoPhotography.mjs.map +1 -0
- package/dist/components/Icon/icons/index.cjs +2 -0
- package/dist/components/Icon/icons/index.cjs.map +1 -1
- package/dist/components/Icon/icons/index.d.cts +1 -0
- package/dist/components/Icon/icons/index.d.cts.map +1 -1
- package/dist/components/Icon/icons/index.d.mts +1 -0
- package/dist/components/Icon/icons/index.d.mts.map +1 -1
- package/dist/components/Icon/icons/index.mjs +2 -0
- package/dist/components/Icon/icons/index.mjs.map +1 -1
- package/dist/types/index.cjs +15 -50
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +7 -54
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +7 -54
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +7 -57
- package/dist/types/index.mjs.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.15.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Added `NoPhotography` icon ([#1056](https://github.com/MetaMask/metamask-design-system/pull/1056))
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **BREAKING:** Updated `AvatarToken` and `AvatarAccount` exports to use shared const-object + string-union types (ADR-0003/ADR-0004); normal use is unaffected ([#1009](https://github.com/MetaMask/metamask-design-system/pull/1009), [#1015](https://github.com/MetaMask/metamask-design-system/pull/1015))
|
|
19
|
+
|
|
20
|
+
## [0.14.0]
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- **BREAKING:** Updated `AvatarBase` exports to consume shared const-object + string-union types rather than local enums, aligning React with shared cross-platform type contracts ([#1005](https://github.com/MetaMask/metamask-design-system/pull/1005)).
|
|
25
|
+
- No migration required for typical usage; continue importing from `@metamask/design-system-react` as before.
|
|
26
|
+
- Runtime values remain stable while type definitions follow ADR-0003/ADR-0004.
|
|
27
|
+
- Updated `@metamask/utils` peer dependency to `^11.11.0` ([#1033](https://github.com/MetaMask/metamask-design-system/pull/1033)).
|
|
28
|
+
- Expanded `BannerBase` migration documentation to improve upgrade guidance for consumers moving between recent releases ([#1011](https://github.com/MetaMask/metamask-design-system/pull/1011)).
|
|
29
|
+
|
|
10
30
|
## [0.13.0]
|
|
11
31
|
|
|
12
32
|
### Changed
|
|
@@ -205,7 +225,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
205
225
|
- Full TypeScript support with type definitions and enums
|
|
206
226
|
- Tailwind CSS integration with design token support
|
|
207
227
|
|
|
208
|
-
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.
|
|
228
|
+
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.15.0...HEAD
|
|
229
|
+
[0.15.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.14.0...@metamask/design-system-react@0.15.0
|
|
230
|
+
[0.14.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.13.0...@metamask/design-system-react@0.14.0
|
|
209
231
|
[0.13.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.12.0...@metamask/design-system-react@0.13.0
|
|
210
232
|
[0.12.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.11.0...@metamask/design-system-react@0.12.0
|
|
211
233
|
[0.11.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.10.0...@metamask/design-system-react@0.11.0
|
|
@@ -24,28 +24,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.AvatarAccount = void 0;
|
|
27
|
+
const design_system_shared_1 = require("@metamask/design-system-shared");
|
|
27
28
|
const react_1 = __importStar(require("react"));
|
|
28
|
-
const types_1 = require("../../types/index.cjs");
|
|
29
29
|
const AvatarBase_1 = require("../AvatarBase/index.cjs");
|
|
30
30
|
const Blockies_1 = require("../temp-components/Blockies/index.cjs");
|
|
31
31
|
const Jazzicon_1 = require("../temp-components/Jazzicon/index.cjs");
|
|
32
32
|
const Maskicon_1 = require("../temp-components/Maskicon/index.cjs");
|
|
33
33
|
const AvatarAccount_constants_1 = require("./AvatarAccount.constants.cjs");
|
|
34
|
-
exports.AvatarAccount = (0, react_1.forwardRef)(({ address, variant =
|
|
34
|
+
exports.AvatarAccount = (0, react_1.forwardRef)(({ address, variant = design_system_shared_1.AvatarAccountVariant.Jazzicon, className, size = design_system_shared_1.AvatarAccountSize.Md, blockiesProps, jazziconProps, maskiconProps, ...props }, ref) => {
|
|
35
35
|
let AvatarArtComponent;
|
|
36
36
|
switch (variant) {
|
|
37
|
-
case
|
|
37
|
+
case design_system_shared_1.AvatarAccountVariant.Blockies:
|
|
38
38
|
AvatarArtComponent = (react_1.default.createElement(Blockies_1.Blockies, { address: address, size: AvatarAccount_constants_1.MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size], ...blockiesProps }));
|
|
39
39
|
break;
|
|
40
|
-
case
|
|
40
|
+
case design_system_shared_1.AvatarAccountVariant.Maskicon:
|
|
41
41
|
AvatarArtComponent = (react_1.default.createElement(Maskicon_1.Maskicon, { address: address, size: AvatarAccount_constants_1.MAP_AVATARACCOUNT_SIZE_SIZENUMBER[size], ...maskiconProps }));
|
|
42
42
|
break;
|
|
43
|
-
case
|
|
43
|
+
case design_system_shared_1.AvatarAccountVariant.Jazzicon:
|
|
44
44
|
default:
|
|
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:
|
|
48
|
+
return (react_1.default.createElement(AvatarBase_1.AvatarBase, { ref: ref, shape: design_system_shared_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,
|
|
1
|
+
{"version":3,"file":"AvatarAccount.cjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAIwC;AACxC,+CAA0C;AAE1C,wDAA2C;AAC3C,oEAAuD;AACvD,oEAAuD;AACvD,oEAAuD;AAEvD,2EAA8E;AAGjE,QAAA,aAAa,GAAG,IAAA,kBAAU,EACrC,CACE,EACE,OAAO,EACP,OAAO,GAAG,2CAAoB,CAAC,QAAQ,EACvC,SAAS,EACT,IAAI,GAAG,wCAAiB,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,2CAAoB,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,2CAAoB,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,2CAAoB,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,sCAAe,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 {\n AvatarAccountSize,\n AvatarAccountVariant,\n AvatarBaseShape,\n} from '@metamask/design-system-shared';\nimport React, { forwardRef } from 'react';\n\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"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MAP_AVATARACCOUNT_SIZE_SIZENUMBER = void 0;
|
|
4
|
-
const
|
|
4
|
+
const design_system_shared_1 = require("@metamask/design-system-shared");
|
|
5
5
|
exports.MAP_AVATARACCOUNT_SIZE_SIZENUMBER = {
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
6
|
+
[design_system_shared_1.AvatarAccountSize.Xs]: 16,
|
|
7
|
+
[design_system_shared_1.AvatarAccountSize.Sm]: 24,
|
|
8
|
+
[design_system_shared_1.AvatarAccountSize.Md]: 32,
|
|
9
|
+
[design_system_shared_1.AvatarAccountSize.Lg]: 40,
|
|
10
|
+
[design_system_shared_1.AvatarAccountSize.Xl]: 48,
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=AvatarAccount.constants.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarAccount.constants.cjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.constants.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"AvatarAccount.constants.cjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.constants.ts"],"names":[],"mappings":";;;AAAA,yEAAmE;AAEtD,QAAA,iCAAiC,GAG1C;IACF,CAAC,wCAAiB,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1B,CAAC,wCAAiB,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1B,CAAC,wCAAiB,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1B,CAAC,wCAAiB,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1B,CAAC,wCAAiB,CAAC,EAAE,CAAC,EAAE,EAAE;CAC3B,CAAC","sourcesContent":["import { AvatarAccountSize } from '@metamask/design-system-shared';\n\nexport const MAP_AVATARACCOUNT_SIZE_SIZENUMBER: Record<\n AvatarAccountSize,\n number\n> = {\n [AvatarAccountSize.Xs]: 16,\n [AvatarAccountSize.Sm]: 24,\n [AvatarAccountSize.Md]: 32,\n [AvatarAccountSize.Lg]: 40,\n [AvatarAccountSize.Xl]: 48,\n};\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AvatarAccountSize } from "
|
|
1
|
+
import { AvatarAccountSize } from "@metamask/design-system-shared";
|
|
2
2
|
export declare const MAP_AVATARACCOUNT_SIZE_SIZENUMBER: Record<AvatarAccountSize, number>;
|
|
3
3
|
//# sourceMappingURL=AvatarAccount.constants.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarAccount.constants.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarAccount.constants.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,uCAAuC;AAEnE,eAAO,MAAM,iCAAiC,EAAE,MAAM,CACpD,iBAAiB,EACjB,MAAM,CAOP,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AvatarAccountSize } from "
|
|
1
|
+
import { AvatarAccountSize } from "@metamask/design-system-shared";
|
|
2
2
|
export declare const MAP_AVATARACCOUNT_SIZE_SIZENUMBER: Record<AvatarAccountSize, number>;
|
|
3
3
|
//# sourceMappingURL=AvatarAccount.constants.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarAccount.constants.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarAccount.constants.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,uCAAuC;AAEnE,eAAO,MAAM,iCAAiC,EAAE,MAAM,CACpD,iBAAiB,EACjB,MAAM,CAOP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarAccount.constants.mjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarAccount.constants.mjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,uCAAuC;AAEnE,MAAM,CAAC,MAAM,iCAAiC,GAG1C;IACF,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1B,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1B,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1B,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1B,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE;CAC3B,CAAC","sourcesContent":["import { AvatarAccountSize } from '@metamask/design-system-shared';\n\nexport const MAP_AVATARACCOUNT_SIZE_SIZENUMBER: Record<\n AvatarAccountSize,\n number\n> = {\n [AvatarAccountSize.Xs]: 16,\n [AvatarAccountSize.Sm]: 24,\n [AvatarAccountSize.Md]: 32,\n [AvatarAccountSize.Lg]: 40,\n [AvatarAccountSize.Xl]: 48,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarAccount.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AvatarAccount.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAqB,cAAc;AAQ1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,wGA0DzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarAccount.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AvatarAccount.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAqB,cAAc;AAQ1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,wGA0DzB,CAAC"}
|
|
@@ -4,9 +4,9 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
+
import { AvatarAccountSize, AvatarAccountVariant, AvatarBaseShape } from "@metamask/design-system-shared";
|
|
7
8
|
import $React, { forwardRef } from "react";
|
|
8
9
|
const React = $importDefault($React);
|
|
9
|
-
import { AvatarAccountVariant, AvatarAccountSize, AvatarBaseShape } from "../../types/index.mjs";
|
|
10
10
|
import { AvatarBase } from "../AvatarBase/index.mjs";
|
|
11
11
|
import { Blockies } from "../temp-components/Blockies/index.mjs";
|
|
12
12
|
import { Jazzicon } from "../temp-components/Jazzicon/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarAccount.mjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AvatarAccount.mjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EAChB,uCAAuC;AACxC,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,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 {\n AvatarAccountSize,\n AvatarAccountVariant,\n AvatarBaseShape,\n} from '@metamask/design-system-shared';\nimport React, { forwardRef } from 'react';\n\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarAccount.types.cjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"AvatarAccount.types.cjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarAccountPropsShared } from '@metamask/design-system-shared';\nimport type { ComponentProps } from 'react';\n\nimport type { AvatarBaseProps } from '../AvatarBase';\nimport type { Blockies } from '../temp-components/Blockies';\nimport type { Jazzicon } from '../temp-components/Jazzicon';\nimport type { Maskicon } from '../temp-components/Maskicon';\n\nexport type AvatarAccountProps = Omit<\n ComponentProps<'img'>,\n 'children' | 'size'\n> &\n Omit<AvatarBaseProps, 'children' | 'size'> &\n AvatarAccountPropsShared & {\n /**\n * Optional props to be passed to the Blockies component\n */\n blockiesProps?: Partial<ComponentProps<typeof Blockies>>;\n /**\n * Optional props to be passed to the Jazzicon component\n */\n jazziconProps?: Partial<ComponentProps<typeof Jazzicon>>;\n /**\n * Optional props to be passed to the Maskicon component\n */\n maskiconProps?: Partial<ComponentProps<typeof Maskicon>>;\n };\n"]}
|
|
@@ -1,26 +1,10 @@
|
|
|
1
|
+
import type { AvatarAccountPropsShared } from "@metamask/design-system-shared";
|
|
1
2
|
import type { ComponentProps } from "react";
|
|
2
|
-
import type { AvatarAccountVariant, AvatarAccountSize } from "../../types/index.cjs";
|
|
3
3
|
import type { AvatarBaseProps } from "../AvatarBase/index.cjs";
|
|
4
4
|
import type { Blockies } from "../temp-components/Blockies/index.cjs";
|
|
5
5
|
import type { Jazzicon } from "../temp-components/Jazzicon/index.cjs";
|
|
6
6
|
import type { Maskicon } from "../temp-components/Maskicon/index.cjs";
|
|
7
|
-
export type AvatarAccountProps = Omit<ComponentProps<'img'>, 'children' | 'size'> & Omit<AvatarBaseProps, 'children' | 'size'> & {
|
|
8
|
-
/**
|
|
9
|
-
* Required address used as a unique identifier to generate the AvatarAccount art.
|
|
10
|
-
*/
|
|
11
|
-
address: string;
|
|
12
|
-
/**
|
|
13
|
-
* Optional prop to control the variant of the avatar account
|
|
14
|
-
*
|
|
15
|
-
* @default AvatarAccountVariant.Jazzicon
|
|
16
|
-
*/
|
|
17
|
-
variant?: AvatarAccountVariant;
|
|
18
|
-
/**
|
|
19
|
-
* Optional prop to control the size of the avatar
|
|
20
|
-
*
|
|
21
|
-
* @default AvatarAccountSize.Md
|
|
22
|
-
*/
|
|
23
|
-
size?: AvatarAccountSize;
|
|
7
|
+
export type AvatarAccountProps = Omit<ComponentProps<'img'>, 'children' | 'size'> & Omit<AvatarBaseProps, 'children' | 'size'> & AvatarAccountPropsShared & {
|
|
24
8
|
/**
|
|
25
9
|
* Optional props to be passed to the Blockies component
|
|
26
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarAccount.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarAccount.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAuC;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,8CAAoC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,8CAAoC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,8CAAoC;AAE5D,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,cAAc,CAAC,KAAK,CAAC,EACrB,UAAU,GAAG,MAAM,CACpB,GACC,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,MAAM,CAAC,GAC1C,wBAAwB,GAAG;IACzB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC;IACzD;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC;IACzD;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC;CAC1D,CAAC"}
|
|
@@ -1,26 +1,10 @@
|
|
|
1
|
+
import type { AvatarAccountPropsShared } from "@metamask/design-system-shared";
|
|
1
2
|
import type { ComponentProps } from "react";
|
|
2
|
-
import type { AvatarAccountVariant, AvatarAccountSize } from "../../types/index.mjs";
|
|
3
3
|
import type { AvatarBaseProps } from "../AvatarBase/index.mjs";
|
|
4
4
|
import type { Blockies } from "../temp-components/Blockies/index.mjs";
|
|
5
5
|
import type { Jazzicon } from "../temp-components/Jazzicon/index.mjs";
|
|
6
6
|
import type { Maskicon } from "../temp-components/Maskicon/index.mjs";
|
|
7
|
-
export type AvatarAccountProps = Omit<ComponentProps<'img'>, 'children' | 'size'> & Omit<AvatarBaseProps, 'children' | 'size'> & {
|
|
8
|
-
/**
|
|
9
|
-
* Required address used as a unique identifier to generate the AvatarAccount art.
|
|
10
|
-
*/
|
|
11
|
-
address: string;
|
|
12
|
-
/**
|
|
13
|
-
* Optional prop to control the variant of the avatar account
|
|
14
|
-
*
|
|
15
|
-
* @default AvatarAccountVariant.Jazzicon
|
|
16
|
-
*/
|
|
17
|
-
variant?: AvatarAccountVariant;
|
|
18
|
-
/**
|
|
19
|
-
* Optional prop to control the size of the avatar
|
|
20
|
-
*
|
|
21
|
-
* @default AvatarAccountSize.Md
|
|
22
|
-
*/
|
|
23
|
-
size?: AvatarAccountSize;
|
|
7
|
+
export type AvatarAccountProps = Omit<ComponentProps<'img'>, 'children' | 'size'> & Omit<AvatarBaseProps, 'children' | 'size'> & AvatarAccountPropsShared & {
|
|
24
8
|
/**
|
|
25
9
|
* Optional props to be passed to the Blockies component
|
|
26
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarAccount.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarAccount.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAuC;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,8CAAoC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,8CAAoC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,8CAAoC;AAE5D,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,cAAc,CAAC,KAAK,CAAC,EACrB,UAAU,GAAG,MAAM,CACpB,GACC,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,MAAM,CAAC,GAC1C,wBAAwB,GAAG;IACzB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC;IACzD;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC;IACzD;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC;CAC1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarAccount.types.mjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"AvatarAccount.types.mjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/AvatarAccount.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarAccountPropsShared } from '@metamask/design-system-shared';\nimport type { ComponentProps } from 'react';\n\nimport type { AvatarBaseProps } from '../AvatarBase';\nimport type { Blockies } from '../temp-components/Blockies';\nimport type { Jazzicon } from '../temp-components/Jazzicon';\nimport type { Maskicon } from '../temp-components/Maskicon';\n\nexport type AvatarAccountProps = Omit<\n ComponentProps<'img'>,\n 'children' | 'size'\n> &\n Omit<AvatarBaseProps, 'children' | 'size'> &\n AvatarAccountPropsShared & {\n /**\n * Optional props to be passed to the Blockies component\n */\n blockiesProps?: Partial<ComponentProps<typeof Blockies>>;\n /**\n * Optional props to be passed to the Jazzicon component\n */\n jazziconProps?: Partial<ComponentProps<typeof Jazzicon>>;\n /**\n * Optional props to be passed to the Maskicon component\n */\n maskiconProps?: Partial<ComponentProps<typeof Maskicon>>;\n };\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AvatarAccount = exports.AvatarAccountVariant = exports.AvatarAccountSize = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "AvatarAccountSize", { enumerable: true, get: function () { return
|
|
6
|
-
Object.defineProperty(exports, "AvatarAccountVariant", { enumerable: true, get: function () { return
|
|
4
|
+
var design_system_shared_1 = require("@metamask/design-system-shared");
|
|
5
|
+
Object.defineProperty(exports, "AvatarAccountSize", { enumerable: true, get: function () { return design_system_shared_1.AvatarAccountSize; } });
|
|
6
|
+
Object.defineProperty(exports, "AvatarAccountVariant", { enumerable: true, get: function () { return design_system_shared_1.AvatarAccountVariant; } });
|
|
7
7
|
var AvatarAccount_1 = require("./AvatarAccount.cjs");
|
|
8
8
|
Object.defineProperty(exports, "AvatarAccount", { enumerable: true, get: function () { return AvatarAccount_1.AvatarAccount; } });
|
|
9
9
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/index.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/index.ts"],"names":[],"mappings":";;;AAAA,uEAGwC;AAFtC,yHAAA,iBAAiB,OAAA;AACjB,4HAAA,oBAAoB,OAAA;AAEtB,qDAAgD;AAAvC,8GAAA,aAAa,OAAA","sourcesContent":["export {\n AvatarAccountSize,\n AvatarAccountVariant,\n} from '@metamask/design-system-shared';\nexport { AvatarAccount } from './AvatarAccount';\nexport type { AvatarAccountProps } from './AvatarAccount.types';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AvatarAccountSize, AvatarAccountVariant } from "
|
|
1
|
+
export { AvatarAccountSize, AvatarAccountVariant, } from "@metamask/design-system-shared";
|
|
2
2
|
export { AvatarAccount } from "./AvatarAccount.cjs";
|
|
3
3
|
export type { AvatarAccountProps } from "./AvatarAccount.types.cjs";
|
|
4
4
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,oBAAoB,GACrB,uCAAuC;AACxC,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAChD,YAAY,EAAE,kBAAkB,EAAE,kCAA8B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AvatarAccountSize, AvatarAccountVariant } from "
|
|
1
|
+
export { AvatarAccountSize, AvatarAccountVariant, } from "@metamask/design-system-shared";
|
|
2
2
|
export { AvatarAccount } from "./AvatarAccount.mjs";
|
|
3
3
|
export type { AvatarAccountProps } from "./AvatarAccount.types.mjs";
|
|
4
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarAccount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,oBAAoB,GACrB,uCAAuC;AACxC,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAChD,YAAY,EAAE,kBAAkB,EAAE,kCAA8B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/AvatarAccount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACrB,uCAAuC;AACxC,OAAO,EAAE,aAAa,EAAE,4BAAwB","sourcesContent":["export {\n AvatarAccountSize,\n AvatarAccountVariant,\n} from '@metamask/design-system-shared';\nexport { AvatarAccount } from './AvatarAccount';\nexport type { AvatarAccountProps } from './AvatarAccount.types';\n"]}
|
|
@@ -24,17 +24,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.AvatarBase = void 0;
|
|
27
|
+
const design_system_shared_1 = require("@metamask/design-system-shared");
|
|
27
28
|
const react_slot_1 = require("@radix-ui/react-slot");
|
|
28
29
|
const react_1 = __importStar(require("react"));
|
|
29
|
-
const types_1 = require("../../types/index.cjs");
|
|
30
30
|
const tw_merge_1 = require("../../utils/tw-merge.cjs");
|
|
31
31
|
const Text_1 = require("../Text/index.cjs");
|
|
32
32
|
const AvatarBase_constants_1 = require("./AvatarBase.constants.cjs");
|
|
33
|
-
exports.AvatarBase = (0, react_1.forwardRef)(({ children, fallbackText, fallbackTextProps, className, size =
|
|
33
|
+
exports.AvatarBase = (0, react_1.forwardRef)(({ children, fallbackText, fallbackTextProps, className, size = design_system_shared_1.AvatarBaseSize.Md, shape = design_system_shared_1.AvatarBaseShape.Circle, asChild, style, hasBorder = false, ...props }, ref) => {
|
|
34
34
|
const Component = asChild ? react_slot_1.Slot : 'div';
|
|
35
35
|
const mergedClassName = (0, tw_merge_1.twMerge)(
|
|
36
36
|
// Base styles
|
|
37
|
-
'inline-flex shrink-0 items-center justify-center overflow-hidden bg-section', shape ===
|
|
37
|
+
'inline-flex shrink-0 items-center justify-center overflow-hidden bg-section', shape === design_system_shared_1.AvatarBaseShape.Circle
|
|
38
38
|
? 'rounded-full'
|
|
39
39
|
: AvatarBase_constants_1.TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE[size],
|
|
40
40
|
// Size
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarBase.cjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA4C;AAC5C,+CAA0C;AAE1C,
|
|
1
|
+
{"version":3,"file":"AvatarBase.cjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAGwC;AACxC,qDAA4C;AAC5C,+CAA0C;AAE1C,uDAA+C;AAC/C,4CAAmE;AAEnE,qEAKgC;AAGnB,QAAA,UAAU,GAAG,IAAA,kBAAU,EAClC,CACE,EACE,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,IAAI,GAAG,qCAAc,CAAC,EAAE,EACxB,KAAK,GAAG,sCAAe,CAAC,MAAM,EAC9B,OAAO,EACP,KAAK,EACL,SAAS,GAAG,KAAK,EACjB,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IAEzC,MAAM,eAAe,GAAG,IAAA,kBAAO;IAC7B,cAAc;IACd,6EAA6E,EAC7E,KAAK,KAAK,sCAAe,CAAC,MAAM;QAC9B,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,sEAA+C,CAAC,IAAI,CAAC;IACzD,OAAO;IACP,SAAS;QACP,CAAC,CAAC,qEAA8C,CAAC,IAAI,CAAC;QACtD,CAAC,CAAC,2DAAoC,CAAC,IAAI,CAAC;IAC9C,SAAS;IACT,SAAS,IAAI,wDAAiC,CAAC,IAAI,CAAC;IACpD,iBAAiB;IACjB,SAAS,CACV,CAAC;IAEF,OAAO,CACL,8BAAC,SAAS,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK,IACrE,YAAY,CAAC,CAAC,CAAC,CACd,8BAAC,WAAI,IACH,OAAO,EAAE,kBAAW,CAAC,MAAM,EAC3B,UAAU,EAAE,iBAAU,CAAC,MAAM,EAC7B,KAAK,EAAE,gBAAS,CAAC,SAAS,EAC1B,OAAO,QACP,SAAS,EAAC,WAAW,KACjB,iBAAiB;QAGrB,4CAAO,YAAY,CAAQ,CACtB,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CACS,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import {\n AvatarBaseSize,\n AvatarBaseShape,\n} from '@metamask/design-system-shared';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Text, FontWeight, TextVariant, TextColor } from '../Text';\n\nimport {\n TWCLASSMAP_AVATARBASE_SIZE_DIMENSION,\n TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION,\n TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE,\n TWCLASSMAP_AVATARBASE_SIZE_BORDER,\n} from './AvatarBase.constants';\nimport type { AvatarBaseProps } from './AvatarBase.types';\n\nexport const AvatarBase = forwardRef<HTMLDivElement, AvatarBaseProps>(\n (\n {\n children,\n fallbackText,\n fallbackTextProps,\n className,\n size = AvatarBaseSize.Md,\n shape = AvatarBaseShape.Circle,\n asChild,\n style,\n hasBorder = false,\n ...props\n },\n ref,\n ) => {\n const Component = asChild ? Slot : 'div';\n\n const mergedClassName = twMerge(\n // Base styles\n 'inline-flex shrink-0 items-center justify-center overflow-hidden bg-section',\n shape === AvatarBaseShape.Circle\n ? 'rounded-full'\n : TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE[size],\n // Size\n hasBorder\n ? TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION[size]\n : TWCLASSMAP_AVATARBASE_SIZE_DIMENSION[size],\n // Border\n hasBorder && TWCLASSMAP_AVATARBASE_SIZE_BORDER[size],\n // Custom classes\n className,\n );\n\n return (\n <Component ref={ref} className={mergedClassName} style={style} {...props}>\n {fallbackText ? (\n <Text\n variant={TextVariant.BodySm}\n fontWeight={FontWeight.Medium}\n color={TextColor.TextMuted}\n asChild\n className=\"uppercase\"\n {...fallbackTextProps}\n >\n {/* asChild prop renders Text component as a span, it does not create an additional element */}\n <span>{fallbackText}</span>\n </Text>\n ) : (\n children\n )}\n </Component>\n );\n },\n);\n\nAvatarBase.displayName = 'AvatarBase';\n"]}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TWCLASSMAP_AVATARBASE_SIZE_BORDER = exports.TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE = exports.TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION = exports.TWCLASSMAP_AVATARBASE_SIZE_DIMENSION = void 0;
|
|
4
|
-
const
|
|
4
|
+
const design_system_shared_1 = require("@metamask/design-system-shared");
|
|
5
5
|
exports.TWCLASSMAP_AVATARBASE_SIZE_DIMENSION = {
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
6
|
+
[design_system_shared_1.AvatarBaseSize.Xs]: 'h-4 w-4',
|
|
7
|
+
[design_system_shared_1.AvatarBaseSize.Sm]: 'h-6 w-6',
|
|
8
|
+
[design_system_shared_1.AvatarBaseSize.Md]: 'h-8 w-8',
|
|
9
|
+
[design_system_shared_1.AvatarBaseSize.Lg]: 'h-10 w-10',
|
|
10
|
+
[design_system_shared_1.AvatarBaseSize.Xl]: 'h-12 w-12', // 48px
|
|
11
11
|
};
|
|
12
12
|
exports.TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION = {
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
13
|
+
[design_system_shared_1.AvatarBaseSize.Xs]: 'h-[18px] w-[18px]',
|
|
14
|
+
[design_system_shared_1.AvatarBaseSize.Sm]: 'h-[26px] w-[26px]',
|
|
15
|
+
[design_system_shared_1.AvatarBaseSize.Md]: 'h-[34px] w-[34px]',
|
|
16
|
+
[design_system_shared_1.AvatarBaseSize.Lg]: 'h-[44px] w-[44px]',
|
|
17
|
+
[design_system_shared_1.AvatarBaseSize.Xl]: 'h-[52px] w-[52px]', // 48px with 2px border on each side
|
|
18
18
|
};
|
|
19
19
|
exports.TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE = {
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
20
|
+
[design_system_shared_1.AvatarBaseSize.Xs]: 'rounded-sm',
|
|
21
|
+
[design_system_shared_1.AvatarBaseSize.Sm]: 'rounded-md',
|
|
22
|
+
[design_system_shared_1.AvatarBaseSize.Md]: 'rounded-lg',
|
|
23
|
+
[design_system_shared_1.AvatarBaseSize.Lg]: 'rounded-[10px]',
|
|
24
|
+
[design_system_shared_1.AvatarBaseSize.Xl]: 'rounded-xl', // 12px
|
|
25
25
|
};
|
|
26
26
|
exports.TWCLASSMAP_AVATARBASE_SIZE_BORDER = {
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
[
|
|
27
|
+
[design_system_shared_1.AvatarBaseSize.Xs]: 'border-background-default border',
|
|
28
|
+
[design_system_shared_1.AvatarBaseSize.Sm]: 'border-background-default border',
|
|
29
|
+
[design_system_shared_1.AvatarBaseSize.Md]: 'border-background-default border',
|
|
30
|
+
[design_system_shared_1.AvatarBaseSize.Lg]: 'border-background-default border-2',
|
|
31
|
+
[design_system_shared_1.AvatarBaseSize.Xl]: 'border-background-default border-2', // 2px border
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=AvatarBase.constants.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarBase.constants.cjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.constants.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"AvatarBase.constants.cjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.constants.ts"],"names":[],"mappings":";;;AAAA,yEAAgE;AAEnD,QAAA,oCAAoC,GAG7C;IACF,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,WAAW;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,OAAO;CAC1C,CAAC;AAEW,QAAA,8CAA8C,GAGvD;IACF,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,mBAAmB;IACxC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,mBAAmB;IACxC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,mBAAmB;IACxC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,mBAAmB;IACxC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,mBAAmB,EAAE,oCAAoC;CAC/E,CAAC;AAEW,QAAA,+CAA+C,GAGxD;IACF,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,YAAY;IACjC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,YAAY;IACjC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,YAAY;IACjC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,gBAAgB;IACrC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,OAAO;CAC3C,CAAC;AAEW,QAAA,iCAAiC,GAC5C;IACE,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,kCAAkC;IACvD,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,kCAAkC;IACvD,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,kCAAkC;IACvD,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,oCAAoC;IACzD,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,oCAAoC,EAAE,aAAa;CACzE,CAAC","sourcesContent":["import { AvatarBaseSize } from '@metamask/design-system-shared';\n\nexport const TWCLASSMAP_AVATARBASE_SIZE_DIMENSION: Record<\n AvatarBaseSize,\n string\n> = {\n [AvatarBaseSize.Xs]: 'h-4 w-4', // 16px\n [AvatarBaseSize.Sm]: 'h-6 w-6', // 24px\n [AvatarBaseSize.Md]: 'h-8 w-8', // 32px\n [AvatarBaseSize.Lg]: 'h-10 w-10', // 40px\n [AvatarBaseSize.Xl]: 'h-12 w-12', // 48px\n};\n\nexport const TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION: Record<\n AvatarBaseSize,\n string\n> = {\n [AvatarBaseSize.Xs]: 'h-[18px] w-[18px]', // 16px with 1px border on each side\n [AvatarBaseSize.Sm]: 'h-[26px] w-[26px]', // 24px with 1px border on each side\n [AvatarBaseSize.Md]: 'h-[34px] w-[34px]', // 32px with 1px border on each side\n [AvatarBaseSize.Lg]: 'h-[44px] w-[44px]', // 40px with 2px border on each side\n [AvatarBaseSize.Xl]: 'h-[52px] w-[52px]', // 48px with 2px border on each side\n};\n\nexport const TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE: Record<\n AvatarBaseSize,\n string\n> = {\n [AvatarBaseSize.Xs]: 'rounded-sm', // 4px\n [AvatarBaseSize.Sm]: 'rounded-md', // 6px\n [AvatarBaseSize.Md]: 'rounded-lg', // 8px\n [AvatarBaseSize.Lg]: 'rounded-[10px]', // 10px (No tailwind class for this)\n [AvatarBaseSize.Xl]: 'rounded-xl', // 12px\n};\n\nexport const TWCLASSMAP_AVATARBASE_SIZE_BORDER: Record<AvatarBaseSize, string> =\n {\n [AvatarBaseSize.Xs]: 'border-background-default border', // 1px border\n [AvatarBaseSize.Sm]: 'border-background-default border', // 1px border\n [AvatarBaseSize.Md]: 'border-background-default border', // 1px border\n [AvatarBaseSize.Lg]: 'border-background-default border-2', // 2px border\n [AvatarBaseSize.Xl]: 'border-background-default border-2', // 2px border\n };\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AvatarBaseSize } from "
|
|
1
|
+
import { AvatarBaseSize } from "@metamask/design-system-shared";
|
|
2
2
|
export declare const TWCLASSMAP_AVATARBASE_SIZE_DIMENSION: Record<AvatarBaseSize, string>;
|
|
3
3
|
export declare const TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION: Record<AvatarBaseSize, string>;
|
|
4
4
|
export declare const TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE: Record<AvatarBaseSize, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarBase.constants.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarBase.constants.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,uCAAuC;AAEhE,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,cAAc,EACd,MAAM,CAOP,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,MAAM,CACjE,cAAc,EACd,MAAM,CAOP,CAAC;AAEF,eAAO,MAAM,+CAA+C,EAAE,MAAM,CAClE,cAAc,EACd,MAAM,CAOP,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAO1E,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AvatarBaseSize } from "
|
|
1
|
+
import { AvatarBaseSize } from "@metamask/design-system-shared";
|
|
2
2
|
export declare const TWCLASSMAP_AVATARBASE_SIZE_DIMENSION: Record<AvatarBaseSize, string>;
|
|
3
3
|
export declare const TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION: Record<AvatarBaseSize, string>;
|
|
4
4
|
export declare const TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE: Record<AvatarBaseSize, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarBase.constants.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarBase.constants.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,uCAAuC;AAEhE,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,cAAc,EACd,MAAM,CAOP,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,MAAM,CACjE,cAAc,EACd,MAAM,CAOP,CAAC;AAEF,eAAO,MAAM,+CAA+C,EAAE,MAAM,CAClE,cAAc,EACd,MAAM,CAOP,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAO1E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarBase.constants.mjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarBase.constants.mjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,uCAAuC;AAEhE,MAAM,CAAC,MAAM,oCAAoC,GAG7C;IACF,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,SAAS;IAC9B,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,OAAO;CAC1C,CAAC;AAEF,MAAM,CAAC,MAAM,8CAA8C,GAGvD;IACF,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,mBAAmB;IACxC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,mBAAmB;IACxC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,mBAAmB;IACxC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,mBAAmB;IACxC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,mBAAmB,EAAE,oCAAoC;CAC/E,CAAC;AAEF,MAAM,CAAC,MAAM,+CAA+C,GAGxD;IACF,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,YAAY;IACjC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,YAAY;IACjC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,YAAY;IACjC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,gBAAgB;IACrC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,OAAO;CAC3C,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAC5C;IACE,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,kCAAkC;IACvD,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,kCAAkC;IACvD,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,kCAAkC;IACvD,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,oCAAoC;IACzD,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,oCAAoC,EAAE,aAAa;CACzE,CAAC","sourcesContent":["import { AvatarBaseSize } from '@metamask/design-system-shared';\n\nexport const TWCLASSMAP_AVATARBASE_SIZE_DIMENSION: Record<\n AvatarBaseSize,\n string\n> = {\n [AvatarBaseSize.Xs]: 'h-4 w-4', // 16px\n [AvatarBaseSize.Sm]: 'h-6 w-6', // 24px\n [AvatarBaseSize.Md]: 'h-8 w-8', // 32px\n [AvatarBaseSize.Lg]: 'h-10 w-10', // 40px\n [AvatarBaseSize.Xl]: 'h-12 w-12', // 48px\n};\n\nexport const TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION: Record<\n AvatarBaseSize,\n string\n> = {\n [AvatarBaseSize.Xs]: 'h-[18px] w-[18px]', // 16px with 1px border on each side\n [AvatarBaseSize.Sm]: 'h-[26px] w-[26px]', // 24px with 1px border on each side\n [AvatarBaseSize.Md]: 'h-[34px] w-[34px]', // 32px with 1px border on each side\n [AvatarBaseSize.Lg]: 'h-[44px] w-[44px]', // 40px with 2px border on each side\n [AvatarBaseSize.Xl]: 'h-[52px] w-[52px]', // 48px with 2px border on each side\n};\n\nexport const TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE: Record<\n AvatarBaseSize,\n string\n> = {\n [AvatarBaseSize.Xs]: 'rounded-sm', // 4px\n [AvatarBaseSize.Sm]: 'rounded-md', // 6px\n [AvatarBaseSize.Md]: 'rounded-lg', // 8px\n [AvatarBaseSize.Lg]: 'rounded-[10px]', // 10px (No tailwind class for this)\n [AvatarBaseSize.Xl]: 'rounded-xl', // 12px\n};\n\nexport const TWCLASSMAP_AVATARBASE_SIZE_BORDER: Record<AvatarBaseSize, string> =\n {\n [AvatarBaseSize.Xs]: 'border-background-default border', // 1px border\n [AvatarBaseSize.Sm]: 'border-background-default border', // 1px border\n [AvatarBaseSize.Md]: 'border-background-default border', // 1px border\n [AvatarBaseSize.Lg]: 'border-background-default border-2', // 2px border\n [AvatarBaseSize.Xl]: 'border-background-default border-2', // 2px border\n };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarBase.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AvatarBase.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAqB,cAAc;AAW1C,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,qGAsDtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarBase.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AvatarBase.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAqB,cAAc;AAW1C,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,qGAsDtB,CAAC"}
|
|
@@ -4,10 +4,10 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
+
import { AvatarBaseSize, AvatarBaseShape } from "@metamask/design-system-shared";
|
|
7
8
|
import { Slot } from "@radix-ui/react-slot";
|
|
8
9
|
import $React, { forwardRef } from "react";
|
|
9
10
|
const React = $importDefault($React);
|
|
10
|
-
import { AvatarBaseSize, AvatarBaseShape } from "../../types/index.mjs";
|
|
11
11
|
import { twMerge } from "../../utils/tw-merge.mjs";
|
|
12
12
|
import { Text, FontWeight, TextVariant, TextColor } from "../Text/index.mjs";
|
|
13
13
|
import { TWCLASSMAP_AVATARBASE_SIZE_DIMENSION, TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION, TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE, TWCLASSMAP_AVATARBASE_SIZE_BORDER } from "./AvatarBase.constants.mjs";
|