From f4ae284e36b1abbbbe74b7b6525024f5ee24736c Mon Sep 17 00:00:00 2001 From: Avinash Dwarapu Date: Fri, 25 Aug 2023 16:13:41 +0200 Subject: [PATCH] feat: Support iframes in container media content --- src/__tests__/__snapshots__/documenter.test.ts.snap | 2 +- src/container/interfaces.ts | 6 ++---- src/container/styles.scss | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/__tests__/__snapshots__/documenter.test.ts.snap b/src/__tests__/__snapshots__/documenter.test.ts.snap index ad634840a0..e3be63f9c5 100644 --- a/src/__tests__/__snapshots__/documenter.test.ts.snap +++ b/src/__tests__/__snapshots__/documenter.test.ts.snap @@ -5007,7 +5007,7 @@ all containers to the height of the longest one, to avoid extra vertical scroll Object { "description": "Use this slot to render a media element. Supported element types are 'img', 'video', and 'picture'. You can define different positions and sizes for the media element within the container. -* \`content\` - Use this slot to render your media element. We support \`img\`, \`video\` and \`picture\` elements. +* \`content\` - Use this slot to render your media element. We support \`img\`, \`video\`, \`picture\`, and \`iframe\` elements. * \`position\` - Defines the media slot's position within the container. Defaults to \`top\`. diff --git a/src/container/interfaces.ts b/src/container/interfaces.ts index 1c3d01bfb9..f88046d348 100644 --- a/src/container/interfaces.ts +++ b/src/container/interfaces.ts @@ -19,7 +19,7 @@ export interface ContainerProps extends BaseComponentProps { * Use this slot to render a media element. Supported element types are 'img', 'video', and 'picture'. * You can define different positions and sizes for the media element within the container. * - * * `content` - Use this slot to render your media element. We support `img`, `video` and `picture` elements. + * * `content` - Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements. * * * `position` - Defines the media slot's position within the container. Defaults to `top`. * @@ -72,9 +72,7 @@ export interface ContainerProps extends BaseComponentProps { export namespace ContainerProps { export interface Media { /** - * - * Use this slot to render your media element. We support `img`, `video` and `picture` elements. - * + * Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements. */ content: React.ReactNode; diff --git a/src/container/styles.scss b/src/container/styles.scss index cddb942127..8406680f56 100644 --- a/src/container/styles.scss +++ b/src/container/styles.scss @@ -91,7 +91,8 @@ // stylelint-disable-next-line @cloudscape-design/no-implicit-descendant, selector-max-type img, video, - picture { + picture, + iframe { width: 100%; height: 100%; object-fit: cover;