@adecore/ui 0.31.12 → 0.33.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
|
@@ -1,16 +1,157 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { MoreHorizontal } from 'lucide-react';
|
|
5
5
|
import * as Menu from './menu/index.parts.js';
|
|
6
|
-
import { Tooltip } from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
6
|
+
import { Tooltip } from "./Tooltip.js";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
export function ProjectSwitcherRow(t0) {
|
|
9
|
+
const $ = _c(35);
|
|
10
|
+
const {
|
|
11
|
+
project,
|
|
12
|
+
onSelect
|
|
13
|
+
} = t0;
|
|
14
|
+
const {
|
|
15
|
+
t
|
|
16
|
+
} = useTranslation("ui");
|
|
17
|
+
const hasActions = Boolean(project.actions);
|
|
18
|
+
const t1 = project.muted && "opacity-50";
|
|
19
|
+
let t2;
|
|
20
|
+
if ($[0] !== t1) {
|
|
21
|
+
t2 = clsx("min-w-0", t1);
|
|
22
|
+
$[0] = t1;
|
|
23
|
+
$[1] = t2;
|
|
24
|
+
} else {
|
|
25
|
+
t2 = $[1];
|
|
26
|
+
}
|
|
27
|
+
let t3;
|
|
28
|
+
if ($[2] !== onSelect || $[3] !== project) {
|
|
29
|
+
t3 = event => onSelect(project, event);
|
|
30
|
+
$[2] = onSelect;
|
|
31
|
+
$[3] = project;
|
|
32
|
+
$[4] = t3;
|
|
33
|
+
} else {
|
|
34
|
+
t3 = $[4];
|
|
35
|
+
}
|
|
36
|
+
let t4;
|
|
37
|
+
if ($[5] !== project.name) {
|
|
38
|
+
t4 = /*#__PURE__*/_jsx("span", {
|
|
39
|
+
className: "min-w-0 truncate",
|
|
40
|
+
children: project.name
|
|
41
|
+
});
|
|
42
|
+
$[5] = project.name;
|
|
43
|
+
$[6] = t4;
|
|
44
|
+
} else {
|
|
45
|
+
t4 = $[6];
|
|
46
|
+
}
|
|
47
|
+
let t5;
|
|
48
|
+
if ($[7] !== project.hint) {
|
|
49
|
+
t5 = project.hint && /*#__PURE__*/_jsx("span", {
|
|
50
|
+
className: "ml-auto truncate pl-3 text-xs text-text-faint",
|
|
51
|
+
children: project.hint
|
|
52
|
+
});
|
|
53
|
+
$[7] = project.hint;
|
|
54
|
+
$[8] = t5;
|
|
55
|
+
} else {
|
|
56
|
+
t5 = $[8];
|
|
57
|
+
}
|
|
58
|
+
let t6;
|
|
59
|
+
if ($[9] !== project.disabled || $[10] !== project.icon || $[11] !== project.name || $[12] !== t2 || $[13] !== t3 || $[14] !== t4 || $[15] !== t5) {
|
|
60
|
+
t6 = /*#__PURE__*/_jsxs(Menu.Item, {
|
|
61
|
+
className: t2,
|
|
62
|
+
disabled: project.disabled,
|
|
63
|
+
label: project.name,
|
|
64
|
+
onClick: t3,
|
|
65
|
+
children: [project.icon, t4, t5]
|
|
66
|
+
});
|
|
67
|
+
$[9] = project.disabled;
|
|
68
|
+
$[10] = project.icon;
|
|
69
|
+
$[11] = project.name;
|
|
70
|
+
$[12] = t2;
|
|
71
|
+
$[13] = t3;
|
|
72
|
+
$[14] = t4;
|
|
73
|
+
$[15] = t5;
|
|
74
|
+
$[16] = t6;
|
|
75
|
+
} else {
|
|
76
|
+
t6 = $[16];
|
|
77
|
+
}
|
|
78
|
+
const item = t6;
|
|
79
|
+
let t7;
|
|
80
|
+
if ($[17] !== hasActions || $[18] !== item || $[19] !== project.description) {
|
|
81
|
+
t7 = project.description ? /*#__PURE__*/_jsx(Tooltip, {
|
|
82
|
+
label: project.description,
|
|
83
|
+
side: "right",
|
|
84
|
+
sideOffset: hasActions ? 41 : undefined,
|
|
85
|
+
children: item
|
|
86
|
+
}) : item;
|
|
87
|
+
$[17] = hasActions;
|
|
88
|
+
$[18] = item;
|
|
89
|
+
$[19] = project.description;
|
|
90
|
+
$[20] = t7;
|
|
91
|
+
} else {
|
|
92
|
+
t7 = $[20];
|
|
93
|
+
}
|
|
94
|
+
const row = t7;
|
|
95
|
+
if (!hasActions) {
|
|
96
|
+
return row;
|
|
97
|
+
}
|
|
98
|
+
const t8 = project.name;
|
|
99
|
+
let t9;
|
|
100
|
+
if ($[21] !== project.name || $[22] !== t) {
|
|
101
|
+
t9 = t("projectSwitcher.actionsFor", {
|
|
102
|
+
name: project.name
|
|
103
|
+
});
|
|
104
|
+
$[21] = project.name;
|
|
105
|
+
$[22] = t;
|
|
106
|
+
$[23] = t9;
|
|
107
|
+
} else {
|
|
108
|
+
t9 = $[23];
|
|
109
|
+
}
|
|
110
|
+
let t10;
|
|
111
|
+
if ($[24] !== t9) {
|
|
112
|
+
t10 = /*#__PURE__*/_jsx(Menu.RowSubmenuTrigger, {
|
|
113
|
+
icon: MoreHorizontal,
|
|
114
|
+
label: t9
|
|
115
|
+
});
|
|
116
|
+
$[24] = t9;
|
|
117
|
+
$[25] = t10;
|
|
118
|
+
} else {
|
|
119
|
+
t10 = $[25];
|
|
120
|
+
}
|
|
121
|
+
let t11;
|
|
122
|
+
if ($[26] !== project.actions) {
|
|
123
|
+
t11 = /*#__PURE__*/_jsx(Menu.Popup, {
|
|
124
|
+
className: "min-w-52",
|
|
125
|
+
children: project.actions
|
|
126
|
+
});
|
|
127
|
+
$[26] = project.actions;
|
|
128
|
+
$[27] = t11;
|
|
129
|
+
} else {
|
|
130
|
+
t11 = $[27];
|
|
131
|
+
}
|
|
132
|
+
let t12;
|
|
133
|
+
if ($[28] !== t10 || $[29] !== t11) {
|
|
134
|
+
t12 = /*#__PURE__*/_jsxs(Menu.SubmenuRoot, {
|
|
135
|
+
children: [t10, t11]
|
|
136
|
+
});
|
|
137
|
+
$[28] = t10;
|
|
138
|
+
$[29] = t11;
|
|
139
|
+
$[30] = t12;
|
|
140
|
+
} else {
|
|
141
|
+
t12 = $[30];
|
|
142
|
+
}
|
|
143
|
+
let t13;
|
|
144
|
+
if ($[31] !== project.name || $[32] !== row || $[33] !== t12) {
|
|
145
|
+
t13 = /*#__PURE__*/_jsxs(Menu.Row, {
|
|
146
|
+
"aria-label": t8,
|
|
147
|
+
children: [row, t12]
|
|
148
|
+
});
|
|
149
|
+
$[31] = project.name;
|
|
150
|
+
$[32] = row;
|
|
151
|
+
$[33] = t12;
|
|
152
|
+
$[34] = t13;
|
|
153
|
+
} else {
|
|
154
|
+
t13 = $[34];
|
|
155
|
+
}
|
|
156
|
+
return t13;
|
|
157
|
+
}
|
package/dist/select-row.js
CHANGED
|
@@ -1,6 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MenuCheck } from
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { MenuCheck } from "./menu/parts.js";
|
|
3
3
|
/* The check, icon and text of a row; `text` is the element that carries the label, which Base UI wants to know. */
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
export function RowContent(t0) {
|
|
6
|
+
const $ = _c(13);
|
|
7
|
+
const {
|
|
8
|
+
item,
|
|
9
|
+
picked,
|
|
10
|
+
text
|
|
11
|
+
} = t0;
|
|
12
|
+
let t1;
|
|
13
|
+
if ($[0] !== picked) {
|
|
14
|
+
t1 = /*#__PURE__*/_jsx(MenuCheck, {
|
|
15
|
+
kind: "radio",
|
|
16
|
+
checked: picked
|
|
17
|
+
});
|
|
18
|
+
$[0] = picked;
|
|
19
|
+
$[1] = t1;
|
|
20
|
+
} else {
|
|
21
|
+
t1 = $[1];
|
|
22
|
+
}
|
|
23
|
+
let t2;
|
|
24
|
+
if ($[2] !== item.icon) {
|
|
25
|
+
t2 = item.icon && /*#__PURE__*/_jsx("span", {
|
|
26
|
+
className: "flex h-lh shrink-0 items-center",
|
|
27
|
+
children: item.icon
|
|
28
|
+
});
|
|
29
|
+
$[2] = item.icon;
|
|
30
|
+
$[3] = t2;
|
|
31
|
+
} else {
|
|
32
|
+
t2 = $[3];
|
|
33
|
+
}
|
|
34
|
+
let t3;
|
|
35
|
+
if ($[4] !== item.description) {
|
|
36
|
+
t3 = item.description && /*#__PURE__*/_jsx("span", {
|
|
37
|
+
className: "text-xs text-text-faint",
|
|
38
|
+
children: item.description
|
|
39
|
+
});
|
|
40
|
+
$[4] = item.description;
|
|
41
|
+
$[5] = t3;
|
|
42
|
+
} else {
|
|
43
|
+
t3 = $[5];
|
|
44
|
+
}
|
|
45
|
+
let t4;
|
|
46
|
+
if ($[6] !== t3 || $[7] !== text) {
|
|
47
|
+
t4 = /*#__PURE__*/_jsxs("span", {
|
|
48
|
+
className: "flex min-w-0 flex-col",
|
|
49
|
+
children: [text, t3]
|
|
50
|
+
});
|
|
51
|
+
$[6] = t3;
|
|
52
|
+
$[7] = text;
|
|
53
|
+
$[8] = t4;
|
|
54
|
+
} else {
|
|
55
|
+
t4 = $[8];
|
|
56
|
+
}
|
|
57
|
+
let t5;
|
|
58
|
+
if ($[9] !== t1 || $[10] !== t2 || $[11] !== t4) {
|
|
59
|
+
t5 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
60
|
+
children: [t1, t2, t4]
|
|
61
|
+
});
|
|
62
|
+
$[9] = t1;
|
|
63
|
+
$[10] = t2;
|
|
64
|
+
$[11] = t4;
|
|
65
|
+
$[12] = t5;
|
|
66
|
+
} else {
|
|
67
|
+
t5 = $[12];
|
|
68
|
+
}
|
|
69
|
+
return t5;
|
|
70
|
+
}
|
package/dist/select-shared.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
export const isGroup =
|
|
2
|
+
export const isGroup = entry => Array.isArray(entry.items);
|
|
3
3
|
export const TRIGGER_SIZE = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
sm: 'h-7 gap-1 px-2',
|
|
5
|
+
md: 'h-8 gap-1.5 px-2'
|
|
6
6
|
};
|
|
7
7
|
export const TRIGGER_VARIANT = {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
outlined: 'max-w-56 rounded-lg border border-border bg-surface-raised text-text',
|
|
9
|
+
ghost: 'rounded-md text-text-muted hover:bg-surface-hover hover:text-text data-[popup-open]:bg-surface-active data-[popup-open]:text-text data-disabled:hover:bg-transparent data-disabled:hover:text-text-muted'
|
|
10
10
|
};
|
|
11
11
|
/* The dimmed look `Switch` and `Button` wear when disabled, so a select that cannot open reads as such. */
|
|
12
12
|
export const TRIGGER_DISABLED = 'data-disabled:cursor-default data-disabled:opacity-50';
|
|
13
13
|
/* The trigger of every select, and of any other picker that stands in a row of selects and has to line up with them. */
|
|
14
14
|
export const triggerClassName = (size, variant, className) => clsx('flex shrink-0 items-center whitespace-nowrap text-xs', TRIGGER_SIZE[size], TRIGGER_VARIANT[variant], TRIGGER_DISABLED, className);
|
|
15
15
|
/* A description makes the row two lines high; the box keeps the icon on the label's line. */
|
|
16
|
-
export const rowClassName =
|
|
16
|
+
export const rowClassName = item => clsx('menu-item', item.description && 'items-start');
|
package/dist/selection.js
CHANGED
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
* menu belongs to the surface the click landed on, so both of these are scoped to an element.
|
|
4
4
|
* A selection somewhere else is no selection this menu can copy.
|
|
5
5
|
*/
|
|
6
|
-
export const selectionWithin =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
export const selectAllWithin = (element) => {
|
|
14
|
-
const selection = window.getSelection();
|
|
15
|
-
if (!element || !selection) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const range = document.createRange();
|
|
19
|
-
range.selectNodeContents(element);
|
|
20
|
-
selection.removeAllRanges();
|
|
21
|
-
selection.addRange(range);
|
|
6
|
+
export const selectionWithin = element => {
|
|
7
|
+
const selection = window.getSelection();
|
|
8
|
+
if (!element || !selection || selection.isCollapsed || selection.rangeCount === 0) {
|
|
9
|
+
return '';
|
|
10
|
+
}
|
|
11
|
+
return element.contains(selection.getRangeAt(0).commonAncestorContainer) ? selection.toString() : '';
|
|
22
12
|
};
|
|
13
|
+
export const selectAllWithin = element => {
|
|
14
|
+
const selection = window.getSelection();
|
|
15
|
+
if (!element || !selection) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const range = document.createRange();
|
|
19
|
+
range.selectNodeContents(element);
|
|
20
|
+
selection.removeAllRanges();
|
|
21
|
+
selection.addRange(range);
|
|
22
|
+
};
|