@react-ui-org/react-ui 0.42.0 → 0.44.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 (167) hide show
  1. package/CONTRIBUTING.md +44 -25
  2. package/README.md +1 -1
  3. package/dist/lib.development.js +1598 -652
  4. package/dist/lib.js +1 -9
  5. package/package.json +49 -48
  6. package/src/lib/components/{ui/Alert → Alert}/Alert.jsx +17 -14
  7. package/src/lib/components/{ui/Alert → Alert}/Alert.scss +3 -3
  8. package/src/lib/components/{ui/Alert → Alert}/README.mdx +6 -6
  9. package/src/lib/components/{ui/Alert → Alert}/_settings.scss +1 -1
  10. package/src/lib/components/{ui/Alert → Alert}/_theme.scss +0 -0
  11. package/src/lib/components/{ui/Alert → Alert}/_tools.scss +0 -0
  12. package/src/lib/components/{ui/Alert → Alert}/index.js +0 -0
  13. package/src/lib/components/{ui/Badge → Badge}/Badge.jsx +2 -2
  14. package/src/lib/components/{ui/Badge → Badge}/Badge.scss +3 -3
  15. package/src/lib/components/{ui/Badge → Badge}/README.mdx +3 -3
  16. package/src/lib/components/{ui/Badge → Badge}/index.js +0 -0
  17. package/src/lib/components/Button/Button.jsx +198 -0
  18. package/src/lib/components/{ui/Button → Button}/Button.scss +0 -0
  19. package/src/lib/components/{ui/Button → Button}/README.mdx +160 -75
  20. package/src/lib/components/Button/_base.scss +148 -0
  21. package/src/lib/components/{ui/Button → Button}/_priorities.scss +0 -4
  22. package/src/lib/components/{ui/Button → Button}/_settings.scss +2 -3
  23. package/src/lib/components/{ui/Button → Button}/_theme.scss +3 -11
  24. package/src/lib/components/{ui/Button → Button}/_tools.scss +27 -44
  25. package/src/lib/components/Button/helpers/getRootLabelVisibilityClassName.js +33 -0
  26. package/src/lib/components/{ui/Button → Button}/helpers/getRootPriorityClassName.js +0 -4
  27. package/src/lib/components/{ui/Button → Button}/index.js +0 -0
  28. package/src/lib/components/{ui/ButtonGroup → ButtonGroup}/ButtonGroup.jsx +9 -11
  29. package/src/lib/components/{ui/ButtonGroup → ButtonGroup}/ButtonGroup.scss +0 -0
  30. package/src/lib/components/ButtonGroup/ButtonGroupContext.js +3 -0
  31. package/src/lib/components/{ui/ButtonGroup → ButtonGroup}/README.mdx +26 -2
  32. package/src/lib/components/ButtonGroup/index.js +2 -0
  33. package/src/lib/components/{layout/CTA → CTA}/CTA.jsx +5 -2
  34. package/src/lib/components/{layout/CTA → CTA}/CTA.scss +2 -2
  35. package/src/lib/components/{layout/CTA → CTA}/CTACenter.jsx +1 -1
  36. package/src/lib/components/{layout/CTA → CTA}/CTAEnd.jsx +1 -1
  37. package/src/lib/components/{layout/CTA → CTA}/CTAStart.jsx +1 -1
  38. package/src/lib/components/{layout/CTA → CTA}/README.mdx +3 -3
  39. package/src/lib/components/{layout/CTA → CTA}/index.js +0 -0
  40. package/src/lib/components/{ui/Card → Card}/Card.jsx +6 -4
  41. package/src/lib/components/{ui/Card → Card}/Card.scss +1 -1
  42. package/src/lib/components/{ui/Card → Card}/CardBody.jsx +1 -1
  43. package/src/lib/components/{ui/Card → Card}/CardFooter.jsx +1 -1
  44. package/src/lib/components/{ui/Card → Card}/README.mdx +2 -2
  45. package/src/lib/components/{ui/Card → Card}/_theme.scss +0 -0
  46. package/src/lib/components/{ui/Card → Card}/_tools.scss +0 -0
  47. package/src/lib/components/{ui/Card → Card}/index.js +0 -0
  48. package/src/lib/components/{layout/Center → Center}/Center.jsx +1 -1
  49. package/src/lib/components/{layout/Center → Center}/Center.scss +0 -0
  50. package/src/lib/components/{layout/Center → Center}/README.mdx +2 -2
  51. package/src/lib/components/{layout/Center → Center}/index.js +0 -0
  52. package/src/lib/components/CheckboxField/CheckboxField.jsx +164 -0
  53. package/src/lib/components/{ui/CheckboxField → CheckboxField}/CheckboxField.scss +5 -5
  54. package/src/lib/components/{ui/CheckboxField → CheckboxField}/README.mdx +15 -12
  55. package/src/lib/components/{ui/CheckboxField → CheckboxField}/index.js +0 -0
  56. package/src/lib/components/FileInputField/FileInputField.jsx +162 -0
  57. package/src/lib/components/{ui/FileInputField → FileInputField}/FileInputField.scss +5 -5
  58. package/src/lib/components/{ui/FileInputField → FileInputField}/README.mdx +8 -6
  59. package/src/lib/components/{ui/FileInputField → FileInputField}/index.js +0 -0
  60. package/src/lib/components/{layout/FormLayout → FormLayout}/FormLayout.jsx +16 -18
  61. package/src/lib/components/{layout/FormLayout → FormLayout}/FormLayout.scss +3 -3
  62. package/src/lib/components/FormLayout/FormLayoutContext.js +3 -0
  63. package/src/lib/components/{layout/FormLayout → FormLayout}/FormLayoutCustomField.jsx +33 -30
  64. package/src/lib/components/{layout/FormLayout → FormLayout}/FormLayoutCustomField.scss +4 -4
  65. package/src/lib/components/{layout/FormLayout → FormLayout}/README.mdx +30 -40
  66. package/src/lib/components/{layout/FormLayout → FormLayout}/_theme.scss +0 -0
  67. package/src/lib/components/{layout/FormLayout → FormLayout}/index.js +1 -0
  68. package/src/lib/components/{layout/Grid → Grid}/Grid.jsx +23 -5
  69. package/src/lib/components/{layout/Grid → Grid}/Grid.scss +2 -4
  70. package/src/lib/components/{layout/Grid → Grid}/GridSpan.jsx +10 -3
  71. package/src/lib/components/{layout/Grid → Grid}/README.mdx +42 -38
  72. package/src/lib/components/{layout/Grid → Grid}/_theme.scss +1 -2
  73. package/src/lib/components/{layout/Grid → Grid}/_tools.scss +2 -2
  74. package/src/lib/components/{layout/Grid → Grid}/helpers/generateResponsiveCustomProperties.js +0 -0
  75. package/src/lib/components/{layout/Grid → Grid}/index.js +0 -0
  76. package/src/lib/components/Link/Link.jsx +45 -0
  77. package/src/lib/components/Link/Link.scss +11 -0
  78. package/src/lib/components/Link/README.mdx +85 -0
  79. package/src/lib/components/Link/_theme.scss +4 -0
  80. package/src/lib/components/Link/index.js +1 -0
  81. package/src/lib/components/{layout/List → List}/List.jsx +1 -1
  82. package/src/lib/components/{layout/List → List}/List.scss +2 -2
  83. package/src/lib/components/{layout/List → List}/ListItem.jsx +1 -1
  84. package/src/lib/components/{layout/List → List}/README.mdx +2 -2
  85. package/src/lib/components/{layout/List → List}/_theme.scss +0 -0
  86. package/src/lib/components/{layout/List → List}/index.js +0 -0
  87. package/src/lib/components/{layout/Media → Media}/Media.jsx +4 -2
  88. package/src/lib/components/{layout/Media → Media}/Media.scss +1 -1
  89. package/src/lib/components/{layout/Media → Media}/MediaBody.jsx +1 -1
  90. package/src/lib/components/{layout/Media → Media}/MediaObject.jsx +1 -1
  91. package/src/lib/components/{layout/Media → Media}/README.mdx +2 -2
  92. package/src/lib/components/{layout/Media → Media}/index.js +0 -0
  93. package/src/lib/components/{ui/Modal → Modal}/Modal.jsx +28 -27
  94. package/src/lib/components/{ui/Modal → Modal}/Modal.scss +5 -5
  95. package/src/lib/components/{ui/Modal → Modal}/README.mdx +40 -40
  96. package/src/lib/components/{ui/Modal → Modal}/_settings.scss +4 -4
  97. package/src/lib/components/{ui/Modal → Modal}/_theme.scss +0 -0
  98. package/src/lib/components/{ui/Modal → Modal}/index.js +0 -0
  99. package/src/lib/components/{ui/Paper → Paper}/Paper.jsx +8 -1
  100. package/src/lib/components/{ui/Paper → Paper}/Paper.scss +5 -0
  101. package/src/lib/components/{ui/Paper → Paper}/README.mdx +14 -2
  102. package/src/lib/components/{ui/Paper → Paper}/_theme.scss +2 -0
  103. package/src/lib/components/{ui/Paper → Paper}/index.js +0 -0
  104. package/src/lib/components/{ui/Radio → Radio}/README.mdx +17 -14
  105. package/src/lib/components/Radio/Radio.jsx +188 -0
  106. package/src/lib/components/{ui/Radio → Radio}/Radio.scss +9 -9
  107. package/src/lib/components/{ui/Radio → Radio}/index.js +0 -0
  108. package/src/lib/components/{ui/ScrollView → ScrollView}/README.mdx +10 -10
  109. package/src/lib/components/{ui/ScrollView → ScrollView}/ScrollView.jsx +9 -10
  110. package/src/lib/components/{ui/ScrollView → ScrollView}/ScrollView.scss +6 -6
  111. package/src/lib/components/{ui/ScrollView → ScrollView}/_theme.scss +0 -0
  112. package/src/lib/components/{ui/ScrollView → ScrollView}/index.js +0 -0
  113. package/src/lib/components/{ui/SelectField → SelectField}/README.mdx +44 -41
  114. package/src/lib/components/SelectField/SelectField.jsx +219 -0
  115. package/src/lib/components/{ui/SelectField → SelectField}/SelectField.scss +6 -6
  116. package/src/lib/components/{ui/SelectField → SelectField}/index.js +0 -0
  117. package/src/lib/components/{ui/Table → Table}/README.mdx +7 -7
  118. package/src/lib/components/{ui/Table → Table}/Table.jsx +9 -13
  119. package/src/lib/components/{ui/Table → Table}/Table.scss +1 -1
  120. package/src/lib/components/{ui/Table → Table}/_settings.scss +4 -4
  121. package/src/lib/components/{ui/Table → Table}/index.js +0 -0
  122. package/src/lib/components/{ui/Tabs → Tabs}/README.mdx +3 -3
  123. package/src/lib/components/{ui/Tabs → Tabs}/Tabs.jsx +4 -4
  124. package/src/lib/components/{ui/Tabs → Tabs}/Tabs.scss +1 -1
  125. package/src/lib/components/{ui/Tabs → Tabs}/TabsItem.jsx +4 -3
  126. package/src/lib/components/{ui/Tabs → Tabs}/TabsItem.scss +3 -3
  127. package/src/lib/components/{ui/Tabs → Tabs}/_theme.scss +0 -0
  128. package/src/lib/components/{ui/Tabs → Tabs}/index.js +0 -0
  129. package/src/lib/components/{ui/Text → Text}/README.mdx +19 -19
  130. package/src/lib/components/{ui/Text → Text}/Text.jsx +1 -1
  131. package/src/lib/components/{ui/Text → Text}/Text.scss +0 -0
  132. package/src/lib/components/{ui/Text → Text}/helpers/getRootHyphensClassName.js +0 -0
  133. package/src/lib/components/{ui/Text → Text}/helpers/getRootWordWrappingClassName.js +0 -0
  134. package/src/lib/components/{ui/Text → Text}/index.js +0 -0
  135. package/src/lib/components/{ui/TextArea → TextArea}/README.mdx +8 -6
  136. package/src/lib/components/{ui/TextArea → TextArea}/TextArea.jsx +78 -78
  137. package/src/lib/components/{ui/TextArea → TextArea}/TextArea.scss +6 -6
  138. package/src/lib/components/{ui/TextArea → TextArea}/index.js +0 -0
  139. package/src/lib/components/{ui/TextField → TextField}/README.mdx +7 -6
  140. package/src/lib/components/{ui/TextField → TextField}/TextField.jsx +20 -23
  141. package/src/lib/components/{ui/TextField → TextField}/TextField.scss +6 -6
  142. package/src/lib/components/{ui/TextField → TextField}/index.js +0 -0
  143. package/src/lib/components/{ui/Toggle → Toggle}/README.mdx +15 -12
  144. package/src/lib/components/Toggle/Toggle.jsx +163 -0
  145. package/src/lib/components/{ui/Toggle → Toggle}/Toggle.scss +5 -5
  146. package/src/lib/components/{ui/Toggle → Toggle}/index.js +0 -0
  147. package/src/lib/components/{layout/Toolbar → Toolbar}/README.mdx +26 -26
  148. package/src/lib/components/{layout/Toolbar → Toolbar}/Toolbar.jsx +1 -1
  149. package/src/lib/components/{layout/Toolbar → Toolbar}/Toolbar.scss +1 -1
  150. package/src/lib/components/{layout/Toolbar → Toolbar}/ToolbarGroup.jsx +1 -1
  151. package/src/lib/components/{layout/Toolbar → Toolbar}/ToolbarItem.jsx +1 -1
  152. package/src/lib/components/{layout/Toolbar → Toolbar}/_theme.scss +0 -0
  153. package/src/lib/components/{layout/Toolbar → Toolbar}/index.js +0 -0
  154. package/src/lib/components/{ui/withForwardedRef.jsx → withForwardedRef.jsx} +0 -0
  155. package/src/lib/helpers/resolveContextOrProp.js +7 -0
  156. package/src/lib/index.js +34 -35
  157. package/src/lib/styles/tools/_accessibility.scss +9 -0
  158. package/src/lib/theme.scss +25 -7
  159. package/src/lib/components/ui/Button/Button.jsx +0 -191
  160. package/src/lib/components/ui/Button/_base.scss +0 -154
  161. package/src/lib/components/ui/Button/helpers/getRootLabelVisibilityClassName.js +0 -11
  162. package/src/lib/components/ui/ButtonGroup/index.js +0 -1
  163. package/src/lib/components/ui/CheckboxField/CheckboxField.jsx +0 -173
  164. package/src/lib/components/ui/FileInputField/FileInputField.jsx +0 -158
  165. package/src/lib/components/ui/Radio/Radio.jsx +0 -179
  166. package/src/lib/components/ui/SelectField/SelectField.jsx +0 -214
  167. package/src/lib/components/ui/Toggle/Toggle.jsx +0 -174
