@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/Checkbox.js
CHANGED
|
@@ -1,9 +1,78 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { Check, Minus } from 'lucide-react';
|
|
4
4
|
import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox';
|
|
5
|
-
import { Icon } from
|
|
5
|
+
import { Icon } from "./Icon.js";
|
|
6
6
|
/* Picked or not, as one item out of a list or an option that waits for a Save button. */
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export function Checkbox(t0) {
|
|
9
|
+
const $ = _c(13);
|
|
10
|
+
const {
|
|
11
|
+
checked,
|
|
12
|
+
onCheckedChange,
|
|
13
|
+
label,
|
|
14
|
+
indeterminate: t1,
|
|
15
|
+
disabled,
|
|
16
|
+
className,
|
|
17
|
+
ref
|
|
18
|
+
} = t0;
|
|
19
|
+
const indeterminate = t1 === undefined ? false : t1;
|
|
20
|
+
let t2;
|
|
21
|
+
if ($[0] !== onCheckedChange) {
|
|
22
|
+
t2 = next => onCheckedChange(next);
|
|
23
|
+
$[0] = onCheckedChange;
|
|
24
|
+
$[1] = t2;
|
|
25
|
+
} else {
|
|
26
|
+
t2 = $[1];
|
|
27
|
+
}
|
|
28
|
+
let t3;
|
|
29
|
+
if ($[2] !== className) {
|
|
30
|
+
t3 = clsx("flex size-4 shrink-0 items-center justify-center rounded-sm border border-border-strong bg-surface text-accent-text transition-colors", "data-checked:border-accent data-checked:bg-accent data-indeterminate:border-accent data-indeterminate:bg-accent data-disabled:opacity-50", className);
|
|
31
|
+
$[2] = className;
|
|
32
|
+
$[3] = t3;
|
|
33
|
+
} else {
|
|
34
|
+
t3 = $[3];
|
|
35
|
+
}
|
|
36
|
+
let t4;
|
|
37
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
38
|
+
t4 = /*#__PURE__*/_jsx(BaseCheckbox.Indicator, {
|
|
39
|
+
render: _temp
|
|
40
|
+
});
|
|
41
|
+
$[4] = t4;
|
|
42
|
+
} else {
|
|
43
|
+
t4 = $[4];
|
|
44
|
+
}
|
|
45
|
+
let t5;
|
|
46
|
+
if ($[5] !== checked || $[6] !== disabled || $[7] !== indeterminate || $[8] !== label || $[9] !== ref || $[10] !== t2 || $[11] !== t3) {
|
|
47
|
+
t5 = /*#__PURE__*/_jsx(BaseCheckbox.Root, {
|
|
48
|
+
ref: ref,
|
|
49
|
+
checked: checked,
|
|
50
|
+
indeterminate: indeterminate,
|
|
51
|
+
onCheckedChange: t2,
|
|
52
|
+
"aria-label": label,
|
|
53
|
+
disabled: disabled,
|
|
54
|
+
className: t3,
|
|
55
|
+
children: t4
|
|
56
|
+
});
|
|
57
|
+
$[5] = checked;
|
|
58
|
+
$[6] = disabled;
|
|
59
|
+
$[7] = indeterminate;
|
|
60
|
+
$[8] = label;
|
|
61
|
+
$[9] = ref;
|
|
62
|
+
$[10] = t2;
|
|
63
|
+
$[11] = t3;
|
|
64
|
+
$[12] = t5;
|
|
65
|
+
} else {
|
|
66
|
+
t5 = $[12];
|
|
67
|
+
}
|
|
68
|
+
return t5;
|
|
9
69
|
}
|
|
70
|
+
function _temp(props, state) {
|
|
71
|
+
return /*#__PURE__*/_jsx("span", {
|
|
72
|
+
...props,
|
|
73
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
74
|
+
icon: state.indeterminate ? Minus : Check,
|
|
75
|
+
size: 12
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
}
|
package/dist/ChoiceCards.js
CHANGED
|
@@ -1,21 +1,215 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { Fragment, useId } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { Radio } from '@base-ui/react/radio';
|
|
5
5
|
import { RadioGroup } from '@base-ui/react/radio-group';
|
|
6
|
-
import { Icon } from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import { Icon } from "./Icon.js";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
function ChoiceCard(t0) {
|
|
9
|
+
const $ = _c(21);
|
|
10
|
+
const {
|
|
11
|
+
choice,
|
|
12
|
+
radio
|
|
13
|
+
} = t0;
|
|
14
|
+
const id = useId();
|
|
15
|
+
let t1;
|
|
16
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
17
|
+
t1 = /*#__PURE__*/_jsx("span", {
|
|
18
|
+
className: "flex h-(--text-sm--line-height) shrink-0 items-center",
|
|
19
|
+
"aria-hidden": true,
|
|
20
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
21
|
+
className: "size-4 rounded-full border border-border-strong group-data-checked:border-5 group-data-checked:border-accent group-data-checked:bg-accent-text"
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
$[0] = t1;
|
|
25
|
+
} else {
|
|
26
|
+
t1 = $[0];
|
|
27
|
+
}
|
|
28
|
+
const dot = t1;
|
|
29
|
+
const t2 = `${id}-title`;
|
|
30
|
+
const t3 = `${id}-description`;
|
|
31
|
+
const t4 = radio === "start" && dot;
|
|
32
|
+
let t5;
|
|
33
|
+
if ($[1] !== choice.icon) {
|
|
34
|
+
t5 = choice.icon && /*#__PURE__*/_jsx("span", {
|
|
35
|
+
className: "grid size-8 shrink-0 place-items-center rounded-lg bg-surface-sunken text-text-muted group-data-checked:text-accent",
|
|
36
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
37
|
+
icon: choice.icon,
|
|
38
|
+
size: 16
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
$[1] = choice.icon;
|
|
42
|
+
$[2] = t5;
|
|
43
|
+
} else {
|
|
44
|
+
t5 = $[2];
|
|
45
|
+
}
|
|
46
|
+
const t6 = `${id}-title`;
|
|
47
|
+
let t7;
|
|
48
|
+
if ($[3] !== choice.title || $[4] !== t6) {
|
|
49
|
+
t7 = /*#__PURE__*/_jsx("span", {
|
|
50
|
+
id: t6,
|
|
51
|
+
className: "text-sm font-medium text-text",
|
|
52
|
+
children: choice.title
|
|
53
|
+
});
|
|
54
|
+
$[3] = choice.title;
|
|
55
|
+
$[4] = t6;
|
|
56
|
+
$[5] = t7;
|
|
57
|
+
} else {
|
|
58
|
+
t7 = $[5];
|
|
59
|
+
}
|
|
60
|
+
const t8 = `${id}-description`;
|
|
61
|
+
let t9;
|
|
62
|
+
if ($[6] !== choice.description || $[7] !== t8) {
|
|
63
|
+
t9 = /*#__PURE__*/_jsx("span", {
|
|
64
|
+
id: t8,
|
|
65
|
+
className: "text-xs text-pretty text-text-muted",
|
|
66
|
+
children: choice.description
|
|
67
|
+
});
|
|
68
|
+
$[6] = choice.description;
|
|
69
|
+
$[7] = t8;
|
|
70
|
+
$[8] = t9;
|
|
71
|
+
} else {
|
|
72
|
+
t9 = $[8];
|
|
73
|
+
}
|
|
74
|
+
let t10;
|
|
75
|
+
if ($[9] !== t7 || $[10] !== t9) {
|
|
76
|
+
t10 = /*#__PURE__*/_jsxs("span", {
|
|
77
|
+
className: "flex min-w-0 grow flex-col gap-0.5",
|
|
78
|
+
children: [t7, t9]
|
|
79
|
+
});
|
|
80
|
+
$[9] = t7;
|
|
81
|
+
$[10] = t9;
|
|
82
|
+
$[11] = t10;
|
|
83
|
+
} else {
|
|
84
|
+
t10 = $[11];
|
|
85
|
+
}
|
|
86
|
+
const t11 = radio === "end" && dot;
|
|
87
|
+
let t12;
|
|
88
|
+
if ($[12] !== choice.disabled || $[13] !== choice.value || $[14] !== t10 || $[15] !== t11 || $[16] !== t2 || $[17] !== t3 || $[18] !== t4 || $[19] !== t5) {
|
|
89
|
+
t12 = /*#__PURE__*/_jsxs(Radio.Root, {
|
|
90
|
+
value: choice.value,
|
|
91
|
+
disabled: choice.disabled,
|
|
92
|
+
"aria-labelledby": t2,
|
|
93
|
+
"aria-describedby": t3,
|
|
94
|
+
className: "group focus-ring flex min-w-0 items-start gap-3 rounded-xl border border-border bg-surface p-3 text-left hover:bg-surface-hover data-checked:border-accent data-disabled:opacity-50 data-disabled:hover:bg-surface",
|
|
95
|
+
children: [t4, t5, t10, t11]
|
|
96
|
+
});
|
|
97
|
+
$[12] = choice.disabled;
|
|
98
|
+
$[13] = choice.value;
|
|
99
|
+
$[14] = t10;
|
|
100
|
+
$[15] = t11;
|
|
101
|
+
$[16] = t2;
|
|
102
|
+
$[17] = t3;
|
|
103
|
+
$[18] = t4;
|
|
104
|
+
$[19] = t5;
|
|
105
|
+
$[20] = t12;
|
|
106
|
+
} else {
|
|
107
|
+
t12 = $[20];
|
|
108
|
+
}
|
|
109
|
+
return t12;
|
|
12
110
|
}
|
|
13
111
|
/*
|
|
14
112
|
* One of a few options, each a card that says what it means, for a choice that deserves more than a
|
|
15
113
|
* select: the cards stand side by side at the same width, one under the other or in a set number of
|
|
16
114
|
* columns, and the arrow keys move between them.
|
|
17
115
|
*/
|
|
18
|
-
export function ChoiceCards(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
116
|
+
export function ChoiceCards(t0) {
|
|
117
|
+
const $ = _c(27);
|
|
118
|
+
const {
|
|
119
|
+
value,
|
|
120
|
+
onValueChange,
|
|
121
|
+
choices,
|
|
122
|
+
label,
|
|
123
|
+
orientation: t1,
|
|
124
|
+
columns,
|
|
125
|
+
radio: t2,
|
|
126
|
+
detail,
|
|
127
|
+
disabled,
|
|
128
|
+
className,
|
|
129
|
+
ref
|
|
130
|
+
} = t0;
|
|
131
|
+
const orientation = t1 === undefined ? "horizontal" : t1;
|
|
132
|
+
const radio = t2 === undefined ? "end" : t2;
|
|
133
|
+
const vertical = columns === undefined && orientation === "vertical";
|
|
134
|
+
let t3;
|
|
135
|
+
if ($[0] !== onValueChange) {
|
|
136
|
+
t3 = next => onValueChange(next);
|
|
137
|
+
$[0] = onValueChange;
|
|
138
|
+
$[1] = t3;
|
|
139
|
+
} else {
|
|
140
|
+
t3 = $[1];
|
|
141
|
+
}
|
|
142
|
+
const t4 = columns !== undefined || vertical ? "grid-flow-row" : "auto-cols-fr grid-flow-col";
|
|
143
|
+
let t5;
|
|
144
|
+
if ($[2] !== className || $[3] !== t4) {
|
|
145
|
+
t5 = clsx("grid gap-2", t4, className);
|
|
146
|
+
$[2] = className;
|
|
147
|
+
$[3] = t4;
|
|
148
|
+
$[4] = t5;
|
|
149
|
+
} else {
|
|
150
|
+
t5 = $[4];
|
|
151
|
+
}
|
|
152
|
+
let t6;
|
|
153
|
+
if ($[5] !== columns) {
|
|
154
|
+
t6 = columns !== undefined ? {
|
|
155
|
+
gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`
|
|
156
|
+
} : undefined;
|
|
157
|
+
$[5] = columns;
|
|
158
|
+
$[6] = t6;
|
|
159
|
+
} else {
|
|
160
|
+
t6 = $[6];
|
|
161
|
+
}
|
|
162
|
+
let t7;
|
|
163
|
+
if ($[7] !== choices || $[8] !== detail || $[9] !== radio || $[10] !== value || $[11] !== vertical) {
|
|
164
|
+
let t8;
|
|
165
|
+
if ($[13] !== detail || $[14] !== radio || $[15] !== value || $[16] !== vertical) {
|
|
166
|
+
t8 = choice => /*#__PURE__*/_jsxs(Fragment, {
|
|
167
|
+
children: [/*#__PURE__*/_jsx(ChoiceCard, {
|
|
168
|
+
choice: choice,
|
|
169
|
+
radio: radio
|
|
170
|
+
}), vertical && choice.value === value && detail]
|
|
171
|
+
}, choice.value);
|
|
172
|
+
$[13] = detail;
|
|
173
|
+
$[14] = radio;
|
|
174
|
+
$[15] = value;
|
|
175
|
+
$[16] = vertical;
|
|
176
|
+
$[17] = t8;
|
|
177
|
+
} else {
|
|
178
|
+
t8 = $[17];
|
|
179
|
+
}
|
|
180
|
+
t7 = choices.map(t8);
|
|
181
|
+
$[7] = choices;
|
|
182
|
+
$[8] = detail;
|
|
183
|
+
$[9] = radio;
|
|
184
|
+
$[10] = value;
|
|
185
|
+
$[11] = vertical;
|
|
186
|
+
$[12] = t7;
|
|
187
|
+
} else {
|
|
188
|
+
t7 = $[12];
|
|
189
|
+
}
|
|
190
|
+
let t8;
|
|
191
|
+
if ($[18] !== disabled || $[19] !== label || $[20] !== ref || $[21] !== t3 || $[22] !== t5 || $[23] !== t6 || $[24] !== t7 || $[25] !== value) {
|
|
192
|
+
t8 = /*#__PURE__*/_jsx(RadioGroup, {
|
|
193
|
+
ref: ref,
|
|
194
|
+
value: value,
|
|
195
|
+
onValueChange: t3,
|
|
196
|
+
disabled: disabled,
|
|
197
|
+
"aria-label": label,
|
|
198
|
+
className: t5,
|
|
199
|
+
style: t6,
|
|
200
|
+
children: t7
|
|
201
|
+
});
|
|
202
|
+
$[18] = disabled;
|
|
203
|
+
$[19] = label;
|
|
204
|
+
$[20] = ref;
|
|
205
|
+
$[21] = t3;
|
|
206
|
+
$[22] = t5;
|
|
207
|
+
$[23] = t6;
|
|
208
|
+
$[24] = t7;
|
|
209
|
+
$[25] = value;
|
|
210
|
+
$[26] = t8;
|
|
211
|
+
} else {
|
|
212
|
+
t8 = $[26];
|
|
213
|
+
}
|
|
214
|
+
return t8;
|
|
215
|
+
}
|
package/dist/CloseButton.js
CHANGED
|
@@ -1,11 +1,91 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { X } from 'lucide-react';
|
|
3
3
|
import { Dialog } from '@base-ui/react/dialog';
|
|
4
|
-
import { IconButton } from
|
|
4
|
+
import { IconButton } from "./IconButton.js";
|
|
5
5
|
/* The close button in the header of every panel and dialog. In a dialog it is that dialog's own close part. */
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export function CloseButton(t0) {
|
|
8
|
+
const $ = _c(21);
|
|
9
|
+
let className;
|
|
10
|
+
let closes;
|
|
11
|
+
let kbd;
|
|
12
|
+
let label;
|
|
13
|
+
let ref;
|
|
14
|
+
let size;
|
|
15
|
+
if ($[0] !== t0) {
|
|
16
|
+
({
|
|
17
|
+
label,
|
|
18
|
+
kbd,
|
|
19
|
+
size,
|
|
20
|
+
className,
|
|
21
|
+
ref,
|
|
22
|
+
...closes
|
|
23
|
+
} = t0);
|
|
24
|
+
$[0] = t0;
|
|
25
|
+
$[1] = className;
|
|
26
|
+
$[2] = closes;
|
|
27
|
+
$[3] = kbd;
|
|
28
|
+
$[4] = label;
|
|
29
|
+
$[5] = ref;
|
|
30
|
+
$[6] = size;
|
|
31
|
+
} else {
|
|
32
|
+
className = $[1];
|
|
33
|
+
closes = $[2];
|
|
34
|
+
kbd = $[3];
|
|
35
|
+
label = $[4];
|
|
36
|
+
ref = $[5];
|
|
37
|
+
size = $[6];
|
|
38
|
+
}
|
|
39
|
+
if ("dialog" in closes) {
|
|
40
|
+
let t1;
|
|
41
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
42
|
+
t1 = /*#__PURE__*/_jsx(Dialog.Close, {});
|
|
43
|
+
$[7] = t1;
|
|
44
|
+
} else {
|
|
45
|
+
t1 = $[7];
|
|
46
|
+
}
|
|
47
|
+
let t2;
|
|
48
|
+
if ($[8] !== className || $[9] !== kbd || $[10] !== label || $[11] !== ref || $[12] !== size) {
|
|
49
|
+
t2 = /*#__PURE__*/_jsx(IconButton, {
|
|
50
|
+
ref: ref,
|
|
51
|
+
icon: X,
|
|
52
|
+
label: label,
|
|
53
|
+
kbd: kbd,
|
|
54
|
+
size: size,
|
|
55
|
+
className: className,
|
|
56
|
+
render: t1
|
|
57
|
+
});
|
|
58
|
+
$[8] = className;
|
|
59
|
+
$[9] = kbd;
|
|
60
|
+
$[10] = label;
|
|
61
|
+
$[11] = ref;
|
|
62
|
+
$[12] = size;
|
|
63
|
+
$[13] = t2;
|
|
64
|
+
} else {
|
|
65
|
+
t2 = $[13];
|
|
9
66
|
}
|
|
10
|
-
return
|
|
11
|
-
}
|
|
67
|
+
return t2;
|
|
68
|
+
}
|
|
69
|
+
let t1;
|
|
70
|
+
if ($[14] !== className || $[15] !== closes.onClick || $[16] !== kbd || $[17] !== label || $[18] !== ref || $[19] !== size) {
|
|
71
|
+
t1 = /*#__PURE__*/_jsx(IconButton, {
|
|
72
|
+
ref: ref,
|
|
73
|
+
icon: X,
|
|
74
|
+
label: label,
|
|
75
|
+
kbd: kbd,
|
|
76
|
+
size: size,
|
|
77
|
+
className: className,
|
|
78
|
+
onClick: closes.onClick
|
|
79
|
+
});
|
|
80
|
+
$[14] = className;
|
|
81
|
+
$[15] = closes.onClick;
|
|
82
|
+
$[16] = kbd;
|
|
83
|
+
$[17] = label;
|
|
84
|
+
$[18] = ref;
|
|
85
|
+
$[19] = size;
|
|
86
|
+
$[20] = t1;
|
|
87
|
+
} else {
|
|
88
|
+
t1 = $[20];
|
|
89
|
+
}
|
|
90
|
+
return t1;
|
|
91
|
+
}
|
package/dist/ColorSwatch.js
CHANGED
|
@@ -1,28 +1,145 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { Check } from 'lucide-react';
|
|
4
4
|
import { useRender } from '@base-ui/react/use-render';
|
|
5
|
-
import { Icon } from
|
|
5
|
+
import { Icon } from "./Icon.js";
|
|
6
6
|
/* `focus-ring` for the swatch that is a menu item rather than a button, which the keyboard reaches all the same. */
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
const SWATCH = 'focus-ring grid h-6 w-6 place-items-center rounded-full text-accent-text';
|
|
8
9
|
/* The ring of the picked color is offset against whatever the swatch stands on. */
|
|
9
10
|
const PICKED_RING = {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
surface: 'ring-2 ring-accent ring-offset-2 ring-offset-surface',
|
|
12
|
+
popup: 'ring-2 ring-accent ring-offset-1 ring-offset-surface-raised'
|
|
12
13
|
};
|
|
13
14
|
/*
|
|
14
15
|
* One color, drawn as the color itself. Its name belongs in a tooltip, so the circle carries a tick
|
|
15
16
|
* alone when it is picked. Children replace the tick, such as the ellipsis of a "more colors" swatch.
|
|
16
17
|
*/
|
|
17
|
-
export function ColorSwatch(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
export function ColorSwatch(t0) {
|
|
19
|
+
const $ = _c(32);
|
|
20
|
+
let children;
|
|
21
|
+
let className;
|
|
22
|
+
let color;
|
|
23
|
+
let props;
|
|
24
|
+
let ref;
|
|
25
|
+
let render;
|
|
26
|
+
let style;
|
|
27
|
+
let t1;
|
|
28
|
+
let t2;
|
|
29
|
+
let t3;
|
|
30
|
+
if ($[0] !== t0) {
|
|
31
|
+
({
|
|
32
|
+
color,
|
|
33
|
+
picked: t1,
|
|
34
|
+
on: t2,
|
|
35
|
+
tick: t3,
|
|
36
|
+
render,
|
|
37
|
+
className,
|
|
38
|
+
style,
|
|
39
|
+
ref,
|
|
40
|
+
children,
|
|
41
|
+
...props
|
|
42
|
+
} = t0);
|
|
43
|
+
$[0] = t0;
|
|
44
|
+
$[1] = children;
|
|
45
|
+
$[2] = className;
|
|
46
|
+
$[3] = color;
|
|
47
|
+
$[4] = props;
|
|
48
|
+
$[5] = ref;
|
|
49
|
+
$[6] = render;
|
|
50
|
+
$[7] = style;
|
|
51
|
+
$[8] = t1;
|
|
52
|
+
$[9] = t2;
|
|
53
|
+
$[10] = t3;
|
|
54
|
+
} else {
|
|
55
|
+
children = $[1];
|
|
56
|
+
className = $[2];
|
|
57
|
+
color = $[3];
|
|
58
|
+
props = $[4];
|
|
59
|
+
ref = $[5];
|
|
60
|
+
render = $[6];
|
|
61
|
+
style = $[7];
|
|
62
|
+
t1 = $[8];
|
|
63
|
+
t2 = $[9];
|
|
64
|
+
t3 = $[10];
|
|
65
|
+
}
|
|
66
|
+
const picked = t1 === undefined ? false : t1;
|
|
67
|
+
const on = t2 === undefined ? "surface" : t2;
|
|
68
|
+
const tick = t3 === undefined ? true : t3;
|
|
69
|
+
let t4;
|
|
70
|
+
if ($[11] !== render) {
|
|
71
|
+
t4 = render ?? /*#__PURE__*/_jsx("button", {
|
|
72
|
+
type: "button"
|
|
27
73
|
});
|
|
28
|
-
|
|
74
|
+
$[11] = render;
|
|
75
|
+
$[12] = t4;
|
|
76
|
+
} else {
|
|
77
|
+
t4 = $[12];
|
|
78
|
+
}
|
|
79
|
+
const t5 = color === undefined ? "border border-border-strong text-text-muted" : picked && PICKED_RING[on];
|
|
80
|
+
let t6;
|
|
81
|
+
if ($[13] !== className || $[14] !== t5) {
|
|
82
|
+
t6 = clsx(SWATCH, t5, className);
|
|
83
|
+
$[13] = className;
|
|
84
|
+
$[14] = t5;
|
|
85
|
+
$[15] = t6;
|
|
86
|
+
} else {
|
|
87
|
+
t6 = $[15];
|
|
88
|
+
}
|
|
89
|
+
let t7;
|
|
90
|
+
if ($[16] !== color || $[17] !== style) {
|
|
91
|
+
t7 = color === undefined ? style : {
|
|
92
|
+
...style,
|
|
93
|
+
background: color
|
|
94
|
+
};
|
|
95
|
+
$[16] = color;
|
|
96
|
+
$[17] = style;
|
|
97
|
+
$[18] = t7;
|
|
98
|
+
} else {
|
|
99
|
+
t7 = $[18];
|
|
100
|
+
}
|
|
101
|
+
let t8;
|
|
102
|
+
if ($[19] !== children || $[20] !== picked || $[21] !== tick) {
|
|
103
|
+
t8 = children ?? (picked && tick && /*#__PURE__*/_jsx(Icon, {
|
|
104
|
+
icon: Check,
|
|
105
|
+
size: 12
|
|
106
|
+
}));
|
|
107
|
+
$[19] = children;
|
|
108
|
+
$[20] = picked;
|
|
109
|
+
$[21] = tick;
|
|
110
|
+
$[22] = t8;
|
|
111
|
+
} else {
|
|
112
|
+
t8 = $[22];
|
|
113
|
+
}
|
|
114
|
+
let t9;
|
|
115
|
+
if ($[23] !== props || $[24] !== t6 || $[25] !== t7 || $[26] !== t8) {
|
|
116
|
+
t9 = {
|
|
117
|
+
...props,
|
|
118
|
+
className: t6,
|
|
119
|
+
style: t7,
|
|
120
|
+
children: t8
|
|
121
|
+
};
|
|
122
|
+
$[23] = props;
|
|
123
|
+
$[24] = t6;
|
|
124
|
+
$[25] = t7;
|
|
125
|
+
$[26] = t8;
|
|
126
|
+
$[27] = t9;
|
|
127
|
+
} else {
|
|
128
|
+
t9 = $[27];
|
|
129
|
+
}
|
|
130
|
+
let t10;
|
|
131
|
+
if ($[28] !== ref || $[29] !== t4 || $[30] !== t9) {
|
|
132
|
+
t10 = {
|
|
133
|
+
render: t4,
|
|
134
|
+
ref,
|
|
135
|
+
props: t9
|
|
136
|
+
};
|
|
137
|
+
$[28] = ref;
|
|
138
|
+
$[29] = t4;
|
|
139
|
+
$[30] = t9;
|
|
140
|
+
$[31] = t10;
|
|
141
|
+
} else {
|
|
142
|
+
t10 = $[31];
|
|
143
|
+
}
|
|
144
|
+
return useRender(t10);
|
|
145
|
+
}
|