-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
1 parent
5e3149a
commit 4ec4ebb
Showing
11 changed files
with
99 additions
and
107 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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
node_modules | ||
yarn.lock | ||
/dist.js | ||
build | ||
dist |
Empty file.
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 |
---|---|---|
|
@@ -10,23 +10,22 @@ | |
"email": "[email protected]", | ||
"url": "https://sindresorhus.com" | ||
}, | ||
"main": "dist.js", | ||
"type": "module", | ||
"exports": { | ||
"types": "./build/index.d.ts", | ||
"default": "./build/index.js" | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
}, | ||
"engines": { | ||
"node": ">=14.16" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "xo && ava", | ||
"prepublish": "npm run build", | ||
"pretest": "npm run build", | ||
"test": "xo && ava" | ||
"pretest": "npm run build" | ||
}, | ||
"files": [ | ||
"build" | ||
"dist" | ||
], | ||
"keywords": [ | ||
"ink-component", | ||
|
@@ -45,46 +44,36 @@ | |
"command-line" | ||
], | ||
"dependencies": { | ||
"cfonts": "^2.8.6", | ||
"prop-types": "^15.7.2" | ||
"cfonts": "^3.1.1", | ||
"prop-types": "^15.8.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.3.3", | ||
"@babel/preset-react": "^7.0.0", | ||
"@sindresorhus/tsconfig": "^3.0.1", | ||
"@types/react": "^18.0.28", | ||
"ava": "^5.1.1", | ||
"clear-module": "^3.1.0", | ||
"eslint-config-xo-react": "^0.19.0", | ||
"eslint-plugin-react": "^7.7.0", | ||
"eslint-plugin-react-hooks": "^1.4.0", | ||
"ink": "^4", | ||
"ink-testing-library": "^3", | ||
"react": "^18", | ||
"strip-ansi": "^5.0.0", | ||
"ava": "^5.2.0", | ||
"clear-module": "^4.1.2", | ||
"eslint-config-xo-react": "^0.27.0", | ||
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"ink": "^4.0.0", | ||
"ink-testing-library": "^3.0.0", | ||
"react": "^18.2.0", | ||
"strip-ansi": "^7.0.1", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.0.2", | ||
"xo": "^0.24.0" | ||
"xo": "^0.53.1" | ||
}, | ||
"peerDependencies": { | ||
"ink": ">=2.0.0", | ||
"react": ">=16.8.0" | ||
}, | ||
"babel": { | ||
"presets": [ | ||
"@ava/stage-4", | ||
"@babel/preset-react" | ||
] | ||
"ink": ">=4", | ||
"react": ">=18" | ||
}, | ||
"xo": { | ||
"extends": [ | ||
"xo-react" | ||
], | ||
"prettier": true, | ||
"rules": { | ||
"unicorn/no-hex-escape": "off", | ||
"unicorn/filename-case": "off" | ||
"unicorn/filename-case": "off", | ||
"@typescript-eslint/naming-convention": "off" | ||
} | ||
}, | ||
"ava": { | ||
|
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 |
---|---|---|
|
@@ -6,8 +6,8 @@ | |
|
||
## Install | ||
|
||
``` | ||
$ npm install ink-big-text | ||
```sh | ||
npm install ink-big-text | ||
``` | ||
|
||
## Usage | ||
|
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 @@ | ||
declare module 'cfonts'; |
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 @@ | ||
import React from 'react'; | ||
import {Text} from 'ink'; | ||
import CFonts from 'cfonts'; | ||
|
||
export type CFontProps = { | ||
font: | ||
| 'block' | ||
| 'slick' | ||
| 'tiny' | ||
| 'grid' | ||
| 'pallet' | ||
| 'shade' | ||
| 'simple' | ||
| 'simpleBlock' | ||
| '3d' | ||
| 'simple3d' | ||
| 'chrome' | ||
| 'huge'; | ||
align: 'left' | 'center' | 'right'; | ||
colors: string[]; | ||
backgroundColor: | ||
| 'transparent' | ||
| 'black' | ||
| 'red' | ||
| 'green' | ||
| 'yellow' | ||
| 'blue' | ||
| 'magenta' | ||
| 'cyan' | ||
| 'white'; | ||
letterSpacing: number; | ||
lineHeight: number; | ||
space: boolean; | ||
maxLength: number; | ||
}; | ||
|
||
export type BigTextProps = {text: string} & Partial<CFontProps>; | ||
|
||
const defaultCFontProps: CFontProps = { | ||
font: 'block', | ||
align: 'left', | ||
colors: ['system'], | ||
backgroundColor: 'transparent', | ||
letterSpacing: 1, | ||
lineHeight: 1, | ||
space: true, | ||
maxLength: 0, | ||
}; | ||
|
||
const BigText: React.FC<BigTextProps> = ({text, ...props}) => { // eslint-disable-line react/function-component-definition | ||
const cFontProps = {...defaultCFontProps, ...props}; | ||
return <Text>{CFonts.render(text, cFontProps).string}</Text>; // eslint-disable-line @typescript-eslint/no-unsafe-call | ||
}; | ||
|
||
export default BigText; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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