@overdoser/react-toolkit 0.1.0 → 0.5.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.
Files changed (50) hide show
  1. package/AGENTS.md +26 -0
  2. package/CHANGELOG.md +151 -0
  3. package/README.md +43 -1
  4. package/components/Alert/Alert.d.ts +34 -0
  5. package/components/Alert/index.d.ts +2 -0
  6. package/components/Avatar/Avatar.d.ts +36 -0
  7. package/components/Avatar/index.d.ts +2 -0
  8. package/components/Badge/Badge.d.ts +25 -0
  9. package/components/Badge/index.d.ts +2 -0
  10. package/components/Breadcrumbs/Breadcrumbs.d.ts +44 -0
  11. package/components/Breadcrumbs/index.d.ts +2 -0
  12. package/components/Divider/Divider.d.ts +28 -0
  13. package/components/Divider/index.d.ts +2 -0
  14. package/components/Draggable/Draggable.d.ts +50 -0
  15. package/components/Draggable/index.d.ts +2 -0
  16. package/components/Drawer/Drawer.d.ts +65 -0
  17. package/components/Drawer/index.d.ts +2 -0
  18. package/components/Dropzone/Dropzone.d.ts +50 -0
  19. package/components/Dropzone/index.d.ts +2 -0
  20. package/components/Pagination/Pagination.d.ts +48 -0
  21. package/components/Pagination/index.d.ts +4 -0
  22. package/components/Pagination/paginationRange.d.ts +8 -0
  23. package/components/Skeleton/Skeleton.d.ts +28 -0
  24. package/components/Skeleton/index.d.ts +2 -0
  25. package/components/Spinner/Spinner.d.ts +29 -0
  26. package/components/Spinner/index.d.ts +2 -0
  27. package/components/Tabs/Tabs.d.ts +66 -0
  28. package/components/Tabs/index.d.ts +2 -0
  29. package/components/Timer/Timer.d.ts +103 -0
  30. package/components/Timer/index.d.ts +2 -0
  31. package/components/Toast/Toast.d.ts +82 -0
  32. package/components/Toast/index.d.ts +2 -0
  33. package/components/Toast/toastStore.d.ts +28 -0
  34. package/components/Tooltip/Tooltip.d.ts +38 -0
  35. package/components/Tooltip/index.d.ts +2 -0
  36. package/components/inputs/Checkbox/Checkbox.d.ts +11 -1
  37. package/components/inputs/DatePicker/DatePicker.d.ts +58 -0
  38. package/components/inputs/DatePicker/dateUtils.d.ts +16 -0
  39. package/components/inputs/DatePicker/index.d.ts +2 -0
  40. package/components/inputs/NumberInput/NumberInput.d.ts +41 -0
  41. package/components/inputs/NumberInput/index.d.ts +2 -0
  42. package/components/inputs/Slider/Slider.d.ts +44 -0
  43. package/components/inputs/Slider/index.d.ts +2 -0
  44. package/index.css +1 -1
  45. package/index.d.ts +36 -0
  46. package/index.js +4956 -2805
  47. package/index.layered.css +1 -1
  48. package/llms.txt +275 -1
  49. package/manifest.json +548 -1
  50. package/package.json +1 -1
