-
Notifications
You must be signed in to change notification settings - Fork 76
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
feat(tabs): make component responsive #8616
Merged
jcfranco
merged 133 commits into
main
from
jcfranco/6689-tabs-responsive-layout-alt-approach
Feb 27, 2024
Merged
Changes from all commits
Commits
Show all changes
133 commits
Select commit
Hold shift + click to select a range
d30b74b
feat(tabs, tab-nav, tab-title, tab): make component responsive
Elijbet 58e56d7
add getOverflowIcons() to detect overflow at right and left edges of …
Elijbet cc10a03
work out scrollToNextTabTitles callback on right chevron click
Elijbet 9f100f2
work out scrollToPreviousTabTitles callback to onClick for left chevr…
Elijbet ab01786
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet 917bf49
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet fa57cc0
fix overflow logic and only show overflow icons for the inline version
Elijbet a704b4e
wire up t9n, LocalizedComponent
Elijbet 4242f52
subsitute icon with action button
Elijbet 14136e8
adapt css to action button instead of icon
Elijbet 07728c2
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet fb4d4f6
pas in overflowDirection to scrollDir action callback
Elijbet 2c9f93b
cleanup
Elijbet 0ccac60
add a story and cleanup
Elijbet 19c2fac
slim down scrollToNextTabTitles function
Elijbet 87de476
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet 4c1c23d
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet 1bae874
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet a849ebf
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet 6ad662c
WIP: e2e test for overflowScenarios = [right, left, both]
Elijbet f505684
WIP: work out leaner combined test for both scenarios
Elijbet 9676f65
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet ffc7704
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet 91e0b62
call clientWidth instead of getBoundingClientRect.width, use for..of …
Elijbet 2fc31b1
adapt to tab order change for ltr/rtl bidirecitonal design
Elijbet 043ffe6
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet f35d111
styling of the action button with box-shadow
Elijbet 4a22ae9
simplify arrow navigation logic
Elijbet 1f98581
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet cc4b6df
cleanup
Elijbet ab70c42
WIP: fix failing tests
Elijbet e19073a
use Element.scrollIntoView for the horizontal scrolling instead of t…
Elijbet 05ad709
cleanup
Elijbet f5abd58
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet 0d5824c
WIP: fix scroll calculation to apply correctly on RTL
Elijbet 7497b82
revert to ltr only option
Elijbet 817d643
test cleanup
Elijbet 13d7845
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet 07b8f69
feat(tab-nav): add support for built-in translations
Elijbet 555f3dd
remove localization and translations and create a seperate PR
Elijbet 128f82b
cleanup
Elijbet b2ffd3d
fix failing commonTests
Elijbet 7d5d87e
cleanups to fix some failing tests
Elijbet 3bfc5a0
add checks to avoid uncaught errors
Elijbet 925e2c5
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet b255279
cleanup
Elijbet 5474a9f
removed the need for .getBoundingClientRect()
Elijbet e9bb23c
cleanup
Elijbet 712fb31
apply bordered styling to the action button
Elijbet aec6472
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet d5ec4ba
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet 3e5da4c
calcite appearance based on tab-nav being bordered or not
Elijbet 54ee2b6
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet c9b71b2
WIP: work out tab-title container clipping to accomodate transparent …
Elijbet aafd27a
Merge branch 'main' into elijbet/6689-add-support-for-built-in-transl…
Elijbet a6a3b09
merge with resolved conflicts
Elijbet c1db09f
Merge branch 'main' into elijbet/6689-tabs-responsive-layout
Elijbet 057f6e8
resolve conflicts
Elijbet a4528ea
Merge branch 'main' into elijbet/6689-add-support-for-built-in-transl…
Elijbet 7db0415
merge update
Elijbet 870f629
alt approach w/ intersection observer
jcfranco 8e3c942
add bound checking logic
jcfranco e9f1076
merge main
jcfranco e8fec06
tidy up
jcfranco 406b8e1
fix missing import
jcfranco cc3b64c
roll back tabs being full width by default
jcfranco 1c9e394
simplify styles
jcfranco 047c52e
merge elijbet/6689-add-support-for-built-in-translations
jcfranco cf95c28
wire up messages
jcfranco c0a0614
tidy up
jcfranco 57e48ee
tweak tab-title overflow logic and styling
jcfranco e80ffb1
add mask to overflowing, visible tab-titles
jcfranco 9e22fce
prevent selected tab-title from shrinking in layout=center
jcfranco 479b638
improve tab-title layout for layout=center
jcfranco bcd45eb
update mask to latest design
jcfranco 905868d
consider scrolling into active indicator position and width
jcfranco 21ab9d5
tweak breakpoint stories
jcfranco 9fdb6b2
fix mask when tab-titles are overflowing on a single side
jcfranco 8ea8c59
add scroll button class
jcfranco cc16dfc
tidy up
jcfranco 7177ae3
improve selected tab title scrolling into view
jcfranco be9a95a
add wheel scrolling behavior
jcfranco 92f1219
improve scrolling behavior
jcfranco a61ac26
mask active tab-title indicator
jcfranco c9628b0
tidy up
jcfranco f649f75
add scroller button dividers
jcfranco b5a84e5
allow scrolling in center layout
jcfranco fb14ae4
tweak non-border divider styles
jcfranco 730f407
fix bordered, centered layout spacing
jcfranco 7125bfa
fix forward/backward scrolling
jcfranco f861b59
fix visual artifact for both start-end mask was applied
jcfranco a165be4
tidy up
jcfranco 8e5d7a5
update masking for rtl
jcfranco cb26d11
update scroller buttons for rtl
jcfranco b23bd25
add placeholders for updated E2E tests
jcfranco ceb35ca
tidy up
jcfranco 5494687
merge main
jcfranco fb54422
fix visual regression
jcfranco 8ab7f55
fix spacing
jcfranco a1bfab6
fix visual regression
jcfranco 452a431
fix spacing
jcfranco 931095a
fix tab-title inline-padding when bordered + scale=s
jcfranco 323014e
restore tab-title bordered + closable spacing
jcfranco 3b91a49
fix scrolling via buttons
jcfranco ecde23e
tidy up
jcfranco effb817
add tests
jcfranco 36f61b6
fix incorrect tag used in t9n test helper
jcfranco 46772eb
tidy up
jcfranco 5b5fa24
fix RTL scrolling
jcfranco 00d13e4
initially display selected tab title
jcfranco aa7656a
tidy up
jcfranco b352835
bail scrolling to tab title if nonexistent
jcfranco f0f0bed
fix story typo
jcfranco 3cc4247
improve dom focus util type
jcfranco de8c447
update scrolling buttons to follow spec
jcfranco 679e4fb
scroll to keyboard-navigated tab
jcfranco c31177f
fix tab order of scrolling buttons and tab-titles
jcfranco 4143b0d
improve closable tab-title spacing
jcfranco 7257714
fix tab scrolling button focus
jcfranco 834b013
tidy up
jcfranco e437c53
improve scrolling for mobile
jcfranco e4255bb
fix tests
jcfranco 536117a
tidy up
jcfranco 3a5a5ab
remove scrolling arrows from tab order
jcfranco 0727b11
update scrolling tests to use both deltaX and deltaY
jcfranco 40c0da8
fix specificity issues
jcfranco eafdab6
update wheel/scrolling behavior to be device agnostic
jcfranco 85fe4fc
update test config to troubleshoot CI failure
jcfranco 36667f2
add log messaging
jcfranco 3be8717
restore previous scroll values
jcfranco cd0f5bb
roll back troubleshooting changes
jcfranco 961ecfd
fix indicator position regression
jcfranco 68c9f48
fix layout=center + closable spacing
jcfranco 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
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
13 changes: 13 additions & 0 deletions
13
packages/calcite-components/src/components/tab-nav/resources.ts
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 |
---|---|---|
@@ -1,3 +1,16 @@ | ||
export const ICON = { | ||
chevronRight: "chevron-right", | ||
chevronLeft: "chevron-left", | ||
}; | ||
|
||
export const CSS = { | ||
activeIndicatorContainer: "tab-nav-active-indicator-container", | ||
container: "tab-nav", | ||
containerHasEndTabTitleOverflow: "tab-nav--end-overflow", | ||
containerHasStartTabTitleOverflow: "tab-nav--start-overflow", | ||
scrollButton: "scroll-button", | ||
scrollButtonContainer: "scroll-button-container", | ||
scrollBackwardContainerButton: "scroll-button-container--backward", | ||
scrollForwardContainerButton: "scroll-button-container--forward", | ||
tabTitleSlotWrapper: "tab-titles-slot-wrapper", | ||
}; |
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.
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.
Extracted this over to #8739.