@hashicorp/react-components 0.0.0-canary.29ac326 → 0.0.0-canary.32599ff

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/package.json +7 -6
  2. package/src/components/actions/index.tsx +5 -5
  3. package/src/components/call-to-action/index.tsx +12 -10
  4. package/src/components/call-to-action/styles/variant-centered.module.css +5 -4
  5. package/src/components/call-to-action/styles/variant-compact-grid.module.css +6 -4
  6. package/src/components/call-to-action/styles/variant-compact.module.css +6 -4
  7. package/src/components/call-to-action/styles/variant-links.module.css +6 -11
  8. package/src/components/card/index.test.tsx +1 -1
  9. package/src/components/card/newsroom-card/index.test.tsx +1 -1
  10. package/src/components/card/newsroom-card/style.module.css +1 -1
  11. package/src/components/card/partner-card/index.tsx +5 -5
  12. package/src/components/card/person-card/index.tsx +3 -3
  13. package/src/components/card/primitives.tsx +20 -19
  14. package/src/components/card/resource-card/index.test.tsx +1 -1
  15. package/src/components/card/resource-card/index.tsx +3 -0
  16. package/src/components/card/style.module.css +2 -2
  17. package/src/components/card/types.ts +2 -2
  18. package/src/components/card/unified-card/index.spec.tsx +40 -0
  19. package/src/components/card/unified-card/index.tsx +5 -11
  20. package/src/components/inline-video/index.tsx +104 -0
  21. package/src/components/inline-video/style.module.css +99 -0
  22. package/src/components/intro/style.module.css +2 -2
  23. package/src/components/marketo-form/contexts/FormMetadata.ts +2 -0
  24. package/src/components/marketo-form/form/index.tsx +12 -7
  25. package/src/components/marketo-form/partials/fields/checkbox-field/index.tsx +1 -1
  26. package/src/components/marketo-form/partials/fields/email-field/index.tsx +1 -1
  27. package/src/components/marketo-form/partials/fields/form-page-url-field/index.tsx +12 -1
  28. package/src/components/marketo-form/partials/fields/hidden-field/index.tsx +1 -0
  29. package/src/components/marketo-form/partials/fields/htmltext-field/style.module.css +2 -2
  30. package/src/components/marketo-form/partials/fields/radio-buttons-field/index.tsx +1 -1
  31. package/src/components/marketo-form/partials/fields/select-field/index.tsx +1 -1
  32. package/src/components/marketo-form/partials/fields/telephone-field/index.tsx +1 -1
  33. package/src/components/marketo-form/partials/fields/text-field/index.tsx +1 -1
  34. package/src/components/marketo-form/partials/fields/textarea-field/index.tsx +1 -1
  35. package/src/components/marketo-form/types.ts +10 -12
  36. package/src/components/marketo-form/utils.ts +1 -1
  37. package/src/components/nav-panel/components/link-list/index.tsx +15 -9
  38. package/src/components/nav-panel/components/link-list/style.module.css +10 -10
  39. package/src/components/nav-panel/components/panel/column/index.tsx +15 -2
  40. package/src/components/nav-panel/components/panel/column/style.module.css +13 -3
  41. package/src/components/nav-panel/components/panel/root/index.tsx +11 -2
  42. package/src/components/nav-panel/components/panel/root/style.module.css +20 -6
  43. package/src/components/nav-panel/components/promo/index.tsx +23 -10
  44. package/src/components/nav-panel/components/promo/style.module.css +48 -16
  45. package/src/components/nav-panel/product-panel/index.tsx +46 -16
  46. package/src/components/nav-panel/product-panel/style.module.css +151 -42
  47. package/src/components/nav-panel/standard-panel/index.tsx +3 -0
  48. package/src/components/nav-panel/standard-panel/style.module.css +2 -2
  49. package/src/components/next-steps/index.tsx +3 -2
  50. package/src/components/next-steps/style.module.css +18 -18
  51. package/src/components/product-badge/index.tsx +1 -1
  52. package/src/components/product-badge/style.module.css +2 -2
  53. package/src/components/products-used/style.module.css +7 -7
  54. package/src/components/related-content/index.tsx +28 -29
  55. package/src/components/related-content/style.module.css +58 -60
  56. package/src/components/related-content/types.ts +2 -2
  57. package/src/components/subnav/index.tsx +12 -3
  58. package/src/components/subnav/partials/CtaLinks/github-stars-link/style.module.css +8 -12
  59. package/src/components/subnav/partials/CtaLinks/index.tsx +9 -8
  60. package/src/components/subnav/partials/CtaLinks/style.module.css +6 -6
  61. package/src/components/subnav/partials/DropdownTrigger/index.tsx +2 -2
  62. package/src/components/subnav/partials/DropdownTrigger/style.module.css +11 -8
  63. package/src/components/subnav/partials/MenuItemsDefault/index.tsx +24 -8
  64. package/src/components/subnav/partials/MenuItemsDefault/style.module.css +44 -31
  65. package/src/components/subnav/partials/MenuItemsOverflow/index.tsx +17 -4
  66. package/src/components/subnav/partials/MenuItemsOverflow/style.module.css +24 -18
  67. package/src/components/subnav/partials/TitleLink/index.tsx +6 -4
  68. package/src/components/subnav/partials/TitleLink/mktg-logos/all-community-product-logos_on-dark.ts +2 -1
  69. package/src/components/subnav/partials/TitleLink/mktg-logos/all-community-product-logos_on-light.ts +2 -1
  70. package/src/components/subnav/partials/TitleLink/style.module.css +3 -3
  71. package/src/components/subnav/partials/nav-item-text/style.module.css +2 -4
  72. package/src/components/subnav/style.module.css +5 -7
  73. package/src/lib/get-localized-link-props/index.test.ts +30 -0
  74. package/src/lib/get-localized-link-props/index.ts +45 -0
  75. package/src/lib/parse-url/index.test.ts +40 -1
  76. package/src/lib/parse-url/index.ts +77 -9
  77. package/src/lib/supported-locales/index.ts +1 -0
  78. package/src/lib/track-nav-click-event/index.ts +4 -4
  79. package/src/lib/v/index.ts +4 -5
  80. package/src/components/consent-manager/README.md +0 -73
  81. package/src/components/consent-manager/components/banner/banner.module.css +0 -23
  82. package/src/components/consent-manager/components/banner/banner.test.tsx +0 -31
  83. package/src/components/consent-manager/components/banner/banner.tsx +0 -73
  84. package/src/components/consent-manager/components/dialog/dialog.module.css +0 -145
  85. package/src/components/consent-manager/components/dialog/dialog.test.tsx +0 -194
  86. package/src/components/consent-manager/components/dialog/dialog.tsx +0 -339
  87. package/src/components/consent-manager/img/icn_close.tsx +0 -19
  88. package/src/components/consent-manager/index.test.tsx +0 -334
  89. package/src/components/consent-manager/index.tsx +0 -186
  90. package/src/components/consent-manager/loader/README.md +0 -29
  91. package/src/components/consent-manager/loader/categories.ts +0 -22
  92. package/src/components/consent-manager/loader/index.tsx +0 -94
  93. package/src/components/consent-manager/loader/presets/enterprise.ts +0 -12
  94. package/src/components/consent-manager/loader/presets/oss.ts +0 -10
  95. package/src/components/consent-manager/loader/services.ts +0 -45
  96. package/src/components/consent-manager/scripts/custom.tsx +0 -59
  97. package/src/components/consent-manager/scripts/segment.tsx +0 -87
  98. package/src/components/consent-manager/style.module.css +0 -9
  99. package/src/components/consent-manager/types.ts +0 -55
  100. package/src/components/consent-manager/util/cookies.test.ts +0 -75
  101. package/src/components/consent-manager/util/cookies.ts +0 -70
  102. package/src/components/consent-manager/util/integrations.test.ts +0 -115
  103. package/src/components/consent-manager/util/integrations.ts +0 -110
  104. package/src/components/subnav/theme.module.css +0 -50
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ import { useEffect, useState } from 'react'
7
+ import classNames from 'classnames'
8
+ import WistiaPlayer from 'react-player/wistia'
9
+ import Player from 'react-player'
10
+ import s from './style.module.css'
11
+
12
+ interface InlineVideoProps {
13
+ appearance?: 'light' | 'dark'
14
+ url: string
15
+ description?: string
16
+ solution?: 'infrastructure' | 'security' | 'networking' | 'applications'
17
+ gradientPosition?: 'left' | 'right' | false
18
+ videoClassName?: string
19
+ aspectRatio?: string
20
+ showAccent?: boolean
21
+ }
22
+
23
+ const DEFAULT_ASPECT_RATIO = '16 / 9'
24
+
25
+ export default function InlineVideo(props: InlineVideoProps) {
26
+ const {
27
+ appearance = 'light',
28
+ gradientPosition = 'left',
29
+ url,
30
+ description,
31
+ solution,
32
+ videoClassName,
33
+ aspectRatio,
34
+ showAccent = true,
35
+ } = props
36
+
37
+ const hasAspectRatio = Boolean(aspectRatio)
38
+
39
+ const playerProps = {
40
+ controls: true,
41
+ url,
42
+ width: '100%',
43
+ height: '100%',
44
+ }
45
+
46
+ const [hasWindow, setHasWindow] = useState(false)
47
+
48
+ useEffect(() => {
49
+ if (typeof window !== 'undefined') {
50
+ setHasWindow(true)
51
+ }
52
+ }, [])
53
+
54
+ return (
55
+ <div
56
+ className={classNames(
57
+ s.inlineVideo,
58
+ s[appearance],
59
+ gradientPosition && s[gradientPosition]
60
+ )}
61
+ data-testid="wpl-inline-video"
62
+ >
63
+ <div
64
+ className={classNames(s.videoContainer, solution && s[solution], {
65
+ [s.hideAccentColor]: !showAccent,
66
+ })}
67
+ style={{
68
+ ['--aspect-ratio' as string]: hasAspectRatio
69
+ ? aspectRatio
70
+ : DEFAULT_ASPECT_RATIO,
71
+ }}
72
+ >
73
+ <div
74
+ className={classNames(
75
+ s.video,
76
+ {
77
+ [s.innerHasAspectRatio]: hasAspectRatio,
78
+ },
79
+ videoClassName
80
+ )}
81
+ >
82
+ {hasWindow ? (
83
+ <>
84
+ {url.includes('wistia') ? (
85
+ <WistiaPlayer
86
+ {...playerProps}
87
+ config={{
88
+ options: {
89
+ controlsVisibleOnLoad: false,
90
+ },
91
+ }}
92
+ />
93
+ ) : (
94
+ <Player {...playerProps} />
95
+ )}
96
+ </>
97
+ ) : null}
98
+ </div>
99
+ </div>
100
+
101
+ {description ? <p className={s.description}>{description}</p> : null}
102
+ </div>
103
+ )
104
+ }
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Copyright (c) HashiCorp, Inc.
3
+ * SPDX-License-Identifier: MPL-2.0
4
+ */
5
+
6
+ .inlineVideo {
7
+ --gradient-size: 32px;
8
+
9
+ /* Apply border radius to Wistia play button */
10
+ & :global(.w-bpb-wrapper) {
11
+ border-radius: 4px !important;
12
+ overflow: hidden;
13
+ }
14
+ }
15
+
16
+ .videoContainer {
17
+ --gradient: linear-gradient(180deg, #b5d9fa 0%, #1a5ee5 100%);
18
+
19
+ width: 100%;
20
+ position: relative;
21
+
22
+ @media (--large) {
23
+ @nest .left & {
24
+ padding-left: var(--gradient-size);
25
+ }
26
+
27
+ @nest .right & {
28
+ padding-right: var(--gradient-size);
29
+ }
30
+
31
+ &.hideAccentColor {
32
+ &::before {
33
+ background-image: none;
34
+ }
35
+ }
36
+
37
+ &::before {
38
+ position: absolute;
39
+ content: '';
40
+ width: 100%;
41
+ height: calc(100% - var(--gradient-size) * 2);
42
+ top: var(--gradient-size);
43
+ left: 0;
44
+ border-radius: 8px;
45
+ background-image: var(--gradient);
46
+ }
47
+ }
48
+
49
+ &.infrastructure {
50
+ --gradient: linear-gradient(180deg, #8cdeff 0%, #8763d9 100%);
51
+ }
52
+
53
+ &.security {
54
+ --gradient: linear-gradient(180deg, #ffe58c 0%, #f26b63 100%);
55
+ }
56
+
57
+ &.networking {
58
+ --gradient: linear-gradient(180deg, #ffb2b8 0%, #c74fb8 100%);
59
+ }
60
+
61
+ &.applications {
62
+ --gradient: linear-gradient(180deg, #a3f7d6 0%, #5cd1d9 50%, #5494e3 100%);
63
+ }
64
+ }
65
+
66
+ .video {
67
+ aspect-ratio: var(--aspect-ratio);
68
+ border-radius: 8px;
69
+ background-color: var(--wpl-neutral-50);
70
+ overflow: hidden;
71
+ position: relative;
72
+
73
+ @nest .dark & {
74
+ background-color: var(--wpl-neutral-800);
75
+ }
76
+
77
+ &.innerHasAspectRatio {
78
+ width: calc(var(--aspect-ratio) * 100%);
79
+ height: auto;
80
+ max-width: 100%;
81
+ }
82
+ }
83
+ .description {
84
+ composes: g-type-body-small-strong from global;
85
+ color: var(--wpl-neutral-500);
86
+ padding: 16px 24px 0 24px;
87
+ margin: 0;
88
+ text-align: center;
89
+
90
+ @media (--large) {
91
+ @nest .left & {
92
+ padding-left: calc(24px + var(--gradient-size));
93
+ }
94
+
95
+ @nest .right & {
96
+ padding-right: calc(24px + var(--gradient-size));
97
+ }
98
+ }
99
+ }
@@ -17,8 +17,8 @@
17
17
  .eyebrow {
18
18
  --color: var(--wpl-neutral-500);
19
19
 
20
- composes: hdsplus-typography-label from global;
21
- font-weight: var(--font-weight-bold);
20
+ composes: mds-typography-label from global;
21
+ font-weight: var(--mds-typography-font-weight-bold);
22
22
  text-transform: uppercase;
23
23
  margin: 0 0 32px;
24
24
  color: var(--color);
@@ -3,6 +3,8 @@
3
3
  * SPDX-License-Identifier: MPL-2.0
4
4
  */
5
5
 
6
+ 'use client'
7
+
6
8
  import { createContext } from 'react'
7
9
  import type { MarketoFormMetadata } from '../types'
8
10
 
@@ -3,9 +3,11 @@
3
3
  * SPDX-License-Identifier: MPL-2.0
4
4
  */
5
5
 
6
+ 'use client'
7
+
6
8
  import { useEffect, useMemo, useRef } from 'react'
7
9
  import { useForm, FormProvider } from 'react-hook-form'
8
- import Button from '@hashicorp/react-design-system-components/src/components/button'
10
+ import { HDSButton } from '@hashicorp/react-mds/src/hds/components/button'
9
11
  import VisibilityRule from '../partials/visibility-rule'
10
12
  import NameField from '../partials/fields/name-field'
11
13
  import { FormMetadataContext } from '../contexts/FormMetadata'
@@ -81,7 +83,10 @@ interface Props {
81
83
  /**
82
84
  * Callback called when form has been successfully submitted.
83
85
  */
84
- onSubmitSuccess?: () => void
86
+ onSubmitSuccess?: (
87
+ dataToPersist: Record<string, unknown>,
88
+ response: MarketoSubmissionResponse
89
+ ) => void
85
90
 
86
91
  /**
87
92
  * Callback called when form submission results in an error.
@@ -278,16 +283,16 @@ const Form = ({
278
283
  marketoResponse.success &&
279
284
  !includesSkippedRecords(marketoResponse)
280
285
  ) {
281
- if (onSubmitSuccess) {
282
- onSubmitSuccess()
283
- }
284
-
285
286
  // Remove fields that shouldn't be stored in local storage
286
287
  const dataToPersist = Object.fromEntries(
287
288
  Object.entries(data).filter(([k]) => STORED_FIELD_NAMES.includes(k))
288
289
  )
289
290
  localStorage.setItem('marketoFormData', JSON.stringify(dataToPersist))
290
291
 
292
+ if (onSubmitSuccess) {
293
+ onSubmitSuccess(dataToPersist, marketoResponse)
294
+ }
295
+
291
296
  if (resetOnSubmission) {
292
297
  methods.reset()
293
298
  }
@@ -345,7 +350,7 @@ const Form = ({
345
350
  />
346
351
  )
347
352
  })}
348
- <Button
353
+ <HDSButton
349
354
  type="submit"
350
355
  size="large"
351
356
  disabled={
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { useFormContext } from 'react-hook-form'
7
7
  // import CheckboxInput from '@hashicorp/react-form-fields/checkbox'
8
- import Checkbox from '@hashicorp/react-design-system-components/src/components/form/checkbox'
8
+ import Checkbox from '@hashicorp/react-mds/src/hds/components/form/checkbox'
9
9
  import FieldWrapper from '../../field-wrapper'
10
10
  import { formattedLabel, useErrorMessage } from '../../../utils'
11
11
  import type { MarketoFormCheckboxField } from '../../../types'
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { useFormContext } from 'react-hook-form'
7
7
  // import TextInput from '@hashicorp/react-form-fields/text'
8
- import TextInput from '@hashicorp/react-design-system-components/src/components/form/text-input'
8
+ import TextInput from '@hashicorp/react-mds/src/hds/components/form/text-input'
9
9
  import FieldWrapper from '../../field-wrapper'
10
10
  import { formattedLabel, useErrorMessage } from '../../../utils'
11
11
  import type { MarketoFormEmailField } from '../../../types'
@@ -3,8 +3,11 @@
3
3
  * SPDX-License-Identifier: MPL-2.0
4
4
  */
5
5
 
6
+ 'use client'
7
+
6
8
  import { useEffect } from 'react'
7
9
  import { useFormContext } from 'react-hook-form'
10
+ import { removeLocaleFromPathname } from '@web/utils/supported-locales/index'
8
11
  import type { MarketoFormHiddenField } from '../../../types'
9
12
 
10
13
  const FormPageUrlField = ({ field }: { field: MarketoFormHiddenField }) => {
@@ -12,7 +15,15 @@ const FormPageUrlField = ({ field }: { field: MarketoFormHiddenField }) => {
12
15
 
13
16
  useEffect(() => {
14
17
  const { protocol, host, pathname } = window.location
15
- setValue(field.id, `${protocol}//${host}${pathname}`)
18
+ // Marketo campaigns expect a URL that does not include the locale.
19
+ // This is because the campaigns were created prior to locales being
20
+ // added to hashicorp.com paths. As a result, we need to strip out the
21
+ // locale from the path in order for Marketo campaigns to work.
22
+ // In the future, we should better understand why this dependency exists
23
+ // and explore ways to make this less brittle.
24
+ const pathnameWithoutLocale = removeLocaleFromPathname(pathname)
25
+ const url = `${protocol}//${host}${pathnameWithoutLocale}`
26
+ setValue(field.id, url)
16
27
  }, [])
17
28
 
18
29
  return <input type="hidden" {...register(field.id)} />
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) HashiCorp, Inc.
3
3
  * SPDX-License-Identifier: MPL-2.0
4
4
  */
5
+ 'use client'
5
6
 
6
7
  import { useEffect } from 'react'
7
8
  import { useFormContext } from 'react-hook-form'
@@ -1,7 +1,7 @@
1
1
  .htmltext {
2
2
  composes: g-type-body-small from global;
3
- margin-top: var(--hdsplus-spacing-04);
4
- margin-bottom: var(--hdsplus-spacing-07);
3
+ margin-top: var(--mds-spacing-04);
4
+ margin-bottom: var(--mds-spacing-07);
5
5
  color: var(--token-color-foreground-faint);
6
6
 
7
7
  & a {
@@ -1,7 +1,7 @@
1
1
  import { useFormContext } from 'react-hook-form'
2
2
  import RadioCard, {
3
3
  RadioCardGroup,
4
- } from '@hashicorp/react-design-system-components/src/components/form/radio-card'
4
+ } from '@hashicorp/react-mds/src/hds/components/form/radio-card'
5
5
  import FieldWrapper from '../../field-wrapper'
6
6
  import type { MarketoFormRadioButtonsField } from '../../../types'
7
7
 
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { useFormContext } from 'react-hook-form'
7
- import Select from '@hashicorp/react-design-system-components/src/components/form/select'
7
+ import Select from '@hashicorp/react-mds/src/hds/components/form/select'
8
8
  import FieldWrapper from '../../field-wrapper'
9
9
  import { formattedLabel, useErrorMessage } from '../../../utils'
10
10
  import type { MarketoFormSelectField } from '../../../types'
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { useFormContext } from 'react-hook-form'
7
- import TextInput from '@hashicorp/react-design-system-components/src/components/form/text-input'
7
+ import TextInput from '@hashicorp/react-mds/src/hds/components/form/text-input'
8
8
  import FieldWrapper from '../../field-wrapper'
9
9
  import { formattedLabel, useErrorMessage } from '../../../utils'
10
10
  import type { MarketoFormTelephoneField } from '../../../types'
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { useFormContext } from 'react-hook-form'
7
- import TextInput from '@hashicorp/react-design-system-components/src/components/form/text-input'
7
+ import TextInput from '@hashicorp/react-mds/src/hds/components/form/text-input'
8
8
  import FieldWrapper from '../../field-wrapper'
9
9
  import { formattedLabel, useErrorMessage } from '../../../utils'
10
10
  import type { MarketoFormTextField } from '../../../types'
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { useFormContext } from 'react-hook-form'
7
- import Textarea from '@hashicorp/react-design-system-components/src/components/form/textarea'
7
+ import Textarea from '@hashicorp/react-mds/src/hds/components/form/textarea'
8
8
  import FieldWrapper from '../../field-wrapper'
9
9
  import { formattedLabel, useErrorMessage } from '../../../utils'
10
10
  import type { MarketoFormTextAreaField } from '../../../types'
@@ -15,6 +15,7 @@ export type MarketoFormDatatype =
15
15
  | 'hidden'
16
16
  | 'htmltext'
17
17
  | 'radioButtons'
18
+ | 'fieldset'
18
19
 
19
20
  export interface Autofill {
20
21
  value: string
@@ -41,7 +42,7 @@ export interface MarketoBaseFormField {
41
42
  columnNumber: number
42
43
  defaultValue?: string
43
44
  label?: string
44
- required: boolean
45
+ required?: boolean
45
46
  validationMessage?: string
46
47
  autoFill?: Autofill
47
48
  visibilityRules?: VisibilityRules
@@ -106,12 +107,9 @@ export interface MarketoFormHiddenField extends MarketoBaseFormField {
106
107
  dataType: 'hidden'
107
108
  }
108
109
 
109
- export interface MarketoFormHtmltextField {
110
- id: string
111
- labelWidth: number
110
+ export interface MarketoFormHtmltextField extends MarketoBaseFormField {
112
111
  dataType: 'htmltext'
113
- rowNumber: number
114
- columnNumber: number
112
+ labelWidth: number
115
113
  visibilityRules?: VisibilityRules
116
114
  text: string
117
115
  }
@@ -125,12 +123,8 @@ export interface MarketoFormRadioButtonsField extends MarketoBaseFormField {
125
123
  }
126
124
  }
127
125
 
128
- export interface MarketoFormFieldset {
129
- id: string
130
- label?: string
126
+ export interface MarketoFormFieldset extends MarketoBaseFormField {
131
127
  dataType: 'fieldset'
132
- rowNumber: number
133
- columnNumber: number
134
128
  visibilityRules?: VisibilityRules
135
129
  fields: Array<string>
136
130
  }
@@ -232,8 +226,12 @@ export type MarketoFormGroups = Record<
232
226
  export type SubmissionFilter = (req: NextApiRequest) => Promise<boolean>
233
227
 
234
228
  export interface MarketoSubmissionResponse {
229
+ requestId?: string
235
230
  success: boolean
236
- result: { status: 'created' | 'updated' | 'skipped' }[]
231
+ result: {
232
+ status: 'created' | 'updated' | 'skipped'
233
+ id?: number
234
+ }[]
237
235
  }
238
236
 
239
237
  export type OnSubmitData = Record<string, unknown>
@@ -18,7 +18,7 @@ import cookies from 'js-cookie'
18
18
  // endpoints return SOAP names, while others accept REST names. This object
19
19
  // contains all fields from our Marketo instance that have a REST name that is
20
20
  // different from the SOAP name.
21
- const soapToRESTFieldNames: Record<string, string> = {
21
+ export const soapToRESTFieldNames: Record<string, string> = {
22
22
  Address: 'address',
23
23
  AnnualRevenue: 'annualRevenue',
24
24
  AnonymousIP: 'anonymousIP',
@@ -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
  }
@@ -4,8 +4,21 @@ import s from './style.module.css'
4
4
  export interface NavColumnProps {
5
5
  className?: string
6
6
  children: React.ReactNode
7
+ hasSidePanel?: boolean
7
8
  }
8
9
 
9
- export default function Column({ className, children }: NavColumnProps) {
10
- return <div className={classNames(s.column, className)}>{children}</div>
10
+ export default function Column({
11
+ className,
12
+ children,
13
+ hasSidePanel,
14
+ }: NavColumnProps) {
15
+ return (
16
+ <div
17
+ className={classNames(s.column, className, {
18
+ [s.hasSide]: hasSidePanel,
19
+ })}
20
+ >
21
+ {children}
22
+ </div>
23
+ )
11
24
  }
@@ -1,3 +1,5 @@
1
+ @custom-media --dev-dot-viewport (min-width: 924px);
2
+
1
3
  .column {
2
4
  position: relative;
3
5
  display: flex;
@@ -5,10 +7,18 @@
5
7
  justify-content: flex-start;
6
8
  min-width: 190px;
7
9
  padding: 0;
8
- margin: 0 var(--hdsplus-spacing-05);
9
- border-radius: var(--hdsplus-spacing-03);
10
+ margin: 0 var(--mds-spacing-07);
11
+ border-radius: var(--mds-spacing-03);
10
12
 
11
13
  @media (--large) {
12
- margin: 0;
14
+ &:not(.hasSide) {
15
+ margin: 0;
16
+ }
17
+ }
18
+
19
+ @media (--dev-dot-viewport) {
20
+ &.hasSide {
21
+ margin: 0;
22
+ }
13
23
  }
14
24
  }
@@ -4,8 +4,17 @@ import s from './style.module.css'
4
4
  interface RootProps {
5
5
  className?: string
6
6
  children: React.ReactNode
7
+ hasSidePanel?: boolean
7
8
  }
8
9
 
9
- export default function Root({ className, children }: RootProps) {
10
- return <div className={classNames(s.root, className)}>{children}</div>
10
+ export default function Root({ className, children, hasSidePanel }: RootProps) {
11
+ return (
12
+ <div
13
+ className={classNames(s.root, className, {
14
+ [s.hasSide]: hasSidePanel,
15
+ })}
16
+ >
17
+ {children}
18
+ </div>
19
+ )
11
20
  }