@lax-wp/design-system 0.3.59 → 0.3.61

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,72 +1,69 @@
1
- /**
2
- * Date range value type
3
- */
4
- export interface DateRangeValue {
5
- /** Start date */
6
- startDate: Date | null;
7
- /** End date */
8
- endDate: Date | null;
9
- }
10
1
  /**
11
2
  * Props for the DateRange component
3
+ * Matches the lax-web-portal implementation for drop-in replacement
12
4
  */
13
- export interface DateRangeProps {
5
+ export type TDateRangeProps = {
14
6
  /** Unique identifier for the date range */
15
7
  id: string;
16
8
  /** Label text to display above the date range */
17
9
  label?: string;
18
- /** Current date range value */
19
- value?: DateRangeValue;
20
- /** Default date range value */
21
- defaultValue?: DateRangeValue;
10
+ /** Start date value (ISO string or formatted date string) */
11
+ startDate: string;
12
+ /** End date value (ISO string or formatted date string) */
13
+ endDate: string;
22
14
  /** Callback function called when date range changes */
23
- onChange: (value: DateRangeValue) => void;
24
- /** Whether the date range is disabled */
25
- disabled?: boolean;
15
+ onChange(data: any): void;
16
+ /** Callback function called when calendar selection changes */
17
+ onCalendarChange?(data: any): void;
26
18
  /** Whether the field is required */
27
19
  required?: boolean;
28
- /** Message to display below the date range */
29
- message?: string;
30
- /** Type of message to display */
31
- messageType?: "success" | "error" | "info" | "default";
32
- /** Additional CSS classes for the wrapper container */
33
- wrapperClassName?: string;
34
- /** Additional CSS classes for the input containers */
35
- inputClassName?: string;
36
- /** Additional CSS classes for the label */
37
- labelClassName?: string;
38
- /** Help text to display below the label */
39
- helpText?: string;
40
- /** Size variant for the inputs */
41
- size?: "small" | "medium" | "large";
42
- /** Date format for display */
20
+ /** Error message to display below the date range */
21
+ errorMessage?: string;
22
+ /** Additional CSS classes for the wrapper */
23
+ className?: string;
24
+ /** Whether the date range is disabled */
25
+ disabled?: boolean;
26
+ /** Custom date format */
43
27
  dateFormat?: string;
44
- /** Minimum date allowed */
45
- minDate?: Date;
46
- /** Maximum date allowed */
47
- maxDate?: Date;
48
- /** Placeholder text for start date */
49
- startPlaceholder?: string;
50
- /** Placeholder text for end date */
51
- endPlaceholder?: string;
52
- /** Whether to allow clearing the selection */
53
- allowClear?: boolean;
54
- /** Additional props to pass to the input elements */
55
- inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
56
- }
28
+ /** Whether popup should render inside parent element */
29
+ shouldPopOnParent?: boolean;
30
+ /** Custom function to get popup container */
31
+ getPopupContainer?: (trigger: HTMLElement | null) => HTMLElement;
32
+ /** Maximum date range in days */
33
+ maxDateRange?: number;
34
+ /** Whether the picker is open */
35
+ open?: boolean;
36
+ /** Callback function called when open state changes */
37
+ onOpenChange?(open: boolean): void;
38
+ /** Placement of the dropdown */
39
+ placement?: "bottomLeft" | "bottomRight" | "topLeft" | "topRight";
40
+ /** Whether the component is in dark mode */
41
+ isDarkMode?: boolean;
42
+ };
57
43
  /**
58
- * A highly customizable date range component with label, validation, and styling support.
44
+ * A date range picker component with label, validation, and styling support.
59
45
  * Features proper date handling, validation, and comprehensive prop support.
46
+ * Built on top of Ant Design's RangePicker for advanced functionality.
47
+ *
48
+ * This component is designed as a drop-in replacement for the lax-web-portal
49
+ * DateRange component.
60
50
  *
61
51
  * @example
62
52
  * ```tsx
63
53
  * <DateRange
64
54
  * id="event-dates"
65
55
  * label="Event Duration"
66
- * value={dateRange}
67
- * onChange={(range) => setDateRange(range)}
56
+ * startDate={startDate}
57
+ * endDate={endDate}
58
+ * onChange={(dates) => {
59
+ * setStartDate(dates[0]);
60
+ * setEndDate(dates[1]);
61
+ * }}
68
62
  * required
69
63
  * />
70
64
  * ```
71
65
  */
