@efolusi/meridian 1.19.1 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/README.md +1 -1
  2. package/ai/Bubble.d.ts +16 -0
  3. package/ai/Bubble.js +71 -0
  4. package/ai/ChatMessage.js +2 -5
  5. package/ai/Confirmation.d.ts +0 -7
  6. package/ai/Confirmation.js +3 -6
  7. package/ai/GeneratedImage.d.ts +0 -2
  8. package/ai/GeneratedImage.js +2 -4
  9. package/ai/Marker.d.ts +26 -0
  10. package/ai/Marker.js +67 -0
  11. package/ai/Message.d.ts +13 -0
  12. package/ai/Message.js +68 -0
  13. package/ai/MessageScroller.d.ts +21 -0
  14. package/ai/MessageScroller.js +283 -0
  15. package/ai/ModelSelector.d.ts +2 -2
  16. package/ai/ModelSelector.js +1 -2
  17. package/ai/Player.js +1 -1
  18. package/ai/PromptSteps.js +4 -2
  19. package/ai/Sandbox.d.ts +0 -2
  20. package/ai/Sandbox.js +2 -4
  21. package/ai/Suggestions.d.ts +0 -2
  22. package/ai/Suggestions.js +1 -4
  23. package/ai/WebPreview.d.ts +0 -2
  24. package/ai/WebPreview.js +2 -4
  25. package/code/Console.js +1 -1
  26. package/code/EnvList.d.ts +0 -2
  27. package/code/EnvList.js +2 -3
  28. package/components.css +660 -423
  29. package/data/BarChart.d.ts +0 -2
  30. package/data/BarChart.js +1 -4
  31. package/data/Chart.d.ts +14 -0
  32. package/data/Chart.js +149 -0
  33. package/data/EmptyState.d.ts +8 -13
  34. package/data/EmptyState.js +62 -24
  35. package/data/LineChart.js +7 -4
  36. package/data/Skeleton.d.ts +2 -11
  37. package/data/Skeleton.js +8 -38
  38. package/data/Sparkline.js +4 -1
  39. package/data/StatusDot.d.ts +0 -4
  40. package/data/StatusDot.js +3 -6
  41. package/data/Table.d.ts +11 -4
  42. package/data/Table.js +39 -7
  43. package/dates/Calendar.d.ts +10 -27
  44. package/dates/Calendar.js +250 -184
  45. package/dates/TimePicker.js +2 -2
  46. package/display/Accordion.d.ts +47 -15
  47. package/display/Accordion.js +257 -27
  48. package/display/AspectRatio.d.ts +4 -6
  49. package/display/AspectRatio.js +7 -5
  50. package/display/Avatar.d.ts +17 -14
  51. package/display/Avatar.js +68 -43
  52. package/display/Badge.d.ts +9 -8
  53. package/display/Badge.js +32 -14
  54. package/display/Card.d.ts +11 -13
  55. package/display/Card.js +74 -29
  56. package/display/Carousel.d.ts +23 -15
  57. package/display/Carousel.js +217 -66
  58. package/display/Collapsible.d.ts +19 -9
  59. package/display/Collapsible.js +140 -28
  60. package/display/Direction.d.ts +10 -0
  61. package/display/Direction.js +24 -0
  62. package/display/Item.d.ts +19 -0
  63. package/display/Item.js +152 -0
  64. package/display/Kbd.d.ts +5 -7
  65. package/display/Kbd.js +22 -10
  66. package/display/Link.js +2 -4
  67. package/display/Resizable.d.ts +6 -16
  68. package/display/Resizable.js +141 -58
  69. package/display/ScrollArea.d.ts +3 -1
  70. package/display/ScrollArea.js +30 -5
  71. package/display/Separator.d.ts +9 -0
  72. package/display/Separator.js +18 -0
  73. package/display/Timeline.d.ts +24 -0
  74. package/display/Timeline.js +51 -0
  75. package/display/Toolbar.js +5 -4
  76. package/display/TreeList.d.ts +0 -2
  77. package/display/TreeList.js +2 -5
  78. package/feedback/Alert.d.ts +13 -13
  79. package/feedback/Alert.js +40 -36
  80. package/feedback/AlertDialog.d.ts +30 -0
  81. package/feedback/AlertDialog.js +249 -0
  82. package/feedback/Banner.d.ts +1 -3
  83. package/feedback/Banner.js +1 -5
  84. package/feedback/ConfirmDialog.d.ts +1 -1
  85. package/feedback/ConfirmDialog.js +18 -20
  86. package/feedback/Dialog.d.ts +13 -16
  87. package/feedback/Dialog.js +204 -62
  88. package/feedback/Progress.d.ts +8 -9
  89. package/feedback/Progress.js +42 -24
  90. package/feedback/Sonner.d.ts +8 -0
  91. package/feedback/Sonner.js +238 -0
  92. package/feedback/Spinner.d.ts +2 -9
  93. package/feedback/Spinner.js +19 -28
  94. package/feedback/Tooltip.d.ts +9 -10
  95. package/feedback/Tooltip.js +147 -96
  96. package/files/Attachment.d.ts +27 -0
  97. package/files/Attachment.js +111 -0
  98. package/files/FileDrop.js +3 -1
  99. package/finance/PaymentCard.js +3 -3
  100. package/forms/Button.d.ts +6 -5
  101. package/forms/Button.js +42 -8
  102. package/forms/ButtonGroup.d.ts +11 -3
  103. package/forms/ButtonGroup.js +57 -6
  104. package/forms/Checkbox.d.ts +14 -3
  105. package/forms/Checkbox.js +84 -16
  106. package/forms/Combobox.d.ts +24 -16
  107. package/forms/Combobox.js +466 -135
  108. package/forms/Field.d.ts +14 -0
  109. package/forms/Field.js +99 -0
  110. package/forms/IconButton.d.ts +1 -1
  111. package/forms/IconButton.js +4 -3
  112. package/forms/Input.d.ts +8 -8
  113. package/forms/Input.js +46 -33
  114. package/forms/InputGroup.d.ts +8 -15
  115. package/forms/InputGroup.js +74 -35
  116. package/forms/InputOTP.d.ts +13 -0
  117. package/forms/InputOTP.js +125 -0
  118. package/forms/Label.d.ts +2 -6
  119. package/forms/Label.js +6 -4
  120. package/forms/NativeSelect.d.ts +16 -0
  121. package/forms/NativeSelect.js +35 -0
  122. package/forms/NumberInput.js +2 -2
  123. package/forms/Radio.d.ts +12 -1
  124. package/forms/Radio.js +76 -6
  125. package/forms/Select.d.ts +12 -9
  126. package/forms/Select.js +254 -42
  127. package/forms/Slider.d.ts +10 -17
  128. package/forms/Slider.js +78 -39
  129. package/forms/Switch.d.ts +8 -2
  130. package/forms/Switch.js +46 -15
  131. package/forms/Textarea.d.ts +1 -1
  132. package/forms/Textarea.js +26 -18
  133. package/forms/Toggle.d.ts +18 -15
  134. package/forms/Toggle.js +96 -42
  135. package/icons/_svg.js +2 -0
  136. package/index.d.ts +20 -8
  137. package/index.js +50 -38
  138. package/navigation/Breadcrumbs.d.ts +18 -11
  139. package/navigation/Breadcrumbs.js +99 -26
  140. package/navigation/Menubar.d.ts +52 -10
  141. package/navigation/Menubar.js +191 -146
  142. package/navigation/NavigationMenu.d.ts +15 -0
  143. package/navigation/NavigationMenu.js +296 -0
  144. package/navigation/Pagination.d.ts +10 -9
  145. package/navigation/Pagination.js +94 -51
  146. package/navigation/SideNav.js +4 -3
  147. package/navigation/Sidebar.d.ts +29 -0
  148. package/navigation/Sidebar.js +311 -0
  149. package/navigation/Tabs.d.ts +9 -5
  150. package/navigation/Tabs.js +132 -44
  151. package/overlay/Command.d.ts +32 -0
  152. package/overlay/Command.js +257 -0
  153. package/overlay/ContextMenu.d.ts +40 -8
  154. package/overlay/ContextMenu.js +468 -107
  155. package/overlay/Drawer.d.ts +29 -14
  156. package/overlay/Drawer.js +178 -80
  157. package/overlay/DropdownMenu.d.ts +43 -0
  158. package/overlay/DropdownMenu.js +502 -0
  159. package/overlay/HoverCard.d.ts +21 -12
  160. package/overlay/HoverCard.js +129 -61
  161. package/overlay/Popover.d.ts +11 -13
  162. package/overlay/Popover.js +138 -65
  163. package/overlay/Portal.js +21 -7
  164. package/overlay/Sheet.d.ts +11 -0
  165. package/overlay/Sheet.js +62 -0
  166. package/package.json +4 -1
  167. package/tokens/base.css +1 -1
  168. package/dates/DatePicker.d.ts +0 -14
  169. package/dates/DatePicker.js +0 -111
  170. package/dates/DateRangePicker.d.ts +0 -23
  171. package/dates/DateRangePicker.js +0 -150
  172. package/display/ListItem.d.ts +0 -19
  173. package/display/ListItem.js +0 -50
  174. package/feedback/Toast.d.ts +0 -78
  175. package/feedback/Toast.js +0 -192
  176. package/forms/DigitEntry.d.ts +0 -15
  177. package/forms/DigitEntry.js +0 -79
  178. package/forms/FormField.d.ts +0 -82
  179. package/forms/FormField.js +0 -209
  180. package/overlay/CommandPalette.d.ts +0 -21
  181. package/overlay/CommandPalette.js +0 -148
  182. package/overlay/Menu.d.ts +0 -24
  183. package/overlay/Menu.js +0 -139
