@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.
- package/README.md +1 -1
- package/ai/Bubble.d.ts +16 -0
- package/ai/Bubble.js +71 -0
- package/ai/ChatMessage.js +2 -5
- package/ai/Confirmation.d.ts +0 -7
- package/ai/Confirmation.js +3 -6
- package/ai/GeneratedImage.d.ts +0 -2
- package/ai/GeneratedImage.js +2 -4
- package/ai/Marker.d.ts +26 -0
- package/ai/Marker.js +67 -0
- package/ai/Message.d.ts +13 -0
- package/ai/Message.js +68 -0
- package/ai/MessageScroller.d.ts +21 -0
- package/ai/MessageScroller.js +283 -0
- package/ai/ModelSelector.d.ts +2 -2
- package/ai/ModelSelector.js +1 -2
- package/ai/Player.js +1 -1
- package/ai/PromptSteps.js +4 -2
- package/ai/Sandbox.d.ts +0 -2
- package/ai/Sandbox.js +2 -4
- package/ai/Suggestions.d.ts +0 -2
- package/ai/Suggestions.js +1 -4
- package/ai/WebPreview.d.ts +0 -2
- package/ai/WebPreview.js +2 -4
- package/code/Console.js +1 -1
- package/code/EnvList.d.ts +0 -2
- package/code/EnvList.js +2 -3
- package/components.css +660 -423
- package/data/BarChart.d.ts +0 -2
- package/data/BarChart.js +1 -4
- package/data/Chart.d.ts +14 -0
- package/data/Chart.js +149 -0
- package/data/EmptyState.d.ts +8 -13
- package/data/EmptyState.js +62 -24
- package/data/LineChart.js +7 -4
- package/data/Skeleton.d.ts +2 -11
- package/data/Skeleton.js +8 -38
- package/data/Sparkline.js +4 -1
- package/data/StatusDot.d.ts +0 -4
- package/data/StatusDot.js +3 -6
- package/data/Table.d.ts +11 -4
- package/data/Table.js +39 -7
- package/dates/Calendar.d.ts +10 -27
- package/dates/Calendar.js +250 -184
- package/dates/TimePicker.js +2 -2
- package/display/Accordion.d.ts +47 -15
- package/display/Accordion.js +257 -27
- package/display/AspectRatio.d.ts +4 -6
- package/display/AspectRatio.js +7 -5
- package/display/Avatar.d.ts +17 -14
- package/display/Avatar.js +68 -43
- package/display/Badge.d.ts +9 -8
- package/display/Badge.js +32 -14
- package/display/Card.d.ts +11 -13
- package/display/Card.js +74 -29
- package/display/Carousel.d.ts +23 -15
- package/display/Carousel.js +217 -66
- package/display/Collapsible.d.ts +19 -9
- package/display/Collapsible.js +140 -28
- package/display/Direction.d.ts +10 -0
- package/display/Direction.js +24 -0
- package/display/Item.d.ts +19 -0
- package/display/Item.js +152 -0
- package/display/Kbd.d.ts +5 -7
- package/display/Kbd.js +22 -10
- package/display/Link.js +2 -4
- package/display/Resizable.d.ts +6 -16
- package/display/Resizable.js +141 -58
- package/display/ScrollArea.d.ts +3 -1
- package/display/ScrollArea.js +30 -5
- package/display/Separator.d.ts +9 -0
- package/display/Separator.js +18 -0
- package/display/Timeline.d.ts +24 -0
- package/display/Timeline.js +51 -0
- package/display/Toolbar.js +5 -4
- package/display/TreeList.d.ts +0 -2
- package/display/TreeList.js +2 -5
- package/feedback/Alert.d.ts +13 -13
- package/feedback/Alert.js +40 -36
- package/feedback/AlertDialog.d.ts +30 -0
- package/feedback/AlertDialog.js +249 -0
- package/feedback/Banner.d.ts +1 -3
- package/feedback/Banner.js +1 -5
- package/feedback/ConfirmDialog.d.ts +1 -1
- package/feedback/ConfirmDialog.js +18 -20
- package/feedback/Dialog.d.ts +13 -16
- package/feedback/Dialog.js +204 -62
- package/feedback/Progress.d.ts +8 -9
- package/feedback/Progress.js +42 -24
- package/feedback/Sonner.d.ts +8 -0
- package/feedback/Sonner.js +238 -0
- package/feedback/Spinner.d.ts +2 -9
- package/feedback/Spinner.js +19 -28
- package/feedback/Tooltip.d.ts +9 -10
- package/feedback/Tooltip.js +147 -96
- package/files/Attachment.d.ts +27 -0
- package/files/Attachment.js +111 -0
- package/files/FileDrop.js +3 -1
- package/finance/PaymentCard.js +3 -3
- package/forms/Button.d.ts +6 -5
- package/forms/Button.js +42 -8
- package/forms/ButtonGroup.d.ts +11 -3
- package/forms/ButtonGroup.js +57 -6
- package/forms/Checkbox.d.ts +14 -3
- package/forms/Checkbox.js +84 -16
- package/forms/Combobox.d.ts +24 -16
- package/forms/Combobox.js +466 -135
- package/forms/Field.d.ts +14 -0
- package/forms/Field.js +99 -0
- package/forms/IconButton.d.ts +1 -1
- package/forms/IconButton.js +4 -3
- package/forms/Input.d.ts +8 -8
- package/forms/Input.js +46 -33
- package/forms/InputGroup.d.ts +8 -15
- package/forms/InputGroup.js +74 -35
- package/forms/InputOTP.d.ts +13 -0
- package/forms/InputOTP.js +125 -0
- package/forms/Label.d.ts +2 -6
- package/forms/Label.js +6 -4
- package/forms/NativeSelect.d.ts +16 -0
- package/forms/NativeSelect.js +35 -0
- package/forms/NumberInput.js +2 -2
- package/forms/Radio.d.ts +12 -1
- package/forms/Radio.js +76 -6
- package/forms/Select.d.ts +12 -9
- package/forms/Select.js +254 -42
- package/forms/Slider.d.ts +10 -17
- package/forms/Slider.js +78 -39
- package/forms/Switch.d.ts +8 -2
- package/forms/Switch.js +46 -15
- package/forms/Textarea.d.ts +1 -1
- package/forms/Textarea.js +26 -18
- package/forms/Toggle.d.ts +18 -15
- package/forms/Toggle.js +96 -42
- package/icons/_svg.js +2 -0
- package/index.d.ts +20 -8
- package/index.js +50 -38
- package/navigation/Breadcrumbs.d.ts +18 -11
- package/navigation/Breadcrumbs.js +99 -26
- package/navigation/Menubar.d.ts +52 -10
- package/navigation/Menubar.js +191 -146
- package/navigation/NavigationMenu.d.ts +15 -0
- package/navigation/NavigationMenu.js +296 -0
- package/navigation/Pagination.d.ts +10 -9
- package/navigation/Pagination.js +94 -51
- package/navigation/SideNav.js +4 -3
- package/navigation/Sidebar.d.ts +29 -0
- package/navigation/Sidebar.js +311 -0
- package/navigation/Tabs.d.ts +9 -5
- package/navigation/Tabs.js +132 -44
- package/overlay/Command.d.ts +32 -0
- package/overlay/Command.js +257 -0
- package/overlay/ContextMenu.d.ts +40 -8
- package/overlay/ContextMenu.js +468 -107
- package/overlay/Drawer.d.ts +29 -14
- package/overlay/Drawer.js +178 -80
- package/overlay/DropdownMenu.d.ts +43 -0
- package/overlay/DropdownMenu.js +502 -0
- package/overlay/HoverCard.d.ts +21 -12
- package/overlay/HoverCard.js +129 -61
- package/overlay/Popover.d.ts +11 -13
- package/overlay/Popover.js +138 -65
- package/overlay/Portal.js +21 -7
- package/overlay/Sheet.d.ts +11 -0
- package/overlay/Sheet.js +62 -0
- package/package.json +4 -1
- package/tokens/base.css +1 -1
- package/dates/DatePicker.d.ts +0 -14
- package/dates/DatePicker.js +0 -111
- package/dates/DateRangePicker.d.ts +0 -23
- package/dates/DateRangePicker.js +0 -150
- package/display/ListItem.d.ts +0 -19
- package/display/ListItem.js +0 -50
- package/feedback/Toast.d.ts +0 -78
- package/feedback/Toast.js +0 -192
- package/forms/DigitEntry.d.ts +0 -15
- package/forms/DigitEntry.js +0 -79
- package/forms/FormField.d.ts +0 -82
- package/forms/FormField.js +0 -209
- package/overlay/CommandPalette.d.ts +0 -21
- package/overlay/CommandPalette.js +0 -148
- package/overlay/Menu.d.ts +0 -24
- 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
|
-
});
|