@olenbetong/synergi-react 2.7.0 → 2.8.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/{src/components → es/chrome}/AppMenu/AppMenu.css +648 -648
- package/es/{components → chrome}/AppMenu/AppMenu.d.ts +17 -8
- package/es/chrome/AppMenu/AppMenu.js +145 -0
- package/es/chrome/AppMenu/AppMenuColorScheme.d.ts +2 -0
- package/es/chrome/AppMenu/AppMenuColorScheme.js +18 -0
- package/es/chrome/AppMenu/AppMenuFavoriteButton.d.ts +18 -0
- package/es/chrome/AppMenu/AppMenuFavoriteButton.js +11 -0
- package/es/chrome/AppMenu/AppMenuHeader.d.ts +24 -0
- package/es/chrome/AppMenu/AppMenuHeader.js +18 -0
- package/es/chrome/AppMenu/AppMenuList.d.ts +18 -0
- package/es/chrome/AppMenu/AppMenuList.js +39 -0
- package/es/chrome/AppMenu/AppMenuRail.d.ts +26 -0
- package/es/chrome/AppMenu/AppMenuRail.js +30 -0
- package/es/chrome/AppMenu/icons.d.ts +15 -0
- package/es/chrome/AppMenu/icons.js +13 -0
- package/es/chrome/AppMenu/index.d.ts +12 -0
- package/es/{components → chrome}/AppMenu/index.js +5 -0
- package/es/chrome/AppMenu/menuEntries.d.ts +51 -0
- package/es/chrome/AppMenu/menuEntries.js +93 -0
- package/es/{components → chrome}/AppMenu/types.d.ts +10 -0
- package/es/chrome/AppMenu/useFavorites.d.ts +13 -0
- package/es/chrome/AppMenu/useFavorites.js +28 -0
- package/es/{components → chrome}/AppMenu/useRovingTabIndex.d.ts +4 -0
- package/es/{components → chrome}/AppMenu/useRovingTabIndex.js +12 -1
- package/es/{components → chrome}/AppShell/index.js +23 -2
- package/es/colorScheme.d.ts +17 -0
- package/es/colorScheme.js +54 -0
- package/es/components/PageBanner/index.d.ts +1 -1
- package/es/index.d.ts +3 -2
- package/es/index.js +3 -2
- package/package.json +2 -2
- package/{es/components → src/chrome}/AppMenu/AppMenu.css +129 -2
- package/src/{components → chrome}/AppMenu/AppMenu.tsx +285 -285
- package/src/{components → chrome}/AppMenu/AppMenuColorScheme.tsx +42 -41
- package/src/{components → chrome}/AppMenu/AppMenuFavoriteButton.tsx +47 -47
- package/src/{components → chrome}/AppMenu/AppMenuHeader.tsx +79 -79
- package/src/{components → chrome}/AppMenu/AppMenuList.tsx +89 -89
- package/src/{components → chrome}/AppMenu/AppMenuRail.tsx +117 -117
- package/src/{components → chrome}/AppMenu/icons.tsx +76 -76
- package/src/{components → chrome}/AppMenu/index.ts +17 -17
- package/src/{components → chrome}/AppMenu/menuEntries.ts +128 -128
- package/src/{components → chrome}/AppMenu/types.ts +45 -45
- package/src/{components → chrome}/AppMenu/useFavorites.ts +40 -40
- package/src/{components → chrome}/AppMenu/useRovingTabIndex.ts +130 -130
- package/src/{components → chrome}/AppShell/index.tsx +287 -287
- package/src/colorScheme.ts +81 -81
- package/src/components/ImageEditor/ImageEditor.tsx +1 -1
- package/src/components/ImageEditor/index.ts +2 -0
- package/src/components/ImageEditor/plugins/zoomPlugin/ZoomControls.tsx +7 -8
- package/src/components/LinkedCardList/index.scss +93 -93
- package/src/components/PageBanner/index.tsx +5 -4
- package/src/components/ProgressBar/index.scss +94 -94
- package/src/elements/ElementDamage/DamageFormButtons.tsx +2 -2
- package/src/elements/ElementDamage/TransportElementSelect.tsx +1 -1
- package/src/elements/index.ts +5 -0
- package/src/index.ts +70 -61
- package/es/components/AppMenu/AppMenu.js +0 -223
- package/es/components/AppMenu/index.d.ts +0 -6
- /package/es/{components → chrome}/AppMenu/AppMenuToggle.d.ts +0 -0
- /package/es/{components → chrome}/AppMenu/AppMenuToggle.js +0 -0
- /package/es/{components → chrome}/AppMenu/AppMenuUserMenu.d.ts +0 -0
- /package/es/{components → chrome}/AppMenu/AppMenuUserMenu.js +0 -0
- /package/es/{components → chrome}/AppMenu/developerCategories.d.ts +0 -0
- /package/es/{components → chrome}/AppMenu/developerCategories.js +0 -0
- /package/es/{components → chrome}/AppMenu/types.js +0 -0
- /package/es/{components → chrome}/AppMenu/useServiceWorkerUpdate.d.ts +0 -0
- /package/es/{components → chrome}/AppMenu/useServiceWorkerUpdate.js +0 -0
- /package/es/{components → chrome}/AppShell/index.d.ts +0 -0
- /package/src/{components → chrome}/AppMenu/AppMenuToggle.tsx +0 -0
- /package/src/{components → chrome}/AppMenu/AppMenuUserMenu.tsx +0 -0
- /package/src/{components → chrome}/AppMenu/developerCategories.ts +0 -0
- /package/src/{components → chrome}/AppMenu/useServiceWorkerUpdate.ts +0 -0
package/src/colorScheme.ts
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from "react";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Color scheme preference (system / light / dark).
|
|
5
|
-
*
|
|
6
|
-
* The preference lives in the `ob-color-scheme` cookie so the article template
|
|
7
|
-
* can read it server side and render `data-color-scheme` on `<html>` and
|
|
8
|
-
* `<body>` before the first paint. The site script for the 2026 template
|
|
9
|
-
* (`ob.2026.application.min.js`) owns the same cookie for the toolbar user menu
|
|
10
|
-
* toggle, so both write the cookie, apply the attributes, and dispatch
|
|
11
|
-
* `COLOR_SCHEME_CHANGE_EVENT` to keep every toggle on the page in sync.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
export type ColorSchemePreference = "auto" | "light" | "dark";
|
|
15
|
-
|
|
16
|
-
const COOKIE_NAME = "ob-color-scheme";
|
|
17
|
-
const COOKIE_MAX_AGE = 60 * 60 * 24 * 365;
|
|
18
|
-
const DEFAULT_PREFERENCE: ColorSchemePreference = "auto";
|
|
19
|
-
const PREFERENCES: ColorSchemePreference[] = ["auto", "light", "dark"];
|
|
20
|
-
|
|
21
|
-
/** Dispatched on `window` whenever the preference changes. */
|
|
22
|
-
export const COLOR_SCHEME_CHANGE_EVENT = "ob:colorschemechange";
|
|
23
|
-
|
|
24
|
-
function isColorSchemePreference(value: unknown): value is ColorSchemePreference {
|
|
25
|
-
return typeof value === "string" && PREFERENCES.includes(value as ColorSchemePreference);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function getColorSchemePreference(): ColorSchemePreference {
|
|
29
|
-
if (typeof document === "undefined") return DEFAULT_PREFERENCE;
|
|
30
|
-
|
|
31
|
-
let match = document.cookie.match(new RegExp(`(?:^|;\\s*)${COOKIE_NAME}=([^;]*)`));
|
|
32
|
-
let value = match ? decodeURIComponent(match[1]) : null;
|
|
33
|
-
|
|
34
|
-
return isColorSchemePreference(value) ? value : DEFAULT_PREFERENCE;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function setColorSchemePreference(preference: ColorSchemePreference) {
|
|
38
|
-
if (typeof document === "undefined" || !isColorSchemePreference(preference)) return;
|
|
39
|
-
|
|
40
|
-
let secure = window.location.protocol === "https:" ? ";secure" : "";
|
|
41
|
-
document.cookie = `${COOKIE_NAME}=${preference};path=/;max-age=${COOKIE_MAX_AGE};samesite=lax${secure}`;
|
|
42
|
-
|
|
43
|
-
/*
|
|
44
|
-
* Both elements are updated: `<html>` so the browser applies `color-scheme`
|
|
45
|
-
* to scrollbars and native controls, `<body>` because Designsystemet declares
|
|
46
|
-
* the light tokens on `:root` as well (`:root, [data-color-scheme="light"]`).
|
|
47
|
-
*/
|
|
48
|
-
document.documentElement.dataset.colorScheme = preference;
|
|
49
|
-
if (document.body) document.body.dataset.colorScheme = preference;
|
|
50
|
-
|
|
51
|
-
window.dispatchEvent(new CustomEvent(COLOR_SCHEME_CHANGE_EVENT, { detail: preference }));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** Reads the stored preference and keeps it in sync with other toggles on the page. */
|
|
55
|
-
export function useColorSchemePreference(): [ColorSchemePreference, (value: ColorSchemePreference) => void] {
|
|
56
|
-
let [preference, setPreference] = useState<ColorSchemePreference>(() => getColorSchemePreference());
|
|
57
|
-
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
function update() {
|
|
60
|
-
setPreference(getColorSchemePreference());
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
update();
|
|
64
|
-
|
|
65
|
-
window.addEventListener(COLOR_SCHEME_CHANGE_EVENT, update);
|
|
66
|
-
// Cookies fire no change event, so also pick up changes made in another tab.
|
|
67
|
-
document.addEventListener("visibilitychange", update);
|
|
68
|
-
|
|
69
|
-
return () => {
|
|
70
|
-
window.removeEventListener(COLOR_SCHEME_CHANGE_EVENT, update);
|
|
71
|
-
document.removeEventListener("visibilitychange", update);
|
|
72
|
-
};
|
|
73
|
-
}, []);
|
|
74
|
-
|
|
75
|
-
let setValue = useCallback((value: ColorSchemePreference) => {
|
|
76
|
-
setColorSchemePreference(value);
|
|
77
|
-
setPreference(value);
|
|
78
|
-
}, []);
|
|
79
|
-
|
|
80
|
-
return [preference, setValue];
|
|
81
|
-
}
|
|
1
|
+
import { useCallback, useEffect, useState } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Color scheme preference (system / light / dark).
|
|
5
|
+
*
|
|
6
|
+
* The preference lives in the `ob-color-scheme` cookie so the article template
|
|
7
|
+
* can read it server side and render `data-color-scheme` on `<html>` and
|
|
8
|
+
* `<body>` before the first paint. The site script for the 2026 template
|
|
9
|
+
* (`ob.2026.application.min.js`) owns the same cookie for the toolbar user menu
|
|
10
|
+
* toggle, so both write the cookie, apply the attributes, and dispatch
|
|
11
|
+
* `COLOR_SCHEME_CHANGE_EVENT` to keep every toggle on the page in sync.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export type ColorSchemePreference = "auto" | "light" | "dark";
|
|
15
|
+
|
|
16
|
+
const COOKIE_NAME = "ob-color-scheme";
|
|
17
|
+
const COOKIE_MAX_AGE = 60 * 60 * 24 * 365;
|
|
18
|
+
const DEFAULT_PREFERENCE: ColorSchemePreference = "auto";
|
|
19
|
+
const PREFERENCES: ColorSchemePreference[] = ["auto", "light", "dark"];
|
|
20
|
+
|
|
21
|
+
/** Dispatched on `window` whenever the preference changes. */
|
|
22
|
+
export const COLOR_SCHEME_CHANGE_EVENT = "ob:colorschemechange";
|
|
23
|
+
|
|
24
|
+
function isColorSchemePreference(value: unknown): value is ColorSchemePreference {
|
|
25
|
+
return typeof value === "string" && PREFERENCES.includes(value as ColorSchemePreference);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function getColorSchemePreference(): ColorSchemePreference {
|
|
29
|
+
if (typeof document === "undefined") return DEFAULT_PREFERENCE;
|
|
30
|
+
|
|
31
|
+
let match = document.cookie.match(new RegExp(`(?:^|;\\s*)${COOKIE_NAME}=([^;]*)`));
|
|
32
|
+
let value = match ? decodeURIComponent(match[1]) : null;
|
|
33
|
+
|
|
34
|
+
return isColorSchemePreference(value) ? value : DEFAULT_PREFERENCE;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function setColorSchemePreference(preference: ColorSchemePreference) {
|
|
38
|
+
if (typeof document === "undefined" || !isColorSchemePreference(preference)) return;
|
|
39
|
+
|
|
40
|
+
let secure = window.location.protocol === "https:" ? ";secure" : "";
|
|
41
|
+
document.cookie = `${COOKIE_NAME}=${preference};path=/;max-age=${COOKIE_MAX_AGE};samesite=lax${secure}`;
|
|
42
|
+
|
|
43
|
+
/*
|
|
44
|
+
* Both elements are updated: `<html>` so the browser applies `color-scheme`
|
|
45
|
+
* to scrollbars and native controls, `<body>` because Designsystemet declares
|
|
46
|
+
* the light tokens on `:root` as well (`:root, [data-color-scheme="light"]`).
|
|
47
|
+
*/
|
|
48
|
+
document.documentElement.dataset.colorScheme = preference;
|
|
49
|
+
if (document.body) document.body.dataset.colorScheme = preference;
|
|
50
|
+
|
|
51
|
+
window.dispatchEvent(new CustomEvent(COLOR_SCHEME_CHANGE_EVENT, { detail: preference }));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Reads the stored preference and keeps it in sync with other toggles on the page. */
|
|
55
|
+
export function useColorSchemePreference(): [ColorSchemePreference, (value: ColorSchemePreference) => void] {
|
|
56
|
+
let [preference, setPreference] = useState<ColorSchemePreference>(() => getColorSchemePreference());
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
function update() {
|
|
60
|
+
setPreference(getColorSchemePreference());
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
update();
|
|
64
|
+
|
|
65
|
+
window.addEventListener(COLOR_SCHEME_CHANGE_EVENT, update);
|
|
66
|
+
// Cookies fire no change event, so also pick up changes made in another tab.
|
|
67
|
+
document.addEventListener("visibilitychange", update);
|
|
68
|
+
|
|
69
|
+
return () => {
|
|
70
|
+
window.removeEventListener(COLOR_SCHEME_CHANGE_EVENT, update);
|
|
71
|
+
document.removeEventListener("visibilitychange", update);
|
|
72
|
+
};
|
|
73
|
+
}, []);
|
|
74
|
+
|
|
75
|
+
let setValue = useCallback((value: ColorSchemePreference) => {
|
|
76
|
+
setColorSchemePreference(value);
|
|
77
|
+
setPreference(value);
|
|
78
|
+
}, []);
|
|
79
|
+
|
|
80
|
+
return [preference, setValue];
|
|
81
|
+
}
|
|
@@ -241,7 +241,7 @@ function ToolButton({
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
return (
|
|
244
|
-
<Button variant="
|
|
244
|
+
<Button variant="tertiary" data-size="sm" onClick={onActivate} disabled={busy}>
|
|
245
245
|
<Icon />
|
|
246
246
|
{label}
|
|
247
247
|
</Button>
|
|
@@ -2,5 +2,7 @@ export { defaultPlugins, defaultViewPlugin } from "./defaultPlugins.js";
|
|
|
2
2
|
export type { ImageEditorRef } from "./ImageEditor.js";
|
|
3
3
|
export { ImageEditor } from "./ImageEditor.js";
|
|
4
4
|
export { cropPlugin } from "./plugins/cropPlugin/index.js";
|
|
5
|
+
export { redactPlugin } from "./plugins/redactPlugin/index.js";
|
|
6
|
+
export { zoomPlugin } from "./plugins/zoomPlugin/index.js";
|
|
5
7
|
export { rotateCcwPlugin, rotateCwPlugin } from "./plugins/rotatePlugin.js";
|
|
6
8
|
export type { ActionPlugin, EditAction, Plugin, ToolPlugin, ViewPlugin } from "./types.js";
|
|
@@ -28,14 +28,13 @@ export function ZoomControls({ disabled, isSmall = false }: Props) {
|
|
|
28
28
|
disabled={disabled || !canZoomIn}
|
|
29
29
|
isSmall={isSmall}
|
|
30
30
|
/>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
)}
|
|
31
|
+
<ResponsiveButton
|
|
32
|
+
disabled={!isZoomed}
|
|
33
|
+
icon={<ShrinkIcon aria-hidden />}
|
|
34
|
+
label={getLocalizedString("Reset zoom")}
|
|
35
|
+
onClick={resetZoom}
|
|
36
|
+
isSmall={isSmall}
|
|
37
|
+
/>
|
|
39
38
|
</>
|
|
40
39
|
);
|
|
41
40
|
}
|
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
@use "../../styles/variables";
|
|
2
|
-
|
|
3
|
-
$bullet-size: 0.7em;
|
|
4
|
-
$line-width: 0.2em;
|
|
5
|
-
|
|
6
|
-
:root {
|
|
7
|
-
--ob-linked-list-bullet-size: 0.7em;
|
|
8
|
-
--ob-linked-list-line-width: 0.2em;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.ObLinkedList-root {
|
|
12
|
-
|
|
13
|
-
list-style-type: none;
|
|
14
|
-
margin-left: 0;
|
|
15
|
-
padding-left: 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.ObLinkedList-item {
|
|
19
|
-
display: flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
flex-direction: row;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.ObLinkedList-leftColumn {
|
|
25
|
-
flex: 1 1 4em;
|
|
26
|
-
font-size: 0.75em;
|
|
27
|
-
padding: 0 1em;
|
|
28
|
-
text-align: center;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.ObLinkedList-rightColumn {
|
|
32
|
-
flex: 1 1 100%;
|
|
33
|
-
padding: 1em 1em 1em 1.5em;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.ObLinkedList-line {
|
|
37
|
-
display: flex;
|
|
38
|
-
align-self: stretch;
|
|
39
|
-
flex: 0 0 $line-width;
|
|
40
|
-
background: white;
|
|
41
|
-
position: relative;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.ObLinkedList-bullet {
|
|
45
|
-
background: white;
|
|
46
|
-
|
|
47
|
-
border: 1px solid rgba(50, 50, 50, 0.25);
|
|
48
|
-
border-radius: 0.55em;
|
|
49
|
-
height: $bullet-size;
|
|
50
|
-
width: $bullet-size;
|
|
51
|
-
|
|
52
|
-
position: absolute;
|
|
53
|
-
left: 0;
|
|
54
|
-
top: 50%;
|
|
55
|
-
|
|
56
|
-
transform: translate(calc(-1 * (var(--ob-linked-list-bullet-size) / 2) + (var(--ob-linked-list-line-width) / 2)), -50%);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.ObLinkedList-card {
|
|
60
|
-
display: block;
|
|
61
|
-
background: white;
|
|
62
|
-
border: 1px solid;
|
|
63
|
-
border-color: variables.$color-border-top variables.$color-border-side variables.$color-border-bottom;
|
|
64
|
-
border-radius: 0.1875em;
|
|
65
|
-
color: inherit;
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
flex: 100% 1 1;
|
|
68
|
-
position: relative;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.ObLinkedList-card::before {
|
|
72
|
-
border-bottom: 0.5em solid transparent;
|
|
73
|
-
border-right: 1em solid white;
|
|
74
|
-
border-top: 0.5em solid transparent;
|
|
75
|
-
content: " ";
|
|
76
|
-
filter: drop-shadow(-1px 0px 1px rgba(50, 50, 50, 0.2));
|
|
77
|
-
height: 1em;
|
|
78
|
-
left: -1em;
|
|
79
|
-
margin-top: -0.5em;
|
|
80
|
-
position: absolute;
|
|
81
|
-
top: 50%;
|
|
82
|
-
width: 1em;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.ObLinkedList-card:hover {
|
|
86
|
-
background-color: variables.$block-color-bg-hover !important;
|
|
87
|
-
color: inherit;
|
|
88
|
-
text-decoration: inherit;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.ObLinkedList-card:hover::before {
|
|
92
|
-
border-right-color: variables.$block-color-bg-hover !important;
|
|
93
|
-
}
|
|
1
|
+
@use "../../styles/variables";
|
|
2
|
+
|
|
3
|
+
$bullet-size: 0.7em;
|
|
4
|
+
$line-width: 0.2em;
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
--ob-linked-list-bullet-size: 0.7em;
|
|
8
|
+
--ob-linked-list-line-width: 0.2em;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ObLinkedList-root {
|
|
12
|
+
|
|
13
|
+
list-style-type: none;
|
|
14
|
+
margin-left: 0;
|
|
15
|
+
padding-left: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ObLinkedList-item {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
flex-direction: row;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ObLinkedList-leftColumn {
|
|
25
|
+
flex: 1 1 4em;
|
|
26
|
+
font-size: 0.75em;
|
|
27
|
+
padding: 0 1em;
|
|
28
|
+
text-align: center;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ObLinkedList-rightColumn {
|
|
32
|
+
flex: 1 1 100%;
|
|
33
|
+
padding: 1em 1em 1em 1.5em;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ObLinkedList-line {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-self: stretch;
|
|
39
|
+
flex: 0 0 $line-width;
|
|
40
|
+
background: white;
|
|
41
|
+
position: relative;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ObLinkedList-bullet {
|
|
45
|
+
background: white;
|
|
46
|
+
|
|
47
|
+
border: 1px solid rgba(50, 50, 50, 0.25);
|
|
48
|
+
border-radius: 0.55em;
|
|
49
|
+
height: $bullet-size;
|
|
50
|
+
width: $bullet-size;
|
|
51
|
+
|
|
52
|
+
position: absolute;
|
|
53
|
+
left: 0;
|
|
54
|
+
top: 50%;
|
|
55
|
+
|
|
56
|
+
transform: translate(calc(-1 * (var(--ob-linked-list-bullet-size) / 2) + (var(--ob-linked-list-line-width) / 2)), -50%);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ObLinkedList-card {
|
|
60
|
+
display: block;
|
|
61
|
+
background: white;
|
|
62
|
+
border: 1px solid;
|
|
63
|
+
border-color: variables.$color-border-top variables.$color-border-side variables.$color-border-bottom;
|
|
64
|
+
border-radius: 0.1875em;
|
|
65
|
+
color: inherit;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
flex: 100% 1 1;
|
|
68
|
+
position: relative;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ObLinkedList-card::before {
|
|
72
|
+
border-bottom: 0.5em solid transparent;
|
|
73
|
+
border-right: 1em solid white;
|
|
74
|
+
border-top: 0.5em solid transparent;
|
|
75
|
+
content: " ";
|
|
76
|
+
filter: drop-shadow(-1px 0px 1px rgba(50, 50, 50, 0.2));
|
|
77
|
+
height: 1em;
|
|
78
|
+
left: -1em;
|
|
79
|
+
margin-top: -0.5em;
|
|
80
|
+
position: absolute;
|
|
81
|
+
top: 50%;
|
|
82
|
+
width: 1em;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ObLinkedList-card:hover {
|
|
86
|
+
background-color: variables.$block-color-bg-hover !important;
|
|
87
|
+
color: inherit;
|
|
88
|
+
text-decoration: inherit;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ObLinkedList-card:hover::before {
|
|
92
|
+
border-right-color: variables.$block-color-bg-hover !important;
|
|
93
|
+
}
|
|
@@ -49,10 +49,11 @@ export function TabList({ as, className, children, sticky, ...other }: TabListPr
|
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export type TabProps = Pick<React.HTMLProps<HTMLDivElement>, "id" | "className" | "children"> &
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
export type TabProps = Pick<React.HTMLProps<HTMLDivElement>, "id" | "className" | "children"> &
|
|
53
|
+
Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "target" | "rel"> & {
|
|
54
|
+
active?: boolean;
|
|
55
|
+
as?: "a" | "li" | "div" | "span";
|
|
56
|
+
};
|
|
56
57
|
|
|
57
58
|
export function Tab({ active, as, className, children, ...other }: TabProps) {
|
|
58
59
|
const Component = as ? as : "a";
|
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
@use "../../styles/variables";
|
|
2
|
-
|
|
3
|
-
.ObProgressBar-root {
|
|
4
|
-
height: 1.5em;
|
|
5
|
-
width: 100%;
|
|
6
|
-
appearance: none;
|
|
7
|
-
-webkit-appearance: none;
|
|
8
|
-
background-color: whiteSmoke;
|
|
9
|
-
border: none;
|
|
10
|
-
border-radius: 3px;
|
|
11
|
-
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) inset;
|
|
12
|
-
color: royalblue;
|
|
13
|
-
position: relative;
|
|
14
|
-
|
|
15
|
-
&::-webkit-progress-bar {
|
|
16
|
-
background-color: whiteSmoke;
|
|
17
|
-
border-radius: 3px;
|
|
18
|
-
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) inset;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&::-webkit-progress-value {
|
|
22
|
-
background-image: linear-gradient(
|
|
23
|
-
135deg,
|
|
24
|
-
transparent,
|
|
25
|
-
transparent 33%,
|
|
26
|
-
rgba(0, 0, 0, 0.1) 33%,
|
|
27
|
-
rgba(0, 0, 0, 0.1) 66%,
|
|
28
|
-
transparent 66%
|
|
29
|
-
),
|
|
30
|
-
linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
31
|
-
linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
32
|
-
background-image:
|
|
33
|
-
-webkit-linear-gradient(
|
|
34
|
-
135deg,
|
|
35
|
-
transparent,
|
|
36
|
-
transparent 33%,
|
|
37
|
-
rgba(0, 0, 0, 0.1) 33%,
|
|
38
|
-
rgba(0, 0, 0, 0.1) 66%,
|
|
39
|
-
transparent 66%
|
|
40
|
-
),
|
|
41
|
-
-webkit-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
42
|
-
-webkit-linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
43
|
-
background-size:
|
|
44
|
-
35px 20px,
|
|
45
|
-
100% 100%,
|
|
46
|
-
100% 100%;
|
|
47
|
-
border-radius: 3px;
|
|
48
|
-
position: relative;
|
|
49
|
-
transition: width 0.5s ease-out;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&::-webkit-progress-value:after {
|
|
53
|
-
background-color: white;
|
|
54
|
-
content: "";
|
|
55
|
-
|
|
56
|
-
border-radius: 100%;
|
|
57
|
-
height: 5px;
|
|
58
|
-
|
|
59
|
-
position: absolute;
|
|
60
|
-
right: 7px;
|
|
61
|
-
top: 7px;
|
|
62
|
-
width: 5px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&::-moz-progress-bar {
|
|
66
|
-
background-image: linear-gradient(
|
|
67
|
-
135deg,
|
|
68
|
-
transparent,
|
|
69
|
-
transparent 33%,
|
|
70
|
-
rgba(0, 0, 0, 0.1) 33%,
|
|
71
|
-
rgba(0, 0, 0, 0.1) 66%,
|
|
72
|
-
transparent 66%
|
|
73
|
-
),
|
|
74
|
-
linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
75
|
-
linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
76
|
-
background-image:
|
|
77
|
-
-moz-linear-gradient(
|
|
78
|
-
135deg,
|
|
79
|
-
transparent,
|
|
80
|
-
transparent 33%,
|
|
81
|
-
rgba(0, 0, 0, 0.1) 33%,
|
|
82
|
-
rgba(0, 0, 0, 0.1) 66%,
|
|
83
|
-
transparent 66%
|
|
84
|
-
),
|
|
85
|
-
-moz-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
86
|
-
-moz-linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
87
|
-
background-size:
|
|
88
|
-
35px 20px,
|
|
89
|
-
100% 100%,
|
|
90
|
-
100% 100%;
|
|
91
|
-
border-radius: 3px;
|
|
92
|
-
transition: width 0.5s ease-out;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
1
|
+
@use "../../styles/variables";
|
|
2
|
+
|
|
3
|
+
.ObProgressBar-root {
|
|
4
|
+
height: 1.5em;
|
|
5
|
+
width: 100%;
|
|
6
|
+
appearance: none;
|
|
7
|
+
-webkit-appearance: none;
|
|
8
|
+
background-color: whiteSmoke;
|
|
9
|
+
border: none;
|
|
10
|
+
border-radius: 3px;
|
|
11
|
+
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) inset;
|
|
12
|
+
color: royalblue;
|
|
13
|
+
position: relative;
|
|
14
|
+
|
|
15
|
+
&::-webkit-progress-bar {
|
|
16
|
+
background-color: whiteSmoke;
|
|
17
|
+
border-radius: 3px;
|
|
18
|
+
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) inset;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&::-webkit-progress-value {
|
|
22
|
+
background-image: linear-gradient(
|
|
23
|
+
135deg,
|
|
24
|
+
transparent,
|
|
25
|
+
transparent 33%,
|
|
26
|
+
rgba(0, 0, 0, 0.1) 33%,
|
|
27
|
+
rgba(0, 0, 0, 0.1) 66%,
|
|
28
|
+
transparent 66%
|
|
29
|
+
),
|
|
30
|
+
linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
31
|
+
linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
32
|
+
background-image:
|
|
33
|
+
-webkit-linear-gradient(
|
|
34
|
+
135deg,
|
|
35
|
+
transparent,
|
|
36
|
+
transparent 33%,
|
|
37
|
+
rgba(0, 0, 0, 0.1) 33%,
|
|
38
|
+
rgba(0, 0, 0, 0.1) 66%,
|
|
39
|
+
transparent 66%
|
|
40
|
+
),
|
|
41
|
+
-webkit-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
42
|
+
-webkit-linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
43
|
+
background-size:
|
|
44
|
+
35px 20px,
|
|
45
|
+
100% 100%,
|
|
46
|
+
100% 100%;
|
|
47
|
+
border-radius: 3px;
|
|
48
|
+
position: relative;
|
|
49
|
+
transition: width 0.5s ease-out;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&::-webkit-progress-value:after {
|
|
53
|
+
background-color: white;
|
|
54
|
+
content: "";
|
|
55
|
+
|
|
56
|
+
border-radius: 100%;
|
|
57
|
+
height: 5px;
|
|
58
|
+
|
|
59
|
+
position: absolute;
|
|
60
|
+
right: 7px;
|
|
61
|
+
top: 7px;
|
|
62
|
+
width: 5px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&::-moz-progress-bar {
|
|
66
|
+
background-image: linear-gradient(
|
|
67
|
+
135deg,
|
|
68
|
+
transparent,
|
|
69
|
+
transparent 33%,
|
|
70
|
+
rgba(0, 0, 0, 0.1) 33%,
|
|
71
|
+
rgba(0, 0, 0, 0.1) 66%,
|
|
72
|
+
transparent 66%
|
|
73
|
+
),
|
|
74
|
+
linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
75
|
+
linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
76
|
+
background-image:
|
|
77
|
+
-moz-linear-gradient(
|
|
78
|
+
135deg,
|
|
79
|
+
transparent,
|
|
80
|
+
transparent 33%,
|
|
81
|
+
rgba(0, 0, 0, 0.1) 33%,
|
|
82
|
+
rgba(0, 0, 0, 0.1) 66%,
|
|
83
|
+
transparent 66%
|
|
84
|
+
),
|
|
85
|
+
-moz-linear-gradient(top, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.2)),
|
|
86
|
+
-moz-linear-gradient(left, var(--brand-primary), var(--brand-light));
|
|
87
|
+
background-size:
|
|
88
|
+
35px 20px,
|
|
89
|
+
100% 100%,
|
|
90
|
+
100% 100%;
|
|
91
|
+
border-radius: 3px;
|
|
92
|
+
transition: width 0.5s ease-out;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -2,7 +2,7 @@ import Add from "@mui/icons-material/Add";
|
|
|
2
2
|
import { Button } from "@mui/material";
|
|
3
3
|
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
4
4
|
|
|
5
|
-
type DamageFormButtonsProps = {
|
|
5
|
+
export type DamageFormButtonsProps = {
|
|
6
6
|
isEdit: boolean;
|
|
7
7
|
loading: boolean;
|
|
8
8
|
uploadingFile: boolean;
|
|
@@ -10,7 +10,7 @@ type DamageFormButtonsProps = {
|
|
|
10
10
|
handleCancel: () => void;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export function
|
|
13
|
+
export function DamageFormButtons({
|
|
14
14
|
isEdit,
|
|
15
15
|
loading,
|
|
16
16
|
uploadingFile,
|
|
@@ -4,7 +4,7 @@ import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import type { TransportElementsRecord } from "../data/dsTransportElements.js";
|
|
6
6
|
|
|
7
|
-
type TransportElementSelectProps = {
|
|
7
|
+
export type TransportElementSelectProps = {
|
|
8
8
|
elements: TransportElementsRecord[];
|
|
9
9
|
onSelect: (element: TransportElementsRecord) => void;
|
|
10
10
|
};
|
package/src/elements/index.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
export * from "./data/index.js";
|
|
2
|
+
export * from "./ElementDamage/DamageFormButtons.js";
|
|
2
3
|
export * from "./ElementDamage/DescriptionInput.js";
|
|
3
4
|
export * from "./ElementDamage/DuplicateDamage/index.js";
|
|
4
5
|
export * from "./ElementDamage/ElementNumberTextField.js";
|
|
5
6
|
export * from "./ElementDamage/HiddenDamageFields.js";
|
|
6
7
|
export * from "./ElementDamage/RegisterFix.js";
|
|
7
8
|
export * from "./ElementDamage/SubmitButtons.js";
|
|
9
|
+
export * from "./ElementDamage/TransportElementSelect.js";
|
|
8
10
|
export * from "./ElementLookup.js";
|
|
11
|
+
export * from "./ElementLookupDialog/BarcodeScanner/index.js";
|
|
12
|
+
export * from "./ElementLookupDialog/HIDScanner/index.js";
|
|
9
13
|
export * from "./ElementLookupDialog/index.js";
|
|
14
|
+
export * from "./ElementLookupDialog/Manual/ManualForm.js";
|
|
10
15
|
export * from "./ProjectSelect.js";
|