@efolusi/meridian 1.21.10 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -21
- package/THIRD_PARTY_NOTICES.md +3 -3
- package/ai/AgentRun.js +1 -0
- package/ai/Bubble.js +1 -0
- package/ai/ChatMessage.js +1 -0
- package/ai/Citation.js +45 -22
- package/ai/Confirmation.js +3 -2
- package/ai/Conversation.js +1 -0
- package/ai/DocumentCard.js +1 -0
- package/ai/FeedbackBar.js +1 -0
- package/ai/GeneratedImage.js +1 -0
- package/ai/Marker.js +1 -0
- package/ai/Message.js +1 -0
- package/ai/MessageScroller.js +1 -0
- package/ai/ModelSelector.js +1 -0
- package/ai/Player.js +1 -0
- package/ai/PromptComposer.d.ts +4 -0
- package/ai/PromptComposer.js +8 -1
- package/ai/PromptSteps.js +1 -0
- package/ai/Reasoning.js +1 -0
- package/ai/RichComposer.js +4 -0
- package/ai/Sandbox.js +1 -0
- package/ai/SelectionQuote.js +1 -0
- package/ai/SourceCard.js +13 -4
- package/ai/Suggestions.js +1 -0
- package/ai/Task.js +1 -0
- package/ai/Todo.js +1 -0
- package/ai/ToolCall.js +1 -0
- package/ai/Transcript.js +1 -0
- package/ai/UsageMeter.d.ts +3 -1
- package/ai/UsageMeter.js +9 -2
- package/ai/WebPreview.js +13 -4
- package/code/CodeBlock.js +27 -7
- package/code/Console.js +1 -0
- package/code/CopyField.js +25 -9
- package/code/Diff.js +1 -0
- package/code/EnvList.js +1 -0
- package/code/Exception.js +1 -0
- package/code/Terminal.js +1 -0
- package/components.css +139 -56
- package/data/BarChart.d.ts +4 -0
- package/data/BarChart.js +29 -4
- package/data/Chart.d.ts +1 -1
- package/data/Chart.js +10 -4
- package/data/DonutChart.d.ts +4 -0
- package/data/DonutChart.js +38 -8
- package/data/EmptyState.js +1 -0
- package/data/KeyValueList.js +1 -0
- package/data/LineChart.d.ts +4 -0
- package/data/LineChart.js +30 -7
- package/data/Skeleton.js +1 -0
- package/data/Sparkline.js +1 -0
- package/data/Stat.js +1 -0
- package/data/StatusDot.js +1 -0
- package/data/Table.d.ts +1 -0
- package/data/Table.js +36 -19
- package/dates/Calendar.js +44 -15
- package/dates/TimePicker.js +19 -3
- package/display/Accordion.js +1 -0
- package/display/AspectRatio.js +1 -0
- package/display/Avatar.js +1 -0
- package/display/Badge.js +1 -0
- package/display/Card.js +1 -0
- package/display/Carousel.js +24 -6
- package/display/Collapsible.js +1 -0
- package/display/Direction.js +1 -0
- package/display/Divider.js +1 -0
- package/display/Item.js +1 -0
- package/display/Kbd.js +1 -0
- package/display/Link.js +1 -0
- package/display/Resizable.js +5 -4
- package/display/ScrollArea.js +4 -2
- package/display/Separator.js +1 -0
- package/display/Tag.js +1 -0
- package/display/Timeline.js +1 -0
- package/display/Toolbar.js +2 -0
- package/display/TreeList.js +21 -13
- package/feedback/Alert.js +1 -0
- package/feedback/AlertDialog.js +31 -18
- package/feedback/Banner.js +1 -0
- package/feedback/ConfirmDialog.js +1 -0
- package/feedback/Dialog.js +37 -18
- package/feedback/Loader.js +1 -0
- package/feedback/Progress.js +1 -0
- package/feedback/Spinner.js +1 -0
- package/feedback/Toast.js +10 -3
- package/feedback/Tooltip.js +25 -6
- package/files/Attachment.js +1 -0
- package/files/FileDrop.d.ts +5 -1
- package/files/FileDrop.js +29 -1
- package/files/FileTile.js +1 -0
- package/files/FileTypeIcon.js +1 -0
- package/finance/PaymentCard.js +1 -0
- package/forms/Button.js +55 -0
- package/forms/ButtonGroup.js +1 -0
- package/forms/ButtonTile.js +3 -0
- package/forms/Checkbox.js +1 -0
- package/forms/Combobox.js +31 -9
- package/forms/Field.js +1 -0
- package/forms/IconButton.js +1 -0
- package/forms/Input.js +1 -0
- package/forms/InputGroup.js +1 -0
- package/forms/InputOTP.js +1 -0
- package/forms/Label.js +1 -0
- package/forms/NativeSelect.js +1 -0
- package/forms/NumberInput.js +22 -4
- package/forms/Questionnaire.js +2 -1
- package/forms/Radio.js +1 -0
- package/forms/Select.js +7 -4
- package/forms/Slider.js +26 -3
- package/forms/Switch.js +15 -3
- package/forms/Textarea.js +1 -0
- package/forms/Toggle.js +1 -0
- package/icons/Icon.js +6 -0
- package/icons/_svg.js +1 -1
- package/index.js +3 -3
- package/navigation/Breadcrumbs.js +1 -0
- package/navigation/Menubar.js +1 -0
- package/navigation/NavigationMenu.js +18 -5
- package/navigation/PageControl.js +2 -0
- package/navigation/Pagination.js +1 -0
- package/navigation/SegmentedControl.js +2 -0
- package/navigation/SideNav.js +3 -0
- package/navigation/Sidebar.js +75 -11
- package/navigation/SkipLink.d.ts +2 -1
- package/navigation/SkipLink.js +17 -4
- package/navigation/Steps.js +1 -0
- package/navigation/Tabs.js +1 -0
- package/navigation/TopNav.js +1 -0
- package/overlay/Command.js +2 -0
- package/overlay/ContextMenu.js +40 -13
- package/overlay/Drawer.d.ts +4 -0
- package/overlay/Drawer.js +24 -3
- package/overlay/DropdownMenu.js +40 -13
- package/overlay/HoverCard.js +29 -19
- package/overlay/Popover.js +67 -16
- package/overlay/Portal.js +97 -2
- package/overlay/Sheet.js +1 -0
- package/package.json +2 -2
- package/tailwind.preset.cjs +60 -28
- package/tokens/base.css +19 -3
- package/tokens/colors.css +248 -46
- package/tokens/effects.css +33 -20
- package/tokens/fonts.css +7 -0
- package/tokens/spacing.css +42 -17
- package/tokens/typography.css +29 -8
- package/tokens.json +689 -115
package/ai/UsageMeter.d.ts
CHANGED
|
@@ -13,8 +13,10 @@ export interface UsageMeterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
13
13
|
warnAt?: number;
|
|
14
14
|
/** Count the figure and bar up on mount/change */
|
|
15
15
|
animated?: boolean;
|
|
16
|
-
/** Figure formatter @default
|
|
16
|
+
/** Figure formatter @default Intl.NumberFormat(locale), whole numbers */
|
|
17
17
|
format?: (v: number) => string;
|
|
18
|
+
/** BCP 47 locale for number formatting (fixed default keeps server and browser output identical) @default 'en-US' */
|
|
19
|
+
locale?: string;
|
|
18
20
|
style?: React.CSSProperties;
|
|
19
21
|
className?: string;
|
|
20
22
|
}
|
package/ai/UsageMeter.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
2
3
|
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
4
|
import React from 'react';
|
|
4
5
|
import { cssPct, prefersReducedMotion } from "../forms/Button.js";
|
|
@@ -12,6 +13,7 @@ export function UsageMeter({
|
|
|
12
13
|
warnAt = 0.8,
|
|
13
14
|
animated,
|
|
14
15
|
format,
|
|
16
|
+
locale = 'en-US',
|
|
15
17
|
style,
|
|
16
18
|
className,
|
|
17
19
|
...rest
|
|
@@ -36,7 +38,11 @@ export function UsageMeter({
|
|
|
36
38
|
return () => cancelAnimationFrame(raf);
|
|
37
39
|
}, [used, animated]);
|
|
38
40
|
const ratio = limit > 0 ? used / limit : 0;
|
|
39
|
-
|
|
41
|
+
// Fixed default locale: the runtime default would differ between server and browser.
|
|
42
|
+
const nf = new Intl.NumberFormat(locale, {
|
|
43
|
+
maximumFractionDigits: 0
|
|
44
|
+
});
|
|
45
|
+
const fmt = format || (v => nf.format(Math.round(v)));
|
|
40
46
|
const tone = ratio >= 1 ? ' ef-usage--over' : ratio >= warnAt ? ' ef-usage--warn' : '';
|
|
41
47
|
const shownRatio = limit > 0 ? shown / limit : 0;
|
|
42
48
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
|
@@ -51,9 +57,10 @@ export function UsageMeter({
|
|
|
51
57
|
}, fmt(shown), " / ", fmt(limit), unit ? ' ' + unit : '')), /*#__PURE__*/React.createElement("div", {
|
|
52
58
|
className: "ef-usage__track",
|
|
53
59
|
role: "progressbar",
|
|
54
|
-
"aria-valuenow": Math.round(ratio * 100),
|
|
60
|
+
"aria-valuenow": Math.round(Math.min(1, Math.max(0, ratio)) * 100),
|
|
55
61
|
"aria-valuemin": 0,
|
|
56
62
|
"aria-valuemax": 100,
|
|
63
|
+
"aria-valuetext": `${fmt(used)} / ${fmt(limit)}${unit ? " " + unit : ""}`,
|
|
57
64
|
"aria-label": label
|
|
58
65
|
}, /*#__PURE__*/React.createElement("span", {
|
|
59
66
|
className: "ef-usage__fill",
|
package/ai/WebPreview.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
2
3
|
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
4
|
import React from 'react';
|
|
4
5
|
import { Icon } from "../icons/Icon.js";
|
|
6
|
+
// Model-supplied URL: only http(s), mailto and relative pass (see Citation.jsx).
|
|
7
|
+
function safeUrl(url) {
|
|
8
|
+
if (url == null || url === '') return undefined;
|
|
9
|
+
const s = String(url);
|
|
10
|
+
const scheme = /^\s*([a-z][a-z0-9+.-]*):/i.exec(s.replace(/[\u0000-\u001F\u007F]/g, ''));
|
|
11
|
+
return !scheme || /^(https?|mailto)$/i.test(scheme[1]) ? s : undefined;
|
|
12
|
+
}
|
|
5
13
|
const VIEWPORTS = [{
|
|
6
14
|
id: 'desktop',
|
|
7
15
|
icon: 'monitor',
|
|
@@ -45,6 +53,7 @@ export function WebPreview({
|
|
|
45
53
|
setUrl(next);
|
|
46
54
|
if (onUrlChange) onUrlChange(next);
|
|
47
55
|
};
|
|
56
|
+
const safe = safeUrl(url);
|
|
48
57
|
const width = (VIEWPORTS.find(v => v.id === vp) || {}).width;
|
|
49
58
|
const LOG_ICON = {
|
|
50
59
|
warn: 'triangle-alert',
|
|
@@ -110,7 +119,7 @@ export function WebPreview({
|
|
|
110
119
|
}, errs) : null), /*#__PURE__*/React.createElement("a", {
|
|
111
120
|
className: "ef-webprev__btn",
|
|
112
121
|
"aria-label": "Open in new tab",
|
|
113
|
-
href:
|
|
122
|
+
href: safe,
|
|
114
123
|
target: "_blank",
|
|
115
124
|
rel: "noreferrer noopener"
|
|
116
125
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -126,10 +135,10 @@ export function WebPreview({
|
|
|
126
135
|
style: width ? {
|
|
127
136
|
width
|
|
128
137
|
} : null
|
|
129
|
-
}, children) :
|
|
130
|
-
key:
|
|
138
|
+
}, children) : safe ? /*#__PURE__*/React.createElement("iframe", {
|
|
139
|
+
key: safe + '-' + key,
|
|
131
140
|
className: "ef-webprev__frame",
|
|
132
|
-
src:
|
|
141
|
+
src: safe,
|
|
133
142
|
title: "Web preview",
|
|
134
143
|
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups",
|
|
135
144
|
style: width ? {
|
package/code/CodeBlock.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
2
3
|
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
4
|
import React from 'react';
|
|
4
5
|
import { Icon } from "../icons/Icon.js";
|
|
@@ -13,7 +14,17 @@ export function CodeBlock({
|
|
|
13
14
|
className,
|
|
14
15
|
...rest
|
|
15
16
|
}) {
|
|
16
|
-
|
|
17
|
+
// 'idle' | 'done' | 'failed': only a resolved clipboard write counts as copied.
|
|
18
|
+
const [copied, setCopied] = React.useState('idle');
|
|
19
|
+
const timer = React.useRef(null);
|
|
20
|
+
const live = React.useRef(true);
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
live.current = true;
|
|
23
|
+
return () => {
|
|
24
|
+
live.current = false;
|
|
25
|
+
clearTimeout(timer.current);
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
17
28
|
const [open, setOpen] = React.useState(false);
|
|
18
29
|
const [full, setFull] = React.useState(null);
|
|
19
30
|
const ref = React.useRef(null);
|
|
@@ -29,9 +40,14 @@ export function CodeBlock({
|
|
|
29
40
|
}, [clip]);
|
|
30
41
|
const copy = () => {
|
|
31
42
|
const text = ref.current ? ref.current.textContent : '';
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
const write = typeof navigator !== 'undefined' && navigator.clipboard ? navigator.clipboard.writeText(text) : Promise.reject(new Error('no clipboard'));
|
|
44
|
+
const settle = result => {
|
|
45
|
+
if (!live.current) return;
|
|
46
|
+
setCopied(result);
|
|
47
|
+
clearTimeout(timer.current);
|
|
48
|
+
timer.current = setTimeout(() => setCopied('idle'), 1600);
|
|
49
|
+
};
|
|
50
|
+
write.then(() => settle('done'), () => settle('failed'));
|
|
35
51
|
};
|
|
36
52
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
|
37
53
|
className: `ef-code${className ? ' ' + className : ''}`,
|
|
@@ -41,12 +57,16 @@ export function CodeBlock({
|
|
|
41
57
|
}, /*#__PURE__*/React.createElement("span", {
|
|
42
58
|
className: "ef-code__lang"
|
|
43
59
|
}, title || lang), /*#__PURE__*/React.createElement("button", {
|
|
44
|
-
|
|
60
|
+
type: "button",
|
|
61
|
+
className: `ef-code__copy${copied !== 'idle' ? ' ef-code__copy--' + copied : ''}`,
|
|
45
62
|
onClick: copy
|
|
46
63
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
47
|
-
name: copied ? 'check' : 'copy',
|
|
64
|
+
name: copied === 'done' ? 'check' : copied === 'failed' ? 'circle-alert' : 'copy',
|
|
48
65
|
size: 13
|
|
49
|
-
}), copied ? 'Copied' : 'Copy')
|
|
66
|
+
}), copied === 'done' ? 'Copied' : copied === 'failed' ? 'Copy failed' : 'Copy'), /*#__PURE__*/React.createElement("span", {
|
|
67
|
+
className: "ef-code__sr",
|
|
68
|
+
role: "status"
|
|
69
|
+
}, copied === 'done' ? 'Copied to clipboard' : copied === 'failed' ? 'Copy failed' : '')), clip ? /*#__PURE__*/React.createElement("div", {
|
|
50
70
|
className: "ef-code__win",
|
|
51
71
|
style: {
|
|
52
72
|
height: full === null ? open ? undefined : clipHeight : open ? full : Math.min(full, clipHeight)
|
package/code/Console.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
2
3
|
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
4
|
import React from 'react';
|
|
4
5
|
import { prefersReducedMotion } from "../forms/Button.js";
|
package/code/CopyField.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
2
3
|
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
4
|
import React from 'react';
|
|
4
5
|
import { Icon } from "../icons/Icon.js";
|
|
@@ -12,14 +13,26 @@ export function CopyField({
|
|
|
12
13
|
...rest
|
|
13
14
|
}) {
|
|
14
15
|
const [show, setShow] = React.useState(!secret);
|
|
15
|
-
|
|
16
|
+
// 'idle' | 'done' | 'failed': only a resolved clipboard write counts as copied.
|
|
17
|
+
const [copied, setCopied] = React.useState('idle');
|
|
16
18
|
const timer = React.useRef(null);
|
|
17
|
-
|
|
19
|
+
const live = React.useRef(true);
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
live.current = true;
|
|
22
|
+
return () => {
|
|
23
|
+
live.current = false;
|
|
24
|
+
clearTimeout(timer.current);
|
|
25
|
+
};
|
|
26
|
+
}, []);
|
|
18
27
|
const copy = () => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
const write = typeof navigator !== 'undefined' && navigator.clipboard ? navigator.clipboard.writeText(String(value)) : Promise.reject(new Error('no clipboard'));
|
|
29
|
+
const settle = result => {
|
|
30
|
+
if (!live.current) return;
|
|
31
|
+
setCopied(result);
|
|
32
|
+
clearTimeout(timer.current);
|
|
33
|
+
timer.current = setTimeout(() => setCopied('idle'), 1600);
|
|
34
|
+
};
|
|
35
|
+
write.then(() => settle('done'), () => settle('failed'));
|
|
23
36
|
};
|
|
24
37
|
const shown = show ? value : '•'.repeat(Math.min(24, String(value).length));
|
|
25
38
|
const box = /*#__PURE__*/React.createElement("span", {
|
|
@@ -32,11 +45,14 @@ export function CopyField({
|
|
|
32
45
|
size: "sm",
|
|
33
46
|
onClick: () => setShow(s => !s)
|
|
34
47
|
}) : null, /*#__PURE__*/React.createElement(IconButton, {
|
|
35
|
-
icon: copied ? 'check' : 'copy',
|
|
36
|
-
label:
|
|
48
|
+
icon: copied === 'done' ? 'check' : copied === 'failed' ? 'circle-alert' : 'copy',
|
|
49
|
+
label: copied === 'done' ? 'Copied' : copied === 'failed' ? 'Copy failed' : 'Copy',
|
|
37
50
|
size: "sm",
|
|
38
51
|
onClick: copy
|
|
39
|
-
})
|
|
52
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
53
|
+
className: "ef-copyfield__sr",
|
|
54
|
+
role: "status"
|
|
55
|
+
}, copied === 'done' ? 'Copied to clipboard' : copied === 'failed' ? 'Copy failed' : ''));
|
|
40
56
|
if (!label) return /*#__PURE__*/React.cloneElement(box, {
|
|
41
57
|
...rest,
|
|
42
58
|
className: 'ef-copyfield__box' + (className ? ' ' + className : ''),
|
package/code/Diff.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
2
3
|
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
4
|
import React from 'react';
|
|
4
5
|
import { Icon } from "../icons/Icon.js";
|
package/code/EnvList.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
2
3
|
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
4
|
import React from 'react';
|
|
4
5
|
import { Icon } from "../icons/Icon.js";
|
package/code/Exception.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
2
3
|
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
4
|
import React from 'react';
|
|
4
5
|
import { Icon } from "../icons/Icon.js";
|
package/code/Terminal.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
|
|
2
3
|
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
4
|
import React from 'react';
|
|
4
5
|
export function Terminal({
|