aha-components 1.7.7 → 1.7.9

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/dist/index.d.ts CHANGED
@@ -1,30 +1,33 @@
1
1
  import React from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
 
4
- type ButtonType = 'default' | 'primary';
5
- type ButtonSize = 'small' | 'mediumSmall' | 'medium' | 'large';
4
+ /**
5
+ * 对齐 Figma: Untitled UI v7 Buttons
6
+ * 维度:Size × Hierarchy × State × Icon only
7
+ * Size: sm(36) / md(40) / lg(44) / xl(48)
8
+ * Hierarchy: primary / secondary / tertiary / link-color / link-gray
9
+ * State: default / hover / focused / disabled / loading
10
+ * Icon only: boolean
11
+ */
12
+ type ButtonHierarchy = 'primary' | 'secondary' | 'tertiary' | 'link-color' | 'link-gray' | 'destructive-primary' | 'destructive-secondary' | 'destructive-tertiary' | 'destructive-link' | 'default';
13
+ type ButtonSize = 'sm' | 'md' | 'lg' | 'xl' | 'small' | 'mediumSmall' | 'medium' | 'large';
6
14
  interface ButtonProps {
7
- /** 按钮内容 */
8
15
  children?: React.ReactNode;
9
- /** 按钮类型 */
10
- type?: ButtonType;
11
- /** 按钮尺寸 */
16
+ /** 按钮层级(对应 Figma Hierarchy)。`default` 为 `secondary` 的旧名 */
17
+ type?: ButtonHierarchy;
18
+ /** 按钮尺寸(对应 Figma Size)。旧名会映射到新尺寸 */
12
19
  size?: ButtonSize;
13
- /** 是否禁用 */
14
20
  disabled?: boolean;
15
- /** 是否加载中 */
16
21
  loading?: boolean;
17
- /** 点击事件 */
18
- onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
19
- /** 按钮原生type */
22
+ /** 仅图标按钮。不传 `children`、仅传 `icon` 时自动开启 */
23
+ iconOnly?: boolean;
24
+ /** 受控的 Focused 视觉态,用于 Storybook 预览设计稿;真实键盘焦点由 :focus-visible 处理 */
25
+ focused?: boolean;
26
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
20
27
  htmlType?: 'button' | 'submit' | 'reset';
21
- /** 自定义类名 */
22
28
  className?: string;
23
- /** 自定义样式 */
24
29
  style?: React.CSSProperties;
25
- /** 图标 */
26
30
  icon?: React.ReactNode;
27
- /** 图标位置 */
28
31
  iconPosition?: 'left' | 'right';
29
32
  [key: string]: any;
30
33
  }