@react-ui-org/react-ui 0.44.1 → 0.45.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. package/dist/lib.development.js +138 -258
  2. package/dist/lib.js +1 -1
  3. package/package.json +7 -10
  4. package/src/lib/components/Alert/Alert.jsx +4 -3
  5. package/src/lib/components/Alert/Alert.scss +48 -48
  6. package/src/lib/components/Alert/_settings.scss +4 -4
  7. package/src/lib/components/Alert/_theme.scss +50 -50
  8. package/src/lib/components/Alert/_tools.scss +6 -6
  9. package/src/lib/components/Badge/Badge.jsx +5 -4
  10. package/src/lib/components/Badge/Badge.scss +57 -57
  11. package/src/lib/components/Button/Button.jsx +10 -9
  12. package/src/lib/components/Button/Button.scss +2 -2
  13. package/src/lib/components/Button/README.mdx +6 -1
  14. package/src/lib/components/Button/_base.scss +65 -65
  15. package/src/lib/components/Button/_priorities.scss +49 -49
  16. package/src/lib/components/Button/_settings.scss +10 -10
  17. package/src/lib/components/Button/_theme.scss +18 -15
  18. package/src/lib/components/Button/_tools.scss +98 -100
  19. package/src/lib/components/ButtonGroup/ButtonGroup.jsx +4 -3
  20. package/src/lib/components/ButtonGroup/ButtonGroup.scss +3 -3
  21. package/src/lib/components/Card/Card.jsx +7 -6
  22. package/src/lib/components/Card/Card.scss +28 -28
  23. package/src/lib/components/Card/_theme.scss +50 -50
  24. package/src/lib/components/Card/_tools.scss +6 -6
  25. package/src/lib/components/CheckboxField/CheckboxField.jsx +12 -11
  26. package/src/lib/components/CheckboxField/CheckboxField.scss +20 -20
  27. package/src/lib/components/FileInputField/FileInputField.jsx +13 -12
  28. package/src/lib/components/FileInputField/FileInputField.scss +19 -19
  29. package/src/lib/components/FormLayout/FormLayout.jsx +5 -4
  30. package/src/lib/components/FormLayout/FormLayout.scss +17 -17
  31. package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +9 -8
  32. package/src/lib/components/FormLayout/FormLayoutCustomField.scss +18 -18
  33. package/src/lib/components/FormLayout/README.mdx +16 -36
  34. package/src/lib/components/Grid/Grid.jsx +1 -1
  35. package/src/lib/components/Grid/Grid.scss +28 -30
  36. package/src/lib/components/Grid/GridSpan.jsx +1 -1
  37. package/src/lib/components/Grid/{helpers → _helpers}/generateResponsiveCustomProperties.js +0 -2
  38. package/src/lib/components/Grid/_theme.scss +9 -9
  39. package/src/lib/components/Grid/_tools.scss +20 -20
  40. package/src/lib/components/Link/Link.jsx +1 -1
  41. package/src/lib/components/Link/Link.scss +7 -7
  42. package/src/lib/components/List/List.jsx +11 -10
  43. package/src/lib/components/List/List.scss +21 -21
  44. package/src/lib/components/Media/Media.scss +6 -6
  45. package/src/lib/components/Modal/Modal.jsx +6 -5
  46. package/src/lib/components/Modal/Modal.scss +73 -73
  47. package/src/lib/components/Modal/_settings.scss +5 -5
  48. package/src/lib/components/Modal/_theme.scss +17 -17
  49. package/src/lib/components/Paper/Paper.jsx +5 -4
  50. package/src/lib/components/Paper/Paper.scss +8 -8
  51. package/src/lib/components/Radio/Radio.jsx +12 -11
  52. package/src/lib/components/Radio/Radio.scss +26 -26
  53. package/src/lib/components/ScrollView/ScrollView.jsx +9 -8
  54. package/src/lib/components/ScrollView/ScrollView.scss +113 -113
  55. package/src/lib/{services/elementPositionService.js → components/ScrollView/_helpers/getElementsPositionDifference.js} +0 -2
  56. package/src/lib/{hooks → components/ScrollView/_hooks}/useLoadResizeHook.js +1 -1
  57. package/src/lib/{hooks → components/ScrollView/_hooks}/useScrollPositionHook.js +1 -1
  58. package/src/lib/components/SelectField/SelectField.jsx +14 -13
  59. package/src/lib/components/SelectField/SelectField.scss +30 -30
  60. package/src/lib/components/Table/Table.scss +28 -35
  61. package/src/lib/components/Table/_settings.scss +5 -5
  62. package/src/lib/components/Tabs/Tabs.scss +21 -21
  63. package/src/lib/components/Tabs/TabsItem.jsx +4 -3
  64. package/src/lib/components/Tabs/TabsItem.scss +78 -78
  65. package/src/lib/components/Text/Text.jsx +5 -4
  66. package/src/lib/components/Text/Text.scss +12 -12
  67. package/src/lib/components/Text/{helpers → _helpers}/getRootHyphensClassName.js +1 -1
  68. package/src/lib/components/Text/{helpers → _helpers}/getRootWordWrappingClassName.js +1 -1
  69. package/src/lib/components/TextArea/TextArea.jsx +14 -13
  70. package/src/lib/components/TextArea/TextArea.scss +27 -27
  71. package/src/lib/components/TextField/TextField.jsx +16 -15
  72. package/src/lib/components/TextField/TextField.scss +28 -28
  73. package/src/lib/components/Toggle/Toggle.jsx +12 -11
  74. package/src/lib/components/Toggle/Toggle.scss +20 -20
  75. package/src/lib/components/Toolbar/Toolbar.jsx +5 -4
  76. package/src/lib/components/Toolbar/Toolbar.scss +25 -25
  77. package/src/lib/components/Toolbar/ToolbarGroup.jsx +5 -4
  78. package/src/lib/{helpers → components/_helpers}/getRootColorClassName.js +1 -1
  79. package/src/lib/{helpers → components/_helpers}/getRootSizeClassName.js +1 -1
  80. package/src/lib/{helpers → components/_helpers}/getRootValidationStateClassName.js +1 -1
  81. package/src/lib/{helpers → components/_helpers}/resolveContextOrProp.js +0 -0
  82. package/src/lib/{utils → components/_helpers}/transferProps.js +1 -1
  83. package/src/lib/foundation.scss +11 -11
  84. package/src/lib/helpers.scss +2 -2
  85. package/src/lib/index.js +3 -7
  86. package/src/lib/styles/_utilities.scss +13 -13
  87. package/src/lib/styles/elements/_code.scss +7 -7
  88. package/src/lib/styles/elements/_links.scss +8 -8
  89. package/src/lib/styles/elements/_lists.scss +3 -3
  90. package/src/lib/styles/elements/_page.scss +14 -14
  91. package/src/lib/styles/elements/_rulers.scss +6 -6
  92. package/src/lib/styles/elements/_small.scss +2 -2
  93. package/src/lib/styles/generic/_box-sizing.scss +3 -2
  94. package/src/lib/styles/generic/_forms.scss +3 -3
  95. package/src/lib/styles/generic/_reset.scss +6 -6
  96. package/src/lib/styles/generic/_shared.scss +3 -3
  97. package/src/lib/styles/helpers/_animation.scss +8 -8
  98. package/src/lib/styles/settings/_breakpoints.scss +7 -7
  99. package/src/lib/styles/settings/_escaped-characters.scss +5 -5
  100. package/src/lib/styles/settings/_form-fields.scss +24 -24
  101. package/src/lib/styles/settings/_utilities.scss +112 -100
  102. package/src/lib/styles/theme/_colors.scss +50 -50
  103. package/src/lib/styles/theme/_form-fields.scss +32 -32
  104. package/src/lib/styles/theme/_spacing.scss +11 -11
  105. package/src/lib/styles/theme/_typography.scss +12 -11
  106. package/src/lib/styles/theme-constants/_breakpoints.scss +2 -2
  107. package/src/lib/styles/theme-constants/_colors.scss +2 -2
  108. package/src/lib/styles/theme-constants/_svg.scss +1 -2
  109. package/src/lib/styles/tools/_accessibility.scss +29 -29
  110. package/src/lib/styles/tools/_breakpoint.scss +11 -14
  111. package/src/lib/styles/tools/_caret.scss +8 -8
  112. package/src/lib/styles/tools/_colors.scss +3 -3
  113. package/src/lib/styles/tools/_reset.scss +21 -21
  114. package/src/lib/styles/tools/_scrollbar.scss +4 -4
  115. package/src/lib/styles/tools/_spacing.scss +17 -21
  116. package/src/lib/styles/tools/_string.scss +9 -9
  117. package/src/lib/styles/tools/_svg.scss +13 -16
  118. package/src/lib/styles/tools/_transition.scss +42 -44
  119. package/src/lib/styles/tools/_utilities.scss +19 -19
  120. package/src/lib/styles/tools/form-fields/_box-field-elements.scss +88 -88
  121. package/src/lib/styles/tools/form-fields/_box-field-layout.scss +144 -144
  122. package/src/lib/styles/tools/form-fields/_box-field-sizes.scss +13 -15
  123. package/src/lib/styles/tools/form-fields/_foundation.scss +12 -12
  124. package/src/lib/styles/tools/form-fields/_inline-field-elements.scss +71 -71
  125. package/src/lib/styles/tools/form-fields/_inline-field-layout.scss +44 -44
  126. package/src/lib/styles/tools/form-fields/_variants.scss +104 -106
  127. package/src/lib/theme.scss +958 -954
  128. package/src/lib/utils/classNames.js +8 -0
  129. package/src/lib/components/CTA/CTA.jsx +0 -60
  130. package/src/lib/components/CTA/CTA.scss +0 -71
  131. package/src/lib/components/CTA/CTACenter.jsx +0 -27
  132. package/src/lib/components/CTA/CTAEnd.jsx +0 -27
  133. package/src/lib/components/CTA/CTAStart.jsx +0 -27
  134. package/src/lib/components/CTA/README.mdx +0 -119
  135. package/src/lib/components/CTA/index.js +0 -4
  136. package/src/lib/components/Center/Center.jsx +0 -27
  137. package/src/lib/components/Center/Center.scss +0 -7
  138. package/src/lib/components/Center/README.mdx +0 -52
  139. package/src/lib/components/Center/index.js +0 -1
