@cjlapao/ui-kit 0.2.14 → 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-sug3nUbg.d.cts → CapsuleBlueprint-GfFJiLUb.d.cts} +1 -1
- package/dist/{CapsuleBlueprint-sug3nUbg.d.ts → CapsuleBlueprint-GfFJiLUb.d.ts} +1 -1
- package/dist/index.cjs +656 -302
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +6 -0
- package/dist/index.d.cts +64 -3
- package/dist/index.d.ts +64 -3
- package/dist/index.js +648 -296
- package/dist/index.js.map +1 -1
- package/dist/markdown.d.cts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -195,11 +195,13 @@ __export(src_exports, {
|
|
|
195
195
|
LOADER_VARIANTS: () => LOADER_VARIANTS,
|
|
196
196
|
LOCK_TTL_MS: () => LOCK_TTL_MS,
|
|
197
197
|
Loader: () => Loader_default,
|
|
198
|
+
MENU_VARIANTS: () => SURFACE_VARIANTS,
|
|
198
199
|
METERGROUP_ORIENTATIONS: () => METERGROUP_ORIENTATIONS,
|
|
199
200
|
MODAL_POSITIONS: () => MODAL_POSITIONS,
|
|
200
201
|
MS_DAY: () => MS_DAY,
|
|
201
202
|
MULTI_TOGGLE_INDICATORS: () => MULTI_TOGGLE_INDICATORS,
|
|
202
203
|
MULTI_TOGGLE_VARIANTS: () => MULTI_TOGGLE_VARIANTS,
|
|
204
|
+
Menu: () => Menu,
|
|
203
205
|
MeterGroup: () => MeterGroup_default,
|
|
204
206
|
MetricBar: () => MetricBar,
|
|
205
207
|
Modal: () => Modal_default,
|
|
@@ -7685,13 +7687,13 @@ var Parser = class _Parser {
|
|
|
7685
7687
|
/** Parse a message body (top-level or a branch body — see parseBranchBody). */
|
|
7686
7688
|
parseMessage(inPluralBranch = false) {
|
|
7687
7689
|
const nodes = [];
|
|
7688
|
-
let
|
|
7690
|
+
let text2 = "";
|
|
7689
7691
|
let pendingSpace = false;
|
|
7690
7692
|
let hasContent = false;
|
|
7691
7693
|
const flushText = () => {
|
|
7692
|
-
if (
|
|
7693
|
-
nodes.push({ type: "text", value:
|
|
7694
|
-
|
|
7694
|
+
if (text2 !== "") {
|
|
7695
|
+
nodes.push({ type: "text", value: text2 });
|
|
7696
|
+
text2 = "";
|
|
7695
7697
|
}
|
|
7696
7698
|
};
|
|
7697
7699
|
while (this.pos < this.src.length) {
|
|
@@ -7699,19 +7701,19 @@ var Parser = class _Parser {
|
|
|
7699
7701
|
if (ch === "\\") {
|
|
7700
7702
|
if (this.src[this.pos + 1] === "'") {
|
|
7701
7703
|
if (pendingSpace) {
|
|
7702
|
-
|
|
7704
|
+
text2 += " ";
|
|
7703
7705
|
pendingSpace = false;
|
|
7704
7706
|
}
|
|
7705
|
-
|
|
7707
|
+
text2 += "'";
|
|
7706
7708
|
this.pos += 2;
|
|
7707
7709
|
hasContent = true;
|
|
7708
7710
|
continue;
|
|
7709
7711
|
}
|
|
7710
7712
|
if (pendingSpace) {
|
|
7711
|
-
|
|
7713
|
+
text2 += " ";
|
|
7712
7714
|
pendingSpace = false;
|
|
7713
7715
|
}
|
|
7714
|
-
|
|
7716
|
+
text2 += ch;
|
|
7715
7717
|
this.pos += 1;
|
|
7716
7718
|
hasContent = true;
|
|
7717
7719
|
continue;
|
|
@@ -7719,16 +7721,16 @@ var Parser = class _Parser {
|
|
|
7719
7721
|
if (ch === "'") {
|
|
7720
7722
|
if (this.src[this.pos + 1] === "'") {
|
|
7721
7723
|
if (pendingSpace) {
|
|
7722
|
-
|
|
7724
|
+
text2 += " ";
|
|
7723
7725
|
pendingSpace = false;
|
|
7724
7726
|
}
|
|
7725
|
-
|
|
7727
|
+
text2 += "'";
|
|
7726
7728
|
this.pos += 2;
|
|
7727
7729
|
hasContent = true;
|
|
7728
7730
|
continue;
|
|
7729
7731
|
}
|
|
7730
7732
|
if (pendingSpace) {
|
|
7731
|
-
|
|
7733
|
+
text2 += " ";
|
|
7732
7734
|
pendingSpace = false;
|
|
7733
7735
|
}
|
|
7734
7736
|
this.pos += 1;
|
|
@@ -7740,13 +7742,13 @@ var Parser = class _Parser {
|
|
|
7740
7742
|
throw this.err("unterminated quoted section \u2014 a ' opened without a closing '");
|
|
7741
7743
|
}
|
|
7742
7744
|
this.pos += 1;
|
|
7743
|
-
|
|
7745
|
+
text2 += inner;
|
|
7744
7746
|
hasContent = true;
|
|
7745
7747
|
continue;
|
|
7746
7748
|
}
|
|
7747
7749
|
if (ch === "{") {
|
|
7748
7750
|
if (pendingSpace) {
|
|
7749
|
-
|
|
7751
|
+
text2 += " ";
|
|
7750
7752
|
pendingSpace = false;
|
|
7751
7753
|
}
|
|
7752
7754
|
flushText();
|
|
@@ -7759,7 +7761,7 @@ var Parser = class _Parser {
|
|
|
7759
7761
|
}
|
|
7760
7762
|
if (inPluralBranch && ch === "#") {
|
|
7761
7763
|
if (pendingSpace) {
|
|
7762
|
-
|
|
7764
|
+
text2 += " ";
|
|
7763
7765
|
pendingSpace = false;
|
|
7764
7766
|
}
|
|
7765
7767
|
flushText();
|
|
@@ -7774,10 +7776,10 @@ var Parser = class _Parser {
|
|
|
7774
7776
|
continue;
|
|
7775
7777
|
}
|
|
7776
7778
|
if (pendingSpace) {
|
|
7777
|
-
|
|
7779
|
+
text2 += " ";
|
|
7778
7780
|
pendingSpace = false;
|
|
7779
7781
|
}
|
|
7780
|
-
|
|
7782
|
+
text2 += ch;
|
|
7781
7783
|
hasContent = true;
|
|
7782
7784
|
this.pos += 1;
|
|
7783
7785
|
}
|
|
@@ -8215,8 +8217,8 @@ var FULL_MONTH_REGEX = new RegExp(
|
|
|
8215
8217
|
"gi"
|
|
8216
8218
|
);
|
|
8217
8219
|
var escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
8218
|
-
var normalizeToEnglishNames = (
|
|
8219
|
-
let out =
|
|
8220
|
+
var normalizeToEnglishNames = (text2, names) => {
|
|
8221
|
+
let out = text2;
|
|
8220
8222
|
const mapSet = (source, target) => {
|
|
8221
8223
|
if (!source) return;
|
|
8222
8224
|
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);
|
|
@@ -8233,21 +8235,21 @@ var normalizeToEnglishNames = (text, names) => {
|
|
|
8233
8235
|
mapSet(names.weekdayShort, WEEKDAY_LABELS_SHORT);
|
|
8234
8236
|
return out;
|
|
8235
8237
|
};
|
|
8236
|
-
var abbreviateMonthNames = (
|
|
8238
|
+
var abbreviateMonthNames = (text2) => text2.replace(
|
|
8237
8239
|
FULL_MONTH_REGEX,
|
|
8238
8240
|
(match) => MONTH_NAME_TO_ABBR[match.toLowerCase()] ?? match
|
|
8239
8241
|
);
|
|
8240
8242
|
var ABBR_MONTH_REGEX = /\b(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\b/g;
|
|
8241
|
-
var expandMonthNames = (
|
|
8243
|
+
var expandMonthNames = (text2) => text2.replace(ABBR_MONTH_REGEX, (match) => {
|
|
8242
8244
|
const expanded = MONTH_ABBR_TO_NAME[match.toLowerCase()];
|
|
8243
8245
|
return expanded ? `${expanded.charAt(0) + expanded.slice(1).toLowerCase()}` : match;
|
|
8244
8246
|
});
|
|
8245
|
-
var parseCandidates = (
|
|
8246
|
-
const candidates = [
|
|
8247
|
+
var parseCandidates = (text2) => {
|
|
8248
|
+
const candidates = [text2, abbreviateMonthNames(text2), expandMonthNames(text2)];
|
|
8247
8249
|
return [...new Set(candidates)];
|
|
8248
8250
|
};
|
|
8249
|
-
var parseDateText = (
|
|
8250
|
-
const trimmed =
|
|
8251
|
+
var parseDateText = (text2, formatString = DEFAULT_DATE_FORMAT, reference = /* @__PURE__ */ new Date(), names) => {
|
|
8252
|
+
const trimmed = text2.trim();
|
|
8251
8253
|
if (!trimmed) return null;
|
|
8252
8254
|
const candidates = /* @__PURE__ */ new Set();
|
|
8253
8255
|
for (const candidate of parseCandidates(trimmed)) candidates.add(candidate);
|
|
@@ -8264,13 +8266,13 @@ var parseDateText = (text, formatString = DEFAULT_DATE_FORMAT, reference = /* @_
|
|
|
8264
8266
|
}
|
|
8265
8267
|
return null;
|
|
8266
8268
|
};
|
|
8267
|
-
var parseValueText = (
|
|
8268
|
-
const trimmed =
|
|
8269
|
+
var parseValueText = (text2, selectionMode = "single", formatString = DEFAULT_DATE_FORMAT, reference = /* @__PURE__ */ new Date(), names) => {
|
|
8270
|
+
const trimmed = text2.trim();
|
|
8269
8271
|
if (!trimmed) return null;
|
|
8270
8272
|
if (selectionMode === "single") {
|
|
8271
8273
|
return parseDateText(trimmed, formatString, reference, names);
|
|
8272
8274
|
}
|
|
8273
|
-
const withTrailingSeparator = /\s-$/.test(
|
|
8275
|
+
const withTrailingSeparator = /\s-$/.test(text2) ? `${text2} ` : text2;
|
|
8274
8276
|
const parts = withTrailingSeparator.split(RANGE_SEPARATOR);
|
|
8275
8277
|
if (parts.length !== 2) return null;
|
|
8276
8278
|
const start = parseDateText(parts[0], formatString, reference, names);
|
|
@@ -10794,9 +10796,9 @@ var sizeTokens = {
|
|
|
10794
10796
|
}
|
|
10795
10797
|
}
|
|
10796
10798
|
};
|
|
10797
|
-
var SpinnerLabel = ({ text }) => {
|
|
10799
|
+
var SpinnerLabel = ({ text: text2 }) => {
|
|
10798
10800
|
const surface = useSurfaceText();
|
|
10799
|
-
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("span", { className: (0, import_classnames4.default)("text-sm font-medium", surface.body), children:
|
|
10801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("span", { className: (0, import_classnames4.default)("text-sm font-medium", surface.body), children: text2 });
|
|
10800
10802
|
};
|
|
10801
10803
|
var Spinner = import_react151.default.forwardRef(
|
|
10802
10804
|
({
|
|
@@ -11099,7 +11101,7 @@ var TOOLTIP_ARROW_BORDER = {
|
|
|
11099
11101
|
// src/components/TooltipWrapper.tsx
|
|
11100
11102
|
var import_jsx_runtime154 = require("react/jsx-runtime");
|
|
11101
11103
|
var TooltipWrapper = ({
|
|
11102
|
-
text,
|
|
11104
|
+
text: text2,
|
|
11103
11105
|
delay = 500,
|
|
11104
11106
|
position = "top",
|
|
11105
11107
|
variant = "surface",
|
|
@@ -11120,12 +11122,12 @@ var TooltipWrapper = ({
|
|
|
11120
11122
|
};
|
|
11121
11123
|
}, []);
|
|
11122
11124
|
(0, import_react152.useEffect)(() => {
|
|
11123
|
-
if (!
|
|
11125
|
+
if (!text2 && visible) {
|
|
11124
11126
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
11125
11127
|
setVisible(false);
|
|
11126
11128
|
setPlacement(null);
|
|
11127
11129
|
}
|
|
11128
|
-
}, [
|
|
11130
|
+
}, [text2, visible]);
|
|
11129
11131
|
const measure = (0, import_react152.useCallback)(() => {
|
|
11130
11132
|
const el = tooltipRef.current;
|
|
11131
11133
|
const trigger = triggerRectRef.current;
|
|
@@ -11173,7 +11175,7 @@ var TooltipWrapper = ({
|
|
|
11173
11175
|
}, [visible, measure]);
|
|
11174
11176
|
const show = (0, import_react152.useCallback)(
|
|
11175
11177
|
(e) => {
|
|
11176
|
-
if (
|
|
11178
|
+
if (text2) {
|
|
11177
11179
|
setColorScheme(
|
|
11178
11180
|
e.currentTarget.closest("[data-color-scheme]")?.getAttribute("data-color-scheme") ?? null
|
|
11179
11181
|
);
|
|
@@ -11187,7 +11189,7 @@ var TooltipWrapper = ({
|
|
|
11187
11189
|
children.props.onMouseEnter?.(e);
|
|
11188
11190
|
}
|
|
11189
11191
|
},
|
|
11190
|
-
[
|
|
11192
|
+
[text2, delay, children.props]
|
|
11191
11193
|
);
|
|
11192
11194
|
const hide = (0, import_react152.useCallback)(
|
|
11193
11195
|
(e) => {
|
|
@@ -11210,7 +11212,7 @@ var TooltipWrapper = ({
|
|
|
11210
11212
|
// The WAI pattern for tooltips: the relationship is declared only while
|
|
11211
11213
|
// the tooltip exists — a permanent `aria-describedby` to an absent id is
|
|
11212
11214
|
// a dangling reference most readers skip silently.
|
|
11213
|
-
"aria-describedby": visible &&
|
|
11215
|
+
"aria-describedby": visible && text2 ? tooltipId : void 0,
|
|
11214
11216
|
onMouseEnter: show,
|
|
11215
11217
|
onMouseLeave: hide,
|
|
11216
11218
|
onFocus: show,
|
|
@@ -11221,7 +11223,7 @@ var TooltipWrapper = ({
|
|
|
11221
11223
|
const vertical = side === "top" || side === "bottom";
|
|
11222
11224
|
return /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(import_jsx_runtime154.Fragment, { children: [
|
|
11223
11225
|
child,
|
|
11224
|
-
visible &&
|
|
11226
|
+
visible && text2 && (0, import_react_dom.createPortal)(
|
|
11225
11227
|
/* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(
|
|
11226
11228
|
"div",
|
|
11227
11229
|
{
|
|
@@ -11243,7 +11245,7 @@ var TooltipWrapper = ({
|
|
|
11243
11245
|
colorScheme === "dark" && "dark"
|
|
11244
11246
|
),
|
|
11245
11247
|
children: [
|
|
11246
|
-
|
|
11248
|
+
text2,
|
|
11247
11249
|
/* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
|
|
11248
11250
|
"span",
|
|
11249
11251
|
{
|
|
@@ -13754,7 +13756,7 @@ var MultiProgressBar = ({
|
|
|
13754
13756
|
className,
|
|
13755
13757
|
...rest
|
|
13756
13758
|
}) => {
|
|
13757
|
-
const
|
|
13759
|
+
const text2 = useSurfaceText();
|
|
13758
13760
|
const renderIcon2 = useIconRenderer();
|
|
13759
13761
|
const [hoveredKey, setHoveredKey] = (0, import_react162.useState)(null);
|
|
13760
13762
|
const [tooltip, setTooltip] = (0, import_react162.useState)(null);
|
|
@@ -13825,7 +13827,7 @@ var MultiProgressBar = ({
|
|
|
13825
13827
|
className: (0, import_classnames17.default)(
|
|
13826
13828
|
"flex cursor-pointer select-none items-center gap-1.5 whitespace-nowrap",
|
|
13827
13829
|
"transition-all duration-200",
|
|
13828
|
-
isActive ?
|
|
13830
|
+
isActive ? text2.heading : isDimmed ? "opacity-40" : text2.muted
|
|
13829
13831
|
),
|
|
13830
13832
|
onMouseEnter: () => setHoveredKey(s.key),
|
|
13831
13833
|
onMouseLeave: () => setHoveredKey(null),
|
|
@@ -13850,13 +13852,13 @@ var MultiProgressBar = ({
|
|
|
13850
13852
|
{
|
|
13851
13853
|
className: (0, import_classnames17.default)(
|
|
13852
13854
|
"font-semibold transition-colors duration-200",
|
|
13853
|
-
isActive ?
|
|
13855
|
+
isActive ? text2.heading : text2.body
|
|
13854
13856
|
),
|
|
13855
13857
|
children: s.displayValue ?? s.value
|
|
13856
13858
|
}
|
|
13857
13859
|
),
|
|
13858
13860
|
s.label,
|
|
13859
|
-
showPercent && /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)("span", { className:
|
|
13861
|
+
showPercent && /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)("span", { className: text2.muted, children: [
|
|
13860
13862
|
"(",
|
|
13861
13863
|
Math.round(pct),
|
|
13862
13864
|
"%)"
|
|
@@ -13998,7 +14000,7 @@ var MultiProgressBar = ({
|
|
|
13998
14000
|
className: (0, import_classnames17.default)(
|
|
13999
14001
|
tokens.label,
|
|
14000
14002
|
"font-semibold",
|
|
14001
|
-
!hasTextColor(labelClassName) &&
|
|
14003
|
+
!hasTextColor(labelClassName) && text2.heading,
|
|
14002
14004
|
labelClassName
|
|
14003
14005
|
),
|
|
14004
14006
|
children: label
|
|
@@ -14010,7 +14012,7 @@ var MultiProgressBar = ({
|
|
|
14010
14012
|
className: (0, import_classnames17.default)(
|
|
14011
14013
|
tokens.meta,
|
|
14012
14014
|
"mt-0.5",
|
|
14013
|
-
!hasTextColor(secondaryLabelClassName) &&
|
|
14015
|
+
!hasTextColor(secondaryLabelClassName) && text2.muted,
|
|
14014
14016
|
secondaryLabelClassName
|
|
14015
14017
|
),
|
|
14016
14018
|
children: secondaryLabel
|
|
@@ -14020,7 +14022,7 @@ var MultiProgressBar = ({
|
|
|
14020
14022
|
totalLabel && /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
|
|
14021
14023
|
"span",
|
|
14022
14024
|
{
|
|
14023
|
-
className: (0, import_classnames17.default)(tokens.meta, "font-medium",
|
|
14025
|
+
className: (0, import_classnames17.default)(tokens.meta, "font-medium", text2.muted),
|
|
14024
14026
|
children: totalLabel
|
|
14025
14027
|
}
|
|
14026
14028
|
)
|
|
@@ -14098,9 +14100,9 @@ var Shimmer_default = Shimmer;
|
|
|
14098
14100
|
var import_classnames19 = __toESM(require("classnames"), 1);
|
|
14099
14101
|
var import_react164 = __toESM(require("react"), 1);
|
|
14100
14102
|
var import_jsx_runtime168 = require("react/jsx-runtime");
|
|
14101
|
-
var StatusSpinnerLabel = ({ text }) => {
|
|
14103
|
+
var StatusSpinnerLabel = ({ text: text2 }) => {
|
|
14102
14104
|
const surface = useSurfaceText();
|
|
14103
|
-
return /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("span", { className: (0, import_classnames19.default)("text-sm font-medium", surface.body), children:
|
|
14105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("span", { className: (0, import_classnames19.default)("text-sm font-medium", surface.body), children: text2 });
|
|
14104
14106
|
};
|
|
14105
14107
|
var StatusSpinner = import_react164.default.forwardRef(
|
|
14106
14108
|
({
|
|
@@ -16016,7 +16018,7 @@ var DropdownButton_default = DropdownButton;
|
|
|
16016
16018
|
var import_classnames28 = __toESM(require("classnames"), 1);
|
|
16017
16019
|
var import_jsx_runtime177 = require("react/jsx-runtime");
|
|
16018
16020
|
var Tooltip = ({
|
|
16019
|
-
text,
|
|
16021
|
+
text: text2,
|
|
16020
16022
|
delay = 500,
|
|
16021
16023
|
position = "top",
|
|
16022
16024
|
variant = "surface",
|
|
@@ -16026,11 +16028,11 @@ var Tooltip = ({
|
|
|
16026
16028
|
wrapperClassName,
|
|
16027
16029
|
children
|
|
16028
16030
|
}) => {
|
|
16029
|
-
if (!
|
|
16031
|
+
if (!text2) return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_jsx_runtime177.Fragment, { children });
|
|
16030
16032
|
return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(
|
|
16031
16033
|
TooltipWrapper_default,
|
|
16032
16034
|
{
|
|
16033
|
-
text,
|
|
16035
|
+
text: text2,
|
|
16034
16036
|
delay,
|
|
16035
16037
|
position,
|
|
16036
16038
|
variant,
|
|
@@ -16373,9 +16375,9 @@ var InputOtp = (0, import_react172.forwardRef)(function InputOtp2({
|
|
|
16373
16375
|
[integerOnly]
|
|
16374
16376
|
);
|
|
16375
16377
|
const distribute = (0, import_react172.useCallback)(
|
|
16376
|
-
(start,
|
|
16378
|
+
(start, text2) => {
|
|
16377
16379
|
const at = Math.min(start, current.length);
|
|
16378
|
-
const clean = [...
|
|
16380
|
+
const clean = [...text2].filter((char) => isAllowed(char)).slice(0, clampedLength - at);
|
|
16379
16381
|
if (!clean.length) return;
|
|
16380
16382
|
const next = [...chars];
|
|
16381
16383
|
clean.forEach((char, j) => {
|
|
@@ -20510,7 +20512,7 @@ var Checkbox = (0, import_react184.forwardRef)(
|
|
|
20510
20512
|
children: description
|
|
20511
20513
|
}
|
|
20512
20514
|
) : null;
|
|
20513
|
-
const
|
|
20515
|
+
const text2 = label || descriptionNode ? /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(
|
|
20514
20516
|
"span",
|
|
20515
20517
|
{
|
|
20516
20518
|
className: (0, import_classnames41.default)(
|
|
@@ -20564,7 +20566,7 @@ var Checkbox = (0, import_react184.forwardRef)(
|
|
|
20564
20566
|
),
|
|
20565
20567
|
children: [
|
|
20566
20568
|
control,
|
|
20567
|
-
|
|
20569
|
+
text2
|
|
20568
20570
|
]
|
|
20569
20571
|
}
|
|
20570
20572
|
),
|
|
@@ -23918,7 +23920,7 @@ var safeHref = (href) => {
|
|
|
23918
23920
|
if (/^#[^\s"'<>]*$/.test(h)) return h;
|
|
23919
23921
|
return null;
|
|
23920
23922
|
};
|
|
23921
|
-
var inline = (
|
|
23923
|
+
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) => {
|
|
23922
23924
|
const href = safeHref(h);
|
|
23923
23925
|
if (!href) return t;
|
|
23924
23926
|
return `<a href="${href}" target="_blank" rel="noopener noreferrer" class="text-blue-600 underline underline-offset-2 dark:text-blue-400">${t}</a>`;
|
|
@@ -24262,8 +24264,8 @@ var Chat2 = ({
|
|
|
24262
24264
|
fail(err);
|
|
24263
24265
|
}
|
|
24264
24266
|
};
|
|
24265
|
-
const send = async (
|
|
24266
|
-
const content =
|
|
24267
|
+
const send = async (text2) => {
|
|
24268
|
+
const content = text2.trim();
|
|
24267
24269
|
if (!content || streaming) return;
|
|
24268
24270
|
setDraft("");
|
|
24269
24271
|
let chatId = activeIdRef.current;
|
|
@@ -24732,7 +24734,7 @@ var ChatRow = ({
|
|
|
24732
24734
|
onMenu,
|
|
24733
24735
|
menuRef
|
|
24734
24736
|
}) => {
|
|
24735
|
-
const [
|
|
24737
|
+
const [text2, setText] = (0, import_react195.useState)(chat.title);
|
|
24736
24738
|
if (renaming) {
|
|
24737
24739
|
return /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
24738
24740
|
Input_default,
|
|
@@ -24740,13 +24742,13 @@ var ChatRow = ({
|
|
|
24740
24742
|
size: "sm",
|
|
24741
24743
|
autoFocus: true,
|
|
24742
24744
|
className: "my-0.5",
|
|
24743
|
-
value:
|
|
24745
|
+
value: text2,
|
|
24744
24746
|
onChange: (event) => setText(event.target.value),
|
|
24745
24747
|
onKeyDown: (event) => {
|
|
24746
|
-
if (event.key === "Enter") onRenamed(
|
|
24748
|
+
if (event.key === "Enter") onRenamed(text2 || chat.title);
|
|
24747
24749
|
if (event.key === "Escape") onCancelRename();
|
|
24748
24750
|
},
|
|
24749
|
-
onBlur: () => onRenamed(
|
|
24751
|
+
onBlur: () => onRenamed(text2 || chat.title)
|
|
24750
24752
|
}
|
|
24751
24753
|
);
|
|
24752
24754
|
}
|
|
@@ -24783,17 +24785,17 @@ var FolderInput = ({
|
|
|
24783
24785
|
onDone,
|
|
24784
24786
|
onCancel
|
|
24785
24787
|
}) => {
|
|
24786
|
-
const [
|
|
24788
|
+
const [text2, setText] = (0, import_react195.useState)(initial);
|
|
24787
24789
|
return /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
24788
24790
|
Input_default,
|
|
24789
24791
|
{
|
|
24790
24792
|
size: "sm",
|
|
24791
24793
|
autoFocus: true,
|
|
24792
24794
|
placeholder: "Folder name",
|
|
24793
|
-
value:
|
|
24795
|
+
value: text2,
|
|
24794
24796
|
onChange: (event) => setText(event.target.value),
|
|
24795
24797
|
onKeyDown: (event) => {
|
|
24796
|
-
if (event.key === "Enter") onDone(
|
|
24798
|
+
if (event.key === "Enter") onDone(text2);
|
|
24797
24799
|
if (event.key === "Escape") onCancel();
|
|
24798
24800
|
}
|
|
24799
24801
|
}
|
|
@@ -31167,10 +31169,10 @@ function PieSeries(props) {
|
|
|
31167
31169
|
const lp = Math.max(1e-3, fracs[lb.index] ?? 0);
|
|
31168
31170
|
const size = 11 * lp;
|
|
31169
31171
|
if (size < 2) return;
|
|
31170
|
-
const
|
|
31172
|
+
const text2 = pctLabel(lb.pct * lp);
|
|
31171
31173
|
c.globalAlpha = lp;
|
|
31172
31174
|
c.font = `600 ${size}px sans-serif`;
|
|
31173
|
-
const w =
|
|
31175
|
+
const w = text2.length * size * 0.58 + 12 * lp;
|
|
31174
31176
|
const h = 17 * lp;
|
|
31175
31177
|
c.fillStyle = shadeColor(lb.color, 0.45);
|
|
31176
31178
|
if (typeof c.roundRect === "function") {
|
|
@@ -31181,7 +31183,7 @@ function PieSeries(props) {
|
|
|
31181
31183
|
c.fillRect(lb.x - w / 2, lb.y - h / 2, w, h);
|
|
31182
31184
|
}
|
|
31183
31185
|
c.fillStyle = "#fff";
|
|
31184
|
-
c.fillText(
|
|
31186
|
+
c.fillText(text2, lb.x, lb.y + 0.5);
|
|
31185
31187
|
c.globalAlpha = 1;
|
|
31186
31188
|
});
|
|
31187
31189
|
c.restore();
|
|
@@ -31241,8 +31243,8 @@ function PieSeries(props) {
|
|
|
31241
31243
|
const lp = Math.max(1e-3, fracs[lb.index] ?? 0);
|
|
31242
31244
|
const size = 11 * lp;
|
|
31243
31245
|
if (size < 2) return null;
|
|
31244
|
-
const
|
|
31245
|
-
const w =
|
|
31246
|
+
const text2 = pctLabel(lb.pct * lp);
|
|
31247
|
+
const w = text2.length * size * 0.58 + 12 * lp;
|
|
31246
31248
|
const h = 17 * lp;
|
|
31247
31249
|
return /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("g", { opacity: lp, pointerEvents: "none", children: [
|
|
31248
31250
|
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
@@ -31266,7 +31268,7 @@ function PieSeries(props) {
|
|
|
31266
31268
|
fontSize: size,
|
|
31267
31269
|
fontWeight: 600,
|
|
31268
31270
|
fill: "#fff",
|
|
31269
|
-
children:
|
|
31271
|
+
children: text2
|
|
31270
31272
|
}
|
|
31271
31273
|
)
|
|
31272
31274
|
] }, lb.index);
|
|
@@ -31578,8 +31580,8 @@ function CandlestickSeries(props) {
|
|
|
31578
31580
|
}
|
|
31579
31581
|
if (hovered && hoverItem) {
|
|
31580
31582
|
const up = hovered.direction !== "down";
|
|
31581
|
-
const
|
|
31582
|
-
const w =
|
|
31583
|
+
const text2 = String(Math.round(hoverItem.value * 10) / 10);
|
|
31584
|
+
const w = text2.length * 6.4 + 12;
|
|
31583
31585
|
const h = 17;
|
|
31584
31586
|
const top = hovered.highY - 8 - h;
|
|
31585
31587
|
c.fillStyle = shadeColor(up ? upColor : downColor, 0.45);
|
|
@@ -31588,7 +31590,7 @@ function CandlestickSeries(props) {
|
|
|
31588
31590
|
c.font = "600 11px sans-serif";
|
|
31589
31591
|
c.textAlign = "center";
|
|
31590
31592
|
c.textBaseline = "middle";
|
|
31591
|
-
c.fillText(
|
|
31593
|
+
c.fillText(text2, hovered.x, top + h / 2);
|
|
31592
31594
|
}
|
|
31593
31595
|
c.restore();
|
|
31594
31596
|
};
|
|
@@ -31726,8 +31728,8 @@ function CandlestickSeries(props) {
|
|
|
31726
31728
|
highlightOn && hoveredIndex >= 0 && hoverItem && (() => {
|
|
31727
31729
|
const k = candles[hoveredIndex];
|
|
31728
31730
|
const up = k.direction !== "down";
|
|
31729
|
-
const
|
|
31730
|
-
const w =
|
|
31731
|
+
const text2 = String(Math.round(hoverItem.value * 10) / 10);
|
|
31732
|
+
const w = text2.length * 6.4 + 12;
|
|
31731
31733
|
const h = 17;
|
|
31732
31734
|
const top = k.highY - 8 - h;
|
|
31733
31735
|
return /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)("g", { pointerEvents: "none", children: [
|
|
@@ -31752,7 +31754,7 @@ function CandlestickSeries(props) {
|
|
|
31752
31754
|
fontSize: 11,
|
|
31753
31755
|
fontWeight: 600,
|
|
31754
31756
|
fill: "#fff",
|
|
31755
|
-
children:
|
|
31757
|
+
children: text2
|
|
31756
31758
|
}
|
|
31757
31759
|
)
|
|
31758
31760
|
] });
|
|
@@ -34112,7 +34114,7 @@ function DataLabels(props = {}) {
|
|
|
34112
34114
|
};
|
|
34113
34115
|
return /* @__PURE__ */ (0, import_jsx_runtime228.jsxs)("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: [
|
|
34114
34116
|
endpoints.map((ep) => {
|
|
34115
|
-
const
|
|
34117
|
+
const text2 = props.formatter ? props.formatter(ep.value, ep.name) : formatSI(ep.value);
|
|
34116
34118
|
const renderPoint = {
|
|
34117
34119
|
seriesId: ep.id,
|
|
34118
34120
|
seriesName: ep.name,
|
|
@@ -34122,7 +34124,7 @@ function DataLabels(props = {}) {
|
|
|
34122
34124
|
y: ep.y,
|
|
34123
34125
|
isLast: true
|
|
34124
34126
|
};
|
|
34125
|
-
const w =
|
|
34127
|
+
const w = text2.length * 7 + 14;
|
|
34126
34128
|
const bx = props.anchor === "margin-left" ? Math.max(2, area2.x - w - 6) : Math.min(width - w - 2, ep.x + 10);
|
|
34127
34129
|
const by = Math.max(2, Math.min(ep.y - PILL_H / 2, height - PILL_H - 2));
|
|
34128
34130
|
if (props.render) {
|
|
@@ -34146,14 +34148,14 @@ function DataLabels(props = {}) {
|
|
|
34146
34148
|
background: ep.color,
|
|
34147
34149
|
color: "#ffffff"
|
|
34148
34150
|
},
|
|
34149
|
-
children:
|
|
34151
|
+
children: text2
|
|
34150
34152
|
},
|
|
34151
34153
|
ep.id
|
|
34152
34154
|
);
|
|
34153
34155
|
}),
|
|
34154
34156
|
pieSlices.map((sl) => {
|
|
34155
|
-
const
|
|
34156
|
-
const w =
|
|
34157
|
+
const text2 = props.formatter ? props.formatter(sl.value, sl.name) : formatSI(sl.value);
|
|
34158
|
+
const w = text2.length * 7 + 14;
|
|
34157
34159
|
const bx = Math.max(2, Math.min(width - w - 2, sl.x - w / 2));
|
|
34158
34160
|
const by = Math.max(2, Math.min(height - PILL_H - 2, sl.y - PILL_H / 2));
|
|
34159
34161
|
if (props.render) {
|
|
@@ -34178,7 +34180,7 @@ function DataLabels(props = {}) {
|
|
|
34178
34180
|
background: shadeColor(sl.color, 0.45),
|
|
34179
34181
|
color: "#ffffff"
|
|
34180
34182
|
},
|
|
34181
|
-
children:
|
|
34183
|
+
children: text2
|
|
34182
34184
|
},
|
|
34183
34185
|
sl.key
|
|
34184
34186
|
);
|
|
@@ -36320,7 +36322,7 @@ var GlassBackground_default = GlassBackground;
|
|
|
36320
36322
|
var import_react221 = require("react");
|
|
36321
36323
|
var import_jsx_runtime238 = require("react/jsx-runtime");
|
|
36322
36324
|
var TruncatedText = ({
|
|
36323
|
-
text,
|
|
36325
|
+
text: text2,
|
|
36324
36326
|
className,
|
|
36325
36327
|
delay = 2e3,
|
|
36326
36328
|
as: Tag = "div",
|
|
@@ -36339,11 +36341,11 @@ var TruncatedText = ({
|
|
|
36339
36341
|
observer.observe(el);
|
|
36340
36342
|
check();
|
|
36341
36343
|
return () => observer.disconnect();
|
|
36342
|
-
}, [
|
|
36344
|
+
}, [text2]);
|
|
36343
36345
|
const inner = /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
36344
36346
|
TooltipWrapper_default,
|
|
36345
36347
|
{
|
|
36346
|
-
text: truncated ?
|
|
36348
|
+
text: truncated ? text2 : void 0,
|
|
36347
36349
|
delay,
|
|
36348
36350
|
position: tooltipPosition,
|
|
36349
36351
|
children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
@@ -36358,7 +36360,7 @@ var TruncatedText = ({
|
|
|
36358
36360
|
truncated && "rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",
|
|
36359
36361
|
className
|
|
36360
36362
|
].filter(Boolean).join(" "),
|
|
36361
|
-
children:
|
|
36363
|
+
children: text2
|
|
36362
36364
|
}
|
|
36363
36365
|
)
|
|
36364
36366
|
}
|
|
@@ -36440,18 +36442,18 @@ function normaliseValue(value, boolWords) {
|
|
|
36440
36442
|
return { display: null, copyText: null, isEmpty: true };
|
|
36441
36443
|
}
|
|
36442
36444
|
if (typeof value === "boolean") {
|
|
36443
|
-
const
|
|
36444
|
-
return { display:
|
|
36445
|
+
const text2 = value ? boolWords.yes : boolWords.no;
|
|
36446
|
+
return { display: text2, copyText: text2, isEmpty: false };
|
|
36445
36447
|
}
|
|
36446
36448
|
if (typeof value === "string" || typeof value === "number") {
|
|
36447
36449
|
return { display: value, copyText: String(value), isEmpty: false };
|
|
36448
36450
|
}
|
|
36449
36451
|
return { display: value, copyText: null, isEmpty: false };
|
|
36450
36452
|
}
|
|
36451
|
-
async function writeClipboard(
|
|
36453
|
+
async function writeClipboard(text2) {
|
|
36452
36454
|
try {
|
|
36453
36455
|
if (!navigator.clipboard?.writeText) return false;
|
|
36454
|
-
await navigator.clipboard.writeText(
|
|
36456
|
+
await navigator.clipboard.writeText(text2);
|
|
36455
36457
|
return true;
|
|
36456
36458
|
} catch {
|
|
36457
36459
|
return false;
|
|
@@ -36484,7 +36486,7 @@ var InfoRowBody = ({
|
|
|
36484
36486
|
rootProps
|
|
36485
36487
|
}) => {
|
|
36486
36488
|
const t = useKitT();
|
|
36487
|
-
const
|
|
36489
|
+
const text2 = useSurfaceText();
|
|
36488
36490
|
const [copyState, setCopyState] = (0, import_react222.useState)("idle");
|
|
36489
36491
|
const [dismissed, setDismissed] = (0, import_react222.useState)(false);
|
|
36490
36492
|
const [truncated, setTruncated] = (0, import_react222.useState)(false);
|
|
@@ -36522,7 +36524,7 @@ var InfoRowBody = ({
|
|
|
36522
36524
|
}, [canTooltip]);
|
|
36523
36525
|
const loaderInk = `bg-${rowTone}-500/20 dark:bg-${rowTone}-500/25`;
|
|
36524
36526
|
const loaderText = `text-${rowTone}-500 dark:text-${rowTone}-400`;
|
|
36525
|
-
const valueColorClass = hasError ? "text-rose-600 dark:text-rose-400" : isEmpty2 ?
|
|
36527
|
+
const valueColorClass = hasError ? "text-rose-600 dark:text-rose-400" : isEmpty2 ? text2.muted : text2.body;
|
|
36526
36528
|
const valueSpan = /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(
|
|
36527
36529
|
"span",
|
|
36528
36530
|
{
|
|
@@ -36560,7 +36562,7 @@ var InfoRowBody = ({
|
|
|
36560
36562
|
// `!copied` so the confirmation wash is never racing the hover wash for
|
|
36561
36563
|
// the same property.
|
|
36562
36564
|
hoverable && copyState === "idle" && trigger.hover,
|
|
36563
|
-
!noBorder && !hoverable && `border-b ${
|
|
36565
|
+
!noBorder && !hoverable && `border-b ${text2.divider} last:border-0`,
|
|
36564
36566
|
copyState === "copied" && "bg-emerald-500/10",
|
|
36565
36567
|
copyState === "failed" && "bg-rose-500/10",
|
|
36566
36568
|
className
|
|
@@ -36572,7 +36574,7 @@ var InfoRowBody = ({
|
|
|
36572
36574
|
{
|
|
36573
36575
|
className: (0, import_classnames60.default)(
|
|
36574
36576
|
labelTokens.text,
|
|
36575
|
-
!hasTextColor(labelClassName) &&
|
|
36577
|
+
!hasTextColor(labelClassName) && text2.muted,
|
|
36576
36578
|
useSmartLayout ? "shrink-0 min-w-0 max-w-[30%] truncate" : `grow shrink-0 ${labelWidth ?? tokens.defaultLabelWidth}`,
|
|
36577
36579
|
labelClassName
|
|
36578
36580
|
),
|
|
@@ -36893,7 +36895,7 @@ var PagedPanelBody = ({
|
|
|
36893
36895
|
onPrev,
|
|
36894
36896
|
onNext
|
|
36895
36897
|
}) => {
|
|
36896
|
-
const
|
|
36898
|
+
const text2 = useSurfaceText();
|
|
36897
36899
|
const t = useKitT();
|
|
36898
36900
|
const tokens = SIZE_TOKENS2[size] ?? SIZE_TOKENS2.md;
|
|
36899
36901
|
const emptySize = PANE_EMPTY_STATE_SIZE[size] ?? PANE_EMPTY_STATE_SIZE.md;
|
|
@@ -36906,7 +36908,7 @@ var PagedPanelBody = ({
|
|
|
36906
36908
|
className: (0, import_classnames62.default)(
|
|
36907
36909
|
"flex items-center gap-2 border-b",
|
|
36908
36910
|
tokens.pad,
|
|
36909
|
-
|
|
36911
|
+
text2.divider
|
|
36910
36912
|
),
|
|
36911
36913
|
children: [
|
|
36912
36914
|
/* @__PURE__ */ (0, import_jsx_runtime241.jsx)("div", { className: "shrink-0", children: showNav && /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
@@ -36929,7 +36931,7 @@ var PagedPanelBody = ({
|
|
|
36929
36931
|
className: (0, import_classnames62.default)(
|
|
36930
36932
|
"font-semibold leading-snug truncate",
|
|
36931
36933
|
tokens.title,
|
|
36932
|
-
|
|
36934
|
+
text2.heading
|
|
36933
36935
|
),
|
|
36934
36936
|
children: resolvedTitle
|
|
36935
36937
|
}
|
|
@@ -36940,7 +36942,7 @@ var PagedPanelBody = ({
|
|
|
36940
36942
|
className: (0, import_classnames62.default)(
|
|
36941
36943
|
"mt-0.5 truncate",
|
|
36942
36944
|
tokens.subtitle,
|
|
36943
|
-
|
|
36945
|
+
text2.muted
|
|
36944
36946
|
),
|
|
36945
36947
|
children: subtitle
|
|
36946
36948
|
}
|
|
@@ -36955,7 +36957,7 @@ var PagedPanelBody = ({
|
|
|
36955
36957
|
className: (0, import_classnames62.default)(
|
|
36956
36958
|
"mt-0.5 tabular-nums",
|
|
36957
36959
|
tokens.counter,
|
|
36958
|
-
|
|
36960
|
+
text2.muted
|
|
36959
36961
|
),
|
|
36960
36962
|
children: [
|
|
36961
36963
|
current + 1,
|
|
@@ -38022,7 +38024,7 @@ var HelpBody = ({
|
|
|
38022
38024
|
};
|
|
38023
38025
|
var CollapsibleHelpText = ({
|
|
38024
38026
|
title,
|
|
38025
|
-
text,
|
|
38027
|
+
text: text2,
|
|
38026
38028
|
maxLength = 160,
|
|
38027
38029
|
showIcon = false,
|
|
38028
38030
|
icon = "Help",
|
|
@@ -38042,7 +38044,7 @@ var CollapsibleHelpText = ({
|
|
|
38042
38044
|
}) => {
|
|
38043
38045
|
const [expanded, setExpanded] = (0, import_react228.useState)(false);
|
|
38044
38046
|
const regionId = (0, import_react228.useId)();
|
|
38045
|
-
const sanitized =
|
|
38047
|
+
const sanitized = text2?.trim() ?? "";
|
|
38046
38048
|
const needsTruncation = sanitized.length > maxLength;
|
|
38047
38049
|
const displayText = expanded || !needsTruncation ? sanitized : truncate(sanitized, maxLength);
|
|
38048
38050
|
const toneTokens3 = getCollapsibleHelpToneTokens(tone);
|
|
@@ -39351,7 +39353,7 @@ var DatePicker = (0, import_react234.forwardRef)(
|
|
|
39351
39353
|
setViewDate(getViewDate(currentValue, constraints));
|
|
39352
39354
|
}
|
|
39353
39355
|
}, [currentValue, constraints]);
|
|
39354
|
-
const [
|
|
39356
|
+
const [text2, setText] = (0, import_react234.useState)(() => formatValue(initialValue, format2));
|
|
39355
39357
|
const [textInvalid, setTextInvalid] = (0, import_react234.useState)(false);
|
|
39356
39358
|
const [focused, setFocused] = (0, import_react234.useState)(false);
|
|
39357
39359
|
const focusedRef = (0, import_react234.useRef)(false);
|
|
@@ -39508,7 +39510,7 @@ var DatePicker = (0, import_react234.forwardRef)(
|
|
|
39508
39510
|
}
|
|
39509
39511
|
if (event.key === "Enter") {
|
|
39510
39512
|
const parsed = parseValueText(
|
|
39511
|
-
|
|
39513
|
+
text2,
|
|
39512
39514
|
selectionMode,
|
|
39513
39515
|
format2,
|
|
39514
39516
|
/* @__PURE__ */ new Date(),
|
|
@@ -39733,7 +39735,7 @@ var DatePicker = (0, import_react234.forwardRef)(
|
|
|
39733
39735
|
readOnly: readonly,
|
|
39734
39736
|
inputMode: "none",
|
|
39735
39737
|
autoComplete: "off",
|
|
39736
|
-
value:
|
|
39738
|
+
value: text2,
|
|
39737
39739
|
onChange: handleTextChange,
|
|
39738
39740
|
onFocus: (event) => {
|
|
39739
39741
|
focusedRef.current = true;
|
|
@@ -50060,12 +50062,12 @@ var parseSmartVariable = (token) => {
|
|
|
50060
50062
|
};
|
|
50061
50063
|
};
|
|
50062
50064
|
var matcher = () => new RegExp(SMART_VAR_REGEX.source, "gi");
|
|
50063
|
-
var extractVariables = (
|
|
50065
|
+
var extractVariables = (text2) => {
|
|
50064
50066
|
const variables = [];
|
|
50065
50067
|
const seen = /* @__PURE__ */ new Set();
|
|
50066
50068
|
const regex = matcher();
|
|
50067
50069
|
let match;
|
|
50068
|
-
while ((match = regex.exec(
|
|
50070
|
+
while ((match = regex.exec(text2)) !== null) {
|
|
50069
50071
|
const fullToken = match[0];
|
|
50070
50072
|
if (seen.has(fullToken)) continue;
|
|
50071
50073
|
seen.add(fullToken);
|
|
@@ -50078,7 +50080,7 @@ var extractVariables = (text) => {
|
|
|
50078
50080
|
}
|
|
50079
50081
|
return variables;
|
|
50080
50082
|
};
|
|
50081
|
-
var hasSmartVariables = (
|
|
50083
|
+
var hasSmartVariables = (text2) => matcher().test(text2 ?? "");
|
|
50082
50084
|
var splitSmartValue = (value) => {
|
|
50083
50085
|
const parts = [];
|
|
50084
50086
|
if (!value) return parts;
|
|
@@ -50147,13 +50149,13 @@ var createDefaultResolver = (groups) => (variable) => {
|
|
|
50147
50149
|
};
|
|
50148
50150
|
var resolveSmartValue = (value, resolve2) => {
|
|
50149
50151
|
const missing = [];
|
|
50150
|
-
const
|
|
50152
|
+
const text2 = splitSmartValue(value).map((part) => {
|
|
50151
50153
|
if (part.kind === "text") return part.text;
|
|
50152
50154
|
const resolution = resolve2(part.variable);
|
|
50153
50155
|
if (resolution.state === "missing") missing.push(part.variable);
|
|
50154
50156
|
return resolution.value;
|
|
50155
50157
|
}).join("");
|
|
50156
|
-
return { text, missing };
|
|
50158
|
+
return { text: text2, missing };
|
|
50157
50159
|
};
|
|
50158
50160
|
var createLegacyGroups = (options) => {
|
|
50159
50161
|
const { globalParameters = [], serviceNames = [], systemVariables = [] } = options;
|
|
@@ -51480,7 +51482,7 @@ var StatPager = ({
|
|
|
51480
51482
|
onGradient = false,
|
|
51481
51483
|
className
|
|
51482
51484
|
}) => {
|
|
51483
|
-
const
|
|
51485
|
+
const text2 = useSurfaceText();
|
|
51484
51486
|
const tokens = TOKENS2[size] ?? TOKENS2.md;
|
|
51485
51487
|
if (pager.total <= 1 && label == null) return null;
|
|
51486
51488
|
return /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)("div", { className: (0, import_classnames87.default)("flex items-center gap-2", className), children: [
|
|
@@ -51508,7 +51510,7 @@ var StatPager = ({
|
|
|
51508
51510
|
className: (0, import_classnames87.default)(
|
|
51509
51511
|
"truncate font-semibold",
|
|
51510
51512
|
tokens.label,
|
|
51511
|
-
onGradient ? "text-white" :
|
|
51513
|
+
onGradient ? "text-white" : text2.heading
|
|
51512
51514
|
),
|
|
51513
51515
|
children: label
|
|
51514
51516
|
}
|
|
@@ -51523,7 +51525,7 @@ var StatPager = ({
|
|
|
51523
51525
|
className: (0, import_classnames87.default)(
|
|
51524
51526
|
"tabular-nums",
|
|
51525
51527
|
tokens.counter,
|
|
51526
|
-
onGradient ? "text-white/70" :
|
|
51528
|
+
onGradient ? "text-white/70" : text2.muted
|
|
51527
51529
|
),
|
|
51528
51530
|
children: [
|
|
51529
51531
|
pager.page + 1,
|
|
@@ -51987,7 +51989,7 @@ var CHART_TOKENS = {
|
|
|
51987
51989
|
};
|
|
51988
51990
|
var Donut = ({ dataset, tokens, chartSize, onGradient }) => {
|
|
51989
51991
|
const [hoveredIndex, setHoveredIndex] = (0, import_react260.useState)(null);
|
|
51990
|
-
const
|
|
51992
|
+
const text2 = useSurfaceText();
|
|
51991
51993
|
const resolvedItems = (0, import_react260.useMemo)(() => {
|
|
51992
51994
|
const palette = getColorPaletteNames(dataset.items.length);
|
|
51993
51995
|
return dataset.items.map((item, i) => ({
|
|
@@ -52092,7 +52094,7 @@ var Donut = ({ dataset, tokens, chartSize, onGradient }) => {
|
|
|
52092
52094
|
className: (0, import_classnames89.default)(
|
|
52093
52095
|
"mb-1 font-bold leading-none",
|
|
52094
52096
|
tokens.total,
|
|
52095
|
-
onGradient ? "text-white" :
|
|
52097
|
+
onGradient ? "text-white" : text2.heading
|
|
52096
52098
|
),
|
|
52097
52099
|
children: total
|
|
52098
52100
|
}
|
|
@@ -52103,7 +52105,7 @@ var Donut = ({ dataset, tokens, chartSize, onGradient }) => {
|
|
|
52103
52105
|
className: (0, import_classnames89.default)(
|
|
52104
52106
|
"font-medium leading-tight",
|
|
52105
52107
|
tokens.center,
|
|
52106
|
-
onGradient ? "text-white/70" :
|
|
52108
|
+
onGradient ? "text-white/70" : text2.muted
|
|
52107
52109
|
),
|
|
52108
52110
|
children: dataset.centerLabel
|
|
52109
52111
|
}
|
|
@@ -52147,7 +52149,7 @@ var Donut = ({ dataset, tokens, chartSize, onGradient }) => {
|
|
|
52147
52149
|
className: (0, import_classnames89.default)(
|
|
52148
52150
|
"truncate transition-colors",
|
|
52149
52151
|
tokens.legend,
|
|
52150
|
-
onGradient ? "text-white/80" :
|
|
52152
|
+
onGradient ? "text-white/80" : text2.body
|
|
52151
52153
|
),
|
|
52152
52154
|
children: item.label
|
|
52153
52155
|
}
|
|
@@ -52159,7 +52161,7 @@ var Donut = ({ dataset, tokens, chartSize, onGradient }) => {
|
|
|
52159
52161
|
className: (0, import_classnames89.default)(
|
|
52160
52162
|
"flex-none font-bold",
|
|
52161
52163
|
tokens.legend,
|
|
52162
|
-
onGradient ? "text-white" :
|
|
52164
|
+
onGradient ? "text-white" : text2.heading
|
|
52163
52165
|
),
|
|
52164
52166
|
children: item.value
|
|
52165
52167
|
}
|
|
@@ -52214,14 +52216,14 @@ var StatChartTile_default = StatChartTile;
|
|
|
52214
52216
|
var import_classnames90 = __toESM(require("classnames"), 1);
|
|
52215
52217
|
var import_jsx_runtime275 = require("react/jsx-runtime");
|
|
52216
52218
|
var Breakdown = ({ items, onGradient }) => {
|
|
52217
|
-
const
|
|
52219
|
+
const text2 = useSurfaceText();
|
|
52218
52220
|
return /* @__PURE__ */ (0, import_jsx_runtime275.jsx)("div", { className: "mt-auto space-y-3 pt-4", children: items.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)("div", { className: "flex items-center justify-between text-sm", children: [
|
|
52219
52221
|
/* @__PURE__ */ (0, import_jsx_runtime275.jsx)(
|
|
52220
52222
|
"span",
|
|
52221
52223
|
{
|
|
52222
52224
|
className: (0, import_classnames90.default)(
|
|
52223
52225
|
"font-medium",
|
|
52224
|
-
onGradient ? "text-white/70" :
|
|
52226
|
+
onGradient ? "text-white/70" : text2.muted
|
|
52225
52227
|
),
|
|
52226
52228
|
children: item.label
|
|
52227
52229
|
}
|
|
@@ -52231,7 +52233,7 @@ var Breakdown = ({ items, onGradient }) => {
|
|
|
52231
52233
|
{
|
|
52232
52234
|
className: (0, import_classnames90.default)(
|
|
52233
52235
|
"font-semibold",
|
|
52234
|
-
item.color ? `text-${item.color}-600 dark:text-${item.color}-400` : onGradient ? "text-white" :
|
|
52236
|
+
item.color ? `text-${item.color}-600 dark:text-${item.color}-400` : onGradient ? "text-white" : text2.body
|
|
52235
52237
|
),
|
|
52236
52238
|
children: item.value
|
|
52237
52239
|
}
|
|
@@ -52347,7 +52349,7 @@ var CircularProgress = ({ value, color, icon, label, size, strokeWidth, iconSize
|
|
|
52347
52349
|
);
|
|
52348
52350
|
};
|
|
52349
52351
|
var Goals = ({ goals, tokens, ringSize, onGradient }) => {
|
|
52350
|
-
const
|
|
52352
|
+
const text2 = useSurfaceText();
|
|
52351
52353
|
return /* @__PURE__ */ (0, import_jsx_runtime276.jsx)("div", { className: "flex h-full flex-col justify-center", children: goals.map((goal, idx) => /* @__PURE__ */ (0, import_jsx_runtime276.jsxs)(import_react261.default.Fragment, { children: [
|
|
52352
52354
|
/* @__PURE__ */ (0, import_jsx_runtime276.jsxs)(
|
|
52353
52355
|
"div",
|
|
@@ -52378,7 +52380,7 @@ var Goals = ({ goals, tokens, ringSize, onGradient }) => {
|
|
|
52378
52380
|
className: (0, import_classnames91.default)(
|
|
52379
52381
|
"font-bold leading-none",
|
|
52380
52382
|
tokens.value,
|
|
52381
|
-
onGradient ? "text-white" :
|
|
52383
|
+
onGradient ? "text-white" : text2.heading
|
|
52382
52384
|
),
|
|
52383
52385
|
children: [
|
|
52384
52386
|
goal.value,
|
|
@@ -52392,7 +52394,7 @@ var Goals = ({ goals, tokens, ringSize, onGradient }) => {
|
|
|
52392
52394
|
className: (0, import_classnames91.default)(
|
|
52393
52395
|
"mt-1 font-medium",
|
|
52394
52396
|
tokens.label,
|
|
52395
|
-
onGradient ? "text-white/70" :
|
|
52397
|
+
onGradient ? "text-white/70" : text2.muted
|
|
52396
52398
|
),
|
|
52397
52399
|
children: goal.label
|
|
52398
52400
|
}
|
|
@@ -52406,7 +52408,7 @@ var Goals = ({ goals, tokens, ringSize, onGradient }) => {
|
|
|
52406
52408
|
{
|
|
52407
52409
|
className: (0, import_classnames91.default)(
|
|
52408
52410
|
"my-1 h-px w-full border-t",
|
|
52409
|
-
onGradient ? "border-white/20" :
|
|
52411
|
+
onGradient ? "border-white/20" : text2.divider
|
|
52410
52412
|
)
|
|
52411
52413
|
}
|
|
52412
52414
|
)
|
|
@@ -52558,7 +52560,7 @@ var StatGraphTile = ({
|
|
|
52558
52560
|
const resolvedChartType = chartType ?? (isChartType(variant) ? variant : "bar");
|
|
52559
52561
|
const surfaceVariant = isChartType(variant) ? void 0 : variant;
|
|
52560
52562
|
const resolvedTone = tone ?? color;
|
|
52561
|
-
const
|
|
52563
|
+
const text2 = useSurfaceText();
|
|
52562
52564
|
const isDark = useIsDarkMode();
|
|
52563
52565
|
const [tooltip, setTooltip] = (0, import_react263.useState)(null);
|
|
52564
52566
|
const wrapperRef = (0, import_react263.useRef)(null);
|
|
@@ -52671,13 +52673,13 @@ var StatGraphTile = ({
|
|
|
52671
52673
|
{
|
|
52672
52674
|
className: (0, import_classnames92.default)(
|
|
52673
52675
|
"text-xs font-medium",
|
|
52674
|
-
gradient ? "text-white/70" :
|
|
52676
|
+
gradient ? "text-white/70" : text2.muted
|
|
52675
52677
|
),
|
|
52676
52678
|
children: s.label
|
|
52677
52679
|
}
|
|
52678
52680
|
)
|
|
52679
52681
|
] }, s.key)) });
|
|
52680
|
-
}, [showLegend, resolvedChartType, resolvedSeries, getColor, gradient,
|
|
52682
|
+
}, [showLegend, resolvedChartType, resolvedSeries, getColor, gradient, text2.muted]);
|
|
52681
52683
|
const axisColor = gradient ? "rgba(255,255,255,0.7)" : isDark ? "#94a3b8" : "#64748b";
|
|
52682
52684
|
const gridColor = gradient ? "rgba(255,255,255,0.2)" : isDark ? "#334155" : "#e2e8f0";
|
|
52683
52685
|
const renderChart = () => {
|
|
@@ -52825,7 +52827,7 @@ var StatGraphTile = ({
|
|
|
52825
52827
|
className: (0, import_classnames92.default)(
|
|
52826
52828
|
"font-bold",
|
|
52827
52829
|
SPARK_VALUE[size] ?? SPARK_VALUE.md,
|
|
52828
|
-
gradient ? "text-white" :
|
|
52830
|
+
gradient ? "text-white" : text2.heading
|
|
52829
52831
|
),
|
|
52830
52832
|
children: props.value
|
|
52831
52833
|
}
|
|
@@ -52835,7 +52837,7 @@ var StatGraphTile = ({
|
|
|
52835
52837
|
{
|
|
52836
52838
|
className: (0, import_classnames92.default)(
|
|
52837
52839
|
"mt-1 text-sm",
|
|
52838
|
-
gradient ? "text-white/70" :
|
|
52840
|
+
gradient ? "text-white/70" : text2.muted
|
|
52839
52841
|
),
|
|
52840
52842
|
children: props.subtitle
|
|
52841
52843
|
}
|
|
@@ -57595,8 +57597,8 @@ var TYPE_CONFIG = {
|
|
|
57595
57597
|
var NotificationModalBody = ({
|
|
57596
57598
|
children
|
|
57597
57599
|
}) => {
|
|
57598
|
-
const
|
|
57599
|
-
return /* @__PURE__ */ (0, import_jsx_runtime287.jsx)("div", { className: (0, import_classnames99.default)("text-sm",
|
|
57600
|
+
const text2 = useSurfaceText();
|
|
57601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime287.jsx)("div", { className: (0, import_classnames99.default)("text-sm", text2.body), children });
|
|
57600
57602
|
};
|
|
57601
57603
|
var NotificationModal = ({
|
|
57602
57604
|
isOpen,
|
|
@@ -58781,8 +58783,8 @@ var nodeIsSkipped = (node) => node?.skipped ?? (node?.status === "skipped" ? tru
|
|
|
58781
58783
|
|
|
58782
58784
|
// ../common/connectionFlow/measure.ts
|
|
58783
58785
|
var rowHeight = (metrics, hasGlyph, hasSubtitle) => {
|
|
58784
|
-
const
|
|
58785
|
-
return hasGlyph ? Math.max(metrics.glyph,
|
|
58786
|
+
const text2 = metrics.titleLine + (hasSubtitle ? metrics.bodyLine : 0);
|
|
58787
|
+
return hasGlyph ? Math.max(metrics.glyph, text2) : text2;
|
|
58786
58788
|
};
|
|
58787
58789
|
var measureHeader = (node, metrics) => {
|
|
58788
58790
|
if (!node.title && !node.subtitle) return 0;
|
|
@@ -59756,14 +59758,14 @@ var MARGIN = 12;
|
|
|
59756
59758
|
var LINE_HEIGHT = 14;
|
|
59757
59759
|
var captionStub = (options) => 18 + options.cornerRadius;
|
|
59758
59760
|
var captionEscape = (options) => 2 * captionStub(options) + MARGIN;
|
|
59759
|
-
var captionTextWidth = (
|
|
59761
|
+
var captionTextWidth = (text2) => Array.from(text2).reduce(
|
|
59760
59762
|
(sum, c) => sum + ((c.codePointAt(0) ?? 0) >= 11904 ? 12 : /[MW@%]/.test(c) ? 9 : /[ilI.,'!:;| ]/.test(c) ? 3.5 : 6.8),
|
|
59761
59763
|
0
|
|
59762
59764
|
);
|
|
59763
|
-
function wrapCaption(
|
|
59765
|
+
function wrapCaption(text2, width) {
|
|
59764
59766
|
const lines = [];
|
|
59765
59767
|
let line3 = "";
|
|
59766
|
-
for (const paragraph of
|
|
59768
|
+
for (const paragraph of text2.split(/\r?\n/u)) {
|
|
59767
59769
|
for (const word of paragraph.split(/\s+/u).filter(Boolean)) {
|
|
59768
59770
|
if (line3 && captionTextWidth(`${line3} ${word}`) <= width) {
|
|
59769
59771
|
line3 += ` ${word}`;
|
|
@@ -59859,8 +59861,8 @@ function layoutCaptions(nodes, edges, connectors, options) {
|
|
|
59859
59861
|
if (route && !segmentsCrossBoxes(route.points, [...nodes, ...boxes]) && (blocked || score(route.points) < score(edge.points)))
|
|
59860
59862
|
Object.assign(edge, { points: route.points, d: route.d });
|
|
59861
59863
|
};
|
|
59862
|
-
const measure = (
|
|
59863
|
-
const lines = wrapCaption(
|
|
59864
|
+
const measure = (text2, width, x, y) => {
|
|
59865
|
+
const lines = wrapCaption(text2, Math.max(10, width - 2 * PADDING));
|
|
59864
59866
|
const measuredWidth = Math.min(
|
|
59865
59867
|
width,
|
|
59866
59868
|
Math.max(...lines.map(captionTextWidth)) + 2 * PADDING
|
|
@@ -59899,10 +59901,10 @@ function layoutCaptions(nodes, edges, connectors, options) {
|
|
|
59899
59901
|
Object.assign(edge, local);
|
|
59900
59902
|
}
|
|
59901
59903
|
avoid(edge, reserved);
|
|
59902
|
-
const
|
|
59904
|
+
const text2 = edge.label;
|
|
59903
59905
|
const readableWidth = Math.max(
|
|
59904
59906
|
64,
|
|
59905
|
-
Math.min(96, Math.max(...
|
|
59907
|
+
Math.min(96, Math.max(...text2.split(/\s+/u).map(captionTextWidth))) + 16
|
|
59906
59908
|
);
|
|
59907
59909
|
const candidates = [];
|
|
59908
59910
|
for (let i = 1; i < edge.points.length; i++) {
|
|
@@ -59936,7 +59938,7 @@ function layoutCaptions(nodes, edges, connectors, options) {
|
|
|
59936
59938
|
);
|
|
59937
59939
|
for (const candidate of candidates) {
|
|
59938
59940
|
if (candidate.width < readableWidth) continue;
|
|
59939
|
-
const base = measure(
|
|
59941
|
+
const base = measure(text2, candidate.width, candidate.x, candidate.y);
|
|
59940
59942
|
const canMove = !candidate.vertical && candidate.segment > 0 && candidate.segment < edge.points.length - 2;
|
|
59941
59943
|
const middle = nodes.reduce((sum, n) => sum + n.y + n.height / 2, 0) / Math.max(1, nodes.length);
|
|
59942
59944
|
const direction = candidate.y >= middle ? 1 : -1;
|
|
@@ -59975,7 +59977,7 @@ function layoutCaptions(nodes, edges, connectors, options) {
|
|
|
59975
59977
|
}
|
|
59976
59978
|
if (!edge.caption) {
|
|
59977
59979
|
const caption = measure(
|
|
59978
|
-
|
|
59980
|
+
text2,
|
|
59979
59981
|
Math.min(240, Math.max(80, options.connectorWidth - 2 * MARGIN)),
|
|
59980
59982
|
0,
|
|
59981
59983
|
0
|
|
@@ -60046,9 +60048,9 @@ function captionSpacing(nodes, options) {
|
|
|
60046
60048
|
};
|
|
60047
60049
|
nodes.forEach(visit);
|
|
60048
60050
|
const ranks = new Map(all.map((n, i) => [n.id, i]));
|
|
60049
|
-
const reserve = (map, id,
|
|
60050
|
-
if (!
|
|
60051
|
-
const width = captionTextWidth(
|
|
60051
|
+
const reserve = (map, id, text2) => {
|
|
60052
|
+
if (!text2) return;
|
|
60053
|
+
const width = captionTextWidth(text2);
|
|
60052
60054
|
if (width <= Math.max(48, options.connectorWidth - 40)) return;
|
|
60053
60055
|
const budget = Math.min(
|
|
60054
60056
|
240,
|
|
@@ -60062,7 +60064,7 @@ function captionSpacing(nodes, options) {
|
|
|
60062
60064
|
),
|
|
60063
60065
|
vertical: Math.max(
|
|
60064
60066
|
old?.vertical ?? 0,
|
|
60065
|
-
wrapCaption(
|
|
60067
|
+
wrapCaption(text2, budget).length * LINE_HEIGHT + PADDING + 2 * (captionEscape(options) + MARGIN)
|
|
60066
60068
|
)
|
|
60067
60069
|
});
|
|
60068
60070
|
};
|
|
@@ -67082,11 +67084,11 @@ function buildTimeScale(rangeStart, rangeEnd, pxPerDay, locale) {
|
|
|
67082
67084
|
const columns = seeds.filter((s) => s.end > rangeStart && s.start < rangeEnd).map((s, i) => {
|
|
67083
67085
|
const clampedStart = Math.max(s.start, rangeStart);
|
|
67084
67086
|
const clampedEnd = Math.min(s.end, rangeEnd);
|
|
67085
|
-
const
|
|
67087
|
+
const text2 = labelOf(s.start);
|
|
67086
67088
|
return {
|
|
67087
67089
|
id: `${id}-${i}`,
|
|
67088
|
-
label:
|
|
67089
|
-
subLabel:
|
|
67090
|
+
label: text2.label,
|
|
67091
|
+
subLabel: text2.subLabel,
|
|
67090
67092
|
start: clampedStart,
|
|
67091
67093
|
end: clampedEnd,
|
|
67092
67094
|
width: (clampedEnd - clampedStart) / MS_PER_DAY * pxPerDay
|
|
@@ -70867,7 +70869,7 @@ var Avatars = ({ users }) => {
|
|
|
70867
70869
|
)) });
|
|
70868
70870
|
};
|
|
70869
70871
|
var TaskBoardCardBody = ({ card }) => {
|
|
70870
|
-
const { surface, size, cardLayout, priorities, locale, text } = useTaskBoard();
|
|
70872
|
+
const { surface, size, cardLayout, priorities, locale, text: text2 } = useTaskBoard();
|
|
70871
70873
|
const priority = card.priority ? priorities.get(card.priority) : void 0;
|
|
70872
70874
|
const due = formatDue(card.due, locale);
|
|
70873
70875
|
const plainChip = (0, import_classnames127.default)("bg-black/5 dark:bg-white/10", surface.muted);
|
|
@@ -70924,12 +70926,12 @@ var TaskBoardCardBody = ({ card }) => {
|
|
|
70924
70926
|
(hasMeta || card.assignees?.length) && /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "flex items-end gap-2", children: [
|
|
70925
70927
|
/* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: (0, import_classnames127.default)("flex min-w-0 flex-1 flex-wrap items-center gap-2", size.meta, surface.muted), children: [
|
|
70926
70928
|
priorityChip,
|
|
70927
|
-
card.description && /* @__PURE__ */ (0, import_jsx_runtime319.jsx)("span", { title:
|
|
70929
|
+
card.description && /* @__PURE__ */ (0, import_jsx_runtime319.jsx)("span", { title: text2("notes"), "aria-label": text2("notes"), role: "img", children: /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(Details, { className: "h-3.5 w-3.5", "aria-hidden": "true" }) }),
|
|
70928
70930
|
card.checklist && /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)(
|
|
70929
70931
|
"span",
|
|
70930
70932
|
{
|
|
70931
70933
|
className: "inline-flex items-center gap-1",
|
|
70932
|
-
title:
|
|
70934
|
+
title: text2("checklist", { done: card.checklist.done, total: card.checklist.total }),
|
|
70933
70935
|
children: [
|
|
70934
70936
|
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(CheckCircle, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
70935
70937
|
card.checklist.done,
|
|
@@ -70938,7 +70940,7 @@ var TaskBoardCardBody = ({ card }) => {
|
|
|
70938
70940
|
]
|
|
70939
70941
|
}
|
|
70940
70942
|
),
|
|
70941
|
-
due && /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("span", { "data-card-due": true, className: "inline-flex items-center gap-1", title:
|
|
70943
|
+
due && /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("span", { "data-card-due": true, className: "inline-flex items-center gap-1", title: text2("due", { date: due }), children: [
|
|
70942
70944
|
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(Calendar, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
70943
70945
|
due
|
|
70944
70946
|
] })
|
|
@@ -71041,7 +71043,7 @@ TaskBoardCard.displayName = "TaskBoardCard";
|
|
|
71041
71043
|
// src/components/TaskBoard/TaskBoardBucket.tsx
|
|
71042
71044
|
var import_jsx_runtime320 = require("react/jsx-runtime");
|
|
71043
71045
|
var TaskBoardBucket = ({ column, lane, cards, className, label }) => {
|
|
71044
|
-
const { cardState, cardProps, dropTarget, size, text } = useTaskBoard();
|
|
71046
|
+
const { cardState, cardProps, dropTarget, size, text: text2 } = useTaskBoard();
|
|
71045
71047
|
const key = bucketKey(column, lane);
|
|
71046
71048
|
const target = dropTarget && dropTarget.bucket === key ? dropTarget : null;
|
|
71047
71049
|
return /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
@@ -71053,7 +71055,7 @@ var TaskBoardBucket = ({ column, lane, cards, className, label }) => {
|
|
|
71053
71055
|
"data-bucket-column": column,
|
|
71054
71056
|
"data-bucket-lane": lane ?? "",
|
|
71055
71057
|
"data-drop": target ? target.valid ? "valid" : "invalid" : void 0,
|
|
71056
|
-
title: target && !target.valid ?
|
|
71058
|
+
title: target && !target.valid ? text2("notAllowed") : void 0,
|
|
71057
71059
|
className: (0, import_classnames128.default)(
|
|
71058
71060
|
"flex min-h-12 flex-col rounded-lg transition-colors",
|
|
71059
71061
|
size.gap,
|
|
@@ -71125,7 +71127,7 @@ var TaskBoardAddColumn = ({
|
|
|
71125
71127
|
onAdd,
|
|
71126
71128
|
variant
|
|
71127
71129
|
}) => {
|
|
71128
|
-
const { text, surface, color, size, columnCornerClass } = useTaskBoard();
|
|
71130
|
+
const { text: text2, surface, color, size, columnCornerClass } = useTaskBoard();
|
|
71129
71131
|
const [editing, setEditing] = (0, import_react296.useState)(false);
|
|
71130
71132
|
const [title, setTitle] = (0, import_react296.useState)("");
|
|
71131
71133
|
const trigger = getSurfaceTriggerTokens(color);
|
|
@@ -71152,8 +71154,8 @@ var TaskBoardAddColumn = ({
|
|
|
71152
71154
|
"input",
|
|
71153
71155
|
{
|
|
71154
71156
|
autoFocus: true,
|
|
71155
|
-
"aria-label":
|
|
71156
|
-
placeholder:
|
|
71157
|
+
"aria-label": text2("columnName"),
|
|
71158
|
+
placeholder: text2("columnName"),
|
|
71157
71159
|
value: title,
|
|
71158
71160
|
onChange: (e) => setTitle(e.target.value),
|
|
71159
71161
|
onKeyDown: (e) => {
|
|
@@ -71186,7 +71188,7 @@ var TaskBoardAddColumn = ({
|
|
|
71186
71188
|
),
|
|
71187
71189
|
children: [
|
|
71188
71190
|
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)(Add, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
71189
|
-
|
|
71191
|
+
text2("addColumn")
|
|
71190
71192
|
]
|
|
71191
71193
|
}
|
|
71192
71194
|
)
|
|
@@ -71263,7 +71265,7 @@ function fromDraft(column, d) {
|
|
|
71263
71265
|
}
|
|
71264
71266
|
var limitValid = (wip) => wip.trim() === "" || Number.isInteger(Number(wip)) && Number(wip) >= 1;
|
|
71265
71267
|
var TaskBoardColumnEditButton = ({ column }) => {
|
|
71266
|
-
const { onEditColumn, allColumns, text, surface, color } = useTaskBoard();
|
|
71268
|
+
const { onEditColumn, allColumns, text: text2, surface, color } = useTaskBoard();
|
|
71267
71269
|
const [open, setOpen] = (0, import_react297.useState)(false);
|
|
71268
71270
|
const [draft, setDraft] = (0, import_react297.useState)(() => toDraft(column));
|
|
71269
71271
|
const id = (0, import_react297.useId)();
|
|
@@ -71290,7 +71292,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
71290
71292
|
"button",
|
|
71291
71293
|
{
|
|
71292
71294
|
type: "button",
|
|
71293
|
-
"aria-label":
|
|
71295
|
+
"aria-label": text2("editColumn", { name: column.title }),
|
|
71294
71296
|
className: (0, import_classnames130.default)("shrink-0 rounded p-1", surface.muted, trigger.hover, trigger.focusRing),
|
|
71295
71297
|
children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Edit, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
71296
71298
|
}
|
|
@@ -71308,8 +71310,8 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
71308
71310
|
Input_default,
|
|
71309
71311
|
{
|
|
71310
71312
|
size: "sm",
|
|
71311
|
-
"aria-label":
|
|
71312
|
-
placeholder:
|
|
71313
|
+
"aria-label": text2("columnName"),
|
|
71314
|
+
placeholder: text2("columnName"),
|
|
71313
71315
|
value: draft.title,
|
|
71314
71316
|
onChange: (e) => setDraft({ ...draft, title: e.target.value }),
|
|
71315
71317
|
onKeyDown: (e) => {
|
|
@@ -71321,7 +71323,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
71321
71323
|
}
|
|
71322
71324
|
),
|
|
71323
71325
|
/* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
|
|
71324
|
-
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("span", { className: (0, import_classnames130.default)("text-xs font-semibold", surface.muted), children:
|
|
71326
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("span", { className: (0, import_classnames130.default)("text-xs font-semibold", surface.muted), children: text2("columnColor") }),
|
|
71325
71327
|
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
71326
71328
|
ColorSwatches,
|
|
71327
71329
|
{
|
|
@@ -71334,7 +71336,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
71334
71336
|
)
|
|
71335
71337
|
] }),
|
|
71336
71338
|
/* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
71337
|
-
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("label", { htmlFor: `${id}-wip`, className: (0, import_classnames130.default)("text-xs font-semibold", surface.muted), children:
|
|
71339
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("label", { htmlFor: `${id}-wip`, className: (0, import_classnames130.default)("text-xs font-semibold", surface.muted), children: text2("wipLimit") }),
|
|
71338
71340
|
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
71339
71341
|
Input_default,
|
|
71340
71342
|
{
|
|
@@ -71343,7 +71345,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
71343
71345
|
type: "number",
|
|
71344
71346
|
min: 1,
|
|
71345
71347
|
inputMode: "numeric",
|
|
71346
|
-
placeholder:
|
|
71348
|
+
placeholder: text2("wipLimitHint"),
|
|
71347
71349
|
value: draft.wip,
|
|
71348
71350
|
onChange: (e) => setDraft({ ...draft, wip: e.target.value }),
|
|
71349
71351
|
"aria-invalid": !limitValid(draft.wip) || void 0
|
|
@@ -71351,7 +71353,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
71351
71353
|
)
|
|
71352
71354
|
] }),
|
|
71353
71355
|
/* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
71354
|
-
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("label", { htmlFor: `${id}-max`, className: (0, import_classnames130.default)("text-xs font-semibold", surface.muted), children:
|
|
71356
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("label", { htmlFor: `${id}-max`, className: (0, import_classnames130.default)("text-xs font-semibold", surface.muted), children: text2("maxItems") }),
|
|
71355
71357
|
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
71356
71358
|
Input_default,
|
|
71357
71359
|
{
|
|
@@ -71360,7 +71362,7 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
71360
71362
|
type: "number",
|
|
71361
71363
|
min: 1,
|
|
71362
71364
|
inputMode: "numeric",
|
|
71363
|
-
placeholder:
|
|
71365
|
+
placeholder: text2("maxItemsHint"),
|
|
71364
71366
|
value: draft.max,
|
|
71365
71367
|
onChange: (e) => setDraft({ ...draft, max: e.target.value }),
|
|
71366
71368
|
"aria-invalid": !limitValid(draft.max) || void 0
|
|
@@ -71371,14 +71373,14 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
71371
71373
|
Toggle_default,
|
|
71372
71374
|
{
|
|
71373
71375
|
size: "sm",
|
|
71374
|
-
label:
|
|
71375
|
-
description:
|
|
71376
|
+
label: text2("lockColumn"),
|
|
71377
|
+
description: text2("lockColumnHint"),
|
|
71376
71378
|
checked: draft.locked,
|
|
71377
71379
|
onChange: (e) => setDraft({ ...draft, locked: e.target.checked })
|
|
71378
71380
|
}
|
|
71379
71381
|
),
|
|
71380
71382
|
others.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("fieldset", { className: "flex flex-col gap-1.5", children: [
|
|
71381
|
-
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("legend", { className: (0, import_classnames130.default)("mb-1 text-xs font-semibold", surface.muted), children:
|
|
71383
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("legend", { className: (0, import_classnames130.default)("mb-1 text-xs font-semibold", surface.muted), children: text2("acceptsFrom") }),
|
|
71382
71384
|
others.map((c) => /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
71383
71385
|
Checkbox_default,
|
|
71384
71386
|
{
|
|
@@ -71392,11 +71394,11 @@ var TaskBoardColumnEditButton = ({ column }) => {
|
|
|
71392
71394
|
},
|
|
71393
71395
|
c.id
|
|
71394
71396
|
)),
|
|
71395
|
-
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("span", { className: (0, import_classnames130.default)("text-[11px]", surface.muted), children:
|
|
71397
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("span", { className: (0, import_classnames130.default)("text-[11px]", surface.muted), children: text2("acceptsAny") })
|
|
71396
71398
|
] }),
|
|
71397
71399
|
/* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: "flex justify-end gap-2 pt-1", children: [
|
|
71398
|
-
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Button_default, { type: "button", size: "sm", variant: "soft", color: "slate", onClick: () => setOpen(false), children:
|
|
71399
|
-
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Button_default, { type: "submit", size: "sm", color, disabled: !valid, children:
|
|
71400
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Button_default, { type: "button", size: "sm", variant: "soft", color: "slate", onClick: () => setOpen(false), children: text2("cancel") }),
|
|
71401
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(Button_default, { type: "submit", size: "sm", color, disabled: !valid, children: text2("save") })
|
|
71400
71402
|
] })
|
|
71401
71403
|
]
|
|
71402
71404
|
}
|
|
@@ -71418,7 +71420,7 @@ var TaskBoardColumn = ({
|
|
|
71418
71420
|
index = 0,
|
|
71419
71421
|
onToggle
|
|
71420
71422
|
}) => {
|
|
71421
|
-
const { surface, text, color, size, wellSurface, columnCornerClass, onAddCard, draggingColumnId, boardMaxItems, dropTarget } = useTaskBoard();
|
|
71423
|
+
const { surface, text: text2, color, size, wellSurface, columnCornerClass, onAddCard, draggingColumnId, boardMaxItems, dropTarget } = useTaskBoard();
|
|
71422
71424
|
const refused = Boolean(dropTarget && !dropTarget.valid && dropTarget.bucket === bucketKey(column.id, null));
|
|
71423
71425
|
const max = effectiveMaxItems(column, boardMaxItems);
|
|
71424
71426
|
const full = max !== void 0 && count >= max;
|
|
@@ -71435,7 +71437,7 @@ var TaskBoardColumn = ({
|
|
|
71435
71437
|
type: "button",
|
|
71436
71438
|
onClick: onToggle,
|
|
71437
71439
|
"aria-expanded": !column.collapsed,
|
|
71438
|
-
"aria-label":
|
|
71440
|
+
"aria-label": text2(column.collapsed ? "expand" : "collapse", {
|
|
71439
71441
|
name: column.title
|
|
71440
71442
|
}),
|
|
71441
71443
|
className: (0, import_classnames131.default)(
|
|
@@ -71459,7 +71461,7 @@ var TaskBoardColumn = ({
|
|
|
71459
71461
|
"span",
|
|
71460
71462
|
{
|
|
71461
71463
|
"data-column-count": true,
|
|
71462
|
-
title: column.wipLimit !== void 0 ?
|
|
71464
|
+
title: column.wipLimit !== void 0 ? text2("wip", { count, limit: column.wipLimit }) : void 0,
|
|
71463
71465
|
className: (0, import_classnames131.default)(
|
|
71464
71466
|
"text-xs font-semibold tabular-nums",
|
|
71465
71467
|
wip === "full" || wip === "over" || full ? tokens.wipFull : surface.muted
|
|
@@ -71562,7 +71564,7 @@ var TaskBoardColumn = ({
|
|
|
71562
71564
|
column: column.id,
|
|
71563
71565
|
lane: null,
|
|
71564
71566
|
cards,
|
|
71565
|
-
label: `${column.title}, ${
|
|
71567
|
+
label: `${column.title}, ${text2("cardCount", { count: cards.length })}`
|
|
71566
71568
|
}
|
|
71567
71569
|
)
|
|
71568
71570
|
}
|
|
@@ -71580,7 +71582,7 @@ var TaskBoardColumn = ({
|
|
|
71580
71582
|
),
|
|
71581
71583
|
children: [
|
|
71582
71584
|
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)(Add, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
71583
|
-
|
|
71585
|
+
text2("addCard")
|
|
71584
71586
|
]
|
|
71585
71587
|
}
|
|
71586
71588
|
)
|
|
@@ -71606,7 +71608,7 @@ var TaskBoardHeader = ({
|
|
|
71606
71608
|
people,
|
|
71607
71609
|
variant
|
|
71608
71610
|
}) => {
|
|
71609
|
-
const { surface, text } = useTaskBoard();
|
|
71611
|
+
const { surface, text: text2 } = useTaskBoard();
|
|
71610
71612
|
const shown = people?.slice(0, MAX_AVATARS) ?? [];
|
|
71611
71613
|
const extra = (people?.length ?? 0) - shown.length;
|
|
71612
71614
|
return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)(
|
|
@@ -71636,7 +71638,7 @@ var TaskBoardHeader = ({
|
|
|
71636
71638
|
{
|
|
71637
71639
|
"data-taskboard-people": true,
|
|
71638
71640
|
role: "group",
|
|
71639
|
-
"aria-label":
|
|
71641
|
+
"aria-label": text2("online", { count: people.length }),
|
|
71640
71642
|
className: "flex items-center -space-x-2",
|
|
71641
71643
|
children: [
|
|
71642
71644
|
shown.map((p) => /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
@@ -71674,7 +71676,7 @@ var TaskBoardLaneGrid = ({
|
|
|
71674
71676
|
onToggleColumn,
|
|
71675
71677
|
onAddColumn
|
|
71676
71678
|
}) => {
|
|
71677
|
-
const { surface, text, color, size, stickySurface, draggingColumnId, boardMaxItems } = useTaskBoard();
|
|
71679
|
+
const { surface, text: text2, color, size, stickySurface, draggingColumnId, boardMaxItems } = useTaskBoard();
|
|
71678
71680
|
const fullColumns = new Set(columns.filter((c) => columnAtMax(cards, c, boardMaxItems)).map((c) => c.id));
|
|
71679
71681
|
const trigger = getSurfaceTriggerTokens(color);
|
|
71680
71682
|
const template = [
|
|
@@ -71689,7 +71691,7 @@ var TaskBoardLaneGrid = ({
|
|
|
71689
71691
|
type: "button",
|
|
71690
71692
|
onClick,
|
|
71691
71693
|
"aria-expanded": !collapsed,
|
|
71692
|
-
"aria-label":
|
|
71694
|
+
"aria-label": text2(collapsed ? "expand" : "collapse", { name }),
|
|
71693
71695
|
className: (0, import_classnames133.default)("rounded p-1", surface.muted, trigger.hover, trigger.focusRing),
|
|
71694
71696
|
children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(
|
|
71695
71697
|
ChevronRight,
|
|
@@ -71775,7 +71777,7 @@ var TaskBoardLaneRow = ({
|
|
|
71775
71777
|
trailingCell,
|
|
71776
71778
|
fullColumns
|
|
71777
71779
|
}) => {
|
|
71778
|
-
const { surface, text, color, stickySurface, onAddCard, dropTarget } = useTaskBoard();
|
|
71780
|
+
const { surface, text: text2, color, stickySurface, onAddCard, dropTarget } = useTaskBoard();
|
|
71779
71781
|
const refusedBucket = dropTarget && !dropTarget.valid ? dropTarget.bucket : null;
|
|
71780
71782
|
const trigger = getSurfaceTriggerTokens(color);
|
|
71781
71783
|
const open = !lane.collapsed;
|
|
@@ -71826,7 +71828,7 @@ var TaskBoardLaneRow = ({
|
|
|
71826
71828
|
{
|
|
71827
71829
|
type: "button",
|
|
71828
71830
|
onClick: () => onAddCard({ column: col.id, lane: lane.id }),
|
|
71829
|
-
"aria-label": `${
|
|
71831
|
+
"aria-label": `${text2("addCard")} \u2014 ${col.title}, ${lane.title}`,
|
|
71830
71832
|
className: (0, import_classnames133.default)(
|
|
71831
71833
|
"flex items-center justify-center rounded-md py-1 opacity-60 hover:opacity-100 focus-visible:opacity-100",
|
|
71832
71834
|
surface.muted,
|
|
@@ -72181,7 +72183,7 @@ function useTaskBoardDrag(opts) {
|
|
|
72181
72183
|
var import_react299 = require("react");
|
|
72182
72184
|
var isRtl = (el) => el?.closest("[dir]")?.getAttribute("dir") === "rtl";
|
|
72183
72185
|
function useTaskBoardKeyboard(o) {
|
|
72184
|
-
const { rootRef, cards, viewCards, columns, lanes, text, drag } = o;
|
|
72186
|
+
const { rootRef, cards, viewCards, columns, lanes, text: text2, drag } = o;
|
|
72185
72187
|
const [message, setMessage] = (0, import_react299.useState)("");
|
|
72186
72188
|
const [activeId, setActiveId] = (0, import_react299.useState)(null);
|
|
72187
72189
|
const [ownSelection, setOwnSelection] = (0, import_react299.useState)([]);
|
|
@@ -72208,9 +72210,9 @@ function useTaskBoardKeyboard(o) {
|
|
|
72208
72210
|
const total = (others.get(bucketKey(to.column, to.lane))?.length ?? 0) + 1;
|
|
72209
72211
|
const values = { column: columnTitle(to.column), index: to.index + 1, total };
|
|
72210
72212
|
const lane = to.lane ? lanes?.find((l) => l.id === to.lane)?.title : void 0;
|
|
72211
|
-
announce(lane ?
|
|
72213
|
+
announce(lane ? text2("movedLane", { ...values, lane }) : text2("moved", values));
|
|
72212
72214
|
},
|
|
72213
|
-
[announce, cards, columns, lanes, columnTitle,
|
|
72215
|
+
[announce, cards, columns, lanes, columnTitle, text2]
|
|
72214
72216
|
);
|
|
72215
72217
|
const setSelection = (0, import_react299.useCallback)(
|
|
72216
72218
|
(ids) => {
|
|
@@ -72310,20 +72312,20 @@ function useTaskBoardKeyboard(o) {
|
|
|
72310
72312
|
e.preventDefault();
|
|
72311
72313
|
const target = drag.to ?? drag.from;
|
|
72312
72314
|
refocusRef.current = card.id;
|
|
72313
|
-
announce(
|
|
72315
|
+
announce(text2("dropped", { title: card.title, column: columnTitle(target.column) }));
|
|
72314
72316
|
void o.finish().then((ok) => {
|
|
72315
72317
|
if (!ok && (target.column !== drag.from.column || target.lane !== drag.from.lane || target.index !== drag.from.index)) {
|
|
72316
|
-
announce(
|
|
72318
|
+
announce(text2("cancelled"));
|
|
72317
72319
|
}
|
|
72318
72320
|
});
|
|
72319
72321
|
} else if (e.key === "Escape") {
|
|
72320
72322
|
e.preventDefault();
|
|
72321
72323
|
refocusRef.current = card.id;
|
|
72322
72324
|
o.cancel("escape");
|
|
72323
|
-
announce(
|
|
72325
|
+
announce(text2("cancelled"));
|
|
72324
72326
|
} else if (e.key === "Tab") {
|
|
72325
72327
|
o.cancel("blur");
|
|
72326
|
-
announce(
|
|
72328
|
+
announce(text2("cancelled"));
|
|
72327
72329
|
} else if (e.key === "Enter") {
|
|
72328
72330
|
e.preventDefault();
|
|
72329
72331
|
}
|
|
@@ -72333,7 +72335,7 @@ function useTaskBoardKeyboard(o) {
|
|
|
72333
72335
|
e.preventDefault();
|
|
72334
72336
|
if (o.keyboardGrab(card, slot)) {
|
|
72335
72337
|
refocusRef.current = card.id;
|
|
72336
|
-
announce(
|
|
72338
|
+
announce(text2("grabbed", { title: card.title }));
|
|
72337
72339
|
}
|
|
72338
72340
|
return;
|
|
72339
72341
|
}
|
|
@@ -72359,7 +72361,7 @@ function useTaskBoardKeyboard(o) {
|
|
|
72359
72361
|
}
|
|
72360
72362
|
}
|
|
72361
72363
|
}),
|
|
72362
|
-
[tabStop, selection, setSelection, viewBuckets, drag, cards, columns, lanes, o, announceSlot, announce,
|
|
72364
|
+
[tabStop, selection, setSelection, viewBuckets, drag, cards, columns, lanes, o, announceSlot, announce, text2, columnTitle, focusStep]
|
|
72363
72365
|
);
|
|
72364
72366
|
return { cardProps, message, selection, announce };
|
|
72365
72367
|
}
|
|
@@ -72870,7 +72872,7 @@ var TaskBoardBody = (props) => {
|
|
|
72870
72872
|
surfaceVariant
|
|
72871
72873
|
} = props;
|
|
72872
72874
|
const surface = useSurfaceText();
|
|
72873
|
-
const
|
|
72875
|
+
const text2 = useTaskBoardText(labels);
|
|
72874
72876
|
const { locale } = useKitEngine();
|
|
72875
72877
|
const sizeTokens12 = TASKBOARD_SIZES[size] ?? TASKBOARD_SIZES.md;
|
|
72876
72878
|
const wellSurface = surface.translucent ? GLASS_WELL : SOLID_WELL;
|
|
@@ -72903,8 +72905,8 @@ var TaskBoardBody = (props) => {
|
|
|
72903
72905
|
if (!holder || holder === selfId) return;
|
|
72904
72906
|
const peer = collab.userById(holder);
|
|
72905
72907
|
cancel("held");
|
|
72906
|
-
setNotice({ cardId: drag.cardId, text:
|
|
72907
|
-
}, [collab, drag, selfId, cancel,
|
|
72908
|
+
setNotice({ cardId: drag.cardId, text: text2("heldShort", { name: peer.name }), color: peer.color ?? peerColor(peer.id) });
|
|
72909
|
+
}, [collab, drag, selfId, cancel, text2]);
|
|
72908
72910
|
(0, import_react305.useEffect)(() => {
|
|
72909
72911
|
if (!notice) return;
|
|
72910
72912
|
const t = setTimeout(() => setNotice(null), NOTICE_MS);
|
|
@@ -72916,7 +72918,7 @@ var TaskBoardBody = (props) => {
|
|
|
72916
72918
|
viewCards: previewCards,
|
|
72917
72919
|
columns,
|
|
72918
72920
|
lanes: viewLanes,
|
|
72919
|
-
text,
|
|
72921
|
+
text: text2,
|
|
72920
72922
|
drag,
|
|
72921
72923
|
keyboardGrab,
|
|
72922
72924
|
keyboardMove,
|
|
@@ -72935,7 +72937,7 @@ var TaskBoardBody = (props) => {
|
|
|
72935
72937
|
rootRef,
|
|
72936
72938
|
columns,
|
|
72937
72939
|
enabled: columnEditing,
|
|
72938
|
-
text,
|
|
72940
|
+
text: text2,
|
|
72939
72941
|
announce: keyboard.announce,
|
|
72940
72942
|
onCommit: (next) => onColumnsChange?.(next)
|
|
72941
72943
|
});
|
|
@@ -72956,7 +72958,7 @@ var TaskBoardBody = (props) => {
|
|
|
72956
72958
|
);
|
|
72957
72959
|
const ctx = (0, import_react305.useMemo)(
|
|
72958
72960
|
() => ({
|
|
72959
|
-
text,
|
|
72961
|
+
text: text2,
|
|
72960
72962
|
surface,
|
|
72961
72963
|
color,
|
|
72962
72964
|
size: sizeTokens12,
|
|
@@ -72989,7 +72991,7 @@ var TaskBoardBody = (props) => {
|
|
|
72989
72991
|
cardProps: (card, slot) => ({ ...isEditable ? cardHandlers(card, slot) : {}, ...keyboardProps(card, slot) }),
|
|
72990
72992
|
dropTarget: drag?.to && !drag.valid ? { bucket: bucketKey(drag.to.column, drag.to.lane), index: drag.to.index, valid: false } : null
|
|
72991
72993
|
}),
|
|
72992
|
-
[
|
|
72994
|
+
[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]
|
|
72993
72995
|
);
|
|
72994
72996
|
const buckets = (0, import_react305.useMemo)(() => bucketCards(previewCards, columns, viewLanes), [previewCards, columns, viewLanes]);
|
|
72995
72997
|
const draggedCard = drag ? cards.find((c) => c.id === drag.cardId) : void 0;
|
|
@@ -73010,12 +73012,12 @@ var TaskBoardBody = (props) => {
|
|
|
73010
73012
|
);
|
|
73011
73013
|
} else if (error) {
|
|
73012
73014
|
content = /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)("div", { role: "alert", className: "flex flex-1 flex-col items-center justify-center gap-3 p-10 text-center", children: [
|
|
73013
|
-
/* @__PURE__ */ (0, import_jsx_runtime329.jsx)("p", { className: (0, import_classnames137.default)("text-sm font-medium", surface.body), children: error === true ?
|
|
73014
|
-
onRetry && /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(Button_default, { size: "sm", variant: "outline", color, onClick: onRetry, children:
|
|
73015
|
+
/* @__PURE__ */ (0, import_jsx_runtime329.jsx)("p", { className: (0, import_classnames137.default)("text-sm font-medium", surface.body), children: error === true ? text2("error") : error }),
|
|
73016
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(Button_default, { size: "sm", variant: "outline", color, onClick: onRetry, children: text2("retry") })
|
|
73015
73017
|
] });
|
|
73016
73018
|
} else {
|
|
73017
73019
|
content = /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
73018
|
-
cards.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("div", { "data-taskboard-empty": true, className: (0, import_classnames137.default)("px-4 pt-4 text-center text-sm", surface.muted), children: emptyState ??
|
|
73020
|
+
cards.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("div", { "data-taskboard-empty": true, className: (0, import_classnames137.default)("px-4 pt-4 text-center text-sm", surface.muted), children: emptyState ?? text2("empty") }),
|
|
73019
73021
|
laneView ? /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
73020
73022
|
TaskBoardLaneGrid,
|
|
73021
73023
|
{
|
|
@@ -73062,7 +73064,7 @@ var TaskBoardBody = (props) => {
|
|
|
73062
73064
|
role: "application",
|
|
73063
73065
|
"aria-roledescription": "task board",
|
|
73064
73066
|
"aria-busy": loading ? true : void 0,
|
|
73065
|
-
"aria-label":
|
|
73067
|
+
"aria-label": text2("root"),
|
|
73066
73068
|
className: "flex h-full min-h-0 flex-col",
|
|
73067
73069
|
children: [
|
|
73068
73070
|
/* @__PURE__ */ (0, import_jsx_runtime329.jsx)("div", { "data-taskboard-live": true, "aria-live": "polite", "aria-atomic": "true", className: "sr-only", children: keyboard.message }),
|
|
@@ -73833,12 +73835,362 @@ function hasZone(node) {
|
|
|
73833
73835
|
return node != null && node !== false;
|
|
73834
73836
|
}
|
|
73835
73837
|
|
|
73836
|
-
// src/
|
|
73838
|
+
// src/components/Menu/Menu.tsx
|
|
73839
|
+
var import_react311 = __toESM(require("react"), 1);
|
|
73840
|
+
var import_react_router_dom3 = require("react-router-dom");
|
|
73841
|
+
var import_classnames142 = __toESM(require("classnames"), 1);
|
|
73842
|
+
|
|
73843
|
+
// src/components/Menu/MenuPopup.tsx
|
|
73837
73844
|
var import_react310 = require("react");
|
|
73838
73845
|
var import_react_dom19 = require("react-dom");
|
|
73839
|
-
var import_classnames142 = __toESM(require("classnames"), 1);
|
|
73840
73846
|
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
73841
|
-
|
|
73847
|
+
function MenuPopup({ anchor, placement, width, children }) {
|
|
73848
|
+
const ref = (0, import_react310.useRef)(null);
|
|
73849
|
+
const [style, setStyle] = (0, import_react310.useState)({ visibility: "hidden" });
|
|
73850
|
+
(0, import_react310.useLayoutEffect)(() => {
|
|
73851
|
+
const update = () => {
|
|
73852
|
+
if (!anchor.current || !ref.current) return;
|
|
73853
|
+
const trigger = anchor.current.getBoundingClientRect();
|
|
73854
|
+
const rect = ref.current.getBoundingClientRect();
|
|
73855
|
+
const position = resolveTooltipPlacement({
|
|
73856
|
+
trigger: { left: trigger.left, top: trigger.top, width: trigger.width, height: trigger.height },
|
|
73857
|
+
tooltip: { width: rect.width, height: rect.height },
|
|
73858
|
+
viewport: { width: window.innerWidth, height: window.innerHeight },
|
|
73859
|
+
preferred: placement,
|
|
73860
|
+
align: "grow",
|
|
73861
|
+
offset: 4
|
|
73862
|
+
});
|
|
73863
|
+
setStyle({ left: position.left, top: position.top, zIndex: resolveOverlayZIndex(anchor.current), visibility: "visible" });
|
|
73864
|
+
};
|
|
73865
|
+
update();
|
|
73866
|
+
const observer = typeof ResizeObserver !== "undefined" ? new ResizeObserver(update) : null;
|
|
73867
|
+
if (ref.current) observer?.observe(ref.current);
|
|
73868
|
+
if (anchor.current) observer?.observe(anchor.current);
|
|
73869
|
+
window.addEventListener("resize", update);
|
|
73870
|
+
window.addEventListener("scroll", update, true);
|
|
73871
|
+
return () => {
|
|
73872
|
+
observer?.disconnect();
|
|
73873
|
+
window.removeEventListener("resize", update);
|
|
73874
|
+
window.removeEventListener("scroll", update, true);
|
|
73875
|
+
};
|
|
73876
|
+
}, [anchor, placement, width]);
|
|
73877
|
+
if (typeof document === "undefined") return null;
|
|
73878
|
+
return (0, import_react_dom19.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { ref, style: { position: "fixed", width, maxWidth: "calc(100vw - 16px)", ...style }, children }), document.body);
|
|
73879
|
+
}
|
|
73880
|
+
|
|
73881
|
+
// src/components/Menu/Menu.tsx
|
|
73882
|
+
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
73883
|
+
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" };
|
|
73884
|
+
var text = (item) => item.textValue ?? (typeof item.label === "string" ? item.label : item.id);
|
|
73885
|
+
function MenuList({ items, state, depth = 0, parentLabel, onBack, focusOnMount = false, grouped = false }) {
|
|
73886
|
+
const list = (0, import_react311.useRef)(null);
|
|
73887
|
+
const buffer = (0, import_react311.useRef)("");
|
|
73888
|
+
const timer = (0, import_react311.useRef)(void 0);
|
|
73889
|
+
const actions = () => Array.from(list.current?.querySelectorAll("[data-menu-action]") ?? []).filter((el) => el.closest('[role="menu"]') === list.current && el.getAttribute("aria-disabled") !== "true");
|
|
73890
|
+
(0, import_react311.useLayoutEffect)(() => {
|
|
73891
|
+
if (grouped) return;
|
|
73892
|
+
const entries = actions();
|
|
73893
|
+
const selected = entries.find((el) => el === document.activeElement) ?? entries[0];
|
|
73894
|
+
entries.forEach((el) => {
|
|
73895
|
+
el.tabIndex = el === selected ? 0 : -1;
|
|
73896
|
+
});
|
|
73897
|
+
}, [items, grouped]);
|
|
73898
|
+
(0, import_react311.useLayoutEffect)(() => {
|
|
73899
|
+
if (!focusOnMount) return;
|
|
73900
|
+
const frame = requestAnimationFrame(() => actions()[0]?.focus());
|
|
73901
|
+
return () => cancelAnimationFrame(frame);
|
|
73902
|
+
}, [focusOnMount]);
|
|
73903
|
+
(0, import_react311.useEffect)(() => () => clearTimeout(timer.current), []);
|
|
73904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(
|
|
73905
|
+
"ul",
|
|
73906
|
+
{
|
|
73907
|
+
ref: list,
|
|
73908
|
+
id: depth === 0 && !grouped ? `${state.owner}-menu` : void 0,
|
|
73909
|
+
role: grouped ? "group" : "menu",
|
|
73910
|
+
"aria-label": parentLabel ?? state.props["aria-label"] ?? "Menu",
|
|
73911
|
+
className: "m-0 list-none space-y-0.5 p-0",
|
|
73912
|
+
onFocusCapture: (event) => {
|
|
73913
|
+
const entries = actions();
|
|
73914
|
+
entries.forEach((el) => {
|
|
73915
|
+
el.tabIndex = el === event.target ? 0 : -1;
|
|
73916
|
+
});
|
|
73917
|
+
},
|
|
73918
|
+
onKeyDown: (event) => {
|
|
73919
|
+
if (event.target.closest('[role="menu"]') !== list.current) return;
|
|
73920
|
+
const entries = actions();
|
|
73921
|
+
const index = entries.indexOf(document.activeElement);
|
|
73922
|
+
let next;
|
|
73923
|
+
if (event.key === "ArrowDown") next = (index + 1) % entries.length;
|
|
73924
|
+
if (event.key === "ArrowUp") next = (index - 1 + entries.length) % entries.length;
|
|
73925
|
+
if (event.key === "Home") next = 0;
|
|
73926
|
+
if (event.key === "End") next = entries.length - 1;
|
|
73927
|
+
if (next !== void 0) {
|
|
73928
|
+
event.preventDefault();
|
|
73929
|
+
event.stopPropagation();
|
|
73930
|
+
entries[next]?.focus();
|
|
73931
|
+
return;
|
|
73932
|
+
}
|
|
73933
|
+
if (event.key === "Escape" || event.key === "ArrowLeft") {
|
|
73934
|
+
if (onBack) {
|
|
73935
|
+
event.preventDefault();
|
|
73936
|
+
event.stopPropagation();
|
|
73937
|
+
onBack();
|
|
73938
|
+
} else if (event.key === "Escape") {
|
|
73939
|
+
event.preventDefault();
|
|
73940
|
+
state.close(true);
|
|
73941
|
+
}
|
|
73942
|
+
return;
|
|
73943
|
+
}
|
|
73944
|
+
if (event.key === "Tab") {
|
|
73945
|
+
state.close(false);
|
|
73946
|
+
return;
|
|
73947
|
+
}
|
|
73948
|
+
if (event.key.length === 1 && event.key !== " " && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
73949
|
+
clearTimeout(timer.current);
|
|
73950
|
+
buffer.current += event.key.toLocaleLowerCase();
|
|
73951
|
+
const ordered = [...entries.slice(index + 1), ...entries.slice(0, index + 1)];
|
|
73952
|
+
ordered.find((el) => el.dataset.menuText?.toLocaleLowerCase().startsWith(buffer.current))?.focus();
|
|
73953
|
+
timer.current = setTimeout(() => {
|
|
73954
|
+
buffer.current = "";
|
|
73955
|
+
}, 600);
|
|
73956
|
+
}
|
|
73957
|
+
},
|
|
73958
|
+
children: items.filter((item) => !item.hidden).map((item) => /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(MenuRow, { item, state, depth }, item.id))
|
|
73959
|
+
}
|
|
73960
|
+
);
|
|
73961
|
+
}
|
|
73962
|
+
function MenuRow({ item, state, depth }) {
|
|
73963
|
+
const anchor = (0, import_react311.useRef)(null);
|
|
73964
|
+
const { props } = state;
|
|
73965
|
+
const tiered = (item.submenuMode ?? props.submenuMode) === "tiered";
|
|
73966
|
+
const nested = Boolean(item.items?.some((child) => !child.hidden) || item.content != null);
|
|
73967
|
+
const expanded = tiered ? state.path[depth] === item.id : state.expanded.includes(item.id);
|
|
73968
|
+
const label = text(item);
|
|
73969
|
+
const id = (0, import_react311.useId)();
|
|
73970
|
+
const open = (keyboard) => {
|
|
73971
|
+
if (item.disabled || !nested) return;
|
|
73972
|
+
state.keyboard.current = keyboard;
|
|
73973
|
+
if (tiered) state.setPath([...state.path.slice(0, depth), item.id]);
|
|
73974
|
+
else if (!expanded) state.toggle(item.id);
|
|
73975
|
+
else if (keyboard) document.getElementById(`${id}-submenu`)?.querySelector("[data-menu-action]:not([aria-disabled='true'])")?.focus();
|
|
73976
|
+
};
|
|
73977
|
+
const back = () => {
|
|
73978
|
+
if (tiered) state.setPath(state.path.slice(0, depth));
|
|
73979
|
+
else state.toggle(item.id);
|
|
73980
|
+
anchor.current?.focus();
|
|
73981
|
+
};
|
|
73982
|
+
if (item.type === "separator") return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("li", { role: "separator", className: "my-1.5 border-t border-neutral-200 dark:border-white/10" });
|
|
73983
|
+
if (item.type === "group") return /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)("li", { role: "presentation", children: [
|
|
73984
|
+
item.label && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: "px-3 pb-1 pt-3 text-xs font-semibold text-neutral-500 dark:text-neutral-400", children: item.label }),
|
|
73985
|
+
item.items && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(MenuList, { items: item.disabled ? item.items.map((child) => ({ ...child, disabled: true })) : item.items, state, depth, parentLabel: label, grouped: true })
|
|
73986
|
+
] });
|
|
73987
|
+
const tokens = getSideMenuItemTokens(props.tone ?? "neutral");
|
|
73988
|
+
const checkable = item.type === "checkbox" || item.type === "radio";
|
|
73989
|
+
const activate = (event) => {
|
|
73990
|
+
if (item.disabled) {
|
|
73991
|
+
event.preventDefault();
|
|
73992
|
+
return;
|
|
73993
|
+
}
|
|
73994
|
+
if (nested) {
|
|
73995
|
+
event.preventDefault();
|
|
73996
|
+
if (expanded) back();
|
|
73997
|
+
else open(true);
|
|
73998
|
+
return;
|
|
73999
|
+
}
|
|
74000
|
+
if (checkable) item.onCheckedChange?.(item.type === "radio" ? true : !item.checked);
|
|
74001
|
+
item.command?.(item);
|
|
74002
|
+
props.onSelect?.(item);
|
|
74003
|
+
if (item.closeOnSelect ?? !checkable) state.close(true);
|
|
74004
|
+
};
|
|
74005
|
+
const content = props.renderItem?.(item, { expanded, checked: Boolean(item.checked) }) ?? /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)(import_jsx_runtime336.Fragment, { children: [
|
|
74006
|
+
/* @__PURE__ */ (0, import_jsx_runtime336.jsx)("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__ */ (0, import_jsx_runtime336.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current" }) : /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(CustomIcon_default, { icon: "Check", size: "sm" })) : import_react311.default.isValidElement(item.icon) ? item.icon : typeof item.icon === "string" ? /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(CustomIcon_default, { icon: item.icon, size: "sm" }) : null }),
|
|
74007
|
+
/* @__PURE__ */ (0, import_jsx_runtime336.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
74008
|
+
/* @__PURE__ */ (0, import_jsx_runtime336.jsx)("span", { className: "block truncate", children: item.label }),
|
|
74009
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("span", { className: "block text-xs font-normal opacity-70", children: item.description })
|
|
74010
|
+
] }),
|
|
74011
|
+
item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("span", { className: "shrink-0 text-xs", children: item.badge }),
|
|
74012
|
+
item.shortcut != null && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("span", { className: "shrink-0 text-xs opacity-60", children: item.shortcut }),
|
|
74013
|
+
item.trailing,
|
|
74014
|
+
nested && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(CollapseChevron, { "aria-hidden": "true", className: (0, import_classnames142.default)("h-3 w-3 shrink-0", !tiered && (expanded ? "-rotate-90" : "rotate-90")) })
|
|
74015
|
+
] });
|
|
74016
|
+
const rowProps = {
|
|
74017
|
+
id,
|
|
74018
|
+
role: checkable ? item.type === "radio" ? "menuitemradio" : "menuitemcheckbox" : "menuitem",
|
|
74019
|
+
"aria-label": label,
|
|
74020
|
+
"aria-disabled": item.disabled || void 0,
|
|
74021
|
+
"aria-checked": checkable ? Boolean(item.checked) : void 0,
|
|
74022
|
+
"aria-expanded": nested ? expanded : void 0,
|
|
74023
|
+
"aria-haspopup": nested && tiered ? "menu" : void 0,
|
|
74024
|
+
"aria-controls": nested && expanded ? `${id}-submenu` : void 0,
|
|
74025
|
+
"data-menu-action": "",
|
|
74026
|
+
"data-menu-text": label,
|
|
74027
|
+
tabIndex: -1,
|
|
74028
|
+
className: (0, import_classnames142.default)(
|
|
74029
|
+
"flex w-full items-center gap-2 rounded-lg text-left font-medium outline-none transition-colors",
|
|
74030
|
+
rowSizes[props.size ?? "md"],
|
|
74031
|
+
getSurfaceTriggerTokens(props.tone ?? "neutral").focusRing,
|
|
74032
|
+
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],
|
|
74033
|
+
expanded && !item.disabled && tokens.bg
|
|
74034
|
+
),
|
|
74035
|
+
onClick: activate,
|
|
74036
|
+
onKeyDown: (event) => {
|
|
74037
|
+
if (event.key === "ArrowRight" && nested) {
|
|
74038
|
+
event.preventDefault();
|
|
74039
|
+
event.stopPropagation();
|
|
74040
|
+
open(true);
|
|
74041
|
+
}
|
|
74042
|
+
if (event.key === " " && (item.href || item.to)) {
|
|
74043
|
+
event.preventDefault();
|
|
74044
|
+
event.currentTarget.click();
|
|
74045
|
+
}
|
|
74046
|
+
},
|
|
74047
|
+
onMouseEnter: () => {
|
|
74048
|
+
state.cancelLeave();
|
|
74049
|
+
if (tiered && !item.disabled) {
|
|
74050
|
+
if (nested) open(false);
|
|
74051
|
+
else state.setPath(state.path.slice(0, depth));
|
|
74052
|
+
}
|
|
74053
|
+
}
|
|
74054
|
+
};
|
|
74055
|
+
const row = item.to && !nested ? /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(import_react_router_dom3.Link, { ...rowProps, ref: (el) => {
|
|
74056
|
+
anchor.current = el;
|
|
74057
|
+
}, to: item.to, children: content }) : item.href && !nested ? /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("a", { ...rowProps, ref: (el) => {
|
|
74058
|
+
anchor.current = el;
|
|
74059
|
+
}, href: item.href, target: item.target, rel: item.target === "_blank" ? "noopener noreferrer" : void 0, children: content }) : /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("button", { ...rowProps, type: "button", ref: (el) => {
|
|
74060
|
+
anchor.current = el;
|
|
74061
|
+
}, children: content });
|
|
74062
|
+
const submenu = /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)("div", { id: `${id}-submenu`, children: [
|
|
74063
|
+
item.items && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(MenuList, { items: item.items, state, depth: depth + 1, parentLabel: label, onBack: back, focusOnMount: state.keyboard.current }),
|
|
74064
|
+
item.content
|
|
74065
|
+
] });
|
|
74066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)("li", { role: "presentation", children: [
|
|
74067
|
+
row,
|
|
74068
|
+
nested && expanded && (tiered ? /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(MenuPopup, { anchor, placement: "right", width: props.width ?? 256, children: /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(MenuSurface, { state, children: submenu }) }) : /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: "ml-4 border-l border-neutral-200 pl-1 dark:border-white/10", children: submenu }))
|
|
74069
|
+
] });
|
|
74070
|
+
}
|
|
74071
|
+
function MenuSurface({ state, children, root = false }) {
|
|
74072
|
+
const { props } = state;
|
|
74073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { "data-menu-owner": state.owner, onMouseEnter: state.cancelLeave, onMouseLeave: state.scheduleLeave, children: /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)(
|
|
74074
|
+
Panel_default,
|
|
74075
|
+
{
|
|
74076
|
+
variant: props.variant ?? "outlined",
|
|
74077
|
+
tone: props.tone ?? "neutral",
|
|
74078
|
+
corner: props.corner,
|
|
74079
|
+
padding: props.padding ?? "xs",
|
|
74080
|
+
glassOpacity: props.glassOpacity,
|
|
74081
|
+
vibrancy: props.vibrancy,
|
|
74082
|
+
specularMode: props.specularMode,
|
|
74083
|
+
className: (0, import_classnames142.default)(
|
|
74084
|
+
root ? props.className : void 0,
|
|
74085
|
+
(!root || props.popup || props.trigger || props.anchorRef) && "backdrop-blur-xl"
|
|
74086
|
+
),
|
|
74087
|
+
children: [
|
|
74088
|
+
root && props.header && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: "mb-2 border-b border-neutral-200 pb-2 dark:border-white/10", children: props.header }),
|
|
74089
|
+
/* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: (0, import_classnames142.default)("overflow-auto", THIN_SCROLLBAR), style: { maxHeight: `min(${props.maxHeight ?? 400}px, calc(100dvh - 32px))` }, children }),
|
|
74090
|
+
root && props.footer && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { className: "mt-2 border-t border-neutral-200 pt-2 dark:border-white/10", children: props.footer })
|
|
74091
|
+
]
|
|
74092
|
+
}
|
|
74093
|
+
) });
|
|
74094
|
+
}
|
|
74095
|
+
function Menu(props) {
|
|
74096
|
+
const owner = (0, import_react311.useId)();
|
|
74097
|
+
const triggerRef = (0, import_react311.useRef)(null);
|
|
74098
|
+
const anchor = props.anchorRef ?? triggerRef;
|
|
74099
|
+
const popup = props.popup ?? Boolean(props.trigger || props.anchorRef);
|
|
74100
|
+
const [internalOpen, setInternalOpen] = (0, import_react311.useState)(props.defaultOpen ?? false);
|
|
74101
|
+
const open = props.open ?? internalOpen;
|
|
74102
|
+
const [expanded, setExpanded] = (0, import_react311.useState)(props.defaultExpandedKeys ?? []);
|
|
74103
|
+
const [path, setPath] = (0, import_react311.useState)([]);
|
|
74104
|
+
const keyboard = (0, import_react311.useRef)(false);
|
|
74105
|
+
const leave = (0, import_react311.useRef)(void 0);
|
|
74106
|
+
const cancelLeave = (0, import_react311.useCallback)(() => clearTimeout(leave.current), []);
|
|
74107
|
+
const requestOpen = (0, import_react311.useCallback)((value) => {
|
|
74108
|
+
if (props.open === void 0) setInternalOpen(value);
|
|
74109
|
+
props.onOpenChange?.(value);
|
|
74110
|
+
if (!value) setPath([]);
|
|
74111
|
+
}, [props.open, props.onOpenChange]);
|
|
74112
|
+
const close = (restore = false) => {
|
|
74113
|
+
setPath([]);
|
|
74114
|
+
if (popup) requestOpen(false);
|
|
74115
|
+
if (restore) {
|
|
74116
|
+
if (anchor.current) anchor.current.focus();
|
|
74117
|
+
else {
|
|
74118
|
+
const root = Array.from(document.querySelectorAll("[data-menu-owner]")).find((el) => el.dataset.menuOwner === owner);
|
|
74119
|
+
root?.querySelector("[data-menu-action]:not([aria-disabled='true'])")?.focus();
|
|
74120
|
+
}
|
|
74121
|
+
}
|
|
74122
|
+
};
|
|
74123
|
+
(0, import_react311.useEffect)(() => {
|
|
74124
|
+
if (popup ? !open : path.length === 0) return;
|
|
74125
|
+
const outside = (event) => {
|
|
74126
|
+
const target = event.target;
|
|
74127
|
+
if (anchor.current?.contains(target)) return;
|
|
74128
|
+
const owned = Array.from(document.querySelectorAll("[data-menu-owner]")).some((el) => el.dataset.menuOwner === owner && el.contains(target));
|
|
74129
|
+
if (!owned) requestOpen(false);
|
|
74130
|
+
};
|
|
74131
|
+
document.addEventListener("pointerdown", outside);
|
|
74132
|
+
return () => document.removeEventListener("pointerdown", outside);
|
|
74133
|
+
}, [popup, open, path.length, anchor, owner, requestOpen]);
|
|
74134
|
+
(0, import_react311.useEffect)(() => () => clearTimeout(leave.current), []);
|
|
74135
|
+
const state = {
|
|
74136
|
+
owner,
|
|
74137
|
+
props,
|
|
74138
|
+
expanded: props.expandedKeys ?? expanded,
|
|
74139
|
+
path,
|
|
74140
|
+
setPath,
|
|
74141
|
+
close,
|
|
74142
|
+
keyboard,
|
|
74143
|
+
cancelLeave,
|
|
74144
|
+
scheduleLeave: () => {
|
|
74145
|
+
cancelLeave();
|
|
74146
|
+
if (path.length && !keyboard.current) leave.current = setTimeout(() => setPath([]), 250);
|
|
74147
|
+
},
|
|
74148
|
+
toggle: (id) => {
|
|
74149
|
+
const current = props.expandedKeys ?? expanded;
|
|
74150
|
+
const next = current.includes(id) ? current.filter((key) => key !== id) : [...current, id];
|
|
74151
|
+
if (props.expandedKeys === void 0) setExpanded(next);
|
|
74152
|
+
props.onExpandedKeysChange?.(next);
|
|
74153
|
+
}
|
|
74154
|
+
};
|
|
74155
|
+
const surface = /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(MenuSurface, { state, root: true, children: /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(MenuList, { items: props.items, state, focusOnMount: popup && open }) });
|
|
74156
|
+
let trigger = null;
|
|
74157
|
+
if (props.trigger) {
|
|
74158
|
+
const original = props.trigger.props;
|
|
74159
|
+
const originalRef = Number(import_react311.default.version.split(".")[0]) >= 19 ? original.ref : props.trigger.ref;
|
|
74160
|
+
trigger = (0, import_react311.cloneElement)(props.trigger, {
|
|
74161
|
+
ref: (el) => {
|
|
74162
|
+
triggerRef.current = el;
|
|
74163
|
+
if (typeof originalRef === "function") originalRef(el);
|
|
74164
|
+
else if (originalRef) originalRef.current = el;
|
|
74165
|
+
},
|
|
74166
|
+
"aria-haspopup": "menu",
|
|
74167
|
+
"aria-expanded": open,
|
|
74168
|
+
"aria-controls": open ? `${owner}-menu` : void 0,
|
|
74169
|
+
onClick: (event) => {
|
|
74170
|
+
original.onClick?.(event);
|
|
74171
|
+
if (!event.defaultPrevented) requestOpen(!open);
|
|
74172
|
+
},
|
|
74173
|
+
onKeyDown: (event) => {
|
|
74174
|
+
original.onKeyDown?.(event);
|
|
74175
|
+
if (!event.defaultPrevented && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
74176
|
+
event.preventDefault();
|
|
74177
|
+
requestOpen(true);
|
|
74178
|
+
}
|
|
74179
|
+
}
|
|
74180
|
+
});
|
|
74181
|
+
}
|
|
74182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)(import_jsx_runtime336.Fragment, { children: [
|
|
74183
|
+
trigger,
|
|
74184
|
+
popup ? open && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(MenuPopup, { anchor, placement: props.placement ?? "bottom", width: props.width ?? 256, children: surface }) : /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("div", { style: { width: props.width ?? 256, maxWidth: "100%" }, children: surface })
|
|
74185
|
+
] });
|
|
74186
|
+
}
|
|
74187
|
+
|
|
74188
|
+
// src/contexts/BottomSheetContext.tsx
|
|
74189
|
+
var import_react312 = require("react");
|
|
74190
|
+
var import_react_dom20 = require("react-dom");
|
|
74191
|
+
var import_classnames143 = __toESM(require("classnames"), 1);
|
|
74192
|
+
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
74193
|
+
var BottomSheetContext = (0, import_react312.createContext)(null);
|
|
73842
74194
|
var TRANSITION_MS2 = 260;
|
|
73843
74195
|
var renderSlot = (slot, controls) => {
|
|
73844
74196
|
if (!slot) {
|
|
@@ -73849,13 +74201,13 @@ var renderSlot = (slot, controls) => {
|
|
|
73849
74201
|
var BottomSheetProvider = ({
|
|
73850
74202
|
children
|
|
73851
74203
|
}) => {
|
|
73852
|
-
const [sheet, setSheet] = (0,
|
|
73853
|
-
const [isVisible, setIsVisible] = (0,
|
|
73854
|
-
const pendingCloseRef = (0,
|
|
73855
|
-
const dismissSheet = (0,
|
|
74204
|
+
const [sheet, setSheet] = (0, import_react312.useState)(null);
|
|
74205
|
+
const [isVisible, setIsVisible] = (0, import_react312.useState)(false);
|
|
74206
|
+
const pendingCloseRef = (0, import_react312.useRef)(null);
|
|
74207
|
+
const dismissSheet = (0, import_react312.useCallback)(() => {
|
|
73856
74208
|
setIsVisible(false);
|
|
73857
74209
|
}, []);
|
|
73858
|
-
const presentSheet = (0,
|
|
74210
|
+
const presentSheet = (0, import_react312.useCallback)((options) => {
|
|
73859
74211
|
if (pendingCloseRef.current) {
|
|
73860
74212
|
clearTimeout(pendingCloseRef.current);
|
|
73861
74213
|
pendingCloseRef.current = null;
|
|
@@ -73868,7 +74220,7 @@ var BottomSheetProvider = ({
|
|
|
73868
74220
|
setTimeout(animateIn, 0);
|
|
73869
74221
|
}
|
|
73870
74222
|
}, []);
|
|
73871
|
-
(0,
|
|
74223
|
+
(0, import_react312.useEffect)(() => {
|
|
73872
74224
|
if (!isVisible && sheet) {
|
|
73873
74225
|
pendingCloseRef.current = setTimeout(() => {
|
|
73874
74226
|
sheet.onClose?.();
|
|
@@ -73883,7 +74235,7 @@ var BottomSheetProvider = ({
|
|
|
73883
74235
|
}
|
|
73884
74236
|
return void 0;
|
|
73885
74237
|
}, [isVisible, sheet]);
|
|
73886
|
-
(0,
|
|
74238
|
+
(0, import_react312.useEffect)(
|
|
73887
74239
|
() => () => {
|
|
73888
74240
|
if (pendingCloseRef.current) {
|
|
73889
74241
|
clearTimeout(pendingCloseRef.current);
|
|
@@ -73891,13 +74243,13 @@ var BottomSheetProvider = ({
|
|
|
73891
74243
|
},
|
|
73892
74244
|
[]
|
|
73893
74245
|
);
|
|
73894
|
-
const controls = (0,
|
|
74246
|
+
const controls = (0, import_react312.useMemo)(
|
|
73895
74247
|
() => ({
|
|
73896
74248
|
dismiss: dismissSheet
|
|
73897
74249
|
}),
|
|
73898
74250
|
[dismissSheet]
|
|
73899
74251
|
);
|
|
73900
|
-
const contextValue = (0,
|
|
74252
|
+
const contextValue = (0, import_react312.useMemo)(
|
|
73901
74253
|
() => ({
|
|
73902
74254
|
presentSheet,
|
|
73903
74255
|
dismissSheet,
|
|
@@ -73906,12 +74258,12 @@ var BottomSheetProvider = ({
|
|
|
73906
74258
|
}),
|
|
73907
74259
|
[presentSheet, dismissSheet, sheet, isVisible]
|
|
73908
74260
|
);
|
|
73909
|
-
const overlayNode = typeof document !== "undefined" && sheet ? (0,
|
|
73910
|
-
/* @__PURE__ */ (0,
|
|
73911
|
-
/* @__PURE__ */ (0,
|
|
74261
|
+
const overlayNode = typeof document !== "undefined" && sheet ? (0, import_react_dom20.createPortal)(
|
|
74262
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsxs)("div", { className: "pointer-events-none fixed inset-0 z-[70] flex items-end justify-center", children: [
|
|
74263
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
73912
74264
|
"div",
|
|
73913
74265
|
{
|
|
73914
|
-
className: (0,
|
|
74266
|
+
className: (0, import_classnames143.default)(
|
|
73915
74267
|
"absolute inset-0 bg-neutral-900/40 transition-opacity duration-300",
|
|
73916
74268
|
isVisible ? "opacity-100 pointer-events-auto" : "opacity-0"
|
|
73917
74269
|
),
|
|
@@ -73921,24 +74273,24 @@ var BottomSheetProvider = ({
|
|
|
73921
74273
|
}
|
|
73922
74274
|
}
|
|
73923
74275
|
),
|
|
73924
|
-
/* @__PURE__ */ (0,
|
|
74276
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)("div", { className: "relative w-full max-w-4xl px-4 pb-4 sm:px-8", children: /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
73925
74277
|
"section",
|
|
73926
74278
|
{
|
|
73927
74279
|
role: "dialog",
|
|
73928
74280
|
"aria-modal": "true",
|
|
73929
|
-
className: (0,
|
|
74281
|
+
className: (0, import_classnames143.default)(
|
|
73930
74282
|
"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",
|
|
73931
74283
|
sheet.className,
|
|
73932
74284
|
isVisible ? "translate-y-0" : "translate-y-full"
|
|
73933
74285
|
),
|
|
73934
74286
|
style: { minHeight: "25vh", maxHeight: "85vh" },
|
|
73935
74287
|
children: [
|
|
73936
|
-
/* @__PURE__ */ (0,
|
|
73937
|
-
/* @__PURE__ */ (0,
|
|
73938
|
-
sheet.title && /* @__PURE__ */ (0,
|
|
73939
|
-
sheet.description && /* @__PURE__ */ (0,
|
|
74288
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsxs)("header", { className: "flex items-start justify-between gap-3 border-b border-slate-200 px-6 py-4 dark:border-slate-800", children: [
|
|
74289
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsxs)("div", { className: "space-y-1", children: [
|
|
74290
|
+
sheet.title && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("div", { className: "text-base font-semibold text-slate-900 dark:text-slate-100", children: sheet.title }),
|
|
74291
|
+
sheet.description && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("p", { className: "text-sm text-slate-500 dark:text-slate-300", children: sheet.description })
|
|
73940
74292
|
] }),
|
|
73941
|
-
(sheet.showCloseButton ?? true) && /* @__PURE__ */ (0,
|
|
74293
|
+
(sheet.showCloseButton ?? true) && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
73942
74294
|
IconButton_default,
|
|
73943
74295
|
{
|
|
73944
74296
|
icon: "Close",
|
|
@@ -73950,21 +74302,21 @@ var BottomSheetProvider = ({
|
|
|
73950
74302
|
}
|
|
73951
74303
|
)
|
|
73952
74304
|
] }),
|
|
73953
|
-
/* @__PURE__ */ (0,
|
|
73954
|
-
sheet.actions && /* @__PURE__ */ (0,
|
|
74305
|
+
/* @__PURE__ */ (0, import_jsx_runtime337.jsx)("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: renderSlot(sheet.content, controls) ?? /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("p", { className: "text-sm text-slate-500", children: "No content provided." }) }),
|
|
74306
|
+
sheet.actions && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)("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) })
|
|
73955
74307
|
]
|
|
73956
74308
|
}
|
|
73957
74309
|
) })
|
|
73958
74310
|
] }),
|
|
73959
74311
|
document.body
|
|
73960
74312
|
) : null;
|
|
73961
|
-
return /* @__PURE__ */ (0,
|
|
74313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(BottomSheetContext.Provider, { value: contextValue, children: [
|
|
73962
74314
|
children,
|
|
73963
74315
|
overlayNode
|
|
73964
74316
|
] });
|
|
73965
74317
|
};
|
|
73966
74318
|
var useBottomSheet = () => {
|
|
73967
|
-
const context = (0,
|
|
74319
|
+
const context = (0, import_react312.useContext)(BottomSheetContext);
|
|
73968
74320
|
if (!context) {
|
|
73969
74321
|
throw new Error("useBottomSheet must be used within a BottomSheetProvider");
|
|
73970
74322
|
}
|
|
@@ -74598,8 +74950,8 @@ var SYSTEM_VARIABLES = [
|
|
|
74598
74950
|
];
|
|
74599
74951
|
|
|
74600
74952
|
// src/components/MetricBar.tsx
|
|
74601
|
-
var
|
|
74602
|
-
var
|
|
74953
|
+
var import_classnames144 = __toESM(require("classnames"), 1);
|
|
74954
|
+
var import_jsx_runtime338 = require("react/jsx-runtime");
|
|
74603
74955
|
var MetricBar = ({
|
|
74604
74956
|
label,
|
|
74605
74957
|
value,
|
|
@@ -74609,7 +74961,7 @@ var MetricBar = ({
|
|
|
74609
74961
|
size = "sm",
|
|
74610
74962
|
className,
|
|
74611
74963
|
...rest
|
|
74612
|
-
}) => /* @__PURE__ */ (0,
|
|
74964
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime338.jsx)(
|
|
74613
74965
|
Progress_default,
|
|
74614
74966
|
{
|
|
74615
74967
|
...rest,
|
|
@@ -74619,13 +74971,13 @@ var MetricBar = ({
|
|
|
74619
74971
|
formatValue: value !== void 0 ? () => String(value) : void 0,
|
|
74620
74972
|
size,
|
|
74621
74973
|
color: tone ?? color ?? "blue",
|
|
74622
|
-
className: (0,
|
|
74974
|
+
className: (0, import_classnames144.default)("w-full", className)
|
|
74623
74975
|
}
|
|
74624
74976
|
);
|
|
74625
74977
|
MetricBar.displayName = "MetricBar";
|
|
74626
74978
|
|
|
74627
74979
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
74628
|
-
var
|
|
74980
|
+
var import_react314 = require("react");
|
|
74629
74981
|
|
|
74630
74982
|
// src/components/NetworkGraph/model.ts
|
|
74631
74983
|
var CELL = 64;
|
|
@@ -74769,17 +75121,17 @@ function findNetworkPath(edges, source, target) {
|
|
|
74769
75121
|
}
|
|
74770
75122
|
|
|
74771
75123
|
// src/components/NetworkGraph/useNetworkCanvas.ts
|
|
74772
|
-
var
|
|
75124
|
+
var import_react313 = require("react");
|
|
74773
75125
|
function useNetworkCanvas(options) {
|
|
74774
|
-
const canvasRef = (0,
|
|
74775
|
-
const view = (0,
|
|
74776
|
-
const size = (0,
|
|
74777
|
-
const latest = (0,
|
|
74778
|
-
const frame = (0,
|
|
74779
|
-
const [zoom, setZoom] = (0,
|
|
74780
|
-
const colors3 = (0,
|
|
74781
|
-
const textColor = (0,
|
|
74782
|
-
const draw = (0,
|
|
75126
|
+
const canvasRef = (0, import_react313.useRef)(null);
|
|
75127
|
+
const view = (0, import_react313.useRef)({ x: 0, y: 0, zoom: 1 });
|
|
75128
|
+
const size = (0, import_react313.useRef)({ width: 1, height: 1 });
|
|
75129
|
+
const latest = (0, import_react313.useRef)(options);
|
|
75130
|
+
const frame = (0, import_react313.useRef)(null);
|
|
75131
|
+
const [zoom, setZoom] = (0, import_react313.useState)(1);
|
|
75132
|
+
const colors3 = (0, import_react313.useRef)(/* @__PURE__ */ new Map());
|
|
75133
|
+
const textColor = (0, import_react313.useRef)("#737373");
|
|
75134
|
+
const draw = (0, import_react313.useCallback)(() => {
|
|
74783
75135
|
const canvas = canvasRef.current;
|
|
74784
75136
|
const ctx = canvas?.getContext("2d");
|
|
74785
75137
|
if (!canvas || !ctx) return;
|
|
@@ -74879,14 +75231,14 @@ function useNetworkCanvas(options) {
|
|
|
74879
75231
|
}
|
|
74880
75232
|
ctx.globalAlpha = 1;
|
|
74881
75233
|
}, []);
|
|
74882
|
-
const requestDraw = (0,
|
|
75234
|
+
const requestDraw = (0, import_react313.useCallback)(() => {
|
|
74883
75235
|
if (frame.current !== null) return;
|
|
74884
75236
|
frame.current = requestAnimationFrame(() => {
|
|
74885
75237
|
frame.current = null;
|
|
74886
75238
|
draw();
|
|
74887
75239
|
});
|
|
74888
75240
|
}, [draw]);
|
|
74889
|
-
const update = (0,
|
|
75241
|
+
const update = (0, import_react313.useCallback)(
|
|
74890
75242
|
(next) => {
|
|
74891
75243
|
view.current = next;
|
|
74892
75244
|
setZoom(next.zoom);
|
|
@@ -74895,7 +75247,7 @@ function useNetworkCanvas(options) {
|
|
|
74895
75247
|
},
|
|
74896
75248
|
[requestDraw]
|
|
74897
75249
|
);
|
|
74898
|
-
const fit = (0,
|
|
75250
|
+
const fit = (0, import_react313.useCallback)(
|
|
74899
75251
|
() => update(
|
|
74900
75252
|
fitNetwork(
|
|
74901
75253
|
latest.current.nodes,
|
|
@@ -74905,11 +75257,11 @@ function useNetworkCanvas(options) {
|
|
|
74905
75257
|
),
|
|
74906
75258
|
[update]
|
|
74907
75259
|
);
|
|
74908
|
-
const zoomBy = (0,
|
|
75260
|
+
const zoomBy = (0, import_react313.useCallback)(
|
|
74909
75261
|
(factor, x = size.current.width / 2, y = size.current.height / 2) => update(zoomAt(view.current, factor, x, y)),
|
|
74910
75262
|
[update]
|
|
74911
75263
|
);
|
|
74912
|
-
const focusNode = (0,
|
|
75264
|
+
const focusNode = (0, import_react313.useCallback)(
|
|
74913
75265
|
(node) => {
|
|
74914
75266
|
update({
|
|
74915
75267
|
...view.current,
|
|
@@ -74919,14 +75271,14 @@ function useNetworkCanvas(options) {
|
|
|
74919
75271
|
},
|
|
74920
75272
|
[update]
|
|
74921
75273
|
);
|
|
74922
|
-
(0,
|
|
75274
|
+
(0, import_react313.useEffect)(() => {
|
|
74923
75275
|
latest.current = options;
|
|
74924
75276
|
requestDraw();
|
|
74925
75277
|
}, [options, requestDraw]);
|
|
74926
|
-
(0,
|
|
75278
|
+
(0, import_react313.useEffect)(() => {
|
|
74927
75279
|
fit();
|
|
74928
75280
|
}, [options.model, fit]);
|
|
74929
|
-
(0,
|
|
75281
|
+
(0, import_react313.useEffect)(() => {
|
|
74930
75282
|
const canvas = canvasRef.current;
|
|
74931
75283
|
if (!canvas) return;
|
|
74932
75284
|
const measure = () => {
|
|
@@ -74979,7 +75331,7 @@ function useNetworkCanvas(options) {
|
|
|
74979
75331
|
}
|
|
74980
75332
|
|
|
74981
75333
|
// src/components/NetworkGraph/NetworkGraph.tsx
|
|
74982
|
-
var
|
|
75334
|
+
var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
74983
75335
|
var NO_COMMUNITIES = [];
|
|
74984
75336
|
var NO_HIGHLIGHTS = [];
|
|
74985
75337
|
function NetworkGraph({
|
|
@@ -75010,11 +75362,11 @@ function NetworkGraph({
|
|
|
75010
75362
|
...panelProps
|
|
75011
75363
|
}) {
|
|
75012
75364
|
const t = useKitT();
|
|
75013
|
-
const helpId = (0,
|
|
75014
|
-
const layoutRef = (0,
|
|
75015
|
-
const [hasLegendSpace, setHasLegendSpace] = (0,
|
|
75365
|
+
const helpId = (0, import_react314.useId)();
|
|
75366
|
+
const layoutRef = (0, import_react314.useRef)(null);
|
|
75367
|
+
const [hasLegendSpace, setHasLegendSpace] = (0, import_react314.useState)(true);
|
|
75016
75368
|
const legendOnRight = legendPosition === "right" || legendPosition === "auto" && hasLegendSpace;
|
|
75017
|
-
(0,
|
|
75369
|
+
(0, import_react314.useEffect)(() => {
|
|
75018
75370
|
const element = layoutRef.current;
|
|
75019
75371
|
if (!element || legendPosition !== "auto") return;
|
|
75020
75372
|
const measure = () => setHasLegendSpace(element.getBoundingClientRect().width >= 600);
|
|
@@ -75023,38 +75375,38 @@ function NetworkGraph({
|
|
|
75023
75375
|
observer.observe(element);
|
|
75024
75376
|
return () => observer.disconnect();
|
|
75025
75377
|
}, [legendPosition, loading]);
|
|
75026
|
-
const model = (0,
|
|
75378
|
+
const model = (0, import_react314.useMemo)(
|
|
75027
75379
|
() => buildNetwork(nodes, edges, communities),
|
|
75028
75380
|
[nodes, edges, communities]
|
|
75029
75381
|
);
|
|
75030
|
-
const [internalSelected, setInternalSelected] = (0,
|
|
75382
|
+
const [internalSelected, setInternalSelected] = (0, import_react314.useState)(
|
|
75031
75383
|
defaultSelectedNodeId
|
|
75032
75384
|
);
|
|
75033
|
-
const [hidden, setHidden] = (0,
|
|
75034
|
-
const [focused, setFocused] = (0,
|
|
75035
|
-
const [query, setQuery] = (0,
|
|
75036
|
-
const enabled = (0,
|
|
75385
|
+
const [hidden, setHidden] = (0, import_react314.useState)(() => /* @__PURE__ */ new Set());
|
|
75386
|
+
const [focused, setFocused] = (0, import_react314.useState)(null);
|
|
75387
|
+
const [query, setQuery] = (0, import_react314.useState)("");
|
|
75388
|
+
const enabled = (0, import_react314.useMemo)(
|
|
75037
75389
|
() => new Set(
|
|
75038
75390
|
visibleCommunityIds ?? model.groups.filter((g) => !hidden.has(g.id)).map((g) => g.id)
|
|
75039
75391
|
),
|
|
75040
75392
|
[visibleCommunityIds, model, hidden]
|
|
75041
75393
|
);
|
|
75042
|
-
const visibleNodes = (0,
|
|
75394
|
+
const visibleNodes = (0, import_react314.useMemo)(
|
|
75043
75395
|
() => model.nodes.filter((n) => !n.community || enabled.has(n.community)),
|
|
75044
75396
|
[model, enabled]
|
|
75045
75397
|
);
|
|
75046
|
-
const visible = (0,
|
|
75398
|
+
const visible = (0, import_react314.useMemo)(
|
|
75047
75399
|
() => new Set(visibleNodes.map((n) => n.id)),
|
|
75048
75400
|
[visibleNodes]
|
|
75049
75401
|
);
|
|
75050
75402
|
const selection = selectedNodeId === void 0 ? internalSelected : selectedNodeId;
|
|
75051
75403
|
const selected = selection !== null && visible.has(selection) ? selection : null;
|
|
75052
75404
|
const activeFocus = focused !== null && visible.has(focused) ? focused : null;
|
|
75053
|
-
const highlighted = (0,
|
|
75405
|
+
const highlighted = (0, import_react314.useMemo)(
|
|
75054
75406
|
() => new Set(highlightedEdgeIds),
|
|
75055
75407
|
[highlightedEdgeIds]
|
|
75056
75408
|
);
|
|
75057
|
-
const counts = (0,
|
|
75409
|
+
const counts = (0, import_react314.useMemo)(() => {
|
|
75058
75410
|
const result = /* @__PURE__ */ new Map();
|
|
75059
75411
|
for (const n of model.nodes)
|
|
75060
75412
|
if (n.community)
|
|
@@ -75074,7 +75426,7 @@ function NetworkGraph({
|
|
|
75074
75426
|
onViewportChange
|
|
75075
75427
|
});
|
|
75076
75428
|
const locked = disabled || loading;
|
|
75077
|
-
const drag = (0,
|
|
75429
|
+
const drag = (0, import_react314.useRef)(null);
|
|
75078
75430
|
const select = (id) => {
|
|
75079
75431
|
if (locked) return;
|
|
75080
75432
|
if (selectedNodeId === void 0) setInternalSelected(id);
|
|
@@ -75090,7 +75442,7 @@ function NetworkGraph({
|
|
|
75090
75442
|
);
|
|
75091
75443
|
onVisibleCommunitiesChange?.(ids);
|
|
75092
75444
|
};
|
|
75093
|
-
(0,
|
|
75445
|
+
(0, import_react314.useEffect)(() => {
|
|
75094
75446
|
const element = canvas.canvasRef.current;
|
|
75095
75447
|
if (!element || locked) return;
|
|
75096
75448
|
const wheel = (event) => {
|
|
@@ -75139,13 +75491,13 @@ function NetworkGraph({
|
|
|
75139
75491
|
}
|
|
75140
75492
|
};
|
|
75141
75493
|
const focusedNode = model.byId.get(activeFocus ?? selected ?? "");
|
|
75142
|
-
const matchingNodes = (0,
|
|
75494
|
+
const matchingNodes = (0, import_react314.useMemo)(() => {
|
|
75143
75495
|
const search = query.toLocaleLowerCase();
|
|
75144
75496
|
return visibleNodes.filter((n) => (n.label ?? n.id).toLocaleLowerCase().includes(search)).slice(0, 50).map((n) => ({ value: n.id, label: n.label ?? n.id }));
|
|
75145
75497
|
}, [visibleNodes, query]);
|
|
75146
75498
|
const graphHeight = Number.isFinite(height) ? Math.max(160, height) : 480;
|
|
75147
75499
|
const resolvedLegendTone = legendTone === "auto" ? tone : legendTone;
|
|
75148
|
-
const legendContent = /* @__PURE__ */ (0,
|
|
75500
|
+
const legendContent = /* @__PURE__ */ (0, import_jsx_runtime339.jsxs)(
|
|
75149
75501
|
"fieldset",
|
|
75150
75502
|
{
|
|
75151
75503
|
disabled: locked,
|
|
@@ -75154,8 +75506,8 @@ function NetworkGraph({
|
|
|
75154
75506
|
maxHeight: legendPanel ? Math.max(96, graphHeight - 64) : graphHeight
|
|
75155
75507
|
},
|
|
75156
75508
|
children: [
|
|
75157
|
-
/* @__PURE__ */ (0,
|
|
75158
|
-
/* @__PURE__ */ (0,
|
|
75509
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)("legend", { className: "mb-3 text-xs font-semibold uppercase tracking-widest", children: t("kit.networkGraph.communities") }),
|
|
75510
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
75159
75511
|
Checkbox_default,
|
|
75160
75512
|
{
|
|
75161
75513
|
size: "sm",
|
|
@@ -75166,8 +75518,8 @@ function NetworkGraph({
|
|
|
75166
75518
|
onChange: (event) => filter(event.target.checked ? model.groups.map((g) => g.id) : [])
|
|
75167
75519
|
}
|
|
75168
75520
|
),
|
|
75169
|
-
model.groups.map((group) => /* @__PURE__ */ (0,
|
|
75170
|
-
/* @__PURE__ */ (0,
|
|
75521
|
+
model.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime339.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
75522
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
75171
75523
|
Checkbox_default,
|
|
75172
75524
|
{
|
|
75173
75525
|
size: "sm",
|
|
@@ -75179,12 +75531,12 @@ function NetworkGraph({
|
|
|
75179
75531
|
)
|
|
75180
75532
|
}
|
|
75181
75533
|
),
|
|
75182
|
-
/* @__PURE__ */ (0,
|
|
75534
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)("span", { className: "text-xs tabular-nums opacity-60", children: counts.get(group.id) ?? 0 })
|
|
75183
75535
|
] }, group.id))
|
|
75184
75536
|
]
|
|
75185
75537
|
}
|
|
75186
75538
|
);
|
|
75187
|
-
return /* @__PURE__ */ (0,
|
|
75539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
75188
75540
|
Panel_default,
|
|
75189
75541
|
{
|
|
75190
75542
|
...panelProps,
|
|
@@ -75195,7 +75547,7 @@ function NetworkGraph({
|
|
|
75195
75547
|
loading,
|
|
75196
75548
|
clickable: false,
|
|
75197
75549
|
scrollable: false,
|
|
75198
|
-
children: /* @__PURE__ */ (0,
|
|
75550
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime339.jsxs)(
|
|
75199
75551
|
"div",
|
|
75200
75552
|
{
|
|
75201
75553
|
className: "flex min-w-0 flex-col gap-3",
|
|
@@ -75203,7 +75555,7 @@ function NetworkGraph({
|
|
|
75203
75555
|
"aria-label": ariaLabel ?? t("kit.networkGraph.name"),
|
|
75204
75556
|
"aria-disabled": locked || void 0,
|
|
75205
75557
|
children: [
|
|
75206
|
-
showControls && /* @__PURE__ */ (0,
|
|
75558
|
+
showControls && /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
75207
75559
|
Combobox_default,
|
|
75208
75560
|
{
|
|
75209
75561
|
size: "sm",
|
|
@@ -75225,7 +75577,7 @@ function NetworkGraph({
|
|
|
75225
75577
|
}
|
|
75226
75578
|
}
|
|
75227
75579
|
) }) }),
|
|
75228
|
-
/* @__PURE__ */ (0,
|
|
75580
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsxs)(
|
|
75229
75581
|
"div",
|
|
75230
75582
|
{
|
|
75231
75583
|
ref: layoutRef,
|
|
@@ -75233,13 +75585,13 @@ function NetworkGraph({
|
|
|
75233
75585
|
style: { flexDirection: legendOnRight ? "row" : "column" },
|
|
75234
75586
|
"data-legend-position": legendOnRight ? "right" : "bottom",
|
|
75235
75587
|
children: [
|
|
75236
|
-
/* @__PURE__ */ (0,
|
|
75588
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsxs)(
|
|
75237
75589
|
"div",
|
|
75238
75590
|
{
|
|
75239
75591
|
className: "relative min-w-0 flex-1",
|
|
75240
75592
|
style: { height: graphHeight, minHeight: graphHeight },
|
|
75241
75593
|
children: [
|
|
75242
|
-
/* @__PURE__ */ (0,
|
|
75594
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
75243
75595
|
"canvas",
|
|
75244
75596
|
{
|
|
75245
75597
|
ref: canvas.canvasRef,
|
|
@@ -75308,11 +75660,11 @@ function NetworkGraph({
|
|
|
75308
75660
|
}
|
|
75309
75661
|
}
|
|
75310
75662
|
),
|
|
75311
|
-
showControls && /* @__PURE__ */ (0,
|
|
75312
|
-
/* @__PURE__ */ (0,
|
|
75663
|
+
showControls && /* @__PURE__ */ (0, import_jsx_runtime339.jsxs)("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: [
|
|
75664
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
75313
75665
|
IconButton_default,
|
|
75314
75666
|
{
|
|
75315
|
-
icon: /* @__PURE__ */ (0,
|
|
75667
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime339.jsxs)(
|
|
75316
75668
|
"svg",
|
|
75317
75669
|
{
|
|
75318
75670
|
viewBox: "0 0 24 24",
|
|
@@ -75323,10 +75675,10 @@ function NetworkGraph({
|
|
|
75323
75675
|
strokeLinejoin: "round",
|
|
75324
75676
|
"aria-hidden": "true",
|
|
75325
75677
|
children: [
|
|
75326
|
-
/* @__PURE__ */ (0,
|
|
75327
|
-
/* @__PURE__ */ (0,
|
|
75328
|
-
/* @__PURE__ */ (0,
|
|
75329
|
-
/* @__PURE__ */ (0,
|
|
75678
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)("path", { d: "M4 9V5a1 1 0 0 1 1-1h4" }),
|
|
75679
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)("path", { d: "M15 4h4a1 1 0 0 1 1 1v4" }),
|
|
75680
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)("path", { d: "M20 15v4a1 1 0 0 1-1 1h-4" }),
|
|
75681
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)("path", { d: "M9 20H5a1 1 0 0 1-1-1v-4" })
|
|
75330
75682
|
]
|
|
75331
75683
|
}
|
|
75332
75684
|
),
|
|
@@ -75339,10 +75691,10 @@ function NetworkGraph({
|
|
|
75339
75691
|
onClick: canvas.fit
|
|
75340
75692
|
}
|
|
75341
75693
|
),
|
|
75342
|
-
/* @__PURE__ */ (0,
|
|
75694
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
75343
75695
|
IconButton_default,
|
|
75344
75696
|
{
|
|
75345
|
-
icon: /* @__PURE__ */ (0,
|
|
75697
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
75346
75698
|
"svg",
|
|
75347
75699
|
{
|
|
75348
75700
|
viewBox: "0 0 24 24",
|
|
@@ -75351,7 +75703,7 @@ function NetworkGraph({
|
|
|
75351
75703
|
strokeWidth: 2,
|
|
75352
75704
|
strokeLinecap: "round",
|
|
75353
75705
|
"aria-hidden": "true",
|
|
75354
|
-
children: /* @__PURE__ */ (0,
|
|
75706
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("path", { d: "M6 12h12" })
|
|
75355
75707
|
}
|
|
75356
75708
|
),
|
|
75357
75709
|
size: "xs",
|
|
@@ -75363,7 +75715,7 @@ function NetworkGraph({
|
|
|
75363
75715
|
onClick: () => canvas.zoomBy(0.8)
|
|
75364
75716
|
}
|
|
75365
75717
|
),
|
|
75366
|
-
/* @__PURE__ */ (0,
|
|
75718
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsxs)(
|
|
75367
75719
|
"span",
|
|
75368
75720
|
{
|
|
75369
75721
|
className: "min-w-[3.5ch] px-1 text-center text-[11px] tabular-nums text-neutral-500 dark:text-neutral-400",
|
|
@@ -75374,7 +75726,7 @@ function NetworkGraph({
|
|
|
75374
75726
|
]
|
|
75375
75727
|
}
|
|
75376
75728
|
),
|
|
75377
|
-
/* @__PURE__ */ (0,
|
|
75729
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
75378
75730
|
IconButton_default,
|
|
75379
75731
|
{
|
|
75380
75732
|
icon: "Add",
|
|
@@ -75387,7 +75739,7 @@ function NetworkGraph({
|
|
|
75387
75739
|
onClick: () => canvas.zoomBy(1.25)
|
|
75388
75740
|
}
|
|
75389
75741
|
),
|
|
75390
|
-
/* @__PURE__ */ (0,
|
|
75742
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
75391
75743
|
IconButton_default,
|
|
75392
75744
|
{
|
|
75393
75745
|
icon: "Reset",
|
|
@@ -75405,18 +75757,18 @@ function NetworkGraph({
|
|
|
75405
75757
|
}
|
|
75406
75758
|
)
|
|
75407
75759
|
] }),
|
|
75408
|
-
!visibleNodes.length && /* @__PURE__ */ (0,
|
|
75760
|
+
!visibleNodes.length && /* @__PURE__ */ (0, import_jsx_runtime339.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-sm", children: emptyMessage ?? t("kit.networkGraph.empty") })
|
|
75409
75761
|
]
|
|
75410
75762
|
}
|
|
75411
75763
|
),
|
|
75412
|
-
showCommunities && model.groups.length > 0 && /* @__PURE__ */ (0,
|
|
75764
|
+
showCommunities && model.groups.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
75413
75765
|
"div",
|
|
75414
75766
|
{
|
|
75415
75767
|
className: "min-w-0 shrink-0",
|
|
75416
75768
|
style: {
|
|
75417
75769
|
width: legendOnRight ? legendPanel ? 224 : 192 : "100%"
|
|
75418
75770
|
},
|
|
75419
|
-
children: legendPanel ? /* @__PURE__ */ (0,
|
|
75771
|
+
children: legendPanel ? /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
75420
75772
|
Panel_default,
|
|
75421
75773
|
{
|
|
75422
75774
|
variant: legendVariant === "auto" ? variant : legendVariant,
|
|
@@ -75435,8 +75787,8 @@ function NetworkGraph({
|
|
|
75435
75787
|
]
|
|
75436
75788
|
}
|
|
75437
75789
|
),
|
|
75438
|
-
/* @__PURE__ */ (0,
|
|
75439
|
-
/* @__PURE__ */ (0,
|
|
75790
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)("p", { id: helpId, className: "text-xs opacity-70", children: t("kit.networkGraph.instructions") }),
|
|
75791
|
+
/* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
75440
75792
|
"p",
|
|
75441
75793
|
{
|
|
75442
75794
|
role: "status",
|
|
@@ -75625,11 +75977,13 @@ function NetworkGraph({
|
|
|
75625
75977
|
LOADER_VARIANTS,
|
|
75626
75978
|
LOCK_TTL_MS,
|
|
75627
75979
|
Loader,
|
|
75980
|
+
MENU_VARIANTS,
|
|
75628
75981
|
METERGROUP_ORIENTATIONS,
|
|
75629
75982
|
MODAL_POSITIONS,
|
|
75630
75983
|
MS_DAY,
|
|
75631
75984
|
MULTI_TOGGLE_INDICATORS,
|
|
75632
75985
|
MULTI_TOGGLE_VARIANTS,
|
|
75986
|
+
Menu,
|
|
75633
75987
|
MeterGroup,
|
|
75634
75988
|
MetricBar,
|
|
75635
75989
|
Modal,
|