@lax-wp/design-system 0.3.60 → 0.3.62

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,65 +1,51 @@
1
+ import { DebounceInput } from "react-debounce-input";
2
+ import type { LabelType } from "../../data-display/label/Label";
3
+ import type { ComponentProps } from "react";
1
4
  /**
2
5
  * Props for the DebounceInputField component
6
+ * Drop-in replacement matching the lax-web-portal API
3
7
  */
4
- export interface DebounceInputFieldProps {
5
- /** Unique identifier for the input */
6
- id: string;
7
- /** Label text to display above the input */
8
- label?: string;
8
+ export type DebounceInputFieldProps = ComponentProps<typeof DebounceInput> & {
9
9
  /** Current value of the input */
10
- value?: string;
10
+ value: string;
11
+ /** Callback function called when the input value changes (debounced) */
12
+ onChange(data: any): void;
13
+ /** Error message to display */
14
+ errorMessage: string;
11
15
  /** Default value for the input */
12
16
  defaultValue?: string;
13
- /** Callback function called when value changes (debounced) */
14
- onChange: (value: string) => void;
15
- /** Callback function called on every keystroke (immediate) */
16
- onImmediateChange?: (value: string) => void;
17
17
  /** Whether the input is disabled */
18
18
  disabled?: boolean;
19
+ /** Maximum value for number inputs */
20
+ max?: number;
21
+ /** Minimum value for number inputs */
22
+ min?: number;
19
23
  /** Whether the field is required */
20
24
  required?: boolean;
21
- /** Placeholder text for the input */
25
+ /** Background color class */
26
+ bg?: string;
27
+ /** Tags to display with the label */
28
+ tags?: (string | LabelType)[];
29
+ /** Text color class */
30
+ color?: string;
31
+ /** Unique identifier for the input */
32
+ id: string;
33
+ /** Label text for the input */
34
+ label?: string;
35
+ /** Input type (text, email, password, number, etc.) */
36
+ type?: string;
37
+ /** Placeholder text */
22
38
  placeholder?: string;
23
- /** Message to display below the input */
24
- message?: string;
25
- /** Type of message to display */
26
- messageType?: "success" | "error" | "info" | "default";
27
- /** Additional CSS classes for the wrapper container */
28
- wrapperClassName?: string;
29
- /** Additional CSS classes for the input */
30
- inputClassName?: string;
31
- /** Additional CSS classes for the label */
32
- labelClassName?: string;
33
- /** Help text to display below the label */
34
- helpText?: string;
35
- /** Size variant for the input */
36
- size?: "small" | "medium" | "large";
37
- /** Input type */
38
- type?: "text" | "email" | "url" | "search" | "tel" | "password";
39
39
  /** Debounce timeout in milliseconds */
40
40
  debounceTimeout?: number;
41
- /** Minimum value for number inputs */
42
- min?: number;
43
- /** Maximum value for number inputs */
44
- max?: number;
45
- /** Maximum length for text inputs */
46
- maxLength?: number;
47
- /** Pattern for input validation */
48
- pattern?: string;
49
- /** Additional props to pass to the input element */
50
- inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
51
- /** Inline styles for the input element */
52
- inputStyle?: React.CSSProperties;
53
- /** Callback for key down events */
54
- onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
55
- /** Callback for focus events */
56
- onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
57
- /** Callback for blur events */
58
- onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
59
- }
41
+ /** Additional CSS classes */
42
+ className?: string;
43
+ /** Whether dark mode is enabled (optional - uses CSS dark: classes if not provided) */
44
+ isDarkMode?: boolean;
45
+ };
60
46
  /**
61
- * A highly customizable debounced input component with label, validation, and styling support.
62
- * Features configurable debounce timing, immediate change callbacks, and comprehensive prop support.
47
+ * A debounced input field component that delays onChange calls until the user stops typing.
48
+ * This is a drop-in replacement for the lax-web-portal DebounceInputField component.
63
49
  *
64
50
  * @example
65
51
  * ```tsx
@@ -70,7 +56,11 @@ export interface DebounceInputFieldProps {
70
56
  * onChange={(value) => setSearchTerm(value)}
71
57
  * debounceTimeout={300}
72
58
  * placeholder="Type to search..."
59
+ * errorMessage=""
73
60
  * />
74
61
  * ```
75
62
  */
76
- export declare const DebounceInputField: import("react").ForwardRefExoticComponent<DebounceInputFieldProps & import("react").RefAttributes<HTMLInputElement>>;
63
+ export declare const DebounceInputField: {
64
+ ({ id, label, onChange, errorMessage, required, bg, tags, color, debounceTimeout, className, isDarkMode, ...props }: DebounceInputFieldProps): import("react/jsx-runtime").JSX.Element;
65
+ displayName: string;
66
+ };