-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use fresnel on site to prevent mismatch errors
- Loading branch information
Showing
12 changed files
with
194 additions
and
137 deletions.
There are no files selected for viewing
Binary file not shown.
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
File renamed without changes.
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,30 @@ | ||
import { Appear, Box } from 'preshape'; | ||
import { Menu } from '../Menu/Menu'; | ||
import AppShell from './AppShell'; | ||
import Router from './Router'; | ||
|
||
const AppDesktop = () => { | ||
return ( | ||
<AppShell> | ||
<Box flex="horizontal" grow> | ||
<Appear | ||
animation="FadeSlideRight" | ||
backgroundColor="background-shade-2" | ||
maxWidth="300px" | ||
borderColor="background-shade-3" | ||
borderSize="x2" | ||
borderRight | ||
maxHeight="100vh" | ||
overflow="auto" | ||
style={{ position: 'sticky', top: '0' }} | ||
> | ||
<Menu /> | ||
</Appear> | ||
|
||
<Router /> | ||
</Box> | ||
</AppShell> | ||
); | ||
}; | ||
|
||
export default AppDesktop; |
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,35 @@ | ||
import { MenuIcon } from 'lucide-react'; | ||
import { Box, Modal } from 'preshape'; | ||
import { useState } from 'react'; | ||
import { Menu } from '../Menu/Menu'; | ||
import AppShell from './AppShell'; | ||
import Router from './Router'; | ||
|
||
const AppMobile = () => { | ||
const [menuVisible, setMenuVisible] = useState(false); | ||
|
||
return ( | ||
<AppShell> | ||
<Box | ||
alignChildren="middle" | ||
backgroundColor="black" | ||
flex="horizontal" | ||
onClick={() => setMenuVisible(true)} | ||
padding="x4" | ||
style={{ position: 'sticky', top: 0 }} | ||
zIndex={10} | ||
textColor="light-shade-1" | ||
> | ||
<MenuIcon size="2rem" /> | ||
</Box> | ||
|
||
<Modal borderRadius="x0" fullscreen visible={menuVisible} zIndex={11}> | ||
<Menu onSelect={() => setMenuVisible(false)} /> | ||
</Modal> | ||
|
||
<Router /> | ||
</AppShell> | ||
); | ||
}; | ||
|
||
export default AppMobile; |
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,24 @@ | ||
import { Box, ModalManager, ThemeProvider } from 'preshape'; | ||
import 'preshape/dist/style.css'; | ||
import { type PropsWithChildren } from 'react'; | ||
import { HelmetProvider } from 'react-helmet-async'; | ||
import './App.css'; | ||
import Message from './Message'; | ||
|
||
const AppShell = ({ children }: PropsWithChildren) => { | ||
return ( | ||
<HelmetProvider> | ||
<ThemeProvider> | ||
<ModalManager> | ||
<Box flex="vertical" grow> | ||
<Message /> | ||
|
||
{children} | ||
</Box> | ||
</ModalManager> | ||
</ThemeProvider> | ||
</HelmetProvider> | ||
); | ||
}; | ||
|
||
export default AppShell; |
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,12 @@ | ||
import { createMedia } from '@artsy/fresnel'; | ||
|
||
const PreshapeMedia = createMedia({ | ||
breakpoints: { | ||
xs: 0, | ||
sm: 800, | ||
}, | ||
}); | ||
|
||
export const mediaStyles = PreshapeMedia.createMediaStyle(); | ||
|
||
export const { Media, MediaContextProvider } = PreshapeMedia; |
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,45 @@ | ||
import { Appear, Box, Button, Text, useLocalStorage } from 'preshape'; | ||
|
||
const Message = () => { | ||
const [dontUseMessageVisible, setDontUseMessageVisible] = useLocalStorage( | ||
'preshape.dontUseMessage', | ||
true | ||
); | ||
|
||
return dontUseMessageVisible ? ( | ||
<Box fixed="bottom-right" padding="x6" maxWidth="400px" zIndex={100}> | ||
<Appear | ||
animation="Pop" | ||
backgroundColor="text-shade-1" | ||
borderRadius="x3" | ||
elevate="x1" | ||
delay={1000} | ||
padding="x6" | ||
textColor="background-shade-1" | ||
> | ||
<Text margin="x6"> | ||
Welcome! Take a look around. However, you probably{' '} | ||
<Text textColor="background-shade-1" strong> | ||
shouldn't use this in your project | ||
</Text> | ||
. It's a component library for my own projects, so{' '} | ||
<Text textColor="background-shade-1" strong> | ||
there's no guarantee of stability or support | ||
</Text> | ||
. | ||
</Text> | ||
|
||
<Button | ||
color="accent" | ||
onClick={() => setDontUseMessageVisible(false)} | ||
variant="primary" | ||
width="100%" | ||
> | ||
Ok | ||
</Button> | ||
</Appear> | ||
</Box> | ||
) : null; | ||
}; | ||
|
||
export default Message; |
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,26 @@ | ||
import { Box } from 'preshape'; | ||
import { Navigate, Route, Routes } from 'react-router-dom'; | ||
import { ColorsPage } from '../../pages/Colors'; | ||
import { ComponentPage } from '../../pages/Component'; | ||
import { ComponentsPage } from '../../pages/Components'; | ||
import { SizingsPage } from '../../pages/Sizings'; | ||
import { ThemesPage } from '../../pages/Themes'; | ||
|
||
const Router = () => { | ||
return ( | ||
<Box flex="horizontal" grow> | ||
<Box basis="0" grow minWidth={0}> | ||
<Routes> | ||
<Route element={<Navigate to="/components" />} path="/" /> | ||
<Route element={<ColorsPage />} path="/colors" /> | ||
<Route element={<ThemesPage />} path="/themes" /> | ||
<Route element={<SizingsPage />} path="/sizings" /> | ||
<Route element={<ComponentsPage />} path="/components" /> | ||
<Route element={<ComponentPage />} path="/components/:id" /> | ||
</Routes> | ||
</Box> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default Router; |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
{ | ||
|
||
"include": ["src", "src/assets/documentation.json"], | ||
"references": [ | ||
{ "path": "./tsconfig.node.json" } | ||
|
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