Skip to content

Commit 2a51ed1

Browse files
Merge pull request #402 from Enterwell/feature/reactui-sidenav
Feature/reactui sidenav
2 parents 4660646 + 6914add commit 2a51ed1

19 files changed

+410
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ pnpm build
5151

5252
### Develop
5353

54+
**Note:** Run `pnpm build` before `pnpm dev` to ensure that all packages have required files built and ready.
55+
5456
To develop all apps and packages, run the following command:
5557

5658
```bash
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
'use client';
2+
3+
import { SideNav, SideNavItem, SideNavItemGroup } from '@enterwell/react-ui';
4+
import { Button } from '@mui/material';
5+
import { Stack } from '@mui/system';
6+
import Image from 'next/image';
7+
import { useSearchParams } from 'next/navigation';
8+
9+
export function ExampleSideNav() {
10+
const params = useSearchParams();
11+
const selectedItem = params.get('item');
12+
const show = params.get('show') === 'true';
13+
function setShow(show: boolean) {
14+
const url = new URL(window.location.href);
15+
url.searchParams.set('show', show.toString());
16+
window.history.pushState({}, '', url.toString());
17+
}
18+
19+
return (
20+
<>
21+
{show && (
22+
// @highlight-start
23+
<SideNav header={(
24+
<Stack direction='row' alignItems='center' spacing={2}>
25+
<div className="flex flex-row gap-1 items-center whitespace-nowrap">
26+
<Image
27+
alt="Enterwell"
28+
width={32}
29+
height={32}
30+
src="https://enterwell.net/wp-content/uploads/2023/05/ew-logomark-monochrome-negative-64.x71089.svg" />
31+
<span className="text-xs sm:text-sm md:text-lg">Enterwell {'<'}UI{' \\>'}</span>
32+
</div>
33+
</Stack>
34+
)}>
35+
<SideNavItem href="?item=1&show=true" selected={selectedItem === '1'}>Item 1</SideNavItem>
36+
<SideNavItem href="?item=2&show=true" selected={selectedItem === '2'}>Item 2</SideNavItem>
37+
<SideNavItemGroup label="Group 1" defaultExpanded={selectedItem === '3' || selectedItem === '4'}>
38+
<SideNavItem href="?item=3&show=true" selected={selectedItem === '3'}>Item 3</SideNavItem>
39+
<SideNavItem href="?item=4&show=true" selected={selectedItem === '4'}>Item 4</SideNavItem>
40+
</SideNavItemGroup>
41+
</SideNav>
42+
// @highlight-end
43+
)}
44+
<Button variant='contained' onClick={() => setShow(!show)}>Toggle SideNav</Button>
45+
</>
46+
)
47+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: SideNav
3+
---
4+
5+
import { SideNav } from '@enterwell/react-ui';
6+
import { ComponentWithSource } from '../../../components/docs/ComponentWithSource.tsx';
7+
import { ExampleSideNav } from '../../../components/ExampleSideNav.tsx';
8+
import { ComponentDescription, ComponentParameters, ComponentSource } from '../../../components/docs/ComponentDocs';
9+
10+
# SideNav
11+
12+
## Description
13+
14+
<ComponentDescription name="SideNav" />
15+
16+
### Parameters
17+
18+
<ComponentParameters name="SideNav" />
19+
20+
## Example
21+
22+
<ComponentWithSource component={ ExampleSideNav } centered />
23+
24+
## Inspect
25+
26+
<details>
27+
<summary>Source code</summary>
28+
<ComponentSource
29+
package="@enterwell/react-ui"
30+
directory="SideNav"
31+
name="SideNav"
32+
/>
33+
</details>

packages/react-hooks/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
_NOTE: This is an automatically generated file. Do not modify contents of this file manually._
99

10+
## [0.7.0] - 2025-04-02
11+
### Changed
12+
- Updated React to v19
13+
14+
### Fixed
15+
- useResizeObserver not returns correct ref type
16+
1017
## [0.6.0] - 2025-04-01
1118
### Changed
1219
- Updated packages

packages/react-hooks/changes/Fixed useResizeObserver not returns correct ref type

Whitespace-only changes.

packages/react-hooks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@enterwell/react-hooks",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"type": "module",
55
"main": "dist/index.js",
66
"types": "./dist/index.d.ts",

packages/react-mui-hooks/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
_NOTE: This is an automatically generated file. Do not modify contents of this file manually._
99

10+
## [0.10.0] - 2025-04-02
11+
### Changed
12+
- Migrated to MUI 7
13+
1014
## [0.9.0] - 2025-04-01
1115
### Changed
1216
- Migrated to MUI 6

packages/react-mui-hooks/changes/Changed Migrated to MUI 7

Whitespace-only changes.

packages/react-mui-hooks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@enterwell/react-mui-hooks",
3-
"version": "0.9.0",
3+
"version": "0.10.0",
44
"type": "module",
55
"main": "dist/index.js",
66
"types": "./dist/index.d.ts",

packages/react-ui/.changelog.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"Select",
1111
"SplitButton",
1212
"TimeInput",
13-
"ItemAccordion"
13+
"ItemAccordion",
14+
"SideNav"
1415
]
1516
}

0 commit comments

Comments
 (0)