azamat-ui-kit 0.1.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.
- package/LICENSE +21 -0
- package/README.md +323 -0
- package/dist/cli/index.js +725 -0
- package/dist/components/actions/action-menu.d.ts +26 -0
- package/dist/components/actions/copy-button.d.ts +13 -0
- package/dist/components/actions/index.d.ts +3 -0
- package/dist/components/actions/quick-action-grid.d.ts +27 -0
- package/dist/components/calendar/calendar.d.ts +28 -0
- package/dist/components/calendar/date-picker.d.ts +15 -0
- package/dist/components/calendar/date-range-picker.d.ts +18 -0
- package/dist/components/calendar/date-utils.d.ts +12 -0
- package/dist/components/calendar/index.d.ts +4 -0
- package/dist/components/command/command-palette.d.ts +54 -0
- package/dist/components/command/index.d.ts +1 -0
- package/dist/components/data-table/data-table-actions-column.d.ts +16 -0
- package/dist/components/data-table/data-table-bulk-actions.d.ts +17 -0
- package/dist/components/data-table/data-table-column-visibility-menu.d.ts +14 -0
- package/dist/components/data-table/data-table-pagination.d.ts +21 -0
- package/dist/components/data-table/data-table-row-actions.d.ts +13 -0
- package/dist/components/data-table/data-table-select-column.d.ts +13 -0
- package/dist/components/data-table/data-table-sortable-header.d.ts +11 -0
- package/dist/components/data-table/data-table-toolbar.d.ts +14 -0
- package/dist/components/data-table/data-table-view-presets.d.ts +27 -0
- package/dist/components/data-table/data-table.d.ts +86 -0
- package/dist/components/data-table/index.d.ts +10 -0
- package/dist/components/display/activity-feed.d.ts +25 -0
- package/dist/components/display/avatar.d.ts +26 -0
- package/dist/components/display/data-state.d.ts +16 -0
- package/dist/components/display/description-list.d.ts +31 -0
- package/dist/components/display/index.d.ts +10 -0
- package/dist/components/display/info-card.d.ts +18 -0
- package/dist/components/display/metric-grid.d.ts +22 -0
- package/dist/components/display/progress.d.ts +35 -0
- package/dist/components/display/result.d.ts +18 -0
- package/dist/components/display/status-legend.d.ts +27 -0
- package/dist/components/display/timeline.d.ts +25 -0
- package/dist/components/feedback/empty-state.d.ts +11 -0
- package/dist/components/feedback/index.d.ts +3 -0
- package/dist/components/feedback/loading-state.d.ts +8 -0
- package/dist/components/feedback/status-badge.d.ts +9 -0
- package/dist/components/filters/filter-bar.d.ts +14 -0
- package/dist/components/filters/filter-chips.d.ts +18 -0
- package/dist/components/filters/index.d.ts +2 -0
- package/dist/components/form/form-async-select.d.ts +12 -0
- package/dist/components/form/form-date-input.d.ts +12 -0
- package/dist/components/form/form-date-picker.d.ts +12 -0
- package/dist/components/form/form-date-range-input.d.ts +12 -0
- package/dist/components/form/form-date-range-picker.d.ts +15 -0
- package/dist/components/form/form-field-shell.d.ts +26 -0
- package/dist/components/form/form-input.d.ts +13 -0
- package/dist/components/form/form-number-input.d.ts +12 -0
- package/dist/components/form/form-password-input.d.ts +11 -0
- package/dist/components/form/form-phone-input.d.ts +13 -0
- package/dist/components/form/form-search-input.d.ts +11 -0
- package/dist/components/form/form-select.d.ts +12 -0
- package/dist/components/form/form-switch.d.ts +14 -0
- package/dist/components/form/form-textarea.d.ts +13 -0
- package/dist/components/form/index.d.ts +14 -0
- package/dist/components/inputs/async-select.d.ts +106 -0
- package/dist/components/inputs/clearable-input.d.ts +16 -0
- package/dist/components/inputs/combobox.d.ts +20 -0
- package/dist/components/inputs/date-input.d.ts +9 -0
- package/dist/components/inputs/date-range-input.d.ts +18 -0
- package/dist/components/inputs/index.d.ts +14 -0
- package/dist/components/inputs/masked-input.d.ts +11 -0
- package/dist/components/inputs/money-input.d.ts +13 -0
- package/dist/components/inputs/number-input.d.ts +16 -0
- package/dist/components/inputs/password-input.d.ts +17 -0
- package/dist/components/inputs/phone-input.d.ts +10 -0
- package/dist/components/inputs/quantity-input.d.ts +15 -0
- package/dist/components/inputs/search-input.d.ts +7 -0
- package/dist/components/inputs/simple-select.d.ts +20 -0
- package/dist/components/inputs/tag-input.d.ts +15 -0
- package/dist/components/layout/app-header.d.ts +10 -0
- package/dist/components/layout/app-shell.d.ts +32 -0
- package/dist/components/layout/app-sidebar.d.ts +28 -0
- package/dist/components/layout/breadcrumbs.d.ts +18 -0
- package/dist/components/layout/index.d.ts +8 -0
- package/dist/components/layout/page-container.d.ts +7 -0
- package/dist/components/layout/page-header.d.ts +12 -0
- package/dist/components/layout/sidebar-nav.d.ts +25 -0
- package/dist/components/layout/stat-card.d.ts +18 -0
- package/dist/components/navigation/index.d.ts +3 -0
- package/dist/components/navigation/page-tabs.d.ts +18 -0
- package/dist/components/navigation/pagination.d.ts +21 -0
- package/dist/components/navigation/stepper-tabs.d.ts +19 -0
- package/dist/components/notifications/index.d.ts +1 -0
- package/dist/components/notifications/toast.d.ts +42 -0
- package/dist/components/overlay/confirm-dialog.d.ts +17 -0
- package/dist/components/overlay/dialog-actions.d.ts +14 -0
- package/dist/components/overlay/index.d.ts +4 -0
- package/dist/components/overlay/modal-shell.d.ts +20 -0
- package/dist/components/overlay/sheet-shell.d.ts +34 -0
- package/dist/components/patterns/form-builder-presets.d.ts +23 -0
- package/dist/components/patterns/form-builder.d.ts +95 -0
- package/dist/components/patterns/index.d.ts +4 -0
- package/dist/components/patterns/resource-detail-page.d.ts +39 -0
- package/dist/components/patterns/resource-page.d.ts +34 -0
- package/dist/components/ui/badge.d.ts +7 -0
- package/dist/components/ui/button.d.ts +8 -0
- package/dist/components/ui/card.d.ts +11 -0
- package/dist/components/ui/checkbox.d.ts +13 -0
- package/dist/components/ui/component-preview.d.ts +10 -0
- package/dist/components/ui/dialog.d.ts +17 -0
- package/dist/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/popover.d.ts +9 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/switch.d.ts +12 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/tabs.d.ts +6 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/upload/file-upload.d.ts +61 -0
- package/dist/components/upload/image-upload.d.ts +14 -0
- package/dist/components/upload/index.d.ts +2 -0
- package/dist/components/wizard/index.d.ts +2 -0
- package/dist/components/wizard/stepper.d.ts +16 -0
- package/dist/components/wizard/wizard.d.ts +17 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/use-before-unload-when-dirty.d.ts +2 -0
- package/dist/hooks/use-data-table-view-state.d.ts +20 -0
- package/dist/hooks/use-debounce.d.ts +3 -0
- package/dist/hooks/use-disclosure.d.ts +13 -0
- package/dist/hooks/use-is-mobile.d.ts +3 -0
- package/dist/hooks/use-session-storage-state.d.ts +8 -0
- package/dist/index.cjs +9 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +23213 -0
- package/dist/lib/utils.d.ts +2 -0
- package/package.json +118 -0
- package/registry.json +185 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Card } from "@/components/ui/card";
|
|
3
|
+
export type ProgressTone = "default" | "success" | "info" | "warning" | "danger" | "muted";
|
|
4
|
+
export type ProgressSize = "sm" | "default" | "lg";
|
|
5
|
+
export type ProgressProps = Omit<React.ComponentProps<"div">, "children"> & {
|
|
6
|
+
value?: number | null;
|
|
7
|
+
max?: number;
|
|
8
|
+
min?: number;
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
description?: React.ReactNode;
|
|
11
|
+
showValue?: boolean;
|
|
12
|
+
valueFormatter?: (value: number, percent: number) => React.ReactNode;
|
|
13
|
+
tone?: ProgressTone;
|
|
14
|
+
size?: ProgressSize;
|
|
15
|
+
indeterminate?: boolean;
|
|
16
|
+
trackClassName?: string;
|
|
17
|
+
indicatorClassName?: string;
|
|
18
|
+
};
|
|
19
|
+
export type ProgressCardProps = React.ComponentProps<typeof Card> & {
|
|
20
|
+
title?: React.ReactNode;
|
|
21
|
+
description?: React.ReactNode;
|
|
22
|
+
value?: number | null;
|
|
23
|
+
max?: number;
|
|
24
|
+
min?: number;
|
|
25
|
+
tone?: ProgressTone;
|
|
26
|
+
size?: ProgressSize;
|
|
27
|
+
showValue?: boolean;
|
|
28
|
+
valueFormatter?: ProgressProps["valueFormatter"];
|
|
29
|
+
footer?: React.ReactNode;
|
|
30
|
+
progressClassName?: string;
|
|
31
|
+
};
|
|
32
|
+
declare function getProgressPercent(value: number | null | undefined, min: number, max: number): number;
|
|
33
|
+
declare function Progress({ value, min, max, label, description, showValue, valueFormatter, tone, size, indeterminate, className, trackClassName, indicatorClassName, ...props }: ProgressProps): React.JSX.Element;
|
|
34
|
+
declare function ProgressCard({ title, description, value, min, max, tone, size, showValue, valueFormatter, footer, progressClassName, className, ...props }: ProgressCardProps): React.JSX.Element;
|
|
35
|
+
export { Progress, ProgressCard, getProgressPercent };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Button } from "@/components/ui/button";
|
|
3
|
+
export type ResultStatus = "success" | "error" | "warning" | "info" | "not-found" | "forbidden" | "server-error";
|
|
4
|
+
export type ResultProps = React.ComponentProps<"div"> & {
|
|
5
|
+
status?: ResultStatus;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
title?: React.ReactNode;
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
actions?: React.ReactNode;
|
|
10
|
+
extra?: React.ReactNode;
|
|
11
|
+
compact?: boolean;
|
|
12
|
+
iconClassName?: string;
|
|
13
|
+
titleClassName?: string;
|
|
14
|
+
descriptionClassName?: string;
|
|
15
|
+
};
|
|
16
|
+
declare function Result({ status, icon, title, description, actions, extra, compact, iconClassName, titleClassName, descriptionClassName, className, ...props }: ResultProps): React.JSX.Element;
|
|
17
|
+
declare function ResultAction({ className, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
18
|
+
export { Result, ResultAction };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Card } from "@/components/ui/card";
|
|
3
|
+
export type StatusLegendTone = "default" | "success" | "warning" | "danger" | "info" | "muted";
|
|
4
|
+
export type StatusLegendOrientation = "vertical" | "horizontal" | "grid";
|
|
5
|
+
export type StatusLegendItem = {
|
|
6
|
+
key: string;
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
count?: React.ReactNode;
|
|
10
|
+
tone?: StatusLegendTone;
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
hidden?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
export type StatusLegendProps = React.ComponentProps<typeof Card> & {
|
|
16
|
+
title?: React.ReactNode;
|
|
17
|
+
description?: React.ReactNode;
|
|
18
|
+
actions?: React.ReactNode;
|
|
19
|
+
items: StatusLegendItem[];
|
|
20
|
+
orientation?: StatusLegendOrientation;
|
|
21
|
+
compact?: boolean;
|
|
22
|
+
showCounts?: boolean;
|
|
23
|
+
contentClassName?: string;
|
|
24
|
+
itemClassName?: string;
|
|
25
|
+
};
|
|
26
|
+
declare function StatusLegend({ title, description, actions, items, orientation, compact, showCounts, contentClassName, itemClassName, className, ...props }: StatusLegendProps): React.JSX.Element;
|
|
27
|
+
export { StatusLegend };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type TimelineTone = "default" | "success" | "info" | "warning" | "danger" | "muted";
|
|
3
|
+
export type TimelineOrientation = "vertical" | "horizontal";
|
|
4
|
+
export type TimelineItem = {
|
|
5
|
+
key: string;
|
|
6
|
+
title?: React.ReactNode;
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
time?: React.ReactNode;
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
tone?: TimelineTone;
|
|
11
|
+
content?: React.ReactNode;
|
|
12
|
+
actions?: React.ReactNode;
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
export type TimelineProps = React.ComponentProps<"div"> & {
|
|
17
|
+
items: TimelineItem[];
|
|
18
|
+
orientation?: TimelineOrientation;
|
|
19
|
+
pending?: boolean;
|
|
20
|
+
pendingLabel?: React.ReactNode;
|
|
21
|
+
compact?: boolean;
|
|
22
|
+
itemClassName?: string;
|
|
23
|
+
};
|
|
24
|
+
declare function Timeline({ items, orientation, pending, pendingLabel, compact, itemClassName, className, ...props }: TimelineProps): React.JSX.Element;
|
|
25
|
+
export { Timeline };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type EmptyStateProps = React.ComponentProps<"div"> & {
|
|
3
|
+
icon?: React.ReactNode;
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
action?: React.ReactNode;
|
|
7
|
+
actionLabel?: React.ReactNode;
|
|
8
|
+
onAction?: () => void;
|
|
9
|
+
};
|
|
10
|
+
declare function EmptyState({ className, icon, title, description, action, actionLabel, onAction, ...props }: EmptyStateProps): React.JSX.Element;
|
|
11
|
+
export { EmptyState };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type LoadingStateProps = React.ComponentProps<"div"> & {
|
|
3
|
+
label?: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
declare function LoadingState({ className, label, description, icon, ...props }: LoadingStateProps): React.JSX.Element;
|
|
8
|
+
export { LoadingState };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Badge } from "@/components/ui/badge";
|
|
3
|
+
export type StatusBadgeTone = "default" | "success" | "warning" | "danger" | "info" | "muted" | "outline";
|
|
4
|
+
export type StatusBadgeProps = React.ComponentProps<typeof Badge> & {
|
|
5
|
+
tone?: StatusBadgeTone;
|
|
6
|
+
dot?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare function StatusBadge({ className, tone, dot, children, ...props }: StatusBadgeProps): React.JSX.Element;
|
|
9
|
+
export { StatusBadge };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type FilterBarProps = React.ComponentProps<"div"> & {
|
|
3
|
+
search?: React.ReactNode;
|
|
4
|
+
filters?: React.ReactNode;
|
|
5
|
+
actions?: React.ReactNode;
|
|
6
|
+
activeCount?: number;
|
|
7
|
+
activeLabel?: (count: number) => React.ReactNode;
|
|
8
|
+
resetLabel?: React.ReactNode;
|
|
9
|
+
onReset?: () => void;
|
|
10
|
+
collapsible?: boolean;
|
|
11
|
+
defaultExpanded?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare function FilterBar({ className, search, filters, actions, activeCount, activeLabel, resetLabel, onReset, collapsible, defaultExpanded, children, ...props }: FilterBarProps): React.JSX.Element;
|
|
14
|
+
export { FilterBar };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type FilterChip = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
value?: React.ReactNode;
|
|
6
|
+
tone?: "default" | "success" | "warning" | "danger" | "info" | "muted";
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type FilterChipsProps = React.ComponentProps<"div"> & {
|
|
11
|
+
chips: FilterChip[];
|
|
12
|
+
clearLabel?: React.ReactNode;
|
|
13
|
+
empty?: React.ReactNode;
|
|
14
|
+
onRemove?: (key: string) => void;
|
|
15
|
+
onClear?: () => void;
|
|
16
|
+
};
|
|
17
|
+
declare function FilterChips({ chips, clearLabel, empty, onRemove, onClear, className, ...props }: FilterChipsProps): React.JSX.Element;
|
|
18
|
+
export { FilterChips };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
2
|
+
import { type FormFieldShellControlProps } from "@/components/form/form-field-shell";
|
|
3
|
+
import { type AsyncSelectOption, type AsyncSelectProps } from "@/components/inputs/async-select";
|
|
4
|
+
export type FormAsyncSelectProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValue extends string = string, TData = unknown, TOption extends AsyncSelectOption<TValue, TData> = AsyncSelectOption<TValue, TData>> = Omit<AsyncSelectProps<TValue, TData, TOption>, "value" | "onValueChange" | "disabled"> & FormFieldShellControlProps & {
|
|
5
|
+
control: Control<TFieldValues>;
|
|
6
|
+
name: TName;
|
|
7
|
+
fieldClassName?: string;
|
|
8
|
+
emptyValue?: unknown;
|
|
9
|
+
onValueChange?: (value: TValue | undefined, option?: TOption) => void;
|
|
10
|
+
};
|
|
11
|
+
declare function FormAsyncSelect<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TValue extends string = string, TData = unknown, TOption extends AsyncSelectOption<TValue, TData> = AsyncSelectOption<TValue, TData>>({ control, name, label, description, required, className, layout, descriptionPosition, labelAction, requiredIndicator, errorIcon, showErrorIcon, disabled, readOnly, labelClassName, labelRowClassName, descriptionClassName, errorClassName, contentClassName, fieldClassName, emptyValue, onValueChange, ...props }: FormAsyncSelectProps<TFieldValues, TName, TValue, TData, TOption>): import("react").JSX.Element;
|
|
12
|
+
export { FormAsyncSelect };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
2
|
+
import { type FormFieldShellProps } from "@/components/form/form-field-shell";
|
|
3
|
+
import { type DateInputProps } from "@/components/inputs/date-input";
|
|
4
|
+
export type FormDateInputProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<DateInputProps, "name" | "value" | "defaultValue" | "onValueChange"> & Pick<FormFieldShellProps, "label" | "description" | "required" | "className"> & {
|
|
5
|
+
control: Control<TFieldValues>;
|
|
6
|
+
name: TName;
|
|
7
|
+
fieldClassName?: string;
|
|
8
|
+
emptyValue?: unknown;
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
};
|
|
11
|
+
declare function FormDateInput<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ control, name, label, description, required, className, fieldClassName, emptyValue, onValueChange, ...props }: FormDateInputProps<TFieldValues, TName>): import("react").JSX.Element;
|
|
12
|
+
export { FormDateInput };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
2
|
+
import { type DatePickerProps } from "@/components/calendar/date-picker";
|
|
3
|
+
import { type FormFieldShellProps } from "@/components/form/form-field-shell";
|
|
4
|
+
export type FormDatePickerProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<DatePickerProps, "value" | "onValueChange"> & Pick<FormFieldShellProps, "label" | "description" | "required" | "className"> & {
|
|
5
|
+
control: Control<TFieldValues>;
|
|
6
|
+
name: TName;
|
|
7
|
+
fieldClassName?: string;
|
|
8
|
+
emptyValue?: unknown;
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
};
|
|
11
|
+
declare function FormDatePicker<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ control, name, label, description, required, className, fieldClassName, emptyValue, onValueChange, ...props }: FormDatePickerProps<TFieldValues, TName>): import("react").JSX.Element;
|
|
12
|
+
export { FormDatePicker };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
2
|
+
import { type FormFieldShellProps } from "@/components/form/form-field-shell";
|
|
3
|
+
import { type DateRangeInputProps, type DateRangeValue } from "@/components/inputs/date-range-input";
|
|
4
|
+
export type FormDateRangeInputProps<TFieldValues extends FieldValues = FieldValues, TFromName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TToName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<DateRangeInputProps, "value" | "onValueChange"> & Pick<FormFieldShellProps, "label" | "description" | "required" | "className"> & {
|
|
5
|
+
control: Control<TFieldValues>;
|
|
6
|
+
fromName: TFromName;
|
|
7
|
+
toName: TToName;
|
|
8
|
+
emptyValue?: unknown;
|
|
9
|
+
onValueChange?: (value: DateRangeValue) => void;
|
|
10
|
+
};
|
|
11
|
+
declare function FormDateRangeInput<TFieldValues extends FieldValues = FieldValues, TFromName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TToName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ control, fromName, toName, label, description, required, className, emptyValue, onValueChange, ...props }: FormDateRangeInputProps<TFieldValues, TFromName, TToName>): import("react").JSX.Element;
|
|
12
|
+
export { FormDateRangeInput };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
2
|
+
import { type DateRangePickerProps } from "@/components/calendar/date-range-picker";
|
|
3
|
+
import { type FormFieldShellProps } from "@/components/form/form-field-shell";
|
|
4
|
+
export type FormDateRangePickerProps<TFieldValues extends FieldValues = FieldValues> = Omit<DateRangePickerProps, "value" | "onValueChange"> & Pick<FormFieldShellProps, "label" | "description" | "required" | "className"> & {
|
|
5
|
+
control: Control<TFieldValues>;
|
|
6
|
+
fromName: FieldPath<TFieldValues>;
|
|
7
|
+
toName: FieldPath<TFieldValues>;
|
|
8
|
+
emptyValue?: unknown;
|
|
9
|
+
onValueChange?: (value: {
|
|
10
|
+
from?: string;
|
|
11
|
+
to?: string;
|
|
12
|
+
}) => void;
|
|
13
|
+
};
|
|
14
|
+
declare function FormDateRangePicker<TFieldValues extends FieldValues = FieldValues>({ control, fromName, toName, label, description, required, className, emptyValue, onValueChange, ...props }: FormDateRangePickerProps<TFieldValues>): import("react").JSX.Element;
|
|
15
|
+
export { FormDateRangePicker };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type FormFieldLayout = "vertical" | "horizontal" | "inline";
|
|
3
|
+
export type FormFieldDescriptionPosition = "top" | "bottom";
|
|
4
|
+
export type FormFieldShellProps = React.ComponentProps<"div"> & {
|
|
5
|
+
label?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
error?: React.ReactNode;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
htmlFor?: string;
|
|
10
|
+
layout?: FormFieldLayout;
|
|
11
|
+
descriptionPosition?: FormFieldDescriptionPosition;
|
|
12
|
+
labelAction?: React.ReactNode;
|
|
13
|
+
requiredIndicator?: React.ReactNode;
|
|
14
|
+
errorIcon?: React.ReactNode;
|
|
15
|
+
showErrorIcon?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
readOnly?: boolean;
|
|
18
|
+
labelClassName?: string;
|
|
19
|
+
labelRowClassName?: string;
|
|
20
|
+
descriptionClassName?: string;
|
|
21
|
+
errorClassName?: string;
|
|
22
|
+
contentClassName?: string;
|
|
23
|
+
};
|
|
24
|
+
export type FormFieldShellControlProps = Pick<FormFieldShellProps, "label" | "description" | "required" | "className" | "layout" | "descriptionPosition" | "labelAction" | "requiredIndicator" | "errorIcon" | "showErrorIcon" | "disabled" | "readOnly" | "labelClassName" | "labelRowClassName" | "descriptionClassName" | "errorClassName" | "contentClassName">;
|
|
25
|
+
declare function FormFieldShell({ className, label, description, error, required, htmlFor, layout, descriptionPosition, labelAction, requiredIndicator, errorIcon, showErrorIcon, disabled, readOnly, labelClassName, labelRowClassName, descriptionClassName, errorClassName, contentClassName, children, ...props }: FormFieldShellProps): React.JSX.Element;
|
|
26
|
+
export { FormFieldShell };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
3
|
+
import { type FormFieldShellControlProps } from "@/components/form/form-field-shell";
|
|
4
|
+
import { Input } from "@/components/ui/input";
|
|
5
|
+
export type FormInputProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<React.ComponentProps<typeof Input>, "name" | "value" | "defaultValue"> & FormFieldShellControlProps & {
|
|
6
|
+
control: Control<TFieldValues>;
|
|
7
|
+
name: TName;
|
|
8
|
+
fieldClassName?: string;
|
|
9
|
+
transformIn?: (value: unknown) => string | number | readonly string[] | undefined;
|
|
10
|
+
transformOut?: (event: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
11
|
+
};
|
|
12
|
+
declare function FormInput<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ control, name, label, description, required, className, layout, descriptionPosition, labelAction, requiredIndicator, errorIcon, showErrorIcon, disabled, readOnly, labelClassName, labelRowClassName, descriptionClassName, errorClassName, contentClassName, fieldClassName, transformIn, transformOut, id, onChange, onBlur, ...props }: FormInputProps<TFieldValues, TName>): React.JSX.Element;
|
|
13
|
+
export { FormInput };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
2
|
+
import { type FormFieldShellProps } from "@/components/form/form-field-shell";
|
|
3
|
+
import { type NumberInputProps } from "@/components/inputs/number-input";
|
|
4
|
+
export type FormNumberInputProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<NumberInputProps, "name" | "value" | "defaultValue" | "onNumberChange"> & Pick<FormFieldShellProps, "label" | "description" | "required" | "className"> & {
|
|
5
|
+
control: Control<TFieldValues>;
|
|
6
|
+
name: TName;
|
|
7
|
+
fieldClassName?: string;
|
|
8
|
+
emptyValue?: unknown;
|
|
9
|
+
onNumberChange?: (value: number | null) => void;
|
|
10
|
+
};
|
|
11
|
+
declare function FormNumberInput<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ control, name, label, description, required, className, fieldClassName, emptyValue, onNumberChange, ...props }: FormNumberInputProps<TFieldValues, TName>): import("react").JSX.Element;
|
|
12
|
+
export { FormNumberInput };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
2
|
+
import { type FormFieldShellProps } from "@/components/form/form-field-shell";
|
|
3
|
+
import { type PasswordInputProps } from "@/components/inputs/password-input";
|
|
4
|
+
export type FormPasswordInputProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<PasswordInputProps, "name" | "value" | "defaultValue" | "onValueChange"> & Pick<FormFieldShellProps, "label" | "description" | "required" | "className"> & {
|
|
5
|
+
control: Control<TFieldValues>;
|
|
6
|
+
name: TName;
|
|
7
|
+
fieldClassName?: string;
|
|
8
|
+
onValueChange?: (value: string) => void;
|
|
9
|
+
};
|
|
10
|
+
declare function FormPasswordInput<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ control, name, label, description, required, className, fieldClassName, onValueChange, ...props }: FormPasswordInputProps<TFieldValues, TName>): import("react").JSX.Element;
|
|
11
|
+
export { FormPasswordInput };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
2
|
+
import { type FormFieldShellProps } from "@/components/form/form-field-shell";
|
|
3
|
+
import { type PhoneInputProps } from "@/components/inputs/phone-input";
|
|
4
|
+
export type FormPhoneInputValueMode = "raw" | "masked";
|
|
5
|
+
export type FormPhoneInputProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<PhoneInputProps, "name" | "value" | "defaultValue" | "onValueChange"> & Pick<FormFieldShellProps, "label" | "description" | "required" | "className"> & {
|
|
6
|
+
control: Control<TFieldValues>;
|
|
7
|
+
name: TName;
|
|
8
|
+
fieldClassName?: string;
|
|
9
|
+
valueMode?: FormPhoneInputValueMode;
|
|
10
|
+
onValueChange?: (value: string, rawValue: string, maskedValue: string) => void;
|
|
11
|
+
};
|
|
12
|
+
declare function FormPhoneInput<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ control, name, label, description, required, className, fieldClassName, valueMode, countryCode, maxDigits, onValueChange, ...props }: FormPhoneInputProps<TFieldValues, TName>): import("react").JSX.Element;
|
|
13
|
+
export { FormPhoneInput };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
2
|
+
import { type FormFieldShellProps } from "@/components/form/form-field-shell";
|
|
3
|
+
import { type SearchInputProps } from "@/components/inputs/search-input";
|
|
4
|
+
export type FormSearchInputProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<SearchInputProps, "name" | "value" | "defaultValue" | "onValueChange"> & Pick<FormFieldShellProps, "label" | "description" | "required" | "className"> & {
|
|
5
|
+
control: Control<TFieldValues>;
|
|
6
|
+
name: TName;
|
|
7
|
+
fieldClassName?: string;
|
|
8
|
+
onValueChange?: (value: string) => void;
|
|
9
|
+
};
|
|
10
|
+
declare function FormSearchInput<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ control, name, label, description, required, className, fieldClassName, onValueChange, ...props }: FormSearchInputProps<TFieldValues, TName>): import("react").JSX.Element;
|
|
11
|
+
export { FormSearchInput };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
2
|
+
import { type FormFieldShellControlProps } from "@/components/form/form-field-shell";
|
|
3
|
+
import { type SimpleSelectProps } from "@/components/inputs/simple-select";
|
|
4
|
+
export type FormSelectProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<SimpleSelectProps, "value" | "onValueChange" | "disabled"> & FormFieldShellControlProps & {
|
|
5
|
+
control: Control<TFieldValues>;
|
|
6
|
+
name: TName;
|
|
7
|
+
fieldClassName?: string;
|
|
8
|
+
emptyValue?: unknown;
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
};
|
|
11
|
+
declare function FormSelect<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ control, name, label, description, required, className, layout, descriptionPosition, labelAction, requiredIndicator, errorIcon, showErrorIcon, disabled, readOnly, labelClassName, labelRowClassName, descriptionClassName, errorClassName, contentClassName, fieldClassName, emptyValue, onValueChange, ...props }: FormSelectProps<TFieldValues, TName>): import("react").JSX.Element;
|
|
12
|
+
export { FormSelect };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
3
|
+
import { type FormFieldShellControlProps } from "@/components/form/form-field-shell";
|
|
4
|
+
import { Switch } from "@/components/ui/switch";
|
|
5
|
+
export type FormSwitchLabelPlacement = "start" | "end";
|
|
6
|
+
export type FormSwitchProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<React.ComponentProps<typeof Switch>, "name" | "checked" | "defaultChecked" | "disabled"> & FormFieldShellControlProps & {
|
|
7
|
+
control: Control<TFieldValues>;
|
|
8
|
+
name: TName;
|
|
9
|
+
fieldClassName?: string;
|
|
10
|
+
labelPlacement?: FormSwitchLabelPlacement;
|
|
11
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
12
|
+
};
|
|
13
|
+
declare function FormSwitch<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ control, name, label, description, required, className, layout, descriptionPosition, labelAction, requiredIndicator, errorIcon, showErrorIcon, disabled, readOnly, labelClassName, labelRowClassName, descriptionClassName, errorClassName, contentClassName, fieldClassName, labelPlacement, id, onCheckedChange, ...props }: FormSwitchProps<TFieldValues, TName>): React.JSX.Element;
|
|
14
|
+
export { FormSwitch };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
3
|
+
import { type FormFieldShellControlProps } from "@/components/form/form-field-shell";
|
|
4
|
+
import { Textarea } from "@/components/ui/textarea";
|
|
5
|
+
export type FormTextareaProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<React.ComponentProps<typeof Textarea>, "name" | "value" | "defaultValue"> & FormFieldShellControlProps & {
|
|
6
|
+
control: Control<TFieldValues>;
|
|
7
|
+
name: TName;
|
|
8
|
+
fieldClassName?: string;
|
|
9
|
+
transformIn?: (value: unknown) => string | number | readonly string[] | undefined;
|
|
10
|
+
transformOut?: (event: React.ChangeEvent<HTMLTextAreaElement>) => unknown;
|
|
11
|
+
};
|
|
12
|
+
declare function FormTextarea<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ control, name, label, description, required, className, layout, descriptionPosition, labelAction, requiredIndicator, errorIcon, showErrorIcon, disabled, readOnly, labelClassName, labelRowClassName, descriptionClassName, errorClassName, contentClassName, fieldClassName, transformIn, transformOut, id, onChange, onBlur, ...props }: FormTextareaProps<TFieldValues, TName>): React.JSX.Element;
|
|
13
|
+
export { FormTextarea };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./form-field-shell";
|
|
2
|
+
export * from "./form-input";
|
|
3
|
+
export * from "./form-select";
|
|
4
|
+
export * from "./form-async-select";
|
|
5
|
+
export * from "./form-textarea";
|
|
6
|
+
export * from "./form-switch";
|
|
7
|
+
export * from "./form-search-input";
|
|
8
|
+
export * from "./form-password-input";
|
|
9
|
+
export * from "./form-number-input";
|
|
10
|
+
export * from "./form-phone-input";
|
|
11
|
+
export * from "./form-date-input";
|
|
12
|
+
export * from "./form-date-range-input";
|
|
13
|
+
export * from "./form-date-picker";
|
|
14
|
+
export * from "./form-date-range-picker";
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type AsyncSelectOption<TValue extends string = string, TData = unknown> = {
|
|
3
|
+
value: TValue;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
data?: TData;
|
|
8
|
+
};
|
|
9
|
+
export type AsyncSelectOptionGroup<TValue extends string = string, TData = unknown, TOption extends AsyncSelectOption<TValue, TData> = AsyncSelectOption<TValue, TData>> = {
|
|
10
|
+
label?: React.ReactNode;
|
|
11
|
+
options: TOption[];
|
|
12
|
+
};
|
|
13
|
+
export type AsyncSelectOptionsResult<TValue extends string = string, TData = unknown, TOption extends AsyncSelectOption<TValue, TData> = AsyncSelectOption<TValue, TData>> = TOption[] | AsyncSelectOptionGroup<TValue, TData, TOption>[];
|
|
14
|
+
export type AsyncSelectRenderState<TValue extends string = string, TData = unknown, TOption extends AsyncSelectOption<TValue, TData> = AsyncSelectOption<TValue, TData>> = {
|
|
15
|
+
search: string;
|
|
16
|
+
minSearchLength: number;
|
|
17
|
+
options: TOption[];
|
|
18
|
+
selectedCount?: number;
|
|
19
|
+
maxSelected?: number;
|
|
20
|
+
};
|
|
21
|
+
export type AsyncSelectStateRenderer<TValue extends string = string, TData = unknown, TOption extends AsyncSelectOption<TValue, TData> = AsyncSelectOption<TValue, TData>> = (state: AsyncSelectRenderState<TValue, TData, TOption>) => React.ReactNode;
|
|
22
|
+
export type AsyncSelectLabels = {
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
searchPlaceholder?: string;
|
|
25
|
+
loading?: string;
|
|
26
|
+
creating?: string;
|
|
27
|
+
empty?: string;
|
|
28
|
+
error?: string;
|
|
29
|
+
clear?: string;
|
|
30
|
+
clearAll?: string;
|
|
31
|
+
selectAll?: string;
|
|
32
|
+
minSearchLength?: (minSearchLength: number) => string;
|
|
33
|
+
maxSelected?: (maxSelected: number) => string;
|
|
34
|
+
selectedCount?: (count: number) => string;
|
|
35
|
+
};
|
|
36
|
+
export type AsyncSelectProps<TValue extends string = string, TData = unknown, TOption extends AsyncSelectOption<TValue, TData> = AsyncSelectOption<TValue, TData>> = Omit<React.ComponentProps<"div">, "onChange"> & {
|
|
37
|
+
value?: TValue;
|
|
38
|
+
selectedOption?: TOption | null;
|
|
39
|
+
onValueChange?: (value: TValue | undefined, option?: TOption) => void;
|
|
40
|
+
loadOptions: (search: string) => Promise<AsyncSelectOptionsResult<TValue, TData, TOption>>;
|
|
41
|
+
loadSelectedOption?: (value: TValue) => Promise<TOption | null | undefined>;
|
|
42
|
+
defaultOptions?: AsyncSelectOptionsResult<TValue, TData, TOption>;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
clearable?: boolean;
|
|
45
|
+
cacheOptions?: boolean;
|
|
46
|
+
cacheTtl?: number;
|
|
47
|
+
debounceMs?: number;
|
|
48
|
+
minSearchLength?: number;
|
|
49
|
+
labels?: AsyncSelectLabels;
|
|
50
|
+
renderOption?: (option: TOption, state: {
|
|
51
|
+
selected: boolean;
|
|
52
|
+
}) => React.ReactNode;
|
|
53
|
+
renderValue?: (option: TOption) => React.ReactNode;
|
|
54
|
+
renderLoading?: AsyncSelectStateRenderer<TValue, TData, TOption>;
|
|
55
|
+
renderEmpty?: AsyncSelectStateRenderer<TValue, TData, TOption>;
|
|
56
|
+
renderError?: AsyncSelectStateRenderer<TValue, TData, TOption>;
|
|
57
|
+
renderMinSearch?: AsyncSelectStateRenderer<TValue, TData, TOption>;
|
|
58
|
+
onCreateOption?: (search: string) => Promise<TOption> | TOption;
|
|
59
|
+
createOptionLabel?: (search: string) => React.ReactNode;
|
|
60
|
+
showCreateOption?: (search: string, options: TOption[]) => boolean;
|
|
61
|
+
triggerClassName?: string;
|
|
62
|
+
contentClassName?: string;
|
|
63
|
+
searchClassName?: string;
|
|
64
|
+
optionClassName?: string;
|
|
65
|
+
};
|
|
66
|
+
export type AsyncMultiSelectProps<TValue extends string = string, TData = unknown, TOption extends AsyncSelectOption<TValue, TData> = AsyncSelectOption<TValue, TData>> = Omit<React.ComponentProps<"div">, "onChange"> & {
|
|
67
|
+
value?: TValue[];
|
|
68
|
+
selectedOptions?: TOption[];
|
|
69
|
+
onValueChange?: (value: TValue[], options: TOption[]) => void;
|
|
70
|
+
loadOptions: (search: string) => Promise<AsyncSelectOptionsResult<TValue, TData, TOption>>;
|
|
71
|
+
loadSelectedOptions?: (values: TValue[]) => Promise<TOption[]>;
|
|
72
|
+
defaultOptions?: AsyncSelectOptionsResult<TValue, TData, TOption>;
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
clearable?: boolean;
|
|
75
|
+
cacheOptions?: boolean;
|
|
76
|
+
cacheTtl?: number;
|
|
77
|
+
closeOnSelect?: boolean;
|
|
78
|
+
debounceMs?: number;
|
|
79
|
+
minSearchLength?: number;
|
|
80
|
+
maxSelected?: number;
|
|
81
|
+
showSelectAll?: boolean;
|
|
82
|
+
labels?: AsyncSelectLabels;
|
|
83
|
+
renderOption?: (option: TOption, state: {
|
|
84
|
+
selected: boolean;
|
|
85
|
+
}) => React.ReactNode;
|
|
86
|
+
renderValue?: (option: TOption) => React.ReactNode;
|
|
87
|
+
renderTag?: (option: TOption, state: {
|
|
88
|
+
remove: () => void;
|
|
89
|
+
}) => React.ReactNode;
|
|
90
|
+
renderLoading?: AsyncSelectStateRenderer<TValue, TData, TOption>;
|
|
91
|
+
renderEmpty?: AsyncSelectStateRenderer<TValue, TData, TOption>;
|
|
92
|
+
renderError?: AsyncSelectStateRenderer<TValue, TData, TOption>;
|
|
93
|
+
renderMinSearch?: AsyncSelectStateRenderer<TValue, TData, TOption>;
|
|
94
|
+
renderMaxSelected?: AsyncSelectStateRenderer<TValue, TData, TOption>;
|
|
95
|
+
onCreateOption?: (search: string) => Promise<TOption> | TOption;
|
|
96
|
+
createOptionLabel?: (search: string) => React.ReactNode;
|
|
97
|
+
showCreateOption?: (search: string, options: TOption[]) => boolean;
|
|
98
|
+
triggerClassName?: string;
|
|
99
|
+
contentClassName?: string;
|
|
100
|
+
searchClassName?: string;
|
|
101
|
+
optionClassName?: string;
|
|
102
|
+
tagClassName?: string;
|
|
103
|
+
};
|
|
104
|
+
declare function AsyncSelect<TValue extends string = string, TData = unknown, TOption extends AsyncSelectOption<TValue, TData> = AsyncSelectOption<TValue, TData>>({ className, value, selectedOption, onValueChange, loadOptions, loadSelectedOption, defaultOptions, disabled, clearable, cacheOptions, cacheTtl, debounceMs, minSearchLength, labels, renderOption, renderValue, renderLoading, renderEmpty, renderError, renderMinSearch, onCreateOption, createOptionLabel, showCreateOption, triggerClassName, contentClassName, searchClassName, optionClassName, ...props }: AsyncSelectProps<TValue, TData, TOption>): React.JSX.Element;
|
|
105
|
+
declare function AsyncMultiSelect<TValue extends string = string, TData = unknown, TOption extends AsyncSelectOption<TValue, TData> = AsyncSelectOption<TValue, TData>>({ className, value, selectedOptions, onValueChange, loadOptions, loadSelectedOptions, defaultOptions, disabled, clearable, cacheOptions, cacheTtl, closeOnSelect, debounceMs, minSearchLength, maxSelected, showSelectAll, labels, renderOption, renderValue, renderTag, renderLoading, renderEmpty, renderError, renderMinSearch, renderMaxSelected, onCreateOption, createOptionLabel, showCreateOption, triggerClassName, contentClassName, searchClassName, optionClassName, tagClassName, ...props }: AsyncMultiSelectProps<TValue, TData, TOption>): React.JSX.Element;
|
|
106
|
+
export { AsyncSelect, AsyncMultiSelect };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Input } from "@/components/ui/input";
|
|
3
|
+
export type ClearableInputProps = Omit<React.ComponentProps<typeof Input>, "value" | "onChange"> & {
|
|
4
|
+
value?: string | number | null;
|
|
5
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
6
|
+
onValueChange?: (value: string) => void;
|
|
7
|
+
onClear?: () => void;
|
|
8
|
+
clearable?: boolean;
|
|
9
|
+
clearLabel?: string;
|
|
10
|
+
leadingIcon?: React.ReactNode;
|
|
11
|
+
trailing?: React.ReactNode;
|
|
12
|
+
wrapperClassName?: string;
|
|
13
|
+
inputClassName?: string;
|
|
14
|
+
};
|
|
15
|
+
declare const ClearableInput: React.ForwardRefExoticComponent<Omit<ClearableInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
16
|
+
export { ClearableInput };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type ComboboxOption<TValue extends string = string> = {
|
|
3
|
+
value: TValue;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
searchValue?: string;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type ComboboxProps<TValue extends string = string> = React.ComponentProps<"div"> & {
|
|
11
|
+
value?: TValue;
|
|
12
|
+
options: ComboboxOption<TValue>[];
|
|
13
|
+
onValueChange?: (value: TValue | undefined, option?: ComboboxOption<TValue>) => void;
|
|
14
|
+
placeholder?: React.ReactNode;
|
|
15
|
+
searchPlaceholder?: string;
|
|
16
|
+
emptyLabel?: React.ReactNode;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare function Combobox<TValue extends string = string>({ value, options, onValueChange, placeholder, searchPlaceholder, emptyLabel, disabled, className, ...props }: ComboboxProps<TValue>): React.JSX.Element;
|
|
20
|
+
export { Combobox };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Input } from "@/components/ui/input";
|
|
3
|
+
export type DateInputProps = Omit<React.ComponentProps<typeof Input>, "type" | "value" | "onChange"> & {
|
|
4
|
+
value?: string | null;
|
|
5
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
6
|
+
onValueChange?: (value: string) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const DateInput: React.ForwardRefExoticComponent<Omit<DateInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
9
|
+
export { DateInput };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type DateInputProps } from "@/components/inputs/date-input";
|
|
3
|
+
export type DateRangeValue = {
|
|
4
|
+
from?: string;
|
|
5
|
+
to?: string;
|
|
6
|
+
};
|
|
7
|
+
export type DateRangeInputProps = Omit<React.ComponentProps<"div">, "onChange"> & {
|
|
8
|
+
value?: DateRangeValue;
|
|
9
|
+
onValueChange?: (value: DateRangeValue) => void;
|
|
10
|
+
fromPlaceholder?: string;
|
|
11
|
+
toPlaceholder?: string;
|
|
12
|
+
fromInputProps?: Omit<DateInputProps, "value" | "onValueChange">;
|
|
13
|
+
toInputProps?: Omit<DateInputProps, "value" | "onValueChange">;
|
|
14
|
+
separator?: React.ReactNode;
|
|
15
|
+
inputClassName?: string;
|
|
16
|
+
};
|
|
17
|
+
declare function DateRangeInput({ className, value, onValueChange, fromPlaceholder, toPlaceholder, fromInputProps, toInputProps, separator, inputClassName, ...props }: DateRangeInputProps): React.JSX.Element;
|
|
18
|
+
export { DateRangeInput };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./simple-select";
|
|
2
|
+
export * from "./async-select";
|
|
3
|
+
export * from "./clearable-input";
|
|
4
|
+
export * from "./search-input";
|
|
5
|
+
export * from "./password-input";
|
|
6
|
+
export * from "./number-input";
|
|
7
|
+
export * from "./date-input";
|
|
8
|
+
export * from "./date-range-input";
|
|
9
|
+
export * from "./money-input";
|
|
10
|
+
export * from "./quantity-input";
|
|
11
|
+
export * from "./masked-input";
|
|
12
|
+
export * from "./phone-input";
|
|
13
|
+
export * from "./tag-input";
|
|
14
|
+
export * from "./combobox";
|