@olenbetong/synergi-react 2.6.0 → 2.7.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/es/components/AppMenu/AppMenu.css +0 -25
- package/es/components/AppMenu/AppMenu.js +1 -2
- package/es/components/AppMenu/index.d.ts +0 -1
- package/es/components/AppMenu/index.js +0 -1
- package/es/index.d.ts +1 -2
- package/es/index.js +1 -2
- package/package.json +3 -3
- package/src/colorScheme.ts +81 -81
- package/src/components/AppMenu/AppMenu.css +648 -546
- package/src/components/AppMenu/AppMenu.tsx +285 -478
- package/src/components/AppMenu/AppMenuColorScheme.tsx +41 -41
- package/src/components/AppMenu/AppMenuFavoriteButton.tsx +47 -0
- package/src/components/AppMenu/AppMenuHeader.tsx +79 -0
- package/src/components/AppMenu/AppMenuList.tsx +89 -0
- package/src/components/AppMenu/AppMenuRail.tsx +117 -0
- package/src/components/AppMenu/icons.tsx +76 -0
- package/src/components/AppMenu/index.ts +17 -12
- package/src/components/AppMenu/menuEntries.ts +128 -0
- package/src/components/AppMenu/types.ts +45 -35
- package/src/components/AppMenu/useFavorites.ts +40 -0
- package/src/components/AppMenu/useRovingTabIndex.ts +130 -118
- package/src/components/AppShell/index.tsx +287 -259
- package/src/components/LinkedCardList/index.scss +93 -93
- package/src/components/ProgressBar/index.scss +94 -94
- package/src/index.ts +61 -61
- package/es/colorScheme.d.ts +0 -17
- package/es/colorScheme.js +0 -54
- package/es/components/AppMenu/AppMenuColorScheme.d.ts +0 -2
- package/es/components/AppMenu/AppMenuColorScheme.js +0 -18
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
export {
|
|
2
|
-
AppMenu,
|
|
3
|
-
type AppMenuArticle,
|
|
4
|
-
type AppMenuCategory,
|
|
5
|
-
AppMenuColorScheme,
|
|
6
|
-
type AppMenuLink,
|
|
7
|
-
type AppMenuLinkGroup,
|
|
8
|
-
type AppMenuProps,
|
|
9
|
-
AppMenuToggle,
|
|
10
|
-
type AppMenuToggleProps,
|
|
11
|
-
type AppMenuUser,
|
|
12
|
-
AppMenuUserMenu,
|
|
13
|
-
type AppMenuUserMenuProps,
|
|
14
|
-
createDeveloperCategories,
|
|
15
|
-
defaultUserMenuItems,
|
|
16
|
-
type DeveloperCategoryOptions,
|
|
17
|
-
useServiceWorkerUpdate,
|
|
18
|
-
} from "./components/AppMenu/index.js";
|
|
19
|
-
export { AppShell, type AppShellProps } from "./components/AppShell/index.js";
|
|
20
|
-
export { Checkbox, type CheckboxProps } from "./components/Checkbox/index.js";
|
|
21
|
-
export {
|
|
22
|
-
COLOR_SCHEME_CHANGE_EVENT,
|
|
23
|
-
type ColorSchemePreference,
|
|
24
|
-
getColorSchemePreference,
|
|
25
|
-
setColorSchemePreference,
|
|
26
|
-
useColorSchemePreference,
|
|
27
|
-
} from "./colorScheme.js";
|
|
28
|
-
export { CardColumn, CardDetail, CardLabel, CardStep, CardStepList, ColorCard } from "./components/ColorCard/index.js";
|
|
29
|
-
export { DateNavigator } from "./components/DateNavigator/index.js";
|
|
30
|
-
export * from "./components/FilePond.js";
|
|
31
|
-
export * from "./components/ImageEditor/index.js";
|
|
32
|
-
export { Card, LinkedList, LinkedListItem } from "./components/LinkedCardList/index.js";
|
|
33
|
-
export { MergeProgressDialog, type MergeProgressDialogProps } from "./components/MergeProgressDialog/index.js";
|
|
34
|
-
export {
|
|
35
|
-
BannerImage as PageBannerImage,
|
|
36
|
-
type BannerImageProps,
|
|
37
|
-
PageBanner,
|
|
38
|
-
type PageBannerProps,
|
|
39
|
-
Tab as PageBannerTab,
|
|
40
|
-
TabList as PageBannerTabList,
|
|
41
|
-
type TabListProps as PageBannerTabListProps,
|
|
42
|
-
type TabProps as PageBannerTabProps,
|
|
43
|
-
Title as PageBannerTitle,
|
|
44
|
-
type TitleProps as PageBannerTitleProps,
|
|
45
|
-
} from "./components/PageBanner/index.js";
|
|
46
|
-
export * from "./components/PdfViewer/index.js";
|
|
47
|
-
export { Portal } from "./components/Portal/index.js";
|
|
48
|
-
export {
|
|
49
|
-
ToolbarBreadcrumbs,
|
|
50
|
-
ToolbarPortal,
|
|
51
|
-
type BreadcrumbItem,
|
|
52
|
-
type ToolbarBreadcrumbsProps,
|
|
53
|
-
type ToolbarPortalProps,
|
|
54
|
-
type ToolbarPortalSlot,
|
|
55
|
-
} from "./components/Toolbar/index.js";
|
|
56
|
-
export { ProgressBar } from "./components/ProgressBar/index.js";
|
|
57
|
-
export { Sidebar, type SidebarProps } from "./components/Sidebar/index.js";
|
|
58
|
-
export { Spinner, type SpinnerProps } from "./components/Spinner/index.js";
|
|
59
|
-
export { SplitContainer, type SplitContainerProps } from "./components/SplitContainer/index.js";
|
|
60
|
-
export { ValueToggleGroup, type ValueToggleGroupProps } from "./components/ValueToggleGroup/index.js";
|
|
61
|
-
export { useTranslation } from "./useTranslation/index.js";
|
|
1
|
+
export {
|
|
2
|
+
AppMenu,
|
|
3
|
+
type AppMenuArticle,
|
|
4
|
+
type AppMenuCategory,
|
|
5
|
+
AppMenuColorScheme,
|
|
6
|
+
type AppMenuLink,
|
|
7
|
+
type AppMenuLinkGroup,
|
|
8
|
+
type AppMenuProps,
|
|
9
|
+
AppMenuToggle,
|
|
10
|
+
type AppMenuToggleProps,
|
|
11
|
+
type AppMenuUser,
|
|
12
|
+
AppMenuUserMenu,
|
|
13
|
+
type AppMenuUserMenuProps,
|
|
14
|
+
createDeveloperCategories,
|
|
15
|
+
defaultUserMenuItems,
|
|
16
|
+
type DeveloperCategoryOptions,
|
|
17
|
+
useServiceWorkerUpdate,
|
|
18
|
+
} from "./components/AppMenu/index.js";
|
|
19
|
+
export { AppShell, type AppShellProps } from "./components/AppShell/index.js";
|
|
20
|
+
export { Checkbox, type CheckboxProps } from "./components/Checkbox/index.js";
|
|
21
|
+
export {
|
|
22
|
+
COLOR_SCHEME_CHANGE_EVENT,
|
|
23
|
+
type ColorSchemePreference,
|
|
24
|
+
getColorSchemePreference,
|
|
25
|
+
setColorSchemePreference,
|
|
26
|
+
useColorSchemePreference,
|
|
27
|
+
} from "./colorScheme.js";
|
|
28
|
+
export { CardColumn, CardDetail, CardLabel, CardStep, CardStepList, ColorCard } from "./components/ColorCard/index.js";
|
|
29
|
+
export { DateNavigator } from "./components/DateNavigator/index.js";
|
|
30
|
+
export * from "./components/FilePond.js";
|
|
31
|
+
export * from "./components/ImageEditor/index.js";
|
|
32
|
+
export { Card, LinkedList, LinkedListItem } from "./components/LinkedCardList/index.js";
|
|
33
|
+
export { MergeProgressDialog, type MergeProgressDialogProps } from "./components/MergeProgressDialog/index.js";
|
|
34
|
+
export {
|
|
35
|
+
BannerImage as PageBannerImage,
|
|
36
|
+
type BannerImageProps,
|
|
37
|
+
PageBanner,
|
|
38
|
+
type PageBannerProps,
|
|
39
|
+
Tab as PageBannerTab,
|
|
40
|
+
TabList as PageBannerTabList,
|
|
41
|
+
type TabListProps as PageBannerTabListProps,
|
|
42
|
+
type TabProps as PageBannerTabProps,
|
|
43
|
+
Title as PageBannerTitle,
|
|
44
|
+
type TitleProps as PageBannerTitleProps,
|
|
45
|
+
} from "./components/PageBanner/index.js";
|
|
46
|
+
export * from "./components/PdfViewer/index.js";
|
|
47
|
+
export { Portal } from "./components/Portal/index.js";
|
|
48
|
+
export {
|
|
49
|
+
ToolbarBreadcrumbs,
|
|
50
|
+
ToolbarPortal,
|
|
51
|
+
type BreadcrumbItem,
|
|
52
|
+
type ToolbarBreadcrumbsProps,
|
|
53
|
+
type ToolbarPortalProps,
|
|
54
|
+
type ToolbarPortalSlot,
|
|
55
|
+
} from "./components/Toolbar/index.js";
|
|
56
|
+
export { ProgressBar } from "./components/ProgressBar/index.js";
|
|
57
|
+
export { Sidebar, type SidebarProps } from "./components/Sidebar/index.js";
|
|
58
|
+
export { Spinner, type SpinnerProps } from "./components/Spinner/index.js";
|
|
59
|
+
export { SplitContainer, type SplitContainerProps } from "./components/SplitContainer/index.js";
|
|
60
|
+
export { ValueToggleGroup, type ValueToggleGroupProps } from "./components/ValueToggleGroup/index.js";
|
|
61
|
+
export { useTranslation } from "./useTranslation/index.js";
|
package/es/colorScheme.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Color scheme preference (system / light / dark).
|
|
3
|
-
*
|
|
4
|
-
* The preference lives in the `ob-color-scheme` cookie so the article template
|
|
5
|
-
* can read it server side and render `data-color-scheme` on `<html>` and
|
|
6
|
-
* `<body>` before the first paint. The site script for the 2026 template
|
|
7
|
-
* (`ob.2026.application.min.js`) owns the same cookie for the toolbar user menu
|
|
8
|
-
* toggle, so both write the cookie, apply the attributes, and dispatch
|
|
9
|
-
* `COLOR_SCHEME_CHANGE_EVENT` to keep every toggle on the page in sync.
|
|
10
|
-
*/
|
|
11
|
-
export type ColorSchemePreference = "auto" | "light" | "dark";
|
|
12
|
-
/** Dispatched on `window` whenever the preference changes. */
|
|
13
|
-
export declare const COLOR_SCHEME_CHANGE_EVENT = "ob:colorschemechange";
|
|
14
|
-
export declare function getColorSchemePreference(): ColorSchemePreference;
|
|
15
|
-
export declare function setColorSchemePreference(preference: ColorSchemePreference): void;
|
|
16
|
-
/** Reads the stored preference and keeps it in sync with other toggles on the page. */
|
|
17
|
-
export declare function useColorSchemePreference(): [ColorSchemePreference, (value: ColorSchemePreference) => void];
|
package/es/colorScheme.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from "react";
|
|
2
|
-
const COOKIE_NAME = "ob-color-scheme";
|
|
3
|
-
const COOKIE_MAX_AGE = 60 * 60 * 24 * 365;
|
|
4
|
-
const DEFAULT_PREFERENCE = "auto";
|
|
5
|
-
const PREFERENCES = ["auto", "light", "dark"];
|
|
6
|
-
/** Dispatched on `window` whenever the preference changes. */
|
|
7
|
-
export const COLOR_SCHEME_CHANGE_EVENT = "ob:colorschemechange";
|
|
8
|
-
function isColorSchemePreference(value) {
|
|
9
|
-
return typeof value === "string" && PREFERENCES.includes(value);
|
|
10
|
-
}
|
|
11
|
-
export function getColorSchemePreference() {
|
|
12
|
-
if (typeof document === "undefined")
|
|
13
|
-
return DEFAULT_PREFERENCE;
|
|
14
|
-
let match = document.cookie.match(new RegExp(`(?:^|;\\s*)${COOKIE_NAME}=([^;]*)`));
|
|
15
|
-
let value = match ? decodeURIComponent(match[1]) : null;
|
|
16
|
-
return isColorSchemePreference(value) ? value : DEFAULT_PREFERENCE;
|
|
17
|
-
}
|
|
18
|
-
export function setColorSchemePreference(preference) {
|
|
19
|
-
if (typeof document === "undefined" || !isColorSchemePreference(preference))
|
|
20
|
-
return;
|
|
21
|
-
let secure = window.location.protocol === "https:" ? ";secure" : "";
|
|
22
|
-
document.cookie = `${COOKIE_NAME}=${preference};path=/;max-age=${COOKIE_MAX_AGE};samesite=lax${secure}`;
|
|
23
|
-
/*
|
|
24
|
-
* Both elements are updated: `<html>` so the browser applies `color-scheme`
|
|
25
|
-
* to scrollbars and native controls, `<body>` because Designsystemet declares
|
|
26
|
-
* the light tokens on `:root` as well (`:root, [data-color-scheme="light"]`).
|
|
27
|
-
*/
|
|
28
|
-
document.documentElement.dataset.colorScheme = preference;
|
|
29
|
-
if (document.body)
|
|
30
|
-
document.body.dataset.colorScheme = preference;
|
|
31
|
-
window.dispatchEvent(new CustomEvent(COLOR_SCHEME_CHANGE_EVENT, { detail: preference }));
|
|
32
|
-
}
|
|
33
|
-
/** Reads the stored preference and keeps it in sync with other toggles on the page. */
|
|
34
|
-
export function useColorSchemePreference() {
|
|
35
|
-
let [preference, setPreference] = useState(() => getColorSchemePreference());
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
function update() {
|
|
38
|
-
setPreference(getColorSchemePreference());
|
|
39
|
-
}
|
|
40
|
-
update();
|
|
41
|
-
window.addEventListener(COLOR_SCHEME_CHANGE_EVENT, update);
|
|
42
|
-
// Cookies fire no change event, so also pick up changes made in another tab.
|
|
43
|
-
document.addEventListener("visibilitychange", update);
|
|
44
|
-
return () => {
|
|
45
|
-
window.removeEventListener(COLOR_SCHEME_CHANGE_EVENT, update);
|
|
46
|
-
document.removeEventListener("visibilitychange", update);
|
|
47
|
-
};
|
|
48
|
-
}, []);
|
|
49
|
-
let setValue = useCallback((value) => {
|
|
50
|
-
setColorSchemePreference(value);
|
|
51
|
-
setPreference(value);
|
|
52
|
-
}, []);
|
|
53
|
-
return [preference, setValue];
|
|
54
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ToggleGroup, Tooltip } from "@digdir/designsystemet-react";
|
|
3
|
-
import { MonitorIcon, MoonIcon, SunIcon } from "@navikt/aksel-icons";
|
|
4
|
-
import { getLocalizedString } from "@olenbetong/appframe-core";
|
|
5
|
-
import { useColorSchemePreference } from "../../colorScheme.js";
|
|
6
|
-
const OPTIONS = [
|
|
7
|
-
{ value: "auto", label: "Follow system setting", Icon: MonitorIcon },
|
|
8
|
-
{ value: "light", label: "Light mode", Icon: SunIcon },
|
|
9
|
-
{ value: "dark", label: "Dark mode", Icon: MoonIcon },
|
|
10
|
-
];
|
|
11
|
-
/** Icon-only color scheme toggle, shown at the bottom of the app menu rail. */
|
|
12
|
-
export function AppMenuColorScheme() {
|
|
13
|
-
let [preference, setPreference] = useColorSchemePreference();
|
|
14
|
-
return (_jsx("div", { className: "ob-app-menu__color-scheme", children: _jsx(ToggleGroup, { "data-size": "sm", "aria-label": getLocalizedString("Theme"), value: preference, onChange: (value) => setPreference(value), children: OPTIONS.map(({ value, label, Icon }) => {
|
|
15
|
-
let localizedLabel = getLocalizedString(label);
|
|
16
|
-
return (_jsx(Tooltip, { content: localizedLabel, children: _jsxs(ToggleGroup.Item, { value: value, children: [_jsx(Icon, { "aria-hidden": true, fontSize: "1.25rem" }), _jsx("span", { className: "ob-app-menu__color-scheme-label", children: localizedLabel })] }) }, value));
|
|
17
|
-
}) }) }));
|
|
18
|
-
}
|