@editora/ui-react 0.1.11 → 0.1.13
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 +13 -1
- package/dist/Accordion.cjs.js +1 -1
- package/dist/Accordion.esm.js +1 -1
- package/dist/Alert.cjs.js +1 -1
- package/dist/Alert.esm.js +1 -1
- package/dist/AlertDialogProvider.cjs.js +1 -1
- package/dist/AlertDialogProvider.esm.js +1 -1
- package/dist/AnimatedBeam.cjs.js +1 -1
- package/dist/AnimatedBeam.esm.js +1 -1
- package/dist/AnimatedList.cjs.js +1 -1
- package/dist/AnimatedList.esm.js +1 -1
- package/dist/AnimatedNumber.cjs.js +1 -1
- package/dist/AnimatedNumber.esm.js +1 -1
- package/dist/AnimatedText.cjs.js +1 -1
- package/dist/AnimatedText.esm.js +1 -1
- package/dist/Avatar.cjs.js +1 -1
- package/dist/Avatar.esm.js +1 -1
- package/dist/Badge.cjs.js +1 -1
- package/dist/Badge.esm.js +1 -1
- package/dist/BlockControls.cjs.js +1 -1
- package/dist/BlockControls.esm.js +1 -1
- package/dist/Breadcrumb.cjs.js +1 -1
- package/dist/Breadcrumb.esm.js +1 -1
- package/dist/Button.cjs.js +1 -1
- package/dist/Button.esm.js +1 -1
- package/dist/Calendar.cjs.js +1 -1
- package/dist/Calendar.esm.js +1 -1
- package/dist/Card.cjs.js +1 -1
- package/dist/Card.esm.js +1 -1
- package/dist/Carousel.cjs.js +2 -0
- package/dist/Carousel.esm.js +438 -0
- package/dist/Chart.cjs.js +1 -1
- package/dist/Chart.esm.js +1 -1
- package/dist/Checkbox.cjs.js +1 -1
- package/dist/Checkbox.esm.js +1 -1
- package/dist/CodeBlock.cjs.js +2 -0
- package/dist/CodeBlock.esm.js +130 -0
- package/dist/CodeSnippet.cjs.js +1 -0
- package/dist/CodeSnippet.esm.js +55 -0
- package/dist/Collapsible.cjs.js +1 -1
- package/dist/Collapsible.esm.js +1 -1
- package/dist/ColorPicker.cjs.js +1 -1
- package/dist/ColorPicker.esm.js +1 -1
- package/dist/Command.cjs.js +1 -1
- package/dist/Command.esm.js +1 -1
- package/dist/CommandPalette.cjs.js +1 -1
- package/dist/CommandPalette.esm.js +1 -1
- package/dist/CopyButton.cjs.js +2 -0
- package/dist/CopyButton.esm.js +116 -0
- package/dist/DataViewToolbar.cjs.js +2 -0
- package/dist/DataViewToolbar.esm.js +125 -0
- package/dist/DateField.cjs.js +1 -1
- package/dist/DateField.esm.js +1 -1
- package/dist/DatePicker.cjs.js +1 -1
- package/dist/DatePicker.esm.js +1 -1
- package/dist/DateRangePicker.cjs.js +1 -1
- package/dist/DateRangePicker.esm.js +1 -1
- package/dist/DateRangeTimePicker.cjs.js +1 -1
- package/dist/DateRangeTimePicker.esm.js +1 -1
- package/dist/DateTimePicker.cjs.js +1 -1
- package/dist/DateTimePicker.esm.js +1 -1
- package/dist/Dialog.cjs.js +1 -1
- package/dist/Dialog.esm.js +86 -65
- package/dist/DialogProvider.cjs.js +1 -1
- package/dist/DialogProvider.esm.js +1 -1
- package/dist/Dock.cjs.js +1 -1
- package/dist/Dock.esm.js +1 -1
- package/dist/EmptyState.cjs.js +1 -1
- package/dist/EmptyState.esm.js +1 -1
- package/dist/FiltersBar.cjs.js +2 -0
- package/dist/FiltersBar.esm.js +81 -0
- package/dist/FloatingToolbar.cjs.js +1 -1
- package/dist/FloatingToolbar.esm.js +1 -1
- package/dist/HoverCard.cjs.js +1 -1
- package/dist/HoverCard.esm.js +1 -1
- package/dist/Icon.cjs.js +1 -1
- package/dist/Icon.esm.js +40 -38
- package/dist/IconCloud.cjs.js +1 -1
- package/dist/IconCloud.esm.js +1 -1
- package/dist/Input.cjs.js +1 -1
- package/dist/Input.esm.js +1 -1
- package/dist/Kbd.cjs.js +1 -0
- package/dist/Kbd.esm.js +95 -0
- package/dist/Marquee.cjs.js +1 -1
- package/dist/Marquee.esm.js +1 -1
- package/dist/MasonryGrid.cjs.js +1 -1
- package/dist/MasonryGrid.esm.js +1 -1
- package/dist/Menubar.cjs.js +1 -1
- package/dist/Menubar.esm.js +1 -1
- package/dist/Meter.cjs.js +1 -1
- package/dist/Meter.esm.js +1 -1
- package/dist/MetricCard.cjs.js +1 -0
- package/dist/MetricCard.esm.js +10 -0
- package/dist/NumberField.cjs.js +1 -1
- package/dist/NumberField.esm.js +1 -1
- package/dist/NumberTicker.cjs.js +1 -1
- package/dist/NumberTicker.esm.js +1 -1
- package/dist/Orbiter.cjs.js +1 -1
- package/dist/Orbiter.esm.js +1 -1
- package/dist/PageHeader.cjs.js +2 -0
- package/dist/PageHeader.esm.js +107 -0
- package/dist/PageToolbar.cjs.js +2 -0
- package/dist/PageToolbar.esm.js +41 -0
- package/dist/PasswordField.cjs.js +1 -1
- package/dist/PasswordField.esm.js +1 -1
- package/dist/PinInput.cjs.js +1 -1
- package/dist/PinInput.esm.js +1 -1
- package/dist/PlacementGrid.cjs.js +1 -1
- package/dist/PlacementGrid.esm.js +1 -1
- package/dist/PluginPanel.cjs.js +1 -1
- package/dist/PluginPanel.esm.js +1 -1
- package/dist/Popover.cjs.js +1 -1
- package/dist/Popover.esm.js +1 -1
- package/dist/Progress.cjs.js +1 -1
- package/dist/Progress.esm.js +1 -1
- package/dist/QuickActions.cjs.js +1 -1
- package/dist/QuickActions.esm.js +1 -1
- package/dist/Radio.cjs.js +2 -0
- package/dist/Radio.esm.js +60 -0
- package/dist/RadioGroup.cjs.js +1 -1
- package/dist/RadioGroup.esm.js +1 -1
- package/dist/RecordHeader.cjs.js +2 -0
- package/dist/RecordHeader.esm.js +96 -0
- package/dist/Select.cjs.js +1 -1
- package/dist/Select.esm.js +1 -1
- package/dist/SelectionPopup.cjs.js +1 -1
- package/dist/SelectionPopup.esm.js +1 -1
- package/dist/Shortcut.cjs.js +1 -0
- package/dist/Shortcut.esm.js +10 -0
- package/dist/Skeleton.cjs.js +1 -1
- package/dist/Skeleton.esm.js +1 -1
- package/dist/Slider.cjs.js +1 -1
- package/dist/Slider.esm.js +1 -1
- package/dist/Sortable.cjs.js +1 -1
- package/dist/Sortable.esm.js +1 -1
- package/dist/SpinningText.cjs.js +1 -1
- package/dist/SpinningText.esm.js +1 -1
- package/dist/SplitButton.cjs.js +396 -1
- package/dist/SplitButton.esm.js +658 -49
- package/dist/Stat.cjs.js +1 -0
- package/dist/Stat.esm.js +75 -0
- package/dist/Stepper.cjs.js +1 -1
- package/dist/Stepper.esm.js +1 -1
- package/dist/Switch.cjs.js +1 -1
- package/dist/Switch.esm.js +1 -1
- package/dist/TagsInput.cjs.js +1 -1
- package/dist/TagsInput.esm.js +1 -1
- package/dist/Textarea.cjs.js +1 -1
- package/dist/Textarea.esm.js +1 -1
- package/dist/ThemeProvider.cjs.js +1 -1
- package/dist/ThemeProvider.esm.js +4 -4
- package/dist/TimePicker.cjs.js +1 -1
- package/dist/TimePicker.esm.js +1 -1
- package/dist/Toggle.cjs.js +1 -1
- package/dist/Toggle.esm.js +1 -1
- package/dist/ToggleGroup.cjs.js +1 -1
- package/dist/ToggleGroup.esm.js +1 -1
- package/dist/TransferList.cjs.js +1 -1
- package/dist/TransferList.esm.js +1 -1
- package/dist/__tests__/setup.d.ts +11 -0
- package/dist/__tests__/setup.d.ts.map +1 -1
- package/dist/{_internals-d86cc997.mjs → _internals-68620b0c.mjs} +26 -30
- package/dist/_internals-a238f8ce.js +1 -0
- package/dist/client.cjs.js +1 -1
- package/dist/client.d.ts +15 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.esm.js +120 -92
- package/dist/components/Accordion.cjs.js +1 -1
- package/dist/components/Accordion.esm.js +1 -1
- package/dist/components/Alert.cjs.js +1 -1
- package/dist/components/Alert.esm.js +1 -1
- package/dist/components/AlertDialogProvider.cjs.js +1 -1
- package/dist/components/AlertDialogProvider.esm.js +1 -1
- package/dist/components/AnimatedBeam.cjs.js +1 -1
- package/dist/components/AnimatedBeam.esm.js +1 -1
- package/dist/components/AnimatedList.cjs.js +1 -1
- package/dist/components/AnimatedList.esm.js +1 -1
- package/dist/components/AnimatedNumber.cjs.js +1 -1
- package/dist/components/AnimatedNumber.esm.js +1 -1
- package/dist/components/AnimatedText.cjs.js +1 -1
- package/dist/components/AnimatedText.esm.js +1 -1
- package/dist/components/Avatar.cjs.js +1 -1
- package/dist/components/Avatar.esm.js +1 -1
- package/dist/components/Badge.cjs.js +1 -1
- package/dist/components/Badge.esm.js +1 -1
- package/dist/components/BlockControls.cjs.js +1 -1
- package/dist/components/BlockControls.esm.js +1 -1
- package/dist/components/Breadcrumb.cjs.js +1 -1
- package/dist/components/Breadcrumb.esm.js +1 -1
- package/dist/components/Button.cjs.js +1 -1
- package/dist/components/Button.d.ts +22 -0
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.esm.js +1 -1
- package/dist/components/Calendar.cjs.js +1 -1
- package/dist/components/Calendar.esm.js +1 -1
- package/dist/components/Card.cjs.js +1 -1
- package/dist/components/Card.esm.js +1 -1
- package/dist/components/Carousel.cjs.js +2 -0
- package/dist/components/Carousel.d.ts +63 -0
- package/dist/components/Carousel.d.ts.map +1 -0
- package/dist/components/Carousel.esm.js +9 -0
- package/dist/components/Chart.cjs.js +1 -1
- package/dist/components/Chart.esm.js +1 -1
- package/dist/components/Checkbox.cjs.js +1 -1
- package/dist/components/Checkbox.esm.js +1 -1
- package/dist/components/CodeBlock.cjs.js +1 -0
- package/dist/components/CodeBlock.d.ts +27 -0
- package/dist/components/CodeBlock.d.ts.map +1 -0
- package/dist/components/CodeBlock.esm.js +6 -0
- package/dist/components/CodeSnippet.cjs.js +1 -0
- package/dist/components/CodeSnippet.d.ts +73 -0
- package/dist/components/CodeSnippet.d.ts.map +1 -0
- package/dist/components/CodeSnippet.esm.js +6 -0
- package/dist/components/Collapsible.cjs.js +1 -1
- package/dist/components/Collapsible.esm.js +1 -1
- package/dist/components/ColorPicker.cjs.js +1 -1
- package/dist/components/ColorPicker.esm.js +1 -1
- package/dist/components/Command.cjs.js +1 -1
- package/dist/components/Command.esm.js +1 -1
- package/dist/components/CommandPalette.cjs.js +1 -1
- package/dist/components/CommandPalette.esm.js +1 -1
- package/dist/components/CopyButton.cjs.js +2 -0
- package/dist/components/CopyButton.d.ts +38 -0
- package/dist/components/CopyButton.d.ts.map +1 -0
- package/dist/components/CopyButton.esm.js +9 -0
- package/dist/components/DataViewToolbar.cjs.js +2 -0
- package/dist/components/DataViewToolbar.d.ts +29 -0
- package/dist/components/DataViewToolbar.d.ts.map +1 -0
- package/dist/components/DataViewToolbar.esm.js +12 -0
- package/dist/components/DateField.cjs.js +1 -1
- package/dist/components/DateField.esm.js +1 -1
- package/dist/components/DatePicker.cjs.js +1 -1
- package/dist/components/DatePicker.esm.js +1 -1
- package/dist/components/DateRangePicker.cjs.js +1 -1
- package/dist/components/DateRangePicker.esm.js +1 -1
- package/dist/components/DateRangeTimePicker.cjs.js +1 -1
- package/dist/components/DateRangeTimePicker.esm.js +1 -1
- package/dist/components/DateTimePicker.cjs.js +1 -1
- package/dist/components/DateTimePicker.esm.js +1 -1
- package/dist/components/Dialog.cjs.js +1 -1
- package/dist/components/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog.esm.js +4 -3
- package/dist/components/DialogProvider.cjs.js +1 -1
- package/dist/components/DialogProvider.esm.js +1 -1
- package/dist/components/Dock.cjs.js +1 -1
- package/dist/components/Dock.esm.js +1 -1
- package/dist/components/EmptyState.cjs.js +1 -1
- package/dist/components/EmptyState.esm.js +1 -1
- package/dist/components/FiltersBar.cjs.js +2 -0
- package/dist/components/FiltersBar.d.ts +46 -0
- package/dist/components/FiltersBar.d.ts.map +1 -0
- package/dist/components/FiltersBar.esm.js +11 -0
- package/dist/components/FloatingToolbar.cjs.js +1 -1
- package/dist/components/FloatingToolbar.esm.js +1 -1
- package/dist/components/HoverCard.cjs.js +1 -1
- package/dist/components/HoverCard.esm.js +1 -1
- package/dist/components/Icon.d.ts +2 -0
- package/dist/components/Icon.d.ts.map +1 -1
- package/dist/components/IconCloud.cjs.js +1 -1
- package/dist/components/IconCloud.esm.js +1 -1
- package/dist/components/Input.cjs.js +1 -1
- package/dist/components/Input.esm.js +1 -1
- package/dist/components/Kbd.cjs.js +1 -0
- package/dist/components/Kbd.d.ts +71 -0
- package/dist/components/Kbd.d.ts.map +1 -0
- package/dist/components/Kbd.esm.js +6 -0
- package/dist/components/Marquee.cjs.js +1 -1
- package/dist/components/Marquee.esm.js +1 -1
- package/dist/components/MasonryGrid.cjs.js +1 -1
- package/dist/components/MasonryGrid.esm.js +1 -1
- package/dist/components/Menubar.cjs.js +1 -1
- package/dist/components/Menubar.esm.js +1 -1
- package/dist/components/Meter.cjs.js +1 -1
- package/dist/components/Meter.esm.js +1 -1
- package/dist/components/MetricCard.cjs.js +1 -0
- package/dist/components/MetricCard.d.ts +6 -0
- package/dist/components/MetricCard.d.ts.map +1 -0
- package/dist/components/MetricCard.esm.js +7 -0
- package/dist/components/NumberField.cjs.js +1 -1
- package/dist/components/NumberField.esm.js +1 -1
- package/dist/components/NumberTicker.cjs.js +1 -1
- package/dist/components/NumberTicker.esm.js +1 -1
- package/dist/components/Orbiter.cjs.js +1 -1
- package/dist/components/Orbiter.esm.js +1 -1
- package/dist/components/PageHeader.cjs.js +2 -0
- package/dist/components/PageHeader.d.ts +41 -0
- package/dist/components/PageHeader.d.ts.map +1 -0
- package/dist/components/PageHeader.esm.js +10 -0
- package/dist/components/PageToolbar.cjs.js +2 -0
- package/dist/components/PageToolbar.d.ts +16 -0
- package/dist/components/PageToolbar.d.ts.map +1 -0
- package/dist/components/PageToolbar.esm.js +11 -0
- package/dist/components/PasswordField.cjs.js +1 -1
- package/dist/components/PasswordField.esm.js +1 -1
- package/dist/components/PinInput.cjs.js +1 -1
- package/dist/components/PinInput.esm.js +1 -1
- package/dist/components/PlacementGrid.cjs.js +1 -1
- package/dist/components/PlacementGrid.esm.js +1 -1
- package/dist/components/PluginPanel.cjs.js +1 -1
- package/dist/components/PluginPanel.esm.js +1 -1
- package/dist/components/Popover.cjs.js +1 -1
- package/dist/components/Popover.esm.js +1 -1
- package/dist/components/Progress.cjs.js +1 -1
- package/dist/components/Progress.esm.js +1 -1
- package/dist/components/QuickActions.cjs.js +1 -1
- package/dist/components/QuickActions.esm.js +1 -1
- package/dist/components/Radio.cjs.js +2 -0
- package/dist/components/Radio.d.ts +25 -0
- package/dist/components/Radio.d.ts.map +1 -0
- package/dist/components/Radio.esm.js +7 -0
- package/dist/components/RadioGroup.cjs.js +1 -1
- package/dist/components/RadioGroup.esm.js +1 -1
- package/dist/components/RecordHeader.cjs.js +2 -0
- package/dist/components/RecordHeader.d.ts +19 -0
- package/dist/components/RecordHeader.d.ts.map +1 -0
- package/dist/components/RecordHeader.esm.js +11 -0
- package/dist/components/Select.cjs.js +1 -1
- package/dist/components/Select.esm.js +1 -1
- package/dist/components/SelectionPopup.cjs.js +1 -1
- package/dist/components/SelectionPopup.esm.js +1 -1
- package/dist/components/Shortcut.cjs.js +1 -0
- package/dist/components/Shortcut.d.ts +12 -0
- package/dist/components/Shortcut.d.ts.map +1 -0
- package/dist/components/Shortcut.esm.js +7 -0
- package/dist/components/Skeleton.cjs.js +1 -1
- package/dist/components/Skeleton.esm.js +1 -1
- package/dist/components/Slider.cjs.js +1 -1
- package/dist/components/Slider.esm.js +1 -1
- package/dist/components/Sortable.cjs.js +1 -1
- package/dist/components/Sortable.esm.js +1 -1
- package/dist/components/SpinningText.cjs.js +1 -1
- package/dist/components/SpinningText.esm.js +1 -1
- package/dist/components/SplitButton.cjs.js +1 -1
- package/dist/components/SplitButton.d.ts +4 -2
- package/dist/components/SplitButton.d.ts.map +1 -1
- package/dist/components/SplitButton.esm.js +3 -2
- package/dist/components/Stat.cjs.js +1 -0
- package/dist/components/Stat.d.ts +61 -0
- package/dist/components/Stat.d.ts.map +1 -0
- package/dist/components/Stat.esm.js +6 -0
- package/dist/components/Stepper.cjs.js +1 -1
- package/dist/components/Stepper.esm.js +1 -1
- package/dist/components/Switch.cjs.js +1 -1
- package/dist/components/Switch.esm.js +1 -1
- package/dist/components/TagsInput.cjs.js +1 -1
- package/dist/components/TagsInput.esm.js +1 -1
- package/dist/components/Textarea.cjs.js +1 -1
- package/dist/components/Textarea.esm.js +1 -1
- package/dist/components/ThemeProvider.cjs.js +1 -1
- package/dist/components/ThemeProvider.esm.js +1 -1
- package/dist/components/TimePicker.cjs.js +1 -1
- package/dist/components/TimePicker.esm.js +1 -1
- package/dist/components/Toggle.cjs.js +1 -1
- package/dist/components/Toggle.esm.js +1 -1
- package/dist/components/ToggleGroup.cjs.js +1 -1
- package/dist/components/ToggleGroup.esm.js +1 -1
- package/dist/components/TransferList.cjs.js +1 -1
- package/dist/components/TransferList.esm.js +1 -1
- package/dist/components/index.d.ts +28 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/hooks/useForm.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +424 -379
- package/dist/{runtime-3cc1c386-b4118dbe.mjs → runtime-864efe2f-3a3f8a32.mjs} +230 -248
- package/dist/runtime-864efe2f-b526ae0d.js +1 -0
- package/dist/server.cjs.js +1 -1
- package/dist/server.d.ts +6 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.esm.js +28 -16
- package/package.json +86 -2
- package/dist/_internals-5a21394b.js +0 -1
- package/dist/runtime-3cc1c386-9d1b191c.js +0 -1
package/dist/SplitButton.esm.js
CHANGED
|
@@ -1,59 +1,668 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import t
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
import t from "react";
|
|
3
|
+
import { createPortal as oe } from "react-dom";
|
|
4
|
+
const V = "editora-split-button-styles", se = `
|
|
5
|
+
.ed-split-button {
|
|
6
|
+
--ed-split-radius: 12px;
|
|
7
|
+
--ed-split-bg: var(--ui-color-primary, #2563eb);
|
|
8
|
+
--ed-split-bg-hover: color-mix(in srgb, var(--ed-split-bg) 84%, #0f172a 16%);
|
|
9
|
+
--ed-split-border: 1px solid color-mix(in srgb, var(--ui-color-border, #cbd5e1) 70%, transparent);
|
|
10
|
+
--ed-split-text: #ffffff;
|
|
11
|
+
--ed-split-shadow: 0 1px 2px rgba(2, 6, 23, 0.12), 0 8px 18px color-mix(in srgb, var(--ed-split-bg) 20%, transparent);
|
|
12
|
+
--ed-split-menu-bg: var(--ui-color-surface, #ffffff);
|
|
13
|
+
--ed-split-menu-text: var(--ui-color-text, #0f172a);
|
|
14
|
+
--ed-split-menu-muted: color-mix(in srgb, var(--ed-split-menu-text) 58%, transparent);
|
|
15
|
+
--ed-split-menu-border: 1px solid color-mix(in srgb, var(--ui-color-border, #cbd5e1) 64%, transparent);
|
|
16
|
+
--ed-split-menu-shadow: 0 22px 44px rgba(2, 6, 23, 0.16), 0 2px 8px rgba(2, 6, 23, 0.08);
|
|
17
|
+
--ed-split-menu-radius: 14px;
|
|
18
|
+
--ed-split-menu-gap: 2px;
|
|
19
|
+
--ed-split-menu-item-radius: 10px;
|
|
20
|
+
--ed-split-menu-item-min-height: 44px;
|
|
21
|
+
--ed-split-menu-item-padding: 10px 10px;
|
|
22
|
+
--ed-split-menu-accent: color-mix(in srgb, var(--ed-split-bg) 12%, transparent);
|
|
23
|
+
--ed-split-menu-accent-strong: color-mix(in srgb, var(--ed-split-bg) 18%, transparent);
|
|
24
|
+
--ed-split-menu-accent-border: color-mix(in srgb, var(--ed-split-bg) 24%, transparent);
|
|
25
|
+
--ed-split-menu-danger: var(--ui-color-danger, #dc2626);
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
position: relative;
|
|
28
|
+
min-width: 0;
|
|
29
|
+
font-family: "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ed-split-button--neutral {
|
|
33
|
+
--ed-split-bg: #ffffff;
|
|
34
|
+
--ed-split-bg-hover: #f8fafc;
|
|
35
|
+
--ed-split-border: 1px solid color-mix(in srgb, #0f172a 12%, transparent);
|
|
36
|
+
--ed-split-text: #0f172a;
|
|
37
|
+
--ed-split-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 10px 24px rgba(15, 23, 42, 0.08);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ed-split-button--flat {
|
|
41
|
+
--ed-split-radius: 10px;
|
|
42
|
+
--ed-split-bg: #ffffff;
|
|
43
|
+
--ed-split-bg-hover: #f1f5f9;
|
|
44
|
+
--ed-split-border: 1px solid #dbe4f0;
|
|
45
|
+
--ed-split-text: #0f172a;
|
|
46
|
+
--ed-split-shadow: none;
|
|
47
|
+
--ed-split-menu-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ed-split-button--contrast {
|
|
51
|
+
--ed-split-bg: #111827;
|
|
52
|
+
--ed-split-bg-hover: #0b1220;
|
|
53
|
+
--ed-split-text: #f8fafc;
|
|
54
|
+
--ed-split-shadow: 0 1px 2px rgba(15, 23, 42, 0.2), 0 16px 36px rgba(15, 23, 42, 0.18);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.ed-split-button--compact {
|
|
58
|
+
--ed-split-radius: 10px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ed-split-button--square {
|
|
62
|
+
--ed-split-radius: 0px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ed-split-button__group {
|
|
66
|
+
display: inline-grid;
|
|
67
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
68
|
+
min-width: 0;
|
|
69
|
+
border: var(--ed-split-border);
|
|
70
|
+
border-radius: var(--ed-split-radius);
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
background: var(--ed-split-bg);
|
|
73
|
+
color: var(--ed-split-text);
|
|
74
|
+
box-shadow: var(--ed-split-shadow);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ed-split-button__primary,
|
|
78
|
+
.ed-split-button__toggle {
|
|
79
|
+
appearance: none;
|
|
80
|
+
border: 0;
|
|
81
|
+
margin: 0;
|
|
82
|
+
background: transparent;
|
|
83
|
+
color: inherit;
|
|
84
|
+
font: 600 14px/1.2 "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
transition: background-color 130ms ease, color 130ms ease;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.ed-split-button__primary {
|
|
90
|
+
min-height: 40px;
|
|
91
|
+
padding: 0 14px;
|
|
92
|
+
display: inline-flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
gap: 8px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ed-split-button__toggle {
|
|
99
|
+
min-height: 40px;
|
|
100
|
+
inline-size: 42px;
|
|
101
|
+
display: inline-grid;
|
|
102
|
+
place-items: center;
|
|
103
|
+
border-inline-start: 1px solid color-mix(in srgb, currentColor 16%, transparent);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.ed-split-button__primary:hover,
|
|
107
|
+
.ed-split-button__primary:focus-visible,
|
|
108
|
+
.ed-split-button__toggle:hover,
|
|
109
|
+
.ed-split-button__toggle:focus-visible,
|
|
110
|
+
.ed-split-button[data-open="true"] .ed-split-button__toggle {
|
|
111
|
+
background: var(--ed-split-bg-hover);
|
|
112
|
+
outline: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.ed-split-button--compact .ed-split-button__primary,
|
|
116
|
+
.ed-split-button--compact .ed-split-button__toggle {
|
|
117
|
+
min-height: 36px;
|
|
118
|
+
font-size: 13px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.ed-split-button--compact .ed-split-button__primary {
|
|
122
|
+
padding-inline: 12px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.ed-split-button--compact .ed-split-button__toggle {
|
|
126
|
+
inline-size: 38px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.ed-split-button--comfortable .ed-split-button__primary,
|
|
130
|
+
.ed-split-button--comfortable .ed-split-button__toggle {
|
|
131
|
+
min-height: 44px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.ed-split-button--comfortable .ed-split-button__primary {
|
|
135
|
+
padding-inline: 16px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.ed-split-button--comfortable .ed-split-button__toggle {
|
|
139
|
+
inline-size: 46px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.ed-split-button__toggleIcon {
|
|
143
|
+
inline-size: 14px;
|
|
144
|
+
block-size: 14px;
|
|
145
|
+
display: block;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.ed-split-button[aria-disabled="true"] {
|
|
149
|
+
opacity: 0.72;
|
|
150
|
+
pointer-events: none;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.ed-split-button__menu {
|
|
154
|
+
--ed-split-bg: var(--ui-color-primary, #2563eb);
|
|
155
|
+
--ed-split-menu-bg: var(--ui-color-surface, #ffffff);
|
|
156
|
+
--ed-split-menu-text: var(--ui-color-text, #0f172a);
|
|
157
|
+
--ed-split-menu-muted: color-mix(in srgb, var(--ed-split-menu-text) 58%, transparent);
|
|
158
|
+
--ed-split-menu-border: 1px solid color-mix(in srgb, var(--ui-color-border, #cbd5e1) 64%, transparent);
|
|
159
|
+
--ed-split-menu-shadow: 0 22px 44px rgba(2, 6, 23, 0.16), 0 2px 8px rgba(2, 6, 23, 0.08);
|
|
160
|
+
--ed-split-menu-radius: 14px;
|
|
161
|
+
--ed-split-menu-gap: 2px;
|
|
162
|
+
--ed-split-menu-item-radius: 10px;
|
|
163
|
+
--ed-split-menu-item-min-height: 44px;
|
|
164
|
+
--ed-split-menu-item-padding: 10px 10px;
|
|
165
|
+
--ed-split-menu-accent: color-mix(in srgb, var(--ed-split-bg) 12%, transparent);
|
|
166
|
+
--ed-split-menu-accent-strong: color-mix(in srgb, var(--ed-split-bg) 18%, transparent);
|
|
167
|
+
--ed-split-menu-accent-border: color-mix(in srgb, var(--ed-split-bg) 24%, transparent);
|
|
168
|
+
--ed-split-menu-danger: var(--ui-color-danger, #dc2626);
|
|
169
|
+
position: fixed;
|
|
170
|
+
z-index: 1600;
|
|
171
|
+
display: grid;
|
|
172
|
+
gap: 8px;
|
|
173
|
+
min-width: 240px;
|
|
174
|
+
max-width: min(360px, calc(100vw - 16px));
|
|
175
|
+
max-height: min(420px, calc(100vh - 16px));
|
|
176
|
+
overflow: hidden auto;
|
|
177
|
+
padding: 8px;
|
|
178
|
+
box-sizing: border-box;
|
|
179
|
+
border: var(--ed-split-menu-border);
|
|
180
|
+
border-radius: calc(var(--ed-split-menu-radius) + 2px);
|
|
181
|
+
background: var(--ed-split-menu-bg);
|
|
182
|
+
color: var(--ed-split-menu-text);
|
|
183
|
+
box-shadow: var(--ed-split-menu-shadow);
|
|
184
|
+
outline: none;
|
|
185
|
+
opacity: 0;
|
|
186
|
+
transform: translateY(-4px) scale(0.985);
|
|
187
|
+
animation: ed-split-button-menu-in 150ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.ed-split-button__menu--neutral {
|
|
191
|
+
--ed-split-bg: #2563eb;
|
|
192
|
+
--ed-split-menu-bg: #ffffff;
|
|
193
|
+
--ed-split-menu-text: #0f172a;
|
|
194
|
+
--ed-split-menu-muted: color-mix(in srgb, var(--ed-split-menu-text) 58%, transparent);
|
|
195
|
+
--ed-split-menu-border: 1px solid color-mix(in srgb, #0f172a 12%, transparent);
|
|
196
|
+
--ed-split-menu-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.ed-split-button__menu--flat {
|
|
200
|
+
--ed-split-bg: #2563eb;
|
|
201
|
+
--ed-split-menu-bg: #ffffff;
|
|
202
|
+
--ed-split-menu-text: #0f172a;
|
|
203
|
+
--ed-split-menu-muted: color-mix(in srgb, var(--ed-split-menu-text) 58%, transparent);
|
|
204
|
+
--ed-split-menu-border: 1px solid #dbe4f0;
|
|
205
|
+
--ed-split-menu-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
|
|
206
|
+
--ed-split-menu-accent: #eef4ff;
|
|
207
|
+
--ed-split-menu-accent-strong: #e0ecff;
|
|
208
|
+
--ed-split-menu-accent-border: color-mix(in srgb, #2563eb 20%, transparent);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.ed-split-button__menu--contrast {
|
|
212
|
+
--ed-split-bg: #2563eb;
|
|
213
|
+
--ed-split-menu-bg: #111827;
|
|
214
|
+
--ed-split-menu-text: #f8fafc;
|
|
215
|
+
--ed-split-menu-muted: color-mix(in srgb, var(--ed-split-menu-text) 58%, transparent);
|
|
216
|
+
--ed-split-menu-border: 1px solid #334155;
|
|
217
|
+
--ed-split-menu-shadow: 0 18px 36px rgba(15, 23, 42, 0.3), 0 2px 8px rgba(15, 23, 42, 0.2);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.ed-split-button__menu[data-placement="top"] {
|
|
221
|
+
transform-origin: bottom left;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.ed-split-button__menu[data-placement="bottom"] {
|
|
225
|
+
transform-origin: top left;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.ed-split-button__menuHeader {
|
|
229
|
+
display: grid;
|
|
230
|
+
gap: 4px;
|
|
231
|
+
padding: 4px 6px 2px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.ed-split-button__menuHeading {
|
|
235
|
+
margin: 0;
|
|
236
|
+
font: 700 13px/1.25 "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
237
|
+
letter-spacing: 0.015em;
|
|
238
|
+
color: var(--ed-split-menu-text);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.ed-split-button__menuDescription {
|
|
242
|
+
margin: 0;
|
|
243
|
+
font: 500 12px/1.5 "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
244
|
+
color: var(--ed-split-menu-muted);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.ed-split-button__list {
|
|
248
|
+
display: grid;
|
|
249
|
+
gap: var(--ed-split-menu-gap);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.ed-split-button__menu--compact {
|
|
253
|
+
--ed-split-menu-gap: 1px;
|
|
254
|
+
--ed-split-menu-item-radius: 8px;
|
|
255
|
+
--ed-split-menu-item-min-height: 38px;
|
|
256
|
+
--ed-split-menu-item-padding: 8px 10px;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.ed-split-button__menu--airy {
|
|
260
|
+
--ed-split-menu-gap: 4px;
|
|
261
|
+
--ed-split-menu-item-radius: 14px;
|
|
262
|
+
--ed-split-menu-item-min-height: 50px;
|
|
263
|
+
--ed-split-menu-item-padding: 12px;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.ed-split-button__menu--flat {
|
|
267
|
+
--ed-split-menu-radius: 10px;
|
|
268
|
+
--ed-split-menu-item-radius: 8px;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.ed-split-button__menu--soft {
|
|
272
|
+
--ed-split-menu-radius: 18px;
|
|
273
|
+
--ed-split-menu-item-radius: 14px;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.ed-split-button__menu--square {
|
|
277
|
+
--ed-split-menu-radius: 0px;
|
|
278
|
+
--ed-split-menu-item-radius: 0px;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.ed-split-button__item {
|
|
282
|
+
inline-size: 100%;
|
|
283
|
+
min-inline-size: 0;
|
|
284
|
+
min-block-size: var(--ed-split-menu-item-min-height);
|
|
285
|
+
box-sizing: border-box;
|
|
286
|
+
display: grid;
|
|
287
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
288
|
+
align-items: center;
|
|
289
|
+
gap: 10px;
|
|
290
|
+
padding: var(--ed-split-menu-item-padding);
|
|
291
|
+
border: 1px solid transparent;
|
|
292
|
+
border-radius: var(--ed-split-menu-item-radius);
|
|
293
|
+
background: transparent;
|
|
294
|
+
color: inherit;
|
|
295
|
+
text-align: left;
|
|
296
|
+
font: 500 13px/1.35 "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
297
|
+
cursor: pointer;
|
|
298
|
+
transition:
|
|
299
|
+
background-color 130ms ease,
|
|
300
|
+
border-color 130ms ease,
|
|
301
|
+
color 130ms ease,
|
|
302
|
+
box-shadow 130ms ease;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.ed-split-button__item:hover,
|
|
306
|
+
.ed-split-button__item[data-active="true"] {
|
|
307
|
+
background: var(--ed-split-menu-accent);
|
|
308
|
+
border-color: var(--ed-split-menu-accent-border);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.ed-split-button__item[data-active="true"] {
|
|
312
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ed-split-bg) 12%, transparent);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.ed-split-button__item:active {
|
|
316
|
+
background: var(--ed-split-menu-accent-strong);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.ed-split-button__item:focus-visible {
|
|
320
|
+
outline: none;
|
|
321
|
+
background: var(--ed-split-menu-accent);
|
|
322
|
+
border-color: var(--ed-split-menu-accent-border);
|
|
323
|
+
box-shadow:
|
|
324
|
+
inset 0 0 0 1px color-mix(in srgb, var(--ed-split-bg) 12%, transparent),
|
|
325
|
+
0 0 0 3px color-mix(in srgb, var(--ed-split-bg) 14%, transparent);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.ed-split-button__item[aria-disabled="true"] {
|
|
329
|
+
opacity: 0.52;
|
|
330
|
+
cursor: not-allowed;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.ed-split-button__item--danger {
|
|
334
|
+
color: color-mix(in srgb, var(--ed-split-menu-danger) 88%, var(--ed-split-menu-text));
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.ed-split-button__item--danger .ed-split-button__itemDescription {
|
|
338
|
+
color: color-mix(in srgb, var(--ed-split-menu-danger) 68%, transparent);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.ed-split-button__item--danger:hover,
|
|
342
|
+
.ed-split-button__item--danger[data-active="true"],
|
|
343
|
+
.ed-split-button__item--danger:focus-visible {
|
|
344
|
+
border-color: color-mix(in srgb, var(--ed-split-menu-danger) 28%, transparent);
|
|
345
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ed-split-menu-danger) 14%, transparent);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.ed-split-button__itemText {
|
|
349
|
+
min-inline-size: 0;
|
|
350
|
+
display: grid;
|
|
351
|
+
gap: 2px;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.ed-split-button__itemLabel {
|
|
355
|
+
display: block;
|
|
356
|
+
min-inline-size: 0;
|
|
357
|
+
overflow: hidden;
|
|
358
|
+
text-overflow: ellipsis;
|
|
359
|
+
white-space: nowrap;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.ed-split-button__itemDescription {
|
|
363
|
+
display: -webkit-box;
|
|
364
|
+
min-inline-size: 0;
|
|
365
|
+
overflow: hidden;
|
|
366
|
+
-webkit-box-orient: vertical;
|
|
367
|
+
-webkit-line-clamp: 2;
|
|
368
|
+
white-space: normal;
|
|
369
|
+
color: var(--ed-split-menu-muted);
|
|
370
|
+
font-size: 12px;
|
|
371
|
+
line-height: 1.4;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.ed-split-button__itemShortcut {
|
|
375
|
+
white-space: nowrap;
|
|
376
|
+
color: var(--ed-split-menu-muted);
|
|
377
|
+
font: 600 12px/1 "IBM Plex Mono", "SFMono-Regular", "SF Mono", Consolas, monospace;
|
|
378
|
+
letter-spacing: 0.03em;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
@keyframes ed-split-button-menu-in {
|
|
382
|
+
from {
|
|
383
|
+
opacity: 0;
|
|
384
|
+
transform: translateY(-4px) scale(0.985);
|
|
385
|
+
}
|
|
386
|
+
to {
|
|
387
|
+
opacity: 1;
|
|
388
|
+
transform: translateY(0) scale(1);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
@media (prefers-reduced-motion: reduce) {
|
|
393
|
+
.ed-split-button__menu {
|
|
394
|
+
animation: none;
|
|
395
|
+
opacity: 1;
|
|
396
|
+
transform: none;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
`;
|
|
400
|
+
function le() {
|
|
401
|
+
if (typeof document > "u" || document.getElementById(V))
|
|
402
|
+
return;
|
|
403
|
+
const r = document.createElement("style");
|
|
404
|
+
r.id = V, r.textContent = se, document.head.appendChild(r);
|
|
405
|
+
}
|
|
406
|
+
function D(...r) {
|
|
407
|
+
return r.filter(Boolean).join(" ");
|
|
408
|
+
}
|
|
409
|
+
function L(r) {
|
|
410
|
+
return r.findIndex((u) => !u.disabled);
|
|
411
|
+
}
|
|
412
|
+
function G(r, u, y) {
|
|
413
|
+
var f;
|
|
414
|
+
if (!r.length)
|
|
415
|
+
return -1;
|
|
416
|
+
let d = u;
|
|
417
|
+
for (let m = 0; m < r.length; m += 1)
|
|
418
|
+
if (d = (d + y + r.length) % r.length, !((f = r[d]) != null && f.disabled))
|
|
419
|
+
return d;
|
|
420
|
+
return -1;
|
|
421
|
+
}
|
|
422
|
+
function J(r, u) {
|
|
423
|
+
const d = (u === "first" ? r : [...r].reverse()).findIndex((f) => !f.disabled);
|
|
424
|
+
return d < 0 ? -1 : u === "first" ? d : r.length - 1 - d;
|
|
425
|
+
}
|
|
426
|
+
const ae = t.forwardRef(function({
|
|
427
|
+
children: u,
|
|
428
|
+
className: y,
|
|
429
|
+
label: d = "Run action",
|
|
430
|
+
menuLabel: f = "Open action menu",
|
|
431
|
+
menuHeading: m,
|
|
432
|
+
menuDescription: k,
|
|
433
|
+
variant: E = "primary",
|
|
434
|
+
density: F = "default",
|
|
435
|
+
shape: W = "default",
|
|
436
|
+
menuDensity: $ = "default",
|
|
437
|
+
menuShape: H = "default",
|
|
438
|
+
disabled: x = !1,
|
|
439
|
+
items: o = [],
|
|
440
|
+
onPrimaryAction: B,
|
|
441
|
+
onSelect: I,
|
|
442
|
+
style: P,
|
|
443
|
+
...Q
|
|
444
|
+
}, X) {
|
|
445
|
+
const z = t.useRef(null), T = t.useRef(null), N = t.useRef(null), _ = t.useRef(null), U = t.useRef([]), [l, M] = t.useState(!1), [s, b] = t.useState(-1), [a, q] = t.useState(null), K = t.useId(), Y = t.useId();
|
|
446
|
+
t.useImperativeHandle(X, () => z.current), t.useLayoutEffect(() => {
|
|
447
|
+
le();
|
|
448
|
+
}, []);
|
|
449
|
+
const v = t.useCallback(() => {
|
|
450
|
+
const e = T.current, n = _.current;
|
|
451
|
+
if (!e || !n)
|
|
23
452
|
return;
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
453
|
+
const i = e.getBoundingClientRect(), c = window.innerWidth || document.documentElement.clientWidth || 0, p = window.innerHeight || document.documentElement.clientHeight || 0, j = Math.max(260, Math.round(i.width));
|
|
454
|
+
n.style.minWidth = `${j}px`;
|
|
455
|
+
const g = n.getBoundingClientRect(), A = Math.max(0, p - i.bottom - 8), re = Math.max(0, i.top - 8), O = A < g.height && re > A;
|
|
456
|
+
let h = O ? i.top - g.height - 6 : i.bottom + 6, w = i.left;
|
|
457
|
+
w + g.width > c - 8 && (w = c - g.width - 8), w < 8 && (w = 8), h < 8 && (h = 8), h + g.height > p - 8 && (h = Math.max(8, p - g.height - 8)), q({
|
|
458
|
+
top: Math.round(h),
|
|
459
|
+
left: Math.round(w),
|
|
460
|
+
minWidth: j,
|
|
461
|
+
placement: O ? "top" : "bottom"
|
|
462
|
+
});
|
|
463
|
+
}, []);
|
|
464
|
+
t.useEffect(() => {
|
|
465
|
+
var n;
|
|
466
|
+
if (!l) {
|
|
467
|
+
q(null);
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
const e = s >= 0 && !((n = o[s]) != null && n.disabled) ? s : L(o);
|
|
471
|
+
b(e);
|
|
472
|
+
}, [l, o, s]), t.useLayoutEffect(() => {
|
|
473
|
+
if (!l)
|
|
474
|
+
return;
|
|
475
|
+
v();
|
|
476
|
+
const e = requestAnimationFrame(() => {
|
|
477
|
+
var c, p;
|
|
478
|
+
v();
|
|
479
|
+
try {
|
|
480
|
+
(c = _.current) == null || c.focus({ preventScroll: !0 });
|
|
481
|
+
} catch {
|
|
482
|
+
(p = _.current) == null || p.focus();
|
|
483
|
+
}
|
|
484
|
+
}), n = () => v(), i = () => v();
|
|
485
|
+
return window.addEventListener("resize", n, { passive: !0 }), window.addEventListener("scroll", i, { passive: !0, capture: !0 }), () => {
|
|
486
|
+
cancelAnimationFrame(e), window.removeEventListener("resize", n), window.removeEventListener("scroll", i, !0);
|
|
487
|
+
};
|
|
488
|
+
}, [l, v]), t.useEffect(() => {
|
|
489
|
+
if (!l)
|
|
490
|
+
return;
|
|
491
|
+
const e = (n) => {
|
|
492
|
+
var c, p;
|
|
493
|
+
const i = n.target;
|
|
494
|
+
i && ((c = z.current) != null && c.contains(i)) || i && ((p = _.current) != null && p.contains(i)) || M(!1);
|
|
27
495
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
496
|
+
return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
|
|
497
|
+
}, [l]), t.useEffect(() => {
|
|
498
|
+
l || queueMicrotask(() => {
|
|
499
|
+
var e, n;
|
|
500
|
+
try {
|
|
501
|
+
(e = N.current) == null || e.focus({ preventScroll: !0 });
|
|
502
|
+
} catch {
|
|
503
|
+
(n = N.current) == null || n.focus();
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
}, [l]), t.useEffect(() => {
|
|
507
|
+
if (!l || s < 0)
|
|
508
|
+
return;
|
|
509
|
+
const e = U.current[s];
|
|
510
|
+
!e || typeof e.scrollIntoView != "function" || e.scrollIntoView({ block: "nearest" });
|
|
511
|
+
}, [l, s]);
|
|
512
|
+
const R = t.useCallback((e) => {
|
|
513
|
+
const n = o[e];
|
|
514
|
+
!n || n.disabled || (I == null || I({
|
|
515
|
+
index: e,
|
|
516
|
+
value: n.value,
|
|
517
|
+
label: n.label
|
|
518
|
+
}), M(!1));
|
|
519
|
+
}, [o, I]), C = t.useCallback(() => {
|
|
520
|
+
x || o.length === 0 || M(!0);
|
|
521
|
+
}, [x, o.length]), S = t.useCallback(() => {
|
|
522
|
+
M(!1);
|
|
523
|
+
}, []), Z = t.useCallback((e) => {
|
|
524
|
+
(e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") && (e.preventDefault(), C());
|
|
525
|
+
}, [C]), ee = t.useCallback((e) => {
|
|
526
|
+
switch (e.key) {
|
|
527
|
+
case "Escape":
|
|
528
|
+
e.preventDefault(), S();
|
|
529
|
+
return;
|
|
530
|
+
case "Tab":
|
|
531
|
+
S();
|
|
532
|
+
return;
|
|
533
|
+
case "ArrowDown": {
|
|
534
|
+
e.preventDefault();
|
|
535
|
+
const n = s >= 0 ? s : L(o) - 1, i = G(o, n, 1);
|
|
536
|
+
i >= 0 && b(i);
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
case "ArrowUp": {
|
|
540
|
+
e.preventDefault();
|
|
541
|
+
const n = s >= 0 ? s : L(o) + 1, i = G(o, n, -1);
|
|
542
|
+
i >= 0 && b(i);
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
case "Home": {
|
|
546
|
+
e.preventDefault();
|
|
547
|
+
const n = J(o, "first");
|
|
548
|
+
n >= 0 && b(n);
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
case "End": {
|
|
552
|
+
e.preventDefault();
|
|
553
|
+
const n = J(o, "last");
|
|
554
|
+
n >= 0 && b(n);
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
case "Enter":
|
|
558
|
+
case " ": {
|
|
559
|
+
e.preventDefault(), s >= 0 && R(s);
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
default:
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
}, [s, S, o, R]), te = D(
|
|
566
|
+
"ed-split-button",
|
|
567
|
+
E !== "primary" && `ed-split-button--${E}`,
|
|
568
|
+
F !== "default" && `ed-split-button--${F}`,
|
|
569
|
+
W !== "default" && `ed-split-button--${W}`,
|
|
570
|
+
y
|
|
571
|
+
), ne = D(
|
|
572
|
+
"ed-split-button__menu",
|
|
573
|
+
E !== "primary" && `ed-split-button__menu--${E}`,
|
|
574
|
+
$ !== "default" && `ed-split-button__menu--${$}`,
|
|
575
|
+
H !== "default" && `ed-split-button__menu--${H}`
|
|
576
|
+
), ie = l && typeof document < "u" ? oe(
|
|
577
|
+
/* @__PURE__ */ t.createElement(
|
|
578
|
+
"div",
|
|
579
|
+
{
|
|
580
|
+
ref: _,
|
|
581
|
+
className: ne,
|
|
582
|
+
role: "menu",
|
|
583
|
+
tabIndex: -1,
|
|
584
|
+
"aria-labelledby": m ? K : void 0,
|
|
585
|
+
"aria-describedby": k ? Y : void 0,
|
|
586
|
+
"data-placement": (a == null ? void 0 : a.placement) || "bottom",
|
|
587
|
+
onKeyDown: ee,
|
|
588
|
+
style: {
|
|
589
|
+
top: (a == null ? void 0 : a.top) ?? -9999,
|
|
590
|
+
left: (a == null ? void 0 : a.left) ?? -9999,
|
|
591
|
+
minWidth: a == null ? void 0 : a.minWidth,
|
|
592
|
+
visibility: a ? "visible" : "hidden"
|
|
593
|
+
}
|
|
594
|
+
},
|
|
595
|
+
m || k ? /* @__PURE__ */ t.createElement("div", { className: "ed-split-button__menuHeader" }, m ? /* @__PURE__ */ t.createElement("p", { id: K, className: "ed-split-button__menuHeading" }, m) : null, k ? /* @__PURE__ */ t.createElement("p", { id: Y, className: "ed-split-button__menuDescription" }, k) : null) : null,
|
|
596
|
+
/* @__PURE__ */ t.createElement("div", { className: "ed-split-button__list" }, o.map((e, n) => /* @__PURE__ */ t.createElement(
|
|
597
|
+
"button",
|
|
598
|
+
{
|
|
599
|
+
key: e.value,
|
|
600
|
+
ref: (i) => {
|
|
601
|
+
U.current[n] = i;
|
|
602
|
+
},
|
|
603
|
+
type: "button",
|
|
604
|
+
role: "menuitem",
|
|
605
|
+
className: D(
|
|
606
|
+
"ed-split-button__item",
|
|
607
|
+
e.tone === "danger" && "ed-split-button__item--danger"
|
|
608
|
+
),
|
|
609
|
+
"data-active": n === s ? "true" : void 0,
|
|
610
|
+
"aria-disabled": e.disabled ? "true" : void 0,
|
|
611
|
+
disabled: e.disabled,
|
|
612
|
+
onPointerMove: () => {
|
|
613
|
+
e.disabled || b(n);
|
|
614
|
+
},
|
|
615
|
+
onFocus: () => {
|
|
616
|
+
e.disabled || b(n);
|
|
617
|
+
},
|
|
618
|
+
onClick: () => R(n)
|
|
619
|
+
},
|
|
620
|
+
/* @__PURE__ */ t.createElement("span", { className: "ed-split-button__itemText" }, /* @__PURE__ */ t.createElement("span", { className: "ed-split-button__itemLabel" }, e.label), e.description ? /* @__PURE__ */ t.createElement("span", { className: "ed-split-button__itemDescription" }, e.description) : null),
|
|
621
|
+
e.shortcut ? /* @__PURE__ */ t.createElement("span", { className: "ed-split-button__itemShortcut" }, e.shortcut) : null
|
|
622
|
+
)), u)
|
|
623
|
+
),
|
|
624
|
+
document.body
|
|
625
|
+
) : null;
|
|
626
|
+
return /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
627
|
+
"div",
|
|
628
|
+
{
|
|
629
|
+
...Q,
|
|
630
|
+
ref: z,
|
|
631
|
+
className: te,
|
|
632
|
+
style: P,
|
|
633
|
+
"aria-disabled": x ? "true" : void 0,
|
|
634
|
+
"data-open": l ? "true" : void 0
|
|
635
|
+
},
|
|
636
|
+
/* @__PURE__ */ t.createElement("div", { ref: T, className: "ed-split-button__group" }, /* @__PURE__ */ t.createElement(
|
|
637
|
+
"button",
|
|
638
|
+
{
|
|
639
|
+
type: "button",
|
|
640
|
+
className: "ed-split-button__primary",
|
|
641
|
+
disabled: x,
|
|
642
|
+
onClick: () => B == null ? void 0 : B()
|
|
643
|
+
},
|
|
644
|
+
d
|
|
645
|
+
), /* @__PURE__ */ t.createElement(
|
|
34
646
|
"button",
|
|
35
647
|
{
|
|
36
|
-
|
|
37
|
-
slot: "menuitem",
|
|
648
|
+
ref: N,
|
|
38
649
|
type: "button",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
650
|
+
className: "ed-split-button__toggle",
|
|
651
|
+
"aria-label": f,
|
|
652
|
+
"aria-haspopup": "menu",
|
|
653
|
+
"aria-expanded": l ? "true" : "false",
|
|
654
|
+
disabled: x || o.length === 0,
|
|
655
|
+
onClick: () => {
|
|
656
|
+
l ? S() : C();
|
|
657
|
+
},
|
|
658
|
+
onKeyDown: Z
|
|
43
659
|
},
|
|
44
|
-
t.createElement(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
t.createElement("span", { "data-menu-label": "true" }, e.label),
|
|
48
|
-
e.description ? t.createElement("span", { "data-menu-description": "true" }, e.description) : null
|
|
49
|
-
),
|
|
50
|
-
e.shortcut ? t.createElement("span", { "data-menu-shortcut": "true" }, e.shortcut) : null
|
|
51
|
-
)
|
|
52
|
-
)) || null;
|
|
53
|
-
return t.createElement("ui-split-button", { ref: d, ...h }, w, E);
|
|
660
|
+
/* @__PURE__ */ t.createElement("svg", { className: "ed-split-button__toggleIcon", viewBox: "0 0 20 20", "aria-hidden": "true", focusable: "false" }, /* @__PURE__ */ t.createElement("path", { d: "m5 8 5 5 5-5", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }))
|
|
661
|
+
))
|
|
662
|
+
), ie);
|
|
54
663
|
});
|
|
55
|
-
|
|
664
|
+
ae.displayName = "SplitButton";
|
|
56
665
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
666
|
+
ae as SplitButton,
|
|
667
|
+
ae as default
|
|
59
668
|
};
|