@rocket.chat/fuselage 0.31.6-dev.1 → 0.31.6

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 (28) hide show
  1. package/LICENSE +21 -0
  2. package/dist/components/{SelectPaginated → PaginatedSelect}/PaginatedMultiSelect.d.ts +0 -0
  3. package/dist/components/{SelectPaginated → PaginatedSelect}/PaginatedMultiSelect.d.ts.map +1 -1
  4. package/dist/components/{SelectPaginated → PaginatedSelect}/PaginatedSelect.d.ts +1 -1
  5. package/dist/components/PaginatedSelect/PaginatedSelect.d.ts.map +1 -0
  6. package/dist/components/PaginatedSelect/PaginatedSelectAddon.d.ts +7 -0
  7. package/dist/components/PaginatedSelect/PaginatedSelectAddon.d.ts.map +1 -0
  8. package/dist/components/PaginatedSelect/PaginatedSelectFiltered.d.ts +7 -0
  9. package/dist/components/PaginatedSelect/PaginatedSelectFiltered.d.ts.map +1 -0
  10. package/dist/components/PaginatedSelect/PaginatedSelectFocus.d.ts +7 -0
  11. package/dist/components/PaginatedSelect/PaginatedSelectFocus.d.ts.map +1 -0
  12. package/dist/components/PaginatedSelect/PaginatedSelectWrapper.d.ts +7 -0
  13. package/dist/components/PaginatedSelect/PaginatedSelectWrapper.d.ts.map +1 -0
  14. package/dist/components/PaginatedSelect/index.d.ts +3 -0
  15. package/dist/components/PaginatedSelect/index.d.ts.map +1 -0
  16. package/dist/components/index.d.ts +1 -1
  17. package/dist/fuselage.development.js +890 -818
  18. package/dist/fuselage.development.js.map +1 -1
  19. package/dist/fuselage.production.js +1 -1
  20. package/package.json +17 -17
  21. package/CHANGELOG.md +0 -705
  22. package/dist/components/SelectPaginated/PaginatedSelect.d.ts.map +0 -1
  23. package/dist/components/SelectPaginated/PaginatedSelectFiltered.d.ts +0 -5
  24. package/dist/components/SelectPaginated/PaginatedSelectFiltered.d.ts.map +0 -1
  25. package/dist/components/SelectPaginated/hugeList.d.ts +0 -5
  26. package/dist/components/SelectPaginated/hugeList.d.ts.map +0 -1
  27. package/dist/components/SelectPaginated/index.d.ts +0 -4
  28. package/dist/components/SelectPaginated/index.d.ts.map +0 -1
@@ -11862,21 +11862,34 @@ __webpack_require__.r(__webpack_exports__);
11862
11862
 
11863
11863
  /***/ }),
11864
11864
 
11865
- /***/ "./src/components/Pagination/Pagination.tsx":
11866
- /*!**************************************************!*\
11867
- !*** ./src/components/Pagination/Pagination.tsx ***!
11868
- \**************************************************/
11865
+ /***/ "./src/components/PaginatedSelect/PaginatedMultiSelect.tsx":
11866
+ /*!*****************************************************************!*\
11867
+ !*** ./src/components/PaginatedSelect/PaginatedMultiSelect.tsx ***!
11868
+ \*****************************************************************/
11869
11869
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
11870
11870
 
11871
11871
  "use strict";
11872
11872
  __webpack_require__.r(__webpack_exports__);
11873
11873
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11874
- /* harmony export */ "Pagination": function() { return /* binding */ Pagination; }
11874
+ /* harmony export */ "PaginatedMultiSelect": function() { return /* binding */ PaginatedMultiSelect; },
11875
+ /* harmony export */ "PaginatedMultiSelectFiltered": function() { return /* binding */ PaginatedMultiSelectFiltered; }
11875
11876
  /* harmony export */ });
11876
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
11877
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
11878
- /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
11879
- /* harmony import */ var _Chevron__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Chevron */ "./src/components/Chevron/index.tsx");
11877
+ /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
11878
+ /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__);
11879
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
11880
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
11881
+ /* harmony import */ var _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../AnimatedVisibility */ "./src/components/AnimatedVisibility/index.ts");
11882
+ /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
11883
+ /* harmony import */ var _Chip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Chip */ "./src/components/Chip/index.ts");
11884
+ /* harmony import */ var _Flex__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Flex */ "./src/components/Flex/index.ts");
11885
+ /* harmony import */ var _Icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts");
11886
+ /* harmony import */ var _InputBox__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
11887
+ /* harmony import */ var _Margins__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Margins */ "./src/components/Margins/index.ts");
11888
+ /* harmony import */ var _Options_useVisible__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../Options/useVisible */ "./src/components/Options/useVisible.ts");
11889
+ /* harmony import */ var _OptionsPaginated__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../OptionsPaginated */ "./src/components/OptionsPaginated/index.ts");
11890
+ /* harmony import */ var _Position__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../Position */ "./src/components/Position/index.ts");
11891
+ /* harmony import */ var _Select_SelectAddon__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../Select/SelectAddon */ "./src/components/Select/SelectAddon.tsx");
11892
+ /* harmony import */ var _Select_SelectFocus__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../Select/SelectFocus */ "./src/components/Select/SelectFocus.tsx");
11880
11893
  var __assign = (undefined && undefined.__assign) || function () {
11881
11894
  __assign = Object.assign || function(t) {
11882
11895
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -11899,102 +11912,149 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
11899
11912
  }
11900
11913
  return t;
11901
11914
  };
11915
+ var __read = (undefined && undefined.__read) || function (o, n) {
11916
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
11917
+ if (!m) return o;
11918
+ var i = m.call(o), r, ar = [], e;
11919
+ try {
11920
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
11921
+ }
11922
+ catch (error) { e = { error: error }; }
11923
+ finally {
11924
+ try {
11925
+ if (r && !r.done && (m = i["return"])) m.call(i);
11926
+ }
11927
+ finally { if (e) throw e.error; }
11928
+ }
11929
+ return ar;
11930
+ };
11931
+ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {
11932
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
11933
+ to[j] = from[i];
11934
+ return to;
11935
+ };
11936
+ // @ts-nocheck
11902
11937
 
11903
11938
 
11904
11939
 
11905
- var defaultItemsPerPageLabel = function () { return 'Items per page:'; };
11906
- var defaultShowingResultsLabel = function (_a) {
11907
- var count = _a.count, current = _a.current, itemsPerPage = _a.itemsPerPage;
11908
- return "Showing results " + (current + 1) + " - " + Math.min(current + itemsPerPage, count) + " of " + count;
11940
+
11941
+
11942
+
11943
+
11944
+
11945
+
11946
+
11947
+
11948
+
11949
+
11950
+
11951
+ var SelectedOptions = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(function (props) { return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Chip__WEBPACK_IMPORTED_MODULE_4__["default"], __assign({ maxWidth: '150px', withTruncatedText: true }, props))); });
11952
+ var prevent = function (e) {
11953
+ e.preventDefault();
11954
+ e.stopPropagation();
11955
+ e.nativeEvent.stopImmediatePropagation();
11909
11956
  };
11910
- var Pagination = function (_a) {
11911
- var count = _a.count, _b = _a.current, current = _b === void 0 ? 0 : _b, _c = _a.itemsPerPage, itemsPerPage = _c === void 0 ? 25 : _c, _d = _a.itemsPerPageLabel, itemsPerPageLabel = _d === void 0 ? defaultItemsPerPageLabel : _d, _e = _a.showingResultsLabel, showingResultsLabel = _e === void 0 ? defaultShowingResultsLabel : _e, onSetItemsPerPage = _a.onSetItemsPerPage, onSetCurrent = _a.onSetCurrent, divider = _a.divider, props = __rest(_a, ["count", "current", "itemsPerPage", "itemsPerPageLabel", "showingResultsLabel", "onSetItemsPerPage", "onSetCurrent", "divider"]);
11912
- var itemsPerPageOptions = [25, 50, 100].filter(function (i) { return i <= count; });
11913
- var hasItemsPerPageSelection = itemsPerPageOptions.length > 1;
11914
- var currentPage = Math.floor(current / itemsPerPage);
11915
- var pages = Math.ceil(count / itemsPerPage);
11916
- var displayedPages = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
11917
- if (pages <= 7) {
11918
- // 0 1 2 3 4 5 6
11919
- return Array.from({ length: pages }, function (_, i) { return i; });
11957
+ var PaginatedMultiSelect = function (_a) {
11958
+ var withTitle = _a.withTitle, value = _a.value, filter = _a.filter, _b = _a.options, options = _b === void 0 ? [] : _b, error = _a.error, disabled = _a.disabled, _c = _a.anchor, Anchor = _c === void 0 ? _Select_SelectFocus__WEBPACK_IMPORTED_MODULE_13__["default"] : _c, _d = _a.onChange, onChange = _d === void 0 ? function () { } : _d, placeholder = _a.placeholder, _e = _a.renderOptions, _Options = _e === void 0 ? _OptionsPaginated__WEBPACK_IMPORTED_MODULE_10__.OptionsPaginated : _e, endReached = _a.endReached, props = __rest(_a, ["withTitle", "value", "filter", "options", "error", "disabled", "anchor", "onChange", "placeholder", "renderOptions", "endReached"]);
11959
+ var _f = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(value || []), 2), internalValue = _f[0], setInternalValue = _f[1];
11960
+ var currentValue = value !== undefined ? value : internalValue;
11961
+ var option = options.find(function (option) { return option.value === currentValue; });
11962
+ var internalChanged = function (_a) {
11963
+ var _b = __read(_a, 1), value = _b[0];
11964
+ if (currentValue.some(function (item) { return item.value === value.value; })) {
11965
+ var newValue_1 = currentValue.filter(function (item) { return item.value !== value.value; });
11966
+ setInternalValue(newValue_1);
11967
+ return onChange(newValue_1);
11920
11968
  }
11921
- if (currentPage < 5) {
11922
- // 0 1 2 3 4 ... N
11923
- return [0, 1, 2, 3, 4, '⋯', pages - 1];
11969
+ var newValue = __spreadArray(__spreadArray([], __read(currentValue)), [value]);
11970
+ setInternalValue(newValue);
11971
+ return onChange(newValue);
11972
+ };
11973
+ var _g = __read((0,_Options_useVisible__WEBPACK_IMPORTED_MODULE_9__.useVisible)(), 3), visible = _g[0], hide = _g[1], show = _g[2];
11974
+ var ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
11975
+ var _h = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useResizeObserver)(), containerRef = _h.ref, borderBoxSize = _h.borderBoxSize;
11976
+ var handleClick = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(function () {
11977
+ if (visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__["default"].VISIBLE) {
11978
+ return hide();
11924
11979
  }
11925
- if (currentPage > pages - 5) {
11926
- // 0 ... N-4 N-3 N-2 N-1 N
11927
- return [0, '⋯', pages - 5, pages - 4, pages - 3, pages - 2, pages - 1];
11980
+ if (ref && ref.current) {
11981
+ ref.current.focus();
11982
+ return show();
11928
11983
  }
11929
- // 0 ... x-1 x x-2 ... N
11930
- return [
11931
- 0,
11932
- '',
11933
- currentPage - 1,
11934
- currentPage,
11935
- currentPage + 1,
11936
- '',
11937
- pages - 1,
11938
- ];
11939
- }, [pages, currentPage]);
11940
- var renderingContext = { count: count, pages: pages, current: current, currentPage: currentPage, itemsPerPage: itemsPerPage };
11941
- var handleSetItemsPerPageLinkClick = function (itemsPerPageOption) { return function () {
11942
- onSetItemsPerPage === null || onSetItemsPerPage === void 0 ? void 0 : onSetItemsPerPage(itemsPerPageOption);
11943
- }; };
11944
- var handleSetPageLinkClick = function (page) { return function () {
11945
- onSetCurrent === null || onSetCurrent === void 0 ? void 0 : onSetCurrent(page * itemsPerPage);
11946
- }; };
11947
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, __assign({ is: 'nav', "rcx-pagination": true, "rcx-pagination--divider": divider }, props),
11948
- hasItemsPerPageSelection && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { "rcx-pagination__left": true },
11949
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'span', "rcx-pagination__label": true }, itemsPerPageLabel(renderingContext)),
11950
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'ol', "rcx-pagination__list": true }, itemsPerPageOptions.map(function (itemsPerPageOption) { return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { key: itemsPerPageOption, is: 'li', "rcx-pagination__list-item": true },
11951
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'button', "rcx-pagination__link": true, tabIndex: itemsPerPage === itemsPerPageOption ? -1 : 0, disabled: itemsPerPage === itemsPerPageOption, onClick: handleSetItemsPerPageLinkClick(itemsPerPageOption) }, itemsPerPageOption))); })))),
11952
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { "rcx-pagination__right": true },
11953
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'span', "rcx-pagination__label": true }, showingResultsLabel(renderingContext)),
11954
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'ol', "rcx-pagination__list": true },
11955
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'li', "rcx-pagination__list-item": true },
11956
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'button', "rcx-pagination__back": true, disabled: currentPage === 0, onClick: handleSetPageLinkClick(currentPage - 1) },
11957
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Chevron__WEBPACK_IMPORTED_MODULE_2__.Chevron, { left: true, size: 'x16' }))),
11958
- displayedPages.map(function (page, i) { return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { key: i, is: 'li', "rcx-pagination__list-item": true }, page === '⋯' ? ('⋯') : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'button', "rcx-pagination__link": true, disabled: currentPage === page, onClick: handleSetPageLinkClick(page) }, page + 1)))); }),
11959
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'li', "rcx-pagination__list-item": true },
11960
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'button', "rcx-pagination__forward": true, disabled: currentPage === pages - 1, onClick: handleSetPageLinkClick(currentPage + 1) },
11961
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Chevron__WEBPACK_IMPORTED_MODULE_2__.Chevron, { right: true, size: 'x16' })))))));
11984
+ });
11985
+ return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_3__.Box, __assign({ is: 'div', "rcx-select": true, className: [error && 'invalid', disabled && 'disabled'], ref: containerRef, onClick: handleClick, disabled: disabled }, props),
11986
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Flex__WEBPACK_IMPORTED_MODULE_5__["default"].Item, { grow: 1 },
11987
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Margins__WEBPACK_IMPORTED_MODULE_8__["default"], { inline: 'x4' },
11988
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Flex__WEBPACK_IMPORTED_MODULE_5__["default"].Container, null,
11989
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_3__.Box, { is: 'div' },
11990
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_3__.Box, { is: 'div', display: 'flex', alignItems: 'center', flexWrap: 'wrap', margin: '-x8', role: 'listbox' },
11991
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Margins__WEBPACK_IMPORTED_MODULE_8__["default"], { all: 'x4' },
11992
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Anchor, { disabled: disabled, ref: ref, "aria-haspopup": 'listbox', onClick: show, onBlur: hide, order: 1, "rcx-input-box--undecorated": true, children: !value ? option || placeholder : null }),
11993
+ currentValue.map(function (value, index) {
11994
+ var _a, _b;
11995
+ return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(SelectedOptions, __assign({}, (withTitle && {
11996
+ title: value.label ||
11997
+ ((_a = options.find(function (val) {
11998
+ return val.value === value;
11999
+ })) === null || _a === void 0 ? void 0 : _a.label),
12000
+ }), { tabIndex: -1, role: 'option', key: index, onMouseDown: function (e) {
12001
+ prevent(e);
12002
+ internalChanged([value]);
12003
+ return false;
12004
+ }, children: value.label ||
12005
+ ((_b = options.find(function (val) {
12006
+ return val.value === value;
12007
+ })) === null || _b === void 0 ? void 0 : _b.label) })));
12008
+ }))))))),
12009
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Flex__WEBPACK_IMPORTED_MODULE_5__["default"].Item, { grow: 0, shrink: 0 },
12010
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Margins__WEBPACK_IMPORTED_MODULE_8__["default"], { inline: 'x4' },
12011
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Select_SelectAddon__WEBPACK_IMPORTED_MODULE_12__["default"], { children: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Icon__WEBPACK_IMPORTED_MODULE_6__.Icon, { name: visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__["default"].VISIBLE
12012
+ ? 'cross'
12013
+ : 'chevron-down', size: 'x20' }) }))),
12014
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__["default"], { visibility: visible },
12015
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Position__WEBPACK_IMPORTED_MODULE_11__["default"], { anchor: containerRef },
12016
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Options, __assign({}, (withTitle && { title: withTitle }), { width: borderBoxSize.inlineSize, onMouseDown: prevent, multiple: true, filter: filter, role: 'listbox', options: options, onSelect: internalChanged, endReached: endReached }))))));
12017
+ };
12018
+ var PaginatedMultiSelectFiltered = function (_a) {
12019
+ var filter = _a.filter, setFilter = _a.setFilter, options = _a.options, placeholder = _a.placeholder, props = __rest(_a, ["filter", "setFilter", "options", "placeholder"]);
12020
+ var anchor = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (_a, ref) {
12021
+ var _children = _a.children, filter = _a.filter, props = __rest(_a, ["children", "filter"]);
12022
+ return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Flex__WEBPACK_IMPORTED_MODULE_5__["default"].Item, { grow: 1 },
12023
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_7__.InputBox.Input, __assign({ ref: ref, placeholder: placeholder, value: filter, onInput: function (e) {
12024
+ return setFilter &&
12025
+ setFilter(e.currentTarget.value);
12026
+ } }, props, { "rcx-input-box--undecorated": true }))));
12027
+ }), []);
12028
+ return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(PaginatedMultiSelect, __assign({ filter: filter, options: options }, props, { anchor: anchor })));
11962
12029
  };