@@ -0,0 +1,188 @@
1
+ import PropTypes from 'prop-types';
2
+ import React, { useContext } from 'react';
3
+ import getRootValidationStateClassName from '../../helpers/getRootValidationStateClassName';
4
+ import { resolveContextOrProp } from '../../helpers/resolveContextOrProp';
5
+ import { withProviderContext } from '../../provider';
6
+ import transferProps from '../../utils/transferProps';
7
+ import { FormLayoutContext } from '../FormLayout';
8
+ import styles from './Radio.scss';
9
+
10
+ export const Radio = ({
11
+ disabled,
12
+ helpText,
13
+ id,
14
+ isLabelVisible,
15
+ label,
16
+ layout,
17
+ options,
18
+ required,
19
+ validationState,
20
+ validationText,
21
+ value,
22
+ ...restProps
23
+ }) => {
24
+ const context = useContext(FormLayoutContext);
25
+
26
+ return (
27
+ <div
28
+ className={[
29
+ styles.root,
30
+ context ? styles.isRootInFormLayout : '',
31
+ resolveContextOrProp(context && context.layout, layout) === 'horizontal'
32
+ ? styles.rootLayoutHorizontal
33
+ : styles.rootLayoutVertical,
34
+ disabled ? styles.isRootDisabled : '',
35
+ required ? styles.isRootRequired : '',
36
+ getRootValidationStateClassName(validationState, styles),
37
+ ].join(' ')}
38
+ id={id}
39
+ >
40
+ <div
41
+ className={[
42
+ styles.label,
43
+ isLabelVisible ? '' : styles.isLabelHidden,
44
+ ].join(' ')}
45
+ id={id && `${id}__labelText`}
46
+ >
47
+ {label}
48
+ </div>
49
+ <div className={styles.field}>
50
+ <ul className={styles.list}>
51
+ {
52
+ options.map((option) => (
53
+ <li key={option.value}>
54
+ <label
55
+ className={styles.option}
56
+ htmlFor={id && `${id}__item__${option.value}`}
57
+ id={id && `${id}__item__${option.value}__label`}
58
+ >
59
+ <input
60
+ {...transferProps(restProps)}
61
+ className={styles.input}
62
+ checked={restProps.onChange
63
+ ? (value === option.value) || false
64
+ : undefined}
65
+ disabled={disabled || option.disabled}
66
+ id={id && `${id}__item__${option.value}`}
67
+ name={id}
68
+ type="radio"
69
+ value={option.value}
70
+ />
71
+ <span
72
+ className={styles.optionLabel}
73
+ id={id && `${id}__item__${option.value}__labelText`}
74
+ >
75
+ { option.label }
76
+ </span>
77
+ </label>
78
+ </li>
79
+ ))
80
+ }
81
+ </ul>
82
+ {helpText && (
83
+ <div
84
+ className={styles.helpText}
85
+ id={id && `${id}__helpText`}
86
+ >
87
+ {helpText}
88
+ </div>
89
+ )}
90
+ {validationText && (
91
+ <div
92
+ className={styles.validationText}
93
+ id={id && `${id}__validationText`}
94
+ >
95
+ {validationText}
96
+ </div>
97
+ )}
98
+ </div>
99
+ </div>
100
+ );
101
+ };
102
+
103
+ Radio.defaultProps = {
104
+ disabled: false,
105
+ helpText: null,
106
+ id: undefined,
107
+ isLabelVisible: true,
108
+ layout: 'vertical',
109
+ required: false,
110
+ validationState: null,
111
+ validationText: null,
112
+ value: undefined,
113
+ };
114
+
115
+ Radio.propTypes = {
116
+ /**
117
+ * If `true`, the input will be disabled.
118
+ */
119
+ disabled: PropTypes.bool,
120
+ /**
121
+ * Optional help text.
122
+ */
123
+ helpText: PropTypes.node,
124
+ /**
125
+ * ID of the root HTML element.
126
+ *
127
+ * Also serves as base for ids of nested elements:
128
+ * * `<ID>__labelText`
129
+ * * `<ID>__helpText`
130
+ * * `<ID>__validationText`
131
+ *
132
+ * and of individual options (`<input>`):
133
+ * * `<ID>__item__<VALUE>`
134
+ * * `<ID>__item__<VALUE>__label`
135
+ * * `<ID>__item__<VALUE>__labelText`
136
+ */
137
+ id: PropTypes.string,
138
+ /**
139
+ * If `false`, the label will be visually hidden (but remains accessible by assistive
140
+ * technologies).
141
+ */
142
+ isLabelVisible: PropTypes.bool,
143
+ /**
144
+ * Label of the group of options.
145
+ */
146
+ label: PropTypes.string.isRequired,
147
+ /**
148
+ * Layout of the field.
149
+ *
150
+ * Ignored if the component is rendered within `FormLayout` component
151
+ * as the value is inherited in such case.
152
+ */
153
+ layout: PropTypes.oneOf(['horizontal', 'vertical']),
154
+ /**
155
+ * Set of options to be chosen from.
156
+ */
157
+ options: PropTypes.arrayOf(PropTypes.shape({
158
+ disabled: PropTypes.bool,
159
+ label: PropTypes.string.isRequired,
160
+ value: PropTypes.oneOfType([
161
+ PropTypes.string,
162
+ PropTypes.number,
163
+ ]),
164
+ })).isRequired,
165
+ /**
166
+ * If `true`, the input will be required.
167
+ */
168
+ required: PropTypes.bool,
169
+ /**
170
+ * Alter the field to provide feedback based on validation result.
171
+ */
172
+ validationState: PropTypes.oneOf(['invalid', 'valid', 'warning']),
173
+ /**
174
+ * Validation message to be displayed.
175
+ */
176
+ validationText: PropTypes.node,
177
+ /**
178
+ * Value of the input.
179
+ */
180
+ value: PropTypes.oneOfType([
181
+ PropTypes.string,
182
+ PropTypes.number,
183
+ ]),
184
+ };
185
+
186
+ export const RadioWithContext = withProviderContext(Radio, 'Radio');
187
+
188
+ export default RadioWithContext;
@@ -1,12 +1,12 @@
1
- @use '../../../styles/tools/form-fields/box-field-elements';
2
- @use '../../../styles/tools/form-fields/box-field-layout';
3
- @use '../../../styles/tools/form-fields/foundation';
4
- @use '../../../styles/tools/form-fields/inline-field-elements';
5
- @use '../../../styles/tools/form-fields/inline-field-layout';
6
- @use '../../../styles/tools/form-fields/variants';
7
- @use '../../../styles/tools/accessibility';
8
- @use '../../../styles/tools/reset';
9
- @use '../../../styles/tools/spacing';
1
+ @use '../../styles/tools/form-fields/box-field-elements';
2
+ @use '../../styles/tools/form-fields/box-field-layout';
3
+ @use '../../styles/tools/form-fields/foundation';
4
+ @use '../../styles/tools/form-fields/inline-field-elements';
5
+ @use '../../styles/tools/form-fields/inline-field-layout';
6
+ @use '../../styles/tools/form-fields/variants';
7
+ @use '../../styles/tools/accessibility';
8
+ @use '../../styles/tools/reset';
9
+ @use '../../styles/tools/spacing';
10
10
 
