diff --git a/package.json b/package.json index b931623..2045c50 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,9 @@ "version": "0.0.1", "description": "zhst 工具库合集", "license": "MIT", + "exports": { + "./package.json": "./package.json" + }, "main": "src/index.ts", "module": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/biz/package.json b/packages/biz/package.json index 44d1dff..59dc496 100644 --- a/packages/biz/package.json +++ b/packages/biz/package.json @@ -19,7 +19,9 @@ "module": "es/index.js", "typings": "es/index.d.ts", "exports": { - "./package.json": "./package.json" + ".": { + "import": "./src/index.ts" + } }, "files": [ "es", diff --git a/packages/constants/package.json b/packages/constants/package.json index 9742099..507569f 100644 --- a/packages/constants/package.json +++ b/packages/constants/package.json @@ -20,7 +20,9 @@ "module": "es/index.js", "typings": "es/index.d.ts", "exports": { - "./package.json": "./package.json" + ".": { + "import": "./src/index.ts" + } }, "files": [ "es", diff --git a/packages/func/package.json b/packages/func/package.json index 248ca30..fc14d69 100644 --- a/packages/func/package.json +++ b/packages/func/package.json @@ -17,7 +17,9 @@ "module": "es/index.js", "typings": "es/index.d.ts", "exports": { - "./*": "./*", + ".": { + "import": "./src/index.ts" + }, "./package.json": "./package.json" }, "files": [ diff --git a/packages/hooks/package.json b/packages/hooks/package.json index b872541..1ec4ee1 100644 --- a/packages/hooks/package.json +++ b/packages/hooks/package.json @@ -17,6 +17,9 @@ "module": "es/index.js", "typings": "es/index.d.ts", "exports": { + ".": { + "import": "./src/index.ts" + }, "./package.json": "./package.json" }, "files": [ diff --git a/packages/meta/package.json b/packages/meta/package.json index 834eda6..373e28d 100644 --- a/packages/meta/package.json +++ b/packages/meta/package.json @@ -14,16 +14,16 @@ "lib/**/style/*", "*.less" ], + "type": "module", "main": "lib/index.js", - "module": "es/index.js", - "typings": "es/index.d.ts", + "module": "es/index.ts", + "typings": "src/index.ts", "exports": { - "./package.json": "./package.json" + ".": { + "import": "./src/index.ts" + } }, "files": [ - "es", - "lib", - "dist" ], "scripts": { "build": "father build" @@ -47,6 +47,7 @@ "@types/downloadjs": "^1.4.6", "@zhst/func": "workspace:^", "@zhst/hooks": "workspace:^", + "@zhst/meta": "workspace:^", "antd": "^5.12.5", "antd-style": "^3.6.1", "classnames": "^2.5.1", diff --git a/packages/meta/src/descriptions/demo/component-token.tsx b/packages/meta/src/descriptions/demo/component-token.tsx index 01c004b..0463bf9 100644 --- a/packages/meta/src/descriptions/demo/component-token.tsx +++ b/packages/meta/src/descriptions/demo/component-token.tsx @@ -100,13 +100,14 @@ const App: React.FC = () => { theme={{ components: { Descriptions: { - labelBg: 'red', - titleColor: 'red', + labelBg: '#f6f6f6', + titleColor: 'rgba(0,0,0,0.88)', + colorTextLabel: 'rgba(0,0,0,0.88)', titleMarginBottom: 2, itemPaddingBottom: 8, colonMarginRight: 10, colonMarginLeft: 20, - contentColor: 'green', + contentColor: 'rgba(0,0,0,0.88)', extraColor: 'blue', }, }, diff --git a/packages/meta/src/descriptions/index.zh-CN.md b/packages/meta/src/descriptions/index.zh-CN.md index e8bd394..020174c 100644 --- a/packages/meta/src/descriptions/index.zh-CN.md +++ b/packages/meta/src/descriptions/index.zh-CN.md @@ -2,9 +2,7 @@ category: Components subtitle: 描述列表 group: 数据展示 -title: Descriptions -cover: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*fHdlTpif6XQAAAAAAAAAAAAADrJ8AQ/original -coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*d27AQJrowGAAAAAAAAAAAAAADrJ8AQ/original +title: Descriptions 描述列表 --- 成组展示多个只读字段。 @@ -102,7 +100,3 @@ const items: DescriptionsProps['items'] = [ | span | 包含列的数量 | number \| [Screens](/components/grid#col) | 1 | `screens: 5.9.0` | > span 是 Description.Item 的数量。 span={2} 会占用两个 DescriptionItem 的宽度。当同时配置 `style` 和 `labelStyle`(或 `contentStyle`)时,两者会同时作用。样式冲突时,后者会覆盖前者。 - -## 主题变量(Design Token) - - diff --git a/packages/meta/src/tabs/demo/centered.tsx b/packages/meta/src/tabs/demo/centered.tsx index 636a1bd..946135e 100644 --- a/packages/meta/src/tabs/demo/centered.tsx +++ b/packages/meta/src/tabs/demo/centered.tsx @@ -1,19 +1,38 @@ import React from 'react'; -import { Tabs } from '@zhst/meta'; +import { Tabs, ConfigProvider } from '@zhst/meta'; +import type { TabsProps } from '@zhst/meta'; -const App: React.FC = () => ( - { - const id = String(i + 1); - return { - label: `Tab ${id}`, - key: id, - children: `Content of Tab Pane ${id}`, - }; - })} - /> -); +const items: TabsProps['items'] = [ + { + key: '1', + label: '场景图', + }, + { + key: '2', + label: '对比图', + } +]; + +const App: React.FC = () => { + return ( + + + + ) +}; export default App; diff --git a/packages/meta/src/tabs/index.tsx b/packages/meta/src/tabs/index.tsx index 99ee907..3b83e5f 100644 --- a/packages/meta/src/tabs/index.tsx +++ b/packages/meta/src/tabs/index.tsx @@ -56,7 +56,6 @@ const Tabs: React.FC & { TabPane: typeof TabPane } = (props) => { const { direction, tabs, getPrefixCls, getPopupContainer } = React.useContext(ConfigContext); const prefixCls = getPrefixCls('tabs', customizePrefixCls); const rootCls = useCSSVarCls(prefixCls); - console.log(prefixCls) const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls); let editable: EditableConfig | undefined; @@ -82,7 +81,10 @@ const Tabs: React.FC & { TabPane: typeof TabPane } = (props) => { ); } - const mergedItems = useLegacyItems(items, children); + /** + * 合并并且校验传递值 + */ + let mergedItems = useLegacyItems(items, children) const mergedAnimated = useAnimateConfig(prefixCls, animated); diff --git a/packages/meta/tsconfig.json b/packages/meta/tsconfig.json new file mode 100644 index 0000000..5f99e14 --- /dev/null +++ b/packages/meta/tsconfig.json @@ -0,0 +1,9 @@ +{ + "references": [{ "path": "../../tsconfig.json" }], + "compilerOptions": { + "paths": { + "@zhst/meta": ["./src"] + } + }, + "exclude": ["src/**/demo"] +} diff --git a/packages/request/package.json b/packages/request/package.json index 9f9b43b..3cf06d2 100644 --- a/packages/request/package.json +++ b/packages/request/package.json @@ -18,6 +18,9 @@ "module": "es/index.js", "typings": "es/index.d.ts", "exports": { + ".": { + "import": "./src/index.ts" + }, "./package.json": "./package.json" }, "files": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 49f690a..19af500 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -211,6 +211,9 @@ importers: '@zhst/hooks': specifier: workspace:^ version: link:../hooks + '@zhst/meta': + specifier: workspace:^ + version: 'link:' antd: specifier: ^5.12.5 version: 5.12.5(react-dom@18.2.0)(react@18.2.0) diff --git a/tsconfig.json b/tsconfig.json index 3123513..a5a9c89 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,11 +4,12 @@ "declaration": true, "skipLibCheck": true, "esModuleInterop": true, + "composite": true, "jsx": "react", "baseUrl": "./", "paths": { "@@/*": [".dumi/tmp/*"], - "@zhst/*": ["components/*", "*"] + "@zhst/*": ["packages/*", "*"] }, "strictNullChecks": true, "module": "esnext", @@ -19,6 +20,7 @@ "noUnusedParameters": true, "noUnusedLocals": true, "noImplicitAny": true, + "isolatedModules": false, "target": "es6", "lib": ["dom", "es2017"], "stripInternal": true,