@kingsoft-ai/design 0.1.9 → 0.1.10

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.
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Design 组件的主题提供者
3
+ *
4
+ * 这是一个便捷的包装器,自动使用默认的设计主题
5
+ * 用户可以直接使用而不需要手动导入 theme
6
+ */
7
+ import type { ReactNode } from 'react';
8
+ import type { AppTheme } from '@kingsoft-ai/theme';
9
+ export interface DesignThemeProviderProps {
10
+ /** 子组件 */
11
+ children: ReactNode;
12
+ /**
13
+ * 主题模式
14
+ * @default 'light'
15
+ */
16
+ mode?: 'light' | 'dark';
17
+ /**
18
+ * 自定义主题对象(可选)
19
+ * 如果提供,将覆盖默认主题
20
+ */
21
+ theme?: AppTheme;
22
+ }
23
+ /**
24
+ * Design 组件主题提供者
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * // 使用默认亮色主题
29
+ * <DesignThemeProvider>
30
+ * <Button>点击我</Button>
31
+ * </DesignThemeProvider>
32
+ *
33
+ * // 使用暗色主题
34
+ * <DesignThemeProvider mode="dark">
35
+ * <Button>点击我</Button>
36
+ * </DesignThemeProvider>
37
+ *
38
+ * // 使用自定义主题
39
+ * <DesignThemeProvider theme={customTheme}>
40
+ * <Button>点击我</Button>
41
+ * </DesignThemeProvider>
42
+ * ```
43
+ */
44
+ export declare const DesignThemeProvider: ({ children, mode, theme }: DesignThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
@@ -27,7 +27,7 @@ export type IconButtonProps = Omit<AriaButtonProps, 'elementType' | 'children'>
27
27
  /** 自定义类名 */
28
28
  className?: string;
29
29
  };
30
- export declare const IconButton: import("react").ForwardRefExoticComponent<Omit<AriaButtonProps<"button">, "elementType" | "children"> & {
30
+ export declare const IconButton: import("react").ForwardRefExoticComponent<Omit<AriaButtonProps<"button">, "children" | "elementType"> & {
31
31
  /** 图标按钮的视觉外观:实心、描边、幽灵 */
32
32
  appearance?: IconButtonAppearance;
33
33
  /** 语义色彩:主题、自然、危险 */
@@ -15,4 +15,8 @@ export * from './tag';
15
15
  export * from './upload';
16
16
  export * from './theme';
17
17
  export * from './types/theme-utils';
18
+ export { DesignThemeProvider } from './DesignThemeProvider';
19
+ export type { DesignThemeProviderProps } from './DesignThemeProvider';
20
+ export { CustomThemeProvider, globalColors, globalSpacing, globalRadii, globalTypography, globalShadows, globalGradients, lightSemantic, darkSemantic, } from '@kingsoft-ai/theme';
21
+ export type { CustomThemeProviderProps, AppTheme, Theme, ComponentTheme, GlobalColors, GlobalColorScale, GlobalSpacing, GlobalRadii, GlobalTypography, GlobalShadows, GlobalGradients, SemanticColors, SemanticSpacing, SemanticBorderRadius, SemanticTypography, SemanticShadows, } from '@kingsoft-ai/theme';
18
22
  export * from './types/component-tokens.types';
@@ -52,7 +52,7 @@ export type SwitchProps = Omit<AriaSwitchProps, 'children' | 'isDisabled'> & Omi
52
52
  * 基于 Figma 设计规范实现的开关组件,支持带文字的开关
53
53
  * 使用 react-aria 保证无障碍访问性
54
54
  */
55
- export declare const Switch: import("react").ForwardRefExoticComponent<Omit<AriaSwitchProps, "isDisabled" | "children"> & Omit<ToggleProps, "isDisabled" | "children"> & {
55
+ export declare const Switch: import("react").ForwardRefExoticComponent<Omit<AriaSwitchProps, "children" | "isDisabled"> & Omit<ToggleProps, "children" | "isDisabled"> & {
56
56
  /** 开关尺寸:小号(20px)、标准(24px) */
57
57
  size?: SwitchSize;
58
58
  /** 选中状态的文字标签(显示在开关内部) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kingsoft-ai/design",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",