aha-components 1.7.11 → 1.8.1

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.
Files changed (54) hide show
  1. package/README.md +10 -0
  2. package/dist/Avatar.esm.js +2 -0
  3. package/dist/Avatar.esm.js.map +1 -0
  4. package/dist/Avatar.js +2 -0
  5. package/dist/Avatar.js.map +1 -0
  6. package/dist/Badge.esm.js +2 -0
  7. package/dist/Badge.esm.js.map +1 -0
  8. package/dist/Badge.js +2 -0
  9. package/dist/Badge.js.map +1 -0
  10. package/dist/Checkbox.esm.js +1 -1
  11. package/dist/Checkbox.esm.js.map +1 -1
  12. package/dist/Checkbox.js +1 -1
  13. package/dist/Checkbox.js.map +1 -1
  14. package/dist/Radio.esm.js +1 -1
  15. package/dist/Radio.esm.js.map +1 -1
  16. package/dist/Radio.js +1 -1
  17. package/dist/Radio.js.map +1 -1
  18. package/dist/Table.esm.js +1 -1
  19. package/dist/Table.esm.js.map +1 -1
  20. package/dist/Table.js +1 -1
  21. package/dist/Table.js.map +1 -1
  22. package/dist/Tag.esm.js +1 -1
  23. package/dist/Tag.esm.js.map +1 -1
  24. package/dist/Tag.js +1 -1
  25. package/dist/Tag.js.map +1 -1
  26. package/dist/Textarea.esm.js +1 -1
  27. package/dist/Textarea.esm.js.map +1 -1
  28. package/dist/Textarea.js +1 -1
  29. package/dist/Textarea.js.map +1 -1
  30. package/dist/components/Avatar/Avatar.stories.d.ts +12 -0
  31. package/dist/components/Avatar/index.d.ts +42 -0
  32. package/dist/components/Badge/Badge.stories.d.ts +15 -0
  33. package/dist/components/Badge/index.d.ts +71 -0
  34. package/dist/components/Checkbox/Checkbox.stories.d.ts +5 -4
  35. package/dist/components/Checkbox/index.d.ts +6 -0
  36. package/dist/components/Radio/Radio.stories.d.ts +6 -4
  37. package/dist/components/Radio/index.d.ts +6 -0
  38. package/dist/components/Tag/Tag.stories.d.ts +5 -8
  39. package/dist/components/Tag/index.d.ts +24 -2
  40. package/dist/components/Textarea/Textarea.stories.d.ts +2 -0
  41. package/dist/components/Textarea/Textarea.test.d.ts +1 -0
  42. package/dist/components/Textarea/index.d.ts +12 -0
  43. package/dist/design-tokens/theme.css +26 -0
  44. package/dist/design-tokens/theme.tailwind4.css +26 -0
  45. package/dist/index.css +3848 -0
  46. package/dist/index.d.ts +153 -4
  47. package/dist/index.esm.css +3848 -0
  48. package/dist/index.esm.js +1 -1
  49. package/dist/index.esm.js.map +1 -1
  50. package/dist/index.js +1 -1
  51. package/dist/index.js.map +1 -1
  52. package/dist/theme.css +26 -0
  53. package/dist/tokens.d.ts +28 -0
  54. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { ReactNode, MouseEventHandler, FC } from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
 
4
4
  /**
@@ -87,15 +87,31 @@ declare const ToastProvider: React.FC<{
87
87
 
88
88
  type TagColor = 'Green' | 'Red' | 'Orange' | 'Cyan' | 'Violet' | 'Pink' | 'Gray' | 'Yellow' | 'Blue' | string;
89
89
  type TagVariant = 'light' | 'fill';
90
- type TagSize = 'large' | 'small';
90
+ /** sm/md/lg are the canonical sizes; large/small are legacy aliases */
91
+ type TagSize = 'sm' | 'md' | 'lg' | 'large' | 'small';
92
+ /** Leading icon variant */
93
+ type TagIconType = 'none' | 'dot' | 'avatar' | 'icon';
94
+ /** Right-side action */
95
+ type TagAction = 'none' | 'x-close' | 'count';
96
+ /** @deprecated Use iconType instead */
91
97
  type IconPosition = 'leading' | 'after' | 'none';
