@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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) HashiCorp, Inc.
|
|
3
3
|
* SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
*/
|
|
5
|
+
'use client'
|
|
5
6
|
|
|
6
7
|
import { useState } from 'react'
|
|
7
8
|
import Badge from '@hashicorp/react-badge'
|
|
@@ -10,7 +11,7 @@ import ExpandableArrow from '@hashicorp/react-expandable-arrow'
|
|
|
10
11
|
import Intro from '../intro'
|
|
11
12
|
import Link from 'next/link'
|
|
12
13
|
import type { NextStepsProps } from './types'
|
|
13
|
-
import
|
|
14
|
+
import { HDSPlusStandaloneLink } from '@hashicorp/react-mds/src/hds-plus/standalone-link'
|
|
14
15
|
import { IconArrowRight16 } from '@hashicorp/flight-icons/svg-react/arrow-right-16'
|
|
15
16
|
import useProductMeta from '@hashicorp/platform-product-meta'
|
|
16
17
|
import s from './style.module.css'
|
|
@@ -69,7 +70,7 @@ export default function NextSteps({
|
|
|
69
70
|
{cta ? (
|
|
70
71
|
<div className={s.cta}>
|
|
71
72
|
<p className={s.ctaCopy}>{cta.copy}</p>
|
|
72
|
-
<
|
|
73
|
+
<HDSPlusStandaloneLink
|
|
73
74
|
href={cta.href}
|
|
74
75
|
text={cta.ctaText}
|
|
75
76
|
icon={
|
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
.nextSteps {
|
|
7
|
-
--padding-y: var(--
|
|
7
|
+
--padding-y: var(--mds-spacing-12);
|
|
8
8
|
|
|
9
9
|
position: relative;
|
|
10
10
|
padding-top: var(--padding-y);
|
|
11
11
|
padding-bottom: var(--padding-y);
|
|
12
12
|
|
|
13
13
|
@media (--medium-up) {
|
|
14
|
-
--padding-y: var(--
|
|
14
|
+
--padding-y: var(--mds-spacing-14);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.container {
|
|
19
19
|
composes: g-grid-container from global;
|
|
20
20
|
composes: g-grid from global;
|
|
21
|
-
row-gap: var(--
|
|
21
|
+
row-gap: var(--mds-spacing-08);
|
|
22
22
|
align-items: flex-start;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.heading {
|
|
34
|
-
--color: var(--
|
|
34
|
+
--color: var(--wpl-neutral-900);
|
|
35
35
|
|
|
36
36
|
composes: g-type-display-2 from global;
|
|
37
37
|
margin: 0;
|
|
38
38
|
color: var(--color);
|
|
39
39
|
|
|
40
40
|
@nest .dark & {
|
|
41
|
-
--color: var(--
|
|
41
|
+
--color: var(--wpl-neutral-0);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
--color: var(--gray-3);
|
|
47
47
|
|
|
48
48
|
composes: g-type-body-large from global;
|
|
49
|
-
margin: var(--
|
|
49
|
+
margin: var(--mds-spacing-07) 0 0;
|
|
50
50
|
color: var(--color);
|
|
51
51
|
|
|
52
52
|
@nest .dark & {
|
|
@@ -55,19 +55,19 @@
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.actions {
|
|
58
|
-
margin-top: var(--
|
|
58
|
+
margin-top: var(--mds-spacing-08);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.stepsWrapper {
|
|
62
|
-
--grid-gap: var(--
|
|
62
|
+
--grid-gap: var(--mds-spacing-07);
|
|
63
63
|
|
|
64
64
|
display: flex;
|
|
65
65
|
flex-direction: column;
|
|
66
|
-
gap: var(--
|
|
66
|
+
gap: var(--mds-spacing-07);
|
|
67
67
|
grid-column: 1 / -1;
|
|
68
68
|
|
|
69
69
|
@media (--large) {
|
|
70
|
-
--grid-gap: var(--
|
|
70
|
+
--grid-gap: var(--mds-spacing-08);
|
|
71
71
|
|
|
72
72
|
grid-column: 6 / -1;
|
|
73
73
|
}
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
width: 100%;
|
|
113
113
|
min-height: 208px;
|
|
114
114
|
flex-direction: column;
|
|
115
|
-
padding: var(--
|
|
115
|
+
padding: var(--mds-spacing-08);
|
|
116
116
|
background-color: var(--background-color);
|
|
117
117
|
color: var(--color);
|
|
118
118
|
border-radius: var(--border-radius);
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
|
|
160
160
|
@nest .dark & {
|
|
161
161
|
--background-color: var(--wpl-neutral-700);
|
|
162
|
-
--color: var(--
|
|
162
|
+
--color: var(--wpl-neutral-0);
|
|
163
163
|
|
|
164
164
|
&:hover {
|
|
165
165
|
--background-color: var(--wpl-neutral-600);
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
|
|
203
203
|
.tileBadge {
|
|
204
204
|
display: inline-flex;
|
|
205
|
-
margin: 0 0 0 var(--
|
|
205
|
+
margin: 0 0 0 var(--mds-spacing-04);
|
|
206
206
|
vertical-align: middle;
|
|
207
207
|
}
|
|
208
208
|
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
|
|
234
234
|
.tileCta {
|
|
235
235
|
margin-top: auto;
|
|
236
|
-
padding-top: var(--
|
|
236
|
+
padding-top: var(--mds-spacing-07);
|
|
237
237
|
display: inline-flex;
|
|
238
238
|
align-items: center;
|
|
239
239
|
gap: 8px;
|
|
@@ -243,8 +243,8 @@
|
|
|
243
243
|
.tileCtaLabel {
|
|
244
244
|
font-size: 0.875rem;
|
|
245
245
|
line-height: 1.143;
|
|
246
|
-
font-weight: var(--
|
|
247
|
-
font-family: var(--
|
|
246
|
+
font-weight: var(--mds-typography-font-weight-medium);
|
|
247
|
+
font-family: var(--mds-typography-font-stack-text);
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
.tileCtaIcon {
|
|
@@ -255,8 +255,8 @@
|
|
|
255
255
|
grid-column: 1/ -1;
|
|
256
256
|
display: flex;
|
|
257
257
|
flex-wrap: wrap;
|
|
258
|
-
column-gap: var(--
|
|
259
|
-
row-gap: var(--
|
|
258
|
+
column-gap: var(--mds-spacing-05);
|
|
259
|
+
row-gap: var(--mds-spacing-03);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
.ctaCopy {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { Products } from '@hashicorp/platform-product-meta'
|
|
7
|
-
import Badge from '@hashicorp/react-
|
|
7
|
+
import { Badge } from '@hashicorp/react-mds/src/components/badge'
|
|
8
8
|
import { IconDot16 } from '@hashicorp/flight-icons/svg-react/dot-16'
|
|
9
9
|
import s from './style.module.css'
|
|
10
10
|
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
.text {
|
|
48
48
|
display: inline-block;
|
|
49
49
|
position: relative;
|
|
50
|
-
font-family: var(--font-
|
|
51
|
-
font-weight: var(--font-weight-bold);
|
|
50
|
+
font-family: var(--mds-typography-font-stack-text);
|
|
51
|
+
font-weight: var(--mds-typography-font-weight-bold);
|
|
52
52
|
font-size: 14px;
|
|
53
53
|
letter-spacing: 0.0125em;
|
|
54
54
|
text-transform: capitalize;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
.eyebrow {
|
|
11
11
|
composes: g-type-label-strong from global;
|
|
12
|
-
margin: 0 0 var(--
|
|
12
|
+
margin: 0 0 var(--mds-spacing-05) 0;
|
|
13
13
|
color: var(--token-color-foreground-faint);
|
|
14
14
|
|
|
15
15
|
&.dark {
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
flex-wrap: wrap;
|
|
24
24
|
padding: 0;
|
|
25
25
|
list-style-type: none;
|
|
26
|
-
row-gap: var(--
|
|
27
|
-
column-gap: var(--
|
|
26
|
+
row-gap: var(--mds-spacing-03);
|
|
27
|
+
column-gap: var(--mds-spacing-05);
|
|
28
28
|
|
|
29
29
|
&.isSmallerGap {
|
|
30
|
-
column-gap: var(--
|
|
30
|
+
column-gap: var(--mds-spacing-03);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
|
|
38
38
|
&[href] {
|
|
39
39
|
min-height: 40px;
|
|
40
|
-
padding: var(--
|
|
41
|
-
border-radius: calc(var(--
|
|
40
|
+
padding: var(--mds-spacing-03) var(--mds-spacing-04);
|
|
41
|
+
border-radius: calc(var(--mds-spacing-03) / 2);
|
|
42
42
|
border: 1px solid var(--token-color-border-primary);
|
|
43
43
|
transition: background-color 0.2s, border 0.2s;
|
|
44
44
|
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.productName {
|
|
79
|
-
composes:
|
|
79
|
+
composes: token-typography-body-100 mds-typography-font-weight-medium from global;
|
|
80
80
|
font-size: 14px;
|
|
81
81
|
text-transform: capitalize;
|
|
82
82
|
color: var(--token-color-foreground-primary);
|
|
@@ -10,7 +10,7 @@ import type { RelatedContentProps } from './types'
|
|
|
10
10
|
import s from './style.module.css'
|
|
11
11
|
|
|
12
12
|
const RelatedContent = ({
|
|
13
|
-
appearance = '
|
|
13
|
+
appearance = 'transparent',
|
|
14
14
|
headline,
|
|
15
15
|
description,
|
|
16
16
|
cards,
|
|
@@ -18,37 +18,36 @@ const RelatedContent = ({
|
|
|
18
18
|
}: RelatedContentProps) => {
|
|
19
19
|
return (
|
|
20
20
|
<div
|
|
21
|
-
className={classNames([
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{ ['hdsplus-dark-mode']: appearance === 'dark' },
|
|
25
|
-
])}
|
|
21
|
+
className={classNames(s.root, s[appearance], {
|
|
22
|
+
['mds-dark-mode']: appearance === 'dark',
|
|
23
|
+
})}
|
|
26
24
|
>
|
|
27
|
-
<div className={s.
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
<p className={
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
<div className={s.wrapper}>
|
|
26
|
+
<div className={s.textStack}>
|
|
27
|
+
<h2 className={s.headline}>{headline}</h2>
|
|
28
|
+
{description ? <p className={s.description}>{description}</p> : null}
|
|
29
|
+
</div>
|
|
30
|
+
<div className={s.cards} data-testid="wpl-cards-container">
|
|
31
|
+
{cards.map((card, i) => (
|
|
32
|
+
<Card
|
|
33
|
+
key={i}
|
|
34
|
+
link={card.link}
|
|
35
|
+
thumbnail={card.thumbnail}
|
|
36
|
+
meta={card.meta}
|
|
37
|
+
heading={card.heading}
|
|
38
|
+
description={card.description}
|
|
39
|
+
/>
|
|
40
|
+
))}
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
{cta ? (
|
|
44
|
+
<div className={s.cta} data-testid="wpl-cta-container">
|
|
45
|
+
<Link href={cta.href} legacyBehavior>
|
|
46
|
+
{cta.text}
|
|
47
|
+
</Link>
|
|
48
|
+
</div>
|
|
33
49
|
) : null}
|
|
34
50
|
</div>
|
|
35
|
-
<div className={s.cards} data-testid="wpl-cards-container">
|
|
36
|
-
{cards.map((card, i) => (
|
|
37
|
-
<Card
|
|
38
|
-
key={i}
|
|
39
|
-
link={card.link}
|
|
40
|
-
thumbnail={card.thumbnail}
|
|
41
|
-
meta={card.meta}
|
|
42
|
-
heading={card.heading}
|
|
43
|
-
description={card.description}
|
|
44
|
-
/>
|
|
45
|
-
))}
|
|
46
|
-
</div>
|
|
47
|
-
<div className={s.cta} data-testid="wpl-cta-container">
|
|
48
|
-
<Link href={cta.href} legacyBehavior>
|
|
49
|
-
{cta.text}
|
|
50
|
-
</Link>
|
|
51
|
-
</div>
|
|
52
51
|
</div>
|
|
53
52
|
)
|
|
54
53
|
}
|
|
@@ -3,87 +3,85 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
.root {
|
|
7
|
+
width: 100%;
|
|
8
|
+
background-color: var(--token-color-surface-primary);
|
|
9
|
+
|
|
10
|
+
&.transparent {
|
|
11
|
+
background-color: transparent;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
6
15
|
.wrapper {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
composes: g-grid from global;
|
|
17
|
+
composes: g-grid-container from global;
|
|
18
|
+
padding-top: var(--mds-spacing-12);
|
|
19
|
+
padding-bottom: var(--mds-spacing-12);
|
|
11
20
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
&.dark {
|
|
17
|
-
background-color: var(--wpl-neutral-900);
|
|
18
|
-
}
|
|
21
|
+
@media (--large) {
|
|
22
|
+
padding-top: 88px;
|
|
23
|
+
padding-bottom: 88px;
|
|
24
|
+
}
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
.textStack {
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
grid-column: 1 / -1;
|
|
29
|
+
margin-bottom: var(--mds-spacing-07);
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
@media (--medium) {
|
|
32
|
+
grid-column: 1 / span 7;
|
|
33
|
+
margin-bottom: var(--mds-spacing-08);
|
|
34
|
+
}
|
|
29
35
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
@media (--large) {
|
|
37
|
+
grid-column: 1 / span 6;
|
|
38
|
+
margin-bottom: var(--mds-spacing-08);
|
|
39
|
+
}
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
.headline {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
&.dark {
|
|
42
|
-
color: white;
|
|
43
|
-
}
|
|
43
|
+
composes: g-type-display-3 from global;
|
|
44
|
+
color: var(--token-color-foreground-primary);
|
|
45
|
+
margin: 0 0 var(--mds-spacing-05) 0;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
.description {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
&.dark {
|
|
52
|
-
color: white;
|
|
53
|
-
}
|
|
49
|
+
composes: g-type-body from global;
|
|
50
|
+
color: var(--token-color-foreground-faint);
|
|
51
|
+
margin: 0;
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
.cards {
|
|
57
|
-
|
|
55
|
+
--columns: 1;
|
|
58
56
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
grid-column: 1 / -1;
|
|
58
|
+
display: grid;
|
|
59
|
+
grid-gap: var(--mds-spacing-08);
|
|
60
|
+
grid-template-columns: repeat(var(--columns), 1fr);
|
|
61
|
+
margin-bottom: var(--mds-spacing-08);
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
@media (--medium) {
|
|
64
|
+
--columns: 2;
|
|
65
|
+
}
|
|
66
|
+
@media (--large) {
|
|
67
|
+
--columns: 4;
|
|
68
|
+
}
|
|
71
69
|
}
|
|
72
70
|
|
|
73
71
|
.cta {
|
|
74
|
-
|
|
72
|
+
grid-column: 1 / -1;
|
|
75
73
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
74
|
+
& a {
|
|
75
|
+
font-weight: 500;
|
|
76
|
+
font-size: 17px;
|
|
77
|
+
line-height: 20px;
|
|
78
|
+
letter-spacing: 0.0125em;
|
|
79
|
+
text-decoration: underline;
|
|
80
|
+
text-underline-offset: 3px;
|
|
81
|
+
display: inline;
|
|
84
82
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
@nest .dark & {
|
|
84
|
+
color: var(--token-color-foreground-faint);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
89
87
|
}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
import type { CardProps } from '../card/types'
|
|
7
7
|
|
|
8
8
|
export interface RelatedContentProps {
|
|
9
|
-
appearance?: 'light' | 'dark'
|
|
9
|
+
appearance?: 'light' | 'dark' | 'transparent'
|
|
10
10
|
headline: string
|
|
11
11
|
description?: string
|
|
12
12
|
cards: Array<RelatedContentCardProps>
|
|
13
|
-
cta
|
|
13
|
+
cta?: RelatedContentCtaProps
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
interface RelatedContentCtaProps {
|
|
@@ -17,7 +17,6 @@ import CtaLinks, { type CtaLinkProps } from './partials/CtaLinks'
|
|
|
17
17
|
import traverse, { isObject } from './helpers/traverse'
|
|
18
18
|
import { areBasePathsMatching } from './helpers/areBasePathsMatching'
|
|
19
19
|
import * as NavigationMenu from '@radix-ui/react-navigation-menu'
|
|
20
|
-
import themeStyles from './theme.module.css'
|
|
21
20
|
import s from './style.module.css'
|
|
22
21
|
|
|
23
22
|
const productAllowList = {
|
|
@@ -47,6 +46,7 @@ type SubnavDropdown = {
|
|
|
47
46
|
type MenuItem = SubnavLink | SubnavDropdown | 'divider'
|
|
48
47
|
|
|
49
48
|
export interface SubnavInnerProps {
|
|
49
|
+
locale?: string
|
|
50
50
|
hasOverflow?: boolean
|
|
51
51
|
titleLink: { text: string; url: string }
|
|
52
52
|
product?: Products
|
|
@@ -62,6 +62,7 @@ export interface SubnavInnerProps {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
function SubnavInner({
|
|
65
|
+
locale,
|
|
65
66
|
hasOverflow,
|
|
66
67
|
titleLink,
|
|
67
68
|
product,
|
|
@@ -110,17 +111,20 @@ function SubnavInner({
|
|
|
110
111
|
>
|
|
111
112
|
<NavigationMenu.Link asChild>
|
|
112
113
|
<TitleLink
|
|
114
|
+
locale={locale}
|
|
113
115
|
text={titleLink.text}
|
|
114
116
|
url={titleLink.url}
|
|
115
117
|
product={product}
|
|
116
118
|
theme={theme}
|
|
117
119
|
/>
|
|
118
120
|
</NavigationMenu.Link>
|
|
121
|
+
|
|
119
122
|
{!hasOverflow && (
|
|
120
123
|
<div className={s.subNavRight}>
|
|
121
124
|
<MenuItemsDefault
|
|
122
125
|
menuItems={menuItemsWithActive}
|
|
123
126
|
activatePanel={activatePanel}
|
|
127
|
+
locale={locale}
|
|
124
128
|
/>
|
|
125
129
|
{ctaLinks?.length > 0 && (
|
|
126
130
|
<CtaLinks
|
|
@@ -165,6 +169,10 @@ function Subnav({ className, theme = 'light', ...restProps }: SubnavProps) {
|
|
|
165
169
|
setActivePanel(panel)
|
|
166
170
|
}
|
|
167
171
|
|
|
172
|
+
const ariaLabel = restProps?.titleLink?.text
|
|
173
|
+
? `${restProps.titleLink.text} pages`
|
|
174
|
+
: 'Subnav pages'
|
|
175
|
+
|
|
168
176
|
return (
|
|
169
177
|
<>
|
|
170
178
|
{/**
|
|
@@ -175,11 +183,12 @@ function Subnav({ className, theme = 'light', ...restProps }: SubnavProps) {
|
|
|
175
183
|
<style>{`:root{--subnav-height:${height}px}`}</style>
|
|
176
184
|
<NavigationMenu.Root
|
|
177
185
|
ref={wrapperRef}
|
|
178
|
-
className={classNames(s.root,
|
|
186
|
+
className={classNames(s.root, className, {
|
|
179
187
|
[s.isSticky]: isSticky,
|
|
180
188
|
[s.hasOverflow]: hasOverflow,
|
|
189
|
+
'mds-dark-mode': theme === 'dark',
|
|
181
190
|
})}
|
|
182
|
-
aria-label={
|
|
191
|
+
aria-label={ariaLabel}
|
|
183
192
|
onValueChange={activatePanel}
|
|
184
193
|
value={activePanel}
|
|
185
194
|
delayDuration={0}
|
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
/* Note: consumes from theme.module.css, as marked */
|
|
7
|
-
|
|
8
6
|
.root {
|
|
9
|
-
--local-scrim-
|
|
10
|
-
--local-divider-color: var(--border-
|
|
7
|
+
--local-scrim-opacity: 0;
|
|
8
|
+
--local-divider-color: var(--token-color-border-primary);
|
|
11
9
|
|
|
12
10
|
position: relative;
|
|
13
|
-
color: var(--
|
|
14
|
-
border: 1px solid var(--local-divider-color);
|
|
11
|
+
color: var(--token-color-foreground-primary);
|
|
12
|
+
border: 1px solid var(--local-divider-color);
|
|
15
13
|
border-radius: 5px;
|
|
16
14
|
background: none;
|
|
17
15
|
transition: background 0.2s, border-color 0.2s;
|
|
@@ -27,17 +25,15 @@
|
|
|
27
25
|
right: -1px;
|
|
28
26
|
bottom: -1px;
|
|
29
27
|
border-radius: 5px;
|
|
30
|
-
transition:
|
|
28
|
+
transition: opacity 0.25s ease;
|
|
29
|
+
opacity: var(--local-scrim-opacity);
|
|
31
30
|
z-index: 0;
|
|
32
|
-
background-color: var(--
|
|
31
|
+
background-color: var(--token-color-foreground-primary);
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
&:hover,
|
|
36
35
|
&:active {
|
|
37
|
-
--local-
|
|
38
|
-
--local-scrim-color: var(
|
|
39
|
-
--gh-stars-scrim-color
|
|
40
|
-
); /* from theme.module.css */
|
|
36
|
+
--local-scrim-opacity: 0.12;
|
|
41
37
|
}
|
|
42
38
|
}
|
|
43
39
|
|
|
@@ -3,19 +3,20 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import {
|
|
7
|
+
HDSButton,
|
|
8
|
+
type HDSButtonProps,
|
|
9
|
+
} from '@hashicorp/react-mds/src/hds/components/button'
|
|
10
|
+
import FlightIcon from '@hashicorp/react-mds/src/hds/components/flight-icon'
|
|
10
11
|
import type { Products } from '@hashicorp/platform-product-meta'
|
|
11
|
-
import type { ToggleButtonProps } from '@hashicorp/react-
|
|
12
|
-
import * as Dropdown from '@hashicorp/react-
|
|
12
|
+
import type { ToggleButtonProps } from '@hashicorp/react-mds/src/hds/components/dropdown/toggle/button'
|
|
13
|
+
import * as Dropdown from '@hashicorp/react-mds/src/hds/components/dropdown'
|
|
13
14
|
import GithubStarsLink from './github-stars-link'
|
|
14
15
|
import classNames from 'classnames'
|
|
15
16
|
import * as NavigationMenu from '@radix-ui/react-navigation-menu'
|
|
16
17
|
import s from './style.module.css'
|
|
17
18
|
|
|
18
|
-
type CtaLink =
|
|
19
|
+
type CtaLink = HDSButtonProps & { href: string; __typename?: string }
|
|
19
20
|
|
|
20
21
|
type CtaDropdown = {
|
|
21
22
|
__typename?: string
|
|
@@ -83,7 +84,7 @@ function CtaLinks({
|
|
|
83
84
|
const isLastButton = stableIdx === links.length - 1
|
|
84
85
|
|
|
85
86
|
return (
|
|
86
|
-
<
|
|
87
|
+
<HDSButton
|
|
87
88
|
key={href}
|
|
88
89
|
text={text}
|
|
89
90
|
href={href}
|
|
@@ -8,31 +8,31 @@
|
|
|
8
8
|
justify-content: flex-end;
|
|
9
9
|
white-space: nowrap;
|
|
10
10
|
list-style: none;
|
|
11
|
-
padding: 0 0 0 var(--
|
|
11
|
+
padding: 0 0 0 var(--mds-spacing-05);
|
|
12
12
|
margin: 0;
|
|
13
|
-
gap: 0
|
|
13
|
+
gap: 0 var(--mds-spacing-04);
|
|
14
14
|
@media (--medium-up) {
|
|
15
15
|
gap: 0;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
& > * + * {
|
|
19
19
|
/* Spaces consecutive buttons horizontally on desktop */
|
|
20
|
-
margin-left:
|
|
20
|
+
margin-left: var(--mds-spacing-05);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
&.isInDropdown {
|
|
24
24
|
/* Allows consecutive buttons to wrap */
|
|
25
25
|
flex-wrap: wrap;
|
|
26
26
|
white-space: wrap;
|
|
27
|
-
padding-
|
|
27
|
+
padding-inline: var(--mds-spacing-04);
|
|
28
28
|
|
|
29
29
|
& > * {
|
|
30
30
|
/* Spaces consecutive buttons vertically */
|
|
31
31
|
margin-left: 0;
|
|
32
|
-
margin-top:
|
|
32
|
+
margin-top: var(--mds-spacing-05);
|
|
33
33
|
|
|
34
34
|
&:last-of-type {
|
|
35
|
-
margin-bottom: var(--
|
|
35
|
+
margin-bottom: var(--mds-spacing-04);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: MPL-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import FlightIcon from '@hashicorp/react-
|
|
6
|
+
import FlightIcon from '@hashicorp/react-mds/src/hds/components/flight-icon'
|
|
7
7
|
import NavItemText from '../nav-item-text'
|
|
8
8
|
import * as NavigationMenu from '@radix-ui/react-navigation-menu'
|
|
9
9
|
import s from './style.module.css'
|
|
@@ -27,7 +27,7 @@ function DropdownTrigger(props: DropdownTriggerProps) {
|
|
|
27
27
|
onMouseDown={(e) => e.preventDefault()}
|
|
28
28
|
>
|
|
29
29
|
<NavItemText isActive={isActive} text={text} />
|
|
30
|
-
<FlightIcon name="chevron-down"
|
|
30
|
+
<FlightIcon name="chevron-down" />
|
|
31
31
|
</NavigationMenu.Trigger>
|
|
32
32
|
)
|
|
33
33
|
}
|