11963
12030
 
11964
12031
 
11965
12032
  /***/ }),
11966
12033
 
11967
- /***/ "./src/components/Pagination/index.ts":
11968
- /*!********************************************!*\
11969
- !*** ./src/components/Pagination/index.ts ***!
11970
- \********************************************/
12034
+ /***/ "./src/components/PaginatedSelect/PaginatedSelect.tsx":
12035
+ /*!************************************************************!*\
12036
+ !*** ./src/components/PaginatedSelect/PaginatedSelect.tsx ***!
12037
+ \************************************************************/
11971
12038
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
11972
12039
 
11973
12040
  "use strict";
11974
12041
  __webpack_require__.r(__webpack_exports__);
11975
12042
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11976
- /* harmony export */ "Pagination": function() { return /* reexport safe */ _Pagination__WEBPACK_IMPORTED_MODULE_0__.Pagination; }
12043
+ /* harmony export */ "PaginatedSelect": function() { return /* binding */ PaginatedSelect; }
11977
12044
  /* harmony export */ });
11978
- /* harmony import */ var _Pagination__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Pagination */ "./src/components/Pagination/Pagination.tsx");
11979
-
11980
-
11981
-
11982
- /***/ }),
11983
-
11984
- /***/ "./src/components/PasswordInput/PasswordInput.tsx":
11985
- /*!********************************************************!*\
11986
- !*** ./src/components/PasswordInput/PasswordInput.tsx ***!
11987
- \********************************************************/
11988
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
11989
-
11990
- "use strict";
11991
- __webpack_require__.r(__webpack_exports__);
11992
12045
  /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
11993
12046
  /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__);
11994
12047
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
11995
12048
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
11996
- /* harmony import */ var _Icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts");
11997
- /* harmony import */ var _InputBox__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
12049
+ /* harmony import */ var _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../AnimatedVisibility */ "./src/components/AnimatedVisibility/index.ts");
12050
+ /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
12051
+ /* harmony import */ var _Icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts");
12052
+ /* harmony import */ var _Options_useVisible__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Options/useVisible */ "./src/components/Options/useVisible.ts");
12053
+ /* harmony import */ var _OptionsPaginated__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../OptionsPaginated */ "./src/components/OptionsPaginated/index.ts");
12054
+ /* harmony import */ var _PositionAnimated__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../PositionAnimated */ "./src/components/PositionAnimated/index.ts");
12055
+ /* harmony import */ var _PaginatedSelectAddon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./PaginatedSelectAddon */ "./src/components/PaginatedSelect/PaginatedSelectAddon.tsx");
12056
+ /* harmony import */ var _PaginatedSelectFocus__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./PaginatedSelectFocus */ "./src/components/PaginatedSelect/PaginatedSelectFocus.tsx");
12057
+ /* harmony import */ var _PaginatedSelectWrapper__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./PaginatedSelectWrapper */ "./src/components/PaginatedSelect/PaginatedSelectWrapper.tsx");
11998
12058
  var __assign = (undefined && undefined.__assign) || function () {
11999
12059
  __assign = Object.assign || function(t) {
12000
12060
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -12006,6 +12066,17 @@ var __assign = (undefined && undefined.__assign) || function () {
12006
12066
  };
12007
12067
  return __assign.apply(this, arguments);
12008
12068
  };
12069
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
12070
+ var t = {};
12071
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
12072
+ t[p] = s[p];
12073
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
12074
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
12075
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
12076
+ t[p[i]] = s[p[i]];
12077
+ }
12078
+ return t;
12079
+ };
12009
12080
  var __read = (undefined && undefined.__read) || function (o, n) {
12010
12081
  var m = typeof Symbol === "function" && o[Symbol.iterator];
12011
12082
  if (!m) return o;
@@ -12022,53 +12093,84 @@ var __read = (undefined && undefined.__read) || function (o, n) {
12022
12093
  }
12023
12094
  return ar;
12024
12095
  };
12096
+ // @ts-nocheck
12025
12097
 
12026
12098
 
12027
12099
 
12028
12100
 
12029
- var PasswordInput = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function PasswordInput(props, ref) {
12030
- var _a = __read((0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useToggle)(true), 2), hidden = _a[0], toggle = _a[1];
12031
- var handleAddonClick = function () {
12032
- toggle();
12033
- };
12034
- return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_3__.InputBox, __assign({ type: hidden ? 'password' : 'text', addon: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Icon__WEBPACK_IMPORTED_MODULE_2__.Icon, { name: hidden ? 'eye-off' : 'eye', size: 20, onClick: handleAddonClick }), ref: ref }, props)));
12035
- });
12036
- /* harmony default export */ __webpack_exports__["default"] = (PasswordInput);
12037
-
12038
12101
 
12039
- /***/ }),
12040
12102
 
12041
- /***/ "./src/components/PasswordInput/index.ts":
12042
- /*!***********************************************!*\
12043
- !*** ./src/components/PasswordInput/index.ts ***!
12044
- \***********************************************/
12045
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12046
12103
 
12047
- "use strict";
12048
- __webpack_require__.r(__webpack_exports__);
12049
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12050
- /* harmony export */ "default": function() { return /* reexport safe */ _PasswordInput__WEBPACK_IMPORTED_MODULE_0__["default"]; }
12051
- /* harmony export */ });
12052
- /* harmony import */ var _PasswordInput__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PasswordInput */ "./src/components/PasswordInput/PasswordInput.tsx");
12053
12104
 
12054
12105
 
12055
12106
 
12056
- /***/ }),
12057
12107
 
12058
- /***/ "./src/components/Position/Position.tsx":
12059
- /*!**********************************************!*\
12060
- !*** ./src/components/Position/Position.tsx ***!
12061
- \**********************************************/
12108
+ var prevent = function (e) {
12109
+ e.preventDefault();
12110
+ e.stopPropagation();
12111
+ e.nativeEvent.stopImmediatePropagation();
12112
+ };
12113
+ var useDidUpdate = function (func) {
12114
+ var didMount = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);
12115
+ var fn = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(func);
12116
+ (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
12117
+ if (didMount.current) {
12118
+ fn();
12119
+ }
12120
+ didMount.current = true;
12121
+ }, [fn]);
12122
+ };
12123
+ var PaginatedSelect = function (_a) {
12124
+ var value = _a.value, withTitle = _a.withTitle, filter = _a.filter, _setFilter = _a.setFilter, error = _a.error, disabled = _a.disabled, _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.anchor, Anchor = _c === void 0 ? _PaginatedSelectFocus__WEBPACK_IMPORTED_MODULE_9__["default"] : _c, _d = _a.onChange, onChange = _d === void 0 ? function () { } : _d, _e = _a.placeholder, placeholder = _e === void 0 ? '' : _e, _f = _a.renderOptions, _Options = _f === void 0 ? _OptionsPaginated__WEBPACK_IMPORTED_MODULE_6__.OptionsPaginated : _f, endReached = _a.endReached, props = __rest(_a, ["value", "withTitle", "filter", "setFilter", "error", "disabled", "options", "anchor", "onChange", "placeholder", "renderOptions", "endReached"]);
12125
+ var _g = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(value), 2), internalValue = _g[0], setInternalValue = _g[1];
12126
+ var currentValue = value !== undefined ? value : internalValue;
12127
+ var option = options.find(function (option) { return (option === null || option === void 0 ? void 0 : option.value) === currentValue; });
12128
+ var _h = __read((0,_Options_useVisible__WEBPACK_IMPORTED_MODULE_5__.useVisible)(), 3), visible = _h[0], hide = _h[1], show = _h[2];
12129
+ var internalChangedByClick = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(function (_a) {
12130
+ var _b = __read(_a, 1), value = _b[0];
12131
+ setInternalValue(value);
12132
+ onChange(value);
12133
+ hide();
12134
+ });
12135
+ var ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
12136
+ var _j = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useResizeObserver)(), containerRef = _j.ref, borderBoxSize = _j.borderBoxSize;
12137
+ useDidUpdate([filter, internalValue]);
12138
+ var valueLabel = option === null || option === void 0 ? void 0 : option.label;
12139
+ var visibleText = (filter === undefined || visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__["default"].HIDDEN) &&
12140
+ (valueLabel || placeholder || typeof placeholder === 'string');
12141
+ var handleClick = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(function () {
12142
+ if (visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__["default"].VISIBLE) {
12143
+ return hide();
12144
+ }
12145
+ if (ref && ref.current) {
12146
+ ref.current.focus();
12147
+ return show();
12148
+ }
12149
+ });
12150
+ return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_3__.Box, __assign({ "rcx-select": true, disabled: disabled, ref: containerRef, onClick: handleClick, className: (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () { return [error && 'invalid', disabled && 'disabled']; }, [error, disabled]) }, props),
12151
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_PaginatedSelectWrapper__WEBPACK_IMPORTED_MODULE_10__["default"], { display: 'flex', mi: 'neg-x4', "rcx-select__wrapper--hidden": !!visibleText },
12152
+ visibleText && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_3__.Box, { flexGrow: 1, is: 'span', mi: 'x4', "rcx-select__item": true, fontScale: 'p2m', color: valueLabel ? 'default' : 'hint' }, visibleText)),
12153
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Anchor, { disabled: disabled, "rcx-input-box--undecorated": true, filter: filter, ref: ref, "aria-haspopup": 'listbox', onClick: show, onBlur: hide }),
12154
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_PaginatedSelectAddon__WEBPACK_IMPORTED_MODULE_8__["default"], { mi: 'x4' },
12155
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Icon__WEBPACK_IMPORTED_MODULE_4__.Icon, { name: visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__["default"].VISIBLE ? 'cross' : 'chevron-down', size: 'x20' }))),
12156
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_PositionAnimated__WEBPACK_IMPORTED_MODULE_7__["default"], { visible: visible, anchor: containerRef },
12157
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Options, __assign({}, (withTitle && { title: withTitle }), { width: borderBoxSize.inlineSize, role: 'listbox', filter: filter, options: options, onSelect: internalChangedByClick, endReached: endReached, onMouseDown: prevent })))));
12158
+ };
12159
+
12160
+
12161
+ /***/ }),
12162
+
12163
+ /***/ "./src/components/PaginatedSelect/PaginatedSelectAddon.tsx":
12164
+ /*!*****************************************************************!*\
12165
+ !*** ./src/components/PaginatedSelect/PaginatedSelectAddon.tsx ***!
12166
+ \*****************************************************************/
12062
12167
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12063
12168
 
12064
12169
  "use strict";
12065
12170
  __webpack_require__.r(__webpack_exports__);
12066
- /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
12067
- /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__);
12068
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
12069
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
12070
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "react-dom");
12071
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
12171
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
12172
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
12173
+ /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
12072
12174
  var __assign = (undefined && undefined.__assign) || function () {
12073
12175
  __assign = Object.assign || function(t) {
12074
12176
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -12080,71 +12182,33 @@ var __assign = (undefined && undefined.__assign) || function () {
12080
12182
  };
12081
12183
  return __assign.apply(this, arguments);
12082
12184
  };
12083
- var __rest = (undefined && undefined.__rest) || function (s, e) {
12084
- var t = {};
12085
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
12086
- t[p] = s[p];
12087
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
12088
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
12089
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
12090
- t[p[i]] = s[p[i]];
12091
- }
12092
- return t;
12093
- };
12094
12185
 
12095
12186
 
12096
-
12097
- var Position = function (_a) {
12098
- var anchor = _a.anchor, children = _a.children, placement = _a.placement, margin = _a.margin, _className = _a.className, props = __rest(_a, ["anchor", "children", "placement", "margin", "className"]);
12099
- var target = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
12100
- var _b = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.usePosition)(anchor, target, (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () { return ({ placement: placement, margin: margin }); }, [placement, margin])) || {}, positionStyle = _b.style, positionPlacement = _b.placement;
12101
- var style = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () { return (__assign({ position: 'fixed' }, positionStyle)); }, [positionStyle]);
12102
- var portalContainer = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
12103
- var element = document.createElement('div');
12104
- document.body.appendChild(element);
12105
- return element;
12106
- }, []);
12107
- (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
12108
- return function () {
12109
- document.body.removeChild(portalContainer);
12110
- };
12111
- }, [portalContainer]);
12112
- return (0,react_dom__WEBPACK_IMPORTED_MODULE_2__.createPortal)((0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(children, __assign(__assign({ ref: target, style: style }, props), { placement: positionPlacement })), portalContainer);
12113
- };
12114
- /* harmony default export */ __webpack_exports__["default"] = (Position);
12187
+ var PaginatedSelectAddon = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function PaginatedSelectAddon(props, ref) {
12188
+ return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, __assign({ is: 'div', "rcx-select__addon": true, ref: ref }, props));
12189
+ });
12190
+ /* harmony default export */ __webpack_exports__["default"] = (PaginatedSelectAddon);
12115
12191
 
12116
12192
 
12117
12193
  /***/ }),
12118
12194
 
12119
- /***/ "./src/components/Position/index.ts":
12120
- /*!******************************************!*\
12121
- !*** ./src/components/Position/index.ts ***!
12122
- \******************************************/
12195
+ /***/ "./src/components/PaginatedSelect/PaginatedSelectFiltered.tsx":
12196
+ /*!********************************************************************!*\
12197
+ !*** ./src/components/PaginatedSelect/PaginatedSelectFiltered.tsx ***!
12198
+ \********************************************************************/
12123
12199
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12124
12200
 
12125
12201
  "use strict";
12126
12202
  __webpack_require__.r(__webpack_exports__);
12127
12203
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12128
- /* harmony export */ "default": function() { return /* reexport safe */ _Position__WEBPACK_IMPORTED_MODULE_0__["default"]; }
12204
+ /* harmony export */ "PaginatedSelectFiltered": function() { return /* binding */ PaginatedSelectFiltered; }
12129
12205
  /* harmony export */ });
12130
- /* harmony import */ var _Position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Position */ "./src/components/Position/Position.tsx");
12131
-
12132
-
12133
-
12134
- /***/ }),
12135
-
12136
- /***/ "./src/components/PositionAnimated/PositionAnimated.tsx":
12137
- /*!**************************************************************!*\
12138
- !*** ./src/components/PositionAnimated/PositionAnimated.tsx ***!
12139
- \**************************************************************/
12140
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12141
-
12142
- "use strict";
12143
- __webpack_require__.r(__webpack_exports__);
12144
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
12145
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
12146
- /* harmony import */ var _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AnimatedVisibility */ "./src/components/AnimatedVisibility/index.ts");
12147
- /* harmony import */ var _Position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Position */ "./src/components/Position/index.ts");
12206
+ /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
12207
+ /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__);
12208
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
12209
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
12210
+ /* harmony import */ var _InputBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
12211
+ /* harmony import */ var _PaginatedSelect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PaginatedSelect */ "./src/components/PaginatedSelect/PaginatedSelect.tsx");
12148
12212
  var __assign = (undefined && undefined.__assign) || function () {
12149
12213
  __assign = Object.assign || function(t) {
12150
12214
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -12170,44 +12234,63 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
12170
12234
 
12171
12235
 
12172
12236
 
12173
- var PositionAnimated = function (_a) {
12174
- var _width = _a.width, visible = _a.visible, children = _a.children, props = __rest(_a, ["width", "visible", "children"]);
12175
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_AnimatedVisibility__WEBPACK_IMPORTED_MODULE_1__["default"], { visibility: visible },
12176
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Position__WEBPACK_IMPORTED_MODULE_2__["default"], __assign({}, props), children)));
12237
+
12238
+ var PaginatedSelectFiltered = function (_a) {
12239
+ var filter = _a.filter, setFilter = _a.setFilter, options = _a.options, placeholder = _a.placeholder, props = __rest(_a, ["filter", "setFilter", "options", "placeholder"]);
12240
+ var anchor = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
12241
+ return (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (_a, ref) {
12242
+ var filter = _a.filter, _onChange = _a.onChange, props = __rest(_a, ["filter", "onChange"]);
12243
+ return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_2__.InputBox.Input, __assign({ mi: 'x4', flexGrow: 1, className: 'rcx-select__focus', ref: ref, placeholder: placeholder, value: filter, onChange: (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(function (e) {
12244
+ setFilter(e.currentTarget.value);
12245
+ }) }, props, { "rcx-input-box--undecorated": true })));
12246
+ });
12247
+ }, [placeholder, setFilter]);
12248
+ return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_PaginatedSelect__WEBPACK_IMPORTED_MODULE_3__.PaginatedSelect, __assign({ placeholder: undefined, filter: filter, options: options }, props, { anchor: anchor })));
12177
12249
  };
12178
- /* harmony default export */ __webpack_exports__["default"] = (PositionAnimated);
12179
12250
 
12180
12251
 
12181
12252
  /***/ }),
12182
12253
 
12183
- /***/ "./src/components/PositionAnimated/index.ts":
12184
- /*!**************************************************!*\
12185
- !*** ./src/components/PositionAnimated/index.ts ***!
12186
- \**************************************************/
12254
+ /***/ "./src/components/PaginatedSelect/PaginatedSelectFocus.tsx":
12255
+ /*!*****************************************************************!*\
12256
+ !*** ./src/components/PaginatedSelect/PaginatedSelectFocus.tsx ***!
12257
+ \*****************************************************************/
12187
12258
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12188
12259
 
