-
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
9 changed files
with
169 additions
and
3 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
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,11 @@ | ||
# `@artifak/container` | ||
|
||
> TODO: description | ||
## Usage | ||
|
||
``` | ||
const container = require('@artifak/container'); | ||
// TODO: DEMONSTRATE API | ||
``` |
27 changes: 27 additions & 0 deletions
27
packages/container/__tests__/__snapshots__/container.test.tsx.snap
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,27 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`@artifak/container renders 1`] = ` | ||
<DocumentFragment> | ||
<div | ||
class="sc-bdfBwQ eaQfTv" | ||
width="100%" | ||
> | ||
<p> | ||
Hello World | ||
</p> | ||
</div> | ||
</DocumentFragment> | ||
`; | ||
|
||
exports[`@artifak/container renders 2`] = ` | ||
<DocumentFragment> | ||
<div | ||
class="sc-bdfBwQ lmFeAU" | ||
width="100%" | ||
> | ||
<p> | ||
Hello World | ||
</p> | ||
</div> | ||
</DocumentFragment> | ||
`; |
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,29 @@ | ||
import { Container } from '../src'; | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
|
||
describe('@artifak/container', () => { | ||
it('renders', () => { | ||
const { asFragment } = render( | ||
<Container> | ||
<> | ||
<p>Hello World</p> | ||
</> | ||
</Container> | ||
); | ||
|
||
expect(asFragment()).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders', () => { | ||
const { asFragment } = render( | ||
<Container maxWidth={['40em', '52em', '64em', '80em']}> | ||
<> | ||
<p>Hello World</p> | ||
</> | ||
</Container> | ||
); | ||
|
||
expect(asFragment()).toMatchSnapshot(); | ||
}); | ||
}); |
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,22 @@ | ||
import React from 'react'; | ||
import { Container } from './src'; | ||
|
||
export const ContainerTest = () => { | ||
return ( | ||
<Container | ||
maxWidth={['40em', '52em', '64em', '80em']} | ||
style={{ | ||
background: 'red' | ||
}} | ||
> | ||
<> | ||
<p>Hello World</p> | ||
</> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default { | ||
title: 'Container', | ||
component: [ContainerTest] | ||
}; |
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,55 @@ | ||
{ | ||
"name": "@artifak/container", | ||
"version": "1.0.0", | ||
"description": "A basic React container component", | ||
"keywords": [ | ||
"react", | ||
"react-component", | ||
"component", | ||
"ui", | ||
"container", | ||
"grid", | ||
"block", | ||
"layout" | ||
], | ||
"author": "Julian Low", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "dist/container.cjs.js", | ||
"module": "dist/container.esm.js", | ||
"src": "src/index.tsx", | ||
"types": "dist/src/index.d.ts", | ||
"directories": { | ||
"test": "__tests__", | ||
"src": "src" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/heyjul3s/artifak.git" | ||
}, | ||
"scripts": { | ||
"build": "rimraf dist && builder", | ||
"test": "echo \"Error: run tests from root\" && exit 1" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/heyjul3s/artifak/issues" | ||
}, | ||
"homepage": "https://github.com/heyjul3s/artifak#readme", | ||
"devDependencies": { | ||
"@artifak/bundler": "^1.1.4" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=17.0.1", | ||
"react-dom": ">=17.0.1", | ||
"styled-components": ">=5.2.1" | ||
}, | ||
"dependencies": { | ||
"@artifak/component-generator": "^2.0.3" | ||
} | ||
} |
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,13 @@ | ||
import React from 'react'; | ||
import { createStyledComponent, BaseProps } from '@artifak/component-generator'; | ||
|
||
export function Container({ children, ...props }) { | ||
return <ContainerBase {...props}>{children}</ContainerBase>; | ||
} | ||
|
||
const ContainerBase = createStyledComponent<BaseProps<any>>({ | ||
styles: { | ||
margin: '0 auto', | ||
width: '100%' | ||
} | ||
}); |
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,9 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"allowSyntheticDefaultImports": true, | ||
"compilerOptions": { | ||
"outDir": "dist" | ||
}, | ||
"references": [], | ||
"include": ["src"] | ||
} |
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