@metamask-previews/design-system-react 0.6.1-preview.abc15cd → 0.9.0-preview.694a8ed
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 +38 -1
- package/dist/components/BadgeCount/BadgeCount.cjs +2 -2
- package/dist/components/BadgeCount/BadgeCount.cjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.cjs +5 -5
- package/dist/components/BadgeCount/BadgeCount.constants.cjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.d.cts +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.d.cts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.d.mts +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.d.mts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.mjs +3 -3
- package/dist/components/BadgeCount/BadgeCount.constants.mjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.d.cts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.d.mts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.mjs +1 -1
- package/dist/components/BadgeCount/BadgeCount.mjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.cjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.d.cts +4 -21
- package/dist/components/BadgeCount/BadgeCount.types.d.cts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.d.mts +4 -21
- package/dist/components/BadgeCount/BadgeCount.types.d.mts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.mjs.map +1 -1
- package/dist/components/BadgeCount/index.cjs +2 -2
- package/dist/components/BadgeCount/index.cjs.map +1 -1
- package/dist/components/BadgeCount/index.d.cts +1 -1
- package/dist/components/BadgeCount/index.d.cts.map +1 -1
- package/dist/components/BadgeCount/index.d.mts +1 -1
- package/dist/components/BadgeCount/index.d.mts.map +1 -1
- package/dist/components/BadgeCount/index.mjs +1 -1
- package/dist/components/BadgeCount/index.mjs.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.cjs +2 -2
- package/dist/components/BadgeStatus/BadgeStatus.cjs.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.constants.cjs +8 -8
- package/dist/components/BadgeStatus/BadgeStatus.constants.cjs.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.constants.d.cts +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.constants.d.cts.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.constants.d.mts +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.constants.d.mts.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.constants.mjs +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.constants.mjs.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.d.cts.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.d.mts.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.mjs +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.mjs.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.cjs.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.d.cts +4 -28
- package/dist/components/BadgeStatus/BadgeStatus.types.d.cts.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.d.mts +4 -28
- package/dist/components/BadgeStatus/BadgeStatus.types.d.mts.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.mjs.map +1 -1
- package/dist/components/BadgeStatus/index.cjs +3 -3
- package/dist/components/BadgeStatus/index.cjs.map +1 -1
- package/dist/components/BadgeStatus/index.d.cts +1 -1
- package/dist/components/BadgeStatus/index.d.cts.map +1 -1
- package/dist/components/BadgeStatus/index.d.mts +1 -1
- package/dist/components/BadgeStatus/index.d.mts.map +1 -1
- package/dist/components/BadgeStatus/index.mjs +1 -1
- package/dist/components/BadgeStatus/index.mjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.cjs +54 -0
- package/dist/components/BannerBase/BannerBase.cjs.map +1 -0
- package/dist/components/BannerBase/BannerBase.d.cts +614 -0
- package/dist/components/BannerBase/BannerBase.d.cts.map +1 -0
- package/dist/components/BannerBase/BannerBase.d.mts +614 -0
- package/dist/components/BannerBase/BannerBase.d.mts.map +1 -0
- package/dist/components/BannerBase/BannerBase.mjs +35 -0
- package/dist/components/BannerBase/BannerBase.mjs.map +1 -0
- package/dist/components/BannerBase/BannerBase.types.cjs +3 -0
- package/dist/components/BannerBase/BannerBase.types.cjs.map +1 -0
- package/dist/components/BannerBase/BannerBase.types.d.cts +50 -0
- package/dist/components/BannerBase/BannerBase.types.d.cts.map +1 -0
- package/dist/components/BannerBase/BannerBase.types.d.mts +50 -0
- package/dist/components/BannerBase/BannerBase.types.d.mts.map +1 -0
- package/dist/components/BannerBase/BannerBase.types.mjs +2 -0
- package/dist/components/BannerBase/BannerBase.types.mjs.map +1 -0
- package/dist/components/BannerBase/index.cjs +6 -0
- package/dist/components/BannerBase/index.cjs.map +1 -0
- package/dist/components/BannerBase/index.d.cts +3 -0
- package/dist/components/BannerBase/index.d.cts.map +1 -0
- package/dist/components/BannerBase/index.d.mts +3 -0
- package/dist/components/BannerBase/index.d.mts.map +1 -0
- package/dist/components/BannerBase/index.mjs +2 -0
- package/dist/components/BannerBase/index.mjs.map +1 -0
- package/dist/components/Icon/icons/CorporateFare.cjs +32 -0
- package/dist/components/Icon/icons/CorporateFare.cjs.map +1 -0
- package/dist/components/Icon/icons/CorporateFare.d.cts +4 -0
- package/dist/components/Icon/icons/CorporateFare.d.cts.map +1 -0
- package/dist/components/Icon/icons/CorporateFare.d.mts +4 -0
- package/dist/components/Icon/icons/CorporateFare.d.mts.map +1 -0
- package/dist/components/Icon/icons/CorporateFare.mjs +7 -0
- package/dist/components/Icon/icons/CorporateFare.mjs.map +1 -0
- package/dist/components/Icon/icons/PopUp.cjs +32 -0
- package/dist/components/Icon/icons/PopUp.cjs.map +1 -0
- package/dist/components/Icon/icons/PopUp.d.cts +4 -0
- package/dist/components/Icon/icons/PopUp.d.cts.map +1 -0
- package/dist/components/Icon/icons/PopUp.d.mts +4 -0
- package/dist/components/Icon/icons/PopUp.d.mts.map +1 -0
- package/dist/components/Icon/icons/PopUp.mjs +7 -0
- package/dist/components/Icon/icons/PopUp.mjs.map +1 -0
- package/dist/components/Icon/icons/SidePanel.cjs +32 -0
- package/dist/components/Icon/icons/SidePanel.cjs.map +1 -0
- package/dist/components/Icon/icons/SidePanel.d.cts +4 -0
- package/dist/components/Icon/icons/SidePanel.d.cts.map +1 -0
- package/dist/components/Icon/icons/SidePanel.d.mts +4 -0
- package/dist/components/Icon/icons/SidePanel.d.mts.map +1 -0
- package/dist/components/Icon/icons/SidePanel.mjs +7 -0
- package/dist/components/Icon/icons/SidePanel.mjs.map +1 -0
- package/dist/components/Icon/icons/index.cjs +6 -0
- package/dist/components/Icon/icons/index.cjs.map +1 -1
- package/dist/components/Icon/icons/index.d.cts +3 -0
- package/dist/components/Icon/icons/index.d.cts.map +1 -1
- package/dist/components/Icon/icons/index.d.mts +3 -0
- package/dist/components/Icon/icons/index.d.mts.map +1 -1
- package/dist/components/Icon/icons/index.mjs +6 -0
- package/dist/components/Icon/icons/index.mjs.map +1 -1
- package/dist/components/Input/Input.cjs +36 -0
- package/dist/components/Input/Input.cjs.map +1 -0
- package/dist/components/Input/Input.d.cts +10 -0
- package/dist/components/Input/Input.d.cts.map +1 -0
- package/dist/components/Input/Input.d.mts +10 -0
- package/dist/components/Input/Input.d.mts.map +1 -0
- package/dist/components/Input/Input.mjs +17 -0
- package/dist/components/Input/Input.mjs.map +1 -0
- package/dist/components/Input/Input.types.cjs +3 -0
- package/dist/components/Input/Input.types.cjs.map +1 -0
- package/dist/components/Input/Input.types.d.cts +31 -0
- package/dist/components/Input/Input.types.d.cts.map +1 -0
- package/dist/components/Input/Input.types.d.mts +31 -0
- package/dist/components/Input/Input.types.d.mts.map +1 -0
- package/dist/components/Input/Input.types.mjs +2 -0
- package/dist/components/Input/Input.types.mjs.map +1 -0
- package/dist/components/Input/index.cjs +6 -0
- package/dist/components/Input/index.cjs.map +1 -0
- package/dist/components/Input/index.d.cts +3 -0
- package/dist/components/Input/index.d.cts.map +1 -0
- package/dist/components/Input/index.d.mts +3 -0
- package/dist/components/Input/index.d.mts.map +1 -0
- package/dist/components/Input/index.mjs +2 -0
- package/dist/components/Input/index.mjs.map +1 -0
- package/dist/components/index.cjs +6 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +4 -0
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +4 -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/dist/types/index.cjs +14 -50
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +13 -46
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +13 -46
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +13 -49
- package/dist/types/index.mjs.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.9.0]
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **BREAKING:** Migrated `BadgeStatus` component from TypeScript enums to string union types with const objects ([#912](https://github.com/MetaMask/metamask-design-system/pull/912))
|
|
15
|
+
- `BadgeStatusStatus` and `BadgeStatusSize` enums replaced with const objects and derived string union types
|
|
16
|
+
- **No migration required** - continue importing from `@metamask/design-system-react` as usual
|
|
17
|
+
- Const object values remain the same (e.g., `BadgeStatusStatus.Active` still works)
|
|
18
|
+
- String literals now also accepted thanks to structural typing (e.g., `'active'` works where `BadgeStatusStatus.Active` is expected)
|
|
19
|
+
- We are still evaluating best practices for const objects vs string literals - use whichever approach works best for your codebase
|
|
20
|
+
- This change implements [ADR-0003](https://github.com/MetaMask/decisions/blob/main/decisions/design-system/0003-enum-to-string-union-migration.md) and [ADR-0004](https://github.com/MetaMask/decisions/blob/main/decisions/design-system/0004-centralized-types-architecture.md)
|
|
21
|
+
|
|
22
|
+
## [0.8.0]
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- Added `CorporateFare` icon to represent stocks ([#920](https://github.com/MetaMask/metamask-design-system/pull/920))
|
|
27
|
+
- Added `Input` component for text input fields ([#909](https://github.com/MetaMask/metamask-design-system/pull/909))
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- **BREAKING:** Standardized non-icon enum runtime values to use kebab-case format ([#894](https://github.com/MetaMask/metamask-design-system/pull/894))
|
|
32
|
+
- Enum values now use lowercase/kebab-case (e.g., `'primary'` instead of `'Primary'`, `'top-right'` instead of `'TopRight'`)
|
|
33
|
+
- **Migration likely not needed** - continue using enum constants (e.g., `ButtonVariant.Primary`)
|
|
34
|
+
- **Migration needed** only if your app persists or transmits these enum values (localStorage, databases, APIs)
|
|
35
|
+
- This prepares for migration from enums to string union types per ADR #127
|
|
36
|
+
- Updated `@metamask/utils` peer dependency from 11.9.0 to 11.10.0 ([#903](https://github.com/MetaMask/metamask-design-system/pull/903))
|
|
37
|
+
|
|
38
|
+
## [0.7.0]
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- Added `AfterHours`, `Popup`, and `Sidepanel` icons ([#898](https://github.com/MetaMask/metamask-design-system/pull/898), [#879](https://github.com/MetaMask/metamask-design-system/pull/879))
|
|
43
|
+
|
|
10
44
|
## [0.6.1]
|
|
11
45
|
|
|
12
46
|
### Changed
|
|
@@ -123,7 +157,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
123
157
|
- Full TypeScript support with type definitions and enums
|
|
124
158
|
- Tailwind CSS integration with design token support
|
|
125
159
|
|
|
126
|
-
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.
|
|
160
|
+
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.9.0...HEAD
|
|
161
|
+
[0.9.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.8.0...@metamask/design-system-react@0.9.0
|
|
162
|
+
[0.8.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.7.0...@metamask/design-system-react@0.8.0
|
|
163
|
+
[0.7.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.6.1...@metamask/design-system-react@0.7.0
|
|
127
164
|
[0.6.1]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.6.0...@metamask/design-system-react@0.6.1
|
|
128
165
|
[0.6.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.5.0...@metamask/design-system-react@0.6.0
|
|
129
166
|
[0.5.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react@0.4.1...@metamask/design-system-react@0.5.0
|
|
@@ -24,12 +24,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.BadgeCount = void 0;
|
|
27
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
27
28
|
const react_1 = __importStar(require("react"));
|
|
28
|
-
const types_1 = require("../../types/index.cjs");
|
|
29
29
|
const tw_merge_1 = require("../../utils/tw-merge.cjs");
|
|
30
30
|
const Text_1 = require("../Text/index.cjs");
|
|
31
31
|
const BadgeCount_constants_1 = require("./BadgeCount.constants.cjs");
|
|
32
|
-
exports.BadgeCount = (0, react_1.forwardRef)(({ size =
|
|
32
|
+
exports.BadgeCount = (0, react_1.forwardRef)(({ size = design_system_shared_1.BadgeCountSize.Md, count, max = 99, textProps, className = '', style, ...props }, ref) => {
|
|
33
33
|
const mergedClassName = (0, tw_merge_1.twMerge)(
|
|
34
34
|
// Base styles
|
|
35
35
|
'inline-flex items-center justify-center self-start rounded-lg bg-error-default', BadgeCount_constants_1.TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER[size], className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.cjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,
|
|
1
|
+
{"version":3,"file":"BadgeCount.cjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAAyE;AACzE,+CAA0C;AAE1C,uDAA+C;AAC/C,4CAAsD;AAEtD,qEAGgC;AAGnB,QAAA,UAAU,GAAG,IAAA,kBAAU,EAClC,CACE,EACE,IAAI,GAAG,qCAAc,CAAC,EAAE,EACxB,KAAK,EACL,GAAG,GAAG,EAAE,EACR,SAAS,EACT,SAAS,GAAG,EAAE,EACd,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,eAAe,GAAG,IAAA,kBAAO;IAC7B,cAAc;IACd,gFAAgF,EAChF,2DAAoC,CAAC,IAAI,CAAC,EAC1C,SAAS,CACV,CAAC;IAEF,OAAO,CACL,uCAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK;QAChE,8BAAC,WAAI,IACH,OAAO,EAAE,sDAA+B,CAAC,IAAI,CAAC,EAC9C,KAAK,EAAE,gBAAS,CAAC,YAAY,EAC7B,UAAU,EAAE,iBAAU,CAAC,MAAM,KACzB,SAAS,EACb,SAAS,EAAE,GAAG,SAAS,EAAE,SAAS,IAAI,EAAE,EAAE,EAC1C,OAAO;YAEP,4CAAO,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAQ,CAC9C,CACH,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import { BadgeCountSize } from '@metamask-previews/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Text, TextColor, FontWeight } from '../Text';\n\nimport {\n MAP_BADGECOUNT_SIZE_TEXTVARIANT,\n TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER,\n} from './BadgeCount.constants';\nimport type { BadgeCountProps } from './BadgeCount.types';\n\nexport const BadgeCount = forwardRef<HTMLDivElement, BadgeCountProps>(\n (\n {\n size = BadgeCountSize.Md,\n count,\n max = 99,\n textProps,\n className = '',\n style,\n ...props\n },\n ref,\n ) => {\n const mergedClassName = twMerge(\n // Base styles\n 'inline-flex items-center justify-center self-start rounded-lg bg-error-default',\n TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER[size],\n className,\n );\n\n return (\n <div ref={ref} className={mergedClassName} style={style} {...props}>\n <Text\n variant={MAP_BADGECOUNT_SIZE_TEXTVARIANT[size]}\n color={TextColor.ErrorInverse}\n fontWeight={FontWeight.Medium}\n {...textProps}\n className={`${textProps?.className || ''}`}\n asChild\n >\n <span>{count > max ? `${max}+` : `${count}`}</span>\n </Text>\n </div>\n );\n },\n);\n\nBadgeCount.displayName = 'BadgeCount';\n"]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER = exports.MAP_BADGECOUNT_SIZE_TEXTVARIANT = void 0;
|
|
4
|
-
const
|
|
4
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
5
|
const Text_1 = require("../Text/index.cjs");
|
|
6
6
|
// Mappings
|
|
7
7
|
exports.MAP_BADGECOUNT_SIZE_TEXTVARIANT = {
|
|
8
|
-
[
|
|
9
|
-
[
|
|
8
|
+
[design_system_shared_1.BadgeCountSize.Md]: Text_1.TextVariant.BodyXs,
|
|
9
|
+
[design_system_shared_1.BadgeCountSize.Lg]: Text_1.TextVariant.BodySm,
|
|
10
10
|
};
|
|
11
11
|
exports.TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER = {
|
|
12
|
-
[
|
|
13
|
-
[
|
|
12
|
+
[design_system_shared_1.BadgeCountSize.Md]: 'min-w-4 h-4 px-1',
|
|
13
|
+
[design_system_shared_1.BadgeCountSize.Lg]: 'min-w-6 h- px-1.5', // min-width 24px, height 20px, padding-horizontal 6
|
|
14
14
|
};
|
|
15
15
|
//# sourceMappingURL=BadgeCount.constants.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.constants.cjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.constants.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"BadgeCount.constants.cjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.constants.ts"],"names":[],"mappings":";;;AAAA,kFAAyE;AAEzE,4CAAsC;AAEtC,WAAW;AACE,QAAA,+BAA+B,GAGxC;IACF,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,kBAAW,CAAC,MAAM;IACvC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,kBAAW,CAAC,MAAM;CACxC,CAAC;AAEW,QAAA,oCAAoC,GAG7C;IACF,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,kBAAkB;IACvC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,mBAAmB,EAAE,oDAAoD;CAC/F,CAAC","sourcesContent":["import { BadgeCountSize } from '@metamask-previews/design-system-shared';\n\nimport { TextVariant } from '../Text';\n\n// Mappings\nexport const MAP_BADGECOUNT_SIZE_TEXTVARIANT: Record<\n BadgeCountSize,\n TextVariant\n> = {\n [BadgeCountSize.Md]: TextVariant.BodyXs,\n [BadgeCountSize.Lg]: TextVariant.BodySm,\n};\n\nexport const TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER: Record<\n BadgeCountSize,\n string\n> = {\n [BadgeCountSize.Md]: 'min-w-4 h-4 px-1', // min-width 16px, height 14px, padding-horizontal 4\n [BadgeCountSize.Lg]: 'min-w-6 h- px-1.5', // min-width 24px, height 20px, padding-horizontal 6\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BadgeCountSize } from "
|
|
1
|
+
import { BadgeCountSize } from "@metamask-previews/design-system-shared";
|
|
2
2
|
import { TextVariant } from "../Text/index.cjs";
|
|
3
3
|
export declare const MAP_BADGECOUNT_SIZE_TEXTVARIANT: Record<BadgeCountSize, TextVariant>;
|
|
4
4
|
export declare const TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER: Record<BadgeCountSize, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.constants.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"BadgeCount.constants.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AAEzE,OAAO,EAAE,WAAW,EAAE,0BAAgB;AAGtC,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAClD,cAAc,EACd,WAAW,CAIZ,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,cAAc,EACd,MAAM,CAIP,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BadgeCountSize } from "
|
|
1
|
+
import { BadgeCountSize } from "@metamask-previews/design-system-shared";
|
|
2
2
|
import { TextVariant } from "../Text/index.mjs";
|
|
3
3
|
export declare const MAP_BADGECOUNT_SIZE_TEXTVARIANT: Record<BadgeCountSize, TextVariant>;
|
|
4
4
|
export declare const TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER: Record<BadgeCountSize, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.constants.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"BadgeCount.constants.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AAEzE,OAAO,EAAE,WAAW,EAAE,0BAAgB;AAGtC,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAClD,cAAc,EACd,WAAW,CAIZ,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,cAAc,EACd,MAAM,CAIP,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BadgeCountSize } from "
|
|
1
|
+
import { BadgeCountSize } from "@metamask-previews/design-system-shared";
|
|
2
2
|
import { TextVariant } from "../Text/index.mjs";
|
|
3
3
|
// Mappings
|
|
4
4
|
export const MAP_BADGECOUNT_SIZE_TEXTVARIANT = {
|
|
@@ -6,7 +6,7 @@ export const MAP_BADGECOUNT_SIZE_TEXTVARIANT = {
|
|
|
6
6
|
[BadgeCountSize.Lg]: TextVariant.BodySm,
|
|
7
7
|
};
|
|
8
8
|
export const TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER = {
|
|
9
|
-
[BadgeCountSize.Md]: 'min-w-4 h-
|
|
10
|
-
[BadgeCountSize.Lg]: 'min-w-6 h-
|
|
9
|
+
[BadgeCountSize.Md]: 'min-w-4 h-4 px-1',
|
|
10
|
+
[BadgeCountSize.Lg]: 'min-w-6 h- px-1.5', // min-width 24px, height 20px, padding-horizontal 6
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=BadgeCount.constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.constants.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"BadgeCount.constants.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AAEzE,OAAO,EAAE,WAAW,EAAE,0BAAgB;AAEtC,WAAW;AACX,MAAM,CAAC,MAAM,+BAA+B,GAGxC;IACF,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM;IACvC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAG7C;IACF,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,kBAAkB;IACvC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,mBAAmB,EAAE,oDAAoD;CAC/F,CAAC","sourcesContent":["import { BadgeCountSize } from '@metamask-previews/design-system-shared';\n\nimport { TextVariant } from '../Text';\n\n// Mappings\nexport const MAP_BADGECOUNT_SIZE_TEXTVARIANT: Record<\n BadgeCountSize,\n TextVariant\n> = {\n [BadgeCountSize.Md]: TextVariant.BodyXs,\n [BadgeCountSize.Lg]: TextVariant.BodySm,\n};\n\nexport const TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER: Record<\n BadgeCountSize,\n string\n> = {\n [BadgeCountSize.Md]: 'min-w-4 h-4 px-1', // min-width 16px, height 14px, padding-horizontal 4\n [BadgeCountSize.Lg]: 'min-w-6 h- px-1.5', // min-width 24px, height 20px, padding-horizontal 6\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BadgeCount.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,cAAc;AAS1C,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,qGAmCtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BadgeCount.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,cAAc;AAS1C,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,qGAmCtB,CAAC"}
|
|
@@ -4,9 +4,9 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
+
import { BadgeCountSize } from "@metamask-previews/design-system-shared";
|
|
7
8
|
import $React, { forwardRef } from "react";
|
|
8
9
|
const React = $importDefault($React);
|
|
9
|
-
import { BadgeCountSize } from "../../types/index.mjs";
|
|
10
10
|
import { twMerge } from "../../utils/tw-merge.mjs";
|
|
11
11
|
import { Text, TextColor, FontWeight } from "../Text/index.mjs";
|
|
12
12
|
import { MAP_BADGECOUNT_SIZE_TEXTVARIANT, TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER } from "./BadgeCount.constants.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BadgeCount.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AACzE,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,0BAAgB;AAEtD,OAAO,EACL,+BAA+B,EAC/B,oCAAoC,EACrC,mCAA+B;AAGhC,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAClC,CACE,EACE,IAAI,GAAG,cAAc,CAAC,EAAE,EACxB,KAAK,EACL,GAAG,GAAG,EAAE,EACR,SAAS,EACT,SAAS,GAAG,EAAE,EACd,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,eAAe,GAAG,OAAO;IAC7B,cAAc;IACd,gFAAgF,EAChF,oCAAoC,CAAC,IAAI,CAAC,EAC1C,SAAS,CACV,CAAC;IAEF,OAAO,CACL,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK;QAChE,oBAAC,IAAI,IACH,OAAO,EAAE,+BAA+B,CAAC,IAAI,CAAC,EAC9C,KAAK,EAAE,SAAS,CAAC,YAAY,EAC7B,UAAU,EAAE,UAAU,CAAC,MAAM,KACzB,SAAS,EACb,SAAS,EAAE,GAAG,SAAS,EAAE,SAAS,IAAI,EAAE,EAAE,EAC1C,OAAO;YAEP,kCAAO,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAQ,CAC9C,CACH,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import { BadgeCountSize } from '@metamask-previews/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Text, TextColor, FontWeight } from '../Text';\n\nimport {\n MAP_BADGECOUNT_SIZE_TEXTVARIANT,\n TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER,\n} from './BadgeCount.constants';\nimport type { BadgeCountProps } from './BadgeCount.types';\n\nexport const BadgeCount = forwardRef<HTMLDivElement, BadgeCountProps>(\n (\n {\n size = BadgeCountSize.Md,\n count,\n max = 99,\n textProps,\n className = '',\n style,\n ...props\n },\n ref,\n ) => {\n const mergedClassName = twMerge(\n // Base styles\n 'inline-flex items-center justify-center self-start rounded-lg bg-error-default',\n TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER[size],\n className,\n );\n\n return (\n <div ref={ref} className={mergedClassName} style={style} {...props}>\n <Text\n variant={MAP_BADGECOUNT_SIZE_TEXTVARIANT[size]}\n color={TextColor.ErrorInverse}\n fontWeight={FontWeight.Medium}\n {...textProps}\n className={`${textProps?.className || ''}`}\n asChild\n >\n <span>{count > max ? `${max}+` : `${count}`}</span>\n </Text>\n </div>\n );\n },\n);\n\nBadgeCount.displayName = 'BadgeCount';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"BadgeCount.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"","sourcesContent":["// Import shared type for extension\nimport type { BadgeCountPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ComponentProps } from 'react';\n\nimport type { TextProps } from '../Text';\n\n/**\n * BadgeCount component props (React platform-specific)\n * Extends shared props with React-specific platform concerns\n */\nexport type BadgeCountProps = ComponentProps<'div'> &\n BadgeCountPropsShared & {\n /**\n * Optional props to be passed to the Text component used by count\n */\n textProps?: Partial<TextProps>;\n /**\n * Optional prop for additional CSS classes to be applied to the BadgeCount component.\n * These classes will be merged with the component's default classes using twMerge.\n */\n className?: string;\n /**\n * Optional CSS styles to be applied to the component.\n * Should be used sparingly and only for dynamic styles that can't be achieved with className.\n */\n style?: React.CSSProperties;\n };\n"]}
|
|
@@ -1,28 +1,11 @@
|
|
|
1
|
+
import type { BadgeCountPropsShared } from "@metamask-previews/design-system-shared";
|
|
1
2
|
import type { ComponentProps } from "react";
|
|
2
|
-
import type { BadgeCountSize } from "../../types/index.cjs";
|
|
3
3
|
import type { TextProps } from "../Text/index.cjs";
|
|
4
4
|
/**
|
|
5
|
-
* BadgeCount component props
|
|
5
|
+
* BadgeCount component props (React platform-specific)
|
|
6
|
+
* Extends shared props with React-specific platform concerns
|
|
6
7
|
*/
|
|
7
|
-
export type BadgeCountProps = ComponentProps<'div'> & {
|
|
8
|
-
/**
|
|
9
|
-
* Optional prop to control the size of the BadgeCount
|
|
10
|
-
* Different sizes map to specific height
|
|
11
|
-
*
|
|
12
|
-
* @default IconSize.Md
|
|
13
|
-
*/
|
|
14
|
-
size?: BadgeCountSize;
|
|
15
|
-
/**
|
|
16
|
-
* Required prop to show the count number
|
|
17
|
-
*/
|
|
18
|
-
count: number;
|
|
19
|
-
/**
|
|
20
|
-
* Optional prop to determine the max the count can go up to.
|
|
21
|
-
* If count > max, the count will be shown as "max+"
|
|
22
|
-
*
|
|
23
|
-
* @default 99
|
|
24
|
-
*/
|
|
25
|
-
max?: number;
|
|
8
|
+
export type BadgeCountProps = ComponentProps<'div'> & BadgeCountPropsShared & {
|
|
26
9
|
/**
|
|
27
10
|
* Optional props to be passed to the Text component used by count
|
|
28
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BadgeCount.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC,GACjD,qBAAqB,GAAG;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC"}
|
|
@@ -1,28 +1,11 @@
|
|
|
1
|
+
import type { BadgeCountPropsShared } from "@metamask-previews/design-system-shared";
|
|
1
2
|
import type { ComponentProps } from "react";
|
|
2
|
-
import type { BadgeCountSize } from "../../types/index.mjs";
|
|
3
3
|
import type { TextProps } from "../Text/index.mjs";
|
|
4
4
|
/**
|
|
5
|
-
* BadgeCount component props
|
|
5
|
+
* BadgeCount component props (React platform-specific)
|
|
6
|
+
* Extends shared props with React-specific platform concerns
|
|
6
7
|
*/
|
|
7
|
-
export type BadgeCountProps = ComponentProps<'div'> & {
|
|
8
|
-
/**
|
|
9
|
-
* Optional prop to control the size of the BadgeCount
|
|
10
|
-
* Different sizes map to specific height
|
|
11
|
-
*
|
|
12
|
-
* @default IconSize.Md
|
|
13
|
-
*/
|
|
14
|
-
size?: BadgeCountSize;
|
|
15
|
-
/**
|
|
16
|
-
* Required prop to show the count number
|
|
17
|
-
*/
|
|
18
|
-
count: number;
|
|
19
|
-
/**
|
|
20
|
-
* Optional prop to determine the max the count can go up to.
|
|
21
|
-
* If count > max, the count will be shown as "max+"
|
|
22
|
-
*
|
|
23
|
-
* @default 99
|
|
24
|
-
*/
|
|
25
|
-
max?: number;
|
|
8
|
+
export type BadgeCountProps = ComponentProps<'div'> & BadgeCountPropsShared & {
|
|
26
9
|
/**
|
|
27
10
|
* Optional props to be passed to the Text component used by count
|
|
28
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BadgeCount.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC,GACjD,qBAAqB,GAAG;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"BadgeCount.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"","sourcesContent":["// Import shared type for extension\nimport type { BadgeCountPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ComponentProps } from 'react';\n\nimport type { TextProps } from '../Text';\n\n/**\n * BadgeCount component props (React platform-specific)\n * Extends shared props with React-specific platform concerns\n */\nexport type BadgeCountProps = ComponentProps<'div'> &\n BadgeCountPropsShared & {\n /**\n * Optional props to be passed to the Text component used by count\n */\n textProps?: Partial<TextProps>;\n /**\n * Optional prop for additional CSS classes to be applied to the BadgeCount component.\n * These classes will be merged with the component's default classes using twMerge.\n */\n className?: string;\n /**\n * Optional CSS styles to be applied to the component.\n * Should be used sparingly and only for dynamic styles that can't be achieved with className.\n */\n style?: React.CSSProperties;\n };\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BadgeCount = exports.BadgeCountSize = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "BadgeCountSize", { enumerable: true, get: function () { return
|
|
4
|
+
var design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
|
+
Object.defineProperty(exports, "BadgeCountSize", { enumerable: true, get: function () { return design_system_shared_1.BadgeCountSize; } });
|
|
6
6
|
var BadgeCount_1 = require("./BadgeCount.cjs");
|
|
7
7
|
Object.defineProperty(exports, "BadgeCount", { enumerable: true, get: function () { return BadgeCount_1.BadgeCount; } });
|
|
8
8
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":";;;AAAA,gFAAyE;AAAhE,sHAAA,cAAc,OAAA;AACvB,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { BadgeCountSize } from '@metamask-previews/design-system-shared';\nexport { BadgeCount } from './BadgeCount';\nexport type { BadgeCountProps } from './BadgeCount.types';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BadgeCountSize } from "
|
|
1
|
+
export { BadgeCountSize } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export { BadgeCount } from "./BadgeCount.cjs";
|
|
3
3
|
export type { BadgeCountProps } from "./BadgeCount.types.cjs";
|
|
4
4
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AACzE,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BadgeCountSize } from "
|
|
1
|
+
export { BadgeCountSize } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export { BadgeCount } from "./BadgeCount.mjs";
|
|
3
3
|
export type { BadgeCountProps } from "./BadgeCount.types.mjs";
|
|
4
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AACzE,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AACzE,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { BadgeCountSize } from '@metamask-previews/design-system-shared';\nexport { BadgeCount } from './BadgeCount';\nexport type { BadgeCountProps } from './BadgeCount.types';\n"]}
|
|
@@ -24,11 +24,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.BadgeStatus = void 0;
|
|
27
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
27
28
|
const react_1 = __importStar(require("react"));
|
|
28
|
-
const types_1 = require("../../types/index.cjs");
|
|
29
29
|
const tw_merge_1 = require("../../utils/tw-merge.cjs");
|
|
30
30
|
const BadgeStatus_constants_1 = require("./BadgeStatus.constants.cjs");
|
|
31
|
-
exports.BadgeStatus = (0, react_1.forwardRef)(({ status, size =
|
|
31
|
+
exports.BadgeStatus = (0, react_1.forwardRef)(({ status, size = design_system_shared_1.BadgeStatusSize.Md, hasBorder = true, className, style, ...props }, ref) => {
|
|
32
32
|
const mergedClassName = (0, tw_merge_1.twMerge)(
|
|
33
33
|
// Base styles
|
|
34
34
|
'inline-flex rounded-full',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,
|
|
1
|
+
{"version":3,"file":"BadgeStatus.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAA0E;AAC1E,+CAA0C;AAE1C,uDAA+C;AAE/C,uEAGiC;AAGpB,QAAA,WAAW,GAAG,IAAA,kBAAU,EACnC,CACE,EACE,MAAM,EACN,IAAI,GAAG,sCAAe,CAAC,EAAE,EACzB,SAAS,GAAG,IAAI,EAChB,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,eAAe,GAAG,IAAA,kBAAO;IAC7B,cAAc;IACd,0BAA0B;IAC1B,kBAAkB;IAClB,SAAS,CAAC,CAAC,CAAC,oCAAoC,CAAC,CAAC,CAAC,EAAE;IACrD,iBAAiB;IACjB,SAAS,CACV,CAAC;IAEF,MAAM,qBAAqB,GAAG,IAAA,kBAAO;IACnC,cAAc;IACd,4BAA4B;IAC5B,cAAc;IACd,iDAAyB,CAAC,IAAI,CAAC;IAC/B,8BAA8B;IAC9B,0DAAkC,CAAC,MAAM,CAAC,CAC3C,CAAC;IAEF,OAAO,CACL,uCAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK;QAChE,uCAAK,SAAS,EAAE,qBAAqB,GAAI,CACrC,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import { BadgeStatusSize } from '@metamask-previews/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\n\nimport {\n CLASSMAP_BADGESTATUS_STATUS_CIRCLE,\n CLASSMAP_BADGESTATUS_SIZE,\n} from './BadgeStatus.constants';\nimport type { BadgeStatusProps } from './BadgeStatus.types';\n\nexport const BadgeStatus = forwardRef<HTMLDivElement, BadgeStatusProps>(\n (\n {\n status,\n size = BadgeStatusSize.Md,\n hasBorder = true,\n className,\n style,\n ...props\n },\n ref,\n ) => {\n const mergedClassName = twMerge(\n // Base styles\n 'inline-flex rounded-full',\n // hasBorder style\n hasBorder ? 'border-2 border-background-default' : '',\n // Custom classes\n className,\n );\n\n const mergedCircleClassName = twMerge(\n // Base styles\n 'z-10 rounded-full border-2',\n // Size styles\n CLASSMAP_BADGESTATUS_SIZE[size],\n // Circle with semantics style\n CLASSMAP_BADGESTATUS_STATUS_CIRCLE[status],\n );\n\n return (\n <div ref={ref} className={mergedClassName} style={style} {...props}>\n <div className={mergedCircleClassName} />\n </div>\n );\n },\n);\n\nBadgeStatus.displayName = 'BadgeStatus';\n"]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CLASSMAP_BADGESTATUS_SIZE = exports.CLASSMAP_BADGESTATUS_STATUS_CIRCLE = void 0;
|
|
4
|
-
const
|
|
4
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
5
|
// Mappings
|
|
6
6
|
exports.CLASSMAP_BADGESTATUS_STATUS_CIRCLE = {
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
7
|
+
[design_system_shared_1.BadgeStatusStatus.Active]: 'bg-success-default border-success-default',
|
|
8
|
+
[design_system_shared_1.BadgeStatusStatus.Inactive]: 'bg-default border-success-default',
|
|
9
|
+
[design_system_shared_1.BadgeStatusStatus.Disconnected]: 'bg-icon-muted border-icon-muted',
|
|
10
|
+
[design_system_shared_1.BadgeStatusStatus.New]: 'bg-primary-default border-primary-default',
|
|
11
|
+
[design_system_shared_1.BadgeStatusStatus.Attention]: 'bg-error-default border-error-default',
|
|
12
12
|
};
|
|
13
13
|
exports.CLASSMAP_BADGESTATUS_SIZE = {
|
|
14
|
-
[
|
|
15
|
-
[
|
|
14
|
+
[design_system_shared_1.BadgeStatusSize.Md]: 'h-2 w-2',
|
|
15
|
+
[design_system_shared_1.BadgeStatusSize.Lg]: 'h-2.5 w-2.5', // 10px width and height
|
|
16
16
|
};
|
|
17
17
|
//# sourceMappingURL=BadgeStatus.constants.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.constants.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.constants.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"BadgeStatus.constants.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.constants.ts"],"names":[],"mappings":";;;AAAA,kFAGiD;AAEjD,WAAW;AACE,QAAA,kCAAkC,GAG3C;IACF,CAAC,wCAAiB,CAAC,MAAM,CAAC,EAAE,2CAA2C;IACvE,CAAC,wCAAiB,CAAC,QAAQ,CAAC,EAAE,mCAAmC;IACjE,CAAC,wCAAiB,CAAC,YAAY,CAAC,EAAE,iCAAiC;IACnE,CAAC,wCAAiB,CAAC,GAAG,CAAC,EAAE,2CAA2C;IACpE,CAAC,wCAAiB,CAAC,SAAS,CAAC,EAAE,uCAAuC;CACvE,CAAC;AAEW,QAAA,yBAAyB,GAAoC;IACxE,CAAC,sCAAe,CAAC,EAAE,CAAC,EAAE,SAAS;IAC/B,CAAC,sCAAe,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,wBAAwB;CAC9D,CAAC","sourcesContent":["import {\n BadgeStatusSize,\n BadgeStatusStatus,\n} from '@metamask-previews/design-system-shared';\n\n// Mappings\nexport const CLASSMAP_BADGESTATUS_STATUS_CIRCLE: Record<\n BadgeStatusStatus,\n string\n> = {\n [BadgeStatusStatus.Active]: 'bg-success-default border-success-default',\n [BadgeStatusStatus.Inactive]: 'bg-default border-success-default',\n [BadgeStatusStatus.Disconnected]: 'bg-icon-muted border-icon-muted',\n [BadgeStatusStatus.New]: 'bg-primary-default border-primary-default',\n [BadgeStatusStatus.Attention]: 'bg-error-default border-error-default',\n};\n\nexport const CLASSMAP_BADGESTATUS_SIZE: Record<BadgeStatusSize, string> = {\n [BadgeStatusSize.Md]: 'h-2 w-2', // 8px width and height\n [BadgeStatusSize.Lg]: 'h-2.5 w-2.5', // 10px width and height\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BadgeStatusSize, BadgeStatusStatus } from "
|
|
1
|
+
import { BadgeStatusSize, BadgeStatusStatus } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export declare const CLASSMAP_BADGESTATUS_STATUS_CIRCLE: Record<BadgeStatusStatus, string>;
|
|
3
3
|
export declare const CLASSMAP_BADGESTATUS_SIZE: Record<BadgeStatusSize, string>;
|
|
4
4
|
//# sourceMappingURL=BadgeStatus.constants.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.constants.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.constants.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BadgeStatus.constants.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EAClB,gDAAgD;AAGjD,eAAO,MAAM,kCAAkC,EAAE,MAAM,CACrD,iBAAiB,EACjB,MAAM,CAOP,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAGrE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BadgeStatusSize, BadgeStatusStatus } from "
|
|
1
|
+
import { BadgeStatusSize, BadgeStatusStatus } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export declare const CLASSMAP_BADGESTATUS_STATUS_CIRCLE: Record<BadgeStatusStatus, string>;
|
|
3
3
|
export declare const CLASSMAP_BADGESTATUS_SIZE: Record<BadgeStatusSize, string>;
|
|
4
4
|
//# sourceMappingURL=BadgeStatus.constants.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.constants.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.constants.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BadgeStatus.constants.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EAClB,gDAAgD;AAGjD,eAAO,MAAM,kCAAkC,EAAE,MAAM,CACrD,iBAAiB,EACjB,MAAM,CAOP,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAGrE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BadgeStatusSize, BadgeStatusStatus } from "
|
|
1
|
+
import { BadgeStatusSize, BadgeStatusStatus } from "@metamask-previews/design-system-shared";
|
|
2
2
|
// Mappings
|
|
3
3
|
export const CLASSMAP_BADGESTATUS_STATUS_CIRCLE = {
|
|
4
4
|
[BadgeStatusStatus.Active]: 'bg-success-default border-success-default',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.constants.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.constants.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BadgeStatus.constants.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EAClB,gDAAgD;AAEjD,WAAW;AACX,MAAM,CAAC,MAAM,kCAAkC,GAG3C;IACF,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,2CAA2C;IACvE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,mCAAmC;IACjE,CAAC,iBAAiB,CAAC,YAAY,CAAC,EAAE,iCAAiC;IACnE,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,2CAA2C;IACpE,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,uCAAuC;CACvE,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAoC;IACxE,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,SAAS;IAC/B,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,wBAAwB;CAC9D,CAAC","sourcesContent":["import {\n BadgeStatusSize,\n BadgeStatusStatus,\n} from '@metamask-previews/design-system-shared';\n\n// Mappings\nexport const CLASSMAP_BADGESTATUS_STATUS_CIRCLE: Record<\n BadgeStatusStatus,\n string\n> = {\n [BadgeStatusStatus.Active]: 'bg-success-default border-success-default',\n [BadgeStatusStatus.Inactive]: 'bg-default border-success-default',\n [BadgeStatusStatus.Disconnected]: 'bg-icon-muted border-icon-muted',\n [BadgeStatusStatus.New]: 'bg-primary-default border-primary-default',\n [BadgeStatusStatus.Attention]: 'bg-error-default border-error-default',\n};\n\nexport const CLASSMAP_BADGESTATUS_SIZE: Record<BadgeStatusSize, string> = {\n [BadgeStatusSize.Md]: 'h-2 w-2', // 8px width and height\n [BadgeStatusSize.Lg]: 'h-2.5 w-2.5', // 10px width and height\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BadgeStatus.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,cAAc;AAQ1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW,sGAoCvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BadgeStatus.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,cAAc;AAQ1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW,sGAoCvB,CAAC"}
|
|
@@ -4,9 +4,9 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
+
import { BadgeStatusSize } from "@metamask-previews/design-system-shared";
|
|
7
8
|
import $React, { forwardRef } from "react";
|
|
8
9
|
const React = $importDefault($React);
|
|
9
|
-
import { BadgeStatusSize } from "../../types/index.mjs";
|
|
10
10
|
import { twMerge } from "../../utils/tw-merge.mjs";
|
|
11
11
|
import { CLASSMAP_BADGESTATUS_STATUS_CIRCLE, CLASSMAP_BADGESTATUS_SIZE } from "./BadgeStatus.constants.mjs";
|
|
12
12
|
export const BadgeStatus = forwardRef(({ status, size = BadgeStatusSize.Md, hasBorder = true, className, style, ...props }, ref) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BadgeStatus.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,gDAAgD;AAC1E,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAE/C,OAAO,EACL,kCAAkC,EAClC,yBAAyB,EAC1B,oCAAgC;AAGjC,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,CACE,EACE,MAAM,EACN,IAAI,GAAG,eAAe,CAAC,EAAE,EACzB,SAAS,GAAG,IAAI,EAChB,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,eAAe,GAAG,OAAO;IAC7B,cAAc;IACd,0BAA0B;IAC1B,kBAAkB;IAClB,SAAS,CAAC,CAAC,CAAC,oCAAoC,CAAC,CAAC,CAAC,EAAE;IACrD,iBAAiB;IACjB,SAAS,CACV,CAAC;IAEF,MAAM,qBAAqB,GAAG,OAAO;IACnC,cAAc;IACd,4BAA4B;IAC5B,cAAc;IACd,yBAAyB,CAAC,IAAI,CAAC;IAC/B,8BAA8B;IAC9B,kCAAkC,CAAC,MAAM,CAAC,CAC3C,CAAC;IAEF,OAAO,CACL,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK;QAChE,6BAAK,SAAS,EAAE,qBAAqB,GAAI,CACrC,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import { BadgeStatusSize } from '@metamask-previews/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\n\nimport {\n CLASSMAP_BADGESTATUS_STATUS_CIRCLE,\n CLASSMAP_BADGESTATUS_SIZE,\n} from './BadgeStatus.constants';\nimport type { BadgeStatusProps } from './BadgeStatus.types';\n\nexport const BadgeStatus = forwardRef<HTMLDivElement, BadgeStatusProps>(\n (\n {\n status,\n size = BadgeStatusSize.Md,\n hasBorder = true,\n className,\n style,\n ...props\n },\n ref,\n ) => {\n const mergedClassName = twMerge(\n // Base styles\n 'inline-flex rounded-full',\n // hasBorder style\n hasBorder ? 'border-2 border-background-default' : '',\n // Custom classes\n className,\n );\n\n const mergedCircleClassName = twMerge(\n // Base styles\n 'z-10 rounded-full border-2',\n // Size styles\n CLASSMAP_BADGESTATUS_SIZE[size],\n // Circle with semantics style\n CLASSMAP_BADGESTATUS_STATUS_CIRCLE[status],\n );\n\n return (\n <div ref={ref} className={mergedClassName} style={style} {...props}>\n <div className={mergedCircleClassName} />\n </div>\n );\n },\n);\n\nBadgeStatus.displayName = 'BadgeStatus';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"BadgeStatus.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BadgeStatusPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ComponentProps } from 'react';\n\n/**\n * BadgeStatus component props (React platform-specific)\n * Extends shared props from @metamask-previews/design-system-shared with React-specific platform concerns\n */\nexport type BadgeStatusProps = ComponentProps<'div'> &\n BadgeStatusPropsShared & {\n /**\n * Optional prop for additional CSS classes to be applied to the BadgeStatus component.\n * These classes will be merged with the component's default classes using twMerge.\n */\n className?: string;\n /**\n * Optional CSS styles to be applied to the component.\n * Should be used sparingly and only for dynamic styles that can't be achieved with className.\n */\n style?: React.CSSProperties;\n };\n"]}
|
|
@@ -1,34 +1,10 @@
|
|
|
1
|
+
import type { BadgeStatusPropsShared } from "@metamask-previews/design-system-shared";
|
|
1
2
|
import type { ComponentProps } from "react";
|
|
2
|
-
import type { BadgeStatusSize, BadgeStatusStatus } from "../../types/index.cjs";
|
|
3
3
|
/**
|
|
4
|
-
* BadgeStatus component props
|
|
4
|
+
* BadgeStatus component props (React platform-specific)
|
|
5
|
+
* Extends shared props from @metamask-previews/design-system-shared with React-specific platform concerns
|
|
5
6
|
*/
|
|
6
|
-
export type BadgeStatusProps = ComponentProps<'div'> & {
|
|
7
|
-
/**
|
|
8
|
-
* Optional prop to control the status of the badge
|
|
9
|
-
* Possible values:
|
|
10
|
-
* - BadgeStatusStatus.Active. (Connected)
|
|
11
|
-
* - BadgeStatusStatus.Inactive. (Connected)
|
|
12
|
-
* - BadgeStatusStatus.Disconnected.
|
|
13
|
-
* - BadgeStatusStatus.New.
|
|
14
|
-
* - BadgeStatusStatus.Attention.
|
|
15
|
-
*/
|
|
16
|
-
status: BadgeStatusStatus;
|
|
17
|
-
/**
|
|
18
|
-
* Optional prop to determine whether the badge should display a border
|
|
19
|
-
*
|
|
20
|
-
* @default true
|
|
21
|
-
*/
|
|
22
|
-
hasBorder?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Optional prop to control the size of the BadgeStatus
|
|
25
|
-
* Possible values:
|
|
26
|
-
* - BadgeStatusSize.Md (8px),
|
|
27
|
-
* - BadgeStatusSize.Lg (10px),
|
|
28
|
-
*
|
|
29
|
-
* @default AvatarBaseSize.Md
|
|
30
|
-
*/
|
|
31
|
-
size?: BadgeStatusSize;
|
|
7
|
+
export type BadgeStatusProps = ComponentProps<'div'> & BadgeStatusPropsShared & {
|
|
32
8
|
/**
|
|
33
9
|
* Optional prop for additional CSS classes to be applied to the BadgeStatus component.
|
|
34
10
|
* These classes will be merged with the component's default classes using twMerge.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BadgeStatus.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc;AAE5C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,KAAK,CAAC,GAClD,sBAAsB,GAAG;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC"}
|