-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Replace hand-rolled dropdown on the dashboard and menu-related UI fixes #5037
Merged
apata
merged 34 commits into
saved-segments/singular-bar
from
saved-segments/replace-handrolled-dropdown
Feb 4, 2025
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
f6985a6
Try popover
apata ce86bbe
Pass targetRef instead of target, stop Escape clearing filters
apata 719e59e
Stop Escape clearing filters when popover menus active
apata 9bfc4ec
Attempt get rid of hand-rolled dropdown
apata d392d3b
Fix issue with comparison calendar
apata 315ce65
Almost works
apata 5ca7af2
Unify styles
apata 9f1cb57
Focus modals on mount
apata 776a19f
Refactor date picker logic
apata 6db18d8
Replace navigate keybinds with straightforward keybinds
apata 688c947
Remove extraneous Calendar component, better props
apata 15efcc3
Attempt optimise menu re-renders
apata 38a7360
Memoise QueryPeriodsMenu, refactor getDatePeriodGroups
apata e2dae51
Refactor ComparisonMenu to Popover
apata ec86842
Refactor QueryPeriodMenu to Popover
apata b8c68f9
Pull calendar out of components
apata c49465d
Refactor calendar to receive position from JS
apata 868dd40
Simpler calendar API
apata c526804
Add click outside listener for Calendar, fix FiltersBar measurements
apata 3dbd86a
Give back top bar room
apata d21f724
Update tests
apata 68afaeb
Apply unified button text style
apata 2633518
Close calendar on keyboard nav to othe menus as well
apata a6a3807
Kinda works
apata 994c52c
Works even better
apata ea6fe11
Working well
apata cb9fbe3
Sometimes menu stays active
apata 382b13f
WIP
apata 2793345
Adapter
apata 5788d62
Works with error
apata 85a7b33
Fixed the error
apata 304758c
Remove handrolled isOpen
apata cec6f02
Introduce shared adapter
apata 8fdeb07
Share adapter
apata 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 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
22 changes: 0 additions & 22 deletions
22
assets/css/flatpickr.css → assets/css/flatpickr-colors.css
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 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,67 @@ | ||
/** @format */ | ||
import { TransitionClasses } from '@headlessui/react' | ||
import classNames from 'classnames' | ||
|
||
const TRANSITION_CONFIG: TransitionClasses = { | ||
enter: 'transition ease-out duration-100', | ||
enterFrom: 'opacity-0 scale-95', | ||
enterTo: 'opacity-100 scale-100', | ||
leave: 'transition ease-in duration-75', | ||
leaveFrom: 'opacity-100 scale-100', | ||
leaveTo: 'opacity-0 scale-95' | ||
} | ||
|
||
const transition = { | ||
props: TRANSITION_CONFIG, | ||
classNames: { fullwidth: 'z-10 absolute left-0 right-0' } | ||
} | ||
|
||
const panel = { | ||
classNames: { | ||
roundedSheet: | ||
'focus:outline-none rounded-md shadow-lg bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5 font-medium text-gray-800 dark:text-gray-200' | ||
} | ||
} | ||
|
||
const toggleButton = { | ||
classNames: { | ||
rounded: 'flex items-center rounded text-sm leading-tight h-9', | ||
shadow: | ||
'bg-white dark:bg-gray-800 shadow text-gray-800 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-900', | ||
ghost: | ||
'text-gray-500 hover:text-gray-800 hover:bg-gray-200 dark:hover:text-gray-200 dark:hover:bg-gray-900', | ||
truncatedText: 'truncate block font-medium' | ||
} | ||
} | ||
|
||
const items = { | ||
classNames: { | ||
navigationLink: classNames( | ||
'flex items-center justify-between', | ||
'px-4 py-2 text-sm leading-tight' | ||
), | ||
selectedOption: classNames('data-[selected=true]:font-bold'), | ||
hoverLink: classNames( | ||
'hover:bg-gray-100', | ||
'hover:text-gray-900', | ||
'dark:hover:bg-gray-900', | ||
'dark:hover:text-gray-100', | ||
|
||
'focus-within:bg-gray-100', | ||
'focus-within:text-gray-900', | ||
'dark:focus-within:bg-gray-900', | ||
'dark:focus-within:text-gray-100' | ||
), | ||
roundedStartEnd: classNames( | ||
'first-of-type:rounded-t-md', | ||
'last-of-type:rounded-b-md' | ||
) | ||
} | ||
} | ||
|
||
export const popover = { | ||
toggleButton, | ||
panel, | ||
transition, | ||
items | ||
} |
This file contains 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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