@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.
@@ -17,7 +17,9 @@ export interface ColorGroup {
17
17
  colors: ColorItem[];
18
18
  subGroups?: ColorSubGroup[];
19
19
  }
20
- export type CopyMode = 'css-var' | 'hex' | 'tailwind';
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 DrawerSize = 'small' | 'default' | 'large' | 'extraLarge';
5
- export type DrawerPlacement = 'top' | 'right' | 'bottom' | 'left';
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
- export type FormMode = 'edit' | 'read';
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
- declare const ImageComponent: React.ForwardRefExoticComponent<Omit<Omit<import("antd").ImageProps & React.RefAttributes<any>, "ref"> & React.RefAttributes<any> & import("../form-mode").WithFormModeProps, "ref"> & React.RefAttributes<any>>;
3
- export type ImageProps = React.ComponentProps<typeof ImageComponent>;
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 };
@@ -31,6 +31,7 @@ export * from './time-picker';
31
31
  export * from './tooltip';
32
32
  export * from './tree';
33
33
  export * from './tree-select';
34
+ export * from './types';
34
35
  export * from './typography';
35
36
  export * from './upload';
36
37
  export * from './themes';
package/lib/esm/index.js CHANGED
@@ -32,6 +32,7 @@ export * from "./time-picker";
32
32
  export * from "./tooltip";
33
33
  export * from "./tree";
34
34
  export * from "./tree-select";
35
+ export * from "./types";
35
36
  export * from "./typography";
36
37
  export * from "./upload";
37
38
  export * from "./themes";
@@ -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 interface MessageProps extends ArgsProps {
5
- type?: 'success' | 'error' | 'warning' | 'info' | 'loading';
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 && config.type && customIcons[config.type]) {
42
+ if (!config.icon && type && customIcons[type]) {
42
43
  return _objectSpread(_objectSpread({}, config), {}, {
43
- icon: customIcons[config.type]
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 PopoverType = 'default' | 'error';
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?: 'line' | 'card' | 'editable-card' | 'editable-line';
8
+ type?: TabsType;
6
9
  scrollIndicator?: boolean;
7
10
  }
@@ -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?: 'text' | 'deep' | 'shallow';
6
- color?: 'default' | 'info' | 'success' | 'minor' | 'warning' | 'error' | 'red' | 'tangerine' | 'orange' | 'yellow' | 'lemonYellow' | 'grassGreen' | 'green' | 'cyan' | 'blue' | 'purple' | 'magenta' | 'neutral';
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",
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.24.3",
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.24.3",
86
+ "antd": "5.29.1",
87
87
  "classnames": "2.5.1",
88
88
  "react": "^18.0.0",
89
89
  "react-dom": "^18.0.0",