@rocket.chat/fuselage 0.65.0 → 0.66.1
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/CheckBox/CheckBox.d.ts +2 -1
- package/dist/components/CheckBox/CheckBox.d.ts.map +1 -1
- package/dist/components/Field/FieldLabel.d.ts +7 -5
- package/dist/components/Field/FieldLabel.d.ts.map +1 -1
- package/dist/components/Field/index.d.ts +2 -2
- package/dist/components/Label/Label.d.ts +2 -2
- package/dist/components/Label/Label.d.ts.map +1 -1
- package/dist/components/OptionsPaginated/OptionsPaginated.d.ts.map +1 -1
- package/dist/components/RadioButton/RadioButton.d.ts +4 -2
- package/dist/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/dist/components/Tag/Tag.d.ts +4 -3
- package/dist/components/Tag/Tag.d.ts.map +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.d.ts +7 -4
- package/dist/components/ToggleSwitch/ToggleSwitch.d.ts.map +1 -1
- package/dist/fuselage.css +1 -1
- package/dist/fuselage.css.map +1 -1
- package/dist/fuselage.development.js +61 -61
- package/dist/fuselage.development.js.map +1 -1
- package/dist/fuselage.production.js +1 -1
- package/package.json +14 -14
|
@@ -75,10 +75,46 @@ module.exports = invariant;
|
|
|
75
75
|
|
|
76
76
|
/***/ }),
|
|
77
77
|
|
|
78
|
-
/***/ "../../node_modules/react-
|
|
79
|
-
|
|
80
|
-
!*** ../../node_modules/react-
|
|
81
|
-
|
|
78
|
+
/***/ "../../node_modules/react-keyed-flatten-children/index.js":
|
|
79
|
+
/*!****************************************************************!*\
|
|
80
|
+
!*** ../../node_modules/react-keyed-flatten-children/index.js ***!
|
|
81
|
+
\****************************************************************/
|
|
82
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
86
|
+
/* Returns React children into an array, flattening fragments. */
|
|
87
|
+
var react_1 = __webpack_require__(/*! react */ "react");
|
|
88
|
+
var react_is_1 = __webpack_require__(/*! react-is */ "../../node_modules/react-keyed-flatten-children/node_modules/react-is/index.js");
|
|
89
|
+
function flattenChildren(children, depth, keys) {
|
|
90
|
+
if (depth === void 0) { depth = 0; }
|
|
91
|
+
if (keys === void 0) { keys = []; }
|
|
92
|
+
return react_1.Children.toArray(children).reduce(function (acc, node, nodeIndex) {
|
|
93
|
+
if (react_is_1.isFragment(node)) {
|
|
94
|
+
acc.push.apply(acc, flattenChildren(node.props.children, depth + 1, keys.concat(node.key || nodeIndex)));
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
if (react_1.isValidElement(node)) {
|
|
98
|
+
acc.push(react_1.cloneElement(node, {
|
|
99
|
+
key: keys.concat(String(node.key)).join('.')
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
else if (typeof node === "string" || typeof node === "number") {
|
|
103
|
+
acc.push(node);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return acc;
|
|
107
|
+
}, []);
|
|
108
|
+
}
|
|
109
|
+
exports["default"] = flattenChildren;
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
/***/ }),
|
|
113
|
+
|
|
114
|
+
/***/ "../../node_modules/react-keyed-flatten-children/node_modules/react-is/cjs/react-is.development.js":
|
|
115
|
+
/*!*********************************************************************************************************!*\
|
|
116
|
+
!*** ../../node_modules/react-keyed-flatten-children/node_modules/react-is/cjs/react-is.development.js ***!
|
|
117
|
+
\*********************************************************************************************************/
|
|
82
118
|
/***/ (function(__unused_webpack_module, exports) {
|
|
83
119
|
|
|
84
120
|
/** @license React v16.13.1
|
|
@@ -266,56 +302,20 @@ exports.typeOf = typeOf;
|
|
|
266
302
|
|
|
267
303
|
/***/ }),
|
|
268
304
|
|
|
269
|
-
/***/ "../../node_modules/react-is/index.js":
|
|
270
|
-
|
|
271
|
-
!*** ../../node_modules/react-is/index.js ***!
|
|
272
|
-
|
|
305
|
+
/***/ "../../node_modules/react-keyed-flatten-children/node_modules/react-is/index.js":
|
|
306
|
+
/*!**************************************************************************************!*\
|
|
307
|
+
!*** ../../node_modules/react-keyed-flatten-children/node_modules/react-is/index.js ***!
|
|
308
|
+
\**************************************************************************************/
|
|
273
309
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
274
310
|
|
|
275
311
|
|
|
276
312
|
|
|
277
313
|
if (false) // removed by dead control flow
|
|
278
314
|
{} else {
|
|
279
|
-
module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../../node_modules/react-is/cjs/react-is.development.js");
|
|
315
|
+
module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../../node_modules/react-keyed-flatten-children/node_modules/react-is/cjs/react-is.development.js");
|
|
280
316
|
}
|
|
281
317
|
|
|
282
318
|
|
|
283
|
-
/***/ }),
|
|
284
|
-
|
|
285
|
-
/***/ "../../node_modules/react-keyed-flatten-children/index.js":
|
|
286
|
-
/*!****************************************************************!*\
|
|
287
|
-
!*** ../../node_modules/react-keyed-flatten-children/index.js ***!
|
|
288
|
-
\****************************************************************/
|
|
289
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
293
|
-
/* Returns React children into an array, flattening fragments. */
|
|
294
|
-
var react_1 = __webpack_require__(/*! react */ "react");
|
|
295
|
-
var react_is_1 = __webpack_require__(/*! react-is */ "../../node_modules/react-is/index.js");
|
|
296
|
-
function flattenChildren(children, depth, keys) {
|
|
297
|
-
if (depth === void 0) { depth = 0; }
|
|
298
|
-
if (keys === void 0) { keys = []; }
|
|
299
|
-
return react_1.Children.toArray(children).reduce(function (acc, node, nodeIndex) {
|
|
300
|
-
if (react_is_1.isFragment(node)) {
|
|
301
|
-
acc.push.apply(acc, flattenChildren(node.props.children, depth + 1, keys.concat(node.key || nodeIndex)));
|
|
302
|
-
}
|
|
303
|
-
else {
|
|
304
|
-
if (react_1.isValidElement(node)) {
|
|
305
|
-
acc.push(react_1.cloneElement(node, {
|
|
306
|
-
key: keys.concat(String(node.key)).join('.')
|
|
307
|
-
}));
|
|
308
|
-
}
|
|
309
|
-
else if (typeof node === "string" || typeof node === "number") {
|
|
310
|
-
acc.push(node);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
return acc;
|
|
314
|
-
}, []);
|
|
315
|
-
}
|
|
316
|
-
exports["default"] = flattenChildren;
|
|
317
|
-
|
|
318
|
-
|
|
319
319
|
/***/ }),
|
|
320
320
|
|
|
321
321
|
/***/ "../../node_modules/react/cjs/react-jsx-runtime.development.js":
|
|
@@ -4665,7 +4665,7 @@ var fuselage_hooks_1 = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@
|
|
|
4665
4665
|
var react_1 = __webpack_require__(/*! react */ "react");
|
|
4666
4666
|
var Box_1 = __importDefault(__webpack_require__(/*! ../Box */ "./src/components/Box/index.ts"));
|
|
4667
4667
|
exports.CheckBox = (0, react_1.forwardRef)(function CheckBox(_a, ref) {
|
|
4668
|
-
var indeterminate = _a.indeterminate, onChange = _a.onChange, className = _a.className, props = __rest(_a, ["indeterminate", "onChange", "className"]);
|
|
4668
|
+
var indeterminate = _a.indeterminate, onChange = _a.onChange, className = _a.className, labelChildren = _a.labelChildren, props = __rest(_a, ["indeterminate", "onChange", "className", "labelChildren"]);
|
|
4669
4669
|
var innerRef = (0, react_1.useRef)(null);
|
|
4670
4670
|
var mergedRef = (0, fuselage_hooks_1.useMergedRefs)(ref, innerRef);
|
|
4671
4671
|
(0, react_1.useLayoutEffect)(function () {
|
|
@@ -4679,7 +4679,7 @@ exports.CheckBox = (0, react_1.forwardRef)(function CheckBox(_a, ref) {
|
|
|
4679
4679
|
}
|
|
4680
4680
|
onChange === null || onChange === void 0 ? void 0 : onChange.call(innerRef.current, event);
|
|
4681
4681
|
}, [innerRef, indeterminate, onChange]);
|
|
4682
|
-
return ((0, jsx_runtime_1.jsxs)(Box_1.default, { is: 'label', className: className, "rcx-check-box": true, children: [(0, jsx_runtime_1.jsx)(Box_1.default, __assign({ is: 'input', type: 'checkbox', "rcx-check-box__input": true, ref: mergedRef, onChange: handleChange }, props)), (0, jsx_runtime_1.jsx)(Box_1.default, { is: 'i', "rcx-check-box__fake": true, "aria-hidden": 'true' })] }));
|
|
4682
|
+
return ((0, jsx_runtime_1.jsxs)(Box_1.default, { is: 'label', className: className, "rcx-check-box": true, children: [labelChildren, (0, jsx_runtime_1.jsx)(Box_1.default, __assign({ is: 'input', type: 'checkbox', "rcx-check-box__input": true, ref: mergedRef, onChange: handleChange }, props)), (0, jsx_runtime_1.jsx)(Box_1.default, { is: 'i', "rcx-check-box__fake": true, "aria-hidden": 'true' })] }));
|
|
4683
4683
|
});
|
|
4684
4684
|
|
|
4685
4685
|
|
|
@@ -6366,18 +6366,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6366
6366
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6367
6367
|
exports.FieldLabel = void 0;
|
|
6368
6368
|
var jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "../../node_modules/react/jsx-runtime.js");
|
|
6369
|
+
var react_1 = __webpack_require__(/*! react */ "react");
|
|
6369
6370
|
var WithErrorWrapper_1 = __importDefault(__webpack_require__(/*! ../../helpers/WithErrorWrapper */ "./src/helpers/WithErrorWrapper.tsx"));
|
|
6370
6371
|
var Label_1 = __webpack_require__(/*! ../Label */ "./src/components/Label/index.tsx");
|
|
6371
6372
|
var Field_1 = __webpack_require__(/*! ./Field */ "./src/components/Field/Field.tsx");
|
|
6372
|
-
|
|
6373
|
-
var component = (0, jsx_runtime_1.jsx)(Label_1.Label, __assign({ "rcx-field__label": true }, props));
|
|
6373
|
+
exports.FieldLabel = (0, react_1.forwardRef)(function FieldLabel(props, ref) {
|
|
6374
|
+
var component = (0, jsx_runtime_1.jsx)(Label_1.Label, __assign({ "rcx-field__label": true }, props, { ref: ref }));
|
|
6374
6375
|
if (true) {
|
|
6375
|
-
return ((0, jsx_runtime_1.jsx)(WithErrorWrapper_1.default, { context: Field_1.FieldContext, parentComponent: 'Field', componentName:
|
|
6376
|
+
return ((0, jsx_runtime_1.jsx)(WithErrorWrapper_1.default, { context: Field_1.FieldContext, parentComponent: 'Field', componentName: FieldLabel.name, children: component }));
|
|
6376
6377
|
}
|
|
6377
6378
|
// removed by dead control flow
|
|
6378
6379
|
{}
|
|
6379
|
-
};
|
|
6380
|
-
exports.FieldLabel = FieldLabel;
|
|
6380
|
+
});
|
|
6381
6381
|
|
|
6382
6382
|
|
|
6383
6383
|
/***/ }),
|
|
@@ -7405,7 +7405,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7405
7405
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7406
7406
|
};
|
|
7407
7407
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7408
|
-
exports.Label =
|
|
7408
|
+
exports.Label = void 0;
|
|
7409
7409
|
var jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "../../node_modules/react/jsx-runtime.js");
|
|
7410
7410
|
var react_1 = __webpack_require__(/*! react */ "react");
|
|
7411
7411
|
var Box_1 = __importDefault(__webpack_require__(/*! ../Box */ "./src/components/Box/index.ts"));
|
|
@@ -7413,12 +7413,12 @@ var LabelContext = (0, react_1.createContext)(false);
|
|
|
7413
7413
|
/**
|
|
7414
7414
|
* A caption for an input component.
|
|
7415
7415
|
*/
|
|
7416
|
-
function Label(_a) {
|
|
7416
|
+
exports.Label = (0, react_1.forwardRef)(function Label(_a, ref) {
|
|
7417
7417
|
var disabled = _a.disabled, is = _a.is, required = _a.required, children = _a.children, props = __rest(_a, ["disabled", "is", "required", "children"]);
|
|
7418
7418
|
var isInsideLabel = (0, react_1.useContext)(LabelContext);
|
|
7419
7419
|
var component = is || (isInsideLabel && 'span') || 'label';
|
|
7420
|
-
return ((0, jsx_runtime_1.jsx)(LabelContext.Provider, { value: true, children: (0, jsx_runtime_1.jsxs)(Box_1.default, __assign({ is: component, "rcx-label": true, "rcx-label--disabled": disabled }, props, { children: [children, required && ((0, jsx_runtime_1.jsx)(Box_1.default, { is: 'span', "rcx-label__required": true, mis: 'x4', "aria-hidden": 'true', children: "*" }))] })) }));
|
|
7421
|
-
}
|
|
7420
|
+
return ((0, jsx_runtime_1.jsx)(LabelContext.Provider, { value: true, children: (0, jsx_runtime_1.jsxs)(Box_1.default, __assign({ is: component, "rcx-label": true, "rcx-label--disabled": disabled }, props, { ref: ref, children: [children, required && ((0, jsx_runtime_1.jsx)(Box_1.default, { is: 'span', "rcx-label__required": true, mis: 'x4', "aria-hidden": 'true', children: "*" }))] })) }));
|
|
7421
|
+
});
|
|
7422
7422
|
|
|
7423
7423
|
|
|
7424
7424
|
/***/ }),
|
|
@@ -13149,7 +13149,7 @@ exports.OptionsPaginated = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
13149
13149
|
var OptionsComponentWithData = function (_a) {
|
|
13150
13150
|
var index = _a.index, data = _a.data;
|
|
13151
13151
|
var value = data.value, label = data.label, selected = data.selected;
|
|
13152
|
-
return ((0, react_1.createElement)(OptionComponent, __assign({}, (withTitle && { title: label }), { role: 'option', label: label, onMouseDown: function (e) {
|
|
13152
|
+
return ((0, react_1.createElement)(OptionComponent, __assign({}, (withTitle && { title: label }), { index: index, role: 'option', label: label, onMouseDown: function (e) {
|
|
13153
13153
|
(0, prevent_1.prevent)(e);
|
|
13154
13154
|
onSelect([value, label]);
|
|
13155
13155
|
return false;
|
|
@@ -14658,8 +14658,8 @@ var jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "../../node_mod
|
|
|
14658
14658
|
var react_1 = __webpack_require__(/*! react */ "react");
|
|
14659
14659
|
var Box_1 = __importDefault(__webpack_require__(/*! ../Box */ "./src/components/Box/index.ts"));
|
|
14660
14660
|
exports.RadioButton = (0, react_1.forwardRef)(function RadioButton(_a, ref) {
|
|
14661
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
14662
|
-
return ((0, jsx_runtime_1.jsxs)(Box_1.default, { is: 'label', className: className, "rcx-radio-button": true, children: [(0, jsx_runtime_1.jsx)(Box_1.default, __assign({ is: 'input', "rcx-radio-button__input": true, type: 'radio', ref: ref }, props)), (0, jsx_runtime_1.jsx)(Box_1.default, { is: 'i', "rcx-radio-button__fake": true, "aria-hidden": 'true' })] }));
|
|
14661
|
+
var className = _a.className, labelChildren = _a.labelChildren, props = __rest(_a, ["className", "labelChildren"]);
|
|
14662
|
+
return ((0, jsx_runtime_1.jsxs)(Box_1.default, { is: 'label', className: className, "rcx-radio-button": true, children: [labelChildren, (0, jsx_runtime_1.jsx)(Box_1.default, __assign({ is: 'input', "rcx-radio-button__input": true, type: 'radio', ref: ref }, props)), (0, jsx_runtime_1.jsx)(Box_1.default, { is: 'i', "rcx-radio-button__fake": true, "aria-hidden": 'true' })] }));
|
|
14663
14663
|
});
|
|
14664
14664
|
|
|
14665
14665
|
|
|
@@ -20268,8 +20268,8 @@ var jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "../../node_mod
|
|
|
20268
20268
|
var react_1 = __webpack_require__(/*! react */ "react");
|
|
20269
20269
|
var Box_1 = __importDefault(__webpack_require__(/*! ../Box */ "./src/components/Box/index.ts"));
|
|
20270
20270
|
exports.ToggleSwitch = (0, react_1.forwardRef)(function ToggleSwitch(_a, ref) {
|
|
20271
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
20272
|
-
return ((0, jsx_runtime_1.jsxs)(Box_1.default, { is: 'label', className: className, "rcx-toggle-switch": true, children: [(0, jsx_runtime_1.jsx)(Box_1.default, __assign({ is: 'input', ref: ref, "rcx-toggle-switch__input": true, type: 'checkbox' }, props)), (0, jsx_runtime_1.jsx)(Box_1.default, { is: 'i', "rcx-toggle-switch__fake": true, "aria-hidden": 'true' })] }));
|
|
20271
|
+
var className = _a.className, labelChildren = _a.labelChildren, props = __rest(_a, ["className", "labelChildren"]);
|
|
20272
|
+
return ((0, jsx_runtime_1.jsxs)(Box_1.default, { is: 'label', className: className, "rcx-toggle-switch": true, children: [labelChildren, (0, jsx_runtime_1.jsx)(Box_1.default, __assign({ is: 'input', ref: ref, "rcx-toggle-switch__input": true, type: 'checkbox' }, props)), (0, jsx_runtime_1.jsx)(Box_1.default, { is: 'i', "rcx-toggle-switch__fake": true, "aria-hidden": 'true' })] }));
|
|
20273
20273
|
});
|
|
20274
20274
|
|
|
20275
20275
|
|