-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: added HeaderMobile, HeaderNav refactor: modified Header, SearchBar, SidebarMenu, CollapseButton
- Loading branch information
1 parent
25be4ad
commit 480af11
Showing
24 changed files
with
1,373 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@smile/react-front-kit': minor | ||
--- | ||
|
||
Added `HeaderMobile` and `HeaderNav` components, reworked `Header` with mobile mode, added optional placeholder to `SearchBar`, improved info returned by collapseButtonProps in `SidebarMenu` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
packages/react-front-kit/src/Components/Header/Header.mock.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import type { IHeaderNavMenu } from '../HeaderNav/HeaderNav'; | ||
import type { ReactElement } from 'react'; | ||
|
||
import { Avatar, Menu } from '@mantine/core'; | ||
|
||
import { DropdownButton } from '../DropdownButton/DropdownButton'; | ||
import { HeaderNav } from '../HeaderNav/HeaderNav'; | ||
|
||
export const menusMock: IHeaderNavMenu<number>[] = [ | ||
{ | ||
children: [ | ||
{ id: 4, label: 'Releases', url: '#' }, | ||
{ id: 5, label: 'Account', url: '#' }, | ||
{ | ||
children: [ | ||
{ id: 8, label: 'Wiki pages', url: '#' }, | ||
{ id: 9, label: 'Settings', url: '#' }, | ||
], | ||
id: 6, | ||
label: 'Upcoming releases', | ||
url: '#', | ||
}, | ||
{ id: 7, label: 'Lorem ipsum dolor', url: '#' }, | ||
], | ||
id: 1, | ||
label: 'Espace documentaire', | ||
url: '#', | ||
}, | ||
{ id: 2, label: 'Espace workflow', url: '#' }, | ||
{ id: 3, label: 'Archives', url: '#' }, | ||
]; | ||
|
||
export const childrenMock = (isMobile: boolean): ReactElement => { | ||
return <HeaderNav isMobile={isMobile} menus={menusMock} />; | ||
}; | ||
|
||
export const leftContentMock = ( | ||
<img alt="logo" height="58" src="./logo.svg" width="128" /> | ||
); | ||
|
||
export const rightContentMobileMock = ( | ||
<DropdownButton label="Mon espace"> | ||
<Menu.Item component="a" href="#"> | ||
Calico | ||
</Menu.Item> | ||
<Menu.Item component="a" href="#"> | ||
Espace RH | ||
</Menu.Item> | ||
<Menu.Item component="a" href="#"> | ||
Aventure IA | ||
</Menu.Item> | ||
<Menu.Item component="a" href="#"> | ||
Lunette & CO | ||
</Menu.Item> | ||
</DropdownButton> | ||
); | ||
|
||
export const rightContentMock = ( | ||
<> | ||
{rightContentMobileMock} | ||
<Avatar src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=250&q=80" /> | ||
</> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
packages/react-front-kit/src/Components/Header/Header.style.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { createStyles } from '@mantine/core'; | ||
|
||
export const useStyles = createStyles((theme) => ({ | ||
around: { | ||
alignItems: 'center', | ||
gap: theme.spacing.xs, | ||
}, | ||
button: { | ||
'&::after': { | ||
background: | ||
theme.colorScheme === 'light' | ||
? theme.colors.gray[3] | ||
: theme.colors.gray[8], | ||
content: '""', | ||
display: 'block', | ||
height: 36, | ||
position: 'absolute', | ||
right: 0, | ||
top: '50%', | ||
translate: '0 -50%', | ||
width: 1, | ||
}, | ||
background: 'transparent', | ||
borderRadius: 0, | ||
position: 'relative', | ||
}, | ||
buttonOpened: { | ||
'&::after': { | ||
display: 'none', | ||
}, | ||
background: theme.fn.primaryColor(), | ||
color: theme.white, | ||
}, | ||
container: { | ||
alignItems: 'center', | ||
justifyContent: 'space-between', | ||
padding: '16px 64px', | ||
position: 'relative', | ||
width: '100%', | ||
}, | ||
menu: { | ||
alignItems: 'center', | ||
gap: theme.spacing.xl, | ||
left: '50%', | ||
margin: 'auto', | ||
position: 'absolute', | ||
top: '50%', | ||
translate: '-50% -50%', | ||
}, | ||
none: { | ||
display: 'none', | ||
}, | ||
sizeDesktop: { | ||
display: 'initial', | ||
[theme.fn.smallerThan('md')]: { | ||
display: 'none', | ||
}, | ||
}, | ||
sizeMobile: { | ||
display: 'none', | ||
[theme.fn.smallerThan('md')]: { | ||
display: 'initial', | ||
}, | ||
}, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.