Conversation
There was a problem hiding this comment.
Looks good, agree with the approach. We could also look at enabling something like:
import { DocString } from '@cucumber/react/components/gherkin'I think that would require us being very deliberate about the file structure of the compiled output and the .d.ts files but would probably be possible. It might come down to which (if any) is more reliable inferred by editors?
Make all components customisable with component overrides
Do we really mean every component in here? Some are a bit in flux (especially the "chrome" stuff that we have yet to restyle/redesign, plus the accordion might be replaced as you've said before) and I'd be wary of effectively expanding the public API surface more than necessary if there's not an obvious use case.
Demonstrate how to override component styles with TailwindCSS by defining classes with @apply in a Storybook story
My next task on #1592 is to add tailwind to the tooling - I can do a standalone PR for that unless you have already started?
| } | ||
|
|
||
| // TODO encapsulate in a component | ||
| .cucumber-children { |
There was a problem hiding this comment.
I think this may be used in more places than the <Feature> component?
There was a problem hiding this comment.
Fixed in 53cc7f6 - added a <Children> component
Ah yes, removed the tailwind TODO from this PR |
Summary
Ensure all components in
@cucumber/reactare exported and styleableDetails
This changes most components to
export const SomeComponent = ...and removes theexport default SomeComponent.The motivation for this is to more easily export everything in a directory, and do it in a nested fashion.
From the consumer's perspective, this means components are now imported like this:
This is a bit more verbose than the previous:
But since this library has grown quite big, I feel it's a bit tidier to have a bit more namespacing rather than cramming everything into the top-level import. Trying to do that also makes it easier to forget to export something, whereas now, the various directories'
index.tsspreads this responsibility over multiple files, so it's easier to spot an omission.I've also made the
<Feature>component styleable.TODO before merging
components.gherkin.SomeComponentand use destructuring at the top of the filefilterso we can doimport { filter } from '@cucumber/react'Motivation and Context
Make sure everything is exported and make things a bit more organised
How Has This Been Tested?
With StoryBook and tsc - and existing tests are still passing.
Types of changes
Checklist: