Skip to content

Commit 4e66515

Browse files
authored
Merge branch 'main' into docs/text-button-extension
2 parents 3a530b2 + 578dec4 commit 4e66515

97 files changed

Lines changed: 608 additions & 590 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/metamask-design-system",
3-
"version": "35.0.0",
3+
"version": "36.0.0",
44
"private": true,
55
"description": "The MetaMask Design System monorepo",
66
"repository": {

packages/design-system-react-native/CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.21.0]
11+
12+
### Added
13+
14+
- Added `Telegram` to the `IconName` set for use anywhere the React Native package accepts design system icons ([#1122](https://github.com/MetaMask/metamask-design-system/pull/1122))
15+
16+
### Changed
17+
18+
- **BREAKING:** Updated `AvatarIcon` exports to use shared const-object + string-union types rather than local enum-based definitions, aligning React Native with the shared cross-platform type contracts ([#996](https://github.com/MetaMask/metamask-design-system/pull/996))
19+
- No migration required for typical usage; continue importing from `@metamask/design-system-react-native` as before.
20+
- Runtime values remain stable while type definitions follow ADR-0003/ADR-0004.
21+
1022
## [0.20.0]
1123

1224
### Added
@@ -361,7 +373,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
361373
- Full TypeScript support with type definitions and enums
362374
- React Native integration with TWRNC preset support
363375

364-
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.20.0...HEAD
376+
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.21.0...HEAD
377+
[0.21.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.20.0...@metamask/design-system-react-native@0.21.0
365378
[0.20.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.19.0...@metamask/design-system-react-native@0.20.0
366379
[0.19.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.18.0...@metamask/design-system-react-native@0.19.0
367380
[0.18.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.17.0...@metamask/design-system-react-native@0.18.0

packages/design-system-react-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/design-system-react-native",
3-
"version": "0.20.0",
3+
"version": "0.21.0",
44
"description": "Design System React Native",
55
"keywords": [
66
"MetaMask",

packages/design-system-react-native/src/components/BannerBase/BannerBase.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import {
22
BoxAlignItems,
33
BoxBackgroundColor,
44
BoxFlexDirection,
5+
ButtonIconSize,
6+
ButtonSize,
57
FontWeight,
8+
IconName,
69
TextVariant,
710
} from '@metamask/design-system-shared';
811
import React from 'react';
912
import { GestureResponderEvent } from 'react-native';
1013

11-
import { ButtonIconSize, ButtonSize, IconName } from '../../types';
1214
import { Box } from '../Box';
1315
import { Button } from '../Button';
1416
import { ButtonIcon } from '../ButtonIcon';

packages/design-system-react-native/src/components/Button/Button.stories.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import {
2+
ButtonSize,
3+
ButtonVariant,
4+
IconName,
5+
} from '@metamask/design-system-shared';
16
import { useTailwind } from '@metamask/design-system-twrnc-preset';
27
import type { Meta, StoryObj } from '@storybook/react-native';
38
import React from 'react';
49
import { View } from 'react-native';
510

6-
import { ButtonSize, ButtonVariant } from '../../types';
7-
import { IconName } from '../Icon';
8-
911
import { Button } from './Button';
1012
import type { ButtonProps } from './Button.types';
1113

packages/design-system-react-native/src/components/Button/Button.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
import { ButtonVariant } from '@metamask/design-system-shared';
12
import { render } from '@testing-library/react-native';
23
import React from 'react';
34

4-
import { ButtonVariant } from '../../types';
5-
65
import { Button } from './Button';
76

87
describe('Button', () => {

packages/design-system-react-native/src/components/Button/Button.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
import { ButtonVariant } from '@metamask/design-system-shared';
12
import React from 'react';
23

3-
import { ButtonVariant } from '../../types';
4-
54
import type { ButtonProps } from './Button.types';
65
import { ButtonPrimary } from './variants/ButtonPrimary';
76
import { ButtonSecondary } from './variants/ButtonSecondary';
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ButtonVariant } from '../../types';
1+
import type { ButtonPropsShared } from '@metamask/design-system-shared';
22

33
import type { ButtonPrimaryProps } from './variants/ButtonPrimary';
44
import type { ButtonSecondaryProps } from './variants/ButtonSecondary';
@@ -7,13 +7,5 @@ import type { ButtonTertiaryProps } from './variants/ButtonTertiary';
77
/**
88
* Button component props.
99
*/
10-
export type ButtonProps = (
11-
| ButtonTertiaryProps
12-
| ButtonPrimaryProps
13-
| ButtonSecondaryProps
14-
) & {
15-
/**
16-
* Variant of Button.
17-
*/
18-
variant?: ButtonVariant;
19-
};
10+
export type ButtonProps = ButtonPropsShared &
11+
(ButtonTertiaryProps | ButtonPrimaryProps | ButtonSecondaryProps);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export { ButtonSize, ButtonVariant } from '../../types';
1+
export { ButtonSize, ButtonVariant } from '@metamask/design-system-shared';
22
export { Button } from './Button';
33
export type { ButtonProps } from './Button.types';

packages/design-system-react-native/src/components/Button/variants/ButtonPrimary/ButtonPrimary.stories.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1+
import { ButtonSize, IconName } from '@metamask/design-system-shared';
12
import { useTailwind } from '@metamask/design-system-twrnc-preset';
23
import type { Meta, StoryObj } from '@storybook/react-native';
34
import { View } from 'react-native';
45

5-
import { ButtonPrimarySize } from '../../../../types';
6-
import { IconName } from '../../../Icon';
7-
86
import { ButtonPrimary } from './ButtonPrimary';
97
import type { ButtonPrimaryProps } from './ButtonPrimary.types';
108

@@ -17,7 +15,7 @@ const meta: Meta<ButtonPrimaryProps> = {
1715
},
1816
size: {
1917
control: 'select',
20-
options: ButtonPrimarySize,
18+
options: ButtonSize,
2119
},
2220
isLoading: {
2321
control: 'boolean',
@@ -69,7 +67,7 @@ const ButtonPrimaryStory: React.FC<ButtonPrimaryProps> = ({
6967
export const Default: Story = {
7068
args: {
7169
children: 'Sample ButtonPrimary Text',
72-
size: ButtonPrimarySize.Lg,
70+
size: ButtonSize.Lg,
7371
isLoading: false,
7472
loadingText: 'Loading',
7573
startIconName: IconName.Add,
@@ -85,9 +83,9 @@ export const Default: Story = {
8583
export const Sizes: Story = {
8684
render: () => (
8785
<View style={{ gap: 16 }}>
88-
<ButtonPrimary size={ButtonPrimarySize.Sm}>ButtonSize Sm</ButtonPrimary>
89-
<ButtonPrimary size={ButtonPrimarySize.Md}>ButtonSize Md</ButtonPrimary>
90-
<ButtonPrimary size={ButtonPrimarySize.Lg}>
86+
<ButtonPrimary size={ButtonSize.Sm}>ButtonSize Sm</ButtonPrimary>
87+
<ButtonPrimary size={ButtonSize.Md}>ButtonSize Md</ButtonPrimary>
88+
<ButtonPrimary size={ButtonSize.Lg}>
9189
ButtonSize Lg (Default)
9290
</ButtonPrimary>
9391
</View>

0 commit comments

Comments
 (0)