@adecore/ui 0.31.12 → 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/ColorWheelPicker.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useEffect, useId, useRef, useState } from 'react';
|
|
3
3
|
import { ChevronDown } from 'lucide-react';
|
|
4
|
-
import { ColorSwatch } from
|
|
5
|
-
import { Icon } from
|
|
6
|
-
import { PopoverPopup, PopoverRoot, PopoverTrigger } from
|
|
4
|
+
import { ColorSwatch } from "./ColorSwatch.js";
|
|
5
|
+
import { Icon } from "./Icon.js";
|
|
6
|
+
import { PopoverPopup, PopoverRoot, PopoverTrigger } from "./popover/parts.js";
|
|
7
7
|
import { triggerClassName } from './select-shared.js';
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
9
|
const SWATCH_SIZE = 24;
|
|
9
10
|
/* The outer ring stands this far from the middle, further when its swatches would not keep a gap between them otherwise. */
|
|
10
11
|
const MIN_RADIUS = 97;
|
|
@@ -13,24 +14,31 @@ const MIN_GAP = 8;
|
|
|
13
14
|
const EDGE = 7;
|
|
14
15
|
/* Every swatch's top left corner in whole pixels, the rings evenly apart from the outer one to the middle, and the size of the wheel. */
|
|
15
16
|
function layout(rings, center) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
const outer = rings[0]?.length ?? 0;
|
|
18
|
+
const radius = Math.max(MIN_RADIUS, outer > 1 ? Math.ceil((SWATCH_SIZE + MIN_GAP) / (2 * Math.sin(Math.PI / outer))) : 0);
|
|
19
|
+
const size = 2 * (radius + SWATCH_SIZE / 2 + EDGE);
|
|
20
|
+
const middle = (size - SWATCH_SIZE) / 2;
|
|
21
|
+
const spot = (id, turn, distance) => {
|
|
22
|
+
const angle = turn * 2 * Math.PI - Math.PI / 2;
|
|
23
|
+
return {
|
|
24
|
+
id,
|
|
25
|
+
left: Math.round(middle + distance * Math.cos(angle)),
|
|
26
|
+
top: Math.round(middle + distance * Math.sin(angle))
|
|
23
27
|
};
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
};
|
|
29
|
+
const spots = rings.flatMap((ring, depth) => ring.map((id, i) => spot(id, i / ring.length, radius * (rings.length - depth) / rings.length)));
|
|
30
|
+
return {
|
|
31
|
+
size,
|
|
32
|
+
spots: center === undefined ? spots : [...spots, spot(center, 0, 0)]
|
|
33
|
+
};
|
|
26
34
|
}
|
|
27
35
|
const STEPS = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
ArrowRight: (index, count) => (index + 1) % count,
|
|
37
|
+
ArrowDown: (index, count) => (index + 1) % count,
|
|
38
|
+
ArrowLeft: (index, count) => (index - 1 + count) % count,
|
|
39
|
+
ArrowUp: (index, count) => (index - 1 + count) % count,
|
|
40
|
+
Home: () => 0,
|
|
41
|
+
End: (_, count) => count - 1
|
|
34
42
|
};
|
|
35
43
|
/*
|
|
36
44
|
* A color picked from a wheel behind a trigger that holds the one in use and lines up with a select.
|
|
@@ -39,59 +47,285 @@ const STEPS = {
|
|
|
39
47
|
* tooltip. The wheel is one tab stop: the arrows walk it in its order and only Enter, Space or a click
|
|
40
48
|
* picks. Every preview ends with null, after a pick as well as on closing without one or on going away while open.
|
|
41
49
|
*/
|
|
42
|
-
export function ColorWheelPicker(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
export function ColorWheelPicker(t0) {
|
|
51
|
+
const $ = _c(37);
|
|
52
|
+
const {
|
|
53
|
+
value,
|
|
54
|
+
onValueChange,
|
|
55
|
+
onPreviewChange,
|
|
56
|
+
label,
|
|
57
|
+
rings,
|
|
58
|
+
center,
|
|
59
|
+
colorOf,
|
|
60
|
+
labelOf,
|
|
61
|
+
disabled,
|
|
62
|
+
align: t1,
|
|
63
|
+
className,
|
|
64
|
+
ref
|
|
65
|
+
} = t0;
|
|
66
|
+
const align = t1 === undefined ? "start" : t1;
|
|
67
|
+
const labelId = useId();
|
|
68
|
+
const valueId = useId();
|
|
69
|
+
const [open, setOpen] = useState(false);
|
|
70
|
+
const [looking, setLooking] = useState(null);
|
|
71
|
+
const [focused, setFocused] = useState(null);
|
|
72
|
+
const wheel = useRef(null);
|
|
73
|
+
const {
|
|
74
|
+
size,
|
|
75
|
+
spots
|
|
76
|
+
} = layout(rings, center);
|
|
77
|
+
const tabStop = spots.find(spot => spot.id === (focused ?? value))?.id ?? spots[0]?.id;
|
|
78
|
+
let t2;
|
|
79
|
+
if ($[0] !== onPreviewChange) {
|
|
80
|
+
t2 = {
|
|
81
|
+
looking: false,
|
|
82
|
+
onPreviewChange
|
|
60
83
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
look(null);
|
|
84
|
+
$[0] = onPreviewChange;
|
|
85
|
+
$[1] = t2;
|
|
86
|
+
} else {
|
|
87
|
+
t2 = $[1];
|
|
88
|
+
}
|
|
89
|
+
const preview = useRef(t2);
|
|
90
|
+
let t3;
|
|
91
|
+
if ($[2] !== onPreviewChange) {
|
|
92
|
+
t3 = () => {
|
|
93
|
+
preview.current.onPreviewChange = onPreviewChange;
|
|
72
94
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
95
|
+
$[2] = onPreviewChange;
|
|
96
|
+
$[3] = t3;
|
|
97
|
+
} else {
|
|
98
|
+
t3 = $[3];
|
|
99
|
+
}
|
|
100
|
+
useEffect(t3);
|
|
101
|
+
const look = id => {
|
|
102
|
+
setLooking(id);
|
|
103
|
+
preview.current.looking = id !== null;
|
|
104
|
+
onPreviewChange?.(id);
|
|
105
|
+
};
|
|
106
|
+
let t4;
|
|
107
|
+
let t5;
|
|
108
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
109
|
+
t4 = () => () => {
|
|
110
|
+
if (preview.current.looking) {
|
|
111
|
+
preview.current.onPreviewChange?.(null);
|
|
112
|
+
}
|
|
82
113
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
114
|
+
t5 = [];
|
|
115
|
+
$[4] = t4;
|
|
116
|
+
$[5] = t5;
|
|
117
|
+
} else {
|
|
118
|
+
t4 = $[4];
|
|
119
|
+
t5 = $[5];
|
|
120
|
+
}
|
|
121
|
+
useEffect(t4, t5);
|
|
122
|
+
const close = () => {
|
|
123
|
+
setOpen(false);
|
|
124
|
+
setFocused(null);
|
|
125
|
+
look(null);
|
|
126
|
+
};
|
|
127
|
+
let t6;
|
|
128
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
129
|
+
t6 = event => {
|
|
130
|
+
const next = STEPS[event.key];
|
|
131
|
+
const swatches = [...(wheel.current?.querySelectorAll("[role=\"radio\"]") ?? [])];
|
|
132
|
+
const index = swatches.indexOf(event.target);
|
|
133
|
+
if (next === undefined || index < 0) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
swatches[next(index, swatches.length)]?.focus();
|
|
138
|
+
};
|
|
139
|
+
$[6] = t6;
|
|
140
|
+
} else {
|
|
141
|
+
t6 = $[6];
|
|
142
|
+
}
|
|
143
|
+
const step = t6;
|
|
144
|
+
let t7;
|
|
145
|
+
if ($[7] !== label || $[8] !== labelId) {
|
|
146
|
+
t7 = /*#__PURE__*/_jsx("span", {
|
|
147
|
+
id: labelId,
|
|
148
|
+
hidden: true,
|
|
149
|
+
children: label
|
|
150
|
+
});
|
|
151
|
+
$[7] = label;
|
|
152
|
+
$[8] = labelId;
|
|
153
|
+
$[9] = t7;
|
|
154
|
+
} else {
|
|
155
|
+
t7 = $[9];
|
|
156
|
+
}
|
|
157
|
+
const t8 = `${labelId} ${valueId}`;
|
|
158
|
+
let t9;
|
|
159
|
+
if ($[10] !== className) {
|
|
160
|
+
t9 = triggerClassName("md", "outlined", className);
|
|
161
|
+
$[10] = className;
|
|
162
|
+
$[11] = t9;
|
|
163
|
+
} else {
|
|
164
|
+
t9 = $[11];
|
|
165
|
+
}
|
|
166
|
+
let t10;
|
|
167
|
+
if ($[12] !== colorOf || $[13] !== value) {
|
|
168
|
+
t10 = colorOf(value);
|
|
169
|
+
$[12] = colorOf;
|
|
170
|
+
$[13] = value;
|
|
171
|
+
$[14] = t10;
|
|
172
|
+
} else {
|
|
173
|
+
t10 = $[14];
|
|
174
|
+
}
|
|
175
|
+
let t11;
|
|
176
|
+
if ($[15] !== t10) {
|
|
177
|
+
t11 = /*#__PURE__*/_jsx("span", {
|
|
178
|
+
className: "h-3.5 w-3.5 shrink-0 rounded-full",
|
|
179
|
+
style: {
|
|
180
|
+
background: t10
|
|
181
|
+
},
|
|
182
|
+
"aria-hidden": true
|
|
183
|
+
});
|
|
184
|
+
$[15] = t10;
|
|
185
|
+
$[16] = t11;
|
|
186
|
+
} else {
|
|
187
|
+
t11 = $[16];
|
|
188
|
+
}
|
|
189
|
+
let t12;
|
|
190
|
+
if ($[17] !== labelOf || $[18] !== value) {
|
|
191
|
+
t12 = labelOf(value);
|
|
192
|
+
$[17] = labelOf;
|
|
193
|
+
$[18] = value;
|
|
194
|
+
$[19] = t12;
|
|
195
|
+
} else {
|
|
196
|
+
t12 = $[19];
|
|
197
|
+
}
|
|
198
|
+
let t13;
|
|
199
|
+
if ($[20] !== t12 || $[21] !== valueId) {
|
|
200
|
+
t13 = /*#__PURE__*/_jsx("span", {
|
|
201
|
+
id: valueId,
|
|
202
|
+
className: "truncate",
|
|
203
|
+
children: t12
|
|
204
|
+
});
|
|
205
|
+
$[20] = t12;
|
|
206
|
+
$[21] = valueId;
|
|
207
|
+
$[22] = t13;
|
|
208
|
+
} else {
|
|
209
|
+
t13 = $[22];
|
|
210
|
+
}
|
|
211
|
+
let t14;
|
|
212
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
213
|
+
t14 = /*#__PURE__*/_jsx("span", {
|
|
214
|
+
className: "ml-auto flex shrink-0 pl-1",
|
|
215
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
216
|
+
icon: ChevronDown,
|
|
217
|
+
size: 14
|
|
218
|
+
})
|
|
219
|
+
});
|
|
220
|
+
$[23] = t14;
|
|
221
|
+
} else {
|
|
222
|
+
t14 = $[23];
|
|
223
|
+
}
|
|
224
|
+
let t15;
|
|
225
|
+
if ($[24] !== disabled || $[25] !== ref || $[26] !== t11 || $[27] !== t13 || $[28] !== t8 || $[29] !== t9) {
|
|
226
|
+
t15 = /*#__PURE__*/_jsxs(PopoverTrigger, {
|
|
227
|
+
ref: ref,
|
|
228
|
+
disabled: disabled,
|
|
229
|
+
"aria-labelledby": t8,
|
|
230
|
+
className: t9,
|
|
231
|
+
children: [t11, t13, t14]
|
|
232
|
+
});
|
|
233
|
+
$[24] = disabled;
|
|
234
|
+
$[25] = ref;
|
|
235
|
+
$[26] = t11;
|
|
236
|
+
$[27] = t13;
|
|
237
|
+
$[28] = t8;
|
|
238
|
+
$[29] = t9;
|
|
239
|
+
$[30] = t15;
|
|
240
|
+
} else {
|
|
241
|
+
t15 = $[30];
|
|
242
|
+
}
|
|
243
|
+
let t16;
|
|
244
|
+
if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
|
|
245
|
+
t16 = () => wheel.current?.querySelector("[aria-checked=\"true\"]") ?? false;
|
|
246
|
+
$[31] = t16;
|
|
247
|
+
} else {
|
|
248
|
+
t16 = $[31];
|
|
249
|
+
}
|
|
250
|
+
const t18 = looking ?? value;
|
|
251
|
+
let t19;
|
|
252
|
+
if ($[32] !== labelOf || $[33] !== t18) {
|
|
253
|
+
t19 = labelOf(t18);
|
|
254
|
+
$[32] = labelOf;
|
|
255
|
+
$[33] = t18;
|
|
256
|
+
$[34] = t19;
|
|
257
|
+
} else {
|
|
258
|
+
t19 = $[34];
|
|
259
|
+
}
|
|
260
|
+
let t20;
|
|
261
|
+
if ($[35] !== t19) {
|
|
262
|
+
t20 = /*#__PURE__*/_jsx("span", {
|
|
263
|
+
className: "text-xs text-text-muted",
|
|
264
|
+
children: t19
|
|
265
|
+
});
|
|
266
|
+
$[35] = t19;
|
|
267
|
+
$[36] = t20;
|
|
268
|
+
} else {
|
|
269
|
+
t20 = $[36];
|
|
270
|
+
}
|
|
271
|
+
return /*#__PURE__*/_jsxs(PopoverRoot, {
|
|
272
|
+
open: open,
|
|
273
|
+
onOpenChange: next_0 => {
|
|
274
|
+
if (next_0) {
|
|
275
|
+
setOpen(true);
|
|
276
|
+
} else {
|
|
277
|
+
close();
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
children: [t7, t15, /*#__PURE__*/_jsx(PopoverPopup, {
|
|
281
|
+
align: align,
|
|
282
|
+
initialFocus: t16,
|
|
283
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
284
|
+
className: "flex flex-col items-center gap-3 p-3",
|
|
285
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
286
|
+
ref: wheel,
|
|
287
|
+
role: "radiogroup",
|
|
288
|
+
"aria-label": label,
|
|
289
|
+
className: "relative",
|
|
290
|
+
style: {
|
|
291
|
+
width: size,
|
|
292
|
+
height: size
|
|
293
|
+
},
|
|
294
|
+
onPointerLeave: () => look(null),
|
|
295
|
+
onKeyDown: step,
|
|
296
|
+
children: spots.map(t17 => {
|
|
297
|
+
const {
|
|
298
|
+
id: id_0,
|
|
299
|
+
left,
|
|
300
|
+
top
|
|
301
|
+
} = t17;
|
|
302
|
+
return /*#__PURE__*/_jsx(ColorSwatch, {
|
|
303
|
+
role: "radio",
|
|
304
|
+
"aria-checked": value === id_0,
|
|
305
|
+
"aria-label": labelOf(id_0),
|
|
306
|
+
tabIndex: id_0 === tabStop ? 0 : -1,
|
|
307
|
+
color: colorOf(id_0),
|
|
308
|
+
picked: value === id_0,
|
|
309
|
+
tick: false,
|
|
310
|
+
on: "popup",
|
|
311
|
+
className: "absolute",
|
|
312
|
+
style: {
|
|
313
|
+
left,
|
|
314
|
+
top
|
|
315
|
+
},
|
|
316
|
+
onPointerEnter: () => look(id_0),
|
|
317
|
+
onFocus: () => {
|
|
318
|
+
setFocused(id_0);
|
|
319
|
+
look(id_0);
|
|
320
|
+
},
|
|
321
|
+
onClick: () => {
|
|
322
|
+
onValueChange(id_0);
|
|
88
323
|
close();
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
324
|
+
}
|
|
325
|
+
}, id_0);
|
|
326
|
+
})
|
|
327
|
+
}), t20]
|
|
328
|
+
})
|
|
329
|
+
})]
|
|
330
|
+
});
|
|
331
|
+
}
|
|
@@ -1,12 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
4
|
const PLACEMENT = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
left: 'inset-y-0 right-0 w-2 cursor-col-resize',
|
|
6
|
+
right: 'inset-y-0 left-0 w-2 cursor-col-resize',
|
|
7
|
+
top: 'inset-x-0 bottom-0 h-2 cursor-row-resize',
|
|
8
|
+
bottom: 'inset-x-0 top-0 h-2 cursor-row-resize'
|
|
8
9
|
};
|
|
9
10
|
/* An invisible strip over the free edge of a column, so the column needs `relative` and draws its own border. */
|
|
10
|
-
export function ColumnResizeHandle(
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
export function ColumnResizeHandle(t0) {
|
|
12
|
+
const $ = _c(8);
|
|
13
|
+
const {
|
|
14
|
+
from,
|
|
15
|
+
onPointerDown,
|
|
16
|
+
className,
|
|
17
|
+
style,
|
|
18
|
+
ref
|
|
19
|
+
} = t0;
|
|
20
|
+
const t1 = PLACEMENT[from];
|
|
21
|
+
let t2;
|
|
22
|
+
if ($[0] !== className || $[1] !== t1) {
|
|
23
|
+
t2 = clsx("absolute z-10", t1, className);
|
|
24
|
+
$[0] = className;
|
|
25
|
+
$[1] = t1;
|
|
26
|
+
$[2] = t2;
|
|
27
|
+
} else {
|
|
28
|
+
t2 = $[2];
|
|
29
|
+
}
|
|
30
|
+
let t3;
|
|
31
|
+
if ($[3] !== onPointerDown || $[4] !== ref || $[5] !== style || $[6] !== t2) {
|
|
32
|
+
t3 = /*#__PURE__*/_jsx("div", {
|
|
33
|
+
ref: ref,
|
|
34
|
+
className: t2,
|
|
35
|
+
style: style,
|
|
36
|
+
onPointerDown: onPointerDown
|
|
37
|
+
});
|
|
38
|
+
$[3] = onPointerDown;
|
|
39
|
+
$[4] = ref;
|
|
40
|
+
$[5] = style;
|
|
41
|
+
$[6] = t2;
|
|
42
|
+
$[7] = t3;
|
|
43
|
+
} else {
|
|
44
|
+
t3 = $[7];
|
|
45
|
+
}
|
|
46
|
+
return t3;
|
|
47
|
+
}
|
package/dist/DisabledReason.js
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Tooltip } from
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Tooltip } from "./Tooltip.js";
|
|
3
3
|
/*
|
|
4
4
|
* Why a row cannot be picked, in a tooltip beside it rather than in the row itself: a sentence in a menu
|
|
5
5
|
* row sets the width of the whole menu. A row with nothing in its way is handed through untouched.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export function DisabledReason(t0) {
|
|
9
|
+
const $ = _c(3);
|
|
10
|
+
const {
|
|
11
|
+
reason,
|
|
12
|
+
children
|
|
13
|
+
} = t0;
|
|
14
|
+
if (reason === null) {
|
|
15
|
+
return children;
|
|
16
|
+
}
|
|
17
|
+
let t1;
|
|
18
|
+
if ($[0] !== children || $[1] !== reason) {
|
|
19
|
+
t1 = /*#__PURE__*/_jsx(Tooltip, {
|
|
20
|
+
label: reason,
|
|
21
|
+
side: "right",
|
|
22
|
+
children: children
|
|
23
|
+
});
|
|
24
|
+
$[0] = children;
|
|
25
|
+
$[1] = reason;
|
|
26
|
+
$[2] = t1;
|
|
27
|
+
} else {
|
|
28
|
+
t1 = $[2];
|
|
29
|
+
}
|
|
30
|
+
return t1;
|
|
31
|
+
}
|