Repository navigation
Dashboard experiment: animate customize UX #78065
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 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
97cabd9
Apply animation to actions when toggling edit mode
simison 803d564
Add elevation to widget chrome while in edit mode
simison 2ef9b63
Move styling to "tile" and grid
simison 45f6a1f
Grid: add renderDragPreview prop and theming variables
retrofox 97fa415
Dashboard: adopt renderDragPreview for drag-state shadow
retrofox 5c5af6d
Grid: add Customization story for renderDragPreview and theming
retrofox b505352
Dashboard: keep height: 100% chain on dragPreview wrapper
retrofox 8fc0db0
Grid: fix invisible resize-handle triangle
retrofox 094d394
Grid: merge Custom Resize Handle into Customization story
retrofox 25f9fbc
Merge branch 'trunk' into update/dashboard-animate-customize
retrofox e6c2d69
Merge branch 'trunk' into update/dashboard-animate-customize
retrofox 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
45 changes: 45 additions & 0 deletions
45
routes/dashboard/widget-dashboard/components/actions/actions.module.css
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,45 @@ | ||
| .editActionsEnter, | ||
| .editActionsExit { | ||
| display: inline-flex; | ||
| gap: var(--wp--preset--spacing--20); | ||
| transform-origin: right center; | ||
| } | ||
|
|
||
| @media not ( prefers-reduced-motion ) { | ||
| .editActionsEnter, | ||
| .editActionsExit { | ||
| will-change: opacity, transform; | ||
| } | ||
|
|
||
| .editActionsEnter { | ||
| animation: actions-slide-in 220ms ease-out forwards; | ||
| } | ||
|
|
||
| .editActionsExit { | ||
| animation: actions-fold-out 50ms ease-in forwards; | ||
| } | ||
|
|
||
| @keyframes actions-slide-in { | ||
| from { | ||
| opacity: 0; | ||
| transform: translateX(12px) scaleX(0.92); | ||
| } | ||
|
|
||
| to { | ||
| opacity: 1; | ||
| transform: translateX(0) scaleX(1); | ||
| } | ||
| } | ||
|
|
||
| @keyframes actions-fold-out { | ||
| from { | ||
| opacity: 1; | ||
| transform: translateX(0) scaleX(1); | ||
| } | ||
|
|
||
| to { | ||
| opacity: 0; | ||
| transform: translateX(12px) scaleX(0.92); | ||
| } | ||
| } | ||
| } |
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
25 changes: 25 additions & 0 deletions
25
routes/dashboard/widget-dashboard/components/widgets/widgets.module.css
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 |
|---|---|---|
| @@ -1,3 +1,28 @@ | ||
| .grid { | ||
| width: 100%; | ||
| } | ||
|
|
||
| .tile { | ||
| height: 100%; | ||
| border-radius: var(--wpds-border-radius-lg); | ||
| } | ||
|
|
||
| .tileEditMode { | ||
| box-shadow: var(--wpds-elevation-xs); | ||
| } | ||
|
|
||
| .tileEditMode:hover, | ||
| .tileEditMode:focus-visible { | ||
| box-shadow: var(--wpds-elevation-md); | ||
| } | ||
|
|
||
| .tileEditMode:focus-visible { | ||
| outline: var(--wpds-border-width-focus) solid var(--wpds-color-stroke-focus-brand); | ||
| outline-offset: 2px; | ||
| } | ||
|
|
||
| @media not ( prefers-reduced-motion ) { | ||
| .tile { | ||
| transition: box-shadow 180ms ease; | ||
| } | ||
| } |
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 |
|---|---|---|
|
|
@@ -68,11 +68,15 @@ export const Widgets = forwardRef< HTMLDivElement, WidgetsProps >( | |
| ); | ||
|
|
||
| const children = layout.map( ( widget, index ) => ( | ||
| <WidgetChrome | ||
| <div | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a separate tile wrapper for now, but I think these styles could move back to |
||
| key={ widget.uuid } | ||
| widget={ widget } | ||
| index={ index } | ||
| /> | ||
| className={ clsx( styles.tile, { | ||
| [ styles.tileEditMode ]: editMode, | ||
| } ) } | ||
| tabIndex={ editMode ? 0 : undefined } | ||
| > | ||
| <WidgetChrome widget={ widget } index={ index } /> | ||
| </div> | ||
| ) ); | ||
|
|
||
| const sharedProps = { | ||
|
|
||
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.
@retrofox, do you think it should be possible to apply these styles from the consumer / Dashboard side rather than in the grid library?
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.
I think it makes total sense. I'd try to follow a DS UI pattern, probably just adding a className prop?