Skip to content

Commit

Permalink
fix: export create folder
Browse files Browse the repository at this point in the history
  • Loading branch information
wootsbot committed Dec 26, 2023
1 parent 8897350 commit 6962e7f
Show file tree
Hide file tree
Showing 22 changed files with 36 additions and 54 deletions.
8 changes: 0 additions & 8 deletions examples/basic/src/components/Box.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions examples/basic/src/components/Stack.tsx

This file was deleted.

23 changes: 10 additions & 13 deletions examples/basic/src/screens/DS/screen.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
import { ScrollView, View } from 'react-native';
import { ScrollView, View } from "react-native";

import { Text } from '@design-blocks/primitives';
import { Text, Box, Stack } from "@design-blocks/primitives";

import { block } from '../../../blocks.config';

import Box from '../../components/Box';
import Stack from '../../components/Stack';
import { block } from "../../../blocks.config";

const ScrollViewBlock = block(ScrollView)(({ theme }) => {
return {
backgroundColor: theme.colors.blue[950],
height: '100%',
height: "100%",
};
});

function DSScreen() {
return (
<ScrollViewBlock contentInsetAdjustmentBehavior='automatic'>
<Text mb='2xl' fontSize='10xl' color='zinc.50' textAlign='center'>
<ScrollViewBlock contentInsetAdjustmentBehavior="automatic">
<Text mb="2xl" fontSize="10xl" color="zinc.50" textAlign="center">
Blocks v0.0.1
</Text>

<Stack gap='8xl'>
<Box bgColor='fuchsia.500'>
<Stack gap="8xl">
<Box bgColor="fuchsia.500">
<Text>Box 1</Text>
</Box>

<Box bgColor='amber.500'>
<Box bgColor="amber.500">
<Text>Box 2</Text>
</Box>

<Box bgColor='red.500'>
<Box bgColor="red.500">
<Text>Box 3</Text>
</Box>

Expand Down
2 changes: 1 addition & 1 deletion packages/@blocks-primitives/src/Box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';

import { __DEV__ } from '@design-blocks/utils';

import { createBox } from '../create';
import { createBox } from './createBox';

const Box = createBox();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import block from '@design-blocks/block';
import { StyleFunctionMode, styleFunction } from '@design-blocks/system';
import { __DEV__ } from '@design-blocks/utils';

import type { BoxProps } from '../Box';
import type { BoxProps } from './Box.types';

export function createBox<AdditionalProps extends BoxProps = BoxProps>() {
const BoxBlock = block(RN.View, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';

import { Text } from 'react-native';

import { lightTheme, renderWithWrapper, screen } from '../../.ci/testHelper';
import { lightTheme, renderWithWrapper, screen } from '../../../.ci/testHelper';

import { Box } from '.';
import { Box } from '../..';

describe('<Box />', () => {
it('should render correctly', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Text } from 'react-native';

import { renderWithWrapper, screen } from '../../../.ci/testHelper';

import { createBox } from '..';
import { createBox } from '../createBox';

describe('createBox', () => {
const Box = createBox();
Expand Down
2 changes: 1 addition & 1 deletion packages/@blocks-primitives/src/Stack/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';

import { __DEV__ } from '@design-blocks/utils';

import { createStack } from '../create';
import { createStack } from './createStack';

import type { StackProps } from './Stack.types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { StyleFunctionMode, styleFunction } from '@design-blocks/system';
import { __DEV__, camelCase } from '@design-blocks/utils';

import { Box } from '../Box';
import { variants } from '../Stack/Stack.utils';
import { variants } from './Stack.utils';

import type { IStackStyleValue, StackProps } from '../Stack/Stack.types';
import type { IStackStyleValue, StackProps } from './Stack.types';

export function createStack<AdditionalProps extends StackProps = StackProps>() {
const StackBlock = block(Box, {
Expand Down
1 change: 1 addition & 0 deletions packages/@blocks-primitives/src/Stack/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { default as Stack } from './Stack';
export * from './createStack';
export type { StackProps } from './Stack.types';
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';

import { Text, View } from 'react-native';

import { lightTheme, renderWithWrapper, screen } from '../../.ci/testHelper';
import { lightTheme, renderWithWrapper, screen } from '../../../.ci/testHelper';

import { Stack } from '.';
import { Stack } from '../..';

const flexboxStyles = {
display: 'flex',
Expand Down Expand Up @@ -37,7 +37,10 @@ describe('<Stack />', () => {
const result = screen.toJSON();

expect(result.type).toEqual('View');
expect(result.props.style[1][0]).toMatchObject({ ...flexboxStyles, flexDirection: 'row' });
expect(result.props.style[1][0]).toMatchObject({
...flexboxStyles,
flexDirection: 'row',
});
});

it('should render the View component with a background color corresponding to the "red.950" value from the bgColor prop', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/@blocks-primitives/src/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';

import { __DEV__ } from '@design-blocks/utils';

import { createText } from '../create';
import { createText } from './createText';

const Text = createText();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import block from '@design-blocks/block';
import { StyleFunctionMode, styleFunction } from '@design-blocks/system';
import { __DEV__ } from '@design-blocks/utils';

import type { TextProps } from '../Text/Text.types';
import type { TextProps } from './Text.types';

export function createText<AdditionalProps extends TextProps = TextProps>() {
const TextBlock = block(RN.Text, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';

import { lightTheme, renderWithWrapper, screen } from '../../.ci/testHelper';
import { lightTheme, renderWithWrapper, screen } from '../../../.ci/testHelper';

import { Text } from '.';
import { Text } from '../..';

describe('<Text />', () => {
it('should render correctly', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import { lightTheme, renderWithWrapper, screen } from '../../../.ci/testHelper';

import { createText } from '../..';
import { createText } from '../createText';

describe('createText', () => {
const Text = createText();
Expand Down
2 changes: 1 addition & 1 deletion packages/@blocks-primitives/src/XStack/XStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';

import { __DEV__ } from '@design-blocks/utils';

import { createStack } from '../create';
import { createStack } from '../Stack';

import type { StackProps } from '../Stack';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';

import { Text, View } from 'react-native';

import { lightTheme, renderWithWrapper, screen } from '../../.ci/testHelper';
import { lightTheme, renderWithWrapper, screen } from '../../../.ci/testHelper';

import { XStack } from '.';
import { XStack } from '../..';

const flexboxStyles = {
display: 'flex',
Expand Down
2 changes: 1 addition & 1 deletion packages/@blocks-primitives/src/YStack/YStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';

import { __DEV__ } from '@design-blocks/utils';

import { createStack } from '../create';
import { createStack } from '../Stack';

import type { StackProps } from '../Stack';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';

import { Text, View } from 'react-native';

import { lightTheme, renderWithWrapper, screen } from '../../.ci/testHelper';
import { lightTheme, renderWithWrapper, screen } from '../../../.ci/testHelper';

import { YStack } from '.';
import { YStack } from '../..';

const flexboxStyles = {
display: 'flex',
Expand Down
3 changes: 0 additions & 3 deletions packages/@blocks-primitives/src/create/index.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/@blocks-primitives/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ export * from './Stack';
export * from './Text';
export * from './XStack';
export * from './YStack';
export * from './create';

0 comments on commit 6962e7f

Please sign in to comment.