@mieweb/ui 0.10.0-dev.11 → 0.10.0-dev.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/Input-yN516s5_.d.cts +3 -0
  2. package/dist/Input-yN516s5_.d.ts +3 -0
  3. package/dist/ag-grid.d.cts +142 -1
  4. package/dist/ag-grid.d.ts +142 -1
  5. package/dist/{chunk-3M7TAXNR.js → chunk-3YFJBUX4.js} +3 -3
  6. package/dist/{chunk-3M7TAXNR.js.map → chunk-3YFJBUX4.js.map} +1 -1
  7. package/dist/{chunk-ACCAXVOG.js → chunk-4CXGT3P7.js} +61 -41
  8. package/dist/chunk-4CXGT3P7.js.map +1 -0
  9. package/dist/{chunk-OD47TTAW.cjs → chunk-V43ZFGCE.cjs} +9 -9
  10. package/dist/{chunk-OD47TTAW.cjs.map → chunk-V43ZFGCE.cjs.map} +1 -1
  11. package/dist/{chunk-X4XPNTCZ.cjs → chunk-YQ2NQV5C.cjs} +61 -41
  12. package/dist/chunk-YQ2NQV5C.cjs.map +1 -0
  13. package/dist/components/Alert/index.d.cts +1 -1
  14. package/dist/components/Alert/index.d.ts +1 -1
  15. package/dist/components/AlertDialog/index.d.cts +28 -3
  16. package/dist/components/AlertDialog/index.d.ts +28 -3
  17. package/dist/components/AudioRecorder/index.d.cts +2 -2
  18. package/dist/components/AudioRecorder/index.d.ts +2 -2
  19. package/dist/components/Autocomplete/index.d.cts +8 -2
  20. package/dist/components/Autocomplete/index.d.ts +8 -2
  21. package/dist/components/Avatar/index.d.cts +1 -1
  22. package/dist/components/Avatar/index.d.ts +1 -1
  23. package/dist/components/Badge/index.d.cts +1 -1
  24. package/dist/components/Badge/index.d.ts +1 -1
  25. package/dist/components/BoardView/index.d.cts +91 -4
  26. package/dist/components/BoardView/index.d.ts +91 -4
  27. package/dist/components/Button/index.d.cts +1 -1
  28. package/dist/components/Button/index.d.ts +1 -1
  29. package/dist/components/CalendarView/index.d.cts +1 -2
  30. package/dist/components/CalendarView/index.d.ts +1 -2
  31. package/dist/components/Card/index.d.cts +3 -3
  32. package/dist/components/Card/index.d.ts +3 -3
  33. package/dist/components/Dropdown/index.d.cts +2 -1
  34. package/dist/components/Dropdown/index.d.ts +2 -1
  35. package/dist/components/GanttView/index.d.cts +1 -2
  36. package/dist/components/GanttView/index.d.ts +1 -2
  37. package/dist/components/ListView/index.d.cts +2 -3
  38. package/dist/components/ListView/index.d.ts +2 -3
  39. package/dist/components/MediaEditor/index.d.cts +91 -2
  40. package/dist/components/MediaEditor/index.d.ts +91 -2
  41. package/dist/components/MediaPlayer/index.d.cts +1 -1
  42. package/dist/components/MediaPlayer/index.d.ts +1 -1
  43. package/dist/components/Pagination/index.d.cts +1 -1
  44. package/dist/components/Pagination/index.d.ts +1 -1
  45. package/dist/components/PhoneInput/index.d.cts +36 -3
  46. package/dist/components/PhoneInput/index.d.ts +36 -3
  47. package/dist/components/Progress/index.d.cts +1 -1
  48. package/dist/components/Progress/index.d.ts +1 -1
  49. package/dist/components/Q/index.d.cts +2 -2
  50. package/dist/components/Q/index.d.ts +2 -2
  51. package/dist/components/QuickAction/index.d.cts +1 -1
  52. package/dist/components/QuickAction/index.d.ts +1 -1
  53. package/dist/components/RecordButton/index.d.cts +1 -1
  54. package/dist/components/RecordButton/index.d.ts +1 -1
  55. package/dist/components/RichTextEditor/index.d.cts +7 -2
  56. package/dist/components/RichTextEditor/index.d.ts +7 -2
  57. package/dist/components/ScrollArea/index.d.cts +1 -1
  58. package/dist/components/ScrollArea/index.d.ts +1 -1
  59. package/dist/components/Select/index.d.cts +1 -2
  60. package/dist/components/Select/index.d.ts +1 -2
  61. package/dist/components/Skeleton/index.d.cts +1 -1
  62. package/dist/components/Skeleton/index.d.ts +1 -1
  63. package/dist/components/Slider/index.d.cts +2 -2
  64. package/dist/components/Slider/index.d.ts +2 -2
  65. package/dist/components/Spinner/index.d.cts +2 -2
  66. package/dist/components/Spinner/index.d.ts +2 -2
  67. package/dist/components/SuperChat/index.cjs +3 -3
  68. package/dist/components/SuperChat/index.d.cts +2 -4
  69. package/dist/components/SuperChat/index.d.ts +2 -4
  70. package/dist/components/SuperChat/index.js +1 -1
  71. package/dist/components/SuperChat/plugins/index.cjs +3 -3
  72. package/dist/components/SuperChat/plugins/index.d.cts +2 -3
  73. package/dist/components/SuperChat/plugins/index.d.ts +2 -3
  74. package/dist/components/SuperChat/plugins/index.js +2 -2
  75. package/dist/components/Text/index.d.cts +3 -3
  76. package/dist/components/Text/index.d.ts +3 -3
  77. package/dist/components/Textarea/index.d.cts +1 -2
  78. package/dist/components/Textarea/index.d.ts +1 -2
  79. package/dist/components/ThemeProvider/index.d.cts +3 -1
  80. package/dist/components/ThemeProvider/index.d.ts +3 -1
  81. package/dist/components/TranscriptView/index.d.cts +85 -4
  82. package/dist/components/TranscriptView/index.d.ts +85 -4
  83. package/dist/components/ViewSet/index.d.cts +120 -9
  84. package/dist/components/ViewSet/index.d.ts +120 -9
  85. package/dist/components/ViewSwitcher/index.d.cts +4 -40
  86. package/dist/components/ViewSwitcher/index.d.ts +4 -40
  87. package/dist/datavis.d.cts +167 -13
  88. package/dist/datavis.d.ts +167 -13
  89. package/dist/esheet.d.cts +183 -1
  90. package/dist/esheet.d.ts +183 -1
  91. package/dist/hooks/index.d.cts +383 -31
  92. package/dist/hooks/index.d.ts +383 -31
  93. package/dist/index-DoYYWsNc.d.cts +127 -0
  94. package/dist/index-DoYYWsNc.d.ts +127 -0
  95. package/dist/index.cjs +47 -47
  96. package/dist/index.d.cts +7600 -414
  97. package/dist/index.d.ts +7600 -414
  98. package/dist/index.js +4 -4
  99. package/dist/motion.d.cts +186 -2
  100. package/dist/motion.d.ts +186 -2
  101. package/dist/q.d.cts +25 -3
  102. package/dist/q.d.ts +25 -3
  103. package/dist/styles.css +1 -1
  104. package/dist/{types-B97JNRNQ.d.cts → types-DOxdTwmq.d.cts} +170 -2
  105. package/dist/{types-gZXrfLj6.d.ts → types-DOxdTwmq.d.ts} +170 -2
  106. package/dist/{types-CbWXIKbe.d.cts → types-DsdZvEI1.d.cts} +1 -28
  107. package/dist/{types-CbWXIKbe.d.ts → types-DsdZvEI1.d.ts} +1 -28
  108. package/dist/utils/index.d.cts +13 -2
  109. package/dist/utils/index.d.ts +13 -2
  110. package/package.json +3 -2
  111. package/dist/Animated-XmH6k8pZ.d.cts +0 -188
  112. package/dist/Animated-XmH6k8pZ.d.ts +0 -188
  113. package/dist/MedicationEditor-Bp4NLy7y.d.cts +0 -352
  114. package/dist/MedicationEditor-Bp4NLy7y.d.ts +0 -352
  115. package/dist/chunk-ACCAXVOG.js.map +0 -1
  116. package/dist/chunk-X4XPNTCZ.cjs.map +0 -1
  117. package/dist/html-MdxqSzjD.d.cts +0 -13
  118. package/dist/html-MdxqSzjD.d.ts +0 -13
  119. package/dist/orderRows-BUJYgSc7.d.cts +0 -221
  120. package/dist/orderRows-BUJYgSc7.d.ts +0 -221
  121. package/dist/transcript-Cg7uSW-C.d.cts +0 -84
  122. package/dist/transcript-Cg7uSW-C.d.ts +0 -84
  123. package/dist/types-CnPEwzlp.d.cts +0 -254
  124. package/dist/types-CnPEwzlp.d.ts +0 -254
  125. package/dist/useAnchoredPosition-CKwLSQW8.d.cts +0 -76
  126. package/dist/useAnchoredPosition-CKwLSQW8.d.ts +0 -76
  127. package/dist/useTheme-B9SWu6ui.d.cts +0 -24
  128. package/dist/useTheme-B9SWu6ui.d.ts +0 -24
  129. package/dist/useTranscriptEdits-CGzlemHT.d.cts +0 -182
  130. package/dist/useTranscriptEdits-D32bLs0l.d.ts +0 -182
