@lax-wp/design-system 0.2.1 → 0.2.2

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 (48) hide show
  1. package/dist/index.es.js +1629 -1628
  2. package/dist/index.umd.js +37 -37
  3. package/package.json +1 -1
  4. package/dist/components/buttons/option-button/OptionButton.d.ts +0 -79
  5. package/dist/components/data-display/badge/Badge.d.ts +0 -44
  6. package/dist/components/data-display/banner/Banner.d.ts +0 -41
  7. package/dist/components/data-display/code-editor/CodeEditor.d.ts +0 -4
  8. package/dist/components/data-display/code-editor/JsonGrid.d.ts +0 -14
  9. package/dist/components/data-display/code-editor/Tabs.d.ts +0 -12
  10. package/dist/components/data-display/diff-viewer/DiffViewer.d.ts +0 -64
  11. package/dist/components/data-display/label-value/LabelValue.d.ts +0 -121
  12. package/dist/components/data-display/modal/Modal.d.ts +0 -77
  13. package/dist/components/data-display/pdf-viewer/PdfViewer.d.ts +0 -45
  14. package/dist/components/data-display/popper/Popper.d.ts +0 -57
  15. package/dist/components/data-display/resizable-sidebar/ResizableSidebar.d.ts +0 -54
  16. package/dist/components/data-display/status-color-mapping/StatusColorMapping.d.ts +0 -29
  17. package/dist/components/data-display/tag/Tag.d.ts +0 -53
  18. package/dist/components/data-display/typography/Typography.d.ts +0 -15
  19. package/dist/components/feedback/toast/Toast.d.ts +0 -29
  20. package/dist/components/floating-bar/FloatingBar.d.ts +0 -147
  21. package/dist/components/forms/checkbox/Checkbox.d.ts +0 -55
  22. package/dist/components/forms/color-picker/ColorPicker.d.ts +0 -60
  23. package/dist/components/forms/creatable-select/CreatableSelect.d.ts +0 -92
  24. package/dist/components/forms/currency-input/CurrencyInputField.d.ts +0 -73
  25. package/dist/components/forms/currency-input/currency.constant.d.ts +0 -12
  26. package/dist/components/forms/date-range/DateRange.d.ts +0 -72
  27. package/dist/components/forms/debounce-input/DebounceInputField.d.ts +0 -76
  28. package/dist/components/forms/file-upload/FileUpload.d.ts +0 -81
  29. package/dist/components/forms/input-field/InputField.d.ts +0 -62
  30. package/dist/components/forms/multi-file-upload/MultiFileUpload.d.ts +0 -78
  31. package/dist/components/forms/percentage-input/PercentageInputField.d.ts +0 -75
  32. package/dist/components/forms/text-field/TextField.d.ts +0 -48
  33. package/dist/components/forms/toggle/Toggle.d.ts +0 -71
  34. package/dist/components/icons/CloseIcon.d.ts +0 -16
  35. package/dist/components/icons/HelpIcon.d.ts +0 -6
  36. package/dist/components/icons/SearchIcon.d.ts +0 -6
  37. package/dist/components/tooltip/Tooltip.d.ts +0 -8
  38. package/dist/constants/colors.d.ts +0 -263
  39. package/dist/hooks/useOutsideClick.d.ts +0 -28
  40. package/dist/hooks/usePythonSyntax.d.ts +0 -28
  41. package/dist/hooks/useTheme.d.ts +0 -6
  42. package/dist/index.d.ts +0 -67
  43. package/dist/services/monacoManager.d.ts +0 -28
  44. package/dist/types/index.d.ts +0 -66
  45. package/dist/utils/formatters.d.ts +0 -24
  46. package/dist/utils/messageConstants.d.ts +0 -16
  47. package/dist/utils/tagUtils.d.ts +0 -12
  48. package/dist/utils/utilities.d.ts +0 -13