12189
12260
  "use strict";
12190
12261
  __webpack_require__.r(__webpack_exports__);
12191
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12192
- /* harmony export */ "default": function() { return /* reexport safe */ _PositionAnimated__WEBPACK_IMPORTED_MODULE_0__["default"]; }
12193
- /* harmony export */ });
12194
- /* harmony import */ var _PositionAnimated__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PositionAnimated */ "./src/components/PositionAnimated/PositionAnimated.tsx");
12262
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
12263
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
12264
+ /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
12265
+ var __assign = (undefined && undefined.__assign) || function () {
12266
+ __assign = Object.assign || function(t) {
12267
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
12268
+ s = arguments[i];
12269
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
12270
+ t[p] = s[p];
12271
+ }
12272
+ return t;
12273
+ };
12274
+ return __assign.apply(this, arguments);
12275
+ };
12276
+
12195
12277
 
12278
+ var PaginatedSelectFocus = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function PaginatedSelectFocus(props, ref) {
12279
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, __assign({ ref: ref, fontScale: 'p2m', color: 'hint', "rcx-select__focus": true, is: 'button', type: 'button' }, props)));
12280
+ });
12281
+ /* harmony default export */ __webpack_exports__["default"] = (PaginatedSelectFocus);
12196
12282
 
12197
12283
 
12198
12284
  /***/ }),
12199
12285
 
12200
- /***/ "./src/components/ProgressBar/ProgressBar.tsx":
12201
- /*!****************************************************!*\
12202
- !*** ./src/components/ProgressBar/ProgressBar.tsx ***!
12203
- \****************************************************/
12286
+ /***/ "./src/components/PaginatedSelect/PaginatedSelectWrapper.tsx":
12287
+ /*!*******************************************************************!*\
12288
+ !*** ./src/components/PaginatedSelect/PaginatedSelectWrapper.tsx ***!
12289
+ \*******************************************************************/
12204
12290
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12205
12291
 
12206
12292
  "use strict";
12207
12293
  __webpack_require__.r(__webpack_exports__);
12208
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12209
- /* harmony export */ "ProgressBar": function() { return /* binding */ ProgressBar; }
12210
- /* harmony export */ });
12211
12294
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
12212
12295
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
12213
12296
  /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
@@ -12222,72 +12305,51 @@ var __assign = (undefined && undefined.__assign) || function () {
12222
12305
  };
12223
12306
  return __assign.apply(this, arguments);
12224
12307
  };
12225
- var __rest = (undefined && undefined.__rest) || function (s, e) {
12226
- var t = {};
12227
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
12228
- t[p] = s[p];
12229
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
12230
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
12231
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
12232
- t[p[i]] = s[p[i]];
12233
- }
12234
- return t;
12235
- };
12236
12308
 
12237
12309
 
12238
- var getWidth = function (percentage) {
12239
- return Math.min(Math.max(0, percentage), 100).toFixed(1) + "%";
12240
- };
12241
- var getColor = function (percentage, error) {
12242
- if (error) {
12243
- return 'danger-200';
12244
- }
12245
- if (percentage >= 100) {
12246
- return 'success-200';
12247
- }
12248
- return 'primary-200';
12249
- };
12250
- var ProgressBar = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function ProgressBar(_a, ref) {
12251
- var barColor = _a.barColor, percentage = _a.percentage, error = _a.error, _b = _a.animated, animated = _b === void 0 ? true : _b, props = __rest(_a, ["barColor", "percentage", "error", "animated"]);
12252
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, __assign({ ref: ref, "rcx-progress-bar": true, title: error || undefined }, props),
12253
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { bg: barColor || getColor(percentage, error), "rcx-progress-bar__fill": true, "rcx-progress-bar__fill-complete": animated && percentage >= 100, width: getWidth(percentage) })));
12310
+ var PaginatedSelectWrapper = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function PaginatedSelectWrapper(props, ref) {
12311
+ return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, __assign({ is: 'div', "rcx-select__wrapper": true, ref: ref }, props));
12254
12312
  });
12313
+ /* harmony default export */ __webpack_exports__["default"] = (PaginatedSelectWrapper);
12255
12314
 
12256
12315
 
12257
12316
  /***/ }),
12258
12317
 
12259
- /***/ "./src/components/ProgressBar/index.tsx":
12260
- /*!**********************************************!*\
12261
- !*** ./src/components/ProgressBar/index.tsx ***!
12262
- \**********************************************/
12318
+ /***/ "./src/components/PaginatedSelect/index.ts":
12319
+ /*!*************************************************!*\
12320
+ !*** ./src/components/PaginatedSelect/index.ts ***!
12321
+ \*************************************************/
12263
12322
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12264
12323
 
12265
12324
  "use strict";
12266
12325
  __webpack_require__.r(__webpack_exports__);
12267
12326
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12268
- /* harmony export */ "ProgressBar": function() { return /* reexport safe */ _ProgressBar__WEBPACK_IMPORTED_MODULE_0__.ProgressBar; }
12327
+ /* harmony export */ "PaginatedSelectFiltered": function() { return /* reexport safe */ _PaginatedSelectFiltered__WEBPACK_IMPORTED_MODULE_0__.PaginatedSelectFiltered; },
12328
+ /* harmony export */ "PaginatedMultiSelectFiltered": function() { return /* reexport safe */ _PaginatedMultiSelect__WEBPACK_IMPORTED_MODULE_1__.PaginatedMultiSelectFiltered; }
12269
12329
  /* harmony export */ });
12270
- /* harmony import */ var _ProgressBar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ProgressBar */ "./src/components/ProgressBar/ProgressBar.tsx");
12330
+ /* harmony import */ var _PaginatedSelectFiltered__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PaginatedSelectFiltered */ "./src/components/PaginatedSelect/PaginatedSelectFiltered.tsx");
12331
+ /* harmony import */ var _PaginatedMultiSelect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PaginatedMultiSelect */ "./src/components/PaginatedSelect/PaginatedMultiSelect.tsx");
12332
+
12271
12333
 
12272
12334
 
12273
12335
 
12274
12336
  /***/ }),
12275
12337
 
12276
- /***/ "./src/components/RadioButton/RadioButton.tsx":
12277
- /*!****************************************************!*\
12278
- !*** ./src/components/RadioButton/RadioButton.tsx ***!
12279
- \****************************************************/
12338
+ /***/ "./src/components/Pagination/Pagination.tsx":
12339
+ /*!**************************************************!*\
12340
+ !*** ./src/components/Pagination/Pagination.tsx ***!
12341
+ \**************************************************/
12280
12342
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12281
12343
 
12282
12344
  "use strict";
12283
12345
  __webpack_require__.r(__webpack_exports__);
12284
12346
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12285
- /* harmony export */ "RadioButton": function() { return /* binding */ RadioButton; }
12347
+ /* harmony export */ "Pagination": function() { return /* binding */ Pagination; }
12286
12348
  /* harmony export */ });
12287
12349
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
12288
12350
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
12289
12351
  /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
12290
- /* harmony import */ var _Label__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Label */ "./src/components/Label/index.tsx");
12352
+ /* harmony import */ var _Chevron__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Chevron */ "./src/components/Chevron/index.tsx");
12291
12353
  var __assign = (undefined && undefined.__assign) || function () {
12292
12354
  __assign = Object.assign || function(t) {
12293
12355
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -12313,142 +12375,99 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
12313
12375
 
12314
12376
 
12315
12377
 
12316
- var RadioButton = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function RadioButton(_a, ref) {
12317
- var autoComplete = _a.autoComplete, checked = _a.checked, defaultChecked = _a.defaultChecked, disabled = _a.disabled, form = _a.form, id = _a.id, name = _a.name, required = _a.required, tabIndex = _a.tabIndex, value = _a.value, qa = _a.qa, dataQa = _a["data-qa"], onChange = _a.onChange, onInput = _a.onInput, onInvalid = _a.onInvalid, props = __rest(_a, ["autoComplete", "checked", "defaultChecked", "disabled", "form", "id", "name", "required", "tabIndex", "value", "qa", 'data-qa', "onChange", "onInput", "onInvalid"]);
12318
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, __assign({ is: _Label__WEBPACK_IMPORTED_MODULE_2__.Label, "rcx-radio-button": true }, props),
12319
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'input', "rcx-radio-button__input": true, autoComplete: autoComplete, checked: checked, defaultChecked: defaultChecked, disabled: disabled, form: form, id: id, name: name, required: required, tabIndex: tabIndex, type: 'radio', value: value, "data-qa": dataQa || qa, ref: ref, onChange: onChange, onInput: onInput, onInvalid: onInvalid }),
12320
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'i', "rcx-radio-button__fake": true, "aria-hidden": 'true' })));
12321
- });
12322
-
12323
-
12324
- /***/ }),
12325
-
12326
- /***/ "./src/components/RadioButton/index.ts":
12327
- /*!*********************************************!*\
12328
- !*** ./src/components/RadioButton/index.ts ***!
12329
- \*********************************************/
12330
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12331
-
12332
- "use strict";
12333
- __webpack_require__.r(__webpack_exports__);
12334
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12335
- /* harmony export */ "RadioButton": function() { return /* reexport safe */ _RadioButton__WEBPACK_IMPORTED_MODULE_0__.RadioButton; }
12336
- /* harmony export */ });
12337
- /* harmony import */ var _RadioButton__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RadioButton */ "./src/components/RadioButton/RadioButton.tsx");
12338
-
12339
-
12340
-
12341
- /***/ }),
12342
-
12343
- /***/ "./src/components/Scrollable/Scrollable.tsx":
12344
- /*!**************************************************!*\
12345
- !*** ./src/components/Scrollable/Scrollable.tsx ***!
12346
- \**************************************************/
12347
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12348
-
12349
- "use strict";
12350
- __webpack_require__.r(__webpack_exports__);
12351
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12352
- /* harmony export */ "Scrollable": function() { return /* binding */ Scrollable; }
12353
- /* harmony export */ });
12354
- /* harmony import */ var _rocket_chat_css_in_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rocket.chat/css-in-js */ "../css-in-js/dist/index.module.js");
12355
- /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
12356
- /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_1__);
12357
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
12358
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
12359
- /* harmony import */ var _helpers_appendClassName__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers/appendClassName */ "./src/helpers/appendClassName.ts");
12360
- /* harmony import */ var _hooks_useStyle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks/useStyle */ "./src/hooks/useStyle.ts");
12361
- /* harmony import */ var _Box_BoxTransforms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Box/BoxTransforms */ "./src/components/Box/BoxTransforms.ts");
12362
- var __makeTemplateObject = (undefined && undefined.__makeTemplateObject) || function (cooked, raw) {
12363
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
12364
- return cooked;
12365
- };
12366
-
12367
-
12368
-
12369
-
12370
-
12371
-
12372
- var getTouchingEdges = function (element) { return ({
12373
- top: !element.scrollTop,
12374
- bottom: !(element.scrollTop + element.clientHeight - element.scrollHeight),
12375
- left: !element.scrollLeft,
12376
- right: !(element.scrollLeft + element.clientWidth - element.scrollWidth),
12377
- }); };
12378
- var pollTouchingEdges = function (element, touchingEdgesRef, onScrollContent) {
12379
- var touchingEdges = touchingEdgesRef.current;
12380
- var newTouchingEdges = getTouchingEdges(element);
12381
- var dirty = touchingEdges &&
12382
- (touchingEdges.top !== newTouchingEdges.top ||
12383
- touchingEdges.bottom !== newTouchingEdges.bottom ||
12384
- touchingEdges.left !== newTouchingEdges.left ||
12385
- touchingEdges.right !== newTouchingEdges.right);
12386
- if (dirty) {
12387
- touchingEdgesRef.current = newTouchingEdges;
12388
- onScrollContent && onScrollContent(newTouchingEdges);
12389
- }
12378
+ var defaultItemsPerPageLabel = function () { return 'Items per page:'; };
12379
+ var defaultShowingResultsLabel = function (_a) {
12380
+ var count = _a.count, current = _a.current, itemsPerPage = _a.itemsPerPage;
12381
+ return "Showing results " + (current + 1) + " - " + Math.min(current + itemsPerPage, count) + " of " + count;
12390
12382
  };
12391
- var Scrollable = function (_a) {
12392
- var children = _a.children, horizontal = _a.horizontal, vertical = _a.vertical, smooth = _a.smooth, onScrollContent = _a.onScrollContent;
12393
- var scrollTimeoutRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)();
12394
- var touchingEdgesRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)({});
12395
- var handleScroll = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_1__.useMutableCallback)(function (event) {
12396
- var element = event.currentTarget;
12397
- if (!scrollTimeoutRef.current) {
12398
- pollTouchingEdges(element, touchingEdgesRef, onScrollContent);
12383
+ var Pagination = function (_a) {
12384
+ var count = _a.count, _b = _a.current, current = _b === void 0 ? 0 : _b, _c = _a.itemsPerPage, itemsPerPage = _c === void 0 ? 25 : _c, _d = _a.itemsPerPageLabel, itemsPerPageLabel = _d === void 0 ? defaultItemsPerPageLabel : _d, _e = _a.showingResultsLabel, showingResultsLabel = _e === void 0 ? defaultShowingResultsLabel : _e, onSetItemsPerPage = _a.onSetItemsPerPage, onSetCurrent = _a.onSetCurrent, divider = _a.divider, props = __rest(_a, ["count", "current", "itemsPerPage", "itemsPerPageLabel", "showingResultsLabel", "onSetItemsPerPage", "onSetCurrent", "divider"]);
12385
+ var itemsPerPageOptions = [25, 50, 100].filter(function (i) { return i <= count; });
12386
+ var hasItemsPerPageSelection = itemsPerPageOptions.length > 1;
12387
+ var currentPage = Math.floor(current / itemsPerPage);
12388
+ var pages = Math.ceil(count / itemsPerPage);
12389
+ var displayedPages = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
12390
+ if (pages <= 7) {
12391
+ // 0 1 2 3 4 5 6
12392
+ return Array.from({ length: pages }, function (_, i) { return i; });
12399
12393
  }
12400
- scrollTimeoutRef.current && clearTimeout(scrollTimeoutRef.current);
12401
- scrollTimeoutRef.current = setTimeout(function () {
12402
- scrollTimeoutRef.current = undefined;
12403
- pollTouchingEdges(element, touchingEdgesRef, onScrollContent);
12404
- }, 200);
12405
- });
12406
- var className = (0,_hooks_useStyle__WEBPACK_IMPORTED_MODULE_4__.useStyle)((0,_rocket_chat_css_in_js__WEBPACK_IMPORTED_MODULE_0__.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: relative;\n\n &::-webkit-scrollbar {\n width: ", "rem;\n height: ", "rem;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.05);\n background-color: var(\n --rcx-theme-scrollbar-thumb-color,\n rgba(0, 0, 0, 0.05)\n );\n }\n\n &:hover::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.15);\n background-color: var(\n --rcx-theme-scrollbar-thumb-hover-color,\n rgba(0, 0, 0, 0.15)\n );\n }\n\n ", "\n ", "\n "], ["\n position: relative;\n\n &::-webkit-scrollbar {\n width: ", "rem;\n height: ", "rem;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.05);\n background-color: var(\n --rcx-theme-scrollbar-thumb-color,\n rgba(0, 0, 0, 0.05)\n );\n }\n\n &:hover::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.15);\n background-color: var(\n --rcx-theme-scrollbar-thumb-hover-color,\n rgba(0, 0, 0, 0.15)\n );\n }\n\n ", "\n ", "\n "])), 4 / 16, 4 / 16, (horizontal && (0,_rocket_chat_css_in_js__WEBPACK_IMPORTED_MODULE_0__.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n overflow-x: auto !important;\n "], ["\n overflow-x: auto !important;\n "])))) ||
12407
- (vertical && (0,_rocket_chat_css_in_js__WEBPACK_IMPORTED_MODULE_0__.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n overflow-y: auto !important;\n "], ["\n overflow-y: auto !important;\n "])))) || (0,_rocket_chat_css_in_js__WEBPACK_IMPORTED_MODULE_0__.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n overflow: auto !important;\n "], ["\n overflow: auto !important;\n "]))), smooth && (0,_rocket_chat_css_in_js__WEBPACK_IMPORTED_MODULE_0__.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n scroll-behavior: smooth !important;\n "], ["\n scroll-behavior: smooth !important;\n "])))), null);
12408
- var transformFn = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (props) {
12409
- props.className =
12410
- className && (0,_helpers_appendClassName__WEBPACK_IMPORTED_MODULE_3__.appendClassName)(props.className, className);
12411
- if (onScrollContent !== undefined && props.onScroll === undefined) {
12412
- props.onScroll = handleScroll;
12394
+ if (currentPage < 5) {
12395
+ // 0 1 2 3 4 ... N
12396
+ return [0, 1, 2, 3, 4, '⋯', pages - 1];
12413
12397
  }
12414
- return props;
12415
- }, [className, handleScroll, onScrollContent]);
12416
- return (react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_Box_BoxTransforms__WEBPACK_IMPORTED_MODULE_5__.BoxTransforms.Provider, { children: children, value: (0,_Box_BoxTransforms__WEBPACK_IMPORTED_MODULE_5__.useComposedBoxTransform)(transformFn) }));
12398
+ if (currentPage > pages - 5) {
12399
+ // 0 ... N-4 N-3 N-2 N-1 N
12400
+ return [0, '⋯', pages - 5, pages - 4, pages - 3, pages - 2, pages - 1];
12401
+ }
12402
+ // 0 ... x-1 x x-2 ... N
12403
+ return [
12404
+ 0,
12405
+ '⋯',
12406
+ currentPage - 1,
12407
+ currentPage,
12408
+ currentPage + 1,
12409
+ '⋯',
12410
+ pages - 1,
12411
+ ];
12412
+ }, [pages, currentPage]);
12413
+ var renderingContext = { count: count, pages: pages, current: current, currentPage: currentPage, itemsPerPage: itemsPerPage };
12414
+ var handleSetItemsPerPageLinkClick = function (itemsPerPageOption) { return function () {
12415
+ onSetItemsPerPage === null || onSetItemsPerPage === void 0 ? void 0 : onSetItemsPerPage(itemsPerPageOption);
12416
+ }; };
12417
+ var handleSetPageLinkClick = function (page) { return function () {
12418
+ onSetCurrent === null || onSetCurrent === void 0 ? void 0 : onSetCurrent(page * itemsPerPage);
12419
+ }; };
12420
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, __assign({ is: 'nav', "rcx-pagination": true, "rcx-pagination--divider": divider }, props),
12421
+ hasItemsPerPageSelection && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { "rcx-pagination__left": true },
12422
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'span', "rcx-pagination__label": true }, itemsPerPageLabel(renderingContext)),
12423
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'ol', "rcx-pagination__list": true }, itemsPerPageOptions.map(function (itemsPerPageOption) { return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { key: itemsPerPageOption, is: 'li', "rcx-pagination__list-item": true },
12424
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'button', "rcx-pagination__link": true, tabIndex: itemsPerPage === itemsPerPageOption ? -1 : 0, disabled: itemsPerPage === itemsPerPageOption, onClick: handleSetItemsPerPageLinkClick(itemsPerPageOption) }, itemsPerPageOption))); })))),
12425
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { "rcx-pagination__right": true },
12426
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'span', "rcx-pagination__label": true }, showingResultsLabel(renderingContext)),
12427
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'ol', "rcx-pagination__list": true },
12428
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'li', "rcx-pagination__list-item": true },
12429
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'button', "rcx-pagination__back": true, disabled: currentPage === 0, onClick: handleSetPageLinkClick(currentPage - 1) },
12430
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Chevron__WEBPACK_IMPORTED_MODULE_2__.Chevron, { left: true, size: 'x16' }))),
12431
+ displayedPages.map(function (page, i) { return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { key: i, is: 'li', "rcx-pagination__list-item": true }, page === '⋯' ? ('⋯') : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'button', "rcx-pagination__link": true, disabled: currentPage === page, onClick: handleSetPageLinkClick(page) }, page + 1)))); }),
12432
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'li', "rcx-pagination__list-item": true },
12433
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'button', "rcx-pagination__forward": true, disabled: currentPage === pages - 1, onClick: handleSetPageLinkClick(currentPage + 1) },
12434
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Chevron__WEBPACK_IMPORTED_MODULE_2__.Chevron, { right: true, size: 'x16' })))))));
12417
12435
  };
