@hashicorp/react-components 0.0.0-canary.1fe3c0a → 0.0.0-canary.29ac326

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/react-components",
3
- "version": "0.0.0-canary.1fe3c0a",
3
+ "version": "0.0.0-canary.29ac326",
4
4
  "main": "src/index.ts",
5
5
  "scripts": {
6
6
  "lint": "next-hashicorp lint",
@@ -426,6 +426,10 @@ export const resolverErrors = (
426
426
  * @returns MarketoFormField[] with columnSplit property set
427
427
  */
428
428
  export function setFieldsColumnSplit(fieldsArr: MarketoFormField[]) {
429
+ if (!fieldsArr) {
430
+ return []
431
+ }
432
+
429
433
  return fieldsArr.map((f) => {
430
434
  const columnSplit = getFieldColumnSplit(fieldsArr, f)
431
435
  return { ...f, columnSplit }
@@ -18,8 +18,15 @@ const PRODUCT_LOGO_MAP = new Map([
18
18
  ['Nomad', 'nomad-fill-color'],
19
19
  ['Waypoint', 'waypoint-fill-color'],
20
20
  ['Vagrant', 'vagrant-fill-color'],
21
+ ['HCP Vault Secrets', 'vault-secrets'],
22
+ ['HCP Vault Radar', 'vault-radar'],
21
23
  ])
22
24
 
25
+ const PRODUCT_LOGO_EXCEPTION_CLASSNAMES = {
26
+ 'HCP Vault Secrets': 'hcpVaultSecrets',
27
+ 'HCP Vault Radar': 'hcpVaultRadar',
28
+ }
29
+
23
30
  export interface ProductsPanelProps {
24
31
  productCategories: any
25
32
  promo?: PromoProps
@@ -29,6 +36,7 @@ export interface ProductsPanelProps {
29
36
  icon: string
30
37
  title: string
31
38
  description: string
39
+ url: string
32
40
  }[]
33
41
  }
34
42
  }
@@ -69,23 +77,31 @@ const ProductPanel = ({
69
77
  <TextPlus.Body size="200" weight="semibold">
70
78
  {sidePanel.label}
71
79
  </TextPlus.Body>
80
+
81
+ {/* ! TODO Replace the below list with the <LinkList /> component,
82
+ That component will require a refactor to support greater customization
83
+ Ticket:
84
+ https://app.asana.com/0/1206176289707208/1208162145034615/f
85
+ */}
72
86
  <ul className={s.sidePanelItems}>
73
- {sidePanel.navItems.map(({ icon, title, description }) => {
87
+ {sidePanel.navItems.map(({ icon, title, description, url }) => {
74
88
  return (
75
- <li key={title} className={s.sidePanelItem}>
76
- <div className={s.iconBackground}>
77
- <FlightIcon
78
- size={16}
79
- name={icon}
80
- color="var(--token-color-foreground-faint)"
81
- />
82
- </div>
83
- <div className={s.sidePanelItemContent}>
84
- <TextPlus.Body size="200" weight="semibold" tag="span">
85
- {title}
86
- </TextPlus.Body>
87
- <span className={s.sidePanelItemDesc}>{description}</span>
88
- </div>
89
+ <li key={title}>
90
+ <Link href={parseUrl(url).href} className={s.sidePanelItem}>
91
+ <div className={s.iconBackground}>
92
+ <FlightIcon
93
+ size={16}
94
+ name={icon}
95
+ color="var(--token-color-foreground-faint)"
96
+ />
97
+ </div>
98
+ <div className={s.sidePanelItemContent}>
99
+ <TextPlus.Body size="200" weight="semibold" tag="span">
100
+ {title}
101
+ </TextPlus.Body>
102
+ <span className={s.sidePanelItemDesc}>{description}</span>
103
+ </div>
104
+ </Link>
89
105
  </li>
90
106
  )
91
107
  })}
@@ -116,6 +132,11 @@ function NavProduct({ url, product, description }: NavProductProps) {
116
132
  <div className={s.productLogo}>
117
133
  <FlightIcon
118
134
  name={PRODUCT_LOGO_MAP.get(product) ?? 'hashicorp-fill-color'}
135
+ className={
136
+ PRODUCT_LOGO_EXCEPTION_CLASSNAMES[product]
137
+ ? s[PRODUCT_LOGO_EXCEPTION_CLASSNAMES[product]]
138
+ : undefined
139
+ }
119
140
  />
120
141
  </div>
121
142
  <div className={s.productTextContent}>
@@ -164,9 +164,9 @@
164
164
  }
165
165
 
166
166
  /* Lifted from:
167
- /Users/nquiles/git/web/packages/react-components/src/components/nav-panel/components/link-list/style.module.css */
167
+ packages/react-components/src/components/nav-panel/components/link-list/style.module.css */
168
168
  .iconBackground {
169
- background: var(--token-color-page-primary);
169
+ background: var(--token-color-foreground-high-contrast);
170
170
  height: var(--hdsplus-spacing-08);
171
171
  width: var(--hdsplus-spacing-08);
172
172
  display: flex;
@@ -175,6 +175,7 @@
175
175
  border-radius: 3px;
176
176
  flex: none;
177
177
  margin-top: 3px;
178
+ border: 1px solid var(--token-color-border-primary);
178
179
  }
179
180
 
180
181
  /* Lifted from .productTextContent */
@@ -184,9 +185,26 @@
184
185
  color: var(--token-color-foreground-strong);
185
186
  }
186
187
 
187
- .sidePanelItem .sidePanelItemDesc {
188
+ .sidePanelItemDesc {
188
189
  font-weight: 400;
189
190
  font-size: 13px;
190
191
  line-height: 18px;
191
192
  color: var(--token-color-foreground-primary);
192
193
  }
194
+
195
+ /* Branding exception classnames */
196
+
197
+ .hcpVaultSecrets,
198
+ .hcpVaultRadar {
199
+ padding: var(--hdsplus-spacing-01);
200
+ border: 2px solid var(--token-color-vault-brand);
201
+ border-radius: 3px;
202
+
203
+ & use {
204
+ fill: var(--token-color-foreground-strong);
205
+ }
206
+
207
+ & path {
208
+ fill: inherit;
209
+ }
210
+ }