Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sm size variant to Heading #2831

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading