From a39a9013167bb6f000f4afb41b7ebbacd7ef7f37 Mon Sep 17 00:00:00 2001 From: Manu Chambon Date: Mon, 27 Dec 2021 13:10:40 +0100 Subject: [PATCH] feat: reintroduce BorderedBox (#1044) * feat: reintroduce BorderedBox * feat: bonjour * fix: better tests * fix: use new colors --- .../__snapshots__/index.test.tsx.snap | 292 +- .../__tests__/__snapshots__/index.tsx.snap | 50 +- .../__tests__/__snapshots__/index.tsx.snap | 76 +- .../BorderedBox/__stories__/index.stories.tsx | 14 + .../__tests__/__snapshots__/index.tsx.snap | 31 + .../BorderedBox/__tests__/index.tsx | 9 + src/components/BorderedBox/index.tsx | 9 + .../Box/__stories__/index.stories.tsx | 9 - .../__tests__/__snapshots__/index.tsx.snap | 34 +- src/components/Box/__tests__/index.tsx | 6 - src/components/Box/index.tsx | 21 +- .../__tests__/__snapshots__/index.tsx.snap | 8 +- .../__tests__/__snapshots__/index.tsx.snap | 28 +- .../__tests__/__snapshots__/index.tsx.snap | 582 +- .../__tests__/__snapshots__/index.tsx.snap | 216 +- .../__tests__/__snapshots__/index.tsx.snap | 72 +- src/components/Container/index.tsx | 4 +- .../__snapshots__/index.test.tsx.snap | 46 +- .../__snapshots__/index.test.tsx.snap | 290 +- .../__snapshots__/index.test.tsx.snap | 76 +- .../__tests__/__snapshots__/index.tsx.snap | 8 +- .../__tests__/__snapshots__/index.tsx.snap | 86 +- .../__tests__/__snapshots__/index.tsx.snap | 8 +- .../__tests__/__snapshots__/index.tsx.snap | 156 +- .../__tests__/__snapshots__/index.tsx.snap | 66 +- .../__snapshots__/index.test.tsx.snap | 522 +- .../__tests__/__snapshots__/index.tsx.snap | 248 +- .../__tests__/__snapshots__/index.tsx.snap | 98 +- .../__snapshots__/index.test.tsx.snap | 5086 ++++++++--------- .../__tests__/__snapshots__/index.tsx.snap | 60 +- .../__tests__/__snapshots__/index.tsx.snap | 308 +- .../__tests__/__snapshots__/index.tsx.snap | 96 +- .../__snapshots__/index.test.tsx.snap | 36 +- .../__tests__/__snapshots__/index.tsx.snap | 12 +- .../__snapshots__/index.test.tsx.snap | 1682 +++--- .../__snapshots__/index.test.tsx.snap | 28 +- .../__snapshots__/index.test.tsx.snap | 70 +- .../__tests__/__snapshots__/index.tsx.snap | 4 +- .../__tests__/__snapshots__/index.tsx.snap | 156 +- .../__tests__/__snapshots__/index.tsx.snap | 32 +- .../__tests__/__snapshots__/index.tsx.snap | 24 +- .../__tests__/__snapshots__/index.tsx.snap | 58 +- .../__tests__/__snapshots__/index.tsx.snap | 249 +- .../RadioBorderedBox/__tests__/index.tsx | 44 +- src/components/RadioBorderedBox/index.tsx | 18 +- .../__tests__/__snapshots__/index.tsx.snap | 250 +- .../__tests__/__snapshots__/index.tsx.snap | 88 +- .../__tests__/__snapshots__/index.tsx.snap | 546 +- .../__tests__/__snapshots__/index.tsx.snap | 76 +- .../__tests__/__snapshots__/index.tsx.snap | 18 +- .../__tests__/__snapshots__/index.tsx.snap | 84 +- .../__tests__/__snapshots__/index.tsx.snap | 80 +- .../__tests__/__snapshots__/index.tsx.snap | 534 +- .../__tests__/__snapshots__/index.tsx.snap | 58 +- .../__snapshots__/TabGroup.test.tsx.snap | 40 +- .../__tests__/__snapshots__/index.tsx.snap | 96 +- .../__tests__/__snapshots__/index.tsx.snap | 12 +- .../__tests__/__snapshots__/index.tsx.snap | 510 +- .../__tests__/__snapshots__/index.tsx.snap | 74 +- .../__snapshots__/index.test.tsx.snap | 354 +- .../__tests__/__snapshots__/index.tsx.snap | 22 +- .../__tests__/__snapshots__/index.tsx.snap | 164 +- .../__snapshots__/index.test.tsx.snap | 36 +- .../__tests__/__snapshots__/index.tsx.snap | 12 +- .../__tests__/__snapshots__/index.tsx.snap | 36 +- .../__snapshots__/index.test.tsx.snap | 166 +- .../__tests__/__snapshots__/index.tsx.snap | 380 +- .../__tests__/__snapshots__/index.tsx.snap | 20 +- .../__tests__/__snapshots__/index.tsx.snap | 110 +- src/components/index.ts | 1 + 70 files changed, 7457 insertions(+), 7338 deletions(-) create mode 100644 src/components/BorderedBox/__stories__/index.stories.tsx create mode 100644 src/components/BorderedBox/__tests__/__snapshots__/index.tsx.snap create mode 100644 src/components/BorderedBox/__tests__/index.tsx create mode 100644 src/components/BorderedBox/index.tsx diff --git a/src/components/Alert/__tests__/__snapshots__/index.test.tsx.snap b/src/components/Alert/__tests__/__snapshots__/index.test.tsx.snap index 442ee43055..2797c18bcc 100644 --- a/src/components/Alert/__tests__/__snapshots__/index.test.tsx.snap +++ b/src/components/Alert/__tests__/__snapshots__/index.test.tsx.snap @@ -2,7 +2,7 @@ exports[`Alert renders correctly unknow theme type and fallback to defaults 1`] = ` - .cache-1i3p2kd { + .cache-1qiayae { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -20,7 +20,7 @@ exports[`Alert renders correctly unknow theme type and fallback to defaults 1`] color: #ef5774; } -.cache-njjnbl { +.cache-9tkkyk { fill: currentColor; height: 32px; width: 32px; @@ -28,11 +28,11 @@ exports[`Alert renders correctly unknow theme type and fallback to defaults 1`] min-height: 32px; } -.cache-njjnbl.cache-njjnbl { +.cache-9tkkyk.cache-9tkkyk { vertical-align: middle; } -.cache-79qxbt { +.cache-1rumpwk { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -42,11 +42,11 @@ exports[`Alert renders correctly unknow theme type and fallback to defaults 1`] flex-direction: column; } -.cache-79qxbt.cache-79qxbt { +.cache-1rumpwk.cache-1rumpwk { color: inherit; } -.cache-n6ee2f { +.cache-jssxd3 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -57,18 +57,18 @@ exports[`Alert renders correctly unknow theme type and fallback to defaults 1`] color: inherit; } -.cache-n6ee2f.cache-n6ee2f { +.cache-jssxd3.cache-jssxd3 { margin-left: 16px; }

Sample Alert

@@ -90,7 +90,7 @@ exports[`Alert renders correctly unknow theme type and fallback to defaults 1`] exports[`Alert renders correctly unknow variant and fallback to standard 1`] = ` - .cache-1i3p2kd { + .cache-1qiayae { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -108,7 +108,7 @@ exports[`Alert renders correctly unknow variant and fallback to standard 1`] = ` color: #ef5774; } -.cache-njjnbl { +.cache-9tkkyk { fill: currentColor; height: 32px; width: 32px; @@ -116,11 +116,11 @@ exports[`Alert renders correctly unknow variant and fallback to standard 1`] = ` min-height: 32px; } -.cache-njjnbl.cache-njjnbl { +.cache-9tkkyk.cache-9tkkyk { vertical-align: middle; } -.cache-79qxbt { +.cache-1rumpwk { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -130,11 +130,11 @@ exports[`Alert renders correctly unknow variant and fallback to standard 1`] = ` flex-direction: column; } -.cache-79qxbt.cache-79qxbt { +.cache-1rumpwk.cache-1rumpwk { color: inherit; } -.cache-n6ee2f { +.cache-jssxd3 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -145,18 +145,18 @@ exports[`Alert renders correctly unknow variant and fallback to standard 1`] = ` color: inherit; } -.cache-n6ee2f.cache-n6ee2f { +.cache-jssxd3.cache-jssxd3 { margin-left: 16px; }

Sample Alert

@@ -178,7 +178,7 @@ exports[`Alert renders correctly unknow variant and fallback to standard 1`] = ` exports[`Alert renders correctly variant beta 1`] = ` - .cache-121xbfc { + .cache-1cyjdh2 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -196,7 +196,7 @@ exports[`Alert renders correctly variant beta 1`] = ` color: #ff8c69; } -.cache-njjnbl { +.cache-9tkkyk { fill: currentColor; height: 32px; width: 32px; @@ -204,11 +204,11 @@ exports[`Alert renders correctly variant beta 1`] = ` min-height: 32px; } -.cache-njjnbl.cache-njjnbl { +.cache-9tkkyk.cache-9tkkyk { vertical-align: middle; } -.cache-79qxbt { +.cache-1rumpwk { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -218,11 +218,11 @@ exports[`Alert renders correctly variant beta 1`] = ` flex-direction: column; } -.cache-79qxbt.cache-79qxbt { +.cache-1rumpwk.cache-1rumpwk { color: inherit; } -.cache-n6ee2f { +.cache-jssxd3 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -233,18 +233,18 @@ exports[`Alert renders correctly variant beta 1`] = ` color: inherit; } -.cache-n6ee2f.cache-n6ee2f { +.cache-jssxd3.cache-jssxd3 { margin-left: 16px; }

Sample Alert

@@ -266,7 +266,7 @@ exports[`Alert renders correctly variant beta 1`] = ` exports[`Alert renders correctly variant filled 1`] = ` - .cache-1s52m9c { + .cache-kryxo5 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -284,7 +284,7 @@ exports[`Alert renders correctly variant filled 1`] = ` color: #fff; } -.cache-njjnbl { +.cache-9tkkyk { fill: currentColor; height: 32px; width: 32px; @@ -292,11 +292,11 @@ exports[`Alert renders correctly variant filled 1`] = ` min-height: 32px; } -.cache-njjnbl.cache-njjnbl { +.cache-9tkkyk.cache-9tkkyk { vertical-align: middle; } -.cache-79qxbt { +.cache-1rumpwk { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -306,11 +306,11 @@ exports[`Alert renders correctly variant filled 1`] = ` flex-direction: column; } -.cache-79qxbt.cache-79qxbt { +.cache-1rumpwk.cache-1rumpwk { color: inherit; } -.cache-n6ee2f { +.cache-jssxd3 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -321,18 +321,18 @@ exports[`Alert renders correctly variant filled 1`] = ` color: inherit; } -.cache-n6ee2f.cache-n6ee2f { +.cache-jssxd3.cache-jssxd3 { margin-left: 16px; }

Sample Alert

@@ -354,7 +354,7 @@ exports[`Alert renders correctly variant filled 1`] = ` exports[`Alert renders correctly variant info 1`] = ` - .cache-11br9be { + .cache-c35o8f { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -372,7 +372,7 @@ exports[`Alert renders correctly variant info 1`] = ` color: #3f6ed8; } -.cache-njjnbl { +.cache-9tkkyk { fill: currentColor; height: 32px; width: 32px; @@ -380,11 +380,11 @@ exports[`Alert renders correctly variant info 1`] = ` min-height: 32px; } -.cache-njjnbl.cache-njjnbl { +.cache-9tkkyk.cache-9tkkyk { vertical-align: middle; } -.cache-79qxbt { +.cache-1rumpwk { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -394,11 +394,11 @@ exports[`Alert renders correctly variant info 1`] = ` flex-direction: column; } -.cache-79qxbt.cache-79qxbt { +.cache-1rumpwk.cache-1rumpwk { color: inherit; } -.cache-n6ee2f { +.cache-jssxd3 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -409,18 +409,18 @@ exports[`Alert renders correctly variant info 1`] = ` color: inherit; } -.cache-n6ee2f.cache-n6ee2f { +.cache-jssxd3.cache-jssxd3 { margin-left: 16px; }

Sample Alert

@@ -442,7 +442,7 @@ exports[`Alert renders correctly variant info 1`] = ` exports[`Alert renders correctly variant outlined 1`] = ` - .cache-elz115 { + .cache-eke1uc { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -460,7 +460,7 @@ exports[`Alert renders correctly variant outlined 1`] = ` color: #ef5774; } -.cache-njjnbl { +.cache-9tkkyk { fill: currentColor; height: 32px; width: 32px; @@ -468,11 +468,11 @@ exports[`Alert renders correctly variant outlined 1`] = ` min-height: 32px; } -.cache-njjnbl.cache-njjnbl { +.cache-9tkkyk.cache-9tkkyk { vertical-align: middle; } -.cache-79qxbt { +.cache-1rumpwk { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -482,11 +482,11 @@ exports[`Alert renders correctly variant outlined 1`] = ` flex-direction: column; } -.cache-79qxbt.cache-79qxbt { +.cache-1rumpwk.cache-1rumpwk { color: inherit; } -.cache-n6ee2f { +.cache-jssxd3 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -497,18 +497,18 @@ exports[`Alert renders correctly variant outlined 1`] = ` color: inherit; } -.cache-n6ee2f.cache-n6ee2f { +.cache-jssxd3.cache-jssxd3 { margin-left: 16px; }

Sample Alert

@@ -530,7 +530,7 @@ exports[`Alert renders correctly variant outlined 1`] = ` exports[`Alert renders correctly variant standard 1`] = ` - .cache-1i3p2kd { + .cache-1qiayae { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -548,7 +548,7 @@ exports[`Alert renders correctly variant standard 1`] = ` color: #ef5774; } -.cache-njjnbl { +.cache-9tkkyk { fill: currentColor; height: 32px; width: 32px; @@ -556,11 +556,11 @@ exports[`Alert renders correctly variant standard 1`] = ` min-height: 32px; } -.cache-njjnbl.cache-njjnbl { +.cache-9tkkyk.cache-9tkkyk { vertical-align: middle; } -.cache-79qxbt { +.cache-1rumpwk { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -570,11 +570,11 @@ exports[`Alert renders correctly variant standard 1`] = ` flex-direction: column; } -.cache-79qxbt.cache-79qxbt { +.cache-1rumpwk.cache-1rumpwk { color: inherit; } -.cache-n6ee2f { +.cache-jssxd3 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -585,18 +585,18 @@ exports[`Alert renders correctly variant standard 1`] = ` color: inherit; } -.cache-n6ee2f.cache-n6ee2f { +.cache-jssxd3.cache-jssxd3 { margin-left: 16px; }

Sample Alert

@@ -618,7 +618,7 @@ exports[`Alert renders correctly variant standard 1`] = ` exports[`Alert renders correctly variant success 1`] = ` - .cache-x1wlg5 { + .cache-2z6ukh { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -636,7 +636,7 @@ exports[`Alert renders correctly variant success 1`] = ` color: #45d6b5; } -.cache-njjnbl { +.cache-9tkkyk { fill: currentColor; height: 32px; width: 32px; @@ -644,11 +644,11 @@ exports[`Alert renders correctly variant success 1`] = ` min-height: 32px; } -.cache-njjnbl.cache-njjnbl { +.cache-9tkkyk.cache-9tkkyk { vertical-align: middle; } -.cache-79qxbt { +.cache-1rumpwk { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -658,11 +658,11 @@ exports[`Alert renders correctly variant success 1`] = ` flex-direction: column; } -.cache-79qxbt.cache-79qxbt { +.cache-1rumpwk.cache-1rumpwk { color: inherit; } -.cache-n6ee2f { +.cache-jssxd3 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -673,18 +673,18 @@ exports[`Alert renders correctly variant success 1`] = ` color: inherit; } -.cache-n6ee2f.cache-n6ee2f { +.cache-jssxd3.cache-jssxd3 { margin-left: 16px; }

Sample Alert

@@ -706,7 +706,7 @@ exports[`Alert renders correctly variant success 1`] = ` exports[`Alert renders correctly variant transparent 1`] = ` - .cache-rvu1ij { + .cache-82j8oa { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -725,7 +725,7 @@ exports[`Alert renders correctly variant transparent 1`] = ` padding: 12px 0; } -.cache-njjnbl { +.cache-9tkkyk { fill: currentColor; height: 32px; width: 32px; @@ -733,11 +733,11 @@ exports[`Alert renders correctly variant transparent 1`] = ` min-height: 32px; } -.cache-njjnbl.cache-njjnbl { +.cache-9tkkyk.cache-9tkkyk { vertical-align: middle; } -.cache-79qxbt { +.cache-1rumpwk { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -747,11 +747,11 @@ exports[`Alert renders correctly variant transparent 1`] = ` flex-direction: column; } -.cache-79qxbt.cache-79qxbt { +.cache-1rumpwk.cache-1rumpwk { color: inherit; } -.cache-n6ee2f { +.cache-jssxd3 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -762,18 +762,18 @@ exports[`Alert renders correctly variant transparent 1`] = ` color: inherit; } -.cache-n6ee2f.cache-n6ee2f { +.cache-jssxd3.cache-jssxd3 { margin-left: 16px; }

Sample Alert

@@ -795,7 +795,7 @@ exports[`Alert renders correctly variant transparent 1`] = ` exports[`Alert renders correctly variant warning 1`] = ` - .cache-1i3p2kd { + .cache-1qiayae { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -813,7 +813,7 @@ exports[`Alert renders correctly variant warning 1`] = ` color: #ef5774; } -.cache-njjnbl { +.cache-9tkkyk { fill: currentColor; height: 32px; width: 32px; @@ -821,11 +821,11 @@ exports[`Alert renders correctly variant warning 1`] = ` min-height: 32px; } -.cache-njjnbl.cache-njjnbl { +.cache-9tkkyk.cache-9tkkyk { vertical-align: middle; } -.cache-79qxbt { +.cache-1rumpwk { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -835,11 +835,11 @@ exports[`Alert renders correctly variant warning 1`] = ` flex-direction: column; } -.cache-79qxbt.cache-79qxbt { +.cache-1rumpwk.cache-1rumpwk { color: inherit; } -.cache-n6ee2f { +.cache-jssxd3 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -850,18 +850,18 @@ exports[`Alert renders correctly variant warning 1`] = ` color: inherit; } -.cache-n6ee2f.cache-n6ee2f { +.cache-jssxd3.cache-jssxd3 { margin-left: 16px; }

Sample Alert

@@ -883,7 +883,7 @@ exports[`Alert renders correctly variant warning 1`] = ` exports[`Alert renders correctly with custom icon 1`] = ` - .cache-1i3p2kd { + .cache-1qiayae { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -901,7 +901,7 @@ exports[`Alert renders correctly with custom icon 1`] = ` color: #ef5774; } -.cache-njjnbl { +.cache-9tkkyk { fill: currentColor; height: 32px; width: 32px; @@ -909,11 +909,11 @@ exports[`Alert renders correctly with custom icon 1`] = ` min-height: 32px; } -.cache-njjnbl.cache-njjnbl { +.cache-9tkkyk.cache-9tkkyk { vertical-align: middle; } -.cache-79qxbt { +.cache-1rumpwk { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -923,11 +923,11 @@ exports[`Alert renders correctly with custom icon 1`] = ` flex-direction: column; } -.cache-79qxbt.cache-79qxbt { +.cache-1rumpwk.cache-1rumpwk { color: inherit; } -.cache-n6ee2f { +.cache-jssxd3 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -938,18 +938,18 @@ exports[`Alert renders correctly with custom icon 1`] = ` color: inherit; } -.cache-n6ee2f.cache-n6ee2f { +.cache-jssxd3.cache-jssxd3 { margin-left: 16px; }

Sample Alert

@@ -971,7 +971,7 @@ exports[`Alert renders correctly with custom icon 1`] = ` exports[`Alert renders correctly with default values 1`] = ` - .cache-1i3p2kd { + .cache-1qiayae { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -989,7 +989,7 @@ exports[`Alert renders correctly with default values 1`] = ` color: #ef5774; } -.cache-njjnbl { +.cache-9tkkyk { fill: currentColor; height: 32px; width: 32px; @@ -997,11 +997,11 @@ exports[`Alert renders correctly with default values 1`] = ` min-height: 32px; } -.cache-njjnbl.cache-njjnbl { +.cache-9tkkyk.cache-9tkkyk { vertical-align: middle; } -.cache-79qxbt { +.cache-1rumpwk { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -1011,11 +1011,11 @@ exports[`Alert renders correctly with default values 1`] = ` flex-direction: column; } -.cache-79qxbt.cache-79qxbt { +.cache-1rumpwk.cache-1rumpwk { color: inherit; } -.cache-n6ee2f { +.cache-jssxd3 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -1026,18 +1026,18 @@ exports[`Alert renders correctly with default values 1`] = ` color: inherit; } -.cache-n6ee2f.cache-n6ee2f { +.cache-jssxd3.cache-jssxd3 { margin-left: 16px; }

Sample Alert

@@ -1059,7 +1059,7 @@ exports[`Alert renders correctly with default values 1`] = ` exports[`Alert renders correctly with title 1`] = ` - .cache-1i3p2kd { + .cache-1qiayae { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -1077,7 +1077,7 @@ exports[`Alert renders correctly with title 1`] = ` color: #ef5774; } -.cache-njjnbl { +.cache-9tkkyk { fill: currentColor; height: 32px; width: 32px; @@ -1085,11 +1085,11 @@ exports[`Alert renders correctly with title 1`] = ` min-height: 32px; } -.cache-njjnbl.cache-njjnbl { +.cache-9tkkyk.cache-9tkkyk { vertical-align: middle; } -.cache-79qxbt { +.cache-1rumpwk { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -1099,11 +1099,11 @@ exports[`Alert renders correctly with title 1`] = ` flex-direction: column; } -.cache-79qxbt.cache-79qxbt { +.cache-1rumpwk.cache-1rumpwk { color: inherit; } -.cache-372yw { +.cache-13kpmc4 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -1115,11 +1115,11 @@ exports[`Alert renders correctly with title 1`] = ` color: inherit; } -.cache-372yw.cache-372yw { +.cache-13kpmc4.cache-13kpmc4 { margin-left: 16px; } -.cache-n6ee2f { +.cache-jssxd3 { color: #4a4f62; font-weight: 400; margin-bottom: 0; @@ -1130,18 +1130,18 @@ exports[`Alert renders correctly with title 1`] = ` color: inherit; } -.cache-n6ee2f.cache-n6ee2f { +.cache-jssxd3.cache-jssxd3 { margin-left: 16px; }

title

Sample Alert

diff --git a/src/components/Avatar/__tests__/__snapshots__/index.tsx.snap b/src/components/Avatar/__tests__/__snapshots__/index.tsx.snap index b36637995e..9ca64d2528 100644 --- a/src/components/Avatar/__tests__/__snapshots__/index.tsx.snap +++ b/src/components/Avatar/__tests__/__snapshots__/index.tsx.snap @@ -2,7 +2,7 @@ exports[`Avatar renders correctly with custom background color 1`] = ` - .cache-ua3jbc.cache-ua3jbc { + .cache-wta1f9.cache-wta1f9 { width: 32px; height: 32px; position: relative; @@ -30,7 +30,7 @@ exports[`Avatar renders correctly with custom background color 1`] = ` }
- .cache-ua3jbc.cache-ua3jbc { + .cache-wta1f9.cache-wta1f9 { width: 32px; height: 32px; position: relative; @@ -71,7 +71,7 @@ exports[`Avatar renders correctly with custom text color 1`] = ` }
- .cache-ua3jbc.cache-ua3jbc { + .cache-wta1f9.cache-wta1f9 { width: 32px; height: 32px; position: relative; @@ -96,7 +96,7 @@ exports[`Avatar renders correctly with default props 1`] = ` }
- .cache-ua3jbc.cache-ua3jbc { + .cache-wta1f9.cache-wta1f9 { width: 32px; height: 32px; position: relative; @@ -121,7 +121,7 @@ exports[`Avatar renders correctly with image 1`] = ` }
- .cache-ua3jbc.cache-ua3jbc { + .cache-wta1f9.cache-wta1f9 { width: 32px; height: 32px; position: relative; @@ -161,7 +161,7 @@ exports[`Avatar renders correctly with lock 1`] = ` width: 100%; } -.cache-makwam { +.cache-f9vv5z { fill: #b2b6c3; height: 1em; width: 1em; @@ -169,18 +169,18 @@ exports[`Avatar renders correctly with lock 1`] = ` min-height: 1em; } -.cache-makwam.cache-makwam { +.cache-f9vv5z.cache-f9vv5z { vertical-align: middle; }
@@ -195,7 +195,7 @@ exports[`Avatar renders correctly with lock 1`] = ` exports[`Avatar renders correctly with sentence 1`] = ` - .cache-ua3jbc.cache-ua3jbc { + .cache-wta1f9.cache-wta1f9 { width: 32px; height: 32px; position: relative; @@ -223,7 +223,7 @@ exports[`Avatar renders correctly with sentence 1`] = ` }
- .cache-cywuei.cache-cywuei { + .cache-1rk64pa.cache-1rk64pa { width: 48px; height: 48px; position: relative; @@ -248,7 +248,7 @@ exports[`Avatar renders correctly with size 1`] = ` }
- .cache-ua3jbc.cache-ua3jbc { + .cache-wta1f9.cache-wta1f9 { width: 32px; height: 32px; position: relative; @@ -289,7 +289,7 @@ exports[`Avatar renders correctly with small text 1`] = ` }
- .cache-ua3jbc.cache-ua3jbc { + .cache-wta1f9.cache-wta1f9 { width: 32px; height: 32px; position: relative; @@ -330,7 +330,7 @@ exports[`Avatar renders correctly with text 1`] = ` }
- .cache-ua3jbc.cache-ua3jbc { + .cache-wta1f9.cache-wta1f9 { width: 32px; height: 32px; position: relative; @@ -371,7 +371,7 @@ exports[`Avatar renders correctly with text and custom style 1`] = ` }
- .cache-nt716f.cache-nt716f { + .cache-1si9epa.cache-1si9epa { width: 50px; height: 50px; position: relative; @@ -412,7 +412,7 @@ exports[`Avatar renders correctly with text size 1`] = ` }
- .cache-6k4vts { + .cache-3o8ugv { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -29,7 +29,7 @@ exports[`Badge renders correctly size medium 1`] = ` } Sample badge @@ -39,7 +39,7 @@ exports[`Badge renders correctly size medium 1`] = ` exports[`Badge renders correctly size rounded 1`] = ` - .cache-1p52ti6 { + .cache-1uhlju0 { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -68,7 +68,7 @@ exports[`Badge renders correctly size rounded 1`] = ` } Sample badge @@ -78,7 +78,7 @@ exports[`Badge renders correctly size rounded 1`] = ` exports[`Badge renders correctly size small 1`] = ` - .cache-1b12w1h { + .cache-h7rb7c { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -105,7 +105,7 @@ exports[`Badge renders correctly size small 1`] = ` } Sample badge @@ -115,7 +115,7 @@ exports[`Badge renders correctly size small 1`] = ` exports[`Badge renders correctly size xsmall 1`] = ` - .cache-1088rxj { + .cache-14pb4du { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -143,7 +143,7 @@ exports[`Badge renders correctly size xsmall 1`] = ` } Sample badge @@ -153,7 +153,7 @@ exports[`Badge renders correctly size xsmall 1`] = ` exports[`Badge renders correctly size xxsmall 1`] = ` - .cache-4plucs { + .cache-h68942 { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -182,7 +182,7 @@ exports[`Badge renders correctly size xxsmall 1`] = ` } Sample badge @@ -192,7 +192,7 @@ exports[`Badge renders correctly size xxsmall 1`] = ` exports[`Badge renders correctly variant beta 1`] = ` - .cache-iryab { + .cache-13qr8dy { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -220,7 +220,7 @@ exports[`Badge renders correctly variant beta 1`] = ` Sample badge @@ -230,7 +230,7 @@ exports[`Badge renders correctly variant beta 1`] = ` exports[`Badge renders correctly variant error 1`] = ` - .cache-vwe0t0 { + .cache-oh3v7x { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -258,7 +258,7 @@ exports[`Badge renders correctly variant error 1`] = ` Sample badge @@ -268,7 +268,7 @@ exports[`Badge renders correctly variant error 1`] = ` exports[`Badge renders correctly variant info 1`] = ` - .cache-p6eyow { + .cache-1setccw { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -296,7 +296,7 @@ exports[`Badge renders correctly variant info 1`] = ` Sample badge @@ -306,7 +306,7 @@ exports[`Badge renders correctly variant info 1`] = ` exports[`Badge renders correctly variant light-beta 1`] = ` - .cache-111cpk2 { + .cache-wlk06h { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -334,7 +334,7 @@ exports[`Badge renders correctly variant light-beta 1`] = ` Sample badge @@ -344,7 +344,7 @@ exports[`Badge renders correctly variant light-beta 1`] = ` exports[`Badge renders correctly variant light-error 1`] = ` - .cache-3t3a5b { + .cache-154mf9y { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -372,7 +372,7 @@ exports[`Badge renders correctly variant light-error 1`] = ` Sample badge @@ -382,7 +382,7 @@ exports[`Badge renders correctly variant light-error 1`] = ` exports[`Badge renders correctly variant light-info 1`] = ` - .cache-1vaeg9l { + .cache-1vzg6s6 { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -410,7 +410,7 @@ exports[`Badge renders correctly variant light-info 1`] = ` Sample badge @@ -420,7 +420,7 @@ exports[`Badge renders correctly variant light-info 1`] = ` exports[`Badge renders correctly variant light-neutral 1`] = ` - .cache-6k4vts { + .cache-3o8ugv { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -447,7 +447,7 @@ exports[`Badge renders correctly variant light-neutral 1`] = ` } Sample badge @@ -457,7 +457,7 @@ exports[`Badge renders correctly variant light-neutral 1`] = ` exports[`Badge renders correctly variant light-primary 1`] = ` - .cache-z1b64x { + .cache-oqy064 { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -484,7 +484,7 @@ exports[`Badge renders correctly variant light-primary 1`] = ` } Sample badge @@ -494,7 +494,7 @@ exports[`Badge renders correctly variant light-primary 1`] = ` exports[`Badge renders correctly variant light-success 1`] = ` - .cache-1j48uww { + .cache-1dibq65 { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -522,7 +522,7 @@ exports[`Badge renders correctly variant light-success 1`] = ` Sample badge @@ -532,7 +532,7 @@ exports[`Badge renders correctly variant light-success 1`] = ` exports[`Badge renders correctly variant neutral 1`] = ` - .cache-6k4vts { + .cache-3o8ugv { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -559,7 +559,7 @@ exports[`Badge renders correctly variant neutral 1`] = ` } Sample badge @@ -569,7 +569,7 @@ exports[`Badge renders correctly variant neutral 1`] = ` exports[`Badge renders correctly variant primary 1`] = ` - .cache-11f0np7 { + .cache-auqzur { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -596,7 +596,7 @@ exports[`Badge renders correctly variant primary 1`] = ` } Sample badge @@ -606,7 +606,7 @@ exports[`Badge renders correctly variant primary 1`] = ` exports[`Badge renders correctly variant success 1`] = ` - .cache-h3o1u5 { + .cache-1hatzbx { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -634,7 +634,7 @@ exports[`Badge renders correctly variant success 1`] = ` Sample badge @@ -644,7 +644,7 @@ exports[`Badge renders correctly variant success 1`] = ` exports[`Badge renders correctly variant warning 1`] = ` - .cache-vwe0t0 { + .cache-oh3v7x { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -672,7 +672,7 @@ exports[`Badge renders correctly variant warning 1`] = ` Sample badge @@ -682,7 +682,7 @@ exports[`Badge renders correctly variant warning 1`] = ` exports[`Badge renders correctly with default values 1`] = ` - .cache-6k4vts { + .cache-3o8ugv { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -709,7 +709,7 @@ exports[`Badge renders correctly with default values 1`] = ` } Sample badge diff --git a/src/components/BorderedBox/__stories__/index.stories.tsx b/src/components/BorderedBox/__stories__/index.stories.tsx new file mode 100644 index 0000000000..f80ceccefd --- /dev/null +++ b/src/components/BorderedBox/__stories__/index.stories.tsx @@ -0,0 +1,14 @@ +import { Meta, Story } from '@storybook/react' +import React, { ComponentProps } from 'react' +import BorderedBox from '..' + +export default { + component: BorderedBox, + title: 'Components/Container/BorderedBox', +} as Meta + +const Template: Story> = props => ( + Hello +) + +export const Default = Template.bind({}) diff --git a/src/components/BorderedBox/__tests__/__snapshots__/index.tsx.snap b/src/components/BorderedBox/__tests__/__snapshots__/index.tsx.snap new file mode 100644 index 0000000000..c9d77ee4ba --- /dev/null +++ b/src/components/BorderedBox/__tests__/__snapshots__/index.tsx.snap @@ -0,0 +1,31 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`BorderedBox renders correctly 1`] = ` + + .cache-1kl4lkx { + padding: 24px; + border-radius: 4px; + border: 1px solid #d4dae7; +} + +
+ +`; + +exports[`BorderedBox renders correctly with children 1`] = ` + + .cache-1kl4lkx { + padding: 24px; + border-radius: 4px; + border: 1px solid #d4dae7; +} + +
+ Hello World +
+
+`; diff --git a/src/components/BorderedBox/__tests__/index.tsx b/src/components/BorderedBox/__tests__/index.tsx new file mode 100644 index 0000000000..cb5849c2cb --- /dev/null +++ b/src/components/BorderedBox/__tests__/index.tsx @@ -0,0 +1,9 @@ +import React from 'react' +import BorderedBox from '..' +import { shouldMatchEmotionSnapshot } from '../../../helpers/jestHelpers' + +describe('BorderedBox', () => { + test('renders correctly', () => shouldMatchEmotionSnapshot()) + test('renders correctly with children', () => + shouldMatchEmotionSnapshot(Hello World)) +}) diff --git a/src/components/BorderedBox/index.tsx b/src/components/BorderedBox/index.tsx new file mode 100644 index 0000000000..53185b902f --- /dev/null +++ b/src/components/BorderedBox/index.tsx @@ -0,0 +1,9 @@ +import styled from '@emotion/styled' + +const BorderedBox = styled.div` + padding: ${({ theme }) => theme.space['3']}; + border-radius: ${({ theme }) => theme.radii.default}; + border: 1px solid ${({ theme }) => theme.colors.neutral.borderWeak}; +` + +export default BorderedBox diff --git a/src/components/Box/__stories__/index.stories.tsx b/src/components/Box/__stories__/index.stories.tsx index e2363e0889..45362fdd7f 100644 --- a/src/components/Box/__stories__/index.stories.tsx +++ b/src/components/Box/__stories__/index.stories.tsx @@ -24,15 +24,6 @@ Default.parameters = { }, } -export const Bordered = Template.bind({}) -Bordered.parameters = { - docs: { - storyDescription: - 'Using prop `bordered` you can add a border and some padding on a Box.', - }, -} -Bordered.decorators = [() => This is a bordered box] - export const OtherElement = Template.bind({}) OtherElement.parameters = { docs: { diff --git a/src/components/Box/__tests__/__snapshots__/index.tsx.snap b/src/components/Box/__tests__/__snapshots__/index.tsx.snap index 6f41a5a702..fd09d482ba 100644 --- a/src/components/Box/__tests__/__snapshots__/index.tsx.snap +++ b/src/components/Box/__tests__/__snapshots__/index.tsx.snap @@ -3,42 +3,14 @@ exports[`Box Box renders correctly 1`] = `
- -`; - -exports[`Box Box renders with as property 1`] = ` - - .cache-of7ya { - padding: 24px; - border-radius: 4px; - border: 1px solid #d4dae7; -} - -

- -`; - -exports[`Box Box renders with bordered 1`] = ` - - .cache-of7ya { - padding: 24px; - border-radius: 4px; - border: 1px solid #d4dae7; -} - -

`; exports[`Box Box renders with system 1`] = ` - .cache-sf4awt.cache-sf4awt { + .cache-8zzua6.cache-8zzua6 { height: 100px; margin-right: auto; margin-left: auto; @@ -46,7 +18,7 @@ exports[`Box Box renders with system 1`] = ` }
`; diff --git a/src/components/Box/__tests__/index.tsx b/src/components/Box/__tests__/index.tsx index 752db485e3..18e9f52eda 100644 --- a/src/components/Box/__tests__/index.tsx +++ b/src/components/Box/__tests__/index.tsx @@ -8,10 +8,4 @@ describe('Box', () => { // We don't support colors any more with new theme test('Box renders with system', () => shouldMatchEmotionSnapshot()) - - test('Box renders with bordered', () => - shouldMatchEmotionSnapshot()) - - test('Box renders with as property', () => - shouldMatchEmotionSnapshot()) }) diff --git a/src/components/Box/index.tsx b/src/components/Box/index.tsx index d34a529a75..f8a24d9eca 100644 --- a/src/components/Box/index.tsx +++ b/src/components/Box/index.tsx @@ -1,5 +1,4 @@ -import { Interpolation, Theme, css } from '@emotion/react' -import styled from '@emotion/styled' +import { Interpolation, Theme } from '@emotion/react' import { x } from '@xstyled/emotion' import PropTypes from 'prop-types' import React, { @@ -63,20 +62,7 @@ export interface XStyledProps { target?: string } -const borderedStyles = ({ theme }: { theme: Theme }) => css` - padding: ${theme.space['3']}; - border-radius: ${theme.radii.default}; - border: 1px solid ${theme.colorsDeprecated.gray350}; -` - -const StyledBox = styled(x.div, { - shouldForwardProp: prop => !['bordered'].includes(prop.toString()), -})<{ bordered?: boolean }>` - ${({ bordered }) => (bordered ? borderedStyles : null)} -` - export type BoxProps = { - bordered?: boolean children?: ReactNode height?: number | string width?: number | string @@ -98,9 +84,9 @@ type BoxType = typeof forwardType & { const Box: BoxType = forwardRef< Element | HTMLInputElement | HTMLButtonElement, BoxProps ->(({ width, height, bordered = false, ...props }, ref) => ( +>(({ width, height, ...props }, ref) => ( // @ts-expect-error As we won't know the Element kind we can't assume that Ref will be a Element - + )) Box.withComponent = @@ -109,7 +95,6 @@ Box.withComponent = Box.propTypes = { - bordered: PropTypes.bool, height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), } diff --git a/src/components/Boxer/__tests__/__snapshots__/index.tsx.snap b/src/components/Boxer/__tests__/__snapshots__/index.tsx.snap index 84b0553595..4f0f4c7eef 100644 --- a/src/components/Boxer/__tests__/__snapshots__/index.tsx.snap +++ b/src/components/Boxer/__tests__/__snapshots__/index.tsx.snap @@ -3,21 +3,21 @@ exports[`Boxer renders correctly with 3 childs 1`] = `

Header 1

Header 2

paragraph @@ -29,7 +29,7 @@ exports[`Boxer renders correctly with 3 childs 1`] = ` exports[`Boxer renders correctly with one child 1`] = `

Test diff --git a/src/components/Breadcrumbs/__tests__/__snapshots__/index.tsx.snap b/src/components/Breadcrumbs/__tests__/__snapshots__/index.tsx.snap index 90b36fc3c6..bff253dc8b 100644 --- a/src/components/Breadcrumbs/__tests__/__snapshots__/index.tsx.snap +++ b/src/components/Breadcrumbs/__tests__/__snapshots__/index.tsx.snap @@ -25,7 +25,7 @@ exports[`Breadcrumbs renders correctly with default values 1`] = ` margin: 0 8px; } -.cache-eeofzd { +.cache-1lh5mnm { cursor: pointer; -webkit-text-decoration: none; text-decoration: none; @@ -34,14 +34,14 @@ exports[`Breadcrumbs renders correctly with default values 1`] = ` color: #4f0599; } -.cache-eeofzd:hover, -.cache-eeofzd:focus { +.cache-1lh5mnm:hover, +.cache-1lh5mnm:focus { -webkit-text-decoration: underline; text-decoration: underline; } -.cache-eeofzd:hover, -.cache-eeofzd:focus { +.cache-1lh5mnm:hover, +.cache-1lh5mnm:focus { color: #4f0599; } @@ -56,7 +56,7 @@ exports[`Breadcrumbs renders correctly with default values 1`] = ` class="cache-r8ul2r e1081fv10" > Step 1 @@ -67,7 +67,7 @@ exports[`Breadcrumbs renders correctly with default values 1`] = ` class="cache-r8ul2r e1081fv10" > I'm a very long... long long step @@ -198,7 +198,7 @@ exports[`Breadcrumbs renders correctly with variant bubble 1`] = ` z-index: 1; } -.cache-eeofzd { +.cache-1lh5mnm { cursor: pointer; -webkit-text-decoration: none; text-decoration: none; @@ -207,14 +207,14 @@ exports[`Breadcrumbs renders correctly with variant bubble 1`] = ` color: #4f0599; } -.cache-eeofzd:hover, -.cache-eeofzd:focus { +.cache-1lh5mnm:hover, +.cache-1lh5mnm:focus { -webkit-text-decoration: underline; text-decoration: underline; } -.cache-eeofzd:hover, -.cache-eeofzd:focus { +.cache-1lh5mnm:hover, +.cache-1lh5mnm:focus { color: #4f0599; } @@ -229,7 +229,7 @@ exports[`Breadcrumbs renders correctly with variant bubble 1`] = ` class="cache-1kf1fc8 e1081fv11" > Step 1 @@ -240,7 +240,7 @@ exports[`Breadcrumbs renders correctly with variant bubble 1`] = ` class="cache-1kf1fc8 e1081fv11" > I'm a very long... long long step diff --git a/src/components/Button/__tests__/__snapshots__/index.tsx.snap b/src/components/Button/__tests__/__snapshots__/index.tsx.snap index d40d5a4be1..b8e4d34f25 100644 --- a/src/components/Button/__tests__/__snapshots__/index.tsx.snap +++ b/src/components/Button/__tests__/__snapshots__/index.tsx.snap @@ -18,7 +18,7 @@ exports[`Button should render correctly loading 1`] = ` } } -.cache-zoo79t { +.cache-11u2pbz { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -55,19 +55,19 @@ exports[`Button should render correctly loading 1`] = ` padding: 8px 16px; } -.cache-zoo79t:hover, -.cache-zoo79t:focus { +.cache-11u2pbz:hover, +.cache-11u2pbz:focus { -webkit-text-decoration: none; text-decoration: none; } -.cache-zoo79t:hover, -.cache-zoo79t:focus { +.cache-11u2pbz:hover, +.cache-11u2pbz:focus { color: #fff; background-color: #420480; } -.cache-zoo79t:focus { +.cache-11u2pbz:focus { box-shadow: 0 0 0 2px rgba(79,5,153,0.25); } @@ -108,7 +108,7 @@ exports[`Button should render correctly loading 1`] = `