diff --git a/packages/examples/packages/browserify-plugin/snap.manifest.json b/packages/examples/packages/browserify-plugin/snap.manifest.json index ac37af9969..37e782f977 100644 --- a/packages/examples/packages/browserify-plugin/snap.manifest.json +++ b/packages/examples/packages/browserify-plugin/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "BiCtwmtmQRs6IrssjgH8PXZWH7afx75+RKXMnl9KDZ8=", + "shasum": "B0senywfM+w5lQ+iMvK+bVcKJ6VeLDj7HiUVYR5Cuag=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/examples/packages/browserify/snap.manifest.json b/packages/examples/packages/browserify/snap.manifest.json index e30bb3119f..96083306bf 100644 --- a/packages/examples/packages/browserify/snap.manifest.json +++ b/packages/examples/packages/browserify/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/MetaMask/snaps.git" }, "source": { - "shasum": "9K88gT7CbGCXTc/Qx63zbS91VQtHTkFFXWLjyXoM6YU=", + "shasum": "PS0U7SHYXWpFhO8QMtArHKU1rFzMkwtTLFlc3/g1HQ4=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/snaps-sdk/src/jsx/validation.ts b/packages/snaps-sdk/src/jsx/validation.ts index 6d286850ef..3649a37da8 100644 --- a/packages/snaps-sdk/src/jsx/validation.ts +++ b/packages/snaps-sdk/src/jsx/validation.ts @@ -215,15 +215,22 @@ function elementWithSelectiveProps< }); } +/** + * Shared struct used to validate border radius values used by various Snaps components. + */ +export const BorderRadiusStruct = nullUnion([ + literal('none'), + literal('medium'), + literal('full'), +]); + /** * A struct for the {@link ImageElement} type. */ export const ImageStruct: Describe = element('Image', { src: svg(), alt: optional(string()), - borderRadius: optional( - nullUnion([literal('none'), literal('medium'), literal('full')]), - ), + borderRadius: optional(BorderRadiusStruct), }); const IconNameStruct: Struct<`${IconName}`, null> = nullUnion( @@ -698,9 +705,7 @@ export const LinkStruct: Describe = element('Link', { export const SkeletonStruct: Describe = element('Skeleton', { width: optional(union([number(), string()])), height: optional(union([number(), string()])), - borderRadius: optional( - nullUnion([literal('none'), literal('medium'), literal('full')]), - ), + borderRadius: optional(BorderRadiusStruct), }); /**