@react-ui-org/react-ui 0.55.1 → 0.57.0
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/.nvmrc +1 -1
- package/dist/react-ui.css +15 -20
- package/dist/react-ui.development.css +2336 -846
- package/dist/react-ui.development.js +106 -96
- package/dist/react-ui.js +1 -1
- package/package.json +41 -39
- package/src/CNAME +1 -0
- package/src/components/Alert/Alert.jsx +3 -2
- package/src/components/Alert/Alert.module.scss +9 -31
- package/src/components/Alert/README.md +11 -9
- package/src/components/Alert/_settings.scss +5 -0
- package/src/components/Alert/_theme.scss +0 -43
- package/src/components/Badge/Badge.jsx +5 -3
- package/src/components/Badge/Badge.module.scss +29 -74
- package/src/components/Badge/README.md +24 -6
- package/src/components/Badge/_settings.scss +8 -0
- package/src/components/Button/Button.jsx +4 -3
- package/src/components/Button/Button.module.scss +183 -2
- package/src/components/Button/README.md +28 -24
- package/src/components/Button/_settings.scss +8 -3
- package/src/components/Button/_theme.scss +0 -3
- package/src/components/Button/_tools.scss +7 -71
- package/src/components/ButtonGroup/ButtonGroup.jsx +2 -2
- package/src/components/ButtonGroup/README.md +5 -4
- package/src/components/Card/Card.jsx +3 -2
- package/src/components/Card/Card.module.scss +10 -31
- package/src/components/Card/CardBody.jsx +1 -1
- package/src/components/Card/CardFooter.jsx +1 -1
- package/src/components/Card/README.md +11 -10
- package/src/components/Card/_settings.scss +5 -0
- package/src/components/Card/_theme.scss +0 -43
- package/src/components/CheckboxField/CheckboxField.jsx +2 -2
- package/src/components/CheckboxField/README.md +8 -4
- package/src/components/FileInputField/FileInputField.jsx +3 -3
- package/src/components/FileInputField/README.md +8 -4
- package/src/components/FormLayout/FormLayout.jsx +1 -1
- package/src/components/FormLayout/FormLayoutCustomField.jsx +1 -1
- package/src/components/FormLayout/README.md +5 -4
- package/src/components/Grid/Grid.jsx +1 -1
- package/src/components/Grid/Grid.module.scss +5 -0
- package/src/components/Grid/GridSpan.jsx +1 -1
- package/src/components/Grid/README.md +6 -4
- package/src/components/Grid/_settings.scss +2 -2
- package/src/components/InputGroup/InputGroup.jsx +2 -2
- package/src/components/InputGroup/README.md +5 -4
- package/src/components/Modal/Modal.jsx +1 -1
- package/src/components/Modal/Modal.module.scss +1 -1
- package/src/components/Modal/ModalBody.jsx +1 -1
- package/src/components/Modal/ModalCloseButton.jsx +1 -1
- package/src/components/Modal/ModalContent.jsx +1 -1
- package/src/components/Modal/ModalFooter.jsx +1 -1
- package/src/components/Modal/ModalHeader.jsx +2 -4
- package/src/components/Modal/ModalTitle.jsx +2 -4
- package/src/components/Modal/README.md +3 -2
- package/src/components/Paper/Paper.jsx +1 -1
- package/src/components/Paper/README.md +5 -4
- package/src/components/Popover/Popover.jsx +1 -1
- package/src/components/Popover/Popover.module.scss +16 -16
- package/src/components/Popover/PopoverWrapper.jsx +1 -1
- package/src/components/Popover/README.md +5 -4
- package/src/components/Popover/_theme.scss +4 -2
- package/src/components/Radio/README.md +8 -4
- package/src/components/Radio/Radio.jsx +2 -2
- package/src/components/ScrollView/README.md +5 -4
- package/src/components/ScrollView/ScrollView.jsx +1 -1
- package/src/components/ScrollView/ScrollView.module.scss +2 -4
- package/src/components/SelectField/README.md +8 -4
- package/src/components/SelectField/SelectField.jsx +2 -2
- package/src/components/Table/README.md +5 -4
- package/src/components/Table/Table.jsx +1 -1
- package/src/components/Tabs/README.md +3 -2
- package/src/components/Tabs/Tabs.jsx +1 -1
- package/src/components/Tabs/TabsItem.jsx +1 -1
- package/src/components/Text/README.md +3 -2
- package/src/components/Text/Text.jsx +1 -1
- package/src/components/TextArea/README.md +8 -4
- package/src/components/TextArea/TextArea.jsx +2 -2
- package/src/components/TextField/README.md +8 -4
- package/src/components/TextField/TextField.jsx +2 -2
- package/src/components/TextLink/README.md +5 -4
- package/src/components/TextLink/TextLink.jsx +1 -1
- package/src/components/Toggle/README.md +8 -4
- package/src/components/Toggle/Toggle.jsx +2 -2
- package/src/components/Toolbar/README.md +5 -4
- package/src/components/Toolbar/Toolbar.jsx +1 -1
- package/src/components/Toolbar/ToolbarGroup.jsx +1 -1
- package/src/components/Toolbar/ToolbarItem.jsx +1 -1
- package/src/components/_helpers/getRootPriorityClassName.js +1 -1
- package/src/index.js +1 -0
- package/src/provider/RUIProvider.jsx +6 -3
- package/src/styles/settings/_collections.scss +9 -0
- package/src/styles/tools/_collections.scss +191 -0
- package/src/styles/tools/_string.scss +5 -2
- package/src/styles/tools/form-fields/_box-field-layout.scss +5 -0
- package/src/styles/tools/form-fields/_inline-field-layout.scss +1 -0
- package/src/theme.scss +64 -0
- package/src/utils/mergeDeep.js +28 -0
- package/src/{components/_helpers → utils}/transferProps.js +0 -8
- package/src/components/Alert/_tools.scss +0 -10
- package/src/components/Button/_base.scss +0 -159
- package/src/components/Button/_priorities.scss +0 -149
- package/src/components/Card/_tools.scss +0 -10
|
@@ -45,6 +45,9 @@ See [API](#api) for all available options.
|
|
|
45
45
|
send me any emails” which would mean that the user needs to turn the
|
|
46
46
|
checkbox **on** in order for something **not** to happen.
|
|
47
47
|
|
|
48
|
+
- **Use text labels** unless it is necessary to wrap text label into
|
|
49
|
+
Popover-like to component to provide additional info about the field.
|
|
50
|
+
|
|
48
51
|
- Only make the CheckboxField's label invisible when there is **another visual
|
|
49
52
|
clue** to guide users through toggling the input.
|
|
50
53
|
|
|
@@ -172,10 +175,11 @@ Disabled state makes the input unavailable.
|
|
|
172
175
|
## Forwarding HTML Attributes
|
|
173
176
|
|
|
174
177
|
In addition to the options below in the [component's API](#api) section, you
|
|
175
|
-
can specify **any HTML attribute you like.** All attributes that don't
|
|
176
|
-
with the API of the React component
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
can specify **any HTML attribute you like.** All attributes that don't
|
|
179
|
+
interfere with the API of the React component and that aren't filtered out by
|
|
180
|
+
[`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
|
|
181
|
+
`<input>` HTML element. This enables making the component interactive and helps
|
|
182
|
+
to improve its accessibility.
|
|
179
183
|
|
|
180
184
|
👉 For the full list of supported attributes refer to:
|
|
181
185
|
|
|
@@ -2,9 +2,9 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
3
|
import { withGlobalProps } from '../../provider';
|
|
4
4
|
import { classNames } from '../../utils/classNames';
|
|
5
|
+
import { transferProps } from '../../utils/transferProps';
|
|
5
6
|
import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
|
|
6
7
|
import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
|
|
7
|
-
import { transferProps } from '../_helpers/transferProps';
|
|
8
8
|
import { FormLayoutContext } from '../FormLayout';
|
|
9
9
|
import styles from './FileInputField.module.scss';
|
|
10
10
|
|
|
@@ -123,9 +123,9 @@ FileInputField.propTypes = {
|
|
|
123
123
|
*/
|
|
124
124
|
isLabelVisible: PropTypes.bool,
|
|
125
125
|
/**
|
|
126
|
-
*
|
|
126
|
+
* File input field label.
|
|
127
127
|
*/
|
|
128
|
-
label: PropTypes.
|
|
128
|
+
label: PropTypes.node.isRequired,
|
|
129
129
|
/**
|
|
130
130
|
* Layout of the field.
|
|
131
131
|
*
|
|
@@ -27,6 +27,9 @@ See [API](#api) for all available options.
|
|
|
27
27
|
polite phrases like _Please attach your file here_. Short labels will help
|
|
28
28
|
your users accomplish their task faster.
|
|
29
29
|
|
|
30
|
+
- **Use text labels** unless it is necessary to wrap text label into
|
|
31
|
+
Popover-like to component to provide additional info about the field.
|
|
32
|
+
|
|
30
33
|
- Only make the FileInputField's label invisible when there is **another visual
|
|
31
34
|
clue** to guide users through filling the input.
|
|
32
35
|
|
|
@@ -156,10 +159,11 @@ It's possible to disable the whole input.
|
|
|
156
159
|
## Forwarding HTML Attributes
|
|
157
160
|
|
|
158
161
|
In addition to the options below in the [component's API](#api) section, you
|
|
159
|
-
can specify **any HTML attribute you like.** All attributes that don't
|
|
160
|
-
with the API of the React component
|
|
161
|
-
|
|
162
|
-
|
|
162
|
+
can specify **any HTML attribute you like.** All attributes that don't
|
|
163
|
+
interfere with the API of the React component and that aren't filtered out by
|
|
164
|
+
[`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
|
|
165
|
+
`<input>` HTML element. This enables making the component interactive and helps
|
|
166
|
+
to improve its accessibility.
|
|
163
167
|
|
|
164
168
|
```docoff-react-preview
|
|
165
169
|
<FileInputField
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { withGlobalProps } from '../../provider';
|
|
4
|
-
import { transferProps } from '../_helpers/transferProps';
|
|
5
4
|
import { classNames } from '../../utils/classNames';
|
|
5
|
+
import { transferProps } from '../../utils/transferProps';
|
|
6
6
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
|
7
7
|
import { FormLayoutContext } from './FormLayoutContext';
|
|
8
8
|
import styles from './FormLayout.module.scss';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
3
|
import { withGlobalProps } from '../../provider';
|
|
4
|
-
import { transferProps } from '../_helpers/transferProps';
|
|
5
4
|
import { classNames } from '../../utils/classNames';
|
|
5
|
+
import { transferProps } from '../../utils/transferProps';
|
|
6
6
|
import { getRootSizeClassName } from '../_helpers/getRootSizeClassName';
|
|
7
7
|
import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
|
|
8
8
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
|
@@ -416,10 +416,11 @@ React.createElement(() => {
|
|
|
416
416
|
## Forwarding HTML Attributes
|
|
417
417
|
|
|
418
418
|
In addition to the options below in the [component's API](#api) section, you
|
|
419
|
-
can specify **any HTML attribute you like.** All attributes that don't
|
|
420
|
-
with the API of the React component
|
|
421
|
-
|
|
422
|
-
|
|
419
|
+
can specify **any HTML attribute you like.** All attributes that don't
|
|
420
|
+
interfere with the API of the React component and that aren't filtered out by
|
|
421
|
+
[`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
|
|
422
|
+
root `<div>` HTML element. This enables making the component interactive and
|
|
423
|
+
helps to improve its accessibility.
|
|
423
424
|
|
|
424
425
|
👉 For the full list of supported attributes refer to:
|
|
425
426
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withGlobalProps } from '../../provider';
|
|
4
|
+
import { transferProps } from '../../utils/transferProps';
|
|
4
5
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
|
5
|
-
import { transferProps } from '../_helpers/transferProps';
|
|
6
6
|
import { generateResponsiveCustomProperties } from './_helpers/generateResponsiveCustomProperties';
|
|
7
7
|
import styles from './Grid.module.scss';
|
|
8
8
|
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
// `--rui-local-<PROPERTY>: var(--rui-local-<PROPERTY>-sm, var(--rui-local-<PROPERTY>-xs, <INITIAL FALLBACK>))`
|
|
20
20
|
//
|
|
21
21
|
// 2. Apply custom property value that is defined within current breakpoint, see 1.
|
|
22
|
+
//
|
|
23
|
+
// 3. Intentionally use longhand properties because the custom property fallback mechanism evaluates `initial` values as
|
|
24
|
+
// empty. That makes the other value of the shorthand property unexpectedly used for both axes.
|
|
22
25
|
|
|
23
26
|
@use "sass:map";
|
|
24
27
|
@use "../../styles/tools/spacing";
|
|
@@ -35,10 +38,12 @@
|
|
|
35
38
|
grid-template-rows: var(--rui-local-rows); // 2.
|
|
36
39
|
grid-auto-flow: var(--rui-local-auto-flow); // 2.
|
|
37
40
|
grid-gap: var(--rui-local-row-gap) var(--rui-local-column-gap); // 2.
|
|
41
|
+
// stylelint-disable declaration-block-no-redundant-longhand-properties -- 3.
|
|
38
42
|
align-content: var(--rui-local-align-content); // 2.
|
|
39
43
|
align-items: var(--rui-local-align-items); // 2.
|
|
40
44
|
justify-content: var(--rui-local-justify-content); // 2.
|
|
41
45
|
justify-items: var(--rui-local-justify-items); // 2.
|
|
46
|
+
// stylelint-enable declaration-block-no-redundant-longhand-properties
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
// stylelint-disable-next-line selector-max-universal -- Reset any previously added margins.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withGlobalProps } from '../../provider';
|
|
4
|
+
import { transferProps } from '../../utils/transferProps';
|
|
4
5
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
|
5
|
-
import { transferProps } from '../_helpers/transferProps';
|
|
6
6
|
import { generateResponsiveCustomProperties } from './_helpers/generateResponsiveCustomProperties';
|
|
7
7
|
import styles from './Grid.module.scss';
|
|
8
8
|
|
|
@@ -248,10 +248,12 @@ property. Check [MDN][grid-auto-flow] to fully understand available options.
|
|
|
248
248
|
## Forwarding HTML Attributes
|
|
249
249
|
|
|
250
250
|
In addition to the options below in the [component's API](#api) section, you
|
|
251
|
-
can specify **any HTML attribute you like.** All attributes that don't
|
|
252
|
-
with the API of the React component
|
|
253
|
-
|
|
254
|
-
|
|
251
|
+
can specify **any HTML attribute you like.** All attributes that don't
|
|
252
|
+
interfere with the API of the React component and that aren't filtered out by
|
|
253
|
+
[`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
|
|
254
|
+
root HTML element of your choice provided by `tag`, which is `<div>` by
|
|
255
|
+
default. This enables making the component interactive and helps to improve its
|
|
256
|
+
accessibility.
|
|
255
257
|
|
|
256
258
|
👉 For the full list of supported attributes refer to:
|
|
257
259
|
|
|
@@ -8,11 +8,11 @@ $grid-responsive-properties: [
|
|
|
8
8
|
align-items,
|
|
9
9
|
justify-content,
|
|
10
10
|
justify-items,
|
|
11
|
-
]; // stylelint-disable-line indentation -- Broken rule?
|
|
11
|
+
]; // stylelint-disable-line @stylistic/indentation -- Broken rule?
|
|
12
12
|
|
|
13
13
|
$grid-span-responsive-properties: [
|
|
14
14
|
column-span,
|
|
15
15
|
row-span,
|
|
16
|
-
]; // stylelint-disable-line indentation -- Broken rule?
|
|
16
|
+
]; // stylelint-disable-line @stylistic/indentation -- Broken rule?
|
|
17
17
|
|
|
18
18
|
$initial-fallback-value: initial;
|
|
@@ -6,11 +6,11 @@ import React, {
|
|
|
6
6
|
import { Text } from '../Text';
|
|
7
7
|
import { withGlobalProps } from '../../provider';
|
|
8
8
|
import { classNames } from '../../utils/classNames';
|
|
9
|
+
import { transferProps } from '../../utils/transferProps';
|
|
9
10
|
import { getRootSizeClassName } from '../_helpers/getRootSizeClassName';
|
|
10
11
|
import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
|
|
11
12
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
|
12
13
|
import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
|
|
13
|
-
import { transferProps } from '../_helpers/transferProps';
|
|
14
14
|
import { FormLayoutContext } from '../FormLayout';
|
|
15
15
|
import { InputGroupContext } from './InputGroupContext';
|
|
16
16
|
import styles from './InputGroup.module.scss';
|
|
@@ -151,7 +151,7 @@ InputGroup.propTypes = {
|
|
|
151
151
|
/**
|
|
152
152
|
* Input group label.
|
|
153
153
|
*/
|
|
154
|
-
label: PropTypes.
|
|
154
|
+
label: PropTypes.node.isRequired,
|
|
155
155
|
/**
|
|
156
156
|
* Layout of the group.
|
|
157
157
|
*
|
|
@@ -250,10 +250,11 @@ for the underlying `<fieldset>` element.
|
|
|
250
250
|
## Forwarding HTML Attributes
|
|
251
251
|
|
|
252
252
|
In addition to the options below in the [component's API](#api) section, you
|
|
253
|
-
can specify **any HTML attribute you like.** All attributes that don't
|
|
254
|
-
with the API of the React component
|
|
255
|
-
|
|
256
|
-
|
|
253
|
+
can specify **any HTML attribute you like.** All attributes that don't
|
|
254
|
+
interfere with the API of the React component and that aren't filtered out by
|
|
255
|
+
[`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
|
|
256
|
+
root `<fieldset>` HTML element. This enables making the component interactive
|
|
257
|
+
and helps to improve its accessibility.
|
|
257
258
|
|
|
258
259
|
👉 For the full list of supported attributes refer to:
|
|
259
260
|
|
|
@@ -2,8 +2,8 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
import React, { useRef } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import { withGlobalProps } from '../../provider';
|
|
5
|
-
import { transferProps } from '../_helpers/transferProps';
|
|
6
5
|
import { classNames } from '../../utils/classNames';
|
|
6
|
+
import { transferProps } from '../../utils/transferProps';
|
|
7
7
|
import { getPositionClassName } from './_helpers/getPositionClassName';
|
|
8
8
|
import { getSizeClassName } from './_helpers/getSizeClassName';
|
|
9
9
|
import { useModalFocus } from './_hooks/useModalFocus';
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
max-width: var(--rui-local-max-width);
|
|
22
22
|
max-height: var(--rui-local-max-height);
|
|
23
23
|
overflow-y: auto;
|
|
24
|
-
overscroll-behavior: contain;
|
|
25
24
|
border-radius: settings.$border-radius;
|
|
26
25
|
background: theme.$background;
|
|
27
26
|
box-shadow: theme.$box-shadow;
|
|
28
27
|
transform: translateX(-50%);
|
|
28
|
+
overscroll-behavior: contain;
|
|
29
29
|
|
|
30
30
|
@include breakpoint.up(sm) {
|
|
31
31
|
--rui-local-outer-spacing: #{theme.$outer-spacing-sm};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withGlobalProps } from '../../provider';
|
|
4
|
-
import { transferProps } from '../_helpers/transferProps';
|
|
5
4
|
import { classNames } from '../../utils/classNames';
|
|
5
|
+
import { transferProps } from '../../utils/transferProps';
|
|
6
6
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
|
7
7
|
import { getScrollingClassName } from './_helpers/getScrollingClassName';
|
|
8
8
|
import styles from './ModalBody.module.scss';
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
RUIContext,
|
|
5
5
|
withGlobalProps,
|
|
6
6
|
} from '../../provider';
|
|
7
|
-
import { transferProps } from '
|
|
7
|
+
import { transferProps } from '../../utils/transferProps';
|
|
8
8
|
import styles from './ModalCloseButton.module.scss';
|
|
9
9
|
|
|
10
10
|
export const ModalCloseButton = React.forwardRef((props, ref) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withGlobalProps } from '../../provider';
|
|
4
|
+
import { transferProps } from '../../utils/transferProps';
|
|
4
5
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
|
5
|
-
import { transferProps } from '../_helpers/transferProps';
|
|
6
6
|
import styles from './ModalContent.module.scss';
|
|
7
7
|
|
|
8
8
|
export const ModalContent = ({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withGlobalProps } from '../../provider';
|
|
4
|
-
import { transferProps } from '../_helpers/transferProps';
|
|
5
4
|
import { classNames } from '../../utils/classNames';
|
|
5
|
+
import { transferProps } from '../../utils/transferProps';
|
|
6
6
|
import { getJustifyClassName } from './_helpers/getJustifyClassName';
|
|
7
7
|
import styles from './ModalFooter.module.scss';
|
|
8
8
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
withGlobalProps,
|
|
5
|
-
} from '../../provider';
|
|
6
|
-
import { transferProps } from '../_helpers/transferProps';
|
|
3
|
+
import { withGlobalProps } from '../../provider';
|
|
7
4
|
import { classNames } from '../../utils/classNames';
|
|
5
|
+
import { transferProps } from '../../utils/transferProps';
|
|
8
6
|
import { getJustifyClassName } from './_helpers/getJustifyClassName';
|
|
9
7
|
import styles from './ModalHeader.module.scss';
|
|
10
8
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
} from '../../provider';
|
|
6
|
-
import { transferProps } from '../_helpers/transferProps';
|
|
3
|
+
import { withGlobalProps } from '../../provider';
|
|
4
|
+
import { transferProps } from '../../utils/transferProps';
|
|
7
5
|
import styles from './ModalTitle.module.scss';
|
|
8
6
|
|
|
9
7
|
export const ModalTitle = ({
|
|
@@ -1015,8 +1015,9 @@ opened.
|
|
|
1015
1015
|
## Forwarding HTML Attributes
|
|
1016
1016
|
|
|
1017
1017
|
In addition to the options below in the [component's API](#api) section, you
|
|
1018
|
-
can specify **any HTML attribute you like.** All attributes that don't
|
|
1019
|
-
with the API of the React component
|
|
1018
|
+
can specify **any HTML attribute you like.** All attributes that don't
|
|
1019
|
+
interfere with the API of the React component and that aren't filtered out by
|
|
1020
|
+
[`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to:
|
|
1020
1021
|
|
|
1021
1022
|
- the `<div>` HTML element in case of the `Modal` component. This `<div>` is not
|
|
1022
1023
|
the root, but its first child which represents the modal window.
|
|
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withGlobalProps } from '../../provider';
|
|
4
4
|
import { classNames } from '../../utils/classNames';
|
|
5
|
-
import { transferProps } from '
|
|
5
|
+
import { transferProps } from '../../utils/transferProps';
|
|
6
6
|
import styles from './Paper.module.scss';
|
|
7
7
|
|
|
8
8
|
export const Paper = ({
|
|
@@ -54,10 +54,11 @@ Dim background and add transparency to visually suppress the Paper.
|
|
|
54
54
|
## Forwarding HTML Attributes
|
|
55
55
|
|
|
56
56
|
In addition to the options below in the [component's API](#api) section, you
|
|
57
|
-
can specify **any HTML attribute you like.** All attributes that don't
|
|
58
|
-
with the API of the React component
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
can specify **any HTML attribute you like.** All attributes that don't
|
|
58
|
+
interfere with the API of the React component and that aren't filtered out by
|
|
59
|
+
[`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
|
|
60
|
+
root `<div>` HTML element. This enables making the component interactive and
|
|
61
|
+
helps to improve its accessibility.
|
|
61
62
|
|
|
62
63
|
👉 For the full list of supported attributes refer to:
|
|
63
64
|
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import { withGlobalProps } from '../../provider';
|
|
5
5
|
import { classNames } from '../../utils/classNames';
|
|
6
|
-
import { transferProps } from '
|
|
6
|
+
import { transferProps } from '../../utils/transferProps';
|
|
7
7
|
import getRootSideClassName from './_helpers/getRootSideClassName';
|
|
8
8
|
import getRootAlignmentClassName from './_helpers/getRootAlignmentClassName';
|
|
9
9
|
import styles from './Popover.module.scss';
|
|
@@ -51,52 +51,52 @@
|
|
|
51
51
|
|
|
52
52
|
// Sides
|
|
53
53
|
.isRootAtTop {
|
|
54
|
-
bottom: 100
|
|
54
|
+
bottom: calc(100% + #{theme.$arrow-gap} - #{theme.$arrow-safe-rendering-overlap});
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.isRootAtBottom {
|
|
58
|
-
top: 100
|
|
58
|
+
top: calc(100% + #{theme.$arrow-gap} - #{theme.$arrow-safe-rendering-overlap});
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.isRootAtLeft {
|
|
62
|
-
right: 100
|
|
62
|
+
right: calc(100% + #{theme.$arrow-gap} - #{theme.$arrow-safe-rendering-overlap});
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.isRootAtRight {
|
|
66
|
-
left: 100
|
|
66
|
+
left: calc(100% + #{theme.$arrow-gap} - #{theme.$arrow-safe-rendering-overlap});
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// Arrows
|
|
70
70
|
.isRootAtTop > .arrow {
|
|
71
|
-
top: 100
|
|
71
|
+
top: calc(100% - #{theme.$arrow-safe-rendering-overlap});
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.isRootAtBottom > .arrow {
|
|
75
|
-
bottom: 100
|
|
75
|
+
bottom: calc(100% - #{theme.$arrow-safe-rendering-overlap});
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.isRootAtLeft > .arrow {
|
|
79
|
-
left: 100
|
|
79
|
+
left: calc(100% - #{theme.$arrow-safe-rendering-overlap});
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
.isRootAtRight > .arrow {
|
|
83
|
-
right: 100
|
|
83
|
+
right: calc(100% - #{theme.$arrow-safe-rendering-overlap});
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// Side alignments: top
|
|
87
87
|
.isRootAtTop.isRootAtCenter {
|
|
88
88
|
left: 50%;
|
|
89
|
-
transform: translate(-50%,
|
|
89
|
+
transform: translate(-50%, calc(-1 * #{theme.$arrow-height}));
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.isRootAtTop.isRootAtStart {
|
|
93
93
|
left: 0;
|
|
94
|
-
transform: translate(0,
|
|
94
|
+
transform: translate(0, calc(-1 * #{theme.$arrow-height}));
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
.isRootAtTop.isRootAtEnd {
|
|
98
98
|
right: 0;
|
|
99
|
-
transform: translate(0,
|
|
99
|
+
transform: translate(0, calc(-1 * #{theme.$arrow-height}));
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
.isRootAtTop.isRootAtCenter > .arrow {
|
|
@@ -148,17 +148,17 @@
|
|
|
148
148
|
// Side alignments: left
|
|
149
149
|
.isRootAtLeft.isRootAtCenter {
|
|
150
150
|
top: 50%;
|
|
151
|
-
transform: translate(
|
|
151
|
+
transform: translate(calc(-1 * #{theme.$arrow-height}), -50%);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
.isRootAtLeft.isRootAtStart {
|
|
155
155
|
top: 0;
|
|
156
|
-
transform: translate(
|
|
156
|
+
transform: translate(calc(-1 * #{theme.$arrow-height}), 0);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
.isRootAtLeft.isRootAtEnd {
|
|
160
160
|
bottom: 0;
|
|
161
|
-
transform: translate(
|
|
161
|
+
transform: translate(calc(-1 * #{theme.$arrow-height}), 0);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
.isRootAtLeft.isRootAtCenter > .arrow {
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
.isRootControlled.isRootAtTop {
|
|
219
|
-
transform: translate(0,
|
|
219
|
+
transform: translate(0, calc(-1 * #{theme.$arrow-height})); // 2.
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
.isRootControlled.isRootAtBottom {
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
.isRootControlled.isRootAtLeft {
|
|
227
|
-
transform: translate(
|
|
227
|
+
transform: translate(calc(-1 * #{theme.$arrow-height}), 0); // 2.
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
.isRootControlled.isRootAtRight {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withGlobalProps } from '../../provider';
|
|
4
|
-
import { transferProps } from '
|
|
4
|
+
import { transferProps } from '../../utils/transferProps';
|
|
5
5
|
import styles from './PopoverWrapper.module.scss';
|
|
6
6
|
|
|
7
7
|
export const PopoverWrapper = ({
|
|
@@ -287,10 +287,11 @@ React.createElement(() => {
|
|
|
287
287
|
## Forwarding HTML Attributes
|
|
288
288
|
|
|
289
289
|
In addition to the options below in the [component's API](#api) section, you
|
|
290
|
-
can specify **any HTML attribute you like.** All attributes that don't
|
|
291
|
-
with the API of the React component
|
|
292
|
-
|
|
293
|
-
|
|
290
|
+
can specify **any HTML attribute you like.** All attributes that don't
|
|
291
|
+
interfere with the API of the React component and that aren't filtered out by
|
|
292
|
+
[`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
|
|
293
|
+
root `<div>` HTML element. This enables making the component interactive and
|
|
294
|
+
helps to improve its accessibility.
|
|
294
295
|
|
|
295
296
|
👉 For the full list of supported attributes refer to:
|
|
296
297
|
|
|
@@ -11,6 +11,8 @@ $color: var(--rui-Popover__color);
|
|
|
11
11
|
$background-color: var(--rui-Popover__background-color);
|
|
12
12
|
$box-shadow: var(--rui-Popover__box-shadow);
|
|
13
13
|
|
|
14
|
-
$arrow-
|
|
15
|
-
$arrow-
|
|
14
|
+
$arrow-safe-rendering-overlap: 1px;
|
|
15
|
+
$arrow-gap: 1px;
|
|
16
|
+
$arrow-width: calc(1rem + #{$arrow-safe-rendering-overlap * 2});
|
|
17
|
+
$arrow-height: calc($arrow-width / 2); // 1.
|
|
16
18
|
$arrow-corner-offset: 0.75rem;
|
|
@@ -56,6 +56,9 @@ See [API](#api) for all available options.
|
|
|
56
56
|
polite phrases like _Please select your favourite fruit_. Short labels will
|
|
57
57
|
help your users accomplish their task faster.
|
|
58
58
|
|
|
59
|
+
- **Use text labels** unless it is necessary to wrap text label into
|
|
60
|
+
Popover-like to component to provide additional info about the field.
|
|
61
|
+
|
|
59
62
|
- Only make the Radio's label invisible when there is **another visual
|
|
60
63
|
clue** to guide users through filling the input.
|
|
61
64
|
|
|
@@ -279,10 +282,11 @@ It's possible to disable just some options or the whole set.
|
|
|
279
282
|
## Forwarding HTML Attributes
|
|
280
283
|
|
|
281
284
|
In addition to the options below in the [component's API](#api) section, you
|
|
282
|
-
can specify **any HTML attribute you like.** All attributes that don't
|
|
283
|
-
with the API of the React component
|
|
284
|
-
|
|
285
|
-
|
|
285
|
+
can specify **any HTML attribute you like.** All attributes that don't
|
|
286
|
+
interfere with the API of the React component and that aren't filtered out by
|
|
287
|
+
[`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
|
|
288
|
+
`<input>` HTML element. This enables making the component interactive and helps
|
|
289
|
+
to improve its accessibility.
|
|
286
290
|
|
|
287
291
|
👉 For the full list of supported attributes refer to:
|
|
288
292
|
|
|
@@ -2,9 +2,9 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
3
|
import { withGlobalProps } from '../../provider';
|
|
4
4
|
import { classNames } from '../../utils/classNames';
|
|
5
|
+
import { transferProps } from '../../utils/transferProps';
|
|
5
6
|
import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
|
|
6
7
|
import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
|
|
7
|
-
import { transferProps } from '../_helpers/transferProps';
|
|
8
8
|
import { FormLayoutContext } from '../FormLayout';
|
|
9
9
|
import styles from './Radio.module.scss';
|
|
10
10
|
|
|
@@ -157,7 +157,7 @@ Radio.propTypes = {
|
|
|
157
157
|
/**
|
|
158
158
|
* Label of the group of options.
|
|
159
159
|
*/
|
|
160
|
-
label: PropTypes.
|
|
160
|
+
label: PropTypes.node.isRequired,
|
|
161
161
|
/**
|
|
162
162
|
* Layout of the field.
|
|
163
163
|
*
|
|
@@ -480,10 +480,11 @@ React.createElement(() => {
|
|
|
480
480
|
## Forwarding HTML Attributes
|
|
481
481
|
|
|
482
482
|
In addition to the options below in the [component's API](#api) section, you
|
|
483
|
-
can specify **any HTML attribute you like.** All attributes that don't
|
|
484
|
-
with the API of the React component
|
|
485
|
-
|
|
486
|
-
|
|
483
|
+
can specify **any HTML attribute you like.** All attributes that don't
|
|
484
|
+
interfere with the API of the React component and that aren't filtered out by
|
|
485
|
+
[`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
|
|
486
|
+
root `<div>` HTML element. This enables making the component interactive and
|
|
487
|
+
helps to improve its accessibility.
|
|
487
488
|
|
|
488
489
|
👉 For the full list of supported attributes refer to:
|
|
489
490
|
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
withGlobalProps,
|
|
12
12
|
} from '../../provider';
|
|
13
13
|
import { classNames } from '../../utils/classNames';
|
|
14
|
-
import { transferProps } from '
|
|
14
|
+
import { transferProps } from '../../utils/transferProps';
|
|
15
15
|
import { getElementsPositionDifference } from './_helpers/getElementsPositionDifference';
|
|
16
16
|
import { useLoadResize } from './_hooks/useLoadResizeHook';
|
|
17
17
|
import { useScrollPosition } from './_hooks/useScrollPositionHook';
|
|
@@ -103,8 +103,7 @@ $_arrow-outer-spacing: spacing.of(4);
|
|
|
103
103
|
|
|
104
104
|
.isRootVertical .viewport {
|
|
105
105
|
height: 100%;
|
|
106
|
-
overflow
|
|
107
|
-
overflow-y: auto; // 2.
|
|
106
|
+
overflow: clip auto; // 7., 8. / 2.
|
|
108
107
|
}
|
|
109
108
|
|
|
110
109
|
.isRootVertical .arrowPrev {
|
|
@@ -183,8 +182,7 @@ $_arrow-outer-spacing: spacing.of(4);
|
|
|
183
182
|
}
|
|
184
183
|
|
|
185
184
|
.isRootHorizontal .viewport {
|
|
186
|
-
overflow
|
|
187
|
-
overflow-y: clip; // 5., 7., 8.
|
|
185
|
+
overflow: auto clip; // 2. / 5., 7., 8.
|
|
188
186
|
}
|
|
189
187
|
|
|
190
188
|
.isRootHorizontal .content {
|