@hashicorp/react-components 0.0.0-nightly.0cf11a1 → 0.0.0-nightly.1679700

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 (170) hide show
  1. package/.eslintrc.js +1 -2
  2. package/.stylelintrc.js +1 -1
  3. package/README.md +1 -1
  4. package/package.json +5 -9
  5. package/postcss.config.js +1 -1
  6. package/src/components/nav-panel/components/flight-icon/index.tsx +51 -0
  7. package/src/components/nav-panel/components/flight-icon/style.module.css +3 -0
  8. package/src/components/nav-panel/components/link/index.tsx +107 -0
  9. package/src/components/nav-panel/components/link/style.module.css +64 -0
  10. package/src/components/nav-panel/components/link-list/index.tsx +13 -64
  11. package/src/components/nav-panel/components/link-list/style.module.css +1 -50
  12. package/src/components/nav-panel/components/panel/column/index.tsx +15 -2
  13. package/src/components/nav-panel/components/panel/column/style.module.css +13 -3
  14. package/src/components/nav-panel/components/panel/root/index.tsx +11 -2
  15. package/src/components/nav-panel/components/panel/root/style.module.css +20 -6
  16. package/src/components/nav-panel/components/promo/index.tsx +43 -16
  17. package/src/components/nav-panel/components/promo/style.module.css +52 -16
  18. package/src/components/nav-panel/components/text/index.tsx +34 -0
  19. package/src/components/nav-panel/product-panel/index.tsx +70 -20
  20. package/src/components/nav-panel/product-panel/style.module.css +223 -45
  21. package/src/components/nav-panel/standard-panel/index.tsx +3 -0
  22. package/src/components/nav-panel/standard-panel/style.module.css +2 -2
  23. package/src/lib/get-localized-link-props/index.test.ts +30 -0
  24. package/src/lib/get-localized-link-props/index.ts +45 -0
  25. package/src/lib/parse-url/index.test.ts +40 -1
  26. package/src/lib/parse-url/index.ts +74 -9
  27. package/src/lib/send-posthog-event/index.ts +22 -0
  28. package/src/lib/supported-locales/index.ts +10 -0
  29. package/src/lib/track-nav-click-event/index.ts +4 -4
  30. package/src/lib/v/index.ts +4 -5
  31. package/src/components/actions/index.tsx +0 -107
  32. package/src/components/actions/style.module.css +0 -28
  33. package/src/components/actions/types.ts +0 -73
  34. package/src/components/call-to-action/index.tsx +0 -205
  35. package/src/components/call-to-action/styles/variant-centered.module.css +0 -93
  36. package/src/components/call-to-action/styles/variant-compact-grid.module.css +0 -88
  37. package/src/components/call-to-action/styles/variant-compact.module.css +0 -91
  38. package/src/components/call-to-action/styles/variant-links.module.css +0 -85
  39. package/src/components/card/README.md +0 -11
  40. package/src/components/card/card.tsx +0 -45
  41. package/src/components/card/index.test.tsx +0 -69
  42. package/src/components/card/index.tsx +0 -14
  43. package/src/components/card/newsroom-card/index.test.tsx +0 -39
  44. package/src/components/card/newsroom-card/index.tsx +0 -37
  45. package/src/components/card/newsroom-card/style.module.css +0 -12
  46. package/src/components/card/partner-card/index.test.tsx +0 -57
  47. package/src/components/card/partner-card/index.tsx +0 -69
  48. package/src/components/card/partner-card/style.module.css +0 -24
  49. package/src/components/card/person-card/index.test.tsx +0 -71
  50. package/src/components/card/person-card/index.tsx +0 -93
  51. package/src/components/card/person-card/style.module.css +0 -33
  52. package/src/components/card/primitives.tsx +0 -176
  53. package/src/components/card/promo-card/index.tsx +0 -51
  54. package/src/components/card/resource-card/index.test.tsx +0 -48
  55. package/src/components/card/resource-card/index.tsx +0 -37
  56. package/src/components/card/style.module.css +0 -145
  57. package/src/components/card/types.ts +0 -66
  58. package/src/components/card/unified-card/index.tsx +0 -64
  59. package/src/components/consent-manager/README.md +0 -73
  60. package/src/components/consent-manager/components/banner/banner.module.css +0 -23
  61. package/src/components/consent-manager/components/banner/banner.test.tsx +0 -31
  62. package/src/components/consent-manager/components/banner/banner.tsx +0 -73
  63. package/src/components/consent-manager/components/dialog/dialog.module.css +0 -145
  64. package/src/components/consent-manager/components/dialog/dialog.test.tsx +0 -194
  65. package/src/components/consent-manager/components/dialog/dialog.tsx +0 -339
  66. package/src/components/consent-manager/img/icn_close.tsx +0 -19
  67. package/src/components/consent-manager/index.test.tsx +0 -334
  68. package/src/components/consent-manager/index.tsx +0 -186
  69. package/src/components/consent-manager/loader/README.md +0 -29
  70. package/src/components/consent-manager/loader/categories.ts +0 -22
  71. package/src/components/consent-manager/loader/index.tsx +0 -94
  72. package/src/components/consent-manager/loader/presets/enterprise.ts +0 -12
  73. package/src/components/consent-manager/loader/presets/oss.ts +0 -10
  74. package/src/components/consent-manager/loader/services.ts +0 -45
  75. package/src/components/consent-manager/scripts/custom.tsx +0 -59
  76. package/src/components/consent-manager/scripts/segment.tsx +0 -87
  77. package/src/components/consent-manager/style.module.css +0 -9
  78. package/src/components/consent-manager/types.ts +0 -55
  79. package/src/components/consent-manager/util/cookies.test.ts +0 -75
  80. package/src/components/consent-manager/util/cookies.ts +0 -70
  81. package/src/components/consent-manager/util/integrations.test.ts +0 -115
  82. package/src/components/consent-manager/util/integrations.ts +0 -110
  83. package/src/components/intro/index.tsx +0 -82
  84. package/src/components/intro/style.module.css +0 -67
  85. package/src/components/intro/types.ts +0 -44
  86. package/src/components/marketo-form/CHANGELOG.md +0 -122
  87. package/src/components/marketo-form/README.md +0 -1
  88. package/src/components/marketo-form/contexts/FormMetadata.ts +0 -11
  89. package/src/components/marketo-form/docs.mdx +0 -197
  90. package/src/components/marketo-form/fixtures/index.ts +0 -185
  91. package/src/components/marketo-form/form/index.tsx +0 -369
  92. package/src/components/marketo-form/index.test.tsx +0 -320
  93. package/src/components/marketo-form/index.ts +0 -11
  94. package/src/components/marketo-form/package.original.json +0 -30
  95. package/src/components/marketo-form/partials/error-message/index.tsx +0 -12
  96. package/src/components/marketo-form/partials/error-message/style.module.css +0 -13
  97. package/src/components/marketo-form/partials/field/index.tsx +0 -90
  98. package/src/components/marketo-form/partials/field-wrapper/index.tsx +0 -26
  99. package/src/components/marketo-form/partials/fields/checkbox-field/index.tsx +0 -32
  100. package/src/components/marketo-form/partials/fields/email-field/index.tsx +0 -35
  101. package/src/components/marketo-form/partials/fields/form-page-url-field/index.tsx +0 -21
  102. package/src/components/marketo-form/partials/fields/hidden-field/index.tsx +0 -37
  103. package/src/components/marketo-form/partials/fields/htmltext-field/index.tsx +0 -21
  104. package/src/components/marketo-form/partials/fields/htmltext-field/style.module.css +0 -18
  105. package/src/components/marketo-form/partials/fields/name-field/index.tsx +0 -19
  106. package/src/components/marketo-form/partials/fields/name-field/style.module.css +0 -13
  107. package/src/components/marketo-form/partials/fields/radio-buttons-field/index.tsx +0 -48
  108. package/src/components/marketo-form/partials/fields/select-field/index.tsx +0 -39
  109. package/src/components/marketo-form/partials/fields/select-field/style.module.css +0 -5
  110. package/src/components/marketo-form/partials/fields/telephone-field/index.tsx +0 -30
  111. package/src/components/marketo-form/partials/fields/text-field/index.tsx +0 -30
  112. package/src/components/marketo-form/partials/fields/textarea-field/index.tsx +0 -29
  113. package/src/components/marketo-form/partials/label/index.tsx +0 -24
  114. package/src/components/marketo-form/partials/label/style.module.css +0 -12
  115. package/src/components/marketo-form/partials/visibility-rule/index.tsx +0 -84
  116. package/src/components/marketo-form/props.js +0 -66
  117. package/src/components/marketo-form/server/api-routes.ts +0 -109
  118. package/src/components/marketo-form/server/client.ts +0 -98
  119. package/src/components/marketo-form/server/index.ts +0 -8
  120. package/src/components/marketo-form/types.ts +0 -268
  121. package/src/components/marketo-form/utils.test.tsx +0 -103
  122. package/src/components/marketo-form/utils.ts +0 -449
  123. package/src/components/next-steps/index.tsx +0 -137
  124. package/src/components/next-steps/style.module.css +0 -270
  125. package/src/components/next-steps/types.ts +0 -63
  126. package/src/components/product-badge/index.test.tsx +0 -11
  127. package/src/components/product-badge/index.tsx +0 -42
  128. package/src/components/product-badge/style.module.css +0 -76
  129. package/src/components/products-used/index.tsx +0 -84
  130. package/src/components/products-used/style.module.css +0 -87
  131. package/src/components/products-used/types.ts +0 -31
  132. package/src/components/related-content/index.test.tsx +0 -74
  133. package/src/components/related-content/index.tsx +0 -56
  134. package/src/components/related-content/style.module.css +0 -89
  135. package/src/components/related-content/types.ts +0 -21
  136. package/src/components/subnav/helpers/areBasePathsMatching.ts +0 -13
  137. package/src/components/subnav/helpers/traverse/index.ts +0 -42
  138. package/src/components/subnav/helpers/useHeightRef.ts +0 -42
  139. package/src/components/subnav/helpers/useNavRef.ts +0 -30
  140. package/src/components/subnav/helpers/useOverflowRef.ts +0 -85
  141. package/src/components/subnav/helpers/useStuckRef.ts +0 -51
  142. package/src/components/subnav/index.tsx +0 -199
  143. package/src/components/subnav/partials/CtaLinks/github-stars-link/formatStarCount/index.test.ts +0 -26
  144. package/src/components/subnav/partials/CtaLinks/github-stars-link/formatStarCount/index.ts +0 -22
  145. package/src/components/subnav/partials/CtaLinks/github-stars-link/index.tsx +0 -87
  146. package/src/components/subnav/partials/CtaLinks/github-stars-link/parseGithubUrl/index.test.ts +0 -29
  147. package/src/components/subnav/partials/CtaLinks/github-stars-link/parseGithubUrl/index.ts +0 -32
  148. package/src/components/subnav/partials/CtaLinks/github-stars-link/style.module.css +0 -85
  149. package/src/components/subnav/partials/CtaLinks/icons/github-logo.js +0 -20
  150. package/src/components/subnav/partials/CtaLinks/icons/github.svg.js +0 -7
  151. package/src/components/subnav/partials/CtaLinks/icons/star.js +0 -20
  152. package/src/components/subnav/partials/CtaLinks/index.tsx +0 -130
  153. package/src/components/subnav/partials/CtaLinks/style.module.css +0 -45
  154. package/src/components/subnav/partials/DropdownTrigger/index.tsx +0 -35
  155. package/src/components/subnav/partials/DropdownTrigger/style.module.css +0 -36
  156. package/src/components/subnav/partials/MenuItemsDefault/index.tsx +0 -151
  157. package/src/components/subnav/partials/MenuItemsDefault/style.module.css +0 -91
  158. package/src/components/subnav/partials/MenuItemsOverflow/index.tsx +0 -139
  159. package/src/components/subnav/partials/MenuItemsOverflow/style.module.css +0 -82
  160. package/src/components/subnav/partials/TitleLink/index.tsx +0 -113
  161. package/src/components/subnav/partials/TitleLink/mktg-logos/all-community-product-logos_on-dark.ts +0 -9
  162. package/src/components/subnav/partials/TitleLink/mktg-logos/all-community-product-logos_on-light.ts +0 -9
  163. package/src/components/subnav/partials/TitleLink/mktg-logos/all-primary-logos_on-dark.ts +0 -23
  164. package/src/components/subnav/partials/TitleLink/mktg-logos/all-primary-logos_on-light.ts +0 -23
  165. package/src/components/subnav/partials/TitleLink/style.module.css +0 -43
  166. package/src/components/subnav/partials/nav-item-text/index.tsx +0 -37
  167. package/src/components/subnav/partials/nav-item-text/style.module.css +0 -15
  168. package/src/components/subnav/style.module.css +0 -68
  169. package/src/components/subnav/subnav-consts.ts +0 -1
  170. package/src/components/subnav/theme.module.css +0 -50
