@councilbox/councilbox-ui 2.0.56 → 2.0.58

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 (29) hide show
  1. package/dist/build-index.js +0 -7
  2. package/dist/components/1.Introduction.stories.mdx +1 -1
  3. package/dist/components/2.Changelog.stories.mdx +17 -0
  4. package/dist/components/Checkbox/Checkbox.css +6 -0
  5. package/dist/components/Checkbox/Checkbox.js +3 -1
  6. package/dist/components/DragDrop/DragDrop.css +9 -8
  7. package/dist/components/DragDrop/DragDrop.js +3 -1
  8. package/dist/components/DrawerPanel/DrawerPanel.js +1 -1
  9. package/dist/components/Grid/Grid.js +1 -0
  10. package/dist/components/Grid/GridItem.js +2 -1
  11. package/dist/components/InputAutocomplete/InputAutocomplete.js +92 -18
  12. package/dist/components/InputAutocomplete/InputAutocomplete.stories.js +90 -1
  13. package/dist/components/InputText/InputText.css +0 -10
  14. package/dist/components/InputText/InputText.stories.js +15 -1
  15. package/dist/components/Modal/Modal.js +1 -1
  16. package/dist/components/RichTextInput/DesignRichTextInput.stories.js +1 -7
  17. package/dist/components/Scrollbar/Scrollbar.css +19 -60
  18. package/dist/components/Scrollbar/Scrollbar.js +62 -384
  19. package/dist/components/SelectInput/SelectInput.js +12 -6
  20. package/dist/components/Stepper/Stepper.js +2 -1
  21. package/dist/components/Table/TableRow.js +1 -0
  22. package/dist/components/Toast/Toast.js +1 -1
  23. package/dist/components/Toggle/Toggle.js +1 -1
  24. package/package.json +1 -2
  25. package/ScrollbarOld.js +0 -3
  26. package/dist/components/ScrollbarOld/DesignScrollbarOld.js +0 -24
  27. package/dist/components/ScrollbarOld/ScrollbarOld.css +0 -38
  28. package/dist/components/ScrollbarOld/ScrollbarOld.js +0 -104
  29. package/dist/components/ScrollbarOld/ScrollbarOld.stories.js +0 -37