12418
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
12419
12436
 
12420
12437
 
12421
12438
  /***/ }),
12422
12439
 
12423
- /***/ "./src/components/Scrollable/index.ts":
12440
+ /***/ "./src/components/Pagination/index.ts":
12424
12441
  /*!********************************************!*\
12425
- !*** ./src/components/Scrollable/index.ts ***!
12442
+ !*** ./src/components/Pagination/index.ts ***!
12426
12443
  \********************************************/
12427
12444
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12428
12445
 
12429
12446
  "use strict";
12430
12447
  __webpack_require__.r(__webpack_exports__);
12431
- /* harmony import */ var _Scrollable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Scrollable */ "./src/components/Scrollable/Scrollable.tsx");
12448
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12449
+ /* harmony export */ "Pagination": function() { return /* reexport safe */ _Pagination__WEBPACK_IMPORTED_MODULE_0__.Pagination; }
12450
+ /* harmony export */ });
12451
+ /* harmony import */ var _Pagination__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Pagination */ "./src/components/Pagination/Pagination.tsx");
12432
12452
 
12433
- /* harmony default export */ __webpack_exports__["default"] = (_Scrollable__WEBPACK_IMPORTED_MODULE_0__.Scrollable);
12434
12453
 
12435
12454
 
12436
12455
  /***/ }),
12437
12456
 
12438
- /***/ "./src/components/SearchInput/SearchInput.tsx":
12439
- /*!****************************************************!*\
12440
- !*** ./src/components/SearchInput/SearchInput.tsx ***!
12441
- \****************************************************/
12457
+ /***/ "./src/components/PasswordInput/PasswordInput.tsx":
12458
+ /*!********************************************************!*\
12459
+ !*** ./src/components/PasswordInput/PasswordInput.tsx ***!
12460
+ \********************************************************/
12442
12461
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12443
12462
 
12444
12463
  "use strict";
12445
12464
  __webpack_require__.r(__webpack_exports__);
12446
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12447
- /* harmony export */ "SearchInput": function() { return /* binding */ SearchInput; }
12448
- /* harmony export */ });
12449
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
12450
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
12451
- /* harmony import */ var _InputBox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
12465
+ /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
12466
+ /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__);
12467
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
12468
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
12469
+ /* harmony import */ var _Icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts");
12470
+ /* harmony import */ var _InputBox__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
12452
12471
  var __assign = (undefined && undefined.__assign) || function () {
12453
12472
  __assign = Object.assign || function(t) {
12454
12473
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -12460,56 +12479,69 @@ var __assign = (undefined && undefined.__assign) || function () {
12460
12479
  };
12461
12480
  return __assign.apply(this, arguments);
12462
12481
  };
12482
+ var __read = (undefined && undefined.__read) || function (o, n) {
12483
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
12484
+ if (!m) return o;
12485
+ var i = m.call(o), r, ar = [], e;
12486
+ try {
12487
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
12488
+ }
12489
+ catch (error) { e = { error: error }; }
12490
+ finally {
12491
+ try {
12492
+ if (r && !r.done && (m = i["return"])) m.call(i);
12493
+ }
12494
+ finally { if (e) throw e.error; }
12495
+ }
12496
+ return ar;
12497
+ };
12463
12498
 
12464
12499
 
12465
- var SearchInput = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function SearchInput(props, ref) {
12466
- return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_1__.InputBox, __assign({ type: 'search', ref: ref }, props));
12500
+
12501
+
12502
+ var PasswordInput = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function PasswordInput(props, ref) {
12503
+ var _a = __read((0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useToggle)(true), 2), hidden = _a[0], toggle = _a[1];
12504
+ var handleAddonClick = function () {
12505
+ toggle();
12506
+ };
12507
+ return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_3__.InputBox, __assign({ type: hidden ? 'password' : 'text', addon: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Icon__WEBPACK_IMPORTED_MODULE_2__.Icon, { name: hidden ? 'eye-off' : 'eye', size: 20, onClick: handleAddonClick }), ref: ref }, props)));
12467
12508
  });
12509
+ /* harmony default export */ __webpack_exports__["default"] = (PasswordInput);
12468
12510
 
12469
12511
 
12470
12512
  /***/ }),
12471
12513
 
12472
- /***/ "./src/components/SearchInput/index.tsx":
12473
- /*!**********************************************!*\
12474
- !*** ./src/components/SearchInput/index.tsx ***!
12475
- \**********************************************/
12514
+ /***/ "./src/components/PasswordInput/index.ts":
12515
+ /*!***********************************************!*\
12516
+ !*** ./src/components/PasswordInput/index.ts ***!
12517
+ \***********************************************/
12476
12518
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12477
12519
 
12478
12520
  "use strict";
12479
12521
  __webpack_require__.r(__webpack_exports__);
12480
12522
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12481
- /* harmony export */ "SearchInput": function() { return /* reexport safe */ _SearchInput__WEBPACK_IMPORTED_MODULE_0__.SearchInput; }
12523
+ /* harmony export */ "default": function() { return /* reexport safe */ _PasswordInput__WEBPACK_IMPORTED_MODULE_0__["default"]; }
12482
12524
  /* harmony export */ });
12483
- /* harmony import */ var _SearchInput__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SearchInput */ "./src/components/SearchInput/SearchInput.tsx");
12525
+ /* harmony import */ var _PasswordInput__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PasswordInput */ "./src/components/PasswordInput/PasswordInput.tsx");
12484
12526
 
12485
12527
 
12486
12528
 
12487
12529
  /***/ }),
12488
12530
 
12489
- /***/ "./src/components/Select/Select.tsx":
12490
- /*!******************************************!*\
12491
- !*** ./src/components/Select/Select.tsx ***!
12492
- \******************************************/
12531
+ /***/ "./src/components/Position/Position.tsx":
12532
+ /*!**********************************************!*\
12533
+ !*** ./src/components/Position/Position.tsx ***!
12534
+ \**********************************************/
12493
12535
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12494
12536
 
12495
12537
  "use strict";
12496
12538
  __webpack_require__.r(__webpack_exports__);
12497
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12498
- /* harmony export */ "Select": function() { return /* binding */ Select; }
12499
- /* harmony export */ });
12500
12539
  /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
12501
12540
  /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__);
12502
12541
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
12503
12542
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
12504
- /* harmony import */ var _helpers_isForwardRefType__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/isForwardRefType */ "./src/helpers/isForwardRefType.ts");
12505
- /* harmony import */ var _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../AnimatedVisibility */ "./src/components/AnimatedVisibility/index.ts");
12506
- /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
12507
- /* harmony import */ var _Icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts");
12508
- /* harmony import */ var _Margins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Margins */ "./src/components/Margins/index.ts");
12509
- /* harmony import */ var _Options__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Options */ "./src/components/Options/index.ts");
12510
- /* harmony import */ var _PositionAnimated__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../PositionAnimated */ "./src/components/PositionAnimated/index.ts");
12511
- /* harmony import */ var _SelectAddon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./SelectAddon */ "./src/components/Select/SelectAddon.tsx");
12512
- /* harmony import */ var _SelectFocus__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./SelectFocus */ "./src/components/Select/SelectFocus.tsx");
12543
+ /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "react-dom");
12544
+ /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
12513
12545
  var __assign = (undefined && undefined.__assign) || function () {
12514
12546
  __assign = Object.assign || function(t) {
12515
12547
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -12532,140 +12564,60 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
12532
12564
  }
12533
12565
  return t;
12534
12566
  };
12535
- var __read = (undefined && undefined.__read) || function (o, n) {
12536
- var m = typeof Symbol === "function" && o[Symbol.iterator];
12537
- if (!m) return o;
12538
- var i = m.call(o), r, ar = [], e;
12539
- try {
12540
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
12541
- }
12542
- catch (error) { e = { error: error }; }
12543
- finally {
12544
- try {
12545
- if (r && !r.done && (m = i["return"])) m.call(i);
12546
- }
12547
- finally { if (e) throw e.error; }
12548
- }
12549
- return ar;
12550
- };
12551
-
12552
-
12553
-
12554
-
12555
-
12556
12567
 
12557
12568
 
12558
12569
 
12570
+ var Position = function (_a) {
12571
+ var anchor = _a.anchor, children = _a.children, placement = _a.placement, margin = _a.margin, _className = _a.className, props = __rest(_a, ["anchor", "children", "placement", "margin", "className"]);
12572
+ var target = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
12573
+ var _b = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.usePosition)(anchor, target, (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () { return ({ placement: placement, margin: margin }); }, [placement, margin])) || {}, positionStyle = _b.style, positionPlacement = _b.placement;
12574
+ var style = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () { return (__assign({ position: 'fixed' }, positionStyle)); }, [positionStyle]);
12575
+ var portalContainer = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
12576
+ var element = document.createElement('div');
12577
+ document.body.appendChild(element);
12578
+ return element;
12579
+ }, []);
12580
+ (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
12581
+ return function () {
12582
+ document.body.removeChild(portalContainer);
12583
+ };
12584
+ }, [portalContainer]);
12585
+ return (0,react_dom__WEBPACK_IMPORTED_MODULE_2__.createPortal)((0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(children, __assign(__assign({ ref: target, style: style }, props), { placement: positionPlacement })), portalContainer);
12586
+ };
12587
+ /* harmony default export */ __webpack_exports__["default"] = (Position);
12559
12588
 
12560
12589
 
12590
+ /***/ }),
12591
+
12592
+ /***/ "./src/components/Position/index.ts":
12593
+ /*!******************************************!*\
12594
+ !*** ./src/components/Position/index.ts ***!
12595
+ \******************************************/
12596
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12597
+
12598
+ "use strict";
12599
+ __webpack_require__.r(__webpack_exports__);
12600
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12601
+ /* harmony export */ "default": function() { return /* reexport safe */ _Position__WEBPACK_IMPORTED_MODULE_0__["default"]; }
12602
+ /* harmony export */ });
12603
+ /* harmony import */ var _Position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Position */ "./src/components/Position/Position.tsx");
12561
12604
 
12562
- var Wrapper = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (props, ref) { return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_4__.Box, __assign({ is: 'div', "rcx-select__wrapper": true, ref: ref }, props))); });
12563
- var useDidUpdate = function (func, deps) {
12564
- var didMount = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);
12565
- var fn = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(func);
12566
- (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
12567
- if (didMount.current) {
12568
- fn();
12569
- }
12570
- didMount.current = true;
12571
- }, deps || []);
12572
- };
12573
- var Select = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (_a, ref) {
12574
- var value = _a.value, filter = _a.filter, error = _a.error, disabled = _a.disabled, _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.anchor, Anchor = _c === void 0 ? _SelectFocus__WEBPACK_IMPORTED_MODULE_10__["default"] : _c, _d = _a.onChange, onChange = _d === void 0 ? function () { } : _d, _e = _a.getValue, getValue = _e === void 0 ? function (_a) {
12575
- var _b = _a === void 0 ? ['', ''] : _a, _c = __read(_b, 1), value = _c[0];
12576
- return value;
12577
- } : _e, _f = _a.getLabel, getLabel = _f === void 0 ? function (_a) {
12578
- var _b = _a === void 0 ? ['', ''] : _a, _c = __read(_b, 2), _ = _c[0], label = _c[1];
12579
- return label;
12580
- } : _f, _g = _a.placeholder, placeholder = _g === void 0 ? '' : _g, renderItem = _a.renderItem, RenderSelected = _a.renderSelected, _h = _a.renderOptions, _Options = _h === void 0 ? _Options__WEBPACK_IMPORTED_MODULE_7__.Options : _h, addonIcon = _a.addonIcon, customEmpty = _a.customEmpty, props = __rest(_a, ["value", "filter", "error", "disabled", "options", "anchor", "onChange", "getValue", "getLabel", "placeholder", "renderItem", "renderSelected", "renderOptions", "addonIcon", "customEmpty"]);
12581
- var _j = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(value || ''), 2), internalValue = _j[0], setInternalValue = _j[1];
12582
- var internalChangedByKeyboard = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(function (_a) {
12583
- var _b = __read(_a, 1), value = _b[0];
12584
- setInternalValue(value);
12585
- onChange(value);
12586
- });
12587
- var option = options.find(function (option) { return getValue(option) === internalValue; });
12588
- var index = options.indexOf(option);
12589
- var filteredOptions = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
12590
- var mapOptions = function (_a) {
12591
- var _b = __read(_a, 2), value = _b[0], label = _b[1];
12592
- if (internalValue === value) {
12593
- return [value, label, true];
12594
- }
12595
- return [value, label];
12596
- };
12597
- var applyFilter = function (_a) {
12598
- var _b = __read(_a, 2), option = _b[1];
12599
- return !filter || ~option.toLowerCase().indexOf(filter.toLowerCase());
12600
- };
12601
- return options.filter(applyFilter).map(mapOptions);
12602
- }, [options, internalValue, filter]);
12603
- var _k = __read((0,_Options__WEBPACK_IMPORTED_MODULE_7__.useCursor)(index, filteredOptions, internalChangedByKeyboard), 5), cursor = _k[0], handleKeyDown = _k[1], handleKeyUp = _k[2], reset = _k[3], _l = __read(_k[4], 3), visible = _l[0], hide = _l[1], show = _l[2];
12604
- var internalChangedByClick = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(function (_a) {
12605
- var _b = __read(_a, 1), value = _b[0];
12606
- setInternalValue(value);
12607
- onChange(value);
12608
- hide();
12609
- });
12610
- var innerRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
12611
- var anchorRef = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMergedRefs)(ref, innerRef);
12612
- var renderAnchor = function (params) {
12613
- if ((0,_helpers_isForwardRefType__WEBPACK_IMPORTED_MODULE_2__.isForwardRefType)(Anchor)) {
12614
- return react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Anchor, __assign({}, params));
12615
- }
12616
- if (typeof Anchor === 'function') {
12617
- return Anchor(params);
12618
- }
12619
- return null;
12620
- };
12621
- var _m = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useResizeObserver)(), containerRef = _m.ref, borderBoxSize = _m.borderBoxSize;
12622
- useDidUpdate(reset, [filter, internalValue]);
12623
- var valueLabel = getLabel(option);
12624
- var visibleText = (filter === undefined || visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_3__["default"].HIDDEN) &&
12625
- (valueLabel || placeholder || typeof placeholder === 'string');
12626
- var handleClick = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(function () {
12627
- var _a;
12628
- if (visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_3__["default"].VISIBLE) {
12629
- return hide();
12630
- }
12631
- (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
12632
- return show();
12633
- });
12634
- return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_4__.Box, __assign({ "rcx-select": true, disabled: disabled, ref: containerRef, onClick: handleClick, className: (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () { return [error && 'invalid', disabled && 'disabled']; }, [error, disabled]) }, props),
12635
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Wrapper, { display: 'flex', mi: 'neg-x4', "rcx-select__wrapper--hidden": !!visibleText },
12636
- visibleText &&
12637
- (RenderSelected ? (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(RenderSelected, { role: 'option', value: getValue(option), label: valueLabel, key: getValue(option), onClick: internalChangedByClick })) : (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_4__.Box, { flexGrow: 1, is: 'span', mi: 'x4', "rcx-select__item": true, fontScale: 'p2', color: valueLabel ? 'default' : 'hint' }, visibleText))),
12638
- renderAnchor({
12639
- ref: anchorRef,
12640
- children: !value ? option || placeholder : null,
12641
- disabled: disabled !== null && disabled !== void 0 ? disabled : false,
12642
- onClick: show,
12643
- onBlur: hide,
12644
- onKeyDown: handleKeyDown,
12645
- onKeyUp: handleKeyUp,
12646
- }),
12647
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Margins__WEBPACK_IMPORTED_MODULE_6__["default"], { inline: 'x4' },
12648
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_SelectAddon__WEBPACK_IMPORTED_MODULE_9__["default"], { children: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Icon__WEBPACK_IMPORTED_MODULE_5__.Icon, { name: visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_3__["default"].VISIBLE
12649
- ? 'cross'
12650
- : addonIcon || 'chevron-down', size: 'x20' }) }))),
12651
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_PositionAnimated__WEBPACK_IMPORTED_MODULE_8__["default"], { visible: visible, anchor: containerRef },
12652
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Options, { width: borderBoxSize.inlineSize, role: 'listbox', filter: filter, options: filteredOptions, onSelect: internalChangedByClick, renderItem: renderItem, cursor: cursor, customEmpty: customEmpty }))));
12653
- });
12654
12605
 
