From 6ed876a3aeec4ffc4afdaf8de92fce143032b881 Mon Sep 17 00:00:00 2001 From: Adam Kudrna Date: Sat, 30 May 2020 22:51:41 +0200 Subject: [PATCH] Create `FormLayout` component and make form fields ready for it (#44) --- src/demo/pages/DemoContainer.jsx | 185 ++++++++++++++++++ src/demo/pages/navigation.js | 4 + .../components/layout/CardList/CardList.scss | 3 +- .../layout/FormLayout/FormLayout.jsx | 58 ++++++ .../layout/FormLayout/FormLayout.scss | 22 +++ src/lib/components/layout/FormLayout/index.js | 1 + src/lib/components/layout/List/List.scss | 3 +- src/lib/components/layout/Media/Media.scss | 3 +- src/lib/components/layout/Row/Row.scss | 3 +- .../ForgotPassword.test.jsx.snap | 6 + .../__snapshots__/Login.test.jsx.snap | 16 ++ .../__snapshots__/NewPassword.test.jsx.snap | 12 ++ .../ui/CheckboxField/CheckboxField.jsx | 20 +- .../ui/CheckboxField/CheckboxField.scss | 8 + .../tests/CheckboxField.test.jsx | 2 + .../__snapshots__/CheckboxField.test.jsx.snap | 2 + .../MultipleSelectField.jsx | 10 +- .../MultipleSelectField.scss | 4 + .../tests/MultipleSelectField.test.jsx | 1 + .../MultipleSelectField.test.jsx.snap | 5 + src/lib/components/ui/Radio/Radio.jsx | 20 +- src/lib/components/ui/Radio/Radio.scss | 8 + .../components/ui/Radio/tests/Radio.test.jsx | 2 + .../tests/__snapshots__/Radio.test.jsx.snap | 2 + .../components/ui/SelectField/SelectField.jsx | 10 +- .../ui/SelectField/SelectField.scss | 4 + .../ui/SelectField/tests/SelectField.test.jsx | 1 + .../__snapshots__/SelectField.test.jsx.snap | 3 + src/lib/components/ui/TextArea/TextArea.jsx | 10 +- src/lib/components/ui/TextArea/TextArea.scss | 4 + .../ui/TextArea/tests/TextArea.test.jsx | 1 + .../__snapshots__/TextArea.test.jsx.snap | 3 + src/lib/components/ui/TextField/TextField.jsx | 10 +- .../components/ui/TextField/TextField.scss | 4 + .../ui/TextField/__tests__/TextField.test.jsx | 1 + .../__snapshots__/TextField.test.jsx.snap | 3 + src/lib/components/ui/Toggle/Toggle.jsx | 20 +- src/lib/components/ui/Toggle/Toggle.scss | 8 + .../ui/Toggle/tests/Toggle.test.jsx | 2 + .../tests/__snapshots__/Toggle.test.jsx.snap | 2 + src/lib/index.js | 1 + src/lib/styles/settings/_forms-theme.scss | 3 + src/lib/styles/settings/_layouts.scss | 3 + src/lib/styles/tools/_forms.deprecated.scss | 20 ++ src/lib/styles/tools/forms/_layouts.scss | 42 ++++ src/lib/theme.scss | 7 + webpack.config.lib.js | 2 +- 47 files changed, 549 insertions(+), 15 deletions(-) create mode 100644 src/lib/components/layout/FormLayout/FormLayout.jsx create mode 100644 src/lib/components/layout/FormLayout/FormLayout.scss create mode 100644 src/lib/components/layout/FormLayout/index.js create mode 100644 src/lib/styles/settings/_layouts.scss diff --git a/src/demo/pages/DemoContainer.jsx b/src/demo/pages/DemoContainer.jsx index d8a5a0a4..cda1c97e 100644 --- a/src/demo/pages/DemoContainer.jsx +++ b/src/demo/pages/DemoContainer.jsx @@ -21,6 +21,7 @@ import { CTAStart, CheckboxField, ForgotPassword, + FormLayout, LayoutCenter, List, ListItem, @@ -344,6 +345,190 @@ class DemoContainer extends React.Component { )} /> +

Form Layout

+

+ Vertical Form Layout works similar to List except that List Items are not needed. + Vertical form field layout is forced. +

+ + <> + + + + + <> + + + + + + + +