@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
package/overlay/Menu.js DELETED
@@ -1,139 +0,0 @@
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 { Icon } from "../icons/Icon.js";
5
- import { mergeRefs } from "../forms/Button.js";
6
- import { Portal, useAnchoredStyle } from "./Portal.js";
7
- // Panel modifiers pin no edge on purpose; see useAnchoredStyle in Portal.jsx.
8
-
9
- export const Menu = /*#__PURE__*/React.forwardRef(function Menu({
10
- trigger,
11
- items,
12
- onSelect,
13
- align = 'left',
14
- style,
15
- className,
16
- ...rest
17
- }, fRef) {
18
- const [open, setOpen] = React.useState(false);
19
- const ref = React.useRef(null);
20
- const panelRef = React.useRef(null);
21
- const {
22
- style: anchored
23
- } = useAnchoredStyle(ref, panelRef, {
24
- open,
25
- placement: 'bottom',
26
- align: align === 'right' ? 'end' : 'start'
27
- });
28
- const focusItem = which => {
29
- const panel = panelRef.current;
30
- const nodes = panel ? Array.from(panel.querySelectorAll('[role="menuitem"]:not(:disabled)')) : [];
31
- if (!nodes.length) return;
32
- const i = nodes.indexOf(document.activeElement);
33
- const next = which === 'first' ? 0 : which === 'last' ? nodes.length - 1 : (i + which + nodes.length) % nodes.length;
34
- nodes[next].focus();
35
- };
36
- const restoreFocus = () => {
37
- const t = ref.current && ref.current.querySelector('button,[href],[tabindex]');
38
- if (t) t.focus();
39
- };
40
- const close = restore => {
41
- setOpen(false);
42
- if (restore) restoreFocus();
43
- };
44
- React.useEffect(() => {
45
- if (!open) return;
46
- focusItem('first');
47
- // the panel is portaled, so "outside" means outside the trigger AND the panel
48
- const away = e => {
49
- const inTrigger = ref.current && ref.current.contains(e.target);
50
- const inPanel = panelRef.current && panelRef.current.contains(e.target);
51
- if (!inTrigger && !inPanel) setOpen(false);
52
- };
53
- document.addEventListener('mousedown', away);
54
- return () => document.removeEventListener('mousedown', away);
55
- }, [open]);
56
- const onTriggerKey = e => {
57
- if (e.key === 'Enter' || e.key === ' ' || e.key === 'ArrowDown') {
58
- e.preventDefault();
59
- setOpen(true);
60
- } else if (e.key === 'Escape' && open) close(true);
61
- };
62
- const triggerProps = {
63
- onClick: e => {
64
- if (/*#__PURE__*/React.isValidElement(trigger) && trigger.props.onClick) trigger.props.onClick(e);
65
- setOpen(o => !o);
66
- },
67
- onKeyDown: onTriggerKey,
68
- 'aria-haspopup': 'menu',
69
- 'aria-expanded': open
70
- };
71
- const onPanelKey = e => {
72
- if (e.key === 'Escape') {
73
- e.preventDefault();
74
- close(true);
75
- } else if (e.key === 'ArrowDown') {
76
- e.preventDefault();
77
- focusItem(1);
78
- } else if (e.key === 'ArrowUp') {
79
- e.preventDefault();
80
- focusItem(-1);
81
- } else if (e.key === 'Home') {
82
- e.preventDefault();
83
- focusItem('first');
84
- } else if (e.key === 'End') {
85
- e.preventDefault();
86
- focusItem('last');
87
- } else if (e.key === 'Tab') close(false);else if (e.key.length === 1 && /\S/.test(e.key) && !e.metaKey && !e.ctrlKey && !e.altKey) {
88
- const panel = panelRef.current;
89
- const nodes = panel ? Array.from(panel.querySelectorAll('[role="menuitem"]:not(:disabled)')) : [];
90
- const cur = nodes.indexOf(document.activeElement);
91
- const ch = e.key.toLowerCase();
92
- for (let k = 1; k <= nodes.length; k++) {
93
- const n = nodes[(cur + k) % nodes.length];
94
- if ((n.textContent || '').trim().toLowerCase().startsWith(ch)) {
95
- e.preventDefault();
96
- n.focus();
97
- break;
98
- }
99
- }
100
- }
101
- };
102
- return /*#__PURE__*/React.createElement("span", _extends({}, rest, {
103
- ref: mergeRefs(fRef, ref),
104
- className: `ef-menu${className ? ' ' + className : ''}`,
105
- style: style
106
- }), /*#__PURE__*/React.isValidElement(trigger) ? /*#__PURE__*/React.cloneElement(trigger, triggerProps) : /*#__PURE__*/React.createElement("span", _extends({
107
- role: "button",
108
- tabIndex: 0,
109
- style: {
110
- display: 'inline-flex'
111
- }
112
- }, triggerProps), trigger), open && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement("div", {
113
- role: "menu",
114
- ref: panelRef,
115
- onKeyDown: onPanelKey,
116
- style: anchored,
117
- className: `ef-menu__panel ef-menu__panel--${align}`
118
- }, items.map((it, i) => it === 'separator' ? /*#__PURE__*/React.createElement("div", {
119
- key: 's' + i,
120
- className: "ef-menu__sep"
121
- }) : /*#__PURE__*/React.createElement("button", {
122
- key: it.id,
123
- role: "menuitem",
124
- disabled: it.disabled,
125
- className: `ef-menu__item${it.danger ? ' ef-menu__item--danger' : ''}`,
126
- onClick: () => {
127
- close(true);
128
- if (onSelect) onSelect(it.id);
129
- if (it.onClick) it.onClick();
130
- }
131
- }, it.icon ? /*#__PURE__*/React.createElement("span", {
132
- className: "ef-menu__item__icon"
133
- }, /*#__PURE__*/React.createElement(Icon, {
134
- name: it.icon,
135
- size: 15
136
- })) : null, it.label, it.kbd ? /*#__PURE__*/React.createElement("span", {
137
- className: "ef-menu__kbd"
138
- }, it.kbd) : null)))));
139
- });