@react-ui-org/react-ui 0.47.0 → 0.49.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. package/dist/lib.development.js +465 -93
  2. package/dist/lib.js +1 -1
  3. package/package.json +1 -1
  4. package/src/lib/components/Alert/Alert.jsx +3 -0
  5. package/src/lib/components/Alert/Alert.scss +10 -10
  6. package/src/lib/components/Alert/README.mdx +18 -2
  7. package/src/lib/components/Alert/index.js +1 -1
  8. package/src/lib/components/Badge/Badge.jsx +4 -8
  9. package/src/lib/components/Badge/Badge.scss +21 -21
  10. package/src/lib/components/Badge/README.mdx +15 -1
  11. package/src/lib/components/Badge/index.js +1 -1
  12. package/src/lib/components/Button/Button.jsx +23 -34
  13. package/src/lib/components/Button/README.mdx +21 -7
  14. package/src/lib/components/Button/_base.scss +20 -20
  15. package/src/lib/components/Button/_priorities.scss +35 -35
  16. package/src/lib/components/Button/helpers/getRootLabelVisibilityClassName.js +7 -7
  17. package/src/lib/components/Button/helpers/getRootPriorityClassName.js +3 -3
  18. package/src/lib/components/Button/index.js +1 -1
  19. package/src/lib/components/ButtonGroup/ButtonGroup.jsx +2 -8
  20. package/src/lib/components/ButtonGroup/README.mdx +18 -2
  21. package/src/lib/components/Card/Card.jsx +6 -10
  22. package/src/lib/components/Card/Card.scss +13 -13
  23. package/src/lib/components/Card/CardBody.jsx +6 -10
  24. package/src/lib/components/Card/CardFooter.jsx +6 -7
  25. package/src/lib/components/Card/README.mdx +21 -5
  26. package/src/lib/components/CheckboxField/CheckboxField.jsx +17 -44
  27. package/src/lib/components/CheckboxField/README.mdx +18 -6
  28. package/src/lib/components/CheckboxField/index.js +1 -1
  29. package/src/lib/components/FileInputField/FileInputField.jsx +20 -29
  30. package/src/lib/components/FileInputField/FileInputField.scss +3 -3
  31. package/src/lib/components/FileInputField/README.mdx +30 -28
  32. package/src/lib/components/FileInputField/index.js +1 -1
  33. package/src/lib/components/FormLayout/FormLayout.jsx +5 -9
  34. package/src/lib/components/FormLayout/FormLayout.scss +3 -3
  35. package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +4 -1
  36. package/src/lib/components/FormLayout/FormLayoutCustomField.scss +8 -8
  37. package/src/lib/components/FormLayout/README.mdx +28 -13
  38. package/src/lib/components/Grid/Grid.jsx +31 -35
  39. package/src/lib/components/Grid/Grid.scss +10 -15
  40. package/src/lib/components/Grid/GridSpan.jsx +5 -11
  41. package/src/lib/components/Grid/README.mdx +48 -36
  42. package/src/lib/components/Grid/_helpers/generateResponsiveCustomProperties.js +11 -3
  43. package/src/lib/components/Grid/_settings.scss +18 -0
  44. package/src/lib/components/Grid/_tools.scss +5 -5
  45. package/src/lib/components/Modal/Modal.jsx +147 -254
  46. package/src/lib/components/Modal/Modal.scss +7 -55
  47. package/src/lib/components/Modal/ModalBody.jsx +60 -0
  48. package/src/lib/components/Modal/ModalBody.scss +18 -0
  49. package/src/lib/components/Modal/ModalCloseButton.jsx +45 -0
  50. package/src/lib/components/Modal/ModalCloseButton.scss +18 -0
  51. package/src/lib/components/Modal/ModalContent.jsx +39 -0
  52. package/src/lib/components/Modal/ModalContent.scss +5 -0
  53. package/src/lib/components/Modal/ModalFooter.jsx +42 -0
  54. package/src/lib/components/Modal/ModalFooter.scss +35 -0
  55. package/src/lib/components/Modal/ModalHeader.jsx +44 -0
  56. package/src/lib/components/Modal/ModalHeader.scss +30 -0
  57. package/src/lib/components/Modal/ModalTitle.jsx +44 -0
  58. package/src/lib/components/Modal/ModalTitle.scss +10 -0
  59. package/src/lib/components/Modal/README.mdx +865 -195
  60. package/src/lib/components/Modal/_helpers/getJustifyClassName.js +19 -0
  61. package/src/lib/components/Modal/_helpers/getScrollingClassName.js +11 -0
  62. package/src/lib/components/Modal/_settings.scss +1 -5
  63. package/src/lib/components/Modal/_theme.scss +6 -0
  64. package/src/lib/components/Modal/index.js +7 -1
  65. package/src/lib/components/Paper/Paper.jsx +5 -9
  66. package/src/lib/components/Paper/Paper.scss +2 -2
  67. package/src/lib/components/Paper/README.mdx +15 -1
  68. package/src/lib/components/Paper/index.js +1 -1
  69. package/src/lib/components/Popover/Popover.jsx +14 -30
  70. package/src/lib/components/Popover/Popover.scss +7 -6
  71. package/src/lib/components/Popover/PopoverWrapper.jsx +5 -12
  72. package/src/lib/components/Popover/PopoverWrapper.scss +3 -0
  73. package/src/lib/components/Popover/README.mdx +32 -11
  74. package/src/lib/components/Popover/_theme.scss +1 -1
  75. package/src/lib/components/Radio/README.mdx +13 -6
  76. package/src/lib/components/Radio/Radio.jsx +39 -29
  77. package/src/lib/components/Radio/Radio.scss +3 -3
  78. package/src/lib/components/Radio/index.js +1 -1
  79. package/src/lib/components/ScrollView/README.mdx +165 -84
  80. package/src/lib/components/ScrollView/ScrollView.jsx +115 -117
  81. package/src/lib/components/ScrollView/ScrollView.scss +18 -16
  82. package/src/lib/components/ScrollView/index.js +1 -1
  83. package/src/lib/components/SelectField/README.mdx +83 -7
  84. package/src/lib/components/SelectField/SelectField.jsx +86 -61
  85. package/src/lib/components/SelectField/SelectField.scss +8 -8
  86. package/src/lib/components/SelectField/_components/Option/Option.jsx +46 -0
  87. package/src/lib/components/SelectField/_components/Option/index.js +1 -0
  88. package/src/lib/components/SelectField/index.js +1 -1
  89. package/src/lib/components/Table/README.mdx +25 -9
  90. package/src/lib/components/Table/Table.jsx +43 -101
  91. package/src/lib/components/Table/Table.scss +0 -24
  92. package/src/lib/components/Table/_components/TableBodyCell/TableBodyCell.jsx +46 -0
  93. package/src/lib/components/Table/_components/TableBodyCell/index.js +1 -0
  94. package/src/lib/components/Table/_components/TableCell.scss +25 -0
  95. package/src/lib/components/Table/_components/TableHeaderCell/TableHeaderCell.jsx +71 -0
  96. package/src/lib/components/Table/_components/TableHeaderCell/index.js +1 -0
  97. package/src/lib/components/Table/index.js +1 -1
  98. package/src/lib/components/Tabs/README.mdx +21 -3
  99. package/src/lib/components/Tabs/Tabs.jsx +6 -1
  100. package/src/lib/components/Tabs/TabsItem.jsx +3 -0
  101. package/src/lib/components/Tabs/TabsItem.scss +1 -2
  102. package/src/lib/components/Text/README.mdx +25 -7
  103. package/src/lib/components/Text/Text.jsx +3 -7
  104. package/src/lib/components/Text/Text.scss +6 -6
  105. package/src/lib/components/Text/_helpers/getRootClampClassName.js +2 -2
  106. package/src/lib/components/Text/_helpers/getRootHyphensClassName.js +2 -2
  107. package/src/lib/components/Text/_helpers/getRootWordWrappingClassName.js +2 -2
  108. package/src/lib/components/Text/index.js +1 -1
  109. package/src/lib/components/TextArea/README.mdx +34 -31
  110. package/src/lib/components/TextArea/TextArea.jsx +23 -63
  111. package/src/lib/components/TextArea/TextArea.scss +8 -8
  112. package/src/lib/components/TextArea/index.js +1 -1
  113. package/src/lib/components/TextField/README.mdx +56 -54
  114. package/src/lib/components/TextField/TextField.jsx +25 -52
  115. package/src/lib/components/TextField/TextField.scss +9 -9
  116. package/src/lib/components/TextField/index.js +1 -1
  117. package/src/lib/components/TextLink/README.mdx +13 -6
  118. package/src/lib/components/TextLink/TextLink.jsx +0 -10
  119. package/src/lib/components/TextLink/index.js +1 -1
  120. package/src/lib/components/Toggle/README.mdx +18 -6
  121. package/src/lib/components/Toggle/Toggle.jsx +18 -44
  122. package/src/lib/components/Toggle/index.js +1 -1
  123. package/src/lib/components/Toolbar/README.mdx +21 -6
  124. package/src/lib/components/Toolbar/Toolbar.jsx +9 -43
  125. package/src/lib/components/Toolbar/Toolbar.scss +24 -12
  126. package/src/lib/components/Toolbar/ToolbarGroup.jsx +7 -26
  127. package/src/lib/components/Toolbar/ToolbarItem.jsx +3 -7
  128. package/src/lib/components/Toolbar/_helpers/getAlignClassName.js +19 -0
  129. package/src/lib/components/Toolbar/_helpers/getJustifyClassName.js +16 -0
  130. package/src/lib/components/_helpers/getRootColorClassName.js +10 -10
  131. package/src/lib/components/_helpers/getRootSizeClassName.js +3 -3
  132. package/src/lib/components/_helpers/transferProps.js +1 -1
  133. package/src/lib/index.js +24 -16
  134. package/src/lib/provider/withGlobalProps.jsx +20 -3
  135. package/src/lib/styles/tools/form-fields/_box-field-layout.scss +15 -15
  136. package/src/lib/styles/tools/form-fields/_inline-field-elements.scss +1 -1
  137. package/src/lib/styles/tools/form-fields/_inline-field-layout.scss +9 -9
  138. package/src/lib/theme.scss +18 -26
  139. package/src/lib/translations/en.js +1 -1
  140. package/src/lib/components/Grid/_theme.scss +0 -11
  141. package/src/lib/components/ScrollView/_theme.scss +0 -2
  142. package/src/lib/components/withForwardedRef.jsx +0 -11
