diff --git a/.changeset/gorgeous-falcons-peel.md b/.changeset/gorgeous-falcons-peel.md new file mode 100644 index 0000000000..b2f563d725 --- /dev/null +++ b/.changeset/gorgeous-falcons-peel.md @@ -0,0 +1,4 @@ +--- +"@ultraviolet/ui": patch +--- +``: new prop `whiteSpace` \ No newline at end of file diff --git a/packages/plus/src/components/EstimateCost/__tests__/__snapshots__/Regular.test.tsx.snap b/packages/plus/src/components/EstimateCost/__tests__/__snapshots__/Regular.test.tsx.snap index 02dcc8dfa2..786d3c5f96 100644 --- a/packages/plus/src/components/EstimateCost/__tests__/__snapshots__/Regular.test.tsx.snap +++ b/packages/plus/src/components/EstimateCost/__tests__/__snapshots__/Regular.test.tsx.snap @@ -7590,6 +7590,7 @@ exports[`EstimateCost - Regular Item > render basic props with overlay beta 1`] text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -7602,7 +7603,6 @@ exports[`EstimateCost - Regular Item > render basic props with overlay beta 1`] -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -8228,6 +8228,7 @@ exports[`EstimateCost - Regular Item > render basic props with overlay beta 1`] text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -8240,7 +8241,6 @@ exports[`EstimateCost - Regular Item > render basic props with overlay beta 1`] -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; diff --git a/packages/plus/src/components/EstimateCost/__tests__/__snapshots__/index.test.tsx.snap b/packages/plus/src/components/EstimateCost/__tests__/__snapshots__/index.test.tsx.snap index 8d9a497b09..74de5517ae 100644 --- a/packages/plus/src/components/EstimateCost/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/plus/src/components/EstimateCost/__tests__/__snapshots__/index.test.tsx.snap @@ -284,6 +284,7 @@ exports[`EstimateCost - index > render isBeta with discount 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -296,7 +297,6 @@ exports[`EstimateCost - index > render isBeta with discount 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -898,6 +898,7 @@ exports[`EstimateCost - index > render isBeta with discount 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -910,7 +911,6 @@ exports[`EstimateCost - index > render isBeta with discount 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -1581,6 +1581,7 @@ exports[`EstimateCost - index > render isBeta with discount equal to 100% 1`] = text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -1593,7 +1594,6 @@ exports[`EstimateCost - index > render isBeta with discount equal to 100% 1`] = -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -2195,6 +2195,7 @@ exports[`EstimateCost - index > render isBeta with discount equal to 100% 1`] = text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -2207,7 +2208,6 @@ exports[`EstimateCost - index > render isBeta with discount equal to 100% 1`] = -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -2883,6 +2883,7 @@ exports[`EstimateCost - index > render isBeta with discount more than 100% 1`] = text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -2895,7 +2896,6 @@ exports[`EstimateCost - index > render isBeta with discount more than 100% 1`] = -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -3497,6 +3497,7 @@ exports[`EstimateCost - index > render isBeta with discount more than 100% 1`] = text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -3509,7 +3510,6 @@ exports[`EstimateCost - index > render isBeta with discount more than 100% 1`] = -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -4190,6 +4190,7 @@ exports[`EstimateCost - index > render isBeta without discount 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -4202,7 +4203,6 @@ exports[`EstimateCost - index > render isBeta without discount 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -4804,6 +4804,7 @@ exports[`EstimateCost - index > render isBeta without discount 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -4816,7 +4817,6 @@ exports[`EstimateCost - index > render isBeta without discount 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -17268,6 +17268,7 @@ exports[`EstimateCost - index > render with discount 1, isBeta and defaultTimeUn text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -17280,7 +17281,6 @@ exports[`EstimateCost - index > render with discount 1, isBeta and defaultTimeUn -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -17882,6 +17882,7 @@ exports[`EstimateCost - index > render with discount 1, isBeta and defaultTimeUn text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -17894,7 +17895,6 @@ exports[`EstimateCost - index > render with discount 1, isBeta and defaultTimeUn -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -22741,6 +22741,7 @@ exports[`EstimateCost - index > render with isBeta but undefined discount 1`] = text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -22753,7 +22754,6 @@ exports[`EstimateCost - index > render with isBeta but undefined discount 1`] = -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -23355,6 +23355,7 @@ exports[`EstimateCost - index > render with isBeta but undefined discount 1`] = text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -23367,7 +23368,6 @@ exports[`EstimateCost - index > render with isBeta but undefined discount 1`] = -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -24321,6 +24321,7 @@ exports[`EstimateCost - index > render with isBeta, discount 0 and defaultTimeUn text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -24333,7 +24334,6 @@ exports[`EstimateCost - index > render with isBeta, discount 0 and defaultTimeUn -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -24361,6 +24361,7 @@ exports[`EstimateCost - index > render with isBeta, discount 0 and defaultTimeUn text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -24373,7 +24374,6 @@ exports[`EstimateCost - index > render with isBeta, discount 0 and defaultTimeUn -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -25549,6 +25549,7 @@ exports[`EstimateCost - index > render with isBeta, discount 0 and defaultTimeUn text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -25561,7 +25562,6 @@ exports[`EstimateCost - index > render with isBeta, discount 0 and defaultTimeUn -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -25587,6 +25587,7 @@ exports[`EstimateCost - index > render with isBeta, discount 0 and defaultTimeUn text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -25599,7 +25600,6 @@ exports[`EstimateCost - index > render with isBeta, discount 0 and defaultTimeUn -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -26557,6 +26557,7 @@ exports[`EstimateCost - index > render with isBeta, discount 0.5 and defaultTime text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -26569,7 +26570,6 @@ exports[`EstimateCost - index > render with isBeta, discount 0.5 and defaultTime -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -26597,6 +26597,7 @@ exports[`EstimateCost - index > render with isBeta, discount 0.5 and defaultTime text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -26609,7 +26610,6 @@ exports[`EstimateCost - index > render with isBeta, discount 0.5 and defaultTime -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -27785,6 +27785,7 @@ exports[`EstimateCost - index > render with isBeta, discount 0.5 and defaultTime text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -27797,7 +27798,6 @@ exports[`EstimateCost - index > render with isBeta, discount 0.5 and defaultTime -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -27823,6 +27823,7 @@ exports[`EstimateCost - index > render with isBeta, discount 0.5 and defaultTime text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -27835,7 +27836,6 @@ exports[`EstimateCost - index > render with isBeta, discount 0.5 and defaultTime -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -28520,6 +28520,7 @@ exports[`EstimateCost - index > render with isBeta, price, discount 50% 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -28532,7 +28533,6 @@ exports[`EstimateCost - index > render with isBeta, price, discount 50% 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -29134,6 +29134,7 @@ exports[`EstimateCost - index > render with isBeta, price, discount 50% 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -29146,7 +29147,6 @@ exports[`EstimateCost - index > render with isBeta, price, discount 50% 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -32096,6 +32096,7 @@ exports[`EstimateCost - index > render with item discount 50% and text 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -32108,7 +32109,6 @@ exports[`EstimateCost - index > render with item discount 50% and text 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.5rem; gap: 0.25rem; diff --git a/packages/plus/src/components/Navigation/__tests__/__snapshots__/index.test.tsx.snap b/packages/plus/src/components/Navigation/__tests__/__snapshots__/index.test.tsx.snap index b9cd052ede..183fac0cb6 100644 --- a/packages/plus/src/components/Navigation/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/plus/src/components/Navigation/__tests__/__snapshots__/index.test.tsx.snap @@ -860,13 +860,12 @@ exports[`Navigation > click on expand / collapse button 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-23 { @@ -879,13 +878,12 @@ exports[`Navigation > click on expand / collapse button 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-25 { @@ -1274,13 +1272,12 @@ exports[`Navigation > click on expand / collapse button 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-65 { @@ -1293,13 +1290,12 @@ exports[`Navigation > click on expand / collapse button 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-84 { @@ -3913,13 +3909,12 @@ exports[`Navigation > pin and unpin an item 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-23 { @@ -3932,13 +3927,12 @@ exports[`Navigation > pin and unpin an item 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-25 { @@ -4327,13 +4321,12 @@ exports[`Navigation > pin and unpin an item 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-65 { @@ -4346,13 +4339,12 @@ exports[`Navigation > pin and unpin an item 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-84 { @@ -5887,13 +5879,12 @@ exports[`Navigation > pin and unpin an item 2`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-23 { @@ -5906,13 +5897,12 @@ exports[`Navigation > pin and unpin an item 2`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-25 { @@ -6301,13 +6291,12 @@ exports[`Navigation > pin and unpin an item 2`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-65 { @@ -6320,13 +6309,12 @@ exports[`Navigation > pin and unpin an item 2`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-84 { @@ -7861,13 +7849,12 @@ exports[`Navigation > pin and unpin an item 3`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-23 { @@ -7880,13 +7867,12 @@ exports[`Navigation > pin and unpin an item 3`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-25 { @@ -8109,13 +8095,12 @@ exports[`Navigation > pin and unpin an item 3`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-54 { @@ -8374,13 +8359,12 @@ exports[`Navigation > pin and unpin an item 3`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-88 { @@ -8393,13 +8377,12 @@ exports[`Navigation > pin and unpin an item 3`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-116 { @@ -9470,13 +9453,12 @@ exports[`Navigation > render with basic content 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-25 { @@ -9677,13 +9659,12 @@ exports[`Navigation > render with basic content 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-84 { @@ -10693,13 +10674,12 @@ exports[`Navigation > render without pinnedFeature 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-35 { @@ -10743,13 +10723,12 @@ exports[`Navigation > render without pinnedFeature 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-52 { @@ -11945,13 +11924,12 @@ exports[`Navigation > resize manually the navigation using slider 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-23 { @@ -11964,13 +11942,12 @@ exports[`Navigation > resize manually the navigation using slider 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-25 { @@ -12359,13 +12336,12 @@ exports[`Navigation > resize manually the navigation using slider 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-65 { @@ -12378,13 +12354,12 @@ exports[`Navigation > resize manually the navigation using slider 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: pre-wrap; overflow-wrap: anywhere; - white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; } .emotion-84 { diff --git a/packages/plus/src/components/Navigation/components/Item.tsx b/packages/plus/src/components/Navigation/components/Item.tsx index 14c8a17eb0..b01e68a8ec 100644 --- a/packages/plus/src/components/Navigation/components/Item.tsx +++ b/packages/plus/src/components/Navigation/components/Item.tsx @@ -128,12 +128,10 @@ const WrapText = styled(Text, { subLabel?: boolean }>` overflow-wrap: ${({ animation }) => (animation ? 'normal' : 'anywhere')}; - white-space: ${({ animation }) => (animation ? 'nowrap' : 'normal')}; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; - white-space: pre-wrap; ` const StyledStack = styled(Stack)` @@ -550,7 +548,7 @@ export const Item = memo( expanded ? onDragStopTrigger(event) : undefined } id={id} - data-testId={dataTestId} + data-testid={dataTestId} > {label} @@ -602,6 +601,7 @@ export const Item = memo( animation={animation} disabled={disabled} subLabel + whiteSpace="pre-wrap" > {subLabel} @@ -805,7 +805,7 @@ export const Item = memo( flex={1} width="100%" > - + {label} diff --git a/packages/ui/src/__stories__/Properties/Properties.tsx b/packages/ui/src/__stories__/Properties/Properties.tsx index e93dd4e485..7d6a156907 100644 --- a/packages/ui/src/__stories__/Properties/Properties.tsx +++ b/packages/ui/src/__stories__/Properties/Properties.tsx @@ -5,10 +5,6 @@ import { Stack } from '../../components/Stack' import { Table } from '../../components/Table' import { Text } from '../../components/Text' -const StyledText = styled(Text)` - white-space: break-spaces; -` - const StyledTableRow = styled(Table.Row)` vertical-align: top; ` @@ -253,21 +249,21 @@ const Properties = () => { - + {propertyValues.join(', ')} - + - + {findSimilarProperty.join(', ')} - + - + {sortedPropertiesUsagesCountAndComponentsName[ property ].components.join(', ')} - + ) diff --git a/packages/ui/src/components/Badge/__tests__/__snapshots__/index.test.tsx.snap b/packages/ui/src/components/Badge/__tests__/__snapshots__/index.test.tsx.snap index 98e27bd4cb..7cfb48c4d4 100644 --- a/packages/ui/src/components/Badge/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/ui/src/components/Badge/__tests__/__snapshots__/index.test.tsx.snap @@ -11,6 +11,7 @@ exports[`Badge > renders correctly prominence default 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -23,7 +24,6 @@ exports[`Badge > renders correctly prominence default 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -60,6 +60,7 @@ exports[`Badge > renders correctly prominence strong 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -72,7 +73,6 @@ exports[`Badge > renders correctly prominence strong 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -109,6 +109,7 @@ exports[`Badge > renders correctly sentiment danger 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -121,7 +122,6 @@ exports[`Badge > renders correctly sentiment danger 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -158,6 +158,7 @@ exports[`Badge > renders correctly sentiment info 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -170,7 +171,6 @@ exports[`Badge > renders correctly sentiment info 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -207,6 +207,7 @@ exports[`Badge > renders correctly sentiment neutral 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -219,7 +220,6 @@ exports[`Badge > renders correctly sentiment neutral 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -256,6 +256,7 @@ exports[`Badge > renders correctly sentiment primary 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -268,7 +269,6 @@ exports[`Badge > renders correctly sentiment primary 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -305,6 +305,7 @@ exports[`Badge > renders correctly sentiment secondary 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -317,7 +318,6 @@ exports[`Badge > renders correctly sentiment secondary 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -354,6 +354,7 @@ exports[`Badge > renders correctly sentiment success 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -366,7 +367,6 @@ exports[`Badge > renders correctly sentiment success 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -403,6 +403,7 @@ exports[`Badge > renders correctly sentiment warning 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -415,7 +416,6 @@ exports[`Badge > renders correctly sentiment warning 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -452,6 +452,7 @@ exports[`Badge > renders correctly size large 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -464,7 +465,6 @@ exports[`Badge > renders correctly size large 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 1rem; gap: 0.5rem; @@ -501,6 +501,7 @@ exports[`Badge > renders correctly size medium 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -513,7 +514,6 @@ exports[`Badge > renders correctly size medium 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -550,6 +550,7 @@ exports[`Badge > renders correctly size small 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -562,7 +563,6 @@ exports[`Badge > renders correctly size small 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.5rem; gap: 0.25rem; @@ -599,6 +599,7 @@ exports[`Badge > renders correctly when disabled 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -611,7 +612,6 @@ exports[`Badge > renders correctly when disabled 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -648,6 +648,7 @@ exports[`Badge > renders correctly with default values 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -660,7 +661,6 @@ exports[`Badge > renders correctly with default values 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -697,6 +697,7 @@ exports[`Badge > renders correctly with icon 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -709,7 +710,6 @@ exports[`Badge > renders correctly with icon 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; diff --git a/packages/ui/src/components/Badge/index.tsx b/packages/ui/src/components/Badge/index.tsx index be70c3a72f..b9bad16b0d 100644 --- a/packages/ui/src/components/Badge/index.tsx +++ b/packages/ui/src/components/Badge/index.tsx @@ -97,7 +97,6 @@ const StyledSpan = styled(Text, { display: inline-flex; align-items: center; justify-content: center; - white-space: nowrap; border-radius: ${({ theme }) => theme.radii.xlarge}; padding: 0 ${({ theme, size }) => { @@ -171,6 +170,7 @@ export const Badge = ({ prominence={disabled ? 'weak' : 'default'} className={className} data-testid={dataTestId} + whiteSpace="nowrap" > {icon && size !== 'small' ? : null} {children} diff --git a/packages/ui/src/components/Snippet/__tests__/__snapshots__/index.test.tsx.snap b/packages/ui/src/components/Snippet/__tests__/__snapshots__/index.test.tsx.snap index baf7318dba..6b0634ab4f 100644 --- a/packages/ui/src/components/Snippet/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/ui/src/components/Snippet/__tests__/__snapshots__/index.test.tsx.snap @@ -50,11 +50,11 @@ exports[`Snippet > renders correctly 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; margin: 0; padding: 1rem; padding-right: 4.5rem; overflow-x: auto; - white-space: nowrap; height: auto; counter-reset: section; overflow-y: hidden; @@ -1312,11 +1312,11 @@ exports[`Snippet > renders correctly with copiedText 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; margin: 0; padding: 1rem; padding-right: 4.5rem; overflow-x: auto; - white-space: nowrap; height: auto; counter-reset: section; overflow-y: hidden; @@ -1526,11 +1526,11 @@ exports[`Snippet > renders correctly with copyText 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; margin: 0; padding: 1rem; padding-right: 4.5rem; overflow-x: auto; - white-space: nowrap; height: auto; counter-reset: section; overflow-y: hidden; @@ -3944,11 +3944,11 @@ exports[`Snippet > renders correctly with single line with prefix command 1`] = text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; margin: 0; padding: 1rem; padding-right: 4.5rem; overflow-x: auto; - white-space: nowrap; height: auto; counter-reset: section; overflow-y: hidden; @@ -4173,11 +4173,11 @@ exports[`Snippet > renders correctly with single line with prefix lines number 1 text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; margin: 0; padding: 1rem; padding-right: 4.5rem; overflow-x: auto; - white-space: nowrap; height: auto; counter-reset: section; overflow-y: hidden; diff --git a/packages/ui/src/components/Snippet/index.tsx b/packages/ui/src/components/Snippet/index.tsx index e9b582c4bc..fb7406618a 100644 --- a/packages/ui/src/components/Snippet/index.tsx +++ b/packages/ui/src/components/Snippet/index.tsx @@ -14,15 +14,8 @@ type Prefixes = 'lines' | 'command' const PreText = styled(Text, { shouldForwardProp: prop => - ![ - 'multiline', - 'hasShowMoreButton', - 'showMore', - 'rows', - 'noExpandable', - ].includes(prop), + !['hasShowMoreButton', 'showMore', 'rows', 'noExpandable'].includes(prop), })<{ - multiline?: boolean hasShowMoreButton?: boolean showMore?: boolean rows: number @@ -33,7 +26,6 @@ const PreText = styled(Text, { padding-right: ${({ theme }) => theme.space['9']}; overflow-x: ${({ hasShowMoreButton, showMore }) => hasShowMoreButton && !showMore ? 'hidden' : 'auto'}; - ${({ multiline }) => (!multiline ? 'white-space: nowrap;' : '')} height: auto; counter-reset: section; @@ -169,11 +161,11 @@ const CodeContent = ({ {multiline ? ( Children.map(lines, child => ( diff --git a/packages/ui/src/components/Stepper/Step.tsx b/packages/ui/src/components/Stepper/Step.tsx index 3adda2489f..aa70e41248 100644 --- a/packages/ui/src/components/Stepper/Step.tsx +++ b/packages/ui/src/components/Stepper/Step.tsx @@ -67,7 +67,6 @@ const StyledText = styled(Text)` text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; ` const StyledStepContainer = styled(Stack)<{ @@ -259,6 +258,7 @@ export const Step = ({ variant={textVariant} prominence={isDone || isActive ? 'default' : 'weak'} sentiment={isActive ? 'primary' : 'neutral'} + whiteSpace="normal" > {title} diff --git a/packages/ui/src/components/Stepper/__tests__/__snapshots__/index.test.tsx.snap b/packages/ui/src/components/Stepper/__tests__/__snapshots__/index.test.tsx.snap index 3667a94c19..51dc6a5612 100644 --- a/packages/ui/src/components/Stepper/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/ui/src/components/Stepper/__tests__/__snapshots__/index.test.tsx.snap @@ -424,12 +424,12 @@ exports[`Stepper > handles clicks when interactive 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-10 { @@ -442,12 +442,12 @@ exports[`Stepper > handles clicks when interactive 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-15 { @@ -516,12 +516,12 @@ exports[`Stepper > handles clicks when interactive 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-18 { @@ -534,12 +534,12 @@ exports[`Stepper > handles clicks when interactive 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-23 { @@ -604,12 +604,12 @@ exports[`Stepper > handles clicks when interactive 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-26 { @@ -622,12 +622,12 @@ exports[`Stepper > handles clicks when interactive 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; }
handles clicks when interactive and small 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-10 { @@ -1149,12 +1149,12 @@ exports[`Stepper > handles clicks when interactive and small 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-15 { @@ -1223,12 +1223,12 @@ exports[`Stepper > handles clicks when interactive and small 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-18 { @@ -1241,12 +1241,12 @@ exports[`Stepper > handles clicks when interactive and small 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-23 { @@ -1311,12 +1311,12 @@ exports[`Stepper > handles clicks when interactive and small 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-26 { @@ -1329,12 +1329,12 @@ exports[`Stepper > handles clicks when interactive and small 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; }
handles clicks when not interactive 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-10 { @@ -1856,12 +1856,12 @@ exports[`Stepper > handles clicks when not interactive 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-15 { @@ -1930,12 +1930,12 @@ exports[`Stepper > handles clicks when not interactive 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-18 { @@ -1948,12 +1948,12 @@ exports[`Stepper > handles clicks when not interactive 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-23 { @@ -2018,12 +2018,12 @@ exports[`Stepper > handles clicks when not interactive 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-26 { @@ -2036,12 +2036,12 @@ exports[`Stepper > handles clicks when not interactive 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; }
renders correctly with all selected 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-15 { @@ -2390,12 +2390,12 @@ exports[`Stepper > renders correctly with all selected 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-23 { @@ -2434,12 +2434,12 @@ exports[`Stepper > renders correctly with all selected 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; }
renders correctly with animation 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-15 { @@ -2788,12 +2788,12 @@ exports[`Stepper > renders correctly with animation 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-23 { @@ -2832,12 +2832,12 @@ exports[`Stepper > renders correctly with animation 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; }
renders correctly with children 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-15 { @@ -3186,12 +3186,12 @@ exports[`Stepper > renders correctly with children 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-23 { @@ -3230,12 +3230,12 @@ exports[`Stepper > renders correctly with children 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; }
renders correctly with default props 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-15 { @@ -3585,12 +3585,12 @@ exports[`Stepper > renders correctly with default props 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-23 { @@ -3629,12 +3629,12 @@ exports[`Stepper > renders correctly with default props 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; }
renders correctly with disabled steps 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-13 { @@ -3979,12 +3979,12 @@ exports[`Stepper > renders correctly with disabled steps 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; }
renders correctly with selected prop 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-25 { @@ -4323,12 +4323,12 @@ exports[`Stepper > renders correctly with selected prop 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; }
renders correctly with small size 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-15 { @@ -4687,12 +4687,12 @@ exports[`Stepper > renders correctly with small size 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-23 { @@ -4731,12 +4731,12 @@ exports[`Stepper > renders correctly with small size 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; }
renders correctly with step number in row 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-12 { @@ -5124,12 +5124,12 @@ exports[`Stepper > renders correctly with step number in row 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-22 { @@ -5196,12 +5196,12 @@ exports[`Stepper > renders correctly with step number in row 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; }
renders correctly without separator 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-15 { @@ -6155,12 +6155,12 @@ exports[`Stepper > renders correctly without separator 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-23 { @@ -6199,12 +6199,12 @@ exports[`Stepper > renders correctly without separator 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; }
renders correctly without separator with label on the right 1 text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-15 { @@ -6563,12 +6563,12 @@ exports[`Stepper > renders correctly without separator with label on the right 1 text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; } .emotion-23 { @@ -6607,12 +6607,12 @@ exports[`Stepper > renders correctly without separator with label on the right 1 text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: normal; -webkit-transition: text-decoration-color 250ms ease-out; transition: text-decoration-color 250ms ease-out; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: transparent; - white-space: normal; }
renders correctly with counter, badge and subtitle 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -324,7 +325,6 @@ exports[`Tab > renders correctly with counter, badge and subtitle 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; diff --git a/packages/ui/src/components/Tabs/__tests__/__snapshots__/index.test.tsx.snap b/packages/ui/src/components/Tabs/__tests__/__snapshots__/index.test.tsx.snap index cd5d25fe22..d89efca1de 100644 --- a/packages/ui/src/components/Tabs/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/ui/src/components/Tabs/__tests__/__snapshots__/index.test.tsx.snap @@ -1487,6 +1487,7 @@ exports[`Tabs > renders correctly with Tabs with prop 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -1499,7 +1500,6 @@ exports[`Tabs > renders correctly with Tabs with prop 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -1524,6 +1524,7 @@ exports[`Tabs > renders correctly with Tabs with prop 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -1536,7 +1537,6 @@ exports[`Tabs > renders correctly with Tabs with prop 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -2763,6 +2763,7 @@ exports[`Tabs > renders correctly with Tabs with prop 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -2775,7 +2776,6 @@ exports[`Tabs > renders correctly with Tabs with prop 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; @@ -2800,6 +2800,7 @@ exports[`Tabs > renders correctly with Tabs with prop 1`] = ` text-transform: none; -webkit-text-decoration: none; text-decoration: none; + white-space: nowrap; display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -2812,7 +2813,6 @@ exports[`Tabs > renders correctly with Tabs with prop 1`] = ` -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; - white-space: nowrap; border-radius: 1rem; padding: 0 0.75rem; gap: 0.5rem; diff --git a/packages/ui/src/components/Text/__tests__/__snapshots__/index.test.tsx.snap b/packages/ui/src/components/Text/__tests__/__snapshots__/index.test.tsx.snap index a3ec6f5557..b17b291cd5 100644 --- a/packages/ui/src/components/Text/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/ui/src/components/Text/__tests__/__snapshots__/index.test.tsx.snap @@ -725,6 +725,32 @@ exports[`Text > renders correctly with type="headingStronger" 1`] = ` `; +exports[`Text > renders correctly with whiteSpace 1`] = ` + + .emotion-0 { + font-size: 1rem; + font-family: Inter,Asap,sans-serif; + font-weight: 400; + letter-spacing: 0; + line-height: 1.5rem; + text-transform: none; + -webkit-text-decoration: none; + text-decoration: none; + white-space: nowrap; +} + +
+
+ This text is quite long. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +
+
+
+`; + exports[`Text > with disabled 1`] = ` .emotion-0 { @@ -776,6 +802,32 @@ exports[`Text > with italic 1`] = ` `; +exports[`Text > with monochrome 1`] = ` + + .emotion-0 { + color: #151a2d; + font-size: 1rem; + font-family: Inter,Asap,sans-serif; + font-weight: 400; + letter-spacing: 0; + line-height: 1.5rem; + text-transform: none; + -webkit-text-decoration: none; + text-decoration: none; +} + +
+
+ Lorem Ipsum +
+
+
+`; + exports[`Text > with multiple nested children renders correctly 1`] = ` .emotion-0 { diff --git a/packages/ui/src/components/Text/__tests__/index.test.tsx b/packages/ui/src/components/Text/__tests__/index.test.tsx index 6757bdee88..e8403f2465 100644 --- a/packages/ui/src/components/Text/__tests__/index.test.tsx +++ b/packages/ui/src/components/Text/__tests__/index.test.tsx @@ -92,4 +92,20 @@ describe('Text', () => { Lorem Ipsum , )) + + test(`with monochrome`, () => + shouldMatchEmotionSnapshot( + + Lorem Ipsum + , + )) + + test(`renders correctly with whiteSpace`, () => + shouldMatchEmotionSnapshot( + + This text is quite long. Lorem ipsum dolor sit amet, consectetur + adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore + magna aliqua. + , + )) }) diff --git a/packages/ui/src/components/Text/index.tsx b/packages/ui/src/components/Text/index.tsx index b9d00e7d32..c10eae888b 100644 --- a/packages/ui/src/components/Text/index.tsx +++ b/packages/ui/src/components/Text/index.tsx @@ -19,6 +19,7 @@ const PROMINENCES = { type ProminenceProps = keyof typeof PROMINENCES type PlacementProps = React.CSSProperties['textAlign'] +type WhiteSpaceProps = React.CSSProperties['whiteSpace'] type TextVariant = keyof typeof typography export const textVariants = Object.keys(typography) as TextVariant[] @@ -35,6 +36,7 @@ const generateStyles = ({ disabled, italic, underline, + whiteSpace, }: { placement?: PlacementProps prominence: ProminenceProps @@ -45,6 +47,7 @@ const generateStyles = ({ disabled: boolean italic: boolean underline: boolean + whiteSpace?: WhiteSpaceProps }): string => { // stronger is available only for neutral sentiment const definedProminence = @@ -77,6 +80,7 @@ const generateStyles = ({ text-transform: ${theme.typography[variant].textCase}; text-decoration: ${theme.typography[variant].textDecoration}; ${placement ? ` text-align: ${placement};` : ''} + ${whiteSpace ? `white-space: ${whiteSpace};` : ''} ${ oneLine @@ -87,6 +91,7 @@ const generateStyles = ({ } ${italic ? `font-style: italic;` : ''} ${underline ? `text-decoration: underline;` : ''} + ` } @@ -110,6 +115,7 @@ type TextProps = { dir?: 'ltr' | 'rtl' | 'auto' htmlFor?: string 'data-testid'?: string + whiteSpace?: WhiteSpaceProps } const StyledText = styled('div', { @@ -124,6 +130,7 @@ const StyledText = styled('div', { 'disabled', 'italic', 'underline', + 'whiteSpace', ].includes(prop), })<{ placement?: PlacementProps @@ -135,6 +142,7 @@ const StyledText = styled('div', { italic: boolean underline: boolean htmlFor?: string + whiteSpace?: WhiteSpaceProps }>(generateStyles) /** @@ -155,6 +163,7 @@ export const Text = ({ underline = false, id, dir, + whiteSpace, htmlFor, 'data-testid': dataTestId, }: TextProps) => { @@ -182,6 +191,7 @@ export const Text = ({ dir={dir} htmlFor={htmlFor} data-testid={dataTestId} + whiteSpace={whiteSpace} > {children}