@@ -1,45 +1,81 @@
1
+ @custom-media --dev-dot-viewport (min-width: 924px);
2
+
1
3
  .promo {
2
4
  display: flex;
3
- border-radius: var(--hdsplus-spacing-01);
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(--hdsplus-spacing-05) var(--hdsplus-spacing-08)
7
- var(--hdsplus-spacing-06) var(--hdsplus-spacing-08);
8
+ padding: var(--mds-spacing-05) var(--mds-spacing-08) var(--mds-spacing-06)
9
+ var(--mds-spacing-08);
8
10
  flex-direction: row;
9
- gap: var(--hdsplus-spacing-04);
10
- margin: var(--hdsplus-spacing-05);
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
- margin: 0;
14
- width: min-content;
15
- min-width: 100%;
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
+ &.topPromo {
32
+ margin-bottom: var(--mds-spacing-05);
33
+ }
34
+
35
+ margin: 0;
36
+ width: min-content;
37
+ min-width: 100%;
38
+ }
16
39
  }
17
40
  }
18
41
 
42
+ .topPromo {
43
+ margin-bottom: 0;
44
+ }
45
+
19
46
  .rightContent {
20
47
  display: flex;
21
48
  flex-wrap: wrap;
22
- gap: var(--hdsplus-spacing-03);
49
+ gap: var(--mds-spacing-03);
23
50
  width: 100%;
24
51
  justify-content: space-between;
25
52
  }
