@metamask/design-system-react-native 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -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 +5 -29
- package/dist/components/BadgeStatus/BadgeStatus.types.d.cts.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.d.mts +5 -29
- 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 +4 -4
- 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/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/BottomSheetFooter.cjs +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs.map +1 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.d.cts.map +1 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.d.mts.map +1 -0
- package/dist/components/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/BottomSheetFooter.mjs +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs.map +1 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.cjs.map +1 -0
- package/dist/components/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/BottomSheetFooter.types.d.cts +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.cts.map +1 -0
- package/dist/components/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/BottomSheetFooter.types.d.mts +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.mts.map +1 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.mjs.map +1 -0
- package/dist/components/BottomSheetFooter/index.cjs.map +1 -0
- package/dist/components/BottomSheetFooter/index.d.cts.map +1 -0
- package/dist/components/BottomSheetFooter/index.d.mts.map +1 -0
- package/dist/components/BottomSheetFooter/index.mjs.map +1 -0
- package/dist/components/RadioButton/RadioButton.cjs +58 -0
- package/dist/components/RadioButton/RadioButton.cjs.map +1 -0
- package/dist/components/RadioButton/RadioButton.constants.cjs +12 -0
- package/dist/components/RadioButton/RadioButton.constants.cjs.map +1 -0
- package/dist/components/RadioButton/RadioButton.constants.d.cts +3 -0
- package/dist/components/RadioButton/RadioButton.constants.d.cts.map +1 -0
- package/dist/components/RadioButton/RadioButton.constants.d.mts +3 -0
- package/dist/components/RadioButton/RadioButton.constants.d.mts.map +1 -0
- package/dist/components/RadioButton/RadioButton.constants.mjs +9 -0
- package/dist/components/RadioButton/RadioButton.constants.mjs.map +1 -0
- package/dist/components/RadioButton/RadioButton.d.cts +4 -0
- package/dist/components/RadioButton/RadioButton.d.cts.map +1 -0
- package/dist/components/RadioButton/RadioButton.d.mts +4 -0
- package/dist/components/RadioButton/RadioButton.d.mts.map +1 -0
- package/dist/components/RadioButton/RadioButton.mjs +58 -0
- package/dist/components/RadioButton/RadioButton.mjs.map +1 -0
- package/dist/components/RadioButton/RadioButton.types.cjs +3 -0
- package/dist/components/RadioButton/RadioButton.types.cjs.map +1 -0
- package/dist/components/RadioButton/RadioButton.types.d.cts +64 -0
- package/dist/components/RadioButton/RadioButton.types.d.cts.map +1 -0
- package/dist/components/RadioButton/RadioButton.types.d.mts +64 -0
- package/dist/components/RadioButton/RadioButton.types.d.mts.map +1 -0
- package/dist/components/RadioButton/RadioButton.types.mjs +2 -0
- package/dist/components/RadioButton/RadioButton.types.mjs.map +1 -0
- package/dist/components/RadioButton/index.cjs +6 -0
- package/dist/components/RadioButton/index.cjs.map +1 -0
- package/dist/components/RadioButton/index.d.cts +3 -0
- package/dist/components/RadioButton/index.d.cts.map +1 -0
- package/dist/components/RadioButton/index.d.mts +3 -0
- package/dist/components/RadioButton/index.d.mts.map +1 -0
- package/dist/components/RadioButton/index.mjs +2 -0
- package/dist/components/RadioButton/index.mjs.map +1 -0
- package/dist/components/TextField/TextField.cjs +42 -0
- package/dist/components/TextField/TextField.cjs.map +1 -0
- package/dist/components/TextField/TextField.constants.cjs +13 -0
- package/dist/components/TextField/TextField.constants.cjs.map +1 -0
- package/dist/components/TextField/TextField.constants.d.cts +6 -0
- package/dist/components/TextField/TextField.constants.d.cts.map +1 -0
- package/dist/components/TextField/TextField.constants.d.mts +6 -0
- package/dist/components/TextField/TextField.constants.d.mts.map +1 -0
- package/dist/components/TextField/TextField.constants.mjs +10 -0
- package/dist/components/TextField/TextField.constants.mjs.map +1 -0
- package/dist/components/TextField/TextField.d.cts +12 -0
- package/dist/components/TextField/TextField.d.cts.map +1 -0
- package/dist/components/TextField/TextField.d.mts +12 -0
- package/dist/components/TextField/TextField.d.mts.map +1 -0
- package/dist/components/TextField/TextField.mjs +39 -0
- package/dist/components/TextField/TextField.mjs.map +1 -0
- package/dist/components/TextField/TextField.types.cjs +13 -0
- package/dist/components/TextField/TextField.types.cjs.map +1 -0
- package/dist/components/TextField/TextField.types.d.cts +49 -0
- package/dist/components/TextField/TextField.types.d.cts.map +1 -0
- package/dist/components/TextField/TextField.types.d.mts +49 -0
- package/dist/components/TextField/TextField.types.d.mts.map +1 -0
- package/dist/components/TextField/TextField.types.mjs +10 -0
- package/dist/components/TextField/TextField.types.mjs.map +1 -0
- package/dist/components/TextField/index.cjs +8 -0
- package/dist/components/TextField/index.cjs.map +1 -0
- package/dist/components/TextField/index.d.cts +4 -0
- package/dist/components/TextField/index.d.cts.map +1 -0
- package/dist/components/TextField/index.d.mts +4 -0
- package/dist/components/TextField/index.d.mts.map +1 -0
- package/dist/components/TextField/index.mjs +3 -0
- package/dist/components/TextField/index.mjs.map +1 -0
- package/dist/components/index.cjs +7 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +6 -2
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +6 -2
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +3 -1
- package/dist/components/index.mjs.map +1 -1
- package/dist/types/index.cjs +1 -26
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +0 -23
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +0 -23
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +0 -25
- package/dist/types/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/components/BottomSheets/BottomSheetFooter/BottomSheetFooter.cjs.map +0 -1
- package/dist/components/BottomSheets/BottomSheetFooter/BottomSheetFooter.d.cts.map +0 -1
- package/dist/components/BottomSheets/BottomSheetFooter/BottomSheetFooter.d.mts.map +0 -1
- package/dist/components/BottomSheets/BottomSheetFooter/BottomSheetFooter.mjs.map +0 -1
- package/dist/components/BottomSheets/BottomSheetFooter/BottomSheetFooter.types.cjs.map +0 -1
- package/dist/components/BottomSheets/BottomSheetFooter/BottomSheetFooter.types.d.cts.map +0 -1
- package/dist/components/BottomSheets/BottomSheetFooter/BottomSheetFooter.types.d.mts.map +0 -1
- package/dist/components/BottomSheets/BottomSheetFooter/BottomSheetFooter.types.mjs.map +0 -1
- package/dist/components/BottomSheets/BottomSheetFooter/index.cjs.map +0 -1
- package/dist/components/BottomSheets/BottomSheetFooter/index.d.cts.map +0 -1
- package/dist/components/BottomSheets/BottomSheetFooter/index.d.mts.map +0 -1
- package/dist/components/BottomSheets/BottomSheetFooter/index.mjs.map +0 -1
- /package/dist/components/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/BottomSheetFooter.d.cts +0 -0
- /package/dist/components/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/BottomSheetFooter.d.mts +0 -0
- /package/dist/components/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/BottomSheetFooter.types.cjs +0 -0
- /package/dist/components/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/BottomSheetFooter.types.mjs +0 -0
- /package/dist/components/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/index.cjs +0 -0
- /package/dist/components/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/index.d.cts +0 -0
- /package/dist/components/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/index.d.mts +0 -0
- /package/dist/components/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/index.mjs +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,39 @@ 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
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Added `TextField` component for text input fields ([#910](https://github.com/MetaMask/metamask-design-system/pull/910))
|
|
15
|
+
- Boxed, press-to-focus wrapper around `Input` component
|
|
16
|
+
- Supports configurable sizes, optional start/end accessories
|
|
17
|
+
- Includes error and disabled states with custom styling
|
|
18
|
+
- Full accessibility support and comprehensive test coverage
|
|
19
|
+
|
|
20
|
+
## [0.8.0]
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- Added `RadioButton` component for radio button form controls ([#926](https://github.com/MetaMask/metamask-design-system/pull/926))
|
|
25
|
+
- Supports checked, disabled, read-only, and danger states
|
|
26
|
+
- Full accessibility support with `role="radio"` and `accessibilityState`
|
|
27
|
+
- Optional label rendering for improved usability
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- **BREAKING:** Migrated `BadgeStatus` component from TypeScript enums to string union types with const objects ([#912](https://github.com/MetaMask/metamask-design-system/pull/912))
|
|
32
|
+
- `BadgeStatusStatus` and `BadgeStatusSize` enums replaced with const objects and derived string union types
|
|
33
|
+
- **No migration required** - continue importing from `@metamask/design-system-react-native` as usual
|
|
34
|
+
- Const object values remain the same (e.g., `BadgeStatusStatus.Active` still works)
|
|
35
|
+
- String literals now also accepted thanks to structural typing (e.g., `'active'` works where `BadgeStatusStatus.Active` is expected)
|
|
36
|
+
- We are still evaluating best practices for const objects vs string literals - use whichever approach works best for your codebase
|
|
37
|
+
- 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)
|
|
38
|
+
- Refactored `BottomSheetFooter` component location for better organization ([#933](https://github.com/MetaMask/metamask-design-system/pull/933))
|
|
39
|
+
- Moved from `BottomSheets/BottomSheetFooter/` to `BottomSheetFooter/`
|
|
40
|
+
- Updated import paths and Storybook title
|
|
41
|
+
- No breaking changes - all imports from package entry point continue to work
|
|
42
|
+
|
|
10
43
|
## [0.7.0]
|
|
11
44
|
|
|
12
45
|
### Added
|
|
@@ -154,7 +187,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
154
187
|
- Full TypeScript support with type definitions and enums
|
|
155
188
|
- React Native integration with TWRNC preset support
|
|
156
189
|
|
|
157
|
-
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.
|
|
190
|
+
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.9.0...HEAD
|
|
191
|
+
[0.9.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.8.0...@metamask/design-system-react-native@0.9.0
|
|
192
|
+
[0.8.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.7.0...@metamask/design-system-react-native@0.8.0
|
|
158
193
|
[0.7.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.6.0...@metamask/design-system-react-native@0.7.0
|
|
159
194
|
[0.6.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.5.1...@metamask/design-system-react-native@0.6.0
|
|
160
195
|
[0.5.1]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.5.0...@metamask/design-system-react-native@0.5.1
|
|
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BadgeStatus = void 0;
|
|
7
|
+
const design_system_shared_1 = require("@metamask/design-system-shared");
|
|
7
8
|
const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-preset");
|
|
8
9
|
const react_1 = __importDefault(require("react"));
|
|
9
10
|
const react_native_1 = require("react-native/index.js");
|
|
10
|
-
const types_1 = require("../../types/index.cjs");
|
|
11
11
|
const BadgeStatus_constants_1 = require("./BadgeStatus.constants.cjs");
|
|
12
|
-
const BadgeStatus = ({ status, size =
|
|
12
|
+
const BadgeStatus = ({ status, size = design_system_shared_1.BadgeStatusSize.Md, hasBorder = true, twClassName, style, ...props }) => {
|
|
13
13
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
14
14
|
return (<react_native_1.View {...props} style={[
|
|
15
15
|
tw.style('self-start rounded-full', hasBorder && 'border-2 border-background-default', twClassName),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":";;;;;;AAAA,qFAAmE;AACnE,kDAA0B;AAC1B,wDAAoC;AAEpC,
|
|
1
|
+
{"version":3,"file":"BadgeStatus.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":";;;;;;AAAA,yEAAiE;AACjE,qFAAmE;AACnE,kDAA0B;AAC1B,wDAAoC;AAEpC,uEAGiC;AAG1B,MAAM,WAAW,GAAG,CAAC,EAC1B,MAAM,EACN,IAAI,GAAG,sCAAe,CAAC,EAAE,EACzB,SAAS,GAAG,IAAI,EAChB,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACS,EAAE,EAAE;IACrB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,mBAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,yBAAyB,EACzB,SAAS,IAAI,oCAAoC,EACjD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,uBAAuB,EACvB,mDAA2B,CAAC,IAAI,CAAC,EACjC,4DAAoC,CAAC,MAAM,CAAC,CAC7C;SACF,CAAC,EAEN;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAjCW,QAAA,WAAW,eAiCtB","sourcesContent":["import { BadgeStatusSize } from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport {\n TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE,\n TWCLASSMAP_BADGESTATUS_SIZE,\n} from './BadgeStatus.constants';\nimport type { BadgeStatusProps } from './BadgeStatus.types';\n\nexport const BadgeStatus = ({\n status,\n size = BadgeStatusSize.Md,\n hasBorder = true,\n twClassName,\n style,\n ...props\n}: BadgeStatusProps) => {\n const tw = useTailwind();\n\n return (\n <View\n {...props}\n style={[\n tw.style(\n 'self-start rounded-full',\n hasBorder && 'border-2 border-background-default',\n twClassName,\n ),\n style,\n ]}\n >\n <View\n style={[\n tw.style(\n 'rounded-full border-2',\n TWCLASSMAP_BADGESTATUS_SIZE[size],\n TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE[status],\n ),\n ]}\n />\n </View>\n );\n};\n"]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TWCLASSMAP_BADGESTATUS_SIZE = exports.TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE = void 0;
|
|
4
|
-
const
|
|
4
|
+
const design_system_shared_1 = require("@metamask/design-system-shared");
|
|
5
5
|
// Mappings
|
|
6
6
|
exports.TWCLASSMAP_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.TWCLASSMAP_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,yEAGwC;AAExC,WAAW;AACE,QAAA,oCAAoC,GAG7C;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,2BAA2B,GAAoC;IAC1E,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/design-system-shared';\n\n// Mappings\nexport const TWCLASSMAP_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 TWCLASSMAP_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 {
|
|
1
|
+
import { BadgeStatusSize, BadgeStatusStatus } from "@metamask/design-system-shared";
|
|
2
2
|
export declare const TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE: Record<BadgeStatusStatus, string>;
|
|
3
3
|
export declare const TWCLASSMAP_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,uCAAuC;AAGxC,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,iBAAiB,EACjB,MAAM,CAOP,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAGvE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BadgeStatusSize, BadgeStatusStatus } from "@metamask/design-system-shared";
|
|
2
2
|
export declare const TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE: Record<BadgeStatusStatus, string>;
|
|
3
3
|
export declare const TWCLASSMAP_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,uCAAuC;AAGxC,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,iBAAiB,EACjB,MAAM,CAOP,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAGvE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BadgeStatusSize, BadgeStatusStatus } from "@metamask/design-system-shared";
|
|
2
2
|
// Mappings
|
|
3
3
|
export const TWCLASSMAP_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,uCAAuC;AAExC,WAAW;AACX,MAAM,CAAC,MAAM,oCAAoC,GAG7C;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,2BAA2B,GAAoC;IAC1E,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/design-system-shared';\n\n// Mappings\nexport const TWCLASSMAP_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 TWCLASSMAP_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":"AAEA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW,8DAOrB,gBAAgB,sBA0BlB,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":"AAEA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW,8DAOrB,gBAAgB,sBA0BlB,CAAC"}
|
|
@@ -4,11 +4,11 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
+
import { BadgeStatusSize } from "@metamask/design-system-shared";
|
|
7
8
|
import { useTailwind } from "@metamask/design-system-twrnc-preset";
|
|
8
9
|
import $React from "react";
|
|
9
10
|
const React = $importDefault($React);
|
|
10
11
|
import { View } from "react-native/index.js";
|
|
11
|
-
import { BadgeStatusSize } from "../../types/index.mjs";
|
|
12
12
|
import { TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE, TWCLASSMAP_BADGESTATUS_SIZE } from "./BadgeStatus.constants.mjs";
|
|
13
13
|
export const BadgeStatus = ({ status, size = BadgeStatusSize.Md, hasBorder = true, twClassName, style, ...props }) => {
|
|
14
14
|
const tw = useTailwind();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAEpC,OAAO,
|
|
1
|
+
{"version":3,"file":"BadgeStatus.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,uCAAuC;AACjE,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAEpC,OAAO,EACL,oCAAoC,EACpC,2BAA2B,EAC5B,oCAAgC;AAGjC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,MAAM,EACN,IAAI,GAAG,eAAe,CAAC,EAAE,EACzB,SAAS,GAAG,IAAI,EAChB,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACS,EAAE,EAAE;IACrB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,IAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,yBAAyB,EACzB,SAAS,IAAI,oCAAoC,EACjD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,uBAAuB,EACvB,2BAA2B,CAAC,IAAI,CAAC,EACjC,oCAAoC,CAAC,MAAM,CAAC,CAC7C;SACF,CAAC,EAEN;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { BadgeStatusSize } from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport {\n TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE,\n TWCLASSMAP_BADGESTATUS_SIZE,\n} from './BadgeStatus.constants';\nimport type { BadgeStatusProps } from './BadgeStatus.types';\n\nexport const BadgeStatus = ({\n status,\n size = BadgeStatusSize.Md,\n hasBorder = true,\n twClassName,\n style,\n ...props\n}: BadgeStatusProps) => {\n const tw = useTailwind();\n\n return (\n <View\n {...props}\n style={[\n tw.style(\n 'self-start rounded-full',\n hasBorder && 'border-2 border-background-default',\n twClassName,\n ),\n style,\n ]}\n >\n <View\n style={[\n tw.style(\n 'rounded-full border-2',\n TWCLASSMAP_BADGESTATUS_SIZE[size],\n TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE[status],\n ),\n ]}\n />\n </View>\n );\n};\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/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n/**\n * BadgeStatus component props (React Native platform-specific)\n * Extends shared props from @metamask/design-system-shared with React Native specific platform concerns\n */\nexport type BadgeStatusProps = BadgeStatusPropsShared &\n Omit<ViewProps, 'children'> & {\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n };\n"]}
|
|
@@ -1,37 +1,13 @@
|
|
|
1
|
+
import type { BadgeStatusPropsShared } from "@metamask/design-system-shared";
|
|
1
2
|
import type { ViewProps } from "react-native/index.js";
|
|
2
|
-
import type { BadgeStatusStatus, BadgeStatusSize } from "../../types/index.cjs";
|
|
3
3
|
/**
|
|
4
|
-
* BadgeStatus component props
|
|
4
|
+
* BadgeStatus component props (React Native platform-specific)
|
|
5
|
+
* Extends shared props from @metamask/design-system-shared with React Native specific platform concerns
|
|
5
6
|
*/
|
|
6
|
-
export type BadgeStatusProps = {
|
|
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 = BadgeStatusPropsShared & Omit<ViewProps, 'children'> & {
|
|
32
8
|
/**
|
|
33
9
|
* Optional prop to add twrnc overriding classNames.
|
|
34
10
|
*/
|
|
35
11
|
twClassName?: string;
|
|
36
|
-
}
|
|
12
|
+
};
|
|
37
13
|
//# sourceMappingURL=BadgeStatus.types.d.cts.map
|
|
@@ -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,uCAAuC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1,37 +1,13 @@
|
|
|
1
|
+
import type { BadgeStatusPropsShared } from "@metamask/design-system-shared";
|
|
1
2
|
import type { ViewProps } from "react-native/index.js";
|
|
2
|
-
import type { BadgeStatusStatus, BadgeStatusSize } from "../../types/index.mjs";
|
|
3
3
|
/**
|
|
4
|
-
* BadgeStatus component props
|
|
4
|
+
* BadgeStatus component props (React Native platform-specific)
|
|
5
|
+
* Extends shared props from @metamask/design-system-shared with React Native specific platform concerns
|
|
5
6
|
*/
|
|
6
|
-
export type BadgeStatusProps = {
|
|
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 = BadgeStatusPropsShared & Omit<ViewProps, 'children'> & {
|
|
32
8
|
/**
|
|
33
9
|
* Optional prop to add twrnc overriding classNames.
|
|
34
10
|
*/
|
|
35
11
|
twClassName?: string;
|
|
36
|
-
}
|
|
12
|
+
};
|
|
37
13
|
//# sourceMappingURL=BadgeStatus.types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BadgeStatus.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,uCAAuC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"BadgeStatus.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BadgeStatusPropsShared } from '@metamask/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n/**\n * BadgeStatus component props (React Native platform-specific)\n * Extends shared props from @metamask/design-system-shared with React Native specific platform concerns\n */\nexport type BadgeStatusProps = BadgeStatusPropsShared &\n Omit<ViewProps, 'children'> & {\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n };\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BadgeStatus = exports.
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
Object.defineProperty(exports, "
|
|
3
|
+
exports.BadgeStatus = exports.BadgeStatusStatus = exports.BadgeStatusSize = void 0;
|
|
4
|
+
var design_system_shared_1 = require("@metamask/design-system-shared");
|
|
5
|
+
Object.defineProperty(exports, "BadgeStatusSize", { enumerable: true, get: function () { return design_system_shared_1.BadgeStatusSize; } });
|
|
6
|
+
Object.defineProperty(exports, "BadgeStatusStatus", { enumerable: true, get: function () { return design_system_shared_1.BadgeStatusStatus; } });
|
|
7
7
|
var BadgeStatus_1 = require("./BadgeStatus.cjs");
|
|
8
8
|
Object.defineProperty(exports, "BadgeStatus", { enumerable: true, get: function () { return BadgeStatus_1.BadgeStatus; } });
|
|
9
9
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":";;;AAAA,uEAGwC;AAFtC,uHAAA,eAAe,OAAA;AACf,yHAAA,iBAAiB,OAAA;AAEnB,iDAA4C;AAAnC,0GAAA,WAAW,OAAA","sourcesContent":["export {\n BadgeStatusSize,\n BadgeStatusStatus,\n} from '@metamask/design-system-shared';\nexport { BadgeStatus } from './BadgeStatus';\nexport type { BadgeStatusProps } from './BadgeStatus.types';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BadgeStatusStatus,
|
|
1
|
+
export { BadgeStatusSize, BadgeStatusStatus, } from "@metamask/design-system-shared";
|
|
2
2
|
export { BadgeStatus } from "./BadgeStatus.cjs";
|
|
3
3
|
export type { BadgeStatusProps } from "./BadgeStatus.types.cjs";
|
|
4
4
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,GAClB,uCAAuC;AACxC,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BadgeStatusStatus,
|
|
1
|
+
export { BadgeStatusSize, BadgeStatusStatus, } from "@metamask/design-system-shared";
|
|
2
2
|
export { BadgeStatus } from "./BadgeStatus.mjs";
|
|
3
3
|
export type { BadgeStatusProps } from "./BadgeStatus.types.mjs";
|
|
4
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,GAClB,uCAAuC;AACxC,OAAO,EAAE,WAAW,EAAE,0BAAsB;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gCAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EAClB,uCAAuC;AACxC,OAAO,EAAE,WAAW,EAAE,0BAAsB","sourcesContent":["export {\n BadgeStatusSize,\n BadgeStatusStatus,\n} from '@metamask/design-system-shared';\nexport { BadgeStatus } from './BadgeStatus';\nexport type { BadgeStatusProps } from './BadgeStatus.types';\n"]}
|
package/dist/components/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/BottomSheetFooter.cjs
RENAMED
|
@@ -9,7 +9,7 @@ const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-pres
|
|
|
9
9
|
const react_1 = __importDefault(require("react"));
|
|
10
10
|
const react_native_1 = require("react-native/index.js");
|
|
11
11
|
// External dependencies.
|
|
12
|
-
const Button_1 = require("
|
|
12
|
+
const Button_1 = require("../Button/index.cjs");
|
|
13
13
|
const BottomSheetFooter_types_1 = require("./BottomSheetFooter.types.cjs");
|
|
14
14
|
const BottomSheetFooter = ({ style, twClassName, buttonsAlignment = BottomSheetFooter_types_1.ButtonsAlignment.Horizontal, primaryButtonProps, secondaryButtonProps, ...props }) => {
|
|
15
15
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetFooter.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/BottomSheetFooter.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,qFAAmE;AACnE,kDAA0B;AAC1B,wDAAoC;AAEpC,yBAAyB;AACzB,gDAAkD;AAIlD,2EAA6D;AAEtD,MAAM,iBAAiB,GAAqC,CAAC,EAClE,KAAK,EACL,WAAW,EACX,gBAAgB,GAAG,0CAAgB,CAAC,UAAU,EAC9C,kBAAkB,EAClB,oBAAoB,EACpB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,YAAY,GAAG,gBAAgB,KAAK,0CAAgB,CAAC,UAAU,CAAC;IACtE,MAAM,eAAe,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC;IACjE,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,cAAc,GAClB,OAAO,CAAC,kBAAkB,CAAC,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE/D,IAAI,CAAC,kBAAkB,IAAI,CAAC,oBAAoB,EAAE;QAChD,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EACtC,WAAW,EACX,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,oBAAoB,IAAI,CACvB,CAAC,eAAM,CACL,IAAI,oBAAoB,CAAC,CACzB,OAAO,CAAC,CAAC,sBAAa,CAAC,SAAS,CAAC,CACjC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAC/D,CACH,CACD;MAAA,CAAC,kBAAkB,IAAI,CACrB,CAAC,eAAM,CACL,IAAI,kBAAkB,CAAC,CACvB,OAAO,CAAC,CAAC,sBAAa,CAAC,OAAO,CAAC,CAC/B,KAAK,CAAC,CAAC;gBACL,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,cAAc,IAAI,QAAQ,CAAC;gBACrD,kBAAkB,CAAC,KAAK;aACzB,CAAC,EACF,CACH,CACH;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAlDW,QAAA,iBAAiB,qBAkD5B","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\n// External dependencies.\nimport { Button, ButtonVariant } from '../Button';\n\n// Internal dependencies.\nimport type { BottomSheetFooterProps } from './BottomSheetFooter.types';\nimport { ButtonsAlignment } from './BottomSheetFooter.types';\n\nexport const BottomSheetFooter: React.FC<BottomSheetFooterProps> = ({\n style,\n twClassName,\n buttonsAlignment = ButtonsAlignment.Horizontal,\n primaryButtonProps,\n secondaryButtonProps,\n ...props\n}) => {\n const tw = useTailwind();\n const isHorizontal = buttonsAlignment === ButtonsAlignment.Horizontal;\n const buttonBaseClass = isHorizontal ? 'flex-1' : 'self-stretch';\n const gapClass = isHorizontal ? 'ml-4' : 'mt-4';\n const hasBothButtons =\n Boolean(primaryButtonProps) && Boolean(secondaryButtonProps);\n\n if (!primaryButtonProps && !secondaryButtonProps) {\n return null;\n }\n\n return (\n <View\n style={[\n tw.style(\n isHorizontal ? 'flex-row' : 'flex-col',\n 'px-2 py-1',\n twClassName,\n ),\n style,\n ]}\n {...props}\n >\n {secondaryButtonProps && (\n <Button\n {...secondaryButtonProps}\n variant={ButtonVariant.Secondary}\n style={[tw.style(buttonBaseClass), secondaryButtonProps.style]}\n />\n )}\n {primaryButtonProps && (\n <Button\n {...primaryButtonProps}\n variant={ButtonVariant.Primary}\n style={[\n tw.style(buttonBaseClass, hasBothButtons && gapClass),\n primaryButtonProps.style,\n ]}\n />\n )}\n </View>\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetFooter.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/BottomSheetFooter.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,sCAAkC;AAGxE,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAkD9D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetFooter.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/BottomSheetFooter.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,sCAAkC;AAGxE,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAkD9D,CAAC"}
|
package/dist/components/{BottomSheets/BottomSheetFooter → BottomSheetFooter}/BottomSheetFooter.mjs
RENAMED
|
@@ -10,7 +10,7 @@ import $React from "react";
|
|
|
10
10
|
const React = $importDefault($React);
|
|
11
11
|
import { View } from "react-native/index.js";
|
|
12
12
|
// External dependencies.
|
|
13
|
-
import { Button, ButtonVariant } from "
|
|
13
|
+
import { Button, ButtonVariant } from "../Button/index.mjs";
|
|
14
14
|
import { ButtonsAlignment } from "./BottomSheetFooter.types.mjs";
|
|
15
15
|
export const BottomSheetFooter = ({ style, twClassName, buttonsAlignment = ButtonsAlignment.Horizontal, primaryButtonProps, secondaryButtonProps, ...props }) => {
|
|
16
16
|
const tw = useTailwind();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetFooter.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/BottomSheetFooter.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAEpC,yBAAyB;AACzB,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,4BAAkB;AAIlD,OAAO,EAAE,gBAAgB,EAAE,sCAAkC;AAE7D,MAAM,CAAC,MAAM,iBAAiB,GAAqC,CAAC,EAClE,KAAK,EACL,WAAW,EACX,gBAAgB,GAAG,gBAAgB,CAAC,UAAU,EAC9C,kBAAkB,EAClB,oBAAoB,EACpB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,YAAY,GAAG,gBAAgB,KAAK,gBAAgB,CAAC,UAAU,CAAC;IACtE,MAAM,eAAe,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC;IACjE,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,cAAc,GAClB,OAAO,CAAC,kBAAkB,CAAC,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE/D,IAAI,CAAC,kBAAkB,IAAI,CAAC,oBAAoB,EAAE;QAChD,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EACtC,WAAW,EACX,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,oBAAoB,IAAI,CACvB,CAAC,MAAM,CACL,IAAI,oBAAoB,CAAC,CACzB,OAAO,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CACjC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAC/D,CACH,CACD;MAAA,CAAC,kBAAkB,IAAI,CACrB,CAAC,MAAM,CACL,IAAI,kBAAkB,CAAC,CACvB,OAAO,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAC/B,KAAK,CAAC,CAAC;gBACL,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,cAAc,IAAI,QAAQ,CAAC;gBACrD,kBAAkB,CAAC,KAAK;aACzB,CAAC,EACF,CACH,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\n// External dependencies.\nimport { Button, ButtonVariant } from '../Button';\n\n// Internal dependencies.\nimport type { BottomSheetFooterProps } from './BottomSheetFooter.types';\nimport { ButtonsAlignment } from './BottomSheetFooter.types';\n\nexport const BottomSheetFooter: React.FC<BottomSheetFooterProps> = ({\n style,\n twClassName,\n buttonsAlignment = ButtonsAlignment.Horizontal,\n primaryButtonProps,\n secondaryButtonProps,\n ...props\n}) => {\n const tw = useTailwind();\n const isHorizontal = buttonsAlignment === ButtonsAlignment.Horizontal;\n const buttonBaseClass = isHorizontal ? 'flex-1' : 'self-stretch';\n const gapClass = isHorizontal ? 'ml-4' : 'mt-4';\n const hasBothButtons =\n Boolean(primaryButtonProps) && Boolean(secondaryButtonProps);\n\n if (!primaryButtonProps && !secondaryButtonProps) {\n return null;\n }\n\n return (\n <View\n style={[\n tw.style(\n isHorizontal ? 'flex-row' : 'flex-col',\n 'px-2 py-1',\n twClassName,\n ),\n style,\n ]}\n {...props}\n >\n {secondaryButtonProps && (\n <Button\n {...secondaryButtonProps}\n variant={ButtonVariant.Secondary}\n style={[tw.style(buttonBaseClass), secondaryButtonProps.style]}\n />\n )}\n {primaryButtonProps && (\n <Button\n {...primaryButtonProps}\n variant={ButtonVariant.Primary}\n style={[\n tw.style(buttonBaseClass, hasBothButtons && gapClass),\n primaryButtonProps.style,\n ]}\n />\n )}\n </View>\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetFooter.types.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/BottomSheetFooter.types.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACH,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,6CAAyB,CAAA;IACzB,yCAAqB,CAAA;AACvB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B","sourcesContent":["// Third party dependencies.\nimport type { ViewProps } from 'react-native';\n\n// External dependencies.\nimport type { ButtonProps } from '../Button/Button.types';\n\n/**\n * Buttons alignment options for the BottomSheetFooter.\n */\nexport enum ButtonsAlignment {\n Horizontal = 'Horizontal',\n Vertical = 'Vertical',\n}\n\n/**\n * Button props for BottomSheetFooter with variant enforced by the component.\n */\nexport type BottomSheetFooterButtonProps = Omit<ButtonProps, 'variant'>;\n\n/**\n * BottomSheetFooter component props.\n */\nexport type BottomSheetFooterProps = {\n /**\n * Optional prop to control the alignment of the buttons.\n *\n * @default ButtonsAlignment.Horizontal\n */\n buttonsAlignment?: ButtonsAlignment;\n /**\n * Optional props for the primary action button.\n * Renders with ButtonVariant.Primary automatically.\n * Appears second (rightmost in horizontal layout, bottom in vertical layout).\n */\n primaryButtonProps?: BottomSheetFooterButtonProps;\n /**\n * Optional props for the secondary action button.\n * Renders with ButtonVariant.Secondary automatically.\n * Appears first (leftmost in horizontal layout, top in vertical layout).\n */\n secondaryButtonProps?: BottomSheetFooterButtonProps;\n /**\n * Tailwind CSS classes for the footer container.\n */\n twClassName?: string;\n} & ViewProps;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetFooter.types.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/BottomSheetFooter.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAG9C,OAAO,KAAK,EAAE,WAAW,EAAE,mCAA+B;AAE1D;;GAEG;AACH,oBAAY,gBAAgB;IAC1B,UAAU,eAAe;IACzB,QAAQ,aAAa;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,4BAA4B,CAAC;IAClD;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,4BAA4B,CAAC;IACpD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetFooter.types.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/BottomSheetFooter.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAG9C,OAAO,KAAK,EAAE,WAAW,EAAE,mCAA+B;AAE1D;;GAEG;AACH,oBAAY,gBAAgB;IAC1B,UAAU,eAAe;IACzB,QAAQ,aAAa;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,4BAA4B,CAAC;IAClD;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,4BAA4B,CAAC;IACpD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetFooter.types.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/BottomSheetFooter.types.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,6CAAyB,CAAA;IACzB,yCAAqB,CAAA;AACvB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B","sourcesContent":["// Third party dependencies.\nimport type { ViewProps } from 'react-native';\n\n// External dependencies.\nimport type { ButtonProps } from '../Button/Button.types';\n\n/**\n * Buttons alignment options for the BottomSheetFooter.\n */\nexport enum ButtonsAlignment {\n Horizontal = 'Horizontal',\n Vertical = 'Vertical',\n}\n\n/**\n * Button props for BottomSheetFooter with variant enforced by the component.\n */\nexport type BottomSheetFooterButtonProps = Omit<ButtonProps, 'variant'>;\n\n/**\n * BottomSheetFooter component props.\n */\nexport type BottomSheetFooterProps = {\n /**\n * Optional prop to control the alignment of the buttons.\n *\n * @default ButtonsAlignment.Horizontal\n */\n buttonsAlignment?: ButtonsAlignment;\n /**\n * Optional props for the primary action button.\n * Renders with ButtonVariant.Primary automatically.\n * Appears second (rightmost in horizontal layout, bottom in vertical layout).\n */\n primaryButtonProps?: BottomSheetFooterButtonProps;\n /**\n * Optional props for the secondary action button.\n * Renders with ButtonVariant.Secondary automatically.\n * Appears first (leftmost in horizontal layout, top in vertical layout).\n */\n secondaryButtonProps?: BottomSheetFooterButtonProps;\n /**\n * Tailwind CSS classes for the footer container.\n */\n twClassName?: string;\n} & ViewProps;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/index.ts"],"names":[],"mappings":";;;AAAA,6DAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,yEAA6D;AAApD,2HAAA,gBAAgB,OAAA","sourcesContent":["export { BottomSheetFooter } from './BottomSheetFooter';\nexport { ButtonsAlignment } from './BottomSheetFooter.types';\nexport type {\n BottomSheetFooterProps,\n BottomSheetFooterButtonProps,\n} from './BottomSheetFooter.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gCAA4B;AACxD,OAAO,EAAE,gBAAgB,EAAE,sCAAkC;AAC7D,YAAY,EACV,sBAAsB,EACtB,4BAA4B,GAC7B,sCAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gCAA4B;AACxD,OAAO,EAAE,gBAAgB,EAAE,sCAAkC;AAC7D,YAAY,EACV,sBAAsB,EACtB,4BAA4B,GAC7B,sCAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetFooter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gCAA4B;AACxD,OAAO,EAAE,gBAAgB,EAAE,sCAAkC","sourcesContent":["export { BottomSheetFooter } from './BottomSheetFooter';\nexport { ButtonsAlignment } from './BottomSheetFooter.types';\nexport type {\n BottomSheetFooterProps,\n BottomSheetFooterButtonProps,\n} from './BottomSheetFooter.types';\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
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.RadioButton = void 0;
|
|
7
|
+
const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-preset");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const react_native_1 = require("react-native/index.js");
|
|
10
|
+
const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
|
|
11
|
+
const getRadioButtonBorderClass = (isReadOnly, isDanger, isChecked) => {
|
|
12
|
+
if (isReadOnly) {
|
|
13
|
+
return 'border-background-default';
|
|
14
|
+
}
|
|
15
|
+
if (isDanger) {
|
|
16
|
+
return 'border-error-default';
|
|
17
|
+
}
|
|
18
|
+
if (isChecked) {
|
|
19
|
+
return 'border-primary-default';
|
|
20
|
+
}
|
|
21
|
+
return 'border-default';
|
|
22
|
+
};
|
|
23
|
+
const getRadioButtonDotClass = (isReadOnly, isDanger) => {
|
|
24
|
+
if (isReadOnly) {
|
|
25
|
+
return 'bg-icon-alternative';
|
|
26
|
+
}
|
|
27
|
+
if (isDanger) {
|
|
28
|
+
return 'bg-error-default';
|
|
29
|
+
}
|
|
30
|
+
return 'bg-primary-default';
|
|
31
|
+
};
|
|
32
|
+
const RadioButton = ({ onPress, label, labelProps, isChecked = false, isDisabled = false, isReadOnly = false, isDanger = false, touchableOpacityProps, radioButtonContainerProps, twClassName, style, ...props }) => {
|
|
33
|
+
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
34
|
+
return (<react_native_1.View {...props} style={[
|
|
35
|
+
tw.style('flex-row items-center', isDisabled ? 'opacity-50' : 'opacity-100', twClassName),
|
|
36
|
+
style,
|
|
37
|
+
]}>
|
|
38
|
+
<react_native_1.TouchableOpacity onPress={onPress} disabled={isDisabled || isReadOnly} accessible accessibilityRole="radio" accessibilityState={{
|
|
39
|
+
checked: isChecked,
|
|
40
|
+
disabled: isDisabled,
|
|
41
|
+
}} accessibilityLabel={typeof label === 'string' ? label : undefined} {...touchableOpacityProps} style={[
|
|
42
|
+
tw.style('flex-row items-center'),
|
|
43
|
+
touchableOpacityProps?.style,
|
|
44
|
+
]}>
|
|
45
|
+
<react_native_1.View {...radioButtonContainerProps} style={[
|
|
46
|
+
tw.style('size-5 items-center justify-center rounded-full border-2 bg-default', getRadioButtonBorderClass(isReadOnly, isDanger, isChecked)),
|
|
47
|
+
radioButtonContainerProps?.style,
|
|
48
|
+
]}>
|
|
49
|
+
{isChecked && (<react_native_1.View style={tw.style('size-3 rounded-full', getRadioButtonDotClass(isReadOnly, isDanger))}/>)}
|
|
50
|
+
</react_native_1.View>
|
|
51
|
+
{label ? (<TextOrChildren_1.TextOrChildren textProps={{ ...labelProps, twClassName: 'ml-3' }}>
|
|
52
|
+
{label}
|
|
53
|
+
</TextOrChildren_1.TextOrChildren>) : null}
|
|
54
|
+
</react_native_1.TouchableOpacity>
|
|
55
|
+
</react_native_1.View>);
|
|
56
|
+
};
|
|
57
|
+
exports.RadioButton = RadioButton;
|
|
58
|
+
//# sourceMappingURL=RadioButton.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButton.cjs","sourceRoot":"","sources":["../../../src/components/RadioButton/RadioButton.tsx"],"names":[],"mappings":";;;;;;AAAA,qFAAmE;AACnE,kDAA0B;AAC1B,wDAAsD;AAEtD,gFAAmE;AAInE,MAAM,yBAAyB,GAAG,CAChC,UAAmB,EACnB,QAAiB,EACjB,SAAkB,EACV,EAAE;IACV,IAAI,UAAU,EAAE;QACd,OAAO,2BAA2B,CAAC;KACpC;IACD,IAAI,QAAQ,EAAE;QACZ,OAAO,sBAAsB,CAAC;KAC/B;IACD,IAAI,SAAS,EAAE;QACb,OAAO,wBAAwB,CAAC;KACjC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,sBAAsB,GAAG,CAC7B,UAAmB,EACnB,QAAiB,EACT,EAAE;IACV,IAAI,UAAU,EAAE;QACd,OAAO,qBAAqB,CAAC;KAC9B;IACD,IAAI,QAAQ,EAAE;QACZ,OAAO,kBAAkB,CAAC;KAC3B;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC,CAAC;AAEK,MAAM,WAAW,GAAG,CAAC,EAC1B,OAAO,EACP,KAAK,EACL,UAAU,EACV,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,QAAQ,GAAG,KAAK,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACS,EAAE,EAAE;IACrB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,mBAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,uBAAuB,EACvB,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,EACzC,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,+BAAgB,CACf,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,QAAQ,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,CACnC,UAAU,CACV,iBAAiB,CAAC,OAAO,CACzB,kBAAkB,CAAC,CAAC;YAClB,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE,UAAU;SACrB,CAAC,CACF,kBAAkB,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAClE,IAAI,qBAAqB,CAAC,CAC1B,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC;YACjC,qBAAqB,EAAE,KAAK;SAC7B,CAAC,CAEF;QAAA,CAAC,mBAAI,CACH,IAAI,yBAAyB,CAAC,CAC9B,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,qEAAqE,EACrE,yBAAyB,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAC3D;YACD,yBAAyB,EAAE,KAAK;SACjC,CAAC,CAEF;UAAA,CAAC,SAAS,IAAI,CACZ,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CACb,qBAAqB,EACrB,sBAAsB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAC7C,CAAC,EACF,CACH,CACH;QAAA,EAAE,mBAAI,CACN;QAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CACP,CAAC,+BAAc,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAChE;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,+BAAc,CAAC,CAClB,CAAC,CAAC,CAAC,IAAI,CACV;MAAA,EAAE,+BAAgB,CACpB;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAvEW,QAAA,WAAW,eAuEtB","sourcesContent":["import { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\nimport { View, TouchableOpacity } from 'react-native';\n\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { RadioButtonProps } from './RadioButton.types';\n\nconst getRadioButtonBorderClass = (\n isReadOnly: boolean,\n isDanger: boolean,\n isChecked: boolean,\n): string => {\n if (isReadOnly) {\n return 'border-background-default';\n }\n if (isDanger) {\n return 'border-error-default';\n }\n if (isChecked) {\n return 'border-primary-default';\n }\n return 'border-default';\n};\n\nconst getRadioButtonDotClass = (\n isReadOnly: boolean,\n isDanger: boolean,\n): string => {\n if (isReadOnly) {\n return 'bg-icon-alternative';\n }\n if (isDanger) {\n return 'bg-error-default';\n }\n return 'bg-primary-default';\n};\n\nexport const RadioButton = ({\n onPress,\n label,\n labelProps,\n isChecked = false,\n isDisabled = false,\n isReadOnly = false,\n isDanger = false,\n touchableOpacityProps,\n radioButtonContainerProps,\n twClassName,\n style,\n ...props\n}: RadioButtonProps) => {\n const tw = useTailwind();\n\n return (\n <View\n {...props}\n style={[\n tw.style(\n 'flex-row items-center',\n isDisabled ? 'opacity-50' : 'opacity-100',\n twClassName,\n ),\n style,\n ]}\n >\n <TouchableOpacity\n onPress={onPress}\n disabled={isDisabled || isReadOnly}\n accessible\n accessibilityRole=\"radio\"\n accessibilityState={{\n checked: isChecked,\n disabled: isDisabled,\n }}\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n {...touchableOpacityProps}\n style={[\n tw.style('flex-row items-center'),\n touchableOpacityProps?.style,\n ]}\n >\n <View\n {...radioButtonContainerProps}\n style={[\n tw.style(\n 'size-5 items-center justify-center rounded-full border-2 bg-default',\n getRadioButtonBorderClass(isReadOnly, isDanger, isChecked),\n ),\n radioButtonContainerProps?.style,\n ]}\n >\n {isChecked && (\n <View\n style={tw.style(\n 'size-3 rounded-full',\n getRadioButtonDotClass(isReadOnly, isDanger),\n )}\n />\n )}\n </View>\n {label ? (\n <TextOrChildren textProps={{ ...labelProps, twClassName: 'ml-3' }}>\n {label}\n </TextOrChildren>\n ) : null}\n </TouchableOpacity>\n </View>\n );\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SAMPLE_RADIOBUTTON_PROPS = void 0;
|
|
4
|
+
// Sample props for stories and tests
|
|
5
|
+
exports.SAMPLE_RADIOBUTTON_PROPS = {
|
|
6
|
+
label: 'Sample RadioButton Label',
|
|
7
|
+
isChecked: false,
|
|
8
|
+
isDisabled: false,
|
|
9
|
+
isReadOnly: false,
|
|
10
|
+
isDanger: false,
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=RadioButton.constants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButton.constants.cjs","sourceRoot":"","sources":["../../../src/components/RadioButton/RadioButton.constants.ts"],"names":[],"mappings":";;;AAEA,qCAAqC;AACxB,QAAA,wBAAwB,GAAqB;IACxD,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,KAAK;CAChB,CAAC","sourcesContent":["import type { RadioButtonProps } from './RadioButton.types';\n\n// Sample props for stories and tests\nexport const SAMPLE_RADIOBUTTON_PROPS: RadioButtonProps = {\n label: 'Sample RadioButton Label',\n isChecked: false,\n isDisabled: false,\n isReadOnly: false,\n isDanger: false,\n};\n"]}
|