11
11
  // Foundation
12
12
  .root {
File without changes
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ScrollView
3
- menu: 'UI'
4
- route: /components/ui/scroll-view
3
+ menu: 'Miscellaneous'
4
+ route: /components/scroll-view
5
5
  ---
6
6
 
7
7
  # ScrollView
@@ -12,11 +12,11 @@ import {
12
12
  Playground,
13
13
  Props,
14
14
  } from 'docz'
15
- import { Placeholder } from '../../../../docs/_components/Placeholder/Placeholder'
15
+ import { Placeholder } from '../../../docs/_components/Placeholder/Placeholder'
16
16
  import Button from '../Button'
17
17
  import Radio from '../Radio'
18
- import { Toolbar } from '../../layout/Toolbar/Toolbar'
19
- import { ToolbarItem } from '../../layout/Toolbar/ToolbarItem'
18
+ import { Toolbar } from '../Toolbar/Toolbar'
19
+ import { ToolbarItem } from '../Toolbar/ToolbarItem'
20
20
  import {
21
21
  ScrollViewWithContext as ScrollView,
22
22
  ScrollView as ParsableScrollView,
@@ -219,7 +219,8 @@ property defined because it detects changes of these keys.
219
219
  <Toolbar>
220
220
  <ToolbarItem>
221
221
  <Radio
222
- changeHandler={(e) => setDirection(e.target.value)}
222
+ label="Direction:"
223
+ onChange={(e) => setDirection(e.target.value)}
223
224
  options={[
224
225
  {
225
226
  label: 'Vertical',
@@ -230,13 +231,13 @@ property defined because it detects changes of these keys.
230
231
  value: 'horizontal',
231
232
  },
232
233
  ]}
233
- label="Direction:"
234
234
  value={direction}
235
235
  />
236
236
  </ToolbarItem>
237
237
  <ToolbarItem>
238
238
  <Radio
239
- changeHandler={(e) => setAutoScroll(e.target.value)}
239
+ label="Autoscroll:"
240
+ onChange={(e) => setAutoScroll(e.target.value)}
240
241
  options={[
241
242
  {
242
243
  label: 'Always',
@@ -247,14 +248,13 @@ property defined because it detects changes of these keys.
247
248
  value: 'detectEnd',
248
249
  },
249
250
  ]}
250
- label="Autoscroll:"
251
251
  value={autoScroll}
252
252
  />
253
253
  </ToolbarItem>
254
254
  <ToolbarItem>
255
255
  <Button
256
256
  label="Add text"
257
- clickHandler={
257
+ onClick={
258
258
  () => setScrollViewContent(
259
259
  `${scrollViewContent} ${generateRandomString()}`,
260
260
  )
@@ -5,10 +5,10 @@ import React, {
5
5
  useRef,
6
6
  useState,
7
7
  } from 'react';
8
- import { useLoadResize } from '../../../hooks/useLoadResizeHook';
9
- import { useScrollPosition } from '../../../hooks/useScrollPositionHook';
10
- import { withProviderContext } from '../../../provider';
11
- import { getElementsPositionDifference } from '../../../services/elementPositionService';
8
+ import { useLoadResize } from '../../hooks/useLoadResizeHook';
9
+ import { useScrollPosition } from '../../hooks/useScrollPositionHook';
10
+ import { withProviderContext } from '../../provider';
11
+ import { getElementsPositionDifference } from '../../services/elementPositionService';
12
12
  import styles from './ScrollView.scss';
13
13
 
14
14
  // Function `getElementsPositionDifference` sometimes returns floating point values that results
@@ -315,10 +315,7 @@ ScrollView.propTypes = {
315
315
  /**
316
316
  * Content to be scrollable.
317
317
  */
318
- children: PropTypes.oneOfType([
319
- PropTypes.arrayOf(PropTypes.node),
320
- PropTypes.node,
321
- ]).isRequired,
318
+ children: PropTypes.node.isRequired,
322
319
  /**
323
320
  * Custom CSS to replace the default end scrolling shadow.
324
321
  */
@@ -350,8 +347,10 @@ ScrollView.propTypes = {
350
347
  */
351
348
  direction: PropTypes.oneOf(['horizontal', 'vertical']),
352
349
  /**
353
- * ID of the root HTML element. It also serves as a prefix for important inner elements:
354
- * `<ID>__content`, `<ID>__arrowPrevButton`, and `<ID>__arrowNextButton`.
350
+ * ID of the root HTML element. It also serves as base for nested elements:
351
+ * * `<ID>__content`
352
+ * * `<ID>__arrowPrevButton`
353
+ * * `<ID>__arrowNextButton`
355
354
  */
356
355
  id: PropTypes.string,
357
356
  /**
@@ -21,12 +21,12 @@
21
21
  // 7. Hide content overflowing in the other direction because scrollbars would be unreachable under
22
22
  // scrolling shadows.
23
23
 
24
- @use '../../../styles/tools/accessibility';
25
- @use '../../../styles/tools/caret';
26
- @use '../../../styles/tools/reset';
27
- @use '../../../styles/tools/scrollbar';
28
- @use '../../../styles/tools/spacing';
29
- @use '../../../styles/tools/transition';
24
+ @use '../../styles/tools/accessibility';
25
+ @use '../../styles/tools/caret';
26
+ @use '../../styles/tools/reset';
27
+ @use '../../styles/tools/scrollbar';
28
+ @use '../../styles/tools/spacing';
29
+ @use '../../styles/tools/transition';
30
30
  @use 'theme';
31
31
 
32
32
  $_arrow-inner-spacing: spacing.of(2);