@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.
Files changed (59) hide show
  1. package/.env.playwright +9 -0
  2. package/.env.playwright.dist +9 -0
  3. package/.eslintrc-ts +40 -0
  4. package/README.md +18 -1
  5. package/dist/react-ui.css +4 -4
  6. package/dist/react-ui.development.css +8 -0
  7. package/dist/react-ui.development.js +57 -47
  8. package/dist/react-ui.js +1 -1
  9. package/jest.config-ts.js +34 -0
  10. package/package.json +25 -6
  11. package/playwright-ct.config.ts +68 -0
  12. package/src/components/Alert/Alert.jsx +2 -2
  13. package/src/components/Button/Button.jsx +5 -5
  14. package/src/components/Button/README.md +1 -1
  15. package/src/components/ButtonGroup/ButtonGroup.jsx +2 -2
  16. package/src/components/Card/Card.module.scss +1 -0
  17. package/src/components/Card/CardFooter.jsx +2 -2
  18. package/src/components/Card/README.md +2 -0
  19. package/src/components/Card/_theme.scss +2 -0
  20. package/src/components/CheckboxField/CheckboxField.jsx +3 -3
  21. package/src/components/FileInputField/FileInputField.jsx +21 -8
  22. package/src/components/FileInputField/FileInputField.module.scss +4 -0
  23. package/src/components/FormLayout/FormLayout.jsx +2 -2
  24. package/src/components/FormLayout/FormLayoutCustomField.jsx +5 -5
  25. package/src/components/Grid/Grid.jsx +2 -2
  26. package/src/components/Grid/GridSpan.jsx +2 -2
  27. package/src/components/InputGroup/InputGroup.jsx +25 -5
  28. package/src/components/InputGroup/InputGroup.module.scss +2 -1
  29. package/src/components/InputGroup/README.md +69 -14
  30. package/src/components/Modal/Modal.jsx +26 -8
  31. package/src/components/Modal/ModalBody.jsx +2 -2
  32. package/src/components/Modal/ModalContent.jsx +2 -2
  33. package/src/components/Modal/_helpers/dialogOnClickHandler.js +6 -0
  34. package/src/components/Popover/Popover.jsx +5 -5
  35. package/src/components/Radio/Radio.jsx +3 -3
  36. package/src/components/ScrollView/ScrollView.jsx +42 -12
  37. package/src/components/ScrollView/_hooks/useScrollPositionHook.js +4 -4
  38. package/src/components/SelectField/SelectField.jsx +9 -6
  39. package/src/components/Table/Table.jsx +1 -1
  40. package/src/components/Table/_components/TableBodyCell/TableBodyCell.jsx +1 -1
  41. package/src/components/Table/_components/TableHeaderCell/TableHeaderCell.jsx +1 -1
  42. package/src/components/Tabs/TabsItem.jsx +3 -3
  43. package/src/components/Text/Text.jsx +2 -2
  44. package/src/components/TextArea/TextArea.jsx +3 -3
  45. package/src/components/TextField/TextField.jsx +11 -8
  46. package/src/components/Toggle/Toggle.jsx +3 -3
  47. package/src/components/Toolbar/Toolbar.jsx +2 -2
  48. package/src/components/Toolbar/ToolbarGroup.jsx +2 -2
  49. package/src/components/Toolbar/ToolbarItem.jsx +2 -2
  50. package/src/helpers/isChildrenEmpty/README.md +57 -0
  51. package/src/helpers/isChildrenEmpty/index.js +1 -0
  52. package/src/index.js +1 -0
  53. package/src/providers/globalProps/GlobalPropsProvider.jsx +1 -1
  54. package/src/providers/translations/TranslationsProvider.jsx +1 -1
  55. package/src/styles/settings/_breakpoints.scss +2 -0
  56. package/src/theme.scss +2 -0
  57. package/src/translations/en.js +1 -0
  58. package/tsconfig.json +27 -0
  59. /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 '../_helpers/isChildrenEmpty';
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: null,
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 '../_helpers/isChildrenEmpty';
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: null,
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
@@ -64,3 +64,4 @@ export { TranslationsProvider } from './providers/translations';
64
64
  // Helpers
65
65
  export { classNames } from './helpers/classNames';
66
66
  export { transferProps } from './helpers/transferProps';
67
+ export { isChildrenEmpty } from './helpers/isChildrenEmpty';
@@ -21,7 +21,7 @@ const GlobalPropsProvider = ({
21
21
  };
22
22
 
23
23
  GlobalPropsProvider.defaultProps = {
24
- children: null,
24
+ children: undefined,
25
25
  globalProps: {},
26
26
  };
27
27
 
@@ -21,7 +21,7 @@ const TranslationsProvider = ({
21
21
  };
22
22
 
23
23
  TranslationsProvider.defaultProps = {
24
- children: null,
24
+ children: undefined,
25
25
  translations: {},
26
26
  };
27
27
 
@@ -1,3 +1,5 @@
1
+ // Keep this file in sync with values in `tests/playwright/constants/breakpoints.ts`
2
+
1
3
  $values: (
2
4
  xs: 0,
3
5
  sm: 36em,
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);
@@ -5,6 +5,7 @@ export default {
5
5
  FileInputField: {
6
6
  browse: 'Browse',
7
7
  drop: 'or drop file here',
8
+ dropFileHere: 'Drop file here',
8
9
  filesSelected: 'files selected',
9
10
  },
10
11
  ModalCloseButton: {
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
+ }