@@ -0,0 +1,283 @@
1
+ 'use client';
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ import React from 'react';
4
+ import { mergeRefs } from "../forms/Button.js";
5
+ import { Icon } from "../icons/Icon.js";
6
+ const MessageScrollerContext = /*#__PURE__*/React.createContext(null);
7
+ const join = (...values) => values.filter(Boolean).join(' ');
8
+ const EDGE_EPSILON = 2;
9
+ function readRows(viewport) {
10
+ return viewport ? Array.from(viewport.querySelectorAll('[data-slot="message-scroller-item"]')) : [];
11
+ }
12
+ export function MessageScrollerProvider({
13
+ autoScroll = false,
14
+ defaultScrollPosition = 'last-anchor',
15
+ preserveScrollOnPrepend = true,
16
+ scrollPreviousItemPeek = 64,
17
+ children
18
+ }) {
19
+ const viewportRef = React.useRef(null);
20
+ const initializedRef = React.useRef(false);
21
+ const followingRef = React.useRef(autoScroll);
22
+ const automaticRef = React.useRef(false);
23
+ const previousRef = React.useRef({
24
+ firstId: null,
25
+ lastId: null,
26
+ height: 0,
27
+ anchorId: null
28
+ });
29
+ const [scrollable, setScrollable] = React.useState({
30
+ start: false,
31
+ end: false
32
+ });
33
+ const [visibility, setVisibility] = React.useState({
34
+ currentAnchorId: null,
35
+ visibleMessageIds: []
36
+ });
37
+ const [autoscrolling, setAutoscrolling] = React.useState(false);
38
+ const readState = React.useCallback(() => {
39
+ const viewport = viewportRef.current;
40
+ if (!viewport) return {
41
+ start: false,
42
+ end: false
43
+ };
44
+ const next = {
45
+ start: viewport.scrollTop > EDGE_EPSILON,
46
+ end: viewport.scrollTop + viewport.clientHeight < viewport.scrollHeight - EDGE_EPSILON
47
+ };
48
+ setScrollable(current => current.start === next.start && current.end === next.end ? current : next);
49
+ const box = viewport.getBoundingClientRect();
50
+ const rows = readRows(viewport);
51
+ const visibleMessageIds = rows.filter(row => {
52
+ const rect = row.getBoundingClientRect();
53
+ return rect.bottom > box.top && rect.top < box.bottom;
54
+ }).map(row => row.dataset.messageId).filter(Boolean);
55
+ const currentAnchor = rows.filter(row => row.dataset.scrollAnchor === 'true' && row.getBoundingClientRect().top <= box.top + scrollPreviousItemPeek + 1).at(-1) || rows.find(row => row.dataset.scrollAnchor === 'true' && row.getBoundingClientRect().bottom > box.top);
56
+ const currentAnchorId = currentAnchor?.dataset.messageId || null;
57
+ setVisibility(current => current.currentAnchorId === currentAnchorId && current.visibleMessageIds.join('\0') === visibleMessageIds.join('\0') ? current : {
58
+ currentAnchorId,
59
+ visibleMessageIds
60
+ });
61
+ return next;
62
+ }, [scrollPreviousItemPeek]);
63
+ const move = React.useCallback((top, behavior = 'smooth', follow = false) => {
64
+ const viewport = viewportRef.current;
65
+ if (!viewport) return;
66
+ automaticRef.current = true;
67
+ followingRef.current = follow;
68
+ setAutoscrolling(true);
69
+ viewport.scrollTo({
70
+ top,
71
+ behavior
72
+ });
73
+ requestAnimationFrame(() => requestAnimationFrame(() => {
74
+ automaticRef.current = false;
75
+ setAutoscrolling(false);
76
+ readState();
77
+ }));
78
+ }, [readState]);
79
+ const scrollToStart = React.useCallback(options => move(0, options?.behavior, false), [move]);
80
+ const scrollToEnd = React.useCallback(options => {
81
+ const viewport = viewportRef.current;
82
+ if (viewport) move(viewport.scrollHeight, options?.behavior, true);
83
+ }, [move]);
84
+ const scrollToMessage = React.useCallback((messageId, options) => {
85
+ const viewport = viewportRef.current;
86
+ const row = readRows(viewport).find(item => item.dataset.messageId === String(messageId));
87
+ if (!viewport || !row) return false;
88
+ move(Math.max(0, row.offsetTop - (options?.offset ?? scrollPreviousItemPeek)), options?.behavior, false);
89
+ return true;
90
+ }, [move, scrollPreviousItemPeek]);
91
+ const setViewport = React.useCallback(node => {
92
+ viewportRef.current = node;
93
+ }, []);
94
+ const handleScroll = React.useCallback(event => {
95
+ const next = readState();
96
+ if (!automaticRef.current) followingRef.current = autoScroll && !next.end;
97
+ return event;
98
+ }, [autoScroll, readState]);
99
+ React.useEffect(() => {
100
+ const viewport = viewportRef.current;
101
+ if (!viewport) return;
102
+ const reconcile = () => {
103
+ const rows = readRows(viewport);
104
+ const firstId = rows[0]?.dataset.messageId || null;
105
+ const lastId = rows.at(-1)?.dataset.messageId || null;
106
+ const lastAnchor = rows.filter(row => row.dataset.scrollAnchor === 'true').at(-1);
107
+ const lastAnchorId = lastAnchor?.dataset.messageId || null;
108
+ const previous = previousRef.current;
109
+ if (!initializedRef.current) {
110
+ initializedRef.current = true;
111
+ if (defaultScrollPosition === 'end') viewport.scrollTop = viewport.scrollHeight;else if (defaultScrollPosition === 'last-anchor') {
112
+ const anchoredTurnFits = lastAnchor && viewport.scrollHeight - lastAnchor.offsetTop <= viewport.clientHeight;
113
+ viewport.scrollTop = lastAnchor && !anchoredTurnFits ? Math.max(0, lastAnchor.offsetTop - scrollPreviousItemPeek) : viewport.scrollHeight;
114
+ }
115
+ } else if (preserveScrollOnPrepend && previous.firstId && firstId !== previous.firstId && previous.lastId === lastId) {
116
+ viewport.scrollTop += viewport.scrollHeight - previous.height;
117
+ } else if (lastAnchorId && lastAnchorId !== previous.anchorId && lastId !== previous.lastId) {
118
+ viewport.scrollTop = Math.max(0, lastAnchor.offsetTop - scrollPreviousItemPeek);
119
+ } else if (autoScroll && followingRef.current && viewport.scrollHeight !== previous.height) {
120
+ viewport.scrollTop = viewport.scrollHeight;
121
+ }
122
+ previousRef.current = {
123
+ firstId,
124
+ lastId,
125
+ height: viewport.scrollHeight,
126
+ anchorId: lastAnchorId
127
+ };
128
+ readState();
129
+ };
130
+ reconcile();
131
+ const mutation = new MutationObserver(reconcile);
132
+ mutation.observe(viewport, {
133
+ childList: true,
134
+ subtree: true,
135
+ characterData: true
136
+ });
137
+ const resize = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(reconcile);
138
+ resize?.observe(viewport);
139
+ const content = viewport.querySelector('[data-slot="message-scroller-content"]');
140
+ if (content) resize?.observe(content);
141
+ return () => {
142
+ mutation.disconnect();
143
+ resize?.disconnect();
144
+ };
145
+ }, [autoScroll, defaultScrollPosition, preserveScrollOnPrepend, readState, scrollPreviousItemPeek]);
146
+ const value = React.useMemo(() => ({
147
+ viewportRef,
148
+ setViewport,
149
+ handleScroll,
150
+ scrollable,
151
+ visibility,
152
+ autoscrolling,
153
+ scrollToStart,
154
+ scrollToEnd,
155
+ scrollToMessage
156
+ }), [setViewport, handleScroll, scrollable, visibility, autoscrolling, scrollToStart, scrollToEnd, scrollToMessage]);
157
+ return /*#__PURE__*/React.createElement(MessageScrollerContext.Provider, {
158
+ value: value
159
+ }, children);
160
+ }
161
+ function useScrollerContext(name) {
162
+ const context = React.useContext(MessageScrollerContext);
163
+ if (!context) throw new Error(`${name} must be used inside a <MessageScrollerProvider>`);
164
+ return context;
165
+ }
166
+ export function useMessageScroller() {
167
+ const {
168
+ scrollToStart,
169
+ scrollToEnd,
170
+ scrollToMessage
171
+ } = useScrollerContext('useMessageScroller');
172
+ return {
173
+ scrollToStart,
174
+ scrollToEnd,
175
+ scrollToMessage
176
+ };
177
+ }
178
+ export function useMessageScrollerVisibility() {
179
+ return useScrollerContext('useMessageScrollerVisibility').visibility;
180
+ }
181
+ export function useMessageScrollerScrollable() {
182
+ return useScrollerContext('useMessageScrollerScrollable').scrollable;
183
+ }
184
+ export const MessageScroller = /*#__PURE__*/React.forwardRef(function MessageScroller({
185
+ className,
186
+ ...props
187
+ }, ref) {
188
+ const context = useScrollerContext('MessageScroller');
189
+ const directions = [context.scrollable.start && 'start', context.scrollable.end && 'end'].filter(Boolean).join(' ') || 'none';
190
+ return /*#__PURE__*/React.createElement("div", _extends({}, props, {
191
+ ref: ref,
192
+ "data-slot": "message-scroller",
193
+ "data-scrollable": directions,
194
+ "data-autoscrolling": context.autoscrolling ? 'true' : 'false',
195
+ className: join('ef-message-scroller', className)
196
+ }));
197
+ });
198
+ export const MessageScrollerViewport = /*#__PURE__*/React.forwardRef(function MessageScrollerViewport({
199
+ className,
200
+ onScroll,
201
+ role = 'region',
202
+ 'aria-label': ariaLabel = 'Messages',
203
+ tabIndex = 0,
204
+ ...props
205
+ }, ref) {
206
+ const context = useScrollerContext('MessageScrollerViewport');
207
+ const handle = event => {
208
+ context.handleScroll(event);
209
+ onScroll?.(event);
210
+ };
211
+ return /*#__PURE__*/React.createElement("div", _extends({}, props, {
212
+ ref: mergeRefs(ref, context.setViewport),
213
+ role: role,
214
+ "aria-label": ariaLabel,
215
+ tabIndex: tabIndex,
216
+ "data-slot": "message-scroller-viewport",
217
+ "data-scrollable": [context.scrollable.start && 'start', context.scrollable.end && 'end'].filter(Boolean).join(' ') || 'none',
218
+ "data-autoscrolling": context.autoscrolling ? 'true' : 'false',
219
+ className: join('ef-message-scroller__viewport', className),
220
+ onScroll: handle
221
+ }));
222
+ });
223
+ export const MessageScrollerContent = /*#__PURE__*/React.forwardRef(function MessageScrollerContent({
224
+ className,
225
+ role = 'log',
226
+ 'aria-live': ariaLive = 'polite',
227
+ 'aria-relevant': ariaRelevant = 'additions',
228
+ ...props
229
+ }, ref) {
230
+ return /*#__PURE__*/React.createElement("div", _extends({}, props, {
231
+ ref: ref,
232
+ role: role,
233
+ "aria-live": ariaLive,
234
+ "aria-relevant": ariaRelevant,
235
+ "data-slot": "message-scroller-content",
236
+ className: join('ef-message-scroller__content', className)
237
+ }));
238
+ });
239
+ export const MessageScrollerItem = /*#__PURE__*/React.forwardRef(function MessageScrollerItem({
240
+ messageId,
241
+ scrollAnchor = false,
242
+ className,
243
+ ...props
244
+ }, ref) {
245
+ return /*#__PURE__*/React.createElement("div", _extends({}, props, {
246
+ ref: ref,
247
+ "data-slot": "message-scroller-item",
248
+ "data-message-id": messageId == null ? undefined : String(messageId),
249
+ "data-scroll-anchor": scrollAnchor ? 'true' : undefined,
250
+ className: join('ef-message-scroller__item', className)
251
+ }));
252
+ });
253
+ export const MessageScrollerButton = /*#__PURE__*/React.forwardRef(function MessageScrollerButton({
254
+ direction = 'end',
255
+ className,
256
+ children,
257
+ onClick,
258
+ ...props
259
+ }, ref) {
260
+ const context = useScrollerContext('MessageScrollerButton');
261
+ const active = context.scrollable[direction];
262
+ const click = event => {
263
+ onClick?.(event);
264
+ if (!event.defaultPrevented) direction === 'end' ? context.scrollToEnd() : context.scrollToStart();
265
+ };
266
+ return /*#__PURE__*/React.createElement("button", _extends({}, props, {
267
+ ref: ref,
268
+ type: "button",
269
+ "aria-label": props['aria-label'] || (direction === 'end' ? 'Scroll to end' : 'Scroll to start'),
270
+ tabIndex: active ? props.tabIndex : -1,
271
+ inert: active ? undefined : '',
272
+ "data-slot": "message-scroller-button",
273
+ "data-active": active ? 'true' : 'false',
274
+ "data-direction": direction,
275
+ className: join('ef-message-scroller__button', className),
276
+ onClick: click
277
+ }), children || /*#__PURE__*/React.createElement("span", {
278
+ className: "ef-message-scroller__button-icon"
279
+ }, /*#__PURE__*/React.createElement(Icon, {
280
+ name: "chevron-down",
281
+ size: 16
282
+ })));
283
+ });
@@ -13,8 +13,8 @@ export interface ModelSelectorProps {
13
13
  /** Selected model id */
14
14
  value?: string;
15
15
  onChange?: (id: string) => void;
16
- /** Panel direction @default 'top'. 'up'/'down' are deprecated aliases for 'top'/'bottom' (one major). */
17
- side?: 'top' | 'bottom' | 'up' | 'down';
16
+ /** Panel direction @default 'top'. */
17
+ side?: 'top' | 'bottom';
18
18
  style?: React.CSSProperties;
19
19
  className?: string;
20
20
  }
