-
Notifications
You must be signed in to change notification settings - Fork 77
[LG-5845] feat(collection-toolbar): Compact & Collapsible Variant Styling #3497
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
adamrasheed
merged 7 commits into
ar/LG-5830-collection-toolbar
from
ar/LG-5845-variant-styling
Feb 7, 2026
+761
−57
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
77249cc
[LG-5845] feat(collection-toolbar): Variant Styling
adamrasheed 57756b6
added terst
adamrasheed 8e4d01d
tests cleanup
adamrasheed 89636e3
updated render logic, a11y improvements, animation styling improvements
adamrasheed 6857293
updated stories, updated mobile styles
adamrasheed 516c183
updated stories formatting
adamrasheed 0cac143
updated styles
adamrasheed 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
27 changes: 27 additions & 0 deletions
27
packages/collection-toolbar/src/components/CollapsibleContent/CollapsibleContent.styles.ts
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,27 @@ | ||
| import { css, cx } from '@leafygreen-ui/emotion'; | ||
| import { spacing, transitionDuration } from '@leafygreen-ui/tokens'; | ||
|
|
||
| export const collapsibleContentBaseStyles = css` | ||
| display: grid; | ||
| transition-property: grid-template-rows, margin-bottom, opacity; | ||
| transition-duration: ${transitionDuration.default}ms; | ||
| transition-timing-function: ease-in-out; | ||
| grid-template-rows: 1fr; | ||
| margin-bottom: 0; | ||
adamrasheed marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| opacity: 1; | ||
| gap: ${spacing[200]}px; | ||
| `; | ||
|
|
||
| const collapsibleContentCollapsedStyles = css` | ||
| grid-template-rows: 0fr; | ||
adamrasheed marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| opacity: 0; | ||
| `; | ||
|
|
||
| export const getCollapsibleContentStyles = ({ | ||
| isCollapsed, | ||
| }: { | ||
| isCollapsed?: boolean; | ||
| }) => | ||
| cx(collapsibleContentBaseStyles, { | ||
| [collapsibleContentCollapsedStyles]: isCollapsed, | ||
| }); | ||
34 changes: 34 additions & 0 deletions
34
packages/collection-toolbar/src/components/CollapsibleContent/CollapsibleContent.tsx
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,34 @@ | ||
| import React from 'react'; | ||
|
|
||
| import { useCollectionToolbarContext } from '../../Context/CollectionToolbarProvider'; | ||
|
|
||
| import { getCollapsibleContentStyles } from './CollapsibleContent.styles'; | ||
| import { CollapsibleContentProps } from './CollapsibleContent.types'; | ||
|
|
||
| /** | ||
| * @internal | ||
| * Internal CollapsibleContent component | ||
| * | ||
| * @remarks | ||
| * This component is intended to be used within the context of the `CollectionToolbarProvider` | ||
| * created in `CollectionToolbar.tsx`. It relies on the CollectionToolbarContext to access | ||
| * the `isCollapsed` state for styling purposes. | ||
| * | ||
| * Do not use `CollapsibleContent` directly—always use the `CollectionToolbar` component, | ||
| * which ensures the correct context is provided. | ||
| */ | ||
| export const CollapsibleContent = ({ | ||
| searchInput, | ||
| filters, | ||
| }: CollapsibleContentProps) => { | ||
| const { isCollapsed } = useCollectionToolbarContext(); | ||
|
|
||
| return ( | ||
| <div className={getCollapsibleContentStyles({ isCollapsed })}> | ||
| {searchInput} | ||
| {filters} | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| CollapsibleContent.displayName = 'CollapsibleContent'; |
4 changes: 4 additions & 0 deletions
4
packages/collection-toolbar/src/components/CollapsibleContent/CollapsibleContent.types.ts
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,4 @@ | ||
| export interface CollapsibleContentProps { | ||
| searchInput: React.ReactNode; | ||
| filters: React.ReactNode; | ||
| } |
2 changes: 2 additions & 0 deletions
2
packages/collection-toolbar/src/components/CollapsibleContent/index.ts
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,2 @@ | ||
| export { CollapsibleContent } from './CollapsibleContent'; | ||
| export { type CollapsibleContentProps } from './CollapsibleContent.types'; |
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.