-
Notifications
You must be signed in to change notification settings - Fork 221
feat: make dropdown component public #4345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
5cbde95
chore: copy internal dropdown to src/dropdown
mxschll 898be4a
feat: expose dropdown as core-only public component
mxschll ee1ce3c
fix: imports
mxschll c9645aa
fix: imports
mxschll 5932ac1
fix: imports
mxschll 064064a
fix: imports
mxschll 09c2675
fix: imports
mxschll bd85f00
chore: update jest snapshots
mxschll 78be693
feat: add test utils
mxschll 3710476
chore: move props to internal
mxschll 185aa97
chore: move focus props to internal
mxschll 035cad6
fix: typescript error
mxschll d65ee31
fix: typescript error
mxschll 94ec78d
chore: update jest snapshots
mxschll b44bde6
chore: add test util comments
mxschll eef69ef
chore: add tests for test utils
mxschll d77d370
fix: imports
mxschll 558f88a
chore: update jest snapshots
mxschll 4758aff
chore: add tests
mxschll 849631a
chore: update docs
mxschll 4aea120
fix: rename internal DropdownContentWrapper to OptionsDropdownContent…
mxschll e7c3615
fix: a11y issues
mxschll c8a1e33
fix: make codecov happy
mxschll 944b5fe
fix: imports
mxschll 610281c
fix: test
mxschll 2bfcff3
feat: add isOpen
mxschll 80933f4
chore: update bugbash page
mxschll 3890409
chore: update docs
mxschll b507a74
chore: update snapshots
mxschll 9b0f94b
chore: delete bugbash page
mxschll 6732ba9
chore: improve tests
mxschll 794531f
feat: add style api to dropdown
mxschll d5a3208
refactor: tests
mxschll 0904ca0
refactor: restore previous imports
mxschll e4cff60
refactor: restore previous code
mxschll 4868470
refactor: tests
mxschll ed7964f
refactor: tests
mxschll b165866
refactor: tests
mxschll dea489e
chore: update jest snapshot
mxschll c8875d0
fix: restore package-lock.json
mxschll 72f0b1a
refactor: use public dropdown on pages if possible
mxschll e5c65ab
refactor: documentation
mxschll d16040a
chore: update jest snapshots
mxschll ce0b1af
chore: update jest snapshots
mxschll 10aa074
refactor: remove clickTrigger test util
mxschll fc57492
refactor: move tests for style api into separate file
mxschll eed214c
refactor: delete unused function
mxschll 398dc5b
chore: update jest snapshots
mxschll b6dcdf2
chore: update docs
mxschll 1193919
fix: fire onOutsideClick when trigger wrapper is clicked
mxschll c22423a
chore: refactor test utils
mxschll 6382701
chore: update docs
mxschll 21483de
chore: update snapshots
mxschll 7794519
chore: update snapshots
mxschll 05c62e3
Merge remote-tracking branch 'origin/main' into dev-v3-schomax-dropdo…
mxschll 31625aa
fix: revert changes from merge
mxschll f31245a
fix: exclude external trigger ref from firing onOutisdeClick
mxschll d585a1a
chore: push package-lock.json changes
mxschll 9b66511
fix: naming
mxschll 7e461c5
chore: restore legacy selectors
mxschll 2d00948
chore: use legacy selectors in test utils
mxschll c7c4e63
Merge remote-tracking branch 'origin/main' into dev-v3-schomax-dropdo…
mxschll 6d9d4ac
chore: update jest snapshots
mxschll 64e67c0
chore: remove static var
mxschll 0da23a2
chore: refactor to make logic more intuitive
mxschll d30ad85
chore: add integ test for trigger wrapper click
mxschll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| import React, { useState } from 'react'; | ||
|
|
||
| import Button from '~components/button'; | ||
| import Dropdown from '~components/dropdown'; | ||
| import SpaceBetween from '~components/space-between'; | ||
|
|
||
| import ScreenshotArea from '../utils/screenshot-area'; | ||
| import ListContent from './list-content'; | ||
|
|
||
| export default function DropdownStylePermutations() { | ||
| const [open1, setOpen1] = useState(false); | ||
| const [open2, setOpen2] = useState(false); | ||
|
|
||
| return ( | ||
| <ScreenshotArea> | ||
| <h1>Dropdown Style Permutations</h1> | ||
| <SpaceBetween direction="vertical" size="xl"> | ||
| <section> | ||
| <h2>Custom background, no border</h2> | ||
| <Dropdown | ||
| trigger={<Button onClick={() => setOpen1(!open1)}>Open dropdown</Button>} | ||
| open={open1} | ||
| onOutsideClick={() => setOpen1(false)} | ||
| minWidth={400} | ||
| content={<ListContent n={5} />} | ||
| style={{ | ||
| dropdown: { | ||
| background: 'light-dark(#edf4ff, #001a66)', | ||
| borderWidth: '0px', | ||
| }, | ||
| }} | ||
| /> | ||
| </section> | ||
|
|
||
| <section> | ||
| <h2>Custom background with styled border</h2> | ||
| <Dropdown | ||
| trigger={<Button onClick={() => setOpen2(!open2)}>Open dropdown</Button>} | ||
| open={open2} | ||
| onOutsideClick={() => setOpen2(false)} | ||
| minWidth={400} | ||
| content={<ListContent n={5} />} | ||
| style={{ | ||
| dropdown: { | ||
| background: 'light-dark(#edfbff, #005566)', | ||
| borderColor: 'light-dark(#408080, #66ccdd)', | ||
| borderRadius: '0px', | ||
| borderWidth: '2px', | ||
| }, | ||
| }} | ||
| /> | ||
| </section> | ||
| </SpaceBetween> | ||
| </ScreenshotArea> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.