@yqg/slimfit 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/color/types.d.ts +3 -1
- package/lib/esm/drawer/drawer.d.ts +5 -2
- package/lib/esm/form-mode/types.d.ts +3 -1
- package/lib/esm/image/image-base.d.ts +5 -2
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/message/message.d.ts +4 -2
- package/lib/esm/message/message.js +4 -2
- package/lib/esm/popover/popover.d.ts +3 -1
- package/lib/esm/tabs/typings.d.ts +4 -1
- package/lib/esm/tag/tag.d.ts +5 -2
- package/lib/esm/types/index.d.ts +1 -0
- package/lib/esm/types/index.js +1 -0
- package/lib/esm/types/utils.d.ts +1 -0
- package/lib/esm/types/utils.js +1 -0
- package/package.json +3 -3
package/lib/esm/color/types.d.ts
CHANGED
|
@@ -17,7 +17,9 @@ export interface ColorGroup {
|
|
|
17
17
|
colors: ColorItem[];
|
|
18
18
|
subGroups?: ColorSubGroup[];
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
import type { LiteralUnion } from '../types';
|
|
21
|
+
export type CopyModeValue = 'css-var' | 'hex' | 'tailwind';
|
|
22
|
+
export type CopyMode = LiteralUnion<CopyModeValue>;
|
|
21
23
|
export interface ColorPaletteProps {
|
|
22
24
|
copyMode?: CopyMode;
|
|
23
25
|
showCopyButton?: boolean;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { type DrawerProps as AntdDrawerProps } from 'antd';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import type { LiteralUnion } from '../types';
|
|
3
4
|
import './style.less';
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
5
|
+
export type DrawerSizeValue = 'small' | 'default' | 'large' | 'extraLarge';
|
|
6
|
+
export type DrawerSize = LiteralUnion<DrawerSizeValue>;
|
|
7
|
+
export type DrawerPlacementValue = 'top' | 'right' | 'bottom' | 'left';
|
|
8
|
+
export type DrawerPlacement = LiteralUnion<DrawerPlacementValue>;
|
|
6
9
|
export interface DrawerProps extends Omit<AntdDrawerProps, 'size'> {
|
|
7
10
|
size?: DrawerSize;
|
|
8
11
|
onBack?: () => void;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import type { LiteralUnion } from '../types';
|
|
3
|
+
export type FormModeValue = 'edit' | 'read';
|
|
4
|
+
export type FormMode = LiteralUnion<FormModeValue>;
|
|
3
5
|
export interface FormModeConfig {
|
|
4
6
|
mode?: FormMode;
|
|
5
7
|
readonlyRender?: (value: any, props: any) => React.ReactNode;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { Image as AntdImage, type GetProps } from 'antd';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
import type { WithFormModeProps } from '../form-mode/types';
|
|
4
|
+
type AntdImageProps = GetProps<typeof AntdImage>;
|
|
5
|
+
export type ImageProps = AntdImageProps & WithFormModeProps;
|
|
6
|
+
declare const ImageComponent: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
4
7
|
export { ImageComponent };
|
package/lib/esm/index.d.ts
CHANGED
package/lib/esm/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ArgsProps, ConfigOptions, MessageType } from 'antd/es/message/interface';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import type { LiteralUnion } from '../types';
|
|
3
4
|
import './style.css';
|
|
4
|
-
export
|
|
5
|
-
|
|
5
|
+
export type MessageTypeValue = 'success' | 'error' | 'warning' | 'info' | 'loading';
|
|
6
|
+
export interface MessageProps extends Omit<ArgsProps, 'type'> {
|
|
7
|
+
type?: LiteralUnion<MessageTypeValue>;
|
|
6
8
|
}
|
|
7
9
|
export interface MessageApi {
|
|
8
10
|
success: (content: React.ReactNode, duration?: number) => MessageType;
|
|
@@ -37,10 +37,12 @@ var customIcons = {
|
|
|
37
37
|
|
|
38
38
|
// 包装配置,自动注入自定义图标
|
|
39
39
|
var wrapConfig = function wrapConfig(config) {
|
|
40
|
+
var type = config.type;
|
|
40
41
|
// 如果用户没有自定义 icon,则根据 type 自动注入
|
|
41
|
-
if (!config.icon &&
|
|
42
|
+
if (!config.icon && type && customIcons[type]) {
|
|
42
43
|
return _objectSpread(_objectSpread({}, config), {}, {
|
|
43
|
-
|
|
44
|
+
type: type,
|
|
45
|
+
icon: customIcons[type]
|
|
44
46
|
});
|
|
45
47
|
}
|
|
46
48
|
return config;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { PopoverProps as AntdPopoverProps } from 'antd';
|
|
2
|
+
import type { LiteralUnion } from '../types';
|
|
2
3
|
import './style.less';
|
|
3
|
-
export type
|
|
4
|
+
export type PopoverTypeValue = 'default' | 'error';
|
|
5
|
+
export type PopoverType = LiteralUnion<PopoverTypeValue>;
|
|
4
6
|
export interface PopoverProps extends AntdPopoverProps {
|
|
5
7
|
type?: PopoverType;
|
|
6
8
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { TabsProps as AntdTabsProps } from 'antd';
|
|
2
|
+
import type { LiteralUnion } from '../types';
|
|
2
3
|
export type { AntdTabsProps };
|
|
4
|
+
export type TabsTypeValue = 'line' | 'card' | 'editable-card' | 'editable-line';
|
|
5
|
+
export type TabsType = LiteralUnion<TabsTypeValue>;
|
|
3
6
|
export interface TabsProps extends Omit<AntdTabsProps, 'type'> {
|
|
4
7
|
className?: string;
|
|
5
|
-
type?:
|
|
8
|
+
type?: TabsType;
|
|
6
9
|
scrollIndicator?: boolean;
|
|
7
10
|
}
|
package/lib/esm/tag/tag.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { type TagProps as AntdTagProps } from 'antd';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import type { LiteralUnion } from '../types';
|
|
3
4
|
import './style.less';
|
|
5
|
+
export type TagType = 'text' | 'deep' | 'shallow';
|
|
6
|
+
export type TagColor = 'default' | 'info' | 'success' | 'minor' | 'warning' | 'error' | 'red' | 'tangerine' | 'orange' | 'yellow' | 'lemonYellow' | 'grassGreen' | 'green' | 'cyan' | 'blue' | 'purple' | 'magenta' | 'neutral';
|
|
4
7
|
export interface TagProps extends AntdTagProps {
|
|
5
|
-
type?:
|
|
6
|
-
color?:
|
|
8
|
+
type?: LiteralUnion<TagType>;
|
|
9
|
+
color?: LiteralUnion<TagColor>;
|
|
7
10
|
disabled?: boolean;
|
|
8
11
|
category?: boolean;
|
|
9
12
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./utils";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type LiteralUnion<T extends string> = T | (string & {});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yqg/slimfit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/esm/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@yqg/max": "1.2.8",
|
|
72
72
|
"@yqg/max-bundle-mode-plugin": "2.1.3",
|
|
73
73
|
"@yqg/max-docs-plugin": "1.2.2",
|
|
74
|
-
"antd": "5.
|
|
74
|
+
"antd": "5.29.1",
|
|
75
75
|
"classnames": "2.5.1",
|
|
76
76
|
"husky": "7.0.4",
|
|
77
77
|
"jsdom": "26.1.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"@ant-design/icons": "5.6.1",
|
|
85
85
|
"@yqg/beetle": "^1.0.1",
|
|
86
|
-
"antd": "5.
|
|
86
|
+
"antd": "5.29.1",
|
|
87
87
|
"classnames": "2.5.1",
|
|
88
88
|
"react": "^18.0.0",
|
|
89
89
|
"react-dom": "^18.0.0",
|