diff --git a/config/styleguide.config.js b/config/styleguide.config.js index 5eac994008..536d3430ee 100644 --- a/config/styleguide.config.js +++ b/config/styleguide.config.js @@ -314,6 +314,7 @@ module.exports = { return [ path.resolve('packages/Card/Card.jsx'), path.resolve('packages/Image/Image.jsx'), + path.resolve('packages/ResponsiveImage/ResponsiveImage.jsx'), path.resolve('packages/Video/Video.jsx'), path.resolve('packages/WebVideo/WebVideo.jsx'), path.resolve('packages/A11yContent/A11yContent.jsx'), @@ -552,6 +553,7 @@ module.exports = { PriceLockup: path.resolve('packages/PriceLockup'), Radio: path.resolve('packages/Radio'), Responsive: path.resolve('packages/Responsive'), + ResponsiveImage: path.resolve('packages/ResponsiveImage'), Select: path.resolve('packages/Select'), Small: path.resolve('packages/Small'), Spinner: path.resolve('packages/Spinner'), diff --git a/docs/assets/responsive-image/mountains_desktop.jpg b/docs/assets/responsive-image/mountains_desktop.jpg new file mode 100644 index 0000000000..775a4495f2 Binary files /dev/null and b/docs/assets/responsive-image/mountains_desktop.jpg differ diff --git a/docs/assets/responsive-image/mountains_mobile.jpg b/docs/assets/responsive-image/mountains_mobile.jpg new file mode 100644 index 0000000000..5778516fdd Binary files /dev/null and b/docs/assets/responsive-image/mountains_mobile.jpg differ diff --git a/docs/assets/responsive-image/mountains_tablet.jpg b/docs/assets/responsive-image/mountains_tablet.jpg new file mode 100644 index 0000000000..0c9fcbc1e3 Binary files /dev/null and b/docs/assets/responsive-image/mountains_tablet.jpg differ diff --git a/e2e/output/components/ResponsiveImage/baseline/chrome_78.png b/e2e/output/components/ResponsiveImage/baseline/chrome_78.png new file mode 100644 index 0000000000..dfbfe94e33 Binary files /dev/null and b/e2e/output/components/ResponsiveImage/baseline/chrome_78.png differ diff --git a/e2e/output/components/ResponsiveImage/baseline/firefox_80.png b/e2e/output/components/ResponsiveImage/baseline/firefox_80.png new file mode 100644 index 0000000000..8efc49fc6f Binary files /dev/null and b/e2e/output/components/ResponsiveImage/baseline/firefox_80.png differ diff --git a/e2e/output/components/ResponsiveImage/baseline/internet explorer_headless.png b/e2e/output/components/ResponsiveImage/baseline/internet explorer_headless.png new file mode 100644 index 0000000000..05b8b237a7 Binary files /dev/null and b/e2e/output/components/ResponsiveImage/baseline/internet explorer_headless.png differ diff --git a/e2e/output/components/ResponsiveImage/baseline/microsoftedge_18.png b/e2e/output/components/ResponsiveImage/baseline/microsoftedge_18.png new file mode 100644 index 0000000000..9cfb7bee45 Binary files /dev/null and b/e2e/output/components/ResponsiveImage/baseline/microsoftedge_18.png differ diff --git a/e2e/output/components/ResponsiveImage/baseline/safari_12.png b/e2e/output/components/ResponsiveImage/baseline/safari_12.png new file mode 100644 index 0000000000..6df0fbf0fe Binary files /dev/null and b/e2e/output/components/ResponsiveImage/baseline/safari_12.png differ diff --git a/e2e/visual/components/CartesianResponsiveImage.jsx b/e2e/visual/components/CartesianResponsiveImage.jsx new file mode 100644 index 0000000000..51f41ea909 --- /dev/null +++ b/e2e/visual/components/CartesianResponsiveImage.jsx @@ -0,0 +1,64 @@ +/* eslint-disable react/no-children-prop */ +import React from 'react' +import { renderToString } from 'react-dom/server' +import { Cartesian } from '@compositor/kit' + +import ResponsiveImage from '../../../packages/ResponsiveImage' + +const viewports = [ + { width: 320, height: 568 }, + { width: 640, height: 360 }, + { width: 768, height: 1024 }, + { width: 1024, height: 543 }, + { width: 1440, height: 880 }, +] + +const ResponsiveImageContainer = props => { + // "Responsive" component from "@compositor/kit" does not take in a title attribute for + // iframe, failing the accessibility scan. iframe used to test different window sizes + const html = innerHtml => ` + + + + + + + Document + + + ${innerHtml} + + + ` + + const CartesianResponsiveImage = renderToString( + + ) + + return ( + <> + {viewports.map((viewport, i) => ( +