@@ -0,0 +1,39 @@
1
+ import PropTypes from 'prop-types';
2
+ import React from 'react';
3
+ import { withGlobalProps } from '../../provider';
4
+ import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
5
+ import { transferProps } from '../_helpers/transferProps';
6
+ import styles from './ModalContent.scss';
7
+
8
+ export const ModalContent = ({
9
+ children,
10
+ ...restProps
11
+ }) => {
12
+ if (isChildrenEmpty(children)) {
13
+ return null;
14
+ }
15
+
16
+ return (
17
+ <div
18
+ {...transferProps(restProps)}
19
+ className={styles.root}
20
+ >
21
+ {children}
22
+ </div>
23
+ );
24
+ };
25
+
26
+ ModalContent.defaultProps = {
27
+ children: null,
28
+ };
29
+
30
+ ModalContent.propTypes = {
31
+ /**
32
+ * Content of the modal.
33
+ */
34
+ children: PropTypes.node,
35
+ };
36
+
37
+ export const ModalContentWithGlobalProps = withGlobalProps(ModalContent, 'ModalContent');
38
+
39
+ 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,42 @@
1
+ import PropTypes from 'prop-types';
2
+ import React from 'react';
3
+ import { withGlobalProps } from '../../provider';
4
+ import { transferProps } from '../_helpers/transferProps';
5
+ import { classNames } from '../../utils/classNames';
6
+ import { getJustifyClassName } from './_helpers/getJustifyClassName';
7
+ import styles from './ModalFooter.scss';
8
+
9
+ export const ModalFooter = ({
10
+ children,
11
+ justify,
12
+ ...restProps
13
+ }) => (
14
+ <div
15
+ {...transferProps(restProps)}
16
+ className={classNames(
17
+ styles.root,
18
+ getJustifyClassName(justify, styles),
19
+ )}
20
+ >
21
+ {children}
22
+ </div>
23
+ );
24
+
25
+ ModalFooter.defaultProps = {
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
+ * Horizontal alignment (distribution) of individual buttons.
36
+ */
37
+ justify: PropTypes.oneOf(['start', 'center', 'end', 'space-between', 'stretch']),
38
+ };
39
+
40
+ export const ModalFooterWithGlobalProps = withGlobalProps(ModalFooter, 'ModalFooter');
41
+
42
+ 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
+ .isRootJustifiedToStart {
18
+ justify-content: flex-start;
19
+ }
20
+
21
+ .isRootJustifiedToCenter {
22
+ justify-content: center;
23
+ }
24
+
25
+ .isRootJustifiedToEnd {
26
+ justify-content: flex-end;
27
+ }
28
+
29
+ .isRootJustifiedToSpaceBetween {
30
+ justify-content: space-between;
31
+ }
32
+
33
+ .isRootJustifiedToStretch {
34
+ display: block;
35
+ }
@@ -0,0 +1,44 @@
1
+ import PropTypes from 'prop-types';
2
+ import React from 'react';
3
+ import {
4
+ withGlobalProps,
5
+ } from '../../provider';
6
+ import { transferProps } from '../_helpers/transferProps';
7
+ import { classNames } from '../../utils/classNames';
8
+ import { getJustifyClassName } from './_helpers/getJustifyClassName';
9
+ import styles from './ModalHeader.scss';
10
+
11
+ export const ModalHeader = ({
12
+ children,
13
+ justify,
14
+ ...restProps
15
+ }) => (
16
+ <div
17
+ {...transferProps(restProps)}
18
+ className={classNames(
19
+ styles.root,
20
+ getJustifyClassName(justify, styles),
21
+ )}
22
+ >
23
+ {children}
24
+ </div>
25
+ );
26
+
27
+ ModalHeader.defaultProps = {
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
+ * Horizontal alignment (distribution) of individual buttons.
38
+ */
39
+ justify: PropTypes.oneOf(['start', 'center', 'end', 'space-between', 'stretch']),
40
+ };
41
+
42
+ export const ModalHeaderWithGlobalProps = withGlobalProps(ModalHeader, 'ModalHeader');
43
+
44
+ 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
+ .isRootJustifiedToStart {
13
+ justify-content: flex-start;
14
+ }
15
+
16
+ .isRootJustifiedToCenter {
17
+ justify-content: center;
18
+ }
19
+
20
+ .isRootJustifiedToEnd {
21
+ justify-content: flex-end;
22
+ }
23
+
24
+ .isRootJustifiedToSpaceBetween {
25
+ justify-content: space-between;
26
+ }
27
+
28
+ .isRootJustifiedToStretch {
29
+ display: block;
30
+ }
@@ -0,0 +1,44 @@
1
+ import PropTypes from 'prop-types';
2
+ import React from 'react';
3
+ import {
4
+ withGlobalProps,
5
+ } from '../../provider';
6
+ import { transferProps } from '../_helpers/transferProps';
7
+ import styles from './ModalTitle.scss';
8
+
9
+ export const ModalTitle = ({
10
+ children,
11
+ level,
12
+ ...restProps
13
+ }) => {
14
+ const HeadingTag = `h${level}`;
15
+
16
+ return (
17
+ <HeadingTag
18
+ {...transferProps(restProps)}
19
+ className={styles.root}
20
+ >
21
+ {children}
22
+ </HeadingTag>
23
+ );
24
+ };
25
+
26
+ ModalTitle.defaultProps = {
27
+ level: 2,
28
+ };
29
+
30
+ ModalTitle.propTypes = {
31
+ /**
32
+ * Content of the header (preferably ModalTitle and ModalCloseButton).
33
+ */
34
+ children: PropTypes.node.isRequired,
35
+ /**
36
+ * Optional heading level. Preferably `1` or `2` should be used, see
37
+ * [W3C recommendation](https://github.com/w3c/aria-practices/issues/551#issuecomment-365134527).
38
+ */
39
+ level: PropTypes.number,
40
+ };
41
+
42
+ export const ModalTitleWithGlobalProps = withGlobalProps(ModalTitle, 'ModalTitle');
43
+
44
+ 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
+ }