Skip to content

Commit

Permalink
fix: generateNeutralColorPalettes type not match (#165)
Browse files Browse the repository at this point in the history
* fix: generateNeutralColorPalettes type not match

* use react-component/rc-test/.github/workflows/test.yml

* fix

* fix
  • Loading branch information
afc163 authored Jan 7, 2025
1 parent 4496e73 commit a81d0f2
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 120 deletions.
117 changes: 5 additions & 112 deletions .github/workflows/react-component-ci.yml
Original file line number Diff line number Diff line change
@@ -1,113 +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
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,8 @@
"react-dom": "^18.0.0",
"typescript": "^4.6.3",
"umi-test": "^1.9.7"
},
"overrides": {
"cheerio": "1.0.0-rc.12"
}
}
}
2 changes: 1 addition & 1 deletion src/form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export interface ValidateFieldsOptions {
// function create
export interface WrappedFormUtils<V = any> {
/** 获取一组输入控件的值,如不传入参数,则获取全部组件的值 */
getFieldsValue(fieldNames?: string[]): { [field: string]: any };
getFieldsValue(fieldNames?: string[]): Record<string, any>;
/** 获取一个输入控件的值 */
getFieldValue(fieldName: string): any;
/** 设置一组输入控件的值 */
Expand Down
4 changes: 1 addition & 3 deletions src/form/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ interface FORWARD_REF_STATICS {

type NonReactStatics<
S extends React.ComponentType<any>,
C extends {
[key: string]: true;
} = {}
C extends Record<string, true> = {}
> = {
[key in Exclude<
keyof S,
Expand Down
4 changes: 1 addition & 3 deletions src/icon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ export interface IconComponent<P> extends React.FC<P> {
setTwoToneColor: typeof setTwoToneColor;
}

const iconsMap: {
[key: string]: any;
} = allIcons;
const iconsMap: Record<string, any> = allIcons;

const LegacyTypeIcon: React.FC<LegacyTypeIconProps> = props => {
const { type, theme } = props;
Expand Down
4 changes: 4 additions & 0 deletions src/theme/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const generateNeutralColorPalettes: GenerateNeutralColorMap = (
colorBorder: getSolidColor(colorBgBase, 26),
colorBorderSecondary: getSolidColor(colorBgBase, 19),
colorSplit: getAlphaColor(colorTextBase, 0.12),

colorBgSolid: getAlphaColor(colorTextBase, 0.95),
colorBgSolidHover: getAlphaColor(colorTextBase, 1),
colorBgSolidActive: getAlphaColor(colorTextBase, 0.9),
};
};

Expand Down
4 changes: 4 additions & 0 deletions src/theme/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const generateNeutralColorPalettes: GenerateNeutralColorMap = (
colorBorder: getSolidColor(colorBgBase, 15),
colorBorderSecondary: getSolidColor(colorBgBase, 6),
colorSplit: getAlphaColor(colorTextBase, 0.06),

colorBgSolid: getAlphaColor(colorTextBase, 1),
colorBgSolidHover: getAlphaColor(colorTextBase, 0.75),
colorBgSolidActive: getAlphaColor(colorTextBase, 0.95),
};
};

Expand Down
3 changes: 3 additions & 0 deletions src/theme/genColorMapToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export default function genColorMapToken(

colorErrorBg: errorColors[1],
colorErrorBgHover: errorColors[2],
colorErrorBgFilledHover: new TinyColor(errorColors[1])
.mix(new TinyColor(errorColors[3]), 50)
.toHexString(),
colorErrorBorder: errorColors[3],
colorErrorBgActive: errorColors[3],
colorErrorBorderHover: errorColors[4],
Expand Down

0 comments on commit a81d0f2

Please sign in to comment.