@react-ui-org/react-ui 0.47.0 → 0.48.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib.development.js +330 -54
- package/dist/lib.js +1 -1
- package/package.json +1 -1
- package/src/lib/components/Alert/README.mdx +4 -2
- package/src/lib/components/Alert/index.js +1 -1
- package/src/lib/components/Badge/README.mdx +1 -1
- package/src/lib/components/Badge/index.js +1 -1
- package/src/lib/components/Button/Button.jsx +31 -31
- package/src/lib/components/Button/README.mdx +4 -2
- package/src/lib/components/Button/index.js +1 -1
- package/src/lib/components/ButtonGroup/ButtonGroup.jsx +2 -1
- package/src/lib/components/ButtonGroup/README.mdx +4 -2
- package/src/lib/components/Card/README.mdx +7 -5
- package/src/lib/components/CheckboxField/CheckboxField.jsx +27 -28
- package/src/lib/components/CheckboxField/README.mdx +1 -1
- package/src/lib/components/CheckboxField/index.js +1 -1
- package/src/lib/components/FileInputField/FileInputField.jsx +27 -27
- package/src/lib/components/FileInputField/README.mdx +1 -1
- package/src/lib/components/FileInputField/index.js +1 -1
- package/src/lib/components/FormLayout/README.mdx +15 -13
- package/src/lib/components/Grid/Grid.jsx +31 -28
- package/src/lib/components/Grid/Grid.scss +10 -15
- package/src/lib/components/Grid/GridSpan.jsx +5 -4
- package/src/lib/components/Grid/README.mdx +34 -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 -250
- package/src/lib/components/Modal/Modal.scss +7 -55
- package/src/lib/components/Modal/ModalBody.jsx +64 -0
- package/src/lib/components/Modal/ModalBody.scss +18 -0
- package/src/lib/components/Modal/ModalCloseButton.jsx +61 -0
- package/src/lib/components/Modal/ModalCloseButton.scss +18 -0
- package/src/lib/components/Modal/ModalContent.jsx +43 -0
- package/src/lib/components/Modal/ModalContent.scss +5 -0
- package/src/lib/components/Modal/ModalFooter.jsx +46 -0
- package/src/lib/components/Modal/ModalFooter.scss +35 -0
- package/src/lib/components/Modal/ModalHeader.jsx +48 -0
- package/src/lib/components/Modal/ModalHeader.scss +30 -0
- package/src/lib/components/Modal/ModalTitle.jsx +45 -0
- package/src/lib/components/Modal/ModalTitle.scss +10 -0
- package/src/lib/components/Modal/README.mdx +842 -197
- 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/README.mdx +1 -1
- package/src/lib/components/Paper/index.js +1 -1
- package/src/lib/components/Popover/Popover.jsx +24 -24
- package/src/lib/components/Popover/Popover.scss +7 -6
- package/src/lib/components/Popover/PopoverWrapper.jsx +5 -5
- package/src/lib/components/Popover/PopoverWrapper.scss +3 -0
- package/src/lib/components/Popover/README.mdx +13 -11
- package/src/lib/components/Popover/_theme.scss +1 -1
- package/src/lib/components/Radio/README.mdx +1 -1
- package/src/lib/components/Radio/Radio.jsx +37 -27
- package/src/lib/components/Radio/index.js +1 -1
- package/src/lib/components/ScrollView/README.mdx +146 -84
- package/src/lib/components/ScrollView/ScrollView.jsx +104 -113
- 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 +66 -2
- package/src/lib/components/SelectField/SelectField.jsx +93 -49
- 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 +4 -2
- package/src/lib/components/Table/Table.jsx +1 -1
- package/src/lib/components/Table/index.js +1 -1
- package/src/lib/components/Tabs/README.mdx +5 -3
- package/src/lib/components/Tabs/TabsItem.scss +1 -2
- package/src/lib/components/Text/README.mdx +9 -7
- package/src/lib/components/Text/index.js +1 -1
- package/src/lib/components/TextArea/README.mdx +1 -1
- package/src/lib/components/TextArea/TextArea.jsx +33 -33
- package/src/lib/components/TextArea/index.js +1 -1
- package/src/lib/components/TextField/README.mdx +3 -3
- package/src/lib/components/TextField/TextField.jsx +33 -34
- package/src/lib/components/TextField/index.js +1 -1
- package/src/lib/components/TextLink/README.mdx +1 -1
- package/src/lib/components/TextLink/index.js +1 -1
- package/src/lib/components/Toggle/README.mdx +1 -1
- package/src/lib/components/Toggle/Toggle.jsx +28 -28
- package/src/lib/components/Toggle/index.js +1 -1
- package/src/lib/components/Toolbar/README.mdx +8 -6
- 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/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
@@ -7,29 +7,29 @@ import { getRootValidationStateClassName } from '../_helpers/getRootValidationSt
|
|
7
7
|
import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
|
8
8
|
import { transferProps } from '../_helpers/transferProps';
|
9
9
|
import { FormLayoutContext } from '../FormLayout';
|
10
|
-
import withForwardedRef from '../withForwardedRef';
|
11
10
|
import styles from './TextArea.scss';
|
12
11
|
|
13
|
-
export const TextArea = ({
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
12
|
+
export const TextArea = React.forwardRef((props, ref) => {
|
13
|
+
const {
|
14
|
+
cols,
|
15
|
+
disabled,
|
16
|
+
fullWidth,
|
17
|
+
helpText,
|
18
|
+
id,
|
19
|
+
isLabelVisible,
|
20
|
+
label,
|
21
|
+
layout,
|
22
|
+
placeholder,
|
23
|
+
required,
|
24
|
+
rows,
|
25
|
+
size,
|
26
|
+
validationState,
|
27
|
+
validationText,
|
28
|
+
value,
|
29
|
+
variant,
|
30
|
+
...restProps
|
31
|
+
} = props;
|
32
|
+
|
33
33
|
const context = useContext(FormLayoutContext);
|
34
34
|
|
35
35
|
return (
|
@@ -68,7 +68,7 @@ export const TextArea = ({
|
|
68
68
|
disabled={disabled}
|
69
69
|
id={id}
|
70
70
|
placeholder={placeholder}
|
71
|
-
ref={
|
71
|
+
ref={ref}
|
72
72
|
required={required}
|
73
73
|
rows={rows}
|
74
74
|
value={value}
|
@@ -96,18 +96,18 @@ export const TextArea = ({
|
|
96
96
|
</div>
|
97
97
|
</label>
|
98
98
|
);
|
99
|
-
};
|
99
|
+
});
|
100
100
|
|
101
101
|
TextArea.defaultProps = {
|
102
102
|
cols: null,
|
103
103
|
disabled: false,
|
104
|
-
forwardedRef: undefined,
|
105
104
|
fullWidth: false,
|
106
105
|
helpText: null,
|
107
106
|
id: undefined,
|
108
107
|
isLabelVisible: true,
|
109
108
|
layout: 'vertical',
|
110
109
|
placeholder: null,
|
110
|
+
ref: undefined,
|
111
111
|
required: false,
|
112
112
|
rows: 3,
|
113
113
|
size: 'medium',
|
@@ -126,14 +126,6 @@ TextArea.propTypes = {
|
|
126
126
|
* If `true`, the input will be disabled.
|
127
127
|
*/
|
128
128
|
disabled: PropTypes.bool,
|
129
|
-
/**
|
130
|
-
* Reference forwarded to the `textarea` element.
|
131
|
-
*/
|
132
|
-
forwardedRef: PropTypes.oneOfType([
|
133
|
-
PropTypes.func,
|
134
|
-
// eslint-disable-next-line react/forbid-prop-types
|
135
|
-
PropTypes.shape({ current: PropTypes.any }),
|
136
|
-
]),
|
137
129
|
/**
|
138
130
|
* If `true`, the field will span the full width of its parent.
|
139
131
|
*/
|
@@ -172,6 +164,14 @@ TextArea.propTypes = {
|
|
172
164
|
/**
|
173
165
|
* If `true`, the input will be required.
|
174
166
|
*/
|
167
|
+
/**
|
168
|
+
* Reference forwarded to the `textarea` element.
|
169
|
+
*/
|
170
|
+
ref: PropTypes.oneOfType([
|
171
|
+
PropTypes.func,
|
172
|
+
// eslint-disable-next-line react/forbid-prop-types
|
173
|
+
PropTypes.shape({ current: PropTypes.any }),
|
174
|
+
]),
|
175
175
|
required: PropTypes.bool,
|
176
176
|
/**
|
177
177
|
* The number of visible text lines for the control.
|
@@ -202,6 +202,6 @@ TextArea.propTypes = {
|
|
202
202
|
variant: PropTypes.oneOf(['filled', 'outline']),
|
203
203
|
};
|
204
204
|
|
205
|
-
export const TextAreaWithGlobalProps =
|
205
|
+
export const TextAreaWithGlobalProps = withGlobalProps(TextArea, 'TextArea');
|
206
206
|
|
207
207
|
export default TextAreaWithGlobalProps;
|
@@ -1 +1 @@
|
|
1
|
-
export { default } from './TextArea';
|
1
|
+
export { default as TextArea } from './TextArea';
|
@@ -12,7 +12,7 @@ import {
|
|
12
12
|
Playground,
|
13
13
|
Props,
|
14
14
|
} from 'docz'
|
15
|
-
import { TextField } from '
|
15
|
+
import { TextField } from '../..'
|
16
16
|
|
17
17
|
## Basic Usage
|
18
18
|
|
@@ -189,8 +189,8 @@ attribute to achieve that effect (doesn't work for `number` input type though).
|
|
189
189
|
by `inputSize` API option) is
|
190
190
|
[not available for `number` input type][input-number-size]. TextField supports
|
191
191
|
`inputSize` option for all types of inputs, so you can use it whenever you find
|
192
|
-
it suitable. Just keep in mind the `size` attribute will not be present
|
193
|
-
numeric inputs.
|
192
|
+
it suitable. Just keep in mind the `size` attribute will not be present in the
|
193
|
+
DOM for numeric inputs.
|
194
194
|
|
195
195
|
<Playground>
|
196
196
|
<TextField
|
@@ -7,31 +7,30 @@ import { getRootValidationStateClassName } from '../_helpers/getRootValidationSt
|
|
7
7
|
import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
|
8
8
|
import { transferProps } from '../_helpers/transferProps';
|
9
9
|
import { FormLayoutContext } from '../FormLayout';
|
10
|
-
import withForwardedRef from '../withForwardedRef';
|
11
10
|
import styles from './TextField.scss';
|
12
11
|
|
13
12
|
const SMALL_INPUT_SIZE = 10;
|
14
13
|
|
15
|
-
export const TextField = ({
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
}
|
14
|
+
export const TextField = React.forwardRef((props, ref) => {
|
15
|
+
const {
|
16
|
+
disabled,
|
17
|
+
fullWidth,
|
18
|
+
helpText,
|
19
|
+
id,
|
20
|
+
inputSize,
|
21
|
+
isLabelVisible,
|
22
|
+
label,
|
23
|
+
layout,
|
24
|
+
placeholder,
|
25
|
+
required,
|
26
|
+
size,
|
27
|
+
type,
|
28
|
+
validationState,
|
29
|
+
validationText,
|
30
|
+
value,
|
31
|
+
variant,
|
32
|
+
...restProps
|
33
|
+
} = props;
|
35
34
|
const context = useContext(FormLayoutContext);
|
36
35
|
const hasSmallInput = (inputSize !== null) && (inputSize <= SMALL_INPUT_SIZE);
|
37
36
|
|
@@ -73,7 +72,7 @@ export const TextField = ({
|
|
73
72
|
disabled={disabled}
|
74
73
|
id={id}
|
75
74
|
placeholder={placeholder}
|
76
|
-
ref={
|
75
|
+
ref={ref}
|
77
76
|
required={required}
|
78
77
|
size={type !== 'number' ? inputSize : null}
|
79
78
|
type={type}
|
@@ -102,11 +101,10 @@ export const TextField = ({
|
|
102
101
|
</div>
|
103
102
|
</label>
|
104
103
|
);
|
105
|
-
};
|
104
|
+
});
|
106
105
|
|
107
106
|
TextField.defaultProps = {
|
108
107
|
disabled: false,
|
109
|
-
forwardedRef: undefined,
|
110
108
|
fullWidth: false,
|
111
109
|
helpText: null,
|
112
110
|
id: undefined,
|
@@ -114,6 +112,7 @@ TextField.defaultProps = {
|
|
114
112
|
isLabelVisible: true,
|
115
113
|
layout: 'vertical',
|
116
114
|
placeholder: null,
|
115
|
+
ref: undefined,
|
117
116
|
required: false,
|
118
117
|
size: 'medium',
|
119
118
|
type: 'text',
|
@@ -128,14 +127,6 @@ TextField.propTypes = {
|
|
128
127
|
* If `true`, the input will be disabled.
|
129
128
|
*/
|
130
129
|
disabled: PropTypes.bool,
|
131
|
-
/**
|
132
|
-
* Reference forwarded to the `input` element.
|
133
|
-
*/
|
134
|
-
forwardedRef: PropTypes.oneOfType([
|
135
|
-
PropTypes.func,
|
136
|
-
// eslint-disable-next-line react/forbid-prop-types
|
137
|
-
PropTypes.shape({ current: PropTypes.any }),
|
138
|
-
]),
|
139
130
|
/**
|
140
131
|
* If `true`, the field will span the full width of its parent.
|
141
132
|
*/
|
@@ -153,7 +144,7 @@ TextField.propTypes = {
|
|
153
144
|
*/
|
154
145
|
id: PropTypes.string,
|
155
146
|
/**
|
156
|
-
*
|
147
|
+
* Width of the input field. Translated as `size` attribute for input types other than `number`.
|
157
148
|
*/
|
158
149
|
inputSize: PropTypes.number,
|
159
150
|
/**
|
@@ -176,6 +167,14 @@ TextField.propTypes = {
|
|
176
167
|
* Optional example value.
|
177
168
|
*/
|
178
169
|
placeholder: PropTypes.string,
|
170
|
+
/**
|
171
|
+
* Reference forwarded to the `input` element.
|
172
|
+
*/
|
173
|
+
ref: PropTypes.oneOfType([
|
174
|
+
PropTypes.func,
|
175
|
+
// eslint-disable-next-line react/forbid-prop-types
|
176
|
+
PropTypes.shape({ current: PropTypes.any }),
|
177
|
+
]),
|
179
178
|
/**
|
180
179
|
* If `true`, the input will be required.
|
181
180
|
*/
|
@@ -209,6 +208,6 @@ TextField.propTypes = {
|
|
209
208
|
variant: PropTypes.oneOf(['filled', 'outline']),
|
210
209
|
};
|
211
210
|
|
212
|
-
export const TextFieldWithGlobalProps =
|
211
|
+
export const TextFieldWithGlobalProps = withGlobalProps(TextField, 'TextField');
|
213
212
|
|
214
213
|
export default TextFieldWithGlobalProps;
|
@@ -1 +1 @@
|
|
1
|
-
export { default } from './TextField';
|
1
|
+
export { default as TextField } from './TextField';
|
@@ -1 +1 @@
|
|
1
|
-
export { default } from './TextLink';
|
1
|
+
export { default as TextLink } from './TextLink';
|
@@ -5,24 +5,24 @@ import { classNames } from '../../utils/classNames';
|
|
5
5
|
import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
|
6
6
|
import { transferProps } from '../_helpers/transferProps';
|
7
7
|
import { FormLayoutContext } from '../FormLayout';
|
8
|
-
import withForwardedRef from '../withForwardedRef';
|
9
8
|
import styles from './Toggle.scss';
|
10
9
|
|
11
|
-
export const Toggle = ({
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}
|
10
|
+
export const Toggle = React.forwardRef((props, ref) => {
|
11
|
+
const {
|
12
|
+
checked,
|
13
|
+
disabled,
|
14
|
+
helpText,
|
15
|
+
id,
|
16
|
+
isLabelVisible,
|
17
|
+
label,
|
18
|
+
labelPosition,
|
19
|
+
required,
|
20
|
+
validationState,
|
21
|
+
validationText,
|
22
|
+
value,
|
23
|
+
...restProps
|
24
|
+
} = props;
|
25
|
+
|
26
26
|
const context = useContext(FormLayoutContext);
|
27
27
|
|
28
28
|
return (
|
@@ -56,7 +56,7 @@ export const Toggle = ({
|
|
56
56
|
disabled={disabled}
|
57
57
|
id={id}
|
58
58
|
name={id}
|
59
|
-
ref={
|
59
|
+
ref={ref}
|
60
60
|
required={required}
|
61
61
|
type="checkbox"
|
62
62
|
value={value}
|
@@ -80,16 +80,16 @@ export const Toggle = ({
|
|
80
80
|
)}
|
81
81
|
</label>
|
82
82
|
);
|
83
|
-
};
|
83
|
+
});
|
84
84
|
|
85
85
|
Toggle.defaultProps = {
|
86
86
|
checked: undefined,
|
87
87
|
disabled: false,
|
88
|
-
forwardedRef: undefined,
|
89
88
|
helpText: null,
|
90
89
|
id: undefined,
|
91
90
|
isLabelVisible: true,
|
92
91
|
labelPosition: 'after',
|
92
|
+
ref: undefined,
|
93
93
|
required: false,
|
94
94
|
validationState: null,
|
95
95
|
validationText: null,
|
@@ -105,14 +105,6 @@ Toggle.propTypes = {
|
|
105
105
|
* If `true`, the input will be disabled.
|
106
106
|
*/
|
107
107
|
disabled: PropTypes.bool,
|
108
|
-
/**
|
109
|
-
* Reference forwarded to the `input` element.
|
110
|
-
*/
|
111
|
-
forwardedRef: PropTypes.oneOfType([
|
112
|
-
PropTypes.func,
|
113
|
-
// eslint-disable-next-line react/forbid-prop-types
|
114
|
-
PropTypes.shape({ current: PropTypes.any }),
|
115
|
-
]),
|
116
108
|
/**
|
117
109
|
* Optional help text.
|
118
110
|
*/
|
@@ -138,6 +130,14 @@ Toggle.propTypes = {
|
|
138
130
|
* Placement of the label relative to the input.
|
139
131
|
*/
|
140
132
|
labelPosition: PropTypes.oneOf(['before', 'after']),
|
133
|
+
/**
|
134
|
+
* Reference forwarded to the `input` element.
|
135
|
+
*/
|
136
|
+
ref: PropTypes.oneOfType([
|
137
|
+
PropTypes.func,
|
138
|
+
// eslint-disable-next-line react/forbid-prop-types
|
139
|
+
PropTypes.shape({ current: PropTypes.any }),
|
140
|
+
]),
|
141
141
|
/**
|
142
142
|
* If `true`, the input will be required.
|
143
143
|
*/
|
@@ -159,6 +159,6 @@ Toggle.propTypes = {
|
|
159
159
|
]),
|
160
160
|
};
|
161
161
|
|
162
|
-
export const ToggleWithGlobalProps =
|
162
|
+
export const ToggleWithGlobalProps = withGlobalProps(Toggle, 'Toggle');
|
163
163
|
|
164
164
|
export default ToggleWithGlobalProps;
|
@@ -1 +1 @@
|
|
1
|
-
export { default } from './Toggle';
|
1
|
+
export { default as Toggle } from './Toggle';
|
@@ -11,12 +11,14 @@ import {
|
|
11
11
|
Props,
|
12
12
|
} from 'docz'
|
13
13
|
import { Placeholder } from '../../../docs/_components/Placeholder/Placeholder'
|
14
|
-
import {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
import {
|
15
|
+
CheckboxField,
|
16
|
+
Button,
|
17
|
+
ButtonGroup,
|
18
|
+
Toolbar,
|
19
|
+
ToolbarGroup,
|
20
|
+
ToolbarItem,
|
21
|
+
} from '../..'
|
20
22
|
|
21
23
|
The responsive Toolbar layout is a versatile tool that allows spacing, grouping,
|
22
24
|
and aligning inline items.
|
package/src/lib/index.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
// Components
|
2
|
-
export {
|
3
|
-
export {
|
4
|
-
export {
|
2
|
+
export { Alert } from './components/Alert';
|
3
|
+
export { Badge } from './components/Badge';
|
4
|
+
export { Button } from './components/Button';
|
5
5
|
export { ButtonGroup } from './components/ButtonGroup';
|
6
6
|
export {
|
7
7
|
Card,
|
8
8
|
CardBody,
|
9
9
|
CardFooter,
|
10
10
|
} from './components/Card';
|
11
|
-
export {
|
12
|
-
export {
|
11
|
+
export { CheckboxField } from './components/CheckboxField';
|
12
|
+
export { FileInputField } from './components/FileInputField';
|
13
13
|
export {
|
14
14
|
FormLayout,
|
15
15
|
FormLayoutCustomField,
|
@@ -18,25 +18,33 @@ export {
|
|
18
18
|
Grid,
|
19
19
|
GridSpan,
|
20
20
|
} from './components/Grid';
|
21
|
-
export {
|
22
|
-
|
21
|
+
export {
|
22
|
+
Modal,
|
23
|
+
ModalBody,
|
24
|
+
ModalCloseButton,
|
25
|
+
ModalContent,
|
26
|
+
ModalFooter,
|
27
|
+
ModalHeader,
|
28
|
+
ModalTitle,
|
29
|
+
} from './components/Modal';
|
30
|
+
export { Paper } from './components/Paper';
|
23
31
|
export {
|
24
32
|
Popover,
|
25
33
|
PopoverWrapper,
|
26
34
|
} from './components/Popover';
|
27
|
-
export {
|
28
|
-
export {
|
29
|
-
export {
|
35
|
+
export { Radio } from './components/Radio';
|
36
|
+
export { ScrollView } from './components/ScrollView';
|
37
|
+
export { SelectField } from './components/SelectField';
|
30
38
|
export {
|
31
39
|
Tabs,
|
32
40
|
TabsItem,
|
33
41
|
} from './components/Tabs';
|
34
|
-
export {
|
35
|
-
export {
|
36
|
-
export {
|
37
|
-
export {
|
38
|
-
export {
|
39
|
-
export {
|
42
|
+
export { Table } from './components/Table';
|
43
|
+
export { Text } from './components/Text';
|
44
|
+
export { TextArea } from './components/TextArea';
|
45
|
+
export { TextField } from './components/TextField';
|
46
|
+
export { TextLink } from './components/TextLink';
|
47
|
+
export { Toggle } from './components/Toggle';
|
40
48
|
export {
|
41
49
|
Toolbar,
|
42
50
|
ToolbarGroup,
|
@@ -1,8 +1,12 @@
|
|
1
|
+
import PropTypes from 'prop-types';
|
1
2
|
import React from 'react';
|
2
3
|
import RUIContext from './RUIContext';
|
3
4
|
|
4
5
|
export default (Component, componentName) => {
|
5
|
-
const WithGlobalPropsComponent = (
|
6
|
+
const WithGlobalPropsComponent = ({
|
7
|
+
forwardedRef,
|
8
|
+
...rest
|
9
|
+
}) => (
|
6
10
|
<RUIContext.Consumer>
|
7
11
|
{({ globalProps }) => {
|
8
12
|
const contextGlobalProps = globalProps ? globalProps[componentName] : null;
|
@@ -10,12 +14,25 @@ export default (Component, componentName) => {
|
|
10
14
|
return (
|
11
15
|
<Component
|
12
16
|
{...contextGlobalProps}
|
13
|
-
{...
|
17
|
+
{...rest}
|
18
|
+
ref={forwardedRef}
|
14
19
|
/>
|
15
20
|
);
|
16
21
|
}}
|
17
22
|
</RUIContext.Consumer>
|
18
23
|
);
|
19
24
|
|
20
|
-
|
25
|
+
WithGlobalPropsComponent.defaultProps = {
|
26
|
+
forwardedRef: undefined,
|
27
|
+
};
|
28
|
+
|
29
|
+
WithGlobalPropsComponent.propTypes = {
|
30
|
+
forwardedRef: PropTypes.oneOfType([
|
31
|
+
PropTypes.func,
|
32
|
+
// eslint-disable-next-line react/forbid-prop-types
|
33
|
+
PropTypes.shape({ current: PropTypes.any }),
|
34
|
+
]),
|
35
|
+
};
|
36
|
+
|
37
|
+
return React.forwardRef((props, ref) => (<WithGlobalPropsComponent {...props} forwardedRef={ref} />));
|
21
38
|
};
|
package/src/lib/theme.scss
CHANGED
@@ -196,13 +196,6 @@
|
|
196
196
|
--rui-FormLayout--horizontal__label__width--auto: auto;
|
197
197
|
--rui-FormLayout--horizontal__label__width--limited: fit-content(50%);
|
198
198
|
|
199
|
-
//
|
200
|
-
// Grid
|
201
|
-
// ====
|
202
|
-
|
203
|
-
--rui-Grid__column-gap: var(--rui-spacing-4);
|
204
|
-
--rui-Grid__row-gap: var(--rui-spacing-4);
|
205
|
-
|
206
199
|
//
|
207
200
|
// Toolbar
|
208
201
|
// =======
|
@@ -850,24 +843,21 @@
|
|
850
843
|
--rui-FormField--check--checked__border-color: var(--rui-color-active);
|
851
844
|
--rui-FormField--check--checked__check-background-color: var(--rui-color-active);
|
852
845
|
|
853
|
-
//
|
854
|
-
// TextLink
|
855
|
-
// ========
|
856
|
-
|
857
|
-
--rui-TextLink__color: var(--rui-link-color);
|
858
|
-
--rui-TextLink__text-decoration: var(--rui-link-decoration);
|
859
|
-
--rui-TextLink--hover__color: var(--rui-link-hover-color);
|
860
|
-
--rui-TextLink--hover__text-decoration: var(--rui-link-hover-decoration);
|
861
|
-
|
862
846
|
//
|
863
847
|
// Modal
|
864
848
|
// =====
|
865
849
|
|
850
|
+
--rui-Modal__padding-x: var(--rui-spacing-4);
|
851
|
+
--rui-Modal__padding-y: var(--rui-spacing-4);
|
866
852
|
--rui-Modal__background: var(--rui-color-white);
|
867
|
-
--rui-Modal__box-shadow:
|
853
|
+
--rui-Modal__box-shadow: none;
|
854
|
+
--rui-Modal__separator__width: var(--rui-border-width);
|
855
|
+
--rui-Modal__separator__color: var(--rui-color-gray-100);
|
856
|
+
--rui-Modal__header__gap: var(--rui-spacing-2);
|
868
857
|
--rui-Modal__outer-spacing--xs: var(--rui-spacing-2);
|
869
858
|
--rui-Modal__outer-spacing--sm: var(--rui-spacing-6);
|
870
|
-
--rui-Modal__footer__background: var(--rui-color-
|
859
|
+
--rui-Modal__footer__background: var(--rui-color-white);
|
860
|
+
--rui-Modal__footer__gap: var(--rui-spacing-2);
|
871
861
|
--rui-Modal__backdrop__background: rgb(0 0 0 / 50%);
|
872
862
|
--rui-Modal--auto__min-width: 18rem;
|
873
863
|
--rui-Modal--auto__max-width: 60rem;
|
@@ -894,7 +884,7 @@
|
|
894
884
|
// Popover
|
895
885
|
// =======
|
896
886
|
|
897
|
-
--rui-
|
887
|
+
--rui-Popover__max-width: 15rem;
|
898
888
|
--rui-Popover__padding: var(--rui-spacing-3);
|
899
889
|
--rui-Popover__border-width: 0;
|
900
890
|
--rui-Popover__border-color: transparent;
|
@@ -903,13 +893,6 @@
|
|
903
893
|
--rui-Popover__background-color: var(--rui-color-white);
|
904
894
|
--rui-Popover__box-shadow: var(--rui-elevation-2);
|
905
895
|
|
906
|
-
//
|
907
|
-
// ScrollView
|
908
|
-
// ==========
|
909
|
-
|
910
|
-
--rui-ScrollView__arrow__initial-offset: -0.5rem;
|
911
|
-
--rui-ScrollView__shadow__initial-offset: -1rem;
|
912
|
-
|
913
896
|
//
|
914
897
|
// Tabs
|
915
898
|
// ====
|
@@ -961,4 +944,13 @@
|
|
961
944
|
--rui-Tabs__item--active__box-shadow: var(--rui-Tabs__item__box-shadow);
|
962
945
|
--rui-Tabs__item--active__shift-y: -0.25em;
|
963
946
|
--rui-Tabs__item--active__label__shift-y: 0;
|
947
|
+
|
948
|
+
//
|
949
|
+
// TextLink
|
950
|
+
// ========
|
951
|
+
|
952
|
+
--rui-TextLink__color: var(--rui-link-color);
|
953
|
+
--rui-TextLink__text-decoration: var(--rui-link-decoration);
|
954
|
+
--rui-TextLink--hover__color: var(--rui-link-hover-color);
|
955
|
+
--rui-TextLink--hover__text-decoration: var(--rui-link-hover-decoration);
|
964
956
|
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
$responsive-properties: (
|
2
|
-
columns: 1fr,
|
3
|
-
column-gap: var(--rui-Grid__column-gap),
|
4
|
-
rows: auto,
|
5
|
-
row-gap: var(--rui-Grid__row-gap),
|
6
|
-
auto-flow: initial,
|
7
|
-
align-content: initial,
|
8
|
-
align-items: initial,
|
9
|
-
justify-content: initial,
|
10
|
-
justify-items: initial,
|
11
|
-
);
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
export default (WrappedComponent) => {
|
4
|
-
const withForwardedRef = (props, ref) => (
|
5
|
-
<WrappedComponent {...props} forwardedRef={ref} />
|
6
|
-
);
|
7
|
-
|
8
|
-
withForwardedRef.displayName = `withForwardedRef(${WrappedComponent.name || WrappedComponent.name})`;
|
9
|
-
|
10
|
-
return React.forwardRef(withForwardedRef);
|
11
|
-
};
|