Skip to content

Commit

Permalink
Add sm size variant to Heading (#2831)
Browse files Browse the repository at this point in the history
This adds a new `size` variant to the `Heading` component `sm`. It is
the default size of the heading
  • Loading branch information
GuillaumeRx authored Oct 11, 2024
1 parent 1251f80 commit f4890dd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "4Waitn0bnIxi/w96Dqni+0tHJkuPURlZznHkrdp2cPc=",
"shasum": "cpGbAa5I7Y1mBlhvQlq5Sj8KkB/UcsD5MEgaeFeyMmM=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/browserify/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "27AQQByAFXL3KIpdFzj+ke9/98WSR8o8Fan72A4LuXg=",
"shasum": "v1nVnxArJyII7qfswvNyO/rW2hG89ZQgyttgPAUp1r8=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/snaps-sdk/src/jsx/components/Heading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { createSnapComponent } from '../component';
* The props of the {@link Heading} component.
*
* @property children - The text to display in the heading.
* @property size - The size of the heading.
* @property size - The size of the heading. Defaults to `sm`.
*/
type HeadingProps = {
children: StringElement;
size?: 'md' | 'lg' | undefined;
size?: 'sm' | 'md' | 'lg' | undefined;
};

const TYPE = 'Heading';
Expand All @@ -19,7 +19,7 @@ const TYPE = 'Heading';
*
* @param props - The props of the component.
* @param props.children - The text to display in the heading.
* @param props.size - The size of the heading.
* @param props.size - The size of the heading. Defaults to `sm`.
* @returns A heading element.
* @example
* <Heading>Hello world!</Heading>
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-sdk/src/jsx/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ export const ValueStruct: Describe<ValueElement> = element('Value', {
*/
export const HeadingStruct: Describe<HeadingElement> = element('Heading', {
children: StringElementStruct,
size: optional(nullUnion([literal('md'), literal('lg')])),
size: optional(nullUnion([literal('sm'), literal('md'), literal('lg')])),
});

/**
Expand Down

0 comments on commit f4890dd

Please sign in to comment.