@lax-wp/design-system 0.1.0 → 0.1.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.
- package/README.md +526 -16
- package/dist/components/data-display/badge/Badge.d.ts +44 -0
- package/dist/components/data-display/banner/Banner.d.ts +41 -0
- package/dist/components/data-display/code-editor/CodeEditor.d.ts +4 -0
- package/dist/components/data-display/code-editor/JsonGrid.d.ts +14 -0
- package/dist/components/data-display/code-editor/Tabs.d.ts +12 -0
- package/dist/components/data-display/pdf-viewer/PdfViewer.d.ts +45 -0
- package/dist/components/data-display/popper/Popper.d.ts +57 -0
- package/dist/components/data-display/status-color-mapping/StatusColorMapping.d.ts +29 -0
- package/dist/components/data-display/typography/Typography.d.ts +15 -0
- package/dist/components/feedback/toast/Toast.d.ts +29 -0
- package/dist/components/forms/checkbox/Checkbox.d.ts +55 -0
- package/dist/components/forms/color-picker/ColorPicker.d.ts +60 -0
- package/dist/components/forms/creatable-select/CreatableSelect.d.ts +92 -0
- package/dist/components/forms/currency-input/CurrencyInputField.d.ts +73 -0
- package/dist/components/forms/currency-input/currency.constant.d.ts +6 -0
- package/dist/components/forms/date-range/DateRange.d.ts +72 -0
- package/dist/components/forms/debounce-input/DebounceInputField.d.ts +76 -0
- package/dist/components/forms/input-field/InputField.d.ts +62 -0
- package/dist/components/forms/percentage-input/PercentageInputField.d.ts +75 -0
- package/dist/components/forms/text-field/TextField.d.ts +48 -0
- package/dist/components/forms/toggle/Toggle.d.ts +71 -0
- package/dist/components/tooltip/Tooltip.d.ts +13 -0
- package/dist/design-system.css +1 -0
- package/dist/hooks/useOutsideClick.d.ts +28 -0
- package/dist/hooks/usePythonSyntax.d.ts +28 -0
- package/dist/hooks/useTheme.d.ts +6 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.es.js +25703 -4806
- package/dist/index.umd.js +225 -31
- package/dist/services/monacoManager.d.ts +28 -0
- package/dist/types/index.d.ts +66 -0
- package/dist/utils/messageConstants.d.ts +16 -0
- package/dist/utils/utilities.d.ts +13 -0
- package/package.json +40 -13
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the PdfViewer component
|
|
3
|
+
*/
|
|
4
|
+
export interface PdfViewerProps {
|
|
5
|
+
/** URL of the PDF file to display */
|
|
6
|
+
pdfUrl: string;
|
|
7
|
+
/** Width of the viewer */
|
|
8
|
+
width?: string | number;
|
|
9
|
+
/** Height of the viewer */
|
|
10
|
+
height?: string | number;
|
|
11
|
+
/** Additional CSS classes for the wrapper */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Additional CSS classes for the iframe */
|
|
14
|
+
iframeClassName?: string;
|
|
15
|
+
/** Title for the PDF viewer iframe */
|
|
16
|
+
title?: string;
|
|
17
|
+
/** Whether to show loading state */
|
|
18
|
+
showLoading?: boolean;
|
|
19
|
+
/** Custom loading component */
|
|
20
|
+
loadingComponent?: React.ReactNode;
|
|
21
|
+
/** Custom error component */
|
|
22
|
+
errorComponent?: React.ReactNode;
|
|
23
|
+
/** Callback when PDF fails to load */
|
|
24
|
+
onError?: () => void;
|
|
25
|
+
/** Callback when PDF loads successfully */
|
|
26
|
+
onLoad?: () => void;
|
|
27
|
+
/** Whether to allow fullscreen */
|
|
28
|
+
allowFullScreen?: boolean;
|
|
29
|
+
/** Custom aria-label for accessibility */
|
|
30
|
+
"aria-label"?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* PdfViewer component displays PDF documents in an embedded iframe
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <PdfViewer
|
|
38
|
+
* pdfUrl="/documents/report.pdf"
|
|
39
|
+
* width="100%"
|
|
40
|
+
* height="600px"
|
|
41
|
+
* title="Monthly Report"
|
|
42
|
+
* />
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare const PdfViewer: import("react").ForwardRefExoticComponent<PdfViewerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Available placement options for the Popper
|
|
3
|
+
*/
|
|
4
|
+
export type PopperPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
|
|
5
|
+
/**
|
|
6
|
+
* Props for the Popper component
|
|
7
|
+
*/
|
|
8
|
+
export interface PopperProps {
|
|
9
|
+
/** The trigger element (button content) */
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
/** The popper content to display */
|
|
12
|
+
component: React.ReactNode;
|
|
13
|
+
/** Placement position relative to trigger */
|
|
14
|
+
placement?: PopperPlacement;
|
|
15
|
+
/** Whether the popper is open */
|
|
16
|
+
isOpen: boolean;
|
|
17
|
+
/** Function to toggle the popper open/closed state */
|
|
18
|
+
toggleMenu?: (event?: React.MouseEvent<HTMLButtonElement>) => void;
|
|
19
|
+
/** Portal container ID (defaults to document.body) */
|
|
20
|
+
parentContainer?: string;
|
|
21
|
+
/** Whether to remove default spacing on trigger */
|
|
22
|
+
noSpacing?: boolean;
|
|
23
|
+
/** Additional CSS classes for the trigger button */
|
|
24
|
+
triggerClassName?: string;
|
|
25
|
+
/** Additional CSS classes for the popper container */
|
|
26
|
+
containerClassName?: string;
|
|
27
|
+
/** Additional CSS classes for the wrapper */
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Whether to show arrow pointing to trigger */
|
|
30
|
+
showArrow?: boolean;
|
|
31
|
+
/** Custom offset from trigger element */
|
|
32
|
+
offset?: number;
|
|
33
|
+
/** Whether to disable outside click handling */
|
|
34
|
+
disableOutsideClick?: boolean;
|
|
35
|
+
/** Custom aria-label for accessibility */
|
|
36
|
+
"aria-label"?: string;
|
|
37
|
+
/** Whether trigger is disabled */
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Popper component provides positioned floating content relative to a trigger element
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* const [isOpen, setIsOpen] = useState(false);
|
|
46
|
+
*
|
|
47
|
+
* <Popper
|
|
48
|
+
* isOpen={isOpen}
|
|
49
|
+
* toggleMenu={() => setIsOpen(!isOpen)}
|
|
50
|
+
* placement="bottom-start"
|
|
51
|
+
* component={<MenuContent />}
|
|
52
|
+
* >
|
|
53
|
+
* <button>Open Menu</button>
|
|
54
|
+
* </Popper>
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare const Popper: import("react").ForwardRefExoticComponent<PopperProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Available status color options for the StatusColorMapping component
|
|
3
|
+
*/
|
|
4
|
+
export type StatusColor = "blue" | "green" | "yellow" | "orange" | "red" | "navy" | "grey" | "purple" | "teal" | "peach";
|
|
5
|
+
/**
|
|
6
|
+
* Props for the StatusColorMapping component
|
|
7
|
+
*/
|
|
8
|
+
export interface StatusColorMappingProps {
|
|
9
|
+
/** The status color variant to apply */
|
|
10
|
+
status?: StatusColor;
|
|
11
|
+
/** The text content to display */
|
|
12
|
+
children: string;
|
|
13
|
+
/** Additional CSS classes for the wrapper */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Whether to use small size variant */
|
|
16
|
+
size?: "small" | "medium" | "large";
|
|
17
|
+
/** Custom aria-label for accessibility */
|
|
18
|
+
"aria-label"?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* StatusColorMapping component displays text with status-based color styling
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <StatusColorMapping status="green">Active</StatusColorMapping>
|
|
26
|
+
* <StatusColorMapping status="red" size="small">Error</StatusColorMapping>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare const StatusColorMapping: import("react").ForwardRefExoticComponent<StatusColorMappingProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
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;
|
|
@@ -0,0 +1,55 @@
|
|
|
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;
|
|
@@ -0,0 +1,60 @@
|
|
|
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;
|
|
@@ -0,0 +1,92 @@
|
|
|
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;
|
|
@@ -0,0 +1,73 @@
|
|
|
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>>;
|
|
@@ -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 DateRange: import("react").ForwardRefExoticComponent<DateRangeProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the DebounceInputField component
|
|
3
|
+
*/
|
|
4
|
+
export interface DebounceInputFieldProps {
|
|
5
|
+
/** Unique identifier for the input */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Label text to display above the input */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Current value of the input */
|
|
10
|
+
value?: string;
|
|
11
|
+
/** Default value for the input */
|
|
12
|
+
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
|
+
/** Whether the input is disabled */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Whether the field is required */
|
|
20
|
+
required?: boolean;
|
|
21
|
+
/** Placeholder text for the input */
|
|
22
|
+
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
|
+
/** Debounce timeout in milliseconds */
|
|
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
|
+
}
|
|
60
|
+
/**
|
|
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.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* <DebounceInputField
|
|
67
|
+
* id="search"
|
|
68
|
+
* label="Search"
|
|
69
|
+
* value={searchTerm}
|
|
70
|
+
* onChange={(value) => setSearchTerm(value)}
|
|
71
|
+
* debounceTimeout={300}
|
|
72
|
+
* placeholder="Type to search..."
|
|
73
|
+
* />
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare const DebounceInputField: import("react").ForwardRefExoticComponent<DebounceInputFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|