@mithrl/design-system 0.3.0 → 0.4.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/components/approval-card/ApprovalCard.d.ts +70 -0
- package/dist/components/code-block/CodeBlock.d.ts +64 -0
- package/dist/components/command-search/CommandSearch.d.ts +57 -0
- package/dist/components/context-cards/ContextCards.d.ts +53 -0
- package/dist/components/disclosure/Disclosure.d.ts +38 -0
- package/dist/components/field-message/FieldMessage.d.ts +12 -0
- package/dist/components/filter-table/FilterTable.d.ts +61 -0
- package/dist/components/flap-text/FlapText.d.ts +68 -0
- package/dist/components/flowchart/Flowchart.d.ts +140 -0
- package/dist/components/global-app-bar/GlobalAppBar.d.ts +14 -4
- package/dist/components/icon-swap/IconSwap.d.ts +30 -0
- package/dist/components/insight-cards/InsightCards.d.ts +97 -0
- package/dist/components/number-flow/NumberFlow.d.ts +93 -0
- package/dist/components/progress-indicator/ProgressIndicator.d.ts +9 -1
- package/dist/components/prompt-bar/PromptBar.d.ts +103 -0
- package/dist/components/recommendation-card/RecommendationCard.d.ts +77 -0
- package/dist/components/records-table/RecordsTable.d.ts +87 -0
- package/dist/components/resizable-panels/ResizablePanels.d.ts +22 -0
- package/dist/components/selection-actions/SelectionActions.d.ts +72 -0
- package/dist/components/skeleton-reveal/SkeletonReveal.d.ts +33 -0
- package/dist/components/status-orb/StatusOrb.d.ts +51 -0
- package/dist/components/streaming-text/StreamingText.d.ts +85 -0
- package/dist/components/task-rows/TaskRows.d.ts +77 -0
- package/dist/components/upload-queue/UploadQueue.d.ts +10 -0
- package/dist/index.d.ts +41 -1
- package/dist/index.js +5041 -1845
- package/dist/internal/useStaggerBatch.d.ts +22 -0
- package/dist/patterns/notifications/Notifications.d.ts +159 -0
- package/dist/patterns/workspace-app-shell/WorkspaceAppShell.d.ts +50 -0
- package/dist/styles.css +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Highest stagger step any one batch may reach.
|
|
3
|
+
*
|
|
4
|
+
* A stagger only helps while the eye can still count the arrivals. Past a
|
|
5
|
+
* handful of steps it stops reading as "several things arrived" and starts
|
|
6
|
+
* reading as "this list is slow", so every item beyond the cap shares the last
|
|
7
|
+
* delay instead of extending the tail. Twelve rows land within
|
|
8
|
+
* `--motion-stagger-tight * 5` of each other, not half a second apart.
|
|
9
|
+
*/
|
|
10
|
+
export declare const STAGGER_BATCH_MAX_STEPS = 5;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the stagger step for each id that arrived in *this* batch.
|
|
13
|
+
*
|
|
14
|
+
* Only items that appeared together are staggered. An item added on its own
|
|
15
|
+
* later gets step 0 and enters immediately, because a lone arrival has no
|
|
16
|
+
* group for the eye to order — delaying it would be latency with nothing to
|
|
17
|
+
* show for it.
|
|
18
|
+
*
|
|
19
|
+
* The first render counts as a batch, so a list that mounts already populated
|
|
20
|
+
* still staggers.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useStaggerBatch(ids: readonly string[], maxSteps?: number): ReadonlyMap<string, number>;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Toast } from "@base-ui/react/toast";
|
|
2
|
+
import { type LucideIcon } from "lucide-react";
|
|
3
|
+
import { type ComponentPropsWithoutRef, type HTMLAttributes, type ReactNode } from "react";
|
|
4
|
+
import { DialogPortal } from "../../components/dialog/Dialog";
|
|
5
|
+
import { type IconButtonProps } from "../../components/icon-button/IconButton";
|
|
6
|
+
|
|
7
|
+
export type NotificationTone = "success" | "failure" | "information" | "neutral" | "needs-you";
|
|
8
|
+
export type NotificationFilter = "all" | "needs-you";
|
|
9
|
+
export type NotificationItemPreviewState = "default" | "hover" | "focus";
|
|
10
|
+
export type NotificationRecord = {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
metadata: string;
|
|
14
|
+
tone: NotificationTone;
|
|
15
|
+
glyph?: LucideIcon;
|
|
16
|
+
unread: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type NotificationStatusIconProps = Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
19
|
+
tone: NotificationTone;
|
|
20
|
+
glyph?: LucideIcon;
|
|
21
|
+
};
|
|
22
|
+
/** Decorative semantic signal. The notification title carries the meaning. */
|
|
23
|
+
export declare const NotificationStatusIcon: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
24
|
+
tone: NotificationTone;
|
|
25
|
+
glyph?: LucideIcon;
|
|
26
|
+
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
27
|
+
export type NotificationItemProps = Omit<HTMLAttributes<HTMLLIElement>, "children" | "onSelect"> & {
|
|
28
|
+
notification: NotificationRecord;
|
|
29
|
+
onSelect?: (notification: NotificationRecord) => void;
|
|
30
|
+
onMarkRead?: (notification: NotificationRecord) => void;
|
|
31
|
+
onArchive?: (notification: NotificationRecord) => void;
|
|
32
|
+
previewState?: NotificationItemPreviewState;
|
|
33
|
+
};
|
|
34
|
+
/** Controlled inbox row. It never mutates read or archive state internally. */
|
|
35
|
+
export declare const NotificationItem: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLLIElement>, "children" | "onSelect"> & {
|
|
36
|
+
notification: NotificationRecord;
|
|
37
|
+
onSelect?: (notification: NotificationRecord) => void;
|
|
38
|
+
onMarkRead?: (notification: NotificationRecord) => void;
|
|
39
|
+
onArchive?: (notification: NotificationRecord) => void;
|
|
40
|
+
previewState?: NotificationItemPreviewState;
|
|
41
|
+
} & import("react").RefAttributes<HTMLLIElement>>;
|
|
42
|
+
export type NotificationTriggerProps = Omit<IconButtonProps, "icon" | "aria-label" | "children"> & {
|
|
43
|
+
unreadCount?: number;
|
|
44
|
+
label?: string;
|
|
45
|
+
};
|
|
46
|
+
/** Bell trigger with an accessible unread count and DS Tooltip. */
|
|
47
|
+
export declare const NotificationTrigger: import("react").ForwardRefExoticComponent<Omit<IconButtonProps, "aria-label" | "children" | "icon"> & {
|
|
48
|
+
unreadCount?: number;
|
|
49
|
+
label?: string;
|
|
50
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
51
|
+
export type NotificationCenterProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onSelect"> & {
|
|
52
|
+
notifications: readonly NotificationRecord[];
|
|
53
|
+
filter?: NotificationFilter;
|
|
54
|
+
defaultFilter?: NotificationFilter;
|
|
55
|
+
onFilterChange?: (filter: NotificationFilter) => void;
|
|
56
|
+
onItemSelect?: (notification: NotificationRecord) => void;
|
|
57
|
+
onMarkRead?: (notification: NotificationRecord) => void;
|
|
58
|
+
onArchive?: (notification: NotificationRecord) => void;
|
|
59
|
+
onMarkAllRead?: () => void;
|
|
60
|
+
onClearRead?: () => void;
|
|
61
|
+
onOpenSettings?: () => void;
|
|
62
|
+
onClose?: () => void;
|
|
63
|
+
closeAction?: ReactNode;
|
|
64
|
+
emptyContent?: ReactNode;
|
|
65
|
+
titleId?: string;
|
|
66
|
+
};
|
|
67
|
+
/** Global, controlled inbox surface. */
|
|
68
|
+
export declare const NotificationCenter: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children" | "onSelect"> & {
|
|
69
|
+
notifications: readonly NotificationRecord[];
|
|
70
|
+
filter?: NotificationFilter;
|
|
71
|
+
defaultFilter?: NotificationFilter;
|
|
72
|
+
onFilterChange?: (filter: NotificationFilter) => void;
|
|
73
|
+
onItemSelect?: (notification: NotificationRecord) => void;
|
|
74
|
+
onMarkRead?: (notification: NotificationRecord) => void;
|
|
75
|
+
onArchive?: (notification: NotificationRecord) => void;
|
|
76
|
+
onMarkAllRead?: () => void;
|
|
77
|
+
onClearRead?: () => void;
|
|
78
|
+
onOpenSettings?: () => void;
|
|
79
|
+
onClose?: () => void;
|
|
80
|
+
closeAction?: ReactNode;
|
|
81
|
+
emptyContent?: ReactNode;
|
|
82
|
+
titleId?: string;
|
|
83
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
84
|
+
export type NotificationsDrawerProps = {
|
|
85
|
+
notifications: readonly NotificationRecord[];
|
|
86
|
+
unreadCount?: number;
|
|
87
|
+
open?: boolean;
|
|
88
|
+
defaultOpen?: boolean;
|
|
89
|
+
onOpenChange?: (open: boolean) => void;
|
|
90
|
+
dir?: "ltr" | "rtl";
|
|
91
|
+
portalContainer?: ComponentPropsWithoutRef<typeof DialogPortal>["container"];
|
|
92
|
+
triggerProps?: Omit<NotificationTriggerProps, "unreadCount">;
|
|
93
|
+
centerProps?: Omit<NotificationCenterProps, "notifications" | "closeAction" | "titleId">;
|
|
94
|
+
};
|
|
95
|
+
/** Trigger + modal floating drawer behavior for the global inbox. */
|
|
96
|
+
export declare function NotificationsDrawer({ notifications, unreadCount, open, defaultOpen, onOpenChange, dir, portalContainer, triggerProps, centerProps, }: NotificationsDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
97
|
+
export type NotificationToastProps = Omit<HTMLAttributes<HTMLDivElement>, "title" | "children"> & {
|
|
98
|
+
tone: NotificationTone;
|
|
99
|
+
glyph?: LucideIcon;
|
|
100
|
+
heading: ReactNode;
|
|
101
|
+
description?: ReactNode;
|
|
102
|
+
action?: ReactNode;
|
|
103
|
+
onDismiss?: () => void;
|
|
104
|
+
dismissLabel?: string;
|
|
105
|
+
closeAction?: ReactNode;
|
|
106
|
+
};
|
|
107
|
+
/** Visual toast surface. Lifecycle and announcements belong to the provider. */
|
|
108
|
+
export declare const NotificationToast: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children" | "title"> & {
|
|
109
|
+
tone: NotificationTone;
|
|
110
|
+
glyph?: LucideIcon;
|
|
111
|
+
heading: ReactNode;
|
|
112
|
+
description?: ReactNode;
|
|
113
|
+
action?: ReactNode;
|
|
114
|
+
onDismiss?: () => void;
|
|
115
|
+
dismissLabel?: string;
|
|
116
|
+
closeAction?: ReactNode;
|
|
117
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
118
|
+
export type NotificationToastData = {
|
|
119
|
+
tone: NotificationTone;
|
|
120
|
+
glyph?: LucideIcon;
|
|
121
|
+
dismissLabel?: string;
|
|
122
|
+
actionAriaLabel?: string;
|
|
123
|
+
};
|
|
124
|
+
export type NotificationToastOptions = {
|
|
125
|
+
id?: string;
|
|
126
|
+
tone: NotificationTone;
|
|
127
|
+
glyph?: LucideIcon;
|
|
128
|
+
dismissLabel?: string;
|
|
129
|
+
actionAriaLabel?: string;
|
|
130
|
+
title: ReactNode;
|
|
131
|
+
description?: ReactNode;
|
|
132
|
+
actionLabel?: ReactNode;
|
|
133
|
+
onAction?: () => void;
|
|
134
|
+
timeout?: number;
|
|
135
|
+
priority?: "low" | "high";
|
|
136
|
+
onClose?: () => void;
|
|
137
|
+
onRemove?: () => void;
|
|
138
|
+
};
|
|
139
|
+
export type NotificationToastProviderProps = {
|
|
140
|
+
children: ReactNode;
|
|
141
|
+
timeout?: number;
|
|
142
|
+
limit?: number;
|
|
143
|
+
toastManager?: ComponentPropsWithoutRef<typeof Toast.Provider>["toastManager"];
|
|
144
|
+
};
|
|
145
|
+
export declare function NotificationToastProvider({ children, timeout, limit, toastManager, }: NotificationToastProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
146
|
+
export declare function useNotificationToast(): {
|
|
147
|
+
add: ({ tone, glyph, dismissLabel, actionAriaLabel, title, description, actionLabel, onAction, timeout, priority, ...options }: NotificationToastOptions) => string;
|
|
148
|
+
close: (toastId?: string) => void;
|
|
149
|
+
update: <T extends NotificationToastData = NotificationToastData>(toastId: string, options: import("@base-ui/react").ToastManagerUpdateOptions<T>) => void;
|
|
150
|
+
toasts: import("@base-ui/react").ToastObject<NotificationToastData>[];
|
|
151
|
+
};
|
|
152
|
+
export type NotificationToastViewportProps = Omit<ComponentPropsWithoutRef<typeof Toast.Viewport>, "children" | "className"> & {
|
|
153
|
+
portalContainer?: ComponentPropsWithoutRef<typeof Toast.Portal>["container"];
|
|
154
|
+
className?: string;
|
|
155
|
+
};
|
|
156
|
+
export declare const NotificationToastViewport: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").ToastViewportProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">, "children" | "className"> & {
|
|
157
|
+
portalContainer?: ComponentPropsWithoutRef<typeof Toast.Portal>["container"];
|
|
158
|
+
className?: string;
|
|
159
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -78,6 +78,31 @@ export type WorkspaceAppShellProps = NativeWorkspaceAppShellProps & {
|
|
|
78
78
|
secondaryMinSize?: number;
|
|
79
79
|
/** Accessible splitter label when the Primary region has no visible label. */
|
|
80
80
|
resizeLabel?: string;
|
|
81
|
+
/** Controlled Navigation width in pixels on the expanded layout. */
|
|
82
|
+
navigationWidth?: number;
|
|
83
|
+
/** Initial Navigation width for uncontrolled pixel-based persistence. */
|
|
84
|
+
defaultNavigationWidth?: number;
|
|
85
|
+
/** Reports every pointer or keyboard Navigation resize in pixels. */
|
|
86
|
+
onNavigationWidthChange?: (width: number) => void;
|
|
87
|
+
/** Reports the final pointer width or each committed keyboard step. */
|
|
88
|
+
onNavigationWidthCommit?: (width: number) => void;
|
|
89
|
+
/** Navigation minimum width in pixels. Defaults to 200px. */
|
|
90
|
+
navigationMinWidth?: number;
|
|
91
|
+
/** Navigation maximum width in pixels. Defaults to 320px. */
|
|
92
|
+
navigationMaxWidth?: number;
|
|
93
|
+
/** Accessible label for the Navigation splitter. */
|
|
94
|
+
navigationResizeLabel?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Share of a panel minimum the pointer must cross before a drag dismisses
|
|
97
|
+
* that panel. Defaults to 0.5, i.e. half the minimum width.
|
|
98
|
+
*/
|
|
99
|
+
dragDismissThreshold?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Enables the transient left-edge hover peek that reveals Navigation as a
|
|
102
|
+
* floating overlay while it is closed on a persistent layout. The peek never
|
|
103
|
+
* changes `navigationOpen`. Defaults to enabled.
|
|
104
|
+
*/
|
|
105
|
+
navigationPeek?: boolean;
|
|
81
106
|
};
|
|
82
107
|
/**
|
|
83
108
|
* Complete Workspace layout pattern. It composes the approved Global App Bar,
|
|
@@ -140,5 +165,30 @@ export declare const WorkspaceAppShell: import("react").ForwardRefExoticComponen
|
|
|
140
165
|
secondaryMinSize?: number;
|
|
141
166
|
/** Accessible splitter label when the Primary region has no visible label. */
|
|
142
167
|
resizeLabel?: string;
|
|
168
|
+
/** Controlled Navigation width in pixels on the expanded layout. */
|
|
169
|
+
navigationWidth?: number;
|
|
170
|
+
/** Initial Navigation width for uncontrolled pixel-based persistence. */
|
|
171
|
+
defaultNavigationWidth?: number;
|
|
172
|
+
/** Reports every pointer or keyboard Navigation resize in pixels. */
|
|
173
|
+
onNavigationWidthChange?: (width: number) => void;
|
|
174
|
+
/** Reports the final pointer width or each committed keyboard step. */
|
|
175
|
+
onNavigationWidthCommit?: (width: number) => void;
|
|
176
|
+
/** Navigation minimum width in pixels. Defaults to 200px. */
|
|
177
|
+
navigationMinWidth?: number;
|
|
178
|
+
/** Navigation maximum width in pixels. Defaults to 320px. */
|
|
179
|
+
navigationMaxWidth?: number;
|
|
180
|
+
/** Accessible label for the Navigation splitter. */
|
|
181
|
+
navigationResizeLabel?: string;
|
|
182
|
+
/**
|
|
183
|
+
* Share of a panel minimum the pointer must cross before a drag dismisses
|
|
184
|
+
* that panel. Defaults to 0.5, i.e. half the minimum width.
|
|
185
|
+
*/
|
|
186
|
+
dragDismissThreshold?: number;
|
|
187
|
+
/**
|
|
188
|
+
* Enables the transient left-edge hover peek that reveals Navigation as a
|
|
189
|
+
* floating overlay while it is closed on a persistent layout. The peek never
|
|
190
|
+
* changes `navigationOpen`. Defaults to enabled.
|
|
191
|
+
*/
|
|
192
|
+
navigationPeek?: boolean;
|
|
143
193
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
144
194
|
export {};
|