@adecore/ui 0.31.11 → 0.32.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/dist/AccentSwatches.js +290 -13
- package/dist/Banner.js +90 -9
- package/dist/Button.js +114 -22
- package/dist/ButtonGroup.js +62 -8
- package/dist/Checkbox.js +73 -4
- package/dist/ChoiceCards.js +205 -11
- package/dist/CloseButton.js +87 -7
- package/dist/ColorSwatch.js +132 -15
- package/dist/ColorWheelPicker.js +305 -71
- package/dist/ColumnResizeHandle.js +43 -8
- package/dist/DisabledReason.js +27 -8
- package/dist/DockShell.js +144 -37
- package/dist/EmptyState.js +95 -6
- package/dist/ErrorBoundary.js +254 -31
- package/dist/Field.js +349 -31
- package/dist/FileIcon.js +67 -6
- package/dist/Icon.js +38 -6
- package/dist/IconButton.js +176 -20
- package/dist/IconPicker.js +344 -73
- package/dist/Input.js +233 -14
- package/dist/Kbd.js +150 -10
- package/dist/LazyBoundary.js +14 -5
- package/dist/ListRow.js +75 -15
- package/dist/Meter.js +108 -5
- package/dist/MiddleTruncate.js +126 -45
- package/dist/PanelEmpty.js +64 -5
- package/dist/PanelHeader.js +95 -13
- package/dist/Pill.js +114 -19
- package/dist/ProjectSwitcher.js +225 -12
- package/dist/PromptDialog.js +352 -37
- package/dist/SectionLabel.js +62 -8
- package/dist/SegmentBar.js +197 -36
- package/dist/Segmented.js +130 -23
- package/dist/Select.js +310 -19
- package/dist/SelectSearch.js +344 -29
- package/dist/Separator.js +35 -4
- package/dist/ShortcutHints.js +146 -76
- package/dist/Skeleton.js +31 -4
- package/dist/Slider.js +172 -10
- package/dist/SlidingColumn.js +194 -34
- package/dist/Spinner.js +100 -3
- package/dist/Stepper.js +232 -11
- package/dist/Surface.js +62 -8
- package/dist/Switch.js +60 -6
- package/dist/TextMenu.js +212 -17
- package/dist/Tile.js +149 -5
- package/dist/Toasts.js +391 -33
- package/dist/Tooltip.js +153 -16
- package/dist/UIProvider.js +62 -15
- package/dist/Waveform.js +362 -93
- package/dist/Wipe.js +259 -34
- package/dist/ZoomControls.js +356 -14
- package/dist/class-name.js +1 -1
- package/dist/clipboard.js +15 -17
- package/dist/context-menu/index.parts.js +1 -1
- package/dist/dialog/index.parts.js +1 -1
- package/dist/dialog/parts.js +378 -29
- package/dist/dialog-layer.js +51 -18
- package/dist/error-boundary.js +19 -19
- package/dist/error-message.js +1 -1
- package/dist/field-context.js +7 -5
- package/dist/file-icon.js +23 -21
- package/dist/file-tree/helpers.js +133 -119
- package/dist/file-tree/index.parts.js +3 -3
- package/dist/file-tree/parts.js +418 -127
- package/dist/file-tree/style.js +1 -1
- package/dist/file-tree/use-file-tree-shift.js +43 -30
- package/dist/file-tree/use-file-tree.js +60 -18
- package/dist/file-tree/use-slots.js +220 -192
- package/dist/floating.js +2 -2
- package/dist/format/datetime.js +88 -38
- package/dist/format/duration.js +59 -53
- package/dist/format/index.js +1 -1
- package/dist/format/locale.js +76 -56
- package/dist/format/number.js +77 -61
- package/dist/format/regions.js +4 -2
- package/dist/format/time-zone.js +1 -1
- package/dist/icon-button-size.js +12 -2
- package/dist/icon-picker.js +70 -61
- package/dist/index.js +57 -57
- package/dist/key-value-list/index.parts.js +1 -1
- package/dist/key-value-list/parts.js +256 -22
- package/dist/lazy-landings.js +10 -10
- package/dist/lazy.js +84 -71
- package/dist/locales/en.js +80 -80
- package/dist/locales/nl.js +80 -80
- package/dist/locales.js +10 -7
- package/dist/menu/index.parts.js +1 -1
- package/dist/menu/parts.js +882 -44
- package/dist/merge-refs.js +8 -9
- package/dist/middle-truncate.js +24 -25
- package/dist/modality.js +27 -19
- package/dist/placement.js +11 -20
- package/dist/platform.js +6 -6
- package/dist/popover/index.parts.js +1 -1
- package/dist/popover/parts.js +173 -11
- package/dist/popup-layer.js +38 -17
- package/dist/prefetch.js +78 -79
- package/dist/preview-card/index.parts.js +1 -1
- package/dist/project-switcher-row.js +153 -12
- package/dist/select-row.js +69 -5
- package/dist/select-shared.js +6 -6
- package/dist/selection.js +16 -16
- package/dist/seti-icons.js +413 -413
- package/dist/settings/ConfirmDialog.js +55 -8
- package/dist/settings/DetailHeader.js +72 -4
- package/dist/settings/MasterDetail.js +119 -7
- package/dist/settings/SettingsDialog.js +820 -80
- package/dist/settings/SettingsRow.js +205 -18
- package/dist/settings/SettingsSection.js +96 -6
- package/dist/settings/index.js +7 -7
- package/dist/settings/target.js +7 -2
- package/dist/shortcut-hints.js +73 -55
- package/dist/shortcut.js +140 -104
- package/dist/step-places.js +1 -1
- package/dist/tabs/index.parts.js +1 -1
- package/dist/tabs/overflow.js +18 -18
- package/dist/tabs/parts.js +780 -166
- package/dist/testing/dedupe.js +82 -75
- package/dist/testing/fake-source.js +12 -12
- package/dist/testing/index.js +1 -1
- package/dist/toast-store.js +65 -46
- package/dist/tree/index.parts.js +1 -1
- package/dist/tree/parts.js +721 -94
- package/dist/tree/shift.js +28 -22
- package/dist/tree/style.js +2 -2
- package/dist/tree/use-tree-shift.js +178 -117
- package/dist/useAsyncAction.js +23 -19
- package/dist/useColumnResize.js +36 -34
- package/dist/useContentSize.js +62 -18
- package/dist/useMeasuredWidth.js +14 -3
- package/dist/useNow.js +73 -30
- package/dist/wipe-split.js +14 -14
- package/dist/workspace/DropPreview.js +60 -7
- package/dist/workspace/SplitView.js +1025 -441
- package/dist/workspace/TabStrip.js +810 -191
- package/dist/workspace/Workspace.js +276 -26
- package/dist/workspace/context.js +8 -3
- package/dist/workspace/geometry.js +173 -150
- package/dist/workspace/model.js +313 -250
- package/dist/workspace/preview.js +61 -61
- package/dist/zoom.js +2 -2
- package/package.json +1 -1
- package/src/ErrorBoundary.tsx +1 -1
- package/src/Field.tsx +4 -3
- package/src/IconPicker.tsx +3 -3
- package/src/LazyBoundary.tsx +2 -0
- package/src/MiddleTruncate.tsx +2 -2
- package/src/SegmentBar.tsx +2 -2
- package/src/Toasts.tsx +3 -1
- package/src/Tooltip.tsx +7 -10
- package/src/Waveform.tsx +3 -3
- package/src/file-tree/parts.tsx +6 -9
- package/src/file-tree/use-file-tree-shift.tsx +6 -9
- package/src/lazy.tsx +4 -0
- package/src/locales/en.ts +4 -4
- package/src/locales/nl.ts +5 -5
- package/src/settings/SettingsDialog.tsx +1 -1
- package/src/tree/parts.tsx +5 -8
- package/src/useContentSize.ts +3 -3
- package/src/workspace/SplitView.tsx +2 -2
- package/src/workspace/TabStrip.tsx +2 -3
- package/src/workspace/Workspace.tsx +2 -5
package/dist/clipboard.js
CHANGED
|
@@ -3,24 +3,22 @@
|
|
|
3
3
|
* and allowed, and there is nothing a person can do about a refusal, so both sides stay quiet.
|
|
4
4
|
*/
|
|
5
5
|
/* Resolves to whether the text got there, for a caller that tells the person; it never rejects. */
|
|
6
|
-
export const copyText = async
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
await navigator.clipboard.writeText(text);
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
catch {
|
|
15
|
-
return false;
|
|
6
|
+
export const copyText = async text => {
|
|
7
|
+
try {
|
|
8
|
+
if (!navigator.clipboard) {
|
|
9
|
+
return false;
|
|
16
10
|
}
|
|
11
|
+
await navigator.clipboard.writeText(text);
|
|
12
|
+
return true;
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
17
16
|
};
|
|
18
17
|
/* What is on the clipboard, or nothing at all when the browser will not say. */
|
|
19
18
|
export const readClipboardText = async () => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
19
|
+
try {
|
|
20
|
+
return (await navigator.clipboard?.readText()) ?? '';
|
|
21
|
+
} catch {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* A context menu is a menu that opens at the pointer; every part inside it is the menu's own. */
|
|
2
|
-
export { MenuCheck as Check, MenuCheckboxItem as CheckboxItem, MenuGroup as Group, MenuGroupLabel as GroupLabel, MenuHint as Hint, MenuItem as Item, MenuLabel as Label, MenuPopup as Popup, MenuRadioGroup as RadioGroup, MenuRadioItem as RadioItem, ContextMenuRoot as Root, MenuRow as Row, MenuRowAction as RowAction, MenuRowSubmenuTrigger as RowSubmenuTrigger, MenuSeparator as Separator, MenuSubmenuRoot as SubmenuRoot, MenuSubmenuTrigger as SubmenuTrigger, ContextMenuTrigger as Trigger } from
|
|
2
|
+
export { MenuCheck as Check, MenuCheckboxItem as CheckboxItem, MenuGroup as Group, MenuGroupLabel as GroupLabel, MenuHint as Hint, MenuItem as Item, MenuLabel as Label, MenuPopup as Popup, MenuRadioGroup as RadioGroup, MenuRadioItem as RadioItem, ContextMenuRoot as Root, MenuRow as Row, MenuRowAction as RowAction, MenuRowSubmenuTrigger as RowSubmenuTrigger, MenuSeparator as Separator, MenuSubmenuRoot as SubmenuRoot, MenuSubmenuTrigger as SubmenuTrigger, ContextMenuTrigger as Trigger } from "../menu/parts.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DialogClose as Close, DialogDescription as Description, DialogFooter as Footer, DialogPopup as Popup, DialogRoot as Root, DialogText as Text, DialogTitle as Title, DialogTrigger as Trigger } from
|
|
1
|
+
export { DialogClose as Close, DialogDescription as Description, DialogFooter as Footer, DialogPopup as Popup, DialogRoot as Root, DialogText as Text, DialogTitle as Title, DialogTrigger as Trigger } from "./parts.js";
|
package/dist/dialog/parts.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { createContext, useContext, useState } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { Dialog as BaseDialog } from '@base-ui/react/dialog';
|
|
@@ -6,20 +6,80 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
6
6
|
import { withClass } from '../class-name.js';
|
|
7
7
|
import { useDialogLayer } from '../dialog-layer.js';
|
|
8
8
|
/* Whether the dialog is open, for its popup to decide whether it stacks over another one. */
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
10
|
const DialogOpenContext = createContext(false);
|
|
10
11
|
/* A question or a form of a few fields. Every one is as wide as the others, whatever it asks. */
|
|
11
12
|
const SIZE = {
|
|
12
|
-
|
|
13
|
+
sm: 'w-[420px] p-5'
|
|
13
14
|
};
|
|
14
|
-
export function DialogRoot(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
export function DialogRoot(t0) {
|
|
16
|
+
const $ = _c(15);
|
|
17
|
+
let defaultOpen;
|
|
18
|
+
let onOpenChange;
|
|
19
|
+
let open;
|
|
20
|
+
let props;
|
|
21
|
+
if ($[0] !== t0) {
|
|
22
|
+
({
|
|
23
|
+
open,
|
|
24
|
+
defaultOpen,
|
|
25
|
+
onOpenChange,
|
|
26
|
+
...props
|
|
27
|
+
} = t0);
|
|
28
|
+
$[0] = t0;
|
|
29
|
+
$[1] = defaultOpen;
|
|
30
|
+
$[2] = onOpenChange;
|
|
31
|
+
$[3] = open;
|
|
32
|
+
$[4] = props;
|
|
33
|
+
} else {
|
|
34
|
+
defaultOpen = $[1];
|
|
35
|
+
onOpenChange = $[2];
|
|
36
|
+
open = $[3];
|
|
37
|
+
props = $[4];
|
|
38
|
+
}
|
|
39
|
+
const [seen, setSeen] = useState(defaultOpen ?? false);
|
|
40
|
+
const t1 = open ?? seen;
|
|
41
|
+
let t2;
|
|
42
|
+
if ($[5] !== onOpenChange) {
|
|
43
|
+
t2 = (next, details) => {
|
|
44
|
+
onOpenChange?.(next, details);
|
|
45
|
+
if (!details.isCanceled) {
|
|
46
|
+
setSeen(next);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
$[5] = onOpenChange;
|
|
50
|
+
$[6] = t2;
|
|
51
|
+
} else {
|
|
52
|
+
t2 = $[6];
|
|
53
|
+
}
|
|
54
|
+
let t3;
|
|
55
|
+
if ($[7] !== defaultOpen || $[8] !== open || $[9] !== props || $[10] !== t2) {
|
|
56
|
+
t3 = /*#__PURE__*/_jsx(BaseDialog.Root, {
|
|
57
|
+
open: open,
|
|
58
|
+
defaultOpen: defaultOpen,
|
|
59
|
+
onOpenChange: t2,
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
$[7] = defaultOpen;
|
|
63
|
+
$[8] = open;
|
|
64
|
+
$[9] = props;
|
|
65
|
+
$[10] = t2;
|
|
66
|
+
$[11] = t3;
|
|
67
|
+
} else {
|
|
68
|
+
t3 = $[11];
|
|
69
|
+
}
|
|
70
|
+
let t4;
|
|
71
|
+
if ($[12] !== t1 || $[13] !== t3) {
|
|
72
|
+
t4 = /*#__PURE__*/_jsx(DialogOpenContext, {
|
|
73
|
+
value: t1,
|
|
74
|
+
children: t3
|
|
75
|
+
});
|
|
76
|
+
$[12] = t1;
|
|
77
|
+
$[13] = t3;
|
|
78
|
+
$[14] = t4;
|
|
79
|
+
} else {
|
|
80
|
+
t4 = $[14];
|
|
81
|
+
}
|
|
82
|
+
return t4;
|
|
23
83
|
}
|
|
24
84
|
export const DialogTrigger = BaseDialog.Trigger;
|
|
25
85
|
export const DialogClose = BaseDialog.Close;
|
|
@@ -28,28 +88,317 @@ export const DialogClose = BaseDialog.Close;
|
|
|
28
88
|
* one is up, such as one from the menu bar over a settings dialog, takes the nested steps and a
|
|
29
89
|
* backdrop of its own, or the one underneath stays on top and keeps taking clicks.
|
|
30
90
|
*/
|
|
31
|
-
export function DialogPopup(
|
|
32
|
-
|
|
33
|
-
|
|
91
|
+
export function DialogPopup(t0) {
|
|
92
|
+
const $ = _c(23);
|
|
93
|
+
let backdropClassName;
|
|
94
|
+
let className;
|
|
95
|
+
let keepMounted;
|
|
96
|
+
let props;
|
|
97
|
+
let size;
|
|
98
|
+
let t1;
|
|
99
|
+
let t2;
|
|
100
|
+
if ($[0] !== t0) {
|
|
101
|
+
({
|
|
102
|
+
size,
|
|
103
|
+
nested: t1,
|
|
104
|
+
backdrop: t2,
|
|
105
|
+
backdropClassName,
|
|
106
|
+
keepMounted,
|
|
107
|
+
className,
|
|
108
|
+
...props
|
|
109
|
+
} = t0);
|
|
110
|
+
$[0] = t0;
|
|
111
|
+
$[1] = backdropClassName;
|
|
112
|
+
$[2] = className;
|
|
113
|
+
$[3] = keepMounted;
|
|
114
|
+
$[4] = props;
|
|
115
|
+
$[5] = size;
|
|
116
|
+
$[6] = t1;
|
|
117
|
+
$[7] = t2;
|
|
118
|
+
} else {
|
|
119
|
+
backdropClassName = $[1];
|
|
120
|
+
className = $[2];
|
|
121
|
+
keepMounted = $[3];
|
|
122
|
+
props = $[4];
|
|
123
|
+
size = $[5];
|
|
124
|
+
t1 = $[6];
|
|
125
|
+
t2 = $[7];
|
|
126
|
+
}
|
|
127
|
+
const nested = t1 === undefined ? false : t1;
|
|
128
|
+
const backdrop = t2 === undefined ? true : t2;
|
|
129
|
+
const stacked = useDialogLayer(useContext(DialogOpenContext)) || nested;
|
|
130
|
+
let t3;
|
|
131
|
+
if ($[8] !== backdrop || $[9] !== backdropClassName || $[10] !== stacked) {
|
|
132
|
+
t3 = backdrop && /*#__PURE__*/_jsx(BaseDialog.Backdrop, {
|
|
133
|
+
className: clsx("dialog-backdrop", stacked && "dialog-backdrop-nested", backdropClassName),
|
|
134
|
+
forceRender: stacked
|
|
135
|
+
});
|
|
136
|
+
$[8] = backdrop;
|
|
137
|
+
$[9] = backdropClassName;
|
|
138
|
+
$[10] = stacked;
|
|
139
|
+
$[11] = t3;
|
|
140
|
+
} else {
|
|
141
|
+
t3 = $[11];
|
|
142
|
+
}
|
|
143
|
+
let t4;
|
|
144
|
+
if ($[12] !== className || $[13] !== size || $[14] !== stacked) {
|
|
145
|
+
t4 = withClass(clsx("dialog-popup", size !== undefined && SIZE[size], stacked && "dialog-popup-nested"), className);
|
|
146
|
+
$[12] = className;
|
|
147
|
+
$[13] = size;
|
|
148
|
+
$[14] = stacked;
|
|
149
|
+
$[15] = t4;
|
|
150
|
+
} else {
|
|
151
|
+
t4 = $[15];
|
|
152
|
+
}
|
|
153
|
+
let t5;
|
|
154
|
+
if ($[16] !== props || $[17] !== t4) {
|
|
155
|
+
t5 = /*#__PURE__*/_jsx(BaseDialog.Popup, {
|
|
156
|
+
className: t4,
|
|
157
|
+
...props
|
|
158
|
+
});
|
|
159
|
+
$[16] = props;
|
|
160
|
+
$[17] = t4;
|
|
161
|
+
$[18] = t5;
|
|
162
|
+
} else {
|
|
163
|
+
t5 = $[18];
|
|
164
|
+
}
|
|
165
|
+
let t6;
|
|
166
|
+
if ($[19] !== keepMounted || $[20] !== t3 || $[21] !== t5) {
|
|
167
|
+
t6 = /*#__PURE__*/_jsxs(BaseDialog.Portal, {
|
|
168
|
+
keepMounted: keepMounted,
|
|
169
|
+
children: [t3, t5]
|
|
170
|
+
});
|
|
171
|
+
$[19] = keepMounted;
|
|
172
|
+
$[20] = t3;
|
|
173
|
+
$[21] = t5;
|
|
174
|
+
$[22] = t6;
|
|
175
|
+
} else {
|
|
176
|
+
t6 = $[22];
|
|
177
|
+
}
|
|
178
|
+
return t6;
|
|
34
179
|
}
|
|
35
|
-
export function DialogTitle(
|
|
36
|
-
|
|
180
|
+
export function DialogTitle(t0) {
|
|
181
|
+
const $ = _c(10);
|
|
182
|
+
let className;
|
|
183
|
+
let props;
|
|
184
|
+
let t1;
|
|
185
|
+
if ($[0] !== t0) {
|
|
186
|
+
({
|
|
187
|
+
size: t1,
|
|
188
|
+
className,
|
|
189
|
+
...props
|
|
190
|
+
} = t0);
|
|
191
|
+
$[0] = t0;
|
|
192
|
+
$[1] = className;
|
|
193
|
+
$[2] = props;
|
|
194
|
+
$[3] = t1;
|
|
195
|
+
} else {
|
|
196
|
+
className = $[1];
|
|
197
|
+
props = $[2];
|
|
198
|
+
t1 = $[3];
|
|
199
|
+
}
|
|
200
|
+
const size = t1 === undefined ? "base" : t1;
|
|
201
|
+
let t2;
|
|
202
|
+
if ($[4] !== className || $[5] !== size) {
|
|
203
|
+
t2 = withClass(clsx(size === "lg" ? "text-lg" : "text-base", "font-semibold text-text"), className);
|
|
204
|
+
$[4] = className;
|
|
205
|
+
$[5] = size;
|
|
206
|
+
$[6] = t2;
|
|
207
|
+
} else {
|
|
208
|
+
t2 = $[6];
|
|
209
|
+
}
|
|
210
|
+
let t3;
|
|
211
|
+
if ($[7] !== props || $[8] !== t2) {
|
|
212
|
+
t3 = /*#__PURE__*/_jsx(BaseDialog.Title, {
|
|
213
|
+
className: t2,
|
|
214
|
+
...props
|
|
215
|
+
});
|
|
216
|
+
$[7] = props;
|
|
217
|
+
$[8] = t2;
|
|
218
|
+
$[9] = t3;
|
|
219
|
+
} else {
|
|
220
|
+
t3 = $[9];
|
|
221
|
+
}
|
|
222
|
+
return t3;
|
|
37
223
|
}
|
|
38
|
-
const DESCRIPTION = {
|
|
224
|
+
const DESCRIPTION = {
|
|
225
|
+
sm: 'text-sm text-text-muted',
|
|
226
|
+
xs: 'text-xs text-text-muted'
|
|
227
|
+
};
|
|
39
228
|
/* The sentence under the title, which is also what a screen reader reads as the dialog's description. It carries no margin. */
|
|
40
|
-
export function DialogDescription(
|
|
41
|
-
|
|
229
|
+
export function DialogDescription(t0) {
|
|
230
|
+
const $ = _c(10);
|
|
231
|
+
let className;
|
|
232
|
+
let props;
|
|
233
|
+
let t1;
|
|
234
|
+
if ($[0] !== t0) {
|
|
235
|
+
({
|
|
236
|
+
size: t1,
|
|
237
|
+
className,
|
|
238
|
+
...props
|
|
239
|
+
} = t0);
|
|
240
|
+
$[0] = t0;
|
|
241
|
+
$[1] = className;
|
|
242
|
+
$[2] = props;
|
|
243
|
+
$[3] = t1;
|
|
244
|
+
} else {
|
|
245
|
+
className = $[1];
|
|
246
|
+
props = $[2];
|
|
247
|
+
t1 = $[3];
|
|
248
|
+
}
|
|
249
|
+
const size = t1 === undefined ? "sm" : t1;
|
|
250
|
+
const t2 = DESCRIPTION[size];
|
|
251
|
+
let t3;
|
|
252
|
+
if ($[4] !== className || $[5] !== t2) {
|
|
253
|
+
t3 = withClass(t2, className);
|
|
254
|
+
$[4] = className;
|
|
255
|
+
$[5] = t2;
|
|
256
|
+
$[6] = t3;
|
|
257
|
+
} else {
|
|
258
|
+
t3 = $[6];
|
|
259
|
+
}
|
|
260
|
+
let t4;
|
|
261
|
+
if ($[7] !== props || $[8] !== t3) {
|
|
262
|
+
t4 = /*#__PURE__*/_jsx(BaseDialog.Description, {
|
|
263
|
+
className: t3,
|
|
264
|
+
...props
|
|
265
|
+
});
|
|
266
|
+
$[7] = props;
|
|
267
|
+
$[8] = t3;
|
|
268
|
+
$[9] = t4;
|
|
269
|
+
} else {
|
|
270
|
+
t4 = $[9];
|
|
271
|
+
}
|
|
272
|
+
return t4;
|
|
42
273
|
}
|
|
43
274
|
/* A further line in the style of the description that is not the dialog's description: a warning, a note under a choice. */
|
|
44
|
-
export function DialogText(
|
|
45
|
-
|
|
275
|
+
export function DialogText(t0) {
|
|
276
|
+
const $ = _c(16);
|
|
277
|
+
let className;
|
|
278
|
+
let props;
|
|
279
|
+
let ref;
|
|
280
|
+
let render;
|
|
281
|
+
let t1;
|
|
282
|
+
if ($[0] !== t0) {
|
|
283
|
+
({
|
|
284
|
+
size: t1,
|
|
285
|
+
render,
|
|
286
|
+
className,
|
|
287
|
+
ref,
|
|
288
|
+
...props
|
|
289
|
+
} = t0);
|
|
290
|
+
$[0] = t0;
|
|
291
|
+
$[1] = className;
|
|
292
|
+
$[2] = props;
|
|
293
|
+
$[3] = ref;
|
|
294
|
+
$[4] = render;
|
|
295
|
+
$[5] = t1;
|
|
296
|
+
} else {
|
|
297
|
+
className = $[1];
|
|
298
|
+
props = $[2];
|
|
299
|
+
ref = $[3];
|
|
300
|
+
render = $[4];
|
|
301
|
+
t1 = $[5];
|
|
302
|
+
}
|
|
303
|
+
const size = t1 === undefined ? "sm" : t1;
|
|
304
|
+
const t2 = DESCRIPTION[size];
|
|
305
|
+
let t3;
|
|
306
|
+
if ($[6] !== className || $[7] !== t2) {
|
|
307
|
+
t3 = clsx(t2, className);
|
|
308
|
+
$[6] = className;
|
|
309
|
+
$[7] = t2;
|
|
310
|
+
$[8] = t3;
|
|
311
|
+
} else {
|
|
312
|
+
t3 = $[8];
|
|
313
|
+
}
|
|
314
|
+
let t4;
|
|
315
|
+
if ($[9] !== props || $[10] !== t3) {
|
|
316
|
+
t4 = {
|
|
317
|
+
...props,
|
|
318
|
+
className: t3
|
|
319
|
+
};
|
|
320
|
+
$[9] = props;
|
|
321
|
+
$[10] = t3;
|
|
322
|
+
$[11] = t4;
|
|
323
|
+
} else {
|
|
324
|
+
t4 = $[11];
|
|
325
|
+
}
|
|
326
|
+
let t5;
|
|
327
|
+
if ($[12] !== ref || $[13] !== render || $[14] !== t4) {
|
|
328
|
+
t5 = {
|
|
329
|
+
render,
|
|
330
|
+
ref,
|
|
331
|
+
defaultTagName: "p",
|
|
332
|
+
props: t4
|
|
333
|
+
};
|
|
334
|
+
$[12] = ref;
|
|
335
|
+
$[13] = render;
|
|
336
|
+
$[14] = t4;
|
|
337
|
+
$[15] = t5;
|
|
338
|
+
} else {
|
|
339
|
+
t5 = $[15];
|
|
340
|
+
}
|
|
341
|
+
return useRender(t5);
|
|
46
342
|
}
|
|
47
343
|
/* The buttons at the foot of a dialog, the main action last and so on the right. */
|
|
48
|
-
export function DialogFooter(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
344
|
+
export function DialogFooter(t0) {
|
|
345
|
+
const $ = _c(14);
|
|
346
|
+
let className;
|
|
347
|
+
let props;
|
|
348
|
+
let ref;
|
|
349
|
+
let render;
|
|
350
|
+
if ($[0] !== t0) {
|
|
351
|
+
({
|
|
352
|
+
render,
|
|
353
|
+
className,
|
|
354
|
+
ref,
|
|
355
|
+
...props
|
|
356
|
+
} = t0);
|
|
357
|
+
$[0] = t0;
|
|
358
|
+
$[1] = className;
|
|
359
|
+
$[2] = props;
|
|
360
|
+
$[3] = ref;
|
|
361
|
+
$[4] = render;
|
|
362
|
+
} else {
|
|
363
|
+
className = $[1];
|
|
364
|
+
props = $[2];
|
|
365
|
+
ref = $[3];
|
|
366
|
+
render = $[4];
|
|
367
|
+
}
|
|
368
|
+
let t1;
|
|
369
|
+
if ($[5] !== className) {
|
|
370
|
+
t1 = clsx("mt-4 flex flex-wrap items-center justify-end gap-2", className);
|
|
371
|
+
$[5] = className;
|
|
372
|
+
$[6] = t1;
|
|
373
|
+
} else {
|
|
374
|
+
t1 = $[6];
|
|
375
|
+
}
|
|
376
|
+
let t2;
|
|
377
|
+
if ($[7] !== props || $[8] !== t1) {
|
|
378
|
+
t2 = {
|
|
379
|
+
...props,
|
|
380
|
+
className: t1
|
|
381
|
+
};
|
|
382
|
+
$[7] = props;
|
|
383
|
+
$[8] = t1;
|
|
384
|
+
$[9] = t2;
|
|
385
|
+
} else {
|
|
386
|
+
t2 = $[9];
|
|
387
|
+
}
|
|
388
|
+
let t3;
|
|
389
|
+
if ($[10] !== ref || $[11] !== render || $[12] !== t2) {
|
|
390
|
+
t3 = {
|
|
391
|
+
render,
|
|
392
|
+
ref,
|
|
393
|
+
defaultTagName: "div",
|
|
394
|
+
props: t2
|
|
395
|
+
};
|
|
396
|
+
$[10] = ref;
|
|
397
|
+
$[11] = render;
|
|
398
|
+
$[12] = t2;
|
|
399
|
+
$[13] = t3;
|
|
400
|
+
} else {
|
|
401
|
+
t3 = $[13];
|
|
402
|
+
}
|
|
403
|
+
return useRender(t3);
|
|
404
|
+
}
|
package/dist/dialog-layer.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
2
|
import { useLayoutEffect, useRef, useState } from 'react';
|
|
2
3
|
// The app-level dialogs open right now. Each one is its own root, so Base UI does not see them as nested.
|
|
3
4
|
const open = new Set();
|
|
@@ -7,21 +8,53 @@ const open = new Set();
|
|
|
7
8
|
* `dialog-popup-nested`, a forced backdrop), or the one underneath stays on top and keeps taking clicks.
|
|
8
9
|
*/
|
|
9
10
|
export function useDialogLayer(isOpen) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
const $ = _c(5);
|
|
12
|
+
let t0;
|
|
13
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
14
|
+
t0 = Symbol("dialog");
|
|
15
|
+
$[0] = t0;
|
|
16
|
+
} else {
|
|
17
|
+
t0 = $[0];
|
|
18
|
+
}
|
|
19
|
+
const id = useRef(t0);
|
|
20
|
+
let t1;
|
|
21
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
22
|
+
t1 = {
|
|
23
|
+
open: false,
|
|
24
|
+
stacked: false
|
|
25
|
+
};
|
|
26
|
+
$[1] = t1;
|
|
27
|
+
} else {
|
|
28
|
+
t1 = $[1];
|
|
29
|
+
}
|
|
30
|
+
const [seen, setSeen] = useState(t1);
|
|
31
|
+
if (seen.open !== isOpen) {
|
|
32
|
+
setSeen({
|
|
33
|
+
open: isOpen,
|
|
34
|
+
stacked: isOpen && open.size > 0
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
let t2;
|
|
38
|
+
let t3;
|
|
39
|
+
if ($[2] !== isOpen) {
|
|
40
|
+
t2 = () => {
|
|
41
|
+
if (!isOpen) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const self = id.current;
|
|
45
|
+
open.add(self);
|
|
46
|
+
return () => {
|
|
47
|
+
open.delete(self);
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
t3 = [isOpen];
|
|
51
|
+
$[2] = isOpen;
|
|
52
|
+
$[3] = t2;
|
|
53
|
+
$[4] = t3;
|
|
54
|
+
} else {
|
|
55
|
+
t2 = $[3];
|
|
56
|
+
t3 = $[4];
|
|
57
|
+
}
|
|
58
|
+
useLayoutEffect(t2, t3);
|
|
59
|
+
return isOpen && seen.stacked;
|
|
60
|
+
}
|
package/dist/error-boundary.js
CHANGED
|
@@ -8,27 +8,27 @@
|
|
|
8
8
|
* page every time the data under it changes.
|
|
9
9
|
*/
|
|
10
10
|
export const shouldReset = (failed, previous, next) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
if (!failed) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
if (previous.length !== next.length) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return previous.some((key, i) => !Object.is(key, next[i]));
|
|
18
18
|
};
|
|
19
19
|
/* A thrown value is not always an Error, and the message has to say something either way. */
|
|
20
|
-
export const errorMessageOf =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
export const errorMessageOf = error => {
|
|
21
|
+
if (error instanceof Error) {
|
|
22
|
+
return error.message || error.name;
|
|
23
|
+
}
|
|
24
|
+
return typeof error === 'string' ? error : String(error);
|
|
25
25
|
};
|
|
26
26
|
/* The text behind the copy button: what a bug report needs, the component stack included. */
|
|
27
27
|
export const errorReport = (label, error, componentStack) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
28
|
+
const stack = error instanceof Error && error.stack ? error.stack : errorMessageOf(error);
|
|
29
|
+
const parts = [label, stack];
|
|
30
|
+
if (componentStack) {
|
|
31
|
+
parts.push(`Component stack:${componentStack}`);
|
|
32
|
+
}
|
|
33
|
+
return parts.join('\n\n');
|
|
34
|
+
};
|
package/dist/error-message.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* The sentence of an error, for a person to read. One that crossed an Electron bridge (`ipcRenderer.invoke`)
|
|
2
2
|
carries Electron's own prefix, which says nothing to a person. A throw that is not an Error has no
|
|
3
3
|
sentence in it, so a caller that knows the step names it. */
|
|
4
|
-
export const messageOf = (e, fallback) => (e instanceof Error ? e.message :
|
|
4
|
+
export const messageOf = (e, fallback) => (e instanceof Error ? e.message : fallback ?? String(e)).replace(/^Error invoking remote method '[^']+': (?:[A-Za-z]*Error: )?/, '');
|
package/dist/field-context.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { createContext, useContext } from 'react';
|
|
2
2
|
export const FieldContext = createContext(null);
|
|
3
3
|
/* What an `Input` or a `TextArea` inside a `Field` takes over: the id its label points at, the hint and the error it is described by. */
|
|
4
|
-
export const useFieldControl = () =>
|
|
4
|
+
export const useFieldControl = () => {
|
|
5
|
+
return useContext(FieldContext);
|
|
6
|
+
};
|
|
5
7
|
/* The attributes that connect a control to its field; an `id` the caller sets wins over the field's. */
|
|
6
8
|
export const fieldControlProps = (field, id) => ({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
});
|
|
9
|
+
id: id ?? field?.id,
|
|
10
|
+
'aria-describedby': field?.describedBy,
|
|
11
|
+
'aria-invalid': field?.invalid || undefined
|
|
12
|
+
});
|