diff --git a/demo/client/components/richText/elements/Button/Button/index.scss b/demo/client/components/richText/elements/Button/Button/index.scss
index 75d7917cc0..f1b6402d32 100644
--- a/demo/client/components/richText/elements/Button/Button/index.scss
+++ b/demo/client/components/richText/elements/Button/Button/index.scss
@@ -17,10 +17,11 @@
&__header {
width: 100%;
+ margin-bottom: $baseline;
display: flex;
justify-content: space-between;
- h4 {
+ h3 {
margin: 0;
}
diff --git a/src/client/components/elements/Button/index.js b/src/client/components/elements/Button/index.js
index d659a23a44..021ae3770e 100644
--- a/src/client/components/elements/Button/index.js
+++ b/src/client/components/elements/Button/index.js
@@ -79,7 +79,7 @@ const Button = (props) => {
function handleClick(event) {
if (type !== 'submit' && onClick) event.preventDefault();
- if (onClick) onClick();
+ if (onClick) onClick(event);
}
const buttonProps = {
diff --git a/src/client/components/elements/Button/index.scss b/src/client/components/elements/Button/index.scss
index e9f8525043..afaa090d90 100644
--- a/src/client/components/elements/Button/index.scss
+++ b/src/client/components/elements/Button/index.scss
@@ -92,6 +92,15 @@
&--style-none {
padding: 0;
margin: 0;
+ border-radius: 0;
+
+ &:focus {
+ opacity: .8;
+ }
+
+ &:active {
+ opacity: .7;
+ }
}
&--round {
@@ -155,6 +164,8 @@
@include color-svg($color-dark-gray);
background: $color-light-gray;
}
+
+ outline: none;
}
&:active {
diff --git a/src/client/components/elements/Nav/index.scss b/src/client/components/elements/Nav/index.scss
index 40d78604d6..a2fa174fc0 100644
--- a/src/client/components/elements/Nav/index.scss
+++ b/src/client/components/elements/Nav/index.scss
@@ -82,6 +82,15 @@
padding: base(.125) 0;
display: flex;
text-decoration: none;
+
+ &:focus {
+ box-shadow: none;
+ font-weight: 600;
+ }
+
+ &:active {
+ font-weight: normal;
+ }
}
nav {
diff --git a/src/client/components/elements/Popup/index.js b/src/client/components/elements/Popup/index.js
index 554820a3a0..0fa432b791 100644
--- a/src/client/components/elements/Popup/index.js
+++ b/src/client/components/elements/Popup/index.js
@@ -12,12 +12,12 @@ const baseClass = 'popup';
const Popup = (props) => {
const {
- render, align, size, color, button, buttonType, children, showOnHover, horizontalAlign,
+ render, align, size, color, button, buttonType, children, showOnHover, horizontalAlign, initActive,
} = props;
const buttonRef = useRef(null);
const contentRef = useRef(null);
- const [active, setActive] = useState(false);
+ const [active, setActive] = useState(initActive);
const [verticalAlign, setVerticalAlign] = useState('top');
const [forceHorizontalAlign, setForceHorizontalAlign] = useState(null);
@@ -143,6 +143,7 @@ Popup.defaultProps = {
button: undefined,
showOnHover: false,
horizontalAlign: 'left',
+ initActive: false,
};
Popup.propTypes = {
@@ -155,6 +156,7 @@ Popup.propTypes = {
buttonType: PropTypes.oneOf(['default', 'custom']),
button: PropTypes.node,
showOnHover: PropTypes.bool,
+ initActive: PropTypes.bool,
};
export default Popup;
diff --git a/src/client/components/elements/Popup/index.scss b/src/client/components/elements/Popup/index.scss
index 33997a9dab..21c791294b 100644
--- a/src/client/components/elements/Popup/index.scss
+++ b/src/client/components/elements/Popup/index.scss
@@ -25,7 +25,8 @@
}
&__scroll {
- padding: base(1);
+ padding: $baseline;
+ padding-right: calc(var(--scrollbar-width) + #{$baseline});
overflow-y: auto;
width: calc(100% + var(--scrollbar-width));
white-space: nowrap;
diff --git a/src/client/components/forms/Error/index.js b/src/client/components/forms/Error/index.js
index b770189686..44ff492fd2 100644
--- a/src/client/components/forms/Error/index.js
+++ b/src/client/components/forms/Error/index.js
@@ -2,6 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import Tooltip from '../../elements/Tooltip';
+import './index.scss';
+
const Error = (props) => {
const { showError, message } = props;
diff --git a/src/client/components/forms/Error/index.scss b/src/client/components/forms/Error/index.scss
index b21c850377..5c7ba8172a 100644
--- a/src/client/components/forms/Error/index.scss
+++ b/src/client/components/forms/Error/index.scss
@@ -1,14 +1,13 @@
@import '../../../scss/styles';
-.field-error {
- .tooltip {
- left: auto;
- right: base(.5);
- transform: none;
- background-color: $error;
+.error-message {
+ left: auto;
+ right: base(.5);
+ transform: none;
+ background-color: $color-red;
- span {
- border-top-color: $error;
- }
+ span {
+ border-top-color: $color-red;
}
}
+
diff --git a/src/client/components/forms/field-types/RichText/RichText.js b/src/client/components/forms/field-types/RichText/RichText.js
index 061e3afec7..4fb92e7671 100644
--- a/src/client/components/forms/field-types/RichText/RichText.js
+++ b/src/client/components/forms/field-types/RichText/RichText.js
@@ -14,15 +14,12 @@ import elementTypes from './elements';
import toggleLeaf from './leaves/toggle';
import hotkeys from './hotkeys';
import enablePlugins from './enablePlugins';
+import defaultValue from '../../../../../fields/richText/defaultValue';
import mergeCustomFunctions from './mergeCustomFunctions';
import './index.scss';
-const defaultValue = [{
- children: [{ text: '' }],
-}];
-
const defaultElements = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'link'];
const defaultLeaves = ['bold', 'italic', 'underline', 'strikethrough', 'code'];
diff --git a/src/client/components/forms/field-types/RichText/elements/link/index.js b/src/client/components/forms/field-types/RichText/elements/link/index.js
index dffbe7e0aa..95d13c9b4b 100644
--- a/src/client/components/forms/field-types/RichText/elements/link/index.js
+++ b/src/client/components/forms/field-types/RichText/elements/link/index.js
@@ -1,4 +1,4 @@
-import React, { useEffect, useRef, useState } from 'react';
+import React, { Fragment, useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import { ReactEditor, useSlate } from 'slate-react';
import { Transforms } from 'slate';
@@ -8,8 +8,8 @@ import LinkIcon from '../../../../../icons/Link';
import Portal from '../../../../../utilities/Portal';
import Popup from '../../../../../elements/Popup';
import Button from '../../../../../elements/Button';
-import Chevron from '../../../../../icons/Chevron';
import Check from '../../../../../icons/Check';
+import Error from '../../../../Error';
import './index.scss';
@@ -20,6 +20,7 @@ const Link = ({ attributes, children, element }) => {
const linkRef = useRef();
const [left, setLeft] = useState(0);
const [top, setTop] = useState(0);
+ const [error, setError] = useState(false);
const [width, setWidth] = useState(0);
const [height, setHeight] = useState(0);
const [url, setURL] = useState(element.url);
@@ -62,32 +63,67 @@ const Link = ({ attributes, children, element }) => {
}}
>