@hashicorp/react-components 0.0.0-nightly.8df4a87 → 0.0.0-nightly.f3bf415

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-nightly.8df4a87",
3
+ "version": "0.0.0-nightly.f3bf415",
4
4
  "main": "src/index.ts",
5
5
  "scripts": {
6
6
  "lint": "next-hashicorp lint",
@@ -1,9 +1,9 @@
1
1
  import Link from 'next/link'
2
2
  import { parseUrl } from '../../../../../../../apps/www/lib/parseUrl'
3
- import s from './style.module.css'
4
3
  import { v } from '@web/cms'
5
4
  import FlightIcon from '@hashicorp/react-design-system-components/src/components/flight-icon'
6
5
  import * as NavigationMenu from '@radix-ui/react-navigation-menu'
6
+ import s from './style.module.css'
7
7
 
8
8
  export interface LinkListProps {
9
9
  links: {
@@ -1,12 +1,12 @@
1
1
  import { useCallback } from 'react'
2
2
  import { trackNavClickEvent } from '../../../../../../../apps/www/layouts/standard/nav'
3
3
  import { v } from '@web/cms'
4
- import s from './style.module.css'
5
4
  import Link from 'next/link'
6
5
  import classNames from 'classnames'
7
6
  import { parseUrl } from '../../../../../../../apps/www/lib/parseUrl'
8
7
  import FlightIcon from '@hashicorp/react-design-system-components/src/components/flight-icon'
9
8
  import * as NavigationMenu from '@radix-ui/react-navigation-menu'
9
+ import s from './style.module.css'
10
10
 
11
11
  export interface PromoProps {
12
12
  title: string
@@ -6,8 +6,8 @@ import FlightIcon from '@hashicorp/react-design-system-components/src/components
6
6
  import { TextPlus } from '@hashicorp/react-design-system-components/src/components/text'
7
7
  import { parseUrl } from '../../../../../../apps/www/lib/parseUrl'
8
8
  import { trackNavClickEvent } from '../../../../../../apps/www/layouts/standard/nav'
9
- import s from './style.module.css'
10
9
  import * as NavigationMenu from '@radix-ui/react-navigation-menu'
10
+ import s from './style.module.css'
11
11
 
12
12
  const PRODUCT_LOGO_MAP = new Map([
13
13
  ['Terraform', 'terraform-fill-color'],
@@ -3,7 +3,7 @@
3
3
  * SPDX-License-Identifier: MPL-2.0
4
4
  */
5
5
 
6
- import * as React from 'react'
6
+ import { useState } from 'react'
7
7
  import Badge from '@hashicorp/react-badge'
8
8
  import classNames from 'classnames'
9
9
  import ExpandableArrow from '@hashicorp/react-expandable-arrow'
@@ -23,16 +23,10 @@ export default function NextSteps({
23
23
  steps,
24
24
  cta,
25
25
  }: NextStepsProps) {
26
- const { slug, themeClass } = useProductMeta(theme)
27
-
26
+ const { themeClass } = useProductMeta(theme)
28
27
  return (
29
28
  <section
30
- className={classNames(
31
- s.nextSteps,
32
- s[appearance],
33
- themeClass,
34
- slug && s[slug]
35
- )}
29
+ className={classNames(s.nextSteps, s[appearance], themeClass)}
36
30
  data-testid="next-steps"
37
31
  >
38
32
  <div className={s.container}>
@@ -96,7 +90,7 @@ export default function NextSteps({
96
90
  }
97
91
 
98
92
  function Tile({ theme, variant, heading, badge, description, cta }) {
99
- const [isHovered, setIsHovered] = React.useState(false)
93
+ const [isHovered, setIsHovered] = useState(false)
100
94
  return (
101
95
  <Link href={cta.url} legacyBehavior>
102
96
  <a
@@ -1,17 +1,14 @@
1
+ 'use client'
2
+
1
3
  /**
2
4
  * Copyright (c) HashiCorp, Inc.
3
5
  * SPDX-License-Identifier: MPL-2.0
4
6
  */
5
-
6
- 'use client'
7
-
8
7
  import { useState } from 'react'
9
8
  import classNames from 'classnames'
10
9
  import useProductMeta, { Products } from '@hashicorp/platform-product-meta'
11
10
  import { THEMES } from './subnav-consts'
12
11
  import useNavRef from './helpers/useNavRef'
13
- import s from './style.module.css'
14
- import themeStyles from './theme.module.css'
15
12
 
16
13
  import MenuItemsOverflow from './partials/MenuItemsOverflow'
17
14
  import TitleLink from './partials/TitleLink'
@@ -20,6 +17,8 @@ import CtaLinks, { type CtaLinkProps } from './partials/CtaLinks'
20
17
  import traverse, { isObject } from './helpers/traverse'
21
18
  import { areBasePathsMatching } from './helpers/areBasePathsMatching'
22
19
  import * as NavigationMenu from '@radix-ui/react-navigation-menu'
20
+ import themeStyles from './theme.module.css'
21
+ import s from './style.module.css'
23
22
 
24
23
  const productAllowList = {
25
24
  consul: 'consul',
@@ -76,7 +75,6 @@ function SubnavInner({
76
75
  menuText = 'Menu',
77
76
  activatePanel,
78
77
  }: SubnavInnerProps) {
79
- const { themeClass } = useProductMeta(product) // overrides --brand css vars
80
78
  // Add _isActiveUrl to menuItems so we can highlight them appropriately
81
79
  const menuItemsWithActive = traverse(menuItems, (_key, value: any) => {
82
80
  const hasUrl = isObject(value) && value.url
@@ -88,6 +86,8 @@ function SubnavInner({
88
86
  return value
89
87
  })
90
88
 
89
+ const { themeClass } = useProductMeta(product)
90
+
91
91
  /**
92
92
  * Note on constrainWidth & g-grid-container
93
93
  *
@@ -12,8 +12,8 @@ import type { ToggleButtonProps } from '@hashicorp/react-design-system-component
12
12
  import * as Dropdown from '@hashicorp/react-design-system-components/src/components/dropdown'
13
13
  import GithubStarsLink from './github-stars-link'
14
14
  import classNames from 'classnames'
15
- import s from './style.module.css'
16
15
  import * as NavigationMenu from '@radix-ui/react-navigation-menu'
16
+ import s from './style.module.css'
17
17
 
18
18
  type CtaLink = ButtonProps & { href: string; __typename?: string }
19
19
 
@@ -5,8 +5,8 @@
5
5
 
6
6
  import FlightIcon from '@hashicorp/react-design-system-components/src/components/flight-icon'
7
7
  import NavItemText from '../nav-item-text'
8
- import s from './style.module.css'
9
8
  import * as NavigationMenu from '@radix-ui/react-navigation-menu'
9
+ import s from './style.module.css'
10
10
 
11
11
  interface DropdownTriggerProps {
12
12
  text: string
@@ -7,8 +7,8 @@ import React from 'react'
7
7
  import Link from 'next/link'
8
8
  import NavItemText from '../nav-item-text'
9
9
  import DropdownTrigger from '../DropdownTrigger'
10
- import s from './style.module.css'
11
10
  import * as NavigationMenu from '@radix-ui/react-navigation-menu'
11
+ import s from './style.module.css'
12
12
 
13
13
  interface MenuItemsDefaultProps {
14
14
  menuItems: (
@@ -9,9 +9,9 @@ import Link from 'next/link'
9
9
  import type { Products } from '@hashicorp/platform-product-meta'
10
10
  import CtaLinks, { type CtaLinkProps } from '../CtaLinks'
11
11
  import DropdownTrigger from '../DropdownTrigger'
12
- import s from './style.module.css'
13
12
  import * as NavigationMenu from '@radix-ui/react-navigation-menu'
14
13
  import classNames from 'classnames'
14
+ import s from './style.module.css'
15
15
 
16
16
  interface MenuItemsOverflowProps {
17
17
  menuItems: (