@hashicorp/react-components 1.1.10 → 1.2.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/README.md +1 -1
- package/package.json +8 -13
- package/postcss.config.js +1 -1
- package/src/components/nav-panel/components/flight-icon/index.tsx +53 -0
- package/src/components/nav-panel/components/flight-icon/style.module.css +3 -0
- package/src/components/nav-panel/components/link/cloud-fill.svg +3 -0
- package/src/components/nav-panel/components/link/index.tsx +139 -0
- package/src/components/nav-panel/components/link/layers-fill.svg +5 -0
- package/src/components/nav-panel/components/link/shield-alert-fill.svg +3 -0
- package/src/components/nav-panel/components/link/style.module.css +64 -0
- package/src/components/nav-panel/components/link/zap-fill.svg +3 -0
- package/src/components/nav-panel/components/link-list/index.tsx +12 -64
- package/src/components/nav-panel/components/link-list/style.module.css +1 -50
- package/src/components/nav-panel/components/panel/column/style.module.css +2 -2
- package/src/components/nav-panel/components/panel/root/style.module.css +5 -5
- package/src/components/nav-panel/components/promo/index.tsx +35 -15
- package/src/components/nav-panel/components/promo/style.module.css +32 -28
- package/src/components/nav-panel/components/text/index.tsx +34 -0
- package/src/components/nav-panel/product-panel/index.tsx +71 -20
- package/src/components/nav-panel/product-panel/style.module.css +111 -53
- 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/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 +57 -2
- package/src/lib/parse-url/index.ts +97 -13
- package/src/lib/send-posthog-event/index.ts +22 -0
- package/src/lib/supported-locales/index.ts +10 -0
- package/src/lib/track-nav-click-event/index.ts +5 -5
- package/src/lib/v/index.ts +9 -4
- package/tsconfig.json +1 -2
- package/.eslintrc.js +0 -4
- package/.stylelintrc.js +0 -3
- package/src/components/actions/index.tsx +0 -107
- package/src/components/actions/style.module.css +0 -28
- package/src/components/actions/types.ts +0 -73
- package/src/components/call-to-action/index.tsx +0 -205
- package/src/components/call-to-action/styles/variant-centered.module.css +0 -93
- package/src/components/call-to-action/styles/variant-compact-grid.module.css +0 -88
- package/src/components/call-to-action/styles/variant-compact.module.css +0 -91
- package/src/components/call-to-action/styles/variant-links.module.css +0 -85
- package/src/components/card/README.md +0 -11
- package/src/components/card/card.tsx +0 -45
- package/src/components/card/index.test.tsx +0 -69
- package/src/components/card/index.tsx +0 -14
- package/src/components/card/newsroom-card/index.test.tsx +0 -39
- package/src/components/card/newsroom-card/index.tsx +0 -37
- package/src/components/card/newsroom-card/style.module.css +0 -12
- package/src/components/card/partner-card/index.test.tsx +0 -57
- package/src/components/card/partner-card/index.tsx +0 -69
- package/src/components/card/partner-card/style.module.css +0 -24
- package/src/components/card/person-card/index.test.tsx +0 -71
- package/src/components/card/person-card/index.tsx +0 -93
- package/src/components/card/person-card/style.module.css +0 -33
- package/src/components/card/primitives.tsx +0 -176
- package/src/components/card/promo-card/index.tsx +0 -51
- package/src/components/card/resource-card/index.test.tsx +0 -48
- package/src/components/card/resource-card/index.tsx +0 -37
- package/src/components/card/style.module.css +0 -145
- package/src/components/card/types.ts +0 -66
- package/src/components/card/unified-card/index.tsx +0 -64
- 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/intro/index.tsx +0 -82
- package/src/components/intro/style.module.css +0 -67
- package/src/components/intro/types.ts +0 -44
- package/src/components/marketo-form/CHANGELOG.md +0 -122
- package/src/components/marketo-form/README.md +0 -1
- package/src/components/marketo-form/contexts/FormMetadata.ts +0 -11
- package/src/components/marketo-form/docs.mdx +0 -197
- package/src/components/marketo-form/fixtures/index.ts +0 -185
- package/src/components/marketo-form/form/index.tsx +0 -369
- package/src/components/marketo-form/index.test.tsx +0 -320
- package/src/components/marketo-form/index.ts +0 -11
- package/src/components/marketo-form/package.original.json +0 -30
- package/src/components/marketo-form/partials/error-message/index.tsx +0 -12
- package/src/components/marketo-form/partials/error-message/style.module.css +0 -13
- package/src/components/marketo-form/partials/field/index.tsx +0 -90
- package/src/components/marketo-form/partials/field-wrapper/index.tsx +0 -26
- package/src/components/marketo-form/partials/fields/checkbox-field/index.tsx +0 -32
- package/src/components/marketo-form/partials/fields/email-field/index.tsx +0 -35
- package/src/components/marketo-form/partials/fields/form-page-url-field/index.tsx +0 -21
- package/src/components/marketo-form/partials/fields/hidden-field/index.tsx +0 -37
- package/src/components/marketo-form/partials/fields/htmltext-field/index.tsx +0 -21
- package/src/components/marketo-form/partials/fields/htmltext-field/style.module.css +0 -18
- package/src/components/marketo-form/partials/fields/name-field/index.tsx +0 -19
- package/src/components/marketo-form/partials/fields/name-field/style.module.css +0 -13
- package/src/components/marketo-form/partials/fields/radio-buttons-field/index.tsx +0 -48
- package/src/components/marketo-form/partials/fields/select-field/index.tsx +0 -39
- package/src/components/marketo-form/partials/fields/select-field/style.module.css +0 -5
- package/src/components/marketo-form/partials/fields/telephone-field/index.tsx +0 -30
- package/src/components/marketo-form/partials/fields/text-field/index.tsx +0 -30
- package/src/components/marketo-form/partials/fields/textarea-field/index.tsx +0 -29
- package/src/components/marketo-form/partials/label/index.tsx +0 -24
- package/src/components/marketo-form/partials/label/style.module.css +0 -12
- package/src/components/marketo-form/partials/visibility-rule/index.tsx +0 -84
- package/src/components/marketo-form/props.js +0 -66
- package/src/components/marketo-form/server/api-routes.ts +0 -109
- package/src/components/marketo-form/server/client.ts +0 -98
- package/src/components/marketo-form/server/index.ts +0 -8
- package/src/components/marketo-form/types.ts +0 -268
- package/src/components/marketo-form/utils.test.tsx +0 -103
- package/src/components/marketo-form/utils.ts +0 -449
- package/src/components/next-steps/index.tsx +0 -137
- package/src/components/next-steps/style.module.css +0 -270
- package/src/components/next-steps/types.ts +0 -63
- package/src/components/product-badge/index.test.tsx +0 -11
- package/src/components/product-badge/index.tsx +0 -42
- package/src/components/product-badge/style.module.css +0 -76
- package/src/components/products-used/index.tsx +0 -84
- package/src/components/products-used/style.module.css +0 -87
- package/src/components/products-used/types.ts +0 -31
- package/src/components/related-content/index.test.tsx +0 -74
- package/src/components/related-content/index.tsx +0 -56
- package/src/components/related-content/style.module.css +0 -89
- package/src/components/related-content/types.ts +0 -21
- package/src/components/subnav/helpers/areBasePathsMatching.ts +0 -13
- package/src/components/subnav/helpers/traverse/index.ts +0 -42
- package/src/components/subnav/helpers/useHeightRef.ts +0 -42
- package/src/components/subnav/helpers/useNavRef.ts +0 -30
- package/src/components/subnav/helpers/useOverflowRef.ts +0 -85
- package/src/components/subnav/helpers/useStuckRef.ts +0 -51
- package/src/components/subnav/index.tsx +0 -199
- package/src/components/subnav/partials/CtaLinks/github-stars-link/formatStarCount/index.test.ts +0 -26
- package/src/components/subnav/partials/CtaLinks/github-stars-link/formatStarCount/index.ts +0 -22
- package/src/components/subnav/partials/CtaLinks/github-stars-link/index.tsx +0 -87
- package/src/components/subnav/partials/CtaLinks/github-stars-link/parseGithubUrl/index.test.ts +0 -29
- package/src/components/subnav/partials/CtaLinks/github-stars-link/parseGithubUrl/index.ts +0 -32
- package/src/components/subnav/partials/CtaLinks/github-stars-link/style.module.css +0 -85
- package/src/components/subnav/partials/CtaLinks/icons/github-logo.js +0 -20
- package/src/components/subnav/partials/CtaLinks/icons/github.svg.js +0 -7
- package/src/components/subnav/partials/CtaLinks/icons/star.js +0 -20
- package/src/components/subnav/partials/CtaLinks/index.tsx +0 -130
- package/src/components/subnav/partials/CtaLinks/style.module.css +0 -45
- package/src/components/subnav/partials/DropdownTrigger/index.tsx +0 -35
- package/src/components/subnav/partials/DropdownTrigger/style.module.css +0 -36
- package/src/components/subnav/partials/MenuItemsDefault/index.tsx +0 -151
- package/src/components/subnav/partials/MenuItemsDefault/style.module.css +0 -91
- package/src/components/subnav/partials/MenuItemsOverflow/index.tsx +0 -139
- package/src/components/subnav/partials/MenuItemsOverflow/style.module.css +0 -82
- package/src/components/subnav/partials/TitleLink/index.tsx +0 -113
- package/src/components/subnav/partials/TitleLink/mktg-logos/all-community-product-logos_on-dark.ts +0 -9
- package/src/components/subnav/partials/TitleLink/mktg-logos/all-community-product-logos_on-light.ts +0 -9
- package/src/components/subnav/partials/TitleLink/mktg-logos/all-primary-logos_on-dark.ts +0 -23
- package/src/components/subnav/partials/TitleLink/mktg-logos/all-primary-logos_on-light.ts +0 -23
- package/src/components/subnav/partials/TitleLink/style.module.css +0 -43
- package/src/components/subnav/partials/nav-item-text/index.tsx +0 -37
- package/src/components/subnav/partials/nav-item-text/style.module.css +0 -15
- package/src/components/subnav/style.module.css +0 -68
- package/src/components/subnav/subnav-consts.ts +0 -1
- package/src/components/subnav/theme.module.css +0 -50
|
@@ -2,17 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
.promo {
|
|
4
4
|
display: flex;
|
|
5
|
-
border-radius: var(--
|
|
6
|
-
border: 1px solid var(--
|
|
7
|
-
background-color: var(--
|
|
8
|
-
padding: var(--
|
|
9
|
-
var(--hdsplus-spacing-06) var(--hdsplus-spacing-08);
|
|
5
|
+
border-radius: var(--mds-spacing-01);
|
|
6
|
+
border: 1px solid var(--mds-color-border-faint);
|
|
7
|
+
background-color: var(--mds-color-surface-faint);
|
|
8
|
+
padding: var(--mds-spacing-05) var(--mds-spacing-08) var(--mds-spacing-06) var(--mds-spacing-08);
|
|
10
9
|
flex-direction: row;
|
|
11
|
-
gap: var(--
|
|
12
|
-
margin: var(--
|
|
13
|
-
margin-bottom: var(--
|
|
10
|
+
gap: var(--mds-spacing-04);
|
|
11
|
+
margin: var(--mds-spacing-07);
|
|
12
|
+
margin-bottom: var(--mds-spacing-09);
|
|
14
13
|
|
|
15
14
|
@media (--large) {
|
|
15
|
+
&.topPromo {
|
|
16
|
+
margin-bottom: var(--mds-spacing-05);
|
|
17
|
+
}
|
|
16
18
|
&.noSide {
|
|
17
19
|
margin: 0;
|
|
18
20
|
width: min-content;
|
|
@@ -21,7 +23,14 @@
|
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
@media (--dev-dot-viewport) {
|
|
26
|
+
&.topPromo {
|
|
27
|
+
margin-bottom: var(--mds-spacing-05);
|
|
28
|
+
}
|
|
24
29
|
&.hasSide {
|
|
30
|
+
&.topPromo {
|
|
31
|
+
margin-bottom: var(--mds-spacing-05);
|
|
32
|
+
}
|
|
33
|
+
|
|
25
34
|
margin: 0;
|
|
26
35
|
width: min-content;
|
|
27
36
|
min-width: 100%;
|
|
@@ -29,22 +38,26 @@
|
|
|
29
38
|
}
|
|
30
39
|
}
|
|
31
40
|
|
|
41
|
+
.topPromo {
|
|
42
|
+
margin-bottom: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
32
45
|
.rightContent {
|
|
33
46
|
display: flex;
|
|
34
47
|
flex-wrap: wrap;
|
|
35
|
-
gap: var(--
|
|
48
|
+
gap: var(--mds-spacing-03);
|
|
36
49
|
width: 100%;
|
|
37
50
|
justify-content: space-between;
|
|
38
51
|
}
|
|
39
52
|
|
|
40
53
|
.title {
|
|
41
|
-
font-weight: var(--font-weight-
|
|
54
|
+
font-weight: var(--mds-typography-font-weight-semibold);
|
|
42
55
|
}
|
|
43
56
|
|
|
44
57
|
.description {
|
|
45
|
-
font-size: var(--
|
|
46
|
-
font-weight: var(--
|
|
47
|
-
margin-top: var(--
|
|
58
|
+
font-size: var(--mds-typography-body-200-font-size);
|
|
59
|
+
font-weight: var(--mds-typography-font-weight-regular);
|
|
60
|
+
margin-top: var(--mds-spacing-01);
|
|
48
61
|
}
|
|
49
62
|
|
|
50
63
|
.icon {
|
|
@@ -66,29 +79,24 @@
|
|
|
66
79
|
}
|
|
67
80
|
|
|
68
81
|
.link {
|
|
69
|
-
color: var(--
|
|
82
|
+
color: var(--mds-color-foreground-strong);
|
|
70
83
|
display: flex;
|
|
71
84
|
flex-direction: row;
|
|
72
85
|
align-items: center;
|
|
73
|
-
gap: var(--
|
|
86
|
+
gap: var(--mds-spacing-02);
|
|
74
87
|
|
|
75
88
|
&:hover {
|
|
76
89
|
text-decoration: underline;
|
|
77
90
|
}
|
|
78
91
|
|
|
79
92
|
&:focus {
|
|
80
|
-
outline: 2px solid var(--
|
|
93
|
+
outline: 2px solid var(--mds-color-focus-action-internal);
|
|
81
94
|
outline-style: auto;
|
|
82
95
|
}
|
|
83
96
|
}
|
|
84
97
|
|
|
85
98
|
.hashidays {
|
|
86
|
-
background: linear-gradient(
|
|
87
|
-
90deg,
|
|
88
|
-
#7b54b6 0%,
|
|
89
|
-
#4c69d8 74.77%,
|
|
90
|
-
#60d0dc 115.93%
|
|
91
|
-
);
|
|
99
|
+
background: linear-gradient(90deg, #7b54b6 0%, #4c69d8 74.77%, #60d0dc 115.93%);
|
|
92
100
|
-webkit-background-clip: text;
|
|
93
101
|
-webkit-text-fill-color: transparent;
|
|
94
102
|
max-width: fit-content;
|
|
@@ -99,16 +107,12 @@
|
|
|
99
107
|
}
|
|
100
108
|
|
|
101
109
|
.hashiconf {
|
|
102
|
-
background: linear-gradient(
|
|
103
|
-
to right,
|
|
104
|
-
var(--token-color-terraform-foreground),
|
|
105
|
-
var(--token-color-vagrant-foreground)
|
|
106
|
-
);
|
|
110
|
+
background: linear-gradient(to right, var(--mds-color-terraform-foreground), var(--mds-color-vagrant-foreground));
|
|
107
111
|
-webkit-background-clip: text;
|
|
108
112
|
-webkit-text-fill-color: transparent;
|
|
109
113
|
max-width: fit-content;
|
|
110
114
|
|
|
111
115
|
& svg {
|
|
112
|
-
color: var(--
|
|
116
|
+
color: var(--mds-color-terraform-foreground);
|
|
113
117
|
}
|
|
114
118
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import classNames from 'classnames'
|
|
2
|
+
import { type ReactNode, type HTMLAttributes } from 'react'
|
|
3
|
+
|
|
4
|
+
type TextSize = '200' | '300' | '400'
|
|
5
|
+
type TextWeight = 'regular' | 'medium' | 'semibold' | 'bold'
|
|
6
|
+
|
|
7
|
+
interface TextProps extends HTMLAttributes<HTMLSpanElement> {
|
|
8
|
+
size?: TextSize
|
|
9
|
+
weight?: TextWeight
|
|
10
|
+
children: ReactNode
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const Text = ({
|
|
14
|
+
size = '300',
|
|
15
|
+
weight,
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
...rest
|
|
19
|
+
}: TextProps) => {
|
|
20
|
+
return (
|
|
21
|
+
<span
|
|
22
|
+
className={classNames(
|
|
23
|
+
`mds-typography-body-${size}`,
|
|
24
|
+
weight && `mds-typography-font-weight-${weight}`,
|
|
25
|
+
className,
|
|
26
|
+
)}
|
|
27
|
+
{...rest}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</span>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { Text }
|
|
@@ -2,18 +2,21 @@ import classNames from 'classnames'
|
|
|
2
2
|
import Link from 'next/link'
|
|
3
3
|
import * as NavPanel from '../components/panel'
|
|
4
4
|
import Promo, { type PromoProps } from '../components/promo'
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
5
|
+
import { getLocalizedLinkProps } from '../../../lib/get-localized-link-props'
|
|
6
|
+
import { Products } from '@web/product-meta'
|
|
7
|
+
import FlightIcon from '../components/flight-icon'
|
|
8
|
+
import { Text } from '../components/text'
|
|
9
9
|
import { trackNavClickEvent } from '../../../lib/track-nav-click-event'
|
|
10
10
|
import * as NavigationMenu from '@radix-ui/react-navigation-menu'
|
|
11
|
+
import { LinkListProps } from '../components/link-list'
|
|
12
|
+
import NavLink from '../components/link'
|
|
11
13
|
import s from './style.module.css'
|
|
12
14
|
|
|
13
15
|
const PRODUCT_LOGO_MAP = new Map([
|
|
14
16
|
['Terraform', 'terraform-fill'],
|
|
15
17
|
['Packer', 'packer-fill-color'],
|
|
16
18
|
['Vault', 'vault-fill-color'],
|
|
19
|
+
['Vault Radar', 'vault-fill-color'],
|
|
17
20
|
['Boundary', 'boundary-fill-color'],
|
|
18
21
|
['Consul', 'consul-fill-color'],
|
|
19
22
|
['Nomad', 'nomad-fill-color'],
|
|
@@ -29,8 +32,15 @@ const PRODUCT_LOGO_EXCEPTION_CLASSNAMES = {
|
|
|
29
32
|
'HCP Vault Radar': 'hcpVaultRadar',
|
|
30
33
|
}
|
|
31
34
|
|
|
35
|
+
export type ProductCategoriesProps = Array<{
|
|
36
|
+
title: string
|
|
37
|
+
group?: LinkListProps['links'][0]
|
|
38
|
+
products: NavProductProps[]
|
|
39
|
+
}>
|
|
40
|
+
|
|
32
41
|
export interface ProductsPanelProps {
|
|
33
|
-
|
|
42
|
+
locale?: string
|
|
43
|
+
productCategories: ProductCategoriesProps
|
|
34
44
|
promo?: PromoProps
|
|
35
45
|
sidePanel?: {
|
|
36
46
|
label: string
|
|
@@ -41,33 +51,53 @@ export interface ProductsPanelProps {
|
|
|
41
51
|
url: string
|
|
42
52
|
}[]
|
|
43
53
|
}
|
|
54
|
+
isPromoOnTop?: boolean
|
|
44
55
|
}
|
|
45
56
|
|
|
46
57
|
const ProductPanel = ({
|
|
58
|
+
locale,
|
|
47
59
|
productCategories,
|
|
48
60
|
promo,
|
|
49
61
|
sidePanel,
|
|
62
|
+
isPromoOnTop = false,
|
|
50
63
|
}: ProductsPanelProps) => {
|
|
51
64
|
return (
|
|
52
65
|
<NavPanel.Root
|
|
53
66
|
className={classNames(s.productPanel, {
|
|
54
67
|
[s.hasSide]: sidePanel,
|
|
55
68
|
[s.noSide]: !sidePanel,
|
|
69
|
+
[s.topPromo]: isPromoOnTop,
|
|
56
70
|
})}
|
|
57
71
|
hasSidePanel={Boolean(sidePanel)}
|
|
58
72
|
>
|
|
59
73
|
<div className={s.mainPanel}>
|
|
74
|
+
{promo && isPromoOnTop ? (
|
|
75
|
+
<Promo
|
|
76
|
+
{...promo}
|
|
77
|
+
hasSidePanel={Boolean(sidePanel)}
|
|
78
|
+
isPromoOnTop={isPromoOnTop}
|
|
79
|
+
/>
|
|
80
|
+
) : null}
|
|
60
81
|
<NavPanel.Column hasSidePanel={Boolean(sidePanel)}>
|
|
61
82
|
<ul className={s.productCategories}>
|
|
62
|
-
{productCategories.map(({ title, products }) => {
|
|
83
|
+
{productCategories.map(({ group, title, products }) => {
|
|
63
84
|
return (
|
|
64
|
-
<li
|
|
65
|
-
|
|
85
|
+
<li
|
|
86
|
+
key={title}
|
|
87
|
+
className={classNames(s.productCategory, {
|
|
88
|
+
[s.productCategoryHasGroup]: group,
|
|
89
|
+
})}
|
|
90
|
+
>
|
|
91
|
+
{group ? (
|
|
92
|
+
<NavLink {...group} className={s.productGroupLink} />
|
|
93
|
+
) : (
|
|
94
|
+
<Text className={s.eyebrow}>{title}</Text>
|
|
95
|
+
)}
|
|
66
96
|
<ul className={s.productList}>
|
|
67
97
|
{products.map((product) => {
|
|
68
98
|
return (
|
|
69
99
|
<li key={product.url}>
|
|
70
|
-
<NavProduct {...product} />
|
|
100
|
+
<NavProduct locale={locale} {...product} />
|
|
71
101
|
</li>
|
|
72
102
|
)
|
|
73
103
|
})}
|
|
@@ -77,14 +107,16 @@ const ProductPanel = ({
|
|
|
77
107
|
})}
|
|
78
108
|
</ul>
|
|
79
109
|
</NavPanel.Column>
|
|
80
|
-
{promo
|
|
110
|
+
{promo && !isPromoOnTop ? (
|
|
111
|
+
<Promo {...promo} hasSidePanel={Boolean(sidePanel)} />
|
|
112
|
+
) : null}
|
|
81
113
|
</div>
|
|
82
114
|
|
|
83
115
|
{sidePanel ? (
|
|
84
116
|
<NavPanel.Column className={s.sidePanel}>
|
|
85
|
-
<
|
|
117
|
+
<Text size="200" weight="semibold" className={s.sidePanelText}>
|
|
86
118
|
{sidePanel.label}
|
|
87
|
-
</
|
|
119
|
+
</Text>
|
|
88
120
|
|
|
89
121
|
{/* ! TODO Replace the below list with the <LinkList /> component,
|
|
90
122
|
That component will require a refactor to support greater customization
|
|
@@ -97,20 +129,24 @@ const ProductPanel = ({
|
|
|
97
129
|
<li key={title}>
|
|
98
130
|
<Link
|
|
99
131
|
aria-label={`${title} - ${description}`}
|
|
100
|
-
|
|
132
|
+
{...getLocalizedLinkProps(url, locale)}
|
|
133
|
+
locale={locale ? locale : undefined}
|
|
101
134
|
className={classNames(s.sidePanelItem, s.focusIndicator)}
|
|
102
135
|
>
|
|
103
136
|
<div className={s.iconBackground}>
|
|
104
137
|
<FlightIcon
|
|
105
|
-
size={16}
|
|
106
138
|
name={icon}
|
|
107
|
-
color="var(--
|
|
139
|
+
color="var(--mds-color-foreground-faint)"
|
|
108
140
|
/>
|
|
109
141
|
</div>
|
|
110
142
|
<div className={s.sidePanelItemContent}>
|
|
111
|
-
<
|
|
143
|
+
<Text
|
|
144
|
+
size="200"
|
|
145
|
+
weight="semibold"
|
|
146
|
+
className={s.sidePanelText}
|
|
147
|
+
>
|
|
112
148
|
{title}
|
|
113
|
-
</
|
|
149
|
+
</Text>
|
|
114
150
|
<span className={s.sidePanelItemDesc}>{description}</span>
|
|
115
151
|
</div>
|
|
116
152
|
</Link>
|
|
@@ -125,17 +161,19 @@ const ProductPanel = ({
|
|
|
125
161
|
}
|
|
126
162
|
|
|
127
163
|
export interface NavProductProps {
|
|
164
|
+
locale?: string
|
|
128
165
|
url: string
|
|
129
166
|
product: Products | string
|
|
130
167
|
description: string
|
|
131
168
|
}
|
|
132
169
|
|
|
133
|
-
function NavProduct({ url, product, description }: NavProductProps) {
|
|
170
|
+
function NavProduct({ locale, url, product, description }: NavProductProps) {
|
|
134
171
|
return (
|
|
135
172
|
<NavigationMenu.Link asChild>
|
|
136
173
|
<Link
|
|
137
174
|
aria-label={`${product} - ${description}`}
|
|
138
|
-
|
|
175
|
+
{...getLocalizedLinkProps(url, locale)}
|
|
176
|
+
locale={locale ? locale : undefined}
|
|
139
177
|
onClickCapture={() => {
|
|
140
178
|
trackNavClickEvent(product, url, 'products')
|
|
141
179
|
}}
|
|
@@ -153,7 +191,20 @@ function NavProduct({ url, product, description }: NavProductProps) {
|
|
|
153
191
|
/>
|
|
154
192
|
</div>
|
|
155
193
|
<div className={s.productTextContent}>
|
|
156
|
-
|
|
194
|
+
{product === 'Vault Radar' ? (
|
|
195
|
+
<div>
|
|
196
|
+
<Text size="200" weight="semibold">
|
|
197
|
+
Vault
|
|
198
|
+
</Text>
|
|
199
|
+
<Text size="200" weight="regular">
|
|
200
|
+
Radar
|
|
201
|
+
</Text>
|
|
202
|
+
</div>
|
|
203
|
+
) : (
|
|
204
|
+
<Text size="200" weight="semibold">
|
|
205
|
+
{product}
|
|
206
|
+
</Text>
|
|
207
|
+
)}
|
|
157
208
|
<span className={s.productDesc}>{description}</span>
|
|
158
209
|
</div>
|
|
159
210
|
</div>
|
|
@@ -26,7 +26,11 @@
|
|
|
26
26
|
list-style: none;
|
|
27
27
|
padding: 0;
|
|
28
28
|
display: grid;
|
|
29
|
-
margin: var(--
|
|
29
|
+
margin: var(--mds-spacing-07) 0 0;
|
|
30
|
+
|
|
31
|
+
@nest .topPromo & {
|
|
32
|
+
margin-bottom: var(--mds-spacing-07);
|
|
33
|
+
}
|
|
30
34
|
|
|
31
35
|
@media (--large) {
|
|
32
36
|
@nest .noSide & {
|
|
@@ -47,28 +51,28 @@
|
|
|
47
51
|
min-width: 160px;
|
|
48
52
|
|
|
49
53
|
&:first-child {
|
|
50
|
-
border-bottom: 1px solid var(--
|
|
51
|
-
margin-bottom: var(--
|
|
52
|
-
padding-bottom: var(--
|
|
54
|
+
border-bottom: 1px solid var(--mds-color-border-primary);
|
|
55
|
+
margin-bottom: var(--mds-spacing-05);
|
|
56
|
+
padding-bottom: var(--mds-spacing-05);
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
.eyebrow {
|
|
57
|
-
padding-bottom: var(--
|
|
58
|
-
color: var(--
|
|
59
|
-
font-weight: var(--font-weight-
|
|
61
|
+
padding-bottom: var(--mds-spacing-04);
|
|
62
|
+
color: var(--mds-color-foreground-strong);
|
|
63
|
+
font-weight: var(--mds-typography-font-weight-semibold);
|
|
60
64
|
|
|
61
65
|
@media (--large) {
|
|
62
66
|
@nest .noSide & {
|
|
63
67
|
padding-bottom: 0;
|
|
64
|
-
padding-left: var(--
|
|
68
|
+
padding-left: var(--mds-spacing-06);
|
|
65
69
|
}
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
@media (--dev-dot-viewport) {
|
|
69
73
|
@nest .hasSide & {
|
|
70
74
|
padding-bottom: 0;
|
|
71
|
-
padding-left: var(--
|
|
75
|
+
padding-left: var(--mds-spacing-06);
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
}
|
|
@@ -82,8 +86,7 @@
|
|
|
82
86
|
|
|
83
87
|
@media (--large) {
|
|
84
88
|
@nest .noSide & {
|
|
85
|
-
padding: var(--
|
|
86
|
-
var(--hdsplus-spacing-04);
|
|
89
|
+
padding: var(--mds-spacing-06) var(--mds-spacing-05) var(--mds-spacing-04);
|
|
87
90
|
grid-auto-flow: row;
|
|
88
91
|
grid-template-columns: repeat(2, 300px);
|
|
89
92
|
grid-template-rows: repeat(2, max-content);
|
|
@@ -93,8 +96,7 @@
|
|
|
93
96
|
|
|
94
97
|
@media (--dev-dot-viewport) {
|
|
95
98
|
@nest .hasSide & {
|
|
96
|
-
padding: var(--
|
|
97
|
-
var(--hdsplus-spacing-04);
|
|
99
|
+
padding: var(--mds-spacing-06) var(--mds-spacing-05) var(--mds-spacing-04);
|
|
98
100
|
grid-auto-flow: row;
|
|
99
101
|
grid-template-columns: repeat(2, 300px);
|
|
100
102
|
grid-template-rows: repeat(2, max-content);
|
|
@@ -113,29 +115,29 @@
|
|
|
113
115
|
|
|
114
116
|
.productWrapper {
|
|
115
117
|
display: flex;
|
|
116
|
-
margin-bottom: var(--
|
|
117
|
-
gap: var(--
|
|
118
|
+
margin-bottom: var(--mds-spacing-05);
|
|
119
|
+
gap: var(--mds-spacing-05);
|
|
118
120
|
|
|
119
121
|
@media (--large) {
|
|
120
122
|
@nest .noSide & {
|
|
121
|
-
padding: var(--
|
|
123
|
+
padding: var(--mds-spacing-03) var(--mds-spacing-05);
|
|
122
124
|
margin-bottom: 0;
|
|
123
125
|
|
|
124
126
|
&:hover {
|
|
125
|
-
background-color: var(--
|
|
126
|
-
border-radius: var(--
|
|
127
|
+
background-color: var(--mds-color-surface-interactive-hover);
|
|
128
|
+
border-radius: var(--mds-spacing-01);
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
@media (--dev-dot-viewport) {
|
|
132
134
|
@nest .hasSide & {
|
|
133
|
-
padding: var(--
|
|
135
|
+
padding: var(--mds-spacing-03) var(--mds-spacing-05);
|
|
134
136
|
margin-bottom: 0;
|
|
135
137
|
|
|
136
138
|
&:hover {
|
|
137
|
-
background-color: var(--
|
|
138
|
-
border-radius: var(--
|
|
139
|
+
background-color: var(--mds-color-surface-interactive-hover);
|
|
140
|
+
border-radius: var(--mds-spacing-01);
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
143
|
}
|
|
@@ -152,8 +154,8 @@
|
|
|
152
154
|
@nest .noSide & {
|
|
153
155
|
& svg {
|
|
154
156
|
@media (--large) {
|
|
155
|
-
height: var(--
|
|
156
|
-
width: var(--
|
|
157
|
+
height: var(--mds-spacing-08);
|
|
158
|
+
width: var(--mds-spacing-08);
|
|
157
159
|
}
|
|
158
160
|
}
|
|
159
161
|
}
|
|
@@ -161,8 +163,8 @@
|
|
|
161
163
|
@nest .hasSide & {
|
|
162
164
|
& svg {
|
|
163
165
|
@media (--dev-dot-viewport) {
|
|
164
|
-
height: var(--
|
|
165
|
-
width: var(--
|
|
166
|
+
height: var(--mds-spacing-08);
|
|
167
|
+
width: var(--mds-spacing-08);
|
|
166
168
|
}
|
|
167
169
|
}
|
|
168
170
|
}
|
|
@@ -171,7 +173,7 @@
|
|
|
171
173
|
.productTextContent {
|
|
172
174
|
display: flex;
|
|
173
175
|
flex-direction: column;
|
|
174
|
-
color: var(--
|
|
176
|
+
color: var(--mds-color-foreground-strong);
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
.productDesc {
|
|
@@ -179,12 +181,12 @@
|
|
|
179
181
|
font-size: 14px;
|
|
180
182
|
line-height: 20px;
|
|
181
183
|
letter-spacing: 0.0125em;
|
|
182
|
-
color: var(--
|
|
184
|
+
color: var(--mds-color-foreground-faint);
|
|
183
185
|
}
|
|
184
186
|
|
|
185
187
|
.focusIndicator {
|
|
186
188
|
&:focus {
|
|
187
|
-
outline: 2px solid var(--
|
|
189
|
+
outline: 2px solid var(--mds-color-focus-action-internal);
|
|
188
190
|
outline-style: auto;
|
|
189
191
|
}
|
|
190
192
|
}
|
|
@@ -195,30 +197,39 @@
|
|
|
195
197
|
justify-content: space-between;
|
|
196
198
|
flex-direction: column;
|
|
197
199
|
|
|
200
|
+
@nest .topPromo & {
|
|
201
|
+
justify-content: flex-start;
|
|
202
|
+
}
|
|
203
|
+
|
|
198
204
|
@media (--large) {
|
|
199
205
|
@nest .noSide & {
|
|
200
|
-
padding: var(--
|
|
201
|
-
|
|
206
|
+
padding: var(--mds-spacing-05) 0 var(--mds-spacing-05) var(--mds-spacing-04);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@nest .topPromo & {
|
|
210
|
+
padding-bottom: var(--mds-spacing-04);
|
|
202
211
|
}
|
|
203
212
|
}
|
|
204
213
|
|
|
205
214
|
@media (--dev-dot-viewport) {
|
|
206
215
|
@nest .hasSide & {
|
|
207
|
-
padding: var(--
|
|
208
|
-
|
|
216
|
+
padding: var(--mds-spacing-07) 0 var(--mds-spacing-09) var(--mds-spacing-04);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@nest .topPromo & {
|
|
220
|
+
padding-bottom: var(--mds-spacing-04);
|
|
209
221
|
}
|
|
210
222
|
}
|
|
211
223
|
}
|
|
212
224
|
|
|
213
225
|
.sidePanel {
|
|
214
226
|
height: 100%;
|
|
215
|
-
background: var(--
|
|
227
|
+
background: var(--mds-color-surface-faint);
|
|
216
228
|
display: flex;
|
|
217
229
|
flex-direction: column;
|
|
218
|
-
gap: var(--
|
|
230
|
+
gap: var(--mds-spacing-05);
|
|
219
231
|
margin: 0;
|
|
220
|
-
padding: var(--
|
|
221
|
-
var(--hdsplus-spacing-09) var(--hdsplus-spacing-07);
|
|
232
|
+
padding: var(--mds-spacing-07) var(--mds-spacing-04) var(--mds-spacing-09) var(--mds-spacing-07);
|
|
222
233
|
}
|
|
223
234
|
|
|
224
235
|
.sidePanelItems {
|
|
@@ -227,24 +238,24 @@
|
|
|
227
238
|
padding: 0;
|
|
228
239
|
display: grid;
|
|
229
240
|
grid-template-columns: 1fr;
|
|
230
|
-
gap: var(--
|
|
241
|
+
gap: var(--mds-spacing-07);
|
|
231
242
|
|
|
232
243
|
@media (--dev-dot-viewport) {
|
|
233
|
-
gap: var(--
|
|
244
|
+
gap: var(--mds-spacing-05);
|
|
234
245
|
}
|
|
235
246
|
}
|
|
236
247
|
|
|
237
248
|
/* Lifted from .productWrapper */
|
|
238
249
|
.sidePanelItem {
|
|
239
250
|
display: flex;
|
|
240
|
-
gap: var(--
|
|
251
|
+
gap: var(--mds-spacing-05);
|
|
241
252
|
|
|
242
253
|
@media (--dev-dot-viewport) {
|
|
243
|
-
padding: var(--
|
|
254
|
+
padding: var(--mds-spacing-03) var(--mds-spacing-05);
|
|
244
255
|
|
|
245
256
|
&:hover {
|
|
246
|
-
background-color: var(--
|
|
247
|
-
border-radius: var(--
|
|
257
|
+
background-color: var(--mds-color-surface-interactive-hover);
|
|
258
|
+
border-radius: var(--mds-spacing-01);
|
|
248
259
|
}
|
|
249
260
|
}
|
|
250
261
|
}
|
|
@@ -252,30 +263,30 @@
|
|
|
252
263
|
/* Lifted from:
|
|
253
264
|
packages/react-components/src/components/nav-panel/components/link-list/style.module.css */
|
|
254
265
|
.iconBackground {
|
|
255
|
-
background: var(--
|
|
256
|
-
height: var(--
|
|
257
|
-
width: var(--
|
|
266
|
+
background: var(--mds-color-foreground-high-contrast);
|
|
267
|
+
height: var(--mds-spacing-08);
|
|
268
|
+
width: var(--mds-spacing-08);
|
|
258
269
|
display: flex;
|
|
259
270
|
align-items: center;
|
|
260
271
|
justify-content: center;
|
|
261
272
|
border-radius: 3px;
|
|
262
273
|
flex: none;
|
|
263
274
|
margin-top: 3px;
|
|
264
|
-
border: 1px solid var(--
|
|
275
|
+
border: 1px solid var(--mds-color-border-primary);
|
|
265
276
|
}
|
|
266
277
|
|
|
267
278
|
/* Lifted from .productTextContent */
|
|
268
279
|
.sidePanelItemContent {
|
|
269
280
|
display: flex;
|
|
270
281
|
flex-direction: column;
|
|
271
|
-
color: var(--
|
|
282
|
+
color: var(--mds-color-foreground-strong);
|
|
272
283
|
}
|
|
273
284
|
|
|
274
285
|
.sidePanelItemDesc {
|
|
275
286
|
font-weight: 400;
|
|
276
287
|
font-size: 13px;
|
|
277
288
|
line-height: 18px;
|
|
278
|
-
color: var(--
|
|
289
|
+
color: var(--mds-color-foreground-primary);
|
|
279
290
|
}
|
|
280
291
|
|
|
281
292
|
/* Branding exception classnames */
|
|
@@ -283,10 +294,10 @@ packages/react-components/src/components/nav-panel/components/link-list/style.mo
|
|
|
283
294
|
/* Allows switching to a dark-mode-specific color for Terraform */
|
|
284
295
|
.terraform {
|
|
285
296
|
& use {
|
|
286
|
-
fill: var(--
|
|
297
|
+
fill: var(--mds-color-terraform-brand);
|
|
287
298
|
|
|
288
299
|
@nest [data-theme='dark'] & {
|
|
289
|
-
fill: var(--
|
|
300
|
+
fill: var(--mds-color-terraform-foreground);
|
|
290
301
|
}
|
|
291
302
|
}
|
|
292
303
|
|
|
@@ -301,15 +312,62 @@ packages/react-components/src/components/nav-panel/components/link-list/style.mo
|
|
|
301
312
|
*/
|
|
302
313
|
.hcpVaultSecrets,
|
|
303
314
|
.hcpVaultRadar {
|
|
304
|
-
padding: var(--
|
|
305
|
-
border: 2px solid var(--
|
|
315
|
+
padding: var(--mds-spacing-01);
|
|
316
|
+
border: 2px solid var(--mds-color-vault-brand);
|
|
306
317
|
border-radius: 3px;
|
|
307
318
|
|
|
308
319
|
& use {
|
|
309
|
-
fill: var(--
|
|
320
|
+
fill: var(--mds-color-foreground-strong);
|
|
310
321
|
}
|
|
311
322
|
|
|
312
323
|
& path {
|
|
313
324
|
fill: inherit;
|
|
314
325
|
}
|
|
315
326
|
}
|
|
327
|
+
|
|
328
|
+
.sidePanelText {
|
|
329
|
+
font-weight: var(--mds-typography-font-weight-semibold);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.productCategoryHasGroup {
|
|
333
|
+
& .productList {
|
|
334
|
+
padding-left: 0;
|
|
335
|
+
padding-right: 0;
|
|
336
|
+
padding-top: 0;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
& .productWrapper {
|
|
340
|
+
gap: var(--mds-spacing-04);
|
|
341
|
+
|
|
342
|
+
@media (--small) {
|
|
343
|
+
padding: var(--mds-spacing-03) var(--mds-spacing-05);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
& .productLogo {
|
|
348
|
+
margin-top: 3px;
|
|
349
|
+
height: 32px;
|
|
350
|
+
width: 32px;
|
|
351
|
+
min-width: 32px;
|
|
352
|
+
|
|
353
|
+
& svg {
|
|
354
|
+
width: 100%;
|
|
355
|
+
height: 100%;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
& .terraform {
|
|
360
|
+
width: 100%;
|
|
361
|
+
height: 100%;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.productGroupLink {
|
|
366
|
+
min-width: 100%;
|
|
367
|
+
max-width: 100%;
|
|
368
|
+
margin-bottom: var(--mds-spacing-03);
|
|
369
|
+
color: var(--mds-color-foreground-strong);
|
|
370
|
+
font-family: var(--mds-typography-font-stack-text);
|
|
371
|
+
font-size: var(--mds-typography-body-200-font-size);
|
|
372
|
+
line-height: var(--mds-typography-body-200-line-height);
|
|
373
|
+
}
|