@react-ui-org/react-ui 0.44.0 β 0.44.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib.development.js +2 -2
- package/dist/lib.js +1 -1
- package/package.json +1 -1
- package/src/lib/components/Button/README.mdx +1 -1
- package/src/lib/components/ButtonGroup/README.mdx +4 -4
- package/src/lib/components/CTA/README.mdx +1 -1
- package/src/lib/components/Card/README.mdx +2 -2
- package/src/lib/components/CheckboxField/README.mdx +2 -2
- package/src/lib/components/FormLayout/README.mdx +7 -7
- package/src/lib/components/Grid/Grid.scss +11 -0
- package/src/lib/components/Link/README.mdx +1 -1
- package/src/lib/components/List/README.mdx +1 -1
- package/src/lib/components/Modal/README.mdx +2 -2
- package/src/lib/components/Paper/README.mdx +1 -1
- package/src/lib/components/Radio/README.mdx +3 -3
- package/src/lib/components/ScrollView/README.mdx +1 -1
- package/src/lib/components/SelectField/README.mdx +3 -3
- package/src/lib/components/Table/README.mdx +3 -3
- package/src/lib/components/Tabs/README.mdx +1 -1
- package/src/lib/components/TextField/TextField.jsx +1 -0
- package/src/lib/components/Toggle/README.mdx +2 -2
- package/src/lib/components/Toolbar/README.mdx +3 -3
package/package.json
CHANGED
@@ -207,7 +207,7 @@ of your choice and display label once you know there is enough room for it.
|
|
207
207
|
|
208
208
|
## Buttons with Badges
|
209
209
|
|
210
|
-
A [Badge](/components/
|
210
|
+
A [Badge](/components/badge) can be added to buttons to provide additional
|
211
211
|
information or to draw user's attention.
|
212
212
|
|
213
213
|
<Playground>
|
@@ -44,11 +44,11 @@ See [API](#api) for all available options.
|
|
44
44
|
- Use **short labels or icons** so the buttons can fit small screens.
|
45
45
|
|
46
46
|
- For toggling between on/off states, use rather the
|
47
|
-
[Toggle](/components/
|
47
|
+
[Toggle](/components/toggle) component.
|
48
48
|
|
49
49
|
- For switching between options in a form that needs to be submitted, use rather
|
50
|
-
the [SelectField](/components/
|
51
|
-
[Radio](/components/
|
50
|
+
the [SelectField](/components/select-field) or
|
51
|
+
[Radio](/components/radio) components.
|
52
52
|
|
53
53
|
- Be careful with using `startCorner` and `endCorner` options for grouped
|
54
54
|
buttons. Overflowing elements may cause undesired interaction problems.
|
@@ -65,7 +65,7 @@ different types or sizes.
|
|
65
65
|
## Priorities
|
66
66
|
|
67
67
|
There are three **visual priorities** of buttons which exactly copy the
|
68
|
-
priorities of the [Button](/components/
|
68
|
+
priorities of the [Button](/components/button) component:
|
69
69
|
|
70
70
|
1. filled
|
71
71
|
2. outline
|
@@ -61,7 +61,7 @@ See [API](#api) for all available options.
|
|
61
61
|
|
62
62
|
- Place rather **a few smaller elements** into the layout, so they fit the
|
63
63
|
screen even at the smallest size. For complex layouts and a lot of actions,
|
64
|
-
consider using the [Toolbar](/components/
|
64
|
+
consider using the [Toolbar](/components/toolbar) layout.
|
65
65
|
|
66
66
|
π On screen sizes smaller than 66 em (the `lg`
|
67
67
|
[breakpoint](/foundation/breakpoints)), the start element expands over the full
|
@@ -53,7 +53,7 @@ See [API](#api) for all available options.
|
|
53
53
|
grid. It will help you keep the UI clean and easy to scan.
|
54
54
|
|
55
55
|
- **Card, or Paper?** Card is a versatile surface for displaying content.
|
56
|
-
However, there is also the [Paper](/components/
|
56
|
+
However, there is also the [Paper](/components/paper) component. While Card
|
57
57
|
is designed for displaying items (and also supports more visual options),
|
58
58
|
Paper is usually used to hold larger content areas like lists, grids, or
|
59
59
|
forms.
|
@@ -119,7 +119,7 @@ card should be also smaller to keep the card contained and easy to scan.
|
|
119
119
|
|
120
120
|
## Scrollable Card
|
121
121
|
|
122
|
-
Combine Card with [ScrollView](/components/
|
122
|
+
Combine Card with [ScrollView](/components/scroll-view) to enable scrolling
|
123
123
|
for card content.
|
124
124
|
|
125
125
|
<Playground>
|
@@ -44,13 +44,13 @@ See [API](#api) for all available options.
|
|
44
44
|
- Use the CheckboxField when there are lists of options and the user may
|
45
45
|
**select any number of choices,** including zero, one, or several. For
|
46
46
|
selecting just a single option from the list, use either the
|
47
|
-
[Radio](/components/
|
47
|
+
[Radio](/components/radio) or [SelectField](/components/select-field)
|
48
48
|
component.
|
49
49
|
|
50
50
|
- Use the CheckboxField for boolean (true/false) input **in forms that require
|
51
51
|
to be confirmed** by a button to become active. To toggle things on or off
|
52
52
|
with an immediate effect (without confirmation), use rather the
|
53
|
-
[Toggle](/components/
|
53
|
+
[Toggle](/components/toggle) component.
|
54
54
|
|
55
55
|
- **Use positive wording for the checkbox label,** so that it's clear what will
|
56
56
|
happen when the user turns on the checkbox. Avoid negations such as βDon't
|
@@ -60,10 +60,10 @@ the job: the
|
|
60
60
|
are supported!). All React UI form components are ready for this use case and
|
61
61
|
don't need to be wrapped in any `div`s. Namely, the FormLayout supports the
|
62
62
|
following React UI components:
|
63
|
-
[CheckboxField](/components/
|
64
|
-
[Radio](/components/
|
65
|
-
[TextArea](/components/
|
66
|
-
and [Toggle](/components/
|
63
|
+
[CheckboxField](/components/checkbox-field),
|
64
|
+
[Radio](/components/radio), [SelectField](/components/select-field),
|
65
|
+
[TextArea](/components/text-area), [TextField](/components/text-field),
|
66
|
+
and [Toggle](/components/toggle).
|
67
67
|
|
68
68
|
- Use the [FormLayoutCustomField](#custom-fields) component when you need to
|
69
69
|
place any **custom content** inside the FormLayout. This layout helper ensures
|
@@ -80,7 +80,7 @@ in cases when there are longer validation messages or help texts.
|
|
80
80
|
|
81
81
|
## Vertical Layout
|
82
82
|
|
83
|
-
Vertical FormLayout works similar to the [List](/components/
|
83
|
+
Vertical FormLayout works similar to the [List](/components/list) layout
|
84
84
|
except that no equivalent of ListItems is needed. It stacks the form fields
|
85
85
|
vertically while it forces the vertical layout mode on them. To use this layout,
|
86
86
|
simply wrap your form fields with the FormLayout component:
|
@@ -209,7 +209,7 @@ with CSS custom properties.
|
|
209
209
|
|
210
210
|
Please note the `auto` and `limited` label width options may not function
|
211
211
|
correctly in combination with other auto layout mechanisms, e.g. the auto-width
|
212
|
-
[Modal](/components/
|
212
|
+
[Modal](/components/modal). It's just too much of magic that doesn't quite
|
213
213
|
work together yet π©.
|
214
214
|
|
215
215
|
#### Inline Form Fields
|
@@ -226,7 +226,7 @@ is fully supported in
|
|
226
226
|
## Alignment
|
227
227
|
|
228
228
|
To align whole FormLayout to center of a container, simply wrap it with the
|
229
|
-
[Center](/components/
|
229
|
+
[Center](/components/center) layout.
|
230
230
|
|
231
231
|
<Playground>
|
232
232
|
<Placeholder bordered height="24rem">
|
@@ -51,3 +51,14 @@
|
|
51
51
|
grid-column: span var(--rui-local-column-span, 1); // 2.
|
52
52
|
grid-row: span var(--rui-local-row-span, 1); // 2.
|
53
53
|
}
|
54
|
+
|
55
|
+
/* stylelint-disable selector-no-qualifying-type */
|
56
|
+
|
57
|
+
dl.root,
|
58
|
+
ol.root,
|
59
|
+
ul.root {
|
60
|
+
padding-left: 0;
|
61
|
+
margin-left: 0;
|
62
|
+
}
|
63
|
+
|
64
|
+
/* stylelint-enable selector-no-qualifying-type */
|
@@ -33,7 +33,7 @@ See [API](#api) for all available options.
|
|
33
33
|
|
34
34
|
## General Guidelines
|
35
35
|
|
36
|
-
**Avoid using links for actions**, use a [Button](/components/
|
36
|
+
**Avoid using links for actions**, use a [Button](/components/button)
|
37
37
|
instead. This is because users expect navigation to happen when clicking on
|
38
38
|
something what looks like a link.
|
39
39
|
|
@@ -49,7 +49,7 @@ See [API](#api) for all available options.
|
|
49
49
|
**not** try to put any custom HTML or React components directly into the
|
50
50
|
List layout without wrapping it with the ListItem first.
|
51
51
|
|
52
|
-
- For forms, use rather the [FormLayout](/components/
|
52
|
+
- For forms, use rather the [FormLayout](/components/form-layout)
|
53
53
|
component which is designed specifically for that purpose.
|
54
54
|
|
55
55
|
## List Alignment
|
@@ -155,7 +155,7 @@ On top of that, the modal is able to adjust to the width of its content.
|
|
155
155
|
|
156
156
|
π Please note the auto width may not function correctly in combination with
|
157
157
|
other auto layout mechanisms, e.g. the auto-width
|
158
|
-
[FormLayout](/components/
|
158
|
+
[FormLayout](/components/form-layout#label-width). It's just too much
|
159
159
|
magic that doesn't work together yet π©.
|
160
160
|
|
161
161
|
<Playground>
|
@@ -248,7 +248,7 @@ When modals become too long for the user's viewport or device, they scroll
|
|
248
248
|
independent of the page itself.
|
249
249
|
|
250
250
|
The inner implementation of body scrolling uses a partially
|
251
|
-
[customizable](#api) instance of the [ScrollView](/components/
|
251
|
+
[customizable](#api) instance of the [ScrollView](/components/scroll-view)
|
252
252
|
component.
|
253
253
|
|
254
254
|
<Playground>
|
@@ -39,7 +39,7 @@ See [API](#api) for all available options.
|
|
39
39
|
the default appearance to make it stand out on white background.
|
40
40
|
|
41
41
|
- **Paper, or Card?** Paper is a basic surface to put content on. However,
|
42
|
-
there is also the [Card](/components/
|
42
|
+
there is also the [Card](/components/card) component. While Paper is
|
43
43
|
usually used to hold larger content areas like lists, grids, or forms, Card is
|
44
44
|
designed for displaying items. Card also supports more visual options.
|
45
45
|
|
@@ -56,13 +56,13 @@ See [API](#api) for all available options.
|
|
56
56
|
## General Guidelines
|
57
57
|
|
58
58
|
- Use Radio for **just a few options**. For larger sets of many options (say 4
|
59
|
-
and more) consider using the [SelectField](/components/
|
59
|
+
and more) consider using the [SelectField](/components/select-field)
|
60
60
|
component. This will help keep your UI clean and uncluttered and prevent your
|
61
61
|
users from being overwhelmed by too many options.
|
62
62
|
|
63
63
|
- **Don't use for boolean** (true/false) selection or to toggle things on and
|
64
|
-
off. [CheckboxField](/components/
|
65
|
-
[Toggle](/components/
|
64
|
+
off. [CheckboxField](/components/checkbox-field) and
|
65
|
+
[Toggle](/components/toggle) are more suitable for such cases.
|
66
66
|
|
67
67
|
- Use **short and descriptive labels**, ideally nouns rather than seemingly
|
68
68
|
polite phrases like _Please select your favourite fruit_. Short labels will
|
@@ -358,7 +358,7 @@ Aside from setting a custom shadow color and size, you can entirely customize
|
|
358
358
|
the scrolling shadows with `background` or `box-shadow` CSS properties.
|
359
359
|
|
360
360
|
The following example demonstrates exactly the same custom scrolling shadows as
|
361
|
-
we use in the [Modal](/components/
|
361
|
+
we use in the [Modal](/components/modal#scrolling-long-content) component.
|
362
362
|
|
363
363
|
<Playground>
|
364
364
|
<Placeholder height="200px">
|
@@ -56,13 +56,13 @@ See [API](#api) for all available options.
|
|
56
56
|
## General Guidelines
|
57
57
|
|
58
58
|
- Use SelectField for **many options**. For sets of just a few options
|
59
|
-
(say 3 at maximum) consider using the [Radio](/components/
|
59
|
+
(say 3 at maximum) consider using the [Radio](/components/radio) component.
|
60
60
|
This will help keep your UI clean and uncluttered and prevent your users from
|
61
61
|
being overwhelmed by too many options.
|
62
62
|
|
63
63
|
- **Don't use for boolean** (true/false) selection or to toggle things on and
|
64
|
-
off. [CheckboxField](/components/
|
65
|
-
[Toggle](/components/
|
64
|
+
off. [CheckboxField](/components/checkbox-field) and
|
65
|
+
[Toggle](/components/toggle) are more suitable for such cases.
|
66
66
|
|
67
67
|
- Use **short and descriptive labels**, ideally nouns rather than seemingly
|
68
68
|
polite phrases like _Please select your favourite fruit_. Short labels will
|
@@ -77,16 +77,16 @@ See [API](#api) for all available options.
|
|
77
77
|
|
78
78
|
- Tables are **good for displaying complex tabular data.** For simpler data sets
|
79
79
|
or even plain key-value pairs, consider using the
|
80
|
-
[List](/components/
|
80
|
+
[List](/components/list) component.
|
81
81
|
|
82
82
|
- Tables make **lots of information easier to scan and compare.** If you have
|
83
83
|
fewer sections and want to emphasize each group more, consider using
|
84
|
-
[Cards](/components/
|
84
|
+
[Cards](/components/card).
|
85
85
|
|
86
86
|
## Responsive Tables
|
87
87
|
|
88
88
|
The easiest way to make tables responsive is to wrap them with the
|
89
|
-
[ScrollView](/components/
|
89
|
+
[ScrollView](/components/scroll-view) component in the horizontal mode.
|
90
90
|
|
91
91
|
<Playground>
|
92
92
|
<ScrollView direction="horizontal" shadowSize="100px">
|
@@ -119,7 +119,7 @@ for each tab and don't leave some tabs without an icon.
|
|
119
119
|
|
120
120
|
If you have more than a few tabs, you may need to make sure they will be all
|
121
121
|
accessible no matter the space they have around. Wrap Tabs into
|
122
|
-
[ScrollView](/components/
|
122
|
+
[ScrollView](/components/scroll-view) to make them scrollable if necessary.
|
123
123
|
|
124
124
|
<Playground>
|
125
125
|
{() => {
|
@@ -40,6 +40,7 @@ export const TextField = ({
|
|
40
40
|
styles.root,
|
41
41
|
fullWidth ? styles.isRootFullWidth : '',
|
42
42
|
hasSmallInput ? styles.hasRootSmallInput : '',
|
43
|
+
inputSize ? styles.hasRootCustomInputSize : '',
|
43
44
|
context ? styles.isRootInFormLayout : '',
|
44
45
|
resolveContextOrProp(context && context.layout, layout) === 'horizontal'
|
45
46
|
? styles.rootLayoutHorizontal
|
@@ -44,7 +44,7 @@ See [API](#api) for all available options.
|
|
44
44
|
- Use the toggle only for boolean (true/false) input **with an immediate effect
|
45
45
|
(without confirmation)**. To toggle things on or off in forms that require to
|
46
46
|
be submitted by a button, use rather the
|
47
|
-
[CheckboxField](/components/
|
47
|
+
[CheckboxField](/components/checkbox-field) component.
|
48
48
|
|
49
49
|
- **Use positive wording for the toggle label,** so that it's clear what will
|
50
50
|
happen when the user turns on the toggle. Avoid negations such as βDon't send
|
@@ -63,7 +63,7 @@ See [API](#api) for all available options.
|
|
63
63
|
- The toggle is designed for **switching things on and off.** Don't use it to
|
64
64
|
switch between two different things that cannot be described as on or off
|
65
65
|
using a single label, e.g. different viewing modes. In such cases, consider
|
66
|
-
using the [ButtonGroup](/components/
|
66
|
+
using the [ButtonGroup](/components/button-group) component.
|
67
67
|
|
68
68
|
## Help Text
|
69
69
|
|
@@ -329,7 +329,7 @@ A wrapper for individual toolbar items.
|
|
329
329
|
|
330
330
|
[inline-elements]: https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements
|
331
331
|
[block-elements]: https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements
|
332
|
-
[grid]: /components/
|
333
|
-
[list]: /components/
|
332
|
+
[grid]: /components/grid
|
333
|
+
[list]: /components/list
|
334
334
|
[spacing]: /css-helpers/spacing
|
335
|
-
[text]: /components/
|
335
|
+
[text]: /components/text
|