@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.
- package/dist/lib.development.js +465 -93
- package/dist/lib.js +1 -1
- package/package.json +1 -1
- package/src/lib/components/Alert/Alert.jsx +3 -0
- package/src/lib/components/Alert/Alert.scss +10 -10
- package/src/lib/components/Alert/README.mdx +18 -2
- package/src/lib/components/Alert/index.js +1 -1
- package/src/lib/components/Badge/Badge.jsx +4 -8
- package/src/lib/components/Badge/Badge.scss +21 -21
- package/src/lib/components/Badge/README.mdx +15 -1
- package/src/lib/components/Badge/index.js +1 -1
- package/src/lib/components/Button/Button.jsx +23 -34
- package/src/lib/components/Button/README.mdx +21 -7
- package/src/lib/components/Button/_base.scss +20 -20
- package/src/lib/components/Button/_priorities.scss +35 -35
- package/src/lib/components/Button/helpers/getRootLabelVisibilityClassName.js +7 -7
- package/src/lib/components/Button/helpers/getRootPriorityClassName.js +3 -3
- package/src/lib/components/Button/index.js +1 -1
- package/src/lib/components/ButtonGroup/ButtonGroup.jsx +2 -8
- package/src/lib/components/ButtonGroup/README.mdx +18 -2
- package/src/lib/components/Card/Card.jsx +6 -10
- package/src/lib/components/Card/Card.scss +13 -13
- package/src/lib/components/Card/CardBody.jsx +6 -10
- package/src/lib/components/Card/CardFooter.jsx +6 -7
- package/src/lib/components/Card/README.mdx +21 -5
- package/src/lib/components/CheckboxField/CheckboxField.jsx +17 -44
- package/src/lib/components/CheckboxField/README.mdx +18 -6
- package/src/lib/components/CheckboxField/index.js +1 -1
- package/src/lib/components/FileInputField/FileInputField.jsx +20 -29
- package/src/lib/components/FileInputField/FileInputField.scss +3 -3
- package/src/lib/components/FileInputField/README.mdx +30 -28
- package/src/lib/components/FileInputField/index.js +1 -1
- package/src/lib/components/FormLayout/FormLayout.jsx +5 -9
- package/src/lib/components/FormLayout/FormLayout.scss +3 -3
- package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +4 -1
- package/src/lib/components/FormLayout/FormLayoutCustomField.scss +8 -8
- package/src/lib/components/FormLayout/README.mdx +28 -13
- package/src/lib/components/Grid/Grid.jsx +31 -35
- package/src/lib/components/Grid/Grid.scss +10 -15
- package/src/lib/components/Grid/GridSpan.jsx +5 -11
- package/src/lib/components/Grid/README.mdx +48 -36
- package/src/lib/components/Grid/_helpers/generateResponsiveCustomProperties.js +11 -3
- package/src/lib/components/Grid/_settings.scss +18 -0
- package/src/lib/components/Grid/_tools.scss +5 -5
- package/src/lib/components/Modal/Modal.jsx +147 -254
- package/src/lib/components/Modal/Modal.scss +7 -55
- package/src/lib/components/Modal/ModalBody.jsx +60 -0
- package/src/lib/components/Modal/ModalBody.scss +18 -0
- package/src/lib/components/Modal/ModalCloseButton.jsx +45 -0
- package/src/lib/components/Modal/ModalCloseButton.scss +18 -0
- package/src/lib/components/Modal/ModalContent.jsx +39 -0
- package/src/lib/components/Modal/ModalContent.scss +5 -0
- package/src/lib/components/Modal/ModalFooter.jsx +42 -0
- package/src/lib/components/Modal/ModalFooter.scss +35 -0
- package/src/lib/components/Modal/ModalHeader.jsx +44 -0
- package/src/lib/components/Modal/ModalHeader.scss +30 -0
- package/src/lib/components/Modal/ModalTitle.jsx +44 -0
- package/src/lib/components/Modal/ModalTitle.scss +10 -0
- package/src/lib/components/Modal/README.mdx +865 -195
- package/src/lib/components/Modal/_helpers/getJustifyClassName.js +19 -0
- package/src/lib/components/Modal/_helpers/getScrollingClassName.js +11 -0
- package/src/lib/components/Modal/_settings.scss +1 -5
- package/src/lib/components/Modal/_theme.scss +6 -0
- package/src/lib/components/Modal/index.js +7 -1
- package/src/lib/components/Paper/Paper.jsx +5 -9
- package/src/lib/components/Paper/Paper.scss +2 -2
- package/src/lib/components/Paper/README.mdx +15 -1
- package/src/lib/components/Paper/index.js +1 -1
- package/src/lib/components/Popover/Popover.jsx +14 -30
- package/src/lib/components/Popover/Popover.scss +7 -6
- package/src/lib/components/Popover/PopoverWrapper.jsx +5 -12
- package/src/lib/components/Popover/PopoverWrapper.scss +3 -0
- package/src/lib/components/Popover/README.mdx +32 -11
- package/src/lib/components/Popover/_theme.scss +1 -1
- package/src/lib/components/Radio/README.mdx +13 -6
- package/src/lib/components/Radio/Radio.jsx +39 -29
- package/src/lib/components/Radio/Radio.scss +3 -3
- package/src/lib/components/Radio/index.js +1 -1
- package/src/lib/components/ScrollView/README.mdx +165 -84
- package/src/lib/components/ScrollView/ScrollView.jsx +115 -117
- package/src/lib/components/ScrollView/ScrollView.scss +18 -16
- package/src/lib/components/ScrollView/index.js +1 -1
- package/src/lib/components/SelectField/README.mdx +83 -7
- package/src/lib/components/SelectField/SelectField.jsx +86 -61
- package/src/lib/components/SelectField/SelectField.scss +8 -8
- package/src/lib/components/SelectField/_components/Option/Option.jsx +46 -0
- package/src/lib/components/SelectField/_components/Option/index.js +1 -0
- package/src/lib/components/SelectField/index.js +1 -1
- package/src/lib/components/Table/README.mdx +25 -9
- package/src/lib/components/Table/Table.jsx +43 -101
- package/src/lib/components/Table/Table.scss +0 -24
- package/src/lib/components/Table/_components/TableBodyCell/TableBodyCell.jsx +46 -0
- package/src/lib/components/Table/_components/TableBodyCell/index.js +1 -0
- package/src/lib/components/Table/_components/TableCell.scss +25 -0
- package/src/lib/components/Table/_components/TableHeaderCell/TableHeaderCell.jsx +71 -0
- package/src/lib/components/Table/_components/TableHeaderCell/index.js +1 -0
- package/src/lib/components/Table/index.js +1 -1
- package/src/lib/components/Tabs/README.mdx +21 -3
- package/src/lib/components/Tabs/Tabs.jsx +6 -1
- package/src/lib/components/Tabs/TabsItem.jsx +3 -0
- package/src/lib/components/Tabs/TabsItem.scss +1 -2
- package/src/lib/components/Text/README.mdx +25 -7
- package/src/lib/components/Text/Text.jsx +3 -7
- package/src/lib/components/Text/Text.scss +6 -6
- package/src/lib/components/Text/_helpers/getRootClampClassName.js +2 -2
- package/src/lib/components/Text/_helpers/getRootHyphensClassName.js +2 -2
- package/src/lib/components/Text/_helpers/getRootWordWrappingClassName.js +2 -2
- package/src/lib/components/Text/index.js +1 -1
- package/src/lib/components/TextArea/README.mdx +34 -31
- package/src/lib/components/TextArea/TextArea.jsx +23 -63
- package/src/lib/components/TextArea/TextArea.scss +8 -8
- package/src/lib/components/TextArea/index.js +1 -1
- package/src/lib/components/TextField/README.mdx +56 -54
- package/src/lib/components/TextField/TextField.jsx +25 -52
- package/src/lib/components/TextField/TextField.scss +9 -9
- package/src/lib/components/TextField/index.js +1 -1
- package/src/lib/components/TextLink/README.mdx +13 -6
- package/src/lib/components/TextLink/TextLink.jsx +0 -10
- package/src/lib/components/TextLink/index.js +1 -1
- package/src/lib/components/Toggle/README.mdx +18 -6
- package/src/lib/components/Toggle/Toggle.jsx +18 -44
- package/src/lib/components/Toggle/index.js +1 -1
- package/src/lib/components/Toolbar/README.mdx +21 -6
- package/src/lib/components/Toolbar/Toolbar.jsx +9 -43
- package/src/lib/components/Toolbar/Toolbar.scss +24 -12
- package/src/lib/components/Toolbar/ToolbarGroup.jsx +7 -26
- package/src/lib/components/Toolbar/ToolbarItem.jsx +3 -7
- package/src/lib/components/Toolbar/_helpers/getAlignClassName.js +19 -0
- package/src/lib/components/Toolbar/_helpers/getJustifyClassName.js +16 -0
- package/src/lib/components/_helpers/getRootColorClassName.js +10 -10
- package/src/lib/components/_helpers/getRootSizeClassName.js +3 -3
- package/src/lib/components/_helpers/transferProps.js +1 -1
- package/src/lib/index.js +24 -16
- package/src/lib/provider/withGlobalProps.jsx +20 -3
- package/src/lib/styles/tools/form-fields/_box-field-layout.scss +15 -15
- package/src/lib/styles/tools/form-fields/_inline-field-elements.scss +1 -1
- package/src/lib/styles/tools/form-fields/_inline-field-layout.scss +9 -9
- package/src/lib/theme.scss +18 -26
- package/src/lib/translations/en.js +1 -1
- package/src/lib/components/Grid/_theme.scss +0 -11
- package/src/lib/components/ScrollView/_theme.scss +0 -2
- 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,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;
|