@@ -12,8 +12,7 @@ export function ModelSelector({
12
12
  className,
13
13
  ...rest
14
14
  }) {
15
- // 'up'/'down' are deprecated value aliases for 'top'/'bottom' (the house placement vocabulary).
16
- const dir = side === 'down' || side === 'bottom' ? 'bottom' : 'top';
15
+ const dir = side === 'bottom' ? 'bottom' : 'top';
17
16
  const [open, setOpen] = React.useState(false);
18
17
  const ref = React.useRef(null);
19
18
  const panelRef = React.useRef(null);
package/ai/Player.js CHANGED
@@ -188,7 +188,7 @@ export const Player = /*#__PURE__*/React.forwardRef(function Player({
188
188
  type: "button",
189
189
  className: "ef-player__btn",
190
190
  style: {
191
- marginLeft: 'auto'
191
+ marginInlineStart: 'auto'
192
192
  },
193
193
  "aria-label": muted ? 'Unmute' : 'Mute',
194
194
  "aria-pressed": muted,
package/ai/PromptSteps.js CHANGED
@@ -2,6 +2,7 @@
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
3
  import React from 'react';
4
4
  import { Icon } from "../icons/Icon.js";
5
+ import { useDirection } from "../display/Direction.js";
5
6
  export function PromptSteps({
6
7
  steps = [],
7
8
  defaultValues = {},
@@ -12,6 +13,7 @@ export function PromptSteps({
12
13
  className,
13
14
  ...rest
14
15
  }) {
16
+ const direction = useDirection();
15
17
  const [idx, setIdx] = React.useState(0);
16
18
  const [hi, setHi] = React.useState(0);
17
19
  const [other, setOther] = React.useState('');
@@ -76,7 +78,7 @@ export function PromptSteps({
76
78
  e.preventDefault();
77
79
  reset();
78
80
  if (onDismiss) onDismiss();
79
- } else if (e.key === 'ArrowLeft' && !inOther || e.key === 'Tab' && e.shiftKey) {
81
+ } else if (e.key === (direction === 'rtl' ? 'ArrowRight' : 'ArrowLeft') && !inOther || e.key === 'Tab' && e.shiftKey) {
80
82
  e.preventDefault();
81
83
  back();
82
84
  } else if (!inOther && /^[1-9]$/.test(e.key)) {
@@ -142,7 +144,7 @@ export function PromptSteps({
142
144
  className: "ef-promptsteps__back",
143
145
  onClick: back
144
146
  }, /*#__PURE__*/React.createElement(Icon, {
145
- name: "chevron-left",
147
+ name: direction === 'rtl' ? 'chevron-right' : 'chevron-left',
146
148
  size: 12
147
149
  }), "Back") : null, /*#__PURE__*/React.createElement("span", null, idx + 1, " of ", steps.length), /*#__PURE__*/React.createElement("span", {
148
150
  className: "ef-promptsteps__kbd"
package/ai/Sandbox.d.ts CHANGED
@@ -10,8 +10,6 @@ export interface SandboxProps {
10
10
  /** 'running' | 'success' | 'error' */
11
11
  /** @default 'success' */
12
12
  status?: 'running' | 'success' | 'error';
13
- /** @deprecated use `status` */
14
- state?: 'running' | 'success' | 'error';
15
13
  /** Right-side meta, e.g. duration */
16
14
  meta?: React.ReactNode;
17
15
  tabs: SandboxTab[];
package/ai/Sandbox.js CHANGED
@@ -9,8 +9,7 @@ const STATES = {
9
9
  };
10
10
  export function Sandbox({
11
11
  title,
12
- status,
13
- state,
12
+ status = 'success',
14
13
  meta,
15
14
  tabs = [],
16
15
  defaultOpen,
@@ -19,8 +18,7 @@ export function Sandbox({
19
18
  className,
20
19
  ...rest
21
20
  }) {
22
- const s = status ?? state ?? 'success'; // `state` is a deprecated alias for `status`
23
-
21
+ const s = status;
24
22
  const [open, setOpen] = React.useState(defaultOpen !== undefined ? !!defaultOpen : s === 'error');
25
23
  const [tab, setTab] = React.useState(defaultTab || tabs[0] && tabs[0].id);
26
24
  const active = tabs.find(t => t.id === tab) || tabs[0];
@@ -4,8 +4,6 @@ export interface SuggestionsProps {
4
4
  items: Array<string | SuggestionItem>;
5
5
  /** Fires with the picked label */
6
6
  onSelect?: (label: string, index: number) => void;
7
- /** @deprecated Use `onSelect`. Alias kept for one major; `onSelect` wins when both are passed. */
8
- onPick?: (label: string, index: number) => void;
9
7
  style?: React.CSSProperties;
10
8
  className?: string;
11
9
  }
package/ai/Suggestions.js CHANGED
@@ -5,13 +5,10 @@ import { Icon } from "../icons/Icon.js";
5
5
  export function Suggestions({
6
6
  items = [],
7
7
  onSelect,
8
- onPick,
9
8
  style,
10
9
  className,
11
10
  ...rest
12
11
  }) {
13
- // onPick is the deprecated alias; onSelect (command-pick convention) wins when both are passed.
14
- const fire = onSelect ?? onPick;
15
12
  return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
16
13
  className: `ef-suggestions${className ? ' ' + className : ''}`,
17
14
  style: style
@@ -22,7 +19,7 @@ export function Suggestions({
22
19
  key: i,
23
20
  type: "button",
24
21
  className: "ef-suggestion",
25
- onClick: () => fire && fire(label, i)
22
+ onClick: () => onSelect?.(label, i)
26
23
  }, icon ? /*#__PURE__*/React.createElement("span", {
27
24
  className: "ef-suggestion__icon"
28
25
  }, /*#__PURE__*/React.createElement(Icon, {
@@ -12,8 +12,6 @@ export interface WebPreviewProps {
12
12
  logs?: WebPreviewLog[];
13
13
  /** Console starts open */
14
14
  defaultOpen?: boolean;
15
- /** @deprecated Use `defaultOpen`. Alias kept for one major; `defaultOpen` wins when both are passed. */
16
- defaultConsoleOpen?: boolean;
17
15
  /** Rendered instead of an iframe (mock content) */
18
16
  children?: React.ReactNode;
19
17
  onUrlChange?: (url: string) => void;
package/ai/WebPreview.js CHANGED
@@ -19,8 +19,7 @@ export function WebPreview({
19
19
  url: urlProp = '',
20
20
  height = 340,
21
21
  logs = [],
22
- defaultOpen,
23
- defaultConsoleOpen,
22
+ defaultOpen = false,
24
23
  children,
25
24
  onUrlChange,
26
25
  style,
@@ -31,8 +30,7 @@ export function WebPreview({
31
30
  const [draft, setDraft] = React.useState(urlProp);
32
31
  const [key, setKey] = React.useState(0);
33
32
  const [vp, setVp] = React.useState('desktop');
34
- // defaultConsoleOpen is the deprecated alias; defaultOpen wins when both are passed.
35
- const [cons, setCons] = React.useState(!!(defaultOpen ?? defaultConsoleOpen));
33
+ const [cons, setCons] = React.useState(!!defaultOpen);
36
34
  // Controlled-capable url: a changed url prop is adopted into state, so a parent
37
35
  // can drive navigation (address bar + iframe follow it) between user edits.
38
36
  React.useEffect(() => {
package/code/Console.js CHANGED
@@ -74,7 +74,7 @@ export function Console({
74
74
  size: 13
75
75
  }), title, /*#__PURE__*/React.createElement("span", {
76
76
  style: {
77
- marginLeft: 'auto',
77
+ marginInlineStart: 'auto',
78
78
  color: 'var(--text-muted)'
79
79
  }
80
80
  }, entries.length, " entries")), /*#__PURE__*/React.createElement("div", {
package/code/EnvList.d.ts CHANGED
@@ -9,8 +9,6 @@ export interface EnvListProps {
9
9
  vars: EnvVar[];
10
10
  /** Reveal secret values on mount. @default false */
11
11
  defaultOpen?: boolean;
12
- /** @deprecated use `defaultOpen` */
13
- defaultVisible?: boolean;
14
12
  style?: React.CSSProperties;
15
13
  className?: string;
16
14
  }
package/code/EnvList.js CHANGED
@@ -33,13 +33,12 @@ function Row({
33
33
  export function EnvList({
34
34
  title = 'Environment',
35
35
  vars = [],
36
- defaultOpen,
37
- defaultVisible,
36
+ defaultOpen = false,
38
37
  style,
39
38
  className,
40
39
  ...rest
41
40
  }) {
42
- const [visible, setVisible] = React.useState(!!(defaultOpen ?? defaultVisible ?? false));
41
+ const [visible, setVisible] = React.useState(!!defaultOpen);
43
42
  const hasSecrets = vars.some(v => v.secret);
44
43
  return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
45
44
  className: `ef-env${className ? ' ' + className : ''}`,