@react-ui-org/react-ui 0.54.0 → 0.55.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.nvmrc +1 -0
- package/README.md +7 -5
- package/dist/react-ui.css +36 -38
- package/dist/react-ui.development.css +10021 -10523
- package/dist/react-ui.development.js +211 -231
- package/dist/react-ui.js +1 -1
- package/package.json +3 -2
- package/src/components/Alert/Alert.jsx +1 -1
- package/src/components/Alert/Alert.module.scss +100 -0
- package/src/components/Alert/README.md +9 -7
- package/src/components/Badge/Badge.jsx +1 -1
- package/src/components/Badge/Badge.module.scss +109 -0
- package/src/components/Badge/README.md +9 -7
- package/src/components/Button/Button.jsx +1 -1
- package/src/components/Button/README.md +9 -7
- package/src/components/Button/_base.scss +117 -115
- package/src/components/Button/_priorities.scss +135 -133
- package/src/components/ButtonGroup/ButtonGroup.jsx +1 -1
- package/src/components/ButtonGroup/ButtonGroup.module.scss +35 -0
- package/src/components/ButtonGroup/README.md +10 -8
- package/src/components/Card/Card.jsx +1 -1
- package/src/components/Card/Card.module.scss +72 -0
- package/src/components/Card/CardBody.jsx +1 -1
- package/src/components/Card/CardFooter.jsx +1 -1
- package/src/components/Card/README.md +9 -7
- package/src/components/CheckboxField/CheckboxField.jsx +1 -1
- package/src/components/CheckboxField/CheckboxField.module.scss +63 -0
- package/src/components/CheckboxField/README.md +10 -8
- package/src/components/FileInputField/FileInputField.jsx +1 -1
- package/src/components/FileInputField/FileInputField.module.scss +65 -0
- package/src/components/FileInputField/README.md +10 -8
- package/src/components/FormLayout/FormLayout.jsx +1 -1
- package/src/components/FormLayout/{FormLayout.scss → FormLayout.module.scss} +30 -28
- package/src/components/FormLayout/FormLayoutCustomField.jsx +1 -1
- package/src/components/FormLayout/FormLayoutCustomField.module.scss +65 -0
- package/src/components/FormLayout/README.md +11 -9
- package/src/components/Grid/Grid.jsx +1 -1
- package/src/components/Grid/Grid.module.scss +66 -0
- package/src/components/Grid/GridSpan.jsx +1 -1
- package/src/components/Grid/README.md +11 -8
- package/src/components/InputGroup/InputGroup.jsx +1 -1
- package/src/components/InputGroup/InputGroup.module.scss +93 -0
- package/src/components/InputGroup/README.md +10 -8
- package/src/components/Modal/Modal.jsx +1 -1
- package/src/components/Modal/Modal.module.scss +80 -0
- package/src/components/Modal/ModalBody.jsx +1 -1
- package/src/components/Modal/ModalBody.module.scss +20 -0
- package/src/components/Modal/ModalCloseButton.jsx +1 -1
- package/src/components/Modal/ModalCloseButton.module.scss +20 -0
- package/src/components/Modal/ModalContent.jsx +1 -1
- package/src/components/Modal/ModalContent.module.scss +7 -0
- package/src/components/Modal/ModalFooter.jsx +1 -1
- package/src/components/Modal/ModalFooter.module.scss +37 -0
- package/src/components/Modal/ModalHeader.jsx +1 -1
- package/src/components/Modal/ModalHeader.module.scss +32 -0
- package/src/components/Modal/ModalTitle.jsx +1 -1
- package/src/components/Modal/ModalTitle.module.scss +12 -0
- package/src/components/Modal/README.md +17 -14
- package/src/components/Paper/Paper.jsx +1 -1
- package/src/components/Paper/Paper.module.scss +19 -0
- package/src/components/Paper/README.md +9 -7
- package/src/components/Popover/Popover.jsx +1 -1
- package/src/components/Popover/Popover.module.scss +238 -0
- package/src/components/Popover/PopoverWrapper.jsx +1 -2
- package/src/components/Popover/PopoverWrapper.module.scss +5 -0
- package/src/components/Popover/README.md +9 -7
- package/src/components/Radio/README.md +12 -10
- package/src/components/Radio/Radio.jsx +1 -1
- package/src/components/Radio/Radio.module.scss +85 -0
- package/src/components/ScrollView/README.md +10 -8
- package/src/components/ScrollView/ScrollView.jsx +1 -1
- package/src/components/ScrollView/ScrollView.module.scss +233 -0
- package/src/components/SelectField/README.md +10 -8
- package/src/components/SelectField/SelectField.jsx +1 -1
- package/src/components/SelectField/SelectField.module.scss +111 -0
- package/src/components/Table/README.md +10 -8
- package/src/components/Table/Table.jsx +1 -1
- package/src/components/Table/Table.module.scss +30 -0
- package/src/components/Table/_components/TableBodyCell/TableBodyCell.jsx +1 -1
- package/src/components/Table/_components/TableCell.module.scss +28 -0
- package/src/components/Table/_components/TableHeaderCell/TableHeaderCell.jsx +1 -1
- package/src/components/Tabs/README.md +16 -10
- package/src/components/Tabs/Tabs.jsx +1 -1
- package/src/components/Tabs/Tabs.module.scss +31 -0
- package/src/components/Tabs/TabsItem.jsx +1 -1
- package/src/components/Tabs/TabsItem.module.scss +119 -0
- package/src/components/Text/README.md +15 -9
- package/src/components/Text/Text.jsx +1 -1
- package/src/components/Text/Text.module.scss +42 -0
- package/src/components/TextArea/README.md +10 -8
- package/src/components/TextArea/TextArea.jsx +1 -1
- package/src/components/TextArea/TextArea.module.scss +97 -0
- package/src/components/TextField/README.md +13 -8
- package/src/components/TextField/TextField.jsx +1 -1
- package/src/components/TextField/TextField.module.scss +109 -0
- package/src/components/TextLink/README.md +10 -8
- package/src/components/TextLink/TextLink.jsx +1 -1
- package/src/components/TextLink/TextLink.module.scss +18 -0
- package/src/components/Toggle/README.md +10 -8
- package/src/components/Toggle/Toggle.jsx +1 -1
- package/src/components/Toggle/Toggle.module.scss +63 -0
- package/src/components/Toolbar/README.md +9 -7
- package/src/components/Toolbar/Toolbar.jsx +1 -1
- package/src/components/Toolbar/Toolbar.module.scss +85 -0
- package/src/components/Toolbar/ToolbarGroup.jsx +1 -1
- package/src/components/Toolbar/ToolbarItem.jsx +1 -1
- package/src/components/_helpers/transferProps.js +46 -7
- package/src/foundation.scss +22 -17
- package/src/helpers.scss +12 -8
- package/src/index.js +3 -4
- package/src/index.scss +7 -0
- package/src/layers.scss +4 -0
- package/src/styles/elements/_page.scss +0 -4
- package/src/styles/helpers/_animation.scss +2 -2
- package/src/styles/tools/_utilities.scss +1 -1
- package/src/theme.scss +1040 -1038
- package/src/components/Alert/Alert.scss +0 -98
- package/src/components/Badge/Badge.scss +0 -107
- package/src/components/ButtonGroup/ButtonGroup.scss +0 -33
- package/src/components/Card/Card.scss +0 -70
- package/src/components/CheckboxField/CheckboxField.scss +0 -61
- package/src/components/FileInputField/FileInputField.scss +0 -63
- package/src/components/FormLayout/FormLayoutCustomField.scss +0 -63
- package/src/components/Grid/Grid.scss +0 -63
- package/src/components/InputGroup/InputGroup.scss +0 -91
- package/src/components/Modal/Modal.scss +0 -78
- package/src/components/Modal/ModalBody.scss +0 -18
- package/src/components/Modal/ModalCloseButton.scss +0 -18
- package/src/components/Modal/ModalContent.scss +0 -5
- package/src/components/Modal/ModalFooter.scss +0 -35
- package/src/components/Modal/ModalHeader.scss +0 -30
- package/src/components/Modal/ModalTitle.scss +0 -10
- package/src/components/Paper/Paper.scss +0 -17
- package/src/components/Popover/Popover.scss +0 -236
- package/src/components/Popover/PopoverWrapper.scss +0 -3
- package/src/components/Radio/Radio.scss +0 -83
- package/src/components/ScrollView/ScrollView.scss +0 -227
- package/src/components/SelectField/SelectField.scss +0 -109
- package/src/components/Table/Table.scss +0 -28
- package/src/components/Table/_components/TableCell.scss +0 -26
- package/src/components/Tabs/Tabs.scss +0 -28
- package/src/components/Tabs/TabsItem.scss +0 -117
- package/src/components/Text/Text.scss +0 -40
- package/src/components/TextArea/TextArea.scss +0 -95
- package/src/components/TextField/TextField.scss +0 -107
- package/src/components/TextLink/TextLink.scss +0 -16
- package/src/components/Toggle/Toggle.scss +0 -61
- package/src/components/Toolbar/Toolbar.scss +0 -83
- /package/src/components/Button/{Button.scss → Button.module.scss} +0 -0
@@ -4,7 +4,7 @@ import { withGlobalProps } from '../../provider';
|
|
4
4
|
import { transferProps } from '../_helpers/transferProps';
|
5
5
|
import { classNames } from '../../utils/classNames';
|
6
6
|
import { getJustifyClassName } from './_helpers/getJustifyClassName';
|
7
|
-
import styles from './ModalFooter.scss';
|
7
|
+
import styles from './ModalFooter.module.scss';
|
8
8
|
|
9
9
|
export const ModalFooter = ({
|
10
10
|
children,
|
@@ -0,0 +1,37 @@
|
|
1
|
+
@use "settings";
|
2
|
+
@use "theme";
|
3
|
+
|
4
|
+
@layer components.modal {
|
5
|
+
.root {
|
6
|
+
display: flex;
|
7
|
+
flex: none;
|
8
|
+
flex-wrap: wrap;
|
9
|
+
gap: theme.$footer-gap;
|
10
|
+
align-items: center;
|
11
|
+
padding: theme.$padding-y theme.$padding-x;
|
12
|
+
border-top: theme.$separator-width solid theme.$separator-color;
|
13
|
+
border-bottom-right-radius: settings.$border-radius;
|
14
|
+
border-bottom-left-radius: settings.$border-radius;
|
15
|
+
background: theme.$footer-background;
|
16
|
+
}
|
17
|
+
|
18
|
+
.isRootJustifiedToStart {
|
19
|
+
justify-content: flex-start;
|
20
|
+
}
|
21
|
+
|
22
|
+
.isRootJustifiedToCenter {
|
23
|
+
justify-content: center;
|
24
|
+
}
|
25
|
+
|
26
|
+
.isRootJustifiedToEnd {
|
27
|
+
justify-content: flex-end;
|
28
|
+
}
|
29
|
+
|
30
|
+
.isRootJustifiedToSpaceBetween {
|
31
|
+
justify-content: space-between;
|
32
|
+
}
|
33
|
+
|
34
|
+
.isRootJustifiedToStretch {
|
35
|
+
display: block;
|
36
|
+
}
|
37
|
+
}
|
@@ -6,7 +6,7 @@ import {
|
|
6
6
|
import { transferProps } from '../_helpers/transferProps';
|
7
7
|
import { classNames } from '../../utils/classNames';
|
8
8
|
import { getJustifyClassName } from './_helpers/getJustifyClassName';
|
9
|
-
import styles from './ModalHeader.scss';
|
9
|
+
import styles from './ModalHeader.module.scss';
|
10
10
|
|
11
11
|
export const ModalHeader = ({
|
12
12
|
children,
|
@@ -0,0 +1,32 @@
|
|
1
|
+
@use "theme";
|
2
|
+
|
3
|
+
@layer components.modal {
|
4
|
+
.root {
|
5
|
+
display: flex;
|
6
|
+
flex: none;
|
7
|
+
gap: theme.$header-gap;
|
8
|
+
align-items: baseline;
|
9
|
+
padding: theme.$padding-y theme.$padding-x;
|
10
|
+
border-bottom: theme.$separator-width solid theme.$separator-color;
|
11
|
+
}
|
12
|
+
|
13
|
+
.isRootJustifiedToStart {
|
14
|
+
justify-content: flex-start;
|
15
|
+
}
|
16
|
+
|
17
|
+
.isRootJustifiedToCenter {
|
18
|
+
justify-content: center;
|
19
|
+
}
|
20
|
+
|
21
|
+
.isRootJustifiedToEnd {
|
22
|
+
justify-content: flex-end;
|
23
|
+
}
|
24
|
+
|
25
|
+
.isRootJustifiedToSpaceBetween {
|
26
|
+
justify-content: space-between;
|
27
|
+
}
|
28
|
+
|
29
|
+
.isRootJustifiedToStretch {
|
30
|
+
display: block;
|
31
|
+
}
|
32
|
+
}
|
@@ -1015,22 +1015,25 @@ 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
|
1019
|
-
|
1018
|
+
can specify **any HTML attribute you like.** All attributes that don't interfere
|
1019
|
+
with the API of the React component are forwarded to:
|
1020
1020
|
|
1021
|
-
- `<div>` HTML element in case of the `Modal` component. This `<div>` is not
|
1022
|
-
root, but its first child which represents the modal window.
|
1023
|
-
- root `<div>` HTML element in case of `ModalHeader`, `ModalBody`, `ModalContent`
|
1021
|
+
- the `<div>` HTML element in case of the `Modal` component. This `<div>` is not
|
1022
|
+
the root, but its first child which represents the modal window.
|
1023
|
+
- the root `<div>` HTML element in case of `ModalHeader`, `ModalBody`, `ModalContent`
|
1024
1024
|
and `ModalFooter` components.
|
1025
|
-
- heading HTML element
|
1026
|
-
|
1027
|
-
- native HTML `<button>` in case of the `ModalCloseButton` component.
|
1025
|
+
- the heading (e.g. `<h1>`) HTML element in case of the `ModalTitle` component.
|
1026
|
+
- the native HTML `<button>` in case of the `ModalCloseButton` component.
|
1028
1027
|
|
1029
1028
|
This enables making the component interactive and helps to improve its
|
1030
1029
|
accessibility.
|
1031
1030
|
|
1032
|
-
👉
|
1033
|
-
|
1031
|
+
👉 For the full list of supported attributes refer to:
|
1032
|
+
|
1033
|
+
- [`<div>` HTML element attributes][div-attributes]{:target="_blank"}
|
1034
|
+
- [`<h1>`-`<h6>` HTML element attributes][heading-attributes]{:target="_blank"}
|
1035
|
+
- [`<button>` HTML element attributes][button-attributes]{:target="_blank"}
|
1036
|
+
- [React common props]{:target="_blank"}
|
1034
1037
|
|
1035
1038
|
## API
|
1036
1039
|
|
@@ -1084,7 +1087,7 @@ accessibility.
|
|
1084
1087
|
| `--rui-Modal--fullscreen__width` | Width of fullscreen modal |
|
1085
1088
|
| `--rui-Modal--fullscreen__height` | Height of fullscreen modal |
|
1086
1089
|
|
1087
|
-
[
|
1088
|
-
[div]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
|
1089
|
-
[heading]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements#attributes
|
1090
|
-
[
|
1090
|
+
[button-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attributes
|
1091
|
+
[div-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
|
1092
|
+
[heading-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements#attributes
|
1093
|
+
[React common props]: https://react.dev/reference/react-dom/components/common#common-props
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
3
3
|
import { withGlobalProps } from '../../provider';
|
4
4
|
import { classNames } from '../../utils/classNames';
|
5
5
|
import { transferProps } from '../_helpers/transferProps';
|
6
|
-
import styles from './Paper.scss';
|
6
|
+
import styles from './Paper.module.scss';
|
7
7
|
|
8
8
|
export const Paper = ({
|
9
9
|
children,
|
@@ -0,0 +1,19 @@
|
|
1
|
+
@use "theme";
|
2
|
+
|
3
|
+
@layer components.paper {
|
4
|
+
.root {
|
5
|
+
padding: theme.$padding;
|
6
|
+
border: theme.$border-width solid theme.$border-color;
|
7
|
+
border-radius: theme.$border-radius;
|
8
|
+
background-color: theme.$background-color;
|
9
|
+
}
|
10
|
+
|
11
|
+
.isRootMuted {
|
12
|
+
background-color: theme.$muted-background-color;
|
13
|
+
opacity: theme.$muted-opacity;
|
14
|
+
}
|
15
|
+
|
16
|
+
.isRootRaised {
|
17
|
+
box-shadow: theme.$raised-box-shadow;
|
18
|
+
}
|
19
|
+
}
|
@@ -54,13 +54,15 @@ 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
|
58
|
-
|
59
|
-
|
57
|
+
can specify **any HTML attribute you like.** All attributes that don't interfere
|
58
|
+
with the API of the React component are forwarded to the root `<div>` HTML
|
59
|
+
element. This enables making the component interactive and helps to improve
|
60
60
|
its accessibility.
|
61
61
|
|
62
|
-
👉
|
63
|
-
|
62
|
+
👉 For the full list of supported attributes refer to:
|
63
|
+
|
64
|
+
- [`<div>` HTML element attributes][div-attributes]{:target="_blank"}
|
65
|
+
- [React common props]{:target="_blank"}
|
64
66
|
|
65
67
|
## API
|
66
68
|
|
@@ -79,5 +81,5 @@ its accessibility.
|
|
79
81
|
| `--rui-Paper--muted__opacity` | Opacity of muted paper |
|
80
82
|
| `--rui-Paper--raised__box-shadow` | Box shadow of raised paper |
|
81
83
|
|
82
|
-
[
|
83
|
-
[
|
84
|
+
[div-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
|
85
|
+
[React common props]: https://react.dev/reference/react-dom/components/common#common-props
|
@@ -6,7 +6,7 @@ import { classNames } from '../../utils/classNames';
|
|
6
6
|
import { transferProps } from '../_helpers/transferProps';
|
7
7
|
import getRootSideClassName from './_helpers/getRootSideClassName';
|
8
8
|
import getRootAlignmentClassName from './_helpers/getRootAlignmentClassName';
|
9
|
-
import styles from './Popover.scss';
|
9
|
+
import styles from './Popover.module.scss';
|
10
10
|
|
11
11
|
export const Popover = React.forwardRef((props, ref) => {
|
12
12
|
const {
|
@@ -0,0 +1,238 @@
|
|
1
|
+
// 1. Reset positioning for controlled variant.
|
2
|
+
// 2. Shift Popover so there is space for the arrow between Popover and reference element.
|
3
|
+
// 3. Add top offset in case it's not defined by external library.
|
4
|
+
|
5
|
+
@use "theme";
|
6
|
+
|
7
|
+
@layer components.popover {
|
8
|
+
.root {
|
9
|
+
position: absolute;
|
10
|
+
width: max-content;
|
11
|
+
max-width: theme.$max-width;
|
12
|
+
padding: theme.$padding;
|
13
|
+
text-align: left;
|
14
|
+
white-space: normal;
|
15
|
+
word-break: normal;
|
16
|
+
word-wrap: break-word;
|
17
|
+
color: theme.$color;
|
18
|
+
border: theme.$border-width solid theme.$border-color;
|
19
|
+
border-radius: theme.$border-radius;
|
20
|
+
background-color: theme.$background-color;
|
21
|
+
box-shadow: theme.$box-shadow;
|
22
|
+
}
|
23
|
+
|
24
|
+
.arrow {
|
25
|
+
position: absolute;
|
26
|
+
width: theme.$arrow-width;
|
27
|
+
height: theme.$arrow-height;
|
28
|
+
transform-origin: center bottom;
|
29
|
+
|
30
|
+
&::before,
|
31
|
+
&::after {
|
32
|
+
content: "";
|
33
|
+
position: absolute;
|
34
|
+
display: block;
|
35
|
+
border-style: solid;
|
36
|
+
border-color: transparent;
|
37
|
+
}
|
38
|
+
|
39
|
+
&::before {
|
40
|
+
bottom: 0;
|
41
|
+
border-width: theme.$arrow-height theme.$arrow-height 0;
|
42
|
+
border-top-color: theme.$border-color;
|
43
|
+
}
|
44
|
+
|
45
|
+
&::after {
|
46
|
+
bottom: theme.$border-width;
|
47
|
+
border-width: theme.$arrow-height theme.$arrow-height 0;
|
48
|
+
border-top-color: theme.$background-color;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
// Sides
|
53
|
+
.isRootAtTop {
|
54
|
+
bottom: 100%;
|
55
|
+
}
|
56
|
+
|
57
|
+
.isRootAtBottom {
|
58
|
+
top: 100%;
|
59
|
+
}
|
60
|
+
|
61
|
+
.isRootAtLeft {
|
62
|
+
right: 100%;
|
63
|
+
}
|
64
|
+
|
65
|
+
.isRootAtRight {
|
66
|
+
left: 100%;
|
67
|
+
}
|
68
|
+
|
69
|
+
// Arrows
|
70
|
+
.isRootAtTop > .arrow {
|
71
|
+
top: 100%;
|
72
|
+
}
|
73
|
+
|
74
|
+
.isRootAtBottom > .arrow {
|
75
|
+
bottom: 100%;
|
76
|
+
}
|
77
|
+
|
78
|
+
.isRootAtLeft > .arrow {
|
79
|
+
left: 100%;
|
80
|
+
}
|
81
|
+
|
82
|
+
.isRootAtRight > .arrow {
|
83
|
+
right: 100%;
|
84
|
+
}
|
85
|
+
|
86
|
+
// Side alignments: top
|
87
|
+
.isRootAtTop.isRootAtCenter {
|
88
|
+
left: 50%;
|
89
|
+
transform: translate(-50%, #{-1 * theme.$arrow-height});
|
90
|
+
}
|
91
|
+
|
92
|
+
.isRootAtTop.isRootAtStart {
|
93
|
+
left: 0;
|
94
|
+
transform: translate(0, #{-1 * theme.$arrow-height});
|
95
|
+
}
|
96
|
+
|
97
|
+
.isRootAtTop.isRootAtEnd {
|
98
|
+
right: 0;
|
99
|
+
transform: translate(0, #{-1 * theme.$arrow-height});
|
100
|
+
}
|
101
|
+
|
102
|
+
.isRootAtTop.isRootAtCenter > .arrow {
|
103
|
+
left: 50%;
|
104
|
+
transform: translate(-50%, 0) rotateZ(0);
|
105
|
+
}
|
106
|
+
|
107
|
+
.isRootAtTop.isRootAtStart > .arrow {
|
108
|
+
left: theme.$arrow-corner-offset;
|
109
|
+
transform: translate(0, 0) rotateZ(0);
|
110
|
+
}
|
111
|
+
|
112
|
+
.isRootAtTop.isRootAtEnd > .arrow {
|
113
|
+
right: theme.$arrow-corner-offset;
|
114
|
+
transform: translate(0, 0) rotateZ(0);
|
115
|
+
}
|
116
|
+
|
117
|
+
// Side alignments: bottom
|
118
|
+
.isRootAtBottom.isRootAtCenter {
|
119
|
+
left: 50%;
|
120
|
+
transform: translate(-50%, #{theme.$arrow-height});
|
121
|
+
}
|
122
|
+
|
123
|
+
.isRootAtBottom.isRootAtStart {
|
124
|
+
left: 0;
|
125
|
+
transform: translate(0, #{theme.$arrow-height});
|
126
|
+
}
|
127
|
+
|
128
|
+
.isRootAtBottom.isRootAtEnd {
|
129
|
+
right: 0;
|
130
|
+
transform: translate(0, #{theme.$arrow-height});
|
131
|
+
}
|
132
|
+
|
133
|
+
.isRootAtBottom.isRootAtCenter > .arrow {
|
134
|
+
left: 50%;
|
135
|
+
transform: translate(-50%, -100%) rotateZ(180deg);
|
136
|
+
}
|
137
|
+
|
138
|
+
.isRootAtBottom.isRootAtStart > .arrow {
|
139
|
+
left: theme.$arrow-corner-offset;
|
140
|
+
transform: translate(0, -100%) rotateZ(180deg);
|
141
|
+
}
|
142
|
+
|
143
|
+
.isRootAtBottom.isRootAtEnd > .arrow {
|
144
|
+
right: theme.$arrow-corner-offset;
|
145
|
+
transform: translate(0, -100%) rotateZ(180deg);
|
146
|
+
}
|
147
|
+
|
148
|
+
// Side alignments: left
|
149
|
+
.isRootAtLeft.isRootAtCenter {
|
150
|
+
top: 50%;
|
151
|
+
transform: translate(#{-1 * theme.$arrow-height}, -50%);
|
152
|
+
}
|
153
|
+
|
154
|
+
.isRootAtLeft.isRootAtStart {
|
155
|
+
top: 0;
|
156
|
+
transform: translate(#{-1 * theme.$arrow-height}, 0);
|
157
|
+
}
|
158
|
+
|
159
|
+
.isRootAtLeft.isRootAtEnd {
|
160
|
+
bottom: 0;
|
161
|
+
transform: translate(#{-1 * theme.$arrow-height}, 0);
|
162
|
+
}
|
163
|
+
|
164
|
+
.isRootAtLeft.isRootAtCenter > .arrow {
|
165
|
+
top: 50%;
|
166
|
+
transform: translate(0, -100%) rotateZ(-90deg);
|
167
|
+
}
|
168
|
+
|
169
|
+
.isRootAtLeft.isRootAtStart > .arrow {
|
170
|
+
top: theme.$arrow-corner-offset;
|
171
|
+
transform: translate(0, 0) rotateZ(-90deg);
|
172
|
+
}
|
173
|
+
|
174
|
+
.isRootAtLeft.isRootAtEnd > .arrow {
|
175
|
+
bottom: theme.$arrow-corner-offset;
|
176
|
+
transform: translate(0, -100%) rotateZ(-90deg);
|
177
|
+
}
|
178
|
+
|
179
|
+
// Side alignments: right
|
180
|
+
.isRootAtRight.isRootAtCenter {
|
181
|
+
top: 50%;
|
182
|
+
transform: translate(#{theme.$arrow-height}, -50%);
|
183
|
+
}
|
184
|
+
|
185
|
+
.isRootAtRight.isRootAtStart {
|
186
|
+
top: 0;
|
187
|
+
transform: translate(#{theme.$arrow-height}, 0);
|
188
|
+
}
|
189
|
+
|
190
|
+
.isRootAtRight.isRootAtEnd {
|
191
|
+
bottom: 0;
|
192
|
+
transform: translate(#{theme.$arrow-height}, 0);
|
193
|
+
}
|
194
|
+
|
195
|
+
.isRootAtRight.isRootAtCenter > .arrow {
|
196
|
+
top: 50%;
|
197
|
+
transform: translate(0, -100%) rotateZ(90deg);
|
198
|
+
}
|
199
|
+
|
200
|
+
.isRootAtRight.isRootAtStart > .arrow {
|
201
|
+
top: theme.$arrow-corner-offset;
|
202
|
+
transform: translate(0, 0) rotateZ(90deg);
|
203
|
+
}
|
204
|
+
|
205
|
+
.isRootAtRight.isRootAtEnd > .arrow {
|
206
|
+
bottom: theme.$arrow-corner-offset;
|
207
|
+
transform: translate(0, -100%) rotateZ(90deg);
|
208
|
+
}
|
209
|
+
|
210
|
+
// Controlled placement
|
211
|
+
.isRootControlled.isRootAtTop,
|
212
|
+
.isRootControlled.isRootAtBottom,
|
213
|
+
.isRootControlled.isRootAtLeft,
|
214
|
+
.isRootControlled.isRootAtRight {
|
215
|
+
inset: unset; // 1.
|
216
|
+
}
|
217
|
+
|
218
|
+
.isRootControlled.isRootAtTop {
|
219
|
+
transform: translate(0, #{-1 * theme.$arrow-height}); // 2.
|
220
|
+
}
|
221
|
+
|
222
|
+
.isRootControlled.isRootAtBottom {
|
223
|
+
transform: translate(0, #{theme.$arrow-height}); // 2.
|
224
|
+
}
|
225
|
+
|
226
|
+
.isRootControlled.isRootAtLeft {
|
227
|
+
transform: translate(#{-1 * theme.$arrow-height}, 0); // 2.
|
228
|
+
}
|
229
|
+
|
230
|
+
.isRootControlled.isRootAtRight {
|
231
|
+
transform: translate(#{theme.$arrow-height}, 0); // 2.
|
232
|
+
}
|
233
|
+
|
234
|
+
.isRootControlled.isRootAtLeft.isRootAtStart,
|
235
|
+
.isRootControlled.isRootAtRight.isRootAtStart {
|
236
|
+
top: 0; // 3.
|
237
|
+
}
|
238
|
+
}
|
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
3
3
|
import { withGlobalProps } from '../../provider';
|
4
4
|
import { transferProps } from '../_helpers/transferProps';
|
5
|
-
import styles from './PopoverWrapper.scss';
|
5
|
+
import styles from './PopoverWrapper.module.scss';
|
6
6
|
|
7
7
|
export const PopoverWrapper = ({
|
8
8
|
children,
|
@@ -36,4 +36,3 @@ PopoverWrapper.propTypes = {
|
|
36
36
|
export const PopoverWrapperWithContext = withGlobalProps(PopoverWrapper, 'PopoverWrapper');
|
37
37
|
|
38
38
|
export default PopoverWrapperWithContext;
|
39
|
-
|
@@ -287,13 +287,15 @@ 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
|
291
|
-
|
292
|
-
|
290
|
+
can specify **any HTML attribute you like.** All attributes that don't interfere
|
291
|
+
with the API of the React component are forwarded to the root `<div>` HTML
|
292
|
+
element. This enables making the component interactive and helps to improve
|
293
293
|
its accessibility.
|
294
294
|
|
295
|
-
👉
|
296
|
-
|
295
|
+
👉 For the full list of supported attributes refer to:
|
296
|
+
|
297
|
+
- [`<div>` HTML element attributes][div-attributes]{:target="_blank"}
|
298
|
+
- [React common props]{:target="_blank"}
|
297
299
|
|
298
300
|
## Forwarding ref
|
299
301
|
|
@@ -321,7 +323,7 @@ which enables [Advanced Positioning](#advanced-positioning).
|
|
321
323
|
| `--rui-Popover__background-color` | Background color |
|
322
324
|
| `--rui-Popover__box-shadow` | Popover box shadow |
|
323
325
|
|
326
|
+
[div-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
|
324
327
|
[Floating UI]: https://floating-ui.com/docs/react-dom
|
325
|
-
[React
|
326
|
-
[div]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
|
328
|
+
[React common props]: https://react.dev/reference/react-dom/components/common#common-props
|
327
329
|
[ref]: https://reactjs.org/docs/refs-and-the-dom.html
|
@@ -279,13 +279,15 @@ It's possible to disable just some options or the whole set.
|
|
279
279
|
## Forwarding HTML Attributes
|
280
280
|
|
281
281
|
In addition to the options below in the [component's API](#api) section, you
|
282
|
-
can specify
|
283
|
-
|
284
|
-
|
285
|
-
|
282
|
+
can specify **any HTML attribute you like.** All attributes that don't interfere
|
283
|
+
with the API of the React component are forwarded to the root `<input>` HTML
|
284
|
+
element. This enables making the component interactive and helps to improve
|
285
|
+
its accessibility.
|
286
286
|
|
287
|
-
👉
|
288
|
-
|
287
|
+
👉 For the full list of supported attributes refer to:
|
288
|
+
|
289
|
+
- [`<input type="radio" />` HTML element attributes][radio-attributes]{:target="_blank"}
|
290
|
+
- [React common props]{:target="_blank"}
|
289
291
|
|
290
292
|
## API
|
291
293
|
|
@@ -301,8 +303,8 @@ options. On top of that, the following options are available for Radio.
|
|
301
303
|
| `--rui-FormField--check__input--radio__border-radius` | Input corner radius |
|
302
304
|
| `--rui-FormField--check__input--radio--checked__background-image` | Checked input background image (inline, URL, …) |
|
303
305
|
|
304
|
-
[nng-radio]: https://www.nngroup.com/articles/checkboxes-vs-radio-buttons/
|
305
|
-
[fieldset]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset
|
306
306
|
[accessibility]: https://www.w3.org/WAI/tutorials/forms/grouping/
|
307
|
-
[
|
308
|
-
[radio]: https://
|
307
|
+
[fieldset]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset
|
308
|
+
[nng-radio]: https://www.nngroup.com/articles/checkboxes-vs-radio-buttons/
|
309
|
+
[radio-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio#additional_attributes
|
310
|
+
[React common props]: https://react.dev/reference/react-dom/components/common#common-props
|
@@ -6,7 +6,7 @@ import { getRootValidationStateClassName } from '../_helpers/getRootValidationSt
|
|
6
6
|
import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
|
7
7
|
import { transferProps } from '../_helpers/transferProps';
|
8
8
|
import { FormLayoutContext } from '../FormLayout';
|
9
|
-
import styles from './Radio.scss';
|
9
|
+
import styles from './Radio.module.scss';
|
10
10
|
|
11
11
|
export const Radio = ({
|
12
12
|
disabled,
|
@@ -0,0 +1,85 @@
|
|
1
|
+
// 1. Legends are tricky to style, let's use a `div` instead.
|
2
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset#styling_with_css
|
3
|
+
|
4
|
+
@use "../../styles/tools/form-fields/box-field-elements";
|
5
|
+
@use "../../styles/tools/form-fields/box-field-layout";
|
6
|
+
@use "../../styles/tools/form-fields/foundation";
|
7
|
+
@use "../../styles/tools/form-fields/inline-field-elements";
|
8
|
+
@use "../../styles/tools/form-fields/inline-field-layout";
|
9
|
+
@use "../../styles/tools/form-fields/variants";
|
10
|
+
@use "../../styles/tools/accessibility";
|
11
|
+
@use "../../styles/tools/reset";
|
12
|
+
@use "../../styles/tools/spacing";
|
13
|
+
|
14
|
+
@layer components.radio {
|
15
|
+
// Foundation
|
16
|
+
.root {
|
17
|
+
@include foundation.root();
|
18
|
+
@include foundation.fieldset();
|
19
|
+
@include variants.visual(check);
|
20
|
+
}
|
21
|
+
|
22
|
+
// 1.
|
23
|
+
.legend {
|
24
|
+
@include accessibility.hide-text();
|
25
|
+
}
|
26
|
+
|
27
|
+
// 1.
|
28
|
+
.label,
|
29
|
+
.optionLabel {
|
30
|
+
@include foundation.label();
|
31
|
+
}
|
32
|
+
|
33
|
+
.options {
|
34
|
+
@include reset.list();
|
35
|
+
}
|
36
|
+
|
37
|
+
.option {
|
38
|
+
@include inline-field-layout.field($type: radio);
|
39
|
+
@include inline-field-elements.min-tap-target($type: radio);
|
40
|
+
}
|
41
|
+
|
42
|
+
.input {
|
43
|
+
@include inline-field-elements.check-input($type: radio);
|
44
|
+
}
|
45
|
+
|
46
|
+
.helpText,
|
47
|
+
.validationText {
|
48
|
+
@include foundation.help-text();
|
49
|
+
}
|
50
|
+
|
51
|
+
.isRootRequired .label {
|
52
|
+
@include foundation.label-required();
|
53
|
+
}
|
54
|
+
|
55
|
+
// States
|
56
|
+
.isRootStateInvalid {
|
57
|
+
@include variants.validation(invalid);
|
58
|
+
}
|
59
|
+
|
60
|
+
.isRootStateValid {
|
61
|
+
@include variants.validation(valid);
|
62
|
+
}
|
63
|
+
|
64
|
+
.isRootStateWarning {
|
65
|
+
@include variants.validation(warning);
|
66
|
+
}
|
67
|
+
|
68
|
+
// Layouts
|
69
|
+
.isRootLayoutVertical,
|
70
|
+
.isRootLayoutHorizontal {
|
71
|
+
@include box-field-layout.vertical($has-list: true);
|
72
|
+
}
|
73
|
+
|
74
|
+
.isRootLayoutHorizontal {
|
75
|
+
@include box-field-layout.horizontal($has-min-tap-target: true);
|
76
|
+
}
|
77
|
+
|
78
|
+
.isRootFullWidth {
|
79
|
+
@include box-field-layout.full-width();
|
80
|
+
}
|
81
|
+
|
82
|
+
.isRootInFormLayout {
|
83
|
+
@include box-field-layout.in-form-layout($is-fieldset: true);
|
84
|
+
}
|
85
|
+
}
|