@react-ui-org/react-ui 0.45.0 → 0.46.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/CONTRIBUTING.md +7 -0
- package/dist/lib.development.js +113 -89
- package/dist/lib.js +1 -1
- package/package.json +4 -4
- package/src/lib/components/Badge/Badge.jsx +1 -4
- package/src/lib/components/Button/README.mdx +1 -1
- package/src/lib/components/ButtonGroup/ButtonGroup.jsx +30 -22
- package/src/lib/components/Card/CardBody.jsx +5 -11
- package/src/lib/components/Card/CardFooter.jsx +10 -5
- package/src/lib/components/CheckboxField/CheckboxField.jsx +9 -9
- package/src/lib/components/CheckboxField/CheckboxField.scss +1 -1
- package/src/lib/components/CheckboxField/README.mdx +1 -1
- package/src/lib/components/FileInputField/README.mdx +1 -1
- package/src/lib/components/FormLayout/FormLayout.jsx +11 -10
- package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +6 -1
- package/src/lib/components/FormLayout/README.mdx +7 -9
- package/src/lib/components/Grid/Grid.jsx +3 -2
- package/src/lib/components/Grid/GridSpan.jsx +3 -2
- package/src/lib/components/List/List.jsx +3 -2
- package/src/lib/components/List/ListItem.jsx +3 -2
- package/src/lib/components/Media/Media.jsx +12 -5
- package/src/lib/components/Media/MediaBody.jsx +18 -7
- package/src/lib/components/Media/MediaObject.jsx +18 -7
- package/src/lib/components/Modal/Modal.jsx +2 -1
- package/src/lib/components/Paper/Paper.jsx +1 -2
- package/src/lib/components/Radio/README.mdx +1 -1
- package/src/lib/components/Radio/Radio.scss +1 -1
- package/src/lib/components/ScrollView/README.mdx +3 -0
- package/src/lib/components/ScrollView/ScrollView.jsx +2 -1
- package/src/lib/components/SelectField/README.mdx +1 -1
- package/src/lib/components/Tabs/Tabs.jsx +1 -2
- package/src/lib/components/Text/README.mdx +1 -1
- package/src/lib/components/Text/Text.jsx +8 -2
- package/src/lib/components/Text/Text.scss +12 -2
- package/src/lib/components/Text/_helpers/getRootClampClassName.js +11 -0
- package/src/lib/components/TextArea/README.mdx +1 -1
- package/src/lib/components/TextArea/TextArea.jsx +4 -1
- package/src/lib/components/TextField/README.mdx +1 -1
- package/src/lib/components/TextLink/README.mdx +77 -0
- package/src/lib/components/{Link/Link.jsx → TextLink/TextLink.jsx} +11 -12
- package/src/lib/components/TextLink/TextLink.scss +11 -0
- package/src/lib/components/TextLink/_theme.scss +4 -0
- package/src/lib/components/TextLink/index.js +1 -0
- package/src/lib/components/Toggle/README.mdx +1 -1
- package/src/lib/components/Toggle/Toggle.jsx +9 -9
- package/src/lib/components/Toggle/Toggle.scss +1 -1
- package/src/lib/components/Toolbar/README.mdx +16 -0
- package/src/lib/components/Toolbar/Toolbar.jsx +18 -10
- package/src/lib/components/Toolbar/Toolbar.scss +13 -8
- package/src/lib/components/Toolbar/ToolbarGroup.jsx +13 -9
- package/src/lib/components/Toolbar/ToolbarItem.jsx +26 -7
- package/src/lib/components/_helpers/isChildrenEmpty.js +3 -0
- package/src/lib/index.js +1 -1
- package/src/lib/styles/tools/_reset.scss +4 -1
- package/src/lib/styles/tools/form-fields/_box-field-layout.scss +3 -3
- package/src/lib/styles/tools/form-fields/_inline-field-elements.scss +12 -1
- package/src/lib/styles/tools/form-fields/_inline-field-layout.scss +46 -5
- package/src/lib/theme.scss +6 -6
- package/src/lib/components/Link/Link.scss +0 -11
- package/src/lib/components/Link/README.mdx +0 -85
- package/src/lib/components/Link/_theme.scss +0 -4
- package/src/lib/components/Link/index.js +0 -1
@@ -10,6 +10,7 @@
|
|
10
10
|
|
11
11
|
@use "../../settings/forms";
|
12
12
|
@use "../../settings/form-fields" as settings;
|
13
|
+
@use "../../theme/form-fields" as theme;
|
13
14
|
@use "../../theme/typography";
|
14
15
|
@use "../breakpoint";
|
15
16
|
|
@@ -27,11 +28,18 @@
|
|
27
28
|
}
|
28
29
|
}
|
29
30
|
|
30
|
-
@mixin field() {
|
31
|
+
@mixin field($type) {
|
31
32
|
display: flex; // 1.
|
32
33
|
align-items: flex-start;
|
33
34
|
min-width: 0; // 1.
|
34
35
|
|
36
|
+
@if $type == "radio" {
|
37
|
+
flex-direction: row;
|
38
|
+
} @else {
|
39
|
+
flex-direction: row-reverse;
|
40
|
+
justify-content: flex-end;
|
41
|
+
}
|
42
|
+
|
35
43
|
.input {
|
36
44
|
flex: none;
|
37
45
|
}
|
@@ -45,7 +53,7 @@
|
|
45
53
|
|
46
54
|
@mixin has-label-before() {
|
47
55
|
.field {
|
48
|
-
flex-direction: row
|
56
|
+
flex-direction: row;
|
49
57
|
}
|
50
58
|
|
51
59
|
.label,
|
@@ -62,12 +70,45 @@
|
|
62
70
|
|
63
71
|
@include breakpoint.up(forms.$horizontal-breakpoint) {
|
64
72
|
&.rootLayoutHorizontal {
|
73
|
+
grid: inherit;
|
74
|
+
grid-template-columns: subgrid;
|
75
|
+
grid-column: span 2;
|
76
|
+
|
77
|
+
@supports not (grid-template-columns: subgrid) {
|
78
|
+
display: contents;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
&.rootLayoutHorizontal .field {
|
83
|
+
display: contents;
|
84
|
+
}
|
85
|
+
|
86
|
+
&.rootLayoutHorizontal .label {
|
87
|
+
grid-column-start: 1;
|
88
|
+
width: auto;
|
89
|
+
padding-right: settings.$horizontal-inner-gap;
|
90
|
+
margin-left: 0;
|
91
|
+
text-align: theme.$horizontal-label-text-align;
|
92
|
+
}
|
93
|
+
|
94
|
+
&.rootLayoutHorizontal .input,
|
95
|
+
&.rootLayoutHorizontal .helpText,
|
96
|
+
&.rootLayoutHorizontal .validationText {
|
65
97
|
grid-column-start: 2;
|
66
98
|
}
|
67
99
|
|
68
|
-
&.rootLayoutHorizontal .
|
69
|
-
&.rootLayoutHorizontal .
|
70
|
-
width: auto;
|
100
|
+
&.rootLayoutHorizontal .helpText,
|
101
|
+
&.rootLayoutHorizontal .validationText {
|
102
|
+
width: auto;
|
103
|
+
max-width: 100%;
|
104
|
+
|
105
|
+
@supports not (grid-template-columns: subgrid) {
|
106
|
+
margin-top: calc(-1 * var(--rui-FormLayout__row-gap));
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
&.rootLayoutHorizontal.hasRootLabelBefore .label {
|
111
|
+
margin-right: 0;
|
71
112
|
}
|
72
113
|
}
|
73
114
|
}
|
package/src/lib/theme.scss
CHANGED
@@ -863,13 +863,13 @@
|
|
863
863
|
--rui-FormField--check--checked__check-background-color: var(--rui-color-active);
|
864
864
|
|
865
865
|
//
|
866
|
-
//
|
867
|
-
//
|
866
|
+
// TextLink
|
867
|
+
// ========
|
868
868
|
|
869
|
-
--rui-
|
870
|
-
--rui-
|
871
|
-
--rui-
|
872
|
-
--rui-
|
869
|
+
--rui-TextLink__color: var(--rui-link-color);
|
870
|
+
--rui-TextLink__text-decoration: var(--rui-link-decoration);
|
871
|
+
--rui-TextLink--hover__color: var(--rui-link-hover-color);
|
872
|
+
--rui-TextLink--hover__text-decoration: var(--rui-link-hover-decoration);
|
873
873
|
|
874
874
|
//
|
875
875
|
// Modal
|
@@ -1,85 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Link
|
3
|
-
menu: 'Actions'
|
4
|
-
route: /components/link
|
5
|
-
---
|
6
|
-
|
7
|
-
# Link
|
8
|
-
|
9
|
-
import {
|
10
|
-
Playground,
|
11
|
-
Props,
|
12
|
-
} from 'docz'
|
13
|
-
import Placeholder from '../../../docs/_components/Placeholder'
|
14
|
-
import { Link } from './Link'
|
15
|
-
|
16
|
-
Link allow users to follow navigation.
|
17
|
-
|
18
|
-
## Basic Usage
|
19
|
-
|
20
|
-
To implement the Link component, you need to import it first:
|
21
|
-
|
22
|
-
```js
|
23
|
-
import { Link } from '@react-ui-org/react-ui';
|
24
|
-
```
|
25
|
-
|
26
|
-
And use it:
|
27
|
-
|
28
|
-
<Playground>
|
29
|
-
<Link href="/contribute/guidelines">How can I contribute to React UI?</Link>
|
30
|
-
</Playground>
|
31
|
-
|
32
|
-
See [API](#api) for all available options.
|
33
|
-
|
34
|
-
## General Guidelines
|
35
|
-
|
36
|
-
**Avoid using links for actions**, use a [Button](/components/button)
|
37
|
-
instead. This is because users expect navigation to happen when clicking on
|
38
|
-
something what looks like a link.
|
39
|
-
|
40
|
-
## Block-Level Content
|
41
|
-
|
42
|
-
Besides text, link can contain block-level elements too.
|
43
|
-
|
44
|
-
<Playground>
|
45
|
-
<Link href="/contribute/guidelines">
|
46
|
-
<Placeholder>Block-level element wrapped with link</Placeholder>
|
47
|
-
</Link>
|
48
|
-
</Playground>
|
49
|
-
|
50
|
-
## Custom Routing
|
51
|
-
|
52
|
-
It's common to use custom function for routing within SPAs. Use the
|
53
|
-
`onClick` option to provide such function.
|
54
|
-
|
55
|
-
<Playground>
|
56
|
-
<Link
|
57
|
-
href="/contribute/guidelines"
|
58
|
-
onClick={(event) => {
|
59
|
-
event.preventDefault();
|
60
|
-
window.location = event.currentTarget.getAttribute('href');
|
61
|
-
}}
|
62
|
-
>
|
63
|
-
This link is controlled by custom function
|
64
|
-
</Link>
|
65
|
-
</Playground>
|
66
|
-
|
67
|
-
## API
|
68
|
-
|
69
|
-
In addition to the options below, you can specify [React synthetic events] or
|
70
|
-
any custom HTML attributes that do not interfere with the API, and they will be
|
71
|
-
passed to the `a` HTML element. This enables making the component interactive
|
72
|
-
and helps improve its accessibility.
|
73
|
-
|
74
|
-
<Props table of={Link} />
|
75
|
-
|
76
|
-
## Theming
|
77
|
-
|
78
|
-
| Custom Property | Description |
|
79
|
-
|--------------------------------------|----------------------------------------------|
|
80
|
-
| `--rui-Link__color` | Text color |
|
81
|
-
| `--rui-Link__text-decoration` | Text decoration, e.g. underline |
|
82
|
-
| `--rui-Link--hover__color` | Text color on hover |
|
83
|
-
| `--rui-Link--hover__text-decoration` | Text decoration on hover |
|
84
|
-
|
85
|
-
[React synthetic events]: https://reactjs.org/docs/events.html
|
@@ -1 +0,0 @@
|
|
1
|
-
export { default } from './Link';
|