Files
threshold/website/components/downloader/dropdown/index.jsx
T
dcb609b831 [Website] Public Launch Assembly (#438)
* Reduce hero size for placeholder

* Clean up Sticky Footer

- Increase the specificity of the selector to prevent any accidental
collisions
- Account for the meganav that exists

* [Website] Add Boundary Features section to homepage (#436)

* Install and implement ProductFeaturesList

* Add images and content

* Inline the product features

* [Website] Add use cases section (#445)

* Commit to illustrate UseCases error

* update react image

* Add in content from design

* Tweaks

* Apply handy edits

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>
Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* [Website] Add SectionBreakCta component (#452)

* Create implement barebones component

* Build structure/add content

* Get CSS up to spec

- Typography
- spacing
- Layout
- box-shadow
- Accent line

* Mobile treatment

* Update URL

* Add a break-section to give bg on page

* Change link to outbound

Design is incorrect for this link

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* Reduce CSS selectors

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* [Website] Add branded CTA section (#450)

* Create skeleton for component

* Bring in line with CallToAction styles

* Set up background

* Typography and layout (and mobile)

* Button polish

* Changes to prep for updates

These will keep the homepage ready for component updates 
and the upcoming docs and download pages.

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* Address feedback

- Reduce button hackiness
- Adjust pattern position on mobile to not overlap button

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* Upgrade button, minor tweaks to BrandedCTA (#481)

* Updates dependencies

* [Website] Homepage hero updates (#503)

* Adjustments to align and lay out left side

* Implement hero background

* Adjust hero URLs

* Implement mobile hero pattern/tweaks

* Add video!

* Mobile tweaks

* Remove mobile bg

* Center the text/buttons on mobile

* Remove mobile hero pattern

* Address visual nits

* Adjust interface for video

* [Website] Add "How it works" section (#483)

* Create skeleton and implement component

* Add sections

* Add CSS and adjust structure

* Remove sections ternary

* Change nomenclature for clarity

* Mobile tweaks

* Tweaks inspired by HCP

* Create LogoList component skeleton

* Implement LogoList on main component

- Shift footertext responsibility to it
- Assume logos will be passed in, because it doesn't render otherwise
  anyway with the right checks

* Implement some logos/restructure LogoList

* CSS adjustments to logolist/section layout

* Show example for too many integrations

* Remove cutoff logic

* Add SVGs for diagram stack

* Combine SVGs into a component

This is necessary to act on various parts of the image independently.

* Fully combine SVG and remove unneeded CSS

* Further CSS cleanup

* Implement stickyness

* Set up active example checks for graphic

* Implement reactivity

- Apply styles based on inactivity or activity, whichever fits best
  per-element
- Add expected state to the general HowItWorks component, where it will
  be managed and passed into the diagram
- Make icon and arrow spacers use the same spacer class

* CSS tweaks for design/organization

* Implement scroll-to-animate functionality!

* Fill out icons for integrations

* Feature updates

- Move LogoList into folder
- Give descriptions some margin

* Mobile treatment tweaks

* Import logic from the cloud-platform page on .com

This fixes a bug in which the in-view example would not update in an
expected manner.

* Remove max-width adjustment on UL

* Fix need for height on the graphic

* Padding/margin tweaks

* Minor CSS tweaks

* Final padding adjustments

* Plugging in proper content into the landing page (#545)

* Misc content updates to align with copy doc

* Plug in feature SVGs

* Move use cases up

* Remove the MegaNav - to be replaced soon

* Updates the nav

* Add footer content, security page

* Remove react-mega-nav from styles

* Downloads Page (#541)

* [Website] Add use cases section (#445)

* Commit to illustrate UseCases error

* update react image

* Add in content from design

* Tweaks

* Apply handy edits

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>
Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* Port new downloader page to Boundary

* update placeholder data

* missing css property

* Fix the weird rebase

* Fix padding

Co-authored-by: Noel Quiles <3746694+EnMod@users.noreply.github.com>
Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>
Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* [Website] Add alert banner (#557)

* Bring over waypoint's implementation

* Prove that it works/theme to boundary

* revert to hidden for now

* [Website] README polish (#558)

* Adjust readme for boundary

* Correct URL in first paragraph

* [Website] Add community page (#555)

* Just import files from Consul

* Revert CSS paradigm for VerticalBlockList

* Adds community to the nav

Co-authored-by: Brandon Romano <BrandonRRomano@gmail.com>

* A few small content / bug tweaks (#563)

* adds HashiStackMenu

* Fix platform agnostic copy

* Reduce padding between sections

* Fix Subnav indicator for docs page

* Fix features padding

* Adds Favicon

* Update how it works content

* Adds share image

* Updates use cases

* Styling to community page

* Remove some color overrides

* Add SVGO option to nextconfig (#565)

* Add press kit to footer (#567)

* Plug in proper link for onboard users

* Plug in proper video URL (#584)

* Bump HSM version (#582)

* Downloads Page Content (#585)

* Wire up Boundary Downloads content

* Plug in remaining downloads content

* Download via Product slug

* Tweak with transition timing (#587)

* Plug in proper logo into the downloads page (#589)

* Content tweaks (#590)

* Remove border top from footer (#591)

* More content tweaks (#608)

* Updates the hero to support UI/CLI previews (#609)

* Updates the hero to support UI/CLI previews

* Updates video

* More content tweaks (#634)

* Plugs in light theme UI video

* Update infra as code feature

* Remove Auth (#636)

* Remove auth-related files

* Remove auth-related config

* Remove auth provider and next-auth pkgs

* Remove *env.local from gitignore

* Swtich og:image to have a www subdomain

Co-authored-by: Noel Quiles <3746694+EnMod@users.noreply.github.com>

* Elevate prop destructuring to function call

Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>

* Update website/pages/community/index.jsx

Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>

Co-authored-by: Noel Quiles <3746694+EnMod@users.noreply.github.com>
Co-authored-by: Jeff Escalante <jescalan@users.noreply.github.com>
Co-authored-by: Zack Tanner <zacktanner@gmail.com>
Co-authored-by: Jimmy Merritello <7191639+jmfury@users.noreply.github.com>
2020-10-12 15:56:27 -07:00

59 lines
1.7 KiB
React

import { useState, useRef, useEffect } from 'react'
import Button from '@hashicorp/react-button'
import styles from './style.module.css'
export default function Dropdown({ options, onChange, title, brand }) {
const [open, setOpen] = useState(false)
const buttonRef = useRef()
useEffect(() => {
function handleClickOutside(event) {
if (buttonRef.current.contains(event.target)) return
setOpen(false)
}
document.addEventListener('mousedown', handleClickOutside)
return () => {
document.removeEventListener('mousedown', handleClickOutside)
}
}, [])
return (
<div className={styles.root} ref={buttonRef}>
<Button
className="trigger"
theme={{ brand }}
onClick={() => setOpen((open) => !open)}
aria-expanded={open}
aria-controls="menu-list"
aria-haspopup="true"
title={title}
icon={{
position: 'right',
svg:
'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 7.5L10 12.5L15 7.5" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',
}}
/>
{open && (
<ul className={styles.menu} id="menu-list" role="menu">
{options.map((option) => (
<li
className={styles.option}
tabIndex={0}
role="menuitem"
key={option.value}
onClick={() => {
onChange(option.value)
setOpen(false)
}}
>
{option.label}
</li>
))}
</ul>
)}
</div>
)
}