feat(demo): completed initial version of animations demo#11876
feat(demo): completed initial version of animations demo#11876parthivrh wants to merge 17 commits intopatternfly:mainfrom
Conversation
|
Preview: https://patternfly-react-pr-11876.surge.sh A11y report: https://patternfly-react-pr-11876-a11y.surge.sh |
|
|
||
| ## Demos | ||
|
|
||
| This demonstration highlights PatternFly's latest animations. Explore how components like alerts, navigation, and forms use motion to provide clear feedback and improve usability across the platform. |
There was a problem hiding this comment.
| This demonstration highlights PatternFly's latest animations. Explore how components like alerts, navigation, and forms use motion to provide clear feedback and improve usability across the platform. | |
| The following demo highlights the current state of [our ongoing effort to animate PatternFly components](https://github.com/orgs/patternfly/projects/7/views/66). | |
| To see how components like alerts, navigation, and forms can now use motion to provide clear feedback and improve usability, you can explore this demo and interact with various UI elements. We will continue to update this demo as additional animation support is added. |
There was a problem hiding this comment.
Could also add a more specific list if you think we want to call out the details. I'll let you decide based on what seems the most useful for this demo
"Currently, this demo includes animations for:
- Alerts.
- The notification badge and notification drawer.
- The hamburger/navigation menu icon.
- The masthead settings icon.
- Expandable navigation items.
- Skeleton loader in a table.
- Button clicks.
- Validation failure in forms."
| {loading ? ( | ||
| <SkeletonTable columns={['', ...expandableColumns]} rows={8} /> | ||
| ) : ( | ||
| <Table aria-label="Collapsible table"> |
There was a problem hiding this comment.
I think you'll need to opt in to the expansion animation with hasAnimations on the Table.
| }; | ||
|
|
||
| const detailStatusEvents = ( | ||
| <Gallery hasGutter style={{ width: '100%', display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)' }}> |
There was a problem hiding this comment.
Can you take the inline style off and use the gallery props instead?
11f8da6 to
96bf1f6
Compare
edonehoo
left a comment
There was a problem hiding this comment.
content looks good to me!
srambach
left a comment
There was a problem hiding this comment.
Nice job! Just a couple of really nitpicky comments 😉
| const handlePasswordChange = (_event, password: string) => { | ||
| setPassword(password); | ||
| setIsPasswordValid( | ||
| password.length > 12 && /[0-9]/.test(password) && /[A-Z]/.test(password) ? 'success' : 'error' |
There was a problem hiding this comment.
This is very nitpicky 😄 but the text says "at least 12 characters" and this forces you to have more than 12.
| const detailStatusEvents = ( | ||
| <Grid hasGutter> | ||
| <GridItem span={4}> | ||
| <DetailsCard /> | ||
| </GridItem> | ||
| <GridItem span={4}> | ||
| <CardStatus /> | ||
| </GridItem> | ||
| <GridItem span={4}> | ||
| <EventsCard /> | ||
| </GridItem> | ||
| </Grid> | ||
| ); |
srambach
left a comment
There was a problem hiding this comment.
Nice job! I think this is fine to go.
wise-king-sullyman
left a comment
There was a problem hiding this comment.
Great work on this so far! It looks awesome!
A few comments/change requests:
| const [shouldNotify, setShouldNotify] = useState(false); | ||
| const prevUnreadCountRef = useRef(0); | ||
|
|
||
| const getNumberUnread = () => { |
There was a problem hiding this comment.
You'll need to put this into a useCallback to prevent it from causing infinite rerenders since it's listed as a dep in some of your useEffects
| visibility={{ | ||
| default: 'hidden' | ||
| }} /** this kebab dropdown replaces the icon buttons and is hidden for desktop sizes */ |
There was a problem hiding this comment.
With being set to hidden by default and no other visibility options won't this just never render?
| <Masthead> | ||
| <MastheadMain> | ||
| <MastheadToggle> | ||
| <PageToggleButton variant="plain" aria-label="Global navigation" isHamburgerButton /> |
There was a problem hiding this comment.
I'm seeing errors in the console related to the isHamburgerButton being passed here without an isExpanded prop.
| ); | ||
| }; | ||
|
|
||
| const CardStatus: FunctionComponent = () => { |
There was a problem hiding this comment.
Having these components being defined from within another component is potentially problematic, and breaks the rules of hooks for the hooks you're using within them.
| const onKebabDropdownSelect = () => setIsKebabDropdownOpen(false); | ||
| const onCloseNotificationDrawer = (_event: any) => setIsDrawerExpanded((prevState) => !prevState); | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
Also just on a more general note my gut says that the way that all of these alerts are being made and managed could be DRY'd up substantially, but since this is just a demo I'm not too worried about that.
…tions prop to Table
Also updated imports locations so hot reloads work properly
a080916 to
ae41f60
Compare
|
When you get a chance, could you also incorporate the content updates I snuck into Jeff's PR? #11915 Open to other ideas, but I feel like the page content might be better as more of an intro, rather than "docs", since we moved to the guided tour |
|
Closing this because all of the changes here have been integrated into: #11915 and we are picking up in that PR |

What: This demonstration highlights PatternFly's latest animated components, like alerts, navigation, and form validation. Closes #11810
Additional issues: