@react-ui-org/react-ui 0.59.3 → 0.61.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/.env.playwright +9 -0
- package/.env.playwright.dist +9 -0
- package/.eslintrc-ts +40 -0
- package/README.md +18 -1
- package/dist/react-ui.css +4 -4
- package/dist/react-ui.development.css +8 -0
- package/dist/react-ui.development.js +57 -47
- package/dist/react-ui.js +1 -1
- package/jest.config-ts.js +34 -0
- package/package.json +25 -6
- package/playwright-ct.config.ts +68 -0
- package/src/components/Alert/Alert.jsx +2 -2
- package/src/components/Button/Button.jsx +5 -5
- package/src/components/Button/README.md +1 -1
- package/src/components/ButtonGroup/ButtonGroup.jsx +2 -2
- package/src/components/Card/Card.module.scss +1 -0
- package/src/components/Card/CardFooter.jsx +2 -2
- package/src/components/Card/README.md +2 -0
- package/src/components/Card/_theme.scss +2 -0
- package/src/components/CheckboxField/CheckboxField.jsx +3 -3
- package/src/components/FileInputField/FileInputField.jsx +21 -8
- package/src/components/FileInputField/FileInputField.module.scss +4 -0
- package/src/components/FormLayout/FormLayout.jsx +2 -2
- package/src/components/FormLayout/FormLayoutCustomField.jsx +5 -5
- package/src/components/Grid/Grid.jsx +2 -2
- package/src/components/Grid/GridSpan.jsx +2 -2
- package/src/components/InputGroup/InputGroup.jsx +25 -5
- package/src/components/InputGroup/InputGroup.module.scss +2 -1
- package/src/components/InputGroup/README.md +69 -14
- package/src/components/Modal/Modal.jsx +26 -8
- package/src/components/Modal/ModalBody.jsx +2 -2
- package/src/components/Modal/ModalContent.jsx +2 -2
- package/src/components/Modal/_helpers/dialogOnClickHandler.js +6 -0
- package/src/components/Popover/Popover.jsx +5 -5
- package/src/components/Radio/Radio.jsx +3 -3
- package/src/components/ScrollView/ScrollView.jsx +42 -12
- package/src/components/ScrollView/_hooks/useScrollPositionHook.js +4 -4
- package/src/components/SelectField/SelectField.jsx +9 -6
- package/src/components/Table/Table.jsx +1 -1
- package/src/components/Table/_components/TableBodyCell/TableBodyCell.jsx +1 -1
- package/src/components/Table/_components/TableHeaderCell/TableHeaderCell.jsx +1 -1
- package/src/components/Tabs/TabsItem.jsx +3 -3
- package/src/components/Text/Text.jsx +2 -2
- package/src/components/TextArea/TextArea.jsx +3 -3
- package/src/components/TextField/TextField.jsx +11 -8
- package/src/components/Toggle/Toggle.jsx +3 -3
- package/src/components/Toolbar/Toolbar.jsx +2 -2
- package/src/components/Toolbar/ToolbarGroup.jsx +2 -2
- package/src/components/Toolbar/ToolbarItem.jsx +2 -2
- package/src/helpers/isChildrenEmpty/README.md +57 -0
- package/src/helpers/isChildrenEmpty/index.js +1 -0
- package/src/index.js +1 -0
- package/src/providers/globalProps/GlobalPropsProvider.jsx +1 -1
- package/src/providers/translations/TranslationsProvider.jsx +1 -1
- package/src/styles/settings/_breakpoints.scss +2 -0
- package/src/theme.scss +2 -0
- package/src/translations/en.js +1 -0
- package/tsconfig.json +27 -0
- /package/src/{components/_helpers → helpers/isChildrenEmpty}/isChildrenEmpty.js +0 -0
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { withGlobalProps } from '../../providers/globalProps';
|
|
4
4
|
import { classNames } from '../../helpers/classNames/classNames';
|
|
5
5
|
import { transferProps } from '../../helpers/transferProps';
|
|
6
|
-
import { isChildrenEmpty } from '
|
|
6
|
+
import { isChildrenEmpty } from '../../helpers/isChildrenEmpty/isChildrenEmpty';
|
|
7
7
|
import { getAlignClassName } from './_helpers/getAlignClassName';
|
|
8
8
|
import styles from './Toolbar.module.scss';
|
|
9
9
|
|
|
@@ -35,7 +35,7 @@ export const ToolbarGroup = ({
|
|
|
35
35
|
|
|
36
36
|
ToolbarGroup.defaultProps = {
|
|
37
37
|
align: 'top',
|
|
38
|
-
children:
|
|
38
|
+
children: undefined,
|
|
39
39
|
dense: false,
|
|
40
40
|
nowrap: false,
|
|
41
41
|
};
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { classNames } from '../../helpers/classNames/classNames';
|
|
4
4
|
import { transferProps } from '../../helpers/transferProps';
|
|
5
5
|
import { withGlobalProps } from '../../providers/globalProps';
|
|
6
|
-
import { isChildrenEmpty } from '
|
|
6
|
+
import { isChildrenEmpty } from '../../helpers/isChildrenEmpty/isChildrenEmpty';
|
|
7
7
|
import styles from './Toolbar.module.scss';
|
|
8
8
|
|
|
9
9
|
export const ToolbarItem = ({
|
|
@@ -29,7 +29,7 @@ export const ToolbarItem = ({
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
ToolbarItem.defaultProps = {
|
|
32
|
-
children:
|
|
32
|
+
children: undefined,
|
|
33
33
|
flexible: false,
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# isChildrenEmpty
|
|
2
|
+
|
|
3
|
+
The `isChildrenEmpty` helper function determines whether the given children
|
|
4
|
+
value should be considered "empty".
|
|
5
|
+
|
|
6
|
+
It is useful in React when conditionally rendering components based on
|
|
7
|
+
whether children contain meaningful content.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
To use `isChildrenEmpty` helper, you need to import it first:
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import { isChildrenEmpty } from '@react-ui-org/react-ui';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then use it:
|
|
18
|
+
|
|
19
|
+
```docoff-react-preview
|
|
20
|
+
|
|
21
|
+
React.createElement(() => {
|
|
22
|
+
const children = null;
|
|
23
|
+
const isEmpty = isChildrenEmpty(children);
|
|
24
|
+
|
|
25
|
+
if (isEmpty === false) {
|
|
26
|
+
return (
|
|
27
|
+
<div>{children}</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div>Children not provided</div>
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```docoff-react-preview
|
|
38
|
+
React.createElement(() => {
|
|
39
|
+
const children = (
|
|
40
|
+
<>
|
|
41
|
+
<h1>Title</h1>
|
|
42
|
+
<p>Content</p>
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
const isEmpty = isChildrenEmpty(children);
|
|
46
|
+
|
|
47
|
+
if (isEmpty === false) {
|
|
48
|
+
return (
|
|
49
|
+
<div>{children}</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div>Children not provided</div>
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isChildrenEmpty } from './isChildrenEmpty';
|
package/src/index.js
CHANGED
package/src/theme.scss
CHANGED
|
@@ -832,6 +832,8 @@
|
|
|
832
832
|
--rui-Card--raised__box-shadow: var(--rui-shadow-layer-1);
|
|
833
833
|
--rui-Card--disabled__background-color: var(--rui-color-background-disabled);
|
|
834
834
|
--rui-Card--disabled__opacity: var(--rui-ratio-disabled-opacity);
|
|
835
|
+
--rui-Card--disabled__border-width: var(--rui-dimension-border-width-1);
|
|
836
|
+
--rui-Card--disabled__border-color: var(--rui-color-border-primary);
|
|
835
837
|
|
|
836
838
|
// Card: variant: success
|
|
837
839
|
--rui-Card--success__color: var(--rui-color-text-primary);
|
package/src/translations/en.js
CHANGED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"lib": [
|
|
5
|
+
"dom",
|
|
6
|
+
"dom.iterable",
|
|
7
|
+
"esnext"
|
|
8
|
+
],
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"allowSyntheticDefaultImports": true,
|
|
13
|
+
"strict": false,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"noFallthroughCasesInSwitch": true,
|
|
16
|
+
"module": "esnext",
|
|
17
|
+
"moduleResolution": "node",
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"isolatedModules": true,
|
|
20
|
+
"noEmit": false,
|
|
21
|
+
"jsx": "react-jsx"
|
|
22
|
+
},
|
|
23
|
+
"include": [
|
|
24
|
+
"src",
|
|
25
|
+
"tests"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
File without changes
|