Skip to content

Commit cf7233e

Browse files
avivkellerbmuenzenmeyerCopilot
authored
chore(ui-components): add README (#8356)
* chore(ui-components): add README * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> Signed-off-by: Brian Muenzenmeyer <[email protected]> --------- Signed-off-by: Brian Muenzenmeyer <[email protected]> Co-authored-by: Brian Muenzenmeyer <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent cdfd572 commit cf7233e

File tree

4 files changed

+37
-2
lines changed

4 files changed

+37
-2
lines changed

packages/ui-components/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Node.js UI Components
2+
3+
This package is comprised of UI components for use in the Node.js website, documentation,
4+
and other aspects of the project.
5+
6+
The components are based on [this design file](https://www.figma.com/design/a10cjjw3MzvRQMPT9FP3xz/Node.js).
7+
8+
Most components in this package are available on [Chromatic](https://www.chromatic.com/library?appId=64c7d71358830e9105808652).
9+
10+
For additional details regarding specific components, refer to the [nodejs/nodejs.org](https://github.com/nodejs/nodejs.org) repository.

packages/ui-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@node-core/ui-components",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"type": "module",
55
"exports": {
66
"./*": [

packages/ui-components/scripts/publish.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { spawnSync } from 'node:child_process';
2-
import { writeFile } from 'node:fs/promises';
2+
import { writeFile, copyFile } from 'node:fs/promises';
33

44
import pkg from '../package.json' with { type: 'json' };
55

@@ -17,6 +17,8 @@ await writeFile(
1717
'utf8'
1818
);
1919

20+
await copyFile('README.md', 'dist/README.md');
21+
2022
// Now, publish the generated `dist` folder
2123
const { status, error } = spawnSync('pnpm', ['publish', '--no-git-checks'], {
2224
cwd: 'dist',
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Orama Search Components
2+
3+
This directory contains components for creating a Node.js-styled Orama Search Box.
4+
5+
A search modal is constructed using the following format, but additional components can also be used.
6+
7+
```jsx
8+
<SearchModal client={myOramaClient} placeholder={'Search for something...'}>
9+
<SearchResults
10+
noResultsTitle={'No results found for'}
11+
onHit={hit => <MySearchItemComponent hit={hit} />}
12+
>
13+
{/* If you want to include search suggestions, there's a SearchSuggestions
14+
component */}
15+
<SearchSuggestions
16+
suggestions={['You should search this', 'or this']}
17+
label={'Suggestions'}
18+
/>
19+
</SearchResults>
20+
</SearchModal>
21+
```
22+
23+
(For this example, `myOramaClient` and `MySearchItemComponent` refer to the Orama client, and search item component, respectively. These variables **are not** included in @node-core/ui-components at this time)

0 commit comments

Comments
 (0)