@cjlapao/ui-kit 0.2.13 → 0.2.15
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/{CapsuleBlueprint-DY1EmDQu.d.cts → CapsuleBlueprint-GfFJiLUb.d.cts} +13 -1
- package/dist/{CapsuleBlueprint-DY1EmDQu.d.ts → CapsuleBlueprint-GfFJiLUb.d.ts} +13 -1
- package/dist/index.cjs +854 -497
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +80 -16
- package/dist/index.d.cts +150 -48
- package/dist/index.d.ts +150 -48
- package/dist/index.js +824 -473
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.d.cts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5287,6 +5287,9 @@ var surfaceCornerRem = {
|
|
|
5287
5287
|
};
|
|
5288
5288
|
var DEFAULT_SURFACE_CORNER = "rounded-md";
|
|
5289
5289
|
var COLLAPSED_RAIL_WIDTH = 56;
|
|
5290
|
+
var PANEL_SLIDE_DURATION_MS = 450;
|
|
5291
|
+
var PANEL_SLIDE_EASING = "cubic-bezier(0.32, 0.72, 0, 1)";
|
|
5292
|
+
var panelSlideTransition = (...properties) => properties.map((property) => `${property} ${PANEL_SLIDE_DURATION_MS}ms ${PANEL_SLIDE_EASING}`).join(", ");
|
|
5290
5293
|
var DEFAULT_CONTROL_CORNER = "rounded-lg";
|
|
5291
5294
|
var SURFACE_VARIANT_FOR_FIELD = {
|
|
5292
5295
|
flat: "outlined",
|
|
@@ -6996,13 +6999,13 @@ var Parser = class _Parser {
|
|
|
6996
6999
|
/** Parse a message body (top-level or a branch body — see parseBranchBody). */
|
|
6997
7000
|
parseMessage(inPluralBranch = false) {
|
|
6998
7001
|
const nodes = [];
|
|
6999
|
-
let
|
|
7002
|
+
let text2 = "";
|
|
7000
7003
|
let pendingSpace = false;
|
|
7001
7004
|
let hasContent = false;
|
|
7002
7005
|
const flushText = () => {
|
|
7003
|
-
if (
|
|
7004
|
-
nodes.push({ type: "text", value:
|
|
7005
|
-
|
|
7006
|
+
if (text2 !== "") {
|
|
7007
|
+
nodes.push({ type: "text", value: text2 });
|
|
7008
|
+
text2 = "";
|
|
7006
7009
|
}
|
|
7007
7010
|
};
|
|
7008
7011
|
while (this.pos < this.src.length) {
|
|
@@ -7010,19 +7013,19 @@ var Parser = class _Parser {
|
|
|
7010
7013
|
if (ch === "\\") {
|
|
7011
7014
|
if (this.src[this.pos + 1] === "'") {
|
|
7012
7015
|
if (pendingSpace) {
|
|
7013
|
-
|
|
7016
|
+
text2 += " ";
|
|
7014
7017
|
pendingSpace = false;
|
|
7015
7018
|
}
|
|
7016
|
-
|
|
7019
|
+
text2 += "'";
|
|
7017
7020
|
this.pos += 2;
|
|
7018
7021
|
hasContent = true;
|
|
7019
7022
|
continue;
|
|
7020
7023
|
}
|
|
7021
7024
|
if (pendingSpace) {
|
|
7022
|
-
|
|
7025
|
+
text2 += " ";
|
|
7023
7026
|
pendingSpace = false;
|
|
7024
7027
|
}
|
|
7025
|
-
|
|
7028
|
+
text2 += ch;
|
|
7026
7029
|
this.pos += 1;
|
|
7027
7030
|
hasContent = true;
|
|
7028
7031
|
continue;
|
|
@@ -7030,16 +7033,16 @@ var Parser = class _Parser {
|
|
|
7030
7033
|
if (ch === "'") {
|
|
7031
7034
|
if (this.src[this.pos + 1] === "'") {
|
|
7032
7035
|
if (pendingSpace) {
|
|
7033
|
-
|
|
7036
|
+
text2 += " ";
|
|
7034
7037
|
pendingSpace = false;
|
|
7035
7038
|
}
|
|
7036
|
-
|
|
7039
|
+
text2 += "'";
|
|
7037
7040
|
this.pos += 2;
|
|
7038
7041
|
hasContent = true;
|
|
7039
7042
|
continue;
|
|
7040
7043
|
}
|
|
7041
7044
|
if (pendingSpace) {
|
|
7042
|
-
|
|
7045
|
+
text2 += " ";
|
|
7043
7046
|
pendingSpace = false;
|
|
7044
7047
|
}
|
|
7045
7048
|
this.pos += 1;
|
|
@@ -7051,13 +7054,13 @@ var Parser = class _Parser {
|
|
|
7051
7054
|
throw this.err("unterminated quoted section \u2014 a ' opened without a closing '");
|
|
7052
7055
|
}
|
|
7053
7056
|
this.pos += 1;
|
|
7054
|
-
|
|
7057
|
+
text2 += inner;
|
|
7055
7058
|
hasContent = true;
|
|
7056
7059
|
continue;
|
|
7057
7060
|
}
|
|
7058
7061
|
if (ch === "{") {
|
|
7059
7062
|
if (pendingSpace) {
|
|
7060
|
-
|
|
7063
|
+
text2 += " ";
|
|
7061
7064
|
pendingSpace = false;
|
|
7062
7065
|
}
|
|
7063
7066
|
flushText();
|
|
@@ -7070,7 +7073,7 @@ var Parser = class _Parser {
|
|
|
7070
7073
|
}
|
|
7071
7074
|
if (inPluralBranch && ch === "#") {
|
|
7072
7075
|
if (pendingSpace) {
|
|
7073
|
-
|
|
7076
|
+
text2 += " ";
|
|
7074
7077
|
pendingSpace = false;
|
|
7075
7078
|
}
|
|
7076
7079
|
flushText();
|
|
@@ -7085,10 +7088,10 @@ var Parser = class _Parser {
|
|
|
7085
7088
|
continue;
|
|
7086
7089
|
}
|
|
7087
7090
|
if (pendingSpace) {
|
|
7088
|
-
|
|
7091
|
+
text2 += " ";
|
|
7089
7092
|
pendingSpace = false;
|
|
7090
7093
|
}
|
|
7091
|
-
|
|
7094
|
+
text2 += ch;
|
|
7092
7095
|
hasContent = true;
|
|
7093
7096
|
this.pos += 1;
|
|
7094
7097
|
}
|
|
@@ -7526,8 +7529,8 @@ var FULL_MONTH_REGEX = new RegExp(
|
|
|
7526
7529
|
"gi"
|
|
7527
7530
|
);
|
|
7528
7531
|
var escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
7529
|
-
var normalizeToEnglishNames = (
|
|
7530
|
-
let out =
|
|
7532
|
+
var normalizeToEnglishNames = (text2, names) => {
|
|
7533
|
+
let out = text2;
|
|
7531
7534
|
const mapSet = (source, target) => {
|
|
7532
7535
|
if (!source) return;
|
|
7533
7536
|
const pairs = source.map((s, i) => [s, target[i]]).filter(([s, t]) => s && t && s.toLowerCase() !== t.toLowerCase()).sort((a, b) => b[0].length - a[0].length);
|
|
@@ -7544,21 +7547,21 @@ var normalizeToEnglishNames = (text, names) => {
|
|
|
7544
7547
|
mapSet(names.weekdayShort, WEEKDAY_LABELS_SHORT);
|
|
7545
7548
|
return out;
|
|
7546
7549
|
};
|
|
7547
|
-
var abbreviateMonthNames = (
|
|
7550
|
+
var abbreviateMonthNames = (text2) => text2.replace(
|
|
7548
7551
|
FULL_MONTH_REGEX,
|
|
7549
7552
|
(match) => MONTH_NAME_TO_ABBR[match.toLowerCase()] ?? match
|
|
7550
7553
|
);
|
|
7551
7554
|
var ABBR_MONTH_REGEX = /\b(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\b/g;
|
|
7552
|
-
var expandMonthNames = (
|
|
7555
|
+
var expandMonthNames = (text2) => text2.replace(ABBR_MONTH_REGEX, (match) => {
|
|
7553
7556
|
const expanded = MONTH_ABBR_TO_NAME[match.toLowerCase()];
|
|
7554
7557
|
return expanded ? `${expanded.charAt(0) + expanded.slice(1).toLowerCase()}` : match;
|
|
7555
7558
|
});
|
|
7556
|
-
var parseCandidates = (
|
|
7557
|
-
const candidates = [
|
|
7559
|
+
var parseCandidates = (text2) => {
|
|
7560
|
+
const candidates = [text2, abbreviateMonthNames(text2), expandMonthNames(text2)];
|
|
7558
7561
|
return [...new Set(candidates)];
|
|
7559
7562
|
};
|
|
7560
|
-
var parseDateText = (
|
|
7561
|
-
const trimmed =
|
|
7563
|
+
var parseDateText = (text2, formatString = DEFAULT_DATE_FORMAT, reference = /* @__PURE__ */ new Date(), names) => {
|
|
7564
|
+
const trimmed = text2.trim();
|
|
7562
7565
|
if (!trimmed) return null;
|
|
7563
7566
|
const candidates = /* @__PURE__ */ new Set();
|
|
7564
7567
|
for (const candidate of parseCandidates(trimmed)) candidates.add(candidate);
|
|
@@ -7575,13 +7578,13 @@ var parseDateText = (text, formatString = DEFAULT_DATE_FORMAT, reference = /* @_
|
|
|
7575
7578
|
}
|
|
7576
7579
|
return null;
|
|
7577
7580
|
};
|
|
7578
|
-
var parseValueText = (
|
|
7579
|
-
const trimmed =
|
|
7581
|
+
var parseValueText = (text2, selectionMode = "single", formatString = DEFAULT_DATE_FORMAT, reference = /* @__PURE__ */ new Date(), names) => {
|
|
7582
|
+
const trimmed = text2.trim();
|
|
7580
7583
|
if (!trimmed) return null;
|
|
7581
7584
|
if (selectionMode === "single") {
|
|
7582
7585
|
return parseDateText(trimmed, formatString, reference, names);
|
|
7583
7586
|
}
|
|
7584
|
-
const withTrailingSeparator = /\s-$/.test(
|
|
7587
|
+
const withTrailingSeparator = /\s-$/.test(text2) ? `${text2} ` : text2;
|
|
7585
7588
|
const parts = withTrailingSeparator.split(RANGE_SEPARATOR);
|
|
7586
7589
|
if (parts.length !== 2) return null;
|
|
7587
7590
|
const start = parseDateText(parts[0], formatString, reference, names);
|
|
@@ -10105,9 +10108,9 @@ var sizeTokens = {
|
|
|
10105
10108
|
}
|
|
10106
10109
|
}
|
|
10107
10110
|
};
|
|
10108
|
-
var SpinnerLabel = ({ text }) => {
|
|
10111
|
+
var SpinnerLabel = ({ text: text2 }) => {
|
|
10109
10112
|
const surface = useSurfaceText();
|
|
10110
|
-
return /* @__PURE__ */ jsx153("span", { className: classNames4("text-sm font-medium", surface.body), children:
|
|
10113
|
+
return /* @__PURE__ */ jsx153("span", { className: classNames4("text-sm font-medium", surface.body), children: text2 });
|
|
10111
10114
|
};
|
|
10112
10115
|
var Spinner = React6.forwardRef(
|
|
10113
10116
|
({
|
|
@@ -10416,7 +10419,7 @@ var TOOLTIP_ARROW_BORDER = {
|
|
|
10416
10419
|
// src/components/TooltipWrapper.tsx
|
|
10417
10420
|
import { Fragment as Fragment2, jsx as jsx154, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
10418
10421
|
var TooltipWrapper = ({
|
|
10419
|
-
text,
|
|
10422
|
+
text: text2,
|
|
10420
10423
|
delay = 500,
|
|
10421
10424
|
position = "top",
|
|
10422
10425
|
variant = "surface",
|
|
@@ -10437,12 +10440,12 @@ var TooltipWrapper = ({
|
|
|
10437
10440
|
};
|
|
10438
10441
|
}, []);
|
|
10439
10442
|
useEffect(() => {
|
|
10440
|
-
if (!
|
|
10443
|
+
if (!text2 && visible) {
|
|
10441
10444
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
10442
10445
|
setVisible(false);
|
|
10443
10446
|
setPlacement(null);
|
|
10444
10447
|
}
|
|
10445
|
-
}, [
|
|
10448
|
+
}, [text2, visible]);
|
|
10446
10449
|
const measure = useCallback(() => {
|
|
10447
10450
|
const el = tooltipRef.current;
|
|
10448
10451
|
const trigger = triggerRectRef.current;
|
|
@@ -10490,7 +10493,7 @@ var TooltipWrapper = ({
|
|
|
10490
10493
|
}, [visible, measure]);
|
|
10491
10494
|
const show = useCallback(
|
|
10492
10495
|
(e) => {
|
|
10493
|
-
if (
|
|
10496
|
+
if (text2) {
|
|
10494
10497
|
setColorScheme(
|
|
10495
10498
|
e.currentTarget.closest("[data-color-scheme]")?.getAttribute("data-color-scheme") ?? null
|
|
10496
10499
|
);
|
|
@@ -10504,7 +10507,7 @@ var TooltipWrapper = ({
|
|
|
10504
10507
|
children.props.onMouseEnter?.(e);
|
|
10505
10508
|
}
|
|
10506
10509
|
},
|
|
10507
|
-
[
|
|
10510
|
+
[text2, delay, children.props]
|
|
10508
10511
|
);
|
|
10509
10512
|
const hide = useCallback(
|
|
10510
10513
|
(e) => {
|
|
@@ -10527,7 +10530,7 @@ var TooltipWrapper = ({
|
|
|
10527
10530
|
// The WAI pattern for tooltips: the relationship is declared only while
|
|
10528
10531
|
// the tooltip exists — a permanent `aria-describedby` to an absent id is
|
|
10529
10532
|
// a dangling reference most readers skip silently.
|
|
10530
|
-
"aria-describedby": visible &&
|
|
10533
|
+
"aria-describedby": visible && text2 ? tooltipId : void 0,
|
|
10531
10534
|
onMouseEnter: show,
|
|
10532
10535
|
onMouseLeave: hide,
|
|
10533
10536
|
onFocus: show,
|
|
@@ -10538,7 +10541,7 @@ var TooltipWrapper = ({
|
|
|
10538
10541
|
const vertical = side === "top" || side === "bottom";
|
|
10539
10542
|
return /* @__PURE__ */ jsxs56(Fragment2, { children: [
|
|
10540
10543
|
child,
|
|
10541
|
-
visible &&
|
|
10544
|
+
visible && text2 && createPortal(
|
|
10542
10545
|
/* @__PURE__ */ jsxs56(
|
|
10543
10546
|
"div",
|
|
10544
10547
|
{
|
|
@@ -10560,7 +10563,7 @@ var TooltipWrapper = ({
|
|
|
10560
10563
|
colorScheme === "dark" && "dark"
|
|
10561
10564
|
),
|
|
10562
10565
|
children: [
|
|
10563
|
-
|
|
10566
|
+
text2,
|
|
10564
10567
|
/* @__PURE__ */ jsx154(
|
|
10565
10568
|
"span",
|
|
10566
10569
|
{
|
|
@@ -13076,7 +13079,7 @@ var MultiProgressBar = ({
|
|
|
13076
13079
|
className,
|
|
13077
13080
|
...rest
|
|
13078
13081
|
}) => {
|
|
13079
|
-
const
|
|
13082
|
+
const text2 = useSurfaceText();
|
|
13080
13083
|
const renderIcon2 = useIconRenderer();
|
|
13081
13084
|
const [hoveredKey, setHoveredKey] = useState3(null);
|
|
13082
13085
|
const [tooltip, setTooltip] = useState3(null);
|
|
@@ -13147,7 +13150,7 @@ var MultiProgressBar = ({
|
|
|
13147
13150
|
className: classNames17(
|
|
13148
13151
|
"flex cursor-pointer select-none items-center gap-1.5 whitespace-nowrap",
|
|
13149
13152
|
"transition-all duration-200",
|
|
13150
|
-
isActive ?
|
|
13153
|
+
isActive ? text2.heading : isDimmed ? "opacity-40" : text2.muted
|
|
13151
13154
|
),
|
|
13152
13155
|
onMouseEnter: () => setHoveredKey(s.key),
|
|
13153
13156
|
onMouseLeave: () => setHoveredKey(null),
|
|
@@ -13172,13 +13175,13 @@ var MultiProgressBar = ({
|
|
|
13172
13175
|
{
|
|
13173
13176
|
className: classNames17(
|
|
13174
13177
|
"font-semibold transition-colors duration-200",
|
|
13175
|
-
isActive ?
|
|
13178
|
+
isActive ? text2.heading : text2.body
|
|
13176
13179
|
),
|
|
13177
13180
|
children: s.displayValue ?? s.value
|
|
13178
13181
|
}
|
|
13179
13182
|
),
|
|
13180
13183
|
s.label,
|
|
13181
|
-
showPercent && /* @__PURE__ */ jsxs68("span", { className:
|
|
13184
|
+
showPercent && /* @__PURE__ */ jsxs68("span", { className: text2.muted, children: [
|
|
13182
13185
|
"(",
|
|
13183
13186
|
Math.round(pct),
|
|
13184
13187
|
"%)"
|
|
@@ -13320,7 +13323,7 @@ var MultiProgressBar = ({
|
|
|
13320
13323
|
className: classNames17(
|
|
13321
13324
|
tokens.label,
|
|
13322
13325
|
"font-semibold",
|
|
13323
|
-
!hasTextColor(labelClassName) &&
|
|
13326
|
+
!hasTextColor(labelClassName) && text2.heading,
|
|
13324
13327
|
labelClassName
|
|
13325
13328
|
),
|
|
13326
13329
|
children: label
|
|
@@ -13332,7 +13335,7 @@ var MultiProgressBar = ({
|
|
|
13332
13335
|
className: classNames17(
|
|
13333
13336
|
tokens.meta,
|
|
13334
13337
|
"mt-0.5",
|
|
13335
|
-
!hasTextColor(secondaryLabelClassName) &&
|
|
13338
|
+
!hasTextColor(secondaryLabelClassName) && text2.muted,
|
|
13336
13339
|
secondaryLabelClassName
|
|
13337
13340
|
),
|
|
13338
13341
|
children: secondaryLabel
|
|
@@ -13342,7 +13345,7 @@ var MultiProgressBar = ({
|
|
|
13342
13345
|
totalLabel && /* @__PURE__ */ jsx166(
|
|
13343
13346
|
"span",
|
|
13344
13347
|
{
|
|
13345
|
-
className: classNames17(tokens.meta, "font-medium",
|
|
13348
|
+
className: classNames17(tokens.meta, "font-medium", text2.muted),
|
|
13346
13349
|
children: totalLabel
|
|
13347
13350
|
}
|
|
13348
13351
|
)
|
|
@@ -13420,9 +13423,9 @@ var Shimmer_default = Shimmer;
|
|
|
13420
13423
|
import classNames19 from "classnames";
|
|
13421
13424
|
import React18 from "react";
|
|
13422
13425
|
import { jsx as jsx168, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
13423
|
-
var StatusSpinnerLabel = ({ text }) => {
|
|
13426
|
+
var StatusSpinnerLabel = ({ text: text2 }) => {
|
|
13424
13427
|
const surface = useSurfaceText();
|
|
13425
|
-
return /* @__PURE__ */ jsx168("span", { className: classNames19("text-sm font-medium", surface.body), children:
|
|
13428
|
+
return /* @__PURE__ */ jsx168("span", { className: classNames19("text-sm font-medium", surface.body), children: text2 });
|
|
13426
13429
|
};
|
|
13427
13430
|
var StatusSpinner = React18.forwardRef(
|
|
13428
13431
|
({
|
|
@@ -14285,7 +14288,13 @@ var CollapseToggleButton = ({
|
|
|
14285
14288
|
size = "sm",
|
|
14286
14289
|
...rest
|
|
14287
14290
|
}) => {
|
|
14288
|
-
const
|
|
14291
|
+
const towardEdge = !collapsed;
|
|
14292
|
+
const rotation = {
|
|
14293
|
+
right: towardEdge ? "" : "rotate-180",
|
|
14294
|
+
left: towardEdge ? "rotate-180" : "",
|
|
14295
|
+
bottom: towardEdge ? "rotate-90" : "-rotate-90",
|
|
14296
|
+
top: towardEdge ? "-rotate-90" : "rotate-90"
|
|
14297
|
+
}[edge];
|
|
14289
14298
|
return /* @__PURE__ */ jsx172(
|
|
14290
14299
|
IconButton_default,
|
|
14291
14300
|
{
|
|
@@ -14294,7 +14303,7 @@ var CollapseToggleButton = ({
|
|
|
14294
14303
|
{
|
|
14295
14304
|
className: classNames23(
|
|
14296
14305
|
"transition-transform duration-200 motion-reduce:transition-none",
|
|
14297
|
-
|
|
14306
|
+
rotation
|
|
14298
14307
|
)
|
|
14299
14308
|
}
|
|
14300
14309
|
),
|
|
@@ -15343,7 +15352,7 @@ var DropdownButton_default = DropdownButton;
|
|
|
15343
15352
|
import classNames28 from "classnames";
|
|
15344
15353
|
import { Fragment as Fragment10, jsx as jsx177 } from "react/jsx-runtime";
|
|
15345
15354
|
var Tooltip = ({
|
|
15346
|
-
text,
|
|
15355
|
+
text: text2,
|
|
15347
15356
|
delay = 500,
|
|
15348
15357
|
position = "top",
|
|
15349
15358
|
variant = "surface",
|
|
@@ -15353,11 +15362,11 @@ var Tooltip = ({
|
|
|
15353
15362
|
wrapperClassName,
|
|
15354
15363
|
children
|
|
15355
15364
|
}) => {
|
|
15356
|
-
if (!
|
|
15365
|
+
if (!text2) return /* @__PURE__ */ jsx177(Fragment10, { children });
|
|
15357
15366
|
return /* @__PURE__ */ jsx177(
|
|
15358
15367
|
TooltipWrapper_default,
|
|
15359
15368
|
{
|
|
15360
|
-
text,
|
|
15369
|
+
text: text2,
|
|
15361
15370
|
delay,
|
|
15362
15371
|
position,
|
|
15363
15372
|
variant,
|
|
@@ -15708,9 +15717,9 @@ var InputOtp = forwardRef151(function InputOtp2({
|
|
|
15708
15717
|
[integerOnly]
|
|
15709
15718
|
);
|
|
15710
15719
|
const distribute = useCallback4(
|
|
15711
|
-
(start,
|
|
15720
|
+
(start, text2) => {
|
|
15712
15721
|
const at = Math.min(start, current.length);
|
|
15713
|
-
const clean = [...
|
|
15722
|
+
const clean = [...text2].filter((char) => isAllowed(char)).slice(0, clampedLength - at);
|
|
15714
15723
|
if (!clean.length) return;
|
|
15715
15724
|
const next = [...chars];
|
|
15716
15725
|
clean.forEach((char, j) => {
|
|
@@ -19909,7 +19918,7 @@ var Checkbox = forwardRef157(
|
|
|
19909
19918
|
children: description
|
|
19910
19919
|
}
|
|
19911
19920
|
) : null;
|
|
19912
|
-
const
|
|
19921
|
+
const text2 = label || descriptionNode ? /* @__PURE__ */ jsxs87(
|
|
19913
19922
|
"span",
|
|
19914
19923
|
{
|
|
19915
19924
|
className: classNames41(
|
|
@@ -19963,7 +19972,7 @@ var Checkbox = forwardRef157(
|
|
|
19963
19972
|
),
|
|
19964
19973
|
children: [
|
|
19965
19974
|
control,
|
|
19966
|
-
|
|
19975
|
+
text2
|
|
19967
19976
|
]
|
|
19968
19977
|
}
|
|
19969
19978
|
),
|
|
@@ -22477,7 +22486,8 @@ var PageHeader = ({
|
|
|
22477
22486
|
className = "",
|
|
22478
22487
|
...rest
|
|
22479
22488
|
}) => {
|
|
22480
|
-
const
|
|
22489
|
+
const plain = variant === "none" || variant === "plain";
|
|
22490
|
+
const sharedSurface = !plain && variant !== "default" && variant !== "floating" && variant !== "floating-glass";
|
|
22481
22491
|
const surface = variant === "floating" || variant === "floating-glass" ? getSidebarSurfaceTokens(variant, accentColor) : null;
|
|
22482
22492
|
const pair = surface ? "xs" : "none";
|
|
22483
22493
|
const gutter = {
|
|
@@ -22503,7 +22513,7 @@ var PageHeader = ({
|
|
|
22503
22513
|
surface.border,
|
|
22504
22514
|
surface.shadow,
|
|
22505
22515
|
surface.fill
|
|
22506
|
-
) : !sharedSurface && classNames53("border-b", SIDE_MENU_HEADER_FILL, SIDE_MENU_HEADER_SEAM),
|
|
22516
|
+
) : !sharedSurface && !plain && classNames53("border-b", SIDE_MENU_HEADER_FILL, SIDE_MENU_HEADER_SEAM),
|
|
22507
22517
|
className
|
|
22508
22518
|
),
|
|
22509
22519
|
children: [
|
|
@@ -23335,7 +23345,7 @@ var safeHref = (href) => {
|
|
|
23335
23345
|
if (/^#[^\s"'<>]*$/.test(h)) return h;
|
|
23336
23346
|
return null;
|
|
23337
23347
|
};
|
|
23338
|
-
var inline = (
|
|
23348
|
+
var inline = (text2) => text2.replace(/`([^`]+)`/g, (_m, c) => `<code class="rounded bg-black/10 px-1 py-0.5 font-mono text-[0.85em] dark:bg-white/10">${c}</code>`).replace(/\*\*([^*\n]+)\*\*/g, (_m, c) => `<strong>${c}</strong>`).replace(/(^|[^*])\*([^*\n]+)\*/g, (_m, p, c) => `${p}<em>${c}</em>`).replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, (_m, t, h) => {
|
|
23339
23349
|
const href = safeHref(h);
|
|
23340
23350
|
if (!href) return t;
|
|
23341
23351
|
return `<a href="${href}" target="_blank" rel="noopener noreferrer" class="text-blue-600 underline underline-offset-2 dark:text-blue-400">${t}</a>`;
|
|
@@ -23679,8 +23689,8 @@ var Chat2 = ({
|
|
|
23679
23689
|
fail(err);
|
|
23680
23690
|
}
|
|
23681
23691
|
};
|
|
23682
|
-
const send = async (
|
|
23683
|
-
const content =
|
|
23692
|
+
const send = async (text2) => {
|
|
23693
|
+
const content = text2.trim();
|
|
23684
23694
|
if (!content || streaming) return;
|
|
23685
23695
|
setDraft("");
|
|
23686
23696
|
let chatId = activeIdRef.current;
|
|
@@ -24149,7 +24159,7 @@ var ChatRow = ({
|
|
|
24149
24159
|
onMenu,
|
|
24150
24160
|
menuRef
|
|
24151
24161
|
}) => {
|
|
24152
|
-
const [
|
|
24162
|
+
const [text2, setText] = useState28(chat.title);
|
|
24153
24163
|
if (renaming) {
|
|
24154
24164
|
return /* @__PURE__ */ jsx206(
|
|
24155
24165
|
Input_default,
|
|
@@ -24157,13 +24167,13 @@ var ChatRow = ({
|
|
|
24157
24167
|
size: "sm",
|
|
24158
24168
|
autoFocus: true,
|
|
24159
24169
|
className: "my-0.5",
|
|
24160
|
-
value:
|
|
24170
|
+
value: text2,
|
|
24161
24171
|
onChange: (event) => setText(event.target.value),
|
|
24162
24172
|
onKeyDown: (event) => {
|
|
24163
|
-
if (event.key === "Enter") onRenamed(
|
|
24173
|
+
if (event.key === "Enter") onRenamed(text2 || chat.title);
|
|
24164
24174
|
if (event.key === "Escape") onCancelRename();
|
|
24165
24175
|
},
|
|
24166
|
-
onBlur: () => onRenamed(
|
|
24176
|
+
onBlur: () => onRenamed(text2 || chat.title)
|
|
24167
24177
|
}
|
|
24168
24178
|
);
|
|
24169
24179
|
}
|
|
@@ -24200,17 +24210,17 @@ var FolderInput = ({
|
|
|
24200
24210
|
onDone,
|
|
24201
24211
|
onCancel
|
|
24202
24212
|
}) => {
|
|
24203
|
-
const [
|
|
24213
|
+
const [text2, setText] = useState28(initial);
|
|
24204
24214
|
return /* @__PURE__ */ jsx206(
|
|
24205
24215
|
Input_default,
|
|
24206
24216
|
{
|
|
24207
24217
|
size: "sm",
|
|
24208
24218
|
autoFocus: true,
|
|
24209
24219
|
placeholder: "Folder name",
|
|
24210
|
-
value:
|
|
24220
|
+
value: text2,
|
|
24211
24221
|
onChange: (event) => setText(event.target.value),
|
|
24212
24222
|
onKeyDown: (event) => {
|
|
24213
|
-
if (event.key === "Enter") onDone(
|
|
24223
|
+
if (event.key === "Enter") onDone(text2);
|
|
24214
24224
|
if (event.key === "Escape") onCancel();
|
|
24215
24225
|
}
|
|
24216
24226
|
}
|
|
@@ -30603,10 +30613,10 @@ function PieSeries(props) {
|
|
|
30603
30613
|
const lp = Math.max(1e-3, fracs[lb.index] ?? 0);
|
|
30604
30614
|
const size = 11 * lp;
|
|
30605
30615
|
if (size < 2) return;
|
|
30606
|
-
const
|
|
30616
|
+
const text2 = pctLabel(lb.pct * lp);
|
|
30607
30617
|
c.globalAlpha = lp;
|
|
30608
30618
|
c.font = `600 ${size}px sans-serif`;
|
|
30609
|
-
const w =
|
|
30619
|
+
const w = text2.length * size * 0.58 + 12 * lp;
|
|
30610
30620
|
const h = 17 * lp;
|
|
30611
30621
|
c.fillStyle = shadeColor(lb.color, 0.45);
|
|
30612
30622
|
if (typeof c.roundRect === "function") {
|
|
@@ -30617,7 +30627,7 @@ function PieSeries(props) {
|
|
|
30617
30627
|
c.fillRect(lb.x - w / 2, lb.y - h / 2, w, h);
|
|
30618
30628
|
}
|
|
30619
30629
|
c.fillStyle = "#fff";
|
|
30620
|
-
c.fillText(
|
|
30630
|
+
c.fillText(text2, lb.x, lb.y + 0.5);
|
|
30621
30631
|
c.globalAlpha = 1;
|
|
30622
30632
|
});
|
|
30623
30633
|
c.restore();
|
|
@@ -30677,8 +30687,8 @@ function PieSeries(props) {
|
|
|
30677
30687
|
const lp = Math.max(1e-3, fracs[lb.index] ?? 0);
|
|
30678
30688
|
const size = 11 * lp;
|
|
30679
30689
|
if (size < 2) return null;
|
|
30680
|
-
const
|
|
30681
|
-
const w =
|
|
30690
|
+
const text2 = pctLabel(lb.pct * lp);
|
|
30691
|
+
const w = text2.length * size * 0.58 + 12 * lp;
|
|
30682
30692
|
const h = 17 * lp;
|
|
30683
30693
|
return /* @__PURE__ */ jsxs107("g", { opacity: lp, pointerEvents: "none", children: [
|
|
30684
30694
|
/* @__PURE__ */ jsx214(
|
|
@@ -30702,7 +30712,7 @@ function PieSeries(props) {
|
|
|
30702
30712
|
fontSize: size,
|
|
30703
30713
|
fontWeight: 600,
|
|
30704
30714
|
fill: "#fff",
|
|
30705
|
-
children:
|
|
30715
|
+
children: text2
|
|
30706
30716
|
}
|
|
30707
30717
|
)
|
|
30708
30718
|
] }, lb.index);
|
|
@@ -31014,8 +31024,8 @@ function CandlestickSeries(props) {
|
|
|
31014
31024
|
}
|
|
31015
31025
|
if (hovered && hoverItem) {
|
|
31016
31026
|
const up = hovered.direction !== "down";
|
|
31017
|
-
const
|
|
31018
|
-
const w =
|
|
31027
|
+
const text2 = String(Math.round(hoverItem.value * 10) / 10);
|
|
31028
|
+
const w = text2.length * 6.4 + 12;
|
|
31019
31029
|
const h = 17;
|
|
31020
31030
|
const top = hovered.highY - 8 - h;
|
|
31021
31031
|
c.fillStyle = shadeColor(up ? upColor : downColor, 0.45);
|
|
@@ -31024,7 +31034,7 @@ function CandlestickSeries(props) {
|
|
|
31024
31034
|
c.font = "600 11px sans-serif";
|
|
31025
31035
|
c.textAlign = "center";
|
|
31026
31036
|
c.textBaseline = "middle";
|
|
31027
|
-
c.fillText(
|
|
31037
|
+
c.fillText(text2, hovered.x, top + h / 2);
|
|
31028
31038
|
}
|
|
31029
31039
|
c.restore();
|
|
31030
31040
|
};
|
|
@@ -31162,8 +31172,8 @@ function CandlestickSeries(props) {
|
|
|
31162
31172
|
highlightOn && hoveredIndex >= 0 && hoverItem && (() => {
|
|
31163
31173
|
const k = candles[hoveredIndex];
|
|
31164
31174
|
const up = k.direction !== "down";
|
|
31165
|
-
const
|
|
31166
|
-
const w =
|
|
31175
|
+
const text2 = String(Math.round(hoverItem.value * 10) / 10);
|
|
31176
|
+
const w = text2.length * 6.4 + 12;
|
|
31167
31177
|
const h = 17;
|
|
31168
31178
|
const top = k.highY - 8 - h;
|
|
31169
31179
|
return /* @__PURE__ */ jsxs108("g", { pointerEvents: "none", children: [
|
|
@@ -31188,7 +31198,7 @@ function CandlestickSeries(props) {
|
|
|
31188
31198
|
fontSize: 11,
|
|
31189
31199
|
fontWeight: 600,
|
|
31190
31200
|
fill: "#fff",
|
|
31191
|
-
children:
|
|
31201
|
+
children: text2
|
|
31192
31202
|
}
|
|
31193
31203
|
)
|
|
31194
31204
|
] });
|
|
@@ -33552,7 +33562,7 @@ function DataLabels(props = {}) {
|
|
|
33552
33562
|
};
|
|
33553
33563
|
return /* @__PURE__ */ jsxs119("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: [
|
|
33554
33564
|
endpoints.map((ep) => {
|
|
33555
|
-
const
|
|
33565
|
+
const text2 = props.formatter ? props.formatter(ep.value, ep.name) : formatSI(ep.value);
|
|
33556
33566
|
const renderPoint = {
|
|
33557
33567
|
seriesId: ep.id,
|
|
33558
33568
|
seriesName: ep.name,
|
|
@@ -33562,7 +33572,7 @@ function DataLabels(props = {}) {
|
|
|
33562
33572
|
y: ep.y,
|
|
33563
33573
|
isLast: true
|
|
33564
33574
|
};
|
|
33565
|
-
const w =
|
|
33575
|
+
const w = text2.length * 7 + 14;
|
|
33566
33576
|
const bx = props.anchor === "margin-left" ? Math.max(2, area2.x - w - 6) : Math.min(width - w - 2, ep.x + 10);
|
|
33567
33577
|
const by = Math.max(2, Math.min(ep.y - PILL_H / 2, height - PILL_H - 2));
|
|
33568
33578
|
if (props.render) {
|
|
@@ -33586,14 +33596,14 @@ function DataLabels(props = {}) {
|
|
|
33586
33596
|
background: ep.color,
|
|
33587
33597
|
color: "#ffffff"
|
|
33588
33598
|
},
|
|
33589
|
-
children:
|
|
33599
|
+
children: text2
|
|
33590
33600
|
},
|
|
33591
33601
|
ep.id
|
|
33592
33602
|
);
|
|
33593
33603
|
}),
|
|
33594
33604
|
pieSlices.map((sl) => {
|
|
33595
|
-
const
|
|
33596
|
-
const w =
|
|
33605
|
+
const text2 = props.formatter ? props.formatter(sl.value, sl.name) : formatSI(sl.value);
|
|
33606
|
+
const w = text2.length * 7 + 14;
|
|
33597
33607
|
const bx = Math.max(2, Math.min(width - w - 2, sl.x - w / 2));
|
|
33598
33608
|
const by = Math.max(2, Math.min(height - PILL_H - 2, sl.y - PILL_H / 2));
|
|
33599
33609
|
if (props.render) {
|
|
@@ -33618,7 +33628,7 @@ function DataLabels(props = {}) {
|
|
|
33618
33628
|
background: shadeColor(sl.color, 0.45),
|
|
33619
33629
|
color: "#ffffff"
|
|
33620
33630
|
},
|
|
33621
|
-
children:
|
|
33631
|
+
children: text2
|
|
33622
33632
|
},
|
|
33623
33633
|
sl.key
|
|
33624
33634
|
);
|
|
@@ -35760,7 +35770,7 @@ var GlassBackground_default = GlassBackground;
|
|
|
35760
35770
|
import { useEffect as useEffect38, useRef as useRef36, useState as useState33 } from "react";
|
|
35761
35771
|
import { jsx as jsx238 } from "react/jsx-runtime";
|
|
35762
35772
|
var TruncatedText = ({
|
|
35763
|
-
text,
|
|
35773
|
+
text: text2,
|
|
35764
35774
|
className,
|
|
35765
35775
|
delay = 2e3,
|
|
35766
35776
|
as: Tag = "div",
|
|
@@ -35779,11 +35789,11 @@ var TruncatedText = ({
|
|
|
35779
35789
|
observer.observe(el);
|
|
35780
35790
|
check();
|
|
35781
35791
|
return () => observer.disconnect();
|
|
35782
|
-
}, [
|
|
35792
|
+
}, [text2]);
|
|
35783
35793
|
const inner = /* @__PURE__ */ jsx238(
|
|
35784
35794
|
TooltipWrapper_default,
|
|
35785
35795
|
{
|
|
35786
|
-
text: truncated ?
|
|
35796
|
+
text: truncated ? text2 : void 0,
|
|
35787
35797
|
delay,
|
|
35788
35798
|
position: tooltipPosition,
|
|
35789
35799
|
children: /* @__PURE__ */ jsx238(
|
|
@@ -35798,7 +35808,7 @@ var TruncatedText = ({
|
|
|
35798
35808
|
truncated && "rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",
|
|
35799
35809
|
className
|
|
35800
35810
|
].filter(Boolean).join(" "),
|
|
35801
|
-
children:
|
|
35811
|
+
children: text2
|
|
35802
35812
|
}
|
|
35803
35813
|
)
|
|
35804
35814
|
}
|
|
@@ -35874,18 +35884,18 @@ function normaliseValue(value, boolWords) {
|
|
|
35874
35884
|
return { display: null, copyText: null, isEmpty: true };
|
|
35875
35885
|
}
|
|
35876
35886
|
if (typeof value === "boolean") {
|
|
35877
|
-
const
|
|
35878
|
-
return { display:
|
|
35887
|
+
const text2 = value ? boolWords.yes : boolWords.no;
|
|
35888
|
+
return { display: text2, copyText: text2, isEmpty: false };
|
|
35879
35889
|
}
|
|
35880
35890
|
if (typeof value === "string" || typeof value === "number") {
|
|
35881
35891
|
return { display: value, copyText: String(value), isEmpty: false };
|
|
35882
35892
|
}
|
|
35883
35893
|
return { display: value, copyText: null, isEmpty: false };
|
|
35884
35894
|
}
|
|
35885
|
-
async function writeClipboard(
|
|
35895
|
+
async function writeClipboard(text2) {
|
|
35886
35896
|
try {
|
|
35887
35897
|
if (!navigator.clipboard?.writeText) return false;
|
|
35888
|
-
await navigator.clipboard.writeText(
|
|
35898
|
+
await navigator.clipboard.writeText(text2);
|
|
35889
35899
|
return true;
|
|
35890
35900
|
} catch {
|
|
35891
35901
|
return false;
|
|
@@ -35918,7 +35928,7 @@ var InfoRowBody = ({
|
|
|
35918
35928
|
rootProps
|
|
35919
35929
|
}) => {
|
|
35920
35930
|
const t = useKitT();
|
|
35921
|
-
const
|
|
35931
|
+
const text2 = useSurfaceText();
|
|
35922
35932
|
const [copyState, setCopyState] = useState34("idle");
|
|
35923
35933
|
const [dismissed, setDismissed] = useState34(false);
|
|
35924
35934
|
const [truncated, setTruncated] = useState34(false);
|
|
@@ -35956,7 +35966,7 @@ var InfoRowBody = ({
|
|
|
35956
35966
|
}, [canTooltip]);
|
|
35957
35967
|
const loaderInk = `bg-${rowTone}-500/20 dark:bg-${rowTone}-500/25`;
|
|
35958
35968
|
const loaderText = `text-${rowTone}-500 dark:text-${rowTone}-400`;
|
|
35959
|
-
const valueColorClass = hasError ? "text-rose-600 dark:text-rose-400" : isEmpty2 ?
|
|
35969
|
+
const valueColorClass = hasError ? "text-rose-600 dark:text-rose-400" : isEmpty2 ? text2.muted : text2.body;
|
|
35960
35970
|
const valueSpan = (
|
|
35961
35971
|
// The truncated value is the tooltip's anchor: focusable (with a
|
|
35962
35972
|
// focus-visible ring) only when there is a tooltip to reveal, so
|
|
@@ -36000,7 +36010,7 @@ var InfoRowBody = ({
|
|
|
36000
36010
|
// `!copied` so the confirmation wash is never racing the hover wash for
|
|
36001
36011
|
// the same property.
|
|
36002
36012
|
hoverable && copyState === "idle" && trigger.hover,
|
|
36003
|
-
!noBorder && !hoverable && `border-b ${
|
|
36013
|
+
!noBorder && !hoverable && `border-b ${text2.divider} last:border-0`,
|
|
36004
36014
|
copyState === "copied" && "bg-emerald-500/10",
|
|
36005
36015
|
copyState === "failed" && "bg-rose-500/10",
|
|
36006
36016
|
className
|
|
@@ -36012,7 +36022,7 @@ var InfoRowBody = ({
|
|
|
36012
36022
|
{
|
|
36013
36023
|
className: classNames60(
|
|
36014
36024
|
labelTokens.text,
|
|
36015
|
-
!hasTextColor(labelClassName) &&
|
|
36025
|
+
!hasTextColor(labelClassName) && text2.muted,
|
|
36016
36026
|
useSmartLayout ? "shrink-0 min-w-0 max-w-[30%] truncate" : `grow shrink-0 ${labelWidth ?? tokens.defaultLabelWidth}`,
|
|
36017
36027
|
labelClassName
|
|
36018
36028
|
),
|
|
@@ -36333,7 +36343,7 @@ var PagedPanelBody = ({
|
|
|
36333
36343
|
onPrev,
|
|
36334
36344
|
onNext
|
|
36335
36345
|
}) => {
|
|
36336
|
-
const
|
|
36346
|
+
const text2 = useSurfaceText();
|
|
36337
36347
|
const t = useKitT();
|
|
36338
36348
|
const tokens = SIZE_TOKENS2[size] ?? SIZE_TOKENS2.md;
|
|
36339
36349
|
const emptySize = PANE_EMPTY_STATE_SIZE[size] ?? PANE_EMPTY_STATE_SIZE.md;
|
|
@@ -36346,7 +36356,7 @@ var PagedPanelBody = ({
|
|
|
36346
36356
|
className: classNames62(
|
|
36347
36357
|
"flex items-center gap-2 border-b",
|
|
36348
36358
|
tokens.pad,
|
|
36349
|
-
|
|
36359
|
+
text2.divider
|
|
36350
36360
|
),
|
|
36351
36361
|
children: [
|
|
36352
36362
|
/* @__PURE__ */ jsx241("div", { className: "shrink-0", children: showNav && /* @__PURE__ */ jsx241(
|
|
@@ -36369,7 +36379,7 @@ var PagedPanelBody = ({
|
|
|
36369
36379
|
className: classNames62(
|
|
36370
36380
|
"font-semibold leading-snug truncate",
|
|
36371
36381
|
tokens.title,
|
|
36372
|
-
|
|
36382
|
+
text2.heading
|
|
36373
36383
|
),
|
|
36374
36384
|
children: resolvedTitle
|
|
36375
36385
|
}
|
|
@@ -36380,7 +36390,7 @@ var PagedPanelBody = ({
|
|
|
36380
36390
|
className: classNames62(
|
|
36381
36391
|
"mt-0.5 truncate",
|
|
36382
36392
|
tokens.subtitle,
|
|
36383
|
-
|
|
36393
|
+
text2.muted
|
|
36384
36394
|
),
|
|
36385
36395
|
children: subtitle
|
|
36386
36396
|
}
|
|
@@ -36395,7 +36405,7 @@ var PagedPanelBody = ({
|
|
|
36395
36405
|
className: classNames62(
|
|
36396
36406
|
"mt-0.5 tabular-nums",
|
|
36397
36407
|
tokens.counter,
|
|
36398
|
-
|
|
36408
|
+
text2.muted
|
|
36399
36409
|
),
|
|
36400
36410
|
children: [
|
|
36401
36411
|
current + 1,
|
|
@@ -37469,7 +37479,7 @@ var HelpBody = ({
|
|
|
37469
37479
|
};
|
|
37470
37480
|
var CollapsibleHelpText = ({
|
|
37471
37481
|
title,
|
|
37472
|
-
text,
|
|
37482
|
+
text: text2,
|
|
37473
37483
|
maxLength = 160,
|
|
37474
37484
|
showIcon = false,
|
|
37475
37485
|
icon = "Help",
|
|
@@ -37489,7 +37499,7 @@ var CollapsibleHelpText = ({
|
|
|
37489
37499
|
}) => {
|
|
37490
37500
|
const [expanded, setExpanded] = useState40(false);
|
|
37491
37501
|
const regionId = useId27();
|
|
37492
|
-
const sanitized =
|
|
37502
|
+
const sanitized = text2?.trim() ?? "";
|
|
37493
37503
|
const needsTruncation = sanitized.length > maxLength;
|
|
37494
37504
|
const displayText = expanded || !needsTruncation ? sanitized : truncate(sanitized, maxLength);
|
|
37495
37505
|
const toneTokens3 = getCollapsibleHelpToneTokens(tone);
|
|
@@ -38811,7 +38821,7 @@ var DatePicker = forwardRef160(
|
|
|
38811
38821
|
setViewDate(getViewDate(currentValue, constraints));
|
|
38812
38822
|
}
|
|
38813
38823
|
}, [currentValue, constraints]);
|
|
38814
|
-
const [
|
|
38824
|
+
const [text2, setText] = useState44(() => formatValue(initialValue, format2));
|
|
38815
38825
|
const [textInvalid, setTextInvalid] = useState44(false);
|
|
38816
38826
|
const [focused, setFocused] = useState44(false);
|
|
38817
38827
|
const focusedRef = useRef43(false);
|
|
@@ -38968,7 +38978,7 @@ var DatePicker = forwardRef160(
|
|
|
38968
38978
|
}
|
|
38969
38979
|
if (event.key === "Enter") {
|
|
38970
38980
|
const parsed = parseValueText(
|
|
38971
|
-
|
|
38981
|
+
text2,
|
|
38972
38982
|
selectionMode,
|
|
38973
38983
|
format2,
|
|
38974
38984
|
/* @__PURE__ */ new Date(),
|
|
@@ -39193,7 +39203,7 @@ var DatePicker = forwardRef160(
|
|
|
39193
39203
|
readOnly: readonly,
|
|
39194
39204
|
inputMode: "none",
|
|
39195
39205
|
autoComplete: "off",
|
|
39196
|
-
value:
|
|
39206
|
+
value: text2,
|
|
39197
39207
|
onChange: handleTextChange,
|
|
39198
39208
|
onFocus: (event) => {
|
|
39199
39209
|
focusedRef.current = true;
|
|
@@ -42985,6 +42995,21 @@ import React60, {
|
|
|
42985
42995
|
useRef as useRef51,
|
|
42986
42996
|
useState as useState52
|
|
42987
42997
|
} from "react";
|
|
42998
|
+
|
|
42999
|
+
// ../common/theme/noise.ts
|
|
43000
|
+
var NOISE_BACKGROUND_IMAGE = `url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`;
|
|
43001
|
+
var LIGHT = "mix-blend-multiply opacity-[0.08]";
|
|
43002
|
+
var DARK = "mix-blend-overlay opacity-[0.4]";
|
|
43003
|
+
function getNoiseBlendClasses(scheme = "auto") {
|
|
43004
|
+
if (scheme === "light") return LIGHT;
|
|
43005
|
+
if (scheme === "dark") return DARK;
|
|
43006
|
+
return `${LIGHT} dark:mix-blend-overlay dark:opacity-[0.4]`;
|
|
43007
|
+
}
|
|
43008
|
+
function getNoiseBackgroundSize(scale) {
|
|
43009
|
+
return scale !== void 0 && Number.isFinite(scale) && scale > 0 ? `${200 * scale}px ${200 * scale}px` : void 0;
|
|
43010
|
+
}
|
|
43011
|
+
|
|
43012
|
+
// src/components/SideMenu.tsx
|
|
42988
43013
|
import { Fragment as Fragment33, jsx as jsx259, jsxs as jsxs146 } from "react/jsx-runtime";
|
|
42989
43014
|
var EMPTY_VIEW_OPTIONS = [];
|
|
42990
43015
|
var NOISE_STYLE = {
|
|
@@ -43329,6 +43354,7 @@ var SideMenu = ({
|
|
|
43329
43354
|
footerDetails,
|
|
43330
43355
|
footerDetailsTone,
|
|
43331
43356
|
noise = false,
|
|
43357
|
+
noiseScale,
|
|
43332
43358
|
loading = false,
|
|
43333
43359
|
loaderType = "skeleton",
|
|
43334
43360
|
loaderTitle,
|
|
@@ -43979,7 +44005,8 @@ var SideMenu = ({
|
|
|
43979
44005
|
"div",
|
|
43980
44006
|
{
|
|
43981
44007
|
className: `absolute inset-0 opacity-[0.4] pointer-events-none mix-blend-overlay ${surface.radius}`,
|
|
43982
|
-
|
|
44008
|
+
"data-sidemenu-noise": true,
|
|
44009
|
+
style: { ...NOISE_STYLE, backgroundSize: getNoiseBackgroundSize(noiseScale) }
|
|
43983
44010
|
}
|
|
43984
44011
|
),
|
|
43985
44012
|
/* @__PURE__ */ jsx259(
|
|
@@ -44331,18 +44358,6 @@ import {
|
|
|
44331
44358
|
useState as useState55
|
|
44332
44359
|
} from "react";
|
|
44333
44360
|
import classNames80 from "classnames";
|
|
44334
|
-
|
|
44335
|
-
// ../common/theme/noise.ts
|
|
44336
|
-
var NOISE_BACKGROUND_IMAGE = `url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`;
|
|
44337
|
-
var LIGHT = "mix-blend-multiply opacity-[0.08]";
|
|
44338
|
-
var DARK = "mix-blend-overlay opacity-[0.4]";
|
|
44339
|
-
function getNoiseBlendClasses(scheme = "auto") {
|
|
44340
|
-
if (scheme === "light") return LIGHT;
|
|
44341
|
-
if (scheme === "dark") return DARK;
|
|
44342
|
-
return `${LIGHT} dark:mix-blend-overlay dark:opacity-[0.4]`;
|
|
44343
|
-
}
|
|
44344
|
-
|
|
44345
|
-
// src/components/SidePanel.tsx
|
|
44346
44361
|
import { Fragment as Fragment36, jsx as jsx263, jsxs as jsxs148 } from "react/jsx-runtime";
|
|
44347
44362
|
var LEGACY_PANEL_VARIANTS = {
|
|
44348
44363
|
sidebar: "elevated",
|
|
@@ -44352,20 +44367,46 @@ var LEGACY_PANEL_VARIANTS = {
|
|
|
44352
44367
|
};
|
|
44353
44368
|
var resolvePanelVariant2 = (variant) => variant in LEGACY_PANEL_VARIANTS ? LEGACY_PANEL_VARIANTS[variant] : variant;
|
|
44354
44369
|
var getSidePanelTextTokens = (variant) => getSurfaceTextTokens(resolvePanelVariant2(variant));
|
|
44355
|
-
var
|
|
44370
|
+
var INSET_GAP = {
|
|
44371
|
+
xs: { x: "inset-x-1", y: "inset-y-1", px: "px-1", py: "py-1" },
|
|
44372
|
+
sm: { x: "inset-x-2", y: "inset-y-2", px: "px-2", py: "py-2" },
|
|
44373
|
+
md: { x: "inset-x-4", y: "inset-y-4", px: "px-4", py: "py-4" },
|
|
44374
|
+
lg: { x: "inset-x-6", y: "inset-y-6", px: "px-6", py: "py-6" },
|
|
44375
|
+
xl: { x: "inset-x-8", y: "inset-y-8", px: "px-8", py: "py-8" }
|
|
44376
|
+
};
|
|
44377
|
+
var INSET_BORDER = {
|
|
44378
|
+
right: "border-y border-l",
|
|
44379
|
+
left: "border-y border-r",
|
|
44380
|
+
top: "border-x border-b",
|
|
44381
|
+
bottom: "border-x border-t"
|
|
44382
|
+
};
|
|
44383
|
+
var FLUSH_BORDER = {
|
|
44384
|
+
right: "border-l",
|
|
44385
|
+
left: "border-r",
|
|
44386
|
+
top: "border-b",
|
|
44387
|
+
bottom: "border-t"
|
|
44388
|
+
};
|
|
44389
|
+
var BAR_INSET = {
|
|
44390
|
+
none: { x: "inset-x-0", y: "inset-y-0" },
|
|
44391
|
+
rounded: { x: "inset-x-1", y: "inset-y-1" },
|
|
44392
|
+
"rounded-sm": { x: "inset-x-2", y: "inset-y-2" },
|
|
44393
|
+
"rounded-md": { x: "inset-x-4", y: "inset-y-4" },
|
|
44394
|
+
"rounded-lg": { x: "inset-x-6", y: "inset-y-6" },
|
|
44395
|
+
"rounded-xl": { x: "inset-x-8", y: "inset-y-8" }
|
|
44396
|
+
};
|
|
44356
44397
|
var INNER_CORNER = {
|
|
44357
44398
|
// (`"auto"` is absent by design: SidePanel's own default is `rounded`, and
|
|
44358
44399
|
// corner lookups below resolve it to the theme default.)
|
|
44359
|
-
none: { right: "", left: "" },
|
|
44360
|
-
rounded: { right: "rounded-l-sm", left: "rounded-r-sm" },
|
|
44361
|
-
"rounded-sm": { right: "rounded-l-lg", left: "rounded-r-lg" },
|
|
44362
|
-
"rounded-md": { right: "rounded-l-2xl", left: "rounded-r-2xl" },
|
|
44363
|
-
"rounded-lg": { right: "rounded-l-3xl", left: "rounded-r-3xl" },
|
|
44364
|
-
"rounded-xl": { right: "rounded-l-4xl", left: "rounded-r-4xl" }
|
|
44365
|
-
};
|
|
44366
|
-
var SIDE_PANEL_SIDES = ["left", "right"];
|
|
44367
|
-
var OPEN_DURATION_MS =
|
|
44368
|
-
var OPEN_EASING =
|
|
44400
|
+
none: { right: "", left: "", top: "", bottom: "" },
|
|
44401
|
+
rounded: { right: "rounded-l-sm", left: "rounded-r-sm", top: "rounded-b-sm", bottom: "rounded-t-sm" },
|
|
44402
|
+
"rounded-sm": { right: "rounded-l-lg", left: "rounded-r-lg", top: "rounded-b-lg", bottom: "rounded-t-lg" },
|
|
44403
|
+
"rounded-md": { right: "rounded-l-2xl", left: "rounded-r-2xl", top: "rounded-b-2xl", bottom: "rounded-t-2xl" },
|
|
44404
|
+
"rounded-lg": { right: "rounded-l-3xl", left: "rounded-r-3xl", top: "rounded-b-3xl", bottom: "rounded-t-3xl" },
|
|
44405
|
+
"rounded-xl": { right: "rounded-l-4xl", left: "rounded-r-4xl", top: "rounded-b-4xl", bottom: "rounded-t-4xl" }
|
|
44406
|
+
};
|
|
44407
|
+
var SIDE_PANEL_SIDES = ["left", "right", "top", "bottom"];
|
|
44408
|
+
var OPEN_DURATION_MS = PANEL_SLIDE_DURATION_MS;
|
|
44409
|
+
var OPEN_EASING = PANEL_SLIDE_EASING;
|
|
44369
44410
|
var SIZE_TOKENS4 = {
|
|
44370
44411
|
xs: {
|
|
44371
44412
|
pad: "px-2 py-1.5",
|
|
@@ -44406,6 +44447,9 @@ var SidePanel = ({
|
|
|
44406
44447
|
subtitle,
|
|
44407
44448
|
icon,
|
|
44408
44449
|
width = 420,
|
|
44450
|
+
height = 240,
|
|
44451
|
+
minHeight = 120,
|
|
44452
|
+
maxHeight = 600,
|
|
44409
44453
|
headerActions,
|
|
44410
44454
|
footer,
|
|
44411
44455
|
children,
|
|
@@ -44425,6 +44469,7 @@ var SidePanel = ({
|
|
|
44425
44469
|
side = "right",
|
|
44426
44470
|
overlay = false,
|
|
44427
44471
|
noise = false,
|
|
44472
|
+
noiseScale,
|
|
44428
44473
|
inset,
|
|
44429
44474
|
corner = DEFAULT_SURFACE_CORNER,
|
|
44430
44475
|
collapsible = false,
|
|
@@ -44436,6 +44481,7 @@ var SidePanel = ({
|
|
|
44436
44481
|
}) => {
|
|
44437
44482
|
const t = useKitT();
|
|
44438
44483
|
warnIfMissingTitle("SidePanel", title);
|
|
44484
|
+
const vertical = side === "top" || side === "bottom";
|
|
44439
44485
|
const effectiveTone = tone ?? color ?? "neutral";
|
|
44440
44486
|
const sizeToken = SIZE_TOKENS4[size] ?? SIZE_TOKENS4.md;
|
|
44441
44487
|
const legacyVariant = variant in LEGACY_PANEL_VARIANTS;
|
|
@@ -44449,10 +44495,13 @@ var SidePanel = ({
|
|
|
44449
44495
|
surfaceTone
|
|
44450
44496
|
);
|
|
44451
44497
|
const surfaceText = getSidePanelTextTokens(variant);
|
|
44452
|
-
const
|
|
44453
|
-
const
|
|
44454
|
-
const
|
|
44455
|
-
const
|
|
44498
|
+
const insetValue = inset ?? surface.offset !== "";
|
|
44499
|
+
const insetSize = insetValue === true ? "md" : insetValue === false || insetValue === "none" ? null : insetValue;
|
|
44500
|
+
const isInset = insetSize !== null;
|
|
44501
|
+
const insetGap = insetSize ? INSET_GAP[insetSize] : null;
|
|
44502
|
+
const cornerClass = docked ? getSurfaceCornerClass(corner) : INNER_CORNER[corner === "auto" ? DEFAULT_SURFACE_CORNER : corner][side];
|
|
44503
|
+
const borderClass = surface.border ? `${surface.border} ${docked ? "border" : isInset ? INSET_BORDER[side] : surface.borderSides === "all" ? "border" : FLUSH_BORDER[side]}` : "";
|
|
44504
|
+
const shadowClass = side === "right" ? surface.shadowRight : surface.shadow;
|
|
44456
44505
|
const [mounted, setMounted] = useState55(isOpen);
|
|
44457
44506
|
const [entered, setEntered] = useState55(isOpen);
|
|
44458
44507
|
const prevOpenRef = useRef52(isOpen);
|
|
@@ -44473,10 +44522,11 @@ var SidePanel = ({
|
|
|
44473
44522
|
}, [mounted, isOpen, entered]);
|
|
44474
44523
|
const handleTransitionEnd = (event) => {
|
|
44475
44524
|
if (event.target !== event.currentTarget) return;
|
|
44476
|
-
if (event.propertyName !== "width") return;
|
|
44525
|
+
if (event.propertyName !== (vertical ? "height" : "width")) return;
|
|
44477
44526
|
if (!isOpen) setMounted(false);
|
|
44478
44527
|
};
|
|
44479
44528
|
const [currentWidth, setCurrentWidth] = useState55(width);
|
|
44529
|
+
const [currentHeight, setCurrentHeight] = useState55(height);
|
|
44480
44530
|
const isDraggingRef = useRef52(false);
|
|
44481
44531
|
const [isDragging, setIsDragging] = useState55(false);
|
|
44482
44532
|
const startXRef = useRef52(0);
|
|
@@ -44484,15 +44534,25 @@ var SidePanel = ({
|
|
|
44484
44534
|
useEffect54(() => {
|
|
44485
44535
|
if (!isDraggingRef.current) setCurrentWidth(width);
|
|
44486
44536
|
}, [width]);
|
|
44537
|
+
useEffect54(() => {
|
|
44538
|
+
if (!isDraggingRef.current) setCurrentHeight(height);
|
|
44539
|
+
}, [height]);
|
|
44487
44540
|
const onMouseDown = useCallback32(
|
|
44488
44541
|
(e) => {
|
|
44489
44542
|
if (!resizable) return;
|
|
44490
44543
|
e.preventDefault();
|
|
44491
44544
|
isDraggingRef.current = true;
|
|
44492
44545
|
setIsDragging(true);
|
|
44493
|
-
startXRef.current = e.clientX;
|
|
44494
|
-
startWidthRef.current = currentWidth;
|
|
44546
|
+
startXRef.current = vertical ? e.clientY : e.clientX;
|
|
44547
|
+
startWidthRef.current = vertical ? currentHeight : currentWidth;
|
|
44495
44548
|
const onMouseMove = (ev) => {
|
|
44549
|
+
if (vertical) {
|
|
44550
|
+
const delta2 = side === "bottom" ? startXRef.current - ev.clientY : ev.clientY - startXRef.current;
|
|
44551
|
+
setCurrentHeight(
|
|
44552
|
+
Math.min(maxHeight, Math.max(minHeight, startWidthRef.current + delta2))
|
|
44553
|
+
);
|
|
44554
|
+
return;
|
|
44555
|
+
}
|
|
44496
44556
|
const delta = side === "right" ? startXRef.current - ev.clientX : ev.clientX - startXRef.current;
|
|
44497
44557
|
const next = Math.min(
|
|
44498
44558
|
maxWidth,
|
|
@@ -44501,7 +44561,7 @@ var SidePanel = ({
|
|
|
44501
44561
|
setCurrentWidth(next);
|
|
44502
44562
|
};
|
|
44503
44563
|
document.body.style.userSelect = "none";
|
|
44504
|
-
document.body.style.cursor = "col-resize";
|
|
44564
|
+
document.body.style.cursor = vertical ? "row-resize" : "col-resize";
|
|
44505
44565
|
const onMouseUp = () => {
|
|
44506
44566
|
isDraggingRef.current = false;
|
|
44507
44567
|
setIsDragging(false);
|
|
@@ -44513,9 +44573,10 @@ var SidePanel = ({
|
|
|
44513
44573
|
window.addEventListener("mousemove", onMouseMove);
|
|
44514
44574
|
window.addEventListener("mouseup", onMouseUp);
|
|
44515
44575
|
},
|
|
44516
|
-
[resizable, currentWidth, minWidth, maxWidth, side]
|
|
44576
|
+
[resizable, vertical, currentWidth, currentHeight, minWidth, maxWidth, minHeight, maxHeight, side]
|
|
44517
44577
|
);
|
|
44518
44578
|
const resolvedWidth = resizable ? currentWidth : width;
|
|
44579
|
+
const resolvedHeight = resizable ? currentHeight : height;
|
|
44519
44580
|
const [internalCollapsed, setInternalCollapsed] = useState55(defaultCollapsed);
|
|
44520
44581
|
const isCollapsed = collapsible && (collapsed ?? internalCollapsed);
|
|
44521
44582
|
const toggleCollapsed = () => {
|
|
@@ -44524,6 +44585,7 @@ var SidePanel = ({
|
|
|
44524
44585
|
onCollapsedChange?.(next);
|
|
44525
44586
|
};
|
|
44526
44587
|
const shellWidth = isCollapsed ? COLLAPSED_RAIL_WIDTH : resolvedWidth;
|
|
44588
|
+
const shellHeight = isCollapsed ? COLLAPSED_RAIL_WIDTH : resolvedHeight;
|
|
44527
44589
|
const collapseButton = (label) => /* @__PURE__ */ jsx263(
|
|
44528
44590
|
CollapseToggleButton,
|
|
44529
44591
|
{
|
|
@@ -44538,39 +44600,38 @@ var SidePanel = ({
|
|
|
44538
44600
|
(e) => {
|
|
44539
44601
|
if (!resizable) return;
|
|
44540
44602
|
const step = 20;
|
|
44541
|
-
const
|
|
44542
|
-
const
|
|
44603
|
+
const growKey = { right: "ArrowLeft", left: "ArrowRight", bottom: "ArrowUp", top: "ArrowDown" }[side];
|
|
44604
|
+
const shrinkKey = { right: "ArrowRight", left: "ArrowLeft", bottom: "ArrowDown", top: "ArrowUp" }[side];
|
|
44605
|
+
const grow = e.key === growKey;
|
|
44606
|
+
const shrink = e.key === shrinkKey;
|
|
44607
|
+
const [min, max, current, set] = vertical ? [minHeight, maxHeight, currentHeight, setCurrentHeight] : [minWidth, maxWidth, currentWidth, setCurrentWidth];
|
|
44543
44608
|
if (e.key === "Home") {
|
|
44544
44609
|
e.preventDefault();
|
|
44545
|
-
|
|
44610
|
+
set(min);
|
|
44546
44611
|
return;
|
|
44547
44612
|
}
|
|
44548
44613
|
if (e.key === "End") {
|
|
44549
44614
|
e.preventDefault();
|
|
44550
|
-
|
|
44615
|
+
set(max);
|
|
44551
44616
|
return;
|
|
44552
44617
|
}
|
|
44553
44618
|
if (!grow && !shrink) return;
|
|
44554
44619
|
e.preventDefault();
|
|
44555
|
-
|
|
44556
|
-
Math.min(
|
|
44557
|
-
maxWidth,
|
|
44558
|
-
Math.max(minWidth, currentWidth + (grow ? step : -step))
|
|
44559
|
-
)
|
|
44560
|
-
);
|
|
44620
|
+
set(Math.min(max, Math.max(min, current + (grow ? step : -step))));
|
|
44561
44621
|
},
|
|
44562
|
-
[resizable, side, currentWidth, minWidth, maxWidth]
|
|
44622
|
+
[resizable, vertical, side, currentWidth, currentHeight, minWidth, maxWidth, minHeight, maxHeight]
|
|
44563
44623
|
);
|
|
44564
44624
|
if (!mounted || docked && !isOpen) return null;
|
|
44565
|
-
const edgeOffset = entered ? shellWidth : 0;
|
|
44625
|
+
const edgeOffset = entered ? vertical ? shellHeight : shellWidth : 0;
|
|
44566
44626
|
const barTone = isDragging ? `opacity-100 bg-${effectiveTone}-500` : `bg-${effectiveTone}-400 opacity-0 group-hover:opacity-70 group-active:opacity-100`;
|
|
44567
|
-
const
|
|
44627
|
+
const gripTone = isDragging ? `opacity-100 bg-${effectiveTone}-500` : `bg-${effectiveTone}-400 opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100`;
|
|
44628
|
+
const edgeProperty = side;
|
|
44568
44629
|
const handleStyle = {
|
|
44569
44630
|
[edgeProperty]: edgeOffset,
|
|
44570
44631
|
transition: isDragging ? void 0 : `${edgeProperty} ${OPEN_DURATION_MS}ms ${OPEN_EASING}, opacity ${OPEN_DURATION_MS}ms ${OPEN_EASING}`
|
|
44571
44632
|
};
|
|
44572
44633
|
const handleParked = isCollapsed;
|
|
44573
|
-
|
|
44634
|
+
const panel = /* @__PURE__ */ jsxs148(Fragment36, { children: [
|
|
44574
44635
|
/* @__PURE__ */ jsxs148(
|
|
44575
44636
|
"div",
|
|
44576
44637
|
{
|
|
@@ -44578,22 +44639,22 @@ var SidePanel = ({
|
|
|
44578
44639
|
"data-sp-shell": true,
|
|
44579
44640
|
"data-collapsed": collapsible ? isCollapsed : void 0,
|
|
44580
44641
|
className: classNames80(
|
|
44581
|
-
docked ? "relative
|
|
44582
|
-
!docked && (
|
|
44583
|
-
|
|
44642
|
+
docked ? classNames80("relative shrink-0 overflow-hidden", vertical ? "w-full" : "h-full") : "absolute z-40 overflow-hidden",
|
|
44643
|
+
!docked && (vertical ? insetGap ? insetGap.x : "left-0 w-full" : insetGap ? insetGap.y : "top-0 h-full"),
|
|
44644
|
+
!docked && { right: "right-0", left: "left-0", top: "top-0", bottom: "bottom-0" }[side],
|
|
44584
44645
|
cornerClass,
|
|
44585
44646
|
legacyVariant && borderClass,
|
|
44586
44647
|
legacyVariant ? shadowClass : panelOuterChrome
|
|
44587
44648
|
),
|
|
44588
44649
|
style: {
|
|
44589
|
-
|
|
44650
|
+
...vertical ? { height: entered ? shellHeight : 0 } : { width: entered ? shellWidth : 0 },
|
|
44590
44651
|
// Inline rather than `transition-[width] duration-… ease-…`: an
|
|
44591
44652
|
// arbitrary easing utility would have to survive the safelist, and
|
|
44592
44653
|
// this curve is not themeable anyway. It decelerates hard at the end,
|
|
44593
44654
|
// which is what stops the panel feeling like it snaps into place.
|
|
44594
44655
|
// Suppressed while resizing so the panel tracks the pointer exactly
|
|
44595
44656
|
// rather than lagging a third of a second behind it.
|
|
44596
|
-
transition: isDragging ? void 0 :
|
|
44657
|
+
transition: isDragging ? void 0 : `${vertical ? "height" : "width"} ${OPEN_DURATION_MS}ms ${OPEN_EASING}`
|
|
44597
44658
|
},
|
|
44598
44659
|
onTransitionEnd: handleTransitionEnd,
|
|
44599
44660
|
children: [
|
|
@@ -44633,7 +44694,7 @@ var SidePanel = ({
|
|
|
44633
44694
|
getNoiseBlendClasses(),
|
|
44634
44695
|
cornerClass
|
|
44635
44696
|
),
|
|
44636
|
-
style: { backgroundImage: NOISE_BACKGROUND_IMAGE }
|
|
44697
|
+
style: { backgroundImage: NOISE_BACKGROUND_IMAGE, backgroundSize: getNoiseBackgroundSize(noiseScale) }
|
|
44637
44698
|
}
|
|
44638
44699
|
),
|
|
44639
44700
|
/* @__PURE__ */ jsxs148(
|
|
@@ -44643,12 +44704,13 @@ var SidePanel = ({
|
|
|
44643
44704
|
inert: isCollapsed || void 0,
|
|
44644
44705
|
"aria-hidden": isCollapsed || void 0,
|
|
44645
44706
|
className: classNames80(
|
|
44646
|
-
"
|
|
44707
|
+
"flex flex-col transition-opacity duration-200 motion-reduce:transition-none",
|
|
44708
|
+
side === "top" ? "absolute inset-x-0 bottom-0" : "relative h-full",
|
|
44647
44709
|
side === "left" && "ml-auto",
|
|
44648
44710
|
isCollapsed && "opacity-0",
|
|
44649
44711
|
className
|
|
44650
44712
|
),
|
|
44651
|
-
style: {
|
|
44713
|
+
style: vertical ? { height: resolvedHeight } : { width: resolvedWidth },
|
|
44652
44714
|
onKeyDown,
|
|
44653
44715
|
children: [
|
|
44654
44716
|
/* @__PURE__ */ jsxs148(
|
|
@@ -44685,7 +44747,9 @@ var SidePanel = ({
|
|
|
44685
44747
|
)
|
|
44686
44748
|
] }),
|
|
44687
44749
|
/* @__PURE__ */ jsxs148("div", { className: "flex shrink-0 items-center gap-1 pt-0.5", children: [
|
|
44688
|
-
collapsible && collapseButton(
|
|
44750
|
+
collapsible && collapseButton(
|
|
44751
|
+
t("kit.sidepanel.collapse")
|
|
44752
|
+
),
|
|
44689
44753
|
headerActions,
|
|
44690
44754
|
onClose && !collapsible && /* @__PURE__ */ jsx263(
|
|
44691
44755
|
IconButton_default,
|
|
@@ -44712,10 +44776,10 @@ var SidePanel = ({
|
|
|
44712
44776
|
{
|
|
44713
44777
|
"data-sp-collapsed": true,
|
|
44714
44778
|
className: classNames80(
|
|
44715
|
-
"absolute
|
|
44716
|
-
side === "right" ? "left-0" : "right-0"
|
|
44779
|
+
"absolute flex items-center gap-3",
|
|
44780
|
+
vertical ? "inset-x-0 top-0 flex-row px-3" : classNames80("inset-y-0 flex-col py-3", side === "right" ? "left-0" : "right-0")
|
|
44717
44781
|
),
|
|
44718
|
-
style: { width: COLLAPSED_RAIL_WIDTH },
|
|
44782
|
+
style: vertical ? { height: COLLAPSED_RAIL_WIDTH } : { width: COLLAPSED_RAIL_WIDTH },
|
|
44719
44783
|
children: [
|
|
44720
44784
|
collapseButton(t("kit.sidepanel.expand")),
|
|
44721
44785
|
(collapsedLabel ?? title) && /* @__PURE__ */ jsx263(
|
|
@@ -44723,7 +44787,8 @@ var SidePanel = ({
|
|
|
44723
44787
|
{
|
|
44724
44788
|
"data-sp-collapsed-label": true,
|
|
44725
44789
|
className: classNames80(
|
|
44726
|
-
"
|
|
44790
|
+
"truncate text-xs font-semibold uppercase tracking-[0.2em]",
|
|
44791
|
+
vertical ? "min-w-0" : "min-h-0 [writing-mode:vertical-rl]",
|
|
44727
44792
|
surfaceText.muted
|
|
44728
44793
|
),
|
|
44729
44794
|
children: collapsedLabel ?? title
|
|
@@ -44752,7 +44817,7 @@ var SidePanel = ({
|
|
|
44752
44817
|
}
|
|
44753
44818
|
}
|
|
44754
44819
|
),
|
|
44755
|
-
resizable &&
|
|
44820
|
+
resizable && // ARIA 1.2 resizable separator: focusable (tabIndex), arrow keys /
|
|
44756
44821
|
// Home / End resize, aria-valuenow|min|max report the width. Parked
|
|
44757
44822
|
// (collapsed), it drops the role and every aria-* and leaves the tab
|
|
44758
44823
|
// order — see `handleParked`.
|
|
@@ -44764,15 +44829,16 @@ var SidePanel = ({
|
|
|
44764
44829
|
onKeyDown: handleParked ? void 0 : onSeparatorKeyDown,
|
|
44765
44830
|
role: handleParked ? void 0 : "separator",
|
|
44766
44831
|
"aria-hidden": handleParked || void 0,
|
|
44767
|
-
"aria-orientation": handleParked ? void 0 : "vertical",
|
|
44832
|
+
"aria-orientation": handleParked ? void 0 : vertical ? "horizontal" : "vertical",
|
|
44768
44833
|
"aria-label": handleParked ? void 0 : t("kit.sidepanel.resize"),
|
|
44769
|
-
"aria-valuenow": handleParked ? void 0 : resolvedWidth,
|
|
44770
|
-
"aria-valuemin": handleParked ? void 0 : minWidth,
|
|
44771
|
-
"aria-valuemax": handleParked ? void 0 : maxWidth,
|
|
44834
|
+
"aria-valuenow": handleParked ? void 0 : vertical ? resolvedHeight : resolvedWidth,
|
|
44835
|
+
"aria-valuemin": handleParked ? void 0 : vertical ? minHeight : minWidth,
|
|
44836
|
+
"aria-valuemax": handleParked ? void 0 : vertical ? maxHeight : maxWidth,
|
|
44772
44837
|
tabIndex: handleParked ? -1 : 0,
|
|
44773
44838
|
className: classNames80(
|
|
44774
|
-
"group absolute z-40
|
|
44775
|
-
|
|
44839
|
+
"group absolute z-40 bg-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 dark:focus-visible:ring-blue-500",
|
|
44840
|
+
vertical ? "h-3 cursor-row-resize" : "w-3 cursor-col-resize",
|
|
44841
|
+
vertical ? insetGap ? insetGap.x : "inset-x-0" : insetGap ? insetGap.y : "inset-y-0",
|
|
44776
44842
|
handleParked && "pointer-events-none opacity-0"
|
|
44777
44843
|
),
|
|
44778
44844
|
style: handleStyle,
|
|
@@ -44783,8 +44849,16 @@ var SidePanel = ({
|
|
|
44783
44849
|
className: classNames80(
|
|
44784
44850
|
// A hairline bar, centred on the panel edge (2px wide at -1px),
|
|
44785
44851
|
// so the grip below sits on it as a bulge on one centre line.
|
|
44786
|
-
|
|
44787
|
-
|
|
44852
|
+
// Inset by the corner radius, so the line stops where the
|
|
44853
|
+
// rounded corner starts instead of running past the curve.
|
|
44854
|
+
"absolute rounded-full transition duration-150",
|
|
44855
|
+
BAR_INSET[corner === "auto" ? DEFAULT_SURFACE_CORNER : corner][vertical ? "x" : "y"],
|
|
44856
|
+
{
|
|
44857
|
+
right: "w-0.5 -right-px",
|
|
44858
|
+
left: "w-0.5 -left-px",
|
|
44859
|
+
bottom: "h-0.5 -bottom-px",
|
|
44860
|
+
top: "h-0.5 -top-px"
|
|
44861
|
+
}[side],
|
|
44788
44862
|
barTone
|
|
44789
44863
|
)
|
|
44790
44864
|
}
|
|
@@ -44795,8 +44869,8 @@ var SidePanel = ({
|
|
|
44795
44869
|
"aria-hidden": "true",
|
|
44796
44870
|
"data-sp-grip": true,
|
|
44797
44871
|
className: classNames80(
|
|
44798
|
-
"pointer-events-none absolute
|
|
44799
|
-
side === "right" ? "-right-0.5" : "-left-0.5"
|
|
44872
|
+
"pointer-events-none absolute",
|
|
44873
|
+
vertical ? classNames80("left-1/2 h-1 w-10 -translate-x-1/2", side === "bottom" ? "-bottom-0.5" : "-top-0.5") : classNames80("top-1/2 h-10 w-1 -translate-y-1/2", side === "right" ? "-right-0.5" : "-left-0.5")
|
|
44800
44874
|
),
|
|
44801
44875
|
children: [
|
|
44802
44876
|
/* @__PURE__ */ jsx263(
|
|
@@ -44804,8 +44878,8 @@ var SidePanel = ({
|
|
|
44804
44878
|
{
|
|
44805
44879
|
"data-sp-grip-rest": true,
|
|
44806
44880
|
className: classNames80(
|
|
44807
|
-
"absolute inset-0 rounded-full bg-neutral-
|
|
44808
|
-
isDragging ? "opacity-0" : "opacity-
|
|
44881
|
+
"absolute inset-0 rounded-full bg-neutral-300 transition-opacity duration-150 dark:bg-neutral-600",
|
|
44882
|
+
isDragging ? "opacity-0" : "opacity-100 group-hover:opacity-0 group-focus-visible:opacity-0"
|
|
44809
44883
|
)
|
|
44810
44884
|
}
|
|
44811
44885
|
),
|
|
@@ -44813,7 +44887,7 @@ var SidePanel = ({
|
|
|
44813
44887
|
"span",
|
|
44814
44888
|
{
|
|
44815
44889
|
"data-sp-grip-active": true,
|
|
44816
|
-
className: classNames80("absolute inset-0 rounded-full transition duration-150",
|
|
44890
|
+
className: classNames80("absolute inset-0 rounded-full transition duration-150", gripTone)
|
|
44817
44891
|
}
|
|
44818
44892
|
)
|
|
44819
44893
|
]
|
|
@@ -44823,6 +44897,20 @@ var SidePanel = ({
|
|
|
44823
44897
|
}
|
|
44824
44898
|
)
|
|
44825
44899
|
] });
|
|
44900
|
+
return docked ? /* @__PURE__ */ jsx263(
|
|
44901
|
+
"div",
|
|
44902
|
+
{
|
|
44903
|
+
"data-sp-dock": true,
|
|
44904
|
+
className: classNames80(
|
|
44905
|
+
"relative flex shrink-0",
|
|
44906
|
+
vertical ? "w-full flex-col" : "h-full",
|
|
44907
|
+
// Inset docked: the gap is padding on the wrapper, so the panel is
|
|
44908
|
+
// shorter (narrower) than its zone; the handle matches it above.
|
|
44909
|
+
insetGap && (vertical ? insetGap.px : insetGap.py)
|
|
44910
|
+
),
|
|
44911
|
+
children: panel
|
|
44912
|
+
}
|
|
44913
|
+
) : panel;
|
|
44826
44914
|
};
|
|
44827
44915
|
var SidePanel_default = SidePanel;
|
|
44828
44916
|
|
|
@@ -49515,12 +49603,12 @@ var parseSmartVariable = (token) => {
|
|
|
49515
49603
|
};
|
|
49516
49604
|
};
|
|
49517
49605
|
var matcher = () => new RegExp(SMART_VAR_REGEX.source, "gi");
|
|
49518
|
-
var extractVariables = (
|
|
49606
|
+
var extractVariables = (text2) => {
|
|
49519
49607
|
const variables = [];
|
|
49520
49608
|
const seen = /* @__PURE__ */ new Set();
|
|
49521
49609
|
const regex = matcher();
|
|
49522
49610
|
let match;
|
|
49523
|
-
while ((match = regex.exec(
|
|
49611
|
+
while ((match = regex.exec(text2)) !== null) {
|
|
49524
49612
|
const fullToken = match[0];
|
|
49525
49613
|
if (seen.has(fullToken)) continue;
|
|
49526
49614
|
seen.add(fullToken);
|
|
@@ -49533,7 +49621,7 @@ var extractVariables = (text) => {
|
|
|
49533
49621
|
}
|
|
49534
49622
|
return variables;
|
|
49535
49623
|
};
|
|
49536
|
-
var hasSmartVariables = (
|
|
49624
|
+
var hasSmartVariables = (text2) => matcher().test(text2 ?? "");
|
|
49537
49625
|
var splitSmartValue = (value) => {
|
|
49538
49626
|
const parts = [];
|
|
49539
49627
|
if (!value) return parts;
|
|
@@ -49602,13 +49690,13 @@ var createDefaultResolver = (groups) => (variable) => {
|
|
|
49602
49690
|
};
|
|
49603
49691
|
var resolveSmartValue = (value, resolve2) => {
|
|
49604
49692
|
const missing = [];
|
|
49605
|
-
const
|
|
49693
|
+
const text2 = splitSmartValue(value).map((part) => {
|
|
49606
49694
|
if (part.kind === "text") return part.text;
|
|
49607
49695
|
const resolution = resolve2(part.variable);
|
|
49608
49696
|
if (resolution.state === "missing") missing.push(part.variable);
|
|
49609
49697
|
return resolution.value;
|
|
49610
49698
|
}).join("");
|
|
49611
|
-
return { text, missing };
|
|
49699
|
+
return { text: text2, missing };
|
|
49612
49700
|
};
|
|
49613
49701
|
var createLegacyGroups = (options) => {
|
|
49614
49702
|
const { globalParameters = [], serviceNames = [], systemVariables = [] } = options;
|
|
@@ -50935,7 +51023,7 @@ var StatPager = ({
|
|
|
50935
51023
|
onGradient = false,
|
|
50936
51024
|
className
|
|
50937
51025
|
}) => {
|
|
50938
|
-
const
|
|
51026
|
+
const text2 = useSurfaceText();
|
|
50939
51027
|
const tokens = TOKENS2[size] ?? TOKENS2.md;
|
|
50940
51028
|
if (pager.total <= 1 && label == null) return null;
|
|
50941
51029
|
return /* @__PURE__ */ jsxs157("div", { className: classNames87("flex items-center gap-2", className), children: [
|
|
@@ -50963,7 +51051,7 @@ var StatPager = ({
|
|
|
50963
51051
|
className: classNames87(
|
|
50964
51052
|
"truncate font-semibold",
|
|
50965
51053
|
tokens.label,
|
|
50966
|
-
onGradient ? "text-white" :
|
|
51054
|
+
onGradient ? "text-white" : text2.heading
|
|
50967
51055
|
),
|
|
50968
51056
|
children: label
|
|
50969
51057
|
}
|
|
@@ -50978,7 +51066,7 @@ var StatPager = ({
|
|
|
50978
51066
|
className: classNames87(
|
|
50979
51067
|
"tabular-nums",
|
|
50980
51068
|
tokens.counter,
|
|
50981
|
-
onGradient ? "text-white/70" :
|
|
51069
|
+
onGradient ? "text-white/70" : text2.muted
|
|
50982
51070
|
),
|
|
50983
51071
|
children: [
|
|
50984
51072
|
pager.page + 1,
|
|
@@ -51442,7 +51530,7 @@ var CHART_TOKENS = {
|
|
|
51442
51530
|
};
|
|
51443
51531
|
var Donut = ({ dataset, tokens, chartSize, onGradient }) => {
|
|
51444
51532
|
const [hoveredIndex, setHoveredIndex] = useState64(null);
|
|
51445
|
-
const
|
|
51533
|
+
const text2 = useSurfaceText();
|
|
51446
51534
|
const resolvedItems = useMemo39(() => {
|
|
51447
51535
|
const palette = getColorPaletteNames(dataset.items.length);
|
|
51448
51536
|
return dataset.items.map((item, i) => ({
|
|
@@ -51547,7 +51635,7 @@ var Donut = ({ dataset, tokens, chartSize, onGradient }) => {
|
|
|
51547
51635
|
className: classNames89(
|
|
51548
51636
|
"mb-1 font-bold leading-none",
|
|
51549
51637
|
tokens.total,
|
|
51550
|
-
onGradient ? "text-white" :
|
|
51638
|
+
onGradient ? "text-white" : text2.heading
|
|
51551
51639
|
),
|
|
51552
51640
|
children: total
|
|
51553
51641
|
}
|
|
@@ -51558,7 +51646,7 @@ var Donut = ({ dataset, tokens, chartSize, onGradient }) => {
|
|
|
51558
51646
|
className: classNames89(
|
|
51559
51647
|
"font-medium leading-tight",
|
|
51560
51648
|
tokens.center,
|
|
51561
|
-
onGradient ? "text-white/70" :
|
|
51649
|
+
onGradient ? "text-white/70" : text2.muted
|
|
51562
51650
|
),
|
|
51563
51651
|
children: dataset.centerLabel
|
|
51564
51652
|
}
|
|
@@ -51602,7 +51690,7 @@ var Donut = ({ dataset, tokens, chartSize, onGradient }) => {
|
|
|
51602
51690
|
className: classNames89(
|
|
51603
51691
|
"truncate transition-colors",
|
|
51604
51692
|
tokens.legend,
|
|
51605
|
-
onGradient ? "text-white/80" :
|
|
51693
|
+
onGradient ? "text-white/80" : text2.body
|
|
51606
51694
|
),
|
|
51607
51695
|
children: item.label
|
|
51608
51696
|
}
|
|
@@ -51614,7 +51702,7 @@ var Donut = ({ dataset, tokens, chartSize, onGradient }) => {
|
|
|
51614
51702
|
className: classNames89(
|
|
51615
51703
|
"flex-none font-bold",
|
|
51616
51704
|
tokens.legend,
|
|
51617
|
-
onGradient ? "text-white" :
|
|
51705
|
+
onGradient ? "text-white" : text2.heading
|
|
51618
51706
|
),
|
|
51619
51707
|
children: item.value
|
|
51620
51708
|
}
|
|
@@ -51669,14 +51757,14 @@ var StatChartTile_default = StatChartTile;
|
|
|
51669
51757
|
import classNames90 from "classnames";
|
|
51670
51758
|
import { jsx as jsx275, jsxs as jsxs160 } from "react/jsx-runtime";
|
|
51671
51759
|
var Breakdown = ({ items, onGradient }) => {
|
|
51672
|
-
const
|
|
51760
|
+
const text2 = useSurfaceText();
|
|
51673
51761
|
return /* @__PURE__ */ jsx275("div", { className: "mt-auto space-y-3 pt-4", children: items.map((item, idx) => /* @__PURE__ */ jsxs160("div", { className: "flex items-center justify-between text-sm", children: [
|
|
51674
51762
|
/* @__PURE__ */ jsx275(
|
|
51675
51763
|
"span",
|
|
51676
51764
|
{
|
|
51677
51765
|
className: classNames90(
|
|
51678
51766
|
"font-medium",
|
|
51679
|
-
onGradient ? "text-white/70" :
|
|
51767
|
+
onGradient ? "text-white/70" : text2.muted
|
|
51680
51768
|
),
|
|
51681
51769
|
children: item.label
|
|
51682
51770
|
}
|
|
@@ -51686,7 +51774,7 @@ var Breakdown = ({ items, onGradient }) => {
|
|
|
51686
51774
|
{
|
|
51687
51775
|
className: classNames90(
|
|
51688
51776
|
"font-semibold",
|
|
51689
|
-
item.color ? `text-${item.color}-600 dark:text-${item.color}-400` : onGradient ? "text-white" :
|
|
51777
|
+
item.color ? `text-${item.color}-600 dark:text-${item.color}-400` : onGradient ? "text-white" : text2.body
|
|
51690
51778
|
),
|
|
51691
51779
|
children: item.value
|
|
51692
51780
|
}
|
|
@@ -51802,7 +51890,7 @@ var CircularProgress = ({ value, color, icon, label, size, strokeWidth, iconSize
|
|
|
51802
51890
|
);
|
|
51803
51891
|
};
|
|
51804
51892
|
var Goals = ({ goals, tokens, ringSize, onGradient }) => {
|
|
51805
|
-
const
|
|
51893
|
+
const text2 = useSurfaceText();
|
|
51806
51894
|
return /* @__PURE__ */ jsx276("div", { className: "flex h-full flex-col justify-center", children: goals.map((goal, idx) => /* @__PURE__ */ jsxs161(React73.Fragment, { children: [
|
|
51807
51895
|
/* @__PURE__ */ jsxs161(
|
|
51808
51896
|
"div",
|
|
@@ -51833,7 +51921,7 @@ var Goals = ({ goals, tokens, ringSize, onGradient }) => {
|
|
|
51833
51921
|
className: classNames91(
|
|
51834
51922
|
"font-bold leading-none",
|
|
51835
51923
|
tokens.value,
|
|
51836
|
-
onGradient ? "text-white" :
|
|
51924
|
+
onGradient ? "text-white" : text2.heading
|
|
51837
51925
|
),
|
|
51838
51926
|
children: [
|
|
51839
51927
|
goal.value,
|
|
@@ -51847,7 +51935,7 @@ var Goals = ({ goals, tokens, ringSize, onGradient }) => {
|
|
|
51847
51935
|
className: classNames91(
|
|
51848
51936
|
"mt-1 font-medium",
|
|
51849
51937
|
tokens.label,
|
|
51850
|
-
onGradient ? "text-white/70" :
|
|
51938
|
+
onGradient ? "text-white/70" : text2.muted
|
|
51851
51939
|
),
|
|
51852
51940
|
children: goal.label
|
|
51853
51941
|
}
|
|
@@ -51861,7 +51949,7 @@ var Goals = ({ goals, tokens, ringSize, onGradient }) => {
|
|
|
51861
51949
|
{
|
|
51862
51950
|
className: classNames91(
|
|
51863
51951
|
"my-1 h-px w-full border-t",
|
|
51864
|
-
onGradient ? "border-white/20" :
|
|
51952
|
+
onGradient ? "border-white/20" : text2.divider
|
|
51865
51953
|
)
|
|
51866
51954
|
}
|
|
51867
51955
|
)
|
|
@@ -52029,7 +52117,7 @@ var StatGraphTile = ({
|
|
|
52029
52117
|
const resolvedChartType = chartType ?? (isChartType(variant) ? variant : "bar");
|
|
52030
52118
|
const surfaceVariant = isChartType(variant) ? void 0 : variant;
|
|
52031
52119
|
const resolvedTone = tone ?? color;
|
|
52032
|
-
const
|
|
52120
|
+
const text2 = useSurfaceText();
|
|
52033
52121
|
const isDark = useIsDarkMode();
|
|
52034
52122
|
const [tooltip, setTooltip] = useState66(null);
|
|
52035
52123
|
const wrapperRef = useRef58(null);
|
|
@@ -52142,13 +52230,13 @@ var StatGraphTile = ({
|
|
|
52142
52230
|
{
|
|
52143
52231
|
className: classNames92(
|
|
52144
52232
|
"text-xs font-medium",
|
|
52145
|
-
gradient ? "text-white/70" :
|
|
52233
|
+
gradient ? "text-white/70" : text2.muted
|
|
52146
52234
|
),
|
|
52147
52235
|
children: s.label
|
|
52148
52236
|
}
|
|
52149
52237
|
)
|
|
52150
52238
|
] }, s.key)) });
|
|
52151
|
-
}, [showLegend, resolvedChartType, resolvedSeries, getColor, gradient,
|
|
52239
|
+
}, [showLegend, resolvedChartType, resolvedSeries, getColor, gradient, text2.muted]);
|
|
52152
52240
|
const axisColor = gradient ? "rgba(255,255,255,0.7)" : isDark ? "#94a3b8" : "#64748b";
|
|
52153
52241
|
const gridColor = gradient ? "rgba(255,255,255,0.2)" : isDark ? "#334155" : "#e2e8f0";
|
|
52154
52242
|
const renderChart = () => {
|
|
@@ -52296,7 +52384,7 @@ var StatGraphTile = ({
|
|
|
52296
52384
|
className: classNames92(
|
|
52297
52385
|
"font-bold",
|
|
52298
52386
|
SPARK_VALUE[size] ?? SPARK_VALUE.md,
|
|
52299
|
-
gradient ? "text-white" :
|
|
52387
|
+
gradient ? "text-white" : text2.heading
|
|
52300
52388
|
),
|
|
52301
52389
|
children: props.value
|
|
52302
52390
|
}
|
|
@@ -52306,7 +52394,7 @@ var StatGraphTile = ({
|
|
|
52306
52394
|
{
|
|
52307
52395
|
className: classNames92(
|
|
52308
52396
|
"mt-1 text-sm",
|
|
52309
|
-
gradient ? "text-white/70" :
|
|
52397
|
+
gradient ? "text-white/70" : text2.muted
|
|
52310
52398
|
),
|
|
52311
52399
|
children: props.subtitle
|
|
52312
52400
|
}
|
|
@@ -57087,8 +57175,8 @@ var TYPE_CONFIG = {
|
|
|
57087
57175
|
var NotificationModalBody = ({
|
|
57088
57176
|
children
|
|
57089
57177
|
}) => {
|
|
57090
|
-
const
|
|
57091
|
-
return /* @__PURE__ */ jsx287("div", { className: classNames99("text-sm",
|
|
57178
|
+
const text2 = useSurfaceText();
|
|
57179
|
+
return /* @__PURE__ */ jsx287("div", { className: classNames99("text-sm", text2.body), children });
|
|
57092
57180
|
};
|
|
57093
57181
|
var NotificationModal = ({
|
|
57094
57182
|
isOpen,
|
|
@@ -58287,8 +58375,8 @@ var nodeIsSkipped = (node) => node?.skipped ?? (node?.status === "skipped" ? tru
|
|
|
58287
58375
|
|
|
58288
58376
|
// ../common/connectionFlow/measure.ts
|
|
58289
58377
|
var rowHeight = (metrics, hasGlyph, hasSubtitle) => {
|
|
58290
|
-
const
|
|
58291
|
-
return hasGlyph ? Math.max(metrics.glyph,
|
|
58378
|
+
const text2 = metrics.titleLine + (hasSubtitle ? metrics.bodyLine : 0);
|
|
58379
|
+
return hasGlyph ? Math.max(metrics.glyph, text2) : text2;
|
|
58292
58380
|
};
|
|
58293
58381
|
var measureHeader = (node, metrics) => {
|
|
58294
58382
|
if (!node.title && !node.subtitle) return 0;
|
|
@@ -59262,14 +59350,14 @@ var MARGIN = 12;
|
|
|
59262
59350
|
var LINE_HEIGHT = 14;
|
|
59263
59351
|
var captionStub = (options) => 18 + options.cornerRadius;
|
|
59264
59352
|
var captionEscape = (options) => 2 * captionStub(options) + MARGIN;
|
|
59265
|
-
var captionTextWidth = (
|
|
59353
|
+
var captionTextWidth = (text2) => Array.from(text2).reduce(
|
|
59266
59354
|
(sum, c) => sum + ((c.codePointAt(0) ?? 0) >= 11904 ? 12 : /[MW@%]/.test(c) ? 9 : /[ilI.,'!:;| ]/.test(c) ? 3.5 : 6.8),
|
|
59267
59355
|
0
|
|
59268
59356
|
);
|
|
59269
|
-
function wrapCaption(
|
|
59357
|
+
function wrapCaption(text2, width) {
|
|
59270
59358
|
const lines = [];
|
|
59271
59359
|
let line3 = "";
|
|
59272
|
-
for (const paragraph of
|
|
59360
|
+
for (const paragraph of text2.split(/\r?\n/u)) {
|
|
59273
59361
|
for (const word of paragraph.split(/\s+/u).filter(Boolean)) {
|
|
59274
59362
|
if (line3 && captionTextWidth(`${line3} ${word}`) <= width) {
|
|
59275
59363
|
line3 += ` ${word}`;
|
|
@@ -59365,8 +59453,8 @@ function layoutCaptions(nodes, edges, connectors, options) {
|
|
|
59365
59453
|
if (route && !segmentsCrossBoxes(route.points, [...nodes, ...boxes]) && (blocked || score(route.points) < score(edge.points)))
|
|
59366
59454
|
Object.assign(edge, { points: route.points, d: route.d });
|
|
59367
59455
|
};
|
|
59368
|
-
const measure = (
|
|
59369
|
-
const lines = wrapCaption(
|
|
59456
|
+
const measure = (text2, width, x, y) => {
|
|
59457
|
+
const lines = wrapCaption(text2, Math.max(10, width - 2 * PADDING));
|
|
59370
59458
|
const measuredWidth = Math.min(
|
|
59371
59459
|
width,
|
|
59372
59460
|
Math.max(...lines.map(captionTextWidth)) + 2 * PADDING
|
|
@@ -59405,10 +59493,10 @@ function layoutCaptions(nodes, edges, connectors, options) {
|
|
|
59405
59493
|
Object.assign(edge, local);
|
|
59406
59494
|
}
|
|
59407
59495
|
avoid(edge, reserved);
|
|
59408
|
-
const
|
|
59496
|
+
const text2 = edge.label;
|
|
59409
59497
|
const readableWidth = Math.max(
|
|
59410
59498
|
64,
|
|
59411
|
-
Math.min(96, Math.max(...
|
|
59499
|
+
Math.min(96, Math.max(...text2.split(/\s+/u).map(captionTextWidth))) + 16
|
|
59412
59500
|
);
|
|
59413
59501
|
const candidates = [];
|
|
59414
59502
|
for (let i = 1; i < edge.points.length; i++) {
|
|
@@ -59442,7 +59530,7 @@ function layoutCaptions(nodes, edges, connectors, options) {
|
|
|
59442
59530
|
);
|
|
59443
59531
|
for (const candidate of candidates) {
|
|
59444
59532
|
if (candidate.width < readableWidth) continue;
|
|
59445
|
-
const base = measure(
|
|
59533
|
+
const base = measure(text2, candidate.width, candidate.x, candidate.y);
|
|
59446
59534
|
const canMove = !candidate.vertical && candidate.segment > 0 && candidate.segment < edge.points.length - 2;
|
|
59447
59535
|
const middle = nodes.reduce((sum, n) => sum + n.y + n.height / 2, 0) / Math.max(1, nodes.length);
|
|
59448
59536
|
const direction = candidate.y >= middle ? 1 : -1;
|
|
@@ -59481,7 +59569,7 @@ function layoutCaptions(nodes, edges, connectors, options) {
|
|
|
59481
59569
|
}
|
|
59482
59570
|
if (!edge.caption) {
|
|
59483
59571
|
const caption = measure(
|
|
59484
|
-
|
|
59572
|
+
text2,
|
|
59485
59573
|
Math.min(240, Math.max(80, options.connectorWidth - 2 * MARGIN)),
|
|
59486
59574
|
0,
|
|
59487
59575
|
0
|
|
@@ -59552,9 +59640,9 @@ function captionSpacing(nodes, options) {
|
|
|
59552
59640
|
};
|
|
59553
59641
|
nodes.forEach(visit);
|
|
59554
59642
|
const ranks = new Map(all.map((n, i) => [n.id, i]));
|
|
59555
|
-
const reserve = (map, id,
|
|
59556
|
-
if (!
|
|
59557
|
-
const width = captionTextWidth(
|
|
59643
|
+
const reserve = (map, id, text2) => {
|
|
59644
|
+
if (!text2) return;
|
|
59645
|
+
const width = captionTextWidth(text2);
|
|
59558
59646
|
if (width <= Math.max(48, options.connectorWidth - 40)) return;
|
|
59559
59647
|
const budget = Math.min(
|
|
59560
59648
|
240,
|
|
@@ -59568,7 +59656,7 @@ function captionSpacing(nodes, options) {
|
|
|
59568
59656
|
),
|
|
59569
59657
|
vertical: Math.max(
|
|
59570
59658
|
old?.vertical ?? 0,
|
|
59571
|
-
wrapCaption(
|
|
59659
|
+
wrapCaption(text2, budget).length * LINE_HEIGHT + PADDING + 2 * (captionEscape(options) + MARGIN)
|
|
59572
59660
|
)
|
|
59573
59661
|
});
|
|
59574
59662
|
};
|
|
@@ -65686,6 +65774,7 @@ var WorkflowTrackerRail = ({
|
|
|
65686
65774
|
defaultCollapsed = false,
|
|
65687
65775
|
onCollapsedChange,
|
|
65688
65776
|
fillHeight = false,
|
|
65777
|
+
flush = true,
|
|
65689
65778
|
expandLabel = "Expand workflow rail",
|
|
65690
65779
|
collapseLabel = "Collapse workflow rail",
|
|
65691
65780
|
renderStepPopover,
|
|
@@ -65728,15 +65817,19 @@ var WorkflowTrackerRail = ({
|
|
|
65728
65817
|
scrollable: false,
|
|
65729
65818
|
flexBody: scrollBody,
|
|
65730
65819
|
className: classNames115(
|
|
65731
|
-
collapsible && "max-w-full shrink-0
|
|
65820
|
+
collapsible && "max-w-full shrink-0",
|
|
65732
65821
|
fillHeight && "h-full min-h-0 self-stretch",
|
|
65733
65822
|
className,
|
|
65734
65823
|
cardClassName
|
|
65735
65824
|
),
|
|
65736
65825
|
style: collapsible ? {
|
|
65826
|
+
// SidePanel's curve, not `duration-200 ease-in-out` (which read
|
|
65827
|
+
// as a snap). Padding rides it too: collapsing drops it to none,
|
|
65828
|
+
// and snapping it mid-sweep was a visible jump.
|
|
65829
|
+
transition: panelSlideTransition("width", "padding"),
|
|
65737
65830
|
...style,
|
|
65738
65831
|
width: isCollapsed ? COLLAPSED_RAIL_WIDTH : style?.width ?? 360,
|
|
65739
|
-
...
|
|
65832
|
+
...flush ? side === "left" ? { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 } : { borderTopRightRadius: 0, borderBottomRightRadius: 0 } : {}
|
|
65740
65833
|
} : style,
|
|
65741
65834
|
"aria-busy": loading || void 0,
|
|
65742
65835
|
"data-collapsed": collapsible ? isCollapsed : void 0,
|
|
@@ -66596,11 +66689,11 @@ function buildTimeScale(rangeStart, rangeEnd, pxPerDay, locale) {
|
|
|
66596
66689
|
const columns = seeds.filter((s) => s.end > rangeStart && s.start < rangeEnd).map((s, i) => {
|
|
66597
66690
|
const clampedStart = Math.max(s.start, rangeStart);
|
|
66598
66691
|
const clampedEnd = Math.min(s.end, rangeEnd);
|
|
66599
|
-
const
|
|
66692
|
+
const text2 = labelOf(s.start);
|
|
66600
66693
|
return {
|
|
66601
66694
|
id: `${id}-${i}`,
|
|
66602
|
-
label:
|
|
66603
|
-
subLabel:
|
|
66695
|
+
label: text2.label,
|
|
66696
|
+
subLabel: text2.subLabel,
|
|
66604
66697
|
start: clampedStart,
|
|
66605
66698
|
end: clampedEnd,
|
|
66606
66699
|
width: (clampedEnd - clampedStart) / MS_PER_DAY * pxPerDay
|
|
@@ -70381,7 +70474,7 @@ var Avatars = ({ users }) => {
|
|
|
70381
70474
|
)) });
|
|
70382
70475
|
};
|
|
70383
70476
|
var TaskBoardCardBody = ({ card }) => {
|
|
70384
|
-
const { surface, size, cardLayout, priorities, locale, text } = useTaskBoard();
|
|
70477
|
+
const { surface, size, cardLayout, priorities, locale, text: text2 } = useTaskBoard();
|
|
70385
70478
|
const priority = card.priority ? priorities.get(card.priority) : void 0;
|
|
70386
70479
|
const due = formatDue(card.due, locale);
|
|
70387
70480
|
const plainChip = classNames127("bg-black/5 dark:bg-white/10", surface.muted);
|
|
@@ -70438,12 +70531,12 @@ var TaskBoardCardBody = ({ card }) => {
|
|
|
70438
70531
|
(hasMeta || card.assignees?.length) && /* @__PURE__ */ jsxs197("div", { className: "flex items-end gap-2", children: [
|
|
70439
70532
|
/* @__PURE__ */ jsxs197("div", { className: classNames127("flex min-w-0 flex-1 flex-wrap items-center gap-2", size.meta, surface.muted), children: [
|
|
70440
70533
|
priorityChip,
|
|
70441
|
-
card.description && /* @__PURE__ */ jsx319("span", { title:
|
|
70534
|
+
card.description && /* @__PURE__ */ jsx319("span", { title: text2("notes"), "aria-label": text2("notes"), role: "img", children: /* @__PURE__ */ jsx319(Details, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) }),
|
|
70442
70535
|
card.checklist && /* @__PURE__ */ jsxs197(
|
|
70443
70536
|
"span",
|
|
70444
70537
|
{
|
|
70445
70538
|
className: "inline-flex items-center gap-1",
|
|
70446
|
-
title:
|
|
70539
|
+
title: text2("checklist", { done: card.checklist.done, total: card.checklist.total }),
|
|
70447
70540
|
children: [
|
|
70448
70541
|
/* @__PURE__ */ jsx319(CheckCircle, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
70449
70542
|
card.checklist.done,
|
|
@@ -70452,7 +70545,7 @@ var TaskBoardCardBody = ({ card }) => {
|
|
|
70452
70545
|
]
|
|
70453
70546
|
}
|
|
70454
70547
|
),
|
|
70455
|
-
due && /* @__PURE__ */ jsxs197("span", { "data-card-due": true, className: "inline-flex items-center gap-1", title:
|
|
70548
|
+
due && /* @__PURE__ */ jsxs197("span", { "data-card-due": true, className: "inline-flex items-center gap-1", title: text2("due", { date: due }), children: [
|
|
70456
70549
|
/* @__PURE__ */ jsx319(Calendar, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
70457
70550
|
due
|
|
70458
70551
|
] })
|
|
@@ -70555,7 +70648,7 @@ TaskBoardCard.displayName = "TaskBoardCard";
|
|
|
70555
70648
|
// src/components/TaskBoard/TaskBoardBucket.tsx
|
|
70556
70649
|
import { jsx as jsx320 } from "react/jsx-runtime";
|
|
70557
70650
|
var TaskBoardBucket = ({ column, lane, cards, className, label }) => {
|
|
70558
|
-
const { cardState, cardProps, dropTarget, size, text } = useTaskBoard();
|
|
70651
|
+
const { cardState, cardProps, dropTarget, size, text: text2 } = useTaskBoard();
|
|
70559
70652
|
const key = bucketKey(column, lane);
|
|
70560
70653
|
const target = dropTarget && dropTarget.bucket === key ? dropTarget : null;
|
|
70561
70654
|
return /* @__PURE__ */ jsx320(
|
|
@@ -70567,7 +70660,7 @@ var TaskBoardBucket = ({ column, lane, cards, className, label }) => {
|
|
|
70567
70660
|
"data-bucket-column": column,
|
|
70568
70661
|
"data-bucket-lane": lane ?? "",
|
|
70569
70662
|
"data-drop": target ? target.valid ? "valid" : "invalid" : void 0,
|
|
70570
|
-
title: target && !target.valid ?
|
|
70663
|
+
title: target && !target.valid ? text2("notAllowed") : void 0,
|
|
70571
70664
|
className: classNames128(
|
|
70572
70665
|
"flex min-h-12 flex-col rounded-lg transition-colors",
|
|
70573
70666
|
size.gap,
|
|
@@ -70639,7 +70732,7 @@ var TaskBoardAddColumn = ({
|
|
|
70639
70732
|
onAdd,
|
|
70640
70733
|
variant
|
|
70641
70734
|
}) => {
|
|
70642
|
-
const { text, surface, color, size, columnCornerClass } = useTaskBoard();
|
|
70735
|
+
const { text: text2, surface, color, size, columnCornerClass } = useTaskBoard();
|
|
70643
70736
|
const [editing, setEditing] = useState86(false);
|
|
70644
70737
|
const [title, setTitle] = useState86("");
|
|
70645
70738
|
const trigger = getSurfaceTriggerTokens(color);
|
|
@@ -70666,8 +70759,8 @@ var TaskBoardAddColumn = ({
|
|
|
70666
70759
|
"input",
|
|
70667
70760
|
{
|
|
70668
70761
|
autoFocus: true,
|
|
70669
|
-
"aria-label":
|
|
70670
|
-
placeholder:
|
|
70762
|
+
"aria-label": text2("columnName"),
|
|
70763
|
+
placeholder: text2("columnName"),
|
|
70671
70764
|
value: title,
|
|
70672
70765
|
onChange: (e) => setTitle(e.target.value),
|
|
70673
70766
|
onKeyDown: (e) => {
|
|
@@ -70700,7 +70793,7 @@ var TaskBoardAddColumn = ({
|
|
|
70700
70793
|
),
|
|
70701
70794
|
children: [
|
|
70702
70795
|
/* @__PURE__ */ jsx321(Add, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
70703
|
-
|
|
70796
|
+
text2("addColumn")
|
|
70704
70797
|
]
|
|
70705
70798
|
}
|
|
70706
70799
|
)
|
|
@@ -70777,7 +70870,7 @@ function fromDraft(column, d) {
|
|
|
70777
70870
|
}
|
|
70778
70871
|
var limitValid = (wip) => wip.trim() === "" || Number.isInteger(Number(wip)) && Number(wip) >= 1;
|
|
70779
70872
|
var TaskBoardColumnEditButton = ({ column }) => {
|
|
70780
|
-
const { onEditColumn, allColumns, text, surface, color } = useTaskBoard();
|
|
70873
|
+
const { onEditColumn, allColumns, text: text2, surface, color } = useTaskBoard();
|
|
70781
70874
|
const [open, setOpen] = useState87(false);
|
|
70782
70875
|
const [draft, setDraft] = useState87(() => toDraft(column));
|
|
70783
70876
|
const id = useId45();
|
|
@@ -70804,7 +70897,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
70804
70897
|
"button",
|
|
70805
70898
|
{
|
|
70806
70899
|
type: "button",
|
|
70807
|
-
"aria-label":
|
|
70900
|
+
"aria-label": text2("editColumn", { name: column.title }),
|
|
70808
70901
|
className: classNames130("shrink-0 rounded p-1", surface.muted, trigger.hover, trigger.focusRing),
|
|
70809
70902
|
children: /* @__PURE__ */ jsx322(Edit, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
70810
70903
|
}
|
|
@@ -70822,8 +70915,8 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
70822
70915
|
Input_default,
|
|
70823
70916
|
{
|
|
70824
70917
|
size: "sm",
|
|
70825
|
-
"aria-label":
|
|
70826
|
-
placeholder:
|
|
70918
|
+
"aria-label": text2("columnName"),
|
|
70919
|
+
placeholder: text2("columnName"),
|
|
70827
70920
|
value: draft.title,
|
|
70828
70921
|
onChange: (e) => setDraft({ ...draft, title: e.target.value }),
|
|
70829
70922
|
onKeyDown: (e) => {
|
|
@@ -70835,7 +70928,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
70835
70928
|
}
|
|
70836
70929
|
),
|
|
70837
70930
|
/* @__PURE__ */ jsxs199("div", { className: "flex flex-col gap-1.5", children: [
|
|
70838
|
-
/* @__PURE__ */ jsx322("span", { className: classNames130("text-xs font-semibold", surface.muted), children:
|
|
70931
|
+
/* @__PURE__ */ jsx322("span", { className: classNames130("text-xs font-semibold", surface.muted), children: text2("columnColor") }),
|
|
70839
70932
|
/* @__PURE__ */ jsx322(
|
|
70840
70933
|
ColorSwatches,
|
|
70841
70934
|
{
|
|
@@ -70848,7 +70941,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
70848
70941
|
)
|
|
70849
70942
|
] }),
|
|
70850
70943
|
/* @__PURE__ */ jsxs199("div", { className: "flex flex-col gap-1", children: [
|
|
70851
|
-
/* @__PURE__ */ jsx322("label", { htmlFor: `${id}-wip`, className: classNames130("text-xs font-semibold", surface.muted), children:
|
|
70944
|
+
/* @__PURE__ */ jsx322("label", { htmlFor: `${id}-wip`, className: classNames130("text-xs font-semibold", surface.muted), children: text2("wipLimit") }),
|
|
70852
70945
|
/* @__PURE__ */ jsx322(
|
|
70853
70946
|
Input_default,
|
|
70854
70947
|
{
|
|
@@ -70857,7 +70950,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
70857
70950
|
type: "number",
|
|
70858
70951
|
min: 1,
|
|
70859
70952
|
inputMode: "numeric",
|
|
70860
|
-
placeholder:
|
|
70953
|
+
placeholder: text2("wipLimitHint"),
|
|
70861
70954
|
value: draft.wip,
|
|
70862
70955
|
onChange: (e) => setDraft({ ...draft, wip: e.target.value }),
|
|
70863
70956
|
"aria-invalid": !limitValid(draft.wip) || void 0
|
|
@@ -70865,7 +70958,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
70865
70958
|
)
|
|
70866
70959
|
] }),
|
|
70867
70960
|
/* @__PURE__ */ jsxs199("div", { className: "flex flex-col gap-1", children: [
|
|
70868
|
-
/* @__PURE__ */ jsx322("label", { htmlFor: `${id}-max`, className: classNames130("text-xs font-semibold", surface.muted), children:
|
|
70961
|
+
/* @__PURE__ */ jsx322("label", { htmlFor: `${id}-max`, className: classNames130("text-xs font-semibold", surface.muted), children: text2("maxItems") }),
|
|
70869
70962
|
/* @__PURE__ */ jsx322(
|
|
70870
70963
|
Input_default,
|
|
70871
70964
|
{
|
|
@@ -70874,7 +70967,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
70874
70967
|
type: "number",
|
|
70875
70968
|
min: 1,
|
|
70876
70969
|
inputMode: "numeric",
|
|
70877
|
-
placeholder:
|
|
70970
|
+
placeholder: text2("maxItemsHint"),
|
|
70878
70971
|
value: draft.max,
|
|
70879
70972
|
onChange: (e) => setDraft({ ...draft, max: e.target.value }),
|
|
70880
70973
|
"aria-invalid": !limitValid(draft.max) || void 0
|
|
@@ -70885,14 +70978,14 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
70885
70978
|
Toggle_default,
|
|
70886
70979
|
{
|
|
70887
70980
|
size: "sm",
|
|
70888
|
-
label:
|
|
70889
|
-
description:
|
|
70981
|
+
label: text2("lockColumn"),
|
|
70982
|
+
description: text2("lockColumnHint"),
|
|
70890
70983
|
checked: draft.locked,
|
|
70891
70984
|
onChange: (e) => setDraft({ ...draft, locked: e.target.checked })
|
|
70892
70985
|
}
|
|
70893
70986
|
),
|
|
70894
70987
|
others.length > 0 && /* @__PURE__ */ jsxs199("fieldset", { className: "flex flex-col gap-1.5", children: [
|
|
70895
|
-
/* @__PURE__ */ jsx322("legend", { className: classNames130("mb-1 text-xs font-semibold", surface.muted), children:
|
|
70988
|
+
/* @__PURE__ */ jsx322("legend", { className: classNames130("mb-1 text-xs font-semibold", surface.muted), children: text2("acceptsFrom") }),
|
|
70896
70989
|
others.map((c) => /* @__PURE__ */ jsx322(
|
|
70897
70990
|
Checkbox_default,
|
|
70898
70991
|
{
|
|
@@ -70906,11 +70999,11 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
70906
70999
|
},
|
|
70907
71000
|
c.id
|
|
70908
71001
|
)),
|
|
70909
|
-
/* @__PURE__ */ jsx322("span", { className: classNames130("text-[11px]", surface.muted), children:
|
|
71002
|
+
/* @__PURE__ */ jsx322("span", { className: classNames130("text-[11px]", surface.muted), children: text2("acceptsAny") })
|
|
70910
71003
|
] }),
|
|
70911
71004
|
/* @__PURE__ */ jsxs199("div", { className: "flex justify-end gap-2 pt-1", children: [
|
|
70912
|
-
/* @__PURE__ */ jsx322(Button_default, { type: "button", size: "sm", variant: "soft", color: "slate", onClick: () => setOpen(false), children:
|
|
70913
|
-
/* @__PURE__ */ jsx322(Button_default, { type: "submit", size: "sm", color, disabled: !valid, children:
|
|
71005
|
+
/* @__PURE__ */ jsx322(Button_default, { type: "button", size: "sm", variant: "soft", color: "slate", onClick: () => setOpen(false), children: text2("cancel") }),
|
|
71006
|
+
/* @__PURE__ */ jsx322(Button_default, { type: "submit", size: "sm", color, disabled: !valid, children: text2("save") })
|
|
70914
71007
|
] })
|
|
70915
71008
|
]
|
|
70916
71009
|
}
|
|
@@ -70932,7 +71025,7 @@ var TaskBoardColumn = ({
|
|
|
70932
71025
|
index = 0,
|
|
70933
71026
|
onToggle
|
|
70934
71027
|
}) => {
|
|
70935
|
-
const { surface, text, color, size, wellSurface, columnCornerClass, onAddCard, draggingColumnId, boardMaxItems, dropTarget } = useTaskBoard();
|
|
71028
|
+
const { surface, text: text2, color, size, wellSurface, columnCornerClass, onAddCard, draggingColumnId, boardMaxItems, dropTarget } = useTaskBoard();
|
|
70936
71029
|
const refused = Boolean(dropTarget && !dropTarget.valid && dropTarget.bucket === bucketKey(column.id, null));
|
|
70937
71030
|
const max = effectiveMaxItems(column, boardMaxItems);
|
|
70938
71031
|
const full = max !== void 0 && count >= max;
|
|
@@ -70949,7 +71042,7 @@ var TaskBoardColumn = ({
|
|
|
70949
71042
|
type: "button",
|
|
70950
71043
|
onClick: onToggle,
|
|
70951
71044
|
"aria-expanded": !column.collapsed,
|
|
70952
|
-
"aria-label":
|
|
71045
|
+
"aria-label": text2(column.collapsed ? "expand" : "collapse", {
|
|
70953
71046
|
name: column.title
|
|
70954
71047
|
}),
|
|
70955
71048
|
className: classNames131(
|
|
@@ -70973,7 +71066,7 @@ var TaskBoardColumn = ({
|
|
|
70973
71066
|
"span",
|
|
70974
71067
|
{
|
|
70975
71068
|
"data-column-count": true,
|
|
70976
|
-
title: column.wipLimit !== void 0 ?
|
|
71069
|
+
title: column.wipLimit !== void 0 ? text2("wip", { count, limit: column.wipLimit }) : void 0,
|
|
70977
71070
|
className: classNames131(
|
|
70978
71071
|
"text-xs font-semibold tabular-nums",
|
|
70979
71072
|
wip === "full" || wip === "over" || full ? tokens.wipFull : surface.muted
|
|
@@ -71076,7 +71169,7 @@ var TaskBoardColumn = ({
|
|
|
71076
71169
|
column: column.id,
|
|
71077
71170
|
lane: null,
|
|
71078
71171
|
cards,
|
|
71079
|
-
label: `${column.title}, ${
|
|
71172
|
+
label: `${column.title}, ${text2("cardCount", { count: cards.length })}`
|
|
71080
71173
|
}
|
|
71081
71174
|
)
|
|
71082
71175
|
}
|
|
@@ -71094,7 +71187,7 @@ var TaskBoardColumn = ({
|
|
|
71094
71187
|
),
|
|
71095
71188
|
children: [
|
|
71096
71189
|
/* @__PURE__ */ jsx323(Add, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
71097
|
-
|
|
71190
|
+
text2("addCard")
|
|
71098
71191
|
]
|
|
71099
71192
|
}
|
|
71100
71193
|
)
|
|
@@ -71120,7 +71213,7 @@ var TaskBoardHeader = ({
|
|
|
71120
71213
|
people,
|
|
71121
71214
|
variant
|
|
71122
71215
|
}) => {
|
|
71123
|
-
const { surface, text } = useTaskBoard();
|
|
71216
|
+
const { surface, text: text2 } = useTaskBoard();
|
|
71124
71217
|
const shown = people?.slice(0, MAX_AVATARS) ?? [];
|
|
71125
71218
|
const extra = (people?.length ?? 0) - shown.length;
|
|
71126
71219
|
return /* @__PURE__ */ jsxs201(
|
|
@@ -71150,7 +71243,7 @@ var TaskBoardHeader = ({
|
|
|
71150
71243
|
{
|
|
71151
71244
|
"data-taskboard-people": true,
|
|
71152
71245
|
role: "group",
|
|
71153
|
-
"aria-label":
|
|
71246
|
+
"aria-label": text2("online", { count: people.length }),
|
|
71154
71247
|
className: "flex items-center -space-x-2",
|
|
71155
71248
|
children: [
|
|
71156
71249
|
shown.map((p) => /* @__PURE__ */ jsx324(
|
|
@@ -71188,7 +71281,7 @@ var TaskBoardLaneGrid = ({
|
|
|
71188
71281
|
onToggleColumn,
|
|
71189
71282
|
onAddColumn
|
|
71190
71283
|
}) => {
|
|
71191
|
-
const { surface, text, color, size, stickySurface, draggingColumnId, boardMaxItems } = useTaskBoard();
|
|
71284
|
+
const { surface, text: text2, color, size, stickySurface, draggingColumnId, boardMaxItems } = useTaskBoard();
|
|
71192
71285
|
const fullColumns = new Set(columns.filter((c) => columnAtMax(cards, c, boardMaxItems)).map((c) => c.id));
|
|
71193
71286
|
const trigger = getSurfaceTriggerTokens(color);
|
|
71194
71287
|
const template = [
|
|
@@ -71203,7 +71296,7 @@ var TaskBoardLaneGrid = ({
|
|
|
71203
71296
|
type: "button",
|
|
71204
71297
|
onClick,
|
|
71205
71298
|
"aria-expanded": !collapsed,
|
|
71206
|
-
"aria-label":
|
|
71299
|
+
"aria-label": text2(collapsed ? "expand" : "collapse", { name }),
|
|
71207
71300
|
className: classNames133("rounded p-1", surface.muted, trigger.hover, trigger.focusRing),
|
|
71208
71301
|
children: /* @__PURE__ */ jsx325(
|
|
71209
71302
|
ChevronRight,
|
|
@@ -71289,7 +71382,7 @@ var TaskBoardLaneRow = ({
|
|
|
71289
71382
|
trailingCell,
|
|
71290
71383
|
fullColumns
|
|
71291
71384
|
}) => {
|
|
71292
|
-
const { surface, text, color, stickySurface, onAddCard, dropTarget } = useTaskBoard();
|
|
71385
|
+
const { surface, text: text2, color, stickySurface, onAddCard, dropTarget } = useTaskBoard();
|
|
71293
71386
|
const refusedBucket = dropTarget && !dropTarget.valid ? dropTarget.bucket : null;
|
|
71294
71387
|
const trigger = getSurfaceTriggerTokens(color);
|
|
71295
71388
|
const open = !lane.collapsed;
|
|
@@ -71340,7 +71433,7 @@ var TaskBoardLaneRow = ({
|
|
|
71340
71433
|
{
|
|
71341
71434
|
type: "button",
|
|
71342
71435
|
onClick: () => onAddCard({ column: col.id, lane: lane.id }),
|
|
71343
|
-
"aria-label": `${
|
|
71436
|
+
"aria-label": `${text2("addCard")} \u2014 ${col.title}, ${lane.title}`,
|
|
71344
71437
|
className: classNames133(
|
|
71345
71438
|
"flex items-center justify-center rounded-md py-1 opacity-60 hover:opacity-100 focus-visible:opacity-100",
|
|
71346
71439
|
surface.muted,
|
|
@@ -71695,7 +71788,7 @@ function useTaskBoardDrag(opts) {
|
|
|
71695
71788
|
import { useCallback as useCallback47, useLayoutEffect as useLayoutEffect24, useMemo as useMemo63, useRef as useRef73, useState as useState89 } from "react";
|
|
71696
71789
|
var isRtl = (el) => el?.closest("[dir]")?.getAttribute("dir") === "rtl";
|
|
71697
71790
|
function useTaskBoardKeyboard(o) {
|
|
71698
|
-
const { rootRef, cards, viewCards, columns, lanes, text, drag } = o;
|
|
71791
|
+
const { rootRef, cards, viewCards, columns, lanes, text: text2, drag } = o;
|
|
71699
71792
|
const [message, setMessage] = useState89("");
|
|
71700
71793
|
const [activeId, setActiveId] = useState89(null);
|
|
71701
71794
|
const [ownSelection, setOwnSelection] = useState89([]);
|
|
@@ -71722,9 +71815,9 @@ function useTaskBoardKeyboard(o) {
|
|
|
71722
71815
|
const total = (others.get(bucketKey(to.column, to.lane))?.length ?? 0) + 1;
|
|
71723
71816
|
const values = { column: columnTitle(to.column), index: to.index + 1, total };
|
|
71724
71817
|
const lane = to.lane ? lanes?.find((l) => l.id === to.lane)?.title : void 0;
|
|
71725
|
-
announce(lane ?
|
|
71818
|
+
announce(lane ? text2("movedLane", { ...values, lane }) : text2("moved", values));
|
|
71726
71819
|
},
|
|
71727
|
-
[announce, cards, columns, lanes, columnTitle,
|
|
71820
|
+
[announce, cards, columns, lanes, columnTitle, text2]
|
|
71728
71821
|
);
|
|
71729
71822
|
const setSelection = useCallback47(
|
|
71730
71823
|
(ids) => {
|
|
@@ -71824,20 +71917,20 @@ function useTaskBoardKeyboard(o) {
|
|
|
71824
71917
|
e.preventDefault();
|
|
71825
71918
|
const target = drag.to ?? drag.from;
|
|
71826
71919
|
refocusRef.current = card.id;
|
|
71827
|
-
announce(
|
|
71920
|
+
announce(text2("dropped", { title: card.title, column: columnTitle(target.column) }));
|
|
71828
71921
|
void o.finish().then((ok) => {
|
|
71829
71922
|
if (!ok && (target.column !== drag.from.column || target.lane !== drag.from.lane || target.index !== drag.from.index)) {
|
|
71830
|
-
announce(
|
|
71923
|
+
announce(text2("cancelled"));
|
|
71831
71924
|
}
|
|
71832
71925
|
});
|
|
71833
71926
|
} else if (e.key === "Escape") {
|
|
71834
71927
|
e.preventDefault();
|
|
71835
71928
|
refocusRef.current = card.id;
|
|
71836
71929
|
o.cancel("escape");
|
|
71837
|
-
announce(
|
|
71930
|
+
announce(text2("cancelled"));
|
|
71838
71931
|
} else if (e.key === "Tab") {
|
|
71839
71932
|
o.cancel("blur");
|
|
71840
|
-
announce(
|
|
71933
|
+
announce(text2("cancelled"));
|
|
71841
71934
|
} else if (e.key === "Enter") {
|
|
71842
71935
|
e.preventDefault();
|
|
71843
71936
|
}
|
|
@@ -71847,7 +71940,7 @@ function useTaskBoardKeyboard(o) {
|
|
|
71847
71940
|
e.preventDefault();
|
|
71848
71941
|
if (o.keyboardGrab(card, slot)) {
|
|
71849
71942
|
refocusRef.current = card.id;
|
|
71850
|
-
announce(
|
|
71943
|
+
announce(text2("grabbed", { title: card.title }));
|
|
71851
71944
|
}
|
|
71852
71945
|
return;
|
|
71853
71946
|
}
|
|
@@ -71873,7 +71966,7 @@ function useTaskBoardKeyboard(o) {
|
|
|
71873
71966
|
}
|
|
71874
71967
|
}
|
|
71875
71968
|
}),
|
|
71876
|
-
[tabStop, selection, setSelection, viewBuckets, drag, cards, columns, lanes, o, announceSlot, announce,
|
|
71969
|
+
[tabStop, selection, setSelection, viewBuckets, drag, cards, columns, lanes, o, announceSlot, announce, text2, columnTitle, focusStep]
|
|
71877
71970
|
);
|
|
71878
71971
|
return { cardProps, message, selection, announce };
|
|
71879
71972
|
}
|
|
@@ -72384,7 +72477,7 @@ var TaskBoardBody = (props) => {
|
|
|
72384
72477
|
surfaceVariant
|
|
72385
72478
|
} = props;
|
|
72386
72479
|
const surface = useSurfaceText();
|
|
72387
|
-
const
|
|
72480
|
+
const text2 = useTaskBoardText(labels);
|
|
72388
72481
|
const { locale } = useKitEngine();
|
|
72389
72482
|
const sizeTokens12 = TASKBOARD_SIZES[size] ?? TASKBOARD_SIZES.md;
|
|
72390
72483
|
const wellSurface = surface.translucent ? GLASS_WELL : SOLID_WELL;
|
|
@@ -72417,8 +72510,8 @@ var TaskBoardBody = (props) => {
|
|
|
72417
72510
|
if (!holder || holder === selfId) return;
|
|
72418
72511
|
const peer = collab.userById(holder);
|
|
72419
72512
|
cancel("held");
|
|
72420
|
-
setNotice({ cardId: drag.cardId, text:
|
|
72421
|
-
}, [collab, drag, selfId, cancel,
|
|
72513
|
+
setNotice({ cardId: drag.cardId, text: text2("heldShort", { name: peer.name }), color: peer.color ?? peerColor(peer.id) });
|
|
72514
|
+
}, [collab, drag, selfId, cancel, text2]);
|
|
72422
72515
|
useEffect78(() => {
|
|
72423
72516
|
if (!notice) return;
|
|
72424
72517
|
const t = setTimeout(() => setNotice(null), NOTICE_MS);
|
|
@@ -72430,7 +72523,7 @@ var TaskBoardBody = (props) => {
|
|
|
72430
72523
|
viewCards: previewCards,
|
|
72431
72524
|
columns,
|
|
72432
72525
|
lanes: viewLanes,
|
|
72433
|
-
text,
|
|
72526
|
+
text: text2,
|
|
72434
72527
|
drag,
|
|
72435
72528
|
keyboardGrab,
|
|
72436
72529
|
keyboardMove,
|
|
@@ -72449,7 +72542,7 @@ var TaskBoardBody = (props) => {
|
|
|
72449
72542
|
rootRef,
|
|
72450
72543
|
columns,
|
|
72451
72544
|
enabled: columnEditing,
|
|
72452
|
-
text,
|
|
72545
|
+
text: text2,
|
|
72453
72546
|
announce: keyboard.announce,
|
|
72454
72547
|
onCommit: (next) => onColumnsChange?.(next)
|
|
72455
72548
|
});
|
|
@@ -72470,7 +72563,7 @@ var TaskBoardBody = (props) => {
|
|
|
72470
72563
|
);
|
|
72471
72564
|
const ctx = useMemo66(
|
|
72472
72565
|
() => ({
|
|
72473
|
-
text,
|
|
72566
|
+
text: text2,
|
|
72474
72567
|
surface,
|
|
72475
72568
|
color,
|
|
72476
72569
|
size: sizeTokens12,
|
|
@@ -72503,7 +72596,7 @@ var TaskBoardBody = (props) => {
|
|
|
72503
72596
|
cardProps: (card, slot) => ({ ...isEditable ? cardHandlers(card, slot) : {}, ...keyboardProps(card, slot) }),
|
|
72504
72597
|
dropTarget: drag?.to && !drag.valid ? { bucket: bucketKey(drag.to.column, drag.to.lane), index: drag.to.index, valid: false } : null
|
|
72505
72598
|
}),
|
|
72506
|
-
[
|
|
72599
|
+
[text2, surface, color, sizeTokens12, cardLayout, priorities, locale, isEditable, renderCard, onCardOpen, onCardContextMenu, onAddCard, wellSurface, columnCornerClass, columnEditing, columnDrag.gripProps, columnDrag.drag, editColumn, columns, maxItems, selected, drag, pending, cardHandlers, keyboardProps, heldPeer, notice]
|
|
72507
72600
|
);
|
|
72508
72601
|
const buckets = useMemo66(() => bucketCards(previewCards, columns, viewLanes), [previewCards, columns, viewLanes]);
|
|
72509
72602
|
const draggedCard = drag ? cards.find((c) => c.id === drag.cardId) : void 0;
|
|
@@ -72524,12 +72617,12 @@ var TaskBoardBody = (props) => {
|
|
|
72524
72617
|
);
|
|
72525
72618
|
} else if (error) {
|
|
72526
72619
|
content = /* @__PURE__ */ jsxs205("div", { role: "alert", className: "flex flex-1 flex-col items-center justify-center gap-3 p-10 text-center", children: [
|
|
72527
|
-
/* @__PURE__ */ jsx329("p", { className: classNames137("text-sm font-medium", surface.body), children: error === true ?
|
|
72528
|
-
onRetry && /* @__PURE__ */ jsx329(Button_default, { size: "sm", variant: "outline", color, onClick: onRetry, children:
|
|
72620
|
+
/* @__PURE__ */ jsx329("p", { className: classNames137("text-sm font-medium", surface.body), children: error === true ? text2("error") : error }),
|
|
72621
|
+
onRetry && /* @__PURE__ */ jsx329(Button_default, { size: "sm", variant: "outline", color, onClick: onRetry, children: text2("retry") })
|
|
72529
72622
|
] });
|
|
72530
72623
|
} else {
|
|
72531
72624
|
content = /* @__PURE__ */ jsxs205("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
72532
|
-
cards.length === 0 && /* @__PURE__ */ jsx329("div", { "data-taskboard-empty": true, className: classNames137("px-4 pt-4 text-center text-sm", surface.muted), children: emptyState ??
|
|
72625
|
+
cards.length === 0 && /* @__PURE__ */ jsx329("div", { "data-taskboard-empty": true, className: classNames137("px-4 pt-4 text-center text-sm", surface.muted), children: emptyState ?? text2("empty") }),
|
|
72533
72626
|
laneView ? /* @__PURE__ */ jsx329(
|
|
72534
72627
|
TaskBoardLaneGrid,
|
|
72535
72628
|
{
|
|
@@ -72576,7 +72669,7 @@ var TaskBoardBody = (props) => {
|
|
|
72576
72669
|
role: "application",
|
|
72577
72670
|
"aria-roledescription": "task board",
|
|
72578
72671
|
"aria-busy": loading ? true : void 0,
|
|
72579
|
-
"aria-label":
|
|
72672
|
+
"aria-label": text2("root"),
|
|
72580
72673
|
className: "flex h-full min-h-0 flex-col",
|
|
72581
72674
|
children: [
|
|
72582
72675
|
/* @__PURE__ */ jsx329("div", { "data-taskboard-live": true, "aria-live": "polite", "aria-atomic": "true", className: "sr-only", children: keyboard.message }),
|
|
@@ -72794,7 +72887,7 @@ function gradientBackdropCss(colors3, s) {
|
|
|
72794
72887
|
import { jsx as jsx330, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
72795
72888
|
var GRADIENT_BACKDROP_SCHEMES = ["auto", "light", "dark"];
|
|
72796
72889
|
var GradientBackdrop = React104.forwardRef(
|
|
72797
|
-
({ theme = "slate", scheme = "auto", noise = false, className, style, children, ...rest }, ref) => {
|
|
72890
|
+
({ theme = "slate", scheme = "auto", noise = false, noiseScale, className, style, children, ...rest }, ref) => {
|
|
72798
72891
|
const themeKey = typeof theme === "string" ? theme : JSON.stringify(theme);
|
|
72799
72892
|
const resolved = useMemo67(() => {
|
|
72800
72893
|
const t = resolveGradientBackdropTheme(theme);
|
|
@@ -72828,7 +72921,11 @@ var GradientBackdrop = React104.forwardRef(
|
|
|
72828
72921
|
"pointer-events-none absolute inset-0 -z-10 rounded-[inherit]",
|
|
72829
72922
|
getNoiseBlendClasses(scheme)
|
|
72830
72923
|
),
|
|
72831
|
-
style: {
|
|
72924
|
+
style: {
|
|
72925
|
+
backgroundImage: NOISE_BACKGROUND_IMAGE,
|
|
72926
|
+
backgroundSize: getNoiseBackgroundSize(noiseScale),
|
|
72927
|
+
backgroundRepeat: "repeat"
|
|
72928
|
+
}
|
|
72832
72929
|
}
|
|
72833
72930
|
),
|
|
72834
72931
|
children
|
|
@@ -73336,127 +73433,375 @@ var TerminalTabs = forwardRef165(
|
|
|
73336
73433
|
);
|
|
73337
73434
|
|
|
73338
73435
|
// src/components/PageBodyLayout.tsx
|
|
73339
|
-
import { useCallback as useCallback53, useEffect as useEffect81, useRef as useRef80, useState as useState96 } from "react";
|
|
73340
73436
|
import classNames141 from "classnames";
|
|
73341
|
-
import { jsx as jsx334, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
73342
|
-
|
|
73343
|
-
|
|
73344
|
-
const
|
|
73345
|
-
const
|
|
73346
|
-
|
|
73347
|
-
|
|
73348
|
-
|
|
73349
|
-
|
|
73350
|
-
|
|
73351
|
-
|
|
73352
|
-
|
|
73353
|
-
|
|
73354
|
-
|
|
73355
|
-
|
|
73356
|
-
|
|
73357
|
-
|
|
73358
|
-
|
|
73359
|
-
|
|
73360
|
-
|
|
73361
|
-
|
|
73362
|
-
|
|
73363
|
-
|
|
73364
|
-
|
|
73365
|
-
|
|
73366
|
-
|
|
73367
|
-
|
|
73368
|
-
|
|
73369
|
-
|
|
73370
|
-
|
|
73371
|
-
|
|
73372
|
-
|
|
73373
|
-
|
|
73374
|
-
|
|
73375
|
-
|
|
73437
|
+
import { Fragment as Fragment53, jsx as jsx334, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
73438
|
+
var PAGE_BODY_LAYOUT_VARIANTS = ["none", ...SURFACE_VARIANTS];
|
|
73439
|
+
function PageBodyLayout({ header, left, right, bottom, children, className, minCenterWidth = 240, minCenterHeight = 120, gap = 8, variant = "outlined", ...surface }) {
|
|
73440
|
+
const plain = variant === "none" || variant === "plain";
|
|
73441
|
+
const body = /* @__PURE__ */ jsxs208(Fragment53, { children: [
|
|
73442
|
+
header && /* @__PURE__ */ jsx334("div", { className: "shrink-0", children: header }),
|
|
73443
|
+
/* @__PURE__ */ jsx334("div", { className: classNames141("min-h-0 min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR), children: /* @__PURE__ */ jsxs208("div", { className: "flex h-full min-h-0", style: { minWidth: "fit-content", gap, ...plain ? { paddingTop: header ? gap : 0 } : { padding: gap } }, children: [
|
|
73444
|
+
hasZone(left) && /* @__PURE__ */ jsx334("div", { "data-page-region": "left", className: "flex min-h-0 shrink-0", children: left }),
|
|
73445
|
+
/* @__PURE__ */ jsxs208("div", { className: "flex min-h-0 flex-1 flex-col", style: { gap, minWidth: minCenterWidth }, children: [
|
|
73446
|
+
/* @__PURE__ */ jsx334("div", { "data-page-region": "center", className: classNames141("min-w-0 flex-1 overflow-auto", THIN_SCROLLBAR), style: { minHeight: minCenterHeight }, children }),
|
|
73447
|
+
hasZone(bottom) && /* @__PURE__ */ jsx334("div", { "data-page-region": "bottom", className: "flex min-w-0 shrink-0 flex-col", children: bottom })
|
|
73448
|
+
] }),
|
|
73449
|
+
hasZone(right) && /* @__PURE__ */ jsx334("div", { "data-page-region": "right", className: "flex min-h-0 shrink-0", children: right })
|
|
73450
|
+
] }) })
|
|
73451
|
+
] });
|
|
73452
|
+
return plain ? /* @__PURE__ */ jsx334("div", { "data-page-layout": "none", className: classNames141("flex h-full min-h-0 min-w-0 flex-col", className), children: body }) : /* @__PURE__ */ jsx334(Panel_default, { ...surface, variant, padding: "none", scrollable: false, flexBody: true, className: classNames141("h-full min-h-0 min-w-0", className), children: body });
|
|
73453
|
+
}
|
|
73454
|
+
function hasZone(node) {
|
|
73455
|
+
return node != null && node !== false;
|
|
73456
|
+
}
|
|
73457
|
+
|
|
73458
|
+
// src/components/Menu/Menu.tsx
|
|
73459
|
+
import React106, { cloneElement as cloneElement4, useCallback as useCallback53, useEffect as useEffect81, useId as useId47, useLayoutEffect as useLayoutEffect29, useRef as useRef81, useState as useState97 } from "react";
|
|
73460
|
+
import { Link as Link3 } from "react-router-dom";
|
|
73461
|
+
import classNames142 from "classnames";
|
|
73462
|
+
|
|
73463
|
+
// src/components/Menu/MenuPopup.tsx
|
|
73464
|
+
import { useLayoutEffect as useLayoutEffect28, useRef as useRef80, useState as useState96 } from "react";
|
|
73465
|
+
import { createPortal as createPortal19 } from "react-dom";
|
|
73466
|
+
import { jsx as jsx335 } from "react/jsx-runtime";
|
|
73467
|
+
function MenuPopup({ anchor, placement, width, children }) {
|
|
73468
|
+
const ref = useRef80(null);
|
|
73469
|
+
const [style, setStyle] = useState96({ visibility: "hidden" });
|
|
73470
|
+
useLayoutEffect28(() => {
|
|
73471
|
+
const update = () => {
|
|
73472
|
+
if (!anchor.current || !ref.current) return;
|
|
73473
|
+
const trigger = anchor.current.getBoundingClientRect();
|
|
73474
|
+
const rect = ref.current.getBoundingClientRect();
|
|
73475
|
+
const position = resolveTooltipPlacement({
|
|
73476
|
+
trigger: { left: trigger.left, top: trigger.top, width: trigger.width, height: trigger.height },
|
|
73477
|
+
tooltip: { width: rect.width, height: rect.height },
|
|
73478
|
+
viewport: { width: window.innerWidth, height: window.innerHeight },
|
|
73479
|
+
preferred: placement,
|
|
73480
|
+
align: "grow",
|
|
73481
|
+
offset: 4
|
|
73482
|
+
});
|
|
73483
|
+
setStyle({ left: position.left, top: position.top, zIndex: resolveOverlayZIndex(anchor.current), visibility: "visible" });
|
|
73376
73484
|
};
|
|
73377
|
-
|
|
73378
|
-
|
|
73379
|
-
|
|
73485
|
+
update();
|
|
73486
|
+
const observer = typeof ResizeObserver !== "undefined" ? new ResizeObserver(update) : null;
|
|
73487
|
+
if (ref.current) observer?.observe(ref.current);
|
|
73488
|
+
if (anchor.current) observer?.observe(anchor.current);
|
|
73489
|
+
window.addEventListener("resize", update);
|
|
73490
|
+
window.addEventListener("scroll", update, true);
|
|
73380
73491
|
return () => {
|
|
73381
|
-
|
|
73382
|
-
window.removeEventListener("
|
|
73383
|
-
window.removeEventListener("
|
|
73384
|
-
document.body.style.cursor = previousCursor;
|
|
73385
|
-
document.body.style.userSelect = previousSelect;
|
|
73492
|
+
observer?.disconnect();
|
|
73493
|
+
window.removeEventListener("resize", update);
|
|
73494
|
+
window.removeEventListener("scroll", update, true);
|
|
73386
73495
|
};
|
|
73387
|
-
}, [
|
|
73388
|
-
|
|
73389
|
-
|
|
73390
|
-
|
|
73391
|
-
|
|
73496
|
+
}, [anchor, placement, width]);
|
|
73497
|
+
if (typeof document === "undefined") return null;
|
|
73498
|
+
return createPortal19(/* @__PURE__ */ jsx335("div", { ref, style: { position: "fixed", width, maxWidth: "calc(100vw - 16px)", ...style }, children }), document.body);
|
|
73499
|
+
}
|
|
73500
|
+
|
|
73501
|
+
// src/components/Menu/Menu.tsx
|
|
73502
|
+
import { Fragment as Fragment54, jsx as jsx336, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
73503
|
+
var rowSizes = { xs: "px-2 py-1 text-xs", sm: "px-2.5 py-1.5 text-xs", md: "px-3 py-2 text-sm", lg: "px-4 py-2.5 text-base", xl: "px-5 py-3 text-lg" };
|
|
73504
|
+
var text = (item) => item.textValue ?? (typeof item.label === "string" ? item.label : item.id);
|
|
73505
|
+
function MenuList({ items, state, depth = 0, parentLabel, onBack, focusOnMount = false, grouped = false }) {
|
|
73506
|
+
const list = useRef81(null);
|
|
73507
|
+
const buffer = useRef81("");
|
|
73508
|
+
const timer = useRef81(void 0);
|
|
73509
|
+
const actions = () => Array.from(list.current?.querySelectorAll("[data-menu-action]") ?? []).filter((el) => el.closest('[role="menu"]') === list.current && el.getAttribute("aria-disabled") !== "true");
|
|
73510
|
+
useLayoutEffect29(() => {
|
|
73511
|
+
if (grouped) return;
|
|
73512
|
+
const entries = actions();
|
|
73513
|
+
const selected = entries.find((el) => el === document.activeElement) ?? entries[0];
|
|
73514
|
+
entries.forEach((el) => {
|
|
73515
|
+
el.tabIndex = el === selected ? 0 : -1;
|
|
73516
|
+
});
|
|
73517
|
+
}, [items, grouped]);
|
|
73518
|
+
useLayoutEffect29(() => {
|
|
73519
|
+
if (!focusOnMount) return;
|
|
73520
|
+
const frame = requestAnimationFrame(() => actions()[0]?.focus());
|
|
73521
|
+
return () => cancelAnimationFrame(frame);
|
|
73522
|
+
}, [focusOnMount]);
|
|
73523
|
+
useEffect81(() => () => clearTimeout(timer.current), []);
|
|
73524
|
+
return /* @__PURE__ */ jsx336(
|
|
73525
|
+
"ul",
|
|
73392
73526
|
{
|
|
73393
|
-
|
|
73394
|
-
|
|
73395
|
-
"
|
|
73396
|
-
|
|
73397
|
-
|
|
73398
|
-
|
|
73399
|
-
|
|
73400
|
-
|
|
73401
|
-
|
|
73402
|
-
|
|
73403
|
-
|
|
73404
|
-
|
|
73405
|
-
|
|
73406
|
-
|
|
73407
|
-
|
|
73408
|
-
|
|
73409
|
-
|
|
73410
|
-
|
|
73411
|
-
|
|
73412
|
-
|
|
73413
|
-
|
|
73414
|
-
|
|
73415
|
-
|
|
73416
|
-
|
|
73417
|
-
|
|
73418
|
-
|
|
73419
|
-
|
|
73420
|
-
|
|
73421
|
-
|
|
73422
|
-
|
|
73423
|
-
|
|
73424
|
-
|
|
73425
|
-
|
|
73426
|
-
|
|
73427
|
-
if (event.button !== 0) return;
|
|
73428
|
-
event.preventDefault();
|
|
73429
|
-
drag.current = { position: vertical ? event.clientY : event.clientX, size };
|
|
73430
|
-
setDragging(true);
|
|
73431
|
-
},
|
|
73432
|
-
onKeyDown: (event) => {
|
|
73433
|
-
const grow = vertical ? "ArrowUp" : side === "right" ? "ArrowLeft" : "ArrowRight";
|
|
73434
|
-
const shrink = vertical ? "ArrowDown" : side === "right" ? "ArrowRight" : "ArrowLeft";
|
|
73435
|
-
if (![grow, shrink, "Home", "End"].includes(event.key)) return;
|
|
73436
|
-
event.preventDefault();
|
|
73437
|
-
updateSize(event.key === "Home" ? min : event.key === "End" ? max : size + (event.key === grow ? 20 : -20));
|
|
73438
|
-
},
|
|
73439
|
-
children: /* @__PURE__ */ jsx334("span", { "aria-hidden": "true", className: classNames141(
|
|
73440
|
-
"pointer-events-none absolute rounded-full bg-neutral-300 dark:bg-neutral-600",
|
|
73441
|
-
vertical ? "left-1/2 top-0 h-1 w-10 -translate-x-1/2" : "left-0 top-1/2 h-10 w-1 -translate-y-1/2"
|
|
73442
|
-
) })
|
|
73527
|
+
ref: list,
|
|
73528
|
+
id: depth === 0 && !grouped ? `${state.owner}-menu` : void 0,
|
|
73529
|
+
role: grouped ? "group" : "menu",
|
|
73530
|
+
"aria-label": parentLabel ?? state.props["aria-label"] ?? "Menu",
|
|
73531
|
+
className: "m-0 list-none space-y-0.5 p-0",
|
|
73532
|
+
onFocusCapture: (event) => {
|
|
73533
|
+
const entries = actions();
|
|
73534
|
+
entries.forEach((el) => {
|
|
73535
|
+
el.tabIndex = el === event.target ? 0 : -1;
|
|
73536
|
+
});
|
|
73537
|
+
},
|
|
73538
|
+
onKeyDown: (event) => {
|
|
73539
|
+
if (event.target.closest('[role="menu"]') !== list.current) return;
|
|
73540
|
+
const entries = actions();
|
|
73541
|
+
const index = entries.indexOf(document.activeElement);
|
|
73542
|
+
let next;
|
|
73543
|
+
if (event.key === "ArrowDown") next = (index + 1) % entries.length;
|
|
73544
|
+
if (event.key === "ArrowUp") next = (index - 1 + entries.length) % entries.length;
|
|
73545
|
+
if (event.key === "Home") next = 0;
|
|
73546
|
+
if (event.key === "End") next = entries.length - 1;
|
|
73547
|
+
if (next !== void 0) {
|
|
73548
|
+
event.preventDefault();
|
|
73549
|
+
event.stopPropagation();
|
|
73550
|
+
entries[next]?.focus();
|
|
73551
|
+
return;
|
|
73552
|
+
}
|
|
73553
|
+
if (event.key === "Escape" || event.key === "ArrowLeft") {
|
|
73554
|
+
if (onBack) {
|
|
73555
|
+
event.preventDefault();
|
|
73556
|
+
event.stopPropagation();
|
|
73557
|
+
onBack();
|
|
73558
|
+
} else if (event.key === "Escape") {
|
|
73559
|
+
event.preventDefault();
|
|
73560
|
+
state.close(true);
|
|
73443
73561
|
}
|
|
73444
|
-
|
|
73445
|
-
|
|
73562
|
+
return;
|
|
73563
|
+
}
|
|
73564
|
+
if (event.key === "Tab") {
|
|
73565
|
+
state.close(false);
|
|
73566
|
+
return;
|
|
73567
|
+
}
|
|
73568
|
+
if (event.key.length === 1 && event.key !== " " && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
73569
|
+
clearTimeout(timer.current);
|
|
73570
|
+
buffer.current += event.key.toLocaleLowerCase();
|
|
73571
|
+
const ordered = [...entries.slice(index + 1), ...entries.slice(0, index + 1)];
|
|
73572
|
+
ordered.find((el) => el.dataset.menuText?.toLocaleLowerCase().startsWith(buffer.current))?.focus();
|
|
73573
|
+
timer.current = setTimeout(() => {
|
|
73574
|
+
buffer.current = "";
|
|
73575
|
+
}, 600);
|
|
73576
|
+
}
|
|
73577
|
+
},
|
|
73578
|
+
children: items.filter((item) => !item.hidden).map((item) => /* @__PURE__ */ jsx336(MenuRow, { item, state, depth }, item.id))
|
|
73446
73579
|
}
|
|
73447
73580
|
);
|
|
73448
73581
|
}
|
|
73449
|
-
function
|
|
73450
|
-
|
|
73451
|
-
|
|
73452
|
-
|
|
73453
|
-
|
|
73454
|
-
|
|
73455
|
-
|
|
73456
|
-
|
|
73457
|
-
|
|
73458
|
-
|
|
73459
|
-
|
|
73582
|
+
function MenuRow({ item, state, depth }) {
|
|
73583
|
+
const anchor = useRef81(null);
|
|
73584
|
+
const { props } = state;
|
|
73585
|
+
const tiered = (item.submenuMode ?? props.submenuMode) === "tiered";
|
|
73586
|
+
const nested = Boolean(item.items?.some((child) => !child.hidden) || item.content != null);
|
|
73587
|
+
const expanded = tiered ? state.path[depth] === item.id : state.expanded.includes(item.id);
|
|
73588
|
+
const label = text(item);
|
|
73589
|
+
const id = useId47();
|
|
73590
|
+
const open = (keyboard) => {
|
|
73591
|
+
if (item.disabled || !nested) return;
|
|
73592
|
+
state.keyboard.current = keyboard;
|
|
73593
|
+
if (tiered) state.setPath([...state.path.slice(0, depth), item.id]);
|
|
73594
|
+
else if (!expanded) state.toggle(item.id);
|
|
73595
|
+
else if (keyboard) document.getElementById(`${id}-submenu`)?.querySelector("[data-menu-action]:not([aria-disabled='true'])")?.focus();
|
|
73596
|
+
};
|
|
73597
|
+
const back = () => {
|
|
73598
|
+
if (tiered) state.setPath(state.path.slice(0, depth));
|
|
73599
|
+
else state.toggle(item.id);
|
|
73600
|
+
anchor.current?.focus();
|
|
73601
|
+
};
|
|
73602
|
+
if (item.type === "separator") return /* @__PURE__ */ jsx336("li", { role: "separator", className: "my-1.5 border-t border-neutral-200 dark:border-white/10" });
|
|
73603
|
+
if (item.type === "group") return /* @__PURE__ */ jsxs209("li", { role: "presentation", children: [
|
|
73604
|
+
item.label && /* @__PURE__ */ jsx336("div", { className: "px-3 pb-1 pt-3 text-xs font-semibold text-neutral-500 dark:text-neutral-400", children: item.label }),
|
|
73605
|
+
item.items && /* @__PURE__ */ jsx336(MenuList, { items: item.disabled ? item.items.map((child) => ({ ...child, disabled: true })) : item.items, state, depth, parentLabel: label, grouped: true })
|
|
73606
|
+
] });
|
|
73607
|
+
const tokens = getSideMenuItemTokens(props.tone ?? "neutral");
|
|
73608
|
+
const checkable = item.type === "checkbox" || item.type === "radio";
|
|
73609
|
+
const activate = (event) => {
|
|
73610
|
+
if (item.disabled) {
|
|
73611
|
+
event.preventDefault();
|
|
73612
|
+
return;
|
|
73613
|
+
}
|
|
73614
|
+
if (nested) {
|
|
73615
|
+
event.preventDefault();
|
|
73616
|
+
if (expanded) back();
|
|
73617
|
+
else open(true);
|
|
73618
|
+
return;
|
|
73619
|
+
}
|
|
73620
|
+
if (checkable) item.onCheckedChange?.(item.type === "radio" ? true : !item.checked);
|
|
73621
|
+
item.command?.(item);
|
|
73622
|
+
props.onSelect?.(item);
|
|
73623
|
+
if (item.closeOnSelect ?? !checkable) state.close(true);
|
|
73624
|
+
};
|
|
73625
|
+
const content = props.renderItem?.(item, { expanded, checked: Boolean(item.checked) }) ?? /* @__PURE__ */ jsxs209(Fragment54, { children: [
|
|
73626
|
+
/* @__PURE__ */ jsx336("span", { "aria-hidden": "true", className: "inline-flex h-5 w-5 shrink-0 items-center justify-center", children: checkable ? item.checked && (item.type === "radio" ? /* @__PURE__ */ jsx336("span", { className: "h-1.5 w-1.5 rounded-full bg-current" }) : /* @__PURE__ */ jsx336(CustomIcon_default, { icon: "Check", size: "sm" })) : React106.isValidElement(item.icon) ? item.icon : typeof item.icon === "string" ? /* @__PURE__ */ jsx336(CustomIcon_default, { icon: item.icon, size: "sm" }) : null }),
|
|
73627
|
+
/* @__PURE__ */ jsxs209("span", { className: "min-w-0 flex-1", children: [
|
|
73628
|
+
/* @__PURE__ */ jsx336("span", { className: "block truncate", children: item.label }),
|
|
73629
|
+
item.description && /* @__PURE__ */ jsx336("span", { className: "block text-xs font-normal opacity-70", children: item.description })
|
|
73630
|
+
] }),
|
|
73631
|
+
item.badge != null && /* @__PURE__ */ jsx336("span", { className: "shrink-0 text-xs", children: item.badge }),
|
|
73632
|
+
item.shortcut != null && /* @__PURE__ */ jsx336("span", { className: "shrink-0 text-xs opacity-60", children: item.shortcut }),
|
|
73633
|
+
item.trailing,
|
|
73634
|
+
nested && /* @__PURE__ */ jsx336(CollapseChevron, { "aria-hidden": "true", className: classNames142("h-3 w-3 shrink-0", !tiered && (expanded ? "-rotate-90" : "rotate-90")) })
|
|
73635
|
+
] });
|
|
73636
|
+
const rowProps = {
|
|
73637
|
+
id,
|
|
73638
|
+
role: checkable ? item.type === "radio" ? "menuitemradio" : "menuitemcheckbox" : "menuitem",
|
|
73639
|
+
"aria-label": label,
|
|
73640
|
+
"aria-disabled": item.disabled || void 0,
|
|
73641
|
+
"aria-checked": checkable ? Boolean(item.checked) : void 0,
|
|
73642
|
+
"aria-expanded": nested ? expanded : void 0,
|
|
73643
|
+
"aria-haspopup": nested && tiered ? "menu" : void 0,
|
|
73644
|
+
"aria-controls": nested && expanded ? `${id}-submenu` : void 0,
|
|
73645
|
+
"data-menu-action": "",
|
|
73646
|
+
"data-menu-text": label,
|
|
73647
|
+
tabIndex: -1,
|
|
73648
|
+
className: classNames142(
|
|
73649
|
+
"flex w-full items-center gap-2 rounded-lg text-left font-medium outline-none transition-colors",
|
|
73650
|
+
rowSizes[props.size ?? "md"],
|
|
73651
|
+
getSurfaceTriggerTokens(props.tone ?? "neutral").focusRing,
|
|
73652
|
+
item.disabled ? "cursor-not-allowed opacity-40" : item.danger ? "text-rose-700 hover:bg-rose-50 dark:text-rose-300 dark:hover:bg-rose-500/10" : [tokens.hoverBg, tokens.hoverText],
|
|
73653
|
+
expanded && !item.disabled && tokens.bg
|
|
73654
|
+
),
|
|
73655
|
+
onClick: activate,
|
|
73656
|
+
onKeyDown: (event) => {
|
|
73657
|
+
if (event.key === "ArrowRight" && nested) {
|
|
73658
|
+
event.preventDefault();
|
|
73659
|
+
event.stopPropagation();
|
|
73660
|
+
open(true);
|
|
73661
|
+
}
|
|
73662
|
+
if (event.key === " " && (item.href || item.to)) {
|
|
73663
|
+
event.preventDefault();
|
|
73664
|
+
event.currentTarget.click();
|
|
73665
|
+
}
|
|
73666
|
+
},
|
|
73667
|
+
onMouseEnter: () => {
|
|
73668
|
+
state.cancelLeave();
|
|
73669
|
+
if (tiered && !item.disabled) {
|
|
73670
|
+
if (nested) open(false);
|
|
73671
|
+
else state.setPath(state.path.slice(0, depth));
|
|
73672
|
+
}
|
|
73673
|
+
}
|
|
73674
|
+
};
|
|
73675
|
+
const row = item.to && !nested ? /* @__PURE__ */ jsx336(Link3, { ...rowProps, ref: (el) => {
|
|
73676
|
+
anchor.current = el;
|
|
73677
|
+
}, to: item.to, children: content }) : item.href && !nested ? /* @__PURE__ */ jsx336("a", { ...rowProps, ref: (el) => {
|
|
73678
|
+
anchor.current = el;
|
|
73679
|
+
}, href: item.href, target: item.target, rel: item.target === "_blank" ? "noopener noreferrer" : void 0, children: content }) : /* @__PURE__ */ jsx336("button", { ...rowProps, type: "button", ref: (el) => {
|
|
73680
|
+
anchor.current = el;
|
|
73681
|
+
}, children: content });
|
|
73682
|
+
const submenu = /* @__PURE__ */ jsxs209("div", { id: `${id}-submenu`, children: [
|
|
73683
|
+
item.items && /* @__PURE__ */ jsx336(MenuList, { items: item.items, state, depth: depth + 1, parentLabel: label, onBack: back, focusOnMount: state.keyboard.current }),
|
|
73684
|
+
item.content
|
|
73685
|
+
] });
|
|
73686
|
+
return /* @__PURE__ */ jsxs209("li", { role: "presentation", children: [
|
|
73687
|
+
row,
|
|
73688
|
+
nested && expanded && (tiered ? /* @__PURE__ */ jsx336(MenuPopup, { anchor, placement: "right", width: props.width ?? 256, children: /* @__PURE__ */ jsx336(MenuSurface, { state, children: submenu }) }) : /* @__PURE__ */ jsx336("div", { className: "ml-4 border-l border-neutral-200 pl-1 dark:border-white/10", children: submenu }))
|
|
73689
|
+
] });
|
|
73690
|
+
}
|
|
73691
|
+
function MenuSurface({ state, children, root = false }) {
|
|
73692
|
+
const { props } = state;
|
|
73693
|
+
return /* @__PURE__ */ jsx336("div", { "data-menu-owner": state.owner, onMouseEnter: state.cancelLeave, onMouseLeave: state.scheduleLeave, children: /* @__PURE__ */ jsxs209(
|
|
73694
|
+
Panel_default,
|
|
73695
|
+
{
|
|
73696
|
+
variant: props.variant ?? "outlined",
|
|
73697
|
+
tone: props.tone ?? "neutral",
|
|
73698
|
+
corner: props.corner,
|
|
73699
|
+
padding: props.padding ?? "xs",
|
|
73700
|
+
glassOpacity: props.glassOpacity,
|
|
73701
|
+
vibrancy: props.vibrancy,
|
|
73702
|
+
specularMode: props.specularMode,
|
|
73703
|
+
className: classNames142(
|
|
73704
|
+
root ? props.className : void 0,
|
|
73705
|
+
(!root || props.popup || props.trigger || props.anchorRef) && "backdrop-blur-xl"
|
|
73706
|
+
),
|
|
73707
|
+
children: [
|
|
73708
|
+
root && props.header && /* @__PURE__ */ jsx336("div", { className: "mb-2 border-b border-neutral-200 pb-2 dark:border-white/10", children: props.header }),
|
|
73709
|
+
/* @__PURE__ */ jsx336("div", { className: classNames142("overflow-auto", THIN_SCROLLBAR), style: { maxHeight: `min(${props.maxHeight ?? 400}px, calc(100dvh - 32px))` }, children }),
|
|
73710
|
+
root && props.footer && /* @__PURE__ */ jsx336("div", { className: "mt-2 border-t border-neutral-200 pt-2 dark:border-white/10", children: props.footer })
|
|
73711
|
+
]
|
|
73712
|
+
}
|
|
73713
|
+
) });
|
|
73714
|
+
}
|
|
73715
|
+
function Menu(props) {
|
|
73716
|
+
const owner = useId47();
|
|
73717
|
+
const triggerRef = useRef81(null);
|
|
73718
|
+
const anchor = props.anchorRef ?? triggerRef;
|
|
73719
|
+
const popup = props.popup ?? Boolean(props.trigger || props.anchorRef);
|
|
73720
|
+
const [internalOpen, setInternalOpen] = useState97(props.defaultOpen ?? false);
|
|
73721
|
+
const open = props.open ?? internalOpen;
|
|
73722
|
+
const [expanded, setExpanded] = useState97(props.defaultExpandedKeys ?? []);
|
|
73723
|
+
const [path, setPath] = useState97([]);
|
|
73724
|
+
const keyboard = useRef81(false);
|
|
73725
|
+
const leave = useRef81(void 0);
|
|
73726
|
+
const cancelLeave = useCallback53(() => clearTimeout(leave.current), []);
|
|
73727
|
+
const requestOpen = useCallback53((value) => {
|
|
73728
|
+
if (props.open === void 0) setInternalOpen(value);
|
|
73729
|
+
props.onOpenChange?.(value);
|
|
73730
|
+
if (!value) setPath([]);
|
|
73731
|
+
}, [props.open, props.onOpenChange]);
|
|
73732
|
+
const close = (restore = false) => {
|
|
73733
|
+
setPath([]);
|
|
73734
|
+
if (popup) requestOpen(false);
|
|
73735
|
+
if (restore) {
|
|
73736
|
+
if (anchor.current) anchor.current.focus();
|
|
73737
|
+
else {
|
|
73738
|
+
const root = Array.from(document.querySelectorAll("[data-menu-owner]")).find((el) => el.dataset.menuOwner === owner);
|
|
73739
|
+
root?.querySelector("[data-menu-action]:not([aria-disabled='true'])")?.focus();
|
|
73740
|
+
}
|
|
73741
|
+
}
|
|
73742
|
+
};
|
|
73743
|
+
useEffect81(() => {
|
|
73744
|
+
if (popup ? !open : path.length === 0) return;
|
|
73745
|
+
const outside = (event) => {
|
|
73746
|
+
const target = event.target;
|
|
73747
|
+
if (anchor.current?.contains(target)) return;
|
|
73748
|
+
const owned = Array.from(document.querySelectorAll("[data-menu-owner]")).some((el) => el.dataset.menuOwner === owner && el.contains(target));
|
|
73749
|
+
if (!owned) requestOpen(false);
|
|
73750
|
+
};
|
|
73751
|
+
document.addEventListener("pointerdown", outside);
|
|
73752
|
+
return () => document.removeEventListener("pointerdown", outside);
|
|
73753
|
+
}, [popup, open, path.length, anchor, owner, requestOpen]);
|
|
73754
|
+
useEffect81(() => () => clearTimeout(leave.current), []);
|
|
73755
|
+
const state = {
|
|
73756
|
+
owner,
|
|
73757
|
+
props,
|
|
73758
|
+
expanded: props.expandedKeys ?? expanded,
|
|
73759
|
+
path,
|
|
73760
|
+
setPath,
|
|
73761
|
+
close,
|
|
73762
|
+
keyboard,
|
|
73763
|
+
cancelLeave,
|
|
73764
|
+
scheduleLeave: () => {
|
|
73765
|
+
cancelLeave();
|
|
73766
|
+
if (path.length && !keyboard.current) leave.current = setTimeout(() => setPath([]), 250);
|
|
73767
|
+
},
|
|
73768
|
+
toggle: (id) => {
|
|
73769
|
+
const current = props.expandedKeys ?? expanded;
|
|
73770
|
+
const next = current.includes(id) ? current.filter((key) => key !== id) : [...current, id];
|
|
73771
|
+
if (props.expandedKeys === void 0) setExpanded(next);
|
|
73772
|
+
props.onExpandedKeysChange?.(next);
|
|
73773
|
+
}
|
|
73774
|
+
};
|
|
73775
|
+
const surface = /* @__PURE__ */ jsx336(MenuSurface, { state, root: true, children: /* @__PURE__ */ jsx336(MenuList, { items: props.items, state, focusOnMount: popup && open }) });
|
|
73776
|
+
let trigger = null;
|
|
73777
|
+
if (props.trigger) {
|
|
73778
|
+
const original = props.trigger.props;
|
|
73779
|
+
const originalRef = Number(React106.version.split(".")[0]) >= 19 ? original.ref : props.trigger.ref;
|
|
73780
|
+
trigger = cloneElement4(props.trigger, {
|
|
73781
|
+
ref: (el) => {
|
|
73782
|
+
triggerRef.current = el;
|
|
73783
|
+
if (typeof originalRef === "function") originalRef(el);
|
|
73784
|
+
else if (originalRef) originalRef.current = el;
|
|
73785
|
+
},
|
|
73786
|
+
"aria-haspopup": "menu",
|
|
73787
|
+
"aria-expanded": open,
|
|
73788
|
+
"aria-controls": open ? `${owner}-menu` : void 0,
|
|
73789
|
+
onClick: (event) => {
|
|
73790
|
+
original.onClick?.(event);
|
|
73791
|
+
if (!event.defaultPrevented) requestOpen(!open);
|
|
73792
|
+
},
|
|
73793
|
+
onKeyDown: (event) => {
|
|
73794
|
+
original.onKeyDown?.(event);
|
|
73795
|
+
if (!event.defaultPrevented && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
73796
|
+
event.preventDefault();
|
|
73797
|
+
requestOpen(true);
|
|
73798
|
+
}
|
|
73799
|
+
}
|
|
73800
|
+
});
|
|
73801
|
+
}
|
|
73802
|
+
return /* @__PURE__ */ jsxs209(Fragment54, { children: [
|
|
73803
|
+
trigger,
|
|
73804
|
+
popup ? open && /* @__PURE__ */ jsx336(MenuPopup, { anchor, placement: props.placement ?? "bottom", width: props.width ?? 256, children: surface }) : /* @__PURE__ */ jsx336("div", { style: { width: props.width ?? 256, maxWidth: "100%" }, children: surface })
|
|
73460
73805
|
] });
|
|
73461
73806
|
}
|
|
73462
73807
|
|
|
@@ -73467,12 +73812,12 @@ import {
|
|
|
73467
73812
|
useContext as useContext9,
|
|
73468
73813
|
useEffect as useEffect82,
|
|
73469
73814
|
useMemo as useMemo69,
|
|
73470
|
-
useRef as
|
|
73471
|
-
useState as
|
|
73815
|
+
useRef as useRef82,
|
|
73816
|
+
useState as useState98
|
|
73472
73817
|
} from "react";
|
|
73473
|
-
import { createPortal as
|
|
73474
|
-
import
|
|
73475
|
-
import { jsx as
|
|
73818
|
+
import { createPortal as createPortal20 } from "react-dom";
|
|
73819
|
+
import classNames143 from "classnames";
|
|
73820
|
+
import { jsx as jsx337, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
73476
73821
|
var BottomSheetContext = createContext9(null);
|
|
73477
73822
|
var TRANSITION_MS2 = 260;
|
|
73478
73823
|
var renderSlot = (slot, controls) => {
|
|
@@ -73484,9 +73829,9 @@ var renderSlot = (slot, controls) => {
|
|
|
73484
73829
|
var BottomSheetProvider = ({
|
|
73485
73830
|
children
|
|
73486
73831
|
}) => {
|
|
73487
|
-
const [sheet, setSheet] =
|
|
73488
|
-
const [isVisible, setIsVisible] =
|
|
73489
|
-
const pendingCloseRef =
|
|
73832
|
+
const [sheet, setSheet] = useState98(null);
|
|
73833
|
+
const [isVisible, setIsVisible] = useState98(false);
|
|
73834
|
+
const pendingCloseRef = useRef82(null);
|
|
73490
73835
|
const dismissSheet = useCallback54(() => {
|
|
73491
73836
|
setIsVisible(false);
|
|
73492
73837
|
}, []);
|
|
@@ -73541,12 +73886,12 @@ var BottomSheetProvider = ({
|
|
|
73541
73886
|
}),
|
|
73542
73887
|
[presentSheet, dismissSheet, sheet, isVisible]
|
|
73543
73888
|
);
|
|
73544
|
-
const overlayNode = typeof document !== "undefined" && sheet ?
|
|
73545
|
-
/* @__PURE__ */
|
|
73546
|
-
/* @__PURE__ */
|
|
73889
|
+
const overlayNode = typeof document !== "undefined" && sheet ? createPortal20(
|
|
73890
|
+
/* @__PURE__ */ jsxs210("div", { className: "pointer-events-none fixed inset-0 z-[70] flex items-end justify-center", children: [
|
|
73891
|
+
/* @__PURE__ */ jsx337(
|
|
73547
73892
|
"div",
|
|
73548
73893
|
{
|
|
73549
|
-
className:
|
|
73894
|
+
className: classNames143(
|
|
73550
73895
|
"absolute inset-0 bg-neutral-900/40 transition-opacity duration-300",
|
|
73551
73896
|
isVisible ? "opacity-100 pointer-events-auto" : "opacity-0"
|
|
73552
73897
|
),
|
|
@@ -73556,24 +73901,24 @@ var BottomSheetProvider = ({
|
|
|
73556
73901
|
}
|
|
73557
73902
|
}
|
|
73558
73903
|
),
|
|
73559
|
-
/* @__PURE__ */
|
|
73904
|
+
/* @__PURE__ */ jsx337("div", { className: "relative w-full max-w-4xl px-4 pb-4 sm:px-8", children: /* @__PURE__ */ jsxs210(
|
|
73560
73905
|
"section",
|
|
73561
73906
|
{
|
|
73562
73907
|
role: "dialog",
|
|
73563
73908
|
"aria-modal": "true",
|
|
73564
|
-
className:
|
|
73909
|
+
className: classNames143(
|
|
73565
73910
|
"pointer-events-auto ml-auto flex w-full flex-col rounded-t-3xl border border-slate-200 bg-white shadow-2xl transition-transform duration-300 dark:border-slate-700 dark:bg-slate-900",
|
|
73566
73911
|
sheet.className,
|
|
73567
73912
|
isVisible ? "translate-y-0" : "translate-y-full"
|
|
73568
73913
|
),
|
|
73569
73914
|
style: { minHeight: "25vh", maxHeight: "85vh" },
|
|
73570
73915
|
children: [
|
|
73571
|
-
/* @__PURE__ */
|
|
73572
|
-
/* @__PURE__ */
|
|
73573
|
-
sheet.title && /* @__PURE__ */
|
|
73574
|
-
sheet.description && /* @__PURE__ */
|
|
73916
|
+
/* @__PURE__ */ jsxs210("header", { className: "flex items-start justify-between gap-3 border-b border-slate-200 px-6 py-4 dark:border-slate-800", children: [
|
|
73917
|
+
/* @__PURE__ */ jsxs210("div", { className: "space-y-1", children: [
|
|
73918
|
+
sheet.title && /* @__PURE__ */ jsx337("div", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: sheet.title }),
|
|
73919
|
+
sheet.description && /* @__PURE__ */ jsx337("p", { className: "text-sm text-slate-500 dark:text-slate-300", children: sheet.description })
|
|
73575
73920
|
] }),
|
|
73576
|
-
(sheet.showCloseButton ?? true) && /* @__PURE__ */
|
|
73921
|
+
(sheet.showCloseButton ?? true) && /* @__PURE__ */ jsx337(
|
|
73577
73922
|
IconButton_default,
|
|
73578
73923
|
{
|
|
73579
73924
|
icon: "Close",
|
|
@@ -73585,15 +73930,15 @@ var BottomSheetProvider = ({
|
|
|
73585
73930
|
}
|
|
73586
73931
|
)
|
|
73587
73932
|
] }),
|
|
73588
|
-
/* @__PURE__ */
|
|
73589
|
-
sheet.actions && /* @__PURE__ */
|
|
73933
|
+
/* @__PURE__ */ jsx337("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: renderSlot(sheet.content, controls) ?? /* @__PURE__ */ jsx337("p", { className: "text-sm text-slate-500", children: "No content provided." }) }),
|
|
73934
|
+
sheet.actions && /* @__PURE__ */ jsx337("div", { className: "flex flex-wrap items-center justify-end gap-3 border-t border-slate-200 px-6 py-4 dark:border-slate-800", children: renderSlot(sheet.actions, controls) })
|
|
73590
73935
|
]
|
|
73591
73936
|
}
|
|
73592
73937
|
) })
|
|
73593
73938
|
] }),
|
|
73594
73939
|
document.body
|
|
73595
73940
|
) : null;
|
|
73596
|
-
return /* @__PURE__ */
|
|
73941
|
+
return /* @__PURE__ */ jsxs210(BottomSheetContext.Provider, { value: contextValue, children: [
|
|
73597
73942
|
children,
|
|
73598
73943
|
overlayNode
|
|
73599
73944
|
] });
|
|
@@ -74233,8 +74578,8 @@ var SYSTEM_VARIABLES = [
|
|
|
74233
74578
|
];
|
|
74234
74579
|
|
|
74235
74580
|
// src/components/MetricBar.tsx
|
|
74236
|
-
import
|
|
74237
|
-
import { jsx as
|
|
74581
|
+
import classNames144 from "classnames";
|
|
74582
|
+
import { jsx as jsx338 } from "react/jsx-runtime";
|
|
74238
74583
|
var MetricBar = ({
|
|
74239
74584
|
label,
|
|
74240
74585
|
value,
|
|
@@ -74244,7 +74589,7 @@ var MetricBar = ({
|
|
|
74244
74589
|
size = "sm",
|
|
74245
74590
|
className,
|
|
74246
74591
|
...rest
|
|
74247
|
-
}) => /* @__PURE__ */
|
|
74592
|
+
}) => /* @__PURE__ */ jsx338(
|
|
74248
74593
|
Progress_default,
|
|
74249
74594
|
{
|
|
74250
74595
|
...rest,
|
|
@@ -74254,13 +74599,13 @@ var MetricBar = ({
|
|
|
74254
74599
|
formatValue: value !== void 0 ? () => String(value) : void 0,
|
|
74255
74600
|
size,
|
|
74256
74601
|
color: tone ?? color ?? "blue",
|
|
74257
|
-
className:
|
|
74602
|
+
className: classNames144("w-full", className)
|
|
74258
74603
|
}
|
|
74259
74604
|
);
|
|
74260
74605
|
MetricBar.displayName = "MetricBar";
|
|
74261
74606
|
|
|
74262
74607
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
74263
|
-
import { useEffect as useEffect84, useId as
|
|
74608
|
+
import { useEffect as useEffect84, useId as useId48, useMemo as useMemo70, useRef as useRef84, useState as useState100 } from "react";
|
|
74264
74609
|
|
|
74265
74610
|
// src/components/NetworkGraph/model.ts
|
|
74266
74611
|
var CELL = 64;
|
|
@@ -74404,16 +74749,16 @@ function findNetworkPath(edges, source, target) {
|
|
|
74404
74749
|
}
|
|
74405
74750
|
|
|
74406
74751
|
// src/components/NetworkGraph/useNetworkCanvas.ts
|
|
74407
|
-
import { useCallback as useCallback55, useEffect as useEffect83, useRef as
|
|
74752
|
+
import { useCallback as useCallback55, useEffect as useEffect83, useRef as useRef83, useState as useState99 } from "react";
|
|
74408
74753
|
function useNetworkCanvas(options) {
|
|
74409
|
-
const canvasRef =
|
|
74410
|
-
const view =
|
|
74411
|
-
const size =
|
|
74412
|
-
const latest =
|
|
74413
|
-
const frame =
|
|
74414
|
-
const [zoom, setZoom] =
|
|
74415
|
-
const colors3 =
|
|
74416
|
-
const textColor =
|
|
74754
|
+
const canvasRef = useRef83(null);
|
|
74755
|
+
const view = useRef83({ x: 0, y: 0, zoom: 1 });
|
|
74756
|
+
const size = useRef83({ width: 1, height: 1 });
|
|
74757
|
+
const latest = useRef83(options);
|
|
74758
|
+
const frame = useRef83(null);
|
|
74759
|
+
const [zoom, setZoom] = useState99(1);
|
|
74760
|
+
const colors3 = useRef83(/* @__PURE__ */ new Map());
|
|
74761
|
+
const textColor = useRef83("#737373");
|
|
74417
74762
|
const draw = useCallback55(() => {
|
|
74418
74763
|
const canvas = canvasRef.current;
|
|
74419
74764
|
const ctx = canvas?.getContext("2d");
|
|
@@ -74614,7 +74959,7 @@ function useNetworkCanvas(options) {
|
|
|
74614
74959
|
}
|
|
74615
74960
|
|
|
74616
74961
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
74617
|
-
import { jsx as
|
|
74962
|
+
import { jsx as jsx339, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
74618
74963
|
var NO_COMMUNITIES = [];
|
|
74619
74964
|
var NO_HIGHLIGHTS = [];
|
|
74620
74965
|
function NetworkGraph({
|
|
@@ -74645,9 +74990,9 @@ function NetworkGraph({
|
|
|
74645
74990
|
...panelProps
|
|
74646
74991
|
}) {
|
|
74647
74992
|
const t = useKitT();
|
|
74648
|
-
const helpId =
|
|
74649
|
-
const layoutRef =
|
|
74650
|
-
const [hasLegendSpace, setHasLegendSpace] =
|
|
74993
|
+
const helpId = useId48();
|
|
74994
|
+
const layoutRef = useRef84(null);
|
|
74995
|
+
const [hasLegendSpace, setHasLegendSpace] = useState100(true);
|
|
74651
74996
|
const legendOnRight = legendPosition === "right" || legendPosition === "auto" && hasLegendSpace;
|
|
74652
74997
|
useEffect84(() => {
|
|
74653
74998
|
const element = layoutRef.current;
|
|
@@ -74662,12 +75007,12 @@ function NetworkGraph({
|
|
|
74662
75007
|
() => buildNetwork(nodes, edges, communities),
|
|
74663
75008
|
[nodes, edges, communities]
|
|
74664
75009
|
);
|
|
74665
|
-
const [internalSelected, setInternalSelected] =
|
|
75010
|
+
const [internalSelected, setInternalSelected] = useState100(
|
|
74666
75011
|
defaultSelectedNodeId
|
|
74667
75012
|
);
|
|
74668
|
-
const [hidden, setHidden] =
|
|
74669
|
-
const [focused, setFocused] =
|
|
74670
|
-
const [query, setQuery] =
|
|
75013
|
+
const [hidden, setHidden] = useState100(() => /* @__PURE__ */ new Set());
|
|
75014
|
+
const [focused, setFocused] = useState100(null);
|
|
75015
|
+
const [query, setQuery] = useState100("");
|
|
74671
75016
|
const enabled = useMemo70(
|
|
74672
75017
|
() => new Set(
|
|
74673
75018
|
visibleCommunityIds ?? model.groups.filter((g) => !hidden.has(g.id)).map((g) => g.id)
|
|
@@ -74709,7 +75054,7 @@ function NetworkGraph({
|
|
|
74709
75054
|
onViewportChange
|
|
74710
75055
|
});
|
|
74711
75056
|
const locked = disabled || loading;
|
|
74712
|
-
const drag =
|
|
75057
|
+
const drag = useRef84(null);
|
|
74713
75058
|
const select = (id) => {
|
|
74714
75059
|
if (locked) return;
|
|
74715
75060
|
if (selectedNodeId === void 0) setInternalSelected(id);
|
|
@@ -74780,7 +75125,7 @@ function NetworkGraph({
|
|
|
74780
75125
|
}, [visibleNodes, query]);
|
|
74781
75126
|
const graphHeight = Number.isFinite(height) ? Math.max(160, height) : 480;
|
|
74782
75127
|
const resolvedLegendTone = legendTone === "auto" ? tone : legendTone;
|
|
74783
|
-
const legendContent = /* @__PURE__ */
|
|
75128
|
+
const legendContent = /* @__PURE__ */ jsxs211(
|
|
74784
75129
|
"fieldset",
|
|
74785
75130
|
{
|
|
74786
75131
|
disabled: locked,
|
|
@@ -74789,8 +75134,8 @@ function NetworkGraph({
|
|
|
74789
75134
|
maxHeight: legendPanel ? Math.max(96, graphHeight - 64) : graphHeight
|
|
74790
75135
|
},
|
|
74791
75136
|
children: [
|
|
74792
|
-
/* @__PURE__ */
|
|
74793
|
-
/* @__PURE__ */
|
|
75137
|
+
/* @__PURE__ */ jsx339("legend", { className: "mb-3 text-xs font-semibold uppercase tracking-widest", children: t("kit.networkGraph.communities") }),
|
|
75138
|
+
/* @__PURE__ */ jsx339(
|
|
74794
75139
|
Checkbox_default,
|
|
74795
75140
|
{
|
|
74796
75141
|
size: "sm",
|
|
@@ -74801,8 +75146,8 @@ function NetworkGraph({
|
|
|
74801
75146
|
onChange: (event) => filter(event.target.checked ? model.groups.map((g) => g.id) : [])
|
|
74802
75147
|
}
|
|
74803
75148
|
),
|
|
74804
|
-
model.groups.map((group) => /* @__PURE__ */
|
|
74805
|
-
/* @__PURE__ */
|
|
75149
|
+
model.groups.map((group) => /* @__PURE__ */ jsxs211("div", { className: "flex items-center justify-between gap-2", children: [
|
|
75150
|
+
/* @__PURE__ */ jsx339(
|
|
74806
75151
|
Checkbox_default,
|
|
74807
75152
|
{
|
|
74808
75153
|
size: "sm",
|
|
@@ -74814,12 +75159,12 @@ function NetworkGraph({
|
|
|
74814
75159
|
)
|
|
74815
75160
|
}
|
|
74816
75161
|
),
|
|
74817
|
-
/* @__PURE__ */
|
|
75162
|
+
/* @__PURE__ */ jsx339("span", { className: "text-xs tabular-nums opacity-60", children: counts.get(group.id) ?? 0 })
|
|
74818
75163
|
] }, group.id))
|
|
74819
75164
|
]
|
|
74820
75165
|
}
|
|
74821
75166
|
);
|
|
74822
|
-
return /* @__PURE__ */
|
|
75167
|
+
return /* @__PURE__ */ jsx339(
|
|
74823
75168
|
Panel_default,
|
|
74824
75169
|
{
|
|
74825
75170
|
...panelProps,
|
|
@@ -74830,7 +75175,7 @@ function NetworkGraph({
|
|
|
74830
75175
|
loading,
|
|
74831
75176
|
clickable: false,
|
|
74832
75177
|
scrollable: false,
|
|
74833
|
-
children: /* @__PURE__ */
|
|
75178
|
+
children: /* @__PURE__ */ jsxs211(
|
|
74834
75179
|
"div",
|
|
74835
75180
|
{
|
|
74836
75181
|
className: "flex min-w-0 flex-col gap-3",
|
|
@@ -74838,7 +75183,7 @@ function NetworkGraph({
|
|
|
74838
75183
|
"aria-label": ariaLabel ?? t("kit.networkGraph.name"),
|
|
74839
75184
|
"aria-disabled": locked || void 0,
|
|
74840
75185
|
children: [
|
|
74841
|
-
showControls && /* @__PURE__ */
|
|
75186
|
+
showControls && /* @__PURE__ */ jsx339("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ jsx339("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ jsx339(
|
|
74842
75187
|
Combobox_default,
|
|
74843
75188
|
{
|
|
74844
75189
|
size: "sm",
|
|
@@ -74860,7 +75205,7 @@ function NetworkGraph({
|
|
|
74860
75205
|
}
|
|
74861
75206
|
}
|
|
74862
75207
|
) }) }),
|
|
74863
|
-
/* @__PURE__ */
|
|
75208
|
+
/* @__PURE__ */ jsxs211(
|
|
74864
75209
|
"div",
|
|
74865
75210
|
{
|
|
74866
75211
|
ref: layoutRef,
|
|
@@ -74868,13 +75213,13 @@ function NetworkGraph({
|
|
|
74868
75213
|
style: { flexDirection: legendOnRight ? "row" : "column" },
|
|
74869
75214
|
"data-legend-position": legendOnRight ? "right" : "bottom",
|
|
74870
75215
|
children: [
|
|
74871
|
-
/* @__PURE__ */
|
|
75216
|
+
/* @__PURE__ */ jsxs211(
|
|
74872
75217
|
"div",
|
|
74873
75218
|
{
|
|
74874
75219
|
className: "relative min-w-0 flex-1",
|
|
74875
75220
|
style: { height: graphHeight, minHeight: graphHeight },
|
|
74876
75221
|
children: [
|
|
74877
|
-
/* @__PURE__ */
|
|
75222
|
+
/* @__PURE__ */ jsx339(
|
|
74878
75223
|
"canvas",
|
|
74879
75224
|
{
|
|
74880
75225
|
ref: canvas.canvasRef,
|
|
@@ -74943,11 +75288,11 @@ function NetworkGraph({
|
|
|
74943
75288
|
}
|
|
74944
75289
|
}
|
|
74945
75290
|
),
|
|
74946
|
-
showControls && /* @__PURE__ */
|
|
74947
|
-
/* @__PURE__ */
|
|
75291
|
+
showControls && /* @__PURE__ */ jsxs211("div", { className: "absolute bottom-3 right-3 z-10 flex items-center gap-0.5 rounded-lg border border-neutral-200 bg-white/90 p-1 shadow-sm backdrop-blur dark:border-neutral-700 dark:bg-neutral-900/90", children: [
|
|
75292
|
+
/* @__PURE__ */ jsx339(
|
|
74948
75293
|
IconButton_default,
|
|
74949
75294
|
{
|
|
74950
|
-
icon: /* @__PURE__ */
|
|
75295
|
+
icon: /* @__PURE__ */ jsxs211(
|
|
74951
75296
|
"svg",
|
|
74952
75297
|
{
|
|
74953
75298
|
viewBox: "0 0 24 24",
|
|
@@ -74958,10 +75303,10 @@ function NetworkGraph({
|
|
|
74958
75303
|
strokeLinejoin: "round",
|
|
74959
75304
|
"aria-hidden": "true",
|
|
74960
75305
|
children: [
|
|
74961
|
-
/* @__PURE__ */
|
|
74962
|
-
/* @__PURE__ */
|
|
74963
|
-
/* @__PURE__ */
|
|
74964
|
-
/* @__PURE__ */
|
|
75306
|
+
/* @__PURE__ */ jsx339("path", { d: "M4 9V5a1 1 0 0 1 1-1h4" }),
|
|
75307
|
+
/* @__PURE__ */ jsx339("path", { d: "M15 4h4a1 1 0 0 1 1 1v4" }),
|
|
75308
|
+
/* @__PURE__ */ jsx339("path", { d: "M20 15v4a1 1 0 0 1-1 1h-4" }),
|
|
75309
|
+
/* @__PURE__ */ jsx339("path", { d: "M9 20H5a1 1 0 0 1-1-1v-4" })
|
|
74965
75310
|
]
|
|
74966
75311
|
}
|
|
74967
75312
|
),
|
|
@@ -74974,10 +75319,10 @@ function NetworkGraph({
|
|
|
74974
75319
|
onClick: canvas.fit
|
|
74975
75320
|
}
|
|
74976
75321
|
),
|
|
74977
|
-
/* @__PURE__ */
|
|
75322
|
+
/* @__PURE__ */ jsx339(
|
|
74978
75323
|
IconButton_default,
|
|
74979
75324
|
{
|
|
74980
|
-
icon: /* @__PURE__ */
|
|
75325
|
+
icon: /* @__PURE__ */ jsx339(
|
|
74981
75326
|
"svg",
|
|
74982
75327
|
{
|
|
74983
75328
|
viewBox: "0 0 24 24",
|
|
@@ -74986,7 +75331,7 @@ function NetworkGraph({
|
|
|
74986
75331
|
strokeWidth: 2,
|
|
74987
75332
|
strokeLinecap: "round",
|
|
74988
75333
|
"aria-hidden": "true",
|
|
74989
|
-
children: /* @__PURE__ */
|
|
75334
|
+
children: /* @__PURE__ */ jsx339("path", { d: "M6 12h12" })
|
|
74990
75335
|
}
|
|
74991
75336
|
),
|
|
74992
75337
|
size: "xs",
|
|
@@ -74998,7 +75343,7 @@ function NetworkGraph({
|
|
|
74998
75343
|
onClick: () => canvas.zoomBy(0.8)
|
|
74999
75344
|
}
|
|
75000
75345
|
),
|
|
75001
|
-
/* @__PURE__ */
|
|
75346
|
+
/* @__PURE__ */ jsxs211(
|
|
75002
75347
|
"span",
|
|
75003
75348
|
{
|
|
75004
75349
|
className: "min-w-[3.5ch] px-1 text-center text-[11px] tabular-nums text-neutral-500 dark:text-neutral-400",
|
|
@@ -75009,7 +75354,7 @@ function NetworkGraph({
|
|
|
75009
75354
|
]
|
|
75010
75355
|
}
|
|
75011
75356
|
),
|
|
75012
|
-
/* @__PURE__ */
|
|
75357
|
+
/* @__PURE__ */ jsx339(
|
|
75013
75358
|
IconButton_default,
|
|
75014
75359
|
{
|
|
75015
75360
|
icon: "Add",
|
|
@@ -75022,7 +75367,7 @@ function NetworkGraph({
|
|
|
75022
75367
|
onClick: () => canvas.zoomBy(1.25)
|
|
75023
75368
|
}
|
|
75024
75369
|
),
|
|
75025
|
-
/* @__PURE__ */
|
|
75370
|
+
/* @__PURE__ */ jsx339(
|
|
75026
75371
|
IconButton_default,
|
|
75027
75372
|
{
|
|
75028
75373
|
icon: "Reset",
|
|
@@ -75040,18 +75385,18 @@ function NetworkGraph({
|
|
|
75040
75385
|
}
|
|
75041
75386
|
)
|
|
75042
75387
|
] }),
|
|
75043
|
-
!visibleNodes.length && /* @__PURE__ */
|
|
75388
|
+
!visibleNodes.length && /* @__PURE__ */ jsx339("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-sm", children: emptyMessage ?? t("kit.networkGraph.empty") })
|
|
75044
75389
|
]
|
|
75045
75390
|
}
|
|
75046
75391
|
),
|
|
75047
|
-
showCommunities && model.groups.length > 0 && /* @__PURE__ */
|
|
75392
|
+
showCommunities && model.groups.length > 0 && /* @__PURE__ */ jsx339(
|
|
75048
75393
|
"div",
|
|
75049
75394
|
{
|
|
75050
75395
|
className: "min-w-0 shrink-0",
|
|
75051
75396
|
style: {
|
|
75052
75397
|
width: legendOnRight ? legendPanel ? 224 : 192 : "100%"
|
|
75053
75398
|
},
|
|
75054
|
-
children: legendPanel ? /* @__PURE__ */
|
|
75399
|
+
children: legendPanel ? /* @__PURE__ */ jsx339(
|
|
75055
75400
|
Panel_default,
|
|
75056
75401
|
{
|
|
75057
75402
|
variant: legendVariant === "auto" ? variant : legendVariant,
|
|
@@ -75070,8 +75415,8 @@ function NetworkGraph({
|
|
|
75070
75415
|
]
|
|
75071
75416
|
}
|
|
75072
75417
|
),
|
|
75073
|
-
/* @__PURE__ */
|
|
75074
|
-
/* @__PURE__ */
|
|
75418
|
+
/* @__PURE__ */ jsx339("p", { id: helpId, className: "text-xs opacity-70", children: t("kit.networkGraph.instructions") }),
|
|
75419
|
+
/* @__PURE__ */ jsx339(
|
|
75075
75420
|
"p",
|
|
75076
75421
|
{
|
|
75077
75422
|
role: "status",
|
|
@@ -75259,11 +75604,13 @@ export {
|
|
|
75259
75604
|
LOADER_VARIANTS,
|
|
75260
75605
|
LOCK_TTL_MS,
|
|
75261
75606
|
Loader_default as Loader,
|
|
75607
|
+
SURFACE_VARIANTS as MENU_VARIANTS,
|
|
75262
75608
|
METERGROUP_ORIENTATIONS,
|
|
75263
75609
|
MODAL_POSITIONS,
|
|
75264
75610
|
MS_DAY,
|
|
75265
75611
|
MULTI_TOGGLE_INDICATORS,
|
|
75266
75612
|
MULTI_TOGGLE_VARIANTS,
|
|
75613
|
+
Menu,
|
|
75267
75614
|
MeterGroup_default as MeterGroup,
|
|
75268
75615
|
MetricBar,
|
|
75269
75616
|
Modal_default as Modal,
|
|
@@ -75283,9 +75630,12 @@ export {
|
|
|
75283
75630
|
OTP_VARIANTS,
|
|
75284
75631
|
OrganizationChart_default as OrganizationChart,
|
|
75285
75632
|
PAGED_PANEL_LOADERS,
|
|
75633
|
+
PAGE_BODY_LAYOUT_VARIANTS,
|
|
75286
75634
|
SURFACE_VARIANTS as PAGE_HEADER_VARIANTS,
|
|
75287
75635
|
PANEL_HERO_TITLE_ELEMENTS,
|
|
75288
75636
|
PANEL_HERO_VARIANTS,
|
|
75637
|
+
PANEL_SLIDE_DURATION_MS,
|
|
75638
|
+
PANEL_SLIDE_EASING,
|
|
75289
75639
|
PANEL_TONE_FOR_FIELD,
|
|
75290
75640
|
PANE_EMPTY_STATE_SIZE,
|
|
75291
75641
|
PILL_CORNERS,
|
|
@@ -75676,6 +76026,7 @@ export {
|
|
|
75676
76026
|
normalizeString,
|
|
75677
76027
|
normalizeStringToUpper,
|
|
75678
76028
|
oklchToHex,
|
|
76029
|
+
panelSlideTransition,
|
|
75679
76030
|
parseImageSource,
|
|
75680
76031
|
parseMessage,
|
|
75681
76032
|
parseSmartVariable,
|