@react-ui-org/react-ui 0.47.0 → 0.48.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.
Files changed (94) hide show
  1. package/dist/lib.development.js +330 -54
  2. package/dist/lib.js +1 -1
  3. package/package.json +1 -1
  4. package/src/lib/components/Alert/README.mdx +4 -2
  5. package/src/lib/components/Alert/index.js +1 -1
  6. package/src/lib/components/Badge/README.mdx +1 -1
  7. package/src/lib/components/Badge/index.js +1 -1
  8. package/src/lib/components/Button/Button.jsx +31 -31
  9. package/src/lib/components/Button/README.mdx +4 -2
  10. package/src/lib/components/Button/index.js +1 -1
  11. package/src/lib/components/ButtonGroup/ButtonGroup.jsx +2 -1
  12. package/src/lib/components/ButtonGroup/README.mdx +4 -2
  13. package/src/lib/components/Card/README.mdx +7 -5
  14. package/src/lib/components/CheckboxField/CheckboxField.jsx +27 -28
  15. package/src/lib/components/CheckboxField/README.mdx +1 -1
  16. package/src/lib/components/CheckboxField/index.js +1 -1
  17. package/src/lib/components/FileInputField/FileInputField.jsx +27 -27
  18. package/src/lib/components/FileInputField/README.mdx +1 -1
  19. package/src/lib/components/FileInputField/index.js +1 -1
  20. package/src/lib/components/FormLayout/README.mdx +15 -13
  21. package/src/lib/components/Grid/Grid.jsx +31 -28
  22. package/src/lib/components/Grid/Grid.scss +10 -15
  23. package/src/lib/components/Grid/GridSpan.jsx +5 -4
  24. package/src/lib/components/Grid/README.mdx +34 -36
  25. package/src/lib/components/Grid/_helpers/generateResponsiveCustomProperties.js +11 -3
  26. package/src/lib/components/Grid/_settings.scss +18 -0
  27. package/src/lib/components/Grid/_tools.scss +5 -5
  28. package/src/lib/components/Modal/Modal.jsx +147 -250
  29. package/src/lib/components/Modal/Modal.scss +7 -55
  30. package/src/lib/components/Modal/ModalBody.jsx +64 -0
  31. package/src/lib/components/Modal/ModalBody.scss +18 -0
  32. package/src/lib/components/Modal/ModalCloseButton.jsx +61 -0
  33. package/src/lib/components/Modal/ModalCloseButton.scss +18 -0
  34. package/src/lib/components/Modal/ModalContent.jsx +43 -0
  35. package/src/lib/components/Modal/ModalContent.scss +5 -0
  36. package/src/lib/components/Modal/ModalFooter.jsx +46 -0
  37. package/src/lib/components/Modal/ModalFooter.scss +35 -0
  38. package/src/lib/components/Modal/ModalHeader.jsx +48 -0
  39. package/src/lib/components/Modal/ModalHeader.scss +30 -0
  40. package/src/lib/components/Modal/ModalTitle.jsx +45 -0
  41. package/src/lib/components/Modal/ModalTitle.scss +10 -0
  42. package/src/lib/components/Modal/README.mdx +842 -197
  43. package/src/lib/components/Modal/_helpers/getJustifyClassName.js +19 -0
  44. package/src/lib/components/Modal/_helpers/getScrollingClassName.js +11 -0
  45. package/src/lib/components/Modal/_settings.scss +1 -5
  46. package/src/lib/components/Modal/_theme.scss +6 -0
  47. package/src/lib/components/Modal/index.js +7 -1
  48. package/src/lib/components/Paper/README.mdx +1 -1
  49. package/src/lib/components/Paper/index.js +1 -1
  50. package/src/lib/components/Popover/Popover.jsx +24 -24
  51. package/src/lib/components/Popover/Popover.scss +7 -6
  52. package/src/lib/components/Popover/PopoverWrapper.jsx +5 -5
  53. package/src/lib/components/Popover/PopoverWrapper.scss +3 -0
  54. package/src/lib/components/Popover/README.mdx +13 -11
  55. package/src/lib/components/Popover/_theme.scss +1 -1
  56. package/src/lib/components/Radio/README.mdx +1 -1
  57. package/src/lib/components/Radio/Radio.jsx +37 -27
  58. package/src/lib/components/Radio/index.js +1 -1
  59. package/src/lib/components/ScrollView/README.mdx +146 -84
  60. package/src/lib/components/ScrollView/ScrollView.jsx +104 -113
  61. package/src/lib/components/ScrollView/ScrollView.scss +18 -16
  62. package/src/lib/components/ScrollView/index.js +1 -1
  63. package/src/lib/components/SelectField/README.mdx +66 -2
  64. package/src/lib/components/SelectField/SelectField.jsx +93 -49
  65. package/src/lib/components/SelectField/_components/Option/Option.jsx +46 -0
  66. package/src/lib/components/SelectField/_components/Option/index.js +1 -0
  67. package/src/lib/components/SelectField/index.js +1 -1
  68. package/src/lib/components/Table/README.mdx +4 -2
  69. package/src/lib/components/Table/Table.jsx +1 -1
  70. package/src/lib/components/Table/index.js +1 -1
  71. package/src/lib/components/Tabs/README.mdx +5 -3
  72. package/src/lib/components/Tabs/TabsItem.scss +1 -2
  73. package/src/lib/components/Text/README.mdx +9 -7
  74. package/src/lib/components/Text/index.js +1 -1
  75. package/src/lib/components/TextArea/README.mdx +1 -1
  76. package/src/lib/components/TextArea/TextArea.jsx +33 -33
  77. package/src/lib/components/TextArea/index.js +1 -1
  78. package/src/lib/components/TextField/README.mdx +3 -3
  79. package/src/lib/components/TextField/TextField.jsx +33 -34
  80. package/src/lib/components/TextField/index.js +1 -1
  81. package/src/lib/components/TextLink/README.mdx +1 -1
  82. package/src/lib/components/TextLink/index.js +1 -1
  83. package/src/lib/components/Toggle/README.mdx +1 -1
  84. package/src/lib/components/Toggle/Toggle.jsx +28 -28
  85. package/src/lib/components/Toggle/index.js +1 -1
  86. package/src/lib/components/Toolbar/README.mdx +8 -6
  87. package/src/lib/components/_helpers/transferProps.js +1 -1
  88. package/src/lib/index.js +24 -16
  89. package/src/lib/provider/withGlobalProps.jsx +20 -3
  90. package/src/lib/theme.scss +18 -26
  91. package/src/lib/translations/en.js +1 -1
  92. package/src/lib/components/Grid/_theme.scss +0 -11
  93. package/src/lib/components/ScrollView/_theme.scss +0 -2
  94. package/src/lib/components/withForwardedRef.jsx +0 -11