@@ -0,0 +1,48 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export interface PaginationClasses {
3
+ root: string;
4
+ list: string;
5
+ item: string;
6
+ active: string;
7
+ ellipsis: string;
8
+ control: string;
9
+ }
10
+ export interface PaginationProps extends Omit<ComponentPropsWithRef<'nav'>, 'onChange'> {
11
+ /** Total number of pages. Provide this, or `total` + `pageSize`. */
12
+ count?: number;
13
+ /** Total item count — used with `pageSize` to derive `count`. */
14
+ total?: number;
15
+ /** Items per page — used with `total` to derive `count`. @default 10 */
16
+ pageSize?: number;
17
+ /** Controlled current page (1-based). */
18
+ page?: number;
19
+ /** Uncontrolled initial page (1-based). @default 1 */
20
+ defaultPage?: number;
21
+ /** Called with the new page number. */
22
+ onChange?: (page: number) => void;
23
+ /** Pages always shown at the start and end. @default 1 */
24
+ boundaryCount?: number;
25
+ /** Pages shown on each side of the current page. @default 2 (→ up to 9 chips) */
26
+ siblingCount?: number;
27
+ /** Show the previous/next arrow controls. @default true */
28
+ showPrevNext?: boolean;
29
+ /** Show the jump-to-first/last controls. @default false */
30
+ showFirstLast?: boolean;
31
+ /** Control size. @default 'md' */
32
+ size?: 'sm' | 'md' | 'lg';
33
+ /** Disable all controls. @default false */
34
+ disabled?: boolean;
35
+ /** Accessible label for the nav landmark. @default 'Pagination' */
36
+ label?: string;
37
+ /** Override class names on internal elements. */
38
+ classes?: Partial<PaginationClasses>;
39
+ }
40
+ /**
41
+ * Page navigation with a windowed range and ellipses (e.g. `1 … 6 7 8 9 10 … 99`).
42
+ * With the default `siblingCount={2}` it shows at most 9 page chips.
43
+ *
44
+ * @example
45
+ * <Pagination count={99} page={page} onChange={setPage} />
46
+ * <Pagination total={480} pageSize={20} page={page} onChange={setPage} showFirstLast />
47
+ */
48
+ export declare const Pagination: import('react').ForwardRefExoticComponent<Omit<PaginationProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
@@ -0,0 +1,4 @@
1
+ export { Pagination } from './Pagination';
2
+ export type { PaginationProps, PaginationClasses } from './Pagination';
3
+ export { paginationRange } from './paginationRange';
4
+ export type { PaginationItem } from './paginationRange';
@@ -0,0 +1,8 @@
1
+ export type PaginationItem = number | 'ellipsis';
2
+ /**
3
+ * Builds the windowed page list with ellipses — e.g. with `count=99`, `page=8`,
4
+ * `boundaryCount=1`, `siblingCount=2` → `[1, 'ellipsis', 6, 7, 8, 9, 10, 'ellipsis', 99]`.
5
+ * Mirrors MUI's `usePagination` range logic. The widest output is
6
+ * `boundaryCount*2 + siblingCount*2 + 3` items (two ellipses + current).
7
+ */
8
+ export declare function paginationRange(page: number, count: number, boundaryCount?: number, siblingCount?: number): PaginationItem[];
@@ -0,0 +1,28 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export interface SkeletonClasses {
3
+ root: string;
4
+ line: string;
5
+ }
6
+ export interface SkeletonProps extends Omit<ComponentPropsWithRef<'div'>, 'children'> {
7
+ /** Shape of the placeholder. @default 'text' */
8
+ variant?: 'text' | 'circle' | 'rect';
9
+ /** Explicit width (number → px). Defaults to `100%`. */
10
+ width?: number | string;
11
+ /** Explicit height (number → px). Defaults per variant. */
12
+ height?: number | string;
13
+ /** Shimmer style. @default 'pulse' */
14
+ animation?: 'pulse' | 'wave' | 'none';
15
+ /** For `variant="text"`, render this many stacked lines (the last is shorter). @default 1 */
16
+ lines?: number;
17
+ /** Override class names on internal elements. */
18
+ classes?: Partial<SkeletonClasses>;
19
+ }
20
+ /**
21
+ * Loading placeholder that mimics content while it's fetching. Decorative
22
+ * (`aria-hidden`) — pair the surrounding region with its own loading status.
23
+ *
24
+ * @example
25
+ * <Skeleton variant="text" lines={3} />
26
+ * <Skeleton variant="circle" width={40} height={40} />
27
+ */
28
+ export declare const Skeleton: import('react').ForwardRefExoticComponent<Omit<SkeletonProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ export { Skeleton } from './Skeleton';
2
+ export type { SkeletonProps, SkeletonClasses } from './Skeleton';
@@ -0,0 +1,29 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export interface SpinnerClasses {
3
+ root: string;
4
+ circle: string;
5
+ label: string;
6
+ }
7
+ export interface SpinnerProps extends ComponentPropsWithRef<'span'> {
8
+ /** Spinner size. @default 'md' */
9
+ size?: 'sm' | 'md' | 'lg';
10
+ /** Stroke color. Defaults to `currentColor`, so it inherits the surrounding text color. */
11
+ color?: string;
12
+ /**
13
+ * Accessible label announced to screen readers (visually hidden). Set to an
14
+ * empty string only when an adjacent visible element already labels the busy
15
+ * state. @default 'Loading'
16
+ */
17
+ label?: string;
18
+ /** Override class names on internal elements. */
19
+ classes?: Partial<SpinnerClasses>;
20
+ }
21
+ /**
22
+ * Indeterminate loading spinner. Inherits `currentColor` by default, so it works
23
+ * on any surface (including inside a `Button`).
24
+ *
25
+ * @example
26
+ * <Spinner size="lg" />
27
+ * <Button disabled><Spinner size="sm" label="" /> Saving…</Button>
28
+ */
29
+ export declare const Spinner: import('react').ForwardRefExoticComponent<Omit<SpinnerProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,2 @@
1
+ export { Spinner } from './Spinner';
2
+ export type { SpinnerProps, SpinnerClasses } from './Spinner';
@@ -0,0 +1,66 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ export type TabsOrientation = 'horizontal' | 'vertical';
3
+ export type TabsVariant = 'line' | 'solid' | 'pill';
4
+ export type TabsSize = 'sm' | 'md' | 'lg';
5
+ export interface TabsClasses {
6
+ root: string;
7
+ list: string;
8
+ tab: string;
9
+ panel: string;
10
+ }
11
+ export interface TabsProps extends Omit<ComponentPropsWithRef<'div'>, 'onChange'> {
12
+ /** Controlled active tab value. */
13
+ value?: string;
14
+ /** Uncontrolled initial active tab value. */
15
+ defaultValue?: string;
16
+ /** Called with the new value when the active tab changes. */
17
+ onValueChange?: (value: string) => void;
18
+ /** Layout direction. @default 'horizontal' */
19
+ orientation?: TabsOrientation;
20
+ /** Visual style of the tab list. @default 'line' */
21
+ variant?: TabsVariant;
22
+ /** Tab sizing. @default 'md' */
23
+ size?: TabsSize;
24
+ /** Override class names on internal elements. */
25
+ classes?: Partial<TabsClasses>;
26
+ }
27
+ export interface TabsListProps extends ComponentPropsWithRef<'div'> {
28
+ children?: ReactNode;
29
+ }
30
+ export interface TabsTabProps extends Omit<ComponentPropsWithRef<'button'>, 'value'> {
31
+ /** Identifier linking this tab to its panel. */
32
+ value: string;
33
+ /** Disable selection of this tab. @default false */
34
+ disabled?: boolean;
35
+ children?: ReactNode;
36
+ }
37
+ export interface TabsPanelProps extends ComponentPropsWithRef<'div'> {
38
+ /** Identifier linking this panel to its tab. */
39
+ value: string;
40
+ /**
41
+ * Keep the panel mounted (but hidden) when inactive. Useful to preserve
42
+ * scroll/input state across tab switches. @default false
43
+ */
44
+ keepMounted?: boolean;
45
+ children?: ReactNode;
46
+ }
47
+ /**
48
+ * Accessible tabs. Compose with `Tabs.List`, `Tabs.Tab`, and `Tabs.Panel`.
49
+ * Arrow keys (plus Home/End) move between tabs and activate them; activation is
50
+ * automatic on focus.
51
+ *
52
+ * @example
53
+ * <Tabs defaultValue="overview">
54
+ * <Tabs.List>
55
+ * <Tabs.Tab value="overview">Overview</Tabs.Tab>
56
+ * <Tabs.Tab value="activity">Activity</Tabs.Tab>
57
+ * </Tabs.List>
58
+ * <Tabs.Panel value="overview">…</Tabs.Panel>
59
+ * <Tabs.Panel value="activity">…</Tabs.Panel>
60
+ * </Tabs>
61
+ */
62
+ export declare const Tabs: import('react').ForwardRefExoticComponent<Omit<TabsProps, "ref"> & import('react').RefAttributes<HTMLDivElement>> & {
63
+ List: import('react').ForwardRefExoticComponent<Omit<TabsListProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
64
+ Tab: import('react').ForwardRefExoticComponent<Omit<TabsTabProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
65
+ Panel: import('react').ForwardRefExoticComponent<Omit<TabsPanelProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
66
+ };
@@ -0,0 +1,2 @@
1
+ export { Tabs } from './Tabs';
2
+ export type { TabsProps, TabsListProps, TabsTabProps, TabsPanelProps, TabsClasses, TabsOrientation, TabsVariant, TabsSize, } from './Tabs';
@@ -0,0 +1,103 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ export type TimerMode = 'countdown' | 'stopwatch';
3
+ export type TimerVariant = 'digital' | 'ring' | 'segments';
4
+ export type TimerLabelPlacement = 'top' | 'bottom' | 'left' | 'right';
5
+ export type TimerUnit = 'days' | 'hours' | 'minutes' | 'seconds';
6
+ /** One unit cell of the segmented display. */
7
+ export interface TimerSegment {
8
+ /** Which unit this segment represents. */
9
+ unit: TimerUnit;
10
+ /** Numeric value for the unit. */
11
+ value: number;
12
+ /** Display text (zero-padded except the leading unit). */
13
+ text: string;
14
+ /** Resolved unit label (e.g. `'h'`, `'hours'`). */
15
+ label: ReactNode;
16
+ }
17
+ export interface TimerHandle {
18
+ /** Start (or resume) ticking. */
19
+ start: () => void;
20
+ /** Pause, preserving elapsed time. */
21
+ pause: () => void;
22
+ /** Stop and reset to the initial value. */
23
+ reset: () => void;
24
+ /** Reset then start again. */
25
+ restart: () => void;
26
+ /** Current displayed time, in seconds. */
27
+ getTime: () => number;
28
+ /** Whether the timer is currently running. */
29
+ readonly isRunning: boolean;
30
+ }
31
+ export interface TimerClasses {
32
+ root: string;
33
+ display: string;
34
+ label: string;
35
+ ringTrack: string;
36
+ ringProgress: string;
37
+ segments: string;
38
+ segment: string;
39
+ segmentValue: string;
40
+ segmentLabel: string;
41
+ }
42
+ export interface TimerProps {
43
+ /** Count down to zero, or up from zero. @default 'countdown' */
44
+ mode?: TimerMode;
45
+ /** Countdown length / stopwatch cap, in seconds. Drives ring progress. */
46
+ duration?: number;
47
+ /** Absolute countdown target (`Date` or epoch ms). Overrides `duration`/pause; always counts down. */
48
+ to?: Date | number;
49
+ /** Controlled display time in seconds — makes the timer display-only (no internal clock). */
50
+ value?: number;
51
+ /** Start ticking on mount (uncontrolled). @default true */
52
+ autoStart?: boolean;
53
+ /** Controlled run state. When set, start/pause follow this prop. */
54
+ running?: boolean;
55
+ /** Tick interval in milliseconds. @default 1000 */
56
+ interval?: number;
57
+ /** Visual style: `'digital'` digits, `'ring'` progress circle, or `'segments'` (one boxed cell per unit). @default 'digital' */
58
+ variant?: TimerVariant;
59
+ /** Size of the digits / ring / segments. @default 'md' */
60
+ size?: 'sm' | 'md' | 'lg';
61
+ /** Format the time for display (digital/ring only). Receives whole seconds. */
62
+ format?: (seconds: number) => ReactNode;
63
+ /** Which segments to show (segments variant). Defaults to the smallest set that fits the duration. */
64
+ units?: TimerUnit[];
65
+ /** Default unit-label style for the segments variant. `'short'` → `d/h/m/s`, `'long'` → `days/hours/minutes/seconds` (fixed — no singular/plural switching). @default 'short' */
66
+ unitFormat?: 'long' | 'short';
67
+ /** Override unit labels — a node, or a function of the unit's value (for custom pluralization). */
68
+ unitLabels?: Partial<Record<TimerUnit, ReactNode | ((value: number) => ReactNode)>>;
69
+ /** Built-in segment style. `'boxed'` is a square with the number and the unit below. @default 'boxed' */
70
+ segmentVariant?: 'boxed' | 'plain';
71
+ /** Fully custom segment renderer (segments variant). Overrides `segmentVariant`. */
72
+ renderSegment?: (segment: TimerSegment, index: number) => ReactNode;
73
+ /** Content rendered between segments (e.g. `':'`). */
74
+ segmentSeparator?: ReactNode;
75
+ /** Content shown alongside the timer (e.g. a caption). */
76
+ label?: ReactNode;
77
+ /** Where `label` sits relative to the timer. @default 'bottom' */
78
+ labelPlacement?: TimerLabelPlacement;
79
+ /** Fired once when a countdown reaches zero. */
80
+ onComplete?: () => void;
81
+ /** Fired each tick with the current seconds. */
82
+ onTick?: (seconds: number) => void;
83
+ /** Override class names on internal elements. */
84
+ classes?: Partial<TimerClasses>;
85
+ className?: string;
86
+ style?: CSSProperties;
87
+ 'aria-label'?: string;
88
+ }
89
+ /**
90
+ * A flexible timer: countdown or stopwatch, shown as digits or a progress ring,
91
+ * with an optional attached label. Uncontrolled with `autoStart` + an imperative
92
+ * ref (`start`/`pause`/`reset`/`restart`), or display-only via `value`.
93
+ *
94
+ * @example
95
+ * // Countdown with a caption underneath
96
+ * <Timer mode="countdown" duration={90} label="Time left" onComplete={onDone} />
97
+ *
98
+ * @example
99
+ * // Ring stopwatch driven by a ref
100
+ * const t = useRef<TimerHandle>(null);
101
+ * <Timer ref={t} mode="stopwatch" duration={60} variant="ring" autoStart={false} />
102
+ */
103
+ export declare const Timer: import('react').ForwardRefExoticComponent<TimerProps & import('react').RefAttributes<TimerHandle>>;
@@ -0,0 +1,2 @@
1
+ export { Timer } from './Timer';
2
+ export type { TimerProps, TimerHandle, TimerClasses, TimerMode, TimerVariant, TimerLabelPlacement, TimerUnit, TimerSegment, } from './Timer';
@@ -0,0 +1,82 @@
1
+ import { ReactNode } from 'react';
2
+ export type ToastVariant = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
3
+ export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
4
+ export interface ToastClasses {
5
+ viewport: string;
6
+ toast: string;
7
+ icon: string;
8
+ content: string;
9
+ title: string;
10
+ description: string;
11
+ close: string;
12
+ }
13
+ export interface ToastOptions {
14
+ /** Bold heading line. */
15
+ title?: ReactNode;
16
+ /** Secondary line beneath the title. */
17
+ description?: ReactNode;
18
+ /** Color/semantics. @default 'neutral' */
19
+ variant?: ToastVariant;
20
+ /** Auto-dismiss delay in ms. `0` or `Infinity` keeps it until dismissed. Defaults to the provider's `duration`. */
21
+ duration?: number;
22
+ }
23
+ /** Callable toast trigger with `.dismiss` / `.dismissAll` helpers attached. */
24
+ export interface ToastFn {
25
+ /** Show a toast; returns its id. */
26
+ (options: ToastOptions): string;
27
+ /** Dismiss a specific toast by id. */
28
+ dismiss: (id: string) => void;
29
+ /** Dismiss every visible toast. */
30
+ dismissAll: () => void;
31
+ }
32
+ export interface ToastApi {
33
+ /** Show a toast; returns its id. */
34
+ toast: ToastFn;
35
+ /** Dismiss a specific toast by id. */
36
+ dismiss: (id: string) => void;
37
+ /** Dismiss every visible toast. */
38
+ dismissAll: () => void;
39
+ }
40
+ /**
41
+ * Show a toast from anywhere — no hook or context required, as long as a
42
+ * `<ToastProvider>` is mounted somewhere to render the queue. Returns the new
43
+ * toast's id. Also callable as `toast.dismiss(id)` and `toast.dismissAll()`.
44
+ *
45
+ * @example
46
+ * import { toast } from '@overdoser/react-toolkit';
47
+ * toast({ variant: 'success', title: 'Saved' });
48
+ * const id = toast({ title: 'Uploading…', duration: 0 });
49
+ * toast.dismiss(id);
50
+ */
51
+ export declare const toast: ToastFn;
52
+ /**
53
+ * Returns the same imperative API as the standalone {@link toast}, for callers
54
+ * who prefer a hook. Works anywhere — a `<ToastProvider>` only needs to be
55
+ * mounted somewhere to render the toasts.
56
+ *
57
+ * @example
58
+ * const { toast } = useToast();
59
+ * toast({ variant: 'success', title: 'Saved', description: 'All set.' });
60
+ */
61
+ export declare function useToast(): ToastApi;
62
+ export interface ToastProviderProps {
63
+ children: ReactNode;
64
+ /** Where toasts stack on screen. @default 'top-right' */
65
+ position?: ToastPosition;
66
+ /** Default auto-dismiss delay in ms. @default 5000 */
67
+ duration?: number;
68
+ /** Maximum simultaneously-visible toasts; older ones are dropped. @default 5 */
69
+ max?: number;
70
+ /** Override class names on internal elements. */
71
+ classes?: Partial<ToastClasses>;
72
+ }
73
+ /**
74
+ * Provides the toast queue and renders the viewport (portaled to `document.body`).
75
+ * Wrap your app once, then call {@link useToast} anywhere beneath it.
76
+ *
77
+ * @example
78
+ * <ToastProvider position="bottom-right">
79
+ * <App />
80
+ * </ToastProvider>
81
+ */
82
+ export declare function ToastProvider({ children, position, duration, max, classes, }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { ToastProvider, useToast, toast } from './Toast';
2
+ export type { ToastProviderProps, ToastOptions, ToastApi, ToastFn, ToastClasses, ToastVariant, ToastPosition, } from './Toast';
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from 'react';
2
+ import { ToastOptions, ToastVariant } from './Toast';
3
+ /** A live toast in the store. Resolved (`duration`) and renderable. */
4
+ export interface ToastRecord {
5
+ id: string;
6
+ variant: ToastVariant;
7
+ title?: ReactNode;
8
+ description?: ReactNode;
9
+ duration: number;
10
+ exiting: boolean;
11
+ }
12
+ declare let config: {
13
+ duration: number;
14
+ max: number;
15
+ };
16
+ export declare function subscribeToasts(listener: () => void): () => void;
17
+ export declare function getToasts(): ToastRecord[];
18
+ export declare function getServerToasts(): ToastRecord[];
19
+ /** A mounted provider sets the active defaults (duration/max). */
20
+ export declare function configureToasts(next: Partial<typeof config>): void;
21
+ /** Track provider lifecycle so we can warn when toasts fire with nothing rendering them. */
22
+ export declare function registerProvider(): () => void;
23
+ export declare function addToast(options: ToastOptions): string;
24
+ export declare function dismissToast(id: string): void;
25
+ export declare function dismissAllToasts(): void;
26
+ /** Test-only: wipe state and pending timers back to defaults. */
27
+ export declare function resetToastStore(): void;
28
+ export {};
@@ -0,0 +1,38 @@
1
+ import { ReactNode } from 'react';
2
+ export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
3
+ export interface TooltipClasses {
4
+ wrapper: string;
5
+ tooltip: string;
6
+ arrow: string;
7
+ }
8
+ export interface TooltipProps {
9
+ /** The tooltip text/content. If empty/nullish, the tooltip never shows. */
10
+ content: ReactNode;
11
+ /** The trigger element(s). Wrapped in an inline span that owns hover/focus. */
12
+ children: ReactNode;
13
+ /** Preferred side. Flips to the opposite side if it would overflow. @default 'top' */
14
+ placement?: TooltipPlacement;
15
+ /** Delay before showing, in ms. @default 300 */
16
+ delay?: number;
17
+ /** Delay before hiding, in ms. @default 0 */
18
+ closeDelay?: number;
19
+ /** Disable the tooltip entirely. @default false */
20
+ disabled?: boolean;
21
+ /** Hide the little arrow. @default false */
22
+ hideArrow?: boolean;
23
+ /** Override class names on internal elements. */
24
+ classes?: Partial<TooltipClasses>;
25
+ }
26
+ /**
27
+ * Lightweight text tooltip shown on hover/focus after a short delay. For rich,
28
+ * interactive, click-triggered content use `Popover` instead.
29
+ *
30
+ * @example
31
+ * <Tooltip content="Copy to clipboard">
32
+ * <button aria-label="Copy">⧉</button>
33
+ * </Tooltip>
34
+ */
35
+ export declare function Tooltip({ content, children, placement, delay, closeDelay, disabled, hideArrow, classes, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare namespace Tooltip {
37
+ var displayName: string;
38
+ }
@@ -0,0 +1,2 @@
1
+ export { Tooltip } from './Tooltip';
2
+ export type { TooltipProps, TooltipClasses, TooltipPlacement } from './Tooltip';
@@ -7,7 +7,13 @@ export interface CheckboxClasses {
7
7
  export interface CheckboxProps extends ComponentPropsWithRef<'input'> {
8
8
  /** Visible label rendered next to the box. */
9
9
  label?: ReactNode;
10
- /** Sets the DOM `indeterminate` property; visually distinct from checked/unchecked. @default false */
10
+ /**
11
+ * Visual style of the control. `'switch'` renders a sliding toggle instead of
12
+ * a box; the underlying `<input type="checkbox">` (and its a11y/form behavior)
13
+ * is identical. `indeterminate` only applies to `'checkbox'`. @default 'checkbox'
14
+ */
15
+ variant?: 'checkbox' | 'switch';
16
+ /** Sets the DOM `indeterminate` property; visually distinct from checked/unchecked. Ignored when `variant="switch"`. @default false */
11
17
  indeterminate?: boolean;
12
18
  /** Override class names on internal elements. */
13
19
  classes?: Partial<CheckboxClasses>;
@@ -22,5 +28,9 @@ export interface CheckboxProps extends ComponentPropsWithRef<'input'> {
22
28
  * checked={remember}
23
29
  * onChange={(e) => setRemember(e.target.checked)}
24
30
  * />
31
+ *
32
+ * @example
33
+ * // Toggle-switch style
34
+ * <Checkbox variant="switch" label="Notifications" defaultChecked />
25
35
  */
26
36
  export declare const Checkbox: import('react').ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,58 @@
1
+ import { CSSProperties } from 'react';
2
+ export interface DatePickerClasses {
3
+ root: string;
4
+ input: string;
5
+ icon: string;
6
+ popover: string;
7
+ header: string;
8
+ nav: string;
9
+ grid: string;
10
+ day: string;
11
+ daySelected: string;
12
+ dayToday: string;
13
+ dayOutside: string;
14
+ }
15
+ export interface DatePickerProps {
16
+ /** Controlled selected date (`null` for empty). */
17
+ value?: Date | null;
18
+ /** Uncontrolled initial date. */
19
+ defaultValue?: Date | null;
20
+ /** Called with the newly selected date. */
21
+ onChange?: (date: Date | null) => void;
22
+ /** Earliest selectable date (inclusive). */
23
+ min?: Date;
24
+ /** Latest selectable date (inclusive). */
25
+ max?: Date;
26
+ /** Predicate to disable arbitrary days. */
27
+ disabledDate?: (date: Date) => boolean;
28
+ /** First day of the week (0 = Sunday). @default 0 */
29
+ weekStartsOn?: number;
30
+ /** BCP-47 locale for month/weekday names and default formatting. */
31
+ locale?: string;
32
+ /** Format the selected date for the input. Defaults to a localized medium date. */
33
+ format?: (date: Date) => string;
34
+ /** Placeholder when no date is selected. @default 'Select date' */
35
+ placeholder?: string;
36
+ /** Toolkit size scale. @default 'md' */
37
+ inputSize?: 'sm' | 'md' | 'lg';
38
+ /** Apply error styling. @default false */
39
+ error?: boolean;
40
+ /** Disable the field. @default false */
41
+ disabled?: boolean;
42
+ /** Render the calendar in a portal at `document.body` (escapes overflow). @default true */
43
+ portal?: boolean;
44
+ /** Override class names on internal elements. */
45
+ classes?: Partial<DatePickerClasses>;
46
+ className?: string;
47
+ style?: CSSProperties;
48
+ 'aria-label'?: string;
49
+ }
50
+ /**
51
+ * Date input with a pop-up calendar. Single date selection with full keyboard
52
+ * support (arrows move days, PageUp/Down change month, Enter selects, Esc
53
+ * closes). Binds inside `FormField` (`value: Date | null` / `onChange`).
54
+ *
55
+ * @example
56
+ * <DatePicker value={date} onChange={setDate} min={new Date()} />
57
+ */
58
+ export declare const DatePicker: import('react').ForwardRefExoticComponent<DatePickerProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,16 @@
1
+ /** Date helpers for the calendar. All operate on local time, day granularity. */
2
+ export declare function startOfDay(d: Date): Date;
3
+ export declare function isSameDay(a: Date | null | undefined, b: Date | null | undefined): boolean;
4
+ export declare function isSameMonth(a: Date, b: Date): boolean;
5
+ export declare function addDays(d: Date, n: number): Date;
6
+ export declare function addMonths(d: Date, n: number): Date;
7
+ export declare function startOfMonth(d: Date): Date;
8
+ /** ISO `YYYY-MM-DD` of the local date — stable key/identifier for a day. */
9
+ export declare function toISODate(d: Date): string;
10
+ /**
11
+ * The 6×7 grid of days covering the month of `viewDate`, starting each week on
12
+ * `weekStartsOn` (0 = Sunday). Always 42 cells so the calendar height is stable.
13
+ */
14
+ export declare function buildCalendarDays(viewDate: Date, weekStartsOn: number): Date[];
15
+ /** Short weekday labels ordered from `weekStartsOn`, localized. */
16
+ export declare function weekdayLabels(locale: string | undefined, weekStartsOn: number): string[];
@@ -0,0 +1,2 @@
1
+ export { DatePicker } from './DatePicker';
2
+ export type { DatePickerProps, DatePickerClasses } from './DatePicker';
@@ -0,0 +1,41 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export interface NumberInputClasses {
3
+ root: string;
4
+ input: string;
5
+ controls: string;
6
+ increment: string;
7
+ decrement: string;
8
+ }
9
+ export interface NumberInputProps extends Omit<ComponentPropsWithRef<'input'>, 'value' | 'defaultValue' | 'onChange' | 'min' | 'max' | 'step' | 'prefix'> {
10
+ /** Controlled numeric value (`null` when empty). */
11
+ value?: number | null;
12
+ /** Uncontrolled initial value. */
13
+ defaultValue?: number | null;
14
+ /** Called with the parsed value (`null` when the field is empty). */
15
+ onChange?: (value: number | null) => void;
16
+ /** Minimum allowed value. */
17
+ min?: number;
18
+ /** Maximum allowed value. */
19
+ max?: number;
20
+ /** Increment/decrement step. @default 1 */
21
+ step?: number;
22
+ /** Decimal places to round to on commit. */
23
+ precision?: number;
24
+ /** Toolkit size scale. @default 'md' */
25
+ inputSize?: 'sm' | 'md' | 'lg';
26
+ /** Apply error styling. @default false */
27
+ error?: boolean;
28
+ /** Hide the stepper buttons. @default false */
29
+ hideControls?: boolean;
30
+ /** Override class names on internal elements. */
31
+ classes?: Partial<NumberInputClasses>;
32
+ }
33
+ /**
34
+ * Numeric input with stepper buttons, min/max clamping, and keyboard
35
+ * arrow-key stepping. Emits `onChange(value: number | null)`, so it binds
36
+ * directly inside `FormField`.
37
+ *
38
+ * @example
39
+ * <NumberInput value={qty} onChange={setQty} min={0} max={99} />
40
+ */
41
+ export declare const NumberInput: import('react').ForwardRefExoticComponent<Omit<NumberInputProps, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,2 @@
1
+ export { NumberInput } from './NumberInput';
2
+ export type { NumberInputProps, NumberInputClasses } from './NumberInput';