@hashicorp/react-components 0.0.0-nightly.9ce2a10 → 0.0.0-nightly.a120cb6

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.
Files changed (158) hide show
  1. package/package.json +4 -8
  2. package/src/components/nav-panel/components/link-list/index.tsx +15 -9
  3. package/src/components/nav-panel/components/link-list/style.module.css +10 -10
  4. package/src/components/nav-panel/components/panel/column/style.module.css +3 -3
  5. package/src/components/nav-panel/components/panel/root/style.module.css +6 -6
  6. package/src/components/nav-panel/components/promo/index.tsx +12 -9
  7. package/src/components/nav-panel/components/promo/style.module.css +13 -12
  8. package/src/components/nav-panel/product-panel/index.tsx +25 -25
  9. package/src/components/nav-panel/product-panel/style.module.css +62 -43
  10. package/src/components/nav-panel/standard-panel/index.tsx +3 -0
  11. package/src/components/nav-panel/standard-panel/style.module.css +2 -2
  12. package/src/lib/get-localized-link-props/index.test.ts +30 -0
  13. package/src/lib/get-localized-link-props/index.ts +45 -0
  14. package/src/lib/parse-url/index.test.ts +40 -1
  15. package/src/lib/parse-url/index.ts +75 -9
  16. package/src/lib/supported-locales/index.ts +1 -0
  17. package/src/lib/track-nav-click-event/index.ts +4 -4
  18. package/src/lib/v/index.ts +4 -5
  19. package/src/components/actions/index.tsx +0 -107
  20. package/src/components/actions/style.module.css +0 -28
  21. package/src/components/actions/types.ts +0 -73
  22. package/src/components/call-to-action/index.tsx +0 -205
  23. package/src/components/call-to-action/styles/variant-centered.module.css +0 -93
  24. package/src/components/call-to-action/styles/variant-compact-grid.module.css +0 -88
  25. package/src/components/call-to-action/styles/variant-compact.module.css +0 -91
  26. package/src/components/call-to-action/styles/variant-links.module.css +0 -85
  27. package/src/components/card/README.md +0 -11
  28. package/src/components/card/card.tsx +0 -45
  29. package/src/components/card/index.test.tsx +0 -69
  30. package/src/components/card/index.tsx +0 -14
  31. package/src/components/card/newsroom-card/index.test.tsx +0 -39
  32. package/src/components/card/newsroom-card/index.tsx +0 -37
  33. package/src/components/card/newsroom-card/style.module.css +0 -12
  34. package/src/components/card/partner-card/index.test.tsx +0 -57
  35. package/src/components/card/partner-card/index.tsx +0 -69
  36. package/src/components/card/partner-card/style.module.css +0 -24
  37. package/src/components/card/person-card/index.test.tsx +0 -71
  38. package/src/components/card/person-card/index.tsx +0 -93
  39. package/src/components/card/person-card/style.module.css +0 -33
  40. package/src/components/card/primitives.tsx +0 -176
  41. package/src/components/card/promo-card/index.tsx +0 -51
  42. package/src/components/card/resource-card/index.test.tsx +0 -48
  43. package/src/components/card/resource-card/index.tsx +0 -37
  44. package/src/components/card/style.module.css +0 -145
  45. package/src/components/card/types.ts +0 -66
  46. package/src/components/card/unified-card/index.tsx +0 -64
  47. package/src/components/consent-manager/README.md +0 -73
  48. package/src/components/consent-manager/components/banner/banner.module.css +0 -23
  49. package/src/components/consent-manager/components/banner/banner.test.tsx +0 -31
  50. package/src/components/consent-manager/components/banner/banner.tsx +0 -73
  51. package/src/components/consent-manager/components/dialog/dialog.module.css +0 -145
  52. package/src/components/consent-manager/components/dialog/dialog.test.tsx +0 -194
  53. package/src/components/consent-manager/components/dialog/dialog.tsx +0 -339
  54. package/src/components/consent-manager/img/icn_close.tsx +0 -19
  55. package/src/components/consent-manager/index.test.tsx +0 -334
  56. package/src/components/consent-manager/index.tsx +0 -186
  57. package/src/components/consent-manager/loader/README.md +0 -29
  58. package/src/components/consent-manager/loader/categories.ts +0 -22
  59. package/src/components/consent-manager/loader/index.tsx +0 -94
  60. package/src/components/consent-manager/loader/presets/enterprise.ts +0 -12
  61. package/src/components/consent-manager/loader/presets/oss.ts +0 -10
  62. package/src/components/consent-manager/loader/services.ts +0 -45
  63. package/src/components/consent-manager/scripts/custom.tsx +0 -59
  64. package/src/components/consent-manager/scripts/segment.tsx +0 -87
  65. package/src/components/consent-manager/style.module.css +0 -9
  66. package/src/components/consent-manager/types.ts +0 -55
  67. package/src/components/consent-manager/util/cookies.test.ts +0 -75
  68. package/src/components/consent-manager/util/cookies.ts +0 -70
  69. package/src/components/consent-manager/util/integrations.test.ts +0 -115
  70. package/src/components/consent-manager/util/integrations.ts +0 -110
  71. package/src/components/intro/index.tsx +0 -82
  72. package/src/components/intro/style.module.css +0 -67
  73. package/src/components/intro/types.ts +0 -44
  74. package/src/components/marketo-form/CHANGELOG.md +0 -122
  75. package/src/components/marketo-form/README.md +0 -1
  76. package/src/components/marketo-form/contexts/FormMetadata.ts +0 -11
  77. package/src/components/marketo-form/docs.mdx +0 -197
  78. package/src/components/marketo-form/fixtures/index.ts +0 -185
  79. package/src/components/marketo-form/form/index.tsx +0 -369
  80. package/src/components/marketo-form/index.test.tsx +0 -320
  81. package/src/components/marketo-form/index.ts +0 -11
  82. package/src/components/marketo-form/package.original.json +0 -30
  83. package/src/components/marketo-form/partials/error-message/index.tsx +0 -12
  84. package/src/components/marketo-form/partials/error-message/style.module.css +0 -13
  85. package/src/components/marketo-form/partials/field/index.tsx +0 -90
  86. package/src/components/marketo-form/partials/field-wrapper/index.tsx +0 -26
  87. package/src/components/marketo-form/partials/fields/checkbox-field/index.tsx +0 -32
  88. package/src/components/marketo-form/partials/fields/email-field/index.tsx +0 -35
  89. package/src/components/marketo-form/partials/fields/form-page-url-field/index.tsx +0 -21
  90. package/src/components/marketo-form/partials/fields/hidden-field/index.tsx +0 -37
  91. package/src/components/marketo-form/partials/fields/htmltext-field/index.tsx +0 -21
  92. package/src/components/marketo-form/partials/fields/htmltext-field/style.module.css +0 -18
  93. package/src/components/marketo-form/partials/fields/name-field/index.tsx +0 -19
  94. package/src/components/marketo-form/partials/fields/name-field/style.module.css +0 -13
  95. package/src/components/marketo-form/partials/fields/radio-buttons-field/index.tsx +0 -48
  96. package/src/components/marketo-form/partials/fields/select-field/index.tsx +0 -39
  97. package/src/components/marketo-form/partials/fields/select-field/style.module.css +0 -5
  98. package/src/components/marketo-form/partials/fields/telephone-field/index.tsx +0 -30
  99. package/src/components/marketo-form/partials/fields/text-field/index.tsx +0 -30
  100. package/src/components/marketo-form/partials/fields/textarea-field/index.tsx +0 -29
  101. package/src/components/marketo-form/partials/label/index.tsx +0 -24
  102. package/src/components/marketo-form/partials/label/style.module.css +0 -12
  103. package/src/components/marketo-form/partials/visibility-rule/index.tsx +0 -84
  104. package/src/components/marketo-form/props.js +0 -66
  105. package/src/components/marketo-form/server/api-routes.ts +0 -109
  106. package/src/components/marketo-form/server/client.ts +0 -98
  107. package/src/components/marketo-form/server/index.ts +0 -8
  108. package/src/components/marketo-form/types.ts +0 -268
  109. package/src/components/marketo-form/utils.test.tsx +0 -103
  110. package/src/components/marketo-form/utils.ts +0 -449
  111. package/src/components/next-steps/index.tsx +0 -137
  112. package/src/components/next-steps/style.module.css +0 -270
  113. package/src/components/next-steps/types.ts +0 -63
  114. package/src/components/product-badge/index.test.tsx +0 -11
  115. package/src/components/product-badge/index.tsx +0 -42
  116. package/src/components/product-badge/style.module.css +0 -76
  117. package/src/components/products-used/index.tsx +0 -84
  118. package/src/components/products-used/style.module.css +0 -87
  119. package/src/components/products-used/types.ts +0 -31
  120. package/src/components/related-content/index.test.tsx +0 -74
  121. package/src/components/related-content/index.tsx +0 -56
  122. package/src/components/related-content/style.module.css +0 -89
  123. package/src/components/related-content/types.ts +0 -21
  124. package/src/components/subnav/helpers/areBasePathsMatching.ts +0 -13
  125. package/src/components/subnav/helpers/traverse/index.ts +0 -42
  126. package/src/components/subnav/helpers/useHeightRef.ts +0 -42
  127. package/src/components/subnav/helpers/useNavRef.ts +0 -30
  128. package/src/components/subnav/helpers/useOverflowRef.ts +0 -85
  129. package/src/components/subnav/helpers/useStuckRef.ts +0 -51
  130. package/src/components/subnav/index.tsx +0 -199
  131. package/src/components/subnav/partials/CtaLinks/github-stars-link/formatStarCount/index.test.ts +0 -26
  132. package/src/components/subnav/partials/CtaLinks/github-stars-link/formatStarCount/index.ts +0 -22
  133. package/src/components/subnav/partials/CtaLinks/github-stars-link/index.tsx +0 -87
  134. package/src/components/subnav/partials/CtaLinks/github-stars-link/parseGithubUrl/index.test.ts +0 -29
  135. package/src/components/subnav/partials/CtaLinks/github-stars-link/parseGithubUrl/index.ts +0 -32
  136. package/src/components/subnav/partials/CtaLinks/github-stars-link/style.module.css +0 -85
  137. package/src/components/subnav/partials/CtaLinks/icons/github-logo.js +0 -20
  138. package/src/components/subnav/partials/CtaLinks/icons/github.svg.js +0 -7
  139. package/src/components/subnav/partials/CtaLinks/icons/star.js +0 -20
  140. package/src/components/subnav/partials/CtaLinks/index.tsx +0 -130
  141. package/src/components/subnav/partials/CtaLinks/style.module.css +0 -45
  142. package/src/components/subnav/partials/DropdownTrigger/index.tsx +0 -35
  143. package/src/components/subnav/partials/DropdownTrigger/style.module.css +0 -36
  144. package/src/components/subnav/partials/MenuItemsDefault/index.tsx +0 -151
  145. package/src/components/subnav/partials/MenuItemsDefault/style.module.css +0 -91
  146. package/src/components/subnav/partials/MenuItemsOverflow/index.tsx +0 -139
  147. package/src/components/subnav/partials/MenuItemsOverflow/style.module.css +0 -82
  148. package/src/components/subnav/partials/TitleLink/index.tsx +0 -113
  149. package/src/components/subnav/partials/TitleLink/mktg-logos/all-community-product-logos_on-dark.ts +0 -9
  150. package/src/components/subnav/partials/TitleLink/mktg-logos/all-community-product-logos_on-light.ts +0 -9
  151. package/src/components/subnav/partials/TitleLink/mktg-logos/all-primary-logos_on-dark.ts +0 -23
  152. package/src/components/subnav/partials/TitleLink/mktg-logos/all-primary-logos_on-light.ts +0 -23
  153. package/src/components/subnav/partials/TitleLink/style.module.css +0 -43
  154. package/src/components/subnav/partials/nav-item-text/index.tsx +0 -37
  155. package/src/components/subnav/partials/nav-item-text/style.module.css +0 -15
  156. package/src/components/subnav/style.module.css +0 -68
  157. package/src/components/subnav/subnav-consts.ts +0 -1
  158. package/src/components/subnav/theme.module.css +0 -50
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/react-components",
3
- "version": "0.0.0-nightly.9ce2a10",
3
+ "version": "0.0.0-nightly.a120cb6",
4
4
  "main": "src/index.ts",
