@cntrl-site/sdk-nextjs 1.9.135 → 1.9.136-alpha.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.
|
@@ -24,7 +24,7 @@ const Navigation = ({ navigation, pages, hidden }) => {
|
|
|
24
24
|
const isSwitch = position === 'switch';
|
|
25
25
|
const isSwitchOnScroll = (0, useNavigationSwitch_1.useNavigationSwitch)(isSwitch, wrapperRef);
|
|
26
26
|
const layoutValues = [(_d = navigation.settings) !== null && _d !== void 0 ? _d : {}, hidden !== null && hidden !== void 0 ? hidden : {}];
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { id: navigation.component.id, ref: setWrapperRef, className: `navigation-${navigation.id}`, children: (0, jsx_runtime_1.jsx)(NavigationComponent_1.NavigationComponent, { component: navigation.component, pages: pages, currentState: isSwitch ? 'default' : undefined }) }), isSwitch && ((0, jsx_runtime_1.jsx)("div", { "aria-hidden": !isSwitchOnScroll, className: `navigation-switch-clone-${navigation.id}${isSwitchOnScroll ? ` navigation-switch-clone-${navigation.id}-visible` : ''}`, children: (0, jsx_runtime_1.jsx)(NavigationComponent_1.NavigationComponent, { component: navigation.component, pages: pages, currentState: "compact", isSwitchClone: true }) })), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { id: navigation.component.id, ref: setWrapperRef, className: `navigation-${navigation.id}${isSwitch && isSwitchOnScroll ? ` navigation-${navigation.id}-switch-inactive` : ''}`, children: (0, jsx_runtime_1.jsx)(NavigationComponent_1.NavigationComponent, { component: navigation.component, pages: pages, currentState: isSwitch ? 'default' : undefined }) }), isSwitch && ((0, jsx_runtime_1.jsx)("div", { "aria-hidden": !isSwitchOnScroll, className: `navigation-switch-clone-${navigation.id}${isSwitchOnScroll ? ` navigation-switch-clone-${navigation.id}-visible` : ''}`, children: (0, jsx_runtime_1.jsx)(NavigationComponent_1.NavigationComponent, { component: navigation.component, pages: pages, currentState: "compact", isSwitchClone: true }) })), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
|
|
28
28
|
.navigation-${navigation.id} {
|
|
29
29
|
position: absolute;
|
|
30
30
|
top: 0;
|
|
@@ -32,19 +32,26 @@ const Navigation = ({ navigation, pages, hidden }) => {
|
|
|
32
32
|
width: 100%;
|
|
33
33
|
z-index: 10000;
|
|
34
34
|
}
|
|
35
|
+
.navigation-${navigation.id}-switch-inactive {
|
|
36
|
+
visibility: hidden;
|
|
37
|
+
pointer-events: none;
|
|
38
|
+
}
|
|
35
39
|
.navigation-switch-clone-${navigation.id} {
|
|
36
40
|
position: fixed;
|
|
37
41
|
top: var(--cntrl-article-top, 0px);
|
|
38
42
|
left: var(--cntrl-article-left, 0px);
|
|
39
43
|
width: var(--cntrl-article-width, 100%);
|
|
40
44
|
z-index: 10001;
|
|
41
|
-
transform: translateY(-100%);
|
|
42
|
-
transition: transform 320ms ease;
|
|
43
45
|
pointer-events: none;
|
|
46
|
+
visibility: hidden;
|
|
47
|
+
transition: visibility 0s linear 320ms;
|
|
48
|
+
--cntrl-nav-slide: -100%;
|
|
44
49
|
}
|
|
45
50
|
.navigation-switch-clone-${navigation.id}-visible {
|
|
46
|
-
transform: translateY(0);
|
|
47
51
|
pointer-events: auto;
|
|
52
|
+
visibility: visible;
|
|
53
|
+
transition: visibility 0s;
|
|
54
|
+
--cntrl-nav-slide: 0%;
|
|
48
55
|
}
|
|
49
56
|
${(0, sdk_1.getLayoutStyles)(layouts, layoutValues, ([settings, isHidden]) => {
|
|
50
57
|
var _a;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cntrl-site/sdk-nextjs",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.136-alpha.0",
|
|
4
4
|
"description": "SDK for Next.js",
|
|
5
5
|
"author": "arsen@momdesign.nyc",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@antfu/eslint-config": "^3.8.0",
|
|
33
33
|
"@cntrl-site/color": "^1.0.0",
|
|
34
|
-
"@cntrl-site/components": "^1.0.79-alpha.
|
|
34
|
+
"@cntrl-site/components": "^1.0.79-alpha.5",
|
|
35
35
|
"@cntrl-site/effects": "^1.4.2",
|
|
36
36
|
"@cntrl-site/sdk": "^1.28.9-alpha.2",
|
|
37
37
|
"@types/vimeo__player": "^2.18.0",
|
|
@@ -35,7 +35,7 @@ export const Navigation: FC<Props> = ({ navigation, pages, hidden }) => {
|
|
|
35
35
|
<div
|
|
36
36
|
id={navigation.component.id}
|
|
37
37
|
ref={setWrapperRef}
|
|
38
|
-
className={`navigation-${navigation.id}`}
|
|
38
|
+
className={`navigation-${navigation.id}${isSwitch && isSwitchOnScroll ? ` navigation-${navigation.id}-switch-inactive` : ''}`}
|
|
39
39
|
>
|
|
40
40
|
<NavigationComponent
|
|
41
41
|
component={navigation.component}
|
|
@@ -64,19 +64,26 @@ export const Navigation: FC<Props> = ({ navigation, pages, hidden }) => {
|
|
|
64
64
|
width: 100%;
|
|
65
65
|
z-index: 10000;
|
|
66
66
|
}
|
|
67
|
+
.navigation-${navigation.id}-switch-inactive {
|
|
68
|
+
visibility: hidden;
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
}
|
|
67
71
|
.navigation-switch-clone-${navigation.id} {
|
|
68
72
|
position: fixed;
|
|
69
73
|
top: var(--cntrl-article-top, 0px);
|
|
70
74
|
left: var(--cntrl-article-left, 0px);
|
|
71
75
|
width: var(--cntrl-article-width, 100%);
|
|
72
76
|
z-index: 10001;
|
|
73
|
-
transform: translateY(-100%);
|
|
74
|
-
transition: transform 320ms ease;
|
|
75
77
|
pointer-events: none;
|
|
78
|
+
visibility: hidden;
|
|
79
|
+
transition: visibility 0s linear 320ms;
|
|
80
|
+
--cntrl-nav-slide: -100%;
|
|
76
81
|
}
|
|
77
82
|
.navigation-switch-clone-${navigation.id}-visible {
|
|
78
|
-
transform: translateY(0);
|
|
79
83
|
pointer-events: auto;
|
|
84
|
+
visibility: visible;
|
|
85
|
+
transition: visibility 0s;
|
|
86
|
+
--cntrl-nav-slide: 0%;
|
|
80
87
|
}
|
|
81
88
|
${getLayoutStyles(layouts, layoutValues, ([settings, isHidden]) => {
|
|
82
89
|
const layoutPosition = settings?.position ?? DEFAULT_POSITION;
|