26
53
 
27
54
  .title {
28
- font-weight: var(--font-weight-semi-bold);
55
+ font-weight: var(--mds-typography-font-weight-semibold);
29
56
  }
30
57
 
31
58
  .description {
32
- font-size: var(--hdsplus-typography-body-200-font-size);
33
- font-weight: var(--token-typography-font-weight-regular);
34
- margin-top: var(--hdsplus-spacing-01);
59
+ font-size: var(--mds-typography-body-200-font-size);
60
+ font-weight: var(--mds-typography-font-weight-regular);
61
+ margin-top: var(--mds-spacing-01);
35
62
  }
36
63
 
37
64
  .icon {
38
65
  display: none;
39
66
 
40
67
  @media (--large) {
41
- display: block;
42
- margin-top: 3px;
68
+ @nest .noSide & {
69
+ display: block;
70
+ margin-top: 3px;
71
+ }
72
+ }
73
+
74
+ @media (--dev-dot-viewport) {
75
+ @nest .hasSide & {
76
+ display: block;
77
+ margin-top: 3px;
78
+ }
43
79
  }
44
80
  }
45
81
 
@@ -48,7 +84,7 @@
48
84
  display: flex;
49
85
  flex-direction: row;
50
86
  align-items: center;
51
- gap: var(--hdsplus-spacing-02);
87
+ gap: var(--mds-spacing-02);
52
88
 