@@ -1,53 +0,0 @@
1
- import { COLORS } from "../../../constants/colors";
2
- /**
3
- * Available tag size options
4
- */
5
- export type TagSize = "xs" | "sm" | "md" | "lg";
6
- /**
7
- * Available color names for tags
8
- */
9
- export type TagColor = keyof typeof COLORS;
10
- /**
11
- * Theme mode for styling
12
- */
13
- export type ThemeMode = "light" | "dark";
14
- /**
15
- * Upload handler function type
16
- */
17
- export type UploadHandler = (file: File) => void | Promise<void>;
18
- /**
19
- * Props for the Tag component
20
- */
21
- export interface TagProps {
22
- /** The text content to display */
23
- label: string;
24
- /** Color name or hex color value */
25
- color?: TagColor | string;
26
- /** Size variant */
27
- size?: TagSize;
28
- /** Additional CSS classes */
29
- className?: string;
30
- /** Click handler for the tag */
31
- onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
32
- /** Mouse down handler */
33
- onMouseDown?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
34
- /** Maximum character length before truncation */
35
- truncate?: number;
36
- /** Whether to use hash color generation for string colors */
37
- isHashColor?: boolean;
38
- /** Icon to display before the label */
39
- icon?: React.ReactNode;
40
- /** Whether the tag is removable (shows close button) */
41
- removable?: boolean;
42
- /** Handler for remove button click */
43
- onRemove?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
44
- /** Upload handler function */
45
- onUpload?: UploadHandler;
46
- /** Whether the tag accepts file uploads */
47
- acceptsUpload?: boolean;
48
- /** Theme mode for styling */
49
- theme?: ThemeMode;
50
- /** Custom aria-label for accessibility */
51
- "aria-label"?: string;
52
- }
53
- export declare const Tag: import("react").ForwardRefExoticComponent<TagProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,15 +0,0 @@
1
- import React from "react";
2
- export interface TypographyProps {
3
- children: React.ReactNode;
4
- variant?: "regular" | "medium" | "semibold" | "bold" | "extrablack";
5
- size?: "extra-small" | "small" | "display-small" | "medium" | "display-medium" | "large" | "extra-large";
6
- className?: string;
7
- onClick?(event: React.MouseEvent<HTMLDivElement>): void;
8
- highlight?: boolean;
9
- appearance?: "title" | "body" | "subtitle" | "custom";
10
- style?: React.CSSProperties;
11
- }
12
- export declare const Typography: {
13
- ({ children, variant, size, onClick, className, highlight, appearance, style, }: TypographyProps): import("react/jsx-runtime").JSX.Element;
14
- displayName: string;
15
- };
@@ -1,29 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import 'react-toastify/dist/ReactToastify.css';
3
- import './styles.css';
4
- export type ToastType = 'success' | 'error' | 'warning' | 'info' | 'in-progress';
5
- export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
6
- export interface ToastContainerProps {
7
- position?: ToastPosition;
8
- autoClose?: number | false;
9
- hideProgressBar?: boolean;
10
- newestOnTop?: boolean;
11
- closeOnClick?: boolean;
12
- pauseOnFocusLoss?: boolean;
13
- draggable?: boolean;
14
- pauseOnHover?: boolean;
15
- rtl?: boolean;
16
- className?: string;
17
- style?: React.CSSProperties;
18
- }
19
- export declare const Toast: React.FC<ToastContainerProps>;
20
- export declare const toast: {
21
- success: (message: ReactNode, options?: any) => import("react-toastify").Id;
22
- error: (message: ReactNode, options?: any) => import("react-toastify").Id;
23
- warning: (message: ReactNode, options?: any) => import("react-toastify").Id;
24
- info: (message: ReactNode, options?: any) => import("react-toastify").Id;
25
- inProgress: (message: ReactNode, options?: any) => import("react-toastify").Id;
26
- dismiss: (toastId?: string | number) => void;
27
- isActive: (toastId: string | number) => boolean;
28
- };
29
- export default Toast;
@@ -1,147 +0,0 @@
1
- import { type ReactNode, type MouseEvent } from "react";
2
- /**
3
- * Available floating bar sizes
4
- */
5
- export type FloatingBarSize = "small" | "medium" | "large";
6
- /**
7
- * Available floating bar positions
8
- */
9
- export type FloatingBarPosition = "top" | "bottom";
10
- /**
11
- * Available floating bar themes
12
- */
13
- export type FloatingBarTheme = "primary" | "dark" | "light";
14
- /**
15
- * Configuration for action buttons in the floating bar
16
- */
17
- export interface FloatingBarActionConfig {
18
- /** Unique identifier for the action */
19
- id: string;
20
- /** Button label text */
21
- label?: string;
22
- /** Icon element to display */
23
- icon: ReactNode;
24
- /** Click handler for the action */
25
- onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
26
- /** Icon for dropdown mode */
27
- dropdownIcon?: ReactNode;
28
- /** Whether the action is visible */
29
- visible?: boolean;
30
- /** Whether the action is disabled */
31
- disabled?: boolean;
32
- /** Tooltip text */
33
- tooltip?: string;
34
- /** Whether to hide the label text */
35
- hideLabel?: boolean;
36
- /** Action type */
37
- type?: "button" | "dropdown";
38
- /** Dropdown menu items */
39
- dropdownItems?: Array<{
40
- label: ReactNode;
41
- key: string;
42
- disabled?: boolean;
43
- onClick?: () => void;
44
- }>;
45
- /** Custom CSS classes */
46
- className?: string;
47
- /** Test ID for testing */
48
- "data-testid"?: string;
49
- }
50
- /**
51
- * Configuration for the delete action
52
- */
53
- export interface FloatingBarDeleteConfig {
54
- /** Delete button label */
55
- label?: string;
56
- /** Whether delete is disabled */
57
- disabled?: boolean;
58
- /** Delete action handler */
59
- onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
60
- /** Custom icon for delete */
61
- icon?: ReactNode;
62
- /** Delete confirmation required */
63
- confirmRequired?: boolean;
64
- /** Confirmation message */
65
- confirmMessage?: string;
66
- }
67
- /**
68
- * Props for the FloatingBar component
69
- */
70
- export interface FloatingBarProps {
71
- /** Whether the floating bar is visible */
72
- show?: boolean;
73
- /** Close handler */
74
- onClose: () => void;
75
- /** Array of action configurations */
76
- actionItems: FloatingBarActionConfig[];
77
- /** Number of selected items */
78
- selectedItemsCount?: number;
79
- /** Delete action configuration */
80
- deleteConfig?: FloatingBarDeleteConfig;
81
- /** Whether to show action background */
82
- showActionBackground?: boolean;
83
- /** Floating bar size */
84
- size?: FloatingBarSize;
85
- /** Floating bar position */
86
- position?: FloatingBarPosition;
87
- /** Floating bar theme */
88
- theme?: FloatingBarTheme;
89
- /** Custom width */
90
- width?: string | number;
91
- /** Custom CSS classes */
92
- className?: string;
93
- /** Custom selected text */
94
- selectedText?: string;
95
- /** Custom actions text for collapsed mode */
96
- actionsText?: string;
97
- /** Whether to auto-hide on small screens */
98
- autoHide?: boolean;
99
- /** Maximum items before collapsing */
100
- maxVisibleItems?: number;
101
- /** Animation duration in seconds */
102
- animationDuration?: number;
103
- /** Custom aria-label */
104
- "aria-label"?: string;
105
- /** Test ID for testing */
106
- "data-testid"?: string;
107
- /** Error state */
108
- error?: boolean;
109
- /** Loading state */
110
- loading?: boolean;
111
- /** Error message */
112
- errorMessage?: string;
113
- /** Callback when actions overflow */
114
- onOverflow?: (isOverflowing: boolean) => void;
115
- }
116
- /**
117
- * FloatingBar component provides a floating action bar for bulk operations
118
- *
119
- * @example
120
- * ```tsx
121
- * <FloatingBar
122
- * show={selectedItems.length > 0}
123
- * onClose={() => setSelectedItems([])}
124
- * selectedItemsCount={selectedItems.length}
125
- * actionItems={[
126
- * {
127
- * id: "edit",
128
- * label: "Edit",
129
- * icon: <EditIcon />,
130
- * onClick: handleEdit,
131
- * },
132
- * {
133
- * id: "archive",
134
- * label: "Archive",
135
- * icon: <ArchiveIcon />,
136
- * onClick: handleArchive,
137
- * },
138
- * ]}
139
- * deleteConfig={{
140
- * label: "Delete",
141
- * onClick: handleDelete,
142
- * confirmRequired: true,
143
- * }}
144
- * />
145
- * ```
146
- */
147
- export declare const FloatingBar: import("react").ForwardRefExoticComponent<FloatingBarProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,55 +0,0 @@
1
- import type { CheckboxChangeEvent, CheckboxProps, CheckboxRef } from "antd";
2
- /**
3
- * Props for the Checkbox component
4
- */
5
- export interface CheckboxComponentProps {
6
- /** Unique identifier for the checkbox */
7
- id: string;
8
- /** Label text to display next to the checkbox */
9
- label?: string;
10
- /** Whether the checkbox is checked */
11
- checked?: boolean;
12
- /** Whether the checkbox is checked (alias for checked) */
13
- isChecked?: boolean;
14
- /** Callback function called when checkbox state changes */
15
- onChange: (checked: boolean, event: CheckboxChangeEvent) => void;
16
- /** Whether the checkbox is disabled */
17
- disabled?: boolean;
18
- /** Whether the field is required */
19
- required?: boolean;
20
- /** Message to display below the checkbox */
21
- message?: string;
22
- /** Type of message to display */
23
- messageType?: "success" | "error" | "info" | "default";
24
- /** Additional CSS classes for the wrapper container */
25
- wrapperClassName?: string;
26
- /** Additional CSS classes for the checkbox input */
27
- checkboxClassName?: string;
28
- /** Additional CSS classes for the label */
29
- labelClassName?: string;
30
- /** Size variant for the checkbox */
31
- size?: "small" | "medium" | "large";
32
- /** Visual variant for the checkbox */
33
- variant?: "default" | "outline" | "solid";
34
- /** Whether to show the label on the left side */
35
- labelPosition?: "left" | "right";
36
- /** Additional props to pass to the Ant Design Checkbox */
37
- checkboxProps?: Omit<CheckboxProps, "checked" | "onChange" | "id" | "disabled">;
38
- }
39
- /**
40
- * A highly customizable checkbox component with label, validation, and styling support.
41
- * Features dark mode support, accessibility enhancements, and comprehensive prop support.
42
- *
43
- * @example
44
- * ```tsx
45
- * <Checkbox
46
- * id="terms"
47
- * label="I agree to the terms and conditions"
48
- * checked={agreedToTerms}
49
- * onChange={(checked) => setAgreedToTerms(checked)}
50
- * required
51
- * />
52
- * ```
53
- */
54
- export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxComponentProps & import("react").RefAttributes<CheckboxRef>>;
55
- export type TCheckboxComponentProps = CheckboxComponentProps;
@@ -1,60 +0,0 @@
1
- import type { ChangeEvent } from "react";
2
- /**
3
- * Props for the ColorPicker component
4
- */
5
- export interface ColorPickerProps {
6
- /** Unique identifier for the color picker */
7
- id: string;
8
- /** Label text to display above the color picker */
9
- label?: string;
10
- /** Current color value (hex format) */
11
- value?: string;
12
- /** Default color value (hex format) */
13
- defaultValue?: string;
14
- /** Callback function called when color value changes */
15
- onChange: (color: string, event: ChangeEvent<HTMLInputElement>) => void;
16
- /** Callback function called when color value changes (legacy) */
17
- onColorChange?: (color: string) => void;
18
- /** Whether the color picker is disabled */
19
- disabled?: boolean;
20
- /** Whether the field is required */
21
- required?: boolean;
22
- /** Message to display below the color picker */
23
- message?: string;
24
- /** Type of message to display */
25
- messageType?: "success" | "error" | "info" | "default";
26
- /** Additional CSS classes for the wrapper container */
27
- wrapperClassName?: string;
28
- /** Additional CSS classes for the color input */
29
- inputClassName?: string;
30
- /** Additional CSS classes for the label */
31
- labelClassName?: string;
32
- /** Size variant for the color picker */
33
- size?: "small" | "medium" | "large";
34
- /** Whether to show the color value as text */
35
- showValue?: boolean;
36
- /** Format for displaying the color value */
37
- valueFormat?: "hex" | "rgb" | "hsl";
38
- /** Additional props to pass to the input element */
39
- inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
40
- /** Help text to display below the label */
41
- helpText?: string;
42
- }
43
- /**
44
- * A highly customizable color picker component with label, validation, and styling support.
45
- * Features dark mode support, accessibility enhancements, and comprehensive prop support.
46
- *
47
- * @example
48
- * ```tsx
49
- * <ColorPicker
50
- * id="theme-color"
51
- * label="Theme Color"
52
- * value={themeColor}
53
- * onChange={(color) => setThemeColor(color)}
54
- * showValue
55
- * required
56
- * />
57
- * ```
58
- */
59
- export declare const ColorPicker: import("react").ForwardRefExoticComponent<ColorPickerProps & import("react").RefAttributes<HTMLInputElement>>;
60
- export type ColorPickerComponentProps = ColorPickerProps;
@@ -1,92 +0,0 @@
1
- import type { GroupBase, SingleValue, MultiValue, ActionMeta, Props as ReactSelectProps, SelectInstance } from "react-select";
2
- import type { components } from "react-select";
3
- /**
4
- * Option type for the CreatableSelect component
5
- */
6
- export interface SelectOption {
7
- /** The value of the option */
8
- value: string | number;
9
- /** The label displayed for the option */
10
- label: string;
11
- /** Whether the option is disabled */
12
- isDisabled?: boolean;
13
- /** Additional data for the option */
14
- data?: Record<string, unknown>;
15
- }
16
- /**
17
- * Props for the CreatableSelect component
18
- */
19
- export interface CreatableSelectProps {
20
- /** Unique identifier for the select */
21
- id: string;
22
- /** Label text to display above the select */
23
- label?: string;
24
- /** Placeholder text for the select */
25
- placeholder?: string;
26
- /** Current value for single select */
27
- value?: SelectOption | null;
28
- /** Current values for multi select */
29
- selectedValues?: SelectOption[];
30
- /** Callback function called when selection changes */
31
- onChange: (value: SingleValue<SelectOption> | MultiValue<SelectOption>, actionMeta: ActionMeta<SelectOption>) => void;
32
- /** Callback function called when selection changes (legacy) */
33
- onColorChange?: (data: SelectOption | SelectOption[] | null) => void;
34
- /** Array of available options */
35
- selectOptions: SelectOption[];
36
- /** Whether the select is in loading state */
37
- loading?: boolean;
38
- /** Whether multiple selections are allowed */
39
- multiSelect?: boolean;
40
- /** Whether the select is disabled */
41
- disabled?: boolean;
42
- /** Whether the select is clearable */
43
- isClearable?: boolean;
44
- /** Whether the field is required */
45
- required?: boolean;
46
- /** Message to display below the select */
47
- message?: string;
48
- /** Type of message to display */
49
- messageType?: "success" | "error" | "info" | "default";
50
- /** Whether to preserve original case in the label */
51
- originalCase?: boolean;
52
- /** Additional CSS classes for the wrapper container */
53
- wrapperClassName?: string;
54
- /** Additional CSS classes for the select */
55
- selectClassName?: string;
56
- /** Additional CSS classes for the label */
57
- labelClassName?: string;
58
- /** Help text to display below the label */
59
- helpText?: string;
60
- /** Size variant for the select */
61
- size?: "small" | "medium" | "large";
62
- /** Custom filter function for options */
63
- filterOption?: ReactSelectProps<SelectOption, boolean, GroupBase<SelectOption>>["filterOption"];
64
- /** Additional props to pass to the react-select component */
65
- selectProps?: Partial<ReactSelectProps<SelectOption, boolean, GroupBase<SelectOption>>>;
66
- /** Custom components to override defaults */
67
- components?: Partial<typeof components>;
68
- /** Array of tags for categorization */
69
- tags?: string[];
70
- /** Tooltip text */
71
- tooltip?: string;
72
- }
73
- /**
74
- * A highly customizable creatable select component with label, validation, and styling support.
75
- * Features dark mode support, accessibility enhancements, and comprehensive prop support.
76
- * Built on top of react-select/creatable for advanced functionality.
77
- *
78
- * @example
79
- * ```tsx
80
- * <CreatableSelectField
81
- * id="tags"
82
- * label="Tags"
83
- * selectOptions={tagOptions}
84
- * value={selectedTag}
85
- * onChange={(newValue) => setSelectedTag(newValue)}
86
- * placeholder="Select or create tags..."
87
- * multiSelect
88
- * />
89
- * ```
90
- */
91
- export declare const CreatableSelectField: import("react").ForwardRefExoticComponent<CreatableSelectProps & import("react").RefAttributes<SelectInstance<SelectOption, boolean, GroupBase<SelectOption>>>>;
92
- export type TProps = CreatableSelectProps;
@@ -1,73 +0,0 @@
1
- /**
2
- * Props for the CurrencyInputField component
3
- */
4
- export interface CurrencyInputFieldProps {
5
- /** Unique identifier for the currency input */
6
- id: string;
7
- /** Label text to display above the input */
8
- label?: string;
9
- /** Current value of the input (number) */
10
- value?: number | null;
11
- /** Default value for the input */
12
- defaultValue?: number | null;
13
- /** Callback function called when value changes */
14
- onChange: (value: number | null, currencyCode: string) => void;
15
- /** Whether the input is disabled */
16
- disabled?: boolean;
17
- /** Whether the field is required */
18
- required?: boolean;
19
- /** Placeholder text for the input */
20
- placeholder?: string;
21
- /** Message to display below the input */
22
- message?: string;
23
- /** Type of message to display */
24
- messageType?: "success" | "error" | "info" | "default";
25
- /** Additional CSS classes for the wrapper container */
26
- wrapperClassName?: string;
27
- /** Additional CSS classes for the input */
28
- inputClassName?: string;
29
- /** Additional CSS classes for the label */
30
- labelClassName?: string;
31
- /** Help text to display below the label */
32
- helpText?: string;
33
- /** Size variant for the input */
34
- size?: "small" | "medium" | "large";
35
- /** Current currency code */
36
- currencyCode?: string;
37
- /** Whether to allow currency selection */
38
- allowCurrencyChange?: boolean;
39
- /** Available currency options (defaults to all) */
40
- availableCurrencies?: string[];
41
- /** Whether to show currency symbol */
42
- showSymbol?: boolean;
43
- /** Whether to format value display */
44
- formatValue?: boolean;
45
- /** Minimum value allowed */
46
- min?: number;
47
- /** Maximum value allowed */
48
- max?: number;
49
- /** Number of decimal places */
50
- decimalPlaces?: number;
51
- /** Additional props to pass to the input element */
52
- inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
53
- /** Inline styles for the input element */
54
- inputStyle?: React.CSSProperties;
55
- }
56
- /**
57
- * A highly customizable currency input component with label, validation, and styling support.
58
- * Features currency selection, formatting, validation, and comprehensive prop support.
59
- *
60
- * @example
61
- * ```tsx
62
- * <CurrencyInputField
63
- * id="price"
64
- * label="Price"
65
- * value={price}
66
- * onChange={(value, currency) => setPrice(value)}
67
- * currencyCode="USD"
68
- * allowCurrencyChange
69
- * required
70
- * />
71
- * ```
72
- */
73
- export declare const CurrencyInputField: import("react").ForwardRefExoticComponent<CurrencyInputFieldProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,12 +0,0 @@
1
- /**
2
- * Available currencies for the CurrencyInputField component
3
- */
4
- export declare const CURRENCIES: {
5
- value: string;
6
- label: string;
7
- symbol: string;
8
- }[];
9
- /**
10
- * Currency symbols mapping for display purposes
11
- */
12
- export declare const CURRENCY_SYMBOLS: Record<string, string>;
@@ -1,72 +0,0 @@
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 DateRange: import("react").ForwardRefExoticComponent<DateRangeProps & import("react").RefAttributes<HTMLDivElement>>;