@react-ui-org/react-ui 0.58.0 → 0.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -11
- package/dist/react-ui.css +17 -17
- package/dist/react-ui.development.css +1230 -1053
- package/dist/react-ui.development.js +126 -66
- package/dist/react-ui.js +1 -1
- package/package.json +5 -5
- package/src/components/Alert/Alert.jsx +4 -4
- package/src/components/Alert/README.md +1 -27
- package/src/components/Alert/_settings.scss +1 -2
- package/src/components/Badge/Badge.jsx +2 -2
- package/src/components/Button/Button.jsx +2 -2
- package/src/components/ButtonGroup/ButtonGroup.jsx +2 -2
- package/src/components/Card/Card.jsx +6 -6
- package/src/components/Card/Card.module.scss +2 -2
- package/src/components/Card/CardBody.jsx +1 -1
- package/src/components/Card/CardFooter.jsx +1 -1
- package/src/components/Card/README.md +12 -30
- package/src/components/Card/_settings.scss +1 -2
- package/src/components/Card/_theme.scss +2 -0
- package/src/components/CheckboxField/CheckboxField.jsx +2 -2
- package/src/components/FileInputField/FileInputField.jsx +147 -21
- package/src/components/FileInputField/FileInputField.module.scss +87 -1
- package/src/components/FileInputField/README.md +83 -2
- package/src/components/FileInputField/_settings.scss +15 -0
- package/src/components/FormLayout/FormLayout.jsx +2 -2
- package/src/components/FormLayout/FormLayoutCustomField.jsx +2 -2
- package/src/components/FormLayout/README.md +8 -6
- package/src/components/Grid/Grid.jsx +1 -1
- package/src/components/Grid/Grid.module.scss +2 -2
- package/src/components/Grid/GridSpan.jsx +1 -1
- package/src/components/InputGroup/InputGroup.jsx +2 -2
- package/src/components/InputGroup/InputGroup.module.scss +3 -3
- package/src/components/InputGroup/README.md +1 -1
- package/src/components/Modal/Modal.jsx +117 -45
- package/src/components/Modal/Modal.module.scss +34 -18
- package/src/components/Modal/ModalBody.jsx +2 -2
- package/src/components/Modal/ModalBody.module.scss +18 -0
- package/src/components/Modal/ModalCloseButton.jsx +1 -1
- package/src/components/Modal/ModalContent.jsx +1 -1
- package/src/components/Modal/ModalFooter.jsx +2 -2
- package/src/components/Modal/ModalFooter.module.scss +6 -2
- package/src/components/Modal/ModalHeader.jsx +2 -2
- package/src/components/Modal/ModalHeader.module.scss +8 -1
- package/src/components/Modal/ModalTitle.jsx +1 -1
- package/src/components/Modal/README.md +391 -171
- package/src/components/Modal/_animations.scss +9 -0
- package/src/components/Modal/_helpers/dialogOnCancelHandler.js +28 -0
- package/src/components/Modal/_helpers/dialogOnClickHandler.js +46 -0
- package/src/components/Modal/_helpers/dialogOnCloseHandler.js +28 -0
- package/src/components/Modal/_helpers/dialogOnKeyDownHandler.js +62 -0
- package/src/components/Modal/_helpers/getPositionClassName.js +1 -1
- package/src/components/Modal/_hooks/useModalFocus.js +24 -91
- package/src/components/Modal/_settings.scss +4 -3
- package/src/components/Modal/_theme.scss +1 -0
- package/src/components/Paper/Paper.jsx +2 -2
- package/src/components/Popover/Popover.jsx +2 -2
- package/src/components/Popover/PopoverWrapper.jsx +1 -1
- package/src/components/Radio/Radio.jsx +2 -2
- package/src/components/ScrollView/ScrollView.jsx +2 -2
- package/src/components/SelectField/SelectField.jsx +2 -2
- package/src/components/Table/Table.jsx +1 -1
- package/src/components/Tabs/Tabs.jsx +1 -1
- package/src/components/Tabs/TabsItem.jsx +2 -2
- package/src/components/Text/Text.jsx +2 -2
- package/src/components/TextArea/TextArea.jsx +2 -2
- package/src/components/TextField/TextField.jsx +2 -2
- package/src/components/TextLink/TextLink.jsx +1 -1
- package/src/components/Toggle/Toggle.jsx +2 -2
- package/src/components/Toolbar/Toolbar.jsx +2 -2
- package/src/components/Toolbar/ToolbarGroup.jsx +2 -2
- package/src/components/Toolbar/ToolbarItem.jsx +2 -2
- package/src/helpers/classNames/README.md +65 -0
- package/src/helpers/classNames/classNames.js +11 -0
- package/src/helpers/classNames/index.js +1 -0
- package/src/helpers/transferProps/README.md +46 -0
- package/src/helpers/transferProps/index.js +1 -0
- package/src/index.js +3 -3
- package/src/styles/elements/_links.scss +2 -14
- package/src/styles/generic/_focus.scss +1 -1
- package/src/styles/theme/_form-fields.scss +5 -5
- package/src/styles/tools/_accessibility.scss +3 -5
- package/src/styles/tools/_collections.scss +3 -20
- package/src/styles/tools/_links.scss +17 -0
- package/src/styles/tools/form-fields/_box-field-elements.scss +21 -9
- package/src/styles/tools/form-fields/_box-field-layout.scss +2 -2
- package/src/styles/tools/form-fields/_box-field-sizes.scss +6 -10
- package/src/styles/tools/form-fields/_variants.scss +10 -10
- package/src/theme.scss +53 -3
- package/src/translations/en.js +5 -0
- package/src/styles/settings/_z-indexes.scss +0 -2
- package/src/utils/classNames.js +0 -8
- /package/src/{utils → helpers/transferProps}/transferProps.js +0 -0
@@ -1,9 +1,16 @@
|
|
1
|
+
// 1. Modal uses <dialog> element that uses the browser's built-in dialog functionality, so that:
|
2
|
+
// * visibility of the .root element and its backdrop is managed by the browser
|
3
|
+
// * positioning of the .root element and its backdrop is managed by the browser
|
4
|
+
// * z-index of the .root element and its backdrop is not needed as dialog is rendered in browser's Top layer
|
5
|
+
|
1
6
|
@use "sass:map";
|
2
7
|
@use "../../styles/theme/typography";
|
3
8
|
@use "../../styles/tools/accessibility";
|
4
9
|
@use "../../styles/tools/breakpoint";
|
10
|
+
@use "../../styles/tools/collections";
|
5
11
|
@use "../../styles/tools/reset";
|
6
12
|
@use "../../styles/tools/spacing";
|
13
|
+
@use "animations";
|
7
14
|
@use "settings";
|
8
15
|
@use "theme";
|
9
16
|
|
@@ -13,18 +20,16 @@
|
|
13
20
|
--rui-local-max-width: calc(100% - (2 * var(--rui-local-outer-spacing)));
|
14
21
|
--rui-local-max-height: calc(100% - (2 * var(--rui-local-outer-spacing)));
|
15
22
|
|
16
|
-
position: fixed;
|
17
|
-
left: 50%;
|
18
|
-
z-index: settings.$z-index;
|
19
|
-
display: flex;
|
20
23
|
flex-direction: column;
|
21
24
|
max-width: var(--rui-local-max-width);
|
22
25
|
max-height: var(--rui-local-max-height);
|
26
|
+
padding: 0;
|
23
27
|
overflow-y: auto;
|
28
|
+
color: inherit;
|
29
|
+
border-width: 0;
|
24
30
|
border-radius: settings.$border-radius;
|
25
31
|
background: theme.$background;
|
26
32
|
box-shadow: theme.$box-shadow;
|
27
|
-
transform: translateX(-50%);
|
28
33
|
overscroll-behavior: contain;
|
29
34
|
|
30
35
|
@include breakpoint.up(sm) {
|
@@ -32,14 +37,20 @@
|
|
32
37
|
}
|
33
38
|
}
|
34
39
|
|
35
|
-
.
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
40
|
+
.root[open] {
|
41
|
+
display: flex;
|
42
|
+
|
43
|
+
@media (prefers-reduced-motion: no-preference) {
|
44
|
+
animation: fade-in theme.$animation-duration ease-out;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
.root[open]::backdrop {
|
42
49
|
background: theme.$backdrop-background;
|
50
|
+
|
51
|
+
@media (prefers-reduced-motion: no-preference) {
|
52
|
+
animation: inherit;
|
53
|
+
}
|
43
54
|
}
|
44
55
|
|
45
56
|
.isRootSizeSmall {
|
@@ -64,17 +75,22 @@
|
|
64
75
|
}
|
65
76
|
|
66
77
|
.isRootSizeAuto {
|
67
|
-
width: auto;
|
68
78
|
min-width: min(var(--rui-local-max-width), #{map.get(theme.$sizes, auto, min-width)});
|
69
79
|
max-width: min(var(--rui-local-max-width), #{map.get(theme.$sizes, auto, max-width)});
|
70
80
|
}
|
71
81
|
|
72
|
-
.isRootPositionCenter {
|
73
|
-
top: 50%;
|
74
|
-
transform: translate(-50%, -50%);
|
75
|
-
}
|
76
|
-
|
77
82
|
.isRootPositionTop {
|
78
83
|
top: var(--rui-local-outer-spacing);
|
84
|
+
bottom: auto;
|
85
|
+
}
|
86
|
+
|
87
|
+
@each $color in settings.$colors {
|
88
|
+
@include collections.generate-class(
|
89
|
+
$prefix: "rui-",
|
90
|
+
$component-name: "Modal",
|
91
|
+
$variant-name: "color",
|
92
|
+
$variant-value: $color,
|
93
|
+
$properties: settings.$themeable-properties,
|
94
|
+
);
|
79
95
|
}
|
80
96
|
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
3
|
import { withGlobalProps } from '../../providers/globalProps';
|
4
|
-
import { classNames } from '../../
|
5
|
-
import { transferProps } from '../../
|
4
|
+
import { classNames } from '../../helpers/classNames/classNames';
|
5
|
+
import { transferProps } from '../../helpers/transferProps';
|
6
6
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
7
7
|
import { getScrollingClassName } from './_helpers/getScrollingClassName';
|
8
8
|
import styles from './ModalBody.module.scss';
|
@@ -1,6 +1,24 @@
|
|
1
|
+
// 1. Intentionally do not provide a fallback value for the border color. Setting a fallback value (e.g. `transparent`)
|
2
|
+
// will result in the border being skewed at both ends.
|
3
|
+
|
4
|
+
@use "settings";
|
5
|
+
|
1
6
|
@layer components.modal {
|
2
7
|
.root {
|
3
8
|
flex: 1 1 auto;
|
9
|
+
border-inline: settings.$border-width solid var(--rui-local-border-color); // 1.
|
10
|
+
|
11
|
+
&:first-child {
|
12
|
+
border-top: settings.$border-width solid var(--rui-local-border-color); // 1.
|
13
|
+
border-top-left-radius: settings.$border-radius;
|
14
|
+
border-top-right-radius: settings.$border-radius;
|
15
|
+
}
|
16
|
+
|
17
|
+
&:last-child {
|
18
|
+
border-bottom: settings.$border-width solid var(--rui-local-border-color); // 1.
|
19
|
+
border-bottom-right-radius: settings.$border-radius;
|
20
|
+
border-bottom-left-radius: settings.$border-radius;
|
21
|
+
}
|
4
22
|
}
|
5
23
|
|
6
24
|
.isRootScrollingAuto,
|
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
|
|
2
2
|
import React, { useContext } from 'react';
|
3
3
|
import { TranslationsContext } from '../../providers/translations';
|
4
4
|
import { withGlobalProps } from '../../providers/globalProps';
|
5
|
-
import { transferProps } from '../../
|
5
|
+
import { transferProps } from '../../helpers/transferProps';
|
6
6
|
import styles from './ModalCloseButton.module.scss';
|
7
7
|
|
8
8
|
export const ModalCloseButton = React.forwardRef((props, ref) => {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
3
|
import { withGlobalProps } from '../../providers/globalProps';
|
4
|
-
import { transferProps } from '../../
|
4
|
+
import { transferProps } from '../../helpers/transferProps';
|
5
5
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
6
6
|
import styles from './ModalContent.module.scss';
|
7
7
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
3
|
import { withGlobalProps } from '../../providers/globalProps';
|
4
|
-
import { classNames } from '../../
|
5
|
-
import { transferProps } from '../../
|
4
|
+
import { classNames } from '../../helpers/classNames/classNames';
|
5
|
+
import { transferProps } from '../../helpers/transferProps';
|
6
6
|
import { getJustifyClassName } from './_helpers/getJustifyClassName';
|
7
7
|
import styles from './ModalFooter.module.scss';
|
8
8
|
|
@@ -1,3 +1,6 @@
|
|
1
|
+
// 1. Intentionally do not provide a fallback value for the border color. Setting a fallback value (e.g. `transparent`)
|
2
|
+
// will result in the border being skewed at both ends.
|
3
|
+
|
1
4
|
@use "settings";
|
2
5
|
@use "theme";
|
3
6
|
|
@@ -9,10 +12,11 @@
|
|
9
12
|
gap: theme.$footer-gap;
|
10
13
|
align-items: center;
|
11
14
|
padding: theme.$padding-y theme.$padding-x;
|
12
|
-
border
|
15
|
+
border: settings.$border-width solid var(--rui-local-border-color); // 1.
|
16
|
+
border-top: theme.$separator-width solid var(--rui-local-border-color, #{theme.$separator-color});
|
13
17
|
border-bottom-right-radius: settings.$border-radius;
|
14
18
|
border-bottom-left-radius: settings.$border-radius;
|
15
|
-
background: theme.$footer-background;
|
19
|
+
background: var(--rui-local-background-color, #{theme.$footer-background});
|
16
20
|
}
|
17
21
|
|
18
22
|
.isRootJustifiedToStart {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
3
|
import { withGlobalProps } from '../../providers/globalProps';
|
4
|
-
import { classNames } from '../../
|
5
|
-
import { transferProps } from '../../
|
4
|
+
import { classNames } from '../../helpers/classNames/classNames';
|
5
|
+
import { transferProps } from '../../helpers/transferProps';
|
6
6
|
import { getJustifyClassName } from './_helpers/getJustifyClassName';
|
7
7
|
import styles from './ModalHeader.module.scss';
|
8
8
|
|
@@ -1,3 +1,7 @@
|
|
1
|
+
// 1. Intentionally do not provide a fallback value for the border color. Setting a fallback value (e.g. `transparent`)
|
2
|
+
// will result in the border being skewed at both ends.
|
3
|
+
|
4
|
+
@use "settings";
|
1
5
|
@use "theme";
|
2
6
|
|
3
7
|
@layer components.modal {
|
@@ -7,7 +11,10 @@
|
|
7
11
|
gap: theme.$header-gap;
|
8
12
|
align-items: baseline;
|
9
13
|
padding: theme.$padding-y theme.$padding-x;
|
10
|
-
border
|
14
|
+
border: settings.$border-width solid var(--rui-local-border-color); // 1.
|
15
|
+
border-bottom: theme.$separator-width solid var(--rui-local-border-color, #{theme.$separator-color});
|
16
|
+
border-top-left-radius: settings.$border-radius;
|
17
|
+
border-top-right-radius: settings.$border-radius;
|
11
18
|
}
|
12
19
|
|
13
20
|
.isRootJustifiedToStart {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
3
|
import { withGlobalProps } from '../../providers/globalProps';
|
4
|
-
import { transferProps } from '../../
|
4
|
+
import { transferProps } from '../../helpers/transferProps';
|
5
5
|
import styles from './ModalTitle.module.scss';
|
6
6
|
|
7
7
|
export const ModalTitle = ({
|