@react-ui-org/react-ui 0.52.1 → 0.53.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/CODEOWNERS +23 -0
- package/README.md +10 -7
- package/dist/react-ui.css +5 -3
- package/dist/react-ui.js +1 -1
- package/package.json +64 -77
- package/src/{lib/components → components}/Alert/Alert.jsx +1 -1
- package/src/{lib/components/Alert/README.mdx → components/Alert/README.md} +84 -100
- package/src/{lib/components → components}/Badge/Badge.jsx +1 -1
- package/src/{lib/components → components}/Badge/Badge.scss +1 -1
- package/src/components/Badge/README.md +103 -0
- package/src/{lib/components → components}/Button/Button.jsx +1 -1
- package/src/components/Button/README.md +580 -0
- package/src/{lib/components → components}/ButtonGroup/ButtonGroup.jsx +11 -9
- package/src/{lib/components/ButtonGroup/README.mdx → components/ButtonGroup/README.md} +128 -134
- package/src/{lib/components → components}/Card/Card.jsx +1 -1
- package/src/components/Card/README.md +314 -0
- package/src/{lib/components/CheckboxField/README.mdx → components/CheckboxField/README.md} +96 -108
- package/src/{lib/components/FileInputField/README.mdx → components/FileInputField/README.md} +83 -95
- package/src/{lib/components → components}/FormLayout/FormLayout.jsx +4 -4
- package/src/components/FormLayout/README.md +462 -0
- package/src/{lib/components → components}/Grid/Grid.jsx +2 -2
- package/src/components/Grid/README.md +281 -0
- package/src/{lib/components → components}/InputGroup/InputGroup.jsx +20 -19
- package/src/{lib/components → components}/InputGroup/InputGroup.scss +0 -5
- package/src/{lib/components/InputGroup/README.mdx → components/InputGroup/README.md} +145 -163
- package/src/{lib/components → components}/Modal/Modal.jsx +6 -6
- package/src/components/Modal/README.md +1090 -0
- package/src/components/Modal/_hooks/useModalScrollPrevention.js +37 -0
- package/src/{lib/components/Paper/README.mdx → components/Paper/README.md} +18 -30
- package/src/{lib/components/Popover/README.mdx → components/Popover/README.md} +102 -132
- package/src/{lib/components/Radio/README.mdx → components/Radio/README.md} +122 -134
- package/src/{lib/components → components}/Radio/Radio.jsx +11 -12
- package/src/{lib/components → components}/Radio/Radio.scss +0 -5
- package/src/components/ScrollView/README.md +503 -0
- package/src/{lib/components → components}/ScrollView/ScrollView.jsx +12 -3
- package/src/components/SelectField/README.md +681 -0
- package/src/components/Table/README.md +259 -0
- package/src/{lib/components → components}/Table/Table.jsx +4 -1
- package/src/{lib/components → components}/Table/_components/TableHeaderCell/TableHeaderCell.jsx +1 -1
- package/src/{lib/components/Tabs/README.mdx → components/Tabs/README.md} +117 -134
- package/src/{lib/components → components}/Tabs/TabsItem.jsx +3 -3
- package/src/components/Text/README.md +220 -0
- package/src/components/TextArea/README.md +359 -0
- package/src/{lib/components/TextField/README.mdx → components/TextField/README.md} +336 -342
- package/src/{lib/components/TextLink/README.mdx → components/TextLink/README.md} +19 -31
- package/src/{lib/components/Toggle/README.mdx → components/Toggle/README.md} +98 -110
- package/src/components/Toolbar/README.md +359 -0
- package/src/{lib/components → components}/Toolbar/_helpers/getAlignClassName.js +12 -4
- package/src/components/_helpers/getRootPriorityClassName.js +15 -0
- package/src/{lib/index.js → index.js} +6 -0
- package/src/{lib/provider → provider}/RUIProvider.jsx +17 -11
- package/src/{lib/styles → styles}/tools/_caret.scss +1 -1
- package/src/{lib/styles → styles}/tools/form-fields/_box-field-elements.scss +1 -1
- package/src/{lib/styles → styles}/tools/form-fields/_inline-field-elements.scss +2 -2
- package/src/{lib/theme.scss → theme.scss} +4 -3
- package/CONTRIBUTING.md +0 -137
- package/dist/lib.development.js +0 -3179
- package/dist/lib.js +0 -1
- package/public/racom.svg +0 -11
- package/src/lib/components/Badge/README.mdx +0 -126
- package/src/lib/components/Button/README.mdx +0 -581
- package/src/lib/components/Card/README.mdx +0 -326
- package/src/lib/components/FormLayout/README.mdx +0 -501
- package/src/lib/components/Grid/README.mdx +0 -299
- package/src/lib/components/Modal/README.mdx +0 -1360
- package/src/lib/components/Modal/_hooks/useModalScrollPrevention.js +0 -35
- package/src/lib/components/ScrollView/README.mdx +0 -521
- package/src/lib/components/SelectField/README.mdx +0 -693
- package/src/lib/components/Table/README.mdx +0 -275
- package/src/lib/components/Text/README.mdx +0 -241
- package/src/lib/components/TextArea/README.mdx +0 -366
- package/src/lib/components/Toolbar/README.mdx +0 -386
- package/src/{lib/components → components}/Alert/Alert.scss +0 -0
- package/src/{lib/components → components}/Alert/_settings.scss +0 -0
- package/src/{lib/components → components}/Alert/_theme.scss +0 -0
- package/src/{lib/components → components}/Alert/_tools.scss +0 -0
- package/src/{lib/components → components}/Alert/index.js +0 -0
- package/src/{lib/components → components}/Badge/index.js +0 -0
- package/src/{lib/components → components}/Button/Button.scss +0 -0
- package/src/{lib/components → components}/Button/_base.scss +0 -0
- package/src/{lib/components → components}/Button/_priorities.scss +0 -0
- package/src/{lib/components → components}/Button/_settings.scss +0 -0
- package/src/{lib/components → components}/Button/_theme.scss +0 -0
- package/src/{lib/components → components}/Button/_tools.scss +0 -0
- package/src/{lib/components → components}/Button/helpers/getRootLabelVisibilityClassName.js +0 -0
- package/src/{lib/components/_helpers → components/Button/helpers}/getRootPriorityClassName.js +0 -0
- package/src/{lib/components → components}/Button/index.js +0 -0
- package/src/{lib/components → components}/ButtonGroup/ButtonGroup.scss +0 -0
- package/src/{lib/components → components}/ButtonGroup/ButtonGroupContext.js +0 -0
- package/src/{lib/components → components}/ButtonGroup/_theme.scss +0 -0
- package/src/{lib/components → components}/ButtonGroup/index.js +0 -0
- package/src/{lib/components → components}/Card/Card.scss +0 -0
- package/src/{lib/components → components}/Card/CardBody.jsx +0 -0
- package/src/{lib/components → components}/Card/CardFooter.jsx +0 -0
- package/src/{lib/components → components}/Card/_theme.scss +0 -0
- package/src/{lib/components → components}/Card/_tools.scss +0 -0
- package/src/{lib/components → components}/Card/index.js +0 -0
- package/src/{lib/components → components}/CheckboxField/CheckboxField.jsx +0 -0
- package/src/{lib/components → components}/CheckboxField/CheckboxField.scss +0 -0
- package/src/{lib/components → components}/CheckboxField/index.js +0 -0
- package/src/{lib/components → components}/FileInputField/FileInputField.jsx +0 -0
- package/src/{lib/components → components}/FileInputField/FileInputField.scss +0 -0
- package/src/{lib/components → components}/FileInputField/index.js +0 -0
- package/src/{lib/components → components}/FormLayout/FormLayout.scss +0 -0
- package/src/{lib/components → components}/FormLayout/FormLayoutContext.js +0 -0
- package/src/{lib/components → components}/FormLayout/FormLayoutCustomField.jsx +4 -4
- package/src/{lib/components → components}/FormLayout/FormLayoutCustomField.scss +0 -0
- package/src/{lib/components → components}/FormLayout/_theme.scss +0 -0
- package/src/{lib/components → components}/FormLayout/index.js +0 -0
- package/src/{lib/components → components}/Grid/Grid.scss +0 -0
- package/src/{lib/components → components}/Grid/GridSpan.jsx +0 -0
- package/src/{lib/components → components}/Grid/_helpers/generateResponsiveCustomProperties.js +0 -0
- package/src/{lib/components → components}/Grid/_settings.scss +0 -0
- package/src/{lib/components → components}/Grid/_tools.scss +0 -0
- package/src/{lib/components → components}/Grid/index.js +0 -0
- package/src/{lib/components → components}/InputGroup/InputGroupContext.js +0 -0
- package/src/{lib/components → components}/InputGroup/_theme.scss +0 -0
- package/src/{lib/components → components}/InputGroup/index.js +0 -0
- package/src/{lib/components → components}/Modal/Modal.scss +0 -0
- package/src/{lib/components → components}/Modal/ModalBody.jsx +0 -0
- package/src/{lib/components → components}/Modal/ModalBody.scss +0 -0
- package/src/{lib/components → components}/Modal/ModalCloseButton.jsx +1 -1
- package/src/{lib/components → components}/Modal/ModalCloseButton.scss +0 -0
- package/src/{lib/components → components}/Modal/ModalContent.jsx +0 -0
- package/src/{lib/components → components}/Modal/ModalContent.scss +0 -0
- package/src/{lib/components → components}/Modal/ModalFooter.jsx +0 -0
- package/src/{lib/components → components}/Modal/ModalFooter.scss +0 -0
- package/src/{lib/components → components}/Modal/ModalHeader.jsx +0 -0
- package/src/{lib/components → components}/Modal/ModalHeader.scss +0 -0
- package/src/{lib/components → components}/Modal/ModalTitle.jsx +0 -0
- package/src/{lib/components → components}/Modal/ModalTitle.scss +0 -0
- package/src/{lib/components → components}/Modal/_helpers/getJustifyClassName.js +0 -0
- package/src/{lib/components → components}/Modal/_helpers/getPositionClassName.js +0 -0
- package/src/{lib/components → components}/Modal/_helpers/getScrollingClassName.js +0 -0
- package/src/{lib/components → components}/Modal/_helpers/getSizeClassName.js +0 -0
- package/src/{lib/components → components}/Modal/_hooks/useModalFocus.js +0 -0
- package/src/{lib/components → components}/Modal/_settings.scss +0 -0
- package/src/{lib/components → components}/Modal/_theme.scss +0 -0
- package/src/{lib/components → components}/Modal/index.js +0 -0
- package/src/{lib/components → components}/Paper/Paper.jsx +0 -0
- package/src/{lib/components → components}/Paper/Paper.scss +0 -0
- package/src/{lib/components → components}/Paper/_theme.scss +0 -0
- package/src/{lib/components → components}/Paper/index.js +0 -0
- package/src/{lib/components → components}/Popover/Popover.jsx +0 -0
- package/src/{lib/components → components}/Popover/Popover.scss +0 -0
- package/src/{lib/components → components}/Popover/PopoverWrapper.jsx +0 -0
- package/src/{lib/components → components}/Popover/PopoverWrapper.scss +0 -0
- package/src/{lib/components → components}/Popover/_helpers/getRootAlignmentClassName.js +0 -0
- package/src/{lib/components → components}/Popover/_helpers/getRootSideClassName.js +0 -0
- package/src/{lib/components → components}/Popover/_theme.scss +0 -0
- package/src/{lib/components → components}/Popover/index.js +0 -0
- package/src/{lib/components → components}/Radio/index.js +0 -0
- package/src/{lib/components → components}/ScrollView/ScrollView.scss +0 -0
- package/src/{lib/components → components}/ScrollView/_helpers/getElementsPositionDifference.js +0 -0
- package/src/{lib/components → components}/ScrollView/_hooks/useLoadResizeHook.js +0 -0
- package/src/{lib/components → components}/ScrollView/_hooks/useScrollPositionHook.js +0 -0
- package/src/{lib/components → components}/ScrollView/index.js +0 -0
- package/src/{lib/components → components}/SelectField/SelectField.jsx +0 -0
- package/src/{lib/components → components}/SelectField/SelectField.scss +0 -0
- package/src/{lib/components → components}/SelectField/_components/Option/Option.jsx +0 -0
- package/src/{lib/components → components}/SelectField/_components/Option/index.js +0 -0
- package/src/{lib/components → components}/SelectField/index.js +0 -0
- package/src/{lib/components → components}/Table/Table.scss +0 -0
- package/src/{lib/components → components}/Table/_components/TableBodyCell/TableBodyCell.jsx +0 -0
- package/src/{lib/components → components}/Table/_components/TableBodyCell/index.js +0 -0
- package/src/{lib/components → components}/Table/_components/TableCell.scss +0 -0
- package/src/{lib/components → components}/Table/_components/TableHeaderCell/index.js +0 -0
- package/src/{lib/components → components}/Table/_settings.scss +0 -0
- package/src/{lib/components → components}/Table/index.js +0 -0
- package/src/{lib/components → components}/Tabs/Tabs.jsx +0 -0
- package/src/{lib/components → components}/Tabs/Tabs.scss +0 -0
- package/src/{lib/components → components}/Tabs/TabsItem.scss +0 -0
- package/src/{lib/components → components}/Tabs/_theme.scss +0 -0
- package/src/{lib/components → components}/Tabs/index.js +0 -0
- package/src/{lib/components → components}/Text/Text.jsx +0 -0
- package/src/{lib/components → components}/Text/Text.scss +0 -0
- package/src/{lib/components → components}/Text/_helpers/getRootClampClassName.js +0 -0
- package/src/{lib/components → components}/Text/_helpers/getRootHyphensClassName.js +0 -0
- package/src/{lib/components → components}/Text/_helpers/getRootWordWrappingClassName.js +0 -0
- package/src/{lib/components → components}/Text/index.js +0 -0
- package/src/{lib/components → components}/TextArea/TextArea.jsx +0 -0
- package/src/{lib/components → components}/TextArea/TextArea.scss +0 -0
- package/src/{lib/components → components}/TextArea/index.js +0 -0
- package/src/{lib/components → components}/TextField/TextField.jsx +0 -0
- package/src/{lib/components → components}/TextField/TextField.scss +0 -0
- package/src/{lib/components → components}/TextField/index.js +0 -0
- package/src/{lib/components → components}/TextLink/TextLink.jsx +1 -1
- /package/src/{lib/components → components}/TextLink/TextLink.scss +0 -0
- /package/src/{lib/components → components}/TextLink/_theme.scss +0 -0
- /package/src/{lib/components → components}/TextLink/index.js +0 -0
- /package/src/{lib/components → components}/Toggle/Toggle.jsx +0 -0
- /package/src/{lib/components → components}/Toggle/Toggle.scss +0 -0
- /package/src/{lib/components → components}/Toggle/index.js +0 -0
- /package/src/{lib/components → components}/Toolbar/Toolbar.jsx +0 -0
- /package/src/{lib/components → components}/Toolbar/Toolbar.scss +0 -0
- /package/src/{lib/components → components}/Toolbar/ToolbarGroup.jsx +0 -0
- /package/src/{lib/components → components}/Toolbar/ToolbarItem.jsx +0 -0
- /package/src/{lib/components → components}/Toolbar/_helpers/getJustifyClassName.js +0 -0
- /package/src/{lib/components → components}/Toolbar/_theme.scss +0 -0
- /package/src/{lib/components → components}/Toolbar/index.js +0 -0
- /package/src/{lib/components → components}/_helpers/getRootColorClassName.js +0 -0
- /package/src/{lib/components → components}/_helpers/getRootSizeClassName.js +0 -0
- /package/src/{lib/components → components}/_helpers/getRootValidationStateClassName.js +0 -0
- /package/src/{lib/components → components}/_helpers/isChildrenEmpty.js +0 -0
- /package/src/{lib/components → components}/_helpers/resolveContextOrProp.js +0 -0
- /package/src/{lib/components → components}/_helpers/transferProps.js +0 -0
- /package/src/{lib/foundation.scss → foundation.scss} +0 -0
- /package/src/{lib/helpers.scss → helpers.scss} +0 -0
- /package/src/{lib/provider → provider}/RUIContext.jsx +0 -0
- /package/src/{lib/provider → provider}/index.js +0 -0
- /package/src/{lib/provider → provider}/withGlobalProps.jsx +0 -0
- /package/src/{lib/styles → styles}/_utilities.scss +0 -0
- /package/src/{lib/styles → styles}/elements/_code.scss +0 -0
- /package/src/{lib/styles → styles}/elements/_links.scss +0 -0
- /package/src/{lib/styles → styles}/elements/_lists.scss +0 -0
- /package/src/{lib/styles → styles}/elements/_page.scss +0 -0
- /package/src/{lib/styles → styles}/elements/_rulers.scss +0 -0
- /package/src/{lib/styles → styles}/elements/_small.scss +0 -0
- /package/src/{lib/styles → styles}/generic/_box-sizing.scss +0 -0
- /package/src/{lib/styles → styles}/generic/_focus.scss +0 -0
- /package/src/{lib/styles → styles}/generic/_forms.scss +0 -0
- /package/src/{lib/styles → styles}/generic/_reset.scss +0 -0
- /package/src/{lib/styles → styles}/generic/_shared.scss +0 -0
- /package/src/{lib/styles → styles}/helpers/_animation.scss +0 -0
- /package/src/{lib/styles → styles}/settings/_animations.scss +0 -0
- /package/src/{lib/styles → styles}/settings/_breakpoints.scss +0 -0
- /package/src/{lib/styles → styles}/settings/_escaped-characters.scss +0 -0
- /package/src/{lib/styles → styles}/settings/_form-fields.scss +0 -0
- /package/src/{lib/styles → styles}/settings/_forms.scss +0 -0
- /package/src/{lib/styles → styles}/settings/_utilities.scss +0 -0
- /package/src/{lib/styles → styles}/settings/_z-indexes.scss +0 -0
- /package/src/{lib/styles → styles}/theme/_accessibility.scss +0 -0
- /package/src/{lib/styles → styles}/theme/_borders.scss +0 -0
- /package/src/{lib/styles → styles}/theme/_code.scss +0 -0
- /package/src/{lib/styles → styles}/theme/_form-fields.scss +0 -0
- /package/src/{lib/styles → styles}/theme/_links.scss +0 -0
- /package/src/{lib/styles → styles}/theme/_lists.scss +0 -0
- /package/src/{lib/styles → styles}/theme/_page.scss +0 -0
- /package/src/{lib/styles → styles}/theme/_spacing.scss +0 -0
- /package/src/{lib/styles → styles}/theme/_typography.scss +0 -0
- /package/src/{lib/styles → styles}/theme-constants/_breakpoints.scss +0 -0
- /package/src/{lib/styles → styles}/theme-constants/_colors.scss +0 -0
- /package/src/{lib/styles → styles}/theme-constants/_svg.scss +0 -0
- /package/src/{lib/styles → styles}/tools/_accessibility.scss +0 -0
- /package/src/{lib/styles → styles}/tools/_breakpoint.scss +0 -0
- /package/src/{lib/styles → styles}/tools/_colors.scss +0 -0
- /package/src/{lib/styles → styles}/tools/_reset.scss +0 -0
- /package/src/{lib/styles → styles}/tools/_scrollbar.scss +0 -0
- /package/src/{lib/styles → styles}/tools/_spacing.scss +0 -0
- /package/src/{lib/styles → styles}/tools/_string.scss +0 -0
- /package/src/{lib/styles → styles}/tools/_svg.scss +0 -0
- /package/src/{lib/styles → styles}/tools/_transition.scss +0 -0
- /package/src/{lib/styles → styles}/tools/_utilities.scss +0 -0
- /package/src/{lib/styles → styles}/tools/form-fields/_box-field-layout.scss +0 -0
- /package/src/{lib/styles → styles}/tools/form-fields/_box-field-sizes.scss +0 -0
- /package/src/{lib/styles → styles}/tools/form-fields/_foundation.scss +0 -0
- /package/src/{lib/styles → styles}/tools/form-fields/_inline-field-layout.scss +0 -0
- /package/src/{lib/styles → styles}/tools/form-fields/_variants.scss +0 -0
- /package/src/{lib/translations → translations}/en.js +0 -0
- /package/src/{lib/utils → utils}/classNames.js +0 -0
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Toolbar
|
|
3
|
-
menu: 'Layouts'
|
|
4
|
-
route: /components/toolbar
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Toolbar
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
Playground,
|
|
11
|
-
Props,
|
|
12
|
-
} from 'docz'
|
|
13
|
-
import { Placeholder } from '../../../docs/_components/Placeholder/Placeholder'
|
|
14
|
-
import {
|
|
15
|
-
CheckboxField,
|
|
16
|
-
Button,
|
|
17
|
-
ButtonGroup,
|
|
18
|
-
Toolbar,
|
|
19
|
-
ToolbarGroup,
|
|
20
|
-
ToolbarItem,
|
|
21
|
-
} from '../..'
|
|
22
|
-
|
|
23
|
-
The responsive Toolbar layout is a versatile tool that allows spacing, grouping,
|
|
24
|
-
and aligning inline items.
|
|
25
|
-
|
|
26
|
-
## Basic Usage
|
|
27
|
-
|
|
28
|
-
To implement the Toolbar component, you need to import it first:
|
|
29
|
-
|
|
30
|
-
```js
|
|
31
|
-
import { Toolbar, ToolbarItem } from '@react-ui-org/react-ui';
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
And use it:
|
|
35
|
-
|
|
36
|
-
<Playground>
|
|
37
|
-
<Toolbar>
|
|
38
|
-
<ToolbarItem>
|
|
39
|
-
<Placeholder bordered>Toolbar item</Placeholder>
|
|
40
|
-
</ToolbarItem>
|
|
41
|
-
<ToolbarItem>
|
|
42
|
-
<Placeholder bordered>Toolbar item</Placeholder>
|
|
43
|
-
</ToolbarItem>
|
|
44
|
-
<ToolbarItem>
|
|
45
|
-
<Placeholder bordered>Toolbar item</Placeholder>
|
|
46
|
-
</ToolbarItem>
|
|
47
|
-
</Toolbar>
|
|
48
|
-
</Playground>
|
|
49
|
-
|
|
50
|
-
See [API](#api) for all available options.
|
|
51
|
-
|
|
52
|
-
## General Guidelines
|
|
53
|
-
|
|
54
|
-
- **Toolbar is great for flexible inline layouts.** For stacking your content
|
|
55
|
-
vertically or building two-dimensional layouts head to the [Grid][grid]
|
|
56
|
-
layout.
|
|
57
|
-
|
|
58
|
-
- **Wrap your items** into the ToolbarItem component. This ensures your content
|
|
59
|
-
is properly spaced and aligned with other Toolbar elements. Do **not** try to
|
|
60
|
-
put any custom HTML or React components directly into the Toolbar layout
|
|
61
|
-
without wrapping it with the ToolbarItem first.
|
|
62
|
-
|
|
63
|
-
- **Be careful with using Toolbar with long or dynamic items in narrow
|
|
64
|
-
containers.** Toolbar intentionally prevents its items from shrinking using
|
|
65
|
-
`flex: none` which may cause overflow in case of lack of horizontal space.
|
|
66
|
-
Depending on your situation, consider turning on the `nowrap` option
|
|
67
|
-
(which allows shrinking of items but disables Toolbar from wrapping), using
|
|
68
|
-
the [Text][text] component to precisely control text wrapping, or switching to
|
|
69
|
-
the [Grid][grid] layout.
|
|
70
|
-
|
|
71
|
-
## Alignment
|
|
72
|
-
|
|
73
|
-
You can tweak your Toolbar layout using rich alignment options, both in
|
|
74
|
-
horizontal and vertical direction.
|
|
75
|
-
|
|
76
|
-
👉 At the current stage of development, React UI is **RTL aware** so switching
|
|
77
|
-
to a fully RTL-compatible behavior in the future should be painless. That's why
|
|
78
|
-
the justification values are called rather `start` than `left` and `end` instead
|
|
79
|
-
of `right`.
|
|
80
|
-
|
|
81
|
-
<Playground>
|
|
82
|
-
{() => {
|
|
83
|
-
const [alignment, setAlignment] = React.useState('top');
|
|
84
|
-
const [justification, setJustification] = React.useState('start');
|
|
85
|
-
return (
|
|
86
|
-
<div>
|
|
87
|
-
<Toolbar>
|
|
88
|
-
<ToolbarGroup align="baseline">
|
|
89
|
-
<ToolbarItem>
|
|
90
|
-
<span id="alignment-label">Alignment:</span>
|
|
91
|
-
</ToolbarItem>
|
|
92
|
-
<ToolbarItem>
|
|
93
|
-
<ButtonGroup aria-labelledby="alignment-label" priority="outline">
|
|
94
|
-
<Button
|
|
95
|
-
aria-pressed={alignment === 'top'}
|
|
96
|
-
color={alignment === 'top' ? 'selected' : 'secondary'}
|
|
97
|
-
label="top"
|
|
98
|
-
onClick={() => setAlignment('top')}
|
|
99
|
-
/>
|
|
100
|
-
<Button
|
|
101
|
-
aria-pressed={alignment === 'middle'}
|
|
102
|
-
color={alignment === 'middle' ? 'selected' : 'secondary'}
|
|
103
|
-
label="middle"
|
|
104
|
-
onClick={() => setAlignment('middle')}
|
|
105
|
-
/>
|
|
106
|
-
<Button
|
|
107
|
-
aria-pressed={alignment === 'bottom'}
|
|
108
|
-
color={alignment === 'bottom' ? 'selected' : 'secondary'}
|
|
109
|
-
label="bottom"
|
|
110
|
-
onClick={() => setAlignment('bottom')}
|
|
111
|
-
/>
|
|
112
|
-
<Button
|
|
113
|
-
aria-pressed={alignment === 'baseline'}
|
|
114
|
-
color={alignment === 'baseline' ? 'selected' : 'secondary'}
|
|
115
|
-
label="baseline"
|
|
116
|
-
onClick={() => setAlignment('baseline')}
|
|
117
|
-
/>
|
|
118
|
-
</ButtonGroup>
|
|
119
|
-
</ToolbarItem>
|
|
120
|
-
</ToolbarGroup>
|
|
121
|
-
<ToolbarGroup align="baseline">
|
|
122
|
-
<ToolbarItem>
|
|
123
|
-
<span id="justification-label">Justification:</span>
|
|
124
|
-
</ToolbarItem>
|
|
125
|
-
<ToolbarItem>
|
|
126
|
-
<ButtonGroup aria-labelledby="justification-label" priority="outline">
|
|
127
|
-
<Button
|
|
128
|
-
aria-pressed={justification === 'start'}
|
|
129
|
-
color={justification === 'start' ? 'selected' : 'secondary'}
|
|
130
|
-
label="start"
|
|
131
|
-
onClick={() => setJustification('start')}
|
|
132
|
-
/>
|
|
133
|
-
<Button
|
|
134
|
-
aria-pressed={justification === 'center'}
|
|
135
|
-
color={justification === 'center' ? 'selected' : 'secondary'}
|
|
136
|
-
label="center"
|
|
137
|
-
onClick={() => setJustification('center')}
|
|
138
|
-
/>
|
|
139
|
-
<Button
|
|
140
|
-
aria-pressed={justification === 'end'}
|
|
141
|
-
color={justification === 'end' ? 'selected' : 'secondary'}
|
|
142
|
-
label="end"
|
|
143
|
-
onClick={() => setJustification('end')}
|
|
144
|
-
/>
|
|
145
|
-
<Button
|
|
146
|
-
aria-pressed={justification === 'space-between'}
|
|
147
|
-
color={justification === 'space-between' ? 'selected' : 'secondary'}
|
|
148
|
-
label="space-between"
|
|
149
|
-
onClick={() => setJustification('space-between')}
|
|
150
|
-
/>
|
|
151
|
-
</ButtonGroup>
|
|
152
|
-
</ToolbarItem>
|
|
153
|
-
</ToolbarGroup>
|
|
154
|
-
</Toolbar>
|
|
155
|
-
<Toolbar align={alignment} justify={justification}>
|
|
156
|
-
<ToolbarItem>
|
|
157
|
-
<Placeholder bordered>First item</Placeholder>
|
|
158
|
-
</ToolbarItem>
|
|
159
|
-
<ToolbarItem>
|
|
160
|
-
<Placeholder bordered>
|
|
161
|
-
Second item<br />
|
|
162
|
-
is taller
|
|
163
|
-
</Placeholder>
|
|
164
|
-
</ToolbarItem>
|
|
165
|
-
<ToolbarItem>
|
|
166
|
-
<Placeholder bordered>Third item</Placeholder>
|
|
167
|
-
</ToolbarItem>
|
|
168
|
-
</Toolbar>
|
|
169
|
-
</div>
|
|
170
|
-
);
|
|
171
|
-
}}
|
|
172
|
-
</Playground>
|
|
173
|
-
|
|
174
|
-
## Groups
|
|
175
|
-
|
|
176
|
-
Toolbar items can be grouped which enables you aligning related items together.
|
|
177
|
-
To provide the best possible flexibility for building your layout, the
|
|
178
|
-
ToolbarGroup allows you to set many options similar to the Toolbar: vertical
|
|
179
|
-
alignment, [dense spacing](#dense-layout), or [disable wrapping](#wrapping).
|
|
180
|
-
|
|
181
|
-
<Playground>
|
|
182
|
-
<Toolbar justify="space-between">
|
|
183
|
-
<ToolbarGroup>
|
|
184
|
-
<ToolbarItem>
|
|
185
|
-
<Placeholder bordered>Group A</Placeholder>
|
|
186
|
-
</ToolbarItem>
|
|
187
|
-
<ToolbarItem>
|
|
188
|
-
<Placeholder bordered>Group A</Placeholder>
|
|
189
|
-
</ToolbarItem>
|
|
190
|
-
</ToolbarGroup>
|
|
191
|
-
<ToolbarGroup align="middle">
|
|
192
|
-
<ToolbarItem>
|
|
193
|
-
<Placeholder bordered>Group B</Placeholder>
|
|
194
|
-
</ToolbarItem>
|
|
195
|
-
<ToolbarItem>
|
|
196
|
-
<Placeholder bordered>Group B</Placeholder>
|
|
197
|
-
</ToolbarItem>
|
|
198
|
-
</ToolbarGroup>
|
|
199
|
-
<ToolbarItem>
|
|
200
|
-
<Placeholder bordered>Item</Placeholder>
|
|
201
|
-
</ToolbarItem>
|
|
202
|
-
</Toolbar>
|
|
203
|
-
</Playground>
|
|
204
|
-
|
|
205
|
-
## Dense Layout
|
|
206
|
-
|
|
207
|
-
Sometimes it's useful to get related items even closer together. This can be
|
|
208
|
-
easily achieved through the `dense` option which can be applied on individual
|
|
209
|
-
toolbar groups, or on the entire toolbar.
|
|
210
|
-
|
|
211
|
-
<Playground>
|
|
212
|
-
{() => {
|
|
213
|
-
const [isGroupDense, setIsGroupDense] = React.useState(false);
|
|
214
|
-
const [isToolbarDense, setIsToolbarDense] = React.useState(false);
|
|
215
|
-
return (
|
|
216
|
-
<div>
|
|
217
|
-
<Toolbar>
|
|
218
|
-
<ToolbarItem>
|
|
219
|
-
<CheckboxField
|
|
220
|
-
checked={isGroupDense}
|
|
221
|
-
label="Dense ToolbarGroup"
|
|
222
|
-
onChange={(e) => setIsGroupDense(e.target.checked)}
|
|
223
|
-
/>
|
|
224
|
-
</ToolbarItem>
|
|
225
|
-
<ToolbarItem>
|
|
226
|
-
<CheckboxField
|
|
227
|
-
checked={isToolbarDense}
|
|
228
|
-
label="Dense Toolbar"
|
|
229
|
-
onChange={(e) => setIsToolbarDense(e.target.checked)}
|
|
230
|
-
/>
|
|
231
|
-
</ToolbarItem>
|
|
232
|
-
</Toolbar>
|
|
233
|
-
<Toolbar dense={isToolbarDense}>
|
|
234
|
-
<ToolbarGroup dense={isGroupDense}>
|
|
235
|
-
<ToolbarItem>
|
|
236
|
-
<Placeholder bordered>Group item</Placeholder>
|
|
237
|
-
</ToolbarItem>
|
|
238
|
-
<ToolbarItem>
|
|
239
|
-
<Placeholder bordered>Group item</Placeholder>
|
|
240
|
-
</ToolbarItem>
|
|
241
|
-
</ToolbarGroup>
|
|
242
|
-
<ToolbarItem>
|
|
243
|
-
<Placeholder bordered>Standalone item</Placeholder>
|
|
244
|
-
</ToolbarItem>
|
|
245
|
-
<ToolbarItem>
|
|
246
|
-
<Placeholder bordered>Standalone item</Placeholder>
|
|
247
|
-
</ToolbarItem>
|
|
248
|
-
</Toolbar>
|
|
249
|
-
</div>
|
|
250
|
-
);
|
|
251
|
-
}}
|
|
252
|
-
</Playground>
|
|
253
|
-
|
|
254
|
-
## Wrapping
|
|
255
|
-
|
|
256
|
-
By default, all toolbar items are queued up one after another in a row. The
|
|
257
|
-
items automatically wrap and create a new row. To prevent this behavior, just
|
|
258
|
-
set the `nowrap` option on the Toolbar or on individual ToolbarGroups. Note that
|
|
259
|
-
ToolbarGroups can still wrap when the wrapping is disabled just on their parent
|
|
260
|
-
Toolbar.
|
|
261
|
-
|
|
262
|
-
📐 Try resizing the playground below to see how it works.
|
|
263
|
-
|
|
264
|
-
<Playground>
|
|
265
|
-
<>
|
|
266
|
-
<p>Disabled wrapping on entire toolbar:</p>
|
|
267
|
-
<Toolbar justify="space-between" nowrap>
|
|
268
|
-
<ToolbarGroup>
|
|
269
|
-
<ToolbarItem>
|
|
270
|
-
<Placeholder bordered>Group A</Placeholder>
|
|
271
|
-
</ToolbarItem>
|
|
272
|
-
<ToolbarItem>
|
|
273
|
-
<Placeholder bordered>Group A</Placeholder>
|
|
274
|
-
</ToolbarItem>
|
|
275
|
-
</ToolbarGroup>
|
|
276
|
-
<ToolbarGroup>
|
|
277
|
-
<ToolbarItem>
|
|
278
|
-
<Placeholder bordered>Group B</Placeholder>
|
|
279
|
-
</ToolbarItem>
|
|
280
|
-
<ToolbarItem>
|
|
281
|
-
<Placeholder bordered>Group B</Placeholder>
|
|
282
|
-
</ToolbarItem>
|
|
283
|
-
</ToolbarGroup>
|
|
284
|
-
<ToolbarItem>
|
|
285
|
-
<Placeholder bordered>Item</Placeholder>
|
|
286
|
-
</ToolbarItem>
|
|
287
|
-
</Toolbar>
|
|
288
|
-
<p>Disabled wrapping on toolbar groups:</p>
|
|
289
|
-
<Toolbar justify="space-between">
|
|
290
|
-
<ToolbarGroup nowrap>
|
|
291
|
-
<ToolbarItem>
|
|
292
|
-
<Placeholder bordered>Group A</Placeholder>
|
|
293
|
-
</ToolbarItem>
|
|
294
|
-
<ToolbarItem>
|
|
295
|
-
<Placeholder bordered>Group A</Placeholder>
|
|
296
|
-
</ToolbarItem>
|
|
297
|
-
</ToolbarGroup>
|
|
298
|
-
<ToolbarGroup nowrap>
|
|
299
|
-
<ToolbarItem>
|
|
300
|
-
<Placeholder bordered>Group B</Placeholder>
|
|
301
|
-
</ToolbarItem>
|
|
302
|
-
<ToolbarItem>
|
|
303
|
-
<Placeholder bordered>Group B</Placeholder>
|
|
304
|
-
</ToolbarItem>
|
|
305
|
-
</ToolbarGroup>
|
|
306
|
-
<ToolbarItem>
|
|
307
|
-
<Placeholder bordered>Item</Placeholder>
|
|
308
|
-
</ToolbarItem>
|
|
309
|
-
</Toolbar>
|
|
310
|
-
</>
|
|
311
|
-
</Playground>
|
|
312
|
-
|
|
313
|
-
👉 Depending on your situation, you may need to further control wrapping of text
|
|
314
|
-
content placed within Toolbar. The [Text][text] component is designed
|
|
315
|
-
specifically for this kind of job.
|
|
316
|
-
|
|
317
|
-
## Flexible Items
|
|
318
|
-
|
|
319
|
-
Toolbar items can be made flexible to grow and shrink according to the available
|
|
320
|
-
space. This is useful e.g. when you need to combine text with an action:
|
|
321
|
-
|
|
322
|
-
<Playground>
|
|
323
|
-
<Toolbar>
|
|
324
|
-
<ToolbarItem flexible>
|
|
325
|
-
<Placeholder bordered>My Headline</Placeholder>
|
|
326
|
-
</ToolbarItem>
|
|
327
|
-
<ToolbarItem>
|
|
328
|
-
<Placeholder bordered>Action</Placeholder>
|
|
329
|
-
</ToolbarItem>
|
|
330
|
-
</Toolbar>
|
|
331
|
-
</Playground>
|
|
332
|
-
|
|
333
|
-
Or to build a classic media layout with image on the left and text on the right:
|
|
334
|
-
|
|
335
|
-
<Playground>
|
|
336
|
-
<Toolbar>
|
|
337
|
-
<ToolbarItem>
|
|
338
|
-
<Placeholder bordered>Media object</Placeholder>
|
|
339
|
-
</ToolbarItem>
|
|
340
|
-
<ToolbarItem flexible>
|
|
341
|
-
<Placeholder bordered>Media body</Placeholder>
|
|
342
|
-
</ToolbarItem>
|
|
343
|
-
</Toolbar>
|
|
344
|
-
</Playground>
|
|
345
|
-
|
|
346
|
-
## Forwarding HTML Attributes
|
|
347
|
-
|
|
348
|
-
In addition to the options below in the [component's API](#api) section, you
|
|
349
|
-
can specify [React synthetic events] or **any HTML attribute you like.** All
|
|
350
|
-
attributes that don't interfere with the API are forwarded to the root `<div>`
|
|
351
|
-
HTML element. This enables making the component interactive and helps to improve
|
|
352
|
-
its accessibility.
|
|
353
|
-
|
|
354
|
-
👉 Refer to the MDN reference for the full list of supported attributes of the
|
|
355
|
-
[div] element.
|
|
356
|
-
|
|
357
|
-
## API
|
|
358
|
-
|
|
359
|
-
<Props table of={Toolbar} />
|
|
360
|
-
|
|
361
|
-
### ToolbarGroup API
|
|
362
|
-
|
|
363
|
-
A wrapper for grouping ToolbarItems together.
|
|
364
|
-
|
|
365
|
-
<Props table of={ToolbarGroup} />
|
|
366
|
-
|
|
367
|
-
### ToolbarItem API
|
|
368
|
-
|
|
369
|
-
A wrapper for individual toolbar items.
|
|
370
|
-
|
|
371
|
-
<Props table of={ToolbarItem} />
|
|
372
|
-
|
|
373
|
-
## Theming
|
|
374
|
-
|
|
375
|
-
| Custom Property | Description |
|
|
376
|
-
|------------------------------------------------------|--------------------------------------------------------------|
|
|
377
|
-
| `--rui-Toolbar__gap` | Gap between toolbar items |
|
|
378
|
-
| `--rui-Toolbar__gap--dense` | Dense gap between toolbar items |
|
|
379
|
-
|
|
380
|
-
[inline-elements]: https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements
|
|
381
|
-
[block-elements]: https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements
|
|
382
|
-
[grid]: /components/grid
|
|
383
|
-
[spacing]: /css-helpers/spacing
|
|
384
|
-
[text]: /components/text
|
|
385
|
-
[React synthetic events]: https://reactjs.org/docs/events.html
|
|
386
|
-
[div]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/{lib/components/_helpers → components/Button/helpers}/getRootPriorityClassName.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -13,9 +13,9 @@ const renderLabel = (id, label, labelForId) => {
|
|
|
13
13
|
if (labelForId && label) {
|
|
14
14
|
return (
|
|
15
15
|
<label
|
|
16
|
+
className={styles.label}
|
|
16
17
|
htmlFor={labelForId}
|
|
17
18
|
id={id && `${id}__label`}
|
|
18
|
-
className={styles.label}
|
|
19
19
|
>
|
|
20
20
|
{label}
|
|
21
21
|
</label>
|
|
@@ -25,8 +25,8 @@ const renderLabel = (id, label, labelForId) => {
|
|
|
25
25
|
if (label) {
|
|
26
26
|
return (
|
|
27
27
|
<div
|
|
28
|
-
id={id && `${id}__label`}
|
|
29
28
|
className={styles.label}
|
|
29
|
+
id={id && `${id}__label`}
|
|
30
30
|
>
|
|
31
31
|
{label}
|
|
32
32
|
</div>
|
|
@@ -57,7 +57,6 @@ export const FormLayoutCustomField = ({
|
|
|
57
57
|
return (
|
|
58
58
|
<div
|
|
59
59
|
{...transferProps(restProps)}
|
|
60
|
-
id={id}
|
|
61
60
|
className={classNames(
|
|
62
61
|
styles.root,
|
|
63
62
|
fullWidth && styles.isRootFullWidth,
|
|
@@ -67,11 +66,12 @@ export const FormLayoutCustomField = ({
|
|
|
67
66
|
getRootSizeClassName(innerFieldSize, styles),
|
|
68
67
|
getRootValidationStateClassName(validationState, styles),
|
|
69
68
|
)}
|
|
69
|
+
id={id}
|
|
70
70
|
>
|
|
71
71
|
{renderLabel(id, label, labelForId)}
|
|
72
72
|
<div
|
|
73
|
-
id={id && `${id}__field`}
|
|
74
73
|
className={styles.field}
|
|
74
|
+
id={id && `${id}__field`}
|
|
75
75
|
>
|
|
76
76
|
{children}
|
|
77
77
|
</div>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/{lib/components → components}/Grid/_helpers/generateResponsiveCustomProperties.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -18,11 +18,11 @@ export const ModalCloseButton = React.forwardRef((props, ref) => {
|
|
|
18
18
|
return (
|
|
19
19
|
<button
|
|
20
20
|
{...transferProps(restProps)}
|
|
21
|
-
type="button"
|
|
22
21
|
className={styles.root}
|
|
23
22
|
disabled={disabled}
|
|
24
23
|
ref={ref}
|
|
25
24
|
title={translations.ModalCloseButton.close}
|
|
25
|
+
type="button"
|
|
26
26
|
>
|
|
27
27
|
×
|
|
28
28
|
</button>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/{lib/components → components}/ScrollView/_helpers/getElementsPositionDifference.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|