@hashicorp/react-components 1.2.1 → 1.2.3
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/.test/setup-vitest.js +4 -0
- package/global.d.ts +1 -1
- package/package.json +2 -2
- package/postcss.config.js +4 -0
- package/src/components/nav-panel/components/flight-icon/index.tsx +4 -0
- package/src/components/nav-panel/components/flight-icon/style.module.css +4 -0
- package/src/components/nav-panel/components/link/index.tsx +36 -2
- package/src/components/nav-panel/components/link/style.module.css +5 -0
- package/src/components/nav-panel/components/link-list/index.tsx +5 -0
- package/src/components/nav-panel/components/link-list/style.module.css +4 -0
- package/src/components/nav-panel/components/panel/column/index.tsx +7 -3
- package/src/components/nav-panel/components/panel/column/style.module.css +6 -2
- package/src/components/nav-panel/components/panel/index.tsx +4 -0
- package/src/components/nav-panel/components/panel/root/index.tsx +7 -3
- package/src/components/nav-panel/components/panel/root/style.module.css +6 -2
- package/src/components/nav-panel/components/promo/index.tsx +7 -4
- package/src/components/nav-panel/components/promo/style.module.css +8 -4
- package/src/components/nav-panel/components/text/index.tsx +4 -0
- package/src/components/nav-panel/index.tsx +4 -0
- package/src/components/nav-panel/product-panel/index.tsx +11 -6
- package/src/components/nav-panel/product-panel/style.module.css +18 -14
- package/src/components/nav-panel/standard-panel/index.tsx +10 -3
- package/src/components/nav-panel/standard-panel/style.module.css +17 -2
- package/src/lib/get-localized-link-props/index.test.ts +4 -0
- package/src/lib/get-localized-link-props/index.ts +4 -0
- package/src/lib/parse-url/index.test.ts +4 -0
- package/src/lib/parse-url/index.ts +4 -0
- package/src/lib/send-posthog-event/index.ts +4 -0
- package/src/lib/supported-locales/index.ts +4 -0
- package/src/lib/track-nav-click-event/index.ts +4 -0
- package/src/lib/v/index.ts +4 -0
package/.test/setup-vitest.js
CHANGED
package/global.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashicorp/react-components",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "npm run lint:js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"test:watch": "vitest watch"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@hashicorp/flight-icons": "^
|
|
12
|
+
"@hashicorp/flight-icons": "^5.0.0",
|
|
13
13
|
"@hashicorp/web-mktg-logos": "*",
|
|
14
14
|
"@radix-ui/react-navigation-menu": "^1.2.14",
|
|
15
15
|
"@radix-ui/react-visually-hidden": "^1.2.4",
|
package/postcss.config.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022, 2026
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
import Image from 'next/image'
|
|
2
6
|
import Link from 'next/link'
|
|
3
7
|
import classNames from 'classnames'
|
|
@@ -17,6 +21,7 @@ interface NavLinkProps {
|
|
|
17
21
|
icon?: string
|
|
18
22
|
description?: string
|
|
19
23
|
iconGradient?: string
|
|
24
|
+
isDevPortal?: boolean
|
|
20
25
|
linkClickHandler?: (title: string, url: string) => void
|
|
21
26
|
locale?: string
|
|
22
27
|
className?: string
|
|
@@ -56,6 +61,13 @@ const GRADIENT_VALUE_MAP = new Map([
|
|
|
56
61
|
],
|
|
57
62
|
['ILM Solid', { iconBackground: '#7948FF' }],
|
|
58
63
|
['SLM Solid', { iconBackground: '#FF6423' }],
|
|
64
|
+
[
|
|
65
|
+
'Learn',
|
|
66
|
+
{
|
|
67
|
+
iconBackground: 'var(--mds-color-foreground-high-contrast)',
|
|
68
|
+
iconBorder: 'var(--mds-color-border-primary)',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
59
71
|
])
|
|
60
72
|
|
|
61
73
|
export default function NavLink({
|
|
@@ -67,12 +79,16 @@ export default function NavLink({
|
|
|
67
79
|
linkClickHandler,
|
|
68
80
|
locale,
|
|
69
81
|
className,
|
|
82
|
+
isDevPortal = false,
|
|
70
83
|
}: NavLinkProps) {
|
|
71
84
|
const style = iconGradient
|
|
72
85
|
? {
|
|
73
86
|
['--iconBackground' as string]: GRADIENT_VALUE_MAP.get(
|
|
74
87
|
vercelSplit(iconGradient),
|
|
75
88
|
)?.iconBackground,
|
|
89
|
+
['--iconBorder' as string]: GRADIENT_VALUE_MAP.get(
|
|
90
|
+
vercelSplit(iconGradient),
|
|
91
|
+
)?.iconBorder,
|
|
76
92
|
}
|
|
77
93
|
: undefined
|
|
78
94
|
|
|
@@ -86,8 +102,16 @@ export default function NavLink({
|
|
|
86
102
|
}}
|
|
87
103
|
>
|
|
88
104
|
{iconGradient && icon ? (
|
|
89
|
-
<div
|
|
90
|
-
|
|
105
|
+
<div
|
|
106
|
+
className={s.iconBackground}
|
|
107
|
+
style={style}
|
|
108
|
+
data-theme={!isDevPortal && 'dark'}
|
|
109
|
+
>
|
|
110
|
+
<IconSwitcher
|
|
111
|
+
icon={icon}
|
|
112
|
+
iconGradient={iconGradient}
|
|
113
|
+
isDevPortal={isDevPortal}
|
|
114
|
+
/>
|
|
91
115
|
</div>
|
|
92
116
|
) : (
|
|
93
117
|
icon && (
|
|
@@ -111,10 +135,20 @@ export default function NavLink({
|
|
|
111
135
|
const IconSwitcher = ({
|
|
112
136
|
icon,
|
|
113
137
|
iconGradient,
|
|
138
|
+
isDevPortal = false,
|
|
114
139
|
}: {
|
|
115
140
|
icon: string
|
|
116
141
|
iconGradient: string
|
|
142
|
+
isDevPortal?: boolean
|
|
117
143
|
}) => {
|
|
144
|
+
if (isDevPortal) {
|
|
145
|
+
return (
|
|
146
|
+
<FlightIcon
|
|
147
|
+
name={vercelSplit(icon)}
|
|
148
|
+
color={'var(--mds-color-foreground-faint)'}
|
|
149
|
+
/>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
118
152
|
switch (icon) {
|
|
119
153
|
case 'shield-alert':
|
|
120
154
|
return <Image src={ShieldAlertFill} alt="shield alert icon" />
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022, 2026
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
import NavLink from '../link'
|
|
2
6
|
import s from './style.module.css'
|
|
3
7
|
|
|
@@ -9,6 +13,7 @@ export interface LinkListProps {
|
|
|
9
13
|
icon?: string
|
|
10
14
|
description?: string
|
|
11
15
|
iconGradient?: string
|
|
16
|
+
isDevPortal?: boolean
|
|
12
17
|
}[]
|
|
13
18
|
linkClickHandler?: (title: string, url: string) => void
|
|
14
19
|
}
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022, 2026
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
import classNames from 'classnames'
|
|
2
6
|
import s from './style.module.css'
|
|
3
7
|
|
|
4
8
|
export interface NavColumnProps {
|
|
5
9
|
className?: string
|
|
6
10
|
children: React.ReactNode
|
|
7
|
-
|
|
11
|
+
isDevPortal?: boolean
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
export default function Column({
|
|
11
15
|
className,
|
|
12
16
|
children,
|
|
13
|
-
|
|
17
|
+
isDevPortal,
|
|
14
18
|
}: NavColumnProps) {
|
|
15
19
|
return (
|
|
16
20
|
<div
|
|
17
21
|
className={classNames(s.column, className, {
|
|
18
|
-
[s.
|
|
22
|
+
[s.isDevPortal]: isDevPortal,
|
|
19
23
|
})}
|
|
20
24
|
>
|
|
21
25
|
{children}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022, 2026
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
@custom-media --dev-dot-viewport (min-width: 924px);
|
|
2
6
|
|
|
3
7
|
.column {
|
|
@@ -11,13 +15,13 @@
|
|
|
11
15
|
border-radius: var(--mds-spacing-03);
|
|
12
16
|
|
|
13
17
|
@media (--large) {
|
|
14
|
-
&:not(.
|
|
18
|
+
&:not(.isDevPortal) {
|
|
15
19
|
margin: 0;
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
@media (--dev-dot-viewport) {
|
|
20
|
-
&.
|
|
24
|
+
&.isDevPortal {
|
|
21
25
|
margin: 0;
|
|
22
26
|
}
|
|
23
27
|
}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022, 2026
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
import classNames from 'classnames'
|
|
2
6
|
import s from './style.module.css'
|
|
3
7
|
|
|
4
8
|
interface RootProps {
|
|
5
9
|
className?: string
|
|
6
10
|
children: React.ReactNode
|
|
7
|
-
|
|
11
|
+
isDevPortal?: boolean
|
|
8
12
|
}
|
|
9
13
|
|
|
10
|
-
export default function Root({ className, children,
|
|
14
|
+
export default function Root({ className, children, isDevPortal }: RootProps) {
|
|
11
15
|
return (
|
|
12
16
|
<div
|
|
13
17
|
className={classNames(s.root, className, {
|
|
14
|
-
[s.
|
|
18
|
+
[s.isDevPortal]: isDevPortal,
|
|
15
19
|
})}
|
|
16
20
|
>
|
|
17
21
|
{children}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022, 2026
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
@custom-media --dev-dot-viewport (min-width: 924px);
|
|
2
6
|
|
|
3
7
|
.root {
|
|
@@ -9,7 +13,7 @@
|
|
|
9
13
|
min-height: calc(100dvh - var(--mds-spacing-12));
|
|
10
14
|
|
|
11
15
|
@media (--large) {
|
|
12
|
-
&:not(.
|
|
16
|
+
&:not(.isDevPortal) {
|
|
13
17
|
justify-content: flex-start;
|
|
14
18
|
height: 100%;
|
|
15
19
|
min-height: fit-content;
|
|
@@ -19,7 +23,7 @@
|
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
@media (--dev-dot-viewport) {
|
|
22
|
-
&.
|
|
26
|
+
&.isDevPortal {
|
|
23
27
|
justify-content: flex-start;
|
|
24
28
|
height: 100%;
|
|
25
29
|
min-height: fit-content;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022, 2026
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
import { useCallback } from 'react'
|
|
2
6
|
import classNames from 'classnames'
|
|
3
7
|
import { vercelSplit } from '../../../../lib/v'
|
|
@@ -18,7 +22,7 @@ export interface PromoProps {
|
|
|
18
22
|
slug?: string
|
|
19
23
|
icon?: string
|
|
20
24
|
theme: string
|
|
21
|
-
|
|
25
|
+
isDevPortal?: boolean
|
|
22
26
|
isPromoOnTop?: boolean
|
|
23
27
|
}
|
|
24
28
|
|
|
@@ -32,7 +36,7 @@ export default function Promo({
|
|
|
32
36
|
slug,
|
|
33
37
|
icon,
|
|
34
38
|
theme,
|
|
35
|
-
|
|
39
|
+
isDevPortal,
|
|
36
40
|
isPromoOnTop = false,
|
|
37
41
|
}: PromoProps) {
|
|
38
42
|
const handleClick = useCallback((title, linkUrl, linkTitle, slug) => {
|
|
@@ -50,8 +54,7 @@ export default function Promo({
|
|
|
50
54
|
return (
|
|
51
55
|
<div
|
|
52
56
|
className={classNames(s.promo, {
|
|
53
|
-
[s.
|
|
54
|
-
[s.noSide]: !hasSidePanel,
|
|
57
|
+
[s.isDevPortal]: isDevPortal,
|
|
55
58
|
[s.topPromo]: isPromoOnTop,
|
|
56
59
|
})}
|
|
57
60
|
>
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022, 2026
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
@custom-media --dev-dot-viewport (min-width: 924px);
|
|
2
6
|
|
|
3
7
|
.promo {
|
|
@@ -15,7 +19,7 @@
|
|
|
15
19
|
&.topPromo {
|
|
16
20
|
margin-bottom: var(--mds-spacing-05);
|
|
17
21
|
}
|
|
18
|
-
|
|
22
|
+
&:not(.isDevPortal) {
|
|
19
23
|
margin: 0;
|
|
20
24
|
width: min-content;
|
|
21
25
|
min-width: 100%;
|
|
@@ -26,7 +30,7 @@
|
|
|
26
30
|
&.topPromo {
|
|
27
31
|
margin-bottom: var(--mds-spacing-05);
|
|
28
32
|
}
|
|
29
|
-
&.
|
|
33
|
+
&.isDevPortal {
|
|
30
34
|
&.topPromo {
|
|
31
35
|
margin-bottom: var(--mds-spacing-05);
|
|
32
36
|
}
|
|
@@ -64,14 +68,14 @@
|
|
|
64
68
|
display: none;
|
|
65
69
|
|
|
66
70
|
@media (--large) {
|
|
67
|
-
@nest .
|
|
71
|
+
@nest :not(.isDevPortal) & {
|
|
68
72
|
display: block;
|
|
69
73
|
margin-top: 3px;
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
@media (--dev-dot-viewport) {
|
|
74
|
-
@nest .
|
|
78
|
+
@nest .isDevPortal & {
|
|
75
79
|
display: block;
|
|
76
80
|
margin-top: 3px;
|
|
77
81
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022, 2026
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
import classNames from 'classnames'
|
|
2
6
|
import Link from 'next/link'
|
|
3
7
|
import * as NavPanel from '../components/panel'
|
|
@@ -51,6 +55,7 @@ export interface ProductsPanelProps {
|
|
|
51
55
|
}[]
|
|
52
56
|
}
|
|
53
57
|
isPromoOnTop?: boolean
|
|
58
|
+
isDevPortal?: boolean
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
const ProductPanel = ({
|
|
@@ -59,25 +64,25 @@ const ProductPanel = ({
|
|
|
59
64
|
promo,
|
|
60
65
|
sidePanel,
|
|
61
66
|
isPromoOnTop = false,
|
|
67
|
+
isDevPortal = false,
|
|
62
68
|
}: ProductsPanelProps) => {
|
|
63
69
|
return (
|
|
64
70
|
<NavPanel.Root
|
|
65
71
|
className={classNames(s.productPanel, {
|
|
66
|
-
[s.hasSide]: sidePanel,
|
|
67
|
-
[s.noSide]: !sidePanel,
|
|
68
72
|
[s.topPromo]: isPromoOnTop,
|
|
73
|
+
[s.isDevPortal]: isDevPortal,
|
|
69
74
|
})}
|
|
70
|
-
|
|
75
|
+
isDevPortal={isDevPortal}
|
|
71
76
|
>
|
|
72
77
|
<div className={s.mainPanel}>
|
|
73
78
|
{promo && isPromoOnTop ? (
|
|
74
79
|
<Promo
|
|
75
80
|
{...promo}
|
|
76
|
-
|
|
81
|
+
isDevPortal={isDevPortal}
|
|
77
82
|
isPromoOnTop={isPromoOnTop}
|
|
78
83
|
/>
|
|
79
84
|
) : null}
|
|
80
|
-
<NavPanel.Column
|
|
85
|
+
<NavPanel.Column isDevPortal={isDevPortal}>
|
|
81
86
|
<ul className={s.productCategories}>
|
|
82
87
|
{productCategories.map(({ group, title, products }) => {
|
|
83
88
|
return (
|
|
@@ -107,7 +112,7 @@ const ProductPanel = ({
|
|
|
107
112
|
</ul>
|
|
108
113
|
</NavPanel.Column>
|
|
109
114
|
{promo && !isPromoOnTop ? (
|
|
110
|
-
<Promo {...promo}
|
|
115
|
+
<Promo {...promo} isDevPortal={isDevPortal} />
|
|
111
116
|
) : null}
|
|
112
117
|
</div>
|
|
113
118
|
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022, 2026
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
@custom-media --dev-dot-viewport (min-width: 924px);
|
|
2
6
|
|
|
3
7
|
.productPanel {
|
|
4
8
|
height: 100%;
|
|
5
9
|
|
|
6
10
|
@media (--large) {
|
|
7
|
-
|
|
11
|
+
&:not(.isDevPortal) {
|
|
8
12
|
display: grid;
|
|
9
13
|
grid-template-rows: 1fr;
|
|
10
14
|
grid-template-columns: max-content max-content;
|
|
@@ -13,7 +17,7 @@
|
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
@media (--dev-dot-viewport) {
|
|
16
|
-
&.
|
|
20
|
+
&.isDevPortal {
|
|
17
21
|
display: grid;
|
|
18
22
|
grid-template-rows: 1fr;
|
|
19
23
|
grid-template-columns: max-content max-content;
|
|
@@ -33,13 +37,13 @@
|
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
@media (--large) {
|
|
36
|
-
@nest .
|
|
40
|
+
@nest :not(.isDevPortal) & {
|
|
37
41
|
margin: 0;
|
|
38
42
|
}
|
|
39
43
|
}
|
|
40
44
|
|
|
41
45
|
@media (--dev-dot-viewport) {
|
|
42
|
-
@nest .
|
|
46
|
+
@nest .isDevPortal & {
|
|
43
47
|
margin: 0;
|
|
44
48
|
}
|
|
45
49
|
}
|
|
@@ -63,14 +67,14 @@
|
|
|
63
67
|
font-weight: var(--mds-typography-font-weight-semibold);
|
|
64
68
|
|
|
65
69
|
@media (--large) {
|
|
66
|
-
@nest .
|
|
70
|
+
@nest :not(.isDevPortal) & {
|
|
67
71
|
padding-bottom: 0;
|
|
68
72
|
padding-left: var(--mds-spacing-06);
|
|
69
73
|
}
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
@media (--dev-dot-viewport) {
|
|
73
|
-
@nest .
|
|
77
|
+
@nest .isDevPortal & {
|
|
74
78
|
padding-bottom: 0;
|
|
75
79
|
padding-left: var(--mds-spacing-06);
|
|
76
80
|
}
|
|
@@ -85,7 +89,7 @@
|
|
|
85
89
|
padding: 0;
|
|
86
90
|
|
|
87
91
|
@media (--large) {
|
|
88
|
-
@nest .
|
|
92
|
+
@nest :not(.isDevPortal) & {
|
|
89
93
|
padding: var(--mds-spacing-06) var(--mds-spacing-05) var(--mds-spacing-04);
|
|
90
94
|
grid-auto-flow: row;
|
|
91
95
|
grid-template-columns: repeat(2, 300px);
|
|
@@ -95,7 +99,7 @@
|
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
@media (--dev-dot-viewport) {
|
|
98
|
-
@nest .
|
|
102
|
+
@nest .isDevPortal & {
|
|
99
103
|
padding: var(--mds-spacing-06) var(--mds-spacing-05) var(--mds-spacing-04);
|
|
100
104
|
grid-auto-flow: row;
|
|
101
105
|
grid-template-columns: repeat(2, 300px);
|
|
@@ -119,7 +123,7 @@
|
|
|
119
123
|
gap: var(--mds-spacing-05);
|
|
120
124
|
|
|
121
125
|
@media (--large) {
|
|
122
|
-
@nest .
|
|
126
|
+
@nest :not(.isDevPortal) & {
|
|
123
127
|
padding: var(--mds-spacing-03) var(--mds-spacing-05);
|
|
124
128
|
margin-bottom: 0;
|
|
125
129
|
|
|
@@ -131,7 +135,7 @@
|
|
|
131
135
|
}
|
|
132
136
|
|
|
133
137
|
@media (--dev-dot-viewport) {
|
|
134
|
-
@nest .
|
|
138
|
+
@nest .isDevPortal & {
|
|
135
139
|
padding: var(--mds-spacing-03) var(--mds-spacing-05);
|
|
136
140
|
margin-bottom: 0;
|
|
137
141
|
|
|
@@ -151,7 +155,7 @@
|
|
|
151
155
|
width: 42px;
|
|
152
156
|
}
|
|
153
157
|
|
|
154
|
-
@nest .
|
|
158
|
+
@nest :not(.isDevPortal) & {
|
|
155
159
|
& svg {
|
|
156
160
|
@media (--large) {
|
|
157
161
|
height: var(--mds-spacing-08);
|
|
@@ -160,7 +164,7 @@
|
|
|
160
164
|
}
|
|
161
165
|
}
|
|
162
166
|
|
|
163
|
-
@nest .
|
|
167
|
+
@nest .isDevPortal & {
|
|
164
168
|
& svg {
|
|
165
169
|
@media (--dev-dot-viewport) {
|
|
166
170
|
height: var(--mds-spacing-08);
|
|
@@ -202,7 +206,7 @@
|
|
|
202
206
|
}
|
|
203
207
|
|
|
204
208
|
@media (--large) {
|
|
205
|
-
@nest .
|
|
209
|
+
@nest :not(.isDevPortal) & {
|
|
206
210
|
padding: var(--mds-spacing-05) 0 var(--mds-spacing-05) var(--mds-spacing-04);
|
|
207
211
|
}
|
|
208
212
|
|
|
@@ -212,7 +216,7 @@
|
|
|
212
216
|
}
|
|
213
217
|
|
|
214
218
|
@media (--dev-dot-viewport) {
|
|
215
|
-
@nest .
|
|
219
|
+
@nest .isDevPortal & {
|
|
216
220
|
padding: var(--mds-spacing-07) 0 var(--mds-spacing-09) var(--mds-spacing-04);
|
|
217
221
|
}
|
|
218
222
|
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022, 2026
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
import { trackNavClickEvent } from '../../../lib/track-nav-click-event'
|
|
2
6
|
import * as NavPanel from '../components/panel'
|
|
3
7
|
import LinkList, { type LinkListProps } from '../components/link-list'
|
|
4
8
|
import Promo, { type PromoProps } from '../components/promo'
|
|
5
9
|
import s from './style.module.css'
|
|
10
|
+
import classNames from 'classnames'
|
|
6
11
|
|
|
7
12
|
export interface NavItem {
|
|
8
13
|
navItems: LinkListProps['links']
|
|
@@ -13,6 +18,7 @@ interface StandardPanelProps {
|
|
|
13
18
|
promo?: PromoProps
|
|
14
19
|
sectionName?: string
|
|
15
20
|
locale?: any
|
|
21
|
+
isDevPortal?: boolean
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
const StandardPanel = ({
|
|
@@ -20,13 +26,14 @@ const StandardPanel = ({
|
|
|
20
26
|
promo,
|
|
21
27
|
sectionName = '',
|
|
22
28
|
locale,
|
|
29
|
+
isDevPortal = false,
|
|
23
30
|
}: StandardPanelProps) => {
|
|
24
31
|
return (
|
|
25
|
-
<NavPanel.Root>
|
|
26
|
-
<div className={s.columns}>
|
|
32
|
+
<NavPanel.Root isDevPortal={isDevPortal}>
|
|
33
|
+
<div className={classNames(s.columns, { [s.isDevPortal]: isDevPortal })}>
|
|
27
34
|
{navData.map(({ navItems }, stableIdx) => {
|
|
28
35
|
return (
|
|
29
|
-
<NavPanel.Column key={stableIdx}>
|
|
36
|
+
<NavPanel.Column key={stableIdx} isDevPortal={isDevPortal}>
|
|
30
37
|
<LinkList
|
|
31
38
|
locale={locale}
|
|
32
39
|
links={navItems}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022, 2026
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@custom-media --dev-dot-viewport (min-width: 924px);
|
|
6
|
+
|
|
1
7
|
.columns {
|
|
2
8
|
display: flex;
|
|
3
9
|
gap: var(--mds-spacing-03);
|
|
@@ -5,7 +11,16 @@
|
|
|
5
11
|
margin-top: var(--mds-spacing-07);
|
|
6
12
|
|
|
7
13
|
@media (--large) {
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
&:not(.isDevPortal) {
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
margin-top: 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (--dev-dot-viewport) {
|
|
21
|
+
&.isDevPortal {
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
margin-top: 0;
|
|
24
|
+
}
|
|
10
25
|
}
|
|
11
26
|
}
|