aha-components 1.8.1 → 1.8.3

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.
@@ -1,41 +1,30 @@
1
1
  import React from 'react';
2
2
  export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'suffix'> {
3
- /** 输入框大小 */
4
3
  size?: 'small' | 'mediumSmall' | 'medium' | 'large';
5
- /** 是否禁用 */
6
4
  disabled?: boolean;
7
- /** 是否显示错误状态 */
8
5
  error?: boolean;
9
- /** 是否只读 */
10
6
  readOnly?: boolean;
11
- /** 输入框前缀图标 */
12
7
  prefix?: React.ReactNode;
13
- /** 输入框后缀图标 */
14
8
  suffix?: React.ReactNode;
15
- /** 允许清除 */
16
9
  allowClear?: boolean;
17
- /** 清除回调 */
18
10
  onClear?: () => void;
19
- /** 自定义类名 */
20
11
  className?: string;
21
- /** 自定义样式 */
22
12
  style?: React.CSSProperties;
23
- /** 输入框类型 */
24
13
  type?: string;
25
- /** 占位符 */
26
14
  placeholder?: string;
27
- /** 值 */
28
15
  value?: string;
29
- /** 默认值 */
30
16
  defaultValue?: string;
31
- /** 变化回调 */
32
17
  onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
33
- /** 聚焦回调 */
34
18
  onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
35
- /** 失焦回调 */
36
19
  onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
37
- /** 按下回车回调 */
38
20
  onPressEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
21
+ label?: string;
22
+ required?: boolean;
23
+ hintText?: string;
39
24
  }
40
25
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
41
26
  export default Input;
27
+ export { default as InputGroup } from './InputGroup';
28
+ export type { InputGroupProps } from './InputGroup';
29
+ export { default as InputTags } from './InputTags';
30
+ export type { InputTagsProps } from './InputTags';
@@ -4,14 +4,11 @@ declare const meta: Meta<typeof Textarea>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Textarea>;
6
6
  export declare const Basic: Story;
7
- export declare const Sizes: Story;
8
7
  export declare const Disabled: Story;
9
8
  export declare const Error: Story;
10
9
  export declare const ReadOnly: Story;
11
10
  export declare const WithCount: Story;
12
- export declare const WithMaxLength: Story;
13
11
  export declare const AutoSize: Story;
14
- export declare const Controlled: Story;
15
- export declare const AllStates: Story;
16
- export declare const LinkifyUncontrolled: Story;
17
- export declare const LinkifyControlled: Story;
12
+ export declare const Tags: Story;
13
+ export declare const Linkify: Story;
14
+ export declare const AllVariants: Story;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { InputTagsProps } from '../Input/InputTags';
3
+ export interface TextareaTagsProps extends Omit<InputTagsProps, 'size'> {
4
+ minHeight?: number;
5
+ helpIcon?: React.ReactNode;
6
+ }
7
+ declare const TextareaTags: React.FC<TextareaTagsProps>;
8
+ export default TextareaTags;
@@ -7,44 +7,33 @@ interface LinkifyOptions {
7
7
  allowedTlds?: string[];
8
8
  }
9
9
  export interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {
10
- /** 是否禁用 */
11
10
  disabled?: boolean;
12
- /** 是否显示错误状态 */
13
11
  error?: boolean;
14
- /** 是否只读 */
15
12
  readOnly?: boolean;
16
- /** 是否显示字符计数 */
17
13
  showCount?: boolean;
18
- /** 最大字符数 */
19
14
  maxLength?: number;
20
- /** 自定义类名 */
21
15
  className?: string;
22
- /** 自定义样式 */
23
16
  style?: React.CSSProperties;
24
- /** 占位符 */
25
17
  placeholder?: string;
26
- /** 值 */
27
18
  value?: string;
28
- /** 默认值 */
29
19
  defaultValue?: string;
30
- /** 行数 */
31
20
  rows?: number;
32
- /** 是否自动调整高度 */
33
21
  autoSize?: boolean | {
34
22
  minRows?: number;
35
23
  maxRows?: number;
36
24
  };
37
- /** 变化回调 */
38
25
  onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
39
- /** 聚焦回调 */
40
26
  onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
41
- /** 失焦回调 */
42
27
  onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
43
- /** 是否启用实时链接识别 */
44
28
  linkify?: boolean;
45
- /** 链接识别配置 */
46
29
  linkifyOptions?: LinkifyOptions;
30
+ label?: string;
31
+ required?: boolean;
32
+ hintText?: string;
33
+ helpIcon?: React.ReactNode;
47
34
  }
48
35
  export declare const websiteValidator: (url: string, needProtocol?: boolean, needHost?: boolean, allowedTlds?: string[]) => boolean;
49
36
  declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
50
37
  export default Textarea;
38
+ export { default as TextareaTags } from './TextareaTags';
39
+ export type { TextareaTagsProps } from './TextareaTags';