package/dist/index.js CHANGED
@@ -31,10 +31,10 @@ export { SourceTip } from './chunk-Z5V7SAZ4.js';
31
31
  export { Sparkline } from './chunk-CG4ZKJLE.js';
32
32
  import { SparklesIcon, RefreshIcon, CloseIcon, JumpToBottomButton, AIMessageDisplay } from './chunk-TZJQB4P2.js';
33
33
  export { AILogoIcon, AIMessageDisplay, AITypingIndicator, ChatBubble, ChevronIcon, CloseIcon, CollapsiblePill, MCPToolCallDisplay, MessageAvatar, RefreshIcon, ResourceLink, SendIcon, SparklesIcon, SpinnerIcon, ToolStatusIcon, getToolIcon } from './chunk-TZJQB4P2.js';
34
- import { useTypingEmulation, EmptyState } from './chunk-3M7TAXNR.js';
35
- export { AttachmentPreview, ConversationHeader, ConversationListItem, ConversationListSkeleton, DateSeparator, EmptyState, LightboxModal, LoadMoreButton, MessageBubble, MessageList, MessageStatusIcon, MessageThread, MessagingSplitView, ReadReceiptIndicator, SkeletonMessage, TypingIndicator, bubbleVariants, formatDateLabel, formatFileSize, formatLastSeen, getConversationSubtitle, getConversationTitle, groupMessagesByDate, headerVariants, isSameSenderGroup, useMessageScroll, useMessages, useReadReceipts, useTypingEmulation, useTypingIndicator } from './chunk-3M7TAXNR.js';
36
- import { notifyComposerMigrationOnce, ChatComposer, DEFAULT_MAX_FILE_SIZE, DEFAULT_ACCEPTED_FILE_TYPES } from './chunk-ACCAXVOG.js';
37
- export { AttachmentPicker, AttachmentPreviewItem, CameraButton, ChatComposer, ComposerModelSelector, DragDropZone, generateAttachmentId, getFileType, validateFile } from './chunk-ACCAXVOG.js';
34
+ import { useTypingEmulation, EmptyState } from './chunk-3YFJBUX4.js';
35
+ export { AttachmentPreview, ConversationHeader, ConversationListItem, ConversationListSkeleton, DateSeparator, EmptyState, LightboxModal, LoadMoreButton, MessageBubble, MessageList, MessageStatusIcon, MessageThread, MessagingSplitView, ReadReceiptIndicator, SkeletonMessage, TypingIndicator, bubbleVariants, formatDateLabel, formatFileSize, formatLastSeen, getConversationSubtitle, getConversationTitle, groupMessagesByDate, headerVariants, isSameSenderGroup, useMessageScroll, useMessages, useReadReceipts, useTypingEmulation, useTypingIndicator } from './chunk-3YFJBUX4.js';
36
+ import { notifyComposerMigrationOnce, ChatComposer, DEFAULT_MAX_FILE_SIZE, DEFAULT_ACCEPTED_FILE_TYPES } from './chunk-4CXGT3P7.js';
37
+ export { AttachmentPicker, AttachmentPreviewItem, CameraButton, ChatComposer, ComposerModelSelector, DragDropZone, generateAttachmentId, getFileType, validateFile } from './chunk-4CXGT3P7.js';
38
38
  import { RecordButton } from './chunk-VNWJTCBQ.js';
39
39
  export { RecordButton, formatDuration, recordButtonVariants } from './chunk-VNWJTCBQ.js';
40
40
  export { RichTextEditor, convertAngleBracketsToMustache, processDictation } from './chunk-OE5CKRUC.js';
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
- export { MotionProvider, type MotionProviderProps };
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
- export { MotionProvider, type MotionProviderProps };
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
- export { Q, QProps, createQAgentConfig, createQTwilioAgentConfig, qAgentSchema, qLandingPageAgentConfig, qTwilioAgentSchema } from './components/Q/index.cjs';
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
- import 'react/jsx-runtime';
5
- import 'react';
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
- export { Q, QProps, createQAgentConfig, createQTwilioAgentConfig, qAgentSchema, qLandingPageAgentConfig, qTwilioAgentSchema } from './components/Q/index.js';
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
- import 'react/jsx-runtime';
5
- import 'react';
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 };