blue-react 9.0.0-alpha1 → 9.0.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/ActionMenu.js +98 -109
- package/dist/components/ActionMenuSwitch.js +44 -55
- package/dist/components/Body.js +38 -50
- package/dist/components/Caret.js +19 -32
- package/dist/components/DocumentView.js +76 -88
- package/dist/components/Header.js +22 -34
- package/dist/components/HeaderTitle.js +54 -66
- package/dist/components/Intro.js +35 -48
- package/dist/components/Layout.js +313 -292
- package/dist/components/MenuItem.js +130 -139
- package/dist/components/Modal.js +164 -173
- package/dist/components/ModalProvider.js +184 -195
- package/dist/components/Outside.js +50 -63
- package/dist/components/Page.js +62 -74
- package/dist/components/Search.js +159 -168
- package/dist/components/SidebarMenu.js +56 -69
- package/dist/components/SidebarMenuItem.js +124 -0
- package/dist/components/SidebarToggler.js +33 -0
- package/dist/components/SlimContainer.js +21 -34
- package/dist/components/Status.js +64 -76
- package/dist/components/StatusProvider.js +68 -79
- package/dist/components/Switch.js +57 -70
- package/dist/components/Utilities.js +183 -192
- package/dist/components/shared.js +24 -37
- package/dist/neu.scss +76 -0
- package/dist/style.css +1632 -522
- package/dist/style.min.css +9 -10
- package/dist/style.scss +4 -4
- package/dist/styles/_bootstrap-variables.scss +2 -2
- package/dist/styles/_bootstrap.scss +1 -0
- package/dist/styles/_general.scss +2 -2
- package/dist/styles/_layout.scss +3 -7
- package/dist/styles/_sidebar.scss +36 -0
- package/dist/styles/_variables.scss +5 -20
- package/dist/styles/mixins/_sidebar.scss +16 -2
- package/dist/types/components/Layout.d.ts +17 -1
- package/dist/types/components/MenuItem.d.ts +4 -0
- package/dist/types/components/Search.d.ts +7 -3
- package/dist/types/components/SidebarMenuItem.d.ts +21 -0
- package/dist/types/components/SidebarToggler.d.ts +10 -0
- package/dist/types/components/Utilities.d.ts +4 -0
- package/index.d.ts +5 -6
- package/index.js +1 -2
- package/package.json +4 -5
- package/dist/components/BodyRounded.js +0 -44
- package/dist/components/Grid.js +0 -288
- package/dist/style.css.map +0 -1
- package/dist/styles/_bootstrap-optimizations.scss +0 -5
- package/dist/types/components/BodyRounded.d.ts +0 -10
- package/dist/types/components/Grid.d.ts +0 -110
|
@@ -1,104 +1,93 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
(function (
|
|
4
|
-
if (typeof define === "function" && define.amd) {
|
|
5
|
-
define(["exports", "react", "./Status"], factory);
|
|
6
|
-
} else if (typeof exports !== "undefined") {
|
|
7
|
-
factory(exports, require("react"), require("./Status"));
|
|
8
|
-
} else {
|
|
9
|
-
var mod = {
|
|
10
|
-
exports: {}
|
|
11
|
-
};
|
|
12
|
-
factory(mod.exports, global.react, global.Status);
|
|
13
|
-
global.StatusProvider = mod.exports;
|
|
14
|
-
}
|
|
15
|
-
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _react, _Status) {
|
|
16
|
-
"use strict";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
17
4
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_react = _interopRequireWildcard(_react);
|
|
23
|
-
_Status = _interopRequireDefault(_Status);
|
|
24
|
-
var _excluded = ["children", "successIcon", "infoIcon", "warningIcon", "dangerIcon"];
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useStatus = exports.StatusProvider = void 0;
|
|
25
9
|
|
|
26
|
-
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
27
11
|
|
|
28
|
-
|
|
12
|
+
var _Status = _interopRequireDefault(require("./Status"));
|
|
29
13
|
|
|
30
|
-
|
|
14
|
+
var _excluded = ["children", "successIcon", "infoIcon", "warningIcon", "dangerIcon"];
|
|
31
15
|
|
|
32
|
-
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
17
|
|
|
34
|
-
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
19
|
|
|
36
|
-
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
21
|
|
|
38
|
-
|
|
22
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
39
23
|
|
|
40
|
-
|
|
24
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
41
25
|
|
|
42
|
-
|
|
26
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
43
27
|
|
|
44
|
-
|
|
28
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
45
29
|
|
|
46
|
-
|
|
30
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
47
31
|
|
|
48
|
-
|
|
32
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
49
33
|
|
|
50
|
-
|
|
51
|
-
setAlert: undefined,
|
|
52
|
-
setStatus: undefined
|
|
53
|
-
});
|
|
34
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
54
35
|
|
|
55
|
-
|
|
56
|
-
var children = _ref.children,
|
|
57
|
-
successIcon = _ref.successIcon,
|
|
58
|
-
infoIcon = _ref.infoIcon,
|
|
59
|
-
warningIcon = _ref.warningIcon,
|
|
60
|
-
dangerIcon = _ref.dangerIcon,
|
|
61
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
62
37
|
|
|
63
|
-
|
|
64
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
65
|
-
alert = _useState2[0],
|
|
66
|
-
setAlert = _useState2[1];
|
|
38
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
67
39
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
40
|
+
var StatusContext = /*#__PURE__*/(0, _react.createContext)({
|
|
41
|
+
setAlert: undefined,
|
|
42
|
+
setStatus: undefined
|
|
43
|
+
});
|
|
72
44
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
onUnsetAlert: function onUnsetAlert() {
|
|
81
|
-
return setAlert(null);
|
|
82
|
-
},
|
|
83
|
-
successIcon: successIcon,
|
|
84
|
-
infoIcon: infoIcon,
|
|
85
|
-
warningIcon: warningIcon,
|
|
86
|
-
dangerIcon: dangerIcon,
|
|
87
|
-
status: status
|
|
88
|
-
}));
|
|
89
|
-
};
|
|
45
|
+
var StatusProvider = function StatusProvider(_ref) {
|
|
46
|
+
var children = _ref.children,
|
|
47
|
+
successIcon = _ref.successIcon,
|
|
48
|
+
infoIcon = _ref.infoIcon,
|
|
49
|
+
warningIcon = _ref.warningIcon,
|
|
50
|
+
dangerIcon = _ref.dangerIcon,
|
|
51
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
90
52
|
|
|
91
|
-
|
|
53
|
+
var _useState = (0, _react.useState)(null),
|
|
54
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
55
|
+
alert = _useState2[0],
|
|
56
|
+
setAlert = _useState2[1];
|
|
92
57
|
|
|
93
|
-
var
|
|
94
|
-
|
|
58
|
+
var _useState3 = (0, _react.useState)(null),
|
|
59
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
60
|
+
status = _useState4[0],
|
|
61
|
+
setStatus = _useState4[1];
|
|
95
62
|
|
|
96
|
-
|
|
97
|
-
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(StatusContext.Provider, _extends({
|
|
64
|
+
value: {
|
|
65
|
+
setAlert: setAlert,
|
|
66
|
+
setStatus: setStatus
|
|
98
67
|
}
|
|
68
|
+
}, rest), children, /*#__PURE__*/_react.default.createElement(_Status.default, {
|
|
69
|
+
alert: alert || undefined,
|
|
70
|
+
onUnsetAlert: function onUnsetAlert() {
|
|
71
|
+
return setAlert(null);
|
|
72
|
+
},
|
|
73
|
+
successIcon: successIcon,
|
|
74
|
+
infoIcon: infoIcon,
|
|
75
|
+
warningIcon: warningIcon,
|
|
76
|
+
dangerIcon: dangerIcon,
|
|
77
|
+
status: status
|
|
78
|
+
}));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
exports.StatusProvider = StatusProvider;
|
|
82
|
+
|
|
83
|
+
var useStatus = function useStatus() {
|
|
84
|
+
var context = (0, _react.useContext)(StatusContext);
|
|
85
|
+
|
|
86
|
+
if (context === undefined) {
|
|
87
|
+
throw new Error("useStatus must be used within a StatusProvider");
|
|
88
|
+
}
|
|
99
89
|
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
return context;
|
|
91
|
+
};
|
|
102
92
|
|
|
103
|
-
|
|
104
|
-
});
|
|
93
|
+
exports.useStatus = useStatus;
|
|
@@ -1,78 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
4
|
|
|
3
|
-
(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
factory(exports, require("react"));
|
|
8
|
-
} else {
|
|
9
|
-
var mod = {
|
|
10
|
-
exports: {}
|
|
11
|
-
};
|
|
12
|
-
factory(mod.exports, global.react);
|
|
13
|
-
global.Switch = mod.exports;
|
|
14
|
-
}
|
|
15
|
-
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _react) {
|
|
16
|
-
"use strict";
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = Switch;
|
|
17
9
|
|
|
18
|
-
|
|
19
|
-
value: true
|
|
20
|
-
});
|
|
21
|
-
_exports.default = Switch;
|
|
22
|
-
_react = _interopRequireWildcard(_react);
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
23
11
|
|
|
24
|
-
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
13
|
|
|
26
|
-
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
15
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated
|
|
18
|
+
* Use Bootstrap's `.form-check.form-switch` instead:
|
|
19
|
+
* https://getbootstrap.com/docs/5.2/forms/checks-radios/#switches
|
|
20
|
+
*
|
|
21
|
+
* For now, this component acts as proxy for Bootstrap's Switch.
|
|
22
|
+
* To place a label next to the switch, use the new `label` prop.
|
|
23
|
+
*
|
|
24
|
+
* Migrate to Blue React 8.4.0 and use legacy support: Set the `label` with a string. Or set the `legacy` prop to use the previous look and behaviour.
|
|
25
|
+
*/
|
|
26
|
+
function Switch(_ref) {
|
|
27
|
+
var className = _ref.className,
|
|
28
|
+
checked = _ref.checked,
|
|
29
|
+
onChange = _ref.onChange,
|
|
30
|
+
sliderLabel = _ref.sliderLabel,
|
|
31
|
+
disabled = _ref.disabled,
|
|
32
|
+
_ref$elementType = _ref.elementType,
|
|
33
|
+
elementType = _ref$elementType === void 0 ? "label" : _ref$elementType,
|
|
34
|
+
_ref$legacy = _ref.legacy,
|
|
35
|
+
legacy = _ref$legacy === void 0 ? false : _ref$legacy,
|
|
36
|
+
label = _ref.label;
|
|
49
37
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
38
|
+
if (legacy === true) {
|
|
39
|
+
return /*#__PURE__*/(0, _react.createElement)(elementType, {
|
|
40
|
+
className: "switch " + (disabled ? "disabled " : "") + className
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("input", {
|
|
42
|
+
type: "checkbox",
|
|
43
|
+
checked: checked,
|
|
44
|
+
onChange: onChange,
|
|
45
|
+
disabled: disabled,
|
|
46
|
+
role: "switch"
|
|
47
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
48
|
+
className: "slider round",
|
|
49
|
+
"data-label": sliderLabel
|
|
50
|
+
})));
|
|
51
|
+
} else {
|
|
52
|
+
return /*#__PURE__*/(0, _react.createElement)(elementType, {
|
|
53
|
+
className: "form-check form-switch " + (disabled ? "disabled " : "") + className
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("input", {
|
|
55
|
+
type: "checkbox",
|
|
56
|
+
role: "switch",
|
|
57
|
+
className: "form-check-input",
|
|
58
|
+
checked: checked,
|
|
59
|
+
onChange: onChange,
|
|
60
|
+
disabled: disabled
|
|
61
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
62
|
+
className: "form-check-label"
|
|
63
|
+
}, label)));
|
|
77
64
|
}
|
|
78
|
-
}
|
|
65
|
+
}
|