Skip to content

Commit 2a6d6f8

Browse files
authored
Merge pull request #16 from laurazenc/feat/components-text
feat: text component
2 parents eff2f2f + 5e70c36 commit 2a6d6f8

27 files changed

+290
-2978
lines changed

babel.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ module.exports = function (api) {
1717
},
1818
],
1919
"@babel/preset-typescript",
20-
"@babel/preset-react",
20+
["@babel/preset-react",
21+
{ "runtime": "automatic", "importSource": "@emotion/react" }
22+
],
23+
"@emotion/babel-preset-css-prop"
2124
]
2225

2326
const plugins = [
27+
"@emotion/babel-plugin",
2428
"@babel/plugin-proposal-class-properties",
2529
]
2630

jest.config.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11

22
module.exports = {
3-
preset: "ts-jest",
4-
testEnvironment: "node",
3+
preset: 'ts-jest',
4+
projects: ['<rootDir>/jest.config.js'],
5+
modulePaths: [`<rootDir>/src/`],
56
collectCoverageFrom: ["src/**/*.{ts,tsx, js, jsx}"],
6-
transform: { ".(ts|tsx)$": "ts-jest/dist" },
77
transformIgnorePatterns: ["[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$"],
88
setupFilesAfterEnv: ["@testing-library/jest-dom/extend-expect"],
9-
coveragePathIgnorePatterns: ["<roorDir>/node_modules/", "<rootDir>/src/index.ts"],
10-
globals: {
11-
"ts-jest": {
12-
tsconfig: "tsconfig.json",
13-
},
14-
},
9+
coveragePathIgnorePatterns: ["<roorDir>/node_modules/", "<rootDir>/src/index.ts"],
10+
modulePathIgnorePatterns: ["<rootDir>/dist/"]
11+
1512
}

lerna.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"theme:build": "yarn theme build",
1919
"theme:test": "yarn theme test",
2020
"theme:clean": "yarn theme clean",
21+
"components": "yarn workspace @react-atomic-ui/components",
2122
"site": "yarn workspace @react-atomic-ui/site",
2223
"site:dev": "yarn site dev",
2324
"build": "yarn workspaces run build",
@@ -36,6 +37,8 @@
3637
"@babel/preset-react": "7.12.13",
3738
"@babel/preset-typescript": "7.12.17",
3839
"@babel/runtime": "7.12.18",
40+
"@emotion/babel-plugin": "^11.2.0",
41+
"@emotion/babel-preset-css-prop": "^11.2.0",
3942
"@testing-library/jest-dom": "^5.11.9",
4043
"@testing-library/react": "^11.2.5",
4144
"@testing-library/react-hooks": "^5.0.3",
@@ -57,7 +60,6 @@
5760
"eslint-plugin-react-hooks": "^4.2.0",
5861
"eslint-plugin-testing-library": "^3.10.1",
5962
"jest": "^26.6.3",
60-
"lerna": "^3.22.1",
6163
"nodemon": "^2.0.7",
6264
"prettier": "^2.2.1",
6365
"react": "^17.0.1",

packages/components/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# `components`
2+
3+
> TODO: description
4+
5+
## Usage
6+
7+
```
8+
import { ... } from '@react-atomic-ui/components
9+
10+
// TODO: DEMONSTRATE API
11+
```

packages/components/global.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="@emotion/react/types/css-prop" />

packages/components/jest.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// eslint-disable-next-line @typescript-eslint/no-var-requires
2+
const commonConfig = require("../../jest.config")
3+
4+
module.exports = {
5+
...commonConfig,
6+
coveragePathIgnorePatterns: [
7+
"node_modules",
8+
"<rootDir>/src/atoms/index.ts",
9+
"<rootDir>/src/index.ts",
10+
],
11+
}

packages/components/package.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "@react-atomic-ui/components",
3+
"version": "1.0.0",
4+
"description": "> TODO: description",
5+
"author": "Laura <laurazenc@gmail.com>",
6+
"homepage": "https://github.com/laurazenc/react-atomic-ui#readme",
7+
"license": "ISC",
8+
"main": "dist/cjs/index.js",
9+
"module": "dist/esm/index.js",
10+
"types": "dist/types/index.d.ts",
11+
"typings": "dist/types/index.d.ts",
12+
"files": [
13+
"dist"
14+
],
15+
"repository": {
16+
"type": "git",
17+
"url": "git+https://github.com/laurazenc/react-atomic-ui.git"
18+
},
19+
"scripts": {
20+
"prebuild": "rimraf dist",
21+
"dev": "nodemon --watch src --exec yarn build -e ts,tsx",
22+
"build": "concurrently yarn:build:*",
23+
"build:esm": "tsc --module es6 --target es5 --outDir dist/esm",
24+
"build:cjs": "tsc --module commonjs --target es5 --outDir dist/cjs",
25+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
26+
"clean": "rimraf coverage",
27+
"test": "jest --passWithNoTests --env=jsdom ",
28+
"test:ci": "yarn test --watchAll --coverage",
29+
"test:cov": "yarn clean && yarn test --coverage --ci --runInBand",
30+
"lint": "eslint src --ext .ts,.tsx --config ../../.eslintrc"
31+
},
32+
"bugs": {
33+
"url": "https://github.com/laurazenc/react-atomic-ui/issues"
34+
},
35+
"peerDependencies": {
36+
"react": "17.x"
37+
},
38+
"dependencies": {
39+
"@react-atomic-ui/theme": "*",
40+
"@emotion/react": "^11.1.5"
41+
}
42+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { render } from "@testing-library/react"
2+
import React from "react"
3+
import { Box, Row } from "./index"
4+
5+
describe("Layout", () => {
6+
it("should render Box", () => {
7+
const renderInstance = render(<Box>wadus</Box>)
8+
expect(renderInstance.asFragment().firstChild).toBeDefined()
9+
})
10+
11+
it("should render Row", () => {
12+
const renderInstance = render(<Row>wadus</Row>)
13+
expect(renderInstance.asFragment().firstChild).toBeDefined()
14+
})
15+
})
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as CSS from "csstype"
2+
3+
export interface FlexProps {
4+
alignItems?: CSS.Property.AlignItems
5+
justifyContent?: CSS.Property.JustifyContent
6+
flexWrap?: CSS.Property.FlexWrap
7+
flexDirection?: CSS.Property.FlexDirection
8+
flexBsis?: CSS.Property.FlexBasis
9+
flexGrow?: CSS.Property.FlexGrow
10+
flexShrink?: CSS.Property.FlexShrink
11+
}
12+
13+
export interface SizeProps {
14+
width?: CSS.Property.Width
15+
height?: CSS.Property.Height
16+
}

0 commit comments

Comments
 (0)