53
89
  &:hover {
54
90
  text-decoration: underline;
@@ -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 }
@@ -1,16 +1,19 @@
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-design-system-components/src/components/flight-icon'
6
- import { TextPlus } from '@hashicorp/react-design-system-components/src/components/text'
7
- import { parseUrl } from '../../../lib/parse-url'
7
+ import FlightIcon from '../components/flight-icon'
8
+ import { Text } from '../components/text'
8
9
  import { trackNavClickEvent } from '../../../lib/track-nav-click-event'
9
10
  import * as NavigationMenu from '@radix-ui/react-navigation-menu'
11
+ import { LinkListProps } from '../components/link-list'
12
+ import NavLink from '../components/link'
10
13
  import s from './style.module.css'
11
14
 
12
15
  const PRODUCT_LOGO_MAP = new Map([
13
- ['Terraform', 'terraform-fill-color'],
16
+ ['Terraform', 'terraform-fill'],
14
17
  ['Packer', 'packer-fill-color'],
15
18
  ['Vault', 'vault-fill-color'],
16
19
  ['Boundary', 'boundary-fill-color'],
@@ -23,12 +26,20 @@ const PRODUCT_LOGO_MAP = new Map([
23
26
  ])
24
27
 
25
28
  const PRODUCT_LOGO_EXCEPTION_CLASSNAMES = {
29
+ Terraform: 'terraform',
26
30
  'HCP Vault Secrets': 'hcpVaultSecrets',
27
31
  'HCP Vault Radar': 'hcpVaultRadar',
28
32
  }
29
33
 
34
+ export type ProductCategoriesProps = Array<{
35
+ title: string
36
+ group?: LinkListProps['links'][0]
37
+ products: NavProductProps[]
38
+ }>
39
+
30
40
  export interface ProductsPanelProps {
31
- productCategories: any
41
+ locale?: string
42
+ productCategories: ProductCategoriesProps
32
43
  promo?: PromoProps
33
44
  sidePanel?: {
34
45
  label: string
@@ -39,27 +50,53 @@ export interface ProductsPanelProps {
39
50
  url: string
40
51
  }[]
41
52
  }
53
+ isPromoOnTop?: boolean
42
54
  }
43
55
 
44
56
  const ProductPanel = ({
57
+ locale,
45
58
  productCategories,
46
59
  promo,
47
60
  sidePanel,
61
+ isPromoOnTop = false,
48
62
  }: ProductsPanelProps) => {
49
63
  return (
50
- <NavPanel.Root className={s.productPanel}>
64
+ <NavPanel.Root
65
+ className={classNames(s.productPanel, {
66
+ [s.hasSide]: sidePanel,
67
+ [s.noSide]: !sidePanel,
68
+ [s.topPromo]: isPromoOnTop,
69
+ })}
70
+ hasSidePanel={Boolean(sidePanel)}
71
+ >
51
72
  <div className={s.mainPanel}>
52
- <NavPanel.Column>
73
+ {promo && isPromoOnTop ? (
74
+ <Promo
75
+ {...promo}
76
+ hasSidePanel={Boolean(sidePanel)}
77
+ isPromoOnTop={isPromoOnTop}
78
+ />
79
+ ) : null}
80
+ <NavPanel.Column hasSidePanel={Boolean(sidePanel)}>
53
81
  <ul className={s.productCategories}>
54
- {productCategories.map(({ title, products }) => {
82
+ {productCategories.map(({ group, title, products }) => {
55
83
  return (
56
- <li key={title} className={s.productCategory}>
57
- <TextPlus.Body className={s.eyebrow}>{title}</TextPlus.Body>
84
+ <li
85
+ key={title}
86
+ className={classNames(s.productCategory, {
87
+ [s.productCategoryHasGroup]: group,
88
+ })}
89
+ >
90
+ {group ? (
91
+ <NavLink {...group} className={s.productGroupLink} />
92
+ ) : (
93
+ <Text className={s.eyebrow}>{title}</Text>
94
+ )}
58
95
  <ul className={s.productList}>
59
96
  {products.map((product) => {
60
97
  return (
61
98
  <li key={product.url}>
62
- <NavProduct {...product} />
99
+ <NavProduct locale={locale} {...product} />
63
100
  </li>
64
101
  )
65
102
  })}
@@ -69,14 +106,16 @@ const ProductPanel = ({
69
106
  })}
70
107
  </ul>
71
108
  </NavPanel.Column>
72
- {promo ? <Promo {...promo} /> : null}
109
+ {promo && !isPromoOnTop ? (
110
+ <Promo {...promo} hasSidePanel={Boolean(sidePanel)} />
111
+ ) : null}
73
112
  </div>
74
113
 
75
114
  {sidePanel ? (
76
115
  <NavPanel.Column className={s.sidePanel}>
77
- <TextPlus.Body size="200" weight="semibold">
116
+ <Text size="200" weight="semibold" className={s.sidePanelText}>
78
117
  {sidePanel.label}
79
- </TextPlus.Body>
118
+ </Text>
80
119
 
81
120
  {/* ! TODO Replace the below list with the <LinkList /> component,
82
121
  That component will require a refactor to support greater customization
@@ -87,18 +126,26 @@ const ProductPanel = ({
87
126
  {sidePanel.navItems.map(({ icon, title, description, url }) => {
88
127
  return (
89
128
  <li key={title}>
90
- <Link href={parseUrl(url).href} className={s.sidePanelItem}>
129
+ <Link
130
+ aria-label={`${title} - ${description}`}
131
+ {...getLocalizedLinkProps(url, locale)}
132
+ locale={locale ? locale : undefined}
133
+ className={classNames(s.sidePanelItem, s.focusIndicator)}
134
+ >
91
135
  <div className={s.iconBackground}>
92
136
  <FlightIcon
93
- size={16}
94
137
  name={icon}
95
138
  color="var(--token-color-foreground-faint)"
96
139
  />
97
140
  </div>
98
141
  <div className={s.sidePanelItemContent}>
99
- <TextPlus.Body size="200" weight="semibold" tag="span">
142
+ <Text
143
+ size="200"
144
+ weight="semibold"
145
+ className={s.sidePanelText}
146
+ >
100
147
  {title}
101
- </TextPlus.Body>
148
+ </Text>
102
149
  <span className={s.sidePanelItemDesc}>{description}</span>
103
150
  </div>
104
151
  </Link>
@@ -113,16 +160,19 @@ const ProductPanel = ({
113
160
  }
114
161
 
115
162
  export interface NavProductProps {
163
+ locale?: string
116
164
  url: string
117
165
  product: Products | string
118
166
  description: string
119
167
  }
120
168
 
121
- function NavProduct({ url, product, description }: NavProductProps) {
169
+ function NavProduct({ locale, url, product, description }: NavProductProps) {
122
170
  return (
123
171
  <NavigationMenu.Link asChild>
124
172
  <Link
125
- href={parseUrl(url).href}
173
+ aria-label={`${product} - ${description}`}
174
+ {...getLocalizedLinkProps(url, locale)}
175
+ locale={locale ? locale : undefined}
126
176
  onClickCapture={() => {
127
177
  trackNavClickEvent(product, url, 'products')
128
178
  }}
@@ -1,11 +1,47 @@
1
+ @custom-media --dev-dot-viewport (min-width: 924px);
2
+
1
3
  .productPanel {
2
4
  height: 100%;
3
5
 
6
+ /* Temporarily included for devdot compatability
7
+ https://app.asana.com/1/90955849329269/project/1209320521286316/task/1210514680913728?focus=true */
8
+ --mds-spacing-01: 0.25rem;
9
+ --mds-spacing-02: 0.375rem;
10
+ --mds-spacing-03: 0.5rem;
11
+ --mds-spacing-04: 0.75rem;
12
+ --mds-spacing-05: 1rem;
13
+ --mds-spacing-06: 1.25rem;
14
+ --mds-spacing-07: 1.5rem;
15
+ --mds-spacing-08: 2rem;
16
+ --mds-spacing-09: 2.5rem;
17
+ --mds-spacing-10: 3rem;
18
+ --mds-spacing-11: 3.5rem;
19
+ --mds-spacing-12: 4rem;
20
+ --mds-spacing-13: 4.5rem;
21
+ --mds-spacing-14: 5.5rem;
22
+ --mds-spacing-15: 6rem;
23
+ --mds-spacing-16: 8rem;
24
+ --mds-spacing-17: 8.5rem;
25
+ --mds-typography-body-200-font-size: 0.875rem;
26
+ --mds-typography-font-weight-regular: 400;
27
+ --mds-typography-font-weight-semibold: 600;
28
+
4
29
  @media (--large) {
5
- display: grid;
6
- grid-template-rows: 1fr;
7
- grid-template-columns: max-content max-content;
8
- padding: 0;
30
+ &.noSide {
31
+ display: grid;
32
+ grid-template-rows: 1fr;
33
+ grid-template-columns: max-content max-content;
34
+ padding: 0;
35
+ }
36
+ }
37
+
38
+ @media (--dev-dot-viewport) {
39
+ &.hasSide {
40
+ display: grid;
41
+ grid-template-rows: 1fr;
42
+ grid-template-columns: max-content max-content;
43
+ padding: 0;
44
+ }
9
45
  }
10
46
  }
11
47
 
@@ -13,10 +49,22 @@
13
49
  list-style: none;
14
50
  padding: 0;
15
51
  display: grid;
16
- margin: var(--hdsplus-spacing-06) 0 0;
52
+ margin: var(--mds-spacing-07) 0 0;
53
+
54
+ @nest .topPromo & {
55
+ margin-bottom: var(--mds-spacing-07);
56
+ }
17
57
 
18
58
  @media (--large) {
19
- margin: 0;
59
+ @nest .noSide & {
60
+ margin: 0;
61
+ }
62
+ }
63
+
64
+ @media (--dev-dot-viewport) {
65
+ @nest .hasSide & {
66
+ margin: 0;
67
+ }
20
68
  }
21
69
  }
22
70
 
@@ -27,19 +75,28 @@
27
75
 
28
76
  &:first-child {
29
77
  border-bottom: 1px solid var(--token-color-border-primary);
30
- margin-bottom: var(--hdsplus-spacing-05);
31
- padding-bottom: var(--hdsplus-spacing-05);
78
+ margin-bottom: var(--mds-spacing-05);
79
+ padding-bottom: var(--mds-spacing-05);
32
80
  }
33
81
  }
34
82
 
35
83
  .eyebrow {
36
- padding-bottom: var(--hdsplus-spacing-04);
84
+ padding-bottom: var(--mds-spacing-04);
37
85
  color: var(--token-color-foreground-strong);
38
- font-weight: var(--font-weight-semi-bold);
86
+ font-weight: var(--mds-typography-font-weight-semibold);
39
87
 
40
88
  @media (--large) {
41
- padding-bottom: 0;
42
- padding-left: var(--hdsplus-spacing-06);
89
+ @nest .noSide & {
90
+ padding-bottom: 0;
91
+ padding-left: var(--mds-spacing-06);
92
+ }
93
+ }
94
+
95
+ @media (--dev-dot-viewport) {
96
+ @nest .hasSide & {
97
+ padding-bottom: 0;
98
+ padding-left: var(--mds-spacing-06);
99
+ }
43
100
  }
44
101
  }
45
102
 
@@ -51,12 +108,29 @@
51
108
  padding: 0;
52
109
 
53
110
  @media (--large) {
54
- padding: var(--hdsplus-spacing-06) var(--hdsplus-spacing-05)
55
- var(--hdsplus-spacing-04);
56
- grid-auto-flow: row;
57
- grid-template-columns: repeat(2, 300px);
58
- grid-template-rows: repeat(2, max-content);
59
- gap: 0;
111
+ @nest .noSide & {
112
+ padding: var(--mds-spacing-06) var(--mds-spacing-05) var(--mds-spacing-04);
113
+ grid-auto-flow: row;
114
+ grid-template-columns: repeat(2, 300px);
115
+ grid-template-rows: repeat(2, max-content);
116
+ gap: 0;
117
+ }
118
+ }
119
+
120
+ @media (--dev-dot-viewport) {
121
+ @nest .hasSide & {
122
+ padding: var(--mds-spacing-06) var(--mds-spacing-05) var(--mds-spacing-04);
123
+ grid-auto-flow: row;
124
+ grid-template-columns: repeat(2, 300px);
125
+ grid-template-rows: repeat(2, max-content);
126
+ gap: 0;
127
+ }
128
+ }
129
+
130
+ & li:last-child {
131
+ & .productWrapper {
132
+ margin-bottom: 0;
133
+ }
60
134
  }
61
135
  }
62
136
 
@@ -64,16 +138,30 @@
64
138
 
65
139
  .productWrapper {
66
140
  display: flex;
67
- margin-bottom: var(--hdsplus-spacing-05);
68
- gap: var(--hdsplus-spacing-05);
141
+ margin-bottom: var(--mds-spacing-05);
142
+ gap: var(--mds-spacing-05);
69
143
 
70
144
  @media (--large) {
71
- padding: var(--hdsplus-spacing-03) var(--hdsplus-spacing-05);
72
- margin-bottom: 0;
145
+ @nest .noSide & {
146
+ padding: var(--mds-spacing-03) var(--mds-spacing-05);
147
+ margin-bottom: 0;
148
+
149
+ &:hover {
150
+ background-color: var(--token-color-surface-interactive-hover);
151
+ border-radius: var(--mds-spacing-01);
152
+ }
153
+ }
154
+ }
73
155
 
74
- &:hover {
75
- background-color: var(--token-color-surface-interactive-hover);
76
- border-radius: var(--hdsplus-spacing-01);
156
+ @media (--dev-dot-viewport) {
157
+ @nest .hasSide & {
158
+ padding: var(--mds-spacing-03) var(--mds-spacing-05);
159
+ margin-bottom: 0;
160
+
161
+ &:hover {
162
+ background-color: var(--token-color-surface-interactive-hover);
163
+ border-radius: var(--mds-spacing-01);
164
+ }
77
165
  }
78
166
  }
79
167
  }
@@ -84,10 +172,23 @@
84
172
  & svg {
85
173
  height: 42px;
86
174
  width: 42px;
175
+ }
176
+
177
+ @nest .noSide & {
178
+ & svg {
179
+ @media (--large) {
180
+ height: var(--mds-spacing-08);
181
+ width: var(--mds-spacing-08);
182
+ }
183
+ }
184
+ }
87
185
 
88
- @media (--large) {
89
- height: var(--hdsplus-spacing-08);
90
- width: var(--hdsplus-spacing-08);
186
+ @nest .hasSide & {
187
+ & svg {
188
+ @media (--dev-dot-viewport) {
189
+ height: var(--mds-spacing-08);
190
+ width: var(--mds-spacing-08);
191
+ }
91
192
  }
92
193
  }
93
194
  }
@@ -119,9 +220,30 @@
119
220
  justify-content: space-between;
120
221
  flex-direction: column;
121
222
 
223
+ @nest .topPromo & {
224
+ justify-content: flex-start;
225
+ }
226
+
122
227
  @media (--large) {
123
- padding: var(--hdsplus-spacing-07) 0 var(--hdsplus-spacing-05)
124
- var(--hdsplus-spacing-04);
228
+ @nest .noSide & {
229
+ padding: var(--mds-spacing-07) 0 var(--mds-spacing-09)
230
+ var(--mds-spacing-04);
231
+ }
232
+
233
+ @nest .topPromo & {
234
+ padding-bottom: var(--mds-spacing-04);
235
+ }
236
+ }
237
+
238
+ @media (--dev-dot-viewport) {
239
+ @nest .hasSide & {
240
+ padding: var(--mds-spacing-07) 0 var(--mds-spacing-09)
241
+ var(--mds-spacing-04);
242
+ }
243
+
244
+ @nest .topPromo & {
245
+ padding-bottom: var(--mds-spacing-04);
246
+ }
125
247
  }
126
248
  }
127
249
 
@@ -130,10 +252,10 @@
130
252
  background: var(--token-color-surface-faint);
131
253
  display: flex;
132
254
  flex-direction: column;
133
- gap: var(--hdsplus-spacing-05);
255
+ gap: var(--mds-spacing-05);
134
256
  margin: 0;
135
- padding: var(--hdsplus-spacing-07) var(--hdsplus-spacing-04)
136
- var(--hdsplus-spacing-09) var(--hdsplus-spacing-07);
257
+ padding: var(--mds-spacing-07) var(--mds-spacing-04) var(--mds-spacing-09)
258
+ var(--mds-spacing-07);
137
259
  }
138
260
 
139
261
  .sidePanelItems {
@@ -142,26 +264,24 @@
142
264
  padding: 0;
143
265
  display: grid;
144
266
  grid-template-columns: 1fr;
145
- gap: var(--hdsplus-spacing-07);
267
+ gap: var(--mds-spacing-07);
146
268
 
147
- @media (--large) {
148
- gap: var(--hdsplus-spacing-05);
269
+ @media (--dev-dot-viewport) {
270
+ gap: var(--mds-spacing-05);
149
271
  }
150
272
  }
151
273
 
152
274
  /* Lifted from .productWrapper */
153
275
  .sidePanelItem {
154
276
  display: flex;
155
- margin-bottom: var(--hdsplus-spacing-05);
156
- gap: var(--hdsplus-spacing-05);
277
+ gap: var(--mds-spacing-05);
157
278
 
158
- @media (--large) {
159
- padding: var(--hdsplus-spacing-03) var(--hdsplus-spacing-05);
160
- margin-bottom: 0;
279
+ @media (--dev-dot-viewport) {
280
+ padding: var(--mds-spacing-03) var(--mds-spacing-05);
161
281
 
162
282
  &:hover {
163
283
  background-color: var(--token-color-surface-interactive-hover);
164
- border-radius: var(--hdsplus-spacing-01);
284
+ border-radius: var(--mds-spacing-01);
165
285
  }
166
286
  }
167
287
  }
@@ -170,8 +290,8 @@
170
290
  packages/react-components/src/components/nav-panel/components/link-list/style.module.css */
171
291
  .iconBackground {
172
292
  background: var(--token-color-foreground-high-contrast);
173
- height: var(--hdsplus-spacing-08);
174
- width: var(--hdsplus-spacing-08);
293
+ height: var(--mds-spacing-08);
294
+ width: var(--mds-spacing-08);
175
295
  display: flex;
176
296
  align-items: center;
177
297
  justify-content: center;
@@ -197,13 +317,28 @@ packages/react-components/src/components/nav-panel/components/link-list/style.mo
197
317
 
198
318
  /* Branding exception classnames */
199
319
 
320
+ /* Allows switching to a dark-mode-specific color for Terraform */
321
+ .terraform {
322
+ & use {
323
+ fill: var(--token-color-terraform-brand);
324
+
325
+ @nest [data-theme='dark'] & {
326
+ fill: var(--token-color-terraform-foreground);
327
+ }
328
+ }
329
+
330
+ & path {
331
+ fill: inherit;
332
+ }
333
+ }
334
+
200
335
  /* Styles for HCP Vault mimic the spec for `product-square` icons,
201
336
  while allowing the symbol inside the icon border to change color
202
337
  based on the site's theme
203
338
  */
204
339
  .hcpVaultSecrets,
205
340
  .hcpVaultRadar {
206
- padding: var(--hdsplus-spacing-01);
341
+ padding: var(--mds-spacing-01);
207
342
  border: 2px solid var(--token-color-vault-brand);
208
343
  border-radius: 3px;
209
344
 
@@ -215,3 +350,46 @@ packages/react-components/src/components/nav-panel/components/link-list/style.mo
215
350
  fill: inherit;
216
351
  }
217
352
  }
353
+
354
+ .sidePanelText {
355
+ font-weight: var(--mds-typography-font-weight-semibold);
356
+ }
357
+
358
+ .productCategoryHasGroup {
359
+ & .productList {
360
+ padding-left: 0;
361
+ padding-right: 0;
362
+ padding-top: 0;
363
+ }
364
+
365
+ & .productWrapper {
366
+ gap: var(--mds-spacing-04);
367
+
368
+ @media (--small) {
369
+ padding: var(--mds-spacing-03) var(--mds-spacing-05);
370
+ }
371
+ }
372
+
373
+ & .productLogo {
374
+ margin-top: 3px;
375
+ height: 32px;
376
+ width: 32px;
377
+ min-width: 32px;
378
+
379
+ & svg {
380
+ width: 100%;
381
+ height: 100%;
382
+ }
383
+ }
384
+
385
+ & .terraform {
386
+ width: 100%;
387
+ height: 100%;
388
+ }
389
+ }
390
+
391
+ .productGroupLink {
392
+ min-width: 100%;
393
+ max-width: 100%;
394
+ margin-bottom: var(--mds-spacing-03);
395
+ }