@sakaniui/react 0.13.0 → 0.14.0

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,5 +1,8 @@
1
1
  import { default as React } from 'react';
2
+ import { AiGlowMode } from '../../lib/AiGlow';
2
3
  export type InputSize = 'sm' | 'md' | 'lg';
4
+ export type InputVariant = 'default' | 'ai';
5
+ export type InputGlow = AiGlowMode;
3
6
  export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
4
7
  /** Field label (Figma: Title). */
5
8
  label?: string;
@@ -14,6 +17,15 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
14
17
  unstyled?: boolean;
15
18
  leadingIcon?: React.ReactNode;
16
19
  trailingIcon?: React.ReactNode;
20
+ /** "ai" is the prompt box of an AI product: a pill with a 16px field, action slots and a light around the border. Defaults to "default". */
21
+ variant?: InputVariant;
22
+ /** variant="ai": the light that sweeps clockwise around the border. "pulse" (default) sweeps every 2.5s while idle and once each time
23
+ * the field takes focus; "focus" sweeps only on focus; "off" draws none. Reduced motion draws none. */
24
+ glow?: AiGlowMode;
25
+ /** variant="ai": actions before the field, such as an attach button. Interactive content is fine here (unlike `leadingIcon`). */
26
+ leading?: React.ReactNode;
27
+ /** variant="ai": actions after the field, such as a mic and a send button. */
28
+ trailing?: React.ReactNode;
17
29
  }
18
30
  export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
19
31
  export default Input;
@@ -1,8 +1,23 @@
1
1
  import { default as React } from 'react';
2
+ import { AiGlowMode } from '../../lib/AiGlow';
3
+ export type TextareaVariant = 'default' | 'ai';
4
+ export type TextareaGlow = AiGlowMode;
2
5
  export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
3
6
  label?: string;
4
7
  description?: string;
5
8
  error?: string;
9
+ /** "ai" is the prompt box of an AI product: a 16px-radius box, a 16px field that grows with the text, an actions row and a light
10
+ * around the border. Defaults to "default". */
11
+ variant?: TextareaVariant;
12
+ /** variant="ai": the light that sweeps clockwise around the border. "pulse" (default) sweeps every 2.5s while idle and once each
13
+ * time the field takes focus; "focus" sweeps only on focus; "off" draws none. Reduced motion draws none. */
14
+ glow?: AiGlowMode;
15
+ /** variant="ai": actions on the left of the row under the field, such as an attach button. */
16
+ leading?: React.ReactNode;
17
+ /** variant="ai": actions on the right of that row, such as a mic and a send button. */
18
+ trailing?: React.ReactNode;
19
+ /** variant="ai": the most lines the field grows to before it scrolls. Defaults to 8. */
20
+ maxRows?: number;
6
21
  }
7
22
  export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
8
23
  export default Textarea;