@@ -0,0 +1,18 @@
1
+ @use "sass:map";
2
+ @use "../../styles/theme/typography";
3
+ @use "../../styles/tools/accessibility";
4
+ @use "../../styles/tools/reset";
5
+ @use "../../styles/tools/spacing";
6
+
7
+ .root {
8
+ @include reset.button();
9
+ @include accessibility.min-tap-target();
10
+
11
+ font-size: map.get(typography.$size-values, 3);
12
+ line-height: 1;
13
+ color: inherit;
14
+
15
+ &:disabled {
16
+ cursor: var(--rui-disabled-cursor);
17
+ }
18
+ }
@@ -0,0 +1,43 @@
1
+ import PropTypes from 'prop-types';
2
+ import React from 'react';
3
+ import { withGlobalProps } from '../../provider';
4
+ import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
5
+ import styles from './ModalContent.scss';
6
+
7
+ export const ModalContent = ({
8
+ children,
9
+ id,
10
+ }) => {
11
+ if (isChildrenEmpty(children)) {
12
+ return null;
13
+ }
14
+
15
+ return (
16
+ <div
17
+ className={styles.root}
18
+ id={id}
19
+ >
20
+ {children}
21
+ </div>
22
+ );
23
+ };
24
+
25
+ ModalContent.defaultProps = {
26
+ children: null,
27
+ id: undefined,
28
+ };
29
+
30
+ ModalContent.propTypes = {
31
+ /**
32
+ * Content of the modal.
33
+ */
34
+ children: PropTypes.node,
35
+ /**
36
+ * ID of the root HTML element.
37
+ */
38
+ id: PropTypes.string,
39
+ };
40
+
41
+ export const ModalContentWithGlobalProps = withGlobalProps(ModalContent, 'ModalContent');
42
+
43
+ export default ModalContentWithGlobalProps;
@@ -0,0 +1,5 @@
1
+ @use "theme";
2
+
3
+ .root {
4
+ padding: theme.$padding-y theme.$padding-x;
5
+ }
@@ -0,0 +1,46 @@
1
+ import PropTypes from 'prop-types';
2
+ import React from 'react';
3
+ import { withGlobalProps } from '../../provider';
4
+ import { classNames } from '../../utils/classNames';
5
+ import { getJustifyClassName } from './_helpers/getJustifyClassName';
6
+ import styles from './ModalFooter.scss';
7
+
8
+ export const ModalFooter = ({
9
+ children,
10
+ id,
11
+ justify,
12
+ }) => (
13
+ <div
14
+ className={classNames(
15
+ styles.root,
16
+ getJustifyClassName(justify, styles),
17
+ )}
18
+ id={id}
19
+ >
20
+ {children}
21
+ </div>
22
+ );
23
+
24
+ ModalFooter.defaultProps = {
25
+ id: undefined,
26
+ justify: 'center',
27
+ };
28
+
29
+ ModalFooter.propTypes = {
30
+ /**
31
+ * Content of the footer (preferably nested `Button` elements).
32
+ */
33
+ children: PropTypes.node.isRequired,
34
+ /**
35
+ * ID of the root HTML element.
36
+ */
37
+ id: PropTypes.string,
38
+ /**
39
+ * Horizontal alignment (distribution) of individual buttons.
40
+ */
41
+ justify: PropTypes.oneOf(['start', 'center', 'end', 'space-between', 'stretch']),
42
+ };
43
+
44
+ export const ModalFooterWithGlobalProps = withGlobalProps(ModalFooter, 'ModalFooter');
45
+
46
+ export default ModalFooterWithGlobalProps;
@@ -0,0 +1,35 @@
1
+ @use "settings";
2
+ @use "theme";
3
+
4
+ .root {
5
+ display: flex;
6
+ flex: none;
7
+ flex-wrap: wrap;
8
+ gap: theme.$footer-gap;
9
+ align-items: center;
10
+ padding: theme.$padding-y theme.$padding-x;
11
+ border-top: theme.$separator-width solid theme.$separator-color;
12
+ border-bottom-right-radius: settings.$border-radius;
13
+ border-bottom-left-radius: settings.$border-radius;
14
+ background: theme.$footer-background;
15
+ }
16
+
17
+ .isJustifiedToStart {
18
+ justify-content: flex-start;
19
+ }
20
+
21
+ .isJustifiedToCenter {
22
+ justify-content: center;
23
+ }
24
+
25
+ .isJustifiedToEnd {
26
+ justify-content: flex-end;
27
+ }
28
+
29
+ .isJustifiedToSpaceBetween {
30
+ justify-content: space-between;
31
+ }
32
+
33
+ .isJustifiedToStretch {
34
+ display: block;
35
+ }
@@ -0,0 +1,48 @@
1
+ import PropTypes from 'prop-types';
2
+ import React from 'react';
3
+ import {
4
+ withGlobalProps,
5
+ } from '../../provider';
6
+ import { classNames } from '../../utils/classNames';
7
+ import { getJustifyClassName } from './_helpers/getJustifyClassName';
8
+ import styles from './ModalHeader.scss';
9
+
10
+ export const ModalHeader = ({
11
+ children,
12
+ id,
13
+ justify,
14
+ }) => (
15
+ <div
16
+ className={classNames(
17
+ styles.root,
18
+ getJustifyClassName(justify, styles),
19
+ )}
20
+ id={id}
21
+ >
22
+ {children}
23
+ </div>
24
+ );
25
+
26
+ ModalHeader.defaultProps = {
27
+ id: undefined,
28
+ justify: 'space-between',
29
+ };
30
+
31
+ ModalHeader.propTypes = {
32
+ /**
33
+ * Content of the header (preferably ModalTitle and ModalCloseButton).
34
+ */
35
+ children: PropTypes.node.isRequired,
36
+ /**
37
+ * ID of the root HTML element.
38
+ */
39
+ id: PropTypes.string,
40
+ /**
41
+ * Horizontal alignment (distribution) of individual buttons.
42
+ */
43
+ justify: PropTypes.oneOf(['start', 'center', 'end', 'space-between', 'stretch']),
44
+ };
45
+
46
+ export const ModalHeaderWithGlobalProps = withGlobalProps(ModalHeader, 'ModalHeader');
47
+
48
+ export default ModalHeaderWithGlobalProps;
@@ -0,0 +1,30 @@
1
+ @use "theme";
2
+
3
+ .root {
4
+ display: flex;
5
+ flex: none;
6
+ gap: theme.$header-gap;
7
+ align-items: baseline;
8
+ padding: theme.$padding-y theme.$padding-x;
9
+ border-bottom: theme.$separator-width solid theme.$separator-color;
10
+ }
11
+
12
+ .isJustifiedToStart {
13
+ justify-content: flex-start;
14
+ }
15
+
16
+ .isJustifiedToCenter {
17
+ justify-content: center;
18
+ }
19
+
20
+ .isJustifiedToEnd {
21
+ justify-content: flex-end;
22
+ }
23
+
24
+ .isJustifiedToSpaceBetween {
25
+ justify-content: space-between;
26
+ }
27
+
28
+ .isJustifiedToStretch {
29
+ display: block;
30
+ }
@@ -0,0 +1,45 @@
1
+ import PropTypes from 'prop-types';
2
+ import React from 'react';
3
+ import {
4
+ withGlobalProps,
5
+ } from '../../provider';
6
+ import styles from './ModalTitle.scss';
7
+
8
+ export const ModalTitle = ({
9
+ children,
10
+ id,
11
+ level,
12
+ }) => {
13
+ const HeadingTag = `h${level}`;
14
+
15
+ return (
16
+ <HeadingTag className={styles.root} id={id}>
17
+ {children}
18
+ </HeadingTag>
19
+ );
20
+ };
21
+
22
+ ModalTitle.defaultProps = {
23
+ id: undefined,
24
+ level: 2,
25
+ };
26
+
27
+ ModalTitle.propTypes = {
28
+ /**
29
+ * Content of the header (preferably ModalTitle and ModalCloseButton).
30
+ */
31
+ children: PropTypes.node.isRequired,
32
+ /**
33
+ * ID of the root HTML element.
34
+ */
35
+ id: PropTypes.string,
36
+ /**
37
+ * Optional heading level. Preferably `1` or `2` should be used, see
38
+ * [W3C recommendation](https://github.com/w3c/aria-practices/issues/551#issuecomment-365134527).
39
+ */
40
+ level: PropTypes.number,
41
+ };
42
+
43
+ export const ModalTitleWithGlobalProps = withGlobalProps(ModalTitle, 'ModalTitle');
44
+
45
+ export default ModalTitleWithGlobalProps;
@@ -0,0 +1,10 @@
1
+ @use "settings";
2
+
3
+ .root {
4
+ margin-block: 0;
5
+ font-size: settings.$title-font-size;
6
+
7
+ &:not(:last-child) {
8
+ margin-bottom: 0;
9
+ }
10
+ }