@react-ui-org/react-ui 0.49.0 → 0.50.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib.development.js +16 -16
- package/dist/lib.js +1 -1
- package/package.json +1 -1
- package/src/lib/components/Button/_tools.scss +0 -4
- package/src/lib/components/FileInputField/FileInputField.jsx +0 -1
- package/src/lib/components/FileInputField/FileInputField.scss +0 -4
- package/src/lib/components/Modal/Modal.jsx +1 -1
- package/src/lib/components/Modal/README.mdx +7 -6
- package/src/lib/foundation.scss +1 -0
- package/src/lib/styles/generic/_focus.scss +11 -0
- package/src/lib/styles/generic/_forms.scss +0 -8
- package/src/lib/styles/theme/_accessibility.scss +2 -0
- package/src/lib/styles/theme/_form-fields.scss +1 -0
- package/src/lib/styles/tools/_accessibility.scss +2 -0
- package/src/lib/styles/tools/_reset.scss +0 -1
- package/src/lib/styles/tools/form-fields/_foundation.scss +2 -0
- package/src/lib/theme.scss +4 -1
package/package.json
CHANGED
@@ -110,7 +110,7 @@ export const Modal = ({
|
|
110
110
|
const childrenWrapperElement = childrenWrapperRef.current;
|
111
111
|
const childrenElements = childrenWrapperElement.querySelectorAll('*');
|
112
112
|
const formFieldEl = Array.from(childrenElements).find(
|
113
|
-
(element) => ['INPUT', 'TEXTAREA', 'SELECT'].includes(element.nodeName),
|
113
|
+
(element) => ['INPUT', 'TEXTAREA', 'SELECT'].includes(element.nodeName) && !element.disabled,
|
114
114
|
);
|
115
115
|
|
116
116
|
if (formFieldEl) {
|
@@ -115,10 +115,10 @@ See [API](#api) for all available options.
|
|
115
115
|
- **Modal actions** should correspond to the modal purpose, too. E.g. “Delete”
|
116
116
|
tells better what happens rather than “OK”.
|
117
117
|
|
118
|
-
- Modal **automatically focuses the first form field** by default
|
119
|
-
users to confirm the modal by hitting the enter key. When no
|
120
|
-
then the primary button (in the footer) is focused. To turn
|
121
|
-
set the `autofocus` prop to `false`.
|
118
|
+
- Modal **automatically focuses the first non-disabled form field** by default
|
119
|
+
which allows users to confirm the modal by hitting the enter key. When no
|
120
|
+
field is found then the primary button (in the footer) is focused. To turn
|
121
|
+
this feature off, set the `autofocus` prop to `false`.
|
122
122
|
|
123
123
|
- **Avoid stacking** of modals. While it may technically work, the modal is just
|
124
124
|
not designed for that.
|
@@ -841,8 +841,9 @@ Autofocus is implemented to enhance the user experience by automatically
|
|
841
841
|
focussing an element within the modal.
|
842
842
|
|
843
843
|
How does it work? It tries to find `input`, `textarea`, and `select` elements
|
844
|
-
inside of Modal and moves focus
|
845
|
-
`primaryButtonRef` prop on Modal is set, then the primary button
|
844
|
+
inside of Modal and moves focus onto the first non-disabled one. If none is
|
845
|
+
found and the `primaryButtonRef` prop on Modal is set, then the primary button
|
846
|
+
is focused.
|
846
847
|
|
847
848
|
Autofocus is enabled by default, so if you want to control the focus of
|
848
849
|
elements manually, set the `autoFocus` prop on Modal to `false`.
|
package/src/lib/foundation.scss
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
@use "../tools/accessibility";
|
2
|
+
|
3
|
+
// Remove focus outline as we implement custom appearance of focus state. Increase specificity where necessary to
|
4
|
+
// override normalize.css.
|
5
|
+
:where(button, input, select, textarea):focus {
|
6
|
+
outline: none;
|
7
|
+
}
|
8
|
+
|
9
|
+
:is(a, button, input, select, textarea, [type="button"], [type="submit"]) {
|
10
|
+
@include accessibility.focus-ring();
|
11
|
+
}
|
@@ -1,11 +1,3 @@
|
|
1
|
-
// Remove focus outline as we implement custom appearance of focus state.
|
2
|
-
button:focus,
|
3
|
-
input:focus,
|
4
|
-
select:focus,
|
5
|
-
textarea:focus {
|
6
|
-
outline: 0;
|
7
|
-
}
|
8
|
-
|
9
1
|
// Reset Chrome and Firefox behaviour which sets a `min-width: min-content;` on fieldsets.
|
10
2
|
fieldset {
|
11
3
|
min-width: 0;
|
@@ -13,6 +13,7 @@ $label-font-size: var(--rui-FormField__label__font-size);
|
|
13
13
|
$help-text-font-size: var(--rui-FormField__help-text__font-size);
|
14
14
|
$help-text-font-style: var(--rui-FormField__help-text__font-style);
|
15
15
|
$help-text-color: var(--rui-FormField__help-text__color);
|
16
|
+
$required-label-color: var(--rui-FormField--required__label__color);
|
16
17
|
$required-sign: var(--rui-FormField--required__sign);
|
17
18
|
$required-sign-color: var(--rui-FormField--required__sign__color);
|
18
19
|
|
package/src/lib/theme.scss
CHANGED
@@ -149,7 +149,9 @@
|
|
149
149
|
|
150
150
|
// Accessibility
|
151
151
|
--rui-tap-target-size: 10mm;
|
152
|
-
--rui-focus-
|
152
|
+
--rui-focus-outline: 0.2em solid var(--rui-color-active-focus);
|
153
|
+
--rui-focus-outline-offset: 1px;
|
154
|
+
--rui-focus-box-shadow: none;
|
153
155
|
|
154
156
|
// Bottom spacings
|
155
157
|
--rui-spacing-bottom-default: var(--rui-spacing-5);
|
@@ -738,6 +740,7 @@
|
|
738
740
|
--rui-FormField__help-text__font-size: var(--rui-typography-size-small);
|
739
741
|
--rui-FormField__help-text__font-style: normal;
|
740
742
|
--rui-FormField__help-text__color: var(--rui-color-gray-500);
|
743
|
+
--rui-FormField--required__label__color: inherit;
|
741
744
|
--rui-FormField--required__sign: "\00a0*"; // 2.
|
742
745
|
--rui-FormField--required__sign__color: var(--rui-color-gray-500);
|
743
746
|
|