@react-ui-org/react-ui 0.60.0 → 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 (47) 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 +1 -1
  6. package/dist/react-ui.development.css +2 -0
  7. package/dist/react-ui.development.js +32 -32
  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 +1 -1
  16. package/src/components/Card/CardFooter.jsx +1 -1
  17. package/src/components/CheckboxField/CheckboxField.jsx +3 -3
  18. package/src/components/FileInputField/FileInputField.jsx +13 -5
  19. package/src/components/FormLayout/FormLayout.jsx +1 -1
  20. package/src/components/FormLayout/FormLayoutCustomField.jsx +4 -4
  21. package/src/components/Grid/Grid.jsx +1 -1
  22. package/src/components/Grid/GridSpan.jsx +1 -1
  23. package/src/components/InputGroup/InputGroup.jsx +24 -4
  24. package/src/components/InputGroup/InputGroup.module.scss +2 -1
  25. package/src/components/InputGroup/README.md +69 -14
  26. package/src/components/Modal/Modal.jsx +12 -7
  27. package/src/components/Modal/ModalBody.jsx +1 -1
  28. package/src/components/Modal/ModalContent.jsx +1 -1
  29. package/src/components/Popover/Popover.jsx +5 -5
  30. package/src/components/Radio/Radio.jsx +3 -3
  31. package/src/components/ScrollView/ScrollView.jsx +3 -3
  32. package/src/components/SelectField/SelectField.jsx +9 -6
  33. package/src/components/Table/Table.jsx +1 -1
  34. package/src/components/Table/_components/TableBodyCell/TableBodyCell.jsx +1 -1
  35. package/src/components/Table/_components/TableHeaderCell/TableHeaderCell.jsx +1 -1
  36. package/src/components/Tabs/TabsItem.jsx +3 -3
  37. package/src/components/Text/Text.jsx +1 -1
  38. package/src/components/TextArea/TextArea.jsx +3 -3
  39. package/src/components/TextField/TextField.jsx +11 -8
  40. package/src/components/Toggle/Toggle.jsx +3 -3
  41. package/src/components/Toolbar/Toolbar.jsx +1 -1
  42. package/src/components/Toolbar/ToolbarGroup.jsx +1 -1
  43. package/src/components/Toolbar/ToolbarItem.jsx +1 -1
  44. package/src/providers/globalProps/GlobalPropsProvider.jsx +1 -1
  45. package/src/providers/translations/TranslationsProvider.jsx +1 -1
  46. package/src/styles/settings/_breakpoints.scss +2 -0
  47. package/tsconfig.json +27 -0
@@ -43,7 +43,7 @@ export const Popover = React.forwardRef((props, ref) => {
43
43
  getRootAlignmentClassName(placement, styles),
44
44
  )}
45
45
  ref={ref}
46
- style={placementStyle ? cleanPlacementStyle(placementStyle) : null}
46
+ style={placementStyle ? cleanPlacementStyle(placementStyle) : undefined}
47
47
  >
48
48
  {children}
49
49
  <span className={styles.arrow} />
