@danxbot/ui 7.2.0 → 7.3.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.
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const startOfDay: (d: Date) => Date;
|
|
2
|
+
export type DateRange = {
|
|
3
|
+
from: Date | null;
|
|
4
|
+
to: Date | null;
|
|
5
|
+
};
|
|
6
|
+
export interface DateCalendarProps {
|
|
7
|
+
/** A single date, or a range when `range` is set. */
|
|
8
|
+
value?: Date | DateRange | null;
|
|
9
|
+
onValueChange?: (value: Date | DateRange | null) => void;
|
|
10
|
+
range?: boolean;
|
|
11
|
+
min?: Date;
|
|
12
|
+
max?: Date;
|
|
13
|
+
/** Disable specific days — weekends, holidays, taken slots. */
|
|
14
|
+
isDateDisabled?: (date: Date) => boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function DateCalendar({ value, onValueChange, range, min, max, isDateDisabled, className, }: DateCalendarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface DateFieldProps {
|
|
2
|
+
/** The stored ISO calendar date (`YYYY-MM-DD`), or null for none. */
|
|
3
|
+
value: string | null;
|
|
4
|
+
/** Reports the new ISO date, or null when the person cleared it. Only on commit. */
|
|
5
|
+
onValueChange: (value: string | null) => void;
|
|
6
|
+
/** Told when the box gains and loses focus — i.e. while the person's own text is on screen. */
|
|
7
|
+
onEditingChange?: (editing: boolean) => void;
|
|
8
|
+
/** The accessible name. Required: a date box with no name is a box nobody can find. */
|
|
9
|
+
"aria-label": string;
|
|
10
|
+
/** @default "MM/DD/YYYY" */
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** The sentence shown for typed text that is not a date. */
|
|
14
|
+
invalidMessage?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function DateField({ value, onValueChange, onEditingChange, "aria-label": ariaLabel, placeholder, disabled, invalidMessage, className, }: DateFieldProps): import("react").JSX.Element;
|
|
18
|
+
export interface DateTimeFieldProps {
|
|
19
|
+
/** The stored ISO instant, or null for none. */
|
|
20
|
+
value: string | null;
|
|
21
|
+
/** Reports the new ISO instant, or null when the date was cleared. Only on commit. */
|
|
22
|
+
onValueChange: (value: string | null) => void;
|
|
23
|
+
/** Told while either half has focus. */
|
|
24
|
+
onEditingChange?: (editing: boolean) => void;
|
|
25
|
+
"aria-label": string;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function DateTimeField({ value, onValueChange, onEditingChange, "aria-label": ariaLabel, disabled, className, }: DateTimeFieldProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
to: Date | null;
|
|
4
|
-
};
|
|
1
|
+
import { type DateRange } from "./DateCalendar";
|
|
2
|
+
export type { DateRange };
|
|
5
3
|
export interface DatePickerProps {
|
|
6
4
|
/** A single date, or a range when `range` is set. */
|
|
7
5
|
value?: Date | DateRange | null;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export { ThemeMenu, type ThemeMenuProps } from "./components/ThemeMenu";
|
|
|
35
35
|
export { AppShell, type AppShellProps, type NavItem, type NavSection, } from "./components/AppShell";
|
|
36
36
|
export { FileUpload, type FileUploadProps, type UploadFile } from "./components/FileUpload";
|
|
37
37
|
export { DatePicker, type DatePickerProps, type DateRange } from "./components/DatePicker";
|
|
38
|
+
export { DateCalendar, type DateCalendarProps } from "./components/DateCalendar";
|
|
39
|
+
export { DateField, DateTimeField, type DateFieldProps, type DateTimeFieldProps, } from "./components/DateField";
|
|
38
40
|
export { Tree, type TreeProps, type TreeNode } from "./components/Tree";
|
|
39
41
|
export { CommandPalette, useCommandPalette, type CommandPaletteProps, type CommandItem, } from "./components/CommandPalette";
|
|
40
42
|
export { Slider, type SliderProps, type SliderMark } from "./components/Slider";
|