72
- export declare const DateRange: import("react").ForwardRefExoticComponent<DateRangeProps & import("react").RefAttributes<HTMLDivElement>>;
66
+ export declare const DateRange: {
67
+ ({ onCalendarChange, onChange, required, label, startDate, endDate, errorMessage, className, id, disabled, dateFormat, shouldPopOnParent, getPopupContainer: customGetPopupContainer, maxDateRange, open, onOpenChange, placement, isDarkMode, }: TDateRangeProps): import("react/jsx-runtime").JSX.Element;
68
+ displayName: string;
69
+ };
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Date range value type
3
+ */
4
+ export interface DateRangeValue {
5
+ /** Start date */
6
+ startDate: Date | null;
7
+ /** End date */
8
+ endDate: Date | null;
9
+ }
10
+ /**
11
+ * Props for the DateRange component
12
+ */
13
+ export interface DateRangeProps {
14
+ /** Unique identifier for the date range */
15
+ id: string;
16
+ /** Label text to display above the date range */
17
+ label?: string;
18
+ /** Current date range value */
19
+ value?: DateRangeValue;
20
+ /** Default date range value */
21
+ defaultValue?: DateRangeValue;
22
+ /** Callback function called when date range changes */
23
+ onChange: (value: DateRangeValue) => void;
24
+ /** Whether the date range is disabled */
25
+ disabled?: boolean;
26
+ /** Whether the field is required */
27
+ required?: boolean;
28
+ /** Message to display below the date range */
29
+ message?: string;
30
+ /** Type of message to display */
31
+ messageType?: "success" | "error" | "info" | "default";
32
+ /** Additional CSS classes for the wrapper container */
33
+ wrapperClassName?: string;
34
+ /** Additional CSS classes for the input containers */
35
+ inputClassName?: string;
36
+ /** Additional CSS classes for the label */
37
+ labelClassName?: string;
38
+ /** Help text to display below the label */
39
+ helpText?: string;
40
+ /** Size variant for the inputs */
41
+ size?: "small" | "medium" | "large";
42
+ /** Date format for display */
43
+ dateFormat?: string;
44
+ /** Minimum date allowed */
45
+ minDate?: Date;
46
+ /** Maximum date allowed */
47
+ maxDate?: Date;
48
+ /** Placeholder text for start date */
49
+ startPlaceholder?: string;
50
+ /** Placeholder text for end date */
51
+ endPlaceholder?: string;
52
+ /** Whether to allow clearing the selection */
53
+ allowClear?: boolean;
54
+ /** Additional props to pass to the input elements */
55
+ inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
56
+ }
57
+ /**
58
+ * A highly customizable date range component with label, validation, and styling support.
59
+ * Features proper date handling, validation, and comprehensive prop support.
60
+ *
61
+ * @example
62
+ * ```tsx
63
+ * <DateRange
64
+ * id="event-dates"
65
+ * label="Event Duration"
66
+ * value={dateRange}
67
+ * onChange={(range) => setDateRange(range)}
68
+ * required
69
+ * />
70
+ * ```
71
+ */
72
+ export declare const DateRange2: import("react").ForwardRefExoticComponent<DateRangeProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,65 +1,49 @@
1
+ import type { LabelType } from "../../data-display/label/Label";
1
2
  /**
2
3
  * Props for the DebounceInputField component
4
+ * Drop-in replacement matching the lax-web-portal API
3
5
  */
