Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/nativewind-grid #2092

Merged
merged 24 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1b3cadf
feat: add nativewind grid component
DaminiPandey Apr 23, 2024
7a0c2d9
feat: add grid docs and example
DaminiPandey Apr 23, 2024
28a55d8
feat: add more examples for nativewind grid
DaminiPandey Apr 24, 2024
ee33edd
fix: classname
DaminiPandey Apr 24, 2024
df4ca46
Merge branch 'patch' of https://github.com/gluestack/gluestack-ui int…
DaminiPandey Apr 24, 2024
1904327
feat: add beta tag
DaminiPandey Apr 24, 2024
ae11220
fix: bg color in grid examples
DaminiPandey Apr 24, 2024
7fba600
fix: style
DaminiPandey Apr 24, 2024
e96126e
chore: export grid
DaminiPandey Apr 24, 2024
a7c3f1e
feat: remove platform.os
DaminiPandey Apr 24, 2024
6a939b4
Merge branch 'patch' of https://github.com/gluestack/gluestack-ui int…
DaminiPandey Apr 24, 2024
d9dc223
Merge branch 'patch' of https://github.com/gluestack/gluestack-ui int…
DaminiPandey Apr 25, 2024
582c9f2
fix: preview file
DaminiPandey Apr 25, 2024
8b45109
fix: revert ondevice change
DaminiPandey Apr 25, 2024
e2178b7
fix: meta tag
DaminiPandey Apr 25, 2024
fb2e235
feat: extract classNames to prop
DaminiPandey Apr 29, 2024
6103d7c
feat: update docs
DaminiPandey Apr 29, 2024
73e42cd
feat: update grid styles
DaminiPandey Apr 29, 2024
a623f8d
fix: remove spacing props
DaminiPandey Apr 29, 2024
3f75b25
fix: design review changes
DaminiPandey Apr 30, 2024
65cfd3f
Merge branch 'patch' of https://github.com/gluestack/gluestack-ui int…
DaminiPandey Apr 30, 2024
86a5947
fix: review changes
DaminiPandey May 2, 2024
83b0870
feat: moved function globally
DaminiPandey May 2, 2024
45e2786
fix: grid childre type
DaminiPandey May 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion example/storybook-nativewind/.ondevice/storybook.requires.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ try {

const getStories = () => {
return [
require('../src/components/Grid/Grid.stories.tsx'),
// require('../src/components/Disclosure/Actionsheet/Actionsheet.stories.tsx'),
// require('../src/components/Disclosure/Accordion/Accordion.stories.tsx'),
// require('../src/components/Typography/Text/Text.stories.tsx'),
Expand All @@ -57,7 +58,7 @@ const getStories = () => {
// require('../src/components/Feedback/Alert/Alert.stories.tsx'),
// require('../src/components/Forms/Button/Button.stories.tsx'),
// require('../src/components/DataDisplay/Badge/Badge.stories.tsx'),
require('../src/components/primitives/Button/Button.stories.tsx'),
// require('../src/components/primitives/Button/Button.stories.tsx'),
// require('../src/components/Forms/Checkbox/Checkbox.stories.tsx'),
// require('../src/components/DataDisplay/Divider/Divider.stories.tsx'),
// require('../src/components/Others/Fab/Fab.stories.tsx'),
Expand Down
6 changes: 2 additions & 4 deletions example/storybook-nativewind/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const parameters = {
'Typography',
['Heading', 'Text'],
'Layout',
['Box', 'Center', 'Divider', 'HStack', 'VStack'],
['Box', 'Center', 'Divider', 'HStack', 'VStack', 'Grid'],
'Feedback',
['Alert', 'Progress', 'Spinner', 'Toast'],
'Data Display',
Expand Down Expand Up @@ -75,9 +75,7 @@ export const parameters = {
['Fab'],
],
'Guides',
'Recipes',
['Linear Gradient'],
['More', ['Changelog']],
['Recipes', ['Linear Gradient'], 'More', ['Changelog']],
],
icons: [
{
Expand Down
17 changes: 17 additions & 0 deletions example/storybook-nativewind/src/components/Grid/Grid.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { ComponentMeta } from '@storybook/react-native';
import Grid from './Grid';
import GridExampleOne from './GridExampleOne';
import GridSpacing from './GridSpacing';

const GridMeta: ComponentMeta<typeof Grid> = {
title: 'stories/Grid',
component: Grid,
// metaInfo is required for figma generation
// @ts-ignore
metaInfo: {
componentDescription: `This is a Grid component.`,
},
};

export default GridMeta;
export { Grid, GridExampleOne, GridSpacing };
36 changes: 36 additions & 0 deletions example/storybook-nativewind/src/components/Grid/Grid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Grid, GridItem } from '@/components/ui/grid';
import React from 'react';
import { Text } from 'react-native';

const GridBasic = () => {
return (
<Grid numColumns={8} className="gap-x-5 gap-y-5 p-4 flex-col">
<GridItem colSpan={2} className="bg-pink-500 p-10">
<Text>2</Text>
</GridItem>
<GridItem colSpan={4} className="bg-pink-500">
<Text>4</Text>
</GridItem>
<GridItem colSpan={2} className="bg-pink-500">
<Text>2</Text>
</GridItem>

<GridItem colSpan={8} className="bg-pink-500">
<Text>8</Text>
</GridItem>

<GridItem colSpan={8} className="bg-pink-500">
<Text>12</Text>
</GridItem>

<GridItem colSpan={2} className="bg-pink-500">
<Text>2</Text>
</GridItem>
<GridItem colSpan={6} className="bg-pink-500">
<Text>6</Text>
</GridItem>
</Grid>
);
};

export default GridBasic;
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from 'react';
import { Grid, GridItem } from '@/components/ui/grid';
import { Text } from '@/components/ui/text';

const GridExampleOne = () => {
return (
<Grid numColumns={8}>
<GridItem
colSpan={3}
className="bg-background-100 p-4 rounded-md text-center"
>
<Text>colSpan = 3</Text>
</GridItem>
<GridItem
colSpan={5}
className="bg-background-100 p-4 rounded-md text-center"
>
<Text>colSpan = 5</Text>
</GridItem>
<GridItem
colSpan={6}
className="bg-background-100 p-4 rounded-md text-center"
>
<Text>colSpan = 6</Text>
</GridItem>
<GridItem
colSpan={4}
className="bg-background-100 p-4 rounded-md text-center"
>
<Text>colSpan = 4</Text>
</GridItem>
<GridItem
colSpan={4}
className="bg-background-100 p-4 rounded-md text-center"
>
<Text>colSpan = 4</Text>
</GridItem>
</Grid>
);
};

export default GridExampleOne;
16 changes: 16 additions & 0 deletions example/storybook-nativewind/src/components/Grid/GridSpacing.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import { Grid, GridItem } from '@/components/ui/grid';

const GridSpacing = () => {
return (
<Grid numColumns={9}>
<GridItem colSpan={3} className="bg-background-100 p-4 rounded-md " />

<GridItem colSpan={3} className="bg-background-100 p-4 rounded-md " />

<GridItem colSpan={3} className="bg-background-100 p-4 rounded-md" />
</Grid>
);
};

export default GridSpacing;
Loading
Loading