@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.
Files changed (147) hide show
  1. package/LICENSE +201 -21
  2. package/THIRD_PARTY_NOTICES.md +3 -3
  3. package/ai/AgentRun.js +1 -0
  4. package/ai/Bubble.js +1 -0
  5. package/ai/ChatMessage.js +1 -0
  6. package/ai/Citation.js +45 -22
  7. package/ai/Confirmation.js +3 -2
  8. package/ai/Conversation.js +1 -0
  9. package/ai/DocumentCard.js +1 -0
  10. package/ai/FeedbackBar.js +1 -0
  11. package/ai/GeneratedImage.js +1 -0
  12. package/ai/Marker.js +1 -0
  13. package/ai/Message.js +1 -0
  14. package/ai/MessageScroller.js +1 -0
  15. package/ai/ModelSelector.js +1 -0
  16. package/ai/Player.js +1 -0
  17. package/ai/PromptComposer.d.ts +4 -0
  18. package/ai/PromptComposer.js +8 -1
  19. package/ai/PromptSteps.js +1 -0
  20. package/ai/Reasoning.js +1 -0
  21. package/ai/RichComposer.js +4 -0
  22. package/ai/Sandbox.js +1 -0
  23. package/ai/SelectionQuote.js +1 -0
  24. package/ai/SourceCard.js +13 -4
  25. package/ai/Suggestions.js +1 -0
  26. package/ai/Task.js +1 -0
  27. package/ai/Todo.js +1 -0
  28. package/ai/ToolCall.js +1 -0
  29. package/ai/Transcript.js +1 -0
  30. package/ai/UsageMeter.d.ts +3 -1
  31. package/ai/UsageMeter.js +9 -2
  32. package/ai/WebPreview.js +13 -4
  33. package/code/CodeBlock.js +27 -7
  34. package/code/Console.js +1 -0
  35. package/code/CopyField.js +25 -9
  36. package/code/Diff.js +1 -0
  37. package/code/EnvList.js +1 -0
  38. package/code/Exception.js +1 -0
  39. package/code/Terminal.js +1 -0
  40. package/components.css +139 -56
  41. package/data/BarChart.d.ts +4 -0
  42. package/data/BarChart.js +29 -4
  43. package/data/Chart.d.ts +1 -1
  44. package/data/Chart.js +10 -4
  45. package/data/DonutChart.d.ts +4 -0
  46. package/data/DonutChart.js +38 -8
  47. package/data/EmptyState.js +1 -0
  48. package/data/KeyValueList.js +1 -0
  49. package/data/LineChart.d.ts +4 -0
  50. package/data/LineChart.js +30 -7
  51. package/data/Skeleton.js +1 -0
  52. package/data/Sparkline.js +1 -0
  53. package/data/Stat.js +1 -0
  54. package/data/StatusDot.js +1 -0
  55. package/data/Table.d.ts +1 -0
  56. package/data/Table.js +36 -19
  57. package/dates/Calendar.js +44 -15
  58. package/dates/TimePicker.js +19 -3
  59. package/display/Accordion.js +1 -0
  60. package/display/AspectRatio.js +1 -0
  61. package/display/Avatar.js +1 -0
  62. package/display/Badge.js +1 -0
  63. package/display/Card.js +1 -0
  64. package/display/Carousel.js +24 -6
  65. package/display/Collapsible.js +1 -0
  66. package/display/Direction.js +1 -0
  67. package/display/Divider.js +1 -0
  68. package/display/Item.js +1 -0
  69. package/display/Kbd.js +1 -0
  70. package/display/Link.js +1 -0
  71. package/display/Resizable.js +5 -4
  72. package/display/ScrollArea.js +4 -2
  73. package/display/Separator.js +1 -0
  74. package/display/Tag.js +1 -0
  75. package/display/Timeline.js +1 -0
  76. package/display/Toolbar.js +2 -0
  77. package/display/TreeList.js +21 -13
  78. package/feedback/Alert.js +1 -0
  79. package/feedback/AlertDialog.js +31 -18
  80. package/feedback/Banner.js +1 -0
  81. package/feedback/ConfirmDialog.js +1 -0
  82. package/feedback/Dialog.js +37 -18
  83. package/feedback/Loader.js +1 -0
  84. package/feedback/Progress.js +1 -0
  85. package/feedback/Spinner.js +1 -0
  86. package/feedback/Toast.js +10 -3
  87. package/feedback/Tooltip.js +25 -6
  88. package/files/Attachment.js +1 -0
  89. package/files/FileDrop.d.ts +5 -1
  90. package/files/FileDrop.js +29 -1
  91. package/files/FileTile.js +1 -0
  92. package/files/FileTypeIcon.js +1 -0
  93. package/finance/PaymentCard.js +1 -0
  94. package/forms/Button.js +55 -0
  95. package/forms/ButtonGroup.js +1 -0
  96. package/forms/ButtonTile.js +3 -0
  97. package/forms/Checkbox.js +1 -0
  98. package/forms/Combobox.js +31 -9
  99. package/forms/Field.js +1 -0
  100. package/forms/IconButton.js +1 -0
  101. package/forms/Input.js +1 -0
  102. package/forms/InputGroup.js +1 -0
  103. package/forms/InputOTP.js +1 -0
  104. package/forms/Label.js +1 -0
  105. package/forms/NativeSelect.js +1 -0
  106. package/forms/NumberInput.js +22 -4
  107. package/forms/Questionnaire.js +2 -1
  108. package/forms/Radio.js +1 -0
  109. package/forms/Select.js +7 -4
  110. package/forms/Slider.js +26 -3
  111. package/forms/Switch.js +15 -3
  112. package/forms/Textarea.js +1 -0
  113. package/forms/Toggle.js +1 -0
  114. package/icons/Icon.js +6 -0
  115. package/icons/_svg.js +1 -1
  116. package/index.js +3 -3
  117. package/navigation/Breadcrumbs.js +1 -0
  118. package/navigation/Menubar.js +1 -0
  119. package/navigation/NavigationMenu.js +18 -5
  120. package/navigation/PageControl.js +2 -0
  121. package/navigation/Pagination.js +1 -0
  122. package/navigation/SegmentedControl.js +2 -0
  123. package/navigation/SideNav.js +3 -0
  124. package/navigation/Sidebar.js +75 -11
  125. package/navigation/SkipLink.d.ts +2 -1
  126. package/navigation/SkipLink.js +17 -4
  127. package/navigation/Steps.js +1 -0
  128. package/navigation/Tabs.js +1 -0
  129. package/navigation/TopNav.js +1 -0
  130. package/overlay/Command.js +2 -0
  131. package/overlay/ContextMenu.js +40 -13
  132. package/overlay/Drawer.d.ts +4 -0
  133. package/overlay/Drawer.js +24 -3
  134. package/overlay/DropdownMenu.js +40 -13
  135. package/overlay/HoverCard.js +29 -19
  136. package/overlay/Popover.js +67 -16
  137. package/overlay/Portal.js +97 -2
  138. package/overlay/Sheet.js +1 -0
  139. package/package.json +2 -2
  140. package/tailwind.preset.cjs +60 -28
  141. package/tokens/base.css +19 -3
  142. package/tokens/colors.css +248 -46
  143. package/tokens/effects.css +33 -20
  144. package/tokens/fonts.css +7 -0
  145. package/tokens/spacing.css +42 -17
  146. package/tokens/typography.css +29 -8
  147. package/tokens.json +689 -115
@@ -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 toLocaleString */
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
- const fmt = format || (v => Math.round(v).toLocaleString());
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: url || undefined,
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) : url ? /*#__PURE__*/React.createElement("iframe", {
130
- key: url + '-' + key,
138
+ }, children) : safe ? /*#__PURE__*/React.createElement("iframe", {
139
+ key: safe + '-' + key,
131
140
  className: "ef-webprev__frame",
132
- src: url,
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
- const [copied, setCopied] = React.useState(false);
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
- if (navigator.clipboard) navigator.clipboard.writeText(text).catch(() => {});
33
- setCopied(true);
34
- setTimeout(() => setCopied(false), 1600);
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
- className: `ef-code__copy${copied ? ' ef-code__copy--done' : ''}`,
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')), clip ? /*#__PURE__*/React.createElement("div", {
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
- const [copied, setCopied] = React.useState(false);
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
- React.useEffect(() => () => clearTimeout(timer.current), []);
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
- if (navigator.clipboard) navigator.clipboard.writeText(value).catch(() => {});
20
- setCopied(true);
21
- clearTimeout(timer.current);
22
- timer.current = setTimeout(() => setCopied(false), 1600);
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: "Copy",
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({