From 4dbd9e028bf748f4eff7ac353b1d6c2bb2a44055 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 17 May 2021 14:29:13 +0100 Subject: [PATCH] Revert "components: Promote VisuallyHidden from ui into full components (#31244)" (#31882) This reverts commit fda8d09c0d34fd863c8b20459bf9a1be2638dd9a. --- .../test/__snapshots__/index.js.snap | 2 +- .../test/__snapshots__/index.js.snap | 74 +++++-------------- packages/components/src/style.scss | 1 + .../src/ui/form-group/form-group-label.js | 2 +- packages/components/src/ui/index.js | 1 + .../src/ui/visually-hidden/README.md | 17 +++++ .../src/{ => ui}/visually-hidden/component.js | 6 +- .../src/{ => ui}/visually-hidden/hook.js | 7 +- .../src/ui/visually-hidden/index.js | 2 + .../src/ui/visually-hidden/stories/index.js | 42 +++++++++++ .../src/{ => ui}/visually-hidden/styles.js | 3 +- .../test/__snapshots__/index.js.snap | 2 +- .../{ => ui}/visually-hidden/test/index.js | 2 +- .../components/src/visually-hidden/README.md | 14 +--- .../components/src/visually-hidden/index.js | 48 +++++++++++- .../components/src/visually-hidden/next.js | 31 ++++++++ .../src/visually-hidden/stories/index.js | 2 +- .../components/src/visually-hidden/style.scss | 30 ++++++++ .../components/src/visually-hidden/utils.js | 31 ++++++++ .../test/__snapshots__/index.js.snap | 8 +- 20 files changed, 241 insertions(+), 84 deletions(-) create mode 100644 packages/components/src/ui/visually-hidden/README.md rename packages/components/src/{ => ui}/visually-hidden/component.js (76%) rename packages/components/src/{ => ui}/visually-hidden/hook.js (54%) create mode 100644 packages/components/src/ui/visually-hidden/index.js create mode 100644 packages/components/src/ui/visually-hidden/stories/index.js rename packages/components/src/{ => ui}/visually-hidden/styles.js (92%) rename packages/components/src/{ => ui}/visually-hidden/test/__snapshots__/index.js.snap (89%) rename packages/components/src/{ => ui}/visually-hidden/test/index.js (92%) create mode 100644 packages/components/src/visually-hidden/next.js create mode 100644 packages/components/src/visually-hidden/style.scss create mode 100644 packages/components/src/visually-hidden/utils.js diff --git a/packages/block-editor/src/components/link-control/test/__snapshots__/index.js.snap b/packages/block-editor/src/components/link-control/test/__snapshots__/index.js.snap index 25950cca507de7..dd0bc6f80877ce 100644 --- a/packages/block-editor/src/components/link-control/test/__snapshots__/index.js.snap +++ b/packages/block-editor/src/components/link-control/test/__snapshots__/index.js.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Basic rendering should render 1`] = `""`; +exports[`Basic rendering should render 1`] = `""`; diff --git a/packages/components/src/color-picker/test/__snapshots__/index.js.snap b/packages/components/src/color-picker/test/__snapshots__/index.js.snap index 0f3cc97a39aca3..98a90fc9593486 100644 --- a/packages/components/src/color-picker/test/__snapshots__/index.js.snap +++ b/packages/components/src/color-picker/test/__snapshots__/index.js.snap @@ -39,7 +39,7 @@ Snapshot Diff: type="button" />
@@ -86,7 +86,7 @@ Snapshot Diff: tabIndex="0" />

@@ -161,7 +161,7 @@ Snapshot Diff: type="button" />

@@ -208,7 +208,7 @@ Snapshot Diff: tabIndex="0" />

@@ -283,7 +283,7 @@ Snapshot Diff: type="button" />

@@ -330,7 +330,7 @@ Snapshot Diff: tabIndex="0" />

@@ -405,7 +405,7 @@ Snapshot Diff: type="button" />

@@ -452,7 +452,7 @@ Snapshot Diff: tabIndex="0" />

@@ -511,7 +511,7 @@ Snapshot Diff: type="button" />

@@ -537,7 +537,7 @@ Snapshot Diff: tabIndex="0" />

@@ -574,56 +574,20 @@ Snapshot Diff: `; exports[`ColorPicker should render color picker 1`] = ` -.emotion-0 { - border: 0; - -webkit-clip: rect( 1px,1px,1px,1px ); - clip: rect( 1px,1px,1px,1px ); - -webkit-clip-path: inset( 50% ); - -webkit-clip-path: inset( 50% ); - clip-path: inset( 50% ); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; - word-wrap: normal !important; -} - -.emotion-0:focus { - background-color: #edeff0; - -webkit-clip: auto !important; - clip: auto !important; - -webkit-clip-path: none; - clip-path: none; - color: #444; - display: block; - font-size: 1em; - height: auto; - left: 5px; - line-height: normal; - padding: 15px 23px 14px; - -webkit-text-decoration: none; - text-decoration: none; - top: 5px; - width: auto; - z-index: 100000; -} - -.emotion-10 { +.emotion-4 { font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif; font-size: 13px; } -.emotion-8 { +.emotion-2 { margin-bottom: 8px; } -.components-panel__row .emotion-8 { +.components-panel__row .emotion-2 { margin-bottom: inherit; } -.emotion-6 { +.emotion-0 { display: inline-block; margin-bottom: 8px; } @@ -667,7 +631,7 @@ exports[`ColorPicker should render color picker 1`] = ` type="button" />

Use your arrow keys to change the base color. Move up to lighten the color, down to darken, left to decrease saturation, and right to increase saturation. @@ -727,7 +691,7 @@ exports[`ColorPicker should render color picker 1`] = ` tabIndex="0" />

Move the arrow left or right to change hue. @@ -744,13 +708,13 @@ exports[`ColorPicker should render color picker 1`] = ` className="components-color-picker__inputs-fields" >