92
98
  interface TagProps {
93
99
  children: React.ReactNode;
94
- color: TagColor;
100
+ color?: TagColor;
95
101
  variant?: TagVariant;
96
102
  size?: TagSize;
97
103
  stroke?: boolean;
104
+ iconType?: TagIconType;
98
105
  icon?: React.ReactElement;
106
+ avatarSrc?: string;
107
+ dotColor?: string;
108
+ action?: TagAction;
109
+ count?: number;
110
+ onClose?: () => void;
111
+ checkbox?: boolean;
112
+ checked?: boolean;
113
+ onCheckedChange?: (checked: boolean) => void;
114
+ /** @deprecated use iconType='icon' */
99
115
  iconPosition?: IconPosition;
100
116
  className?: string;
101
117
  onClick?: () => void;
@@ -298,6 +314,12 @@ interface CheckboxProps {
298
314
  className?: string;
299
315
  style?: React.CSSProperties;
300
316
  children?: React.ReactNode;
317
+ /** sm = 16px, md = 20px */
318
+ size?: 'sm' | 'md';
319
+ /** Secondary description rendered below the label */
320
+ hint?: React.ReactNode;
321
+ /** Force focused appearance (useful for Storybook demos) */
322
+ isFocused?: boolean;
301
323
  }
302
324
  declare const Checkbox: React.FC<CheckboxProps>;
303
325
 
@@ -310,6 +332,12 @@ interface RadioProps {
310
332
  children?: React.ReactNode;
311
333
  value?: any;
312
334
  name?: string;
335
+ /** sm = 16px, md = 20px */
336
+ size?: 'sm' | 'md';
337
+ /** Secondary description rendered below the label */
338
+ hint?: React.ReactNode;
339
+ /** Force focused appearance (useful for Storybook demos) */
340
+ isFocused?: boolean;
313
341
  }
314
342
  declare const Radio: React.FC<RadioProps>;
315
343
 
@@ -410,6 +438,13 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
410
438
  }
411
439
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
412
440
 
441
+ interface LinkifyOptions {
442
+ validate?: (url: string) => boolean;
443
+ className?: string;
444
+ needProtocol?: boolean;
445
+ needHost?: boolean;
446
+ allowedTlds?: string[];
447
+ }
413
448
  interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {
414
449
  /** 是否禁用 */
415
450
  disabled?: boolean;
@@ -444,6 +479,10 @@ interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaEl
444
479
  onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
445
480
  /** 失焦回调 */
446
481
  onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
482
+ /** 是否启用实时链接识别 */
483
+ linkify?: boolean;
484
+ /** 链接识别配置 */
485
+ linkifyOptions?: LinkifyOptions;
447
486
  }
448
487
  declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
449
488
 
@@ -986,6 +1025,116 @@ interface LoadingProps {
986
1025
  }
987
1026
  declare const Loading: React.FC<LoadingProps>;
988
1027
 
1028
+ type BadgeColor = 'gray' | 'brand' | 'error' | 'warning' | 'success' | 'grayBlue' | 'blueLight' | 'blue' | 'indigo' | 'purple' | 'pink' | 'orange';
1029
+ type BadgeVariant = 'pill' | 'badge' | 'modern';
1030
+ type BadgeSize = 'sm' | 'md' | 'lg';
1031
+ type BadgeIconComponent = React.FC<{
1032
+ style?: React.CSSProperties;
1033
+ className?: string;
1034
+ }>;
1035
+ interface BadgeProps {
1036
+ variant?: BadgeVariant;
1037
+ size?: BadgeSize;
1038
+ color?: BadgeColor;
1039
+ children: ReactNode;
1040
+ style?: React.CSSProperties;
1041
+ className?: string;
1042
+ }
1043
+ declare const Badge: React.FC<BadgeProps>;
1044
+ interface BadgeWithDotProps {
1045
+ variant?: BadgeVariant;
1046
+ size?: BadgeSize;
1047
+ color?: BadgeColor;
1048
+ children: ReactNode;
1049
+ style?: React.CSSProperties;
1050
+ className?: string;
1051
+ }
1052
+ declare const BadgeWithDot: React.FC<BadgeWithDotProps>;
1053
+ interface BadgeWithIconProps {
1054
+ variant?: BadgeVariant;
1055
+ size?: BadgeSize;
1056
+ color?: BadgeColor;
1057
+ iconLeading?: BadgeIconComponent;
1058
+ iconTrailing?: BadgeIconComponent;
1059
+ children: ReactNode;
1060
+ style?: React.CSSProperties;
1061
+ className?: string;
1062
+ }
1063
+ declare const BadgeWithIcon: React.FC<BadgeWithIconProps>;
1064
+ interface BadgeWithButtonProps {
1065
+ variant?: BadgeVariant;
1066
+ size?: BadgeSize;
1067
+ color?: BadgeColor;
1068
+ icon?: BadgeIconComponent;
1069
+ children: ReactNode;
1070
+ buttonLabel?: string;
1071
+ onButtonClick?: MouseEventHandler<HTMLButtonElement>;
1072
+ style?: React.CSSProperties;
1073
+ className?: string;
1074
+ }
1075
+ declare const BadgeWithButton: React.FC<BadgeWithButtonProps>;
1076
+ interface BadgeIconProps {
1077
+ variant?: BadgeVariant;
1078
+ size?: BadgeSize;
1079
+ color?: BadgeColor;
1080
+ icon: BadgeIconComponent;
1081
+ style?: React.CSSProperties;
1082
+ className?: string;
1083
+ }
1084
+ declare const BadgeIcon: React.FC<BadgeIconProps>;
1085
+ interface BadgeWithImageProps {
1086
+ variant?: Exclude<BadgeVariant, 'modern'>;
1087
+ size?: BadgeSize;
1088
+ color?: BadgeColor;
1089
+ imgSrc: string;
1090
+ imgAlt?: string;
1091
+ children: ReactNode;
1092
+ style?: React.CSSProperties;
1093
+ className?: string;
1094
+ }
1095
+ declare const BadgeWithImage: React.FC<BadgeWithImageProps>;
1096
+
1097
+ type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
1098
+ interface AvatarProps {
1099
+ size?: AvatarSize;
1100
+ src?: string | null;
1101
+ alt?: string;
1102
+ /** Two-letter initials displayed when no image is provided */
1103
+ initials?: string;
1104
+ /** Custom icon component displayed as placeholder */
1105
+ placeholderIcon?: FC<{
1106
+ style?: React.CSSProperties;
1107
+ }>;
1108
+ /** Online/offline status indicator dot */
1109
+ status?: 'online' | 'offline';
1110
+ /** Company logo badge displayed bottom-right */
1111
+ companyIcon?: {
1112
+ src: string;
1113
+ alt?: string;
1114
+ };
1115
+ /** Blue verified checkmark badge */
1116
+ verified?: boolean;
1117
+ style?: React.CSSProperties;
1118
+ className?: string;
1119
+ }
1120
+ interface AvatarLabelGroupProps {
1121
+ size?: 'sm' | 'md' | 'lg' | 'xl';
1122
+ name: string;
1123
+ supportingText?: string;
1124
+ avatarSrc?: string | null;
1125
+ avatarInitials?: string;
1126
+ status?: 'online' | 'offline';
1127
+ companyIcon?: {
1128
+ src: string;
1129
+ alt?: string;
1130
+ };
1131
+ verified?: boolean;
1132
+ style?: React.CSSProperties;
1133
+ className?: string;
1134
+ }
1135
+ declare const Avatar: React.FC<AvatarProps>;
1136
+ declare const AvatarLabelGroup: React.FC<AvatarLabelGroupProps>;
1137
+
989
1138
  interface ThemeConfig {
990
1139
  primaryColor?: string;
991
1140
  }