@@ -1,79 +1,38 @@
1
- .Scrollbar>.cbx-scrollbarNew-view {
2
- position: absolute;
3
- top: 0;
4
- left: 0;
5
- right: 0;
6
- bottom: 0;
7
- overflow-y: auto;
8
- overflow-x: hidden;
1
+ .scrollbarFix {
2
+ margin-right: -17px;
9
3
  scroll-behavior: smooth;
10
- -webkit-overflow-scrolling: touch;
11
- scrollbar-width: none;
12
4
  }
13
5
 
14
- .Scrollbar.ScrollbarMobile>.cbx-scrollbarNew-view {
15
- scrollbar-width: auto;
16
- }
17
-
18
- .Scrollbar:not(.ScrollbarMobile)>.cbx-scrollbarNew-view::-webkit-scrollbar {
19
- display: none;
6
+ .Scrollbar>div:first-child {
7
+ scroll-behavior: smooth;
20
8
  }
21
9
 
22
- .scrollbarBoth>.cbx-scrollbarNew-view {
23
- overflow-x: auto;
10
+ .scrollbarBoth>div:first-child {
11
+ margin-right: -17px !important;
12
+ margin-bottom: -0 !important;
13
+ overflow-x: auto !important;
24
14
  }
25
15
 
26
- .scrollbarOnlyY>.cbx-scrollbarNew-view {
27
- overflow-x: hidden;
16
+ .scrollbarOnlyY>div:first-child {
17
+ overflow-x: hidden !important;
18
+ margin-right: -17px !important;
19
+ margin-bottom: -0 !important;
28
20
  }
29
21
 
30
- .scrollflex>.cbx-scrollbarNew-view {
22
+ .scrollflex>div:first-child {
31
23
  display: flex;
32
24
  flex-grow: 1;
33
25
  min-height: 100%;
34
26
  }
35
27
 
36
- .cbx-scrollbarNew-trackVertical,
37
- .cbx-scrollbarNew-trackHorizontal {
38
- position: absolute;
39
- opacity: 1;
40
- transition-property: opacity;
41
- transition-timing-function: ease;
42
- }
43
-
44
- .cbx-scrollbarNew-trackVertical {
45
- top: 2px;
46
- right: 2px;
47
- bottom: 2px;
48
- width: 6px;
49
- border-radius: 3px;
50
- }
51
-
52
- .cbx-scrollbarNew-trackHorizontal {
53
- left: 2px;
54
- right: 2px;
55
- bottom: 2px;
56
- height: 6px;
57
- border-radius: 3px;
58
- }
59
-
60
- .cbx-scrollbarNew-thumbVertical,
61
- .cbx-scrollbarNew-thumbHorizontal {
62
- position: relative;
63
- background-color: rgba(0, 0, 0, .2);
64
- border-radius: inherit;
65
- cursor: pointer;
28
+ .scrollbarFixHeight > div > div {
29
+ /* flex-grow: 1; */
66
30
  }
67
31
 
68
- .cbx-scrollbarNew-thumbVertical {
69
- width: 100%;
32
+ .scrollbarFixHeightIos > div > div {
33
+ padding-bottom: 0!important;
70
34
  }
71
35
 
72
- .cbx-scrollbarNew-thumbHorizontal {
73
- height: 100%;
74
- }
75
-
76
- .ScrollbarMobile .cbx-scrollbarNew-trackVertical,
77
- .ScrollbarMobile .cbx-scrollbarNew-trackHorizontal {
78
- display: none;
36
+ .macOSFlexFix> div > div > div {
37
+ min-height: 100%;
79
38
  }
@@ -6,12 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports["default"] = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
- var _propTypes = _interopRequireDefault(require("prop-types"));
10
9
  require("../../styles/main.css");
11
10
  require("./Scrollbar.css");
11
+ var _reactCustomScrollbars = require("react-custom-scrollbars-2");
12
+ var _getScrollbarWidth = _interopRequireDefault(require("react-custom-scrollbars-2/lib/utils/getScrollbarWidth"));
12
13
  var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
13
14
  var _excluded = ["prefixClass"];
14
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
16
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
15
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
19
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -19,37 +21,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
19
21
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
22
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
21
23
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
22
- var THUMB_MIN_SIZE = 30;
23
- var AUTO_HIDE_TIMEOUT = 1000;
24
- var SCROLL_STOP_DELAY = 100;
25
- var TRACK_FADE_DURATION = 200;
26
- var INTERACTIVE_SELECTOR = ['input', 'select', 'textarea', 'button', '[role="listbox"]', '[role="option"]', '[role="combobox"]', '[role="slider"]', '[role="tablist"]', '[role="tab"]', '[contenteditable="true"]'].join(', ');
27
- var clampThumbSize = function clampThumbSize(trackSize, contentRatio) {
28
- var proportionalSize = Math.ceil(contentRatio * trackSize);
29
- return Math.min(trackSize, Math.max(proportionalSize, THUMB_MIN_SIZE));
30
- };
31
- var EMPTY_AXIS_GEOMETRY = {
32
- size: 0,
33
- offset: 0,
34
- visible: false
35
- };
36
-
37
- // Same measurement react-custom-scrollbars-2 uses: on systems with overlay/0-width
38
- // native scrollbars (macOS trackpad default, some modern Chrome setups), this is 0 -
39
- // and the library shows no custom thumb at all there, relying on the native overlay.
40
- // We replicate that exactly instead of always drawing our own thumb.
41
- var cachedScrollbarWidth = null;
42
- var getScrollbarWidth = function getScrollbarWidth() {
43
- var useCache = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
44
- if (useCache && cachedScrollbarWidth !== null) return cachedScrollbarWidth;
45
- if (typeof document === 'undefined') return 0;
46
- var div = document.createElement('div');
47
- div.style.cssText = 'width:100px;height:100px;position:absolute;top:-9999px;overflow:scroll;-ms-overflow-style:scrollbar;';
48
- document.body.appendChild(div);
49
- cachedScrollbarWidth = div.offsetWidth - div.clientWidth;
50
- document.body.removeChild(div);
51
- return cachedScrollbarWidth;
52
- };
53
24
  var Scrollbar = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
54
25
  var propPrefixClass = _ref.prefixClass,
55
26
  props = _objectWithoutProperties(_ref, _excluded);
@@ -57,370 +28,77 @@ var Scrollbar = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
57
28
  stylesInLine = _useDynamicStyles.stylesInLine,
58
29
  dynamicPrefixClass = _useDynamicStyles.prefixClass;
59
30
  var prefixClass = propPrefixClass || dynamicPrefixClass;
60
- var style = props.style,
61
- autoHide = props.autoHide,
62
- children = props.children,
63
- showX = props.showX,
64
- onScrollStop = props.onScrollStop,
65
- _props$classFix = props.classFix,
66
- classFix = _props$classFix === void 0 ? '' : _props$classFix,
67
- _props$horizontalScro = props.horizontalScroll,
68
- horizontalScroll = _props$horizontalScro === void 0 ? false : _props$horizontalScro;
69
- var isMobileMode = classFix.split(' ').filter(Boolean).includes('ScrollbarMobile');
70
- var showHorizontalThumb = horizontalScroll && showX && !isMobileMode;
71
- var viewRef = _react["default"].useRef(null);
72
- var trackVerticalRef = _react["default"].useRef(null);
73
- var trackHorizontalRef = _react["default"].useRef(null);
74
- var thumbVerticalRef = _react["default"].useRef(null);
75
- var thumbHorizontalRef = _react["default"].useRef(null);
76
- var dragStateRef = _react["default"].useRef(null);
77
- var trackMouseOverRef = _react["default"].useRef(false);
78
- var scrollStopTimerRef = _react["default"].useRef(null);
79
- var hideTracksTimerRef = _react["default"].useRef(null);
80
- var geometryRef = _react["default"].useRef({
81
- vertical: EMPTY_AXIS_GEOMETRY,
82
- horizontal: EMPTY_AXIS_GEOMETRY
83
- });
84
- var tracksVisibleRef = _react["default"].useRef(true);
85
- var hasNativeScrollbarRef = _react["default"].useRef(getScrollbarWidth() > 0);
86
- var isCustomTrackHidden = _react["default"].useCallback(function () {
87
- return isMobileMode || !hasNativeScrollbarRef.current;
88
- }, [isMobileMode]);
89
-
90
- // Thumb size/offset and track opacity are mutated directly on the DOM (like the
91
- // original library's own dom-css updates) instead of through setState, since this
92
- // runs on every scroll/resize frame and must never trigger a React re-render.
93
- var applyTrackStyles = _react["default"].useCallback(function () {
94
- var _geometryRef$current = geometryRef.current,
95
- vertical = _geometryRef$current.vertical,
96
- horizontal = _geometryRef$current.horizontal;
97
- var showTracks = tracksVisibleRef.current;
98
- var display = isCustomTrackHidden() ? 'none' : '';
99
- if (thumbVerticalRef.current) {
100
- thumbVerticalRef.current.style.height = "".concat(vertical.size, "px");
101
- thumbVerticalRef.current.style.transform = "translateY(".concat(vertical.offset, "px)");
102
- }
103
- if (trackVerticalRef.current) {
104
- trackVerticalRef.current.style.display = display;
105
- trackVerticalRef.current.style.opacity = vertical.visible && showTracks ? '1' : '0';
106
- trackVerticalRef.current.style.pointerEvents = vertical.visible ? 'auto' : 'none';
107
- }
108
- if (thumbHorizontalRef.current) {
109
- thumbHorizontalRef.current.style.width = "".concat(horizontal.size, "px");
110
- thumbHorizontalRef.current.style.transform = "translateX(".concat(horizontal.offset, "px)");
111
- }
112
- if (trackHorizontalRef.current) {
113
- trackHorizontalRef.current.style.display = display;
114
- trackHorizontalRef.current.style.opacity = horizontal.visible && showTracks ? '1' : '0';
115
- trackHorizontalRef.current.style.pointerEvents = horizontal.visible ? 'auto' : 'none';
116
- }
117
- }, [isCustomTrackHidden]);
118
- var setTracksVisibility = _react["default"].useCallback(function (visible) {
119
- tracksVisibleRef.current = visible;
120
- applyTrackStyles();
121
- }, [applyTrackStyles]);
122
- var updateThumbs = _react["default"].useCallback(function () {
123
- var view = viewRef.current;
124
- if (!view || isCustomTrackHidden()) return;
125
- var scrollTop = view.scrollTop,
126
- scrollHeight = view.scrollHeight,
127
- clientHeight = view.clientHeight,
128
- scrollLeft = view.scrollLeft,
129
- scrollWidth = view.scrollWidth,
130
- clientWidth = view.clientWidth;
131
- var trackVerticalSize = trackVerticalRef.current ? trackVerticalRef.current.clientHeight : 0;
132
- var trackHorizontalSize = trackHorizontalRef.current ? trackHorizontalRef.current.clientWidth : 0;
133
- var verticalNeeded = scrollHeight > clientHeight + 1;
134
- var horizontalNeeded = showHorizontalThumb && scrollWidth > clientWidth + 1;
135
- var verticalThumbSize = trackVerticalSize ? clampThumbSize(trackVerticalSize, clientHeight / scrollHeight) : 0;
136
- var verticalOffset = verticalNeeded ? scrollTop / (scrollHeight - clientHeight) * (trackVerticalSize - verticalThumbSize) : 0;
137
- var horizontalThumbSize = trackHorizontalSize ? clampThumbSize(trackHorizontalSize, clientWidth / scrollWidth) : 0;
138
- var horizontalOffset = horizontalNeeded ? scrollLeft / (scrollWidth - clientWidth) * (trackHorizontalSize - horizontalThumbSize) : 0;
139
- geometryRef.current = {
140
- vertical: {
141
- size: verticalThumbSize,
142
- offset: verticalOffset,
143
- visible: verticalNeeded
144
- },
145
- horizontal: {
146
- size: horizontalThumbSize,
147
- offset: horizontalOffset,
148
- visible: horizontalNeeded
149
- }
150
- };
151
- applyTrackStyles();
152
- }, [isCustomTrackHidden, showHorizontalThumb, applyTrackStyles]);
153
- var showTracksNow = _react["default"].useCallback(function () {
154
- clearTimeout(hideTracksTimerRef.current);
155
- setTracksVisibility(true);
156
- }, [setTracksVisibility]);
157
- var scheduleHideTracks = _react["default"].useCallback(function () {
158
- if (!autoHide) return;
159
- if (dragStateRef.current || trackMouseOverRef.current) return;
160
- clearTimeout(hideTracksTimerRef.current);
161
- hideTracksTimerRef.current = setTimeout(function () {
162
- return setTracksVisibility(false);
163
- }, AUTO_HIDE_TIMEOUT);
164
- }, [autoHide, setTracksVisibility]);
165
- var rafIdRef = _react["default"].useRef(null);
166
-
167
- // The library coalesces scroll/resize-driven updates into a single rAF (cancelling
168
- // any pending frame first) so a burst of scroll events only recomputes once per
169
- // paint. Prop/content-driven updates (below, in useLayoutEffect) stay synchronous
170
- // so there's never a stale-thumb flash right after mount or a re-render.
171
- var scheduleUpdateThumbs = _react["default"].useCallback(function () {
172
- if (rafIdRef.current !== null) cancelAnimationFrame(rafIdRef.current);
173
- rafIdRef.current = requestAnimationFrame(function () {
174
- rafIdRef.current = null;
175
- updateThumbs();
176
- });
177
- }, [updateThumbs]);
178
- var handleScroll = _react["default"].useCallback(function () {
179
- scheduleUpdateThumbs();
180
- if (autoHide) showTracksNow();
181
- clearTimeout(scrollStopTimerRef.current);
182
- scrollStopTimerRef.current = setTimeout(function () {
183
- onScrollStop === null || onScrollStop === void 0 ? void 0 : onScrollStop();
184
- scheduleHideTracks();
185
- }, SCROLL_STOP_DELAY);
186
- }, [scheduleUpdateThumbs, autoHide, showTracksNow, onScrollStop, scheduleHideTracks]);
187
- _react["default"].useLayoutEffect(function () {
188
- updateThumbs();
189
- });
190
- _react["default"].useEffect(function () {
191
- if (!autoHide) {
192
- setTracksVisibility(true);
193
- } else {
194
- scheduleHideTracks();
195
- }
196
- }, [autoHide, scheduleHideTracks, setTracksVisibility]);
197
- _react["default"].useEffect(function () {
198
- var view = viewRef.current;
199
- if (!view || typeof ResizeObserver === 'undefined') return undefined;
200
- var observer = new ResizeObserver(function () {
201
- return scheduleUpdateThumbs();
202
- });
203
- observer.observe(view);
204
- if (view.firstElementChild) observer.observe(view.firstElementChild);
205
- var handleWindowResize = function handleWindowResize() {
206
- hasNativeScrollbarRef.current = getScrollbarWidth(false) > 0;
207
- scheduleUpdateThumbs();
208
- applyTrackStyles();
209
- };
210
- window.addEventListener('resize', handleWindowResize);
211
- return function () {
212
- observer.disconnect();
213
- window.removeEventListener('resize', handleWindowResize);
214
- };
215
- }, [scheduleUpdateThumbs, applyTrackStyles]);
216
- _react["default"].useEffect(function () {
217
- return function () {
218
- clearTimeout(scrollStopTimerRef.current);
219
- clearTimeout(hideTracksTimerRef.current);
220
- if (rafIdRef.current !== null) cancelAnimationFrame(rafIdRef.current);
221
- };
222
- }, []);
223
- var startDrag = _react["default"].useCallback(function (axis, event) {
224
- event.preventDefault();
225
- event.stopPropagation();
226
- var view = viewRef.current;
227
- if (!view) return;
228
- dragStateRef.current = {
229
- axis: axis,
230
- startClient: axis === 'vertical' ? event.clientY : event.clientX,
231
- startScroll: axis === 'vertical' ? view.scrollTop : view.scrollLeft,
232
- trackSize: axis === 'vertical' ? trackVerticalRef.current.clientHeight : trackHorizontalRef.current.clientWidth,
233
- thumbSize: axis === 'vertical' ? geometryRef.current.vertical.size : geometryRef.current.horizontal.size
234
- };
235
- document.body.style.userSelect = 'none';
236
- showTracksNow();
237
- var handleMouseMove = function handleMouseMove(moveEvent) {
238
- var drag = dragStateRef.current;
239
- if (!drag) return;
240
- var trackRange = drag.trackSize - drag.thumbSize;
241
- if (trackRange <= 0) return;
242
- var client = drag.axis === 'vertical' ? moveEvent.clientY : moveEvent.clientX;
243
- var delta = client - drag.startClient;
244
- if (drag.axis === 'vertical') {
245
- var scrollable = view.scrollHeight - view.clientHeight;
246
- view.scrollTop = drag.startScroll + delta / trackRange * scrollable;
247
- } else {
248
- var _scrollable = view.scrollWidth - view.clientWidth;
249
- view.scrollLeft = drag.startScroll + delta / trackRange * _scrollable;
250
- }
251
- };
252
- var handleMouseUp = function handleMouseUp() {
253
- dragStateRef.current = null;
254
- document.body.style.userSelect = '';
255
- document.removeEventListener('mousemove', handleMouseMove);
256
- document.removeEventListener('mouseup', handleMouseUp);
257
- scheduleHideTracks();
258
- };
259
- document.addEventListener('mousemove', handleMouseMove);
260
- document.addEventListener('mouseup', handleMouseUp);
261
- }, [showTracksNow, scheduleHideTracks]);
262
- var handleTrackMouseDown = _react["default"].useCallback(function (axis, event) {
263
- var thumbEl = axis === 'vertical' ? thumbVerticalRef.current : thumbHorizontalRef.current;
264
- if (event.target === thumbEl) return;
265
- var view = viewRef.current;
266
- var trackEl = axis === 'vertical' ? trackVerticalRef.current : trackHorizontalRef.current;
267
- if (!view || !trackEl) return;
268
- var rect = trackEl.getBoundingClientRect();
269
- var thumbSize = axis === 'vertical' ? geometryRef.current.vertical.size : geometryRef.current.horizontal.size;
270
- var trackSize = axis === 'vertical' ? trackEl.clientHeight : trackEl.clientWidth;
271
- var trackRange = trackSize - thumbSize;
272
- if (trackRange <= 0) return;
273
- var clickOffset = axis === 'vertical' ? event.clientY - rect.top : event.clientX - rect.left;
274
- var ratio = Math.min(Math.max((clickOffset - thumbSize / 2) / trackRange, 0), 1);
275
- if (axis === 'vertical') {
276
- view.scrollTop = ratio * (view.scrollHeight - view.clientHeight);
277
- } else {
278
- view.scrollLeft = ratio * (view.scrollWidth - view.clientWidth);
279
- }
280
- }, []);
281
- var handleTrackMouseEnter = _react["default"].useCallback(function () {
282
- trackMouseOverRef.current = true;
283
- showTracksNow();
284
- }, [showTracksNow]);
285
- var handleTrackMouseLeave = _react["default"].useCallback(function () {
286
- trackMouseOverRef.current = false;
287
- scheduleHideTracks();
288
- }, [scheduleHideTracks]);
289
- var handleKeyUpToScroll = _react["default"].useCallback(function (e) {
290
- var target = e.target;
291
- if (target.closest(INTERACTIVE_SELECTOR)) return;
292
- if (!viewRef.current) return;
293
- if (e.key === 'ArrowDown') viewRef.current.scrollTop = viewRef.current.scrollHeight;
294
- if (e.key === 'ArrowUp') viewRef.current.scrollTop = 0;
295
- }, []);
31
+ var scrollbar = _react["default"].useRef(null);
296
32
  _react["default"].useImperativeHandle(ref, function () {
297
33
  return {
298
34
  scrollToBottom: function scrollToBottom() {
299
- if (viewRef.current) viewRef.current.scrollTop = viewRef.current.scrollHeight;
35
+ scrollbar.current.scrollToBottom();
300
36
  },
301
37
  scrollToTop: function scrollToTop() {
302
- if (viewRef.current) viewRef.current.scrollTop = 0;
303
- },
304
- scrollToLeft: function scrollToLeft() {
305
- if (viewRef.current) viewRef.current.scrollLeft = 0;
306
- },
307
- scrollToRight: function scrollToRight() {
308
- if (viewRef.current) viewRef.current.scrollLeft = viewRef.current.scrollWidth;
38
+ scrollbar.current.scrollToTop();
309
39
  },
310
40
  getScrollHeight: function getScrollHeight() {
311
- return viewRef.current ? viewRef.current.scrollHeight : 0;
312
- },
313
- getScrollTop: function getScrollTop() {
314
- return viewRef.current ? viewRef.current.scrollTop : 0;
315
- },
316
- getScrollLeft: function getScrollLeft() {
317
- return viewRef.current ? viewRef.current.scrollLeft : 0;
318
- },
319
- getScrollWidth: function getScrollWidth() {
320
- return viewRef.current ? viewRef.current.scrollWidth : 0;
321
- },
322
- getClientHeight: function getClientHeight() {
323
- return viewRef.current ? viewRef.current.clientHeight : 0;
324
- },
325
- getClientWidth: function getClientWidth() {
326
- return viewRef.current ? viewRef.current.clientWidth : 0;
41
+ return scrollbar.current.getScrollHeight();
327
42
  },
328
43
  getValues: function getValues() {
329
- var view = viewRef.current;
330
- if (!view) {
331
- return {
332
- top: 0,
333
- left: 0,
334
- scrollTop: 0,
335
- scrollLeft: 0,
336
- scrollWidth: 0,
337
- scrollHeight: 0,
338
- clientWidth: 0,
339
- clientHeight: 0 // eslint-disable-line max-len
340
- };
341
- }
342
- var scrollTop = view.scrollTop,
343
- scrollLeft = view.scrollLeft,
344
- scrollWidth = view.scrollWidth,
345
- scrollHeight = view.scrollHeight,
346
- clientWidth = view.clientWidth,
347
- clientHeight = view.clientHeight;
348
- return {
349
- left: scrollLeft / (scrollWidth - clientWidth) || 0,
350
- top: scrollTop / (scrollHeight - clientHeight) || 0,
351
- scrollTop: scrollTop,
352
- scrollLeft: scrollLeft,
353
- scrollWidth: scrollWidth,
354
- scrollHeight: scrollHeight,
355
- clientWidth: clientWidth,
356
- clientHeight: clientHeight
357
- };
44
+ return scrollbar.current.getValues();
358
45
  }
359
46
  };
360
47
  }, []);
361
- return (
362
- /*#__PURE__*/
363
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
364
- _react["default"].createElement("div", {
365
- className: prefixClass("Scrollbar ".concat(classFix, " ").concat(horizontalScroll ? 'scrollbarBoth' : 'scrollbarOnlyY', " scrollbarFixHeight")),
366
- style: _objectSpread(_objectSpread({
367
- position: 'relative',
368
- overflow: 'hidden',
369
- width: '100%',
370
- height: '100%'
371
- }, style), stylesInLine),
372
- onKeyDown: handleKeyUpToScroll
373
- }, /*#__PURE__*/_react["default"].createElement("div", {
374
- ref: viewRef,
375
- className: prefixClass('cbx-scrollbarNew-view'),
376
- onScroll: handleScroll
377
- }, children), /*#__PURE__*/_react["default"].createElement("div", {
378
- ref: trackHorizontalRef,
379
- className: prefixClass('cbx-scrollbarNew-trackHorizontal'),
380
- style: {
381
- transitionDuration: autoHide ? "".concat(TRACK_FADE_DURATION, "ms") : '0ms'
382
- },
383
- onMouseEnter: handleTrackMouseEnter,
384
- onMouseLeave: handleTrackMouseLeave,
385
- onMouseDown: function onMouseDown(e) {
386
- return handleTrackMouseDown('horizontal', e);
387
- }
388
- }, /*#__PURE__*/_react["default"].createElement("div", {
389
- ref: thumbHorizontalRef,
390
- className: prefixClass('cbx-scrollbarNew-thumbHorizontal'),
391
- onMouseDown: function onMouseDown(e) {
392
- return startDrag('horizontal', e);
393
- }
394
- })), /*#__PURE__*/_react["default"].createElement("div", {
395
- ref: trackVerticalRef,
396
- className: prefixClass('cbx-scrollbarNew-trackVertical'),
397
- style: {
398
- transitionDuration: autoHide ? "".concat(TRACK_FADE_DURATION, "ms") : '0ms'
399
- },
400
- onMouseEnter: handleTrackMouseEnter,
401
- onMouseLeave: handleTrackMouseLeave,
402
- onMouseDown: function onMouseDown(e) {
403
- return handleTrackMouseDown('vertical', e);
404
- }
405
- }, /*#__PURE__*/_react["default"].createElement("div", {
406
- ref: thumbVerticalRef,
407
- className: prefixClass('cbx-scrollbarNew-thumbVertical'),
408
- onMouseDown: function onMouseDown(e) {
409
- return startDrag('vertical', e);
410
- }
411
- })))
412
- );
48
+ var handleKeyUpToScroll = _react["default"].useCallback(function (e) {
49
+ var interactiveSelector = 'input, select, textarea, button, [role="listbox"], [role="option"], [role="combobox"], [role="slider"], [role="tablist"], [role="tab"], [contenteditable="true"]';
50
+ var target = e.target;
51
+ if (target.closest(interactiveSelector)) {
52
+ return;
53
+ }
54
+ if (e.key === 'ArrowDown') {
55
+ var _scrollbar$current;
56
+ scrollbar === null || scrollbar === void 0 ? void 0 : (_scrollbar$current = scrollbar.current) === null || _scrollbar$current === void 0 ? void 0 : _scrollbar$current.scrollToBottom();
57
+ }
58
+ if (e.key === 'ArrowUp') {
59
+ var _scrollbar$current2;
60
+ scrollbar === null || scrollbar === void 0 ? void 0 : (_scrollbar$current2 = scrollbar.current) === null || _scrollbar$current2 === void 0 ? void 0 : _scrollbar$current2.scrollToTop();
61
+ }
62
+ }, []);
63
+ var style = props.style,
64
+ autoHide = props.autoHide,
65
+ children = props.children,
66
+ showX = props.showX,
67
+ onScrollStop = props.onScrollStop,
68
+ classFixProp = props.classFix,
69
+ _props$horizontalScro = props.horizontalScroll,
70
+ horizontalScroll = _props$horizontalScro === void 0 ? false : _props$horizontalScro;
71
+ var classFix = typeof classFixProp === 'string' ? classFixProp : '';
72
+ var extraClass = '';
73
+ if (classFix === 'scrollflex' && !(0, _getScrollbarWidth["default"])()) {
74
+ extraClass = 'macOSFlexFix';
75
+ }
76
+ return /*#__PURE__*/_react["default"].createElement(_reactCustomScrollbars.Scrollbars, _extends({
77
+ ref: scrollbar,
78
+ autoHide: autoHide,
79
+ className: prefixClass("Scrollbar ".concat(classFix, " ").concat(extraClass, " ").concat(horizontalScroll ? 'scrollbarBoth' : 'scrollbarOnlyY', " scrollbarFixHeight")),
80
+ onScrollStop: onScrollStop,
81
+ onKeyDown: handleKeyUpToScroll,
82
+ style: _objectSpread(_objectSpread({
83
+ width: '100%',
84
+ height: '100%'
85
+ }, style), stylesInLine)
86
+ }, !showX ? {
87
+ renderTrackHorizontal: function renderTrackHorizontal(scrollbarProps) {
88
+ return /*#__PURE__*/_react["default"].createElement("div", _extends({
89
+ style: {
90
+ display: 'hidden'
91
+ }
92
+ }, scrollbarProps));
93
+ },
94
+ renderThumbHorizontal: function renderThumbHorizontal(scrollbarProps) {
95
+ return /*#__PURE__*/_react["default"].createElement("div", _extends({
96
+ style: {
97
+ display: 'hidden'
98
+ }
99
+ }, scrollbarProps));
100
+ }
101
+ } : {}), children);
413
102
  });
414
- Scrollbar.propTypes = {
415
- style: _propTypes["default"].object,
416
- sx: _propTypes["default"].object,
417
- autoHide: _propTypes["default"].bool,
418
- showX: _propTypes["default"].bool,
419
- horizontalScroll: _propTypes["default"].bool,
420
- classFix: _propTypes["default"].string,
421
- onScrollStop: _propTypes["default"].func,
422
- prefixClass: _propTypes["default"].func,
423
- children: _propTypes["default"].node
424
- };
425
103
  var _default = Scrollbar;
426
104
  exports["default"] = _default;
@@ -164,18 +164,22 @@ var SelectInput = function SelectInput(_ref) {
164
164
  var updateDropdownPosition = function updateDropdownPosition() {
165
165
  if (selectRef.current && dropdownRef.current) {
166
166
  var _selectRef$current$cl;
167
+ var viewportMargin = 16;
167
168
  var inputText = selectRef.current;
168
169
  var inputRect = inputText.getBoundingClientRect();
169
- var dropdownHeight = dropdownRef.current.offsetHeight;
170
- var isOverflowingBelow = inputRect.bottom + dropdownHeight > window.innerHeight;
171
- var topPosition = isOverflowingBelow ? window.innerHeight - dropdownHeight : inputRect.bottom;
172
170
  var containerRect = ((_selectRef$current$cl = selectRef.current.closest('.cbx-selectInput-options-container')) === null || _selectRef$current$cl === void 0 ? void 0 : _selectRef$current$cl.getBoundingClientRect()) || {
173
171
  top: 0,
174
172
  left: 0
175
173
  };
176
- dropdownRef.current.style.top = "".concat(topPosition - containerRect.top, "px");
177
- dropdownRef.current.style.left = "".concat(inputRect.left - containerRect.left, "px");
178
174
  dropdownRef.current.style.width = "".concat(inputRect.width, "px");
175
+ var dropdownHeight = dropdownRef.current.offsetHeight;
176
+ var dropdownWidth = dropdownRef.current.offsetWidth;
177
+ var isOverflowingBelow = inputRect.bottom + dropdownHeight > window.innerHeight - viewportMargin;
178
+ var topPosition = Math.max(viewportMargin, isOverflowingBelow ? window.innerHeight - dropdownHeight - viewportMargin : inputRect.bottom);
179
+ var isOverflowingRight = inputRect.left + dropdownWidth > window.innerWidth - viewportMargin;
180
+ var leftPosition = Math.max(viewportMargin, Math.min(isOverflowingRight ? inputRect.right - dropdownWidth : inputRect.left, window.innerWidth - dropdownWidth - viewportMargin));
181
+ dropdownRef.current.style.top = "".concat(topPosition - containerRect.top, "px");
182
+ dropdownRef.current.style.left = "".concat(leftPosition - containerRect.left, "px");
179
183
  }
180
184
  };
181
185
  _react["default"].useEffect(function () {
@@ -239,7 +243,9 @@ var SelectInput = function SelectInput(_ref) {
239
243
  return renderValue(value);
240
244
  }
241
245
  if (multiple && Array.isArray(selectedOption)) {
242
- return value.join(', ');
246
+ return Array.isArray(value) ? value.join(', ') : selectedOption.map(function (option) {
247
+ return option.value;
248
+ }).join(', ');
243
249
  }
244
250
  return (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.children) || '';
245
251
  };
@@ -43,7 +43,7 @@ var extractText = function extractText(child) {
43
43
  }, '');
44
44
  };
45
45
  var Stepper = function Stepper(_ref) {
46
- var items = _ref.items,
46
+ var itemsProp = _ref.items,
47
47
  active = _ref.active,
48
48
  onClick = _ref.onClick,
49
49
  _ref$freeNavigation = _ref.freeNavigation,
@@ -58,6 +58,7 @@ var Stepper = function Stepper(_ref) {
58
58
  prefixClass = _useDynamicStyles.prefixClass;
59
59
  var _useA11yGuard = (0, _useA11yGuard2.useA11yGuard)(),
60
60
  requireAccessibleText = _useA11yGuard.requireAccessibleText;
61
+ var items = Array.isArray(itemsProp) ? itemsProp : [];
61
62
  requireAccessibleText(ariaLabel, {
62
63
  component: 'Stepper',
63
64
  prop: '"ariaLabel"',
@@ -34,6 +34,7 @@ var TableRow = function TableRow(_ref) {
34
34
  dynamicPrefixClass = _useDynamicStyles.prefixClass;
35
35
  var prefixClass = propPrefixClass || dynamicPrefixClass;
36
36
  var handleKeyDown = function handleKeyDown(e) {
37
+ if (e.target !== e.currentTarget) return;
37
38
  if (onClick && (e.key === 'Enter' || e.key === ' ')) {
38
39
  e.preventDefault();
39
40
  onClick(e);
@@ -30,7 +30,7 @@ var SEVERITY_CONFIG = {
30
30
  label: 'Éxito'
31
31
  },
32
32
  error: {
33
- icon: 'ri-close-circle-fill',
33
+ icon: 'ri-error-warning-line',
34
34
  label: 'Error'
35
35
  },
36
36
  warning: {