12655
12606
 
12656
12607
  /***/ }),
12657
12608
 
12658
- /***/ "./src/components/Select/SelectAddon.tsx":
12659
- /*!***********************************************!*\
12660
- !*** ./src/components/Select/SelectAddon.tsx ***!
12661
- \***********************************************/
12609
+ /***/ "./src/components/PositionAnimated/PositionAnimated.tsx":
12610
+ /*!**************************************************************!*\
12611
+ !*** ./src/components/PositionAnimated/PositionAnimated.tsx ***!
12612
+ \**************************************************************/
12662
12613
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12663
12614
 
12664
12615
  "use strict";
12665
12616
  __webpack_require__.r(__webpack_exports__);
12666
12617
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
12667
12618
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
12668
- /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
12619
+ /* harmony import */ var _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AnimatedVisibility */ "./src/components/AnimatedVisibility/index.ts");
12620
+ /* harmony import */ var _Position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Position */ "./src/components/Position/index.ts");
12669
12621
  var __assign = (undefined && undefined.__assign) || function () {
12670
12622
  __assign = Object.assign || function(t) {
12671
12623
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -12677,31 +12629,61 @@ var __assign = (undefined && undefined.__assign) || function () {
12677
12629
  };
12678
12630
  return __assign.apply(this, arguments);
12679
12631
  };
12632
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
12633
+ var t = {};
12634
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
12635
+ t[p] = s[p];
12636
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
12637
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
12638
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
12639
+ t[p[i]] = s[p[i]];
12640
+ }
12641
+ return t;
12642
+ };
12680
12643
 
12681
12644
 
12682
- var SelectAddon = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function SelectAddon(props, ref) {
12683
- return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, __assign({ is: 'div', "rcx-select__addon": true, ref: ref }, props));
12684
- });
12685
- /* harmony default export */ __webpack_exports__["default"] = (SelectAddon);
12645
+
12646
+ var PositionAnimated = function (_a) {
12647
+ var _width = _a.width, visible = _a.visible, children = _a.children, props = __rest(_a, ["width", "visible", "children"]);
12648
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_AnimatedVisibility__WEBPACK_IMPORTED_MODULE_1__["default"], { visibility: visible },
12649
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Position__WEBPACK_IMPORTED_MODULE_2__["default"], __assign({}, props), children)));
12650
+ };
12651
+ /* harmony default export */ __webpack_exports__["default"] = (PositionAnimated);
12686
12652
 
12687
12653
 
12688
12654
  /***/ }),
12689
12655
 
12690
- /***/ "./src/components/Select/SelectFiltered.tsx":
12656
+ /***/ "./src/components/PositionAnimated/index.ts":
12691
12657
  /*!**************************************************!*\
12692
- !*** ./src/components/Select/SelectFiltered.tsx ***!
12658
+ !*** ./src/components/PositionAnimated/index.ts ***!
12693
12659
  \**************************************************/
12694
12660
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12695
12661
 
12696
12662
  "use strict";
12697
12663
  __webpack_require__.r(__webpack_exports__);
12698
12664
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12699
- /* harmony export */ "SelectFiltered": function() { return /* binding */ SelectFiltered; }
12665
+ /* harmony export */ "default": function() { return /* reexport safe */ _PositionAnimated__WEBPACK_IMPORTED_MODULE_0__["default"]; }
12666
+ /* harmony export */ });
12667
+ /* harmony import */ var _PositionAnimated__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PositionAnimated */ "./src/components/PositionAnimated/PositionAnimated.tsx");
12668
+
12669
+
12670
+
12671
+ /***/ }),
12672
+
12673
+ /***/ "./src/components/ProgressBar/ProgressBar.tsx":
12674
+ /*!****************************************************!*\
12675
+ !*** ./src/components/ProgressBar/ProgressBar.tsx ***!
12676
+ \****************************************************/
12677
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12678
+
12679
+ "use strict";
12680
+ __webpack_require__.r(__webpack_exports__);
12681
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12682
+ /* harmony export */ "ProgressBar": function() { return /* binding */ ProgressBar; }
12700
12683
  /* harmony export */ });
12701
12684
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
12702
12685
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
12703
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! . */ "./src/components/Select/index.ts");
12704
- /* harmony import */ var _SelectFilteredAnchor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SelectFilteredAnchor */ "./src/components/Select/SelectFilteredAnchor.tsx");
12686
+ /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
12705
12687
  var __assign = (undefined && undefined.__assign) || function () {
12706
12688
  __assign = Object.assign || function(t) {
12707
12689
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -12724,45 +12706,61 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
12724
12706
  }
12725
12707
  return t;
12726
12708
  };
12727
- var __read = (undefined && undefined.__read) || function (o, n) {
12728
- var m = typeof Symbol === "function" && o[Symbol.iterator];
12729
- if (!m) return o;
12730
- var i = m.call(o), r, ar = [], e;
12731
- try {
12732
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
12709
+
12710
+
12711
+ var getWidth = function (percentage) {
12712
+ return Math.min(Math.max(0, percentage), 100).toFixed(1) + "%";
12713
+ };
12714
+ var getColor = function (percentage, error) {
12715
+ if (error) {
12716
+ return 'danger-200';
12733
12717
  }
12734
- catch (error) { e = { error: error }; }
12735
- finally {
12736
- try {
12737
- if (r && !r.done && (m = i["return"])) m.call(i);
12738
- }
12739
- finally { if (e) throw e.error; }
12718
+ if (percentage >= 100) {
12719
+ return 'success-200';
12740
12720
  }
12741
- return ar;
12721
+ return 'primary-200';
12742
12722
  };
12723
+ var ProgressBar = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function ProgressBar(_a, ref) {
12724
+ var barColor = _a.barColor, percentage = _a.percentage, error = _a.error, _b = _a.animated, animated = _b === void 0 ? true : _b, props = __rest(_a, ["barColor", "percentage", "error", "animated"]);
12725
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, __assign({ ref: ref, "rcx-progress-bar": true, title: error || undefined }, props),
12726
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { bg: barColor || getColor(percentage, error), "rcx-progress-bar__fill": true, "rcx-progress-bar__fill-complete": animated && percentage >= 100, width: getWidth(percentage) })));
12727
+ });
12743
12728
 
12744
12729
 
12730
+ /***/ }),
12731
+
12732
+ /***/ "./src/components/ProgressBar/index.tsx":
12733
+ /*!**********************************************!*\
12734
+ !*** ./src/components/ProgressBar/index.tsx ***!
12735
+ \**********************************************/
12736
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12737
+
12738
+ "use strict";
12739
+ __webpack_require__.r(__webpack_exports__);
12740
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12741
+ /* harmony export */ "ProgressBar": function() { return /* reexport safe */ _ProgressBar__WEBPACK_IMPORTED_MODULE_0__.ProgressBar; }
12742
+ /* harmony export */ });
12743
+ /* harmony import */ var _ProgressBar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ProgressBar */ "./src/components/ProgressBar/ProgressBar.tsx");
12745
12744
 
12746
- var SelectFiltered = function (_a) {
12747
- var options = _a.options, placeholder = _a.placeholder, propFilter = _a.filter, propSetFilter = _a.setFilter, props = __rest(_a, ["options", "placeholder", "filter", "setFilter"]);
12748
- var _b = __read((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''), 2), filter = _b[0], setFilter = _b[1];
12749
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_1__.Select, __assign({ placeholder: placeholder, filter: propFilter || filter, options: options }, props, { anchor: function (params) { return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_SelectFilteredAnchor__WEBPACK_IMPORTED_MODULE_2__["default"], __assign({ placeholder: placeholder, filter: propFilter || filter, onChangeFilter: propSetFilter || setFilter }, params))); } })));
12750
- };
12751
12745
 
12752
12746
 
12753
12747
  /***/ }),
12754
12748
 
12755
- /***/ "./src/components/Select/SelectFilteredAnchor.tsx":
12756
- /*!********************************************************!*\
12757
- !*** ./src/components/Select/SelectFilteredAnchor.tsx ***!
12758
- \********************************************************/
12749
+ /***/ "./src/components/RadioButton/RadioButton.tsx":
12750
+ /*!****************************************************!*\
12751
+ !*** ./src/components/RadioButton/RadioButton.tsx ***!
12752
+ \****************************************************/
12759
12753
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12760
12754
 
12761
12755
  "use strict";
12762
12756
  __webpack_require__.r(__webpack_exports__);
12757
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12758
+ /* harmony export */ "RadioButton": function() { return /* binding */ RadioButton; }
12759
+ /* harmony export */ });
12763
12760
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
12764
12761
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
12765
- /* harmony import */ var _InputBox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
12762
+ /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
12763
+ /* harmony import */ var _Label__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Label */ "./src/components/Label/index.tsx");
12766
12764
  var __assign = (undefined && undefined.__assign) || function () {
12767
12765
  __assign = Object.assign || function(t) {
12768
12766
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -12787,84 +12785,143 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
12787
12785
  };
12788
12786
 
12789
12787
 
12790
- var SelectFilteredAnchor = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function SelectFilteredAnchor(_a, ref) {
12791
- var _children = _a.children, filter = _a.filter, onChangeFilter = _a.onChangeFilter, placeholder = _a.placeholder, props = __rest(_a, ["children", "filter", "onChangeFilter", "placeholder"]);
12792
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_1__.InputBox.Input, __assign({ mi: 'x4', flexGrow: 1, className: 'rcx-select__focus', ref: ref, placeholder: placeholder, value: filter, onInput: function (e) {
12793
- return onChangeFilter(e.currentTarget.value);
12794
- } }, props, { "rcx-input-box--undecorated": true })));
12788
+
12789
+ var RadioButton = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function RadioButton(_a, ref) {
12790
+ var autoComplete = _a.autoComplete, checked = _a.checked, defaultChecked = _a.defaultChecked, disabled = _a.disabled, form = _a.form, id = _a.id, name = _a.name, required = _a.required, tabIndex = _a.tabIndex, value = _a.value, qa = _a.qa, dataQa = _a["data-qa"], onChange = _a.onChange, onInput = _a.onInput, onInvalid = _a.onInvalid, props = __rest(_a, ["autoComplete", "checked", "defaultChecked", "disabled", "form", "id", "name", "required", "tabIndex", "value", "qa", 'data-qa', "onChange", "onInput", "onInvalid"]);
12791
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, __assign({ is: _Label__WEBPACK_IMPORTED_MODULE_2__.Label, "rcx-radio-button": true }, props),
12792
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'input', "rcx-radio-button__input": true, autoComplete: autoComplete, checked: checked, defaultChecked: defaultChecked, disabled: disabled, form: form, id: id, name: name, required: required, tabIndex: tabIndex, type: 'radio', value: value, "data-qa": dataQa || qa, ref: ref, onChange: onChange, onInput: onInput, onInvalid: onInvalid }),
12793
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, { is: 'i', "rcx-radio-button__fake": true, "aria-hidden": 'true' })));
12795
12794
  });
12796
- /* harmony default export */ __webpack_exports__["default"] = (SelectFilteredAnchor);
12797
12795
 
12798
12796
 
12799
12797
  /***/ }),
12800
12798
 
12801
- /***/ "./src/components/Select/SelectFocus.tsx":
12802
- /*!***********************************************!*\
12803
- !*** ./src/components/Select/SelectFocus.tsx ***!
12804
- \***********************************************/
12799
+ /***/ "./src/components/RadioButton/index.ts":
12800
+ /*!*********************************************!*\
12801
+ !*** ./src/components/RadioButton/index.ts ***!
12802
+ \*********************************************/
12805
12803
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12806
12804
 
12807
12805
  "use strict";
12808
12806
  __webpack_require__.r(__webpack_exports__);
12809
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
12810
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
12811
- /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
12812
- var __assign = (undefined && undefined.__assign) || function () {
12813
- __assign = Object.assign || function(t) {
12814
- for (var s, i = 1, n = arguments.length; i < n; i++) {
12815
- s = arguments[i];
12816
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
12817
- t[p] = s[p];
12818
- }
12819
- return t;
12820
- };
12821
- return __assign.apply(this, arguments);
12807
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12808
+ /* harmony export */ "RadioButton": function() { return /* reexport safe */ _RadioButton__WEBPACK_IMPORTED_MODULE_0__.RadioButton; }
12809
+ /* harmony export */ });
12810
+ /* harmony import */ var _RadioButton__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RadioButton */ "./src/components/RadioButton/RadioButton.tsx");
12811
+
12812
+
12813
+
12814
+ /***/ }),
12815
+
12816
+ /***/ "./src/components/Scrollable/Scrollable.tsx":
12817
+ /*!**************************************************!*\
12818
+ !*** ./src/components/Scrollable/Scrollable.tsx ***!
12819
+ \**************************************************/
12820
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12821
+
12822
+ "use strict";
12823
+ __webpack_require__.r(__webpack_exports__);
12824
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12825
+ /* harmony export */ "Scrollable": function() { return /* binding */ Scrollable; }
12826
+ /* harmony export */ });
12827
+ /* harmony import */ var _rocket_chat_css_in_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rocket.chat/css-in-js */ "../css-in-js/dist/index.module.js");
12828
+ /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
12829
+ /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_1__);
12830
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
12831
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
12832
+ /* harmony import */ var _helpers_appendClassName__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers/appendClassName */ "./src/helpers/appendClassName.ts");
12833
+ /* harmony import */ var _hooks_useStyle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks/useStyle */ "./src/hooks/useStyle.ts");
12834
+ /* harmony import */ var _Box_BoxTransforms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Box/BoxTransforms */ "./src/components/Box/BoxTransforms.ts");
12835
+ var __makeTemplateObject = (undefined && undefined.__makeTemplateObject) || function (cooked, raw) {
12836
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
12837
+ return cooked;
12822
12838
  };
12823
12839
 
12824
12840
 