@@ -1005,4 +1154,4 @@ declare const MinusIcon: React.FC<{
1005
1154
  style?: React.CSSProperties;
1006
1155
  }>;
1007
1156
 
1008
- export { Alert, AlertProps, Button, ButtonProps, CheckIcon, Checkbox, CheckboxProps, ColumnType, DatePicker, DatePickerProps, DateRange, Drawer, DrawerPlacement, DrawerProps, FormWithItem as Form, FormInstance, FormItemProps, FormProps, Input, InputProps, Loading, LoadingProps, MenuGroupType, MenuItemType, MenuList, MenuListProps, MinusIcon, Pagination, PaginationProps, Popover, PopoverPlacement, PopoverProps, PopoverTrigger, Progress, ProgressProps, ProgressStatus, ProgressType, Radio, RadioProps, Select, SelectOption, SelectProps, SortOrder, SorterResult, Switch, SwitchProps, Tab, TabItem, TabLayout, TabProps, TabVariant, Table, TableCurrentDataSource, TableLayout, TableProps, TableRowSelection, TableSize, Tag, TagProps, Textarea, TextareaProps, ThemeConfig, ThemeProvider, ThemeProviderProps, Toast, ToastPosition, ToastProps, ToastProvider, ToastType, Tooltip, TooltipPosition, TooltipProps, UserProfileType, clearAllToasts, closeToast, debugToast, toast, toastError, toastInfo, toastQuestion, toastSuccess, useTheme };
1157
+ export { Alert, AlertProps, Avatar, AvatarLabelGroup, AvatarLabelGroupProps, AvatarProps, AvatarSize, Badge, BadgeColor, BadgeIcon, BadgeIconComponent, BadgeIconProps, BadgeProps, BadgeSize, BadgeVariant, BadgeWithButton, BadgeWithButtonProps, BadgeWithDot, BadgeWithDotProps, BadgeWithIcon, BadgeWithIconProps, BadgeWithImage, BadgeWithImageProps, Button, ButtonProps, CheckIcon, Checkbox, CheckboxProps, ColumnType, DatePicker, DatePickerProps, DateRange, Drawer, DrawerPlacement, DrawerProps, FormWithItem as Form, FormInstance, FormItemProps, FormProps, Input, InputProps, Loading, LoadingProps, MenuGroupType, MenuItemType, MenuList, MenuListProps, MinusIcon, Pagination, PaginationProps, Popover, PopoverPlacement, PopoverProps, PopoverTrigger, Progress, ProgressProps, ProgressStatus, ProgressType, Radio, RadioProps, Select, SelectOption, SelectProps, SortOrder, SorterResult, Switch, SwitchProps, Tab, TabItem, TabLayout, TabProps, TabVariant, Table, TableCurrentDataSource, TableLayout, TableProps, TableRowSelection, TableSize, Tag, TagProps, Textarea, TextareaProps, ThemeConfig, ThemeProvider, ThemeProviderProps, Toast, ToastPosition, ToastProps, ToastProvider, ToastType, Tooltip, TooltipPosition, TooltipProps, UserProfileType, clearAllToasts, closeToast, debugToast, toast, toastError, toastInfo, toastQuestion, toastSuccess, useTheme };