@rocket.chat/fuselage 0.76.0 → 0.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Avatar/Avatar.d.ts +2 -2
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Box/stylingProps.d.ts +1 -0
- package/dist/components/Box/stylingProps.d.ts.map +1 -1
- package/dist/components/Button/ActionButton.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelectAnchor.d.ts +6 -4
- package/dist/components/MultiSelect/MultiSelectAnchor.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelectAnchorParams.d.ts +3 -0
- package/dist/components/MultiSelect/MultiSelectAnchorParams.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelectFiltered.d.ts +20 -1
- package/dist/components/MultiSelect/MultiSelectFiltered.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelectFilteredAnchor.d.ts +6 -4
- package/dist/components/MultiSelect/MultiSelectFilteredAnchor.d.ts.map +1 -1
- package/dist/components/Options/Options.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/fuselage.css +1 -1
- package/dist/fuselage.css.map +1 -1
- package/dist/fuselage.development.js +26 -14
- package/dist/fuselage.development.js.map +1 -1
- package/dist/fuselage.production.js +3 -3
- package/package.json +2 -3
|
@@ -745,12 +745,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
745
745
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
746
746
|
const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
|
747
747
|
const AvatarContainer_1 = __importDefault(__webpack_require__(/*! ./AvatarContainer */ "./src/components/Avatar/AvatarContainer.tsx"));
|
|
748
|
-
const Avatar = ({ size = 'x36', rounded = false, objectFit
|
|
748
|
+
const Avatar = ({ size = 'x36', rounded = false, objectFit, url, className, alt, ...props }) => {
|
|
749
749
|
const innerClass = [
|
|
750
750
|
'rcx-avatar__element',
|
|
751
|
-
objectFit && 'rcx-avatar__element--object-fit',
|
|
752
751
|
size && `rcx-avatar__element--${size}`,
|
|
753
752
|
rounded && 'rcx-avatar__element--rounded',
|
|
753
|
+
objectFit && `rcx-avatar__element--object-fit-${objectFit}`,
|
|
754
754
|
]
|
|
755
755
|
.filter(Boolean)
|
|
756
756
|
.join(' ');
|
|
@@ -1188,6 +1188,7 @@ exports.propDefs = {
|
|
|
1188
1188
|
overflow: stringProp,
|
|
1189
1189
|
overflowX: stringProp,
|
|
1190
1190
|
overflowY: stringProp,
|
|
1191
|
+
objectFit: stringProp,
|
|
1191
1192
|
position: stringProp,
|
|
1192
1193
|
zIndex: numberOrStringProp,
|
|
1193
1194
|
inset: insetProp,
|
|
@@ -5923,7 +5924,9 @@ const MultiSelect = (0, react_1.forwardRef)(({ value, filter, setFilter, options
|
|
|
5923
5924
|
innerRef.current?.focus();
|
|
5924
5925
|
return show();
|
|
5925
5926
|
});
|
|
5926
|
-
|
|
5927
|
+
const listboxId = props.id ? `${props.id}-listbox` : undefined;
|
|
5928
|
+
const { id, name, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, 'aria-required': ariaRequired, ...containerProps } = props;
|
|
5929
|
+
return ((0, jsx_runtime_1.jsxs)(Box_1.Box, { is: 'div', "rcx-select": true, className: [error && 'invalid', disabled && 'disabled'], ref: containerRef, onClick: handleClick, disabled: disabled, ...containerProps, children: [(0, jsx_runtime_1.jsx)(Flex_1.FlexItem, { grow: 1, children: (0, jsx_runtime_1.jsx)(Margins_1.Margins, { inline: 'x4', children: (0, jsx_runtime_1.jsx)(Flex_1.FlexContainer, { children: (0, jsx_runtime_1.jsx)(Box_1.Box, { is: 'div', children: (0, jsx_runtime_1.jsx)(Box_1.Box, { is: 'div', display: 'flex', alignItems: 'center', flexWrap: 'wrap', margin: '-x8', children: (0, jsx_runtime_1.jsxs)(Margins_1.Margins, { all: 'x4', children: [renderAnchor({
|
|
5927
5930
|
'ref': anchorRef,
|
|
5928
5931
|
'children': internalValue.length === 0 ? placeholder : null,
|
|
5929
5932
|
'disabled': disabled ?? false,
|
|
@@ -5931,8 +5934,17 @@ const MultiSelect = (0, react_1.forwardRef)(({ value, filter, setFilter, options
|
|
|
5931
5934
|
'onBlur': hide,
|
|
5932
5935
|
'onKeyDown': handleKeyDown,
|
|
5933
5936
|
'onKeyUp': handleKeyUp,
|
|
5937
|
+
'role': 'combobox',
|
|
5934
5938
|
'aria-expanded': visible === AnimatedVisibility_1.AnimatedVisibility.VISIBLE,
|
|
5935
|
-
'aria-
|
|
5939
|
+
'aria-haspopup': 'listbox',
|
|
5940
|
+
'aria-controls': listboxId,
|
|
5941
|
+
id,
|
|
5942
|
+
name,
|
|
5943
|
+
'aria-label': ariaLabel,
|
|
5944
|
+
'aria-labelledby': ariaLabelledBy,
|
|
5945
|
+
'aria-describedby': ariaDescribedBy,
|
|
5946
|
+
'aria-invalid': ariaInvalid,
|
|
5947
|
+
'aria-required': ariaRequired,
|
|
5936
5948
|
}), internalValue.map((value) => {
|
|
5937
5949
|
const currentOption = options.find(([val]) => val === value);
|
|
5938
5950
|
return RenderSelected ? ((0, jsx_runtime_1.jsx)(RenderSelected, { value: value, label: getLabel(currentOption), onMouseDown: (e) => {
|
|
@@ -5946,7 +5958,7 @@ const MultiSelect = (0, react_1.forwardRef)(({ value, filter, setFilter, options
|
|
|
5946
5958
|
}, children: getLabel(currentOption) }, String(value)));
|
|
5947
5959
|
})] }) }) }) }) }) }), (0, jsx_runtime_1.jsx)(Flex_1.FlexItem, { grow: 0, shrink: 0, children: (0, jsx_runtime_1.jsx)(Margins_1.Margins, { inline: 'x4', children: (0, jsx_runtime_1.jsx)(SelectAddon_1.default, { children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { name: visible === AnimatedVisibility_1.AnimatedVisibility.VISIBLE
|
|
5948
5960
|
? 'chevron-up'
|
|
5949
|
-
: addonIcon || 'chevron-down', size: 'x20' }) }) }) }), (0, jsx_runtime_1.jsx)(AnimatedVisibility_1.AnimatedVisibility, { visibility: visible, children: (0, jsx_runtime_1.jsx)(Position_1.Position, { anchor: containerRef, children: (0, jsx_runtime_1.jsx)(_Options, { width: borderBoxSize.inlineSize, onMouseDown: prevent_1.prevent, multiple: true, filter: filter, renderItem: renderItem || Option_1.CheckOption,
|
|
5961
|
+
: addonIcon || 'chevron-down', size: 'x20' }) }) }) }), (0, jsx_runtime_1.jsx)(AnimatedVisibility_1.AnimatedVisibility, { visibility: visible, children: (0, jsx_runtime_1.jsx)(Position_1.Position, { anchor: containerRef, children: (0, jsx_runtime_1.jsx)(_Options, { width: borderBoxSize.inlineSize, onMouseDown: prevent_1.prevent, multiple: true, filter: filter, renderItem: renderItem || Option_1.CheckOption, id: listboxId, options: filteredOptions, onSelect: internalChanged, cursor: cursor, customEmpty: customEmpty }) }) })] }));
|
|
5950
5962
|
});
|
|
5951
5963
|
exports["default"] = MultiSelect;
|
|
5952
5964
|
|
|
@@ -5967,8 +5979,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
5967
5979
|
const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
|
5968
5980
|
const react_1 = __webpack_require__(/*! react */ "react");
|
|
5969
5981
|
const SelectFocus_1 = __importDefault(__webpack_require__(/*! ../Select/SelectFocus */ "./src/components/Select/SelectFocus.tsx"));
|
|
5970
|
-
const MultiSelectAnchor = (0, react_1.forwardRef)(function MultiSelectAnchor(props, ref) {
|
|
5971
|
-
return ((0, jsx_runtime_1.jsx)(SelectFocus_1.default, { "rcx-input-box--undecorated": true, ref: ref,
|
|
5982
|
+
const MultiSelectAnchor = (0, react_1.forwardRef)(function MultiSelectAnchor({ children, ...props }, ref) {
|
|
5983
|
+
return ((0, jsx_runtime_1.jsx)(SelectFocus_1.default, { "rcx-input-box--undecorated": true, ref: ref, order: 1, ...props, children: children }));
|
|
5972
5984
|
});
|
|
5973
5985
|
exports["default"] = MultiSelectAnchor;
|
|
5974
5986
|
|
|
@@ -5990,10 +6002,10 @@ const jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-ru
|
|
|
5990
6002
|
const react_1 = __webpack_require__(/*! react */ "react");
|
|
5991
6003
|
const MultiSelect_1 = __importDefault(__webpack_require__(/*! ./MultiSelect */ "./src/components/MultiSelect/MultiSelect.tsx"));
|
|
5992
6004
|
const MultiSelectFilteredAnchor_1 = __importDefault(__webpack_require__(/*! ./MultiSelectFilteredAnchor */ "./src/components/MultiSelect/MultiSelectFilteredAnchor.tsx"));
|
|
5993
|
-
const MultiSelectFiltered = ({ options, placeholder, filter: propFilter, setFilter: propSetFilter, ...props }) => {
|
|
6005
|
+
const MultiSelectFiltered = (0, react_1.forwardRef)(({ options, placeholder, filter: propFilter, setFilter: propSetFilter, ...props }, ref) => {
|
|
5994
6006
|
const [filter, setFilter] = (0, react_1.useState)('');
|
|
5995
|
-
return ((0, jsx_runtime_1.jsx)(MultiSelect_1.default, { ...props, filter: propFilter || filter, setFilter: propSetFilter || setFilter, options: options, anchor: (params) => ((0, jsx_runtime_1.jsx)(MultiSelectFilteredAnchor_1.default, { placeholder: placeholder, filter: propFilter || filter, onChangeFilter: propSetFilter || setFilter, ...params })) }));
|
|
5996
|
-
};
|
|
6007
|
+
return ((0, jsx_runtime_1.jsx)(MultiSelect_1.default, { ...props, ref: ref, filter: propFilter || filter, setFilter: propSetFilter || setFilter, options: options, anchor: (params) => ((0, jsx_runtime_1.jsx)(MultiSelectFilteredAnchor_1.default, { placeholder: placeholder, filter: propFilter || filter, onChangeFilter: propSetFilter || setFilter, ...params })) }));
|
|
6008
|
+
});
|
|
5997
6009
|
exports["default"] = MultiSelectFiltered;
|
|
5998
6010
|
|
|
5999
6011
|
|
|
@@ -6012,7 +6024,7 @@ const react_1 = __webpack_require__(/*! react */ "react");
|
|
|
6012
6024
|
const Flex_1 = __webpack_require__(/*! ../Flex */ "./src/components/Flex/index.ts");
|
|
6013
6025
|
const InputBox_1 = __webpack_require__(/*! ../InputBox */ "./src/components/InputBox/index.ts");
|
|
6014
6026
|
const MultiSelectFilteredAnchor = (0, react_1.forwardRef)(function MultiSelectFilteredAnchor({ children: _children, filter, onChangeFilter, placeholder, ...props }, ref) {
|
|
6015
|
-
return ((0, jsx_runtime_1.jsx)(Flex_1.FlexItem, { grow: 1, children: (0, jsx_runtime_1.jsx)(InputBox_1.Input, { ref: ref, placeholder: placeholder, value: filter, onInput: (e) => onChangeFilter(e.currentTarget.value), ...props, "rcx-input-box--undecorated": true,
|
|
6027
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.FlexItem, { grow: 1, children: (0, jsx_runtime_1.jsx)(InputBox_1.Input, { ref: ref, placeholder: placeholder, value: filter, onInput: (e) => onChangeFilter(e.currentTarget.value), ...props, "rcx-input-box--undecorated": true, order: 1 }) }));
|
|
6016
6028
|
});
|
|
6017
6029
|
exports["default"] = MultiSelectFilteredAnchor;
|
|
6018
6030
|
|
|
@@ -6570,7 +6582,7 @@ const Option_1 = __webpack_require__(/*! ../Option */ "./src/components/Option/i
|
|
|
6570
6582
|
const Scrollable_1 = __webpack_require__(/*! ../Scrollable */ "./src/components/Scrollable/index.ts");
|
|
6571
6583
|
const Tile_1 = __webpack_require__(/*! ../Tile */ "./src/components/Tile/index.ts");
|
|
6572
6584
|
const OptionsEmpty_1 = __importDefault(__webpack_require__(/*! ./OptionsEmpty */ "./src/components/Options/OptionsEmpty.tsx"));
|
|
6573
|
-
const Options = (0, react_1.forwardRef)(function Options({ maxHeight = 'x144', multiple, renderEmpty: EmptyComponent = OptionsEmpty_1.default, options, cursor, renderItem: OptionComponent = Option_1.Option, onSelect, customEmpty, ...props }, ref) {
|
|
6585
|
+
const Options = (0, react_1.forwardRef)(function Options({ maxHeight = 'x144', multiple, renderEmpty: EmptyComponent = OptionsEmpty_1.default, options, cursor, renderItem: OptionComponent = Option_1.Option, onSelect, customEmpty, id, ...props }, ref) {
|
|
6574
6586
|
const liRef = (0, react_1.useRef)(null);
|
|
6575
6587
|
(0, react_1.useLayoutEffect)(() => {
|
|
6576
6588
|
if (!liRef.current) {
|
|
@@ -6604,7 +6616,7 @@ const Options = (0, react_1.forwardRef)(function Options({ maxHeight = 'x144', m
|
|
|
6604
6616
|
}, value: value, selected: selected || (multiple !== true && undefined), disabled: disabled, focus: cursor === i || undefined }, value));
|
|
6605
6617
|
}
|
|
6606
6618
|
}), [options, multiple, cursor, onSelect, OptionComponent]);
|
|
6607
|
-
return ((0, jsx_runtime_1.jsx)(Box_1.Box, { "rcx-options": true, ...props, ref: ref, children: (0, jsx_runtime_1.jsx)(Tile_1.Tile, { padding: 0, paddingBlock: 'x12', paddingInline: 0, elevation: '2', children: (0, jsx_runtime_1.jsx)(Scrollable_1.Scrollable, { vertical: true, smooth: true, children: (0, jsx_runtime_1.jsxs)(Tile_1.Tile, { ref: liRef, elevation: '0', padding: 'none', maxHeight: maxHeight, onMouseDown: prevent_1.prevent, onClick: prevent_1.prevent, is: 'ol', "aria-multiselectable": multiple || true, role: 'listbox', "aria-activedescendant": options?.[cursor]?.[0]
|
|
6619
|
+
return ((0, jsx_runtime_1.jsx)(Box_1.Box, { "rcx-options": true, ...props, ref: ref, children: (0, jsx_runtime_1.jsx)(Tile_1.Tile, { padding: 0, paddingBlock: 'x12', paddingInline: 0, elevation: '2', children: (0, jsx_runtime_1.jsx)(Scrollable_1.Scrollable, { vertical: true, smooth: true, children: (0, jsx_runtime_1.jsxs)(Tile_1.Tile, { ref: liRef, elevation: '0', padding: 'none', maxHeight: maxHeight, onMouseDown: prevent_1.prevent, onClick: prevent_1.prevent, is: 'ol', "aria-multiselectable": multiple || true, role: 'listbox', id: id, "aria-activedescendant": options?.[cursor]?.[0]
|
|
6608
6620
|
? String(options?.[cursor]?.[0])
|
|
6609
6621
|
: undefined, children: [!options.length && (0, jsx_runtime_1.jsx)(EmptyComponent, { customEmpty: customEmpty }), optionsMemoized] }) }) }) }));
|
|
6610
6622
|
});
|
|
@@ -8210,7 +8222,7 @@ exports.SelectAria = (0, react_1.forwardRef)(function SelectAria({ error, placeh
|
|
|
8210
8222
|
const mergedRef = (0, fuselage_hooks_1.useMergedRefs)(outerRef, ref);
|
|
8211
8223
|
const { triggerProps, valueProps, menuProps } = (0, react_aria_1.useSelect)({ isDisabled, ...props }, state, ref);
|
|
8212
8224
|
const { focusProps, isFocusVisible } = (0, react_aria_1.useFocusRing)();
|
|
8213
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(SelectTrigger_1.SelectTrigger, { ...(0, react_aria_1.mergeProps)(focusProps, triggerProps), ref: mergedRef, small: small, focus: isFocusVisible || state.isOpen, error: error, id: id, children: [(0, jsx_runtime_1.jsx)(
|
|
8225
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_aria_1.HiddenSelect, { state: state, triggerRef: ref, label: props.label, name: props.name, isDisabled: isDisabled }), (0, jsx_runtime_1.jsxs)(SelectTrigger_1.SelectTrigger, { ...(0, react_aria_1.mergeProps)(focusProps, triggerProps), ref: mergedRef, small: small, focus: isFocusVisible || state.isOpen, error: error, id: id, children: [(0, jsx_runtime_1.jsx)(Box_1.Box, { is: 'span', color: state.selectedItem ? 'default' : 'hint', ...valueProps, ...(small && { fontScale: 'c1' }), children: state.selectedItem ? state.selectedItem.rendered : placeholder }), (0, jsx_runtime_1.jsx)(Icon_1.Icon, { color: 'default', name: state.isOpen ? 'chevron-up' : 'chevron-down', size: 'x20' })] }), state.isOpen && ((0, jsx_runtime_1.jsx)(Popover_1.Popover, { state: state, triggerRef: ref, placement: 'bottom', offset: 4, containerPadding: 8, children: (0, jsx_runtime_1.jsx)(Options_1.OptionContainer, { style: {
|
|
8214
8226
|
width: borderBoxSize?.inlineSize,
|
|
8215
8227
|
}, children: (0, jsx_runtime_1.jsx)(Listbox_1.ListBox, { ...menuProps, state: state }) }) }))] }));
|
|
8216
8228
|
});
|