12825
- var SelectFocus = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function SelectFocus(props, ref) {
12826
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, __assign({ ref: ref, fontScale: 'p2m', color: 'hint', "rcx-select__focus": true, is: 'button', type: 'button' }, props)));
12827
- });
12828
- /* harmony default export */ __webpack_exports__["default"] = (SelectFocus);
12841
+
12842
+
12843
+
12844
+
12845
+ var getTouchingEdges = function (element) { return ({
12846
+ top: !element.scrollTop,
12847
+ bottom: !(element.scrollTop + element.clientHeight - element.scrollHeight),
12848
+ left: !element.scrollLeft,
12849
+ right: !(element.scrollLeft + element.clientWidth - element.scrollWidth),
12850
+ }); };
12851
+ var pollTouchingEdges = function (element, touchingEdgesRef, onScrollContent) {
12852
+ var touchingEdges = touchingEdgesRef.current;
12853
+ var newTouchingEdges = getTouchingEdges(element);
12854
+ var dirty = touchingEdges &&
12855
+ (touchingEdges.top !== newTouchingEdges.top ||
12856
+ touchingEdges.bottom !== newTouchingEdges.bottom ||
12857
+ touchingEdges.left !== newTouchingEdges.left ||
12858
+ touchingEdges.right !== newTouchingEdges.right);
12859
+ if (dirty) {
12860
+ touchingEdgesRef.current = newTouchingEdges;
12861
+ onScrollContent && onScrollContent(newTouchingEdges);
12862
+ }
12863
+ };
12864
+ var Scrollable = function (_a) {
12865
+ var children = _a.children, horizontal = _a.horizontal, vertical = _a.vertical, smooth = _a.smooth, onScrollContent = _a.onScrollContent;
12866
+ var scrollTimeoutRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)();
12867
+ var touchingEdgesRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)({});
12868
+ var handleScroll = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_1__.useMutableCallback)(function (event) {
12869
+ var element = event.currentTarget;
12870
+ if (!scrollTimeoutRef.current) {
12871
+ pollTouchingEdges(element, touchingEdgesRef, onScrollContent);
12872
+ }
12873
+ scrollTimeoutRef.current && clearTimeout(scrollTimeoutRef.current);
12874
+ scrollTimeoutRef.current = setTimeout(function () {
12875
+ scrollTimeoutRef.current = undefined;
12876
+ pollTouchingEdges(element, touchingEdgesRef, onScrollContent);
12877
+ }, 200);
12878
+ });
12879
+ var className = (0,_hooks_useStyle__WEBPACK_IMPORTED_MODULE_4__.useStyle)((0,_rocket_chat_css_in_js__WEBPACK_IMPORTED_MODULE_0__.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: relative;\n\n &::-webkit-scrollbar {\n width: ", "rem;\n height: ", "rem;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.05);\n background-color: var(\n --rcx-theme-scrollbar-thumb-color,\n rgba(0, 0, 0, 0.05)\n );\n }\n\n &:hover::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.15);\n background-color: var(\n --rcx-theme-scrollbar-thumb-hover-color,\n rgba(0, 0, 0, 0.15)\n );\n }\n\n ", "\n ", "\n "], ["\n position: relative;\n\n &::-webkit-scrollbar {\n width: ", "rem;\n height: ", "rem;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.05);\n background-color: var(\n --rcx-theme-scrollbar-thumb-color,\n rgba(0, 0, 0, 0.05)\n );\n }\n\n &:hover::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.15);\n background-color: var(\n --rcx-theme-scrollbar-thumb-hover-color,\n rgba(0, 0, 0, 0.15)\n );\n }\n\n ", "\n ", "\n "])), 4 / 16, 4 / 16, (horizontal && (0,_rocket_chat_css_in_js__WEBPACK_IMPORTED_MODULE_0__.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n overflow-x: auto !important;\n "], ["\n overflow-x: auto !important;\n "])))) ||
12880
+ (vertical && (0,_rocket_chat_css_in_js__WEBPACK_IMPORTED_MODULE_0__.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n overflow-y: auto !important;\n "], ["\n overflow-y: auto !important;\n "])))) || (0,_rocket_chat_css_in_js__WEBPACK_IMPORTED_MODULE_0__.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n overflow: auto !important;\n "], ["\n overflow: auto !important;\n "]))), smooth && (0,_rocket_chat_css_in_js__WEBPACK_IMPORTED_MODULE_0__.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n scroll-behavior: smooth !important;\n "], ["\n scroll-behavior: smooth !important;\n "])))), null);
12881
+ var transformFn = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (props) {
12882
+ props.className =
12883
+ className && (0,_helpers_appendClassName__WEBPACK_IMPORTED_MODULE_3__.appendClassName)(props.className, className);
12884
+ if (onScrollContent !== undefined && props.onScroll === undefined) {
12885
+ props.onScroll = handleScroll;
12886
+ }
12887
+ return props;
12888
+ }, [className, handleScroll, onScrollContent]);
12889
+ return (react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_Box_BoxTransforms__WEBPACK_IMPORTED_MODULE_5__.BoxTransforms.Provider, { children: children, value: (0,_Box_BoxTransforms__WEBPACK_IMPORTED_MODULE_5__.useComposedBoxTransform)(transformFn) }));
12890
+ };
12891
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
12829
12892
 
12830
12893
 
12831
12894
  /***/ }),
12832
12895
 
12833
- /***/ "./src/components/Select/index.ts":
12834
- /*!****************************************!*\
12835
- !*** ./src/components/Select/index.ts ***!
12836
- \****************************************/
12896
+ /***/ "./src/components/Scrollable/index.ts":
12897
+ /*!********************************************!*\
12898
+ !*** ./src/components/Scrollable/index.ts ***!
12899
+ \********************************************/
12837
12900
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12838
12901
 
12839
12902
  "use strict";
12840
12903
  __webpack_require__.r(__webpack_exports__);
12841
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12842
- /* harmony export */ "Select": function() { return /* reexport safe */ _Select__WEBPACK_IMPORTED_MODULE_0__.Select; },
12843
- /* harmony export */ "SelectFiltered": function() { return /* reexport safe */ _SelectFiltered__WEBPACK_IMPORTED_MODULE_1__.SelectFiltered; }
12844
- /* harmony export */ });
12845
- /* harmony import */ var _Select__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Select */ "./src/components/Select/Select.tsx");
12846
- /* harmony import */ var _SelectFiltered__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SelectFiltered */ "./src/components/Select/SelectFiltered.tsx");
12847
-
12904
+ /* harmony import */ var _Scrollable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Scrollable */ "./src/components/Scrollable/Scrollable.tsx");
12848
12905
 
12906
+ /* harmony default export */ __webpack_exports__["default"] = (_Scrollable__WEBPACK_IMPORTED_MODULE_0__.Scrollable);
12849
12907
 
12850
12908
 
12851
12909
  /***/ }),
12852
12910
 
12853
- /***/ "./src/components/SelectInput/SelectInput.tsx":
12911
+ /***/ "./src/components/SearchInput/SearchInput.tsx":
12854
12912
  /*!****************************************************!*\
12855
- !*** ./src/components/SelectInput/SelectInput.tsx ***!
12913
+ !*** ./src/components/SearchInput/SearchInput.tsx ***!
12856
12914
  \****************************************************/
12857
12915
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12858
12916
 
12859
12917
  "use strict";
12860
12918
  __webpack_require__.r(__webpack_exports__);
12861
12919
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12862
- /* harmony export */ "SelectInput": function() { return /* binding */ SelectInput; }
12920
+ /* harmony export */ "SearchInput": function() { return /* binding */ SearchInput; }
12863
12921
  /* harmony export */ });
12864
12922
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
12865
12923
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
12866
- /* harmony import */ var _Icon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts");
12867
- /* harmony import */ var _InputBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
12924
+ /* harmony import */ var _InputBox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
12868
12925
  var __assign = (undefined && undefined.__assign) || function () {
12869
12926
  __assign = Object.assign || function(t) {
12870
12927
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -12876,103 +12933,56 @@ var __assign = (undefined && undefined.__assign) || function () {
12876
12933
  };
12877
12934
  return __assign.apply(this, arguments);
12878
12935
  };
12879
- var __rest = (undefined && undefined.__rest) || function (s, e) {
12880
- var t = {};
12881
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
12882
- t[p] = s[p];
12883
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
12884
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
12885
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
12886
- t[p[i]] = s[p[i]];
12887
- }
12888
- return t;
12889
- };
12890
- var __read = (undefined && undefined.__read) || function (o, n) {
12891
- var m = typeof Symbol === "function" && o[Symbol.iterator];
12892
- if (!m) return o;
12893
- var i = m.call(o), r, ar = [], e;
12894
- try {
12895
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
12896
- }
12897
- catch (error) { e = { error: error }; }
12898
- finally {
12899
- try {
12900
- if (r && !r.done && (m = i["return"])) m.call(i);
12901
- }
12902
- finally { if (e) throw e.error; }
12903
- }
12904
- return ar;
12905
- };
12906
-
12907
12936
 
12908
12937
 
12909
- var SelectInput = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function SelectInput(_a, ref) {
12910
- var children = _a.children, multiple = _a.multiple, placeholder = _a.placeholder, onChange = _a.onChange, props = __rest(_a, ["children", "multiple", "placeholder", "onChange"]);
12911
- var _b = __read((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!props.value && !props.defaultValue), 2), isPlaceholderVisible = _b[0], setPlaceholderVisible = _b[1];
12912
- var handleChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (event) {
12913
- setPlaceholderVisible(!event.currentTarget.value);
12914
- onChange === null || onChange === void 0 ? void 0 : onChange.call(event.currentTarget, event);
12915
- }, [onChange]);
12916
- if (multiple) {
12917
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_2__.InputBox, __assign({ children: children }, props, { multiple: true, type: 'select', onChange: handleChange })));
12918
- }
12919
- return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_2__.InputBox, __assign({ placeholderVisible: isPlaceholderVisible ? !!placeholder : undefined, ref: ref }, props, { addon: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Icon__WEBPACK_IMPORTED_MODULE_1__.Icon, { name: 'chevron-down', size: 'x20' }), type: 'select', onChange: handleChange }),
12920
- placeholder && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_2__.InputBox.Placeholder, { value: '' }, placeholder)),
12921
- children));
12938
+ var SearchInput = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function SearchInput(props, ref) {
12939
+ return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_1__.InputBox, __assign({ type: 'search', ref: ref }, props));
12922
12940
  });
12923
12941
 
12924
12942
 
12925
12943
  /***/ }),
12926
12944
 
12927
- /***/ "./src/components/SelectInput/index.ts":
12928
- /*!*********************************************!*\
12929
- !*** ./src/components/SelectInput/index.ts ***!
12930
- \*********************************************/
12945
+ /***/ "./src/components/SearchInput/index.tsx":
12946
+ /*!**********************************************!*\
12947
+ !*** ./src/components/SearchInput/index.tsx ***!
12948
+ \**********************************************/
12931
12949
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12932
12950
 
12933
12951
  "use strict";
12934
12952
  __webpack_require__.r(__webpack_exports__);
12935
12953
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12936
- /* harmony export */ "SelectInput": function() { return /* reexport safe */ _SelectInput__WEBPACK_IMPORTED_MODULE_1__.SelectInput; },
12937
- /* harmony export */ "SelectInputOption": function() { return /* binding */ SelectInputOption; }
12954
+ /* harmony export */ "SearchInput": function() { return /* reexport safe */ _SearchInput__WEBPACK_IMPORTED_MODULE_0__.SearchInput; }
12938
12955
  /* harmony export */ });
12939
- /* harmony import */ var _InputBox_Option__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../InputBox/Option */ "./src/components/InputBox/Option.tsx");
12940
- /* harmony import */ var _SelectInput__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SelectInput */ "./src/components/SelectInput/SelectInput.tsx");
12941
-
12956
+ /* harmony import */ var _SearchInput__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SearchInput */ "./src/components/SearchInput/SearchInput.tsx");
12942
12957
 
12943
- var SelectInputOption = _InputBox_Option__WEBPACK_IMPORTED_MODULE_0__.Option;
12944
12958
 
12945
12959
 
12946
12960
  /***/ }),
12947
12961
 
12948
- /***/ "./src/components/SelectPaginated/PaginatedMultiSelect.tsx":
12949
- /*!*****************************************************************!*\
12950
- !*** ./src/components/SelectPaginated/PaginatedMultiSelect.tsx ***!
12951
- \*****************************************************************/
12962
+ /***/ "./src/components/Select/Select.tsx":
12963
+ /*!******************************************!*\
12964
+ !*** ./src/components/Select/Select.tsx ***!
12965
+ \******************************************/
12952
12966
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
12953
12967
 
12954
12968
  "use strict";
12955
12969
  __webpack_require__.r(__webpack_exports__);
12956
12970
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12957
- /* harmony export */ "PaginatedMultiSelect": function() { return /* binding */ PaginatedMultiSelect; },
12958
- /* harmony export */ "PaginatedMultiSelectFiltered": function() { return /* binding */ PaginatedMultiSelectFiltered; }
12971
+ /* harmony export */ "Select": function() { return /* binding */ Select; }
12959
12972
  /* harmony export */ });
12960
12973
  /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
12961
12974
  /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__);
12962
12975
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
12963
12976
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
12964
- /* harmony import */ var _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../AnimatedVisibility */ "./src/components/AnimatedVisibility/index.ts");
12965
- /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
12966
- /* harmony import */ var _Chip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Chip */ "./src/components/Chip/index.ts");
12967
- /* harmony import */ var _Flex__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Flex */ "./src/components/Flex/index.ts");
12968
- /* harmony import */ var _Icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts");
12969
- /* harmony import */ var _InputBox__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
12970
- /* harmony import */ var _Margins__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Margins */ "./src/components/Margins/index.ts");
12971
- /* harmony import */ var _Options_useVisible__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../Options/useVisible */ "./src/components/Options/useVisible.ts");
12972
- /* harmony import */ var _OptionsPaginated__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../OptionsPaginated */ "./src/components/OptionsPaginated/index.ts");
12973
- /* harmony import */ var _Position__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../Position */ "./src/components/Position/index.ts");
12974
- /* harmony import */ var _Select_SelectAddon__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../Select/SelectAddon */ "./src/components/Select/SelectAddon.tsx");
12975
- /* harmony import */ var _Select_SelectFocus__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../Select/SelectFocus */ "./src/components/Select/SelectFocus.tsx");
12977
+ /* harmony import */ var _helpers_isForwardRefType__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/isForwardRefType */ "./src/helpers/isForwardRefType.ts");
12978
+ /* harmony import */ var _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../AnimatedVisibility */ "./src/components/AnimatedVisibility/index.ts");
12979
+ /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
12980
+ /* harmony import */ var _Icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts");
12981
+ /* harmony import */ var _Margins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Margins */ "./src/components/Margins/index.ts");
12982
+ /* harmony import */ var _Options__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Options */ "./src/components/Options/index.ts");
12983
+ /* harmony import */ var _PositionAnimated__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../PositionAnimated */ "./src/components/PositionAnimated/index.ts");
12984
+ /* harmony import */ var _SelectAddon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./SelectAddon */ "./src/components/Select/SelectAddon.tsx");
12985
+ /* harmony import */ var _SelectFocus__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./SelectFocus */ "./src/components/Select/SelectFocus.tsx");
12976
12986
  var __assign = (undefined && undefined.__assign) || function () {
12977
12987
  __assign = Object.assign || function(t) {
12978
12988
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -13011,13 +13021,6 @@ var __read = (undefined && undefined.__read) || function (o, n) {
13011
13021
  }
13012
13022
  return ar;
13013
13023
  };
13014
- var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {
13015
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
13016
- to[j] = from[i];
13017
- return to;
13018
- };
13019
- // @ts-nocheck
13020
-
13021
13024
 
13022
13025
 
13023
13026
 
@@ -13029,112 +13032,149 @@ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from
13029
13032
 
13030
13033
 
13031
13034
 
13032
-
13033
-
13034
- var SelectedOptions = (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(function (props) { return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Chip__WEBPACK_IMPORTED_MODULE_4__["default"], __assign({ maxWidth: '150px', withTruncatedText: true }, props))); });
13035
- var prevent = function (e) {
13036
- e.preventDefault();
13037
- e.stopPropagation();
13038
- e.nativeEvent.stopImmediatePropagation();
13035
+ var Wrapper = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (props, ref) { return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_4__.Box, __assign({ is: 'div', "rcx-select__wrapper": true, ref: ref }, props))); });
13036
+ var useDidUpdate = function (func, deps) {
13037
+ var didMount = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);
13038
+ var fn = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(func);
13039
+ (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
13040
+ if (didMount.current) {
13041
+ fn();
13042
+ }
13043
+ didMount.current = true;
13044
+ }, deps || []);
13039
13045
  };
