diff --git a/.dumirc.ts b/.dumirc.ts index b50763f..498e3b6 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -1,5 +1,8 @@ import { defineConfig } from 'dumi'; +const basePath = process.env.GH_PAGES ? '/input/' : '/'; +const publicPath = process.env.GH_PAGES ? '/input/' : '/'; + export default defineConfig({ mfsu: false, favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'], @@ -7,4 +10,7 @@ export default defineConfig({ name: 'Input', logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', }, + outputPath: '.doc', + base: basePath, + publicPath, }); diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 432a3fb..5735e2d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,114 +1,6 @@ -name: CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - +name: β test +on: [push, pull_request] jobs: - setup: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@master - - - uses: actions/setup-node@v1 - with: - node-version: '12' - - - name: cache package-lock.json - uses: actions/cache@v2 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: create package-lock.json - run: npm i --package-lock-only - - - name: hack for singe file - run: | - if [ ! -d "package-temp-dir" ]; then - mkdir package-temp-dir - fi - cp package-lock.json package-temp-dir - - - name: cache node_modules - id: node_modules_cache_id - uses: actions/cache@v2 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: install - if: steps.node_modules_cache_id.outputs.cache-hit != 'true' - run: npm ci - - lint: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@master - - - name: restore cache from package-lock.json - uses: actions/cache@v2 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: restore cache from node_modules - uses: actions/cache@v2 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: lint - run: npm run lint - - needs: setup - - compile: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@master - - - name: restore cache from package-lock.json - uses: actions/cache@v2 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: restore cache from node_modules - uses: actions/cache@v2 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: compile - run: npm run compile - - needs: setup - - coverage: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@master - - - name: restore cache from package-lock.json - uses: actions/cache@v2 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: restore cache from node_modules - uses: actions/cache@v2 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: coverage - run: npm test -- --coverage && bash <(curl -s https://codecov.io/bash) - - needs: setup + test: + uses: react-component/rc-test/.github/workflows/test.yml@main + secrets: inherit \ No newline at end of file diff --git a/.gitignore b/.gitignore index f1b640b..d099b0d 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,5 @@ dist/ # dumi .dumi/tmp .dumi/tmp-production +.node +bun.lockb diff --git a/README.md b/README.md index 88daefe..e1bb3f6 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,30 @@ # rc-input β¨οΈ -[![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![Dependencies][david-image]](david-url) [![DevDependencies][david-dev-image]][david-dev-url] [![bundle size][bundlephobia-image]][bundlephobia-url] +[![NPM version][npm-image]][npm-url] +[![npm download][download-image]][download-url] +[![build status][github-actions-image]][github-actions-url] +[![Codecov][codecov-image]][codecov-url] +[![bundle size][bundlephobia-image]][bundlephobia-url] +[![dumi][dumi-image]][dumi-url] [npm-image]: http://img.shields.io/npm/v/rc-input.svg?style=flat-square -[npm-url]: http://npmjs.org/package/rc-input +[npm-url]: http://npmjs.org/package/rc-select +[travis-image]: https://img.shields.io/travis/react-component/input/master?style=flat-square +[travis-url]: https://travis-ci.com/react-component/input [github-actions-image]: https://github.com/react-component/input/workflows/CI/badge.svg [github-actions-url]: https://github.com/react-component/input/actions [codecov-image]: https://img.shields.io/codecov/c/github/react-component/input/master.svg?style=flat-square -[codecov-url]: https://codecov.io/gh/react-component/input/branch/master +[codecov-url]: https://app.codecov.io/gh/react-component/input [david-url]: https://david-dm.org/react-component/input [david-image]: https://david-dm.org/react-component/input/status.svg?style=flat-square [david-dev-url]: https://david-dm.org/react-component/input?type=dev [david-dev-image]: https://david-dm.org/react-component/input/dev-status.svg?style=flat-square -[download-image]: https://img.shields.io/npm/dm/rc-input.svg?style=flat-square -[download-url]: https://npmjs.org/package/rc-input -[bundlephobia-url]: https://bundlephobia.com/result?p=rc-input -[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-input +[download-image]: https://img.shields.io/npm/dm/rc-select.svg?style=flat-square +[download-url]: https://npmjs.org/package/rc-select +[bundlephobia-url]: https://bundlephobia.com/package/rc-select +[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-select +[dumi-url]: https://github.com/umijs/dumi +[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square ## Install diff --git a/assets/index.less b/assets/index.less index cd89f8f..afac539 100644 --- a/assets/index.less +++ b/assets/index.less @@ -1,4 +1,8 @@ .rc-input { + &-out-of-range { + color: red; + } + &-affix-wrapper { padding: 2px 8px; overflow: hidden; diff --git a/bunfig.toml b/bunfig.toml new file mode 100644 index 0000000..80d57b6 --- /dev/null +++ b/bunfig.toml @@ -0,0 +1,2 @@ +[install] +peer = false \ No newline at end of file diff --git a/docs/examples/addon.tsx b/docs/examples/addon.tsx index f461ce5..7f9b884 100644 --- a/docs/examples/addon.tsx +++ b/docs/examples/addon.tsx @@ -1,7 +1,7 @@ +import Input from 'rc-input'; import type { FC } from 'react'; import React from 'react'; import '../../assets/index.less'; -import Input from 'rc-input'; const Demo: FC = () => { return ( diff --git a/docs/examples/show-count.tsx b/docs/examples/show-count.tsx index 42d590e..8d1be49 100644 --- a/docs/examples/show-count.tsx +++ b/docs/examples/show-count.tsx @@ -1,10 +1,68 @@ +import Input from 'rc-input'; import type { FC } from 'react'; import React from 'react'; import '../../assets/index.less'; -import Input from 'rc-input'; + +const sharedHeadStyle: React.CSSProperties = { + margin: 0, + padding: 0, +}; const Demo: FC = () => { - return ; + return ( +