@hashicorp/react-components 0.0.0-canary.29ac326 → 0.0.0-canary.32599ff
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/package.json +7 -6
- package/src/components/actions/index.tsx +5 -5
- package/src/components/call-to-action/index.tsx +12 -10
- package/src/components/call-to-action/styles/variant-centered.module.css +5 -4
- package/src/components/call-to-action/styles/variant-compact-grid.module.css +6 -4
- package/src/components/call-to-action/styles/variant-compact.module.css +6 -4
- package/src/components/call-to-action/styles/variant-links.module.css +6 -11
- package/src/components/card/index.test.tsx +1 -1
- package/src/components/card/newsroom-card/index.test.tsx +1 -1
- package/src/components/card/newsroom-card/style.module.css +1 -1
- package/src/components/card/partner-card/index.tsx +5 -5
- package/src/components/card/person-card/index.tsx +3 -3
- package/src/components/card/primitives.tsx +20 -19
- package/src/components/card/resource-card/index.test.tsx +1 -1
- package/src/components/card/resource-card/index.tsx +3 -0
- package/src/components/card/style.module.css +2 -2
- package/src/components/card/types.ts +2 -2
- package/src/components/card/unified-card/index.spec.tsx +40 -0
- package/src/components/card/unified-card/index.tsx +5 -11
- package/src/components/inline-video/index.tsx +104 -0
- package/src/components/inline-video/style.module.css +99 -0
- package/src/components/intro/style.module.css +2 -2
- package/src/components/marketo-form/contexts/FormMetadata.ts +2 -0
- package/src/components/marketo-form/form/index.tsx +12 -7
- package/src/components/marketo-form/partials/fields/checkbox-field/index.tsx +1 -1
- package/src/components/marketo-form/partials/fields/email-field/index.tsx +1 -1
- package/src/components/marketo-form/partials/fields/form-page-url-field/index.tsx +12 -1
- package/src/components/marketo-form/partials/fields/hidden-field/index.tsx +1 -0
- package/src/components/marketo-form/partials/fields/htmltext-field/style.module.css +2 -2
- package/src/components/marketo-form/partials/fields/radio-buttons-field/index.tsx +1 -1
- package/src/components/marketo-form/partials/fields/select-field/index.tsx +1 -1
- package/src/components/marketo-form/partials/fields/telephone-field/index.tsx +1 -1
- package/src/components/marketo-form/partials/fields/text-field/index.tsx +1 -1
- package/src/components/marketo-form/partials/fields/textarea-field/index.tsx +1 -1
- package/src/components/marketo-form/types.ts +10 -12
- package/src/components/marketo-form/utils.ts +1 -1
- package/src/components/nav-panel/components/link-list/index.tsx +15 -9
- package/src/components/nav-panel/components/link-list/style.module.css +10 -10
- package/src/components/nav-panel/components/panel/column/index.tsx +15 -2
- package/src/components/nav-panel/components/panel/column/style.module.css +13 -3
- package/src/components/nav-panel/components/panel/root/index.tsx +11 -2
- package/src/components/nav-panel/components/panel/root/style.module.css +20 -6
- package/src/components/nav-panel/components/promo/index.tsx +23 -10
- package/src/components/nav-panel/components/promo/style.module.css +48 -16
- package/src/components/nav-panel/product-panel/index.tsx +46 -16
- package/src/components/nav-panel/product-panel/style.module.css +151 -42
- package/src/components/nav-panel/standard-panel/index.tsx +3 -0
- package/src/components/nav-panel/standard-panel/style.module.css +2 -2
- package/src/components/next-steps/index.tsx +3 -2
- package/src/components/next-steps/style.module.css +18 -18
- package/src/components/product-badge/index.tsx +1 -1
- package/src/components/product-badge/style.module.css +2 -2
- package/src/components/products-used/style.module.css +7 -7
- package/src/components/related-content/index.tsx +28 -29
- package/src/components/related-content/style.module.css +58 -60
- package/src/components/related-content/types.ts +2 -2
- package/src/components/subnav/index.tsx +12 -3
- package/src/components/subnav/partials/CtaLinks/github-stars-link/style.module.css +8 -12
- package/src/components/subnav/partials/CtaLinks/index.tsx +9 -8
- package/src/components/subnav/partials/CtaLinks/style.module.css +6 -6
- package/src/components/subnav/partials/DropdownTrigger/index.tsx +2 -2
- package/src/components/subnav/partials/DropdownTrigger/style.module.css +11 -8
- package/src/components/subnav/partials/MenuItemsDefault/index.tsx +24 -8
- package/src/components/subnav/partials/MenuItemsDefault/style.module.css +44 -31
- package/src/components/subnav/partials/MenuItemsOverflow/index.tsx +17 -4
- package/src/components/subnav/partials/MenuItemsOverflow/style.module.css +24 -18
- package/src/components/subnav/partials/TitleLink/index.tsx +6 -4
- package/src/components/subnav/partials/TitleLink/mktg-logos/all-community-product-logos_on-dark.ts +2 -1
- package/src/components/subnav/partials/TitleLink/mktg-logos/all-community-product-logos_on-light.ts +2 -1
- package/src/components/subnav/partials/TitleLink/style.module.css +3 -3
- package/src/components/subnav/partials/nav-item-text/style.module.css +2 -4
- package/src/components/subnav/style.module.css +5 -7
- package/src/lib/get-localized-link-props/index.test.ts +30 -0
- package/src/lib/get-localized-link-props/index.ts +45 -0
- package/src/lib/parse-url/index.test.ts +40 -1
- package/src/lib/parse-url/index.ts +77 -9
- package/src/lib/supported-locales/index.ts +1 -0
- package/src/lib/track-nav-click-event/index.ts +4 -4
- package/src/lib/v/index.ts +4 -5
- package/src/components/consent-manager/README.md +0 -73
- package/src/components/consent-manager/components/banner/banner.module.css +0 -23
- package/src/components/consent-manager/components/banner/banner.test.tsx +0 -31
- package/src/components/consent-manager/components/banner/banner.tsx +0 -73
- package/src/components/consent-manager/components/dialog/dialog.module.css +0 -145
- package/src/components/consent-manager/components/dialog/dialog.test.tsx +0 -194
- package/src/components/consent-manager/components/dialog/dialog.tsx +0 -339
- package/src/components/consent-manager/img/icn_close.tsx +0 -19
- package/src/components/consent-manager/index.test.tsx +0 -334
- package/src/components/consent-manager/index.tsx +0 -186
- package/src/components/consent-manager/loader/README.md +0 -29
- package/src/components/consent-manager/loader/categories.ts +0 -22
- package/src/components/consent-manager/loader/index.tsx +0 -94
- package/src/components/consent-manager/loader/presets/enterprise.ts +0 -12
- package/src/components/consent-manager/loader/presets/oss.ts +0 -10
- package/src/components/consent-manager/loader/services.ts +0 -45
- package/src/components/consent-manager/scripts/custom.tsx +0 -59
- package/src/components/consent-manager/scripts/segment.tsx +0 -87
- package/src/components/consent-manager/style.module.css +0 -9
- package/src/components/consent-manager/types.ts +0 -55
- package/src/components/consent-manager/util/cookies.test.ts +0 -75
- package/src/components/consent-manager/util/cookies.ts +0 -70
- package/src/components/consent-manager/util/integrations.test.ts +0 -115
- package/src/components/consent-manager/util/integrations.ts +0 -110
- package/src/components/subnav/theme.module.css +0 -50
|
@@ -1,16 +1,30 @@
|
|
|
1
|
+
@custom-media --dev-dot-viewport (min-width: 924px);
|
|
2
|
+
|
|
1
3
|
.root {
|
|
2
4
|
width: 100%;
|
|
3
5
|
display: flex;
|
|
4
6
|
flex-direction: column;
|
|
5
7
|
justify-content: space-between;
|
|
6
8
|
/* stylelint-disable-next-line unit-no-unknown */
|
|
7
|
-
min-height: calc(100dvh - var(--
|
|
9
|
+
min-height: calc(100dvh - var(--mds-spacing-12));
|
|
8
10
|
|
|
9
11
|
@media (--large) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
&:not(.hasSide) {
|
|
13
|
+
justify-content: flex-start;
|
|
14
|
+
height: 100%;
|
|
15
|
+
min-height: fit-content;
|
|
16
|
+
padding: var(--mds-spacing-05) var(--mds-spacing-04);
|
|
17
|
+
gap: var(--mds-spacing-04);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@media (--dev-dot-viewport) {
|
|
22
|
+
&.hasSide {
|
|
23
|
+
justify-content: flex-start;
|
|
24
|
+
height: 100%;
|
|
25
|
+
min-height: fit-content;
|
|
26
|
+
padding: var(--mds-spacing-05) var(--mds-spacing-04);
|
|
27
|
+
gap: var(--mds-spacing-04);
|
|
28
|
+
}
|
|
15
29
|
}
|
|
16
30
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { useCallback } from 'react'
|
|
2
2
|
import classNames from 'classnames'
|
|
3
|
-
import {
|
|
3
|
+
import { vercelSplit } from '../../../../lib/v'
|
|
4
4
|
import Link from 'next/link'
|
|
5
|
-
import {
|
|
5
|
+
import { getLocalizedLinkProps } from '../../../../lib/get-localized-link-props'
|
|
6
6
|
import { trackNavClickEvent } from '../../../../lib/track-nav-click-event'
|
|
7
|
-
import FlightIcon from '@hashicorp/react-
|
|
7
|
+
import FlightIcon from '@hashicorp/react-mds/src/hds/components/flight-icon'
|
|
8
8
|
import * as NavigationMenu from '@radix-ui/react-navigation-menu'
|
|
9
9
|
import s from './style.module.css'
|
|
10
10
|
|
|
11
11
|
export interface PromoProps {
|
|
12
|
+
locale?: string
|
|
12
13
|
title: string
|
|
13
14
|
description: string
|
|
14
15
|
linkUrl: string
|
|
@@ -16,9 +17,12 @@ export interface PromoProps {
|
|
|
16
17
|
slug?: string
|
|
17
18
|
icon?: string
|
|
18
19
|
theme: string
|
|
20
|
+
hasSidePanel?: boolean
|
|
21
|
+
isPromoOnTop?: boolean
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
export default function Promo({
|
|
25
|
+
locale,
|
|
22
26
|
title,
|
|
23
27
|
description,
|
|
24
28
|
linkUrl,
|
|
@@ -26,6 +30,8 @@ export default function Promo({
|
|
|
26
30
|
slug,
|
|
27
31
|
icon,
|
|
28
32
|
theme,
|
|
33
|
+
hasSidePanel,
|
|
34
|
+
isPromoOnTop = false,
|
|
29
35
|
}: PromoProps) {
|
|
30
36
|
const handleClick = useCallback((title, linkUrl, linkTitle, slug) => {
|
|
31
37
|
if (window && window.analytics) {
|
|
@@ -40,23 +46,29 @@ export default function Promo({
|
|
|
40
46
|
}, [])
|
|
41
47
|
|
|
42
48
|
return (
|
|
43
|
-
<div
|
|
49
|
+
<div
|
|
50
|
+
className={classNames(s.promo, {
|
|
51
|
+
[s.hasSide]: hasSidePanel,
|
|
52
|
+
[s.noSide]: !hasSidePanel,
|
|
53
|
+
[s.topPromo]: isPromoOnTop,
|
|
54
|
+
})}
|
|
55
|
+
>
|
|
44
56
|
{icon && (
|
|
45
57
|
<div
|
|
46
58
|
className={classNames(s.icon, {
|
|
47
|
-
[s.hashidays]:
|
|
48
|
-
[s.hashiconf]:
|
|
59
|
+
[s.hashidays]: vercelSplit(theme) === 'hashidays',
|
|
60
|
+
[s.hashiconf]: vercelSplit(theme) === 'hashiconf',
|
|
49
61
|
})}
|
|
50
62
|
>
|
|
51
|
-
<FlightIcon name={
|
|
63
|
+
<FlightIcon name={vercelSplit(icon)} />
|
|
52
64
|
</div>
|
|
53
65
|
)}
|
|
54
66
|
<div className={s.rightContent}>
|
|
55
67
|
<div>
|
|
56
68
|
<div
|
|
57
69
|
className={classNames(s.title, {
|
|
58
|
-
[s.hashidays]:
|
|
59
|
-
[s.hashiconf]:
|
|
70
|
+
[s.hashidays]: vercelSplit(theme) === 'hashidays',
|
|
71
|
+
[s.hashiconf]: vercelSplit(theme) === 'hashiconf',
|
|
60
72
|
})}
|
|
61
73
|
>
|
|
62
74
|
{title}
|
|
@@ -65,7 +77,8 @@ export default function Promo({
|
|
|
65
77
|
</div>
|
|
66
78
|
<NavigationMenu.Link asChild>
|
|
67
79
|
<Link
|
|
68
|
-
|
|
80
|
+
locale={locale ? locale : undefined}
|
|
81
|
+
{...getLocalizedLinkProps(linkUrl, locale)}
|
|
69
82
|
className={s.link}
|
|
70
83
|
onClickCapture={() => handleClick(title, linkUrl, linkTitle, slug)}
|
|
71
84
|
>
|
|
@@ -1,45 +1,77 @@
|
|
|
1
|
+
@custom-media --dev-dot-viewport (min-width: 924px);
|
|
2
|
+
|
|
1
3
|
.promo {
|
|
2
4
|
display: flex;
|
|
3
|
-
border-radius: var(--
|
|
5
|
+
border-radius: var(--mds-spacing-01);
|
|
4
6
|
border: 1px solid var(--token-color-border-faint);
|
|
5
7
|
background-color: var(--token-color-surface-faint);
|
|
6
|
-
padding: var(--
|
|
7
|
-
var(--
|
|
8
|
+
padding: var(--mds-spacing-05) var(--mds-spacing-08)
|
|
9
|
+
var(--mds-spacing-06) var(--mds-spacing-08);
|
|
8
10
|
flex-direction: row;
|
|
9
|
-
gap: var(--
|
|
10
|
-
margin: var(--
|
|
11
|
+
gap: var(--mds-spacing-04);
|
|
12
|
+
margin: var(--mds-spacing-07);
|
|
13
|
+
margin-bottom: var(--mds-spacing-09);
|
|
11
14
|
|
|
12
15
|
@media (--large) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
&.topPromo {
|
|
17
|
+
margin-bottom: var(--mds-spacing-05);
|
|
18
|
+
}
|
|
19
|
+
&.noSide {
|
|
20
|
+
margin: 0;
|
|
21
|
+
width: min-content;
|
|
22
|
+
min-width: 100%;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (--dev-dot-viewport) {
|
|
27
|
+
&.topPromo {
|
|
28
|
+
margin-bottom: var(--mds-spacing-05);
|
|
29
|
+
}
|
|
30
|
+
&.hasSide {
|
|
31
|
+
margin: 0;
|
|
32
|
+
width: min-content;
|
|
33
|
+
min-width: 100%;
|
|
34
|
+
}
|
|
16
35
|
}
|
|
17
36
|
}
|
|
18
37
|
|
|
38
|
+
.topPromo {
|
|
39
|
+
margin-bottom: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
19
42
|
.rightContent {
|
|
20
43
|
display: flex;
|
|
21
44
|
flex-wrap: wrap;
|
|
22
|
-
gap: var(--
|
|
45
|
+
gap: var(--mds-spacing-03);
|
|
23
46
|
width: 100%;
|
|
24
47
|
justify-content: space-between;
|
|
25
48
|
}
|
|
26
49
|
|
|
27
50
|
.title {
|
|
28
|
-
font-weight: var(--font-weight-
|
|
51
|
+
font-weight: var(--mds-typography-font-weight-semibold);
|
|
29
52
|
}
|
|
30
53
|
|
|
31
54
|
.description {
|
|
32
|
-
font-size: var(--
|
|
33
|
-
font-weight: var(--
|
|
34
|
-
margin-top: var(--
|
|
55
|
+
font-size: var(--mds-typography-body-200-font-size);
|
|
56
|
+
font-weight: var(--mds-typography-font-weight-regular);
|
|
57
|
+
margin-top: var(--mds-spacing-01);
|
|
35
58
|
}
|
|
36
59
|
|
|
37
60
|
.icon {
|
|
38
61
|
display: none;
|
|
39
62
|
|
|
40
63
|
@media (--large) {
|
|
41
|
-
|
|
42
|
-
|
|
64
|
+
@nest .noSide & {
|
|
65
|
+
display: block;
|
|
66
|
+
margin-top: 3px;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@media (--dev-dot-viewport) {
|
|
71
|
+
@nest .hasSide & {
|
|
72
|
+
display: block;
|
|
73
|
+
margin-top: 3px;
|
|
74
|
+
}
|
|
43
75
|
}
|
|
44
76
|
}
|
|
45
77
|
|
|
@@ -48,7 +80,7 @@
|
|
|
48
80
|
display: flex;
|
|
49
81
|
flex-direction: row;
|
|
50
82
|
align-items: center;
|
|
51
|
-
gap: var(--
|
|
83
|
+
gap: var(--mds-spacing-02);
|
|
52
84
|
|
|
53
85
|
&:hover {
|
|
54
86
|
text-decoration: underline;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
import classNames from 'classnames'
|
|
1
2
|
import Link from 'next/link'
|
|
2
3
|
import * as NavPanel from '../components/panel'
|
|
3
4
|
import Promo, { type PromoProps } from '../components/promo'
|
|
5
|
+
import { getLocalizedLinkProps } from '../../../lib/get-localized-link-props'
|
|
4
6
|
import { Products } from '@hashicorp/platform-product-meta'
|
|
5
|
-
import FlightIcon from '@hashicorp/react-
|
|
6
|
-
import {
|
|
7
|
-
import { parseUrl } from '../../../lib/parse-url'
|
|
7
|
+
import FlightIcon from '@hashicorp/react-mds/src/hds/components/flight-icon'
|
|
8
|
+
import { Text } from '@hashicorp/react-mds/src/components/text'
|
|
8
9
|
import { trackNavClickEvent } from '../../../lib/track-nav-click-event'
|
|
9
10
|
import * as NavigationMenu from '@radix-ui/react-navigation-menu'
|
|
10
11
|
import s from './style.module.css'
|
|
11
12
|
|
|
12
13
|
const PRODUCT_LOGO_MAP = new Map([
|
|
13
|
-
['Terraform', 'terraform-fill
|
|
14
|
+
['Terraform', 'terraform-fill'],
|
|
14
15
|
['Packer', 'packer-fill-color'],
|
|
15
16
|
['Vault', 'vault-fill-color'],
|
|
16
17
|
['Boundary', 'boundary-fill-color'],
|
|
@@ -23,11 +24,13 @@ const PRODUCT_LOGO_MAP = new Map([
|
|
|
23
24
|
])
|
|
24
25
|
|
|
25
26
|
const PRODUCT_LOGO_EXCEPTION_CLASSNAMES = {
|
|
27
|
+
Terraform: 'terraform',
|
|
26
28
|
'HCP Vault Secrets': 'hcpVaultSecrets',
|
|
27
29
|
'HCP Vault Radar': 'hcpVaultRadar',
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
export interface ProductsPanelProps {
|
|
33
|
+
locale: string
|
|
31
34
|
productCategories: any
|
|
32
35
|
promo?: PromoProps
|
|
33
36
|
sidePanel?: {
|
|
@@ -39,27 +42,44 @@ export interface ProductsPanelProps {
|
|
|
39
42
|
url: string
|
|
40
43
|
}[]
|
|
41
44
|
}
|
|
45
|
+
isPromoOnTop?: boolean
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
const ProductPanel = ({
|
|
49
|
+
locale,
|
|
45
50
|
productCategories,
|
|
46
51
|
promo,
|
|
47
52
|
sidePanel,
|
|
53
|
+
isPromoOnTop = false,
|
|
48
54
|
}: ProductsPanelProps) => {
|
|
49
55
|
return (
|
|
50
|
-
<NavPanel.Root
|
|
56
|
+
<NavPanel.Root
|
|
57
|
+
className={classNames(s.productPanel, {
|
|
58
|
+
[s.hasSide]: sidePanel,
|
|
59
|
+
[s.noSide]: !sidePanel,
|
|
60
|
+
[s.topPromo]: isPromoOnTop,
|
|
61
|
+
})}
|
|
62
|
+
hasSidePanel={Boolean(sidePanel)}
|
|
63
|
+
>
|
|
51
64
|
<div className={s.mainPanel}>
|
|
52
|
-
|
|
65
|
+
{promo && isPromoOnTop ? (
|
|
66
|
+
<Promo
|
|
67
|
+
{...promo}
|
|
68
|
+
hasSidePanel={Boolean(sidePanel)}
|
|
69
|
+
isPromoOnTop={isPromoOnTop}
|
|
70
|
+
/>
|
|
71
|
+
) : null}
|
|
72
|
+
<NavPanel.Column hasSidePanel={Boolean(sidePanel)}>
|
|
53
73
|
<ul className={s.productCategories}>
|
|
54
74
|
{productCategories.map(({ title, products }) => {
|
|
55
75
|
return (
|
|
56
76
|
<li key={title} className={s.productCategory}>
|
|
57
|
-
<
|
|
77
|
+
<Text.Body className={s.eyebrow}>{title}</Text.Body>
|
|
58
78
|
<ul className={s.productList}>
|
|
59
79
|
{products.map((product) => {
|
|
60
80
|
return (
|
|
61
81
|
<li key={product.url}>
|
|
62
|
-
<NavProduct {...product} />
|
|
82
|
+
<NavProduct locale={locale} {...product} />
|
|
63
83
|
</li>
|
|
64
84
|
)
|
|
65
85
|
})}
|
|
@@ -69,14 +89,16 @@ const ProductPanel = ({
|
|
|
69
89
|
})}
|
|
70
90
|
</ul>
|
|
71
91
|
</NavPanel.Column>
|
|
72
|
-
{promo
|
|
92
|
+
{promo && !isPromoOnTop ? (
|
|
93
|
+
<Promo {...promo} hasSidePanel={Boolean(sidePanel)} />
|
|
94
|
+
) : null}
|
|
73
95
|
</div>
|
|
74
96
|
|
|
75
97
|
{sidePanel ? (
|
|
76
98
|
<NavPanel.Column className={s.sidePanel}>
|
|
77
|
-
<
|
|
99
|
+
<Text.Body size="200" weight="semibold">
|
|
78
100
|
{sidePanel.label}
|
|
79
|
-
</
|
|
101
|
+
</Text.Body>
|
|
80
102
|
|
|
81
103
|
{/* ! TODO Replace the below list with the <LinkList /> component,
|
|
82
104
|
That component will require a refactor to support greater customization
|
|
@@ -87,7 +109,12 @@ const ProductPanel = ({
|
|
|
87
109
|
{sidePanel.navItems.map(({ icon, title, description, url }) => {
|
|
88
110
|
return (
|
|
89
111
|
<li key={title}>
|
|
90
|
-
<Link
|
|
112
|
+
<Link
|
|
113
|
+
aria-label={`${title} - ${description}`}
|
|
114
|
+
{...getLocalizedLinkProps(url, locale)}
|
|
115
|
+
locale={locale ? locale : undefined}
|
|
116
|
+
className={classNames(s.sidePanelItem, s.focusIndicator)}
|
|
117
|
+
>
|
|
91
118
|
<div className={s.iconBackground}>
|
|
92
119
|
<FlightIcon
|
|
93
120
|
size={16}
|
|
@@ -96,9 +123,9 @@ const ProductPanel = ({
|
|
|
96
123
|
/>
|
|
97
124
|
</div>
|
|
98
125
|
<div className={s.sidePanelItemContent}>
|
|
99
|
-
<
|
|
126
|
+
<Text.Body size="200" weight="semibold" tag="span">
|
|
100
127
|
{title}
|
|
101
|
-
</
|
|
128
|
+
</Text.Body>
|
|
102
129
|
<span className={s.sidePanelItemDesc}>{description}</span>
|
|
103
130
|
</div>
|
|
104
131
|
</Link>
|
|
@@ -113,16 +140,19 @@ const ProductPanel = ({
|
|
|
113
140
|
}
|
|
114
141
|
|
|
115
142
|
export interface NavProductProps {
|
|
143
|
+
locale?: string
|
|
116
144
|
url: string
|
|
117
145
|
product: Products | string
|
|
118
146
|
description: string
|
|
119
147
|
}
|
|
120
148
|
|
|
121
|
-
function NavProduct({ url, product, description }: NavProductProps) {
|
|
149
|
+
function NavProduct({ locale, url, product, description }: NavProductProps) {
|
|
122
150
|
return (
|
|
123
151
|
<NavigationMenu.Link asChild>
|
|
124
152
|
<Link
|
|
125
|
-
|
|
153
|
+
aria-label={`${product} - ${description}`}
|
|
154
|
+
{...getLocalizedLinkProps(url, locale)}
|
|
155
|
+
locale={locale ? locale : undefined}
|
|
126
156
|
onClickCapture={() => {
|
|
127
157
|
trackNavClickEvent(product, url, 'products')
|
|
128
158
|
}}
|
|
@@ -1,11 +1,24 @@
|
|
|
1
|
+
@custom-media --dev-dot-viewport (min-width: 924px);
|
|
2
|
+
|
|
1
3
|
.productPanel {
|
|
2
4
|
height: 100%;
|
|
3
5
|
|
|
4
6
|
@media (--large) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
&.noSide {
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-rows: 1fr;
|
|
10
|
+
grid-template-columns: max-content max-content;
|
|
11
|
+
padding: 0;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media (--dev-dot-viewport) {
|
|
16
|
+
&.hasSide {
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-rows: 1fr;
|
|
19
|
+
grid-template-columns: max-content max-content;
|
|
20
|
+
padding: 0;
|
|
21
|
+
}
|
|
9
22
|
}
|
|
10
23
|
}
|
|
11
24
|
|
|
@@ -13,10 +26,22 @@
|
|
|
13
26
|
list-style: none;
|
|
14
27
|
padding: 0;
|
|
15
28
|
display: grid;
|
|
16
|
-
margin: var(--
|
|
29
|
+
margin: var(--mds-spacing-07) 0 0;
|
|
30
|
+
|
|
31
|
+
@nest .topPromo & {
|
|
32
|
+
margin-bottom: var(--mds-spacing-07);
|
|
33
|
+
}
|
|
17
34
|
|
|
18
35
|
@media (--large) {
|
|
19
|
-
|
|
36
|
+
@nest .noSide & {
|
|
37
|
+
margin: 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media (--dev-dot-viewport) {
|
|
42
|
+
@nest .hasSide & {
|
|
43
|
+
margin: 0;
|
|
44
|
+
}
|
|
20
45
|
}
|
|
21
46
|
}
|
|
22
47
|
|
|
@@ -27,18 +52,28 @@
|
|
|
27
52
|
|
|
28
53
|
&:first-child {
|
|
29
54
|
border-bottom: 1px solid var(--token-color-border-primary);
|
|
30
|
-
margin-bottom: var(--
|
|
31
|
-
padding-bottom: var(--
|
|
55
|
+
margin-bottom: var(--mds-spacing-05);
|
|
56
|
+
padding-bottom: var(--mds-spacing-05);
|
|
32
57
|
}
|
|
33
58
|
}
|
|
34
59
|
|
|
35
60
|
.eyebrow {
|
|
36
|
-
padding-bottom: var(--
|
|
61
|
+
padding-bottom: var(--mds-spacing-04);
|
|
37
62
|
color: var(--token-color-foreground-strong);
|
|
38
|
-
font-weight: var(--font-weight-
|
|
63
|
+
font-weight: var(--mds-typography-font-weight-semibold);
|
|
39
64
|
|
|
40
65
|
@media (--large) {
|
|
41
|
-
|
|
66
|
+
@nest .noSide & {
|
|
67
|
+
padding-bottom: 0;
|
|
68
|
+
padding-left: var(--mds-spacing-06);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@media (--dev-dot-viewport) {
|
|
73
|
+
@nest .hasSide & {
|
|
74
|
+
padding-bottom: 0;
|
|
75
|
+
padding-left: var(--mds-spacing-06);
|
|
76
|
+
}
|
|
42
77
|
}
|
|
43
78
|
}
|
|
44
79
|
|
|
@@ -50,10 +85,31 @@
|
|
|
50
85
|
padding: 0;
|
|
51
86
|
|
|
52
87
|
@media (--large) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
88
|
+
@nest .noSide & {
|
|
89
|
+
padding: var(--mds-spacing-06) var(--mds-spacing-05)
|
|
90
|
+
var(--mds-spacing-04);
|
|
91
|
+
grid-auto-flow: row;
|
|
92
|
+
grid-template-columns: repeat(2, 300px);
|
|
93
|
+
grid-template-rows: repeat(2, max-content);
|
|
94
|
+
gap: 0;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media (--dev-dot-viewport) {
|
|
99
|
+
@nest .hasSide & {
|
|
100
|
+
padding: var(--mds-spacing-06) var(--mds-spacing-05)
|
|
101
|
+
var(--mds-spacing-04);
|
|
102
|
+
grid-auto-flow: row;
|
|
103
|
+
grid-template-columns: repeat(2, 300px);
|
|
104
|
+
grid-template-rows: repeat(2, max-content);
|
|
105
|
+
gap: 0;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
& li:last-child {
|
|
110
|
+
& .productWrapper {
|
|
111
|
+
margin-bottom: 0;
|
|
112
|
+
}
|
|
57
113
|
}
|
|
58
114
|
}
|
|
59
115
|
|
|
@@ -61,16 +117,30 @@
|
|
|
61
117
|
|
|
62
118
|
.productWrapper {
|
|
63
119
|
display: flex;
|
|
64
|
-
margin-bottom: var(--
|
|
65
|
-
gap: var(--
|
|
120
|
+
margin-bottom: var(--mds-spacing-05);
|
|
121
|
+
gap: var(--mds-spacing-05);
|
|
66
122
|
|
|
67
123
|
@media (--large) {
|
|
68
|
-
|
|
69
|
-
|
|
124
|
+
@nest .noSide & {
|
|
125
|
+
padding: var(--mds-spacing-03) var(--mds-spacing-05);
|
|
126
|
+
margin-bottom: 0;
|
|
127
|
+
|
|
128
|
+
&:hover {
|
|
129
|
+
background-color: var(--token-color-surface-interactive-hover);
|
|
130
|
+
border-radius: var(--mds-spacing-01);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
70
134
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
135
|
+
@media (--dev-dot-viewport) {
|
|
136
|
+
@nest .hasSide & {
|
|
137
|
+
padding: var(--mds-spacing-03) var(--mds-spacing-05);
|
|
138
|
+
margin-bottom: 0;
|
|
139
|
+
|
|
140
|
+
&:hover {
|
|
141
|
+
background-color: var(--token-color-surface-interactive-hover);
|
|
142
|
+
border-radius: var(--mds-spacing-01);
|
|
143
|
+
}
|
|
74
144
|
}
|
|
75
145
|
}
|
|
76
146
|
}
|
|
@@ -81,10 +151,23 @@
|
|
|
81
151
|
& svg {
|
|
82
152
|
height: 42px;
|
|
83
153
|
width: 42px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@nest .noSide & {
|
|
157
|
+
& svg {
|
|
158
|
+
@media (--large) {
|
|
159
|
+
height: var(--mds-spacing-08);
|
|
160
|
+
width: var(--mds-spacing-08);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
84
164
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
165
|
+
@nest .hasSide & {
|
|
166
|
+
& svg {
|
|
167
|
+
@media (--dev-dot-viewport) {
|
|
168
|
+
height: var(--mds-spacing-08);
|
|
169
|
+
width: var(--mds-spacing-08);
|
|
170
|
+
}
|
|
88
171
|
}
|
|
89
172
|
}
|
|
90
173
|
}
|
|
@@ -117,8 +200,17 @@
|
|
|
117
200
|
flex-direction: column;
|
|
118
201
|
|
|
119
202
|
@media (--large) {
|
|
120
|
-
|
|
121
|
-
var(--
|
|
203
|
+
@nest .noSide & {
|
|
204
|
+
padding: var(--mds-spacing-07) 0 var(--mds-spacing-09)
|
|
205
|
+
var(--mds-spacing-04);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@media (--dev-dot-viewport) {
|
|
210
|
+
@nest .hasSide & {
|
|
211
|
+
padding: var(--mds-spacing-07) 0 var(--mds-spacing-09)
|
|
212
|
+
var(--mds-spacing-04);
|
|
213
|
+
}
|
|
122
214
|
}
|
|
123
215
|
}
|
|
124
216
|
|
|
@@ -127,10 +219,10 @@
|
|
|
127
219
|
background: var(--token-color-surface-faint);
|
|
128
220
|
display: flex;
|
|
129
221
|
flex-direction: column;
|
|
130
|
-
gap: var(--
|
|
222
|
+
gap: var(--mds-spacing-05);
|
|
131
223
|
margin: 0;
|
|
132
|
-
padding: var(--
|
|
133
|
-
var(--
|
|
224
|
+
padding: var(--mds-spacing-07) var(--mds-spacing-04)
|
|
225
|
+
var(--mds-spacing-09) var(--mds-spacing-07);
|
|
134
226
|
}
|
|
135
227
|
|
|
136
228
|
.sidePanelItems {
|
|
@@ -139,26 +231,24 @@
|
|
|
139
231
|
padding: 0;
|
|
140
232
|
display: grid;
|
|
141
233
|
grid-template-columns: 1fr;
|
|
142
|
-
gap: var(--
|
|
234
|
+
gap: var(--mds-spacing-07);
|
|
143
235
|
|
|
144
|
-
@media (--
|
|
145
|
-
gap: var(--
|
|
236
|
+
@media (--dev-dot-viewport) {
|
|
237
|
+
gap: var(--mds-spacing-05);
|
|
146
238
|
}
|
|
147
239
|
}
|
|
148
240
|
|
|
149
241
|
/* Lifted from .productWrapper */
|
|
150
242
|
.sidePanelItem {
|
|
151
243
|
display: flex;
|
|
152
|
-
|
|
153
|
-
gap: var(--hdsplus-spacing-05);
|
|
244
|
+
gap: var(--mds-spacing-05);
|
|
154
245
|
|
|
155
|
-
@media (--
|
|
156
|
-
padding: var(--
|
|
157
|
-
margin-bottom: 0;
|
|
246
|
+
@media (--dev-dot-viewport) {
|
|
247
|
+
padding: var(--mds-spacing-03) var(--mds-spacing-05);
|
|
158
248
|
|
|
159
249
|
&:hover {
|
|
160
250
|
background-color: var(--token-color-surface-interactive-hover);
|
|
161
|
-
border-radius: var(--
|
|
251
|
+
border-radius: var(--mds-spacing-01);
|
|
162
252
|
}
|
|
163
253
|
}
|
|
164
254
|
}
|
|
@@ -167,8 +257,8 @@
|
|
|
167
257
|
packages/react-components/src/components/nav-panel/components/link-list/style.module.css */
|
|
168
258
|
.iconBackground {
|
|
169
259
|
background: var(--token-color-foreground-high-contrast);
|
|
170
|
-
height: var(--
|
|
171
|
-
width: var(--
|
|
260
|
+
height: var(--mds-spacing-08);
|
|
261
|
+
width: var(--mds-spacing-08);
|
|
172
262
|
display: flex;
|
|
173
263
|
align-items: center;
|
|
174
264
|
justify-content: center;
|
|
@@ -194,9 +284,28 @@ packages/react-components/src/components/nav-panel/components/link-list/style.mo
|
|
|
194
284
|
|
|
195
285
|
/* Branding exception classnames */
|
|
196
286
|
|
|
287
|
+
/* Allows switching to a dark-mode-specific color for Terraform */
|
|
288
|
+
.terraform {
|
|
289
|
+
& use {
|
|
290
|
+
fill: var(--token-color-terraform-brand);
|
|
291
|
+
|
|
292
|
+
@nest [data-theme='dark'] & {
|
|
293
|
+
fill: var(--token-color-terraform-foreground);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
& path {
|
|
298
|
+
fill: inherit;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/* Styles for HCP Vault mimic the spec for `product-square` icons,
|
|
303
|
+
while allowing the symbol inside the icon border to change color
|
|
304
|
+
based on the site's theme
|
|
305
|
+
*/
|
|
197
306
|
.hcpVaultSecrets,
|
|
198
307
|
.hcpVaultRadar {
|
|
199
|
-
padding: var(--
|
|
308
|
+
padding: var(--mds-spacing-01);
|
|
200
309
|
border: 2px solid var(--token-color-vault-brand);
|
|
201
310
|
border-radius: 3px;
|
|
202
311
|
|
|
@@ -12,12 +12,14 @@ interface StandardPanelProps {
|
|
|
12
12
|
navData: NavItem[]
|
|
13
13
|
promo?: PromoProps
|
|
14
14
|
sectionName?: string
|
|
15
|
+
locale?: any
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const StandardPanel = ({
|
|
18
19
|
navData,
|
|
19
20
|
promo,
|
|
20
21
|
sectionName = '',
|
|
22
|
+
locale,
|
|
21
23
|
}: StandardPanelProps) => {
|
|
22
24
|
return (
|
|
23
25
|
<NavPanel.Root>
|
|
@@ -26,6 +28,7 @@ const StandardPanel = ({
|
|
|
26
28
|
return (
|
|
27
29
|
<NavPanel.Column key={stableIdx}>
|
|
28
30
|
<LinkList
|
|
31
|
+
locale={locale}
|
|
29
32
|
links={navItems}
|
|
30
33
|
linkClickHandler={(text, href) => {
|
|
31
34
|
trackNavClickEvent(text, href, sectionName)
|