13040
- var PaginatedMultiSelect = function (_a) {
13041
- var withTitle = _a.withTitle, value = _a.value, filter = _a.filter, _b = _a.options, options = _b === void 0 ? [] : _b, error = _a.error, disabled = _a.disabled, _c = _a.anchor, Anchor = _c === void 0 ? _Select_SelectFocus__WEBPACK_IMPORTED_MODULE_13__["default"] : _c, _d = _a.onChange, onChange = _d === void 0 ? function () { } : _d, placeholder = _a.placeholder, _e = _a.renderOptions, _Options = _e === void 0 ? _OptionsPaginated__WEBPACK_IMPORTED_MODULE_10__.OptionsPaginated : _e, endReached = _a.endReached, props = __rest(_a, ["withTitle", "value", "filter", "options", "error", "disabled", "anchor", "onChange", "placeholder", "renderOptions", "endReached"]);
13042
- var _f = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(value || []), 2), internalValue = _f[0], setInternalValue = _f[1];
13043
- var currentValue = value !== undefined ? value : internalValue;
13044
- var option = options.find(function (option) { return option.value === currentValue; });
13045
- var internalChanged = function (_a) {
13046
+ var Select = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (_a, ref) {
13047
+ var value = _a.value, filter = _a.filter, error = _a.error, disabled = _a.disabled, _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.anchor, Anchor = _c === void 0 ? _SelectFocus__WEBPACK_IMPORTED_MODULE_10__["default"] : _c, _d = _a.onChange, onChange = _d === void 0 ? function () { } : _d, _e = _a.getValue, getValue = _e === void 0 ? function (_a) {
13048
+ var _b = _a === void 0 ? ['', ''] : _a, _c = __read(_b, 1), value = _c[0];
13049
+ return value;
13050
+ } : _e, _f = _a.getLabel, getLabel = _f === void 0 ? function (_a) {
13051
+ var _b = _a === void 0 ? ['', ''] : _a, _c = __read(_b, 2), _ = _c[0], label = _c[1];
13052
+ return label;
13053
+ } : _f, _g = _a.placeholder, placeholder = _g === void 0 ? '' : _g, renderItem = _a.renderItem, RenderSelected = _a.renderSelected, _h = _a.renderOptions, _Options = _h === void 0 ? _Options__WEBPACK_IMPORTED_MODULE_7__.Options : _h, addonIcon = _a.addonIcon, customEmpty = _a.customEmpty, props = __rest(_a, ["value", "filter", "error", "disabled", "options", "anchor", "onChange", "getValue", "getLabel", "placeholder", "renderItem", "renderSelected", "renderOptions", "addonIcon", "customEmpty"]);
13054
+ var _j = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(value || ''), 2), internalValue = _j[0], setInternalValue = _j[1];
13055
+ var internalChangedByKeyboard = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(function (_a) {
13046
13056
  var _b = __read(_a, 1), value = _b[0];
13047
- if (currentValue.some(function (item) { return item.value === value.value; })) {
13048
- var newValue_1 = currentValue.filter(function (item) { return item.value !== value.value; });
13049
- setInternalValue(newValue_1);
13050
- return onChange(newValue_1);
13057
+ setInternalValue(value);
13058
+ onChange(value);
13059
+ });
13060
+ var option = options.find(function (option) { return getValue(option) === internalValue; });
13061
+ var index = options.indexOf(option);
13062
+ var filteredOptions = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
13063
+ var mapOptions = function (_a) {
13064
+ var _b = __read(_a, 2), value = _b[0], label = _b[1];
13065
+ if (internalValue === value) {
13066
+ return [value, label, true];
13067
+ }
13068
+ return [value, label];
13069
+ };
13070
+ var applyFilter = function (_a) {
13071
+ var _b = __read(_a, 2), option = _b[1];
13072
+ return !filter || ~option.toLowerCase().indexOf(filter.toLowerCase());
13073
+ };
13074
+ return options.filter(applyFilter).map(mapOptions);
13075
+ }, [options, internalValue, filter]);
13076
+ var _k = __read((0,_Options__WEBPACK_IMPORTED_MODULE_7__.useCursor)(index, filteredOptions, internalChangedByKeyboard), 5), cursor = _k[0], handleKeyDown = _k[1], handleKeyUp = _k[2], reset = _k[3], _l = __read(_k[4], 3), visible = _l[0], hide = _l[1], show = _l[2];
13077
+ var internalChangedByClick = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(function (_a) {
13078
+ var _b = __read(_a, 1), value = _b[0];
13079
+ setInternalValue(value);
13080
+ onChange(value);
13081
+ hide();
13082
+ });
13083
+ var innerRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
13084
+ var anchorRef = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMergedRefs)(ref, innerRef);
13085
+ var renderAnchor = function (params) {
13086
+ if ((0,_helpers_isForwardRefType__WEBPACK_IMPORTED_MODULE_2__.isForwardRefType)(Anchor)) {
13087
+ return react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Anchor, __assign({}, params));
13051
13088
  }
13052
- var newValue = __spreadArray(__spreadArray([], __read(currentValue)), [value]);
13053
- setInternalValue(newValue);
13054
- return onChange(newValue);
13089
+ if (typeof Anchor === 'function') {
13090
+ return Anchor(params);
13091
+ }
13092
+ return null;
13055
13093
  };
13056
- var _g = __read((0,_Options_useVisible__WEBPACK_IMPORTED_MODULE_9__.useVisible)(), 3), visible = _g[0], hide = _g[1], show = _g[2];
13057
- var ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
13058
- var _h = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useResizeObserver)(), containerRef = _h.ref, borderBoxSize = _h.borderBoxSize;
13094
+ var _m = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useResizeObserver)(), containerRef = _m.ref, borderBoxSize = _m.borderBoxSize;
13095
+ useDidUpdate(reset, [filter, internalValue]);
13096
+ var valueLabel = getLabel(option);
13097
+ var visibleText = (filter === undefined || visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_3__["default"].HIDDEN) &&
13098
+ (valueLabel || placeholder || typeof placeholder === 'string');
13059
13099
  var handleClick = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(function () {
13060
- if (visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__["default"].VISIBLE) {
13100
+ var _a;
13101
+ if (visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_3__["default"].VISIBLE) {
13061
13102
  return hide();
13062
13103
  }
13063
- if (ref && ref.current) {
13064
- ref.current.focus();
13065
- return show();
13066
- }
13104
+ (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
13105
+ return show();
13067
13106
  });
13068
- return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_3__.Box, __assign({ is: 'div', "rcx-select": true, className: [error && 'invalid', disabled && 'disabled'], ref: containerRef, onClick: handleClick, disabled: disabled }, props),
13069
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Flex__WEBPACK_IMPORTED_MODULE_5__["default"].Item, { grow: 1 },
13070
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Margins__WEBPACK_IMPORTED_MODULE_8__["default"], { inline: 'x4' },
13071
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Flex__WEBPACK_IMPORTED_MODULE_5__["default"].Container, null,
13072
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_3__.Box, { is: 'div' },
13073
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_3__.Box, { is: 'div', display: 'flex', alignItems: 'center', flexWrap: 'wrap', margin: '-x8', role: 'listbox' },
13074
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Margins__WEBPACK_IMPORTED_MODULE_8__["default"], { all: 'x4' },
13075
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Anchor, { disabled: disabled, ref: ref, "aria-haspopup": 'listbox', onClick: show, onBlur: hide, order: 1, "rcx-input-box--undecorated": true, children: !value ? option || placeholder : null }),
13076
- currentValue.map(function (value, index) {
13077
- var _a, _b;
13078
- return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(SelectedOptions, __assign({}, (withTitle && {
13079
- title: value.label ||
13080
- ((_a = options.find(function (val) {
13081
- return val.value === value;
13082
- })) === null || _a === void 0 ? void 0 : _a.label),
13083
- }), { tabIndex: -1, role: 'option', key: index, onMouseDown: function (e) {
13084
- prevent(e);
13085
- internalChanged([value]);
13086
- return false;
13087
- }, children: value.label ||
13088
- ((_b = options.find(function (val) {
13089
- return val.value === value;
13090
- })) === null || _b === void 0 ? void 0 : _b.label) })));
13091
- }))))))),
13092
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Flex__WEBPACK_IMPORTED_MODULE_5__["default"].Item, { grow: 0, shrink: 0 },
13093
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Margins__WEBPACK_IMPORTED_MODULE_8__["default"], { inline: 'x4' },
13094
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Select_SelectAddon__WEBPACK_IMPORTED_MODULE_12__["default"], { children: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Icon__WEBPACK_IMPORTED_MODULE_6__.Icon, { name: visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__["default"].VISIBLE
13095
- ? 'cross'
13096
- : 'chevron-down', size: 'x20' }) }))),
13097
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__["default"], { visibility: visible },
13098
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Position__WEBPACK_IMPORTED_MODULE_11__["default"], { anchor: containerRef },
13099
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Options, __assign({}, (withTitle && { title: withTitle }), { width: borderBoxSize.inlineSize, onMouseDown: prevent, multiple: true, filter: filter, role: 'listbox', options: options, onSelect: internalChanged, endReached: endReached }))))));
13100
- };
13101
- var PaginatedMultiSelectFiltered = function (_a) {
13102
- var filter = _a.filter, setFilter = _a.setFilter, options = _a.options, placeholder = _a.placeholder, props = __rest(_a, ["filter", "setFilter", "options", "placeholder"]);
13103
- var anchor = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (_a, ref) {
13104
- var _children = _a.children, filter = _a.filter, props = __rest(_a, ["children", "filter"]);
13105
- return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Flex__WEBPACK_IMPORTED_MODULE_5__["default"].Item, { grow: 1 },
13106
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_7__.InputBox.Input, __assign({ ref: ref, placeholder: placeholder, value: filter, onInput: function (e) {
13107
- return setFilter &&
13108
- setFilter(e.currentTarget.value);
13109
- } }, props, { "rcx-input-box--undecorated": true }))));
13110
- }), []);
13111
- return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(PaginatedMultiSelect, __assign({ filter: filter, options: options }, props, { anchor: anchor })));
13107
+ return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_4__.Box, __assign({ "rcx-select": true, disabled: disabled, ref: containerRef, onClick: handleClick, className: (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () { return [error && 'invalid', disabled && 'disabled']; }, [error, disabled]) }, props),
13108
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Wrapper, { display: 'flex', mi: 'neg-x4', "rcx-select__wrapper--hidden": !!visibleText },
13109
+ visibleText &&
13110
+ (RenderSelected ? (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(RenderSelected, { role: 'option', value: getValue(option), label: valueLabel, key: getValue(option), onClick: internalChangedByClick })) : (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_4__.Box, { flexGrow: 1, is: 'span', mi: 'x4', "rcx-select__item": true, fontScale: 'p2', color: valueLabel ? 'default' : 'hint' }, visibleText))),
13111
+ renderAnchor({
13112
+ ref: anchorRef,
13113
+ children: !value ? option || placeholder : null,
13114
+ disabled: disabled !== null && disabled !== void 0 ? disabled : false,
13115
+ onClick: show,
13116
+ onBlur: hide,
13117
+ onKeyDown: handleKeyDown,
13118
+ onKeyUp: handleKeyUp,
13119
+ }),
13120
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Margins__WEBPACK_IMPORTED_MODULE_6__["default"], { inline: 'x4' },
13121
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_SelectAddon__WEBPACK_IMPORTED_MODULE_9__["default"], { children: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Icon__WEBPACK_IMPORTED_MODULE_5__.Icon, { name: visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_3__["default"].VISIBLE
13122
+ ? 'cross'
13123
+ : addonIcon || 'chevron-down', size: 'x20' }) }))),
13124
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_PositionAnimated__WEBPACK_IMPORTED_MODULE_8__["default"], { visible: visible, anchor: containerRef },
13125
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Options, { width: borderBoxSize.inlineSize, role: 'listbox', filter: filter, options: filteredOptions, onSelect: internalChangedByClick, renderItem: renderItem, cursor: cursor, customEmpty: customEmpty }))));
13126
+ });
13127
+
13128
+
13129
+ /***/ }),
13130
+
13131
+ /***/ "./src/components/Select/SelectAddon.tsx":
13132
+ /*!***********************************************!*\
13133
+ !*** ./src/components/Select/SelectAddon.tsx ***!
13134
+ \***********************************************/
13135
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
13136
+
13137
+ "use strict";
13138
+ __webpack_require__.r(__webpack_exports__);
13139
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
13140
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
13141
+ /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
13142
+ var __assign = (undefined && undefined.__assign) || function () {
13143
+ __assign = Object.assign || function(t) {
13144
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
13145
+ s = arguments[i];
13146
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
13147
+ t[p] = s[p];
13148
+ }
13149
+ return t;
13150
+ };
13151
+ return __assign.apply(this, arguments);
13112
13152
  };
13113
13153
 
13114
13154
 
13155
+ var SelectAddon = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function SelectAddon(props, ref) {
13156
+ return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, __assign({ is: 'div', "rcx-select__addon": true, ref: ref }, props));
13157
+ });
13158
+ /* harmony default export */ __webpack_exports__["default"] = (SelectAddon);
13159
+
13160
+
13115
13161
  /***/ }),
13116
13162
 
13117
- /***/ "./src/components/SelectPaginated/PaginatedSelect.tsx":
13118
- /*!************************************************************!*\
13119
- !*** ./src/components/SelectPaginated/PaginatedSelect.tsx ***!
13120
- \************************************************************/
13163
+ /***/ "./src/components/Select/SelectFiltered.tsx":
13164
+ /*!**************************************************!*\
13165
+ !*** ./src/components/Select/SelectFiltered.tsx ***!
13166
+ \**************************************************/
13121
13167
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
13122
13168
 
13123
13169
  "use strict";
13124
13170
  __webpack_require__.r(__webpack_exports__);
13125
13171
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13126
- /* harmony export */ "PaginatedSelect": function() { return /* binding */ PaginatedSelect; }
13172
+ /* harmony export */ "SelectFiltered": function() { return /* binding */ SelectFiltered; }
13127
13173
  /* harmony export */ });
13128
- /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
13129
- /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__);
13130
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
13131
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
13132
- /* harmony import */ var _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../AnimatedVisibility */ "./src/components/AnimatedVisibility/index.ts");
13133
- /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
13134
- /* harmony import */ var _Icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts");
13135
- /* harmony import */ var _Options_useVisible__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Options/useVisible */ "./src/components/Options/useVisible.ts");
13136
- /* harmony import */ var _OptionsPaginated__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../OptionsPaginated */ "./src/components/OptionsPaginated/index.ts");
13137
- /* harmony import */ var _PositionAnimated__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../PositionAnimated */ "./src/components/PositionAnimated/index.ts");
13174
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
13175
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
13176
+ /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! . */ "./src/components/Select/index.ts");
13177
+ /* harmony import */ var _SelectFilteredAnchor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SelectFilteredAnchor */ "./src/components/Select/SelectFilteredAnchor.tsx");
13138
13178
  var __assign = (undefined && undefined.__assign) || function () {
13139
13179
  __assign = Object.assign || function(t) {
13140
13180
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -13173,91 +13213,131 @@ var __read = (undefined && undefined.__read) || function (o, n) {
13173
13213
  }
13174
13214
  return ar;
13175
13215
  };
13176
- // @ts-nocheck
13177
-
13178
13216
 
13179
13217
 
13180
13218
 
13219
+ var SelectFiltered = function (_a) {
13220
+ var options = _a.options, placeholder = _a.placeholder, propFilter = _a.filter, propSetFilter = _a.setFilter, props = __rest(_a, ["options", "placeholder", "filter", "setFilter"]);
13221
+ var _b = __read((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''), 2), filter = _b[0], setFilter = _b[1];
13222
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(___WEBPACK_IMPORTED_MODULE_1__.Select, __assign({ placeholder: placeholder, filter: propFilter || filter, options: options }, props, { anchor: function (params) { return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_SelectFilteredAnchor__WEBPACK_IMPORTED_MODULE_2__["default"], __assign({ placeholder: placeholder, filter: propFilter || filter, onChangeFilter: propSetFilter || setFilter }, params))); } })));
13223
+ };
13181
13224
 
13182
13225
 
13226
+ /***/ }),
13183
13227
 
13228
+ /***/ "./src/components/Select/SelectFilteredAnchor.tsx":
13229
+ /*!********************************************************!*\
13230
+ !*** ./src/components/Select/SelectFilteredAnchor.tsx ***!
13231
+ \********************************************************/
13232
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
13184
13233
 
13185
- var Addon = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (props, ref) { return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_3__.Box, __assign({ is: 'div', "rcx-select__addon": true, ref: ref }, props))); });
13186
- var Wrapper = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (props, ref) { return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_3__.Box, __assign({ is: 'div', "rcx-select__wrapper": true, ref: ref }, props))); });
13187
- var Focus = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (props, ref) { return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_3__.Box, __assign({ ref: ref, fontScale: 'p2m', color: 'hint', "rcx-select__focus": true, is: 'button', type: 'button' }, props))); });
13188
- var prevent = function (e) {
13189
- e.preventDefault();
13190
- e.stopPropagation();
13191
- e.nativeEvent.stopImmediatePropagation();
13192
- };
13193
- var useDidUpdate = function (func) {
13194
- var didMount = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);
13195
- var fn = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(func);
13196
- (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
13197
- if (didMount.current) {
13198
- fn();
13234
+ "use strict";
13235
+ __webpack_require__.r(__webpack_exports__);
13236
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
13237
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
13238
+ /* harmony import */ var _InputBox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
13239
+ var __assign = (undefined && undefined.__assign) || function () {
13240
+ __assign = Object.assign || function(t) {
13241
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
13242
+ s = arguments[i];
13243
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
13244
+ t[p] = s[p];
13199
13245
  }
13200
- didMount.current = true;
13201
- }, [fn]);
13246
+ return t;
13247
+ };
13248
+ return __assign.apply(this, arguments);
13202
13249
  };
