@rocket.chat/fuselage 0.60.1 → 0.60.2
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/Menu/V2/stately/MenuItem.d.ts.map +1 -1
- package/dist/components/Select/SelectAria.d.ts +2 -2
- package/dist/components/Select/SelectAria.d.ts.map +1 -1
- package/dist/components/Select/SelectTrigger.d.ts +8 -0
- package/dist/components/Select/SelectTrigger.d.ts.map +1 -0
- package/dist/fuselage.development.js +59 -12
- package/dist/fuselage.development.js.map +1 -1
- package/dist/fuselage.production.js +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Menu/V2/stately/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Menu/V2/stately/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,iBAAS,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,QAExC;kBAFQ,QAAQ;4BAIwC,CAAC,SACjD,SAAS,CAAC,CAAC,CAAC,WACV,GAAG,KACX,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;;AA8D5B,eAAe,QAAQ,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { AriaSelectProps } from '@react-types/select';
|
|
2
2
|
import type { AllHTMLAttributes, Key } from 'react';
|
|
3
3
|
export { Item } from 'react-stately';
|
|
4
|
-
export declare const SelectAria: import("react").ForwardRefExoticComponent<
|
|
4
|
+
export declare const SelectAria: import("react").ForwardRefExoticComponent<AriaSelectProps<object> & {
|
|
5
5
|
error?: string;
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
value?: Key | null;
|
|
8
|
-
onChange?: (
|
|
8
|
+
onChange?: (key: Key) => void;
|
|
9
9
|
small?: boolean;
|
|
10
10
|
} & AllHTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>>;
|
|
11
11
|
//# sourceMappingURL=SelectAria.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectAria.d.ts","sourceRoot":"","sources":["../../../src/components/Select/SelectAria.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAO,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectAria.d.ts","sourceRoot":"","sources":["../../../src/components/Select/SelectAria.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAO,MAAM,OAAO,CAAC;AAazD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAUrC,eAAO,MAAM,UAAU;YAPb,MAAM;kBACA,MAAM;YACZ,GAAG,GAAG,IAAI;eACP,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI;YACrB,OAAO;gFAuFf,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AllHTMLAttributes } from 'react';
|
|
2
|
+
import { AriaButtonProps } from 'react-aria';
|
|
3
|
+
export declare const SelectTrigger: import("react").ForwardRefExoticComponent<{
|
|
4
|
+
small?: boolean;
|
|
5
|
+
error?: string;
|
|
6
|
+
focus?: boolean;
|
|
7
|
+
} & AriaButtonProps<"button"> & AllHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
//# sourceMappingURL=SelectTrigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectTrigger.d.ts","sourceRoot":"","sources":["../../../src/components/Select/SelectTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAa,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAa,eAAe,EAAE,MAAM,YAAY,CAAC;AAWxD,eAAO,MAAM,aAAa;YANhB,OAAO;YACP,MAAM;YACN,OAAO;wHAmChB,CAAC"}
|
|
@@ -8316,7 +8316,7 @@ MenuSection.getCollectionNode = function getCollectionNode(props) {
|
|
|
8316
8316
|
return [4 /*yield*/, {
|
|
8317
8317
|
type: 'item',
|
|
8318
8318
|
value: item,
|
|
8319
|
-
|
|
8319
|
+
element: children(item),
|
|
8320
8320
|
}];
|
|
8321
8321
|
case 3:
|
|
8322
8322
|
_b.sent();
|
|
@@ -8341,7 +8341,7 @@ MenuSection.getCollectionNode = function getCollectionNode(props) {
|
|
|
8341
8341
|
react_1.Children.forEach(children, function (child) {
|
|
8342
8342
|
items_2.push({
|
|
8343
8343
|
type: 'item',
|
|
8344
|
-
element: child,
|
|
8344
|
+
element: child !== null && child !== void 0 ? child : undefined,
|
|
8345
8345
|
});
|
|
8346
8346
|
});
|
|
8347
8347
|
return [5 /*yield**/, __values(items_2)];
|
|
@@ -14956,24 +14956,18 @@ var Icon_1 = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts"
|
|
|
14956
14956
|
var Options_1 = __webpack_require__(/*! ../Options */ "./src/components/Options/index.ts");
|
|
14957
14957
|
var Popover_1 = __webpack_require__(/*! ../Popover */ "./src/components/Popover/index.ts");
|
|
14958
14958
|
var Listbox_1 = __webpack_require__(/*! ./Listbox */ "./src/components/Select/Listbox.tsx");
|
|
14959
|
+
var SelectTrigger_1 = __webpack_require__(/*! ./SelectTrigger */ "./src/components/Select/SelectTrigger.tsx");
|
|
14959
14960
|
var react_stately_2 = __webpack_require__(/*! react-stately */ "react-stately");
|
|
14960
14961
|
Object.defineProperty(exports, "Item", ({ enumerable: true, get: function () { return react_stately_2.Item; } }));
|
|
14961
14962
|
exports.SelectAria = (0, react_1.forwardRef)(function SelectAria(_a, outerRef) {
|
|
14962
|
-
var error = _a.error, placeholder = _a.placeholder, value = _a.value, onChange = _a.onChange, small = _a.small, isDisabledProps = _a.isDisabled, disabled = _a.disabled, props = __rest(_a, ["error", "placeholder", "value", "onChange", "small", "isDisabled", "disabled"]);
|
|
14963
|
+
var error = _a.error, placeholder = _a.placeholder, value = _a.value, onChange = _a.onChange, small = _a.small, isDisabledProps = _a.isDisabled, disabled = _a.disabled, id = _a.id, props = __rest(_a, ["error", "placeholder", "value", "onChange", "small", "isDisabled", "disabled", "id"]);
|
|
14963
14964
|
var isDisabled = isDisabledProps || disabled;
|
|
14964
14965
|
var state = (0, react_stately_1.useSelectState)(__assign({ isDisabled: isDisabled, selectedKey: value, onSelectionChange: onChange }, props));
|
|
14965
14966
|
var _b = (0, fuselage_hooks_1.useResizeObserver)(), ref = _b.ref, borderBoxSize = _b.borderBoxSize;
|
|
14967
|
+
var mergedRef = (0, fuselage_hooks_1.useMergedRefs)(outerRef, ref);
|
|
14966
14968
|
var _c = (0, react_aria_1.useSelect)(__assign({ isDisabled: isDisabled }, props), state, ref), triggerProps = _c.triggerProps, valueProps = _c.valueProps, menuProps = _c.menuProps;
|
|
14967
|
-
var buttonProps = (0, react_aria_1.useButton)(triggerProps, ref).buttonProps;
|
|
14968
14969
|
var _d = (0, react_aria_1.useFocusRing)(), focusProps = _d.focusProps, isFocusVisible = _d.isFocusVisible;
|
|
14969
|
-
|
|
14970
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Box_1.default, __assign({}, props, { disabled: isDisabled, "rcx-select": true }, (0, react_aria_1.mergeProps)(buttonProps, focusProps), { is: 'button', display: 'flex', flexDirection: 'row', fontScale: 'p2', ref: mergedRef, justifyContent: 'space-between', "rcx-input-box--small": small, className: [
|
|
14971
|
-
error && 'invalid',
|
|
14972
|
-
isDisabled && 'disabled',
|
|
14973
|
-
(isFocusVisible || state.isOpen) && 'focus',
|
|
14974
|
-
]
|
|
14975
|
-
.filter(Boolean)
|
|
14976
|
-
.join(' '), 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.jsx)(Box_1.default, __assign({ is: 'span' }, valueProps, { color: state.selectedItem ? 'default' : 'hint' }, (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: {
|
|
14970
|
+
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, __assign({}, (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.default, __assign({ 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: {
|
|
14977
14971
|
width: borderBoxSize === null || borderBoxSize === void 0 ? void 0 : borderBoxSize.inlineSize,
|
|
14978
14972
|
}, children: (0, jsx_runtime_1.jsx)(Listbox_1.ListBox, __assign({}, menuProps, { state: state })) }) }))] }));
|
|
14979
14973
|
});
|
|
@@ -15275,6 +15269,59 @@ exports.SelectLegacy = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
15275
15269
|
});
|
|
15276
15270
|
|
|
15277
15271
|
|
|
15272
|
+
/***/ }),
|
|
15273
|
+
|
|
15274
|
+
/***/ "./src/components/Select/SelectTrigger.tsx":
|
|
15275
|
+
/*!*************************************************!*\
|
|
15276
|
+
!*** ./src/components/Select/SelectTrigger.tsx ***!
|
|
15277
|
+
\*************************************************/
|
|
15278
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
15279
|
+
|
|
15280
|
+
|
|
15281
|
+
var __assign = (this && this.__assign) || function () {
|
|
15282
|
+
__assign = Object.assign || function(t) {
|
|
15283
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
15284
|
+
s = arguments[i];
|
|
15285
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
15286
|
+
t[p] = s[p];
|
|
15287
|
+
}
|
|
15288
|
+
return t;
|
|
15289
|
+
};
|
|
15290
|
+
return __assign.apply(this, arguments);
|
|
15291
|
+
};
|
|
15292
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
15293
|
+
var t = {};
|
|
15294
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15295
|
+
t[p] = s[p];
|
|
15296
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15297
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
15298
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
15299
|
+
t[p[i]] = s[p[i]];
|
|
15300
|
+
}
|
|
15301
|
+
return t;
|
|
15302
|
+
};
|
|
15303
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15304
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15305
|
+
};
|
|
15306
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
15307
|
+
exports.SelectTrigger = void 0;
|
|
15308
|
+
var jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "../../node_modules/react/jsx-runtime.js");
|
|
15309
|
+
var react_1 = __webpack_require__(/*! react */ "react");
|
|
15310
|
+
var react_aria_1 = __webpack_require__(/*! react-aria */ "react-aria");
|
|
15311
|
+
var Box_1 = __importDefault(__webpack_require__(/*! ../Box */ "./src/components/Box/index.ts"));
|
|
15312
|
+
exports.SelectTrigger = (0, react_1.forwardRef)(function (_a, ref) {
|
|
15313
|
+
var small = _a.small, error = _a.error, isDisabled = _a.isDisabled, focus = _a.focus, id = _a.id, props = __rest(_a, ["small", "error", "isDisabled", "focus", "id"]);
|
|
15314
|
+
var buttonProps = (0, react_aria_1.useButton)(props, ref).buttonProps;
|
|
15315
|
+
return ((0, jsx_runtime_1.jsx)(Box_1.default, __assign({}, buttonProps, { id: id, "rcx-select": true, ref: ref, is: 'button', display: 'flex', flexDirection: 'row', fontScale: 'p2', justifyContent: 'space-between', "rcx-input-box--small": small, className: [
|
|
15316
|
+
error && 'invalid',
|
|
15317
|
+
isDisabled && 'disabled',
|
|
15318
|
+
focus && 'focus',
|
|
15319
|
+
]
|
|
15320
|
+
.filter(Boolean)
|
|
15321
|
+
.join(' '), children: props.children })));
|
|
15322
|
+
});
|
|
15323
|
+
|
|
15324
|
+
|
|
15278
15325
|
/***/ }),
|
|
15279
15326
|
|
|
15280
15327
|
/***/ "./src/components/Select/index.ts":
|