@react-ui-org/react-ui 0.57.0 → 0.59.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/.nvmrc +1 -1
- package/README.md +2 -11
- package/dist/react-ui.css +19 -19
- package/dist/react-ui.development.css +1351 -963
- package/dist/react-ui.development.js +187 -87
- package/dist/react-ui.js +1 -1
- package/package.json +16 -5
- package/src/components/Alert/Alert.jsx +7 -9
- package/src/components/Alert/Alert.module.scss +3 -3
- package/src/components/Alert/README.md +18 -32
- package/src/components/Alert/_settings.scss +1 -2
- package/src/components/Badge/Badge.jsx +3 -3
- package/src/components/Button/Button.jsx +3 -3
- package/src/components/ButtonGroup/ButtonGroup.jsx +3 -3
- package/src/components/Card/Card.jsx +7 -7
- package/src/components/Card/Card.module.scss +8 -7
- package/src/components/Card/CardBody.jsx +2 -2
- package/src/components/Card/CardFooter.jsx +2 -2
- package/src/components/Card/README.md +20 -17
- package/src/components/Card/_settings.scss +1 -2
- package/src/components/Card/_theme.scss +1 -0
- package/src/components/CheckboxField/CheckboxField.jsx +11 -5
- package/src/components/CheckboxField/README.md +110 -5
- package/src/components/FileInputField/FileInputField.jsx +148 -22
- package/src/components/FileInputField/FileInputField.module.scss +87 -1
- package/src/components/FileInputField/README.md +83 -2
- package/src/components/FileInputField/_settings.scss +15 -0
- package/src/components/FormLayout/FormLayout.jsx +3 -3
- package/src/components/FormLayout/FormLayoutCustomField.jsx +3 -3
- package/src/components/FormLayout/README.md +1 -0
- package/src/components/Grid/Grid.jsx +2 -2
- package/src/components/Grid/Grid.module.scss +2 -2
- package/src/components/Grid/GridSpan.jsx +2 -2
- package/src/components/InputGroup/InputGroup.jsx +4 -4
- package/src/components/InputGroup/InputGroup.module.scss +12 -8
- package/src/components/InputGroup/README.md +1 -1
- package/src/components/Modal/Modal.jsx +118 -46
- package/src/components/Modal/Modal.module.scss +34 -18
- package/src/components/Modal/ModalBody.jsx +3 -3
- package/src/components/Modal/ModalBody.module.scss +18 -0
- package/src/components/Modal/ModalCloseButton.jsx +4 -6
- package/src/components/Modal/ModalContent.jsx +2 -2
- package/src/components/Modal/ModalFooter.jsx +3 -3
- package/src/components/Modal/ModalFooter.module.scss +6 -2
- package/src/components/Modal/ModalHeader.jsx +3 -3
- package/src/components/Modal/ModalHeader.module.scss +8 -1
- package/src/components/Modal/ModalTitle.jsx +2 -2
- package/src/components/Modal/README.md +407 -187
- package/src/components/Modal/_animations.scss +9 -0
- package/src/components/Modal/_helpers/dialogOnCancelHandler.js +28 -0
- package/src/components/Modal/_helpers/dialogOnClickHandler.js +46 -0
- package/src/components/Modal/_helpers/dialogOnCloseHandler.js +28 -0
- package/src/components/Modal/_helpers/dialogOnKeyDownHandler.js +62 -0
- package/src/components/Modal/_helpers/getPositionClassName.js +1 -1
- package/src/components/Modal/_hooks/useModalFocus.js +24 -91
- package/src/components/Modal/_settings.scss +4 -3
- package/src/components/Modal/_theme.scss +1 -0
- package/src/components/Paper/Paper.jsx +3 -3
- package/src/components/Popover/Popover.jsx +60 -15
- package/src/components/Popover/Popover.module.scss +37 -9
- package/src/components/Popover/PopoverWrapper.jsx +2 -2
- package/src/components/Popover/README.md +60 -3
- package/src/components/Popover/_helpers/cleanPlacementStyle.js +20 -0
- package/src/components/Radio/README.md +103 -0
- package/src/components/Radio/Radio.jsx +11 -5
- package/src/components/Radio/Radio.module.scss +4 -0
- package/src/components/ScrollView/ScrollView.jsx +5 -7
- package/src/components/SelectField/README.md +103 -0
- package/src/components/SelectField/SelectField.jsx +11 -5
- package/src/components/Table/Table.jsx +2 -2
- package/src/components/Tabs/Tabs.jsx +2 -2
- package/src/components/Tabs/TabsItem.jsx +3 -3
- package/src/components/Text/Text.jsx +3 -3
- package/src/components/TextArea/TextArea.jsx +3 -3
- package/src/components/TextField/README.md +14 -2
- package/src/components/TextField/TextField.jsx +3 -3
- package/src/components/TextLink/README.md +10 -3
- package/src/components/TextLink/TextLink.jsx +2 -2
- package/src/components/TextLink/_theme.scss +3 -3
- package/src/components/Toggle/README.md +83 -1
- package/src/components/Toggle/Toggle.jsx +11 -5
- package/src/components/Toolbar/Toolbar.jsx +3 -3
- package/src/components/Toolbar/ToolbarGroup.jsx +3 -3
- package/src/components/Toolbar/ToolbarItem.jsx +3 -3
- package/src/components/_helpers/resolveContextOrProp.js +6 -3
- package/src/helpers/classNames/README.md +65 -0
- package/src/helpers/classNames/classNames.js +11 -0
- package/src/helpers/classNames/index.js +1 -0
- package/src/helpers/transferProps/README.md +46 -0
- package/src/helpers/transferProps/index.js +1 -0
- package/src/index.js +6 -5
- package/src/providers/globalProps/GlobalPropsContext.jsx +5 -0
- package/src/providers/globalProps/GlobalPropsProvider.jsx +33 -0
- package/src/providers/globalProps/index.js +3 -0
- package/src/{provider → providers/globalProps}/withGlobalProps.jsx +16 -16
- package/src/providers/translations/TranslationsContext.jsx +6 -0
- package/src/providers/translations/TranslationsProvider.jsx +33 -0
- package/src/providers/translations/index.js +2 -0
- package/src/styles/elements/_links.scss +2 -9
- package/src/styles/generic/_focus.scss +1 -1
- package/src/styles/theme/_form-fields.scss +19 -0
- package/src/styles/theme/_links.scss +4 -3
- package/src/styles/tools/_accessibility.scss +3 -5
- package/src/styles/tools/_collections.scss +62 -5
- package/src/styles/tools/_links.scss +17 -0
- package/src/styles/tools/form-fields/_box-field-elements.scss +21 -9
- package/src/styles/tools/form-fields/_box-field-layout.scss +2 -2
- package/src/styles/tools/form-fields/_box-field-sizes.scss +6 -10
- package/src/styles/tools/form-fields/_foundation.scss +6 -4
- package/src/styles/tools/form-fields/_variants.scss +12 -8
- package/src/theme.scss +53 -2
- package/src/translations/en.js +5 -0
- package/src/provider/RUIContext.jsx +0 -9
- package/src/provider/RUIProvider.jsx +0 -42
- package/src/provider/index.js +0 -3
- package/src/styles/settings/_z-indexes.scss +0 -2
- package/src/utils/classNames.js +0 -8
- /package/src/{utils → helpers/transferProps}/transferProps.js +0 -0
@@ -1,22 +1,18 @@
|
|
1
1
|
@use "sass:map";
|
2
2
|
@use "../../theme/form-fields" as theme;
|
3
3
|
|
4
|
-
@mixin size($size, $
|
4
|
+
@mixin size($size, $is-multiline: false) {
|
5
5
|
$size-properties: map.get(theme.$box-sizes, $size);
|
6
6
|
|
7
|
+
--rui-local-height: #{map.get($size-properties, height)};
|
7
8
|
--rui-local-padding-y: #{map.get($size-properties, padding-y)};
|
8
9
|
--rui-local-padding-x: #{map.get($size-properties, padding-x)};
|
10
|
+
--rui-local-font-size: #{map.get($size-properties, font-size)};
|
9
11
|
|
10
|
-
@if $
|
11
|
-
--rui-local-font-size: #{map.get($size-properties, font-size)};
|
12
|
-
|
12
|
+
@if $is-multiline {
|
13
13
|
.input {
|
14
|
-
|
15
|
-
|
16
|
-
min-height: map.get($size-properties, height);
|
17
|
-
} @else {
|
18
|
-
--rui-local-height: #{map.get($size-properties, height)};
|
19
|
-
}
|
14
|
+
height: auto;
|
15
|
+
min-height: map.get($size-properties, height);
|
20
16
|
}
|
21
17
|
}
|
22
18
|
}
|
@@ -18,12 +18,14 @@
|
|
18
18
|
color: var(--rui-local-surrounding-text-color, #{theme.$label-color});
|
19
19
|
}
|
20
20
|
|
21
|
-
@mixin label-required() {
|
21
|
+
@mixin label-required($show-require-sign: true) {
|
22
22
|
color: var(--rui-local-surrounding-text-color, #{theme.$required-label-color});
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
@if $show-require-sign {
|
25
|
+
&::after {
|
26
|
+
content: theme.$required-sign;
|
27
|
+
color: theme.$required-sign-color;
|
28
|
+
}
|
27
29
|
}
|
28
30
|
}
|
29
31
|
|
@@ -13,11 +13,6 @@
|
|
13
13
|
@use "../../settings/form-fields" as settings;
|
14
14
|
@use "../../theme/form-fields" as theme;
|
15
15
|
|
16
|
-
@mixin _disabled-state() {
|
17
|
-
opacity: theme.$disabled-opacity;
|
18
|
-
cursor: theme.$disabled-cursor;
|
19
|
-
}
|
20
|
-
|
21
16
|
// 1.
|
22
17
|
@mixin _generate-custom-properties($type, $variant, $state) {
|
23
18
|
@if not list.index(map.keys(map.get(settings.$themeable-variant-states, $type)), $variant) {
|
@@ -70,7 +65,7 @@
|
|
70
65
|
+ "Choose one of #{map.keys(settings.$themeable-variant-states)}.";
|
71
66
|
}
|
72
67
|
|
73
|
-
$themeable-states: map.get(
|
68
|
+
$themeable-states: map.get(settings.$themeable-variant-states, $type, $variant);
|
74
69
|
|
75
70
|
@if list.index($themeable-states, "hover") {
|
76
71
|
@include _generate-custom-properties($type, $variant, "default");
|
@@ -113,11 +108,16 @@
|
|
113
108
|
}
|
114
109
|
}
|
115
110
|
|
111
|
+
@mixin disabled-state() {
|
112
|
+
opacity: theme.$disabled-opacity;
|
113
|
+
cursor: theme.$disabled-cursor;
|
114
|
+
}
|
115
|
+
|
116
116
|
@mixin visual($type, $variant: "default", $has-caret: false) {
|
117
117
|
@include _get-theme($type, $variant);
|
118
118
|
|
119
119
|
.input:disabled {
|
120
|
-
@include
|
120
|
+
@include disabled-state();
|
121
121
|
}
|
122
122
|
|
123
123
|
@if $type == "box" and $variant == "filled" {
|
@@ -137,11 +137,15 @@
|
|
137
137
|
}
|
138
138
|
|
139
139
|
&.isRootDisabled .caret {
|
140
|
-
@include
|
140
|
+
@include disabled-state();
|
141
141
|
}
|
142
142
|
}
|
143
143
|
}
|
144
144
|
|
145
145
|
@mixin validation($variant) {
|
146
|
+
--rui-local-link-color: #{map.get(theme.$link-validation-colors, $variant, default)};
|
147
|
+
--rui-local-link-color-hover: #{map.get(theme.$link-validation-colors, $variant, hover)};
|
148
|
+
--rui-local-link-color-active: #{map.get(theme.$link-validation-colors, $variant, active)};
|
149
|
+
|
146
150
|
@include _get-theme(validation, $variant);
|
147
151
|
}
|
package/src/theme.scss
CHANGED
@@ -49,7 +49,31 @@
|
|
49
49
|
// Font Families
|
50
50
|
// =============
|
51
51
|
|
52
|
-
|
52
|
+
// Native font stack inspired by Bootstrap.
|
53
|
+
// @see https://getbootstrap.com/docs/5.0/content/reboot/#native-font-stack
|
54
|
+
// @see https://css-tricks.com/snippets/css/system-font-stack/
|
55
|
+
--rui-font-family-base:
|
56
|
+
/* Cross-platform generic font family (default user interface font) */
|
57
|
+
system-ui,
|
58
|
+
/* Safari for macOS and iOS (San Francisco)*/
|
59
|
+
-apple-system,
|
60
|
+
/* Windows*/
|
61
|
+
"Segoe UI",
|
62
|
+
/* Android*/
|
63
|
+
roboto,
|
64
|
+
/* Basic web fallback*/
|
65
|
+
"Helvetica Neue",
|
66
|
+
arial,
|
67
|
+
/* Linux*/
|
68
|
+
"Noto Sans",
|
69
|
+
"Liberation Sans",
|
70
|
+
/* Sans serif fallback*/
|
71
|
+
sans-serif,
|
72
|
+
/* Emoji fonts*/
|
73
|
+
"Apple Color Emoji",
|
74
|
+
"Segoe UI Emoji",
|
75
|
+
"Segoe UI Symbol",
|
76
|
+
"Noto Color Emoji";
|
53
77
|
--rui-font-family-monospace:
|
54
78
|
"SFMono-Regular",
|
55
79
|
"Menlo",
|
@@ -109,7 +133,8 @@
|
|
109
133
|
--rui-line-height-small: 1.25;
|
110
134
|
|
111
135
|
// Text decorations
|
112
|
-
--rui-
|
136
|
+
--rui-underline-offset-link: 0.1875em;
|
137
|
+
--rui-text-decoration-link: underline;
|
113
138
|
--rui-text-decoration-link-hover: underline;
|
114
139
|
--rui-text-decoration-link-active: underline;
|
115
140
|
|
@@ -802,6 +827,7 @@
|
|
802
827
|
--rui-Card__padding: var(--rui-dimension-space-4);
|
803
828
|
--rui-Card__border-width: var(--rui-dimension-border-width-1);
|
804
829
|
--rui-Card__border-radius: var(--rui-dimension-radius-2);
|
830
|
+
--rui-Card__background-color: var(--rui-color-background-layer-1);
|
805
831
|
--rui-Card--dense__padding: var(--rui-dimension-space-2);
|
806
832
|
--rui-Card--raised__box-shadow: var(--rui-shadow-layer-1);
|
807
833
|
--rui-Card--disabled__background-color: var(--rui-color-background-disabled);
|
@@ -1011,6 +1037,31 @@
|
|
1011
1037
|
--rui-Modal--large__width: 60rem;
|
1012
1038
|
--rui-Modal--fullscreen__width: 100%;
|
1013
1039
|
--rui-Modal--fullscreen__height: 100%;
|
1040
|
+
--rui-Modal__animation__duration: 0.25s;
|
1041
|
+
|
1042
|
+
// Modal: success variant
|
1043
|
+
--rui-Modal--success__border-color: var(--rui-color-feedback-success);
|
1044
|
+
--rui-Modal--success__background-color: var(--rui-color-background-success);
|
1045
|
+
|
1046
|
+
// Modal: warning variant
|
1047
|
+
--rui-Modal--warning__border-color: var(--rui-color-feedback-warning);
|
1048
|
+
--rui-Modal--warning__background-color: var(--rui-color-background-warning);
|
1049
|
+
|
1050
|
+
// Modal: danger variant
|
1051
|
+
--rui-Modal--danger__border-color: var(--rui-color-feedback-danger);
|
1052
|
+
--rui-Modal--danger__background-color: var(--rui-color-background-danger);
|
1053
|
+
|
1054
|
+
// Modal: info variant
|
1055
|
+
--rui-Modal--info__border-color: var(--rui-color-feedback-info);
|
1056
|
+
--rui-Modal--info__background-color: var(--rui-color-background-info);
|
1057
|
+
|
1058
|
+
// Modal: help variant
|
1059
|
+
--rui-Modal--help__border-color: var(--rui-color-feedback-help);
|
1060
|
+
--rui-Modal--help__background-color: var(--rui-color-background-help);
|
1061
|
+
|
1062
|
+
// Modal: note variant
|
1063
|
+
--rui-Modal--note__border-color: var(--rui-color-feedback-note);
|
1064
|
+
--rui-Modal--note__background-color: var(--rui-color-background-note);
|
1014
1065
|
|
1015
1066
|
//
|
1016
1067
|
// Paper
|
package/src/translations/en.js
CHANGED
@@ -1,42 +0,0 @@
|
|
1
|
-
import PropTypes from 'prop-types';
|
2
|
-
import React, {
|
3
|
-
useContext,
|
4
|
-
useMemo,
|
5
|
-
} from 'react';
|
6
|
-
import defaultTranslations from '../translations/en';
|
7
|
-
import { mergeDeep } from '../utils/mergeDeep';
|
8
|
-
import RUIContext from './RUIContext';
|
9
|
-
|
10
|
-
const RUIProvider = ({
|
11
|
-
children,
|
12
|
-
globalProps,
|
13
|
-
translations,
|
14
|
-
}) => {
|
15
|
-
const context = useContext(RUIContext);
|
16
|
-
const childProps = useMemo(() => ({
|
17
|
-
globalProps: mergeDeep(context?.globalProps || {}, globalProps),
|
18
|
-
translations: mergeDeep(context?.translations || {}, translations),
|
19
|
-
}), [context, globalProps, translations]);
|
20
|
-
|
21
|
-
return (
|
22
|
-
<RUIContext.Provider
|
23
|
-
value={childProps}
|
24
|
-
>
|
25
|
-
{children}
|
26
|
-
</RUIContext.Provider>
|
27
|
-
);
|
28
|
-
};
|
29
|
-
|
30
|
-
RUIProvider.defaultProps = {
|
31
|
-
children: null,
|
32
|
-
globalProps: null,
|
33
|
-
translations: defaultTranslations,
|
34
|
-
};
|
35
|
-
|
36
|
-
RUIProvider.propTypes = {
|
37
|
-
children: PropTypes.node,
|
38
|
-
globalProps: PropTypes.shape({}),
|
39
|
-
translations: PropTypes.shape({}),
|
40
|
-
};
|
41
|
-
|
42
|
-
export default RUIProvider;
|
package/src/provider/index.js
DELETED
package/src/utils/classNames.js
DELETED
File without changes
|