@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.
Files changed (62) hide show
  1. package/CONTRIBUTING.md +7 -0
  2. package/dist/lib.development.js +113 -89
  3. package/dist/lib.js +1 -1
  4. package/package.json +4 -4
  5. package/src/lib/components/Badge/Badge.jsx +1 -4
  6. package/src/lib/components/Button/README.mdx +1 -1
  7. package/src/lib/components/ButtonGroup/ButtonGroup.jsx +30 -22
  8. package/src/lib/components/Card/CardBody.jsx +5 -11
  9. package/src/lib/components/Card/CardFooter.jsx +10 -5
  10. package/src/lib/components/CheckboxField/CheckboxField.jsx +9 -9
  11. package/src/lib/components/CheckboxField/CheckboxField.scss +1 -1
  12. package/src/lib/components/CheckboxField/README.mdx +1 -1
  13. package/src/lib/components/FileInputField/README.mdx +1 -1
  14. package/src/lib/components/FormLayout/FormLayout.jsx +11 -10
  15. package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +6 -1
  16. package/src/lib/components/FormLayout/README.mdx +7 -9
  17. package/src/lib/components/Grid/Grid.jsx +3 -2
  18. package/src/lib/components/Grid/GridSpan.jsx +3 -2
  19. package/src/lib/components/List/List.jsx +3 -2
  20. package/src/lib/components/List/ListItem.jsx +3 -2
  21. package/src/lib/components/Media/Media.jsx +12 -5
  22. package/src/lib/components/Media/MediaBody.jsx +18 -7
  23. package/src/lib/components/Media/MediaObject.jsx +18 -7
  24. package/src/lib/components/Modal/Modal.jsx +2 -1
  25. package/src/lib/components/Paper/Paper.jsx +1 -2
  26. package/src/lib/components/Radio/README.mdx +1 -1
  27. package/src/lib/components/Radio/Radio.scss +1 -1
  28. package/src/lib/components/ScrollView/README.mdx +3 -0
  29. package/src/lib/components/ScrollView/ScrollView.jsx +2 -1
  30. package/src/lib/components/SelectField/README.mdx +1 -1
  31. package/src/lib/components/Tabs/Tabs.jsx +1 -2
  32. package/src/lib/components/Text/README.mdx +1 -1
  33. package/src/lib/components/Text/Text.jsx +8 -2
  34. package/src/lib/components/Text/Text.scss +12 -2
  35. package/src/lib/components/Text/_helpers/getRootClampClassName.js +11 -0
  36. package/src/lib/components/TextArea/README.mdx +1 -1
  37. package/src/lib/components/TextArea/TextArea.jsx +4 -1
  38. package/src/lib/components/TextField/README.mdx +1 -1
  39. package/src/lib/components/TextLink/README.mdx +77 -0
  40. package/src/lib/components/{Link/Link.jsx → TextLink/TextLink.jsx} +11 -12
  41. package/src/lib/components/TextLink/TextLink.scss +11 -0
  42. package/src/lib/components/TextLink/_theme.scss +4 -0
  43. package/src/lib/components/TextLink/index.js +1 -0
  44. package/src/lib/components/Toggle/README.mdx +1 -1
  45. package/src/lib/components/Toggle/Toggle.jsx +9 -9
  46. package/src/lib/components/Toggle/Toggle.scss +1 -1
  47. package/src/lib/components/Toolbar/README.mdx +16 -0
  48. package/src/lib/components/Toolbar/Toolbar.jsx +18 -10
  49. package/src/lib/components/Toolbar/Toolbar.scss +13 -8
  50. package/src/lib/components/Toolbar/ToolbarGroup.jsx +13 -9
  51. package/src/lib/components/Toolbar/ToolbarItem.jsx +26 -7
  52. package/src/lib/components/_helpers/isChildrenEmpty.js +3 -0
  53. package/src/lib/index.js +1 -1
  54. package/src/lib/styles/tools/_reset.scss +4 -1
  55. package/src/lib/styles/tools/form-fields/_box-field-layout.scss +3 -3
  56. package/src/lib/styles/tools/form-fields/_inline-field-elements.scss +12 -1
  57. package/src/lib/styles/tools/form-fields/_inline-field-layout.scss +46 -5
  58. package/src/lib/theme.scss +6 -6
  59. package/src/lib/components/Link/Link.scss +0 -11
  60. package/src/lib/components/Link/README.mdx +0 -85
  61. package/src/lib/components/Link/_theme.scss +0 -4
  62. 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-reverse;
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 .label,
69
- &.rootLayoutHorizontal .optionLabel {
70
- width: auto; // 1.
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
  }
@@ -863,13 +863,13 @@
863
863
  --rui-FormField--check--checked__check-background-color: var(--rui-color-active);
864
864
 
865
865
  //
866
- // Link
867
- // ====
866
+ // TextLink
867
+ // ========
868
868
 
869
- --rui-Link__color: var(--rui-link-color);
870
- --rui-Link__text-decoration: var(--rui-link-decoration);
871
- --rui-Link--hover__color: var(--rui-link-hover-color);
872
- --rui-Link--hover__text-decoration: var(--rui-link-hover-decoration);
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,11 +0,0 @@
1
- @use "theme";
2
-
3
- .root {
4
- text-decoration: theme.$link-text-decoration;
5
- color: theme.$link-color;
6
-
7
- &:hover {
8
- text-decoration: theme.$link-hover-text-decoration;
9
- color: theme.$link-hover-color;
10
- }
11
- }
@@ -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,4 +0,0 @@
1
- $link-color: var(--rui-Link__color);
2
- $link-text-decoration: var(--rui-Link__text-decoration);
3
- $link-hover-color: var(--rui-Link--hover__color);
4
- $link-hover-text-decoration: var(--rui-Link--hover__text-decoration);
@@ -1 +0,0 @@
1
- export { default } from './Link';