typescript-overlay-essentials 1.6.1 → 2.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/ConfirmationBox.css +18 -8
- package/dist/ConfirmationBox.d.ts +2 -2
- package/dist/ConfirmationBox.js +3 -3
- package/dist/Dropdown.css +3 -3
- package/dist/Dropdown.d.ts +1 -1
- package/dist/Dropdown.js +14 -8
- package/dist/InfoOverlay.css +18 -8
- package/dist/InfoOverlay.d.ts +2 -2
- package/dist/InfoOverlay.js +4 -4
- package/dist/InfoOverlayWithInput.css +39 -12
- package/dist/InfoOverlayWithInput.d.ts +2 -2
- package/dist/InfoOverlayWithInput.js +4 -4
- package/dist/LoadingOverlay.css +15 -15
- package/dist/LoadingOverlay.d.ts +2 -2
- package/dist/LoadingOverlay.js +1 -1
- package/dist/MultipleChoiceOverlay.css +28 -26
- package/dist/MultipleChoiceOverlay.d.ts +2 -2
- package/dist/MultipleChoiceOverlay.js +8 -8
- package/dist/MultipleRadioOverlay.css +27 -25
- package/dist/MultipleRadioOverlay.d.ts +2 -2
- package/dist/MultipleRadioOverlay.js +8 -8
- package/dist/Toast.css +1 -1
- package/dist/Toast.d.ts +3 -3
- package/dist/Toast.js +1 -1
- package/dist/ToggleSwitch.css +7 -7
- package/dist/ToggleSwitch.js +1 -1
- package/dist/TutorialOverlay.css +94 -0
- package/dist/TutorialOverlay.d.ts +26 -0
- package/dist/TutorialOverlay.js +195 -0
- package/package.json +1 -1
package/dist/ConfirmationBox.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.confirmation-overlay {
|
|
1
|
+
.overlay-essentials-confirmation-overlay {
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
z-index: 10000;
|
|
12
|
+
white-space: pre-line;
|
|
13
|
+
word-break: break-word;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
.confirmation-box {
|
|
16
|
+
.overlay-essentials-confirmation-box {
|
|
15
17
|
background-color: var(--Hellgrau, white);
|
|
16
18
|
color: var(--HellSchwarz,#2c2c2c);
|
|
17
19
|
padding: 2rem;
|
|
@@ -36,34 +38,42 @@
|
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
.confirmation-box div {
|
|
41
|
+
.overlay-essentials-confirmation-box div {
|
|
40
42
|
margin-bottom: 0.5em;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
.confirmation-box .headline {
|
|
45
|
+
.overlay-essentials-confirmation-box .overlay-essentials-headline {
|
|
44
46
|
margin-bottom: 0.75em;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
.confirmation-box .confirmation-buttons {
|
|
49
|
+
.overlay-essentials-confirmation-box .overlay-essentials-confirmation-buttons {
|
|
48
50
|
display: flex;
|
|
49
51
|
justify-content: center;
|
|
50
52
|
gap: 1rem;
|
|
51
53
|
margin-top: 1.5rem;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
.confirmation-box .confirmation-buttons button {
|
|
56
|
+
.overlay-essentials-confirmation-box .overlay-essentials-confirmation-buttons button {
|
|
55
57
|
font-size: 85%;
|
|
56
58
|
padding: 0.5rem 1.1rem;
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
.confirmation-box .closeButton {
|
|
61
|
+
.overlay-essentials-confirmation-box .overlay-essentials-closeButton {
|
|
60
62
|
right: 10px;
|
|
61
63
|
top: 10px;
|
|
62
64
|
position: absolute;
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
.confirmation-box .close-icon:hover {
|
|
67
|
+
.overlay-essentials-confirmation-box .overlay-essentials-close-icon:hover {
|
|
66
68
|
color: var(--HSDAkzent);
|
|
67
69
|
cursor: pointer;
|
|
68
70
|
}
|
|
69
71
|
|
|
72
|
+
|
|
73
|
+
/* ==== Dark Mode Support ==== */
|
|
74
|
+
[visual-theme="dark"] {
|
|
75
|
+
.overlay-essentials-confirmation-box {
|
|
76
|
+
background-color: var(--HellSchwarz,#2c2c2c);
|
|
77
|
+
color: white;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { CSSProperties } from 'react';
|
|
2
|
+
import { CSSProperties, Dispatch, SetStateAction } from 'react';
|
|
3
3
|
import './ConfirmationBox.css';
|
|
4
4
|
export interface ConfirmationBoxState {
|
|
5
5
|
headline?: React.ReactNode;
|
|
@@ -20,5 +20,5 @@ export interface ConfirmationBoxState {
|
|
|
20
20
|
export declare const defaultConfirmationState: ConfirmationBoxState;
|
|
21
21
|
export declare function ConfirmationBox({ state, setState }: {
|
|
22
22
|
state: ConfirmationBoxState;
|
|
23
|
-
setState:
|
|
23
|
+
setState: Dispatch<SetStateAction<ConfirmationBoxState>>;
|
|
24
24
|
}): React.ReactElement;
|
package/dist/ConfirmationBox.js
CHANGED
|
@@ -65,10 +65,10 @@ export function ConfirmationBox({ state, setState }) {
|
|
|
65
65
|
tempState.handler(tempState.handlerArgs);
|
|
66
66
|
};
|
|
67
67
|
return showConfirm ?
|
|
68
|
-
_jsx("div", { className: "confirmation-overlay", children: _jsxs("div", { className: "confirmation-box", style: (state === null || state === void 0 ? void 0 : state.style) !== undefined ? state.style : {}, role: "alertdialog", "aria-modal": "true", "aria-labelledby": (state === null || state === void 0 ? void 0 : state.headline) !== undefined ? "confirmation-headline" : undefined, "aria-label": (state === null || state === void 0 ? void 0 : state.headline) !== undefined ? undefined : "Bestätigung", "aria-describedby": "confirmation-message", onKeyDown: (event) => {
|
|
68
|
+
_jsx("div", { className: "overlay-essentials-confirmation-overlay", children: _jsxs("div", { className: "overlay-essentials-confirmation-box", style: (state === null || state === void 0 ? void 0 : state.style) !== undefined ? state.style : {}, role: "alertdialog", "aria-modal": "true", "aria-labelledby": (state === null || state === void 0 ? void 0 : state.headline) !== undefined ? "confirmation-headline" : undefined, "aria-label": (state === null || state === void 0 ? void 0 : state.headline) !== undefined ? undefined : "Bestätigung", "aria-describedby": "confirmation-message", onKeyDown: (event) => {
|
|
69
69
|
if (event.key === "Escape")
|
|
70
70
|
handleAction(state.handlerCancel);
|
|
71
71
|
}, children: [state.addCloseButton ?
|
|
72
|
-
_jsx("span", { className: "closeButton", children: _jsx("button", { type: "button", className: "close-icon", onClick: () => handleAction(undefined), "aria-label": "Dialog schlie\u00DFen", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) }) }) :
|
|
73
|
-
_jsx(_Fragment, {}), (state === null || state === void 0 ? void 0 : state.headline) !== undefined ? _jsx("div", { className: "headline", id: "confirmation-headline",
|
|
72
|
+
_jsx("span", { className: "overlay-essentials-closeButton", children: _jsx("button", { type: "button", className: "overlay-essentials-close-icon", onClick: () => handleAction(undefined), "aria-label": "Dialog schlie\u00DFen", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) }) }) :
|
|
73
|
+
_jsx(_Fragment, {}), (state === null || state === void 0 ? void 0 : state.headline) !== undefined ? _jsx("div", { className: "overlay-essentials-headline", id: "overlay-essentials-confirmation-headline", children: _jsx("strong", { children: state === null || state === void 0 ? void 0 : state.headline }) }) : _jsx(_Fragment, {}), _jsx("div", { id: "overlay-essentials-confirmation-message", children: (_b = (_a = state.message1) !== null && _a !== void 0 ? _a : state.message) !== null && _b !== void 0 ? _b : "" }), _jsx("div", { children: _jsx("strong", { children: (_c = state.message2) !== null && _c !== void 0 ? _c : "" }) }), _jsxs("div", { className: "overlay-essentials-confirmation-buttons", children: [_jsx("button", { onClick: () => handleAction(state.handlerCancel), type: "button", className: "overlay-essentials-px-4 py-2 bg-gray-300 rounded", style: (state === null || state === void 0 ? void 0 : state.cancelButtonStyle) !== undefined ? state.cancelButtonStyle : {}, children: state.cancelButtonText ? state.cancelButtonText : "Abbrechen" }), _jsx("button", { onClick: () => handleAction(state.handlerOk), ref: confirmButtonRef, type: "button", className: "overlay-essentials-px-4 py-2 bg-blue-600 text-white rounded", style: (state === null || state === void 0 ? void 0 : state.proceedButtonStyle) !== undefined ? state.proceedButtonStyle : {}, children: state.proceedButtonText ? state.proceedButtonText : "OK" })] })] }) }) : _jsx(_Fragment, {});
|
|
74
74
|
}
|
package/dist/Dropdown.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.custom-select {
|
|
1
|
+
.overlay-essentials-custom-select {
|
|
2
2
|
border-radius: 8px;
|
|
3
3
|
border: 1px solid var(--Mittelgrau);
|
|
4
4
|
color: black;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
width: 100%;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.custom-select:hover, .dropdown__menu-list div:hover, .card .dropdown__menu-list div:hover {
|
|
21
|
+
.overlay-essentials-custom-select:hover, .dropdown__menu-list div:hover, .card .dropdown__menu-list div:hover {
|
|
22
22
|
cursor: pointer;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
color: var(--FastSchwarz, black);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.custom-select .dropdown__single-value {
|
|
29
|
+
.overlay-essentials-custom-select .dropdown__single-value {
|
|
30
30
|
color: var(--FastSchwarz, black);
|
|
31
31
|
}
|
package/dist/Dropdown.d.ts
CHANGED
package/dist/Dropdown.js
CHANGED
|
@@ -30,14 +30,20 @@ export function Dropdown({ selections, value, onChange, maxMenuHeight, menuPlace
|
|
|
30
30
|
value = options.filter(opt => defaultValue.map(({ value }) => (value)).includes(opt.value)).map(opt => opt.value);
|
|
31
31
|
}
|
|
32
32
|
function usePrefersDarkMode() {
|
|
33
|
-
const [isDarkMode, setIsDarkMode] = useState(
|
|
33
|
+
const [isDarkMode, setIsDarkMode] = useState(document.documentElement.getAttribute('visual-theme') === "dark");
|
|
34
34
|
useEffect(() => {
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
// Handler, der ausgeführt wird, wenn sich das Attribut ändert
|
|
36
|
+
const checkTheme = () => {
|
|
37
|
+
const isDark = document.documentElement.getAttribute('visual-theme') === 'dark';
|
|
38
|
+
setIsDarkMode(isDark);
|
|
39
|
+
};
|
|
40
|
+
// Oberserver an den Handler koppeln (hört auf Änderungen an dem Attribut, falls sich das visual-theme ändert)
|
|
41
|
+
const observer = new MutationObserver(checkTheme);
|
|
42
|
+
observer.observe(document.documentElement, {
|
|
43
|
+
attributes: true,
|
|
44
|
+
attributeFilter: ['visual-theme'] // Nur auf das Attribut reagieren
|
|
45
|
+
});
|
|
46
|
+
return () => observer.disconnect();
|
|
41
47
|
}, []);
|
|
42
48
|
return isDarkMode;
|
|
43
49
|
}
|
|
@@ -46,7 +52,7 @@ export function Dropdown({ selections, value, onChange, maxMenuHeight, menuPlace
|
|
|
46
52
|
function hasId(value) {
|
|
47
53
|
return typeof value === "object" && value !== null && "id" in value;
|
|
48
54
|
}
|
|
49
|
-
return isMulti || Array.isArray(defaultValue) ? (_jsx(Select, { className: "custom-select", isMulti: true, "aria-label": placeHolder !== null && placeHolder !== void 0 ? placeHolder : "Auswahl", placeholder: placeHolder !== null && placeHolder !== void 0 ? placeHolder : "", options: options, value: options.length > 0 && hasId(options[0].value) ? // Wenn die values der Optionen ids haben, handelt es sich um komplexe Objekte, die zur Auswahl stehen und müssen dahingehend verglichen werden
|
|
55
|
+
return isMulti || Array.isArray(defaultValue) ? (_jsx(Select, { className: "overlay-essentials-custom-select", isMulti: true, "aria-label": placeHolder !== null && placeHolder !== void 0 ? placeHolder : "Auswahl", placeholder: placeHolder !== null && placeHolder !== void 0 ? placeHolder : "", options: options, value: options.length > 0 && hasId(options[0].value) ? // Wenn die values der Optionen ids haben, handelt es sich um komplexe Objekte, die zur Auswahl stehen und müssen dahingehend verglichen werden
|
|
50
56
|
options.filter(opt => (hasId(opt.value) && value.find(val => hasId(val) && hasId(opt.value) && val.id === opt.value.id))) // Dann alle Optionen, die in den values per id vorkommen
|
|
51
57
|
: options.filter(opt => (value.includes(opt.value))) // Ansonsten einfach alle Optionen, die in den values vorkommen
|
|
52
58
|
, onChange: (selectedOption) => { initializedRef.current = true; onChange(selectedOption.map((opt) => opt.value)); }, maxMenuHeight: maxMenuHeight !== null && maxMenuHeight !== void 0 ? maxMenuHeight : 280, menuPlacement: menuPlacement !== null && menuPlacement !== void 0 ? menuPlacement : "auto", menuPosition: "fixed", classNamePrefix: "dropdown", defaultValue: options.filter(opt => defaultValue.map(({ value }) => (value)).includes(opt.value)), formatOptionLabel: ({ label, indent }, { context }) => {
|
package/dist/InfoOverlay.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.information-overlay {
|
|
1
|
+
.overlay-essentials-information-overlay {
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
z-index: 10000;
|
|
12
|
+
white-space: pre-line;
|
|
13
|
+
word-break: break-word;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
.information-box {
|
|
16
|
+
.overlay-essentials-information-box {
|
|
15
17
|
background-color: var(--Hellgrau, white);
|
|
16
18
|
color: var(--HellSchwarz,#2c2c2c);
|
|
17
19
|
padding: 2rem;
|
|
@@ -25,7 +27,7 @@
|
|
|
25
27
|
position: relative;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
.information-box .headline {
|
|
30
|
+
.overlay-essentials-information-box .overlay-essentials-headline {
|
|
29
31
|
margin-bottom: 0.75em;
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -41,25 +43,33 @@
|
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
.information-box .information-buttons {
|
|
46
|
+
.overlay-essentials-information-box .overlay-essentials-information-buttons {
|
|
45
47
|
display: flex;
|
|
46
48
|
justify-content: center;
|
|
47
49
|
gap: 1rem;
|
|
48
50
|
margin-top: 1.5rem;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
.information-box .information-buttons button {
|
|
53
|
+
.overlay-essentials-information-box .overlay-essentials-information-buttons button {
|
|
52
54
|
font-size: 85%;
|
|
53
55
|
padding: 0.5rem 1.1rem;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
.information-box .closeButton {
|
|
58
|
+
.overlay-essentials-information-box .overlay-essentials-closeButton {
|
|
57
59
|
right: 10px;
|
|
58
60
|
top: 10px;
|
|
59
61
|
position: absolute;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
.information-box .close-icon:hover {
|
|
64
|
+
.overlay-essentials-information-box .overlay-essentials-close-icon:hover {
|
|
63
65
|
color: var(--HSDAkzent);
|
|
64
66
|
cursor: pointer;
|
|
65
|
-
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* ==== Dark Mode Support ==== */
|
|
70
|
+
[visual-theme="dark"] {
|
|
71
|
+
.overlay-essentials-information-box {
|
|
72
|
+
background-color: var(--HellSchwarz,#2c2c2c);
|
|
73
|
+
color: #fff;
|
|
74
|
+
}
|
|
75
|
+
}
|
package/dist/InfoOverlay.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
1
|
+
import { CSSProperties, Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import './InfoOverlay.css';
|
|
4
4
|
export interface InfoOverlayState {
|
|
@@ -13,5 +13,5 @@ export interface InfoOverlayState {
|
|
|
13
13
|
export declare const defaultInfoOverlayState: InfoOverlayState;
|
|
14
14
|
export declare function InfoOverlay({ state, setState }: {
|
|
15
15
|
state: InfoOverlayState;
|
|
16
|
-
setState:
|
|
16
|
+
setState: Dispatch<SetStateAction<InfoOverlayState>>;
|
|
17
17
|
}): React.ReactElement;
|
package/dist/InfoOverlay.js
CHANGED
|
@@ -40,18 +40,18 @@ export function InfoOverlay({ state, setState }) {
|
|
|
40
40
|
tempState.handler(tempState.handlerArgs);
|
|
41
41
|
};
|
|
42
42
|
return showOverlay ?
|
|
43
|
-
_jsx("div", { className: "information-overlay", children: _jsxs("div", { className: "information-box", style: (state === null || state === void 0 ? void 0 : state.style) !== undefined ? state.style : {}, role: "dialog", "aria-modal": "true", "aria-labelledby": (state === null || state === void 0 ? void 0 : state.headline) !== undefined ? "information-headline" : undefined, "aria-label": (state === null || state === void 0 ? void 0 : state.headline) !== undefined ? undefined : "Information", "aria-describedby": "information-message", onKeyDown: (event) => { if (event.key === "Escape")
|
|
43
|
+
_jsx("div", { className: "overlay-essentials-information-overlay", children: _jsxs("div", { className: "overlay-essentials-information-box", style: (state === null || state === void 0 ? void 0 : state.style) !== undefined ? state.style : {}, role: "dialog", "aria-modal": "true", "aria-labelledby": (state === null || state === void 0 ? void 0 : state.headline) !== undefined ? "information-headline" : undefined, "aria-label": (state === null || state === void 0 ? void 0 : state.headline) !== undefined ? undefined : "Information", "aria-describedby": "information-message", onKeyDown: (event) => { if (event.key === "Escape")
|
|
44
44
|
handleAction(); }, children: [state.addCloseButton ?
|
|
45
|
-
_jsx("span", { className: "closeButton", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", tabIndex: 0, className: "close-icon", onClick: () => setShowOverlay(false), onKeyDown: (e) => {
|
|
45
|
+
_jsx("span", { className: "overlay-essentials-closeButton", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", tabIndex: 0, className: "overlay-essentials-close-icon", onClick: () => setShowOverlay(false), onKeyDown: (e) => {
|
|
46
46
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
47
47
|
e.preventDefault(); // Verhindert Scroll bei Space
|
|
48
48
|
setShowOverlay(false);
|
|
49
49
|
}
|
|
50
50
|
}, role: "button", "aria-label": "Dialog schlie\u00DFen", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) }) :
|
|
51
|
-
_jsx(_Fragment, {}), _jsx("div", { className: "headline", id: "information-headline",
|
|
51
|
+
_jsx(_Fragment, {}), _jsx("div", { className: "overlay-essentials-headline", id: "overlay-essentials-information-headline", children: _jsx("strong", { children: (state === null || state === void 0 ? void 0 : state.headline) !== undefined ? state.headline : "" }) }), _jsx("div", { id: "overlay-essentials-information-message", children: (state === null || state === void 0 ? void 0 : state.message) !== undefined ? state.message : "" }), _jsx("div", { className: "overlay-essentials-information-buttons", children: _jsx("button", { type: "button", autoFocus: true, onClick: () => handleAction(), onKeyDown: (e) => {
|
|
52
52
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
53
53
|
e.preventDefault(); // Verhindert Scroll bei Space
|
|
54
54
|
handleAction();
|
|
55
55
|
}
|
|
56
|
-
}, className: "px-4 py-2 bg-blue-600 text-white rounded", id: "infoButton", children: (state === null || state === void 0 ? void 0 : state.proceedButtonText) !== undefined ? state.proceedButtonText : "OK" }) })] }) }) : _jsx(_Fragment, {});
|
|
56
|
+
}, className: "overlay-essentials-px-4 py-2 bg-blue-600 text-white rounded", id: "overlay-essentials-infoButton", children: (state === null || state === void 0 ? void 0 : state.proceedButtonText) !== undefined ? state.proceedButtonText : "OK" }) })] }) }) : _jsx(_Fragment, {});
|
|
57
57
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.information-overlay-with-input {
|
|
1
|
+
.overlay-essentials-information-overlay-with-input {
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
z-index: 10000;
|
|
12
|
+
white-space: pre-line;
|
|
13
|
+
word-break: break-word;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
.information-box-with-input {
|
|
16
|
+
.overlay-essentials-information-box-with-input {
|
|
15
17
|
background-color: var(--Hellgrau, white);
|
|
16
18
|
color: var(--HellSchwarz,#2c2c2c);
|
|
17
19
|
padding: 2rem;
|
|
@@ -37,19 +39,19 @@
|
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
.information-box-with-input .information-buttons {
|
|
42
|
+
.overlay-essentials-information-box-with-input .overlay-essentials-information-buttons {
|
|
41
43
|
display: flex;
|
|
42
44
|
justify-content: center;
|
|
43
45
|
gap: 1rem;
|
|
44
46
|
margin-top: 1.5rem;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
.information-box-with-input .information-buttons button {
|
|
49
|
+
.overlay-essentials-information-box-with-input .overlay-essentials-information-buttons button {
|
|
48
50
|
font-size: 85%;
|
|
49
51
|
padding: 0.5rem 1.1rem;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
|
-
.information-box-with-input input[type="text"] {
|
|
54
|
+
.overlay-essentials-information-box-with-input input[type="text"] {
|
|
53
55
|
margin-top: 15px;
|
|
54
56
|
padding: 0.75rem 1rem;
|
|
55
57
|
font-size: 1em;
|
|
@@ -58,31 +60,56 @@
|
|
|
58
60
|
box-shadow: inset 0 0 0 1px #ccc;
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
.information-box-with-input .headline {
|
|
63
|
+
.overlay-essentials-information-box-with-input .overlay-essentials-headline {
|
|
62
64
|
margin-bottom: 0.75em;
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
/* ==== Dark Mode Support ==== */
|
|
66
|
-
|
|
67
|
-
.information-box-with-input {
|
|
68
|
+
[visual-theme="dark"] {
|
|
69
|
+
.overlay-essentials-information-box-with-input {
|
|
68
70
|
background-color: var(--HellSchwarz,#2c2c2c);
|
|
69
71
|
color: #fff;
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
.information-box-with-input input[type="text"] {
|
|
74
|
+
.overlay-essentials-information-box-with-input input[type="text"] {
|
|
73
75
|
background-color: var(--HellSchwarz, #2c2c2c);
|
|
74
76
|
color: var(--FastWeiß, white);
|
|
75
77
|
box-shadow: inset 0 0 0 1px #444;
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
|
|
79
|
-
.information-box-with-input .closeButton {
|
|
81
|
+
.overlay-essentials-information-box-with-input .overlay-essentials-closeButton {
|
|
80
82
|
right: 10px;
|
|
81
83
|
top: 10px;
|
|
82
84
|
position: absolute;
|
|
83
85
|
}
|
|
84
86
|
|
|
85
|
-
.information-box-with-input .close-icon:hover {
|
|
87
|
+
.overlay-essentials-information-box-with-input .overlay-essentials-close-icon:hover {
|
|
86
88
|
color: var(--HSDAkzent);
|
|
87
89
|
cursor: pointer;
|
|
88
|
-
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.overlay-essentials-information-box-with-input .overlay-essentials-closeButton {
|
|
93
|
+
right: 10px;
|
|
94
|
+
top: 10px;
|
|
95
|
+
position: absolute;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.overlay-essentials-information-box-with-input .overlay-essentials-close-icon:hover {
|
|
99
|
+
color: var(--HSDAkzent);
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* ==== Dark Mode Support ==== */
|
|
104
|
+
[visual-theme="dark"] {
|
|
105
|
+
.overlay-essentials-information-box-with-input {
|
|
106
|
+
background-color: var(--HellSchwarz,#2c2c2c);
|
|
107
|
+
color: #fff;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.overlay-essentials-information-box-with-input input[type="text"] {
|
|
111
|
+
background-color: var(--HellSchwarz, #2c2c2c);
|
|
112
|
+
color: var(--FastWeiß, white);
|
|
113
|
+
box-shadow: inset 0 0 0 1px #444;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
1
|
+
import { CSSProperties, Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import './InfoOverlayWithInput.css';
|
|
4
4
|
export interface InfoOverlayWithInputState {
|
|
@@ -19,5 +19,5 @@ export interface InfoOverlayWithInputState {
|
|
|
19
19
|
export declare const defaultInfoOverlayWithInputState: InfoOverlayWithInputState;
|
|
20
20
|
export declare function InfoOverlayWithInput({ state, setState }: {
|
|
21
21
|
state: InfoOverlayWithInputState;
|
|
22
|
-
setState:
|
|
22
|
+
setState: Dispatch<SetStateAction<InfoOverlayWithInputState>>;
|
|
23
23
|
}): React.ReactElement;
|
|
@@ -69,18 +69,18 @@ export function InfoOverlayWithInput({ state, setState }) {
|
|
|
69
69
|
tempState.handler(tempState.handlerArgs);
|
|
70
70
|
};
|
|
71
71
|
return showOverlay ?
|
|
72
|
-
_jsx("div", { className: "information-overlay-with-input", children: _jsxs("div", { className: "information-box-with-input", style: (state === null || state === void 0 ? void 0 : state.style) !== undefined ? state.style : {}, role: "dialog", "aria-modal": "true", "aria-labelledby": (state === null || state === void 0 ? void 0 : state.headline) != null ? "information-input-headline" : undefined, "aria-label": (state === null || state === void 0 ? void 0 : state.headline) != null ? undefined : "Information", "aria-describedby": "information-input-message", onKeyDown: (event) => { if (event.key === "Escape")
|
|
72
|
+
_jsx("div", { className: "overlay-essentials-information-overlay-with-input", children: _jsxs("div", { className: "overlay-essentials-information-box-with-input", style: (state === null || state === void 0 ? void 0 : state.style) !== undefined ? state.style : {}, role: "dialog", "aria-modal": "true", "aria-labelledby": (state === null || state === void 0 ? void 0 : state.headline) != null ? "information-input-headline" : undefined, "aria-label": (state === null || state === void 0 ? void 0 : state.headline) != null ? undefined : "Information", "aria-describedby": "information-input-message", onKeyDown: (event) => { if (event.key === "Escape")
|
|
73
73
|
handleAction(state.handlerCancel, false); }, children: [state.addCloseButton ?
|
|
74
|
-
_jsx("span", { className: "closeButton", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", tabIndex: 0, className: "close-icon", onClick: () => handleAction(undefined, false), onKeyDown: (e) => {
|
|
74
|
+
_jsx("span", { className: "overlay-essentials-closeButton", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", tabIndex: 0, className: "overlay-essentials-close-icon", onClick: () => handleAction(undefined, false), onKeyDown: (e) => {
|
|
75
75
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
76
76
|
e.preventDefault(); // Verhindert Scroll bei Space
|
|
77
77
|
handleAction(undefined, false);
|
|
78
78
|
}
|
|
79
79
|
}, role: "button", "aria-label": "Dialog schlie\u00DFen", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) }) :
|
|
80
|
-
_jsx(_Fragment, {}), _jsx("div", { className: "headline", id: "information-input-headline",
|
|
80
|
+
_jsx(_Fragment, {}), _jsx("div", { className: "overlay-essentials-headline", id: "overlay-essentials-information-input-headline", children: _jsx("strong", { children: (state === null || state === void 0 ? void 0 : state.headline) != null ? state.headline : "" }) }), _jsx("div", { id: "overlay-essentials-information-input-message", children: (state === null || state === void 0 ? void 0 : state.message) != null ? state.message : "" }), _jsx("div", { className: "overlay-essentials-information-input", children: _jsx("input", { id: "overlay-essentials-information-inputfield", "aria-label": (state === null || state === void 0 ? void 0 : state.placeholder) != null ? state.placeholder : "Eingabe", autoFocus: true, placeholder: (state === null || state === void 0 ? void 0 : state.placeholder) != null ? state.placeholder : "", pattern: "^[A-Za-z0-9_-~]+$", required: true, type: "text", className: "overlay-essentials-form-control", value: input, onChange: handleInputChange, onKeyDown: handleInputKeyDown }) }), _jsxs("div", { className: "overlay-essentials-information-buttons", children: [_jsx("button", { onClick: () => handleAction(state.handlerCancel, false), className: "overlay-essentials-px-4 py-2 bg-gray-300 rounded", style: (state === null || state === void 0 ? void 0 : state.cancelButtonStyle) != null ? state.cancelButtonStyle : {}, tabIndex: 0, onKeyDown: (e) => {
|
|
81
81
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
82
82
|
e.preventDefault(); // Verhindert Scroll bei Space
|
|
83
83
|
handleAction(state.handlerCancel, false);
|
|
84
84
|
}
|
|
85
|
-
}, children: (state === null || state === void 0 ? void 0 : state.cancelButtonText) != null ? state.cancelButtonText : "Abbrechen" }), _jsx("button", { onClick: () => handleAction(state.handlerOk, true), className: "px-4 py-2 bg-blue-600 text-white rounded", style: (state === null || state === void 0 ? void 0 : state.proceedButtonStyle) != null ? state.proceedButtonStyle : {}, tabIndex: 0, children: (state === null || state === void 0 ? void 0 : state.proceedButtonText) != null ? state.proceedButtonText : "OK" })] })] }) }) : _jsx(_Fragment, {});
|
|
85
|
+
}, children: (state === null || state === void 0 ? void 0 : state.cancelButtonText) != null ? state.cancelButtonText : "Abbrechen" }), _jsx("button", { onClick: () => handleAction(state.handlerOk, true), className: "overlay-essentials-px-4 py-2 bg-blue-600 text-white rounded", style: (state === null || state === void 0 ? void 0 : state.proceedButtonStyle) != null ? state.proceedButtonStyle : {}, tabIndex: 0, children: (state === null || state === void 0 ? void 0 : state.proceedButtonText) != null ? state.proceedButtonText : "OK" })] })] }) }) : _jsx(_Fragment, {});
|
|
86
86
|
}
|
package/dist/LoadingOverlay.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.loading-overlay {
|
|
1
|
+
.overlay-essentials-loading-overlay {
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
backdrop-filter: blur(2px);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.loading-box {
|
|
15
|
+
.overlay-essentials-loading-box {
|
|
16
16
|
display: flex;
|
|
17
17
|
flex-direction: column;
|
|
18
18
|
align-items: center;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/* Spinner (Standardfarbe für Dark Mode) */
|
|
23
|
-
.loading-box .spinner {
|
|
23
|
+
.overlay-essentials-loading-box .overlay-essentials-spinner {
|
|
24
24
|
width: 60px;
|
|
25
25
|
height: 60px;
|
|
26
26
|
/*border: 8px solid var(--HellSchwarz, #555);*/
|
|
@@ -35,25 +35,25 @@
|
|
|
35
35
|
transform 0.3s ease;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.loading-box .spinner.is-success,
|
|
39
|
-
.loading-box .spinner.is-error {
|
|
38
|
+
.overlay-essentials-loading-box .overlay-essentials-spinner.overlay-essentials-is-success,
|
|
39
|
+
.overlay-essentials-loading-box .overlay-essentials-spinner.overlay-essentials-is-error {
|
|
40
40
|
animation: none;
|
|
41
41
|
border-color: transparent;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.loading-box .spinner::before,
|
|
45
|
-
.loading-box .spinner::after {
|
|
44
|
+
.overlay-essentials-loading-box .overlay-essentials-spinner::before,
|
|
45
|
+
.overlay-essentials-loading-box .overlay-essentials-spinner::after {
|
|
46
46
|
content: "";
|
|
47
47
|
position: absolute;
|
|
48
48
|
opacity: 0;
|
|
49
49
|
transition: opacity 0.3s ease;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
.loading-box .spinner.is-success {
|
|
52
|
+
.overlay-essentials-loading-box .overlay-essentials-spinner.overlay-essentials-is-success {
|
|
53
53
|
background-color: var(--success-bg, #4caf50);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
.loading-box .spinner.is-success::before {
|
|
56
|
+
.overlay-essentials-loading-box .overlay-essentials-spinner.overlay-essentials-is-success::before {
|
|
57
57
|
width: 12px;
|
|
58
58
|
height: 24px;
|
|
59
59
|
border-right: 6px solid white;
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
opacity: 1;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.loading-box .spinner.is-error {
|
|
67
|
+
.overlay-essentials-loading-box .overlay-essentials-spinner.overlay-essentials-is-error {
|
|
68
68
|
background-color: var(--error-bg, #e60028);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
.loading-box .spinner.is-error::before,
|
|
72
|
-
.loading-box .spinner.is-error::after {
|
|
71
|
+
.overlay-essentials-loading-box .overlay-essentials-spinner.overlay-essentials-is-error::before,
|
|
72
|
+
.overlay-essentials-loading-box .overlay-essentials-spinner.overlay-essentials-is-error::after {
|
|
73
73
|
width: 36px;
|
|
74
74
|
height: 6px;
|
|
75
75
|
background: white;
|
|
@@ -78,15 +78,15 @@
|
|
|
78
78
|
opacity: 1;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
.loading-box .spinner.is-error::before {
|
|
81
|
+
.overlay-essentials-loading-box .overlay-essentials-spinner.overlay-essentials-is-error::before {
|
|
82
82
|
transform: rotate(45deg);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
.loading-box .spinner.is-error::after {
|
|
85
|
+
.overlay-essentials-loading-box .overlay-essentials-spinner.overlay-essentials-is-error::after {
|
|
86
86
|
transform: rotate(-45deg);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
.loading-box .loading-message {
|
|
89
|
+
.overlay-essentials-loading-box .overlay-essentials-loading-message {
|
|
90
90
|
font-size: 1.1em;
|
|
91
91
|
font-weight: bold;
|
|
92
92
|
text-align: center;
|
package/dist/LoadingOverlay.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement, CSSProperties } from 'react';
|
|
1
|
+
import { ReactElement, CSSProperties, Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import './LoadingOverlay.css';
|
|
4
4
|
export interface LoadingOverlayState {
|
|
@@ -11,5 +11,5 @@ export interface LoadingOverlayState {
|
|
|
11
11
|
export declare const defaultLoadingOverlayState: LoadingOverlayState;
|
|
12
12
|
export declare function LoadingOverlay({ state, setState }: {
|
|
13
13
|
state: LoadingOverlayState;
|
|
14
|
-
setState:
|
|
14
|
+
setState: Dispatch<SetStateAction<LoadingOverlayState>>;
|
|
15
15
|
}): ReactElement;
|
package/dist/LoadingOverlay.js
CHANGED
|
@@ -30,7 +30,7 @@ export function LoadingOverlay({ state, setState }) {
|
|
|
30
30
|
setShowOverlay(false);
|
|
31
31
|
}
|
|
32
32
|
}, [state, setState]);
|
|
33
|
-
return showOverlay ? (_jsx("div", { className: "loading-overlay", role: "status", "aria-live": "polite", "aria-atomic": "true", "aria-busy": (_a = state === null || state === void 0 ? void 0 : state.isActive) !== null && _a !== void 0 ? _a : false, children: _jsxs("div", { className: "loading-box", style: (state === null || state === void 0 ? void 0 : state.style) !== undefined ? state.style : {}, children: [_jsx("div", { className: "spinner " + (state.showSuccess === undefined ? "is-loading" : (state.showSuccess ? "is-success" : "is-error")), style: {
|
|
33
|
+
return showOverlay ? (_jsx("div", { className: "overlay-essentials-loading-overlay", role: "status", "aria-live": "polite", "aria-atomic": "true", "aria-busy": (_a = state === null || state === void 0 ? void 0 : state.isActive) !== null && _a !== void 0 ? _a : false, children: _jsxs("div", { className: "overlay-essentials-loading-box", style: (state === null || state === void 0 ? void 0 : state.style) !== undefined ? state.style : {}, children: [_jsx("div", { className: "overlay-essentials-spinner " + (state.showSuccess === undefined ? "overlay-essentials-is-loading" : (state.showSuccess ? "overlay-essentials-is-success" : "overlay-essentials-is-error")), style: {
|
|
34
34
|
"--spinner-color": (_b = state.color) !== null && _b !== void 0 ? _b : "#e60028",
|
|
35
35
|
"--success-bg": (_c = state.color) !== null && _c !== void 0 ? _c : "#42ab34",
|
|
36
36
|
"--error-bg": (_d = state.color) !== null && _d !== void 0 ? _d : "#e60028",
|