@danxbot/ui 8.0.0 → 10.0.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/dist/index.js +11215 -11735
- package/dist/index.js.map +1 -1
- package/dist/pure.js +110 -172
- package/dist/pure.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/Badge.d.ts +1 -1
- package/dist/types/components/Callout.d.ts +1 -1
- package/dist/types/components/Combobox.d.ts +0 -27
- package/dist/types/components/Dialog.d.ts +3 -3
- package/dist/types/components/Menu.d.ts +10 -45
- package/dist/types/components/ReadMore.d.ts +0 -50
- package/dist/types/components/Table.d.ts +4 -0
- package/dist/types/components/calendar/format.d.ts +1 -3
- package/dist/types/components/chat/Message.d.ts +1 -9
- package/dist/types/components/chat/types.d.ts +0 -1
- package/dist/types/components/overlay-shell.d.ts +18 -0
- package/dist/types/components/rbac/RBACProvider.d.ts +5 -0
- package/dist/types/components/roadmap/OrderedEntityManager.d.ts +41 -0
- package/dist/types/index.d.ts +10 -13
- package/dist/types/lib/icons.d.ts +13 -24
- package/dist/types/lib/pad.d.ts +6 -0
- package/dist/types/lib/syntax/markdown/index.d.ts +1 -1
- package/dist/types/lib/syntax/markdown/parse.d.ts +4 -0
- package/dist/types/lib/values/absent.d.ts +7 -0
- package/dist/types/lib/values/currency.d.ts +1 -1
- package/dist/types/lib/values/index.d.ts +0 -3
- package/dist/types/pure.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types/components/InfiniteScroller.d.ts +0 -34
- package/dist/types/components/PhoneField.d.ts +0 -17
- package/dist/types/components/calendar/index.d.ts +0 -9
- package/dist/types/lib/use-debounced-value.d.ts +0 -22
- package/dist/types/lib/values/email.d.ts +0 -12
- package/dist/types/lib/values/phone.d.ts +0 -68
- package/dist/types/lib/values/url.d.ts +0 -6
package/dist/types/index.d.ts
CHANGED
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import "./styles/lib.css";
|
|
12
12
|
export { Icon, type IconProps, type IconSize, type IconName } from "./components/Icon";
|
|
13
|
-
export {
|
|
13
|
+
export { getIcon, hasIcon, iconNames, type IconNode, type IconNodeChild, } from "./lib/icons";
|
|
14
14
|
export { coreIcons, type CoreIconName } from "./icons/data";
|
|
15
|
-
export { Button,
|
|
15
|
+
export { Button, type ButtonProps } from "./components/Button";
|
|
16
16
|
export { IconButton, type IconButtonProps, type IconButtonVariant, type IconButtonTone, } from "./components/IconButton";
|
|
17
|
-
export { Badge,
|
|
18
|
-
export { Callout,
|
|
17
|
+
export { Badge, type BadgeProps, type BadgeDismiss, } from "./components/Badge";
|
|
18
|
+
export { Callout, type CalloutProps } from "./components/Callout";
|
|
19
19
|
export { Spinner, type SpinnerProps } from "./components/Spinner";
|
|
20
20
|
export { Skeleton, SkeletonText, LoadingOverlay, type SkeletonProps, type SkeletonTextProps, type LoadingOverlayProps, } from "./components/Loading";
|
|
21
21
|
export { ErrorBoundary, type ErrorBoundaryProps } from "./components/ErrorBoundary";
|
|
@@ -31,20 +31,19 @@ export { TriStateSwitch, type TriStateSwitchProps, type TriStateSwitchSize, } fr
|
|
|
31
31
|
export { Dialog, DialogClose, AlertDialog, type DialogProps, type AlertDialogProps, } from "./components/Dialog";
|
|
32
32
|
export { Popover, PopoverClose, Tooltip, TooltipProvider, type PopoverProps, type TooltipProps, } from "./components/Popover";
|
|
33
33
|
export { Toaster, ToastProvider, useToast, type ToasterProps, type ToastProviderProps, type ToastOptions, type ToastTone, } from "./components/Toast";
|
|
34
|
-
export { Menu, MenuItem, MenuGroup, MenuRadioGroup, MenuRadioItem, MenuSeparator,
|
|
34
|
+
export { Menu, MenuItem, MenuGroup, MenuRadioGroup, MenuRadioItem, MenuSeparator, type MenuProps, type MenuItemProps, type MenuItemTone, type MenuGroupProps, type MenuRadioGroupProps, type MenuRadioItemProps, } from "./components/Menu";
|
|
35
35
|
export { ThemeMenu, type ThemeMenuProps } from "./components/ThemeMenu";
|
|
36
36
|
export { AppShell, type AppShellProps, type NavItem, type NavSection, } from "./components/AppShell";
|
|
37
37
|
export { FileUpload, type FileUploadProps, type UploadFile } from "./components/FileUpload";
|
|
38
38
|
export { DatePicker, type DatePickerProps, type DateRange } from "./components/DatePicker";
|
|
39
39
|
export { DateCalendar, type DateCalendarProps } from "./components/DateCalendar";
|
|
40
40
|
export { DateField, DateTimeField, type DateFieldProps, type DateTimeFieldProps, } from "./components/DateField";
|
|
41
|
-
export { PhoneField, type PhoneFieldProps } from "./components/PhoneField";
|
|
42
41
|
export { Tree, type TreeProps, type TreeNode } from "./components/Tree";
|
|
43
42
|
export { CommandPalette, useCommandPalette, type CommandPaletteProps, type CommandItem, } from "./components/CommandPalette";
|
|
44
43
|
export { Slider, type SliderProps, type SliderMark } from "./components/Slider";
|
|
45
44
|
export { NumberInput, type NumberInputProps } from "./components/NumberInput";
|
|
46
45
|
export { OTPInput, type OTPInputProps } from "./components/OTPInput";
|
|
47
|
-
export { Combobox, ComboboxItem, ComboboxGroup, MultiCombobox,
|
|
46
|
+
export { Combobox, ComboboxItem, ComboboxGroup, MultiCombobox, type ComboboxProps, type ComboboxItemProps, type ComboboxGroupProps, type MultiComboboxProps, } from "./components/Combobox";
|
|
48
47
|
export { Select, SelectItem, SelectGroup, SelectSeparator, type SelectProps, type SelectItemProps, type SelectGroupProps, } from "./components/Select";
|
|
49
48
|
export { StatusSelect, type StatusSelectProps, type StatusOption } from "./components/StatusSelect";
|
|
50
49
|
export { Card, CardHeader, CardFooter, type CardProps, type CardHeaderProps, } from "./components/Card";
|
|
@@ -53,7 +52,6 @@ export { Tabs, TabList, Tab, TabPanel, type TabsProps, type TabListProps, type T
|
|
|
53
52
|
export { Accordion, AccordionItem, type AccordionProps, type AccordionItemProps, } from "./components/Accordion";
|
|
54
53
|
export { Breadcrumb, Pagination, type BreadcrumbProps, type PaginationProps, type Crumb, } from "./components/Navigation";
|
|
55
54
|
export { PaginationBar, type PaginationBarProps, type PaginationBarMode, } from "./components/PaginationBar";
|
|
56
|
-
export { InfiniteScroller, type InfiniteScrollerProps, type InfiniteScrollerHandle, } from "./components/InfiniteScroller";
|
|
57
55
|
export { Stepper, stepStatus, stepperProgress, advanceBlockReason, assertSteps, type StepperProps, type Step, type StepStatus, type StepperProgress, } from "./components/stepper";
|
|
58
56
|
export { StatusChecklist, tallyChecklist, type StatusChecklistProps, type ChecklistItem, type ChecklistState, type ChecklistTally, } from "./components/checklist";
|
|
59
57
|
export { Toggle, ToggleGroup, Toolbar, ToolbarButton, ToolbarGroup, ToolbarInput, ToolbarSeparator, type ToggleProps, type ToggleGroupProps, type ToolbarProps, type ToolbarButtonProps, type ToolbarGroupProps, type ToolbarInputProps, } from "./components/Toggle";
|
|
@@ -66,7 +64,7 @@ export { DataTable, TableEmptyState, CellStack, type DataTableProps, type TableD
|
|
|
66
64
|
export { CodeEditor, CodeEditorToolbar, CodeEditorCaption, CodeEditorCopyButton, CodeEditorWrapToggle, CodeEditorViewSwitch, type CodeEditorProps, type CodeEditorToolbarProps, type CodeEditorView, } from "./components/CodeEditor";
|
|
67
65
|
export { Markdown, CodeBlock, type MarkdownProps, type CodeBlockProps } from "./components/Markdown";
|
|
68
66
|
export { MarkdownEditor, type MarkdownEditorProps, type MarkdownEditorHandle, } from "./components/MarkdownEditor";
|
|
69
|
-
export { ReadMore,
|
|
67
|
+
export { ReadMore, type ReadMoreProps } from "./components/ReadMore";
|
|
70
68
|
export { MarkdownSurface, type SurfaceOptions, type Splice } from "./lib/markdown/surface";
|
|
71
69
|
export { project, projectedText, ProjectionError } from "./lib/markdown/project";
|
|
72
70
|
export type { Projection, PNode, PText, PElement } from "./lib/markdown/project";
|
|
@@ -93,9 +91,9 @@ export { DEFAULT_DRAG_STRINGS, DRAG_INSTRUCTIONS_ID, DragInstructions, DragLiveR
|
|
|
93
91
|
export { Board, BoardColumn, BoardCard, BoardCardSurface, type BoardProps, type BoardColumnProps, type BoardCardProps, type BoardCardSurfaceProps, } from "./components/Board";
|
|
94
92
|
export { buildBoardModel, resolveMove, applyBoardMoves, useBoard, type BoardModel, type UseBoardResult, } from "./lib/board";
|
|
95
93
|
export type { BoardAccessors, BoardColumnDef, BoardColumnId, BoardColumnModel, BoardItemId, BoardMove, BoardMoveRequest, BoardMoveSource, BoardMoveVerdict, UseBoardOptions, } from "./lib/board";
|
|
96
|
-
export type { MessageRole, MessagePart,
|
|
94
|
+
export type { MessageRole, MessagePart, TextPart, CodePart, ReasoningPart, ToolPart, ToolStatus, FilePart, ComponentPart, ChatFile, ChatMessage, RenderContext, PartRenderer, PartRenderers, ChatComponentRenderer, ChatComponents, } from "./components/chat/types";
|
|
97
95
|
export { Chat, ChatPopover, type ChatProps, type ChatPopoverProps, type ChatSurface, } from "./components/chat/Chat";
|
|
98
|
-
export { Message, MessagePartView, ToolCall,
|
|
96
|
+
export { Message, MessagePartView, ToolCall, type MessageProps, type MessageAction, type MessagePartViewProps, type ToolCallProps, } from "./components/chat/Message";
|
|
99
97
|
export { MessageScroller, type MessageScrollerProps, } from "./components/chat/MessageScroller";
|
|
100
98
|
export { Composer, type ComposerProps } from "./components/chat/Composer";
|
|
101
99
|
export { StreamingMarkdown, type StreamingMarkdownProps, } from "./components/chat/StreamingMarkdown";
|
|
@@ -105,9 +103,8 @@ export { EffortControl, DEFAULT_EFFORT_LEVELS, type EffortControlProps, type Eff
|
|
|
105
103
|
export { ContextMeter, ChatStatus, type ContextMeterProps, type ContextSegment, type UsageLimit, type ChatStatusProps, } from "./components/chat/ContextMeter";
|
|
106
104
|
export { cn } from "./lib/cn";
|
|
107
105
|
export { formatBytes, formatTokens, formatCompactNumber } from "./lib/format";
|
|
108
|
-
export { formatDate, parseDate, formatDateTime, parseDateTime, type FormatDateTimeOptions, type ParseDateTimeOptions, formatCurrency, parseCurrency,
|
|
106
|
+
export { formatDate, parseDate, formatDateTime, parseDateTime, type FormatDateTimeOptions, type ParseDateTimeOptions, formatCurrency, parseCurrency, formatNumber, parseNumber, type FormatNumberOptions, formatBoolean, parseBoolean, type FormatBooleanOptions, } from "./lib/values";
|
|
109
107
|
export { useFillHeight } from "./lib/use-fill-height";
|
|
110
|
-
export { useDebouncedValue } from "./lib/use-debounced-value";
|
|
111
108
|
export { useTheme, useUiScale, useContrast, useMotionPreference, type Theme, type UiScale, type ContrastPreference, type MotionPreference, } from "./lib/preferences";
|
|
112
109
|
export { usePersistedState, readStored, writeStored, clearStored, storageKey, type PersistedStateOptions, } from "./lib/persist";
|
|
113
110
|
export { CalendarMonth, type CalendarMonthProps } from "./components/calendar/CalendarMonth";
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Icon
|
|
2
|
+
* Icon lookup.
|
|
3
3
|
*
|
|
4
4
|
* Icons are DATA here, not components. A `[tag, attrs]` tuple list is ~100
|
|
5
|
-
* bytes
|
|
6
|
-
*
|
|
5
|
+
* bytes and carries no React overhead — components reference icons BY NAME
|
|
6
|
+
* (`<Icon name="check" />`) and resolve the geometry from `coreIcons` at
|
|
7
|
+
* render.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* shipped as data with no package behind it; anything further is
|
|
16
|
-
* registered by the consumer from whatever set they already use.
|
|
17
|
-
* 3. Names resolve at render, so an icon can be swapped per theme or per
|
|
18
|
-
* brand without re-rendering the tree that uses it.
|
|
9
|
+
* DX-3254: the runtime `registerIcon`/`registerIcons` mutation API this
|
|
10
|
+
* lookup used to expose publicly was removed — zero consumers ever called
|
|
11
|
+
* it (verified by grep across every known consumer repo and this package's
|
|
12
|
+
* own demo before deletion), so the map below is seeded once from
|
|
13
|
+
* `coreIcons` at module load and never mutated afterward. A future need to
|
|
14
|
+
* swap icons at runtime is a new, deliberately-scoped feature to design
|
|
15
|
+
* again, not a resurrection of this one.
|
|
19
16
|
*
|
|
20
17
|
* The core set's geometry is Lucide's (ISC licensed — see src/icons/data.ts),
|
|
21
18
|
* extracted to data at build time so nothing ships at runtime.
|
|
@@ -24,17 +21,9 @@
|
|
|
24
21
|
export type IconNodeChild = readonly [tag: string, attrs: Record<string, string | number>];
|
|
25
22
|
/** An icon's full geometry — the children of a 24x24 `<svg>`. */
|
|
26
23
|
export type IconNode = readonly IconNodeChild[];
|
|
27
|
-
/**
|
|
28
|
-
* Register (or replace) one icon. Replacement is deliberate and unguarded:
|
|
29
|
-
* overriding a core name with a brand's own drawing is the primary reason this
|
|
30
|
-
* registry exists, so it must not require a different call than adding one.
|
|
31
|
-
*/
|
|
32
|
-
export declare function registerIcon(name: string, node: IconNode): void;
|
|
33
|
-
/** Register many at once — the shape a generated icon module exports. */
|
|
34
|
-
export declare function registerIcons(icons: Record<string, IconNode>): void;
|
|
35
|
-
/** Look up an icon, or `undefined` when the name was never registered. */
|
|
24
|
+
/** Look up an icon, or `undefined` when the name is not in the core set. */
|
|
36
25
|
export declare function getIcon(name: string): IconNode | undefined;
|
|
37
|
-
/** Every
|
|
26
|
+
/** Every name in the core set, sorted — powers icon galleries and docs pages. */
|
|
38
27
|
export declare function iconNames(): string[];
|
|
39
28
|
/** True when `name` resolves — for a consumer validating config-driven icons. */
|
|
40
29
|
export declare function hasIcon(name: string): boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Zero-pad a non-negative integer to `width` digits — `pad(9)` → `"09"`,
|
|
2
|
+
* `pad(7, 3)` → `"007"`. Internal only: shared by the time and value
|
|
3
|
+
* formatters that print fixed-width calendar/clock fields, not part of the
|
|
4
|
+
* public package surface (DX-3254 — this one-liner used to be redefined
|
|
5
|
+
* independently in four places). */
|
|
6
|
+
export declare function pad(n: number, width?: number): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { parseMarkdown } from "./parse";
|
|
1
|
+
export { parseMarkdown, RE_FENCE } from "./parse";
|
|
2
2
|
export { markdown } from "./grammar";
|
|
3
3
|
export { MarkdownNodes, sanitizeHref } from "./render";
|
|
4
4
|
export type { MdNode, MdInline, MdListItem, MdCell, MdAlign, MdCodeRenderer } from "./types";
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type Sink } from "./spans";
|
|
2
2
|
import type { MdNode } from "./types";
|
|
3
|
+
/** Exported so any other layer that needs to find the SAME fence boundaries
|
|
4
|
+
the parser itself will — e.g. `StreamingMarkdown`'s pre-parse balancing
|
|
5
|
+
pass — imports this instead of keeping a second copy of the pattern. */
|
|
6
|
+
export declare const RE_FENCE: RegExp;
|
|
3
7
|
/** The renderer's entry point: tree only, no token bookkeeping. */
|
|
4
8
|
export declare function parseMarkdown(source: string): MdNode[];
|
|
5
9
|
/**
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The shared "no value" reading for a blank field — a date, a number, a
|
|
2
|
+
* phone number, a currency amount: nothing recorded. Shared by every
|
|
3
|
+
* formatter that reads absence this way, so the glyph itself never drifts
|
|
4
|
+
* between them (DX-3254). `formatBoolean` does NOT use this — see its own
|
|
5
|
+
* module doc for why a tri-state boolean reads absence as "Unknown"
|
|
6
|
+
* instead. */
|
|
7
|
+
export declare const ABSENT = "\u2014";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `NaN` / `Infinity` are not real amounts either and render as the em dash —
|
|
5
5
|
* grouped with absence rather than with a malformed string, because unlike
|
|
6
|
-
* `formatDate
|
|
6
|
+
* `formatDate`'s malformed-input case, there is no ORIGINAL
|
|
7
7
|
* user-facing string to show back: the caller already has a `number`, and a
|
|
8
8
|
* non-finite one is a computation defect upstream, not a typo to surface.
|
|
9
9
|
*/
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export { formatDate, parseDate } from "./date";
|
|
2
2
|
export { formatDateTime, parseDateTime, type FormatDateTimeOptions, type ParseDateTimeOptions } from "./datetime";
|
|
3
3
|
export { formatCurrency, parseCurrency } from "./currency";
|
|
4
|
-
export { formatPhone, parsePhone, digitsOfPhoneInProgress, formatPhonePartial } from "./phone";
|
|
5
4
|
export { formatNumber, parseNumber, type FormatNumberOptions } from "./number";
|
|
6
5
|
export { formatBoolean, parseBoolean, type FormatBooleanOptions } from "./boolean";
|
|
7
|
-
export { isValidEmail } from "./email";
|
|
8
|
-
export { isValidUrl } from "./url";
|
package/dist/types/pure.d.ts
CHANGED
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
* about this is a migration and no existing import has to change.
|
|
40
40
|
*/
|
|
41
41
|
export { formatBytes, formatTokens, formatCompactNumber } from "./lib/format";
|
|
42
|
-
export { formatDate, parseDate, formatDateTime, parseDateTime, type FormatDateTimeOptions, type ParseDateTimeOptions, formatCurrency, parseCurrency,
|
|
42
|
+
export { formatDate, parseDate, formatDateTime, parseDateTime, type FormatDateTimeOptions, type ParseDateTimeOptions, formatCurrency, parseCurrency, formatNumber, parseNumber, type FormatNumberOptions, formatBoolean, parseBoolean, type FormatBooleanOptions, } from "./lib/values";
|
|
43
43
|
export { confidenceLevel, CONFIDENCE_LEVEL_LABELS, type ConfidenceLevel } from "./lib/confidence";
|
package/package.json
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { type CSSProperties, type Key, type ReactNode, type Ref, type RefObject } from "react";
|
|
2
|
-
export interface InfiniteScrollerHandle {
|
|
3
|
-
/** Mount everything up to `index` (if not already mounted), then scroll that item into view. */
|
|
4
|
-
reveal: (index: number, options?: ScrollIntoViewOptions) => void;
|
|
5
|
-
}
|
|
6
|
-
export interface InfiniteScrollerProps<T> {
|
|
7
|
-
/** Every item. Only a window of them is mounted. */
|
|
8
|
-
items: readonly T[];
|
|
9
|
-
renderItem: (item: T, index: number) => ReactNode;
|
|
10
|
-
/** A stable React key per item. */
|
|
11
|
-
getKey: (item: T, index: number) => Key;
|
|
12
|
-
/** How many items are mounted at first. Default 20. */
|
|
13
|
-
initialCount?: number;
|
|
14
|
-
/** How many more mount each time the end comes into range. Default `initialCount`. */
|
|
15
|
-
batchSize?: number;
|
|
16
|
-
/** Lay items out as a CSS grid with this many equal columns. Omit for a plain vertical list. */
|
|
17
|
-
columns?: number;
|
|
18
|
-
/** How far outside the scroll viewport the end may be before more mount. Default "200px". */
|
|
19
|
-
rootMargin?: string;
|
|
20
|
-
/**
|
|
21
|
-
* The scrolling element to observe against. Default: the nearest ancestor whose `overflow-y`
|
|
22
|
-
* scrolls, else the viewport.
|
|
23
|
-
*/
|
|
24
|
-
root?: RefObject<Element | null>;
|
|
25
|
-
/** Changing this puts the window back to `initialCount` (a genuinely different list). */
|
|
26
|
-
resetKey?: unknown;
|
|
27
|
-
/** Classes for the list/grid element — gaps, padding. */
|
|
28
|
-
className?: string;
|
|
29
|
-
style?: CSSProperties;
|
|
30
|
-
ref?: Ref<InfiniteScrollerHandle>;
|
|
31
|
-
/** Accessible name for the list, when it needs one. */
|
|
32
|
-
"aria-label"?: string;
|
|
33
|
-
}
|
|
34
|
-
export declare function InfiniteScroller<T>({ items, renderItem, getKey, initialCount, batchSize, columns, rootMargin, root, resetKey, className, style, ref, "aria-label": ariaLabel, }: InfiniteScrollerProps<T>): import("react").JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface PhoneFieldProps {
|
|
2
|
-
/** The stored ten-digit form, or null for none. */
|
|
3
|
-
value: string | null;
|
|
4
|
-
/** Reports the new ten-digit value, or null when the person cleared it. Only on commit. */
|
|
5
|
-
onValueChange: (value: string | null) => void;
|
|
6
|
-
/** Told while the box has focus — i.e. while the person's own in-progress digits are on screen. */
|
|
7
|
-
onEditingChange?: (editing: boolean) => void;
|
|
8
|
-
/** The accessible name — required, same reasoning as `DateField`'s. */
|
|
9
|
-
"aria-label": string;
|
|
10
|
-
/** @default "(555) 123-4567" */
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
/** The sentence shown for a committed value that is not ten digits. */
|
|
14
|
-
invalidMessage?: string;
|
|
15
|
-
className?: string;
|
|
16
|
-
}
|
|
17
|
-
export declare function PhoneField({ value, onValueChange, onEditingChange, "aria-label": ariaLabel, placeholder, disabled, invalidMessage, className, }: PhoneFieldProps): import("react").JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { CalendarMonth, type CalendarMonthProps } from "./CalendarMonth";
|
|
2
|
-
export { CalendarTimeGrid, type CalendarTimeGridProps } from "./CalendarTimeGrid";
|
|
3
|
-
export { useNow, type UseNowOptions } from "./use-now";
|
|
4
|
-
export { EventActions, type EventActionsProps } from "./EventActions";
|
|
5
|
-
export { useCalendarDrag, type CalendarDragOptions, type CalendarDragState, } from "./use-calendar-drag";
|
|
6
|
-
export { useEventKeyboard, type EventKeyboardOptions, type EventKeyboardState, } from "./use-event-keyboard";
|
|
7
|
-
export { EVENT_PALETTE, DEFAULT_PALETTE_KEY, isPaletteKey, paletteFor } from "./palette";
|
|
8
|
-
export { cellLabel, dayNumber, eventLabel, formatDateRange, longDate, monthTitle, timeOfDay, weekdayName, zoneLabel, } from "./format";
|
|
9
|
-
export { initialFocusDay, isInMonth, nextDayForKey, useGridNavigation, type GridNavigation, type GridNavigationOptions, } from "./use-grid-navigation";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A value that lags the input by a fixed delay, settling once the input stops
|
|
3
|
-
* changing (SG-833 slice 7).
|
|
4
|
-
*
|
|
5
|
-
* WHY THIS SHAPE, RATHER THAN A DEBOUNCED CALLBACK. gpt-manager's Demand Desk
|
|
6
|
-
* had written `DebouncedSearchField` — a search box holding its own local
|
|
7
|
-
* text state, syncing it back to a controlled `value` after a timeout — as
|
|
8
|
-
* the shared shape behind both of its search boxes. That component still
|
|
9
|
-
* belongs in the app (it also owns the box's markup, its clear button, its
|
|
10
|
-
* re-sync-on-external-change effect), but the debounce INSIDE it is the
|
|
11
|
-
* general-purpose half: take a value that changes on every keystroke, return
|
|
12
|
-
* one that only changes after the keystrokes stop. This hook is that half,
|
|
13
|
-
* usable anywhere a rapidly-changing value needs to drive something
|
|
14
|
-
* expensive (a filter, a server round trip, a live validation) without
|
|
15
|
-
* firing on every change.
|
|
16
|
-
*
|
|
17
|
-
* `delayMs <= 0` updates synchronously on every render rather than arming a
|
|
18
|
-
* zero-length timer — a real `setTimeout(fn, 0)` still yields to the event
|
|
19
|
-
* loop once, which would mean the very first render shows the PREVIOUS value
|
|
20
|
-
* for one paint even when the caller asked for no delay at all.
|
|
21
|
-
*/
|
|
22
|
-
export declare function useDebouncedValue<T>(value: T, delayMs?: number): T;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Whether `value` reads as a plausible email address. An empty (or
|
|
3
|
-
* whitespace-only) value is treated as VALID — clearing the field is not a
|
|
4
|
-
* typo, and a required-field rule belongs to the caller, not this check.
|
|
5
|
-
*
|
|
6
|
-
* SG-909 review fix: the previous regex (`/^[^\s@]+@[^\s@]+\.[^\s@]+$/`)
|
|
7
|
-
* matched the domain half non-specifically, so `"a@b..com"` (an empty label
|
|
8
|
-
* between two dots) passed, and it never looked at trailing punctuation at
|
|
9
|
-
* all, so `"jane@example.com."` and `"jane@example.com,"` — the shape a typo
|
|
10
|
-
* or a sentence's own full stop produces — both passed too.
|
|
11
|
-
*/
|
|
12
|
-
export declare function isValidEmail(value: string): boolean;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ten stored digits → `"(555) 123-4567"`. `null` / `undefined` / `""` → `"—"`.
|
|
3
|
-
*
|
|
4
|
-
* A non-empty value that is not exactly ten digits after parsing is returned
|
|
5
|
-
* UNCHANGED — the same "show the corruption, don't hide it behind absence"
|
|
6
|
-
* rule `formatDate` documents. A stored value should already be `parsePhone`'s
|
|
7
|
-
* output; if it is not, that is a data problem worth seeing in the row, not
|
|
8
|
-
* a blank field that looks like nobody ever entered a number.
|
|
9
|
-
*
|
|
10
|
-
* Reuses `formatPhonePartial` for the ten-digit case (SG-909 review) rather
|
|
11
|
-
* than repeating the same three-slice punctuation a second time — passing it
|
|
12
|
-
* exactly ten digits always produces the identical `"(XXX) XXX-XXXX"` string,
|
|
13
|
-
* since `formatPhonePartial` only ever appends a raw, unformatted tail past
|
|
14
|
-
* the tenth digit and there is no tail here.
|
|
15
|
-
*/
|
|
16
|
-
export declare function formatPhone(value: string | null | undefined): string;
|
|
17
|
-
/**
|
|
18
|
-
* A human-typed phone number → ten stored digits, or `null`.
|
|
19
|
-
*
|
|
20
|
-
* Strips everything but digits, so `"(555) 123-4567"`, `"555.123.4567"`,
|
|
21
|
-
* `"555-123-4567 "` and `"5551234567"` all normalise the same way. A leading
|
|
22
|
-
* US country code (`"1"`, making 11 digits total) is dropped — `"+1 (555)
|
|
23
|
-
* 123-4567"` is the same number as `"(555) 123-4567"` and should be stored
|
|
24
|
-
* identically. Anything that is not exactly 10 digits after that — too few,
|
|
25
|
-
* too many, or an 11-digit number NOT starting with `1` (a foreign number
|
|
26
|
-
* mis-typed into a US field, not a US number with an extra digit) — returns
|
|
27
|
-
* `null` rather than truncating or padding a guess into place.
|
|
28
|
-
*
|
|
29
|
-
* THIS is the one place in the file the 11-digit-leading-`1` rule is written
|
|
30
|
-
* (SG-909 review — it used to also live in `digitsOfPhoneInProgress`, which
|
|
31
|
-
* no longer transforms digits at all; see that function's own doc for why).
|
|
32
|
-
*/
|
|
33
|
-
export declare function parsePhone(input: string): string | null;
|
|
34
|
-
/**
|
|
35
|
-
* Every non-digit stripped — nothing else. `PhoneField` (SG-909) keeps this
|
|
36
|
-
* as ITS state while a person is still typing.
|
|
37
|
-
*
|
|
38
|
-
* Deliberately NOT capped at ten and NOT country-code-aware, unlike an
|
|
39
|
-
* earlier revision of this function. That revision silently dropped every
|
|
40
|
-
* digit past the tenth and stripped a leading `"1"` off an 11-digit run —
|
|
41
|
-
* which meant pasting `"555-123-4567 x12"` or `"44 20 7946 0958"` (a UK
|
|
42
|
-
* number) landed at commit as `parsePhone` accepting whatever ten-or-eleven
|
|
43
|
-
* digits happened to survive the cap, saving a DIFFERENT phone number than
|
|
44
|
-
* the one actually typed, with no error and no visible sign anything had
|
|
45
|
-
* been thrown away. `PhoneField` now keeps the full digit sequence — see its
|
|
46
|
-
* own module comment for how it is FORMATTED (first ten punctuated, any rest
|
|
47
|
-
* appended raw) and how `parsePhone` alone decides, at commit, whether the
|
|
48
|
-
* full sequence resolves to a real ten-digit number.
|
|
49
|
-
*/
|
|
50
|
-
export declare function digitsOfPhoneInProgress(input: string): string;
|
|
51
|
-
/**
|
|
52
|
-
* A digit sequence of any length → what the box shows WHILE TYPING —
|
|
53
|
-
* progressively punctuated as each of the first ten digits lands, with any
|
|
54
|
-
* digit past the tenth appended after a space, UNFORMATTED, rather than
|
|
55
|
-
* silently dropped (SG-909 review). `formatPhone` above is the too-late-to-
|
|
56
|
-
* use-here sibling: it takes the STORED ten-digit form and either renders it
|
|
57
|
-
* or hands back a non-ten-digit value unchanged, which would show a partial
|
|
58
|
-
* number completely unpunctuated until the last digit arrived, and would
|
|
59
|
-
* have nowhere to put an eleventh digit at all.
|
|
60
|
-
*
|
|
61
|
-
* The trailing digits past ten are shown, not hidden, specifically so a
|
|
62
|
-
* too-long paste or a stray extra keystroke stays visible for the person to
|
|
63
|
-
* see and correct — `parsePhone` will refuse anything that is not exactly
|
|
64
|
-
* ten digits (or eleven with a leading `1`) at commit, and a refusal against
|
|
65
|
-
* a box that visibly still has extra digits in it is legible; a refusal
|
|
66
|
-
* against a box that silently ate them is not.
|
|
67
|
-
*/
|
|
68
|
-
export declare function formatPhonePartial(digits: string): string;
|