4
- export interface DebounceInputFieldProps {
5
- /** Unique identifier for the input */
6
- id: string;
7
- /** Label text to display above the input */
8
- label?: string;
6
+ export type DebounceInputFieldProps = any & {
9
7
  /** Current value of the input */
10
- value?: string;
8
+ value: string;
9
+ /** Callback function called when the input value changes (debounced) */
10
+ onChange(data: any): void;
11
+ /** Error message to display */
12
+ errorMessage: string;
11
13
  /** Default value for the input */
12
14
  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
15
  /** Whether the input is disabled */
18
16
  disabled?: boolean;
17
+ /** Maximum value for number inputs */
18
+ max?: number;
19
+ /** Minimum value for number inputs */
20
+ min?: number;
19
21
  /** Whether the field is required */
20
22
  required?: boolean;
21
- /** Placeholder text for the input */
23
+ /** Background color class */
24
+ bg?: string;
25
+ /** Tags to display with the label */
26
+ tags?: (string | LabelType)[];
27
+ /** Text color class */
28
+ color?: string;
29
+ /** Unique identifier for the input */
30
+ id: string;
31
+ /** Label text for the input */
32
+ label?: string;
33
+ /** Input type (text, email, password, number, etc.) */
34
+ type?: string;
35
+ /** Placeholder text */
22
36
  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
37
  /** Debounce timeout in milliseconds */
40
38
  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
- }
39
+ /** Additional CSS classes */
40
+ className?: string;
41
+ /** Whether dark mode is enabled (optional - uses CSS dark: classes if not provided) */
42
+ isDarkMode?: boolean;
43
+ };
60
44
  /**
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.
45
+ * A debounced input field component that delays onChange calls until the user stops typing.
46
+ * This is a drop-in replacement for the lax-web-portal DebounceInputField component.
63
47
  *
64
48
  * @example
65
49
  * ```tsx
@@ -70,7 +54,11 @@ export interface DebounceInputFieldProps {
70
54
  * onChange={(value) => setSearchTerm(value)}
71
55
  * debounceTimeout={300}
72
56
  * placeholder="Type to search..."
57
+ * errorMessage=""
73
58
  * />
74
59
  * ```
75
60
  */
76
- export declare const DebounceInputField: import("react").ForwardRefExoticComponent<DebounceInputFieldProps & import("react").RefAttributes<HTMLInputElement>>;
61
+ export declare const DebounceInputField: {
62
+ ({ id, label, onChange, errorMessage, required, bg, tags, color, debounceTimeout, className, isDarkMode, ...props }: DebounceInputFieldProps): import("react/jsx-runtime").JSX.Element;
63
+ displayName: string;
64
+ };
package/dist/index.d.ts CHANGED
@@ -24,8 +24,10 @@ export type { CustomizableSelectFieldProps, CustomizableSelectOption, OptionConf
24
24
  export { CurrencyInputField } from "./components/forms/currency-input/CurrencyInputField";
25
25
  export type { CurrencyInputFieldProps, RiskDetails as CurrencyInputFieldRiskDetails, RiskDetailsCardProps as CurrencyInputFieldRiskDetailsCardProps, } from "./components/forms/currency-input/CurrencyInputField";
26
26
  export { CURRENCIES, CURRENCY_SYMBOLS } from "./components/forms/currency-input/currency.constant";
27
+ export { DateRange2 } from "./components/forms/date-range/DateRange2";
28
+ export type { DateRangeProps, DateRangeValue, } from "./components/forms/date-range/DateRange2";
27
29
  export { DateRange } from "./components/forms/date-range/DateRange";
28
- export type { DateRangeProps, DateRangeValue, } from "./components/forms/date-range/DateRange";
30
+ export type { TDateRangeProps } from "./components/forms/date-range/DateRange";
29
31
  export { DateTimeField, UNIVERSAL_DATE_FORMAT, UNIVERSAL_DATETIME_FORMAT, } from "./components/forms/date-time-field/DateTimeField";
30
32
  export type { DateTimeFieldProps, RiskDetails as DateTimeFieldRiskDetails, RiskDetailsCardProps as DateTimeFieldRiskDetailsCardProps, } from "./components/forms/date-time-field/DateTimeField";
31
33
  export { DebounceInputField } from "./components/forms/debounce-input/DebounceInputField";