@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
package/dist/IconButton.js
CHANGED
|
@@ -1,25 +1,181 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { useRender } from '@base-ui/react/use-render';
|
|
4
|
-
import { Icon } from
|
|
5
|
-
import { Spinner } from
|
|
6
|
-
import { Tooltip } from
|
|
4
|
+
import { Icon } from "./Icon.js";
|
|
5
|
+
import { Spinner } from "./Spinner.js";
|
|
6
|
+
import { Tooltip } from "./Tooltip.js";
|
|
7
7
|
import { ICON_BUTTON_CLASS, ICON_BUTTON_ICON_SIZE } from './icon-button-size.js';
|
|
8
8
|
/* Every button that is an icon and no word. A square, and the one place the icon inside it is sized. */
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export function IconButton(t0) {
|
|
11
|
+
const $ = _c(43);
|
|
12
|
+
let children;
|
|
13
|
+
let className;
|
|
14
|
+
let icon;
|
|
15
|
+
let iconClassName;
|
|
16
|
+
let kbd;
|
|
17
|
+
let label;
|
|
18
|
+
let props;
|
|
19
|
+
let ref;
|
|
20
|
+
let render;
|
|
21
|
+
let t1;
|
|
22
|
+
let t2;
|
|
23
|
+
let t3;
|
|
24
|
+
let tooltip;
|
|
25
|
+
let tooltipSide;
|
|
26
|
+
if ($[0] !== t0) {
|
|
27
|
+
({
|
|
28
|
+
icon,
|
|
29
|
+
label,
|
|
30
|
+
tooltip,
|
|
31
|
+
kbd,
|
|
32
|
+
tooltipSide,
|
|
33
|
+
size: t1,
|
|
34
|
+
active: t2,
|
|
35
|
+
busy: t3,
|
|
36
|
+
iconClassName,
|
|
37
|
+
render,
|
|
38
|
+
className,
|
|
39
|
+
ref,
|
|
40
|
+
children,
|
|
41
|
+
...props
|
|
42
|
+
} = t0);
|
|
43
|
+
$[0] = t0;
|
|
44
|
+
$[1] = children;
|
|
45
|
+
$[2] = className;
|
|
46
|
+
$[3] = icon;
|
|
47
|
+
$[4] = iconClassName;
|
|
48
|
+
$[5] = kbd;
|
|
49
|
+
$[6] = label;
|
|
50
|
+
$[7] = props;
|
|
51
|
+
$[8] = ref;
|
|
52
|
+
$[9] = render;
|
|
53
|
+
$[10] = t1;
|
|
54
|
+
$[11] = t2;
|
|
55
|
+
$[12] = t3;
|
|
56
|
+
$[13] = tooltip;
|
|
57
|
+
$[14] = tooltipSide;
|
|
58
|
+
} else {
|
|
59
|
+
children = $[1];
|
|
60
|
+
className = $[2];
|
|
61
|
+
icon = $[3];
|
|
62
|
+
iconClassName = $[4];
|
|
63
|
+
kbd = $[5];
|
|
64
|
+
label = $[6];
|
|
65
|
+
props = $[7];
|
|
66
|
+
ref = $[8];
|
|
67
|
+
render = $[9];
|
|
68
|
+
t1 = $[10];
|
|
69
|
+
t2 = $[11];
|
|
70
|
+
t3 = $[12];
|
|
71
|
+
tooltip = $[13];
|
|
72
|
+
tooltipSide = $[14];
|
|
73
|
+
}
|
|
74
|
+
const size = t1 === undefined ? "md" : t1;
|
|
75
|
+
const active = t2 === undefined ? false : t2;
|
|
76
|
+
const busy = t3 === undefined ? false : t3;
|
|
77
|
+
let t4;
|
|
78
|
+
if ($[15] !== render) {
|
|
79
|
+
t4 = render ?? /*#__PURE__*/_jsx("button", {
|
|
80
|
+
type: "button"
|
|
20
81
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
82
|
+
$[15] = render;
|
|
83
|
+
$[16] = t4;
|
|
84
|
+
} else {
|
|
85
|
+
t4 = $[16];
|
|
86
|
+
}
|
|
87
|
+
const t5 = active ? "true" : undefined;
|
|
88
|
+
const t6 = ICON_BUTTON_CLASS[size];
|
|
89
|
+
let t7;
|
|
90
|
+
if ($[17] !== className || $[18] !== t6) {
|
|
91
|
+
t7 = clsx("icon-btn", t6, className);
|
|
92
|
+
$[17] = className;
|
|
93
|
+
$[18] = t6;
|
|
94
|
+
$[19] = t7;
|
|
95
|
+
} else {
|
|
96
|
+
t7 = $[19];
|
|
97
|
+
}
|
|
98
|
+
let t8;
|
|
99
|
+
if ($[20] !== busy || $[21] !== icon || $[22] !== iconClassName || $[23] !== size) {
|
|
100
|
+
t8 = busy ? /*#__PURE__*/_jsx(Spinner, {
|
|
101
|
+
size: ICON_BUTTON_ICON_SIZE[size],
|
|
102
|
+
className: iconClassName
|
|
103
|
+
}) : icon !== undefined && /*#__PURE__*/_jsx(Icon, {
|
|
104
|
+
icon: icon,
|
|
105
|
+
size: ICON_BUTTON_ICON_SIZE[size],
|
|
106
|
+
className: iconClassName
|
|
107
|
+
});
|
|
108
|
+
$[20] = busy;
|
|
109
|
+
$[21] = icon;
|
|
110
|
+
$[22] = iconClassName;
|
|
111
|
+
$[23] = size;
|
|
112
|
+
$[24] = t8;
|
|
113
|
+
} else {
|
|
114
|
+
t8 = $[24];
|
|
115
|
+
}
|
|
116
|
+
let t9;
|
|
117
|
+
if ($[25] !== children || $[26] !== t8) {
|
|
118
|
+
t9 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
119
|
+
children: [t8, children]
|
|
120
|
+
});
|
|
121
|
+
$[25] = children;
|
|
122
|
+
$[26] = t8;
|
|
123
|
+
$[27] = t9;
|
|
124
|
+
} else {
|
|
125
|
+
t9 = $[27];
|
|
126
|
+
}
|
|
127
|
+
let t10;
|
|
128
|
+
if ($[28] !== label || $[29] !== props || $[30] !== t5 || $[31] !== t7 || $[32] !== t9) {
|
|
129
|
+
t10 = {
|
|
130
|
+
"aria-label": label,
|
|
131
|
+
"data-active": t5,
|
|
132
|
+
...props,
|
|
133
|
+
className: t7,
|
|
134
|
+
children: t9
|
|
135
|
+
};
|
|
136
|
+
$[28] = label;
|
|
137
|
+
$[29] = props;
|
|
138
|
+
$[30] = t5;
|
|
139
|
+
$[31] = t7;
|
|
140
|
+
$[32] = t9;
|
|
141
|
+
$[33] = t10;
|
|
142
|
+
} else {
|
|
143
|
+
t10 = $[33];
|
|
144
|
+
}
|
|
145
|
+
let t11;
|
|
146
|
+
if ($[34] !== ref || $[35] !== t10 || $[36] !== t4) {
|
|
147
|
+
t11 = {
|
|
148
|
+
render: t4,
|
|
149
|
+
ref,
|
|
150
|
+
props: t10
|
|
151
|
+
};
|
|
152
|
+
$[34] = ref;
|
|
153
|
+
$[35] = t10;
|
|
154
|
+
$[36] = t4;
|
|
155
|
+
$[37] = t11;
|
|
156
|
+
} else {
|
|
157
|
+
t11 = $[37];
|
|
158
|
+
}
|
|
159
|
+
const button = useRender(t11);
|
|
160
|
+
if (tooltip === false) {
|
|
161
|
+
return button;
|
|
162
|
+
}
|
|
163
|
+
const t12 = tooltip ?? label;
|
|
164
|
+
let t13;
|
|
165
|
+
if ($[38] !== button || $[39] !== kbd || $[40] !== t12 || $[41] !== tooltipSide) {
|
|
166
|
+
t13 = /*#__PURE__*/_jsx(Tooltip, {
|
|
167
|
+
label: t12,
|
|
168
|
+
kbd: kbd,
|
|
169
|
+
side: tooltipSide,
|
|
170
|
+
children: button
|
|
171
|
+
});
|
|
172
|
+
$[38] = button;
|
|
173
|
+
$[39] = kbd;
|
|
174
|
+
$[40] = t12;
|
|
175
|
+
$[41] = tooltipSide;
|
|
176
|
+
$[42] = t13;
|
|
177
|
+
} else {
|
|
178
|
+
t13 = $[42];
|
|
179
|
+
}
|
|
180
|
+
return t13;
|
|
181
|
+
}
|
package/dist/IconPicker.js
CHANGED
|
@@ -1,93 +1,364 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useId, useLayoutEffect,
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useId, useLayoutEffect, useRef, useState } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { Ban, Search, X } from 'lucide-react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { EmptyState } from
|
|
6
|
+
import { EmptyState } from "./EmptyState.js";
|
|
7
7
|
import { formatNumber } from './format/number.js';
|
|
8
|
-
import { Icon } from
|
|
9
|
-
import { IconButton } from
|
|
8
|
+
import { Icon } from "./Icon.js";
|
|
9
|
+
import { IconButton } from "./IconButton.js";
|
|
10
10
|
import { cellForKey, escapeClearsSearch, filterSections, isGrouped, sectionsOf, tabStopOf } from './icon-picker.js';
|
|
11
|
-
import { SectionLabel } from
|
|
12
|
-
import { Tooltip } from
|
|
11
|
+
import { SectionLabel } from "./SectionLabel.js";
|
|
12
|
+
import { Tooltip } from "./Tooltip.js";
|
|
13
13
|
/* A row of cells is 28 high with a gap of 4. Under a heading of 28 the last row keeps 8 below it; without headings the grid has 6 above as well. */
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
15
|
const ROW_HEIGHT = 32;
|
|
15
16
|
const HEADED_EXTRA = 32;
|
|
16
17
|
const BARE_EXTRA = 10;
|
|
17
18
|
/* A heading is stuck while its group runs past the top of the scroll area, and only then draws a line under it. */
|
|
18
|
-
const markStuckHeadings =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
const markStuckHeadings = area => {
|
|
20
|
+
const top = area.scrollTop;
|
|
21
|
+
for (const heading of area.querySelectorAll('[data-icon-heading]')) {
|
|
22
|
+
const group = heading.parentElement;
|
|
23
|
+
const stuck = group !== null && top > 0 && group.offsetTop <= top && group.offsetTop + group.offsetHeight > top;
|
|
24
|
+
heading.toggleAttribute('data-stuck', stuck);
|
|
25
|
+
}
|
|
25
26
|
};
|
|
26
27
|
/*
|
|
27
28
|
* The mark a thing wears, one of a set of Lucide icons, as a grid under a label. With a search or a
|
|
28
29
|
* height in rows, the search and the grid share one frame. The grid is one tab stop: arrows move the
|
|
29
30
|
* focus and only Enter, Space or a click chooses, since a caller may save every choice at once.
|
|
30
31
|
*/
|
|
31
|
-
export function IconPicker(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
32
|
+
export function IconPicker(t0) {
|
|
33
|
+
const $ = _c(48);
|
|
34
|
+
const {
|
|
35
|
+
icons,
|
|
36
|
+
value,
|
|
37
|
+
onValueChange,
|
|
38
|
+
keywords,
|
|
39
|
+
searchable: t1,
|
|
40
|
+
rows,
|
|
41
|
+
disabled: t2,
|
|
42
|
+
onClear,
|
|
43
|
+
label,
|
|
44
|
+
className,
|
|
45
|
+
ref
|
|
46
|
+
} = t0;
|
|
47
|
+
let t3;
|
|
48
|
+
if ($[0] !== icons || $[1] !== t1) {
|
|
49
|
+
t3 = t1 === undefined ? isGrouped(icons) : t1;
|
|
50
|
+
$[0] = icons;
|
|
51
|
+
$[1] = t1;
|
|
52
|
+
$[2] = t3;
|
|
53
|
+
} else {
|
|
54
|
+
t3 = $[2];
|
|
55
|
+
}
|
|
56
|
+
const searchable = t3;
|
|
57
|
+
const disabled = t2 === undefined ? false : t2;
|
|
58
|
+
const {
|
|
59
|
+
t
|
|
60
|
+
} = useTranslation("ui");
|
|
61
|
+
const id = useId();
|
|
62
|
+
const area = useRef(null);
|
|
63
|
+
const input = useRef(null);
|
|
64
|
+
const [query, setQuery] = useState("");
|
|
65
|
+
const [focused, setFocused] = useState(null);
|
|
66
|
+
let t4;
|
|
67
|
+
if ($[3] !== icons) {
|
|
68
|
+
t4 = isGrouped(icons);
|
|
69
|
+
$[3] = icons;
|
|
70
|
+
$[4] = t4;
|
|
71
|
+
} else {
|
|
72
|
+
t4 = $[4];
|
|
73
|
+
}
|
|
74
|
+
const headed = t4;
|
|
75
|
+
const framed = searchable || rows !== undefined;
|
|
76
|
+
const sections = sectionsOf(icons);
|
|
77
|
+
const shown = filterSections(sections, query, keywords);
|
|
78
|
+
const tabStop = tabStopOf(shown.flatMap(_temp2), focused, value);
|
|
79
|
+
let t5;
|
|
80
|
+
if ($[5] !== label || $[6] !== t) {
|
|
81
|
+
t5 = label ?? t("iconPicker.label");
|
|
82
|
+
$[5] = label;
|
|
83
|
+
$[6] = t;
|
|
84
|
+
$[7] = t5;
|
|
85
|
+
} else {
|
|
86
|
+
t5 = $[7];
|
|
87
|
+
}
|
|
88
|
+
const name_0 = t5;
|
|
89
|
+
let t6;
|
|
90
|
+
let t7;
|
|
91
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
92
|
+
t6 = () => {
|
|
93
|
+
const element = area.current;
|
|
94
|
+
const chosen = element?.querySelector("[aria-checked=\"true\"]");
|
|
95
|
+
if (!element || !chosen || element.scrollHeight <= element.clientHeight) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const heading = element.querySelector("[data-icon-heading]")?.offsetHeight ?? 0;
|
|
99
|
+
element.scrollTop = Math.round(chosen.offsetTop - heading - (element.clientHeight - heading - chosen.offsetHeight) / 2);
|
|
100
|
+
};
|
|
101
|
+
t7 = [];
|
|
102
|
+
$[8] = t6;
|
|
103
|
+
$[9] = t7;
|
|
104
|
+
} else {
|
|
105
|
+
t6 = $[8];
|
|
106
|
+
t7 = $[9];
|
|
107
|
+
}
|
|
108
|
+
useLayoutEffect(t6, t7);
|
|
109
|
+
let t8;
|
|
110
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
111
|
+
t8 = next => {
|
|
112
|
+
setQuery(next);
|
|
113
|
+
if (area.current) {
|
|
114
|
+
area.current.scrollTop = 0;
|
|
115
|
+
}
|
|
59
116
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
117
|
+
$[10] = t8;
|
|
118
|
+
} else {
|
|
119
|
+
t8 = $[10];
|
|
120
|
+
}
|
|
121
|
+
const search = t8;
|
|
122
|
+
const moveFocus = _temp4;
|
|
123
|
+
const t9 = `${id}-grid`;
|
|
124
|
+
const t10 = "radiogroup";
|
|
125
|
+
const t11 = framed && "relative overflow-y-auto overscroll-contain";
|
|
126
|
+
const t12 = framed && (headed ? "scroll-pt-7" : "px-1.5 pt-1.5 pb-2");
|
|
127
|
+
let t13;
|
|
128
|
+
if ($[11] !== t11 || $[12] !== t12) {
|
|
129
|
+
t13 = clsx(t11, t12);
|
|
130
|
+
$[11] = t11;
|
|
131
|
+
$[12] = t12;
|
|
132
|
+
$[13] = t13;
|
|
133
|
+
} else {
|
|
134
|
+
t13 = $[13];
|
|
135
|
+
}
|
|
136
|
+
let t14;
|
|
137
|
+
if ($[14] !== headed || $[15] !== rows) {
|
|
138
|
+
t14 = rows === undefined ? undefined : {
|
|
139
|
+
height: rows * ROW_HEIGHT + (headed ? HEADED_EXTRA : BARE_EXTRA)
|
|
75
140
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
141
|
+
$[14] = headed;
|
|
142
|
+
$[15] = rows;
|
|
143
|
+
$[16] = t14;
|
|
144
|
+
} else {
|
|
145
|
+
t14 = $[16];
|
|
146
|
+
}
|
|
147
|
+
const t15 = _temp5;
|
|
148
|
+
const t16 = shown.length === 0 && query.trim() !== "" ? /*#__PURE__*/_jsx(EmptyState, {
|
|
149
|
+
className: "h-full",
|
|
150
|
+
children: t("iconPicker.noMatch", {
|
|
151
|
+
query: query.trim()
|
|
152
|
+
})
|
|
153
|
+
}) : shown.map((section_0, index) => {
|
|
154
|
+
const cells_0 = /*#__PURE__*/_jsx("div", {
|
|
155
|
+
className: clsx("grid grid-cols-[repeat(auto-fill,minmax(28px,1fr))] gap-1", framed && section_0.label !== null && "px-1.5 pb-2"),
|
|
156
|
+
children: section_0.icons.map(t17 => {
|
|
157
|
+
const [icon, glyph] = t17;
|
|
158
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
159
|
+
label: icon,
|
|
160
|
+
name: true,
|
|
161
|
+
children: /*#__PURE__*/_jsx("button", {
|
|
162
|
+
type: "button",
|
|
163
|
+
role: "radio",
|
|
164
|
+
"aria-checked": value === icon,
|
|
165
|
+
tabIndex: icon === tabStop ? 0 : -1,
|
|
166
|
+
disabled: disabled,
|
|
167
|
+
className: clsx("flex h-7 items-center justify-center rounded-md hover:bg-surface-hover disabled:opacity-50", value === icon ? "bg-surface-active text-text" : "text-text-muted"),
|
|
168
|
+
onFocus: () => setFocused(icon),
|
|
169
|
+
onClick: () => onValueChange(icon),
|
|
170
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
171
|
+
icon: glyph,
|
|
172
|
+
size: 16
|
|
173
|
+
})
|
|
174
|
+
})
|
|
175
|
+
}, icon);
|
|
176
|
+
})
|
|
177
|
+
}, section_0.id);
|
|
178
|
+
if (section_0.label === null) {
|
|
179
|
+
return cells_0;
|
|
180
|
+
}
|
|
181
|
+
const headingId = `${id}-group-${index}`;
|
|
182
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
183
|
+
role: "group",
|
|
184
|
+
"aria-labelledby": headingId,
|
|
185
|
+
children: [/*#__PURE__*/_jsxs(SectionLabel, {
|
|
186
|
+
render: /*#__PURE__*/_jsx("div", {}),
|
|
187
|
+
"data-icon-heading": "",
|
|
188
|
+
className: clsx("flex h-7 items-center gap-2", framed ? "sticky top-0 z-10 bg-surface px-2.5 data-stuck:shadow-[0_1px_0_var(--border)]" : "mt-1"),
|
|
189
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
190
|
+
id: headingId,
|
|
191
|
+
className: "truncate",
|
|
192
|
+
children: section_0.label
|
|
193
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
194
|
+
className: "ms-auto shrink-0",
|
|
195
|
+
children: formatNumber(section_0.icons.length)
|
|
196
|
+
})]
|
|
197
|
+
}), cells_0]
|
|
198
|
+
}, section_0.id);
|
|
199
|
+
});
|
|
200
|
+
let t18;
|
|
201
|
+
if ($[17] !== moveFocus || $[18] !== name_0 || $[19] !== t13 || $[20] !== t14 || $[21] !== t15 || $[22] !== t16 || $[23] !== t9) {
|
|
202
|
+
t18 = /*#__PURE__*/_jsx("div", {
|
|
203
|
+
ref: area,
|
|
204
|
+
id: t9,
|
|
205
|
+
role: t10,
|
|
206
|
+
"aria-label": name_0,
|
|
207
|
+
className: t13,
|
|
208
|
+
style: t14,
|
|
209
|
+
onScroll: t15,
|
|
210
|
+
onKeyDown: moveFocus,
|
|
211
|
+
children: t16
|
|
212
|
+
});
|
|
213
|
+
$[17] = moveFocus;
|
|
214
|
+
$[18] = name_0;
|
|
215
|
+
$[19] = t13;
|
|
216
|
+
$[20] = t14;
|
|
217
|
+
$[21] = t15;
|
|
218
|
+
$[22] = t16;
|
|
219
|
+
$[23] = t9;
|
|
220
|
+
$[24] = t18;
|
|
221
|
+
} else {
|
|
222
|
+
t18 = $[24];
|
|
223
|
+
}
|
|
224
|
+
const grid = t18;
|
|
225
|
+
let t19;
|
|
226
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
227
|
+
t19 = /*#__PURE__*/_jsx("div", {});
|
|
228
|
+
$[25] = t19;
|
|
229
|
+
} else {
|
|
230
|
+
t19 = $[25];
|
|
231
|
+
}
|
|
232
|
+
let t20;
|
|
233
|
+
if ($[26] !== disabled || $[27] !== onClear || $[28] !== t || $[29] !== value) {
|
|
234
|
+
t20 = onClear && /*#__PURE__*/_jsxs(_Fragment, {
|
|
235
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
236
|
+
className: "grow"
|
|
237
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
|
238
|
+
icon: Ban,
|
|
239
|
+
size: "sm",
|
|
240
|
+
label: t("iconPicker.none"),
|
|
241
|
+
className: "-my-1",
|
|
242
|
+
disabled: disabled || value === null,
|
|
243
|
+
onClick: onClear
|
|
244
|
+
})]
|
|
245
|
+
});
|
|
246
|
+
$[26] = disabled;
|
|
247
|
+
$[27] = onClear;
|
|
248
|
+
$[28] = t;
|
|
249
|
+
$[29] = value;
|
|
250
|
+
$[30] = t20;
|
|
251
|
+
} else {
|
|
252
|
+
t20 = $[30];
|
|
253
|
+
}
|
|
254
|
+
let t21;
|
|
255
|
+
if ($[31] !== name_0 || $[32] !== t20) {
|
|
256
|
+
t21 = /*#__PURE__*/_jsxs(SectionLabel, {
|
|
257
|
+
render: t19,
|
|
258
|
+
className: "mb-1.5 flex items-center gap-2",
|
|
259
|
+
children: [name_0, t20]
|
|
260
|
+
});
|
|
261
|
+
$[31] = name_0;
|
|
262
|
+
$[32] = t20;
|
|
263
|
+
$[33] = t21;
|
|
264
|
+
} else {
|
|
265
|
+
t21 = $[33];
|
|
266
|
+
}
|
|
267
|
+
let t22;
|
|
268
|
+
if ($[34] !== disabled || $[35] !== framed || $[36] !== grid || $[37] !== id || $[38] !== query || $[39] !== search || $[40] !== searchable || $[41] !== t) {
|
|
269
|
+
t22 = framed ? /*#__PURE__*/_jsxs("div", {
|
|
270
|
+
className: "field h-auto overflow-hidden p-0 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:-outline-offset-1 has-[input:focus-visible]:outline-accent",
|
|
271
|
+
children: [searchable && /*#__PURE__*/_jsxs("div", {
|
|
272
|
+
className: "flex h-8 items-center gap-2 border-b border-border pr-1 pl-2.5",
|
|
273
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
274
|
+
icon: Search,
|
|
275
|
+
size: 14,
|
|
276
|
+
className: "shrink-0 text-text-faint"
|
|
277
|
+
}), /*#__PURE__*/_jsx("input", {
|
|
278
|
+
ref: input,
|
|
279
|
+
type: "text",
|
|
280
|
+
value: query,
|
|
281
|
+
placeholder: t("iconPicker.search"),
|
|
282
|
+
"aria-label": t("iconPicker.search"),
|
|
283
|
+
"aria-controls": `${id}-grid`,
|
|
284
|
+
spellCheck: false,
|
|
285
|
+
autoComplete: "off",
|
|
286
|
+
disabled: disabled,
|
|
287
|
+
className: "h-full min-w-0 flex-1 bg-transparent outline-none placeholder:text-text-faint",
|
|
288
|
+
onChange: event_1 => search(event_1.target.value),
|
|
289
|
+
onKeyDown: event_2 => {
|
|
290
|
+
if (escapeClearsSearch(event_2.key, query)) {
|
|
291
|
+
event_2.stopPropagation();
|
|
292
|
+
search("");
|
|
80
293
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
294
|
+
}
|
|
295
|
+
}), query && /*#__PURE__*/_jsx(IconButton, {
|
|
296
|
+
icon: X,
|
|
297
|
+
size: "sm",
|
|
298
|
+
label: t("iconPicker.clear"),
|
|
299
|
+
tooltip: false,
|
|
300
|
+
onClick: () => {
|
|
301
|
+
search("");
|
|
302
|
+
input.current?.focus();
|
|
303
|
+
}
|
|
304
|
+
})]
|
|
305
|
+
}), grid]
|
|
306
|
+
}) : grid;
|
|
307
|
+
$[34] = disabled;
|
|
308
|
+
$[35] = framed;
|
|
309
|
+
$[36] = grid;
|
|
310
|
+
$[37] = id;
|
|
311
|
+
$[38] = query;
|
|
312
|
+
$[39] = search;
|
|
313
|
+
$[40] = searchable;
|
|
314
|
+
$[41] = t;
|
|
315
|
+
$[42] = t22;
|
|
316
|
+
} else {
|
|
317
|
+
t22 = $[42];
|
|
318
|
+
}
|
|
319
|
+
let t23;
|
|
320
|
+
if ($[43] !== className || $[44] !== ref || $[45] !== t21 || $[46] !== t22) {
|
|
321
|
+
t23 = /*#__PURE__*/_jsxs("div", {
|
|
322
|
+
ref: ref,
|
|
323
|
+
className: className,
|
|
324
|
+
children: [t21, t22]
|
|
325
|
+
});
|
|
326
|
+
$[43] = className;
|
|
327
|
+
$[44] = ref;
|
|
328
|
+
$[45] = t21;
|
|
329
|
+
$[46] = t22;
|
|
330
|
+
$[47] = t23;
|
|
331
|
+
} else {
|
|
332
|
+
t23 = $[47];
|
|
333
|
+
}
|
|
334
|
+
return t23;
|
|
335
|
+
}
|
|
336
|
+
function _temp5(event_0) {
|
|
337
|
+
return markStuckHeadings(event_0.currentTarget);
|
|
338
|
+
}
|
|
339
|
+
function _temp4(event) {
|
|
340
|
+
if (event.metaKey || event.ctrlKey || event.altKey) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
const cells = [...event.currentTarget.querySelectorAll("[role=\"radio\"]")];
|
|
344
|
+
const from = cells.indexOf(event.target);
|
|
345
|
+
if (from === -1) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
const to = cellForKey(event.key, cells.map(_temp3), from);
|
|
349
|
+
if (to === null) {
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
event.preventDefault();
|
|
353
|
+
cells[to]?.focus();
|
|
354
|
+
}
|
|
355
|
+
function _temp3(cell) {
|
|
356
|
+
return cell.getBoundingClientRect();
|
|
357
|
+
}
|
|
358
|
+
function _temp2(section) {
|
|
359
|
+
return section.icons.map(_temp);
|
|
93
360
|
}
|
|
361
|
+
function _temp(t0) {
|
|
362
|
+
const [name] = t0;
|
|
363
|
+
return name;
|
|
364
|
+
}
|