-
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.
- Loading branch information
Showing
21 changed files
with
482 additions
and
55 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,19 @@ | ||
import { Button, SimpleGrid } from '@mantine/core' | ||
import { UiBack, UiCard, UiPage, UiStack } from '@pubkey-ui/core' | ||
|
||
export function DemoFeaturePage() { | ||
return ( | ||
<UiCard title="Page"> | ||
<UiPage title="Page title" leftAction={<UiBack />} rightAction={<Button variant="outline">Right action</Button>}> | ||
<UiCard title="Card with Grid inside Page"> | ||
<SimpleGrid cols={2}> | ||
<UiStack>1</UiStack> | ||
<UiStack>2</UiStack> | ||
<UiStack>3</UiStack> | ||
<UiStack>4</UiStack> | ||
</SimpleGrid> | ||
</UiCard> | ||
</UiPage> | ||
</UiCard> | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Box, Group, Title } from '@mantine/core' | ||
import { UiContainer, UiGroup, UiStack } from '@pubkey-ui/core' | ||
import { ReactNode } from 'react' | ||
|
||
export function UiPage({ | ||
children, | ||
leftAction, | ||
rightAction, | ||
title, | ||
}: { | ||
children: ReactNode | ||
leftAction?: ReactNode | ||
rightAction?: ReactNode | ||
title?: ReactNode | ||
}) { | ||
return ( | ||
<UiContainer> | ||
<UiStack> | ||
<Box> | ||
<UiGroup> | ||
<Group> | ||
{leftAction ? leftAction : null} | ||
<Title order={2}>{title ?? ''}</Title> | ||
</Group> | ||
{rightAction ? <Group>{rightAction}</Group> : null} | ||
</UiGroup> | ||
</Box> | ||
<UiStack my="xs" gap="xl"> | ||
{children} | ||
</UiStack> | ||
</UiStack> | ||
</UiContainer> | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ui-page' |
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,36 @@ | ||
import { Box, Group, Title } from '@mantine/core' | ||
import { ReactNode } from 'react' | ||
import { UiContainer } from '../ui-container' | ||
import { UiGroup } from '../ui-group' | ||
import { UiStack } from '../ui-stack' | ||
|
||
export function UiPage({ | ||
children, | ||
leftAction, | ||
rightAction, | ||
title, | ||
}: { | ||
children: ReactNode | ||
leftAction?: ReactNode | ||
rightAction?: ReactNode | ||
title?: ReactNode | ||
}) { | ||
return ( | ||
<UiContainer> | ||
<UiStack> | ||
<Box> | ||
<UiGroup> | ||
<UiGroup> | ||
{leftAction ? leftAction : null} | ||
<Title order={2}>{title ?? ''}</Title> | ||
</UiGroup> | ||
{rightAction ? <Group>{rightAction}</Group> : null} | ||
</UiGroup> | ||
</Box> | ||
<UiStack my="xs" gap="xl"> | ||
{children} | ||
</UiStack> | ||
</UiStack> | ||
</UiContainer> | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
"logo", | ||
"menu", | ||
"not-found", | ||
"page", | ||
"search-input", | ||
"stack", | ||
"tab-routes", | ||
|
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
2 changes: 1 addition & 1 deletion
2
...s/generators/src/generators/component/files/loader/__prefixFileName__-loader.tsx.template
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
36 changes: 36 additions & 0 deletions
36
packages/generators/src/generators/component/files/page/__prefixFileName__-page.tsx.template
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,36 @@ | ||
import { Box, Group, Title } from '@mantine/core' | ||
import { ReactNode } from 'react' | ||
import { <%= prefix.className %>Container } from '../<%= prefix.fileName %>-container' | ||
import { <%= prefix.className %>Group } from '../<%= prefix.fileName %>-group' | ||
import { <%= prefix.className %>Stack } from '../<%= prefix.fileName %>-stack' | ||
|
||
export function <%= prefix.className %>Page({ | ||
children, | ||
leftAction, | ||
rightAction, | ||
title, | ||
}: { | ||
children: ReactNode | ||
leftAction?: ReactNode | ||
rightAction?: ReactNode | ||
title?: ReactNode | ||
}) { | ||
return ( | ||
<<%= prefix.className %>Container> | ||
<<%= prefix.className %>Stack> | ||
<Box> | ||
<<%= prefix.className %>Group> | ||
<Group> | ||
{leftAction ? leftAction : null} | ||
<Title order={2}>{title ?? ''}</Title> | ||
</Group> | ||
{rightAction ? <Group>{rightAction}</Group> : null} | ||
</<%= prefix.className %>Group> | ||
</Box> | ||
<<%= prefix.className %>Stack my="xs" gap="xl"> | ||
{children} | ||
</<%= prefix.className %>Stack> | ||
</<%= prefix.className %>Stack> | ||
</<%= prefix.className %>Container> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
packages/generators/src/generators/component/files/page/index.ts.template
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 @@ | ||
export * from './<%= prefix.fileName %>-page' |
6 changes: 3 additions & 3 deletions
6
.../src/generators/component/files/theme-switch/__prefixFileName__-theme-switch.tsx.template
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.