@metamask-previews/design-system-react 0.0.0-preview.04cb60f → 0.0.0-preview.31cc4ac
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/dist/components/icon/Icon.cjs +21 -0
- package/dist/components/icon/Icon.cjs.map +1 -0
- package/dist/components/icon/Icon.constants.cjs +12 -0
- package/dist/components/icon/Icon.constants.cjs.map +1 -0
- package/dist/components/icon/Icon.constants.d.cts +3 -0
- package/dist/components/icon/Icon.constants.d.cts.map +1 -0
- package/dist/components/icon/Icon.constants.d.mts +3 -0
- package/dist/components/icon/Icon.constants.d.mts.map +1 -0
- package/dist/components/icon/Icon.constants.mjs +9 -0
- package/dist/components/icon/Icon.constants.mjs.map +1 -0
- package/dist/components/icon/Icon.d.cts +4 -0
- package/dist/components/icon/Icon.d.cts.map +1 -0
- package/dist/components/icon/Icon.d.mts +4 -0
- package/dist/components/icon/Icon.d.mts.map +1 -0
- package/dist/components/icon/Icon.mjs +21 -0
- package/dist/components/icon/Icon.mjs.map +1 -0
- package/dist/components/icon/Icon.types.cjs +53 -0
- package/dist/components/icon/Icon.types.cjs.map +1 -0
- package/dist/components/icon/Icon.types.d.cts +66 -0
- package/dist/components/icon/Icon.types.d.cts.map +1 -0
- package/dist/components/icon/Icon.types.d.mts +66 -0
- package/dist/components/icon/Icon.types.d.mts.map +1 -0
- package/dist/components/icon/Icon.types.mjs +50 -0
- package/dist/components/icon/Icon.types.mjs.map +1 -0
- package/dist/components/icon/index.cjs +10 -0
- package/dist/components/icon/index.cjs.map +1 -0
- package/dist/components/icon/index.d.cts +4 -0
- package/dist/components/icon/index.d.cts.map +1 -0
- package/dist/components/icon/index.d.mts +4 -0
- package/dist/components/icon/index.d.mts.map +1 -0
- package/dist/components/icon/index.mjs +3 -0
- package/dist/components/icon/index.mjs.map +1 -0
- package/dist/components/index.cjs +7 -1
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +3 -0
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +3 -0
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +2 -0
- package/dist/components/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Icon = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const tw_merge_1 = require("../../utils/tw-merge.cjs");
|
|
9
|
+
const Icon_types_1 = require("./Icon.types.cjs");
|
|
10
|
+
const Icon_constants_1 = require("./Icon.constants.cjs");
|
|
11
|
+
const Icon = ({ name, size = Icon_types_1.IconSize.Md, color = Icon_types_1.IconColor.IconDefault, className, style, ...props }) => {
|
|
12
|
+
if (!name) {
|
|
13
|
+
console.warn('Icon name is required');
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const mergedClassName = (0, tw_merge_1.twMerge)('inline-block', Icon_constants_1.ICON_SIZE_CLASS_MAP[size], color, className);
|
|
17
|
+
return (react_1.default.createElement("svg", { className: mergedClassName, ...props, style: style, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", fill: "currentColor" },
|
|
18
|
+
react_1.default.createElement("path", { d: "m337 51l-171 0c-75 0-119 45-119 119l0 172c0 74 44 119 119 119l171 0c75 0 119-45 119-119l0-172c1-74-44-119-119-119z m-3 220l-67 0 0 67c0 8-7 15-15 15-9 0-16-7-16-15l0-67-66 0c-9 0-16-7-16-15 0-8 7-15 16-15l66 0 0-67c0-8 7-15 16-15 8 0 15 7 15 15l0 67 67 0c8 0 15 7 15 15 0 8-7 15-15 15z" })));
|
|
19
|
+
};
|
|
20
|
+
exports.Icon = Icon;
|
|
21
|
+
//# sourceMappingURL=Icon.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.cjs","sourceRoot":"","sources":["../../../src/components/icon/Icon.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,uDAA+C;AAC/C,iDAAmD;AAEnD,yDAAuD;AAEhD,MAAM,IAAI,GAAwB,CAAC,EACxC,IAAI,EACJ,IAAI,GAAG,qBAAQ,CAAC,EAAE,EAClB,KAAK,GAAG,sBAAS,CAAC,WAAW,EAC7B,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;KACb;IACD,MAAM,eAAe,GAAG,IAAA,kBAAO,EAC7B,cAAc,EACd,oCAAmB,CAAC,IAAI,CAAC,EACzB,KAAK,EACL,SAAS,CACV,CAAC;IAEF,OAAO,CACL,uCACE,SAAS,EAAE,eAAe,KACrB,KAAuC,EAC5C,KAAK,EAAE,KAAK,EACZ,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,aAAa,EACrB,IAAI,EAAC,cAAc;QAEnB,wCAAM,CAAC,EAAC,+RAA+R,GAAG,CACtS,CACP,CAAC;AACJ,CAAC,CAAC;AA/BW,QAAA,IAAI,QA+Bf","sourcesContent":["import React from 'react';\nimport { twMerge } from '../../utils/tw-merge';\nimport { IconSize, IconColor } from './Icon.types';\nimport type { IconProps } from './Icon.types';\nimport { ICON_SIZE_CLASS_MAP } from './Icon.constants';\n\nexport const Icon: React.FC<IconProps> = ({\n name,\n size = IconSize.Md,\n color = IconColor.IconDefault,\n className,\n style,\n ...props\n}) => {\n if (!name) {\n console.warn('Icon name is required');\n return null;\n }\n const mergedClassName = twMerge(\n 'inline-block',\n ICON_SIZE_CLASS_MAP[size],\n color,\n className,\n );\n\n return (\n <svg\n className={mergedClassName}\n {...(props as React.SVGProps<SVGSVGElement>)}\n style={style}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n fill=\"currentColor\"\n >\n <path d=\"m337 51l-171 0c-75 0-119 45-119 119l0 172c0 74 44 119 119 119l171 0c75 0 119-45 119-119l0-172c1-74-44-119-119-119z m-3 220l-67 0 0 67c0 8-7 15-15 15-9 0-16-7-16-15l0-67-66 0c-9 0-16-7-16-15 0-8 7-15 16-15l66 0 0-67c0-8 7-15 16-15 8 0 15 7 15 15l0 67 67 0c8 0 15 7 15 15 0 8-7 15-15 15z\" />\n </svg>\n );\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ICON_SIZE_CLASS_MAP = void 0;
|
|
4
|
+
const Icon_types_1 = require("./Icon.types.cjs");
|
|
5
|
+
exports.ICON_SIZE_CLASS_MAP = {
|
|
6
|
+
[Icon_types_1.IconSize.Xs]: 'w-3 h-3',
|
|
7
|
+
[Icon_types_1.IconSize.Sm]: 'w-4 h-4',
|
|
8
|
+
[Icon_types_1.IconSize.Md]: 'w-5 h-5',
|
|
9
|
+
[Icon_types_1.IconSize.Lg]: 'w-6 h-6',
|
|
10
|
+
[Icon_types_1.IconSize.Xl]: 'w-8 h-8', // 32px
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=Icon.constants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.constants.cjs","sourceRoot":"","sources":["../../../src/components/icon/Icon.constants.ts"],"names":[],"mappings":";;;AAAA,iDAAwC;AAE3B,QAAA,mBAAmB,GAA6B;IAC3D,CAAC,qBAAQ,CAAC,EAAE,CAAC,EAAE,SAAS;IACxB,CAAC,qBAAQ,CAAC,EAAE,CAAC,EAAE,SAAS;IACxB,CAAC,qBAAQ,CAAC,EAAE,CAAC,EAAE,SAAS;IACxB,CAAC,qBAAQ,CAAC,EAAE,CAAC,EAAE,SAAS;IACxB,CAAC,qBAAQ,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO;CAClC,CAAC","sourcesContent":["import { IconSize } from './Icon.types';\n\nexport const ICON_SIZE_CLASS_MAP: Record<IconSize, string> = {\n [IconSize.Xs]: 'w-3 h-3', // 12px\n [IconSize.Sm]: 'w-4 h-4', // 16px\n [IconSize.Md]: 'w-5 h-5', // 20px\n [IconSize.Lg]: 'w-6 h-6', // 24px\n [IconSize.Xl]: 'w-8 h-8', // 32px\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.constants.d.cts","sourceRoot":"","sources":["../../../src/components/icon/Icon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,yBAAqB;AAExC,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAMxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.constants.d.mts","sourceRoot":"","sources":["../../../src/components/icon/Icon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,yBAAqB;AAExC,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAMxD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IconSize } from "./Icon.types.mjs";
|
|
2
|
+
export const ICON_SIZE_CLASS_MAP = {
|
|
3
|
+
[IconSize.Xs]: 'w-3 h-3',
|
|
4
|
+
[IconSize.Sm]: 'w-4 h-4',
|
|
5
|
+
[IconSize.Md]: 'w-5 h-5',
|
|
6
|
+
[IconSize.Lg]: 'w-6 h-6',
|
|
7
|
+
[IconSize.Xl]: 'w-8 h-8', // 32px
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=Icon.constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.constants.mjs","sourceRoot":"","sources":["../../../src/components/icon/Icon.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,yBAAqB;AAExC,MAAM,CAAC,MAAM,mBAAmB,GAA6B;IAC3D,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAS;IACxB,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAS;IACxB,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAS;IACxB,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAS;IACxB,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO;CAClC,CAAC","sourcesContent":["import { IconSize } from './Icon.types';\n\nexport const ICON_SIZE_CLASS_MAP: Record<IconSize, string> = {\n [IconSize.Xs]: 'w-3 h-3', // 12px\n [IconSize.Sm]: 'w-4 h-4', // 16px\n [IconSize.Md]: 'w-5 h-5', // 20px\n [IconSize.Lg]: 'w-6 h-6', // 24px\n [IconSize.Xl]: 'w-8 h-8', // 32px\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.d.cts","sourceRoot":"","sources":["../../../src/components/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAG9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA+BpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.d.mts","sourceRoot":"","sources":["../../../src/components/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAG9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA+BpC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import $React from "react";
|
|
8
|
+
const React = $importDefault($React);
|
|
9
|
+
import { twMerge } from "../../utils/tw-merge.mjs";
|
|
10
|
+
import { IconSize, IconColor } from "./Icon.types.mjs";
|
|
11
|
+
import { ICON_SIZE_CLASS_MAP } from "./Icon.constants.mjs";
|
|
12
|
+
export const Icon = ({ name, size = IconSize.Md, color = IconColor.IconDefault, className, style, ...props }) => {
|
|
13
|
+
if (!name) {
|
|
14
|
+
console.warn('Icon name is required');
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const mergedClassName = twMerge('inline-block', ICON_SIZE_CLASS_MAP[size], color, className);
|
|
18
|
+
return (React.createElement("svg", { className: mergedClassName, ...props, style: style, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", fill: "currentColor" },
|
|
19
|
+
React.createElement("path", { d: "m337 51l-171 0c-75 0-119 45-119 119l0 172c0 74 44 119 119 119l171 0c75 0 119-45 119-119l0-172c1-74-44-119-119-119z m-3 220l-67 0 0 67c0 8-7 15-15 15-9 0-16-7-16-15l0-67-66 0c-9 0-16-7-16-15 0-8 7-15 16-15l66 0 0-67c0-8 7-15 16-15 8 0 15 7 15 15l0 67 67 0c8 0 15 7 15 15 0 8-7 15-15 15z" })));
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=Icon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.mjs","sourceRoot":"","sources":["../../../src/components/icon/Icon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,yBAAqB;AAEnD,OAAO,EAAE,mBAAmB,EAAE,6BAAyB;AAEvD,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EACxC,IAAI,EACJ,IAAI,GAAG,QAAQ,CAAC,EAAE,EAClB,KAAK,GAAG,SAAS,CAAC,WAAW,EAC7B,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;KACb;IACD,MAAM,eAAe,GAAG,OAAO,CAC7B,cAAc,EACd,mBAAmB,CAAC,IAAI,CAAC,EACzB,KAAK,EACL,SAAS,CACV,CAAC;IAEF,OAAO,CACL,6BACE,SAAS,EAAE,eAAe,KACrB,KAAuC,EAC5C,KAAK,EAAE,KAAK,EACZ,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,aAAa,EACrB,IAAI,EAAC,cAAc;QAEnB,8BAAM,CAAC,EAAC,+RAA+R,GAAG,CACtS,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { twMerge } from '../../utils/tw-merge';\nimport { IconSize, IconColor } from './Icon.types';\nimport type { IconProps } from './Icon.types';\nimport { ICON_SIZE_CLASS_MAP } from './Icon.constants';\n\nexport const Icon: React.FC<IconProps> = ({\n name,\n size = IconSize.Md,\n color = IconColor.IconDefault,\n className,\n style,\n ...props\n}) => {\n if (!name) {\n console.warn('Icon name is required');\n return null;\n }\n const mergedClassName = twMerge(\n 'inline-block',\n ICON_SIZE_CLASS_MAP[size],\n color,\n className,\n );\n\n return (\n <svg\n className={mergedClassName}\n {...(props as React.SVGProps<SVGSVGElement>)}\n style={style}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n fill=\"currentColor\"\n >\n <path d=\"m337 51l-171 0c-75 0-119 45-119 119l0 172c0 74 44 119 119 119l171 0c75 0 119-45 119-119l0-172c1-74-44-119-119-119z m-3 220l-67 0 0 67c0 8-7 15-15 15-9 0-16-7-16-15l0-67-66 0c-9 0-16-7-16-15 0-8 7-15 16-15l66 0 0-67c0-8 7-15 16-15 8 0 15 7 15 15l0 67 67 0c8 0 15 7 15 15 0 8-7 15-15 15z\" />\n </svg>\n );\n};\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IconName = exports.IconColor = exports.IconSize = void 0;
|
|
4
|
+
var IconSize;
|
|
5
|
+
(function (IconSize) {
|
|
6
|
+
/** Extra small - 12px */
|
|
7
|
+
IconSize["Xs"] = "xs";
|
|
8
|
+
/** Small - 16px */
|
|
9
|
+
IconSize["Sm"] = "sm";
|
|
10
|
+
/** Medium - 20px (Default) */
|
|
11
|
+
IconSize["Md"] = "md";
|
|
12
|
+
/** Large - 24px */
|
|
13
|
+
IconSize["Lg"] = "lg";
|
|
14
|
+
/** Extra large - 32px */
|
|
15
|
+
IconSize["Xl"] = "xl";
|
|
16
|
+
})(IconSize || (exports.IconSize = IconSize = {}));
|
|
17
|
+
var IconColor;
|
|
18
|
+
(function (IconColor) {
|
|
19
|
+
/** For default neutral icons */
|
|
20
|
+
IconColor["IconDefault"] = "text-icon-default";
|
|
21
|
+
/** For softer neutral icons */
|
|
22
|
+
IconColor["IconAlternative"] = "text-icon-alternative";
|
|
23
|
+
/** For the weakest contrast neutral icons (not accessible) */
|
|
24
|
+
IconColor["IconMuted"] = "text-icon-muted";
|
|
25
|
+
/** For elements used on top of overlay/alternative. Used for text, icon or border */
|
|
26
|
+
IconColor["OverlayInverse"] = "text-overlay-inverse";
|
|
27
|
+
/** For interactive, active, and selected semantics. Used for text, background, icon or border */
|
|
28
|
+
IconColor["PrimaryDefault"] = "text-primary-default";
|
|
29
|
+
/** For elements used on top of primary/default. Used for text, icon or border */
|
|
30
|
+
IconColor["PrimaryInverse"] = "text-primary-inverse";
|
|
31
|
+
/** For the critical alert semantic elements. Used for text, background, icon or border */
|
|
32
|
+
IconColor["ErrorDefault"] = "text-error-default";
|
|
33
|
+
/** For elements used on top of error/default. Used for text, icon or border */
|
|
34
|
+
IconColor["ErrorInverse"] = "text-error-inverse";
|
|
35
|
+
/** For the positive semantic elements. Used for text, background, icon or border */
|
|
36
|
+
IconColor["SuccessDefault"] = "text-success-default";
|
|
37
|
+
/** For elements used on top of success/default. Used for text, icon or border */
|
|
38
|
+
IconColor["SuccessInverse"] = "text-success-inverse";
|
|
39
|
+
/** For the caution alert semantic elements. Used for text, background, icon or border */
|
|
40
|
+
IconColor["WarningDefault"] = "text-warning-default";
|
|
41
|
+
/** For elements used on top of warning/default. Used for text, icon or border */
|
|
42
|
+
IconColor["WarningInverse"] = "text-warning-inverse";
|
|
43
|
+
/** For informational read-only elements. Used for text, background, icon or border */
|
|
44
|
+
IconColor["InfoDefault"] = "text-info-default";
|
|
45
|
+
/** For elements used on top of info/default. Used for text, icon or border */
|
|
46
|
+
IconColor["InfoInverse"] = "text-info-inverse";
|
|
47
|
+
})(IconColor || (exports.IconColor = IconColor = {}));
|
|
48
|
+
// TODO: Add more icons see draft PR https://github.com/MetaMask/metamask-design-system/pull/199
|
|
49
|
+
var IconName;
|
|
50
|
+
(function (IconName) {
|
|
51
|
+
IconName["AddSquare"] = "AddSquare";
|
|
52
|
+
})(IconName || (exports.IconName = IconName = {}));
|
|
53
|
+
//# sourceMappingURL=Icon.types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.types.cjs","sourceRoot":"","sources":["../../../src/components/icon/Icon.types.ts"],"names":[],"mappings":";;;AAuBA,IAAY,QAWX;AAXD,WAAY,QAAQ;IAClB,yBAAyB;IACzB,qBAAS,CAAA;IACT,mBAAmB;IACnB,qBAAS,CAAA;IACT,8BAA8B;IAC9B,qBAAS,CAAA;IACT,mBAAmB;IACnB,qBAAS,CAAA;IACT,yBAAyB;IACzB,qBAAS,CAAA;AACX,CAAC,EAXW,QAAQ,wBAAR,QAAQ,QAWnB;AAED,IAAY,SA6BX;AA7BD,WAAY,SAAS;IACnB,gCAAgC;IAChC,8CAAiC,CAAA;IACjC,+BAA+B;IAC/B,sDAAyC,CAAA;IACzC,8DAA8D;IAC9D,0CAA6B,CAAA;IAC7B,qFAAqF;IACrF,oDAAuC,CAAA;IACvC,iGAAiG;IACjG,oDAAuC,CAAA;IACvC,iFAAiF;IACjF,oDAAuC,CAAA;IACvC,0FAA0F;IAC1F,gDAAmC,CAAA;IACnC,+EAA+E;IAC/E,gDAAmC,CAAA;IACnC,oFAAoF;IACpF,oDAAuC,CAAA;IACvC,iFAAiF;IACjF,oDAAuC,CAAA;IACvC,yFAAyF;IACzF,oDAAuC,CAAA;IACvC,iFAAiF;IACjF,oDAAuC,CAAA;IACvC,sFAAsF;IACtF,8CAAiC,CAAA;IACjC,8EAA8E;IAC9E,8CAAiC,CAAA;AACnC,CAAC,EA7BW,SAAS,yBAAT,SAAS,QA6BpB;AAED,gGAAgG;AAChG,IAAY,QAEX;AAFD,WAAY,QAAQ;IAClB,mCAAuB,CAAA;AACzB,CAAC,EAFW,QAAQ,wBAAR,QAAQ,QAEnB","sourcesContent":["import type { SVGProps, ComponentPropsWithoutRef } from 'react';\n\n// Use ComponentPropsWithoutRef to get SVG element props without relying on global SVGElement\ntype SVGElementProps = ComponentPropsWithoutRef<'svg'>;\n\nexport type IconProps = SVGProps<SVGElementProps> & {\n /**\n * Required prop to specify which icon to render from the icon set\n */\n name: IconName;\n /**\n * Optional prop to control the size of the icon\n * Different sizes map to specific pixel dimensions\n * @default IconSize.Md\n */\n size?: IconSize;\n /**\n * Optional prop that sets the color of the icon using predefined theme colors\n * @default IconColor.IconDefault\n */\n color?: IconColor;\n};\n\nexport enum IconSize {\n /** Extra small - 12px */\n Xs = 'xs',\n /** Small - 16px */\n Sm = 'sm',\n /** Medium - 20px (Default) */\n Md = 'md',\n /** Large - 24px */\n Lg = 'lg',\n /** Extra large - 32px */\n Xl = 'xl',\n}\n\nexport enum IconColor {\n /** For default neutral icons */\n IconDefault = 'text-icon-default',\n /** For softer neutral icons */\n IconAlternative = 'text-icon-alternative',\n /** For the weakest contrast neutral icons (not accessible) */\n IconMuted = 'text-icon-muted',\n /** For elements used on top of overlay/alternative. Used for text, icon or border */\n OverlayInverse = 'text-overlay-inverse',\n /** For interactive, active, and selected semantics. Used for text, background, icon or border */\n PrimaryDefault = 'text-primary-default',\n /** For elements used on top of primary/default. Used for text, icon or border */\n PrimaryInverse = 'text-primary-inverse',\n /** For the critical alert semantic elements. Used for text, background, icon or border */\n ErrorDefault = 'text-error-default',\n /** For elements used on top of error/default. Used for text, icon or border */\n ErrorInverse = 'text-error-inverse',\n /** For the positive semantic elements. Used for text, background, icon or border */\n SuccessDefault = 'text-success-default',\n /** For elements used on top of success/default. Used for text, icon or border */\n SuccessInverse = 'text-success-inverse',\n /** For the caution alert semantic elements. Used for text, background, icon or border */\n WarningDefault = 'text-warning-default',\n /** For elements used on top of warning/default. Used for text, icon or border */\n WarningInverse = 'text-warning-inverse',\n /** For informational read-only elements. Used for text, background, icon or border */\n InfoDefault = 'text-info-default',\n /** For elements used on top of info/default. Used for text, icon or border */\n InfoInverse = 'text-info-inverse',\n}\n\n// TODO: Add more icons see draft PR https://github.com/MetaMask/metamask-design-system/pull/199\nexport enum IconName {\n AddSquare = 'AddSquare',\n}\n"]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { SVGProps, ComponentPropsWithoutRef } from "react";
|
|
2
|
+
type SVGElementProps = ComponentPropsWithoutRef<'svg'>;
|
|
3
|
+
export type IconProps = SVGProps<SVGElementProps> & {
|
|
4
|
+
/**
|
|
5
|
+
* Required prop to specify which icon to render from the icon set
|
|
6
|
+
*/
|
|
7
|
+
name: IconName;
|
|
8
|
+
/**
|
|
9
|
+
* Optional prop to control the size of the icon
|
|
10
|
+
* Different sizes map to specific pixel dimensions
|
|
11
|
+
* @default IconSize.Md
|
|
12
|
+
*/
|
|
13
|
+
size?: IconSize;
|
|
14
|
+
/**
|
|
15
|
+
* Optional prop that sets the color of the icon using predefined theme colors
|
|
16
|
+
* @default IconColor.IconDefault
|
|
17
|
+
*/
|
|
18
|
+
color?: IconColor;
|
|
19
|
+
};
|
|
20
|
+
export declare enum IconSize {
|
|
21
|
+
/** Extra small - 12px */
|
|
22
|
+
Xs = "xs",
|
|
23
|
+
/** Small - 16px */
|
|
24
|
+
Sm = "sm",
|
|
25
|
+
/** Medium - 20px (Default) */
|
|
26
|
+
Md = "md",
|
|
27
|
+
/** Large - 24px */
|
|
28
|
+
Lg = "lg",
|
|
29
|
+
/** Extra large - 32px */
|
|
30
|
+
Xl = "xl"
|
|
31
|
+
}
|
|
32
|
+
export declare enum IconColor {
|
|
33
|
+
/** For default neutral icons */
|
|
34
|
+
IconDefault = "text-icon-default",
|
|
35
|
+
/** For softer neutral icons */
|
|
36
|
+
IconAlternative = "text-icon-alternative",
|
|
37
|
+
/** For the weakest contrast neutral icons (not accessible) */
|
|
38
|
+
IconMuted = "text-icon-muted",
|
|
39
|
+
/** For elements used on top of overlay/alternative. Used for text, icon or border */
|
|
40
|
+
OverlayInverse = "text-overlay-inverse",
|
|
41
|
+
/** For interactive, active, and selected semantics. Used for text, background, icon or border */
|
|
42
|
+
PrimaryDefault = "text-primary-default",
|
|
43
|
+
/** For elements used on top of primary/default. Used for text, icon or border */
|
|
44
|
+
PrimaryInverse = "text-primary-inverse",
|
|
45
|
+
/** For the critical alert semantic elements. Used for text, background, icon or border */
|
|
46
|
+
ErrorDefault = "text-error-default",
|
|
47
|
+
/** For elements used on top of error/default. Used for text, icon or border */
|
|
48
|
+
ErrorInverse = "text-error-inverse",
|
|
49
|
+
/** For the positive semantic elements. Used for text, background, icon or border */
|
|
50
|
+
SuccessDefault = "text-success-default",
|
|
51
|
+
/** For elements used on top of success/default. Used for text, icon or border */
|
|
52
|
+
SuccessInverse = "text-success-inverse",
|
|
53
|
+
/** For the caution alert semantic elements. Used for text, background, icon or border */
|
|
54
|
+
WarningDefault = "text-warning-default",
|
|
55
|
+
/** For elements used on top of warning/default. Used for text, icon or border */
|
|
56
|
+
WarningInverse = "text-warning-inverse",
|
|
57
|
+
/** For informational read-only elements. Used for text, background, icon or border */
|
|
58
|
+
InfoDefault = "text-info-default",
|
|
59
|
+
/** For elements used on top of info/default. Used for text, icon or border */
|
|
60
|
+
InfoInverse = "text-info-inverse"
|
|
61
|
+
}
|
|
62
|
+
export declare enum IconName {
|
|
63
|
+
AddSquare = "AddSquare"
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=Icon.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.types.d.cts","sourceRoot":"","sources":["../../../src/components/icon/Icon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAwB,EAAE,cAAc;AAGhE,KAAK,eAAe,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAEvD,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,eAAe,CAAC,GAAG;IAClD;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IACf;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,oBAAY,QAAQ;IAClB,yBAAyB;IACzB,EAAE,OAAO;IACT,mBAAmB;IACnB,EAAE,OAAO;IACT,8BAA8B;IAC9B,EAAE,OAAO;IACT,mBAAmB;IACnB,EAAE,OAAO;IACT,yBAAyB;IACzB,EAAE,OAAO;CACV;AAED,oBAAY,SAAS;IACnB,gCAAgC;IAChC,WAAW,sBAAsB;IACjC,+BAA+B;IAC/B,eAAe,0BAA0B;IACzC,8DAA8D;IAC9D,SAAS,oBAAoB;IAC7B,qFAAqF;IACrF,cAAc,yBAAyB;IACvC,iGAAiG;IACjG,cAAc,yBAAyB;IACvC,iFAAiF;IACjF,cAAc,yBAAyB;IACvC,0FAA0F;IAC1F,YAAY,uBAAuB;IACnC,+EAA+E;IAC/E,YAAY,uBAAuB;IACnC,oFAAoF;IACpF,cAAc,yBAAyB;IACvC,iFAAiF;IACjF,cAAc,yBAAyB;IACvC,yFAAyF;IACzF,cAAc,yBAAyB;IACvC,iFAAiF;IACjF,cAAc,yBAAyB;IACvC,sFAAsF;IACtF,WAAW,sBAAsB;IACjC,8EAA8E;IAC9E,WAAW,sBAAsB;CAClC;AAGD,oBAAY,QAAQ;IAClB,SAAS,cAAc;CACxB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { SVGProps, ComponentPropsWithoutRef } from "react";
|
|
2
|
+
type SVGElementProps = ComponentPropsWithoutRef<'svg'>;
|
|
3
|
+
export type IconProps = SVGProps<SVGElementProps> & {
|
|
4
|
+
/**
|
|
5
|
+
* Required prop to specify which icon to render from the icon set
|
|
6
|
+
*/
|
|
7
|
+
name: IconName;
|
|
8
|
+
/**
|
|
9
|
+
* Optional prop to control the size of the icon
|
|
10
|
+
* Different sizes map to specific pixel dimensions
|
|
11
|
+
* @default IconSize.Md
|
|
12
|
+
*/
|
|
13
|
+
size?: IconSize;
|
|
14
|
+
/**
|
|
15
|
+
* Optional prop that sets the color of the icon using predefined theme colors
|
|
16
|
+
* @default IconColor.IconDefault
|
|
17
|
+
*/
|
|
18
|
+
color?: IconColor;
|
|
19
|
+
};
|
|
20
|
+
export declare enum IconSize {
|
|
21
|
+
/** Extra small - 12px */
|
|
22
|
+
Xs = "xs",
|
|
23
|
+
/** Small - 16px */
|
|
24
|
+
Sm = "sm",
|
|
25
|
+
/** Medium - 20px (Default) */
|
|
26
|
+
Md = "md",
|
|
27
|
+
/** Large - 24px */
|
|
28
|
+
Lg = "lg",
|
|
29
|
+
/** Extra large - 32px */
|
|
30
|
+
Xl = "xl"
|
|
31
|
+
}
|
|
32
|
+
export declare enum IconColor {
|
|
33
|
+
/** For default neutral icons */
|
|
34
|
+
IconDefault = "text-icon-default",
|
|
35
|
+
/** For softer neutral icons */
|
|
36
|
+
IconAlternative = "text-icon-alternative",
|
|
37
|
+
/** For the weakest contrast neutral icons (not accessible) */
|
|
38
|
+
IconMuted = "text-icon-muted",
|
|
39
|
+
/** For elements used on top of overlay/alternative. Used for text, icon or border */
|
|
40
|
+
OverlayInverse = "text-overlay-inverse",
|
|
41
|
+
/** For interactive, active, and selected semantics. Used for text, background, icon or border */
|
|
42
|
+
PrimaryDefault = "text-primary-default",
|
|
43
|
+
/** For elements used on top of primary/default. Used for text, icon or border */
|
|
44
|
+
PrimaryInverse = "text-primary-inverse",
|
|
45
|
+
/** For the critical alert semantic elements. Used for text, background, icon or border */
|
|
46
|
+
ErrorDefault = "text-error-default",
|
|
47
|
+
/** For elements used on top of error/default. Used for text, icon or border */
|
|
48
|
+
ErrorInverse = "text-error-inverse",
|
|
49
|
+
/** For the positive semantic elements. Used for text, background, icon or border */
|
|
50
|
+
SuccessDefault = "text-success-default",
|
|
51
|
+
/** For elements used on top of success/default. Used for text, icon or border */
|
|
52
|
+
SuccessInverse = "text-success-inverse",
|
|
53
|
+
/** For the caution alert semantic elements. Used for text, background, icon or border */
|
|
54
|
+
WarningDefault = "text-warning-default",
|
|
55
|
+
/** For elements used on top of warning/default. Used for text, icon or border */
|
|
56
|
+
WarningInverse = "text-warning-inverse",
|
|
57
|
+
/** For informational read-only elements. Used for text, background, icon or border */
|
|
58
|
+
InfoDefault = "text-info-default",
|
|
59
|
+
/** For elements used on top of info/default. Used for text, icon or border */
|
|
60
|
+
InfoInverse = "text-info-inverse"
|
|
61
|
+
}
|
|
62
|
+
export declare enum IconName {
|
|
63
|
+
AddSquare = "AddSquare"
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=Icon.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.types.d.mts","sourceRoot":"","sources":["../../../src/components/icon/Icon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAwB,EAAE,cAAc;AAGhE,KAAK,eAAe,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAEvD,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,eAAe,CAAC,GAAG;IAClD;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IACf;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,oBAAY,QAAQ;IAClB,yBAAyB;IACzB,EAAE,OAAO;IACT,mBAAmB;IACnB,EAAE,OAAO;IACT,8BAA8B;IAC9B,EAAE,OAAO;IACT,mBAAmB;IACnB,EAAE,OAAO;IACT,yBAAyB;IACzB,EAAE,OAAO;CACV;AAED,oBAAY,SAAS;IACnB,gCAAgC;IAChC,WAAW,sBAAsB;IACjC,+BAA+B;IAC/B,eAAe,0BAA0B;IACzC,8DAA8D;IAC9D,SAAS,oBAAoB;IAC7B,qFAAqF;IACrF,cAAc,yBAAyB;IACvC,iGAAiG;IACjG,cAAc,yBAAyB;IACvC,iFAAiF;IACjF,cAAc,yBAAyB;IACvC,0FAA0F;IAC1F,YAAY,uBAAuB;IACnC,+EAA+E;IAC/E,YAAY,uBAAuB;IACnC,oFAAoF;IACpF,cAAc,yBAAyB;IACvC,iFAAiF;IACjF,cAAc,yBAAyB;IACvC,yFAAyF;IACzF,cAAc,yBAAyB;IACvC,iFAAiF;IACjF,cAAc,yBAAyB;IACvC,sFAAsF;IACtF,WAAW,sBAAsB;IACjC,8EAA8E;IAC9E,WAAW,sBAAsB;CAClC;AAGD,oBAAY,QAAQ;IAClB,SAAS,cAAc;CACxB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export var IconSize;
|
|
2
|
+
(function (IconSize) {
|
|
3
|
+
/** Extra small - 12px */
|
|
4
|
+
IconSize["Xs"] = "xs";
|
|
5
|
+
/** Small - 16px */
|
|
6
|
+
IconSize["Sm"] = "sm";
|
|
7
|
+
/** Medium - 20px (Default) */
|
|
8
|
+
IconSize["Md"] = "md";
|
|
9
|
+
/** Large - 24px */
|
|
10
|
+
IconSize["Lg"] = "lg";
|
|
11
|
+
/** Extra large - 32px */
|
|
12
|
+
IconSize["Xl"] = "xl";
|
|
13
|
+
})(IconSize || (IconSize = {}));
|
|
14
|
+
export var IconColor;
|
|
15
|
+
(function (IconColor) {
|
|
16
|
+
/** For default neutral icons */
|
|
17
|
+
IconColor["IconDefault"] = "text-icon-default";
|
|
18
|
+
/** For softer neutral icons */
|
|
19
|
+
IconColor["IconAlternative"] = "text-icon-alternative";
|
|
20
|
+
/** For the weakest contrast neutral icons (not accessible) */
|
|
21
|
+
IconColor["IconMuted"] = "text-icon-muted";
|
|
22
|
+
/** For elements used on top of overlay/alternative. Used for text, icon or border */
|
|
23
|
+
IconColor["OverlayInverse"] = "text-overlay-inverse";
|
|
24
|
+
/** For interactive, active, and selected semantics. Used for text, background, icon or border */
|
|
25
|
+
IconColor["PrimaryDefault"] = "text-primary-default";
|
|
26
|
+
/** For elements used on top of primary/default. Used for text, icon or border */
|
|
27
|
+
IconColor["PrimaryInverse"] = "text-primary-inverse";
|
|
28
|
+
/** For the critical alert semantic elements. Used for text, background, icon or border */
|
|
29
|
+
IconColor["ErrorDefault"] = "text-error-default";
|
|
30
|
+
/** For elements used on top of error/default. Used for text, icon or border */
|
|
31
|
+
IconColor["ErrorInverse"] = "text-error-inverse";
|
|
32
|
+
/** For the positive semantic elements. Used for text, background, icon or border */
|
|
33
|
+
IconColor["SuccessDefault"] = "text-success-default";
|
|
34
|
+
/** For elements used on top of success/default. Used for text, icon or border */
|
|
35
|
+
IconColor["SuccessInverse"] = "text-success-inverse";
|
|
36
|
+
/** For the caution alert semantic elements. Used for text, background, icon or border */
|
|
37
|
+
IconColor["WarningDefault"] = "text-warning-default";
|
|
38
|
+
/** For elements used on top of warning/default. Used for text, icon or border */
|
|
39
|
+
IconColor["WarningInverse"] = "text-warning-inverse";
|
|
40
|
+
/** For informational read-only elements. Used for text, background, icon or border */
|
|
41
|
+
IconColor["InfoDefault"] = "text-info-default";
|
|
42
|
+
/** For elements used on top of info/default. Used for text, icon or border */
|
|
43
|
+
IconColor["InfoInverse"] = "text-info-inverse";
|
|
44
|
+
})(IconColor || (IconColor = {}));
|
|
45
|
+
// TODO: Add more icons see draft PR https://github.com/MetaMask/metamask-design-system/pull/199
|
|
46
|
+
export var IconName;
|
|
47
|
+
(function (IconName) {
|
|
48
|
+
IconName["AddSquare"] = "AddSquare";
|
|
49
|
+
})(IconName || (IconName = {}));
|
|
50
|
+
//# sourceMappingURL=Icon.types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.types.mjs","sourceRoot":"","sources":["../../../src/components/icon/Icon.types.ts"],"names":[],"mappings":"AAuBA,MAAM,CAAN,IAAY,QAWX;AAXD,WAAY,QAAQ;IAClB,yBAAyB;IACzB,qBAAS,CAAA;IACT,mBAAmB;IACnB,qBAAS,CAAA;IACT,8BAA8B;IAC9B,qBAAS,CAAA;IACT,mBAAmB;IACnB,qBAAS,CAAA;IACT,yBAAyB;IACzB,qBAAS,CAAA;AACX,CAAC,EAXW,QAAQ,KAAR,QAAQ,QAWnB;AAED,MAAM,CAAN,IAAY,SA6BX;AA7BD,WAAY,SAAS;IACnB,gCAAgC;IAChC,8CAAiC,CAAA;IACjC,+BAA+B;IAC/B,sDAAyC,CAAA;IACzC,8DAA8D;IAC9D,0CAA6B,CAAA;IAC7B,qFAAqF;IACrF,oDAAuC,CAAA;IACvC,iGAAiG;IACjG,oDAAuC,CAAA;IACvC,iFAAiF;IACjF,oDAAuC,CAAA;IACvC,0FAA0F;IAC1F,gDAAmC,CAAA;IACnC,+EAA+E;IAC/E,gDAAmC,CAAA;IACnC,oFAAoF;IACpF,oDAAuC,CAAA;IACvC,iFAAiF;IACjF,oDAAuC,CAAA;IACvC,yFAAyF;IACzF,oDAAuC,CAAA;IACvC,iFAAiF;IACjF,oDAAuC,CAAA;IACvC,sFAAsF;IACtF,8CAAiC,CAAA;IACjC,8EAA8E;IAC9E,8CAAiC,CAAA;AACnC,CAAC,EA7BW,SAAS,KAAT,SAAS,QA6BpB;AAED,gGAAgG;AAChG,MAAM,CAAN,IAAY,QAEX;AAFD,WAAY,QAAQ;IAClB,mCAAuB,CAAA;AACzB,CAAC,EAFW,QAAQ,KAAR,QAAQ,QAEnB","sourcesContent":["import type { SVGProps, ComponentPropsWithoutRef } from 'react';\n\n// Use ComponentPropsWithoutRef to get SVG element props without relying on global SVGElement\ntype SVGElementProps = ComponentPropsWithoutRef<'svg'>;\n\nexport type IconProps = SVGProps<SVGElementProps> & {\n /**\n * Required prop to specify which icon to render from the icon set\n */\n name: IconName;\n /**\n * Optional prop to control the size of the icon\n * Different sizes map to specific pixel dimensions\n * @default IconSize.Md\n */\n size?: IconSize;\n /**\n * Optional prop that sets the color of the icon using predefined theme colors\n * @default IconColor.IconDefault\n */\n color?: IconColor;\n};\n\nexport enum IconSize {\n /** Extra small - 12px */\n Xs = 'xs',\n /** Small - 16px */\n Sm = 'sm',\n /** Medium - 20px (Default) */\n Md = 'md',\n /** Large - 24px */\n Lg = 'lg',\n /** Extra large - 32px */\n Xl = 'xl',\n}\n\nexport enum IconColor {\n /** For default neutral icons */\n IconDefault = 'text-icon-default',\n /** For softer neutral icons */\n IconAlternative = 'text-icon-alternative',\n /** For the weakest contrast neutral icons (not accessible) */\n IconMuted = 'text-icon-muted',\n /** For elements used on top of overlay/alternative. Used for text, icon or border */\n OverlayInverse = 'text-overlay-inverse',\n /** For interactive, active, and selected semantics. Used for text, background, icon or border */\n PrimaryDefault = 'text-primary-default',\n /** For elements used on top of primary/default. Used for text, icon or border */\n PrimaryInverse = 'text-primary-inverse',\n /** For the critical alert semantic elements. Used for text, background, icon or border */\n ErrorDefault = 'text-error-default',\n /** For elements used on top of error/default. Used for text, icon or border */\n ErrorInverse = 'text-error-inverse',\n /** For the positive semantic elements. Used for text, background, icon or border */\n SuccessDefault = 'text-success-default',\n /** For elements used on top of success/default. Used for text, icon or border */\n SuccessInverse = 'text-success-inverse',\n /** For the caution alert semantic elements. Used for text, background, icon or border */\n WarningDefault = 'text-warning-default',\n /** For elements used on top of warning/default. Used for text, icon or border */\n WarningInverse = 'text-warning-inverse',\n /** For informational read-only elements. Used for text, background, icon or border */\n InfoDefault = 'text-info-default',\n /** For elements used on top of info/default. Used for text, icon or border */\n InfoInverse = 'text-info-inverse',\n}\n\n// TODO: Add more icons see draft PR https://github.com/MetaMask/metamask-design-system/pull/199\nexport enum IconName {\n AddSquare = 'AddSquare',\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IconColor = exports.IconSize = exports.IconName = exports.Icon = void 0;
|
|
4
|
+
var Icon_1 = require("./Icon.cjs");
|
|
5
|
+
Object.defineProperty(exports, "Icon", { enumerable: true, get: function () { return Icon_1.Icon; } });
|
|
6
|
+
var Icon_types_1 = require("./Icon.types.cjs");
|
|
7
|
+
Object.defineProperty(exports, "IconName", { enumerable: true, get: function () { return Icon_types_1.IconName; } });
|
|
8
|
+
Object.defineProperty(exports, "IconSize", { enumerable: true, get: function () { return Icon_types_1.IconSize; } });
|
|
9
|
+
Object.defineProperty(exports, "IconColor", { enumerable: true, get: function () { return Icon_types_1.IconColor; } });
|
|
10
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/icon/index.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,+CAA6D;AAApD,sGAAA,QAAQ,OAAA;AAAE,sGAAA,QAAQ,OAAA;AAAE,uGAAA,SAAS,OAAA","sourcesContent":["export { Icon } from './Icon';\nexport { IconName, IconSize, IconColor } from './Icon.types';\nexport type { IconProps } from './Icon.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,mBAAe;AAC9B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,yBAAqB;AAC7D,YAAY,EAAE,SAAS,EAAE,yBAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,mBAAe;AAC9B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,yBAAqB;AAC7D,YAAY,EAAE,SAAS,EAAE,yBAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,mBAAe;AAC9B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,yBAAqB","sourcesContent":["export { Icon } from './Icon';\nexport { IconName, IconSize, IconColor } from './Icon.types';\nexport type { IconProps } from './Icon.types';\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Button = exports.OverflowWrap = exports.TextTransform = exports.FontStyle = exports.FontWeight = exports.TextAlign = exports.TextColor = exports.TextVariant = exports.Text = void 0;
|
|
3
|
+
exports.IconColor = exports.IconSize = exports.IconName = exports.Icon = exports.Button = exports.OverflowWrap = exports.TextTransform = exports.FontStyle = exports.FontWeight = exports.TextAlign = exports.TextColor = exports.TextVariant = exports.Text = void 0;
|
|
4
4
|
var text_1 = require("./text/index.cjs");
|
|
5
5
|
Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return text_1.Text; } });
|
|
6
6
|
var text_2 = require("./text/index.cjs");
|
|
@@ -13,4 +13,10 @@ Object.defineProperty(exports, "TextTransform", { enumerable: true, get: functio
|
|
|
13
13
|
Object.defineProperty(exports, "OverflowWrap", { enumerable: true, get: function () { return text_2.OverflowWrap; } });
|
|
14
14
|
var button_1 = require("./button/index.cjs");
|
|
15
15
|
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return button_1.Button; } });
|
|
16
|
+
var icon_1 = require("./icon/index.cjs");
|
|
17
|
+
Object.defineProperty(exports, "Icon", { enumerable: true, get: function () { return icon_1.Icon; } });
|
|
18
|
+
var icon_2 = require("./icon/index.cjs");
|
|
19
|
+
Object.defineProperty(exports, "IconName", { enumerable: true, get: function () { return icon_2.IconName; } });
|
|
20
|
+
Object.defineProperty(exports, "IconSize", { enumerable: true, get: function () { return icon_2.IconSize; } });
|
|
21
|
+
Object.defineProperty(exports, "IconColor", { enumerable: true, get: function () { return icon_2.IconColor; } });
|
|
16
22
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,yCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,yCAQgB;AAPd,mGAAA,WAAW,OAAA;AACX,iGAAA,SAAS,OAAA;AACT,iGAAA,SAAS,OAAA;AACT,kGAAA,UAAU,OAAA;AACV,iGAAA,SAAS,OAAA;AACT,qGAAA,aAAa,OAAA;AACb,oGAAA,YAAY,OAAA;AAId,6CAAkC;AAAzB,gGAAA,MAAM,OAAA","sourcesContent":["export { Text } from './text';\nexport {\n TextVariant,\n TextColor,\n TextAlign,\n FontWeight,\n FontStyle,\n TextTransform,\n OverflowWrap,\n} from './text';\nexport type { TextProps } from './text';\n\nexport { Button } from './button';\nexport type { ButtonProps } from './button';\n"]}
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,yCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,yCAQgB;AAPd,mGAAA,WAAW,OAAA;AACX,iGAAA,SAAS,OAAA;AACT,iGAAA,SAAS,OAAA;AACT,kGAAA,UAAU,OAAA;AACV,iGAAA,SAAS,OAAA;AACT,qGAAA,aAAa,OAAA;AACb,oGAAA,YAAY,OAAA;AAId,6CAAkC;AAAzB,gGAAA,MAAM,OAAA;AAGf,yCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,yCAAuD;AAA9C,gGAAA,QAAQ,OAAA;AAAE,gGAAA,QAAQ,OAAA;AAAE,iGAAA,SAAS,OAAA","sourcesContent":["export { Text } from './text';\nexport {\n TextVariant,\n TextColor,\n TextAlign,\n FontWeight,\n FontStyle,\n TextTransform,\n OverflowWrap,\n} from './text';\nexport type { TextProps } from './text';\n\nexport { Button } from './button';\nexport type { ButtonProps } from './button';\n\nexport { Icon } from './icon';\nexport { IconName, IconSize, IconColor } from './icon';\nexport type { IconProps } from './icon';\n"]}
|
|
@@ -3,4 +3,7 @@ export { TextVariant, TextColor, TextAlign, FontWeight, FontStyle, TextTransform
|
|
|
3
3
|
export type { TextProps } from "./text/index.cjs";
|
|
4
4
|
export { Button } from "./button/index.cjs";
|
|
5
5
|
export type { ButtonProps } from "./button/index.cjs";
|
|
6
|
+
export { Icon } from "./icon/index.cjs";
|
|
7
|
+
export { IconName, IconSize, IconColor } from "./icon/index.cjs";
|
|
8
|
+
export type { IconProps } from "./icon/index.cjs";
|
|
6
9
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,yBAAe;AAC9B,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,GACb,yBAAe;AAChB,YAAY,EAAE,SAAS,EAAE,yBAAe;AAExC,OAAO,EAAE,MAAM,EAAE,2BAAiB;AAClC,YAAY,EAAE,WAAW,EAAE,2BAAiB"}
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,yBAAe;AAC9B,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,GACb,yBAAe;AAChB,YAAY,EAAE,SAAS,EAAE,yBAAe;AAExC,OAAO,EAAE,MAAM,EAAE,2BAAiB;AAClC,YAAY,EAAE,WAAW,EAAE,2BAAiB;AAE5C,OAAO,EAAE,IAAI,EAAE,yBAAe;AAC9B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,yBAAe;AACvD,YAAY,EAAE,SAAS,EAAE,yBAAe"}
|
|
@@ -3,4 +3,7 @@ export { TextVariant, TextColor, TextAlign, FontWeight, FontStyle, TextTransform
|
|
|
3
3
|
export type { TextProps } from "./text/index.mjs";
|
|
4
4
|
export { Button } from "./button/index.mjs";
|
|
5
5
|
export type { ButtonProps } from "./button/index.mjs";
|
|
6
|
+
export { Icon } from "./icon/index.mjs";
|
|
7
|
+
export { IconName, IconSize, IconColor } from "./icon/index.mjs";
|
|
8
|
+
export type { IconProps } from "./icon/index.mjs";
|
|
6
9
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,yBAAe;AAC9B,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,GACb,yBAAe;AAChB,YAAY,EAAE,SAAS,EAAE,yBAAe;AAExC,OAAO,EAAE,MAAM,EAAE,2BAAiB;AAClC,YAAY,EAAE,WAAW,EAAE,2BAAiB"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,yBAAe;AAC9B,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,GACb,yBAAe;AAChB,YAAY,EAAE,SAAS,EAAE,yBAAe;AAExC,OAAO,EAAE,MAAM,EAAE,2BAAiB;AAClC,YAAY,EAAE,WAAW,EAAE,2BAAiB;AAE5C,OAAO,EAAE,IAAI,EAAE,yBAAe;AAC9B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,yBAAe;AACvD,YAAY,EAAE,SAAS,EAAE,yBAAe"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { Text } from "./text/index.mjs";
|
|
2
2
|
export { TextVariant, TextColor, TextAlign, FontWeight, FontStyle, TextTransform, OverflowWrap } from "./text/index.mjs";
|
|
3
3
|
export { Button } from "./button/index.mjs";
|
|
4
|
+
export { Icon } from "./icon/index.mjs";
|
|
5
|
+
export { IconName, IconSize, IconColor } from "./icon/index.mjs";
|
|
4
6
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,yBAAe;AAC9B,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACb,yBAAe;AAGhB,OAAO,EAAE,MAAM,EAAE,2BAAiB","sourcesContent":["export { Text } from './text';\nexport {\n TextVariant,\n TextColor,\n TextAlign,\n FontWeight,\n FontStyle,\n TextTransform,\n OverflowWrap,\n} from './text';\nexport type { TextProps } from './text';\n\nexport { Button } from './button';\nexport type { ButtonProps } from './button';\n"]}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,yBAAe;AAC9B,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACb,yBAAe;AAGhB,OAAO,EAAE,MAAM,EAAE,2BAAiB;AAGlC,OAAO,EAAE,IAAI,EAAE,yBAAe;AAC9B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,yBAAe","sourcesContent":["export { Text } from './text';\nexport {\n TextVariant,\n TextColor,\n TextAlign,\n FontWeight,\n FontStyle,\n TextTransform,\n OverflowWrap,\n} from './text';\nexport type { TextProps } from './text';\n\nexport { Button } from './button';\nexport type { ButtonProps } from './button';\n\nexport { Icon } from './icon';\nexport { IconName, IconSize, IconColor } from './icon';\nexport type { IconProps } from './icon';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/design-system-react",
|
|
3
|
-
"version": "0.0.0-preview.
|
|
3
|
+
"version": "0.0.0-preview.31cc4ac",
|
|
4
4
|
"description": "Design system react ui components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"tailwind-merge": "^2.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@metamask-previews/design-system-tailwind-preset": "0.0.0-preview.
|
|
53
|
+
"@metamask-previews/design-system-tailwind-preset": "0.0.0-preview.31cc4ac",
|
|
54
54
|
"@metamask/auto-changelog": "^3.4.4",
|
|
55
55
|
"@storybook/react": "^8.3.5",
|
|
56
56
|
"@storybook/test": "^8.3.5",
|