diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 1/chrome.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 1/chrome.png index bdbe54a9bbe..eb4f2cfe6bc 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 1/chrome.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 1/chrome.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6af3479dc2ab3edb7f913332abc00b5736a3b12460ddb62369323485deaeb891 -size 29214 +oid sha256:2b58998a4cc63b2e4566607f3bab2738834b8ff48de9787f883492ecd90a50c5 +size 26597 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 1/firefox.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 1/firefox.png index 7536e697c77..c770942c4d2 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 1/firefox.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 1/firefox.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ecb8620ddbe6352658938a4e8097369243d720e2f135ec4689fe3c738589f70d -size 20792 +oid sha256:bf0a45ac59b74ca49d0b23f618717be0cffcb369d9ba3596daa7e7ca0307ccc4 +size 20600 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 1/ie11.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 1/ie11.png index f33041bbd04..72d101504df 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 1/ie11.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 1/ie11.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:68dab94a296aa4bef3df268520e2ea22de20f883e6de75429c4be2e4653c1289 -size 27620 +oid sha256:0610edceb1ecd237315c22ec092ff56ade7a359d61035afb7dbf369e4a2e81dc +size 25766 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 2/chrome.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 2/chrome.png index f2fce9b17d0..e64d6ed5c33 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 2/chrome.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 2/chrome.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2de63f77e9fdaae3d798d2b2c2065989f9e9aa9410cc05e441070526bf7e7b00 -size 19131 +oid sha256:b1cdadb6577f10a30e14457b89dcaace1caddb883ad95876e0a7d958b49ea0ce +size 18248 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 2/firefox.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 2/firefox.png index 1f539c8c5ca..fdf9f6245f3 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 2/firefox.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 2/firefox.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b887183499330ecbd732fa8ded27ab8b549b312e7da1950866f828d4a3126795 -size 12956 +oid sha256:034f0c085e605acbaf765688166c99c6f761be0e608625a758679c411c0c674d +size 12768 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 2/ie11.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 2/ie11.png index 6eb4e3e5dd4..88b649f4479 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 2/ie11.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 2/ie11.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cfbf508ae20b0305dff41a7346d1a5710160644bb23e3088b90e168aff7ac57e -size 17085 +oid sha256:8a397b161b7756d7c5eabb2d22035fc56967f8a9bbb5bf26418d35105c98a380 +size 15910 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 3/chrome.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 3/chrome.png index 26b42f1a63b..37bc9b3dc9e 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 3/chrome.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 3/chrome.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:42e62cf64031baeb9391234e99e453bfa70767171c4c27c06e24b113b986c26f -size 19325 +oid sha256:e3fcad7596d7442cc9ab12724d1ac4a4daabec6f769f73af382f35d4f9575c18 +size 18422 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 3/firefox.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 3/firefox.png index 5af9ea2228b..5b21cd99b4b 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 3/firefox.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 3/firefox.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a7b7c6bcab9b2573f66e19d144ffb5d778497abb50d7a6aa1b72097c3940790a -size 14934 +oid sha256:7a177f592c71ce0444622bfe25a3b027469c0958bbb94501f360ad2eea6430d3 +size 14707 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 3/ie11.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 3/ie11.png index 10352614b05..a84494be08c 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 3/ie11.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 3/ie11.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8c66442f46430655986d2619b41e4fbc1200936a8c6ef1ce42cc3a3ee61db3a1 -size 19846 +oid sha256:a0f844580623734c9b777dbdd30303cab25bfb8fd1df1687e93446ec06369ef9 +size 18540 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 4/chrome.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 4/chrome.png index 62eeb015b5f..c35335e7228 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 4/chrome.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 4/chrome.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9b0aae860e3bea4b0722ad6f64d55f935eb7a82820b811b058fcd65d41fb4ce6 -size 26636 +oid sha256:8737e2b85e3fccbe325f5c3cb3f53b74144d690d0f7f82c6766b9a569e14325b +size 25535 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 4/firefox.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 4/firefox.png index efbcf618f8a..224b18ab54d 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 4/firefox.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 4/firefox.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:16a25adbff286734765ced73227478c96080ce7d46a98df9fe6553746c6d08b2 -size 19714 +oid sha256:598cb590e670fe42283c33f065488a24079dfa22143df016b8b4afb8be08ced8 +size 19343 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 4/ie11.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 4/ie11.png index c5c3b91d2bc..9f3d2bcdc92 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 4/ie11.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 4/ie11.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:285e04117a2dd65801054783648b618fae05a22f41631c4b1eafa279210b006d -size 23393 +oid sha256:bbc7146a55fea162edad08d58f327912a60d589faab4019325f0dbfd9e738783 +size 22242 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 5/chrome.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 5/chrome.png index 7af7ca70f8f..b97e9ece118 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 5/chrome.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 5/chrome.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dfd6cf65db378bc135376b6328ef6dda9619963d297e4b9398a7bf72debec6d9 -size 28048 +oid sha256:67bbb8cf8a85a61eb6c95aac50b44ae5e08f5741ed79ecfc8bab6824b735f93a +size 26440 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 5/firefox.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 5/firefox.png index d20bdea6469..af482e314cf 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 5/firefox.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 5/firefox.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b326b142c5cf7da4f0e1980a1a0842bfefb90e4dc77874c4d11e7f7b7957547a -size 20760 +oid sha256:857e78e1ba557f1e1bc163bffe21f507c28c3a7c76efff72becedfdf087c1c94 +size 20180 diff --git a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 5/ie11.png b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 5/ie11.png index 8582b355631..e9076446a4d 100644 --- a/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 5/ie11.png +++ b/packages/react-ui-screenshot-tests/gemini/screens/Button states/different content/page - 5/ie11.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6e4aad057dd8db115012c302940038f189098bf4ca3ddd13805c1f208c0ce50b -size 24936 +oid sha256:23c2c85ab7dce11dd471e6fba065f882368ca68be063ac589f8d9ace976c64c9 +size 23673 diff --git a/packages/retail-ui/components/Button/__stories__/Button.stories.tsx b/packages/retail-ui/components/Button/__stories__/Button.stories.tsx index 85b9c12dd7e..183743ed351 100644 --- a/packages/retail-ui/components/Button/__stories__/Button.stories.tsx +++ b/packages/retail-ui/components/Button/__stories__/Button.stories.tsx @@ -299,13 +299,13 @@ const ButtonsTable = (props: { const { rows = [], cols = [], presetState = {}, children = 'Button' } = props; return (
{cols.map((state, i) => ( | - {stateToString(state)} + {renderStateDesc(state)} | ))}|
---|---|---|
{stateToString(rowState)} | +{renderStateDesc(rowState)} | {cols.map((colState, colIndex) => (@@ -326,7 +326,7 @@ const ButtonsTable = (props: { ); }; -const stateToString = (state: ButtonState): string => { +const renderStateDesc = (state: ButtonState): React.ReactNode => { return Object.keys(state) .map(key => { // @ts-ignore @@ -336,11 +336,20 @@ const stateToString = (state: ButtonState): string => { return key + (value ? '' : ': false'); case 'string': return `${key}: "${value}"`; + case 'object': + if (React.isValidElement(value)) { + return React.createElement('span', {}, [`${key}: `, value]); + } + return `${key}: ${JSON.stringify(value)}`; default: return `${key}: ${value}`; } }) - .join(', '); + .map((node: React.ReactNode, index: number, nodes: React.ReactNode[]) => ( + + {node} {index + 1 < nodes.length ? ', ' : null} + + )); }; class StatesCombinator extends React.Component< |