13203
- var PaginatedSelect = function (_a) {
13204
- var value = _a.value, withTitle = _a.withTitle, filter = _a.filter, _setFilter = _a.setFilter, error = _a.error, disabled = _a.disabled, _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.anchor, Anchor = _c === void 0 ? Focus : _c, _d = _a.onChange, onChange = _d === void 0 ? function () { } : _d, _e = _a.placeholder, placeholder = _e === void 0 ? '' : _e, _f = _a.renderOptions, _Options = _f === void 0 ? _OptionsPaginated__WEBPACK_IMPORTED_MODULE_6__.OptionsPaginated : _f, endReached = _a.endReached, props = __rest(_a, ["value", "withTitle", "filter", "setFilter", "error", "disabled", "options", "anchor", "onChange", "placeholder", "renderOptions", "endReached"]);
13205
- var _g = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(value), 2), internalValue = _g[0], setInternalValue = _g[1];
13206
- var currentValue = value !== undefined ? value : internalValue;
13207
- var option = options.find(function (option) { return (option === null || option === void 0 ? void 0 : option.value) === currentValue; });
13208
- var _h = __read((0,_Options_useVisible__WEBPACK_IMPORTED_MODULE_5__.useVisible)(), 3), visible = _h[0], hide = _h[1], show = _h[2];
13209
- var internalChangedByClick = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(function (_a) {
13210
- var _b = __read(_a, 1), value = _b[0];
13211
- setInternalValue(value);
13212
- onChange(value);
13213
- hide();
13214
- });
13215
- var ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
13216
- var _j = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useResizeObserver)(), containerRef = _j.ref, borderBoxSize = _j.borderBoxSize;
13217
- useDidUpdate([filter, internalValue]);
13218
- var valueLabel = option === null || option === void 0 ? void 0 : option.label;
13219
- var visibleText = (filter === undefined || visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__["default"].HIDDEN) &&
13220
- (valueLabel || placeholder || typeof placeholder === 'string');
13221
- var handleClick = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(function () {
13222
- if (visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__["default"].VISIBLE) {
13223
- return hide();
13250
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
13251
+ var t = {};
13252
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13253
+ t[p] = s[p];
13254
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
13255
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
13256
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
13257
+ t[p[i]] = s[p[i]];
13224
13258
  }
13225
- if (ref && ref.current) {
13226
- ref.current.focus();
13227
- return show();
13259
+ return t;
13260
+ };
13261
+
13262
+
13263
+ var SelectFilteredAnchor = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function SelectFilteredAnchor(_a, ref) {
13264
+ var _children = _a.children, filter = _a.filter, onChangeFilter = _a.onChangeFilter, placeholder = _a.placeholder, props = __rest(_a, ["children", "filter", "onChangeFilter", "placeholder"]);
13265
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_1__.InputBox.Input, __assign({ mi: 'x4', flexGrow: 1, className: 'rcx-select__focus', ref: ref, placeholder: placeholder, value: filter, onInput: function (e) {
13266
+ return onChangeFilter(e.currentTarget.value);
13267
+ } }, props, { "rcx-input-box--undecorated": true })));
13268
+ });
13269
+ /* harmony default export */ __webpack_exports__["default"] = (SelectFilteredAnchor);
13270
+
13271
+
13272
+ /***/ }),
13273
+
13274
+ /***/ "./src/components/Select/SelectFocus.tsx":
13275
+ /*!***********************************************!*\
13276
+ !*** ./src/components/Select/SelectFocus.tsx ***!
13277
+ \***********************************************/
13278
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
13279
+
13280
+ "use strict";
13281
+ __webpack_require__.r(__webpack_exports__);
13282
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
13283
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
13284
+ /* harmony import */ var _Box__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Box */ "./src/components/Box/index.js");
13285
+ var __assign = (undefined && undefined.__assign) || function () {
13286
+ __assign = Object.assign || function(t) {
13287
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
13288
+ s = arguments[i];
13289
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
13290
+ t[p] = s[p];
13228
13291
  }
13229
- });
13230
- return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_3__.Box, __assign({ "rcx-select": true, disabled: disabled, ref: containerRef, onClick: handleClick, className: (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () { return [error && 'invalid', disabled && 'disabled']; }, [error, disabled]) }, props),
13231
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Wrapper, { display: 'flex', mi: 'neg-x4', "rcx-select__wrapper--hidden": !!visibleText },
13232
- visibleText && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_3__.Box, { flexGrow: 1, is: 'span', mi: 'x4', "rcx-select__item": true, fontScale: 'p2m', color: valueLabel ? 'default' : 'hint' }, visibleText)),
13233
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Anchor, { disabled: disabled, "rcx-input-box--undecorated": true, filter: filter, ref: ref, "aria-haspopup": 'listbox', onClick: show, onBlur: hide }),
13234
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(Addon, { mi: 'x4', children: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Icon__WEBPACK_IMPORTED_MODULE_4__.Icon, { name: visible === _AnimatedVisibility__WEBPACK_IMPORTED_MODULE_2__["default"].VISIBLE
13235
- ? 'cross'
13236
- : 'chevron-down', size: 'x20' }) })),
13237
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_PositionAnimated__WEBPACK_IMPORTED_MODULE_7__["default"], { visible: visible, anchor: containerRef },
13238
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Options, __assign({}, (withTitle && { title: withTitle }), { width: borderBoxSize.inlineSize, role: 'listbox', filter: filter, options: options, onSelect: internalChangedByClick, endReached: endReached, onMouseDown: prevent })))));
13292
+ return t;
13293
+ };
13294
+ return __assign.apply(this, arguments);
13239
13295
  };
13240
13296
 
13241
13297
 
13298
+ var SelectFocus = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function SelectFocus(props, ref) {
13299
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Box__WEBPACK_IMPORTED_MODULE_1__.Box, __assign({ ref: ref, fontScale: 'p2m', color: 'hint', "rcx-select__focus": true, is: 'button', type: 'button' }, props)));
13300
+ });
13301
+ /* harmony default export */ __webpack_exports__["default"] = (SelectFocus);
13302
+
13303
+
13242
13304
  /***/ }),
13243
13305
 
13244
- /***/ "./src/components/SelectPaginated/PaginatedSelectFiltered.tsx":
13245
- /*!********************************************************************!*\
13246
- !*** ./src/components/SelectPaginated/PaginatedSelectFiltered.tsx ***!
13247
- \********************************************************************/
13306
+ /***/ "./src/components/Select/index.ts":
13307
+ /*!****************************************!*\
13308
+ !*** ./src/components/Select/index.ts ***!
13309
+ \****************************************/
13248
13310
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
13249
13311
 
13250
13312
  "use strict";
13251
13313
  __webpack_require__.r(__webpack_exports__);
13252
13314
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13253
- /* harmony export */ "PaginatedSelectFiltered": function() { return /* binding */ PaginatedSelectFiltered; }
13315
+ /* harmony export */ "Select": function() { return /* reexport safe */ _Select__WEBPACK_IMPORTED_MODULE_0__.Select; },
13316
+ /* harmony export */ "SelectFiltered": function() { return /* reexport safe */ _SelectFiltered__WEBPACK_IMPORTED_MODULE_1__.SelectFiltered; }
13254
13317
  /* harmony export */ });
13255
- /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
13256
- /* harmony import */ var _rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__);
13257
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
13258
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
13259
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! . */ "./src/components/SelectPaginated/index.ts");
13260
- /* harmony import */ var _InputBox__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
13318
+ /* harmony import */ var _Select__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Select */ "./src/components/Select/Select.tsx");
13319
+ /* harmony import */ var _SelectFiltered__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SelectFiltered */ "./src/components/Select/SelectFiltered.tsx");
13320
+
13321
+
13322
+
13323
+
13324
+ /***/ }),
13325
+
13326
+ /***/ "./src/components/SelectInput/SelectInput.tsx":
13327
+ /*!****************************************************!*\
13328
+ !*** ./src/components/SelectInput/SelectInput.tsx ***!
13329
+ \****************************************************/
13330
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
13331
+
13332
+ "use strict";
13333
+ __webpack_require__.r(__webpack_exports__);
13334
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13335
+ /* harmony export */ "SelectInput": function() { return /* binding */ SelectInput; }
13336
+ /* harmony export */ });
13337
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
13338
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
13339
+ /* harmony import */ var _Icon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts");
13340
+ /* harmony import */ var _InputBox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
13261
13341
  var __assign = (undefined && undefined.__assign) || function () {
13262
13342
  __assign = Object.assign || function(t) {
13263
13343
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -13299,45 +13379,41 @@ var __read = (undefined && undefined.__read) || function (o, n) {
13299
13379
 
13300
13380
 
13301
13381
 
13302
-
13303
- var PaginatedSelectFiltered = function (_a) {
13304
- var
13305
- // filter,
13306
- // setFilter,
13307
- options = _a.options, placeholder = _a.placeholder, props = __rest(_a, ["options", "placeholder"]);
13308
- var _b = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''), 2), filter = _b[0], setFilter = _b[1];
13309
- var anchor = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (_a, ref) {
13310
- var _children = _a.children, filter = _a.filter, _onChange = _a.onChange, props = __rest(_a, ["children", "filter", "onChange"]);
13311
- return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_3__.InputBox.Input, __assign({ mi: 'x4', flexGrow: 1, className: 'rcx-select__focus', ref: ref, placeholder: placeholder, value: filter, onChange: (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMutableCallback)(function (e) {
13312
- setFilter(e.currentTarget.value);
13313
- }) }, props, { "rcx-input-box--undecorated": true })));
13314
- }), []);
13315
- return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.PaginatedSelect, __assign({ placeholder: undefined, filter: filter, options: options }, props, { anchor: anchor })));
13316
- };
13382
+ var SelectInput = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function SelectInput(_a, ref) {
13383
+ var children = _a.children, multiple = _a.multiple, placeholder = _a.placeholder, onChange = _a.onChange, props = __rest(_a, ["children", "multiple", "placeholder", "onChange"]);
13384
+ var _b = __read((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!props.value && !props.defaultValue), 2), isPlaceholderVisible = _b[0], setPlaceholderVisible = _b[1];
13385
+ var handleChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (event) {
13386
+ setPlaceholderVisible(!event.currentTarget.value);
13387
+ onChange === null || onChange === void 0 ? void 0 : onChange.call(event.currentTarget, event);
13388
+ }, [onChange]);
13389
+ if (multiple) {
13390
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_2__.InputBox, __assign({ children: children }, props, { multiple: true, type: 'select', onChange: handleChange })));
13391
+ }
13392
+ return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_2__.InputBox, __assign({ placeholderVisible: isPlaceholderVisible ? !!placeholder : undefined, ref: ref }, props, { addon: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Icon__WEBPACK_IMPORTED_MODULE_1__.Icon, { name: 'chevron-down', size: 'x20' }), type: 'select', onChange: handleChange }),
13393
+ placeholder && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_InputBox__WEBPACK_IMPORTED_MODULE_2__.InputBox.Placeholder, { value: '' }, placeholder)),
13394
+ children));
13395
+ });
13317
13396
 
13318
13397
 
13319
13398
  /***/ }),
13320
13399
 
13321
- /***/ "./src/components/SelectPaginated/index.ts":
13322
- /*!*************************************************!*\
13323
- !*** ./src/components/SelectPaginated/index.ts ***!
13324
- \*************************************************/
13400
+ /***/ "./src/components/SelectInput/index.ts":
13401
+ /*!*********************************************!*\
13402
+ !*** ./src/components/SelectInput/index.ts ***!
13403
+ \*********************************************/
13325
13404
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
13326
13405
 
13327
13406
  "use strict";
13328
13407
  __webpack_require__.r(__webpack_exports__);
13329
13408
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13330
- /* harmony export */ "PaginatedSelect": function() { return /* reexport safe */ _PaginatedSelect__WEBPACK_IMPORTED_MODULE_0__.PaginatedSelect; },
13331
- /* harmony export */ "PaginatedSelectFiltered": function() { return /* reexport safe */ _PaginatedSelectFiltered__WEBPACK_IMPORTED_MODULE_1__.PaginatedSelectFiltered; },
13332
- /* harmony export */ "PaginatedMultiSelect": function() { return /* reexport safe */ _PaginatedMultiSelect__WEBPACK_IMPORTED_MODULE_2__.PaginatedMultiSelect; },
13333
- /* harmony export */ "PaginatedMultiSelectFiltered": function() { return /* reexport safe */ _PaginatedMultiSelect__WEBPACK_IMPORTED_MODULE_2__.PaginatedMultiSelectFiltered; }
13409
+ /* harmony export */ "SelectInput": function() { return /* reexport safe */ _SelectInput__WEBPACK_IMPORTED_MODULE_1__.SelectInput; },
13410
+ /* harmony export */ "SelectInputOption": function() { return /* binding */ SelectInputOption; }
13334
13411
  /* harmony export */ });
13335
- /* harmony import */ var _PaginatedSelect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PaginatedSelect */ "./src/components/SelectPaginated/PaginatedSelect.tsx");
13336
- /* harmony import */ var _PaginatedSelectFiltered__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PaginatedSelectFiltered */ "./src/components/SelectPaginated/PaginatedSelectFiltered.tsx");
13337
- /* harmony import */ var _PaginatedMultiSelect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PaginatedMultiSelect */ "./src/components/SelectPaginated/PaginatedMultiSelect.tsx");
13338
-
13412
+ /* harmony import */ var _InputBox_Option__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../InputBox/Option */ "./src/components/InputBox/Option.tsx");
13413
+ /* harmony import */ var _SelectInput__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SelectInput */ "./src/components/SelectInput/SelectInput.tsx");
13339
13414
 
13340
13415
 
13416
+ var SelectInputOption = _InputBox_Option__WEBPACK_IMPORTED_MODULE_0__.Option;
13341
13417
 
13342
13418
 
13343
13419
  /***/ }),
@@ -15405,10 +15481,8 @@ __webpack_require__.r(__webpack_exports__);
15405
15481
  /* harmony export */ "SearchInput": function() { return /* reexport safe */ _SearchInput__WEBPACK_IMPORTED_MODULE_41__.SearchInput; },
15406
15482
  /* harmony export */ "Select": function() { return /* reexport safe */ _Select__WEBPACK_IMPORTED_MODULE_42__.Select; },
15407
15483
  /* harmony export */ "SelectFiltered": function() { return /* reexport safe */ _Select__WEBPACK_IMPORTED_MODULE_42__.SelectFiltered; },
15408
- /* harmony export */ "PaginatedMultiSelect": function() { return /* reexport safe */ _SelectPaginated__WEBPACK_IMPORTED_MODULE_43__.PaginatedMultiSelect; },
15409
- /* harmony export */ "PaginatedMultiSelectFiltered": function() { return /* reexport safe */ _SelectPaginated__WEBPACK_IMPORTED_MODULE_43__.PaginatedMultiSelectFiltered; },
15410
- /* harmony export */ "PaginatedSelect": function() { return /* reexport safe */ _SelectPaginated__WEBPACK_IMPORTED_MODULE_43__.PaginatedSelect; },
15411
- /* harmony export */ "PaginatedSelectFiltered": function() { return /* reexport safe */ _SelectPaginated__WEBPACK_IMPORTED_MODULE_43__.PaginatedSelectFiltered; },
15484
+ /* harmony export */ "PaginatedMultiSelectFiltered": function() { return /* reexport safe */ _PaginatedSelect__WEBPACK_IMPORTED_MODULE_43__.PaginatedMultiSelectFiltered; },
15485
+ /* harmony export */ "PaginatedSelectFiltered": function() { return /* reexport safe */ _PaginatedSelect__WEBPACK_IMPORTED_MODULE_43__.PaginatedSelectFiltered; },
15412
15486
  /* harmony export */ "SelectInput": function() { return /* reexport safe */ _SelectInput__WEBPACK_IMPORTED_MODULE_44__.SelectInput; },
15413
15487
  /* harmony export */ "SelectInputOption": function() { return /* reexport safe */ _SelectInput__WEBPACK_IMPORTED_MODULE_44__.SelectInputOption; },
15414
15488
  /* harmony export */ "Sidebar": function() { return /* reexport safe */ _Sidebar__WEBPACK_IMPORTED_MODULE_45__["default"]; },
@@ -15510,7 +15584,7 @@ __webpack_require__.r(__webpack_exports__);
15510
15584
  /* harmony import */ var _Scrollable__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./Scrollable */ "./src/components/Scrollable/index.ts");
15511
15585
  /* harmony import */ var _SearchInput__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./SearchInput */ "./src/components/SearchInput/index.tsx");
15512
15586
  /* harmony import */ var _Select__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./Select */ "./src/components/Select/index.ts");
15513
- /* harmony import */ var _SelectPaginated__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./SelectPaginated */ "./src/components/SelectPaginated/index.ts");
15587
+ /* harmony import */ var _PaginatedSelect__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./PaginatedSelect */ "./src/components/PaginatedSelect/index.ts");
15514
15588
  /* harmony import */ var _SelectInput__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./SelectInput */ "./src/components/SelectInput/index.ts");
15515
15589
  /* harmony import */ var _Sidebar__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./Sidebar */ "./src/components/Sidebar/index.tsx");
15516
15590
  /* harmony import */ var _Skeleton__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./Skeleton */ "./src/components/Skeleton/index.tsx");
@@ -16171,9 +16245,7 @@ __webpack_require__.r(__webpack_exports__);
16171
16245
  /* harmony export */ "OptionSkeleton": function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_0__.OptionSkeleton; },
16172
16246
  /* harmony export */ "OptionTitle": function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_0__.OptionTitle; },
16173
16247
  /* harmony export */ "Options": function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_0__.Options; },
16174
- /* harmony export */ "PaginatedMultiSelect": function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_0__.PaginatedMultiSelect; },
16175
16248
  /* harmony export */ "PaginatedMultiSelectFiltered": function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_0__.PaginatedMultiSelectFiltered; },
16176
- /* harmony export */ "PaginatedSelect": function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_0__.PaginatedSelect; },
16177
16249
  /* harmony export */ "PaginatedSelectFiltered": function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_0__.PaginatedSelectFiltered; },
16178
16250
  /* harmony export */ "Pagination": function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_0__.Pagination; },
16179
16251
  /* harmony export */ "PasswordInput": function() { return /* reexport safe */ _components__WEBPACK_IMPORTED_MODULE_0__.PasswordInput; },
@@ -16270,7 +16342,7 @@ __webpack_require__.r(__webpack_exports__);
16270
16342
 
16271
16343
 
16272
16344
  if (true) {
16273
- console.log("fuselage: " + "0.31.5");
16345
+ console.log("fuselage: " + "0.31.6");
16274
16346
  }
16275
16347
 
16276
16348