@@ -0,0 +1,8 @@
1
+ export const classNames = (...classes) => {
2
+ const filteredClassNames = classes.filter(
3
+ (className) => typeof className === 'string'
4
+ && className.trim().length > 0,
5
+ );
6
+
7
+ return filteredClassNames.length > 0 ? filteredClassNames.join(' ') : undefined;
8
+ };
@@ -1,60 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import { withProviderContext } from '../../provider';
4
- import styles from './CTA.scss';
5
-
6
- export const CTA = (props) => {
7
- const {
8
- align,
9
- children,
10
- } = props;
11
-
12
- const alignClass = (value) => {
13
- if (value === 'top') {
14
- return styles.isAlignedToTop;
15
- }
16
-
17
- if (value === 'middle') {
18
- return styles.isAlignedToMiddle;
19
- }
20
-
21
- if (value === 'bottom') {
22
- return styles.isAlignedToBottom;
23
- }
24
-
25
- return styles.isAlignedToBaseline;
26
- };
27
-
28
- return (
29
- <div
30
- className={[
31
- styles.root,
32
- alignClass(align),
33
- ].join(' ')}
34
- >
35
- {children}
36
- </div>
37
- );
38
- };
39
-
40
- CTA.defaultProps = {
41
- align: 'baseline',
42
- };
43
-
44
- CTA.propTypes = {
45
- /**
46
- * Vertical alignment of CTA elements.
47
- */
48
- align: PropTypes.oneOf(['top', 'middle', 'bottom', 'baseline']),
49
- /**
50
- * Nested elements. Supported types are:
51
- * * `CTAStart`
52
- * * `CTACenter`
53
- * * `CTAEnd`
54
- */
55
- children: PropTypes.node.isRequired,
56
- };
57
-
58
- export const CTAWithContext = withProviderContext(CTA, 'CTA');
59
-
60
- export default CTAWithContext;
@@ -1,71 +0,0 @@
1
- @use '../../styles/tools/breakpoint';
2
- @use '../../styles/tools/spacing';
3
-
4
- $_breakpoint: lg;
5
- $_spacing: spacing.of(1);
6
- $_column-gap: spacing.of(3);
7
-
8
- .root {
9
- @include spacing.bottom(layouts, $compensation: $_spacing);
10
-
11
- display: flex;
12
- flex-wrap: wrap;
13
- justify-content: space-between;
14
- margin: calc(-1 * #{$_spacing});
15
-
16
- @include breakpoint.up($_breakpoint) {
17
- display: grid;
18
- grid-template: 'start center end' auto #{'/'} 1fr auto 1fr;
19
- grid-column-gap: $_column-gap;
20
- margin: 0;
21
- }
22
- }
23
-
24
- .start,
25
- .center,
26
- .end {
27
- margin: $_spacing;
28
-
29
- @include breakpoint.up($_breakpoint) {
30
- margin: 0;
31
- }
32
- }
33
-
34
- .start {
35
- flex-basis: 100%;
36
-
37
- @include breakpoint.up($_breakpoint) {
38
- grid-area: start;
39
- justify-self: start;
40
- }
41
- }
42
-
43
- .center {
44
- @include breakpoint.up($_breakpoint) {
45
- grid-area: center;
46
- justify-self: center;
47
- }
48
- }
49
-
50
- .end {
51
- @include breakpoint.up($_breakpoint) {
52
- grid-area: end;
53
- justify-self: end;
54
- }
55
- }
56
-
57
- .isAlignedToTop {
58
- align-items: start;
59
- }
60
-
61
- .isAlignedToMiddle {
62
- align-items: center;
63
- }
64
-
65
- .isAlignedToBottom {
66
- align-items: end;
67
- }
68
-
69
- .isAlignedToBaseline {
70
- align-items: baseline;
71
- }
@@ -1,27 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import { withProviderContext } from '../../provider';
4
- import styles from './CTA.scss';
5
-
6
- export const CTACenter = (props) => {
7
- const {
8
- children,
9
- } = props;
10
-
11
- return (
12
- <div className={styles.center}>
13
- {children}
14
- </div>
15
- );
16
- };
17
-
18
- CTACenter.propTypes = {
19
- /**
20
- * Content of the center element.
21
- */
22
- children: PropTypes.node.isRequired,
23
- };
24
-
25
- export const CTACenterWithContext = withProviderContext(CTACenter, 'CTACenter');
26
-
27
- export default CTACenterWithContext;
@@ -1,27 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import { withProviderContext } from '../../provider';
4
- import styles from './CTA.scss';
5
-
6
- export const CTAEnd = (props) => {
7
- const {
8
- children,
9
- } = props;
10
-
11
- return (
12
- <div className={styles.end}>
13
- {children}
14
- </div>
15
- );
16
- };
17
-
18
- CTAEnd.propTypes = {
19
- /**
20
- * Content of the end element.
21
- */
22
- children: PropTypes.node.isRequired,
23
- };
24
-
25
- export const CTAEndWithContext = withProviderContext(CTAEnd, 'CTAEnd');
26
-
27
- export default CTAEndWithContext;
@@ -1,27 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import { withProviderContext } from '../../provider';
4
- import styles from './CTA.scss';
5
-
6
- export const CTAStart = (props) => {
7
- const {
8
- children,
9
- } = props;
10
-
11
- return (
12
- <div className={styles.start}>
13
- {children}
14
- </div>
15
- );
16
- };
17
-
18
- CTAStart.propTypes = {
19
- /**
20
- * Content of the start element.
21
- */
22
- children: PropTypes.node.isRequired,
23
- };
24
-
25
- export const CTAStartWithContext = withProviderContext(CTAStart, 'CTAStart');
26
-
27
- export default CTAStartWithContext;
@@ -1,119 +0,0 @@
1
- ---
2
- name: CTA
3
- menu: 'Layouts'
4
- route: /components/cta
5
- ---
6
-
7
- # CTA
8
-
9
- The responsive CTA layout holds an action at the center and two additional
10
- elements on sides.
11
-
12
- import {
13
- Playground,
14
- Props,
15
- } from 'docz'
16
- import { Placeholder } from '../../../docs/_components/Placeholder/Placeholder'
17
- import { CTA } from './CTA'
18
- import { CTACenter } from './CTACenter'
19
- import { CTAEnd } from './CTAEnd'
20
- import { CTAStart } from './CTAStart'
21
-
22
- ## Basic Usage
23
-
24
- To implement the CTA component, you need to import it first:
25
-
26
- ```js
27
- import { CTA } from '@react-ui-org/react-ui';
28
- ```
29
-
30
- And use it:
31
-
32
- <Playground>
33
- <Placeholder bordered>
34
- <CTA>
35
- <CTAStart>
36
- <Placeholder bordered>
37
- Start
38
- </Placeholder>
39
- </CTAStart>
40
- <CTACenter>
41
- <Placeholder bordered>
42
- Center
43
- </Placeholder>
44
- </CTACenter>
45
- <CTAEnd>
46
- <Placeholder bordered>
47
- End
48
- </Placeholder>
49
- </CTAEnd>
50
- </CTA>
51
- </Placeholder>
52
- </Playground>
53
-
54
- See [API](#api) for all available options.
55
-
56
- ## General Guidelines
57
-
58
- - The CTA (call to action) layout is designed for an **action placed at the
59
- center** of its parent and two optional side elements. It works perfectly
60
- especially in composition with a load-more button.
61
-
62
- - Place rather **a few smaller elements** into the layout, so they fit the
63
- screen even at the smallest size. For complex layouts and a lot of actions,
64
- consider using the [Toolbar](/components/toolbar) layout.
65
-
66
- 📐 On screen sizes smaller than 66 em (the `lg`
67
- [breakpoint](/foundation/breakpoints)), the start element expands over the full
68
- width of its parent. Please resize your browser rather than the playground to
69
- see this work.
70
-
71
- ## Vertical Alignment
72
-
73
- There are four options of vertical alignment: baseline (default), top, middle,
74
- and bottom.
75
-
76
- <Playground>
77
- <Placeholder bordered>
78
- <CTA align="bottom">
79
- <CTAStart>
80
- <Placeholder bordered>
81
- Start
82
- </Placeholder>
83
- </CTAStart>
84
- <CTACenter>
85
- <Placeholder bordered>
86
- Center<br />
87
- Element
88
- </Placeholder>
89
- </CTACenter>
90
- <CTAEnd>
91
- <Placeholder bordered>
92
- End
93
- </Placeholder>
94
- </CTAEnd>
95
- </CTA>
96
- </Placeholder>
97
- </Playground>
98
-
99
- ## API
100
-
101
- <Props table of={CTA} />
102
-
103
- ### CTAStart
104
-
105
- The start element of the CTA layout.
106
-
107
- <Props table of={CTAStart} />
108
-
109
- ### CTACenter
110
-
111
- The center element of the CTA layout.
112
-
113
- <Props table of={CTACenter} />
114
-
115
- ### CTAEnd
116
-
117
- The end element of the CTA layout.
118
-
119
- <Props table of={CTAEnd} />
@@ -1,4 +0,0 @@
1
- export { default as CTA } from './CTA';
2
- export { default as CTACenter } from './CTACenter';
3
- export { default as CTAEnd } from './CTAEnd';
4
- export { default as CTAStart } from './CTAStart';
@@ -1,27 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- import { withProviderContext } from '../../provider';
4
- import styles from './Center.scss';
5
-
6
- export const Center = ({ children }) => (
7
- <div className={styles.root}>
8
- <div>
9
- {children}
10
- </div>
11
- </div>
12
- );
13
-
14
- Center.defaultProps = {
15
- children: null,
16
- };
17
-
18
- Center.propTypes = {
19
- /**
20
- * The content to be centered.
21
- */
22
- children: PropTypes.node,
23
- };
24
-
25
- export const CenterWithContext = withProviderContext(Center, 'Center');
26
-
27
- export default CenterWithContext;
@@ -1,7 +0,0 @@
1
- .root {
2
- display: flex;
3
- align-items: center;
4
- justify-content: center;
5
- width: 100%;
6
- height: 100%;
7
- }
@@ -1,52 +0,0 @@
1
- ---
2
- name: Center
3
- menu: 'Layouts'
4
- route: /components/center
5
- ---
6
-
7
- # Center
8
-
9
- The Center layout aligns content both horizontally and vertically.
10
-
11
- import {
12
- Playground,
13
- Props,
14
- } from 'docz'
15
- import { Placeholder } from '../../../docs/_components/Placeholder/Placeholder'
16
- import { Center } from './Center'
17
-
18
- ## Basic Usage
19
-
20
- To implement the Center component, you need to import it first:
21
-
22
- ```js
23
- import { Center } from '@react-ui-org/react-ui';
24
- ```
25
-
26
- And use it:
27
-
28
- <Playground>
29
- <Placeholder height="200px" bordered>
30
- <Center>
31
- <Placeholder bordered>
32
- Look, I&apos;m centered!
33
- </Placeholder>
34
- </Center>
35
- </Placeholder>
36
- </Playground>
37
-
38
- See [API](#api) for all available options.
39
-
40
- ## General Guidelines
41
-
42
- - The Center takes up all **available horizontal space and expands vertically**
43
- according to the length of its content. Depending on your layout, you may need
44
- to define the height of its parent to see the vertical alignment work.
45
-
46
- - The Center layout uses `flexbox` for alignment. You may need to define the
47
- desired width of your centered content because it will be shrunk to the
48
- smallest possible width by default.
49
-
50
- ## API
51
-
52
- <Props table of={Center} />
@@ -1 +0,0 @@
1
- export { default } from './Center';