Skip to content

Commit f12609f

Browse files
authored
Replace FilteredResults with composition (#388)
1 parent a041e96 commit f12609f

17 files changed

+7506
-5452
lines changed

.ladle/global.module.scss renamed to .ladle/components.module.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ sans-serif,
1515
'Noto Color Emoji';
1616
$defaultMonoFamily: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
1717

18-
body {
18+
.wrapper {
1919
font-family: $defaultSansFamily;
2020
background-color: white;
2121
color: #222;
22-
}
2322

24-
pre, code {
25-
font-family: $defaultMonoFamily;
23+
pre, code {
24+
font-family: $defaultMonoFamily;
25+
}
2626
}

.ladle/components.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
import './global.module.scss'
1+
import type { GlobalProvider } from '@ladle/react'
2+
import React from 'react'
3+
import styles from './components.module.scss'
4+
5+
export const Provider: GlobalProvider = ({ children, globalState, storyMeta }) => <div className={styles.wrapper}>{children}</div>

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
- Add `<CustomRendering/>` to override presentation ([#382](https://github.com/cucumber/react-components/pull/382))
1111
- Add `<ControlledSearchProvider/>`, `<InMemorySearchProvider/>` and `<UrlSearchProvider/>` to provide search state ([#384](https://github.com/cucumber/react-components/pull/384))
1212
- Add `<UriProvider/>`, to provide document URI state ([#386](https://github.com/cucumber/react-components/pull/386))
13+
- Add `<FilteredDocuments/>`, to provide (optionally filtered) documents with no props ([#388](https://github.com/cucumber/react-components/pull/388))
1314

1415
### Fixed
1516
- Make keyword spacing look right ([#376](https://github.com/cucumber/react-components/pull/376))
@@ -29,6 +30,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2930
- BREAKING CHANGE: Remove defunct `<CucumberReact/>` component ([#382](https://github.com/cucumber/react-components/pull/382))
3031
- BREAKING CHANGE: Remove `SearchQueryContext`, `<SearchWrapper/>` and related defunct symbols ([#384](https://github.com/cucumber/react-components/pull/384))
3132
- BREAKING CHANGE: Remove `GherkinQueryContext` and `CucumberQueryContext` from entry point ([#385](https://github.com/cucumber/react-components/pull/385))
33+
- BREAKING CHANGE: Remove `<FilteredResults/>` component in favour of composition ([#388](https://github.com/cucumber/react-components/pull/388))
3234

3335
## [22.4.1] - 2025-03-30
3436
### Fixed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ https://cucumber-react-preview.netlify.app/
1515
The source code for the screenshot above is:
1616

1717
```jsx
18-
import { EnvelopesProvider, GherkinDocumentList } from '@cucumber/react-components'
18+
import { EnvelopesProvider, FilteredDocuments } from '@cucumber/react-components'
1919

2020
<EnvelopesProvider envelopes={envelopes}>
21-
<GherkinDocumentList />
21+
<FilteredDocuments />
2222
</EnvelopesProvider>
2323
```
2424

@@ -45,7 +45,9 @@ You can provide your own theme with a small amount of CSS. Target the element ab
4545

4646
```jsx
4747
<div className="dark-theme">
48-
<GherkinDocument />
48+
<EnvelopesProvider envelopes={envelopes}>
49+
<FilteredDocuments />
50+
</EnvelopesProvider>
4951
</div>
5052
```
5153

@@ -95,7 +97,9 @@ Then, you can provide an `overrides` prop to the `CustomRendering` component, in
9597
docString: 'acme-docstring'
9698
}
9799
}}>
98-
<GherkinDocument />
100+
<EnvelopesProvider envelopes={envelopes}>
101+
<FilteredDocuments />
102+
</EnvelopesProvider>
99103
</CustomRendering>
100104
```
101105

@@ -116,7 +120,9 @@ Staying with the doc string example, you can use the same `overrides` prop, but
116120
</>
117121
)
118122
}}>
119-
<GherkinDocument />
123+
<EnvelopesProvider envelopes={envelopes}>
124+
<FilteredDocuments />
125+
</EnvelopesProvider>
120126
</CustomRendering>
121127
```
122128

0 commit comments

Comments
 (0)