-
Notifications
You must be signed in to change notification settings - Fork 2
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
Slider component #975
Slider component #975
Conversation
|
||
import type { TransitionComponent } from '../../types'; | ||
|
||
const Slider: TransitionComponent = ({ |
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 would like to be able to export this as export default function Slider() {...}
, but then there's no way to type it as TransitionComponent
.
It would be nice to be able to do something like export default function Slider() {...} satisfies TransitionComponent
😅
{children} | ||
</div> | ||
); | ||
}; |
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.
This component is brought from client verbatim.
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.
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 actually knew that! 😅
}, | ||
]) | ||
); | ||
}); |
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.
This test is brought from client verbatim. Only one import was adapted.
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.
Looking great so far! I think transition
is a fine name for this group of components. Presumably the human-readable section in the pattern library would be Transitions
?
Do you want to take on the challenge of adding a basic pattern library page for this component (hint: you'll need to add a new "component group" to the routes typing, but I bet you're able to figure that out pretty quick)? I can help with the details once it's in place. We can tackle documenting TransitionComponent
as a concept as a separate task (i.e. probably would document it on the "Using Components" page, which needs content updates anyway).
{children} | ||
</div> | ||
); | ||
}; |
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.
Tab, | ||
TabList, | ||
} from '../../../../'; | ||
import { ModalDialog } from '../../../../components/feedback'; | ||
import type { ModalDialogProps } from '../../../../components/feedback/ModalDialog'; | ||
import Library from '../../Library'; | ||
import FadeComponent from '../FadeComponent'; |
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.
Nice work on cleaning up.
Sure! |
196ec69
to
e97d1e4
Compare
I'm putting this PR as "ready for review", and will work on the documentation in parallel. |
Codecov Report
@@ Coverage Diff @@
## main #975 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 52 53 +1
Lines 671 700 +29
Branches 230 238 +8
=========================================
+ Hits 671 700 +29
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Yay!
Follow-up if you're up to the challenge: Update the plopfile.js
and add a new template for transition
components, such that we can run plop
to scaffold a new transition component in the future.
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's OK to only update index
(not next
, which is going to go away in an upcoming minor release).
On my way |
This PR brings the
Slider
component from client to this library.This component will be the first one fulfiling the
TransitionComponent
contract. These components can be passed to any other component supporting them, or used standalone.I have also deleted the dummy
FadeComponent
that was created just fortransitionComponent
documentation purposes, and used theSlider
instead.TODO
TransitionComponent
s (as infeedback
,input
,layout
, etc). I have provisionally usedtransition
.Slider
specifically andTransitionComponents
in general in the pattern library. -> On a follow-up PR to avoid a too big diffTesting steps
The slider can be seen in action in the Dialog page. Once there, search for
transitionComponent
and there's an example using theSlider
component.