@mieweb/ui 0.10.0-dev.10 → 0.10.0-dev.12
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/Input-yN516s5_.d.cts +3 -0
- package/dist/Input-yN516s5_.d.ts +3 -0
- package/dist/ag-grid.d.cts +142 -1
- package/dist/ag-grid.d.ts +142 -1
- package/dist/components/Alert/index.d.cts +1 -1
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/AlertDialog/index.d.cts +28 -3
- package/dist/components/AlertDialog/index.d.ts +28 -3
- package/dist/components/AudioRecorder/index.d.cts +2 -2
- package/dist/components/AudioRecorder/index.d.ts +2 -2
- package/dist/components/Autocomplete/index.d.cts +8 -2
- package/dist/components/Autocomplete/index.d.ts +8 -2
- package/dist/components/Avatar/index.d.cts +1 -1
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Badge/index.d.cts +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/BoardView/index.d.cts +91 -4
- package/dist/components/BoardView/index.d.ts +91 -4
- package/dist/components/Button/index.d.cts +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/CalendarView/index.d.cts +1 -2
- package/dist/components/CalendarView/index.d.ts +1 -2
- package/dist/components/Card/index.d.cts +3 -3
- package/dist/components/Card/index.d.ts +3 -3
- package/dist/components/Dropdown/index.d.cts +2 -1
- package/dist/components/Dropdown/index.d.ts +2 -1
- package/dist/components/GanttView/index.d.cts +1 -2
- package/dist/components/GanttView/index.d.ts +1 -2
- package/dist/components/ListView/index.d.cts +2 -3
- package/dist/components/ListView/index.d.ts +2 -3
- package/dist/components/MediaEditor/index.d.cts +91 -2
- package/dist/components/MediaEditor/index.d.ts +91 -2
- package/dist/components/MediaPlayer/index.d.cts +1 -1
- package/dist/components/MediaPlayer/index.d.ts +1 -1
- package/dist/components/Pagination/index.d.cts +1 -1
- package/dist/components/Pagination/index.d.ts +1 -1
- package/dist/components/PhoneInput/index.d.cts +36 -3
- package/dist/components/PhoneInput/index.d.ts +36 -3
- package/dist/components/Progress/index.d.cts +1 -1
- package/dist/components/Progress/index.d.ts +1 -1
- package/dist/components/Q/index.d.cts +2 -2
- package/dist/components/Q/index.d.ts +2 -2
- package/dist/components/QuickAction/index.d.cts +1 -1
- package/dist/components/QuickAction/index.d.ts +1 -1
- package/dist/components/RecordButton/index.d.cts +1 -1
- package/dist/components/RecordButton/index.d.ts +1 -1
- package/dist/components/RichTextEditor/index.d.cts +7 -2
- package/dist/components/RichTextEditor/index.d.ts +7 -2
- package/dist/components/ScrollArea/index.d.cts +1 -1
- package/dist/components/ScrollArea/index.d.ts +1 -1
- package/dist/components/Select/index.d.cts +1 -2
- package/dist/components/Select/index.d.ts +1 -2
- package/dist/components/Skeleton/index.d.cts +1 -1
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Slider/index.d.cts +2 -2
- package/dist/components/Slider/index.d.ts +2 -2
- package/dist/components/Spinner/index.d.cts +2 -2
- package/dist/components/Spinner/index.d.ts +2 -2
- package/dist/components/SuperChat/index.d.cts +2 -4
- package/dist/components/SuperChat/index.d.ts +2 -4
- package/dist/components/SuperChat/plugins/index.d.cts +2 -3
- package/dist/components/SuperChat/plugins/index.d.ts +2 -3
- package/dist/components/Text/index.d.cts +3 -3
- package/dist/components/Text/index.d.ts +3 -3
- package/dist/components/Textarea/index.d.cts +1 -2
- package/dist/components/Textarea/index.d.ts +1 -2
- package/dist/components/ThemeProvider/index.d.cts +3 -1
- package/dist/components/ThemeProvider/index.d.ts +3 -1
- package/dist/components/TranscriptView/index.d.cts +85 -4
- package/dist/components/TranscriptView/index.d.ts +85 -4
- package/dist/components/ViewSet/index.d.cts +120 -9
- package/dist/components/ViewSet/index.d.ts +120 -9
- package/dist/components/ViewSwitcher/index.d.cts +4 -40
- package/dist/components/ViewSwitcher/index.d.ts +4 -40
- package/dist/datavis.d.cts +167 -13
- package/dist/datavis.d.ts +167 -13
- package/dist/esheet.d.cts +183 -1
- package/dist/esheet.d.ts +183 -1
- package/dist/hooks/index.d.cts +383 -31
- package/dist/hooks/index.d.ts +383 -31
- package/dist/index-DoYYWsNc.d.cts +127 -0
- package/dist/index-DoYYWsNc.d.ts +127 -0
- package/dist/index.d.cts +7592 -414
- package/dist/index.d.ts +7592 -414
- package/dist/motion.d.cts +186 -2
- package/dist/motion.d.ts +186 -2
- package/dist/q.d.cts +25 -3
- package/dist/q.d.ts +25 -3
- package/dist/{types-B97JNRNQ.d.cts → types-DOxdTwmq.d.cts} +170 -2
- package/dist/{types-gZXrfLj6.d.ts → types-DOxdTwmq.d.ts} +170 -2
- package/dist/{types-CbWXIKbe.d.cts → types-DsdZvEI1.d.cts} +1 -28
- package/dist/{types-CbWXIKbe.d.ts → types-DsdZvEI1.d.ts} +1 -28
- package/dist/utils/index.d.cts +13 -2
- package/dist/utils/index.d.ts +13 -2
- package/package.json +3 -2
- package/dist/Animated-XmH6k8pZ.d.cts +0 -188
- package/dist/Animated-XmH6k8pZ.d.ts +0 -188
- package/dist/MedicationEditor-Bp4NLy7y.d.cts +0 -352
- package/dist/MedicationEditor-Bp4NLy7y.d.ts +0 -352
- package/dist/html-MdxqSzjD.d.cts +0 -13
- package/dist/html-MdxqSzjD.d.ts +0 -13
- package/dist/orderRows-BUJYgSc7.d.cts +0 -221
- package/dist/orderRows-BUJYgSc7.d.ts +0 -221
- package/dist/transcript-Cg7uSW-C.d.cts +0 -84
- package/dist/transcript-Cg7uSW-C.d.ts +0 -84
- package/dist/types-CnPEwzlp.d.cts +0 -254
- package/dist/types-CnPEwzlp.d.ts +0 -254
- package/dist/useAnchoredPosition-CKwLSQW8.d.cts +0 -76
- package/dist/useAnchoredPosition-CKwLSQW8.d.ts +0 -76
- package/dist/useTheme-B9SWu6ui.d.cts +0 -24
- package/dist/useTheme-B9SWu6ui.d.ts +0 -24
- package/dist/useTranscriptEdits-CGzlemHT.d.cts +0 -182
- package/dist/useTranscriptEdits-D32bLs0l.d.ts +0 -182
|
@@ -1,5 +1,173 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AI Component Types
|
|
5
|
+
*
|
|
6
|
+
* Type definitions for AI-related components including MCP (Model Context Protocol)
|
|
7
|
+
* interactions, tool calls, and chat messages.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Status of an MCP tool invocation
|
|
12
|
+
*/
|
|
13
|
+
type MCPToolStatus = 'pending' | 'running' | 'success' | 'error' | 'cancelled';
|
|
14
|
+
/**
|
|
15
|
+
* MCP Tool parameter definition
|
|
16
|
+
*/
|
|
17
|
+
interface MCPToolParameter {
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
value: unknown;
|
|
21
|
+
description?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* MCP Tool invocation
|
|
25
|
+
*/
|
|
26
|
+
interface MCPToolCall {
|
|
27
|
+
/** Unique identifier for this tool call */
|
|
28
|
+
id: string;
|
|
29
|
+
/** Name of the tool being invoked */
|
|
30
|
+
toolName: string;
|
|
31
|
+
/** Human-readable description of what the tool does */
|
|
32
|
+
description?: string;
|
|
33
|
+
/** Parameters passed to the tool */
|
|
34
|
+
parameters: MCPToolParameter[];
|
|
35
|
+
/** Current status of the tool execution */
|
|
36
|
+
status: MCPToolStatus;
|
|
37
|
+
/** Timestamp when tool was invoked */
|
|
38
|
+
startedAt: Date | string;
|
|
39
|
+
/** Timestamp when tool completed */
|
|
40
|
+
completedAt?: Date | string;
|
|
41
|
+
/** Duration in milliseconds */
|
|
42
|
+
duration?: number;
|
|
43
|
+
/** Result data if successful */
|
|
44
|
+
result?: MCPToolResult;
|
|
45
|
+
/** Error message if failed */
|
|
46
|
+
error?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Result from an MCP tool execution
|
|
50
|
+
*/
|
|
51
|
+
interface MCPToolResult {
|
|
52
|
+
/** Type of result data */
|
|
53
|
+
type: 'text' | 'json' | 'link' | 'resource' | 'error';
|
|
54
|
+
/** The result data */
|
|
55
|
+
data: unknown;
|
|
56
|
+
/** Human-readable summary of the result */
|
|
57
|
+
summary?: string;
|
|
58
|
+
/** Link to a resource (for link type) */
|
|
59
|
+
link?: MCPResourceLink;
|
|
60
|
+
/** Resources created or modified */
|
|
61
|
+
resources?: MCPResource[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Link to a resource
|
|
65
|
+
*/
|
|
66
|
+
interface MCPResourceLink {
|
|
67
|
+
/** URL or path to the resource */
|
|
68
|
+
href: string;
|
|
69
|
+
/** Display text for the link */
|
|
70
|
+
label: string;
|
|
71
|
+
/** Type of resource */
|
|
72
|
+
type?: 'patient' | 'document' | 'appointment' | 'order' | 'provider' | 'external' | 'internal';
|
|
73
|
+
/** Icon name or component */
|
|
74
|
+
icon?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* MCP Resource definition
|
|
78
|
+
*/
|
|
79
|
+
interface MCPResource {
|
|
80
|
+
/** Unique identifier */
|
|
81
|
+
id: string;
|
|
82
|
+
/** Resource type (e.g., 'patient', 'appointment', 'document') */
|
|
83
|
+
type: string;
|
|
84
|
+
/** Display name */
|
|
85
|
+
name: string;
|
|
86
|
+
/** URL to access the resource */
|
|
87
|
+
uri?: string;
|
|
88
|
+
/** Brief description */
|
|
89
|
+
description?: string;
|
|
90
|
+
/** Additional metadata */
|
|
91
|
+
metadata?: Record<string, unknown>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Role of the message sender
|
|
95
|
+
*/
|
|
96
|
+
type AIMessageRole = 'user' | 'assistant' | 'system' | 'tool';
|
|
97
|
+
/**
|
|
98
|
+
* Status of an AI message
|
|
99
|
+
*/
|
|
100
|
+
type AIMessageStatus = 'pending' | 'streaming' | 'complete' | 'error';
|
|
101
|
+
/**
|
|
102
|
+
* Content block within a message
|
|
103
|
+
*/
|
|
104
|
+
interface AIMessageContent {
|
|
105
|
+
/** Type of content */
|
|
106
|
+
type: 'text' | 'tool_use' | 'tool_result' | 'thinking' | 'code' | 'image' | 'file' | 'audio' | 'video';
|
|
107
|
+
/** Text content (also used as the label for `audio` and `video` blocks) */
|
|
108
|
+
text?: string;
|
|
109
|
+
/** Tool call reference */
|
|
110
|
+
toolCall?: MCPToolCall;
|
|
111
|
+
/** Language for code blocks */
|
|
112
|
+
language?: string;
|
|
113
|
+
/** Whether this content is collapsed by default */
|
|
114
|
+
collapsed?: boolean;
|
|
115
|
+
/** Image source URL (for `image` blocks) */
|
|
116
|
+
imageUrl?: string;
|
|
117
|
+
/** Alt text / file name (for `image` and `file` blocks) */
|
|
118
|
+
name?: string;
|
|
119
|
+
/** File size in bytes (for `file` blocks) */
|
|
120
|
+
fileSize?: number;
|
|
121
|
+
/** MIME type (for `file`, `audio`, and `video` blocks) */
|
|
122
|
+
mimeType?: string;
|
|
123
|
+
/** Download/open URL (for `file` blocks) */
|
|
124
|
+
fileUrl?: string;
|
|
125
|
+
/** Source URL for `audio` blocks */
|
|
126
|
+
audioUrl?: string;
|
|
127
|
+
/** Source URL for `video` blocks */
|
|
128
|
+
videoUrl?: string;
|
|
129
|
+
/** Duration in seconds for `audio` blocks */
|
|
130
|
+
duration?: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* AI Chat Message
|
|
134
|
+
*/
|
|
135
|
+
interface AIMessage {
|
|
136
|
+
/** Unique identifier */
|
|
137
|
+
id: string;
|
|
138
|
+
/** Role of sender */
|
|
139
|
+
role: AIMessageRole;
|
|
140
|
+
/** Message content blocks */
|
|
141
|
+
content: AIMessageContent[];
|
|
142
|
+
/** Timestamp */
|
|
143
|
+
timestamp: Date | string;
|
|
144
|
+
/** Current status */
|
|
145
|
+
status: AIMessageStatus;
|
|
146
|
+
/** Model used (for assistant messages) */
|
|
147
|
+
model?: string;
|
|
148
|
+
/** Token usage info */
|
|
149
|
+
usage?: {
|
|
150
|
+
promptTokens?: number;
|
|
151
|
+
completionTokens?: number;
|
|
152
|
+
totalTokens?: number;
|
|
153
|
+
};
|
|
154
|
+
/** Custom metadata */
|
|
155
|
+
metadata?: Record<string, unknown>;
|
|
156
|
+
}
|
|
157
|
+
/** Context passed to a custom text content renderer. */
|
|
158
|
+
interface AITextRenderContext {
|
|
159
|
+
/** id of the parent message (useful as a render cache key) */
|
|
160
|
+
messageId: string;
|
|
161
|
+
/** true while the message is still streaming */
|
|
162
|
+
streaming: boolean;
|
|
163
|
+
/** role of the parent message */
|
|
164
|
+
role: AIMessage['role'];
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Render-prop for customizing `text` content blocks. Host is responsible
|
|
168
|
+
* for sanitizing untrusted input.
|
|
169
|
+
*/
|
|
170
|
+
type AIRenderTextContent = (text: string, ctx: AITextRenderContext) => React.ReactNode;
|
|
3
171
|
|
|
4
172
|
/**
|
|
5
173
|
* SuperChat Types
|
|
@@ -248,4 +416,4 @@ interface GenUIBlockPayload {
|
|
|
248
416
|
props?: unknown;
|
|
249
417
|
}
|
|
250
418
|
|
|
251
|
-
export type {
|
|
419
|
+
export type { AIRenderTextContent as A, ComposerAttachment as C, GenUIBlockPayload as G, MCPResourceLink as M, Participant as P, SuperChatConversation as S, SuperChatRenderPlugin as a, AttachmentKind as b, SuperChatLinkBuilder as c, SuperChatCopyFormat as d, SuperChatRef as e, AIMessageContent as f, AIMessageStatus as g, AITextRenderContext as h, GenUIPrefetchPolicy as i, GenUIRegistry as j, GenUIWidgetEntry as k, GenUIWidgetProps as l, ParticipantKind as m, ParticipantStatus as n, StandardSchemaV1 as o, SuperChatChannel as p, SuperChatItemType as q, SuperChatMessage as r, SuperChatPluggable as s, SuperChatPluggableList as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DateTime } from 'luxon';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* The contract every component in the `Modules/Views` family reads through.
|
|
@@ -64,7 +63,6 @@ interface ViewLabels {
|
|
|
64
63
|
/** Heading for the group a record with no status or group falls into. */
|
|
65
64
|
ungrouped: string;
|
|
66
65
|
}
|
|
67
|
-
declare const defaultViewLabels: ViewLabels;
|
|
68
66
|
/**
|
|
69
67
|
* Props every view accepts. Views are controlled: selection, the active view and
|
|
70
68
|
* filter state live in the page, and every change is handed back.
|
|
@@ -90,30 +88,5 @@ interface ViewBaseProps<T> {
|
|
|
90
88
|
now?: Date;
|
|
91
89
|
className?: string;
|
|
92
90
|
}
|
|
93
|
-
/**
|
|
94
|
-
* Reads an accessor's date in the view's zone.
|
|
95
|
-
*
|
|
96
|
-
* `DateTime.fromISO` is what makes this correct for both shapes an accessor may
|
|
97
|
-
* return. A date-only string is a wall date — `2026-03-10` means that calendar
|
|
98
|
-
* day where the collection lives, not UTC midnight, which is the 9th in the
|
|
99
|
-
* Americas — while a full timestamp is an instant and gets converted. Going via
|
|
100
|
-
* `new Date()` would collapse the first case into the second and shift the item
|
|
101
|
-
* onto the previous day in every zone behind UTC.
|
|
102
|
-
*/
|
|
103
|
-
declare function toDateTime(value: Date | string | null | undefined, zone: string): DateTime | null;
|
|
104
|
-
/**
|
|
105
|
-
* Tailwind classes per accent, so every view tints the same way.
|
|
106
|
-
*
|
|
107
|
-
* There is deliberately no text colour here. `--mieweb-success` and friends are
|
|
108
|
-
* fill tokens: as ink on a surface — even their own 10% wash — they fail WCAG AA
|
|
109
|
-
* contrast, which axe catches as a serious violation. So an accent is carried by
|
|
110
|
-
* a wash, a border and a solid marker, and label text always uses a foreground
|
|
111
|
-
* token. That also means colour is never the only signal.
|
|
112
|
-
*/
|
|
113
|
-
declare const accentClasses: Record<Accent, {
|
|
114
|
-
tint: string;
|
|
115
|
-
border: string;
|
|
116
|
-
marker: string;
|
|
117
|
-
}>;
|
|
118
91
|
|
|
119
|
-
export
|
|
92
|
+
export type { Stage as S, ViewLabels as V, ViewBaseProps as a };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DateTime } from 'luxon';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* The contract every component in the `Modules/Views` family reads through.
|
|
@@ -64,7 +63,6 @@ interface ViewLabels {
|
|
|
64
63
|
/** Heading for the group a record with no status or group falls into. */
|
|
65
64
|
ungrouped: string;
|
|
66
65
|
}
|
|
67
|
-
declare const defaultViewLabels: ViewLabels;
|
|
68
66
|
/**
|
|
69
67
|
* Props every view accepts. Views are controlled: selection, the active view and
|
|
70
68
|
* filter state live in the page, and every change is handed back.
|
|
@@ -90,30 +88,5 @@ interface ViewBaseProps<T> {
|
|
|
90
88
|
now?: Date;
|
|
91
89
|
className?: string;
|
|
92
90
|
}
|
|
93
|
-
/**
|
|
94
|
-
* Reads an accessor's date in the view's zone.
|
|
95
|
-
*
|
|
96
|
-
* `DateTime.fromISO` is what makes this correct for both shapes an accessor may
|
|
97
|
-
* return. A date-only string is a wall date — `2026-03-10` means that calendar
|
|
98
|
-
* day where the collection lives, not UTC midnight, which is the 9th in the
|
|
99
|
-
* Americas — while a full timestamp is an instant and gets converted. Going via
|
|
100
|
-
* `new Date()` would collapse the first case into the second and shift the item
|
|
101
|
-
* onto the previous day in every zone behind UTC.
|
|
102
|
-
*/
|
|
103
|
-
declare function toDateTime(value: Date | string | null | undefined, zone: string): DateTime | null;
|
|
104
|
-
/**
|
|
105
|
-
* Tailwind classes per accent, so every view tints the same way.
|
|
106
|
-
*
|
|
107
|
-
* There is deliberately no text colour here. `--mieweb-success` and friends are
|
|
108
|
-
* fill tokens: as ink on a surface — even their own 10% wash — they fail WCAG AA
|
|
109
|
-
* contrast, which axe catches as a serious violation. So an accent is carried by
|
|
110
|
-
* a wash, a border and a solid marker, and label text always uses a foreground
|
|
111
|
-
* token. That also means colour is never the only signal.
|
|
112
|
-
*/
|
|
113
|
-
declare const accentClasses: Record<Accent, {
|
|
114
|
-
tint: string;
|
|
115
|
-
border: string;
|
|
116
|
-
marker: string;
|
|
117
|
-
}>;
|
|
118
91
|
|
|
119
|
-
export
|
|
92
|
+
export type { Stage as S, ViewLabels as V, ViewBaseProps as a };
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
|
-
export { i as isHtmlEmpty, s as stripHtmlTags } from '../html-MdxqSzjD.cjs';
|
|
3
2
|
|
|
4
3
|
declare const miewebUITwMergeConflicts: Record<string, string[]>;
|
|
5
4
|
/**
|
|
@@ -18,6 +17,18 @@ declare const miewebUITwMergeConflicts: Record<string, string[]>;
|
|
|
18
17
|
*/
|
|
19
18
|
declare function cn(...inputs: ClassValue[]): string;
|
|
20
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Extracts visible text from an HTML string without using regex.
|
|
22
|
+
* Uses a simple character-by-character state machine to skip tags.
|
|
23
|
+
* This avoids CodeQL false-positives associated with regex-based tag stripping.
|
|
24
|
+
*/
|
|
25
|
+
declare function stripHtmlTags(html: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Returns true when an HTML string has no visible text content.
|
|
28
|
+
* This is a visibility check, not a sanitizer — do NOT use for XSS prevention.
|
|
29
|
+
*/
|
|
30
|
+
declare function isHtmlEmpty(html: string): boolean;
|
|
31
|
+
|
|
21
32
|
/**
|
|
22
33
|
* Phone number formatting utilities
|
|
23
34
|
*/
|
|
@@ -106,4 +117,4 @@ declare function displayFormatToDateString(value: string): string;
|
|
|
106
117
|
*/
|
|
107
118
|
declare function isStorybookDocsMode(): boolean;
|
|
108
119
|
|
|
109
|
-
export { calculateAge, cn, dateToDisplayFormat, displayFormatToDateString, formatDateValue, formatPhoneNumber, isDateEmpty, isDateInFuture, isDateInPast, isPhoneNumberEmpty, isStorybookDocsMode, isValidDate, isValidDrivingAge, isValidPhoneNumber, miewebUITwMergeConflicts, parseDateValue, unformatPhoneNumber };
|
|
120
|
+
export { calculateAge, cn, dateToDisplayFormat, displayFormatToDateString, formatDateValue, formatPhoneNumber, isDateEmpty, isDateInFuture, isDateInPast, isHtmlEmpty, isPhoneNumberEmpty, isStorybookDocsMode, isValidDate, isValidDrivingAge, isValidPhoneNumber, miewebUITwMergeConflicts, parseDateValue, stripHtmlTags, unformatPhoneNumber };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
|
-
export { i as isHtmlEmpty, s as stripHtmlTags } from '../html-MdxqSzjD.js';
|
|
3
2
|
|
|
4
3
|
declare const miewebUITwMergeConflicts: Record<string, string[]>;
|
|
5
4
|
/**
|
|
@@ -18,6 +17,18 @@ declare const miewebUITwMergeConflicts: Record<string, string[]>;
|
|
|
18
17
|
*/
|
|
19
18
|
declare function cn(...inputs: ClassValue[]): string;
|
|
20
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Extracts visible text from an HTML string without using regex.
|
|
22
|
+
* Uses a simple character-by-character state machine to skip tags.
|
|
23
|
+
* This avoids CodeQL false-positives associated with regex-based tag stripping.
|
|
24
|
+
*/
|
|
25
|
+
declare function stripHtmlTags(html: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Returns true when an HTML string has no visible text content.
|
|
28
|
+
* This is a visibility check, not a sanitizer — do NOT use for XSS prevention.
|
|
29
|
+
*/
|
|
30
|
+
declare function isHtmlEmpty(html: string): boolean;
|
|
31
|
+
|
|
21
32
|
/**
|
|
22
33
|
* Phone number formatting utilities
|
|
23
34
|
*/
|
|
@@ -106,4 +117,4 @@ declare function displayFormatToDateString(value: string): string;
|
|
|
106
117
|
*/
|
|
107
118
|
declare function isStorybookDocsMode(): boolean;
|
|
108
119
|
|
|
109
|
-
export { calculateAge, cn, dateToDisplayFormat, displayFormatToDateString, formatDateValue, formatPhoneNumber, isDateEmpty, isDateInFuture, isDateInPast, isPhoneNumberEmpty, isStorybookDocsMode, isValidDate, isValidDrivingAge, isValidPhoneNumber, miewebUITwMergeConflicts, parseDateValue, unformatPhoneNumber };
|
|
120
|
+
export { calculateAge, cn, dateToDisplayFormat, displayFormatToDateString, formatDateValue, formatPhoneNumber, isDateEmpty, isDateInFuture, isDateInPast, isHtmlEmpty, isPhoneNumberEmpty, isStorybookDocsMode, isValidDate, isValidDrivingAge, isValidPhoneNumber, miewebUITwMergeConflicts, parseDateValue, stripHtmlTags, unformatPhoneNumber };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mieweb/ui",
|
|
3
|
-
"version": "0.10.0-dev.
|
|
3
|
+
"version": "0.10.0-dev.12",
|
|
4
4
|
"description": "A themeable, accessible React component library built with Tailwind CSS",
|
|
5
5
|
"author": "Medical Informatics Engineering, Inc.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -241,7 +241,8 @@
|
|
|
241
241
|
"prepare": "npm run build:datavis && npm run build:css && npm run copy:brand-css && npm run copy:style-css && npm run copy:markdown-css && npm run copy:kerebron-css",
|
|
242
242
|
"dev": "tsup --watch",
|
|
243
243
|
"prebuild": "npm run build:esheet && npm run build:datavis",
|
|
244
|
-
"build": "node --max-old-space-size=8192 ./node_modules/tsup/dist/cli-default.js && npm run build:css && npm run copy:brand-css && npm run copy:style-css && npm run copy:markdown-css && npm run copy:kerebron-css",
|
|
244
|
+
"build": "node --max-old-space-size=8192 ./node_modules/tsup/dist/cli-default.js && npm run build:dts && npm run build:css && npm run copy:brand-css && npm run copy:style-css && npm run copy:markdown-css && npm run copy:kerebron-css",
|
|
245
|
+
"build:dts": "node scripts/build-dts.mjs",
|
|
245
246
|
"build:esheet": "if [ ! -f packages/esheet/packages/core/dist/index.d.ts ] || [ ! -f packages/esheet/packages/renderer/src/index.output.css ] || [ ! -f packages/esheet/packages/builder/src/index.output.css ]; then cd packages/esheet && pnpm install --frozen-lockfile && pnpm --filter '@esheet/builder...' --filter '@esheet/renderer...' build; fi",
|
|
246
247
|
"build:datavis": "node scripts/build-datavis.mjs",
|
|
247
248
|
"build:css": "mkdir -p dist && npx @tailwindcss/cli -i ./src/styles/base.css -o ./dist/styles.css --minify",
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Motion presets — the shared vocabulary of animations.
|
|
5
|
-
*
|
|
6
|
-
* This module is intentionally **free of any `motion` import**. It ships in the
|
|
7
|
-
* main `@mieweb/ui` entry so components can describe *what* they animate
|
|
8
|
-
* without pulling in a runtime to actually do it. The `@mieweb/ui/motion` entry
|
|
9
|
-
* is what turns these descriptions into real animations.
|
|
10
|
-
*
|
|
11
|
-
* Every preset is expressed as an open/closed variant pair so the same
|
|
12
|
-
* definition serves both usages:
|
|
13
|
-
*
|
|
14
|
-
* - **toggle** — the element stays mounted and animates between `open` and
|
|
15
|
-
* `closed` (a drawer sliding in and out).
|
|
16
|
-
* - **presence** — the element mounts and unmounts, entering on `open` and
|
|
17
|
-
* exiting back to `closed` (a modal).
|
|
18
|
-
*/
|
|
19
|
-
/** Named animation recipes shared by components. */
|
|
20
|
-
type MotionPreset = 'drawerStart' | 'overlay' | 'modalContent' | 'sidebarLabel' | 'menu' | 'collapse' | 'toast' | 'fade' | 'pop';
|
|
21
|
-
/**
|
|
22
|
-
* A physical edge, already resolved from any logical (`start`/`end`) position
|
|
23
|
-
* and from writing direction.
|
|
24
|
-
*
|
|
25
|
-
* Presets that move an element along an axis take one of these as `custom`.
|
|
26
|
-
* Resolution is the component's job, not the preset's: only the component knows
|
|
27
|
-
* whether its `end` means right or left, and — for anything anchored — which
|
|
28
|
-
* side it actually landed on after flipping away from a viewport edge.
|
|
29
|
-
*/
|
|
30
|
-
type MotionEdge = 'top' | 'bottom' | 'left' | 'right';
|
|
31
|
-
/**
|
|
32
|
-
* A variant value. Either a plain target object or a function of the element's
|
|
33
|
-
* `custom` value — the latter lets a single preset adapt to context, e.g. a
|
|
34
|
-
* drawer flipping its off-canvas direction in RTL.
|
|
35
|
-
*/
|
|
36
|
-
type MotionVariant = Record<string, unknown> | ((custom: unknown) => Record<string, unknown>);
|
|
37
|
-
interface MotionPresetDefinition {
|
|
38
|
-
variants: {
|
|
39
|
-
open: MotionVariant;
|
|
40
|
-
closed: MotionVariant;
|
|
41
|
-
};
|
|
42
|
-
transition: Record<string, unknown>;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* `custom` contract per preset:
|
|
46
|
-
*
|
|
47
|
-
* - `drawerStart` — `boolean`, whether the document direction is RTL.
|
|
48
|
-
* - `menu`, `toast` — a {@link MotionEdge}, already resolved from logical
|
|
49
|
-
* position and writing direction by the component.
|
|
50
|
-
* - `overlay`, `modalContent`, `sidebarLabel`, `collapse`, `fade`, `pop` —
|
|
51
|
-
* unused.
|
|
52
|
-
*/
|
|
53
|
-
declare const motionPresets: Record<MotionPreset, MotionPresetDefinition>;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Motion runtime — the seam between components and an optional animation library.
|
|
57
|
-
*
|
|
58
|
-
* Components in the main entry never import `motion`. They ask this module for
|
|
59
|
-
* a runtime; if an app has opted in by rendering `<MotionProvider>` from
|
|
60
|
-
* `@mieweb/ui/motion`, they get one and animate. If not, `useMotionRuntime()`
|
|
61
|
-
* returns `null` and they fall back to their existing CSS transitions. That is
|
|
62
|
-
* what keeps `motion` out of the bundle of every app that hasn't asked for it —
|
|
63
|
-
* the opt-in is resolved in the *module graph*, not by a prop.
|
|
64
|
-
*
|
|
65
|
-
* Like `presets`, this module must stay free of any `motion` import.
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
|
-
interface MotionPresenceProps {
|
|
69
|
-
children?: React.ReactNode;
|
|
70
|
-
/** Suppress the initial mount animation. */
|
|
71
|
-
initial?: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Fires once every exiting child has finished and been removed.
|
|
74
|
-
*
|
|
75
|
-
* Needed by anything that guards the DOM while it is open — a focus trap, a
|
|
76
|
-
* scroll lock — because those guards must outlive `open` for as long as the
|
|
77
|
-
* subtree is still on screen. Never fires when no runtime is active, since
|
|
78
|
-
* there is no exit to wait for.
|
|
79
|
-
*/
|
|
80
|
-
onExitComplete?: () => void;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* The capabilities a motion library must supply. Deliberately small: element
|
|
84
|
-
* factories, a presence wrapper, and prop builders. Components depend on this
|
|
85
|
-
* interface, never on a concrete library, so swapping or dropping the library
|
|
86
|
-
* stays a one-file change.
|
|
87
|
-
*/
|
|
88
|
-
interface MotionRuntime {
|
|
89
|
-
/**
|
|
90
|
-
* Whether animations should actually run.
|
|
91
|
-
*
|
|
92
|
-
* A disabled provider still supplies a runtime rather than `null` so that
|
|
93
|
-
* consumers can tell "disabled" apart from "never opted in": `Modal` uses it
|
|
94
|
-
* to decide whether an exit animation will ever report completion, and
|
|
95
|
-
* `AnimatedPresence` keeps its wrapper element stable across the flip.
|
|
96
|
-
* `Animated` itself renders the plain fallback tag whenever this is false —
|
|
97
|
-
* withholding animation props from a mounted motion component corrupts
|
|
98
|
-
* `toggle`-mode elements, so the swap (and the remount it implies) is the
|
|
99
|
-
* correct behaviour. See the render branches in `Animated`.
|
|
100
|
-
*/
|
|
101
|
-
enabled: boolean;
|
|
102
|
-
/** Animated `div`. */
|
|
103
|
-
Div: React.ElementType;
|
|
104
|
-
/** Animated `nav`. */
|
|
105
|
-
Nav: React.ElementType;
|
|
106
|
-
/** Animated `span`, for inline content that must not become a block. */
|
|
107
|
-
Span: React.ElementType;
|
|
108
|
-
/** Enables exit animations for conditionally rendered children. */
|
|
109
|
-
Presence: React.ComponentType<MotionPresenceProps>;
|
|
110
|
-
/**
|
|
111
|
-
* Props for an element that stays mounted and animates between states.
|
|
112
|
-
* Skips the initial animation so a closed drawer doesn't slide out on load.
|
|
113
|
-
*/
|
|
114
|
-
toggle: (preset: MotionPreset, open: boolean, custom?: unknown) => Record<string, unknown>;
|
|
115
|
-
/** Props for an element that mounts and unmounts inside `Presence`. */
|
|
116
|
-
presence: (preset: MotionPreset, custom?: unknown) => Record<string, unknown>;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* The active motion runtime, or `null` when the app has not opted in.
|
|
120
|
-
*
|
|
121
|
-
* Components must treat `null` as the normal case and keep a CSS path that
|
|
122
|
-
* looks good on its own — motion is an enhancement, never a requirement.
|
|
123
|
-
*/
|
|
124
|
-
declare function useMotionRuntime(): MotionRuntime | null;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* `Animated` / `AnimatedPresence` — the ergonomic layer components use.
|
|
128
|
-
*
|
|
129
|
-
* These exist so an individual component never has to branch on whether motion
|
|
130
|
-
* is available. It declares the preset it wants and the CSS classes that stand
|
|
131
|
-
* in when motion is absent; this module picks the element to render.
|
|
132
|
-
*
|
|
133
|
-
* Adding motion to a further component should be a matter of swapping its
|
|
134
|
-
* root `<div>` for an `<Animated>` and naming a preset — no new imports, no
|
|
135
|
-
* new dependency, and no behavior change for apps that have not opted in.
|
|
136
|
-
*/
|
|
137
|
-
|
|
138
|
-
interface AnimatedProps extends React.HTMLAttributes<HTMLElement> {
|
|
139
|
-
/** Intrinsic element to render. */
|
|
140
|
-
as?: 'div' | 'nav' | 'span';
|
|
141
|
-
/** Which shared animation recipe to use. */
|
|
142
|
-
preset: MotionPreset;
|
|
143
|
-
/**
|
|
144
|
-
* - `toggle` — element stays mounted and animates between open and closed.
|
|
145
|
-
* - `presence` — element mounts and unmounts; wrap it in `<AnimatedPresence>`
|
|
146
|
-
* so the exit animation gets a chance to run.
|
|
147
|
-
*/
|
|
148
|
-
mode: 'toggle' | 'presence';
|
|
149
|
-
/** Current state. Only read in `toggle` mode. */
|
|
150
|
-
open?: boolean;
|
|
151
|
-
/** Per-preset context value — see the `custom` contract in `presets.ts`. */
|
|
152
|
-
custom?: unknown;
|
|
153
|
-
/**
|
|
154
|
-
* Classes applied whenever this element is **not** animating — no provider,
|
|
155
|
-
* a disabled provider, or `enabled={false}`. This is where a component's
|
|
156
|
-
* existing CSS transition lives, so the two paths never both try to drive
|
|
157
|
-
* the same property.
|
|
158
|
-
*/
|
|
159
|
-
fallbackClassName?: string;
|
|
160
|
-
/**
|
|
161
|
-
* Set `false` to stop this element animating even when a runtime is active.
|
|
162
|
-
*
|
|
163
|
-
* For states where an animated element would be wrong rather than merely
|
|
164
|
-
* unnecessary. Motion writes a `transform` to hold an element at its resting
|
|
165
|
-
* position, and a transformed ancestor becomes the containing block for any
|
|
166
|
-
* `position: fixed` descendant — so an element that is only sometimes
|
|
167
|
-
* animated should opt out the rest of the time.
|
|
168
|
-
*
|
|
169
|
-
* Flipping this (or the provider's `disabled`) swaps the element back to a
|
|
170
|
-
* plain tag, which **remounts** it — deliberately. See the note on the
|
|
171
|
-
* render branches below.
|
|
172
|
-
*/
|
|
173
|
-
enabled?: boolean;
|
|
174
|
-
}
|
|
175
|
-
declare const Animated: React.ForwardRefExoticComponent<AnimatedProps & React.RefAttributes<HTMLElement>>;
|
|
176
|
-
/**
|
|
177
|
-
* Keeps unmounting children on screen long enough to animate out.
|
|
178
|
-
*
|
|
179
|
-
* Without a runtime this is a pass-through, so children disappear immediately —
|
|
180
|
-
* which is exactly what they do today. Children rendered conditionally inside
|
|
181
|
-
* it need a stable `key`.
|
|
182
|
-
*/
|
|
183
|
-
declare function AnimatedPresence({ children, initial, onExitComplete, }: MotionPresenceProps): React.JSX.Element;
|
|
184
|
-
declare namespace AnimatedPresence {
|
|
185
|
-
var displayName: string;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export { Animated as A, type MotionEdge as M, AnimatedPresence as a, type AnimatedProps as b, type MotionPreset as c, type MotionRuntime as d, type MotionPresenceProps as e, type MotionPresetDefinition as f, type MotionVariant as g, motionPresets as m, useMotionRuntime as u };
|