@mieweb/ui 0.10.0-dev.11 → 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
package/dist/motion.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export { A as Animated, a as AnimatedPresence, b as AnimatedProps, M as MotionEdge, c as MotionPreset, d as MotionRuntime, m as motionPresets, u as useMotionRuntime } from './Animated-XmH6k8pZ.cjs';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* `<MotionProvider>` — the opt-in switch.
|
|
@@ -49,4 +48,189 @@ declare namespace MotionProvider {
|
|
|
49
48
|
var displayName: string;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Motion presets — the shared vocabulary of animations.
|
|
53
|
+
*
|
|
54
|
+
* This module is intentionally **free of any `motion` import**. It ships in the
|
|
55
|
+
* main `@mieweb/ui` entry so components can describe *what* they animate
|
|
56
|
+
* without pulling in a runtime to actually do it. The `@mieweb/ui/motion` entry
|
|
57
|
+
* is what turns these descriptions into real animations.
|
|
58
|
+
*
|
|
59
|
+
* Every preset is expressed as an open/closed variant pair so the same
|
|
60
|
+
* definition serves both usages:
|
|
61
|
+
*
|
|
62
|
+
* - **toggle** — the element stays mounted and animates between `open` and
|
|
63
|
+
* `closed` (a drawer sliding in and out).
|
|
64
|
+
* - **presence** — the element mounts and unmounts, entering on `open` and
|
|
65
|
+
* exiting back to `closed` (a modal).
|
|
66
|
+
*/
|
|
67
|
+
/** Named animation recipes shared by components. */
|
|
68
|
+
type MotionPreset = 'drawerStart' | 'overlay' | 'modalContent' | 'sidebarLabel' | 'menu' | 'collapse' | 'toast' | 'fade' | 'pop';
|
|
69
|
+
/**
|
|
70
|
+
* A physical edge, already resolved from any logical (`start`/`end`) position
|
|
71
|
+
* and from writing direction.
|
|
72
|
+
*
|
|
73
|
+
* Presets that move an element along an axis take one of these as `custom`.
|
|
74
|
+
* Resolution is the component's job, not the preset's: only the component knows
|
|
75
|
+
* whether its `end` means right or left, and — for anything anchored — which
|
|
76
|
+
* side it actually landed on after flipping away from a viewport edge.
|
|
77
|
+
*/
|
|
78
|
+
type MotionEdge = 'top' | 'bottom' | 'left' | 'right';
|
|
79
|
+
/**
|
|
80
|
+
* A variant value. Either a plain target object or a function of the element's
|
|
81
|
+
* `custom` value — the latter lets a single preset adapt to context, e.g. a
|
|
82
|
+
* drawer flipping its off-canvas direction in RTL.
|
|
83
|
+
*/
|
|
84
|
+
type MotionVariant = Record<string, unknown> | ((custom: unknown) => Record<string, unknown>);
|
|
85
|
+
interface MotionPresetDefinition {
|
|
86
|
+
variants: {
|
|
87
|
+
open: MotionVariant;
|
|
88
|
+
closed: MotionVariant;
|
|
89
|
+
};
|
|
90
|
+
transition: Record<string, unknown>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* `custom` contract per preset:
|
|
94
|
+
*
|
|
95
|
+
* - `drawerStart` — `boolean`, whether the document direction is RTL.
|
|
96
|
+
* - `menu`, `toast` — a {@link MotionEdge}, already resolved from logical
|
|
97
|
+
* position and writing direction by the component.
|
|
98
|
+
* - `overlay`, `modalContent`, `sidebarLabel`, `collapse`, `fade`, `pop` —
|
|
99
|
+
* unused.
|
|
100
|
+
*/
|
|
101
|
+
declare const motionPresets: Record<MotionPreset, MotionPresetDefinition>;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Motion runtime — the seam between components and an optional animation library.
|
|
105
|
+
*
|
|
106
|
+
* Components in the main entry never import `motion`. They ask this module for
|
|
107
|
+
* a runtime; if an app has opted in by rendering `<MotionProvider>` from
|
|
108
|
+
* `@mieweb/ui/motion`, they get one and animate. If not, `useMotionRuntime()`
|
|
109
|
+
* returns `null` and they fall back to their existing CSS transitions. That is
|
|
110
|
+
* what keeps `motion` out of the bundle of every app that hasn't asked for it —
|
|
111
|
+
* the opt-in is resolved in the *module graph*, not by a prop.
|
|
112
|
+
*
|
|
113
|
+
* Like `presets`, this module must stay free of any `motion` import.
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
interface MotionPresenceProps {
|
|
117
|
+
children?: React.ReactNode;
|
|
118
|
+
/** Suppress the initial mount animation. */
|
|
119
|
+
initial?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Fires once every exiting child has finished and been removed.
|
|
122
|
+
*
|
|
123
|
+
* Needed by anything that guards the DOM while it is open — a focus trap, a
|
|
124
|
+
* scroll lock — because those guards must outlive `open` for as long as the
|
|
125
|
+
* subtree is still on screen. Never fires when no runtime is active, since
|
|
126
|
+
* there is no exit to wait for.
|
|
127
|
+
*/
|
|
128
|
+
onExitComplete?: () => void;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The capabilities a motion library must supply. Deliberately small: element
|
|
132
|
+
* factories, a presence wrapper, and prop builders. Components depend on this
|
|
133
|
+
* interface, never on a concrete library, so swapping or dropping the library
|
|
134
|
+
* stays a one-file change.
|
|
135
|
+
*/
|
|
136
|
+
interface MotionRuntime {
|
|
137
|
+
/**
|
|
138
|
+
* Whether animations should actually run.
|
|
139
|
+
*
|
|
140
|
+
* A disabled provider still supplies a runtime rather than `null` so that
|
|
141
|
+
* consumers can tell "disabled" apart from "never opted in": `Modal` uses it
|
|
142
|
+
* to decide whether an exit animation will ever report completion, and
|
|
143
|
+
* `AnimatedPresence` keeps its wrapper element stable across the flip.
|
|
144
|
+
* `Animated` itself renders the plain fallback tag whenever this is false —
|
|
145
|
+
* withholding animation props from a mounted motion component corrupts
|
|
146
|
+
* `toggle`-mode elements, so the swap (and the remount it implies) is the
|
|
147
|
+
* correct behaviour. See the render branches in `Animated`.
|
|
148
|
+
*/
|
|
149
|
+
enabled: boolean;
|
|
150
|
+
/** Animated `div`. */
|
|
151
|
+
Div: React.ElementType;
|
|
152
|
+
/** Animated `nav`. */
|
|
153
|
+
Nav: React.ElementType;
|
|
154
|
+
/** Animated `span`, for inline content that must not become a block. */
|
|
155
|
+
Span: React.ElementType;
|
|
156
|
+
/** Enables exit animations for conditionally rendered children. */
|
|
157
|
+
Presence: React.ComponentType<MotionPresenceProps>;
|
|
158
|
+
/**
|
|
159
|
+
* Props for an element that stays mounted and animates between states.
|
|
160
|
+
* Skips the initial animation so a closed drawer doesn't slide out on load.
|
|
161
|
+
*/
|
|
162
|
+
toggle: (preset: MotionPreset, open: boolean, custom?: unknown) => Record<string, unknown>;
|
|
163
|
+
/** Props for an element that mounts and unmounts inside `Presence`. */
|
|
164
|
+
presence: (preset: MotionPreset, custom?: unknown) => Record<string, unknown>;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The active motion runtime, or `null` when the app has not opted in.
|
|
168
|
+
*
|
|
169
|
+
* Components must treat `null` as the normal case and keep a CSS path that
|
|
170
|
+
* looks good on its own — motion is an enhancement, never a requirement.
|
|
171
|
+
*/
|
|
172
|
+
declare function useMotionRuntime(): MotionRuntime | null;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* `Animated` / `AnimatedPresence` — the ergonomic layer components use.
|
|
176
|
+
*
|
|
177
|
+
* These exist so an individual component never has to branch on whether motion
|
|
178
|
+
* is available. It declares the preset it wants and the CSS classes that stand
|
|
179
|
+
* in when motion is absent; this module picks the element to render.
|
|
180
|
+
*
|
|
181
|
+
* Adding motion to a further component should be a matter of swapping its
|
|
182
|
+
* root `<div>` for an `<Animated>` and naming a preset — no new imports, no
|
|
183
|
+
* new dependency, and no behavior change for apps that have not opted in.
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
interface AnimatedProps extends React.HTMLAttributes<HTMLElement> {
|
|
187
|
+
/** Intrinsic element to render. */
|
|
188
|
+
as?: 'div' | 'nav' | 'span';
|
|
189
|
+
/** Which shared animation recipe to use. */
|
|
190
|
+
preset: MotionPreset;
|
|
191
|
+
/**
|
|
192
|
+
* - `toggle` — element stays mounted and animates between open and closed.
|
|
193
|
+
* - `presence` — element mounts and unmounts; wrap it in `<AnimatedPresence>`
|
|
194
|
+
* so the exit animation gets a chance to run.
|
|
195
|
+
*/
|
|
196
|
+
mode: 'toggle' | 'presence';
|
|
197
|
+
/** Current state. Only read in `toggle` mode. */
|
|
198
|
+
open?: boolean;
|
|
199
|
+
/** Per-preset context value — see the `custom` contract in `presets.ts`. */
|
|
200
|
+
custom?: unknown;
|
|
201
|
+
/**
|
|
202
|
+
* Classes applied whenever this element is **not** animating — no provider,
|
|
203
|
+
* a disabled provider, or `enabled={false}`. This is where a component's
|
|
204
|
+
* existing CSS transition lives, so the two paths never both try to drive
|
|
205
|
+
* the same property.
|
|
206
|
+
*/
|
|
207
|
+
fallbackClassName?: string;
|
|
208
|
+
/**
|
|
209
|
+
* Set `false` to stop this element animating even when a runtime is active.
|
|
210
|
+
*
|
|
211
|
+
* For states where an animated element would be wrong rather than merely
|
|
212
|
+
* unnecessary. Motion writes a `transform` to hold an element at its resting
|
|
213
|
+
* position, and a transformed ancestor becomes the containing block for any
|
|
214
|
+
* `position: fixed` descendant — so an element that is only sometimes
|
|
215
|
+
* animated should opt out the rest of the time.
|
|
216
|
+
*
|
|
217
|
+
* Flipping this (or the provider's `disabled`) swaps the element back to a
|
|
218
|
+
* plain tag, which **remounts** it — deliberately. See the note on the
|
|
219
|
+
* render branches below.
|
|
220
|
+
*/
|
|
221
|
+
enabled?: boolean;
|
|
222
|
+
}
|
|
223
|
+
declare const Animated: React.ForwardRefExoticComponent<AnimatedProps & React.RefAttributes<HTMLElement>>;
|
|
224
|
+
/**
|
|
225
|
+
* Keeps unmounting children on screen long enough to animate out.
|
|
226
|
+
*
|
|
227
|
+
* Without a runtime this is a pass-through, so children disappear immediately —
|
|
228
|
+
* which is exactly what they do today. Children rendered conditionally inside
|
|
229
|
+
* it need a stable `key`.
|
|
230
|
+
*/
|
|
231
|
+
declare function AnimatedPresence({ children, initial, onExitComplete, }: MotionPresenceProps): React.JSX.Element;
|
|
232
|
+
declare namespace AnimatedPresence {
|
|
233
|
+
var displayName: string;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export { Animated, AnimatedPresence, type AnimatedProps, type MotionEdge, type MotionPreset, MotionProvider, type MotionProviderProps, type MotionRuntime, motionPresets, useMotionRuntime };
|
package/dist/motion.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export { A as Animated, a as AnimatedPresence, b as AnimatedProps, M as MotionEdge, c as MotionPreset, d as MotionRuntime, m as motionPresets, u as useMotionRuntime } from './Animated-XmH6k8pZ.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* `<MotionProvider>` — the opt-in switch.
|
|
@@ -49,4 +48,189 @@ declare namespace MotionProvider {
|
|
|
49
48
|
var displayName: string;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Motion presets — the shared vocabulary of animations.
|
|
53
|
+
*
|
|
54
|
+
* This module is intentionally **free of any `motion` import**. It ships in the
|
|
55
|
+
* main `@mieweb/ui` entry so components can describe *what* they animate
|
|
56
|
+
* without pulling in a runtime to actually do it. The `@mieweb/ui/motion` entry
|
|
57
|
+
* is what turns these descriptions into real animations.
|
|
58
|
+
*
|
|
59
|
+
* Every preset is expressed as an open/closed variant pair so the same
|
|
60
|
+
* definition serves both usages:
|
|
61
|
+
*
|
|
62
|
+
* - **toggle** — the element stays mounted and animates between `open` and
|
|
63
|
+
* `closed` (a drawer sliding in and out).
|
|
64
|
+
* - **presence** — the element mounts and unmounts, entering on `open` and
|
|
65
|
+
* exiting back to `closed` (a modal).
|
|
66
|
+
*/
|
|
67
|
+
/** Named animation recipes shared by components. */
|
|
68
|
+
type MotionPreset = 'drawerStart' | 'overlay' | 'modalContent' | 'sidebarLabel' | 'menu' | 'collapse' | 'toast' | 'fade' | 'pop';
|
|
69
|
+
/**
|
|
70
|
+
* A physical edge, already resolved from any logical (`start`/`end`) position
|
|
71
|
+
* and from writing direction.
|
|
72
|
+
*
|
|
73
|
+
* Presets that move an element along an axis take one of these as `custom`.
|
|
74
|
+
* Resolution is the component's job, not the preset's: only the component knows
|
|
75
|
+
* whether its `end` means right or left, and — for anything anchored — which
|
|
76
|
+
* side it actually landed on after flipping away from a viewport edge.
|
|
77
|
+
*/
|
|
78
|
+
type MotionEdge = 'top' | 'bottom' | 'left' | 'right';
|
|
79
|
+
/**
|
|
80
|
+
* A variant value. Either a plain target object or a function of the element's
|
|
81
|
+
* `custom` value — the latter lets a single preset adapt to context, e.g. a
|
|
82
|
+
* drawer flipping its off-canvas direction in RTL.
|
|
83
|
+
*/
|
|
84
|
+
type MotionVariant = Record<string, unknown> | ((custom: unknown) => Record<string, unknown>);
|
|
85
|
+
interface MotionPresetDefinition {
|
|
86
|
+
variants: {
|
|
87
|
+
open: MotionVariant;
|
|
88
|
+
closed: MotionVariant;
|
|
89
|
+
};
|
|
90
|
+
transition: Record<string, unknown>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* `custom` contract per preset:
|
|
94
|
+
*
|
|
95
|
+
* - `drawerStart` — `boolean`, whether the document direction is RTL.
|
|
96
|
+
* - `menu`, `toast` — a {@link MotionEdge}, already resolved from logical
|
|
97
|
+
* position and writing direction by the component.
|
|
98
|
+
* - `overlay`, `modalContent`, `sidebarLabel`, `collapse`, `fade`, `pop` —
|
|
99
|
+
* unused.
|
|
100
|
+
*/
|
|
101
|
+
declare const motionPresets: Record<MotionPreset, MotionPresetDefinition>;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Motion runtime — the seam between components and an optional animation library.
|
|
105
|
+
*
|
|
106
|
+
* Components in the main entry never import `motion`. They ask this module for
|
|
107
|
+
* a runtime; if an app has opted in by rendering `<MotionProvider>` from
|
|
108
|
+
* `@mieweb/ui/motion`, they get one and animate. If not, `useMotionRuntime()`
|
|
109
|
+
* returns `null` and they fall back to their existing CSS transitions. That is
|
|
110
|
+
* what keeps `motion` out of the bundle of every app that hasn't asked for it —
|
|
111
|
+
* the opt-in is resolved in the *module graph*, not by a prop.
|
|
112
|
+
*
|
|
113
|
+
* Like `presets`, this module must stay free of any `motion` import.
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
interface MotionPresenceProps {
|
|
117
|
+
children?: React.ReactNode;
|
|
118
|
+
/** Suppress the initial mount animation. */
|
|
119
|
+
initial?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Fires once every exiting child has finished and been removed.
|
|
122
|
+
*
|
|
123
|
+
* Needed by anything that guards the DOM while it is open — a focus trap, a
|
|
124
|
+
* scroll lock — because those guards must outlive `open` for as long as the
|
|
125
|
+
* subtree is still on screen. Never fires when no runtime is active, since
|
|
126
|
+
* there is no exit to wait for.
|
|
127
|
+
*/
|
|
128
|
+
onExitComplete?: () => void;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The capabilities a motion library must supply. Deliberately small: element
|
|
132
|
+
* factories, a presence wrapper, and prop builders. Components depend on this
|
|
133
|
+
* interface, never on a concrete library, so swapping or dropping the library
|
|
134
|
+
* stays a one-file change.
|
|
135
|
+
*/
|
|
136
|
+
interface MotionRuntime {
|
|
137
|
+
/**
|
|
138
|
+
* Whether animations should actually run.
|
|
139
|
+
*
|
|
140
|
+
* A disabled provider still supplies a runtime rather than `null` so that
|
|
141
|
+
* consumers can tell "disabled" apart from "never opted in": `Modal` uses it
|
|
142
|
+
* to decide whether an exit animation will ever report completion, and
|
|
143
|
+
* `AnimatedPresence` keeps its wrapper element stable across the flip.
|
|
144
|
+
* `Animated` itself renders the plain fallback tag whenever this is false —
|
|
145
|
+
* withholding animation props from a mounted motion component corrupts
|
|
146
|
+
* `toggle`-mode elements, so the swap (and the remount it implies) is the
|
|
147
|
+
* correct behaviour. See the render branches in `Animated`.
|
|
148
|
+
*/
|
|
149
|
+
enabled: boolean;
|
|
150
|
+
/** Animated `div`. */
|
|
151
|
+
Div: React.ElementType;
|
|
152
|
+
/** Animated `nav`. */
|
|
153
|
+
Nav: React.ElementType;
|
|
154
|
+
/** Animated `span`, for inline content that must not become a block. */
|
|
155
|
+
Span: React.ElementType;
|
|
156
|
+
/** Enables exit animations for conditionally rendered children. */
|
|
157
|
+
Presence: React.ComponentType<MotionPresenceProps>;
|
|
158
|
+
/**
|
|
159
|
+
* Props for an element that stays mounted and animates between states.
|
|
160
|
+
* Skips the initial animation so a closed drawer doesn't slide out on load.
|
|
161
|
+
*/
|
|
162
|
+
toggle: (preset: MotionPreset, open: boolean, custom?: unknown) => Record<string, unknown>;
|
|
163
|
+
/** Props for an element that mounts and unmounts inside `Presence`. */
|
|
164
|
+
presence: (preset: MotionPreset, custom?: unknown) => Record<string, unknown>;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The active motion runtime, or `null` when the app has not opted in.
|
|
168
|
+
*
|
|
169
|
+
* Components must treat `null` as the normal case and keep a CSS path that
|
|
170
|
+
* looks good on its own — motion is an enhancement, never a requirement.
|
|
171
|
+
*/
|
|
172
|
+
declare function useMotionRuntime(): MotionRuntime | null;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* `Animated` / `AnimatedPresence` — the ergonomic layer components use.
|
|
176
|
+
*
|
|
177
|
+
* These exist so an individual component never has to branch on whether motion
|
|
178
|
+
* is available. It declares the preset it wants and the CSS classes that stand
|
|
179
|
+
* in when motion is absent; this module picks the element to render.
|
|
180
|
+
*
|
|
181
|
+
* Adding motion to a further component should be a matter of swapping its
|
|
182
|
+
* root `<div>` for an `<Animated>` and naming a preset — no new imports, no
|
|
183
|
+
* new dependency, and no behavior change for apps that have not opted in.
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
interface AnimatedProps extends React.HTMLAttributes<HTMLElement> {
|
|
187
|
+
/** Intrinsic element to render. */
|
|
188
|
+
as?: 'div' | 'nav' | 'span';
|
|
189
|
+
/** Which shared animation recipe to use. */
|
|
190
|
+
preset: MotionPreset;
|
|
191
|
+
/**
|
|
192
|
+
* - `toggle` — element stays mounted and animates between open and closed.
|
|
193
|
+
* - `presence` — element mounts and unmounts; wrap it in `<AnimatedPresence>`
|
|
194
|
+
* so the exit animation gets a chance to run.
|
|
195
|
+
*/
|
|
196
|
+
mode: 'toggle' | 'presence';
|
|
197
|
+
/** Current state. Only read in `toggle` mode. */
|
|
198
|
+
open?: boolean;
|
|
199
|
+
/** Per-preset context value — see the `custom` contract in `presets.ts`. */
|
|
200
|
+
custom?: unknown;
|
|
201
|
+
/**
|
|
202
|
+
* Classes applied whenever this element is **not** animating — no provider,
|
|
203
|
+
* a disabled provider, or `enabled={false}`. This is where a component's
|
|
204
|
+
* existing CSS transition lives, so the two paths never both try to drive
|
|
205
|
+
* the same property.
|
|
206
|
+
*/
|
|
207
|
+
fallbackClassName?: string;
|
|
208
|
+
/**
|
|
209
|
+
* Set `false` to stop this element animating even when a runtime is active.
|
|
210
|
+
*
|
|
211
|
+
* For states where an animated element would be wrong rather than merely
|
|
212
|
+
* unnecessary. Motion writes a `transform` to hold an element at its resting
|
|
213
|
+
* position, and a transformed ancestor becomes the containing block for any
|
|
214
|
+
* `position: fixed` descendant — so an element that is only sometimes
|
|
215
|
+
* animated should opt out the rest of the time.
|
|
216
|
+
*
|
|
217
|
+
* Flipping this (or the provider's `disabled`) swaps the element back to a
|
|
218
|
+
* plain tag, which **remounts** it — deliberately. See the note on the
|
|
219
|
+
* render branches below.
|
|
220
|
+
*/
|
|
221
|
+
enabled?: boolean;
|
|
222
|
+
}
|
|
223
|
+
declare const Animated: React.ForwardRefExoticComponent<AnimatedProps & React.RefAttributes<HTMLElement>>;
|
|
224
|
+
/**
|
|
225
|
+
* Keeps unmounting children on screen long enough to animate out.
|
|
226
|
+
*
|
|
227
|
+
* Without a runtime this is a pass-through, so children disappear immediately —
|
|
228
|
+
* which is exactly what they do today. Children rendered conditionally inside
|
|
229
|
+
* it need a stable `key`.
|
|
230
|
+
*/
|
|
231
|
+
declare function AnimatedPresence({ children, initial, onExitComplete, }: MotionPresenceProps): React.JSX.Element;
|
|
232
|
+
declare namespace AnimatedPresence {
|
|
233
|
+
var displayName: string;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export { Animated, AnimatedPresence, type AnimatedProps, type MotionEdge, type MotionPreset, MotionProvider, type MotionProviderProps, type MotionRuntime, motionPresets, useMotionRuntime };
|
package/dist/q.d.cts
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { AgentConfigGeneratorProps, QConfig, QSchema } from '@mieweb/q';
|
|
2
4
|
export { AgentConfigGenerator, AgentConfigGeneratorProps, ConfigEditor, ConfigEditorProps, FormBuilder, FormBuilderProps, GENERIC_TOOLS, Header, HeaderProps, QConfig, QDownloadMode, QSchema, TIMEZONES, ToolBuilder, ToolBuilderProps, configToQuestionnaire, configToYaml, copyToClipboard, defaultSchema, deriveDefaultConfig, downloadConfig, questionnaireToConfig, validateConfig, yamlToConfig } from '@mieweb/q';
|
|
3
5
|
export { UniversalAgentConfigGenerator, UniversalAgentConfigGeneratorOptions, brands, generateBrandCSS } from '@mieweb/q/universal';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
interface QProps extends AgentConfigGeneratorProps {
|
|
8
|
+
/** Additional class name for the Q container. */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Inline styles for the Q container. */
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Q is the agent config generator form surface.
|
|
15
|
+
*
|
|
16
|
+
* It wraps the published @mieweb/q form generator so it can be consumed through
|
|
17
|
+
* @mieweb/ui/q while keeping Q's heavier dependencies out of the main UI entry.
|
|
18
|
+
*/
|
|
19
|
+
declare function Q({ className, style, ...props }: QProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
|
|
21
|
+
declare const qTwilioAgentSchema: QSchema;
|
|
22
|
+
declare const qAgentSchema: QSchema;
|
|
23
|
+
declare const qLandingPageAgentConfig: QConfig;
|
|
24
|
+
declare function createQAgentConfig(): QConfig;
|
|
25
|
+
declare function createQTwilioAgentConfig(): QConfig;
|
|
26
|
+
|
|
27
|
+
export { Q, type QProps, createQAgentConfig, createQTwilioAgentConfig, qAgentSchema, qLandingPageAgentConfig, qTwilioAgentSchema };
|
package/dist/q.d.ts
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { AgentConfigGeneratorProps, QConfig, QSchema } from '@mieweb/q';
|
|
2
4
|
export { AgentConfigGenerator, AgentConfigGeneratorProps, ConfigEditor, ConfigEditorProps, FormBuilder, FormBuilderProps, GENERIC_TOOLS, Header, HeaderProps, QConfig, QDownloadMode, QSchema, TIMEZONES, ToolBuilder, ToolBuilderProps, configToQuestionnaire, configToYaml, copyToClipboard, defaultSchema, deriveDefaultConfig, downloadConfig, questionnaireToConfig, validateConfig, yamlToConfig } from '@mieweb/q';
|
|
3
5
|
export { UniversalAgentConfigGenerator, UniversalAgentConfigGeneratorOptions, brands, generateBrandCSS } from '@mieweb/q/universal';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
interface QProps extends AgentConfigGeneratorProps {
|
|
8
|
+
/** Additional class name for the Q container. */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Inline styles for the Q container. */
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Q is the agent config generator form surface.
|
|
15
|
+
*
|
|
16
|
+
* It wraps the published @mieweb/q form generator so it can be consumed through
|
|
17
|
+
* @mieweb/ui/q while keeping Q's heavier dependencies out of the main UI entry.
|
|
18
|
+
*/
|
|
19
|
+
declare function Q({ className, style, ...props }: QProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
|
|
21
|
+
declare const qTwilioAgentSchema: QSchema;
|
|
22
|
+
declare const qAgentSchema: QSchema;
|
|
23
|
+
declare const qLandingPageAgentConfig: QConfig;
|
|
24
|
+
declare function createQAgentConfig(): QConfig;
|
|
25
|
+
declare function createQTwilioAgentConfig(): QConfig;
|
|
26
|
+
|
|
27
|
+
export { Q, type QProps, createQAgentConfig, createQTwilioAgentConfig, qAgentSchema, qLandingPageAgentConfig, qTwilioAgentSchema };
|
|
@@ -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 };
|