5
5
  "scripts": {
6
6
  "lint": "next-hashicorp lint",
@@ -8,20 +8,16 @@
8
8
  "test:watch": "vitest watch"
9
9
  },
10
10
  "dependencies": {
11
- "@hashicorp/flight-icons": "^3.5.0",
11
+ "@hashicorp/flight-icons": "^3.7.0",
12
12
  "@hashicorp/platform-product-meta": "^0.1.1",
13
13
  "@hashicorp/platform-util": "^0.2.0",
14
- "@hashicorp/react-design-system-components": "*",
14
+ "@hashicorp/react-mds": "*",
15
15
  "@hashicorp/web-mktg-logos": "*",
16
16
  "@radix-ui/react-navigation-menu": "^1.2.0",
17
17
  "@radix-ui/react-visually-hidden": "^1.1.0",
18
- "@vercel/analytics": "^1.3.1",
19
18
  "@vercel/fetch": "^7.0.0",
20
19
  "@vercel/stega": "^0.1.2",
21
- "classnames": "^2.3.2",
22
- "js-cookie": "^3.0.5",
23
- "moize": "^6.1.3",
24
- "react-hook-form": "^7.43.5"
20
+ "classnames": "^2.3.2"
25
21
  },
26
22
  "devDependencies": {
27
23
  "@hashicorp/platform-cli": "^2.8.0",
@@ -1,11 +1,12 @@
1
1
  import Link from 'next/link'
2
- import { parseUrl } from '../../../../lib/parse-url'
3
- import { v } from '../../../../lib/v'
4
- import FlightIcon from '@hashicorp/react-design-system-components/src/components/flight-icon'
2
+ import { vercelSplit } from '../../../../lib/v'
3
+ import { getLocalizedLinkProps } from '../../../../lib/get-localized-link-props'
4
+ import FlightIcon from '@hashicorp/react-mds/src/hds/components/flight-icon'
5
5
  import * as NavigationMenu from '@radix-ui/react-navigation-menu'
6
6
  import s from './style.module.css'
7
7
 
8
8
  export interface LinkListProps {
9
+ locale?: string
9
10
  links: {
10
11
  title: string
11
12
  url: string
@@ -37,15 +38,20 @@ const GRADIENT_VALUE_MAP = new Map([
37
38
  ],
38
39
  ])
39
40
 
40
- export default function LinkList({ links, linkClickHandler }: LinkListProps) {
41
+ export default function LinkList({
42
+ locale,
43
+ links,
44
+ linkClickHandler,
45
+ }: LinkListProps) {
41
46
  return (
42
47
  <ul className={s.linkList}>
43
48
  {links.map((link) => {
44
49
  let style
45
50
  link.iconGradient
46
51
  ? (style = {
47
- '--iconGradient': GRADIENT_VALUE_MAP.get(v(link.iconGradient))
48
- ?.iconGradient,
52
+ '--iconGradient': GRADIENT_VALUE_MAP.get(
53
+ vercelSplit(link.iconGradient)
54
+ )?.iconGradient,
49
55
  } as React.CSSProperties)
50
56
  : (style = null)
51
57
  return (
@@ -53,19 +59,19 @@ export default function LinkList({ links, linkClickHandler }: LinkListProps) {
53
59
  <NavigationMenu.Link asChild>
54
60
  <Link
55
61
  className={s.link}
56
- href={parseUrl(link.url).href}
62
+ {...getLocalizedLinkProps(link.url, locale)}
57
63
  onClickCapture={() => {
58
64
  linkClickHandler && linkClickHandler(link.title, link.url)
59
65
  }}
60
66
  >
61
67
  {link.iconGradient && link.icon ? (
62
68
  <div className={s.iconBackground} style={style}>
63
- <FlightIcon name={v(link.icon)} />
69
+ <FlightIcon name={vercelSplit(link.icon)} />
64
70
  </div>
65
71
  ) : (
66
72
  link.icon && (
67
73
  <FlightIcon
68
- name={v(link.icon)}
74
+ name={vercelSplit(link.icon)}
69
75
  color="var(--token-color-foreground-faint)"
70
76
  />
71
77
  )
@@ -2,7 +2,7 @@
2
2
  display: flex;
3
3
  list-style: none;
4
4
  flex-direction: column;
5
- gap: var(--hdsplus-spacing-03);
5
+ gap: var(--mds-spacing-03);
6
6
  margin: 0;
7
7
  padding: 0;
8
8
  }
@@ -10,14 +10,14 @@
10
10
  .link {
11
11
  color: var(--token-color-foreground-primary);
12
12
  display: flex;
13
- gap: var(--hdsplus-spacing-04);
14
- padding: var(--hdsplus-spacing-03) var(--hdsplus-spacing-04);
13
+ gap: var(--mds-spacing-04);
14
+ padding: var(--mds-spacing-03) var(--mds-spacing-04);
15
15
  min-width: 190px;
16
16
  align-items: center;
17
17
 
18
18
  &:hover {
19
19
  background-color: var(--token-color-surface-interactive-hover);
20
- border-radius: var(--hdsplus-spacing-01);
20
+ border-radius: var(--mds-spacing-01);
21
21
  }
22
22
 
23
23
  &:has(.iconBackground) {
@@ -35,15 +35,15 @@
35
35
  }
36
36
 
37
37
  .description {
38
- font-size: var(--hdsplus-typography-body-200-font-size);
39
- font-weight: var(--token-typography-font-weight-regular);
40
- margin-top: var(--hdsplus-spacing-02);
38
+ font-size: var(--mds-typography-body-200-font-size);
39
+ font-weight: var(--mds-typography-font-weight-regular);
40
+ margin-top: var(--mds-spacing-02);
41
41
  }
42
42
 
43
43
  .iconBackground {
44
44
  background: var(--iconGradient);
45
- height: var(--hdsplus-spacing-08);
46
- width: var(--hdsplus-spacing-08);
45
+ height: var(--mds-spacing-08);
46
+ width: var(--mds-spacing-08);
47
47
  display: flex;
48
48
  align-items: center;
49
49
  justify-content: center;
@@ -53,5 +53,5 @@
53
53
  }
54
54
 
55
55
  .boldTitle {
56
- font-weight: var(--font-weight-semi-bold);
56
+ font-weight: var(--mds-typography-font-weight-semibold);
57
57
  }
@@ -1,4 +1,4 @@
1
- @custom-media --dev-dot-viewport (min-width: 1230px);
1
+ @custom-media --dev-dot-viewport (min-width: 924px);
2
2
 
3
3
  .column {
4
4
  position: relative;
@@ -7,8 +7,8 @@
7
7
  justify-content: flex-start;
8
8
  min-width: 190px;
9
9
  padding: 0;
10
- margin: 0 var(--hdsplus-spacing-05);
11
- border-radius: var(--hdsplus-spacing-03);
10
+ margin: 0 var(--mds-spacing-07);
11
+ border-radius: var(--mds-spacing-03);
12
12
 
13
13
  @media (--large) {
14
14
  &:not(.hasSide) {
@@ -1,4 +1,4 @@
1
- @custom-media --dev-dot-viewport (min-width: 1230px);
1
+ @custom-media --dev-dot-viewport (min-width: 924px);
2
2
 
3
3
  .root {
4
4
  width: 100%;
@@ -6,15 +6,15 @@
6
6
  flex-direction: column;
7
7
  justify-content: space-between;
8
8
  /* stylelint-disable-next-line unit-no-unknown */
9
- min-height: calc(100dvh - var(--hdsplus-spacing-12));
9
+ min-height: calc(100dvh - var(--mds-spacing-12));
10
10
 
11
11
  @media (--large) {
12
12
  &:not(.hasSide) {
13
13
  justify-content: flex-start;
14
14
  height: 100%;
15
15
  min-height: fit-content;
16
- padding: var(--hdsplus-spacing-05) var(--hdsplus-spacing-04);
17
- gap: var(--hdsplus-spacing-04);
16
+ padding: var(--mds-spacing-05) var(--mds-spacing-04);
17
+ gap: var(--mds-spacing-04);
18
18
  }
19
19
  }
20
20
 
@@ -23,8 +23,8 @@
23
23
  justify-content: flex-start;
24
24
  height: 100%;
25
25
  min-height: fit-content;
26
- padding: var(--hdsplus-spacing-05) var(--hdsplus-spacing-04);
27
- gap: var(--hdsplus-spacing-04);
26
+ padding: var(--mds-spacing-05) var(--mds-spacing-04);
27
+ gap: var(--mds-spacing-04);
28
28
  }
29
29
  }
30
30
  }
@@ -1,14 +1,15 @@
1
1
  import { useCallback } from 'react'
2
2
  import classNames from 'classnames'
3
- import { v } from '../../../../lib/v'
3
+ import { vercelSplit } from '../../../../lib/v'
4
4
  import Link from 'next/link'
5
- import { parseUrl } from '../../../../lib/parse-url'
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-design-system-components/src/components/flight-icon'
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
@@ -20,6 +21,7 @@ export interface PromoProps {
20
21
  }
21
22
 
22
23
  export default function Promo({
24
+ locale,
23
25
  title,
24
26
  description,
25
27
  linkUrl,
@@ -51,19 +53,19 @@ export default function Promo({
51
53
  {icon && (
52
54
  <div
53
55
  className={classNames(s.icon, {
54
- [s.hashidays]: v(theme) === 'hashidays',
55
- [s.hashiconf]: v(theme) === 'hashiconf',
56
+ [s.hashidays]: vercelSplit(theme) === 'hashidays',
57
+ [s.hashiconf]: vercelSplit(theme) === 'hashiconf',
56
58
  })}
57
59
  >
58
- <FlightIcon name={v(icon)} />
60
+ <FlightIcon name={vercelSplit(icon)} />
59
61
  </div>
60
62
  )}
61
63
  <div className={s.rightContent}>
62
64
  <div>
63
65
  <div
64
66
  className={classNames(s.title, {
65
- [s.hashidays]: v(theme) === 'hashidays',
66
- [s.hashiconf]: v(theme) === 'hashiconf',
67
+ [s.hashidays]: vercelSplit(theme) === 'hashidays',
68
+ [s.hashiconf]: vercelSplit(theme) === 'hashiconf',
67
69
  })}
68
70
  >
69
71
  {title}
@@ -72,7 +74,8 @@ export default function Promo({
72
74
  </div>
73
75
  <NavigationMenu.Link asChild>
74
76
  <Link
75
- href={parseUrl(linkUrl).href}
77
+ locale={locale ? locale : undefined}
78
+ {...getLocalizedLinkProps(linkUrl, locale)}
76
79
  className={s.link}
77
80
  onClickCapture={() => handleClick(title, linkUrl, linkTitle, slug)}
78
81
  >
@@ -1,15 +1,16 @@
1
- @custom-media --dev-dot-viewport (min-width: 1230px);
1
+ @custom-media --dev-dot-viewport (min-width: 924px);
2
2
 
3
3
  .promo {
4
4
  display: flex;
5
- border-radius: var(--hdsplus-spacing-01);
5
+ border-radius: var(--mds-spacing-01);
6
6
  border: 1px solid var(--token-color-border-faint);
7
7
  background-color: var(--token-color-surface-faint);
8
- padding: var(--hdsplus-spacing-05) var(--hdsplus-spacing-08)
9
- var(--hdsplus-spacing-06) var(--hdsplus-spacing-08);
8
+ padding: var(--mds-spacing-05) var(--mds-spacing-08)
9
+ var(--mds-spacing-06) var(--mds-spacing-08);
10
10
  flex-direction: row;
11
- gap: var(--hdsplus-spacing-04);
12
- margin: var(--hdsplus-spacing-05);
11
+ gap: var(--mds-spacing-04);
12
+ margin: var(--mds-spacing-07);
13
+ margin-bottom: var(--mds-spacing-09);
13
14
 
14
15
  @media (--large) {
15
16
  &.noSide {
@@ -31,19 +32,19 @@
31
32
  .rightContent {
32
33
  display: flex;
33
34
  flex-wrap: wrap;
34
- gap: var(--hdsplus-spacing-03);
35
+ gap: var(--mds-spacing-03);
35
36
  width: 100%;
36
37
  justify-content: space-between;
37
38
  }
38
39
 
39
40
  .title {
40
- font-weight: var(--font-weight-semi-bold);
41
+ font-weight: var(--mds-typography-font-weight-semibold);
41
42
  }
42
43
 
43
44
  .description {
44
- font-size: var(--hdsplus-typography-body-200-font-size);
45
- font-weight: var(--token-typography-font-weight-regular);
46
- margin-top: var(--hdsplus-spacing-01);
45
+ font-size: var(--mds-typography-body-200-font-size);
46
+ font-weight: var(--mds-typography-font-weight-regular);
47
+ margin-top: var(--mds-spacing-01);
47
48
  }
48
49
 
49
50
  .icon {
@@ -69,7 +70,7 @@
69
70
  display: flex;
70
71
  flex-direction: row;
71
72
  align-items: center;
72
- gap: var(--hdsplus-spacing-02);
73
+ gap: var(--mds-spacing-02);
73
74
 
74
75
  &:hover {
75
76
  text-decoration: underline;
@@ -1,18 +1,17 @@
1
- import { CSSProperties } from 'react'
2
1
  import classNames from 'classnames'
3
2
  import Link from 'next/link'
4
3
  import * as NavPanel from '../components/panel'
5
4
  import Promo, { type PromoProps } from '../components/promo'
5
+ import { getLocalizedLinkProps } from '../../../lib/get-localized-link-props'
6
6
  import { Products } from '@hashicorp/platform-product-meta'
7
- import FlightIcon from '@hashicorp/react-design-system-components/src/components/flight-icon'
8
- import { TextPlus } from '@hashicorp/react-design-system-components/src/components/text'
9
- 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'
10
9
  import { trackNavClickEvent } from '../../../lib/track-nav-click-event'
11
10
  import * as NavigationMenu from '@radix-ui/react-navigation-menu'
12
11
  import s from './style.module.css'
13
12
 
14
13
  const PRODUCT_LOGO_MAP = new Map([
15
- ['Terraform', 'terraform-fill-color'],
14
+ ['Terraform', 'terraform-fill'],
16
15
  ['Packer', 'packer-fill-color'],
17
16
  ['Vault', 'vault-fill-color'],
18
17
  ['Boundary', 'boundary-fill-color'],
@@ -25,11 +24,13 @@ const PRODUCT_LOGO_MAP = new Map([
25
24
  ])
26
25
 
27
26
  const PRODUCT_LOGO_EXCEPTION_CLASSNAMES = {
27
+ Terraform: 'terraform',
28
28
  'HCP Vault Secrets': 'hcpVaultSecrets',
29
29
  'HCP Vault Radar': 'hcpVaultRadar',
30
30
  }
31
31
 
32
32
  export interface ProductsPanelProps {
33
+ locale: string
33
34
  productCategories: any
34
35
  promo?: PromoProps
35
36
  sidePanel?: {
@@ -44,6 +45,7 @@ export interface ProductsPanelProps {
44
45
  }
45
46
 
46
47
  const ProductPanel = ({
48
+ locale,
47
49
  productCategories,
48
50
  promo,
49
51
  sidePanel,
@@ -62,22 +64,12 @@ const ProductPanel = ({
62
64
  {productCategories.map(({ title, products }) => {
63
65
  return (
64
66
  <li key={title} className={s.productCategory}>
65
- <TextPlus.Body className={s.eyebrow}>{title}</TextPlus.Body>
66
- <ul
67
- className={s.productList}
68
- // Dynamically calculate row count based on number of items divided by expected columns
69
- style={
70
- {
71
- '--row-count-above-mobile': Math.ceil(
72
- products.length / 2
73
- ),
74
- } as CSSProperties
75
- }
76
- >
67
+ <Text.Body className={s.eyebrow}>{title}</Text.Body>
68
+ <ul className={s.productList}>
77
69
  {products.map((product) => {
78
70
  return (
79
71
  <li key={product.url}>
80
- <NavProduct {...product} />
72
+ <NavProduct locale={locale} {...product} />
81
73
  </li>
82
74
  )
83
75
  })}
@@ -92,9 +84,9 @@ const ProductPanel = ({
92
84
 
93
85
  {sidePanel ? (
94
86
  <NavPanel.Column className={s.sidePanel}>
95
- <TextPlus.Body size="200" weight="semibold">
87
+ <Text.Body size="200" weight="semibold">
96
88
  {sidePanel.label}
97
- </TextPlus.Body>
89
+ </Text.Body>
98
90
 
99
91
  {/* ! TODO Replace the below list with the <LinkList /> component,
100
92
  That component will require a refactor to support greater customization
@@ -105,7 +97,12 @@ const ProductPanel = ({
105
97
  {sidePanel.navItems.map(({ icon, title, description, url }) => {
106
98
  return (
107
99
  <li key={title}>
108
- <Link href={parseUrl(url).href} className={s.sidePanelItem}>
100
+ <Link
101
+ aria-label={`${title} - ${description}`}
102
+ {...getLocalizedLinkProps(url, locale)}
103
+ locale={locale ? locale : undefined}
104
+ className={classNames(s.sidePanelItem, s.focusIndicator)}
105
+ >
109
106
  <div className={s.iconBackground}>
110
107
  <FlightIcon
111
108
  size={16}
@@ -114,9 +111,9 @@ const ProductPanel = ({
114
111
  />
115
112
  </div>
116
113
  <div className={s.sidePanelItemContent}>
117
- <TextPlus.Body size="200" weight="semibold" tag="span">
114
+ <Text.Body size="200" weight="semibold" tag="span">
118
115
  {title}
119
- </TextPlus.Body>
116
+ </Text.Body>
120
117
  <span className={s.sidePanelItemDesc}>{description}</span>
121
118
  </div>
122
119
  </Link>
@@ -131,16 +128,19 @@ const ProductPanel = ({
131
128
  }
132
129
 
133
130
  export interface NavProductProps {
131
+ locale?: string
134
132
  url: string
135
133
  product: Products | string
136
134
  description: string
137
135
  }
138
136
 
139
- function NavProduct({ url, product, description }: NavProductProps) {
137
+ function NavProduct({ locale, url, product, description }: NavProductProps) {
140
138
  return (
141
139
  <NavigationMenu.Link asChild>
142
140
  <Link
143
- href={parseUrl(url).href}
141
+ aria-label={`${product} - ${description}`}
142
+ {...getLocalizedLinkProps(url, locale)}
143
+ locale={locale ? locale : undefined}
144
144
  onClickCapture={() => {
145
145
  trackNavClickEvent(product, url, 'products')
146
146
  }}