@@ -51,7 +51,7 @@ export const Popover = React.forwardRef((props, ref) => {
51
51
  </>
52
52
  );
53
53
 
54
- if (portalId === null) {
54
+ if (portalId === undefined) {
55
55
  return PopoverEl;
56
56
  }
57
57
 
@@ -60,9 +60,9 @@ export const Popover = React.forwardRef((props, ref) => {
60
60
 
61
61
  Popover.defaultProps = {
62
62
  placement: 'bottom',
63
- placementStyle: null,
64
- popoverTargetId: null,
65
- portalId: null,
63
+ placementStyle: undefined,
64
+ popoverTargetId: undefined,
65
+ portalId: undefined,
66
66
  };
67
67
 
68
68
  Popover.propTypes = {
@@ -113,14 +113,14 @@ export const Radio = ({
113
113
 
114
114
  Radio.defaultProps = {
115
115
  disabled: false,
116
- helpText: null,
116
+ helpText: undefined,
117
117
  id: undefined,
118
118
  isLabelVisible: true,
119
119
  layout: 'vertical',
120
120
  renderAsRequired: false,
121
121
  required: false,
122
- validationState: null,
123
- validationText: null,
122
+ validationState: undefined,
123
+ validationText: undefined,
124
124
  value: undefined,
125
125
  };
126
126
 
@@ -297,7 +297,7 @@ ScrollView.defaultProps = {
297
297
  arrows: false,
298
298
  arrowsScrollStep: 200,
299
299
  autoScroll: 'off',
300
- children: null,
300
+ children: undefined,
301
301
  debounce: 50,
302
302
  direction: 'vertical',
303
303
  endShadowBackground: 'linear-gradient(var(--rui-local-end-shadow-direction), rgba(255 255 255 / 1), rgba(255 255 255 / 0))',
@@ -305,10 +305,10 @@ ScrollView.defaultProps = {
305
305
  endShadowSize: '2em',
306
306
  id: undefined,
307
307
  nextArrowColor: undefined,
308
- nextArrowElement: null,
308
+ nextArrowElement: undefined,
309
309
  nextArrowInitialOffset: '-0.5rem',
310
310
  prevArrowColor: undefined,
311
- prevArrowElement: null,
311
+ prevArrowElement: undefined,
312
312
  prevArrowInitialOffset: '-0.5rem',
313
313
  scrollbar: true,
314
314
  shadows: true,
@@ -109,7 +109,7 @@ export const SelectField = React.forwardRef((props, ref) => {
109
109
  <div className={styles.bottomLine} />
110
110
  )}
111
111
  </div>
112
- {helpText && (
112
+ {(helpText && !inputGroupContext) && (
113
113
  <div
114
114
  className={styles.helpText}
115
115
  id={id && `${id}__helpText`}
@@ -133,15 +133,15 @@ export const SelectField = React.forwardRef((props, ref) => {
133
133
  SelectField.defaultProps = {
134
134
  disabled: false,
135
135
  fullWidth: false,
136
- helpText: null,
136
+ helpText: undefined,
137
137
  id: undefined,
138
138
  isLabelVisible: true,
139
139
  layout: 'vertical',
140
140
  renderAsRequired: false,
141
141
  required: false,
142
142
  size: 'medium',
143
- validationState: null,
144
- validationText: null,
143
+ validationState: undefined,
144
+ validationText: undefined,
145
145
  variant: 'outline',
146
146
  };
147
147
 
@@ -156,6 +156,9 @@ SelectField.propTypes = {
156
156
  fullWidth: PropTypes.bool,
157
157
  /**
158
158
  * Optional help text.
159
+ *
160
+ * Help text is never rendered when the component is placed into `InputGroup`.
161
+ * If a help text is needed, it must be defined on the `InputGroup` component instead.
159
162
  */
160
163
  helpText: PropTypes.node,
161
164
  /**
@@ -249,8 +252,8 @@ SelectField.propTypes = {
249
252
  /**
250
253
  * Validation message to be displayed.
251
254
  *
252
- * Validation text is never rendered when the component is placed into `InputGroup`. Instead, the `InputGroup`
253
- * component itself renders all validation texts of its nested components.
255
+ * Validation text is never rendered when the component is placed into `InputGroup`.
256
+ * If a validation text is needed, it must be defined on the `InputGroup` component instead.
254
257
  */
255
258
  validationText: PropTypes.node,
256
259
  /**
@@ -53,7 +53,7 @@ export const Table = ({
53
53
 
54
54
  Table.defaultProps = {
55
55
  id: undefined,
56
- sort: null,
56
+ sort: undefined,
57
57
  };
58
58
 
59
59
  Table.propTypes = {
@@ -20,7 +20,7 @@ TableBodyCell.defaultProps = {
20
20
  format: undefined,
21
21
  id: undefined,
22
22
  isSortingActive: false,
23
- value: null,
23
+ value: undefined,
24
24
  };
25
25
 
26
26
  TableBodyCell.propTypes = {
@@ -42,7 +42,7 @@ export const TableHeaderCell = ({
42
42
 
43
43
  TableHeaderCell.defaultProps = {
44
44
  id: undefined,
45
- sort: null,
45
+ sort: undefined,
46
46
  };
47
47
 
48
48
  TableHeaderCell.propTypes = {
@@ -45,11 +45,11 @@ export const TabsItem = ({
45
45
  );
46
46
 
47
47
  TabsItem.defaultProps = {
48
- afterLabel: null,
49
- beforeLabel: null,
48
+ afterLabel: undefined,
49
+ beforeLabel: undefined,
50
50
  id: undefined,
51
51
  isActive: false,
52
- onClick: null,
52
+ onClick: undefined,
53
53
  };
54
54
 
55
55
  TabsItem.propTypes = {
@@ -42,7 +42,7 @@ export const Text = ({
42
42
 
43
43
  Text.defaultProps = {
44
44
  blockLevel: false,
45
- children: null,
45
+ children: undefined,
46
46
  hyphens: 'none',
47
47
  lines: undefined,
48
48
  wordWrapping: 'normal',
@@ -93,14 +93,14 @@ export const TextArea = React.forwardRef((props, ref) => {
93
93
  TextArea.defaultProps = {
94
94
  disabled: false,
95
95
  fullWidth: false,
96
- helpText: null,
96
+ helpText: undefined,
97
97
  id: undefined,
98
98
  isLabelVisible: true,
99
99
  layout: 'vertical',
100
100
  required: false,
101
101
  size: 'medium',
102
- validationState: null,
103
- validationText: null,
102
+ validationState: undefined,
103
+ validationText: undefined,
104
104
  variant: 'outline',
105
105
  };
106
106
 
@@ -32,7 +32,7 @@ export const TextField = React.forwardRef((props, ref) => {
32
32
  } = props;
33
33
  const formLayoutContext = useContext(FormLayoutContext);
34
34
  const inputGroupContext = useContext(InputGroupContext);
35
- const hasSmallInput = (inputSize !== null) && (inputSize <= SMALL_INPUT_SIZE);
35
+ const hasSmallInput = (inputSize !== undefined) && (inputSize <= SMALL_INPUT_SIZE);
36
36
 
37
37
  return (
38
38
  <label
@@ -84,7 +84,7 @@ export const TextField = React.forwardRef((props, ref) => {
84
84
  <div className={styles.bottomLine} />
85
85
  )}
86
86
  </div>
87
- {helpText && (
87
+ {(helpText && !inputGroupContext) && (
88
88
  <div
89
89
  className={styles.helpText}
90
90
  id={id && `${id}__helpText`}
@@ -108,16 +108,16 @@ export const TextField = React.forwardRef((props, ref) => {
108
108
  TextField.defaultProps = {
109
109
  disabled: false,
110
110
  fullWidth: false,
111
- helpText: null,
111
+ helpText: undefined,
112
112
  id: undefined,
113
- inputSize: null,
113
+ inputSize: undefined,
114
114
  isLabelVisible: true,
115
115
  layout: 'vertical',
116
116
  required: false,
117
117
  size: 'medium',
118
118
  type: 'text',
119
- validationState: null,
120
- validationText: null,
119
+ validationState: undefined,
120
+ validationText: undefined,
121
121
  variant: 'outline',
122
122
  };
123
123
 
@@ -132,6 +132,9 @@ TextField.propTypes = {
132
132
  fullWidth: PropTypes.bool,
133
133
  /**
134
134
  * Optional help text.
135
+ *
136
+ * Help text is never rendered when the component is placed into `InputGroup`.
137
+ * If a help text is needed, it must be defined on the `InputGroup` component instead.
135
138
  */
136
139
  helpText: PropTypes.node,
137
140
  /**
@@ -185,8 +188,8 @@ TextField.propTypes = {
185
188
  /**
186
189
  * Validation message to be displayed.
187
190
  *
188
- * Validation text is never rendered when the component is placed into `InputGroup`. Instead, the `InputGroup`
189
- * component itself renders all validation texts of its nested components.
191
+ * Validation text is never rendered when the component is placed into `InputGroup`.
192
+ * If a validation text is needed, it must be defined on the `InputGroup` component instead.
190
193
  */
191
194
  validationText: PropTypes.node,
192
195
  /**
@@ -81,14 +81,14 @@ export const Toggle = React.forwardRef((props, ref) => {
81
81
 
82
82
  Toggle.defaultProps = {
83
83
  disabled: false,
84
- helpText: null,
84
+ helpText: undefined,
85
85
  id: undefined,
86
86
  isLabelVisible: true,
87
87
  labelPosition: 'after',
88
88
  renderAsRequired: false,
89
89
  required: false,
90
- validationState: null,
91
- validationText: null,
90
+ validationState: undefined,
91
+ validationText: undefined,
92
92
  };
93
93
 
94
94
  Toggle.propTypes = {
@@ -38,7 +38,7 @@ export const Toolbar = ({
38
38
 
39
39
  Toolbar.defaultProps = {
40
40
  align: 'top',
41
- children: null,
41
+ children: undefined,
42
42
  dense: false,
43
43
  justify: 'start',
44
44
  nowrap: false,
@@ -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
  };
@@ -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
 
@@ -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/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
+ }