blue-react 11.3.1 → 12.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/README.md +18 -39
- package/dist/components/Layout.js +50 -22
- package/dist/components/LayoutSplitter.js +79 -0
- package/dist/components/shared.js +1 -0
- package/index.d.ts +4 -7
- package/index.js +1 -0
- package/package.json +54 -77
- package/dist/components/A.d.ts +0 -9
- package/dist/components/ActionMenu.d.ts +0 -26
- package/dist/components/Actions.d.ts +0 -16
- package/dist/components/Button.d.ts +0 -31
- package/dist/components/Chevron.d.ts +0 -17
- package/dist/components/FieldGroup.d.ts +0 -10
- package/dist/components/HashRouter.d.ts +0 -76
- package/dist/components/Header.d.ts +0 -9
- package/dist/components/HeaderTitle.d.ts +0 -40
- package/dist/components/IconMenuItem.d.ts +0 -19
- package/dist/components/Intro.d.ts +0 -22
- package/dist/components/Layout.d.ts +0 -14
- package/dist/components/LegacyMenuItem.d.ts +0 -150
- package/dist/components/MenuItem.d.ts +0 -13
- package/dist/components/Modal.d.ts +0 -30
- package/dist/components/ModalProvider.d.ts +0 -21
- package/dist/components/Outside.d.ts +0 -17
- package/dist/components/Search.d.ts +0 -46
- package/dist/components/SidebarMenu.d.ts +0 -32
- package/dist/components/SimpleLayout.d.ts +0 -12
- package/dist/components/SlimContainer.d.ts +0 -10
- package/dist/components/Status.d.ts +0 -12
- package/dist/components/StatusProvider.d.ts +0 -15
- package/dist/components/Tab.d.ts +0 -12
- package/dist/components/Tabs.d.ts +0 -16
- package/dist/components/ToastProvider.d.ts +0 -22
- package/dist/components/Utilities.d.ts +0 -41
- package/dist/components/shared.d.ts +0 -15
- package/dist/style.scss +0 -6
package/README.md
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/bruegmann/blue-react/master/public/blue-readme-cover.png" alt="React component library based on Bootstrap">
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
1
|
# Blue React
|
|
6
2
|
|
|
7
3
|
[](https://www.npmjs.com/package/blue-react)
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
## Use Blue React
|
|
6
|
+
|
|
7
|
+
### Create new project with [Vite](https://vitejs.dev/)
|
|
8
|
+
|
|
9
|
+
To quickly getting started, you can use the [template with Vite, React, TypeScript and Blue React](https://github.com/bruegmann/vite-template-blue-react).
|
|
10
|
+
You can use degit to create a new project with this command:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
npx degit bruegmann/vite-template-blue-react name-of-my-app
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Install to existing project
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
npm i blue-react
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`blue-react` has `blue-web` and `bootstrap` as dependencies, so these will be installed automatically.
|
|
11
23
|
|
|
12
24
|
## Breaking changes between v10 and v11
|
|
13
25
|
|
|
@@ -50,36 +62,3 @@ The previous Menu Item with the older API is still available as `LegacyMenuItem`
|
|
|
50
62
|
- Body
|
|
51
63
|
- Page
|
|
52
64
|
- SidebarToggler
|
|
53
|
-
|
|
54
|
-
## Developing
|
|
55
|
-
|
|
56
|
-
This project is built with [CRA](https://create-react-app.dev/). To start
|
|
57
|
-
developing, just and install everything with `npm i` and run:
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
npm start
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Create a new release
|
|
64
|
-
|
|
65
|
-
This is how to manually create a release:\
|
|
66
|
-
By running
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
npm publish
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
the missing files in `./dist` will be created, the docs will be generated and
|
|
73
|
-
the NPM package will be released.
|
|
74
|
-
|
|
75
|
-
To publish changes on the documentary, run:
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
npm run deploy
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
To run both of them:
|
|
82
|
-
|
|
83
|
-
```
|
|
84
|
-
npm run release
|
|
85
|
-
```
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["children", "className", "header", "side", "noPageBorder", "page", "drawerTitle", "countryCode", "onInspectorChange", "ref"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
1
10
|
import React, { useEffect, useId, useRef } from "react";
|
|
2
11
|
import clsx from "clsx";
|
|
3
12
|
import { init, dispose } from "blue-web/dist/js/layout.js";
|
|
@@ -9,31 +18,50 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
9
18
|
export default function Layout(_ref) {
|
|
10
19
|
var children = _ref.children,
|
|
11
20
|
className = _ref.className,
|
|
12
|
-
style = _ref.style,
|
|
13
21
|
header = _ref.header,
|
|
14
22
|
side = _ref.side,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
drawerTitle = _ref.drawerTitle
|
|
18
|
-
|
|
23
|
+
noPageBorder = _ref.noPageBorder,
|
|
24
|
+
page = _ref.page,
|
|
25
|
+
drawerTitle = _ref.drawerTitle,
|
|
26
|
+
countryCode = _ref.countryCode,
|
|
27
|
+
onInspectorChange = _ref.onInspectorChange,
|
|
28
|
+
ref = _ref.ref,
|
|
29
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
var fallbackRef = useRef(null);
|
|
31
|
+
var divRef = ref || fallbackRef;
|
|
19
32
|
var idPrefix = useId();
|
|
20
33
|
var sideId = "".concat(idPrefix, "side");
|
|
21
34
|
var drawerId = "".concat(idPrefix, "drawer");
|
|
22
35
|
var drawerLabelId = "".concat(idPrefix, "drawerLabel");
|
|
23
36
|
useEffect(function () {
|
|
24
|
-
if (
|
|
25
|
-
init(
|
|
37
|
+
if (divRef.current) {
|
|
38
|
+
var instance = init(divRef.current);
|
|
39
|
+
if (onInspectorChange) {
|
|
40
|
+
var isOpen = divRef.current.dataset.blueInspectorOpen !== undefined;
|
|
41
|
+
onInspectorChange(isOpen);
|
|
42
|
+
}
|
|
43
|
+
if (onInspectorChange) {
|
|
44
|
+
divRef.current.addEventListener("blue-inspector-change", function (_ref2) {
|
|
45
|
+
var target = _ref2.target;
|
|
46
|
+
if (target) {
|
|
47
|
+
var _isOpen = target.dataset.blueInspectorOpen !== undefined;
|
|
48
|
+
onInspectorChange(_isOpen);
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
51
|
+
signal: instance === null || instance === void 0 ? void 0 : instance.controller.signal
|
|
52
|
+
});
|
|
53
|
+
}
|
|
26
54
|
}
|
|
27
55
|
return function () {
|
|
28
|
-
if (
|
|
29
|
-
dispose(
|
|
56
|
+
if (divRef.current) {
|
|
57
|
+
dispose(divRef.current);
|
|
30
58
|
}
|
|
31
59
|
};
|
|
32
60
|
}, []);
|
|
33
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
34
|
-
ref:
|
|
35
|
-
className: clsx("blue-layout", className)
|
|
36
|
-
|
|
61
|
+
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
62
|
+
ref: divRef,
|
|
63
|
+
className: clsx("blue-layout", className)
|
|
64
|
+
}, props), {}, {
|
|
37
65
|
children: [/*#__PURE__*/_jsxs("header", {
|
|
38
66
|
className: "blue-layout-header",
|
|
39
67
|
children: [/*#__PURE__*/_jsx("button", {
|
|
@@ -42,7 +70,7 @@ export default function Layout(_ref) {
|
|
|
42
70
|
/* @ts-ignore */,
|
|
43
71
|
command: "show-modal",
|
|
44
72
|
commandfor: drawerId,
|
|
45
|
-
"aria-label": getPhrase("Toggle menu"),
|
|
73
|
+
"aria-label": getPhrase("Toggle menu", countryCode),
|
|
46
74
|
children: /*#__PURE__*/_jsxs("svg", {
|
|
47
75
|
xmlns: "http://www.w3.org/2000/svg",
|
|
48
76
|
viewBox: "0 0 16 16",
|
|
@@ -63,7 +91,7 @@ export default function Layout(_ref) {
|
|
|
63
91
|
"data-blue-toggle": "layout-side",
|
|
64
92
|
"aria-controls": sideId,
|
|
65
93
|
"aria-expanded": "true",
|
|
66
|
-
"aria-label": getPhrase("Toggle sidebar"),
|
|
94
|
+
"aria-label": getPhrase("Toggle sidebar", countryCode),
|
|
67
95
|
children: /*#__PURE__*/_jsx("svg", {
|
|
68
96
|
xmlns: "http://www.w3.org/2000/svg",
|
|
69
97
|
viewBox: "0 0 16 16",
|
|
@@ -83,7 +111,7 @@ export default function Layout(_ref) {
|
|
|
83
111
|
children: /*#__PURE__*/_jsxs("dialog", {
|
|
84
112
|
className: "blue-lg-modal blue-modal modal",
|
|
85
113
|
id: drawerId,
|
|
86
|
-
"aria-
|
|
114
|
+
"aria-labelledby": drawerLabelId,
|
|
87
115
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
88
116
|
className: "offcanvas offcanvas-start",
|
|
89
117
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
@@ -91,7 +119,7 @@ export default function Layout(_ref) {
|
|
|
91
119
|
children: [/*#__PURE__*/_jsx("h1", {
|
|
92
120
|
className: "h5 offcanvas-title",
|
|
93
121
|
id: drawerLabelId,
|
|
94
|
-
children: drawerTitle || getPhrase("Menu")
|
|
122
|
+
children: drawerTitle || getPhrase("Menu", countryCode)
|
|
95
123
|
}), /*#__PURE__*/_jsx("form", {
|
|
96
124
|
method: "dialog",
|
|
97
125
|
style: {
|
|
@@ -100,7 +128,7 @@ export default function Layout(_ref) {
|
|
|
100
128
|
children: /*#__PURE__*/_jsx("button", {
|
|
101
129
|
type: "submit",
|
|
102
130
|
className: "btn-close",
|
|
103
|
-
"aria-label": getPhrase("Close")
|
|
131
|
+
"aria-label": getPhrase("Close", countryCode)
|
|
104
132
|
})
|
|
105
133
|
})]
|
|
106
134
|
}), /*#__PURE__*/_jsx("div", {
|
|
@@ -114,18 +142,18 @@ export default function Layout(_ref) {
|
|
|
114
142
|
method: "dialog",
|
|
115
143
|
className: "blue-modal-backdrop",
|
|
116
144
|
children: /*#__PURE__*/_jsx("button", {
|
|
117
|
-
children: getPhrase("Close")
|
|
145
|
+
children: getPhrase("Close", countryCode)
|
|
118
146
|
})
|
|
119
147
|
})]
|
|
120
148
|
})
|
|
121
149
|
}), /*#__PURE__*/_jsx("main", {
|
|
122
150
|
className: "blue-layout-main",
|
|
123
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
151
|
+
children: children || /*#__PURE__*/_jsx("div", {
|
|
124
152
|
className: clsx("blue-layout-body", {
|
|
125
153
|
"border-0": noPageBorder
|
|
126
154
|
}),
|
|
127
|
-
children:
|
|
155
|
+
children: page
|
|
128
156
|
})
|
|
129
157
|
})]
|
|
130
|
-
});
|
|
158
|
+
}));
|
|
131
159
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["inspectorId", "start", "end", "drawerTitle", "noPageBorder", "countryCode", "className"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
+
import "@spectrum-web-components/split-view/sp-split-view.js";
|
|
11
|
+
import { useId } from "react";
|
|
12
|
+
import clsx from "clsx";
|
|
13
|
+
import { getPhrase } from "./shared.js";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Might require React 19 or higher!
|
|
17
|
+
* Allows to create a split view between the layout's main content and an inspector next to it.
|
|
18
|
+
* Doesn't support SSR out of the box.
|
|
19
|
+
*/
|
|
20
|
+
export default function LayoutSplitter(_ref) {
|
|
21
|
+
var inspectorId = _ref.inspectorId,
|
|
22
|
+
start = _ref.start,
|
|
23
|
+
end = _ref.end,
|
|
24
|
+
drawerTitle = _ref.drawerTitle,
|
|
25
|
+
noPageBorder = _ref.noPageBorder,
|
|
26
|
+
countryCode = _ref.countryCode,
|
|
27
|
+
className = _ref.className,
|
|
28
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
var idPrefix = useId();
|
|
30
|
+
var drawerLabelId = "".concat(idPrefix, "drawerLabel");
|
|
31
|
+
return /*#__PURE__*/_jsxs("sp-split-view", _objectSpread(_objectSpread({
|
|
32
|
+
className: clsx("blue-layout-splitter", className)
|
|
33
|
+
}, props), {}, {
|
|
34
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
35
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
36
|
+
className: clsx("blue-layout-body", {
|
|
37
|
+
"border-0": noPageBorder
|
|
38
|
+
}),
|
|
39
|
+
children: start
|
|
40
|
+
})
|
|
41
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
42
|
+
children: /*#__PURE__*/_jsxs("dialog", {
|
|
43
|
+
className: "blue-layout-inspector blue-lg-modal blue-modal modal",
|
|
44
|
+
id: inspectorId,
|
|
45
|
+
"aria-labelledby": drawerLabelId,
|
|
46
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
47
|
+
className: "offcanvas offcanvas-end",
|
|
48
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
49
|
+
className: "offcanvas-header",
|
|
50
|
+
children: [/*#__PURE__*/_jsx("h1", {
|
|
51
|
+
className: "h5 offcanvas-title",
|
|
52
|
+
id: drawerLabelId,
|
|
53
|
+
children: drawerTitle || getPhrase("Inspector", countryCode)
|
|
54
|
+
}), /*#__PURE__*/_jsx("form", {
|
|
55
|
+
method: "dialog",
|
|
56
|
+
style: {
|
|
57
|
+
display: "contents"
|
|
58
|
+
},
|
|
59
|
+
children: /*#__PURE__*/_jsx("button", {
|
|
60
|
+
type: "submit",
|
|
61
|
+
className: "btn-close",
|
|
62
|
+
"aria-label": getPhrase("Close", countryCode)
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
66
|
+
className: "offcanvas-body",
|
|
67
|
+
children: end
|
|
68
|
+
})]
|
|
69
|
+
}), /*#__PURE__*/_jsx("form", {
|
|
70
|
+
method: "dialog",
|
|
71
|
+
className: "blue-modal-backdrop",
|
|
72
|
+
children: /*#__PURE__*/_jsx("button", {
|
|
73
|
+
children: getPhrase("Close", countryCode)
|
|
74
|
+
})
|
|
75
|
+
})]
|
|
76
|
+
})
|
|
77
|
+
})]
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
@@ -5,6 +5,7 @@ var phrases = {
|
|
|
5
5
|
Message: ["Message", "Nachricht"],
|
|
6
6
|
"Toggle menu": ["Toggle menu", "Menü umschalten"],
|
|
7
7
|
Menu: ["Menu", "Menü"],
|
|
8
|
+
Inspector: ["Inspector", "Inspektor"],
|
|
8
9
|
"Toggle sidebar": ["Toggle sidebar", "Seitenleiste umschalten"],
|
|
9
10
|
"Toggle details": ["Toggle details", "Details umschalten"],
|
|
10
11
|
"Close all": ["Close all", "Alle schließen"],
|
package/index.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export default global
|
|
|
9
9
|
export { default as Layout } from "./dist/components/Layout"
|
|
10
10
|
export { LayoutProps } from "./dist/components/Layout"
|
|
11
11
|
|
|
12
|
+
export { default as LayoutSplitter } from "./dist/components/LayoutSplitter"
|
|
13
|
+
export { LayoutSplitterProps } from "./dist/components/LayoutSplitter"
|
|
14
|
+
|
|
12
15
|
export { default as A } from "./dist/components/A"
|
|
13
16
|
export { AProps } from "./dist/components/A"
|
|
14
17
|
|
|
@@ -73,12 +76,6 @@ export { StatusProps } from "./dist/components/Status"
|
|
|
73
76
|
|
|
74
77
|
export { StatusProvider, useStatus } from "./dist/components/StatusProvider"
|
|
75
78
|
|
|
76
|
-
export {
|
|
77
|
-
ToastProvider,
|
|
78
|
-
ToastProviderProps,
|
|
79
|
-
useToast,
|
|
80
|
-
ToastItem,
|
|
81
|
-
ToastItemType
|
|
82
|
-
} from "./dist/components/ToastProvider"
|
|
79
|
+
export { ToastProvider, ToastProviderProps, useToast, ToastItem, ToastItemType } from "./dist/components/ToastProvider"
|
|
83
80
|
|
|
84
81
|
export { default as Utilities } from "./dist/components/Utilities"
|
package/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { default as Chevron } from "./dist/components/Chevron.js"
|
|
|
6
6
|
export { default as FieldGroup } from "./dist/components/FieldGroup.js"
|
|
7
7
|
export { default as HashRouter } from "./dist/components/HashRouter.js"
|
|
8
8
|
export { default as Layout } from "./dist/components/Layout.js"
|
|
9
|
+
export { default as LayoutSplitter } from "./dist/components/LayoutSplitter.js"
|
|
9
10
|
export { default as Header } from "./dist/components/Header.js"
|
|
10
11
|
export { default as HeaderTitle } from "./dist/components/HeaderTitle.js"
|
|
11
12
|
export { default as IconMenuItem } from "./dist/components/IconMenuItem.js"
|
package/package.json
CHANGED
|
@@ -1,78 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"@typescript-eslint/eslint-plugin": "^8.46.4",
|
|
57
|
-
"@typescript-eslint/parser": "^8.46.4",
|
|
58
|
-
"@vitejs/plugin-react": "^5.0.4",
|
|
59
|
-
"babel-plugin-add-import-extension": "^1.6.0",
|
|
60
|
-
"babel-plugin-react-compiler": "^19.1.0-rc.3",
|
|
61
|
-
"eslint": "^9.37.0",
|
|
62
|
-
"eslint-plugin-react-hooks": "^6.1.1",
|
|
63
|
-
"eslint-plugin-react-refresh": "^0.4.7",
|
|
64
|
-
"gh-pages": "^6.3.0",
|
|
65
|
-
"license-report": "^6.2.0",
|
|
66
|
-
"prettier": "2.4.1",
|
|
67
|
-
"react": "^19.2.6",
|
|
68
|
-
"react-bootstrap-icons": "^1.9.1",
|
|
69
|
-
"react-docgen": "^8.0.2",
|
|
70
|
-
"react-dom": "^19.2.6",
|
|
71
|
-
"react-markdown": "^9.0.1",
|
|
72
|
-
"react-router-dom": "^5.3.3",
|
|
73
|
-
"react-syntax-highlighter": "^15.4.3",
|
|
74
|
-
"sass": "1.77.6",
|
|
75
|
-
"typescript": "^5.9.3",
|
|
76
|
-
"vite": "^5.3.4"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
2
|
+
"name": "blue-react",
|
|
3
|
+
"version": "12.0.0",
|
|
4
|
+
"description": "Blue React Components",
|
|
5
|
+
"license": "LGPL-3.0-or-later",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"types": "index.d.ts",
|
|
9
|
+
"homepage": "https://bruegmann.github.io/blue/react",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/bruegmann/blue"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/bruegmann/blue/issues"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@popperjs/core": "^2.11.5",
|
|
19
|
+
"@spectrum-web-components/split-view": "^1.12.2",
|
|
20
|
+
"blue-web": "1.31.0",
|
|
21
|
+
"bootstrap": "~5.3.3",
|
|
22
|
+
"clsx": "^1.1.1"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@babel/cli": "^7.10.4",
|
|
29
|
+
"@babel/preset-env": "^7.10.4",
|
|
30
|
+
"@babel/preset-react": "^7.10.4",
|
|
31
|
+
"@babel/preset-typescript": "^7.9.0",
|
|
32
|
+
"@types/bootstrap": "^5.2.11",
|
|
33
|
+
"@types/react": "^19.2.15",
|
|
34
|
+
"@types/react-dom": "^19.2.3",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^8.46.4",
|
|
36
|
+
"@typescript-eslint/parser": "^8.46.4",
|
|
37
|
+
"babel-plugin-add-import-extension": "^1.6.0",
|
|
38
|
+
"babel-plugin-react-compiler": "^19.1.0-rc.3",
|
|
39
|
+
"eslint": "^9.37.0",
|
|
40
|
+
"eslint-plugin-react-hooks": "^6.1.1",
|
|
41
|
+
"eslint-plugin-react-refresh": "^0.4.7",
|
|
42
|
+
"react": "^19.2.6",
|
|
43
|
+
"react-dom": "^19.2.6",
|
|
44
|
+
"typescript": "^5.9.3"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"dev": "babel ./src/components --out-dir ./dist/components --extensions \".tsx,.js,.ts\" --watch",
|
|
48
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
49
|
+
"build-types": "tsc -p tsconfig.app.json --declaration --emitDeclarationOnly --declarationDir ./dist --noEmit false --composite false",
|
|
50
|
+
"build": "babel ./src/components --out-dir ./dist/components --extensions \".tsx,.js,.ts\"",
|
|
51
|
+
"build-release": "npm run build-types && npm run build",
|
|
52
|
+
"NOT_prepublishOnly": "npm i && npm run build-release",
|
|
53
|
+
"release": "npm publish && npm run deploy"
|
|
54
|
+
}
|
|
55
|
+
}
|
package/dist/components/A.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface AProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* The `<a>` element automatically sets `rel="noreferrer"` for external links with `target="_blank"`.\
|
|
6
|
-
* `A` allows all props of the `<a>` element.\
|
|
7
|
-
* `<A href="https://example.com" target="_blank">Example</A>` ➡️ `<a href="https://example.com" target="_blank" rel="noreferrer">Example</a>`
|
|
8
|
-
*/
|
|
9
|
-
export default function A({ children, rel, ...rest }: AProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { breakOption } from "./shared";
|
|
3
|
-
export declare const ActionMenuContext: React.Context<{
|
|
4
|
-
breakOption: breakOption | "none";
|
|
5
|
-
}>;
|
|
6
|
-
export interface ActionMenuProps {
|
|
7
|
-
/**
|
|
8
|
-
* Hides the toggle button in mobile view. Can be useful when using multiple ActionMenus and not show the toggle button for each menu.
|
|
9
|
-
*/
|
|
10
|
-
hideToggleAction?: boolean;
|
|
11
|
-
children?: any;
|
|
12
|
-
/**
|
|
13
|
-
* Icon component for the toggle icon.
|
|
14
|
-
*/
|
|
15
|
-
toggleIcon?: any;
|
|
16
|
-
className?: string;
|
|
17
|
-
/**
|
|
18
|
-
* "sm" | "md" | "lg" | "xl" | "none". Default is "lg". The responsive breakpoint at which the menu will be shown as a dropdown.
|
|
19
|
-
*/
|
|
20
|
-
break?: breakOption | "none";
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated Use the new `Actions` instead, which is more flexible.
|
|
24
|
-
* The Action Menu on the top right of a page. You can place Actions here which are in context of the current page.
|
|
25
|
-
*/
|
|
26
|
-
export default function ActionMenu(props: ActionMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from "react";
|
|
2
|
-
export interface ActionsProps {
|
|
3
|
-
children?: ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
menuClassName?: string;
|
|
6
|
-
collapseClassName?: string;
|
|
7
|
-
collapseStyle?: CSSProperties;
|
|
8
|
-
collapseMenuClassName?: string;
|
|
9
|
-
collapseMenuStyle?: CSSProperties;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Combination of toolbar and a dropdown menu. Items in toolbar will only be shown if there is enough space.
|
|
13
|
-
* Otherwise they will be visible in the dropdown menu. JavaScript detects if space is changing and rearranges.
|
|
14
|
-
* IMPORTANT: As of right now, children you pass will be rendered twice. Once in the toolbar and once in the dropdown.
|
|
15
|
-
*/
|
|
16
|
-
export default function Actions({ children, className, menuClassName, collapseClassName, collapseStyle, collapseMenuClassName, collapseMenuStyle }: ActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, ReactNode, ElementType } from "react";
|
|
2
|
-
export type ButtonVariant = "filled" | "soft" | "plain" | "outline" | "link" | "menu-item";
|
|
3
|
-
export type ButtonColor = "theme" | "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark";
|
|
4
|
-
export type ButtonProps = ComponentProps<"a"> & ComponentProps<"button"> & {
|
|
5
|
-
elementType?: ElementType;
|
|
6
|
-
variant?: ButtonVariant;
|
|
7
|
-
color?: ButtonColor;
|
|
8
|
-
sm?: boolean;
|
|
9
|
-
lg?: boolean;
|
|
10
|
-
iconBefore?: ReactNode;
|
|
11
|
-
iconAfter?: ReactNode;
|
|
12
|
-
label?: string;
|
|
13
|
-
labelHidden?: boolean;
|
|
14
|
-
busy?: boolean;
|
|
15
|
-
/** Button will be displayed as successful for 3 seconds. */
|
|
16
|
-
success?: boolean;
|
|
17
|
-
active?: boolean;
|
|
18
|
-
/** Button's width and height should be equal. Useful, if you want your body only to have one symbol.
|
|
19
|
-
* When your body only has an icon and hidden label, this will be set automatically. */
|
|
20
|
-
square?: boolean;
|
|
21
|
-
} & {
|
|
22
|
-
/**
|
|
23
|
-
* For compatibility with React Router NavLink
|
|
24
|
-
*/
|
|
25
|
-
to?: string;
|
|
26
|
-
/**
|
|
27
|
-
* For compatibility with React Router NavLink
|
|
28
|
-
*/
|
|
29
|
-
exact?: boolean;
|
|
30
|
-
};
|
|
31
|
-
export default function Button({ elementType, className, type, variant, color, sm, lg, iconBefore, iconAfter, label, labelHidden, busy: busyProp, success: successProp, active, square, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from "react";
|
|
2
|
-
export interface ChevronProps {
|
|
3
|
-
/**
|
|
4
|
-
* Indicates if open or not.
|
|
5
|
-
*/
|
|
6
|
-
open?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* By default the chevron points to the right when closed. Set mirrored and it will point to the left.
|
|
9
|
-
*/
|
|
10
|
-
mirrored?: boolean;
|
|
11
|
-
className?: string;
|
|
12
|
-
style?: CSSProperties;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Chevron icon component with open state.
|
|
16
|
-
*/
|
|
17
|
-
export default function Chevron({ open, mirrored, className, style }: ChevronProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, ReactNode } from "react";
|
|
2
|
-
export type FieldGroupProps = ComponentProps<"details"> & {
|
|
3
|
-
header?: ReactNode;
|
|
4
|
-
isExpanded?: boolean;
|
|
5
|
-
headerClassName?: string;
|
|
6
|
-
id?: string;
|
|
7
|
-
heading?: number;
|
|
8
|
-
pageHeader?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export default function FieldGroup({ className, children, open, header, isExpanded, headerClassName, id, heading, pageHeader, ...rest }: FieldGroupProps): import("react/jsx-runtime").JSX.Element;
|