-
Notifications
You must be signed in to change notification settings - Fork 473
feat(ui): animate mosaic field messages #9756
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
Changes from all commits
2f58a4d
0cc3cbb
c9a0ffb
8f096dc
becd00c
29b84b5
78fb5fc
bd48b8e
58a20a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| --- | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,12 @@ | ||
| import * as stylex from '@stylexjs/stylex'; | ||
|
|
||
| import { colorVars, fontWeightVars, space } from '../../tokens.stylex'; | ||
| import { colorVars, durationVars, easingVars, fontWeightVars, space } from '../../tokens.stylex'; | ||
|
|
||
| const ROOT_GAP = space['2']; | ||
|
|
||
| export const styles = stylex.create({ | ||
| root: { | ||
| gap: space['2'], | ||
| gap: ROOT_GAP, | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| }, | ||
|
|
@@ -18,15 +20,50 @@ export const styles = stylex.create({ | |
| description: { | ||
| color: colorVars['--cl-color-neutral-faded'], | ||
| }, | ||
| error: { | ||
| messageRoot: { | ||
| overflow: 'clip', | ||
| alignContent: 'start', | ||
| display: 'grid', | ||
|
Comment on lines
+25
to
+26
Collaborator
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. any purpose for this grid? looks like we're popping exiting animation out of flow? |
||
| position: 'relative', | ||
| transitionDuration: durationVars['--cl-duration-slow'], | ||
| transitionProperty: { | ||
| default: 'height, margin-top', | ||
| '@media (prefers-reduced-motion: reduce)': 'none', | ||
| }, | ||
| transitionTimingFunction: easingVars['--cl-ease-enter'], | ||
| height: { | ||
| default: 'var(--_cl-field-message-height)', | ||
| ':where(:not([data-open]), [data-starting-style])': 0, | ||
| }, | ||
| marginTop: { | ||
| default: 0, | ||
| ':where(:not([data-open]), [data-starting-style])': `calc(-1 * ${ROOT_GAP})`, | ||
|
Collaborator
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. ahh to account for the gap jump. nice. |
||
| }, | ||
| }, | ||
| feedback: { | ||
| inset: { default: null, ':where([data-ending-style])': '0 0 auto' }, | ||
| gap: space['1'], | ||
| alignItems: 'flex-start', | ||
| color: colorVars['--cl-color-negative'], | ||
| display: 'flex', | ||
| opacity: { default: 1, ':where([data-starting-style], [data-ending-style])': 0 }, | ||
| position: { default: null, ':where([data-ending-style])': 'absolute' }, | ||
| textWrap: 'pretty', | ||
| transitionDuration: durationVars['--cl-duration-base'], | ||
| transitionProperty: 'opacity', | ||
| transitionTimingFunction: 'linear', | ||
|
Comment on lines
+51
to
+53
Collaborator
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.
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. yeah, was toying around with a mask during reveal, but didn't land on anything solid. something to maybe polish in a future PR https://x.com/blvdmitry/status/2000860557298045163
Collaborator
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. ooo I like that. yea def a future improvement and not a blocker |
||
| }, | ||
| error: { | ||
| color: colorVars['--cl-color-negative'], | ||
| }, | ||
| success: { | ||
| color: colorVars['--cl-color-positive'], | ||
| }, | ||
| errorIcon: { | ||
| feedbackIcon: { | ||
| flexShrink: 0, | ||
| height: '1lh', | ||
| }, | ||
| }); | ||
|
|
||
| export const dynamic = stylex.create({ | ||
| messageHeight: (height: number) => ({ '--_cl-field-message-height': `${height}px` }), | ||
| }); | ||

Uh oh!
There was an error while loading. Please reload this page.