@tensor_1/react 2.37.0 → 2.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -0
- package/dist/{chart-theme-Cl0IrkKQ.d.cts → ChartCore-BKK2HEfi.d.cts} +77 -50
- package/dist/chart-analytic-guide.d.ts +6 -0
- package/dist/chart-analytic-guide.js +10 -0
- package/dist/chart-analytic-model.d.ts +141 -0
- package/dist/chart-analytic-model.js +252 -0
- package/dist/chart-analytic.cjs +1372 -0
- package/dist/chart-analytic.d.cts +335 -0
- package/dist/chart-analytic.d.ts +19 -0
- package/dist/chart-analytic.js +95 -0
- package/dist/chart-panels-model.d.ts +92 -0
- package/dist/chart-panels-model.js +284 -0
- package/dist/chart-preset.cjs +41 -4
- package/dist/chart-preset.d.cts +2 -2
- package/dist/chart-preset.d.ts +1 -1
- package/dist/chart-stats-o4zDhpVm.d.cts +46 -0
- package/dist/chart-stats.d.ts +46 -0
- package/dist/chart-stats.js +89 -0
- package/dist/chart-theme.d.ts +3 -0
- package/dist/chart-theme.js +2 -0
- package/dist/chart.cjs +41 -4
- package/dist/chart.d.cts +2 -2
- package/dist/chart.d.ts +1 -1
- package/dist/components/Chart.d.ts +1 -1
- package/dist/components/ChartCore.d.ts +23 -3
- package/dist/components/ChartCore.js +40 -5
- package/dist/components/ChartPanels.d.ts +52 -0
- package/dist/components/ChartPanels.js +170 -0
- package/dist/components/InsightCard.d.ts +86 -0
- package/dist/components/InsightCard.js +118 -0
- package/dist/components/Stat.d.ts +7 -0
- package/dist/components/Stat.js +6 -3
- package/dist/correlation-scatter-model.d.ts +68 -0
- package/dist/correlation-scatter-model.js +179 -0
- package/dist/icons/Icon.d.ts +23 -23
- package/dist/index.cjs +1185 -961
- package/dist/index.d.cts +91 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +10 -0
- package/package.json +6 -1
package/dist/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ __export(src_exports, {
|
|
|
32
32
|
Breadcrumbs: () => Breadcrumbs,
|
|
33
33
|
BuilderCanvas: () => BuilderCanvas,
|
|
34
34
|
BulkBar: () => BulkBar,
|
|
35
|
+
Bullet: () => Bullet,
|
|
35
36
|
Button: () => Button,
|
|
36
37
|
ButtonGroup: () => ButtonGroup,
|
|
37
38
|
ButtonLink: () => ButtonLink,
|
|
@@ -70,6 +71,7 @@ __export(src_exports, {
|
|
|
70
71
|
DEFAULT_FILTER_EDITOR_LABELS: () => DEFAULT_FILTER_EDITOR_LABELS,
|
|
71
72
|
DEFAULT_FILTER_SUMMARY_LABELS: () => DEFAULT_FILTER_SUMMARY_LABELS,
|
|
72
73
|
DEFAULT_INLINE_EDIT_LABELS: () => DEFAULT_INLINE_EDIT_LABELS,
|
|
74
|
+
DEFAULT_INSIGHT_CARD_LABELS: () => DEFAULT_INSIGHT_CARD_LABELS,
|
|
73
75
|
DEFAULT_LIGHTBOX_LABELS: () => DEFAULT_LIGHTBOX_LABELS,
|
|
74
76
|
DEFAULT_MATCH_REVIEW_LABELS: () => DEFAULT_MATCH_REVIEW_LABELS,
|
|
75
77
|
DEFAULT_PAGINATION_LABELS: () => DEFAULT_PAGINATION_LABELS,
|
|
@@ -122,6 +124,7 @@ __export(src_exports, {
|
|
|
122
124
|
InlineEdit: () => InlineEdit,
|
|
123
125
|
Input: () => Input,
|
|
124
126
|
InputGroup: () => InputGroup,
|
|
127
|
+
InsightCard: () => InsightCard,
|
|
125
128
|
Kanban: () => Kanban,
|
|
126
129
|
KanbanCard: () => KanbanCard,
|
|
127
130
|
KanbanColumn: () => KanbanColumn,
|
|
@@ -276,6 +279,7 @@ __export(src_exports, {
|
|
|
276
279
|
layoutMonthSpans: () => layoutMonthSpans,
|
|
277
280
|
layoutRelationshipGraph: () => layoutRelationshipGraph,
|
|
278
281
|
layoutTimeGridDay: () => layoutTimeGridDay,
|
|
282
|
+
linearFit: () => linearFit,
|
|
279
283
|
mapRuleGroup: () => mapRuleGroup,
|
|
280
284
|
matchFilter: () => matchFilter,
|
|
281
285
|
matchFilterPreset: () => matchFilterPreset,
|
|
@@ -284,6 +288,7 @@ __export(src_exports, {
|
|
|
284
288
|
moveRuleNode: () => moveRuleNode,
|
|
285
289
|
multiSort: () => multiSort,
|
|
286
290
|
nextSortDir: () => nextSortDir,
|
|
291
|
+
normalQuantile: () => normalQuantile,
|
|
287
292
|
normalizeHex: () => normalizeHex,
|
|
288
293
|
packLanes: () => packLanes,
|
|
289
294
|
parseDateInput: () => parseDateInput,
|
|
@@ -294,7 +299,9 @@ __export(src_exports, {
|
|
|
294
299
|
pixelsToMs: () => pixelsToMs,
|
|
295
300
|
placeSpan: () => placeSpan,
|
|
296
301
|
placesInTopLane: () => placesInTopLane,
|
|
302
|
+
predictionBand: () => predictionBand,
|
|
297
303
|
proposeMove: () => proposeMove,
|
|
304
|
+
quantiles: () => quantiles,
|
|
298
305
|
rankOverflow: () => rankOverflow,
|
|
299
306
|
relationshipNeighbors: () => relationshipNeighbors,
|
|
300
307
|
relativeTimeValue: () => relativeTimeValue,
|
|
@@ -318,6 +325,7 @@ __export(src_exports, {
|
|
|
318
325
|
splitDateTime: () => splitDateTime,
|
|
319
326
|
startOfMonth: () => startOfMonth,
|
|
320
327
|
stepMetricValue: () => stepMetricValue,
|
|
328
|
+
studentTQuantile: () => studentTQuantile,
|
|
321
329
|
summarizeDiff: () => summarizeDiff,
|
|
322
330
|
summarizeFilter: () => summarizeFilter,
|
|
323
331
|
summarizeRule: () => summarizeRule,
|
|
@@ -1983,7 +1991,11 @@ var glyphCheck = [["path", { "d": "M20 6 9 17l-5-5" }]];
|
|
|
1983
1991
|
var glyphChevronDown = [["path", { "d": "m6 9 6 6 6-6" }]];
|
|
1984
1992
|
var glyphChevronLeft = [["path", { "d": "m15 18-6-6 6-6" }]];
|
|
1985
1993
|
var glyphChevronRight = [["path", { "d": "m9 18 6-6-6-6" }]];
|
|
1994
|
+
var glyphCircleCheck = [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "m16 9-5.5 5.5L8 12" }]];
|
|
1995
|
+
var glyphCircleQuestionMark = [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }], ["path", { "d": "M12 17h.01" }]];
|
|
1996
|
+
var glyphOctagonAlert = [["path", { "d": "M12 16h.01" }], ["path", { "d": "M12 8v4" }], ["path", { "d": "M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z" }]];
|
|
1986
1997
|
var glyphPencil = [["path", { "d": "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }], ["path", { "d": "m15 5 4 4" }]];
|
|
1998
|
+
var glyphTriangleAlert = [["path", { "d": "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }], ["path", { "d": "M12 9v4" }], ["path", { "d": "M12 17h.01" }]];
|
|
1987
1999
|
var glyphX = [["path", { "d": "M18 6 6 18" }], ["path", { "d": "m6 6 12 12" }]];
|
|
1988
2000
|
|
|
1989
2001
|
// src/icons/components.ts
|
|
@@ -1992,7 +2004,11 @@ var CheckIcon = /* @__PURE__ */ createIcon("CheckIcon", glyphCheck);
|
|
|
1992
2004
|
var ChevronDownIcon = /* @__PURE__ */ createIcon("ChevronDownIcon", glyphChevronDown);
|
|
1993
2005
|
var ChevronLeftIcon = /* @__PURE__ */ createIcon("ChevronLeftIcon", glyphChevronLeft);
|
|
1994
2006
|
var ChevronRightIcon = /* @__PURE__ */ createIcon("ChevronRightIcon", glyphChevronRight);
|
|
2007
|
+
var CircleCheckIcon = /* @__PURE__ */ createIcon("CircleCheckIcon", glyphCircleCheck);
|
|
2008
|
+
var CircleQuestionMarkIcon = /* @__PURE__ */ createIcon("CircleQuestionMarkIcon", glyphCircleQuestionMark);
|
|
2009
|
+
var OctagonAlertIcon = /* @__PURE__ */ createIcon("OctagonAlertIcon", glyphOctagonAlert);
|
|
1995
2010
|
var PencilIcon = /* @__PURE__ */ createIcon("PencilIcon", glyphPencil);
|
|
2011
|
+
var TriangleAlertIcon = /* @__PURE__ */ createIcon("TriangleAlertIcon", glyphTriangleAlert);
|
|
1996
2012
|
var XIcon = /* @__PURE__ */ createIcon("XIcon", glyphX);
|
|
1997
2013
|
|
|
1998
2014
|
// src/components/InlineEdit.tsx
|
|
@@ -6010,7 +6026,7 @@ function Meter({ value = 0, tone, label, toneLabels, className, ...props }) {
|
|
|
6010
6026
|
var import_react43 = require("react");
|
|
6011
6027
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
6012
6028
|
var Chevron3 = () => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "uix-stat__chevron", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "m6 9 6 6 6-6" }) }) });
|
|
6013
|
-
var Stat = (0, import_react43.forwardRef)(function Stat2({ label, value, icon, meta, trend, tone = "neutral", size = "hero", onActivate, activateLabel, expanded, trendLabels, haspopup = "dialog", href, current, renderLink, className, onClick, ...props }, ref) {
|
|
6029
|
+
var Stat = (0, import_react43.forwardRef)(function Stat2({ label, value, icon, meta, trend, tone = "neutral", size = "hero", onActivate, activateLabel, expanded, trendLabels, haspopup = "dialog", href, current, renderLink, className, onClick, onKeyDown, pending = false, ...props }, ref) {
|
|
6014
6030
|
const id = (0, import_react43.useId)();
|
|
6015
6031
|
const interactive = onActivate != null;
|
|
6016
6032
|
const linked = !interactive && href != null;
|
|
@@ -6040,11 +6056,11 @@ var Stat = (0, import_react43.forwardRef)(function Stat2({ label, value, icon, m
|
|
|
6040
6056
|
] })
|
|
6041
6057
|
] });
|
|
6042
6058
|
if (linked) {
|
|
6043
|
-
const linkProps = { ...props, href, className: classes, onClick, "aria-current": current ? "page" : void 0, children: body };
|
|
6059
|
+
const linkProps = { ...props, href, className: classes, onClick, onKeyDown, "aria-current": current ? "page" : void 0, children: body };
|
|
6044
6060
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_jsx_runtime56.Fragment, { children: renderLink ? renderUixLink(renderLink, linkProps) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("a", { ref, ...linkProps }) });
|
|
6045
6061
|
}
|
|
6046
6062
|
if (!interactive) {
|
|
6047
|
-
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { ref, className: classes, onClick, ...props, children: body });
|
|
6063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { ref, className: classes, onClick, onKeyDown, ...props, children: body });
|
|
6048
6064
|
}
|
|
6049
6065
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
6050
6066
|
"button",
|
|
@@ -6057,10 +6073,13 @@ var Stat = (0, import_react43.forwardRef)(function Stat2({ label, value, icon, m
|
|
|
6057
6073
|
"aria-expanded": expanded,
|
|
6058
6074
|
"aria-labelledby": `${id}-label ${id}-sep ${id}-value${activateLabel ? ` ${id}-action` : ""}`,
|
|
6059
6075
|
"aria-describedby": meta != null || trend != null ? `${id}-meta` : void 0,
|
|
6076
|
+
...pending ? { "aria-busy": true, "aria-disabled": true } : null,
|
|
6060
6077
|
onClick: (e) => {
|
|
6078
|
+
if (pending) return;
|
|
6061
6079
|
onClick?.(e);
|
|
6062
6080
|
if (!e.defaultPrevented) onActivate();
|
|
6063
6081
|
},
|
|
6082
|
+
onKeyDown: pending ? void 0 : onKeyDown,
|
|
6064
6083
|
children: [
|
|
6065
6084
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { id: `${id}-sep`, className: "uix-visually-hidden", children: ":" }),
|
|
6066
6085
|
activateLabel && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { id: `${id}-action`, className: "uix-visually-hidden", children: [
|
|
@@ -6073,19 +6092,216 @@ var Stat = (0, import_react43.forwardRef)(function Stat2({ label, value, icon, m
|
|
|
6073
6092
|
);
|
|
6074
6093
|
});
|
|
6075
6094
|
|
|
6095
|
+
// src/components/InsightCard.tsx
|
|
6096
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
6097
|
+
var defaultNumber = new Intl.NumberFormat("en", { maximumFractionDigits: 1 });
|
|
6098
|
+
var DEFAULT_INSIGHT_CARD_LABELS = {
|
|
6099
|
+
coverage: (covered, total, percent, note) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
6100
|
+
covered,
|
|
6101
|
+
" of ",
|
|
6102
|
+
total,
|
|
6103
|
+
" ",
|
|
6104
|
+
note,
|
|
6105
|
+
" (",
|
|
6106
|
+
percent,
|
|
6107
|
+
"%)"
|
|
6108
|
+
] }),
|
|
6109
|
+
bullet: (actual, target) => `${actual} against a target of ${target}`,
|
|
6110
|
+
source: "Source",
|
|
6111
|
+
updated: "Updated",
|
|
6112
|
+
kpis: "Key figures",
|
|
6113
|
+
formatNumber: (value) => defaultNumber.format(value)
|
|
6114
|
+
};
|
|
6115
|
+
var STATUS_ICON = {
|
|
6116
|
+
ok: CircleCheckIcon,
|
|
6117
|
+
warning: TriangleAlertIcon,
|
|
6118
|
+
critical: OctagonAlertIcon,
|
|
6119
|
+
unknown: CircleQuestionMarkIcon
|
|
6120
|
+
};
|
|
6121
|
+
function InsightCard({
|
|
6122
|
+
eyebrow,
|
|
6123
|
+
headline,
|
|
6124
|
+
sowhat,
|
|
6125
|
+
status,
|
|
6126
|
+
kpis,
|
|
6127
|
+
coverage,
|
|
6128
|
+
actions,
|
|
6129
|
+
source,
|
|
6130
|
+
updated,
|
|
6131
|
+
layout = "stack",
|
|
6132
|
+
variant = "card",
|
|
6133
|
+
aside,
|
|
6134
|
+
headingLevel = 3,
|
|
6135
|
+
labels: labelOverrides,
|
|
6136
|
+
className,
|
|
6137
|
+
children,
|
|
6138
|
+
...props
|
|
6139
|
+
}) {
|
|
6140
|
+
const labels = { ...DEFAULT_INSIGHT_CARD_LABELS, ...labelOverrides };
|
|
6141
|
+
const Heading = `h${headingLevel}`;
|
|
6142
|
+
const StatusIcon = status ? STATUS_ICON[status.tone] : null;
|
|
6143
|
+
const percent = coverage && coverage.total > 0 ? Math.round(coverage.covered / coverage.total * 100) : null;
|
|
6144
|
+
const hasFooter = coverage != null || source != null || updated != null || actions != null;
|
|
6145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("article", { className: cx("uix-insight", variant === "plain" && "uix-insight--plain", className), "data-layout": layout, ...props, children: [
|
|
6146
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("header", { className: "uix-insight__header", children: [
|
|
6147
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "uix-insight__heading", children: [
|
|
6148
|
+
eyebrow != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "uix-insight__eyebrow", children: eyebrow }) : null,
|
|
6149
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Heading, { className: "uix-insight__headline", children: headline }),
|
|
6150
|
+
sowhat != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "uix-insight__sowhat", children: sowhat }) : null
|
|
6151
|
+
] }),
|
|
6152
|
+
status && StatusIcon ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "uix-insight__status", "data-tone": status.tone, children: [
|
|
6153
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(StatusIcon, { size: "sm", "aria-hidden": "true" }),
|
|
6154
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: status.label })
|
|
6155
|
+
] }) : null
|
|
6156
|
+
] }),
|
|
6157
|
+
kpis?.length ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("dl", { className: "uix-insight__kpis", "aria-label": labels.kpis, children: kpis.map((kpi, index) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "uix-insight__kpi", children: [
|
|
6158
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("dt", { className: "uix-insight__kpi-label", children: kpi.label }),
|
|
6159
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("dd", { className: "uix-insight__kpi-value", children: kpi.value }),
|
|
6160
|
+
kpi.comparison ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("dd", { className: "uix-insight__kpi-comparison", "data-tone": kpi.comparison.tone ?? "neutral", children: kpi.comparison.text }) : null,
|
|
6161
|
+
kpi.target ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("dd", { className: "uix-insight__kpi-target", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Bullet, { ...kpi.target, label: labels.bullet(labels.formatNumber(kpi.target.actual), labels.formatNumber(kpi.target.target)) }) }) : null
|
|
6162
|
+
] }, index)) }) : null,
|
|
6163
|
+
children != null || aside != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "uix-insight__body", children: [
|
|
6164
|
+
children != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "uix-insight__main", children }) : null,
|
|
6165
|
+
aside != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "uix-insight__aside", children: aside }) : null
|
|
6166
|
+
] }) : null,
|
|
6167
|
+
hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("footer", { className: "uix-insight__footer", children: [
|
|
6168
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "uix-insight__meta", children: [
|
|
6169
|
+
coverage && percent != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("p", { className: "uix-insight__coverage", children: [
|
|
6170
|
+
labels.coverage(coverage.covered, coverage.total, percent, coverage.note),
|
|
6171
|
+
coverage.partialPeriod != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "uix-insight__partial", children: coverage.partialPeriod }) : null
|
|
6172
|
+
] }) : null,
|
|
6173
|
+
source != null || updated != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("p", { className: "uix-insight__source", children: [
|
|
6174
|
+
source != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { children: [
|
|
6175
|
+
labels.source,
|
|
6176
|
+
": ",
|
|
6177
|
+
source
|
|
6178
|
+
] }) : null,
|
|
6179
|
+
updated != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { children: [
|
|
6180
|
+
labels.updated,
|
|
6181
|
+
": ",
|
|
6182
|
+
updated
|
|
6183
|
+
] }) : null
|
|
6184
|
+
] }) : null
|
|
6185
|
+
] }),
|
|
6186
|
+
actions != null ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "uix-insight__actions", children: actions }) : null
|
|
6187
|
+
] }) : null
|
|
6188
|
+
] });
|
|
6189
|
+
}
|
|
6190
|
+
function Bullet({ actual, target, ranges, max, label, className, style, ...props }) {
|
|
6191
|
+
const end = Math.max(max ?? 0, ...(ranges ?? []).map((r) => r[1]), actual, target, 0) * (max ? 1 : 1.1) || 1;
|
|
6192
|
+
const pct = (value) => `${Math.max(0, Math.min(100, value / end * 100))}%`;
|
|
6193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: cx("uix-bullet", className), role: "img", "aria-label": label, style, ...props, children: [
|
|
6194
|
+
(ranges ?? []).map(([from, to], index) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6195
|
+
"span",
|
|
6196
|
+
{
|
|
6197
|
+
className: "uix-bullet__range",
|
|
6198
|
+
"data-band": Math.min(index, 2),
|
|
6199
|
+
style: { left: pct(from), width: `calc(${pct(to)} - ${pct(from)})` }
|
|
6200
|
+
},
|
|
6201
|
+
index
|
|
6202
|
+
)),
|
|
6203
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "uix-bullet__bar", style: { width: pct(actual) } }),
|
|
6204
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "uix-bullet__target", style: { left: pct(target) } })
|
|
6205
|
+
] });
|
|
6206
|
+
}
|
|
6207
|
+
|
|
6208
|
+
// src/chart-stats.ts
|
|
6209
|
+
var finite = (value) => typeof value === "number" && Number.isFinite(value);
|
|
6210
|
+
function linearFit(points) {
|
|
6211
|
+
const usable = points.filter((p) => finite(p.x) && finite(p.y));
|
|
6212
|
+
const n = usable.length;
|
|
6213
|
+
if (n < 2) return null;
|
|
6214
|
+
let sumX = 0;
|
|
6215
|
+
let sumY = 0;
|
|
6216
|
+
for (const p of usable) {
|
|
6217
|
+
sumX += p.x;
|
|
6218
|
+
sumY += p.y;
|
|
6219
|
+
}
|
|
6220
|
+
const xMean = sumX / n;
|
|
6221
|
+
const yMean = sumY / n;
|
|
6222
|
+
let sxx = 0;
|
|
6223
|
+
let syy = 0;
|
|
6224
|
+
let sxy = 0;
|
|
6225
|
+
for (const p of usable) {
|
|
6226
|
+
const dx = p.x - xMean;
|
|
6227
|
+
const dy = p.y - yMean;
|
|
6228
|
+
sxx += dx * dx;
|
|
6229
|
+
syy += dy * dy;
|
|
6230
|
+
sxy += dx * dy;
|
|
6231
|
+
}
|
|
6232
|
+
if (sxx === 0) return null;
|
|
6233
|
+
const slope = sxy / sxx;
|
|
6234
|
+
const intercept = yMean - slope * xMean;
|
|
6235
|
+
let sse = 0;
|
|
6236
|
+
for (const p of usable) {
|
|
6237
|
+
const residual = p.y - (intercept + slope * p.x);
|
|
6238
|
+
sse += residual * residual;
|
|
6239
|
+
}
|
|
6240
|
+
const r = syy === 0 ? null : Math.max(-1, Math.min(1, sxy / Math.sqrt(sxx * syy)));
|
|
6241
|
+
const residualStdError = n > 2 ? Math.sqrt(sse / (n - 2)) : 0;
|
|
6242
|
+
return { slope, intercept, r, n, xMean, sxx, residualStdError };
|
|
6243
|
+
}
|
|
6244
|
+
function quantiles(values, ps) {
|
|
6245
|
+
const sorted = values.filter(finite).slice().sort((a, b) => a - b);
|
|
6246
|
+
return ps.map((p) => {
|
|
6247
|
+
if (!sorted.length || !finite(p)) return null;
|
|
6248
|
+
const clamped = Math.max(0, Math.min(1, p));
|
|
6249
|
+
const h = (sorted.length - 1) * clamped;
|
|
6250
|
+
const lo = Math.floor(h);
|
|
6251
|
+
const hi = Math.ceil(h);
|
|
6252
|
+
return sorted[lo] + (h - lo) * (sorted[hi] - sorted[lo]);
|
|
6253
|
+
});
|
|
6254
|
+
}
|
|
6255
|
+
function normalQuantile(p) {
|
|
6256
|
+
if (!(p > 0 && p < 1)) return p === 0 ? -Infinity : p === 1 ? Infinity : Number.NaN;
|
|
6257
|
+
const a = [-39.69683028665376, 220.9460984245205, -275.9285104469687, 138.357751867269, -30.66479806614716, 2.506628277459239];
|
|
6258
|
+
const b = [-54.47609879822406, 161.5858368580409, -155.6989798598866, 66.80131188771972, -13.28068155288572];
|
|
6259
|
+
const c = [-0.007784894002430293, -0.3223964580411365, -2.400758277161838, -2.549732539343734, 4.374664141464968, 2.938163982698783];
|
|
6260
|
+
const d = [0.007784695709041462, 0.3224671290700398, 2.445134137142996, 3.754408661907416];
|
|
6261
|
+
const low = 0.02425;
|
|
6262
|
+
if (p < low) {
|
|
6263
|
+
const q2 = Math.sqrt(-2 * Math.log(p));
|
|
6264
|
+
return (((((c[0] * q2 + c[1]) * q2 + c[2]) * q2 + c[3]) * q2 + c[4]) * q2 + c[5]) / ((((d[0] * q2 + d[1]) * q2 + d[2]) * q2 + d[3]) * q2 + 1);
|
|
6265
|
+
}
|
|
6266
|
+
if (p > 1 - low) {
|
|
6267
|
+
const q2 = Math.sqrt(-2 * Math.log(1 - p));
|
|
6268
|
+
return -(((((c[0] * q2 + c[1]) * q2 + c[2]) * q2 + c[3]) * q2 + c[4]) * q2 + c[5]) / ((((d[0] * q2 + d[1]) * q2 + d[2]) * q2 + d[3]) * q2 + 1);
|
|
6269
|
+
}
|
|
6270
|
+
const q = p - 0.5;
|
|
6271
|
+
const r = q * q;
|
|
6272
|
+
return (((((a[0] * r + a[1]) * r + a[2]) * r + a[3]) * r + a[4]) * r + a[5]) * q / (((((b[0] * r + b[1]) * r + b[2]) * r + b[3]) * r + b[4]) * r + 1);
|
|
6273
|
+
}
|
|
6274
|
+
function studentTQuantile(p, df) {
|
|
6275
|
+
const z = normalQuantile(p);
|
|
6276
|
+
if (!Number.isFinite(z) || !(df > 0)) return z;
|
|
6277
|
+
const z3 = z ** 3;
|
|
6278
|
+
const z5 = z ** 5;
|
|
6279
|
+
const z7 = z ** 7;
|
|
6280
|
+
return z + (z3 + z) / (4 * df) + (5 * z5 + 16 * z3 + 3 * z) / (96 * df ** 2) + (3 * z7 + 19 * z5 + 17 * z3 - 15 * z) / (384 * df ** 3);
|
|
6281
|
+
}
|
|
6282
|
+
function predictionBand(fit, xs, level = 0.8) {
|
|
6283
|
+
const coverage = Math.max(0.01, Math.min(0.999, level));
|
|
6284
|
+
const t = fit.n > 2 ? studentTQuantile(1 - (1 - coverage) / 2, fit.n - 2) : 0;
|
|
6285
|
+
return xs.filter(finite).map((x) => {
|
|
6286
|
+
const y = fit.intercept + fit.slope * x;
|
|
6287
|
+
const spread = t * fit.residualStdError * Math.sqrt(1 + 1 / fit.n + (x - fit.xMean) ** 2 / fit.sxx);
|
|
6288
|
+
return { x, y, lower: y - spread, upper: y + spread };
|
|
6289
|
+
});
|
|
6290
|
+
}
|
|
6291
|
+
|
|
6076
6292
|
// src/components/Chip.tsx
|
|
6077
6293
|
var import_react44 = require("react");
|
|
6078
6294
|
|
|
6079
6295
|
// src/components/ChipRemove.tsx
|
|
6080
|
-
var
|
|
6296
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
6081
6297
|
function ChipRemoveButton({ label, text, disabled, onRemove }) {
|
|
6082
6298
|
const provided = useUixLabels().chip?.remove;
|
|
6083
6299
|
const template = label ?? provided ?? "Remove {label}";
|
|
6084
|
-
return /* @__PURE__ */ (0,
|
|
6300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("button", { type: "button", className: "uix-chip__remove", "aria-label": fillLabel(template, { label: text }).trim(), disabled, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(XIcon, {}) });
|
|
6085
6301
|
}
|
|
6086
6302
|
|
|
6087
6303
|
// src/components/Chip.tsx
|
|
6088
|
-
var
|
|
6304
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
6089
6305
|
var Chip = (0, import_react44.forwardRef)(function Chip2({
|
|
6090
6306
|
children,
|
|
6091
6307
|
icon,
|
|
@@ -6108,10 +6324,10 @@ var Chip = (0, import_react44.forwardRef)(function Chip2({
|
|
|
6108
6324
|
const interactive = toggle || onClick != null || href != null;
|
|
6109
6325
|
const link = href != null && !disabled;
|
|
6110
6326
|
const on = pressed || link && current || void 0;
|
|
6111
|
-
const body = /* @__PURE__ */ (0,
|
|
6112
|
-
icon != null && /* @__PURE__ */ (0,
|
|
6113
|
-
/* @__PURE__ */ (0,
|
|
6114
|
-
count2 != null && /* @__PURE__ */ (0,
|
|
6327
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
6328
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "uix-chip__icon", "aria-hidden": "true", children: icon }),
|
|
6329
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "uix-chip__label", children }),
|
|
6330
|
+
count2 != null && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "uix-chip__count", children: count2 })
|
|
6115
6331
|
] });
|
|
6116
6332
|
const handleClick = () => {
|
|
6117
6333
|
if (disabled) return;
|
|
@@ -6138,7 +6354,7 @@ var Chip = (0, import_react44.forwardRef)(function Chip2({
|
|
|
6138
6354
|
});
|
|
6139
6355
|
}
|
|
6140
6356
|
if (interactive) {
|
|
6141
|
-
return /* @__PURE__ */ (0,
|
|
6357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6142
6358
|
"button",
|
|
6143
6359
|
{
|
|
6144
6360
|
type: "button",
|
|
@@ -6153,14 +6369,14 @@ var Chip = (0, import_react44.forwardRef)(function Chip2({
|
|
|
6153
6369
|
}
|
|
6154
6370
|
);
|
|
6155
6371
|
}
|
|
6156
|
-
return /* @__PURE__ */ (0,
|
|
6372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: classes, ...extra, ...bodyProps, ref, children: body });
|
|
6157
6373
|
};
|
|
6158
6374
|
if (!onRemove) {
|
|
6159
|
-
return /* @__PURE__ */ (0,
|
|
6375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_jsx_runtime59.Fragment, { children: main(outer, { ...props, "data-on": on }) });
|
|
6160
6376
|
}
|
|
6161
|
-
return /* @__PURE__ */ (0,
|
|
6377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: outer, "data-on": on, ...props, children: [
|
|
6162
6378
|
main("uix-chip__main"),
|
|
6163
|
-
/* @__PURE__ */ (0,
|
|
6379
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6164
6380
|
ChipRemoveButton,
|
|
6165
6381
|
{
|
|
6166
6382
|
label: removeLabel,
|
|
@@ -6172,14 +6388,14 @@ var Chip = (0, import_react44.forwardRef)(function Chip2({
|
|
|
6172
6388
|
] });
|
|
6173
6389
|
});
|
|
6174
6390
|
function ChipGroup({ label, children, className, ...props }) {
|
|
6175
|
-
return /* @__PURE__ */ (0,
|
|
6391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { role: "group", "aria-label": label, className: cx("uix-chip-group", className), ...props, children });
|
|
6176
6392
|
}
|
|
6177
6393
|
|
|
6178
6394
|
// src/components/Kbd.tsx
|
|
6179
6395
|
var import_react45 = require("react");
|
|
6180
|
-
var
|
|
6396
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
6181
6397
|
function Kbd({ className, children, ...props }) {
|
|
6182
|
-
return /* @__PURE__ */ (0,
|
|
6398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("kbd", { className: cx("uix-kbd", className), ...props, children });
|
|
6183
6399
|
}
|
|
6184
6400
|
var KEYS = {
|
|
6185
6401
|
Mod: { mac: ["\u2318", "Command"], other: ["Ctrl", "Control"] },
|
|
@@ -6210,15 +6426,15 @@ function KbdCombo({ keys, platform, keyLabels, className, ...props }) {
|
|
|
6210
6426
|
const known = KEYS[key]?.[active];
|
|
6211
6427
|
return { glyph: known?.[0] ?? key, spoken: keyLabels?.[key] ?? known?.[1] ?? key };
|
|
6212
6428
|
});
|
|
6213
|
-
return /* @__PURE__ */ (0,
|
|
6214
|
-
/* @__PURE__ */ (0,
|
|
6215
|
-
/* @__PURE__ */ (0,
|
|
6429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { className: cx("uix-kbd-combo", className), ...props, children: [
|
|
6430
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "uix-visually-hidden", children: parts.map((p) => p.spoken).join("+") }),
|
|
6431
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "uix-kbd-combo__keys", "aria-hidden": "true", children: parts.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("kbd", { className: "uix-kbd", children: p.glyph }, `${keys[i]}-${i}`)) })
|
|
6216
6432
|
] });
|
|
6217
6433
|
}
|
|
6218
6434
|
|
|
6219
6435
|
// src/components/Steps.tsx
|
|
6220
6436
|
var import_react46 = require("react");
|
|
6221
|
-
var
|
|
6437
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
6222
6438
|
var DEFAULT_STEP_STATE_LABELS = {
|
|
6223
6439
|
complete: "Completed",
|
|
6224
6440
|
current: "Current step",
|
|
@@ -6227,12 +6443,12 @@ var DEFAULT_STEP_STATE_LABELS = {
|
|
|
6227
6443
|
error: "Needs attention"
|
|
6228
6444
|
};
|
|
6229
6445
|
var CSS_STATE = { complete: "done", current: "active", upcoming: void 0, waiting: "waiting", error: "error" };
|
|
6230
|
-
var Check = () => /* @__PURE__ */ (0,
|
|
6446
|
+
var Check = () => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("svg", { viewBox: "0 0 16 16", width: "12", height: "12", fill: "none", stroke: "currentColor", strokeWidth: 2.25, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: "M3.5 8.5l3 3 6-7" }) });
|
|
6231
6447
|
function Steps({ orientation = "horizontal", progress = true, headingLevel, label, stateLabels, className, children, ...props }) {
|
|
6232
6448
|
const labels = { ...DEFAULT_STEP_STATE_LABELS, ...stateLabels };
|
|
6233
6449
|
const steps = import_react46.Children.toArray(children).filter(import_react46.isValidElement);
|
|
6234
6450
|
const direction = progress ? orientation : "vertical";
|
|
6235
|
-
return /* @__PURE__ */ (0,
|
|
6451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("ol", { "aria-label": label, className: cx("uix-steps", "uix-steps--list", `uix-steps--${direction}`, !progress && "uix-steps--sections", className), ...props, children: steps.map((step, index) => (0, import_react46.cloneElement)(step, { index, last: index === steps.length - 1, stateLabels: labels, progress, headingLevel })) });
|
|
6236
6452
|
}
|
|
6237
6453
|
function Step({
|
|
6238
6454
|
title,
|
|
@@ -6252,18 +6468,18 @@ function Step({
|
|
|
6252
6468
|
...props
|
|
6253
6469
|
}) {
|
|
6254
6470
|
const titleId = (0, import_react46.useId)();
|
|
6255
|
-
const glyph = marker ?? (!progress ? index + 1 : state === "complete" ? /* @__PURE__ */ (0,
|
|
6471
|
+
const glyph = marker ?? (!progress ? index + 1 : state === "complete" ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Check, {}) : state === "error" ? "!" : index + 1);
|
|
6256
6472
|
const Title = headingLevel ? `h${headingLevel}` : "span";
|
|
6257
|
-
const name = /* @__PURE__ */ (0,
|
|
6258
|
-
/* @__PURE__ */ (0,
|
|
6259
|
-
progress && /* @__PURE__ */ (0,
|
|
6473
|
+
const name = /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
6474
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Title, { id: children != null ? titleId : void 0, className: "uix-step__title", children: title }),
|
|
6475
|
+
progress && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("span", { className: "uix-visually-hidden", children: [
|
|
6260
6476
|
", ",
|
|
6261
6477
|
stateLabels[state]
|
|
6262
6478
|
] })
|
|
6263
6479
|
] });
|
|
6264
|
-
const titled = headingLevel ? name : href != null ? renderUixLink(renderLink, { href, className: "uix-step__action", children: name }) : onSelect ? /* @__PURE__ */ (0,
|
|
6480
|
+
const titled = headingLevel ? name : href != null ? renderUixLink(renderLink, { href, className: "uix-step__action", children: name }) : onSelect ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("button", { type: "button", className: "uix-step__action", onClick: onSelect, children: name }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "uix-step__action", children: name });
|
|
6265
6481
|
const Text = headingLevel || children != null ? "div" : "span";
|
|
6266
|
-
return /* @__PURE__ */ (0,
|
|
6482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
6267
6483
|
"li",
|
|
6268
6484
|
{
|
|
6269
6485
|
className: cx("uix-step", className),
|
|
@@ -6271,13 +6487,13 @@ function Step({
|
|
|
6271
6487
|
"aria-current": progress && state === "current" ? "step" : void 0,
|
|
6272
6488
|
...props,
|
|
6273
6489
|
children: [
|
|
6274
|
-
/* @__PURE__ */ (0,
|
|
6275
|
-
/* @__PURE__ */ (0,
|
|
6490
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "uix-step__marker", "aria-hidden": "true", children: glyph }),
|
|
6491
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(Text, { className: "uix-step__text", children: [
|
|
6276
6492
|
titled,
|
|
6277
|
-
description != null && /* @__PURE__ */ (0,
|
|
6278
|
-
children != null && /* @__PURE__ */ (0,
|
|
6493
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "uix-step__desc", children: description }),
|
|
6494
|
+
children != null && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "uix-step__content", role: "group", "aria-labelledby": titleId, children })
|
|
6279
6495
|
] }),
|
|
6280
|
-
!last && /* @__PURE__ */ (0,
|
|
6496
|
+
!last && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "uix-step__connector", "aria-hidden": "true", "data-done": progress && state === "complete" || void 0 })
|
|
6281
6497
|
]
|
|
6282
6498
|
}
|
|
6283
6499
|
);
|
|
@@ -6285,7 +6501,7 @@ function Step({
|
|
|
6285
6501
|
|
|
6286
6502
|
// src/components/Tooltip.tsx
|
|
6287
6503
|
var import_react47 = require("react");
|
|
6288
|
-
var
|
|
6504
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
6289
6505
|
function Tooltip({ label, content, placement = "top", className, children, ...props }) {
|
|
6290
6506
|
const triggerRef = (0, import_react47.useRef)(null);
|
|
6291
6507
|
const bubbleRef = (0, import_react47.useRef)(null);
|
|
@@ -6348,7 +6564,7 @@ function Tooltip({ label, content, placement = "top", className, children, ...pr
|
|
|
6348
6564
|
const child = single ? (0, import_react47.cloneElement)(children, {
|
|
6349
6565
|
"aria-describedby": [children.props["aria-describedby"], id].filter(Boolean).join(" ")
|
|
6350
6566
|
}) : children;
|
|
6351
|
-
return /* @__PURE__ */ (0,
|
|
6567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
6352
6568
|
"span",
|
|
6353
6569
|
{
|
|
6354
6570
|
ref: triggerRef,
|
|
@@ -6365,7 +6581,7 @@ function Tooltip({ label, content, placement = "top", className, children, ...pr
|
|
|
6365
6581
|
...props,
|
|
6366
6582
|
children: [
|
|
6367
6583
|
child,
|
|
6368
|
-
/* @__PURE__ */ (0,
|
|
6584
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6369
6585
|
"span",
|
|
6370
6586
|
{
|
|
6371
6587
|
ref: bubbleRef,
|
|
@@ -6384,45 +6600,45 @@ function Tooltip({ label, content, placement = "top", className, children, ...pr
|
|
|
6384
6600
|
}
|
|
6385
6601
|
|
|
6386
6602
|
// src/components/States.tsx
|
|
6387
|
-
var
|
|
6603
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
6388
6604
|
function EmptyState({ icon, title, children, action, variant = "section", className, ...props }) {
|
|
6389
|
-
return /* @__PURE__ */ (0,
|
|
6390
|
-
icon != null && /* @__PURE__ */ (0,
|
|
6391
|
-
title != null && /* @__PURE__ */ (0,
|
|
6605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: cx("uix-empty", `uix-empty--${variant}`, className), ...props, children: [
|
|
6606
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "uix-empty__icon", children: icon }),
|
|
6607
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "uix-empty__title", children: title }),
|
|
6392
6608
|
children,
|
|
6393
6609
|
action
|
|
6394
6610
|
] });
|
|
6395
6611
|
}
|
|
6396
6612
|
function ErrorState({ icon, title, detail, action, variant = "section", className, ...props }) {
|
|
6397
|
-
return /* @__PURE__ */ (0,
|
|
6398
|
-
icon != null && /* @__PURE__ */ (0,
|
|
6399
|
-
title != null && /* @__PURE__ */ (0,
|
|
6400
|
-
detail != null && /* @__PURE__ */ (0,
|
|
6613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: cx("uix-empty", "uix-empty--danger", `uix-empty--${variant}`, className), role: "alert", ...props, children: [
|
|
6614
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "uix-empty__icon uix-empty__icon--danger", children: icon }),
|
|
6615
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "uix-empty__title", children: title }),
|
|
6616
|
+
detail != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { children: detail }),
|
|
6401
6617
|
action
|
|
6402
6618
|
] });
|
|
6403
6619
|
}
|
|
6404
6620
|
function ForbiddenState({ icon, title, detail, action, variant = "section", className, ...props }) {
|
|
6405
|
-
return /* @__PURE__ */ (0,
|
|
6406
|
-
icon != null && /* @__PURE__ */ (0,
|
|
6407
|
-
title != null && /* @__PURE__ */ (0,
|
|
6408
|
-
detail != null && /* @__PURE__ */ (0,
|
|
6621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: cx("uix-empty", "uix-empty--warning", `uix-empty--${variant}`, className), ...props, children: [
|
|
6622
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "uix-empty__icon uix-empty__icon--warning", children: icon }),
|
|
6623
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "uix-empty__title", children: title }),
|
|
6624
|
+
detail != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { children: detail }),
|
|
6409
6625
|
action
|
|
6410
6626
|
] });
|
|
6411
6627
|
}
|
|
6412
6628
|
function NotFoundState({ icon, title, detail, action, variant = "section", className, ...props }) {
|
|
6413
|
-
return /* @__PURE__ */ (0,
|
|
6414
|
-
icon != null && /* @__PURE__ */ (0,
|
|
6415
|
-
title != null && /* @__PURE__ */ (0,
|
|
6416
|
-
detail != null && /* @__PURE__ */ (0,
|
|
6629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: cx("uix-empty", `uix-empty--${variant}`, className), ...props, children: [
|
|
6630
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "uix-empty__icon", children: icon }),
|
|
6631
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "uix-empty__title", children: title }),
|
|
6632
|
+
detail != null && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { children: detail }),
|
|
6417
6633
|
action
|
|
6418
6634
|
] });
|
|
6419
6635
|
}
|
|
6420
6636
|
function FilteredEmptyState(props) {
|
|
6421
|
-
return /* @__PURE__ */ (0,
|
|
6637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(EmptyState, { "data-filtered": "true", ...props });
|
|
6422
6638
|
}
|
|
6423
6639
|
function Skeleton({ variant = "block", width, height, className, style, ...props }) {
|
|
6424
6640
|
const dims = { width, height, ...style };
|
|
6425
|
-
return /* @__PURE__ */ (0,
|
|
6641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6426
6642
|
"div",
|
|
6427
6643
|
{
|
|
6428
6644
|
className: cx(
|
|
@@ -6439,9 +6655,9 @@ function Skeleton({ variant = "block", width, height, className, style, ...props
|
|
|
6439
6655
|
function LoadingState({ rows = 3, density = "comfortable", label, className, ...props }) {
|
|
6440
6656
|
return (
|
|
6441
6657
|
// no aria-busy: busy=true tells AT the region isn't ready and suppresses the announcement (UIX-A11Y-4)
|
|
6442
|
-
/* @__PURE__ */ (0,
|
|
6443
|
-
/* @__PURE__ */ (0,
|
|
6444
|
-
Array.from({ length: rows }, (_, i) => /* @__PURE__ */ (0,
|
|
6658
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: cx("uix-stack", density === "compact" && "uix-stack--compact", className), role: "status", ...props, children: [
|
|
6659
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "uix-visually-hidden", children: label ?? "Loading" }),
|
|
6660
|
+
Array.from({ length: rows }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Skeleton, { variant: "text", width: `${92 - i % 3 * 14}%` }, i))
|
|
6445
6661
|
] })
|
|
6446
6662
|
);
|
|
6447
6663
|
}
|
|
@@ -6495,7 +6711,7 @@ function subscribeRelativeClock(interval, listener) {
|
|
|
6495
6711
|
}
|
|
6496
6712
|
|
|
6497
6713
|
// src/components/RelativeTime.tsx
|
|
6498
|
-
var
|
|
6714
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
6499
6715
|
function RelativeTime({
|
|
6500
6716
|
value,
|
|
6501
6717
|
now,
|
|
@@ -6516,7 +6732,7 @@ function RelativeTime({
|
|
|
6516
6732
|
const getServerSnapshot = (0, import_react48.useCallback)(() => fixedNow ?? Date.now(), [fixedNow]);
|
|
6517
6733
|
const clock = (0, import_react48.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot);
|
|
6518
6734
|
const date = (0, import_react48.useMemo)(() => parseDateValue(value), [value]);
|
|
6519
|
-
if (!date) return /* @__PURE__ */ (0,
|
|
6735
|
+
if (!date) return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("time", { "data-invalid": "true", suppressHydrationWarning: true, ...props, children: invalidLabel });
|
|
6520
6736
|
const current = new Date(clock);
|
|
6521
6737
|
const content = formatter ? formatter({ date, now: current, locale, timeZone }) : (() => {
|
|
6522
6738
|
const relative = relativeTimeValue(date, current);
|
|
@@ -6526,11 +6742,11 @@ function RelativeTime({
|
|
|
6526
6742
|
return new Intl.RelativeTimeFormat(locale, { numeric }).format(relative.value, relative.unit);
|
|
6527
6743
|
})();
|
|
6528
6744
|
const absolute = new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeStyle: "short", timeZone }).format(date);
|
|
6529
|
-
return /* @__PURE__ */ (0,
|
|
6745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("time", { dateTime: date.toISOString(), title: title ?? absolute, suppressHydrationWarning: true, ...props, children: content });
|
|
6530
6746
|
}
|
|
6531
6747
|
|
|
6532
6748
|
// src/components/AsyncOperationStatus.tsx
|
|
6533
|
-
var
|
|
6749
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
6534
6750
|
var tones = {
|
|
6535
6751
|
queued: "neutral",
|
|
6536
6752
|
running: "info",
|
|
@@ -6538,29 +6754,29 @@ var tones = {
|
|
|
6538
6754
|
failed: "danger"
|
|
6539
6755
|
};
|
|
6540
6756
|
function AsyncOperationStatus({ state, title, statusLabel, description, progress, progressLabel, action, className, ...props }) {
|
|
6541
|
-
return /* @__PURE__ */ (0,
|
|
6542
|
-
/* @__PURE__ */ (0,
|
|
6543
|
-
/* @__PURE__ */ (0,
|
|
6544
|
-
/* @__PURE__ */ (0,
|
|
6757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: cx("uix-operation", className), role: state === "failed" ? "alert" : "status", "aria-live": "polite", ...props, children: [
|
|
6758
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "uix-operation__head", children: [
|
|
6759
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("strong", { children: title }),
|
|
6760
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(StatusPill, { tone: tones[state], children: statusLabel })
|
|
6545
6761
|
] }),
|
|
6546
|
-
description != null && /* @__PURE__ */ (0,
|
|
6547
|
-
progress != null && /* @__PURE__ */ (0,
|
|
6548
|
-
action != null && /* @__PURE__ */ (0,
|
|
6762
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "uix-operation__description", children: description }),
|
|
6763
|
+
progress != null && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Progress, { value: progress, "aria-label": progressLabel }),
|
|
6764
|
+
action != null && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "uix-operation__action", children: action })
|
|
6549
6765
|
] });
|
|
6550
6766
|
}
|
|
6551
6767
|
|
|
6552
6768
|
// src/components/Label.tsx
|
|
6553
|
-
var
|
|
6769
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
6554
6770
|
function Label({ color, dot, children, className, style, ...props }) {
|
|
6555
6771
|
const merged = color ? { "--label-color": color, ...style } : style;
|
|
6556
|
-
return /* @__PURE__ */ (0,
|
|
6557
|
-
dot && /* @__PURE__ */ (0,
|
|
6772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("span", { className: cx("uix-label", className), style: merged, ...props, children: [
|
|
6773
|
+
dot && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "uix-label__dot", "aria-hidden": "true" }),
|
|
6558
6774
|
children
|
|
6559
6775
|
] });
|
|
6560
6776
|
}
|
|
6561
6777
|
|
|
6562
6778
|
// src/components/Avatar.tsx
|
|
6563
|
-
var
|
|
6779
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
6564
6780
|
var DEFAULT_PRESENCE_LABELS = {
|
|
6565
6781
|
online: "online",
|
|
6566
6782
|
busy: "busy",
|
|
@@ -6570,15 +6786,15 @@ var DEFAULT_PRESENCE_LABELS = {
|
|
|
6570
6786
|
function Avatar({ size = "md", src, alt, children, status, presence, presenceLabels, onlineLabel, className, ...props }) {
|
|
6571
6787
|
const state = presence ?? (status ? "online" : void 0);
|
|
6572
6788
|
const word = state && (presenceLabels?.[state] ?? (state === "online" ? onlineLabel : void 0) ?? DEFAULT_PRESENCE_LABELS[state]);
|
|
6573
|
-
return /* @__PURE__ */ (0,
|
|
6574
|
-
src ? /* @__PURE__ */ (0,
|
|
6575
|
-
state && /* @__PURE__ */ (0,
|
|
6576
|
-
state && /* @__PURE__ */ (0,
|
|
6789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: cx("uix-avatar", size !== "md" && `uix-avatar--${size}`, className), ...props, children: [
|
|
6790
|
+
src ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("img", { src, alt: alt ?? "" }) : children,
|
|
6791
|
+
state && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "uix-avatar__status", "data-presence": state === "online" ? void 0 : state, "aria-hidden": "true" }),
|
|
6792
|
+
state && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "uix-visually-hidden", children: word })
|
|
6577
6793
|
] });
|
|
6578
6794
|
}
|
|
6579
6795
|
function PresenceDot({ presence, label, className, ...props }) {
|
|
6580
6796
|
const decorative = label === null;
|
|
6581
|
-
return /* @__PURE__ */ (0,
|
|
6797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6582
6798
|
"span",
|
|
6583
6799
|
{
|
|
6584
6800
|
className: cx("uix-presence", `uix-presence--${presence}`, className),
|
|
@@ -6590,23 +6806,23 @@ function PresenceDot({ presence, label, className, ...props }) {
|
|
|
6590
6806
|
);
|
|
6591
6807
|
}
|
|
6592
6808
|
function AvatarGroup({ children, className, ...props }) {
|
|
6593
|
-
return /* @__PURE__ */ (0,
|
|
6809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: cx("uix-avatar-group", className), ...props, children });
|
|
6594
6810
|
}
|
|
6595
6811
|
function UserChip({ avatar, name, sub, className, children, ...props }) {
|
|
6596
|
-
return /* @__PURE__ */ (0,
|
|
6812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: cx("uix-user-chip", className), ...props, children: [
|
|
6597
6813
|
avatar,
|
|
6598
|
-
/* @__PURE__ */ (0,
|
|
6599
|
-
name != null && /* @__PURE__ */ (0,
|
|
6600
|
-
sub != null && /* @__PURE__ */ (0,
|
|
6814
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { children: [
|
|
6815
|
+
name != null && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "uix-user-chip__name", children: name }),
|
|
6816
|
+
sub != null && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "uix-user-chip__sub", style: { display: "block" }, children: sub })
|
|
6601
6817
|
] }),
|
|
6602
6818
|
children
|
|
6603
6819
|
] });
|
|
6604
6820
|
}
|
|
6605
6821
|
|
|
6606
6822
|
// src/components/Comments.tsx
|
|
6607
|
-
var
|
|
6823
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
6608
6824
|
function Comments({ children, className, ...props }) {
|
|
6609
|
-
return /* @__PURE__ */ (0,
|
|
6825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { role: "log", className: cx("uix-comments", className), ...props, children });
|
|
6610
6826
|
}
|
|
6611
6827
|
function Comment({
|
|
6612
6828
|
avatar,
|
|
@@ -6622,23 +6838,23 @@ function Comment({
|
|
|
6622
6838
|
}) {
|
|
6623
6839
|
const system = variant === "system";
|
|
6624
6840
|
const byline = author ?? (system ? systemLabel : void 0);
|
|
6625
|
-
return /* @__PURE__ */ (0,
|
|
6841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
6626
6842
|
"div",
|
|
6627
6843
|
{
|
|
6628
6844
|
className: cx("uix-comment", system && "uix-comment--system", className),
|
|
6629
6845
|
"data-variant": system ? "system" : void 0,
|
|
6630
6846
|
...props,
|
|
6631
6847
|
children: [
|
|
6632
|
-
avatar ?? /* @__PURE__ */ (0,
|
|
6633
|
-
/* @__PURE__ */ (0,
|
|
6634
|
-
(byline != null || meta != null) && /* @__PURE__ */ (0,
|
|
6635
|
-
byline != null && /* @__PURE__ */ (0,
|
|
6848
|
+
avatar ?? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { "aria-hidden": "true" }),
|
|
6849
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "uix-comment__body", children: [
|
|
6850
|
+
(byline != null || meta != null) && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "uix-comment__meta", children: [
|
|
6851
|
+
byline != null && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "uix-comment__author", children: byline }),
|
|
6636
6852
|
byline != null && meta != null ? " \xB7 " : null,
|
|
6637
6853
|
meta
|
|
6638
6854
|
] }),
|
|
6639
|
-
replyTo != null && /* @__PURE__ */ (0,
|
|
6640
|
-
/* @__PURE__ */ (0,
|
|
6641
|
-
/* @__PURE__ */ (0,
|
|
6855
|
+
replyTo != null && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("blockquote", { className: "uix-comment__reply", children: [
|
|
6856
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "uix-comment__reply-label", children: replyToLabel }),
|
|
6857
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "uix-comment__reply-body", children: replyTo })
|
|
6642
6858
|
] }),
|
|
6643
6859
|
children
|
|
6644
6860
|
] })
|
|
@@ -6648,7 +6864,7 @@ function Comment({
|
|
|
6648
6864
|
}
|
|
6649
6865
|
|
|
6650
6866
|
// src/components/SaveStatus.tsx
|
|
6651
|
-
var
|
|
6867
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
6652
6868
|
var DEFAULT_SAVE_STATUS_LABELS = {
|
|
6653
6869
|
saving: "Saving\u2026",
|
|
6654
6870
|
saved: "Saved",
|
|
@@ -6658,30 +6874,30 @@ var DEFAULT_SAVE_STATUS_LABELS = {
|
|
|
6658
6874
|
function SaveStatus({ state, labels, onRetry, className, ...props }) {
|
|
6659
6875
|
const text = { ...DEFAULT_SAVE_STATUS_LABELS, ...labels };
|
|
6660
6876
|
const message = state === "idle" ? "" : text[state];
|
|
6661
|
-
return /* @__PURE__ */ (0,
|
|
6662
|
-
/* @__PURE__ */ (0,
|
|
6663
|
-
/* @__PURE__ */ (0,
|
|
6664
|
-
state === "failed" && onRetry && /* @__PURE__ */ (0,
|
|
6877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: cx("uix-save-status", className), "data-state": state, ...props, children: [
|
|
6878
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "uix-save-status__icon", "aria-hidden": "true" }),
|
|
6879
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "uix-save-status__text", role: "status", "aria-live": "polite", children: message }),
|
|
6880
|
+
state === "failed" && onRetry && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("button", { type: "button", className: "uix-btn uix-btn--link uix-btn--sm uix-save-status__retry", onClick: onRetry, children: text.retry })
|
|
6665
6881
|
] });
|
|
6666
6882
|
}
|
|
6667
6883
|
|
|
6668
6884
|
// src/components/Composer.tsx
|
|
6669
6885
|
var import_react49 = require("react");
|
|
6670
|
-
var
|
|
6886
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
6671
6887
|
function Composer({ children, className, label = "Add a comment", ...props }) {
|
|
6672
|
-
return /* @__PURE__ */ (0,
|
|
6888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: cx("uix-composer", className), ...props, children: import_react49.Children.map(children, (child) => {
|
|
6673
6889
|
if (!(0, import_react49.isValidElement)(child) || child.type !== "textarea") return child;
|
|
6674
6890
|
const p = child.props;
|
|
6675
6891
|
return p["aria-label"] || p["aria-labelledby"] || p.id ? child : (0, import_react49.cloneElement)(child, { "aria-label": label });
|
|
6676
6892
|
}) });
|
|
6677
6893
|
}
|
|
6678
6894
|
function ComposerBar({ children, className, ...props }) {
|
|
6679
|
-
return /* @__PURE__ */ (0,
|
|
6895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: cx("uix-composer__bar", className), ...props, children });
|
|
6680
6896
|
}
|
|
6681
6897
|
|
|
6682
6898
|
// src/components/Segmented.tsx
|
|
6683
6899
|
var import_react50 = require("react");
|
|
6684
|
-
var
|
|
6900
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
6685
6901
|
var SegmentedCtx = (0, import_react50.createContext)({});
|
|
6686
6902
|
var OPTION = ".uix-segmented__option";
|
|
6687
6903
|
function Segmented({ value, onChange, selection = "toggle", children, className, onKeyDown, ...props }) {
|
|
@@ -6735,7 +6951,7 @@ function Segmented({ value, onChange, selection = "toggle", children, className,
|
|
|
6735
6951
|
target.focus();
|
|
6736
6952
|
target.click();
|
|
6737
6953
|
};
|
|
6738
|
-
return /* @__PURE__ */ (0,
|
|
6954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(SegmentedCtx.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { ref, role: selection === "radio" ? "radiogroup" : "group", className: cx("uix-segmented", className), onKeyDown: handleKeyDown, ...props, children }) });
|
|
6739
6955
|
}
|
|
6740
6956
|
function SegmentedOption({
|
|
6741
6957
|
value,
|
|
@@ -6747,7 +6963,7 @@ function SegmentedOption({
|
|
|
6747
6963
|
const ctx = (0, import_react50.useContext)(SegmentedCtx);
|
|
6748
6964
|
const selected = ctx.value === value;
|
|
6749
6965
|
const radio = ctx.selection === "radio";
|
|
6750
|
-
return /* @__PURE__ */ (0,
|
|
6966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6751
6967
|
"button",
|
|
6752
6968
|
{
|
|
6753
6969
|
type: "button",
|
|
@@ -6770,7 +6986,7 @@ function SegmentedOption({
|
|
|
6770
6986
|
var import_react51 = require("react");
|
|
6771
6987
|
|
|
6772
6988
|
// src/components/EditorIcons.tsx
|
|
6773
|
-
var
|
|
6989
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
6774
6990
|
var PATHS2 = {
|
|
6775
6991
|
heading1: "M4 12h8M4 18V6M12 18V6M17 12l3-2v8",
|
|
6776
6992
|
heading2: "M4 12h8M4 18V6M12 18V6M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",
|
|
@@ -6804,7 +7020,7 @@ var PATHS2 = {
|
|
|
6804
7020
|
more: "M5 12h.01M12 12h.01M19 12h.01"
|
|
6805
7021
|
};
|
|
6806
7022
|
function EditorIcon({ name, ...props }) {
|
|
6807
|
-
return /* @__PURE__ */ (0,
|
|
7023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6808
7024
|
"svg",
|
|
6809
7025
|
{
|
|
6810
7026
|
viewBox: "0 0 24 24",
|
|
@@ -6816,13 +7032,13 @@ function EditorIcon({ name, ...props }) {
|
|
|
6816
7032
|
"aria-hidden": "true",
|
|
6817
7033
|
focusable: "false",
|
|
6818
7034
|
...props,
|
|
6819
|
-
children: /* @__PURE__ */ (0,
|
|
7035
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("path", { d: PATHS2[name] })
|
|
6820
7036
|
}
|
|
6821
7037
|
);
|
|
6822
7038
|
}
|
|
6823
7039
|
|
|
6824
7040
|
// src/components/TableControls.tsx
|
|
6825
|
-
var
|
|
7041
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
6826
7042
|
var VIEW_MENU_COLUMN_LABELS = {
|
|
6827
7043
|
rowActions: "Column actions: {label}",
|
|
6828
7044
|
reorder: "Drag to reorder: {label}",
|
|
@@ -6894,8 +7110,8 @@ function ColumnRowMenu({ label, actions, triggerRef }) {
|
|
|
6894
7110
|
else if (event.key === "End") focus(list.length - 1);
|
|
6895
7111
|
else if (event.key === "Tab") close(false);
|
|
6896
7112
|
};
|
|
6897
|
-
return /* @__PURE__ */ (0,
|
|
6898
|
-
/* @__PURE__ */ (0,
|
|
7113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "uix-view-menu__actions", children: [
|
|
7114
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6899
7115
|
"button",
|
|
6900
7116
|
{
|
|
6901
7117
|
ref: (el) => {
|
|
@@ -6918,10 +7134,10 @@ function ColumnRowMenu({ label, actions, triggerRef }) {
|
|
|
6918
7134
|
if (open) close(false);
|
|
6919
7135
|
else setOpen(true);
|
|
6920
7136
|
},
|
|
6921
|
-
children: /* @__PURE__ */ (0,
|
|
7137
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(EditorIcon, { name: "more" })
|
|
6922
7138
|
}
|
|
6923
7139
|
),
|
|
6924
|
-
open && /* @__PURE__ */ (0,
|
|
7140
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Popover, { id: menuId, anchor: button, placement: "bottom-end", offset: 4, role: "menu", "aria-label": label, className: "uix-view-menu__row-menu", onKeyDown: onMenuKeyDown, children: actions.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6925
7141
|
"button",
|
|
6926
7142
|
{
|
|
6927
7143
|
ref: (el) => {
|
|
@@ -7012,27 +7228,27 @@ function ViewMenu({
|
|
|
7012
7228
|
...column.required || column.disabled ? [] : [column.visible ? { id: "hide", label: labels.hide, onSelect: () => onColumnVisibilityChange?.(column.id, false) } : { id: "show", label: labels.show, onSelect: () => onColumnVisibilityChange?.(column.id, true) }]
|
|
7013
7229
|
];
|
|
7014
7230
|
const showDensity = !!densityOptions?.length && !!onDensityChange;
|
|
7015
|
-
return /* @__PURE__ */ (0,
|
|
7016
|
-
showDensity && /* @__PURE__ */ (0,
|
|
7017
|
-
/* @__PURE__ */ (0,
|
|
7018
|
-
/* @__PURE__ */ (0,
|
|
7231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: cx("uix-view-menu", className), "data-dragging": dragging ? "" : void 0, children: [
|
|
7232
|
+
showDensity && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "uix-view-menu__group", children: [
|
|
7233
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { id: densityLabelId, className: "uix-view-menu__label", children: densityLabel }),
|
|
7234
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Segmented, { value: density ?? "", onChange: onDensityChange, "aria-labelledby": densityLabelId, children: densityOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SegmentedOption, { value: option.value, children: option.label }, option.value)) })
|
|
7019
7235
|
] }),
|
|
7020
|
-
(zebra || freeze) && /* @__PURE__ */ (0,
|
|
7021
|
-
displayLabel != null && /* @__PURE__ */ (0,
|
|
7022
|
-
zebra && /* @__PURE__ */ (0,
|
|
7023
|
-
/* @__PURE__ */ (0,
|
|
7024
|
-
/* @__PURE__ */ (0,
|
|
7236
|
+
(zebra || freeze) && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "uix-view-menu__group", children: [
|
|
7237
|
+
displayLabel != null && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "uix-view-menu__label", children: displayLabel }),
|
|
7238
|
+
zebra && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "uix-view-menu__row", children: [
|
|
7239
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { id: zebraLabelId, children: zebra.label }),
|
|
7240
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Switch, { checked: zebra.checked, "aria-labelledby": zebraLabelId, onChange: (event) => zebra.onChange(event.currentTarget.checked) })
|
|
7025
7241
|
] }),
|
|
7026
|
-
freeze && /* @__PURE__ */ (0,
|
|
7027
|
-
/* @__PURE__ */ (0,
|
|
7028
|
-
/* @__PURE__ */ (0,
|
|
7242
|
+
freeze && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "uix-view-menu__row", children: [
|
|
7243
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { id: freezeLabelId, children: freeze.label }),
|
|
7244
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Switch, { checked: freeze.checked, "aria-labelledby": freezeLabelId, onChange: (event) => freeze.onChange(event.currentTarget.checked) })
|
|
7029
7245
|
] })
|
|
7030
7246
|
] }),
|
|
7031
|
-
ordered.length > 0 && /* @__PURE__ */ (0,
|
|
7032
|
-
columnsLabel != null && /* @__PURE__ */ (0,
|
|
7033
|
-
/* @__PURE__ */ (0,
|
|
7247
|
+
ordered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "uix-view-menu__group", children: [
|
|
7248
|
+
columnsLabel != null && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { id: columnsLabelId, className: "uix-view-menu__label", children: columnsLabel }),
|
|
7249
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("ul", { ref: listRef, className: "uix-view-menu__cols", "aria-labelledby": columnsLabel != null ? columnsLabelId : void 0, children: ordered.map((column, index) => {
|
|
7034
7250
|
const text = columnText(column);
|
|
7035
|
-
return /* @__PURE__ */ (0,
|
|
7251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
7036
7252
|
"li",
|
|
7037
7253
|
{
|
|
7038
7254
|
className: "uix-view-menu__col",
|
|
@@ -7041,7 +7257,7 @@ function ViewMenu({
|
|
|
7041
7257
|
"data-required": column.required ? "true" : void 0,
|
|
7042
7258
|
"data-dragging": dragging === column.id || void 0,
|
|
7043
7259
|
children: [
|
|
7044
|
-
onReorder && /* @__PURE__ */ (0,
|
|
7260
|
+
onReorder && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
7045
7261
|
"button",
|
|
7046
7262
|
{
|
|
7047
7263
|
type: "button",
|
|
@@ -7060,23 +7276,23 @@ function ViewMenu({
|
|
|
7060
7276
|
event.preventDefault();
|
|
7061
7277
|
move(column.id, event.key === "ArrowUp" ? -1 : 1, "grip");
|
|
7062
7278
|
},
|
|
7063
|
-
children: /* @__PURE__ */ (0,
|
|
7279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(EditorIcon, { name: "grip" })
|
|
7064
7280
|
}
|
|
7065
7281
|
),
|
|
7066
|
-
column.required ? /* @__PURE__ */ (0,
|
|
7067
|
-
/* @__PURE__ */ (0,
|
|
7068
|
-
/* @__PURE__ */ (0,
|
|
7069
|
-
] }) : /* @__PURE__ */ (0,
|
|
7282
|
+
column.required ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "uix-view-menu__col-toggle", title: labels.required, children: [
|
|
7283
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "uix-view-menu__col-box", "aria-hidden": "true" }),
|
|
7284
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "uix-view-menu__col-name", children: column.label })
|
|
7285
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
7070
7286
|
Checkbox,
|
|
7071
7287
|
{
|
|
7072
7288
|
className: "uix-view-menu__col-toggle",
|
|
7073
|
-
label: /* @__PURE__ */ (0,
|
|
7289
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "uix-view-menu__col-name", children: column.label }),
|
|
7074
7290
|
checked: column.visible,
|
|
7075
7291
|
disabled: column.disabled,
|
|
7076
7292
|
onChange: (event) => onColumnVisibilityChange?.(column.id, event.currentTarget.checked)
|
|
7077
7293
|
}
|
|
7078
7294
|
),
|
|
7079
|
-
onReorder && /* @__PURE__ */ (0,
|
|
7295
|
+
onReorder && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
7080
7296
|
ColumnRowMenu,
|
|
7081
7297
|
{
|
|
7082
7298
|
label: fill2(labels.rowActions, { label: text }),
|
|
@@ -7093,20 +7309,20 @@ function ViewMenu({
|
|
|
7093
7309
|
);
|
|
7094
7310
|
}) })
|
|
7095
7311
|
] }),
|
|
7096
|
-
footer != null && /* @__PURE__ */ (0,
|
|
7097
|
-
onReorder && /* @__PURE__ */ (0,
|
|
7312
|
+
footer != null && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "uix-view-menu__footer", children: footer }),
|
|
7313
|
+
onReorder && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { role: "status", className: "uix-visually-hidden", children: announcement })
|
|
7098
7314
|
] });
|
|
7099
7315
|
}
|
|
7100
7316
|
function FilterPopover({ label, type = "text", value, onValueChange, options, applyLabel, clearLabel, onApply, onClear, placeholder }) {
|
|
7101
7317
|
const controlId = (0, import_react51.useId)();
|
|
7102
|
-
return /* @__PURE__ */ (0,
|
|
7103
|
-
/* @__PURE__ */ (0,
|
|
7104
|
-
/* @__PURE__ */ (0,
|
|
7105
|
-
type === "select" || type === "enum" || type === "boolean" ? /* @__PURE__ */ (0,
|
|
7318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "uix-filter-popover", children: [
|
|
7319
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "uix-field", children: [
|
|
7320
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("label", { className: "uix-field__label", htmlFor: controlId, children: label }),
|
|
7321
|
+
type === "select" || type === "enum" || type === "boolean" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("select", { id: controlId, className: "uix-select", value, onChange: (event) => onValueChange(event.currentTarget.value), children: options?.map((option) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("option", { value: option.value, children: option.label }, option.value)) }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Input, { id: controlId, type, value, placeholder, onChange: (event) => onValueChange(event.currentTarget.value) })
|
|
7106
7322
|
] }),
|
|
7107
|
-
/* @__PURE__ */ (0,
|
|
7108
|
-
/* @__PURE__ */ (0,
|
|
7109
|
-
/* @__PURE__ */ (0,
|
|
7323
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "uix-filter-popover__actions", children: [
|
|
7324
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Button, { type: "button", onClick: onClear, children: clearLabel }),
|
|
7325
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Button, { type: "button", variant: "primary", onClick: onApply, children: applyLabel })
|
|
7110
7326
|
] })
|
|
7111
7327
|
] });
|
|
7112
7328
|
}
|
|
@@ -7205,8 +7421,8 @@ function SavedViewMenu({ items, sections, onSelect, onPinChange, pinLabel, unpin
|
|
|
7205
7421
|
if (!item) return null;
|
|
7206
7422
|
const nameId = `${baseId}-${groupIndex}-${index}`;
|
|
7207
7423
|
const extra = actions?.(item);
|
|
7208
|
-
return /* @__PURE__ */ (0,
|
|
7209
|
-
onReorder && /* @__PURE__ */ (0,
|
|
7424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("li", { className: "uix-saved-views__row", "data-active": item.active || void 0, "data-dragging": dragging === item.id || void 0, children: [
|
|
7425
|
+
onReorder && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
7210
7426
|
"button",
|
|
7211
7427
|
{
|
|
7212
7428
|
type: "button",
|
|
@@ -7225,25 +7441,25 @@ function SavedViewMenu({ items, sections, onSelect, onPinChange, pinLabel, unpin
|
|
|
7225
7441
|
event.preventDefault();
|
|
7226
7442
|
move(group, item.id, event.key === "ArrowUp" ? -1 : 1);
|
|
7227
7443
|
},
|
|
7228
|
-
children: /* @__PURE__ */ (0,
|
|
7444
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(EditorIcon, { name: "grip" })
|
|
7229
7445
|
}
|
|
7230
7446
|
),
|
|
7231
|
-
/* @__PURE__ */ (0,
|
|
7232
|
-
onPinChange && /* @__PURE__ */ (0,
|
|
7233
|
-
extra != null && extra !== false && /* @__PURE__ */ (0,
|
|
7447
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("button", { type: "button", id: nameId, className: "uix-menu__item", "data-active": item.active || void 0, "aria-current": item.active || void 0, title: typeof item.label === "string" ? item.label : void 0, onClick: () => onSelect(item.id), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "uix-saved-views__name", children: item.label }) }),
|
|
7448
|
+
onPinChange && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("button", { type: "button", className: "uix-saved-views__pin", "aria-label": item.pinned ? unpinLabel : pinLabel, "data-on": item.pinned || void 0, onClick: () => onPinChange(item.id, !item.pinned), children: "\u2605" }),
|
|
7449
|
+
extra != null && extra !== false && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "uix-saved-views__actions", children: extra })
|
|
7234
7450
|
] }, item.id);
|
|
7235
7451
|
});
|
|
7236
7452
|
};
|
|
7237
|
-
return /* @__PURE__ */ (0,
|
|
7238
|
-
visible.length === 0 && emptyLabel != null && /* @__PURE__ */ (0,
|
|
7453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("ul", { className: "uix-menu uix-saved-views", "data-dragging": dragging ? "" : void 0, children: [
|
|
7454
|
+
visible.length === 0 && emptyLabel != null && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("li", { className: "uix-menu__label", children: emptyLabel }),
|
|
7239
7455
|
sections ? visible.map((group, groupIndex) => {
|
|
7240
7456
|
const labelId = `${baseId}-section-${groupIndex}`;
|
|
7241
|
-
return /* @__PURE__ */ (0,
|
|
7242
|
-
/* @__PURE__ */ (0,
|
|
7243
|
-
/* @__PURE__ */ (0,
|
|
7457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("li", { className: "uix-saved-views__section", children: [
|
|
7458
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { id: labelId, className: "uix-menu__label uix-saved-views__section-label", children: group.label }),
|
|
7459
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("ul", { className: "uix-saved-views__group", "aria-labelledby": labelId, children: renderRows(group, groupIndex) })
|
|
7244
7460
|
] }, group.id);
|
|
7245
7461
|
}) : visible[0] && renderRows(visible[0], 0),
|
|
7246
|
-
footer != null && /* @__PURE__ */ (0,
|
|
7462
|
+
footer != null && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("li", { className: "uix-saved-views__footer", children: footer })
|
|
7247
7463
|
] });
|
|
7248
7464
|
}
|
|
7249
7465
|
|
|
@@ -7347,7 +7563,7 @@ function summarizeFilter(field, value, options = {}) {
|
|
|
7347
7563
|
}
|
|
7348
7564
|
|
|
7349
7565
|
// src/components/FilterEditor.tsx
|
|
7350
|
-
var
|
|
7566
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
7351
7567
|
var DEFAULT_FILTER_EDITOR_LABELS = {
|
|
7352
7568
|
apply: "Apply",
|
|
7353
7569
|
clear: "Clear",
|
|
@@ -7397,16 +7613,16 @@ function FilterEditor({ field, value: valueProp, onValueChange, onApply, onClear
|
|
|
7397
7613
|
let body = null;
|
|
7398
7614
|
switch (value.kind) {
|
|
7399
7615
|
case "enum":
|
|
7400
|
-
body = /* @__PURE__ */ (0,
|
|
7616
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(EnumBody, { field, value, onChange: onValueChange, labels, threshold: searchThreshold });
|
|
7401
7617
|
break;
|
|
7402
7618
|
case "reference":
|
|
7403
|
-
body = /* @__PURE__ */ (0,
|
|
7619
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ReferenceBody, { field, value, onChange: onValueChange, labels, delay: searchDelay });
|
|
7404
7620
|
break;
|
|
7405
7621
|
case "text": {
|
|
7406
7622
|
const ops = field.operators ?? TEXT_FILTER_OPERATORS;
|
|
7407
|
-
body = /* @__PURE__ */ (0,
|
|
7408
|
-
ops.length > 1 && /* @__PURE__ */ (0,
|
|
7409
|
-
/* @__PURE__ */ (0,
|
|
7623
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "uix-filter-editor__row", children: [
|
|
7624
|
+
ops.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Select, { size: "sm", "aria-label": labels.operator, value: value.operator, onChange: (e) => onValueChange({ ...value, operator: e.currentTarget.value }), children: ops.map((op) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("option", { value: op, children: labels.operators[op] }, op)) }),
|
|
7625
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Input, { "aria-label": labels.value, value: value.text, onChange: (e) => onValueChange({ ...value, text: e.currentTarget.value }), onKeyDown: (e) => {
|
|
7410
7626
|
if (e.key === "Enter") onApply();
|
|
7411
7627
|
}, autoFocus: true })
|
|
7412
7628
|
] });
|
|
@@ -7415,45 +7631,45 @@ function FilterEditor({ field, value: valueProp, onValueChange, onApply, onClear
|
|
|
7415
7631
|
case "number": {
|
|
7416
7632
|
const ops = field.operators ?? NUMBER_FILTER_OPERATORS;
|
|
7417
7633
|
const toNumber = (raw) => raw.trim() === "" ? void 0 : Number(raw);
|
|
7418
|
-
body = /* @__PURE__ */ (0,
|
|
7419
|
-
ops.length > 1 && /* @__PURE__ */ (0,
|
|
7420
|
-
/* @__PURE__ */ (0,
|
|
7421
|
-
value.operator === "between" && /* @__PURE__ */ (0,
|
|
7422
|
-
/* @__PURE__ */ (0,
|
|
7423
|
-
/* @__PURE__ */ (0,
|
|
7634
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "uix-filter-editor__row", children: [
|
|
7635
|
+
ops.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Select, { size: "sm", "aria-label": labels.operator, value: value.operator, onChange: (e) => onValueChange({ ...value, operator: e.currentTarget.value }), children: ops.map((op) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("option", { value: op, children: labels.operators[op] }, op)) }),
|
|
7636
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Input, { type: "number", inputMode: "decimal", "aria-label": value.operator === "between" ? labels.from : labels.value, value: value.value ?? "", onChange: (e) => onValueChange({ ...value, value: toNumber(e.currentTarget.value) }), autoFocus: true }),
|
|
7637
|
+
value.operator === "between" && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
7638
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "uix-filter-editor__and", children: labels.and }),
|
|
7639
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Input, { type: "number", inputMode: "decimal", "aria-label": labels.to, value: value.to ?? "", onChange: (e) => onValueChange({ ...value, to: toNumber(e.currentTarget.value) }) })
|
|
7424
7640
|
] }),
|
|
7425
|
-
field.unit && /* @__PURE__ */ (0,
|
|
7641
|
+
field.unit && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "uix-filter-editor__unit", children: field.unit })
|
|
7426
7642
|
] });
|
|
7427
7643
|
break;
|
|
7428
7644
|
}
|
|
7429
7645
|
case "date-range":
|
|
7430
|
-
body = /* @__PURE__ */ (0,
|
|
7431
|
-
/* @__PURE__ */ (0,
|
|
7432
|
-
/* @__PURE__ */ (0,
|
|
7433
|
-
/* @__PURE__ */ (0,
|
|
7646
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "uix-filter-editor__row", children: [
|
|
7647
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("label", { className: "uix-filter-editor__date", children: [
|
|
7648
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { children: labels.from }),
|
|
7649
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Input, { type: "date", value: value.from ?? "", max: value.to, onChange: (e) => onValueChange({ ...value, from: e.currentTarget.value || void 0 }) })
|
|
7434
7650
|
] }),
|
|
7435
|
-
/* @__PURE__ */ (0,
|
|
7436
|
-
/* @__PURE__ */ (0,
|
|
7437
|
-
/* @__PURE__ */ (0,
|
|
7651
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("label", { className: "uix-filter-editor__date", children: [
|
|
7652
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { children: labels.to }),
|
|
7653
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Input, { type: "date", value: value.to ?? "", min: value.from, onChange: (e) => onValueChange({ ...value, to: e.currentTarget.value || void 0 }) })
|
|
7438
7654
|
] })
|
|
7439
7655
|
] });
|
|
7440
7656
|
break;
|
|
7441
7657
|
case "boolean": {
|
|
7442
7658
|
const pick = (v) => onValueChange({ kind: "boolean", value: v });
|
|
7443
|
-
body = /* @__PURE__ */ (0,
|
|
7444
|
-
/* @__PURE__ */ (0,
|
|
7445
|
-
/* @__PURE__ */ (0,
|
|
7446
|
-
/* @__PURE__ */ (0,
|
|
7659
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(RadioGroup, { className: "uix-filter-editor__choices", children: [
|
|
7660
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Radio, { name: `${id}-bool`, label: labels.any, checked: value.value === void 0, onChange: () => pick(void 0) }),
|
|
7661
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Radio, { name: `${id}-bool`, label: field.trueLabel ?? labels.yes, checked: value.value === true, onChange: () => pick(true) }),
|
|
7662
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Radio, { name: `${id}-bool`, label: field.falseLabel ?? labels.no, checked: value.value === false, onChange: () => pick(false) })
|
|
7447
7663
|
] });
|
|
7448
7664
|
break;
|
|
7449
7665
|
}
|
|
7450
7666
|
}
|
|
7451
|
-
return /* @__PURE__ */ (0,
|
|
7452
|
-
/* @__PURE__ */ (0,
|
|
7667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "uix-filter-popover uix-filter-editor", role: "group", "aria-labelledby": `${id}-label`, "data-kind": field.kind, children: [
|
|
7668
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { id: `${id}-label`, className: "uix-filter-editor__label", children: field.label }),
|
|
7453
7669
|
body,
|
|
7454
|
-
/* @__PURE__ */ (0,
|
|
7455
|
-
/* @__PURE__ */ (0,
|
|
7456
|
-
/* @__PURE__ */ (0,
|
|
7670
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "uix-filter-popover__actions", children: [
|
|
7671
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Button, { type: "button", size: "sm", onClick: onClear, children: labels.clear }),
|
|
7672
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Button, { type: "button", size: "sm", variant: "primary", onClick: onApply, children: labels.apply })
|
|
7457
7673
|
] })
|
|
7458
7674
|
] });
|
|
7459
7675
|
}
|
|
@@ -7468,15 +7684,15 @@ function EnumBody({ field, value, onChange, labels, threshold }) {
|
|
|
7468
7684
|
const toggle = (v, on) => onChange({ kind: "enum", values: on ? [...value.values, v] : value.values.filter((x) => x !== v) });
|
|
7469
7685
|
const presets = field.presets ?? [];
|
|
7470
7686
|
const active = matchFilterPreset(field, value);
|
|
7471
|
-
return /* @__PURE__ */ (0,
|
|
7472
|
-
presets.length > 0 && /* @__PURE__ */ (0,
|
|
7473
|
-
options.length > threshold && /* @__PURE__ */ (0,
|
|
7474
|
-
/* @__PURE__ */ (0,
|
|
7475
|
-
/* @__PURE__ */ (0,
|
|
7476
|
-
/* @__PURE__ */ (0,
|
|
7477
|
-
/* @__PURE__ */ (0,
|
|
7687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
7688
|
+
presets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "uix-chip-group uix-filter-editor__presets", role: "group", "aria-label": labels.presets ?? DEFAULT_FILTER_EDITOR_LABELS.presets, children: presets.map((p) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Chip, { pressed: p === active, onPressedChange: () => onChange({ kind: "enum", values: [...p.values] }), children: p.label }, p.id)) }),
|
|
7689
|
+
options.length > threshold && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Input, { type: "search", size: "sm", "aria-label": labels.search, placeholder: labels.search, value: query, onChange: (e) => setQuery(e.currentTarget.value), autoFocus: true }),
|
|
7690
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "uix-filter-editor__bulk", children: [
|
|
7691
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "uix-filter-editor__count", "aria-live": "polite", children: fillLabel(labels.selected, { count: value.values.length }) }),
|
|
7692
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Button, { type: "button", variant: "link", size: "sm", onClick: () => onChange({ kind: "enum", values: [.../* @__PURE__ */ new Set([...value.values, ...shown.map((o) => o.value)])] }), children: labels.selectAll }),
|
|
7693
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Button, { type: "button", variant: "link", size: "sm", onClick: () => onChange({ kind: "enum", values: [] }), children: labels.selectNone })
|
|
7478
7694
|
] }),
|
|
7479
|
-
/* @__PURE__ */ (0,
|
|
7695
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "uix-filter-editor__list", children: shown.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("p", { className: "uix-filter-editor__note", children: labels.noMatches }) : shown.map((o) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Checkbox, { label: o.label, checked: selected.has(o.value), onChange: (e) => toggle(o.value, e.currentTarget.checked) }, o.value)) })
|
|
7480
7696
|
] });
|
|
7481
7697
|
}
|
|
7482
7698
|
function ReferenceBody({ field, value, onChange, labels, delay }) {
|
|
@@ -7502,35 +7718,35 @@ function ReferenceBody({ field, value, onChange, labels, delay }) {
|
|
|
7502
7718
|
}, [query, attempt, field, delay]);
|
|
7503
7719
|
const chosen = new Map(value.values.map((v) => [v.value, v]));
|
|
7504
7720
|
const toggle = (choice, on) => onChange({ kind: "reference", values: on ? [...value.values, choice] : value.values.filter((v) => v.value !== choice.value) });
|
|
7505
|
-
return /* @__PURE__ */ (0,
|
|
7506
|
-
value.values.length > 0 && /* @__PURE__ */ (0,
|
|
7507
|
-
/* @__PURE__ */ (0,
|
|
7508
|
-
/* @__PURE__ */ (0,
|
|
7509
|
-
state.status === "loading" && /* @__PURE__ */ (0,
|
|
7510
|
-
state.status === "error" && /* @__PURE__ */ (0,
|
|
7721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
7722
|
+
value.values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "uix-chip-group", role: "group", "aria-label": fillLabel(labels.selected, { count: value.values.length }), children: value.values.map((v) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Chip, { removeLabel: fillLabel(labels.remove, { label: v.label }), onRemove: () => toggle(v, false), children: v.label }, v.value)) }),
|
|
7723
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Input, { type: "search", size: "sm", "aria-label": labels.search, placeholder: labels.search, value: query, onChange: (e) => setQuery(e.currentTarget.value), autoFocus: true }),
|
|
7724
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "uix-filter-editor__list", "aria-busy": state.status === "loading" || void 0, children: [
|
|
7725
|
+
state.status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("p", { className: "uix-filter-editor__note", role: "status", children: labels.searching }),
|
|
7726
|
+
state.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("p", { className: "uix-filter-editor__note", role: "alert", children: [
|
|
7511
7727
|
labels.searchFailed,
|
|
7512
7728
|
" ",
|
|
7513
|
-
/* @__PURE__ */ (0,
|
|
7729
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Button, { type: "button", variant: "link", size: "sm", onClick: () => setAttempt((n) => n + 1), children: labels.retry })
|
|
7514
7730
|
] }),
|
|
7515
|
-
state.status === "done" && state.results.length === 0 && /* @__PURE__ */ (0,
|
|
7516
|
-
state.status === "done" && state.results.map((r) => /* @__PURE__ */ (0,
|
|
7731
|
+
state.status === "done" && state.results.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("p", { className: "uix-filter-editor__note", children: labels.noMatches }),
|
|
7732
|
+
state.status === "done" && state.results.map((r) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Checkbox, { label: r.label, checked: chosen.has(r.value), onChange: (e) => toggle(r, e.currentTarget.checked) }, r.value))
|
|
7517
7733
|
] })
|
|
7518
7734
|
] });
|
|
7519
7735
|
}
|
|
7520
7736
|
|
|
7521
7737
|
// src/components/Timeline.tsx
|
|
7522
|
-
var
|
|
7738
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
7523
7739
|
function Timeline({ children, className, ...props }) {
|
|
7524
|
-
return /* @__PURE__ */ (0,
|
|
7740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("ol", { className: cx("uix-timeline", className), ...props, children });
|
|
7525
7741
|
}
|
|
7526
7742
|
function TimelineItem({ node, meta, children, className, ...props }) {
|
|
7527
|
-
return /* @__PURE__ */ (0,
|
|
7528
|
-
/* @__PURE__ */ (0,
|
|
7529
|
-
node ?? /* @__PURE__ */ (0,
|
|
7530
|
-
/* @__PURE__ */ (0,
|
|
7743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("li", { className: cx("uix-timeline__item", className), ...props, children: [
|
|
7744
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "uix-timeline__rail", "aria-hidden": "true", children: [
|
|
7745
|
+
node ?? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "uix-timeline__node" }),
|
|
7746
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "uix-timeline__line" })
|
|
7531
7747
|
] }),
|
|
7532
|
-
/* @__PURE__ */ (0,
|
|
7533
|
-
meta != null && /* @__PURE__ */ (0,
|
|
7748
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "uix-timeline__body", children: [
|
|
7749
|
+
meta != null && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "uix-timeline__meta", children: meta }),
|
|
7534
7750
|
children
|
|
7535
7751
|
] })
|
|
7536
7752
|
] });
|
|
@@ -7538,10 +7754,10 @@ function TimelineItem({ node, meta, children, className, ...props }) {
|
|
|
7538
7754
|
|
|
7539
7755
|
// src/components/Pipeline.tsx
|
|
7540
7756
|
var import_react53 = require("react");
|
|
7541
|
-
var
|
|
7757
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
7542
7758
|
function Pipeline({ detailed = false, children, className, tabIndex, ...props }) {
|
|
7543
7759
|
const stages = detailed ? import_react53.Children.map(children, (child) => (0, import_react53.isValidElement)(child) && child.type === PipelineStage ? (0, import_react53.cloneElement)(child, { detailed: child.props.detailed ?? true }) : child) : children;
|
|
7544
|
-
return /* @__PURE__ */ (0,
|
|
7760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7545
7761
|
"ol",
|
|
7546
7762
|
{
|
|
7547
7763
|
className: cx("uix-pipeline", detailed && "uix-pipeline--detailed", className),
|
|
@@ -7578,20 +7794,20 @@ function PipelineStage({
|
|
|
7578
7794
|
const current = currentProp ?? (state === "active" || state === "current" || state === "running");
|
|
7579
7795
|
const resolvedStateLabel = stateLabel ?? DEFAULT_STATE_LABELS[state];
|
|
7580
7796
|
const showDetails = detailed || description != null || meta != null || marker != null;
|
|
7581
|
-
return /* @__PURE__ */ (0,
|
|
7797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7582
7798
|
"li",
|
|
7583
7799
|
{
|
|
7584
7800
|
className: cx("uix-pipeline__stage", className),
|
|
7585
7801
|
"data-state": state,
|
|
7586
7802
|
"aria-current": current ? "step" : void 0,
|
|
7587
7803
|
...props,
|
|
7588
|
-
children: showDetails ? /* @__PURE__ */ (0,
|
|
7589
|
-
/* @__PURE__ */ (0,
|
|
7590
|
-
/* @__PURE__ */ (0,
|
|
7591
|
-
/* @__PURE__ */ (0,
|
|
7592
|
-
/* @__PURE__ */ (0,
|
|
7593
|
-
description != null && /* @__PURE__ */ (0,
|
|
7594
|
-
meta != null && /* @__PURE__ */ (0,
|
|
7804
|
+
children: showDetails ? /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
7805
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "uix-pipeline__marker", "aria-hidden": "true", children: marker }),
|
|
7806
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "uix-pipeline__content", children: [
|
|
7807
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "uix-pipeline__eyebrow", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "uix-pipeline__state", children: resolvedStateLabel }) }),
|
|
7808
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "uix-pipeline__title", children: label }),
|
|
7809
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "uix-pipeline__description", children: description }),
|
|
7810
|
+
meta != null && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "uix-pipeline__meta", children: meta })
|
|
7595
7811
|
] })
|
|
7596
7812
|
] }) : label
|
|
7597
7813
|
}
|
|
@@ -7599,9 +7815,9 @@ function PipelineStage({
|
|
|
7599
7815
|
}
|
|
7600
7816
|
|
|
7601
7817
|
// src/components/Flow.tsx
|
|
7602
|
-
var
|
|
7818
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
7603
7819
|
function Flow({ variant = "linear", panel = false, children, className, role = "group", ...props }) {
|
|
7604
|
-
return /* @__PURE__ */ (0,
|
|
7820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
7605
7821
|
"div",
|
|
7606
7822
|
{
|
|
7607
7823
|
className: cx("uix-flow", `uix-flow--${variant}`, panel && "uix-flow--panel", className),
|
|
@@ -7631,33 +7847,33 @@ function FlowNode({
|
|
|
7631
7847
|
...props
|
|
7632
7848
|
}) {
|
|
7633
7849
|
const resolvedStateLabel = stateLabel ?? FLOW_STATE_LABELS[state];
|
|
7634
|
-
return /* @__PURE__ */ (0,
|
|
7635
|
-
icon != null && /* @__PURE__ */ (0,
|
|
7636
|
-
/* @__PURE__ */ (0,
|
|
7637
|
-
eyebrow != null && /* @__PURE__ */ (0,
|
|
7638
|
-
/* @__PURE__ */ (0,
|
|
7639
|
-
meta != null && /* @__PURE__ */ (0,
|
|
7640
|
-
/* @__PURE__ */ (0,
|
|
7850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: cx("uix-node", `uix-node--${state}`, icon == null && "uix-node--no-icon", wide && "uix-node--wide", className), ...props, children: [
|
|
7851
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "uix-node__icon", "aria-hidden": "true", children: icon }),
|
|
7852
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "uix-node__body", children: [
|
|
7853
|
+
eyebrow != null && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "uix-node__eyebrow", children: eyebrow }),
|
|
7854
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "uix-node__title", children: title }),
|
|
7855
|
+
meta != null && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "uix-node__meta", children: meta }),
|
|
7856
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "uix-node__status", children: resolvedStateLabel })
|
|
7641
7857
|
] }),
|
|
7642
|
-
footer != null && /* @__PURE__ */ (0,
|
|
7858
|
+
footer != null && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "uix-node__footer", children: footer })
|
|
7643
7859
|
] });
|
|
7644
7860
|
}
|
|
7645
7861
|
|
|
7646
7862
|
// src/components/Prose.tsx
|
|
7647
|
-
var
|
|
7863
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
7648
7864
|
function Prose({ children, className, ...props }) {
|
|
7649
|
-
return /* @__PURE__ */ (0,
|
|
7865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: cx("uix-prose", className), ...props, children });
|
|
7650
7866
|
}
|
|
7651
7867
|
function Note({ tone, icon, children, className, ...props }) {
|
|
7652
|
-
return /* @__PURE__ */ (0,
|
|
7653
|
-
icon != null && /* @__PURE__ */ (0,
|
|
7654
|
-
/* @__PURE__ */ (0,
|
|
7868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: cx("uix-note", tone && tone !== "neutral" && `uix-note--${tone}`, className), ...props, children: [
|
|
7869
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "uix-note__icon", children: icon }),
|
|
7870
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "uix-note__body", children })
|
|
7655
7871
|
] });
|
|
7656
7872
|
}
|
|
7657
7873
|
|
|
7658
7874
|
// src/components/Menu.tsx
|
|
7659
7875
|
var import_react54 = require("react");
|
|
7660
|
-
var
|
|
7876
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
7661
7877
|
var MenuContext = (0, import_react54.createContext)(null);
|
|
7662
7878
|
var MenuRadioContext = (0, import_react54.createContext)(null);
|
|
7663
7879
|
var ITEM = '[role^="menuitem"]:not([aria-disabled="true"])';
|
|
@@ -7779,9 +7995,9 @@ function Menu({ trigger, children, open: controlledOpen, defaultOpen = false, on
|
|
|
7779
7995
|
}
|
|
7780
7996
|
}
|
|
7781
7997
|
}) : trigger;
|
|
7782
|
-
return /* @__PURE__ */ (0,
|
|
7998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(MenuContext.Provider, { value: { close }, children: [
|
|
7783
7999
|
triggerElement,
|
|
7784
|
-
/* @__PURE__ */ (0,
|
|
8000
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7785
8001
|
Popover,
|
|
7786
8002
|
{
|
|
7787
8003
|
id: menuId,
|
|
@@ -7803,15 +8019,15 @@ function MenuItem({ children, onSelect, href, renderLink, icon, shortcut, tone =
|
|
|
7803
8019
|
const menu = (0, import_react54.useContext)(MenuContext);
|
|
7804
8020
|
const classes = cx("uix-menu__item", tone === "danger" && "uix-menu__item--danger", className);
|
|
7805
8021
|
const attributes = itemAttributes(rest);
|
|
7806
|
-
const body = /* @__PURE__ */ (0,
|
|
7807
|
-
icon != null && /* @__PURE__ */ (0,
|
|
7808
|
-
/* @__PURE__ */ (0,
|
|
7809
|
-
shortcut != null && /* @__PURE__ */ (0,
|
|
8022
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
8023
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "uix-menu__icon", "aria-hidden": "true", children: icon }),
|
|
8024
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "uix-menu__text", children }),
|
|
8025
|
+
shortcut != null && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "uix-menu__shortcut", children: shortcut })
|
|
7810
8026
|
] });
|
|
7811
8027
|
if (href != null && !disabled) {
|
|
7812
|
-
return /* @__PURE__ */ (0,
|
|
8028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_jsx_runtime79.Fragment, { children: renderUixLink(renderLink, { ...attributes, href, role: "menuitem", tabIndex: -1, className: classes, onClick: () => menu?.close(false), children: body }) });
|
|
7813
8029
|
}
|
|
7814
|
-
return /* @__PURE__ */ (0,
|
|
8030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7815
8031
|
"button",
|
|
7816
8032
|
{
|
|
7817
8033
|
...attributes,
|
|
@@ -7842,7 +8058,7 @@ function CheckableItem({
|
|
|
7842
8058
|
...rest
|
|
7843
8059
|
}) {
|
|
7844
8060
|
const menu = (0, import_react54.useContext)(MenuContext);
|
|
7845
|
-
return /* @__PURE__ */ (0,
|
|
8061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
7846
8062
|
"button",
|
|
7847
8063
|
{
|
|
7848
8064
|
...itemAttributes(rest),
|
|
@@ -7866,24 +8082,24 @@ function CheckableItem({
|
|
|
7866
8082
|
if (closeOnSelect) menu?.close(true);
|
|
7867
8083
|
},
|
|
7868
8084
|
children: [
|
|
7869
|
-
/* @__PURE__ */ (0,
|
|
7870
|
-
icon != null && /* @__PURE__ */ (0,
|
|
7871
|
-
/* @__PURE__ */ (0,
|
|
7872
|
-
shortcut != null && /* @__PURE__ */ (0,
|
|
8085
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "uix-menu__check", "aria-hidden": "true", children: checked && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(CheckIcon, {}) }),
|
|
8086
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "uix-menu__icon", "aria-hidden": "true", children: icon }),
|
|
8087
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "uix-menu__text", children }),
|
|
8088
|
+
shortcut != null && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "uix-menu__shortcut", children: shortcut })
|
|
7873
8089
|
]
|
|
7874
8090
|
}
|
|
7875
8091
|
);
|
|
7876
8092
|
}
|
|
7877
8093
|
function MenuRadioGroup({ value, onValueChange, label, "aria-label": ariaLabel, children }) {
|
|
7878
8094
|
const id = (0, import_react54.useId)();
|
|
7879
|
-
return /* @__PURE__ */ (0,
|
|
7880
|
-
label != null && /* @__PURE__ */ (0,
|
|
8095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(MenuRadioContext.Provider, { value: { value, onValueChange }, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { role: "group", "aria-labelledby": label != null ? id : void 0, "aria-label": label != null ? void 0 : ariaLabel, children: [
|
|
8096
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { id, className: "uix-menu__label", children: label }),
|
|
7881
8097
|
children
|
|
7882
8098
|
] }) });
|
|
7883
8099
|
}
|
|
7884
8100
|
function MenuItemRadio({ value, checked, onSelect, closeOnSelect = true, ...rest }) {
|
|
7885
8101
|
const group = (0, import_react54.useContext)(MenuRadioContext);
|
|
7886
|
-
return /* @__PURE__ */ (0,
|
|
8102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7887
8103
|
CheckableItem,
|
|
7888
8104
|
{
|
|
7889
8105
|
...rest,
|
|
@@ -7898,7 +8114,7 @@ function MenuItemRadio({ value, checked, onSelect, closeOnSelect = true, ...rest
|
|
|
7898
8114
|
);
|
|
7899
8115
|
}
|
|
7900
8116
|
function MenuItemCheckbox({ checked, onCheckedChange, closeOnSelect = false, ...rest }) {
|
|
7901
|
-
return /* @__PURE__ */ (0,
|
|
8117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7902
8118
|
CheckableItem,
|
|
7903
8119
|
{
|
|
7904
8120
|
...rest,
|
|
@@ -7911,18 +8127,18 @@ function MenuItemCheckbox({ checked, onCheckedChange, closeOnSelect = false, ...
|
|
|
7911
8127
|
}
|
|
7912
8128
|
function MenuGroup({ label, children }) {
|
|
7913
8129
|
const id = (0, import_react54.useId)();
|
|
7914
|
-
return /* @__PURE__ */ (0,
|
|
7915
|
-
/* @__PURE__ */ (0,
|
|
8130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { role: "group", "aria-labelledby": id, children: [
|
|
8131
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { id, className: "uix-menu__label", children: label }),
|
|
7916
8132
|
children
|
|
7917
8133
|
] });
|
|
7918
8134
|
}
|
|
7919
8135
|
function MenuSeparator() {
|
|
7920
|
-
return /* @__PURE__ */ (0,
|
|
8136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { role: "separator", className: "uix-menu__sep" });
|
|
7921
8137
|
}
|
|
7922
8138
|
|
|
7923
8139
|
// src/components/CommandPalette.tsx
|
|
7924
8140
|
var import_react55 = require("react");
|
|
7925
|
-
var
|
|
8141
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
7926
8142
|
var CmdkContext = (0, import_react55.createContext)(null);
|
|
7927
8143
|
function CommandPalette({ inputProps, children, inputLabel: inputLabelProp, resultsLabel, className, ...props }) {
|
|
7928
8144
|
const uixLabels = useUixLabels();
|
|
@@ -7948,8 +8164,8 @@ function CommandPalette({ inputProps, children, inputLabel: inputLabelProp, resu
|
|
|
7948
8164
|
return () => clearTimeout(t);
|
|
7949
8165
|
}, [count2]);
|
|
7950
8166
|
const ctx = (0, import_react55.useMemo)(() => ({ listId, setActive, registerItem }), [listId, setActive, registerItem]);
|
|
7951
|
-
return /* @__PURE__ */ (0,
|
|
7952
|
-
/* @__PURE__ */ (0,
|
|
8167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(CmdkContext.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: cx("uix-cmdk", className), ...props, children: [
|
|
8168
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7953
8169
|
"input",
|
|
7954
8170
|
{
|
|
7955
8171
|
className: "uix-cmdk__input",
|
|
@@ -7962,14 +8178,14 @@ function CommandPalette({ inputProps, children, inputLabel: inputLabelProp, resu
|
|
|
7962
8178
|
...inputProps
|
|
7963
8179
|
}
|
|
7964
8180
|
),
|
|
7965
|
-
/* @__PURE__ */ (0,
|
|
7966
|
-
/* @__PURE__ */ (0,
|
|
8181
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "uix-cmdk__list", role: "listbox", id: listId, children }),
|
|
8182
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "uix-visually-hidden", role: "status", children: announced })
|
|
7967
8183
|
] }) });
|
|
7968
8184
|
}
|
|
7969
8185
|
function CommandGroup({ label, children }) {
|
|
7970
8186
|
const labelId = (0, import_react55.useId)();
|
|
7971
|
-
return /* @__PURE__ */ (0,
|
|
7972
|
-
label != null && /* @__PURE__ */ (0,
|
|
8187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { role: "group", "aria-labelledby": label != null ? labelId : void 0, children: [
|
|
8188
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "uix-cmdk__group", id: labelId, children: label }),
|
|
7973
8189
|
children
|
|
7974
8190
|
] });
|
|
7975
8191
|
}
|
|
@@ -7983,7 +8199,7 @@ function CommandItem({ icon, shortcut, active, children, className, id, ...props
|
|
|
7983
8199
|
ctx.setActive(itemId, true);
|
|
7984
8200
|
return () => ctx.setActive(itemId, false);
|
|
7985
8201
|
}, [ctx, itemId, active]);
|
|
7986
|
-
return /* @__PURE__ */ (0,
|
|
8202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
7987
8203
|
"div",
|
|
7988
8204
|
{
|
|
7989
8205
|
className: cx("uix-cmdk__item", className),
|
|
@@ -7994,7 +8210,7 @@ function CommandItem({ icon, shortcut, active, children, className, id, ...props
|
|
|
7994
8210
|
...props,
|
|
7995
8211
|
children: [
|
|
7996
8212
|
icon,
|
|
7997
|
-
/* @__PURE__ */ (0,
|
|
8213
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { children }),
|
|
7998
8214
|
shortcut
|
|
7999
8215
|
]
|
|
8000
8216
|
}
|
|
@@ -8003,9 +8219,9 @@ function CommandItem({ icon, shortcut, active, children, className, id, ...props
|
|
|
8003
8219
|
|
|
8004
8220
|
// src/components/Inbox.tsx
|
|
8005
8221
|
var import_react56 = require("react");
|
|
8006
|
-
var
|
|
8222
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
8007
8223
|
function Inbox({ view, children, className, ...props }) {
|
|
8008
|
-
return /* @__PURE__ */ (0,
|
|
8224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: cx("uix-inbox", className), "data-view": view, ...props, children });
|
|
8009
8225
|
}
|
|
8010
8226
|
var InboxListCtx = (0, import_react56.createContext)({});
|
|
8011
8227
|
function InboxList({ children, listLabel = "Inbox", className, ...props }) {
|
|
@@ -8046,7 +8262,7 @@ function InboxList({ children, listLabel = "Inbox", className, ...props }) {
|
|
|
8046
8262
|
setActiveId(el.id);
|
|
8047
8263
|
el.scrollIntoView({ block: "nearest" });
|
|
8048
8264
|
};
|
|
8049
|
-
return /* @__PURE__ */ (0,
|
|
8265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(InboxListCtx.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8050
8266
|
"div",
|
|
8051
8267
|
{
|
|
8052
8268
|
ref: listRef,
|
|
@@ -8075,7 +8291,7 @@ function InboxItem({
|
|
|
8075
8291
|
const autoId = (0, import_react56.useId)();
|
|
8076
8292
|
const itemId = id ?? autoId;
|
|
8077
8293
|
const { activeId } = (0, import_react56.useContext)(InboxListCtx);
|
|
8078
|
-
return /* @__PURE__ */ (0,
|
|
8294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
8079
8295
|
"div",
|
|
8080
8296
|
{
|
|
8081
8297
|
role: "option",
|
|
@@ -8087,35 +8303,35 @@ function InboxItem({
|
|
|
8087
8303
|
...props,
|
|
8088
8304
|
children: [
|
|
8089
8305
|
leading,
|
|
8090
|
-
subject != null && /* @__PURE__ */ (0,
|
|
8091
|
-
preview != null && /* @__PURE__ */ (0,
|
|
8306
|
+
subject != null && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "uix-inbox__subject", children: subject }),
|
|
8307
|
+
preview != null && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "uix-inbox__preview", children: preview }),
|
|
8092
8308
|
children
|
|
8093
8309
|
]
|
|
8094
8310
|
}
|
|
8095
8311
|
);
|
|
8096
8312
|
}
|
|
8097
8313
|
function InboxDetail({ children, className, ...props }) {
|
|
8098
|
-
return /* @__PURE__ */ (0,
|
|
8314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: cx("uix-inbox__detail", className), ...props, children });
|
|
8099
8315
|
}
|
|
8100
8316
|
|
|
8101
8317
|
// src/components/Kanban.tsx
|
|
8102
8318
|
var import_react57 = require("react");
|
|
8103
|
-
var
|
|
8319
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
8104
8320
|
function Kanban({ announcement, children, className, ...props }) {
|
|
8105
|
-
return /* @__PURE__ */ (0,
|
|
8106
|
-
announcement != null && /* @__PURE__ */ (0,
|
|
8321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: cx("uix-kanban", className), ...props, children: [
|
|
8322
|
+
announcement != null && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { role: "status", className: "uix-visually-hidden", children: announcement }),
|
|
8107
8323
|
children
|
|
8108
8324
|
] });
|
|
8109
8325
|
}
|
|
8110
8326
|
function KanbanColumn({ title, count: count2, children, className, ...props }) {
|
|
8111
8327
|
const headId = (0, import_react57.useId)();
|
|
8112
8328
|
const hasHead = title != null || count2 != null;
|
|
8113
|
-
return /* @__PURE__ */ (0,
|
|
8114
|
-
hasHead && /* @__PURE__ */ (0,
|
|
8329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: cx("uix-kanban__col", className), ...props, children: [
|
|
8330
|
+
hasHead && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "uix-kanban__head", id: headId, children: [
|
|
8115
8331
|
title,
|
|
8116
|
-
count2 != null && /* @__PURE__ */ (0,
|
|
8332
|
+
count2 != null && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "uix-kanban__count", children: count2 })
|
|
8117
8333
|
] }),
|
|
8118
|
-
/* @__PURE__ */ (0,
|
|
8334
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "uix-kanban__body", role: "list", "aria-labelledby": hasHead ? headId : void 0, children })
|
|
8119
8335
|
] });
|
|
8120
8336
|
}
|
|
8121
8337
|
var MOVE_KEYS = {
|
|
@@ -8134,7 +8350,7 @@ function KanbanCard({ title, meta, children, className, onMove, onKeyDown, ...pr
|
|
|
8134
8350
|
onMove(dir);
|
|
8135
8351
|
}
|
|
8136
8352
|
};
|
|
8137
|
-
return /* @__PURE__ */ (0,
|
|
8353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
8138
8354
|
"div",
|
|
8139
8355
|
{
|
|
8140
8356
|
role: "listitem",
|
|
@@ -8143,8 +8359,8 @@ function KanbanCard({ title, meta, children, className, onMove, onKeyDown, ...pr
|
|
|
8143
8359
|
onKeyDown: handleKeyDown,
|
|
8144
8360
|
...props,
|
|
8145
8361
|
children: [
|
|
8146
|
-
title && /* @__PURE__ */ (0,
|
|
8147
|
-
meta && /* @__PURE__ */ (0,
|
|
8362
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "uix-kanban__card-title", children: title }),
|
|
8363
|
+
meta && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "uix-kanban__card-meta", children: meta }),
|
|
8148
8364
|
children
|
|
8149
8365
|
]
|
|
8150
8366
|
}
|
|
@@ -8210,8 +8426,8 @@ function treeNav(flat, currentId, key) {
|
|
|
8210
8426
|
}
|
|
8211
8427
|
|
|
8212
8428
|
// src/components/Tree.tsx
|
|
8213
|
-
var
|
|
8214
|
-
var ChevronIcon2 = () => /* @__PURE__ */ (0,
|
|
8429
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
8430
|
+
var ChevronIcon2 = () => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("svg", { viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("path", { d: "M2 4l4 4 4-4" }) });
|
|
8215
8431
|
var DEFAULT_TREE_LABELS = {
|
|
8216
8432
|
loading: "Loading\u2026",
|
|
8217
8433
|
error: "Could not load.",
|
|
@@ -8220,11 +8436,11 @@ var DEFAULT_TREE_LABELS = {
|
|
|
8220
8436
|
var LOADING = "::uix-loading";
|
|
8221
8437
|
var FAILED = "::uix-error";
|
|
8222
8438
|
var syntheticOf = (id) => id.endsWith(LOADING) ? { parent: id.slice(0, -LOADING.length), kind: "loading" } : id.endsWith(FAILED) ? { parent: id.slice(0, -FAILED.length), kind: "error" } : null;
|
|
8223
|
-
var Ring = () => /* @__PURE__ */ (0,
|
|
8439
|
+
var Ring = () => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "uix-spinner uix-spinner--sm", "aria-hidden": "true" });
|
|
8224
8440
|
function TreeNode({ node, expanded, selected, selectable, tabbableId, onToggle, onSelect, onFocusNode, level = 1, rowToggles = true, busy }) {
|
|
8225
8441
|
const hasChildren = Array.isArray(node.children) && node.children.length > 0;
|
|
8226
8442
|
const isExpanded = expanded.has(node.id);
|
|
8227
|
-
return /* @__PURE__ */ (0,
|
|
8443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
8228
8444
|
"li",
|
|
8229
8445
|
{
|
|
8230
8446
|
role: "treeitem",
|
|
@@ -8245,12 +8461,12 @@ function TreeNode({ node, expanded, selected, selectable, tabbableId, onToggle,
|
|
|
8245
8461
|
onFocusNode(node.id);
|
|
8246
8462
|
},
|
|
8247
8463
|
children: [
|
|
8248
|
-
/* @__PURE__ */ (0,
|
|
8464
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("span", { className: "uix-tree__row", children: [
|
|
8249
8465
|
hasChildren ? (
|
|
8250
8466
|
// TENSOR RX-125 (UIX-09): the chevron is its own pointer target, so a
|
|
8251
8467
|
// branch can be expanded without selecting it. Keyboard users toggle with
|
|
8252
8468
|
// the arrow keys on the treeitem, so it stays out of the tab order.
|
|
8253
|
-
/* @__PURE__ */ (0,
|
|
8469
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8254
8470
|
"button",
|
|
8255
8471
|
{
|
|
8256
8472
|
type: "button",
|
|
@@ -8262,14 +8478,14 @@ function TreeNode({ node, expanded, selected, selectable, tabbableId, onToggle,
|
|
|
8262
8478
|
onToggle(node.id);
|
|
8263
8479
|
onFocusNode(node.id);
|
|
8264
8480
|
},
|
|
8265
|
-
children: /* @__PURE__ */ (0,
|
|
8481
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ChevronIcon2, {})
|
|
8266
8482
|
}
|
|
8267
8483
|
)
|
|
8268
|
-
) : /* @__PURE__ */ (0,
|
|
8269
|
-
node.icon && /* @__PURE__ */ (0,
|
|
8270
|
-
/* @__PURE__ */ (0,
|
|
8484
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "uix-tree__toggle" }),
|
|
8485
|
+
node.icon && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { "aria-hidden": "true", children: node.icon }),
|
|
8486
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "uix-tree__label", children: node.label })
|
|
8271
8487
|
] }),
|
|
8272
|
-
hasChildren && isExpanded && /* @__PURE__ */ (0,
|
|
8488
|
+
hasChildren && isExpanded && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("ul", { role: "group", className: "uix-tree__group", children: node.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8273
8489
|
TreeNode,
|
|
8274
8490
|
{
|
|
8275
8491
|
node: child,
|
|
@@ -8325,12 +8541,12 @@ function Tree({
|
|
|
8325
8541
|
const row = (parent, kind) => ({
|
|
8326
8542
|
id: parent.id + (kind === "error" ? FAILED : LOADING),
|
|
8327
8543
|
typeaheadLabel: "",
|
|
8328
|
-
label: kind === "error" ? /* @__PURE__ */ (0,
|
|
8544
|
+
label: kind === "error" ? /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("span", { className: "uix-tree__status uix-tree__status--error", children: [
|
|
8329
8545
|
labels.error,
|
|
8330
8546
|
" ",
|
|
8331
|
-
/* @__PURE__ */ (0,
|
|
8332
|
-
] }) : /* @__PURE__ */ (0,
|
|
8333
|
-
/* @__PURE__ */ (0,
|
|
8547
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "uix-tree__retry", children: labels.retry })
|
|
8548
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("span", { className: "uix-tree__status", children: [
|
|
8549
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Ring, {}),
|
|
8334
8550
|
labels.loading
|
|
8335
8551
|
] })
|
|
8336
8552
|
});
|
|
@@ -8430,7 +8646,7 @@ function Tree({
|
|
|
8430
8646
|
const useVirtual = virtualize ?? shouldVirtualize(flat.length);
|
|
8431
8647
|
const tabbableId = focusedId ?? selected ?? nodes[0]?.id;
|
|
8432
8648
|
if (useVirtual) {
|
|
8433
|
-
return /* @__PURE__ */ (0,
|
|
8649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8434
8650
|
VirtualTreeView,
|
|
8435
8651
|
{
|
|
8436
8652
|
flat,
|
|
@@ -8510,7 +8726,7 @@ function Tree({
|
|
|
8510
8726
|
break;
|
|
8511
8727
|
}
|
|
8512
8728
|
};
|
|
8513
|
-
return /* @__PURE__ */ (0,
|
|
8729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("ul", { ref: rootRef, className: cx("uix-tree", className), role: "tree", "data-uix-tree": treeId, onKeyDown, ...props, children: nodes.map((node) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8514
8730
|
TreeNode,
|
|
8515
8731
|
{
|
|
8516
8732
|
node,
|
|
@@ -8595,7 +8811,7 @@ function VirtualTreeView({
|
|
|
8595
8811
|
}
|
|
8596
8812
|
if (act.focusId !== void 0) moveTo(act.focusId);
|
|
8597
8813
|
};
|
|
8598
|
-
return /* @__PURE__ */ (0,
|
|
8814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
8599
8815
|
"ul",
|
|
8600
8816
|
{
|
|
8601
8817
|
ref: scrollRef,
|
|
@@ -8614,13 +8830,13 @@ function VirtualTreeView({
|
|
|
8614
8830
|
},
|
|
8615
8831
|
...props,
|
|
8616
8832
|
children: [
|
|
8617
|
-
win.padTop > 0 && /* @__PURE__ */ (0,
|
|
8833
|
+
win.padTop > 0 && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("li", { role: "presentation", "aria-hidden": "true", style: { height: win.padTop } }),
|
|
8618
8834
|
rows.map((f, i) => {
|
|
8619
8835
|
const rowStyle = {
|
|
8620
8836
|
height: rowHeight,
|
|
8621
8837
|
paddingLeft: `calc(${Math.min(f.level - 1, 4)} * var(--uix-space-5) + ${Math.max(0, f.level - 5)} * var(--uix-space-1))`
|
|
8622
8838
|
};
|
|
8623
|
-
return /* @__PURE__ */ (0,
|
|
8839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8624
8840
|
"li",
|
|
8625
8841
|
{
|
|
8626
8842
|
role: "treeitem",
|
|
@@ -8642,12 +8858,12 @@ function VirtualTreeView({
|
|
|
8642
8858
|
onSelect?.(f.node.id);
|
|
8643
8859
|
setFocusedId(f.node.id);
|
|
8644
8860
|
},
|
|
8645
|
-
children: /* @__PURE__ */ (0,
|
|
8861
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("span", { className: "uix-tree__row", style: rowStyle, children: [
|
|
8646
8862
|
f.hasChildren ? (
|
|
8647
8863
|
// TENSOR RX-125 (UIX-09): the chevron is its own pointer target, so a
|
|
8648
8864
|
// branch can be expanded without selecting it. Keyboard users toggle with
|
|
8649
8865
|
// the arrow keys on the treeitem, so it stays out of the tab order.
|
|
8650
|
-
/* @__PURE__ */ (0,
|
|
8866
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8651
8867
|
"button",
|
|
8652
8868
|
{
|
|
8653
8869
|
type: "button",
|
|
@@ -8659,25 +8875,25 @@ function VirtualTreeView({
|
|
|
8659
8875
|
onToggle(f.node.id);
|
|
8660
8876
|
setFocusedId(f.node.id);
|
|
8661
8877
|
},
|
|
8662
|
-
children: /* @__PURE__ */ (0,
|
|
8878
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ChevronIcon2, {})
|
|
8663
8879
|
}
|
|
8664
8880
|
)
|
|
8665
|
-
) : /* @__PURE__ */ (0,
|
|
8666
|
-
f.node.icon && /* @__PURE__ */ (0,
|
|
8667
|
-
/* @__PURE__ */ (0,
|
|
8881
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "uix-tree__toggle" }),
|
|
8882
|
+
f.node.icon && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { "aria-hidden": "true", children: f.node.icon }),
|
|
8883
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "uix-tree__label", children: f.node.label })
|
|
8668
8884
|
] })
|
|
8669
8885
|
},
|
|
8670
8886
|
f.node.id
|
|
8671
8887
|
);
|
|
8672
8888
|
}),
|
|
8673
|
-
win.padBottom > 0 && /* @__PURE__ */ (0,
|
|
8889
|
+
win.padBottom > 0 && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("li", { role: "presentation", "aria-hidden": "true", style: { height: win.padBottom } })
|
|
8674
8890
|
]
|
|
8675
8891
|
}
|
|
8676
8892
|
);
|
|
8677
8893
|
}
|
|
8678
8894
|
|
|
8679
8895
|
// src/components/EditorialHome.tsx
|
|
8680
|
-
var
|
|
8896
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
8681
8897
|
function PageIntro({
|
|
8682
8898
|
kicker,
|
|
8683
8899
|
title,
|
|
@@ -8690,43 +8906,43 @@ function PageIntro({
|
|
|
8690
8906
|
children,
|
|
8691
8907
|
...props
|
|
8692
8908
|
}) {
|
|
8693
|
-
return /* @__PURE__ */ (0,
|
|
8694
|
-
/* @__PURE__ */ (0,
|
|
8695
|
-
kicker != null && /* @__PURE__ */ (0,
|
|
8696
|
-
/* @__PURE__ */ (0,
|
|
8697
|
-
lede != null && /* @__PURE__ */ (0,
|
|
8909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("section", { className: cx("uix-page-intro", className), ...props, children: [
|
|
8910
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { children: [
|
|
8911
|
+
kicker != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "uix-page-kicker", children: kicker }),
|
|
8912
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("h1", { className: "uix-page-title", children: title }),
|
|
8913
|
+
lede != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "uix-page-lede", children: lede })
|
|
8698
8914
|
] }),
|
|
8699
|
-
search != null && /* @__PURE__ */ (0,
|
|
8700
|
-
searchLabel != null && /* @__PURE__ */ (0,
|
|
8915
|
+
search != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { children: [
|
|
8916
|
+
searchLabel != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "uix-intro-search__label", children: searchLabel }),
|
|
8701
8917
|
search
|
|
8702
8918
|
] }),
|
|
8703
|
-
shortcuts != null && /* @__PURE__ */ (0,
|
|
8919
|
+
shortcuts != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "uix-shortcut-grid", "aria-label": shortcutsLabel, children: shortcuts }),
|
|
8704
8920
|
children
|
|
8705
8921
|
] });
|
|
8706
8922
|
}
|
|
8707
8923
|
function SectionHead({ title, titleId, help, helpLabel, action, className, ...props }) {
|
|
8708
|
-
const heading = /* @__PURE__ */ (0,
|
|
8709
|
-
return /* @__PURE__ */ (0,
|
|
8710
|
-
hasHelp(help) ? /* @__PURE__ */ (0,
|
|
8924
|
+
const heading = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("h2", { className: "uix-section-title", id: titleId, children: title });
|
|
8925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: cx("uix-section-head", className), ...props, children: [
|
|
8926
|
+
hasHelp(help) ? /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "uix-section-head__title-row", children: [
|
|
8711
8927
|
heading,
|
|
8712
|
-
/* @__PURE__ */ (0,
|
|
8928
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(InfoTip, { content: help, label: helpLabel ?? helpLabelFor(title) })
|
|
8713
8929
|
] }) : heading,
|
|
8714
8930
|
action
|
|
8715
8931
|
] });
|
|
8716
8932
|
}
|
|
8717
8933
|
function NoticeQueue({ icon, title, summary, meta, position, actions, className, ...props }) {
|
|
8718
|
-
return /* @__PURE__ */ (0,
|
|
8934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("section", { className: cx("uix-notice", className), ...props, children: [
|
|
8719
8935
|
icon,
|
|
8720
|
-
/* @__PURE__ */ (0,
|
|
8721
|
-
/* @__PURE__ */ (0,
|
|
8722
|
-
title != null && /* @__PURE__ */ (0,
|
|
8936
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "uix-notice__content", "aria-live": "polite", children: [
|
|
8937
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("p", { className: "uix-notice__copy", children: [
|
|
8938
|
+
title != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("strong", { children: title }),
|
|
8723
8939
|
title != null && summary != null && " ",
|
|
8724
8940
|
summary
|
|
8725
8941
|
] }),
|
|
8726
|
-
meta != null && /* @__PURE__ */ (0,
|
|
8942
|
+
meta != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "uix-notice__meta", children: meta })
|
|
8727
8943
|
] }),
|
|
8728
|
-
(position != null || actions != null) && /* @__PURE__ */ (0,
|
|
8729
|
-
position != null && /* @__PURE__ */ (0,
|
|
8944
|
+
(position != null || actions != null) && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "uix-notice__actions", children: [
|
|
8945
|
+
position != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "uix-notice__position", children: position }),
|
|
8730
8946
|
actions
|
|
8731
8947
|
] })
|
|
8732
8948
|
] });
|
|
@@ -8744,8 +8960,8 @@ function FeaturedStage({
|
|
|
8744
8960
|
className,
|
|
8745
8961
|
...props
|
|
8746
8962
|
}) {
|
|
8747
|
-
return /* @__PURE__ */ (0,
|
|
8748
|
-
/* @__PURE__ */ (0,
|
|
8963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("article", { className: cx("uix-featured__stage", className), ...props, children: [
|
|
8964
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
8749
8965
|
"div",
|
|
8750
8966
|
{
|
|
8751
8967
|
className: "uix-featured__visual",
|
|
@@ -8755,32 +8971,32 @@ function FeaturedStage({
|
|
|
8755
8971
|
children: visual
|
|
8756
8972
|
}
|
|
8757
8973
|
),
|
|
8758
|
-
/* @__PURE__ */ (0,
|
|
8759
|
-
(eyebrow != null || ordinal != null) && /* @__PURE__ */ (0,
|
|
8760
|
-
ordinal != null && /* @__PURE__ */ (0,
|
|
8974
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "uix-featured__content", "aria-live": "polite", children: [
|
|
8975
|
+
(eyebrow != null || ordinal != null) && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("p", { className: "uix-featured__eyebrow", children: [
|
|
8976
|
+
ordinal != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "uix-featured__now", children: ordinal }),
|
|
8761
8977
|
eyebrow
|
|
8762
8978
|
] }),
|
|
8763
|
-
/* @__PURE__ */ (0,
|
|
8764
|
-
description != null && /* @__PURE__ */ (0,
|
|
8765
|
-
meta != null && /* @__PURE__ */ (0,
|
|
8979
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("h2", { className: "uix-featured__title", id: titleId, children: title }),
|
|
8980
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "uix-featured__description", children: description }),
|
|
8981
|
+
meta != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "uix-featured__meta", children: meta }),
|
|
8766
8982
|
action
|
|
8767
8983
|
] })
|
|
8768
8984
|
] });
|
|
8769
8985
|
}
|
|
8770
8986
|
function FeaturedRundown({ eyebrow, title, titleId, meta, children, className, ...props }) {
|
|
8771
|
-
return /* @__PURE__ */ (0,
|
|
8772
|
-
/* @__PURE__ */ (0,
|
|
8773
|
-
/* @__PURE__ */ (0,
|
|
8774
|
-
eyebrow != null && /* @__PURE__ */ (0,
|
|
8775
|
-
/* @__PURE__ */ (0,
|
|
8987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("aside", { className: cx("uix-rundown", className), ...props, children: [
|
|
8988
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "uix-rundown__head", children: [
|
|
8989
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { children: [
|
|
8990
|
+
eyebrow != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "uix-rundown__eyebrow", children: eyebrow }),
|
|
8991
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("h2", { className: "uix-rundown__title", id: titleId, children: title })
|
|
8776
8992
|
] }),
|
|
8777
8993
|
meta
|
|
8778
8994
|
] }),
|
|
8779
|
-
/* @__PURE__ */ (0,
|
|
8995
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "uix-rundown__items", children })
|
|
8780
8996
|
] });
|
|
8781
8997
|
}
|
|
8782
8998
|
function FeaturedRundownItem({ number, topic, title, selected = false, className, ...props }) {
|
|
8783
|
-
return /* @__PURE__ */ (0,
|
|
8999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
8784
9000
|
"button",
|
|
8785
9001
|
{
|
|
8786
9002
|
type: "button",
|
|
@@ -8789,63 +9005,63 @@ function FeaturedRundownItem({ number, topic, title, selected = false, className
|
|
|
8789
9005
|
"data-selected": selected ? "true" : "false",
|
|
8790
9006
|
...props,
|
|
8791
9007
|
children: [
|
|
8792
|
-
number != null && /* @__PURE__ */ (0,
|
|
8793
|
-
/* @__PURE__ */ (0,
|
|
8794
|
-
topic != null && /* @__PURE__ */ (0,
|
|
8795
|
-
/* @__PURE__ */ (0,
|
|
9008
|
+
number != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "uix-rundown__number", children: number }),
|
|
9009
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { children: [
|
|
9010
|
+
topic != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "uix-rundown__topic", children: topic }),
|
|
9011
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "uix-rundown__item-title", children: title })
|
|
8796
9012
|
] })
|
|
8797
9013
|
]
|
|
8798
9014
|
}
|
|
8799
9015
|
);
|
|
8800
9016
|
}
|
|
8801
9017
|
function NewsLead({ meta, title, summary, className, ...props }) {
|
|
8802
|
-
return /* @__PURE__ */ (0,
|
|
8803
|
-
meta != null && /* @__PURE__ */ (0,
|
|
8804
|
-
/* @__PURE__ */ (0,
|
|
8805
|
-
summary != null && /* @__PURE__ */ (0,
|
|
9018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("article", { className: cx("uix-news-lead", className), ...props, children: [
|
|
9019
|
+
meta != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "uix-news-lead__meta", children: meta }),
|
|
9020
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("h3", { className: "uix-news-lead__title", children: title }),
|
|
9021
|
+
summary != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "uix-news-lead__summary", children: summary })
|
|
8806
9022
|
] });
|
|
8807
9023
|
}
|
|
8808
9024
|
function ContentList({ children, className, ...props }) {
|
|
8809
|
-
return /* @__PURE__ */ (0,
|
|
9025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("ul", { className: cx("uix-content-list", className), ...props, children });
|
|
8810
9026
|
}
|
|
8811
9027
|
function ContentListItem({ title, meta, trailing, className, ...props }) {
|
|
8812
|
-
return /* @__PURE__ */ (0,
|
|
8813
|
-
/* @__PURE__ */ (0,
|
|
8814
|
-
/* @__PURE__ */ (0,
|
|
8815
|
-
meta != null && /* @__PURE__ */ (0,
|
|
9028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("li", { className: cx("uix-content-list__item", className), ...props, children: [
|
|
9029
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { children: [
|
|
9030
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "uix-content-list__title", children: title }),
|
|
9031
|
+
meta != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "uix-content-list__meta", children: meta })
|
|
8816
9032
|
] }),
|
|
8817
9033
|
trailing
|
|
8818
9034
|
] });
|
|
8819
9035
|
}
|
|
8820
9036
|
function ResourceGrid({ children, className, ...props }) {
|
|
8821
|
-
return /* @__PURE__ */ (0,
|
|
9037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: cx("uix-resource-grid", className), ...props, children });
|
|
8822
9038
|
}
|
|
8823
9039
|
function StatLine({ items, children, className, ...props }) {
|
|
8824
|
-
return /* @__PURE__ */ (0,
|
|
8825
|
-
items?.map((item, i) => /* @__PURE__ */ (0,
|
|
8826
|
-
/* @__PURE__ */ (0,
|
|
8827
|
-
/* @__PURE__ */ (0,
|
|
9040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: cx("uix-stat-line", className), ...props, children: [
|
|
9041
|
+
items?.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "uix-stat-line__item", children: [
|
|
9042
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "uix-stat-line__value", children: item.value }),
|
|
9043
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "uix-stat-line__label", children: item.label })
|
|
8828
9044
|
] }, item.id ?? i)),
|
|
8829
9045
|
children
|
|
8830
9046
|
] });
|
|
8831
9047
|
}
|
|
8832
9048
|
function EventRow({ month, day, title, meta, className, ...props }) {
|
|
8833
|
-
return /* @__PURE__ */ (0,
|
|
8834
|
-
/* @__PURE__ */ (0,
|
|
8835
|
-
/* @__PURE__ */ (0,
|
|
8836
|
-
/* @__PURE__ */ (0,
|
|
9049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: cx("uix-event-row", className), ...props, children: [
|
|
9050
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "uix-event-date", children: [
|
|
9051
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "uix-event-date__month", children: month }),
|
|
9052
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "uix-event-date__day", children: day })
|
|
8837
9053
|
] }),
|
|
8838
|
-
/* @__PURE__ */ (0,
|
|
8839
|
-
/* @__PURE__ */ (0,
|
|
8840
|
-
meta != null && /* @__PURE__ */ (0,
|
|
9054
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { children: [
|
|
9055
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "uix-event-row__title", children: title }),
|
|
9056
|
+
meta != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "uix-event-row__meta", children: meta })
|
|
8841
9057
|
] })
|
|
8842
9058
|
] });
|
|
8843
9059
|
}
|
|
8844
9060
|
function StatusRow({ indicator, name, meta, className, ...props }) {
|
|
8845
|
-
return /* @__PURE__ */ (0,
|
|
9061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: cx("uix-status-row", className), ...props, children: [
|
|
8846
9062
|
indicator,
|
|
8847
|
-
/* @__PURE__ */ (0,
|
|
8848
|
-
meta != null && /* @__PURE__ */ (0,
|
|
9063
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "uix-status-row__name", children: name }),
|
|
9064
|
+
meta != null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "uix-list-meta", children: meta })
|
|
8849
9065
|
] });
|
|
8850
9066
|
}
|
|
8851
9067
|
|
|
@@ -8975,7 +9191,7 @@ function summarizeRule(value, labels = {}) {
|
|
|
8975
9191
|
}
|
|
8976
9192
|
|
|
8977
9193
|
// src/components/RuleBuilder.tsx
|
|
8978
|
-
var
|
|
9194
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
8979
9195
|
var DEFAULT_RULE_BUILDER_LABELS = {
|
|
8980
9196
|
region: "Rule builder",
|
|
8981
9197
|
summary: "Rule summary",
|
|
@@ -9035,7 +9251,7 @@ function RuleGroupEditor({ group, depth, root, fields, operators, maxDepth, disa
|
|
|
9035
9251
|
combinator: combinator ?? "and",
|
|
9036
9252
|
conditions: [defaultCondition(fields, operators)]
|
|
9037
9253
|
}, maxDepth));
|
|
9038
|
-
const rowControls = (node, index, label) => disabled ? null : /* @__PURE__ */ (0,
|
|
9254
|
+
const rowControls = (node, index, label) => disabled ? null : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
9039
9255
|
RowControls,
|
|
9040
9256
|
{
|
|
9041
9257
|
labels,
|
|
@@ -9048,25 +9264,25 @@ function RuleGroupEditor({ group, depth, root, fields, operators, maxDepth, disa
|
|
|
9048
9264
|
onRemove: () => onRootChange(removeRuleNode(root, node.id))
|
|
9049
9265
|
}
|
|
9050
9266
|
);
|
|
9051
|
-
return /* @__PURE__ */ (0,
|
|
9052
|
-
/* @__PURE__ */ (0,
|
|
9053
|
-
/* @__PURE__ */ (0,
|
|
9054
|
-
!hideCombinator && (combinator ? /* @__PURE__ */ (0,
|
|
9267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("fieldset", { className: "uix-rule-builder__group", "data-depth": depth, children: [
|
|
9268
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("legend", { className: "uix-rule-builder__group-heading", children: [
|
|
9269
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: depth === 1 ? labels.when : labels.group }),
|
|
9270
|
+
!hideCombinator && (combinator ? /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "uix-rule-builder__match", children: [
|
|
9055
9271
|
labels.match,
|
|
9056
9272
|
" ",
|
|
9057
9273
|
combinator === "or" ? labels.any : labels.all
|
|
9058
|
-
] }) : /* @__PURE__ */ (0,
|
|
9274
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("label", { children: [
|
|
9059
9275
|
labels.match,
|
|
9060
|
-
/* @__PURE__ */ (0,
|
|
9061
|
-
/* @__PURE__ */ (0,
|
|
9062
|
-
/* @__PURE__ */ (0,
|
|
9276
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("select", { className: "uix-select uix-select--sm", value: group.combinator, disabled, onChange: (event) => updateNode(group.id, (node) => ({ ...node, combinator: event.currentTarget.value })), children: [
|
|
9277
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("option", { value: "and", children: labels.all }),
|
|
9278
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("option", { value: "or", children: labels.any })
|
|
9063
9279
|
] })
|
|
9064
9280
|
] }))
|
|
9065
9281
|
] }),
|
|
9066
|
-
/* @__PURE__ */ (0,
|
|
9067
|
-
/* @__PURE__ */ (0,
|
|
9282
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "uix-rule-builder__rows", children: group.conditions.map((node, index) => isRuleGroup(node) ? /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "uix-rule-builder__nested", children: [
|
|
9283
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(RuleGroupEditor, { ...{ group: node, depth: depth + 1, root, fields, operators, maxDepth, disabled, onRootChange, labels, combinator, hideCombinator, allowGroups } }),
|
|
9068
9284
|
rowControls(node, index, labels.itemGroup)
|
|
9069
|
-
] }, node.id) : /* @__PURE__ */ (0,
|
|
9285
|
+
] }, node.id) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
9070
9286
|
ConditionRow,
|
|
9071
9287
|
{
|
|
9072
9288
|
labels,
|
|
@@ -9079,9 +9295,9 @@ function RuleGroupEditor({ group, depth, root, fields, operators, maxDepth, disa
|
|
|
9079
9295
|
},
|
|
9080
9296
|
node.id
|
|
9081
9297
|
)) }),
|
|
9082
|
-
!disabled && /* @__PURE__ */ (0,
|
|
9083
|
-
/* @__PURE__ */ (0,
|
|
9084
|
-
allowGroups && /* @__PURE__ */ (0,
|
|
9298
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "uix-rule-builder__add", children: [
|
|
9299
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "button", className: "uix-btn uix-btn--secondary uix-btn--sm", onClick: addCondition, disabled: fields.length === 0 || operators.length === 0, children: labels.addCondition }),
|
|
9300
|
+
allowGroups && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "button", className: "uix-btn uix-btn--ghost uix-btn--sm", onClick: addGroup, disabled: depth >= maxDepth, children: labels.addGroup })
|
|
9085
9301
|
] })
|
|
9086
9302
|
] });
|
|
9087
9303
|
}
|
|
@@ -9094,24 +9310,24 @@ function ConditionRow({ labels, condition, fields, operators, disabled, onChange
|
|
|
9094
9310
|
const nextOperator = operators.find((item) => nextField?.operators?.includes(item.id)) ?? availableOperators[0] ?? operators[0];
|
|
9095
9311
|
onChange({ ...condition, field: id, operator: nextOperator?.id ?? "" });
|
|
9096
9312
|
};
|
|
9097
|
-
return /* @__PURE__ */ (0,
|
|
9098
|
-
/* @__PURE__ */ (0,
|
|
9099
|
-
/* @__PURE__ */ (0,
|
|
9100
|
-
/* @__PURE__ */ (0,
|
|
9313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "uix-rule-builder__condition", children: [
|
|
9314
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("label", { children: [
|
|
9315
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "uix-visually-hidden", children: labels.field }),
|
|
9316
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("select", { className: "uix-select", value: condition.field, onChange: (event) => setField(event.currentTarget.value), disabled, children: fields.map((item) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("option", { value: item.id, children: item.label }, item.id)) })
|
|
9101
9317
|
] }),
|
|
9102
|
-
/* @__PURE__ */ (0,
|
|
9103
|
-
/* @__PURE__ */ (0,
|
|
9104
|
-
/* @__PURE__ */ (0,
|
|
9318
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("label", { children: [
|
|
9319
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "uix-visually-hidden", children: labels.operator }),
|
|
9320
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("select", { className: "uix-select", value: condition.operator, onChange: (event) => onChange({ ...condition, operator: event.currentTarget.value }), disabled, children: availableOperators.map((item) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("option", { value: item.id, children: item.label }, item.id)) })
|
|
9105
9321
|
] }),
|
|
9106
|
-
operator?.requiresValue !== false && /* @__PURE__ */ (0,
|
|
9322
|
+
operator?.requiresValue !== false && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "uix-rule-builder__value", children: field?.renderValueEditor?.({ condition, onChange: (value) => onChange({ ...condition, value }), disabled }) ?? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("input", { className: "uix-input", value: typeof condition.value === "string" || typeof condition.value === "number" ? condition.value : condition.value == null ? "" : JSON.stringify(condition.value), onChange: (event) => onChange({ ...condition, value: event.currentTarget.value }), disabled, "aria-label": fillLabel(labels.valueFor, { field: field?.label ?? labels.itemCondition }) }) }),
|
|
9107
9323
|
controls
|
|
9108
9324
|
] });
|
|
9109
9325
|
}
|
|
9110
9326
|
function RowControls({ labels, label, first, last, disabled, onUp, onDown, onRemove }) {
|
|
9111
|
-
return /* @__PURE__ */ (0,
|
|
9112
|
-
/* @__PURE__ */ (0,
|
|
9113
|
-
/* @__PURE__ */ (0,
|
|
9114
|
-
/* @__PURE__ */ (0,
|
|
9327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "uix-rule-builder__row-actions", children: [
|
|
9328
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "button", className: "uix-btn uix-btn--ghost uix-btn--sm", onClick: onUp, disabled: disabled || first, "aria-label": fillLabel(labels.moveUpNamed, { item: label }), children: labels.moveUp }),
|
|
9329
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "button", className: "uix-btn uix-btn--ghost uix-btn--sm", onClick: onDown, disabled: disabled || last, "aria-label": fillLabel(labels.moveDownNamed, { item: label }), children: labels.moveDown }),
|
|
9330
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "button", className: "uix-btn uix-btn--ghost uix-btn--sm", onClick: onRemove, disabled, "aria-label": fillLabel(labels.removeNamed, { item: label }), children: labels.remove })
|
|
9115
9331
|
] });
|
|
9116
9332
|
}
|
|
9117
9333
|
function RuleBuilder({
|
|
@@ -9175,16 +9391,16 @@ function RuleBuilder({
|
|
|
9175
9391
|
or: labels.or
|
|
9176
9392
|
}
|
|
9177
9393
|
});
|
|
9178
|
-
return /* @__PURE__ */ (0,
|
|
9179
|
-
/* @__PURE__ */ (0,
|
|
9180
|
-
issues.length > 0 && /* @__PURE__ */ (0,
|
|
9394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("section", { className: cx("uix-rule-builder uix-rule-builder--summary", className), "aria-label": labels.summary, children: [
|
|
9395
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("p", { children: sentence }),
|
|
9396
|
+
issues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("p", { className: "uix-rule-builder__invalid", children: issuesText(labels.summaryIssuesOne, labels.summaryIssuesMany) })
|
|
9181
9397
|
] });
|
|
9182
9398
|
}
|
|
9183
9399
|
const disabled = readOnly === true;
|
|
9184
9400
|
const emitWhen = (when) => onChange({ ...value, when: combinator ? setRuleCombinator(when, combinator) : when });
|
|
9185
9401
|
const updateActions = (next) => onChange({ ...value, then: next });
|
|
9186
|
-
return /* @__PURE__ */ (0,
|
|
9187
|
-
/* @__PURE__ */ (0,
|
|
9402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("section", { className: cx("uix-rule-builder", disabled && "uix-rule-builder--readonly", className), "aria-label": labels.region, children: [
|
|
9403
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
9188
9404
|
RuleGroupEditor,
|
|
9189
9405
|
{
|
|
9190
9406
|
group: value.when,
|
|
@@ -9201,14 +9417,14 @@ function RuleBuilder({
|
|
|
9201
9417
|
allowGroups: allowGroups && maxDepth > 1
|
|
9202
9418
|
}
|
|
9203
9419
|
),
|
|
9204
|
-
!conditionsOnly && /* @__PURE__ */ (0,
|
|
9205
|
-
/* @__PURE__ */ (0,
|
|
9420
|
+
!conditionsOnly && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("fieldset", { className: "uix-rule-builder__actions", children: [
|
|
9421
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("legend", { children: labels.then }),
|
|
9206
9422
|
value.then.map((action, index) => {
|
|
9207
9423
|
const definition = actions.find((item) => item.id === action.type);
|
|
9208
|
-
return /* @__PURE__ */ (0,
|
|
9209
|
-
/* @__PURE__ */ (0,
|
|
9424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "uix-rule-builder__action", children: [
|
|
9425
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("select", { className: "uix-select", value: action.type, disabled, onChange: (event) => updateActions(value.then.map((item) => item.id === action.id ? { ...item, type: event.currentTarget.value } : item)), "aria-label": labels.actionType, children: actions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("option", { value: item.id, children: item.label }, item.id)) }),
|
|
9210
9426
|
definition?.renderParameters?.(action, (parameters) => updateActions(value.then.map((item) => item.id === action.id ? { ...item, parameters } : item)), disabled),
|
|
9211
|
-
!disabled && /* @__PURE__ */ (0,
|
|
9427
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
9212
9428
|
RowControls,
|
|
9213
9429
|
{
|
|
9214
9430
|
labels,
|
|
@@ -9231,18 +9447,18 @@ function RuleBuilder({
|
|
|
9231
9447
|
)
|
|
9232
9448
|
] }, action.id);
|
|
9233
9449
|
}),
|
|
9234
|
-
!disabled && /* @__PURE__ */ (0,
|
|
9450
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "button", className: "uix-btn uix-btn--secondary uix-btn--sm", disabled: actions.length === 0, onClick: () => updateActions([...value.then, { id: nextId("action"), type: actions[0]?.id ?? "", parameters: {} }]), children: labels.addAction })
|
|
9235
9451
|
] }),
|
|
9236
|
-
/* @__PURE__ */ (0,
|
|
9237
|
-
/* @__PURE__ */ (0,
|
|
9238
|
-
/* @__PURE__ */ (0,
|
|
9452
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "uix-rule-builder__validation", "aria-live": "polite", children: issues.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: labels.valid }) : /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
9453
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("strong", { children: issuesText(labels.issuesOne, labels.issuesMany) }),
|
|
9454
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("ul", { children: issues.map((issue, index) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("li", { children: issue.message }, `${issue.path}-${index}`)) })
|
|
9239
9455
|
] }) })
|
|
9240
9456
|
] });
|
|
9241
9457
|
}
|
|
9242
9458
|
|
|
9243
9459
|
// src/components/BuilderCanvas.tsx
|
|
9244
9460
|
var import_react59 = require("react");
|
|
9245
|
-
var
|
|
9461
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
9246
9462
|
var DEFAULT_BUILDER_CANVAS_LABELS = {
|
|
9247
9463
|
region: "Builder canvas",
|
|
9248
9464
|
palette: "Item palette",
|
|
@@ -9321,24 +9537,24 @@ function BuilderCanvas({
|
|
|
9321
9537
|
if (from >= 0 && to >= 0) onItemsChange(reorder(items, from, to));
|
|
9322
9538
|
setDraggedId(void 0);
|
|
9323
9539
|
};
|
|
9324
|
-
return /* @__PURE__ */ (0,
|
|
9325
|
-
/* @__PURE__ */ (0,
|
|
9326
|
-
/* @__PURE__ */ (0,
|
|
9327
|
-
palette.length === 0 ? /* @__PURE__ */ (0,
|
|
9328
|
-
/* @__PURE__ */ (0,
|
|
9329
|
-
item.description && /* @__PURE__ */ (0,
|
|
9330
|
-
/* @__PURE__ */ (0,
|
|
9540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("section", { className: cx("uix-builder-canvas", className), "aria-label": labels.region, children: [
|
|
9541
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("aside", { className: "uix-builder-canvas__palette", "aria-label": labels.palette, children: [
|
|
9542
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("h3", { children: labels.paletteHeading }),
|
|
9543
|
+
palette.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("p", { children: labels.paletteEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("ul", { children: palette.map((item) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("button", { type: "button", onClick: () => add(item), children: [
|
|
9544
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("strong", { children: item.label }),
|
|
9545
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { children: item.description }),
|
|
9546
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { "aria-hidden": "true", children: labels.add })
|
|
9331
9547
|
] }) }, item.id)) })
|
|
9332
9548
|
] }),
|
|
9333
|
-
/* @__PURE__ */ (0,
|
|
9334
|
-
/* @__PURE__ */ (0,
|
|
9335
|
-
loading ? /* @__PURE__ */ (0,
|
|
9336
|
-
/* @__PURE__ */ (0,
|
|
9337
|
-
onRetry && /* @__PURE__ */ (0,
|
|
9338
|
-
] }) : items.length === 0 ? /* @__PURE__ */ (0,
|
|
9339
|
-
/* @__PURE__ */ (0,
|
|
9340
|
-
palette[0] && /* @__PURE__ */ (0,
|
|
9341
|
-
] }) : /* @__PURE__ */ (0,
|
|
9549
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "uix-builder-canvas__workspace", children: [
|
|
9550
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("h3", { children: labels.canvasHeading }),
|
|
9551
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "uix-builder-canvas__state", role: "status", children: labels.loading }) : error ? /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "uix-builder-canvas__state", role: "alert", children: [
|
|
9552
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("p", { children: error }),
|
|
9553
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("button", { type: "button", className: "uix-btn uix-btn--secondary", onClick: onRetry, children: labels.retry })
|
|
9554
|
+
] }) : items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "uix-builder-canvas__state", children: [
|
|
9555
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("p", { children: emptyMessage }),
|
|
9556
|
+
palette[0] && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("button", { type: "button", className: "uix-btn uix-btn--primary", onClick: () => add(palette[0]), children: fillLabel(labels.addFirst, { label: palette[0].label }) })
|
|
9557
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("ol", { className: "uix-builder-canvas__items", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
9342
9558
|
"li",
|
|
9343
9559
|
{
|
|
9344
9560
|
draggable: true,
|
|
@@ -9348,27 +9564,27 @@ function BuilderCanvas({
|
|
|
9348
9564
|
onDrop: (event) => drop(event, item.id),
|
|
9349
9565
|
className: cx("uix-builder-canvas__item", selectedId === item.id && "uix-builder-canvas__item--selected"),
|
|
9350
9566
|
children: [
|
|
9351
|
-
/* @__PURE__ */ (0,
|
|
9352
|
-
/* @__PURE__ */ (0,
|
|
9353
|
-
item.description && /* @__PURE__ */ (0,
|
|
9567
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("button", { type: "button", className: "uix-builder-canvas__item-main", "aria-pressed": selectedId === item.id, onClick: () => select(item.id), children: renderItem?.(item, selectedId === item.id) ?? /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
|
|
9568
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("strong", { children: item.label }),
|
|
9569
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { children: item.description })
|
|
9354
9570
|
] }) }),
|
|
9355
|
-
/* @__PURE__ */ (0,
|
|
9356
|
-
/* @__PURE__ */ (0,
|
|
9357
|
-
/* @__PURE__ */ (0,
|
|
9358
|
-
/* @__PURE__ */ (0,
|
|
9571
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("span", { className: "uix-builder-canvas__item-actions", children: [
|
|
9572
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("button", { type: "button", onClick: () => move(item.id, -1), disabled: index === 0, "aria-label": fillLabel(labels.moveUpNamed, { label: item.label }), children: labels.moveUp }),
|
|
9573
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("button", { type: "button", onClick: () => move(item.id, 1), disabled: index === items.length - 1, "aria-label": fillLabel(labels.moveDownNamed, { label: item.label }), children: labels.moveDown }),
|
|
9574
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("button", { type: "button", onClick: () => remove(item.id), "aria-label": fillLabel(labels.removeNamed, { label: item.label }), children: labels.remove })
|
|
9359
9575
|
] })
|
|
9360
9576
|
]
|
|
9361
9577
|
},
|
|
9362
9578
|
item.id
|
|
9363
9579
|
)) })
|
|
9364
9580
|
] }),
|
|
9365
|
-
/* @__PURE__ */ (0,
|
|
9366
|
-
/* @__PURE__ */ (0,
|
|
9367
|
-
!selected ? /* @__PURE__ */ (0,
|
|
9368
|
-
/* @__PURE__ */ (0,
|
|
9369
|
-
/* @__PURE__ */ (0,
|
|
9370
|
-
/* @__PURE__ */ (0,
|
|
9371
|
-
/* @__PURE__ */ (0,
|
|
9581
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("aside", { className: "uix-builder-canvas__properties", "aria-label": labels.properties, children: [
|
|
9582
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("h3", { ref: propertyHeadingRef, tabIndex: -1, children: labels.propertiesHeading }),
|
|
9583
|
+
!selected ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("p", { children: labels.propertiesEmpty }) : renderProperties?.(selected, (updated) => onItemsChange(items.map((item) => item.id === updated.id ? updated : item))) ?? /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("dl", { children: [
|
|
9584
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("dt", { children: labels.type }),
|
|
9585
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("dd", { children: selected.type }),
|
|
9586
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("dt", { children: labels.label }),
|
|
9587
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("dd", { children: selected.label })
|
|
9372
9588
|
] })
|
|
9373
9589
|
] })
|
|
9374
9590
|
] });
|
|
@@ -9833,7 +10049,7 @@ function usePrinting(enabled = true) {
|
|
|
9833
10049
|
}
|
|
9834
10050
|
|
|
9835
10051
|
// src/components/SchedulingAgenda.tsx
|
|
9836
|
-
var
|
|
10052
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
9837
10053
|
var AGENDA_VIRTUAL_ROW = 44;
|
|
9838
10054
|
var AGENDA_NARROW_WIDTH = 576;
|
|
9839
10055
|
var AGENDA_NARROW_ROW = 64;
|
|
@@ -9850,7 +10066,7 @@ function uniqueKeys(ids) {
|
|
|
9850
10066
|
function SchedulingAgenda(props) {
|
|
9851
10067
|
const rowCount = props.groups.reduce((sum, group) => sum + group.rows.length, 0);
|
|
9852
10068
|
const flat = rowCount > props.virtualizeAbove;
|
|
9853
|
-
return /* @__PURE__ */ (0,
|
|
10069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(AgendaBody, { ...props, flat }, flat ? "flat" : "grouped");
|
|
9854
10070
|
}
|
|
9855
10071
|
function AgendaBody({
|
|
9856
10072
|
groups,
|
|
@@ -10007,18 +10223,18 @@ function AgendaBody({
|
|
|
10007
10223
|
landing.current = { key: flatRows[target].key, index: target };
|
|
10008
10224
|
scrollToRow(box, target);
|
|
10009
10225
|
};
|
|
10010
|
-
const note = (overlay) => /* @__PURE__ */ (0,
|
|
10011
|
-
overlay.kindLabel && /* @__PURE__ */ (0,
|
|
10012
|
-
/* @__PURE__ */ (0,
|
|
10013
|
-
overlay.scopeLabel && /* @__PURE__ */ (0,
|
|
10226
|
+
const note = (overlay) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("button", { type: "button", className: "uix-scheduling-calendar__window", "data-overlay-id": overlay.id, "data-pattern": overlay.pattern ?? "solid", "data-global": overlay.global || void 0, onClick: () => onSelectOverlay?.(overlay), "aria-label": overlayName(overlay), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("span", { className: "uix-scheduling-calendar__window-text", children: [
|
|
10227
|
+
overlay.kindLabel && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "uix-scheduling-calendar__window-kind", children: overlay.kindLabel }),
|
|
10228
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "uix-scheduling-calendar__window-name", children: overlay.label }),
|
|
10229
|
+
overlay.scopeLabel && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "uix-scheduling-calendar__window-scope", children: overlay.scopeLabel })
|
|
10014
10230
|
] }) });
|
|
10015
|
-
const heading = (group, withNotes) => /* @__PURE__ */ (0,
|
|
10231
|
+
const heading = (group, withNotes) => /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "uix-scheduling-calendar__agenda-head", children: [
|
|
10016
10232
|
(0, import_react61.createElement)(`h${headingLevel}`, { className: "uix-scheduling-calendar__agenda-heading" }, group.heading ?? dateText(group.date, "day")),
|
|
10017
|
-
withNotes && group.annotations && group.annotations.length > 0 && /* @__PURE__ */ (0,
|
|
10233
|
+
withNotes && group.annotations && group.annotations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("ul", { className: "uix-scheduling-calendar__agenda-notes", children: uniqueKeys(group.annotations.map((overlay) => overlay.id)).map((key, at) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("li", { children: note(group.annotations[at]) }, key)) })
|
|
10018
10234
|
] });
|
|
10019
10235
|
const timeText = (entry, date) => {
|
|
10020
|
-
const part = (text) => /* @__PURE__ */ (0,
|
|
10021
|
-
const dash = /* @__PURE__ */ (0,
|
|
10236
|
+
const part = (text) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "uix-scheduling-calendar__agenda-time-part", children: text });
|
|
10237
|
+
const dash = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { "aria-hidden": "true", children: " \u2013 " });
|
|
10022
10238
|
if (entry.allDay) {
|
|
10023
10239
|
let span;
|
|
10024
10240
|
try {
|
|
@@ -10028,7 +10244,7 @@ function AgendaBody({
|
|
|
10028
10244
|
}
|
|
10029
10245
|
const last = addCalendarDays(span.end, -1);
|
|
10030
10246
|
if (span.start === date && last === date) return labels.allDay;
|
|
10031
|
-
return span.start === last ? part(dateText(last, "day")) : /* @__PURE__ */ (0,
|
|
10247
|
+
return span.start === last ? part(dateText(last, "day")) : /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
10032
10248
|
part(dateText(span.start, "day")),
|
|
10033
10249
|
dash,
|
|
10034
10250
|
part(dateText(last, "day"))
|
|
@@ -10038,11 +10254,11 @@ function AgendaBody({
|
|
|
10038
10254
|
const endTime = zonedTimeOfDay(entry.end, timeZone);
|
|
10039
10255
|
const endDay = zonedDateKey(entry.end, timeZone);
|
|
10040
10256
|
const underItsDay = zonedDateKey(entry.start, timeZone) === date && (endDay === date || endDay === addCalendarDays(date, 1) && endTime < startTime);
|
|
10041
|
-
return underItsDay ? /* @__PURE__ */ (0,
|
|
10257
|
+
return underItsDay ? /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
10042
10258
|
startTime,
|
|
10043
10259
|
dash,
|
|
10044
10260
|
endTime
|
|
10045
|
-
] }) : /* @__PURE__ */ (0,
|
|
10261
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
10046
10262
|
part(formatInstant(entry.start)),
|
|
10047
10263
|
dash,
|
|
10048
10264
|
part(formatInstant(entry.end))
|
|
@@ -10051,31 +10267,31 @@ function AgendaBody({
|
|
|
10051
10267
|
const row = (entry, date) => {
|
|
10052
10268
|
const markers = entryMarkers(entry);
|
|
10053
10269
|
const name = entry.accessibleName ?? (entry.meta ? `${entryName(entry)}, ${entry.meta}` : entryName(entry));
|
|
10054
|
-
return /* @__PURE__ */ (0,
|
|
10055
|
-
/* @__PURE__ */ (0,
|
|
10056
|
-
/* @__PURE__ */ (0,
|
|
10057
|
-
/* @__PURE__ */ (0,
|
|
10058
|
-
renderEntry?.(entry) ?? /* @__PURE__ */ (0,
|
|
10059
|
-
entry.meta && /* @__PURE__ */ (0,
|
|
10270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("button", { type: "button", className: "uix-scheduling-calendar__agenda-row", "data-item-id": entry.id, "data-highlight": entry.emphasis === "highlight" || void 0, "data-dim": entry.emphasis === "dim" || void 0, "data-band": entry.band ?? "none", "data-status": entryStatus(entry), "data-state": entry.state, onClick: () => onSelectEntry?.(entry), "aria-label": name, children: [
|
|
10271
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "uix-scheduling-calendar__swatch", "aria-hidden": "true", "data-band": entry.band ?? "none", "data-status": entryStatus(entry) }),
|
|
10272
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "uix-scheduling-calendar__agenda-time", children: timeText(entry, date) }),
|
|
10273
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("span", { className: "uix-scheduling-calendar__agenda-main", children: [
|
|
10274
|
+
renderEntry?.(entry) ?? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "uix-scheduling-calendar__title", children: entry.title }),
|
|
10275
|
+
entry.meta && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "uix-scheduling-calendar__agenda-meta", children: entry.meta })
|
|
10060
10276
|
] }),
|
|
10061
|
-
markers.length > 0 && /* @__PURE__ */ (0,
|
|
10062
|
-
/* @__PURE__ */ (0,
|
|
10277
|
+
markers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "uix-scheduling-calendar__markers", children: markers.map((marker) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { children: renderMarker2(marker, true) }, marker.id)) }),
|
|
10278
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "uix-scheduling-calendar__status", children: entryStatusText(entry) })
|
|
10063
10279
|
] });
|
|
10064
10280
|
};
|
|
10065
10281
|
const hidden = (group) => {
|
|
10066
10282
|
const text = fillLabel(labels.hiddenInDay, { count: group.hiddenCount ?? 0 });
|
|
10067
|
-
return onShowMore ? /* @__PURE__ */ (0,
|
|
10283
|
+
return onShowMore ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("button", { type: "button", className: "uix-scheduling-calendar__agenda-more", onClick: () => onShowMore(group.date, group.rows), children: text }) : /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { className: "uix-scheduling-calendar__agenda-more", children: text });
|
|
10068
10284
|
};
|
|
10069
|
-
const continues = (group) => /* @__PURE__ */ (0,
|
|
10070
|
-
if (groups.length === 0) return /* @__PURE__ */ (0,
|
|
10285
|
+
const continues = (group) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { className: "uix-scheduling-calendar__agenda-continues", children: fillLabel(labels.continuesInDay, { count: group.continuesCount ?? 0 }) });
|
|
10286
|
+
if (groups.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "uix-scheduling-calendar__agenda", role: "region", "aria-label": labels.agenda, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { children: labels.agendaEmpty }) });
|
|
10071
10287
|
if (flat) {
|
|
10072
|
-
return /* @__PURE__ */ (0,
|
|
10288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { ref: virtual.containerRef, className: "uix-scheduling-calendar__agenda uix-scheduling-calendar__agenda--virtual", "data-narrow": narrow || void 0, role: "region", "aria-label": labels.agenda, onKeyDown, onFocus, onBlur, onWheel: dropLanding, onPointerDown: dropLanding, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "uix-scheduling-calendar__agenda-window", style: { paddingTop: virtual.padTop, paddingBottom: virtual.padBottom }, children: virtual.rows.map((item, at) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "uix-scheduling-calendar__agenda-vrow", "data-kind": item.kind, "data-flat-index": virtual.startIndex + at, children: item.kind === "heading" ? heading(item.group, false) : item.kind === "note" ? note(item.overlay) : item.kind === "entry" ? row(item.entry, item.group.date) : item.kind === "hidden" ? hidden(item.group) : continues(item.group) }, item.key)) }) });
|
|
10073
10289
|
}
|
|
10074
|
-
return /* @__PURE__ */ (0,
|
|
10290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { ref: grouped, className: "uix-scheduling-calendar__agenda", role: "region", "aria-label": labels.agenda, onKeyDown, onFocus, children: groups.map((group, index) => {
|
|
10075
10291
|
const rowKeys = uniqueKeys(group.rows.map((entry) => entry.id));
|
|
10076
|
-
return /* @__PURE__ */ (0,
|
|
10292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("section", { className: "uix-scheduling-calendar__agenda-group", "data-date": group.date, children: [
|
|
10077
10293
|
heading(group, true),
|
|
10078
|
-
group.rows.length > 0 && /* @__PURE__ */ (0,
|
|
10294
|
+
group.rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("ol", { className: "uix-scheduling-calendar__agenda-rows", children: group.rows.map((entry, at) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("li", { children: row(entry, group.date) }, rowKeys[at])) }),
|
|
10079
10295
|
(group.hiddenCount ?? 0) > 0 && hidden(group),
|
|
10080
10296
|
(group.continuesCount ?? 0) > 0 && continues(group)
|
|
10081
10297
|
] }, groupKeys[index]);
|
|
@@ -10084,7 +10300,7 @@ function AgendaBody({
|
|
|
10084
10300
|
|
|
10085
10301
|
// src/components/SchedulingTimeGrid.tsx
|
|
10086
10302
|
var import_react62 = require("react");
|
|
10087
|
-
var
|
|
10303
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
10088
10304
|
var HOUR_MS2 = 36e5;
|
|
10089
10305
|
var MINUTES_PER_HOUR = 60;
|
|
10090
10306
|
var LINES_PER_HOUR = 3;
|
|
@@ -10107,18 +10323,18 @@ var GridItem = (0, import_react62.memo)(function GridItem2({ entry, segment, col
|
|
|
10107
10323
|
"--uix-scheduling-calendar-lanes": segment.laneCount
|
|
10108
10324
|
});
|
|
10109
10325
|
const custom = renderEntry?.(entry, { availableLines: lines });
|
|
10110
|
-
const text = custom ?? /* @__PURE__ */ (0,
|
|
10111
|
-
!continuation && /* @__PURE__ */ (0,
|
|
10112
|
-
/* @__PURE__ */ (0,
|
|
10326
|
+
const text = custom ?? /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
10327
|
+
!continuation && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
10328
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__time", children: zonedTimeOfDay(entry.start, timeZone) }),
|
|
10113
10329
|
" "
|
|
10114
10330
|
] }),
|
|
10115
|
-
/* @__PURE__ */ (0,
|
|
10331
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__title", children: entry.title })
|
|
10116
10332
|
] });
|
|
10117
10333
|
const noRoom = lines === 0 && (custom === void 0 || custom === null) ? "none" : void 0;
|
|
10118
|
-
const body = /* @__PURE__ */ (0,
|
|
10119
|
-
continuation && /* @__PURE__ */ (0,
|
|
10120
|
-
(!continuation || alone) && text != null && text !== false && /* @__PURE__ */ (0,
|
|
10121
|
-
markers.length > 0 && /* @__PURE__ */ (0,
|
|
10334
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
10335
|
+
continuation && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__tg-from", "data-room": lines === 0 ? "none" : void 0, children: continuesFrom }),
|
|
10336
|
+
(!continuation || alone) && text != null && text !== false && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__entry-text", "data-room": noRoom, children: text }),
|
|
10337
|
+
markers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__markers", children: markers.map((marker) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { children: renderMarker2(marker) }, marker.id)) })
|
|
10122
10338
|
] });
|
|
10123
10339
|
const shared = {
|
|
10124
10340
|
className: "uix-scheduling-calendar__entry uix-scheduling-calendar__tg-item",
|
|
@@ -10134,8 +10350,8 @@ var GridItem = (0, import_react62.memo)(function GridItem2({ entry, segment, col
|
|
|
10134
10350
|
onClick: () => handlers.click(entry),
|
|
10135
10351
|
onPointerDown: movable ? (event) => handlers.pointerDown(event, entry, column, false) : void 0
|
|
10136
10352
|
};
|
|
10137
|
-
if (continuation && !alone) return /* @__PURE__ */ (0,
|
|
10138
|
-
return /* @__PURE__ */ (0,
|
|
10353
|
+
if (continuation && !alone) return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { ...shared, "data-continuation-of": entry.id, "aria-hidden": "true", children: body });
|
|
10354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
10139
10355
|
"button",
|
|
10140
10356
|
{
|
|
10141
10357
|
type: "button",
|
|
@@ -10241,7 +10457,7 @@ function SchedulingTimeGrid({
|
|
|
10241
10457
|
return best;
|
|
10242
10458
|
}, [slots]);
|
|
10243
10459
|
const gutterSignature = slotSignature(slots[gutterIndex]);
|
|
10244
|
-
const hourLabels = (index, inline) => slots[index].map((slot) => /* @__PURE__ */ (0,
|
|
10460
|
+
const hourLabels = (index, inline) => slots[index].map((slot) => /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
|
|
10245
10461
|
"div",
|
|
10246
10462
|
{
|
|
10247
10463
|
className: inline ? "uix-scheduling-calendar__tg-hour uix-scheduling-calendar__tg-hour--inline" : "uix-scheduling-calendar__tg-hour",
|
|
@@ -10249,7 +10465,7 @@ function SchedulingTimeGrid({
|
|
|
10249
10465
|
style: vars({ "--uix-scheduling-calendar-offset": (slot.instant.getTime() - columns[index].dayStart) / HOUR_MS2 }),
|
|
10250
10466
|
children: [
|
|
10251
10467
|
slot.label,
|
|
10252
|
-
slot.offsetLabel && /* @__PURE__ */ (0,
|
|
10468
|
+
slot.offsetLabel && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__tg-offset", children: slot.offsetLabel })
|
|
10253
10469
|
]
|
|
10254
10470
|
},
|
|
10255
10471
|
slot.instant.getTime()
|
|
@@ -10510,7 +10726,7 @@ function SchedulingTimeGrid({
|
|
|
10510
10726
|
const ghostParts = ghost && ghostEntry && !ghostTop ? days.map((date) => layoutTimeGridDay([{ id: "ghost", start: ghost.proposal.start, end: ghost.proposal.end }], date, timeZone, { crossMidnightMinutes: Infinity }).segments) : null;
|
|
10511
10727
|
const ghostSpan = ghost && ghostEntry && ghostTop ? layoutDaySpans([{ id: "ghost", start: ghost.proposal.start, end: ghost.proposal.end }], days, { timeZone }).placed[0] : void 0;
|
|
10512
10728
|
const ghostLane = ghost ? top.placed.find((span) => span.id === ghost.id)?.lane ?? 0 : 0;
|
|
10513
|
-
return /* @__PURE__ */ (0,
|
|
10729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
|
|
10514
10730
|
"div",
|
|
10515
10731
|
{
|
|
10516
10732
|
ref: rootRef,
|
|
@@ -10529,8 +10745,8 @@ function SchedulingTimeGrid({
|
|
|
10529
10745
|
}
|
|
10530
10746
|
},
|
|
10531
10747
|
children: [
|
|
10532
|
-
/* @__PURE__ */ (0,
|
|
10533
|
-
/* @__PURE__ */ (0,
|
|
10748
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "uix-scheduling-calendar__tg-head", children: [
|
|
10749
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "uix-scheduling-calendar__tg-zone", children: fillLabel(labels.timeZone, { timeZone }) }),
|
|
10534
10750
|
days.map((date, index) => {
|
|
10535
10751
|
const info = dayInfo?.[date];
|
|
10536
10752
|
const hiddenIds = dayInfo ? [] : [...columns[index].hidden, ...topHiddenOn(date)];
|
|
@@ -10538,8 +10754,8 @@ function SchedulingTimeGrid({
|
|
|
10538
10754
|
const moreText = fillLabel(labels.moreSpans, { count: more });
|
|
10539
10755
|
const moreName = fillLabel(labels.moreEntriesLabel, { count: more, date: dateText(date, "day") });
|
|
10540
10756
|
const headName = !info ? dateText(date, "day") : info.label ? fillLabel(labels.dayName, { date: dateText(date, "day"), label: info.label }) : `${dateText(date, "day")}, ${fillLabel(labels.dayCount, { count: info.count })}`;
|
|
10541
|
-
return /* @__PURE__ */ (0,
|
|
10542
|
-
/* @__PURE__ */ (0,
|
|
10757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "uix-scheduling-calendar__tg-dayhead", role: "group", "aria-label": headName, "data-date": date, children: [
|
|
10758
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
10543
10759
|
"button",
|
|
10544
10760
|
{
|
|
10545
10761
|
type: "button",
|
|
@@ -10553,20 +10769,20 @@ function SchedulingTimeGrid({
|
|
|
10553
10769
|
children: dateText(date, "column")
|
|
10554
10770
|
}
|
|
10555
10771
|
),
|
|
10556
|
-
info && /* @__PURE__ */ (0,
|
|
10557
|
-
info?.markers && info.markers.length > 0 && /* @__PURE__ */ (0,
|
|
10558
|
-
more > 0 && (onShowMore ? /* @__PURE__ */ (0,
|
|
10559
|
-
/* @__PURE__ */ (0,
|
|
10560
|
-
/* @__PURE__ */ (0,
|
|
10772
|
+
info && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__count", "aria-hidden": "true", children: info.count }),
|
|
10773
|
+
info?.markers && info.markers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__markers", children: info.markers.map((marker) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { children: renderMarker2(marker, true) }, marker.id)) }),
|
|
10774
|
+
more > 0 && (onShowMore ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("button", { type: "button", tabIndex: -1, className: "uix-scheduling-calendar__more", "aria-label": moreName, onClick: () => onShowMore(date, hiddenIds.map((id) => entryById.get(id)).filter(Boolean)), children: moreText }) : /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("span", { className: "uix-scheduling-calendar__more", children: [
|
|
10775
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { "aria-hidden": "true", children: moreText }),
|
|
10776
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-visually-hidden", children: moreName })
|
|
10561
10777
|
] }))
|
|
10562
10778
|
] }, date);
|
|
10563
10779
|
})
|
|
10564
10780
|
] }),
|
|
10565
|
-
(windowLanes > 0 || moreWindows > 0) && /* @__PURE__ */ (0,
|
|
10781
|
+
(windowLanes > 0 || moreWindows > 0) && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "uix-scheduling-calendar__tg-strip", role: "group", "aria-label": labels.windows, style: vars({ "--uix-scheduling-calendar-lanes": Math.max(windowLanes, 1) }), children: [
|
|
10566
10782
|
strip.placed.map((placed) => {
|
|
10567
10783
|
const overlay = overlayById.get(placed.id);
|
|
10568
10784
|
if (!overlay) return null;
|
|
10569
|
-
return /* @__PURE__ */ (0,
|
|
10785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
10570
10786
|
"button",
|
|
10571
10787
|
{
|
|
10572
10788
|
type: "button",
|
|
@@ -10581,24 +10797,24 @@ function SchedulingTimeGrid({
|
|
|
10581
10797
|
style: { gridColumn: gridColumns(placed), ...vars({ "--uix-scheduling-calendar-lane": placed.lane }) },
|
|
10582
10798
|
onClick: () => onSelectOverlay?.(overlay),
|
|
10583
10799
|
"aria-label": overlayName(overlay),
|
|
10584
|
-
children: /* @__PURE__ */ (0,
|
|
10585
|
-
overlay.kindLabel && /* @__PURE__ */ (0,
|
|
10586
|
-
/* @__PURE__ */ (0,
|
|
10587
|
-
overlay.scopeLabel && /* @__PURE__ */ (0,
|
|
10800
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("span", { className: "uix-scheduling-calendar__window-text", children: [
|
|
10801
|
+
overlay.kindLabel && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__window-kind", children: overlay.kindLabel }),
|
|
10802
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__window-name", children: overlay.label }),
|
|
10803
|
+
overlay.scopeLabel && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__window-scope", children: overlay.scopeLabel })
|
|
10588
10804
|
] })
|
|
10589
10805
|
},
|
|
10590
10806
|
placed.id
|
|
10591
10807
|
);
|
|
10592
10808
|
}),
|
|
10593
|
-
moreWindows > 0 && (onShowMore ? /* @__PURE__ */ (0,
|
|
10809
|
+
moreWindows > 0 && (onShowMore ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("button", { type: "button", tabIndex: -1, className: "uix-scheduling-calendar__rowmore", "data-more-date": firstHiddenWindowDay, "aria-label": fillLabel(labels.moreWindowsLabel, { count: moreWindows, date: dateText(firstHiddenWindowDay, "day") }), onClick: () => onShowMore(firstHiddenWindowDay, []), children: fillLabel(labels.moreWindows, { count: moreWindows }) }) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__rowmore", children: fillLabel(labels.moreWindows, { count: moreWindows }) }))
|
|
10594
10810
|
] }),
|
|
10595
|
-
(topLanes > 0 || ghostSpan) && /* @__PURE__ */ (0,
|
|
10811
|
+
(topLanes > 0 || ghostSpan) && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "uix-scheduling-calendar__tg-strip uix-scheduling-calendar__tg-top", role: "group", "aria-label": labels.topLane, style: vars({ "--uix-scheduling-calendar-lanes": Math.max(topLanes, 1) }), children: [
|
|
10596
10812
|
top.placed.map((placed) => {
|
|
10597
10813
|
const entry = entryById.get(placed.id);
|
|
10598
10814
|
if (!entry) return null;
|
|
10599
10815
|
const canDrag = movable(entry);
|
|
10600
10816
|
const markers = entryMarkers(entry);
|
|
10601
|
-
return /* @__PURE__ */ (0,
|
|
10817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
|
|
10602
10818
|
"button",
|
|
10603
10819
|
{
|
|
10604
10820
|
type: "button",
|
|
@@ -10621,23 +10837,23 @@ function SchedulingTimeGrid({
|
|
|
10621
10837
|
onBlur: canDrag ? () => handlers.blur(entry) : void 0,
|
|
10622
10838
|
onPointerDown: canDrag ? (event) => handlers.pointerDown(event, entry, placed.startCol, true) : void 0,
|
|
10623
10839
|
children: [
|
|
10624
|
-
/* @__PURE__ */ (0,
|
|
10625
|
-
!placed.continuesBefore && !entry.allDay && /* @__PURE__ */ (0,
|
|
10626
|
-
/* @__PURE__ */ (0,
|
|
10840
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__entry-text", children: renderEntry?.(entry, { availableLines: 1 }) ?? /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
10841
|
+
!placed.continuesBefore && !entry.allDay && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
10842
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__time", children: zonedTimeOfDay(entry.start, timeZone) }),
|
|
10627
10843
|
" "
|
|
10628
10844
|
] }),
|
|
10629
|
-
/* @__PURE__ */ (0,
|
|
10845
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__title", children: entry.title })
|
|
10630
10846
|
] }) }),
|
|
10631
|
-
markers.length > 0 && /* @__PURE__ */ (0,
|
|
10847
|
+
markers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__markers", children: markers.map((marker) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { children: renderMarker2(marker) }, marker.id)) })
|
|
10632
10848
|
]
|
|
10633
10849
|
},
|
|
10634
10850
|
placed.id
|
|
10635
10851
|
);
|
|
10636
10852
|
}),
|
|
10637
|
-
ghostSpan && /* @__PURE__ */ (0,
|
|
10853
|
+
ghostSpan && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "uix-scheduling-calendar__tg-ghost", "aria-hidden": "true", "data-sent": ghost?.source === "sent" || void 0, style: { gridColumn: gridColumns(ghostSpan), ...vars({ "--uix-scheduling-calendar-lane": ghostLane }) } })
|
|
10638
10854
|
] }),
|
|
10639
|
-
/* @__PURE__ */ (0,
|
|
10640
|
-
/* @__PURE__ */ (0,
|
|
10855
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "uix-scheduling-calendar__tg-body", children: [
|
|
10856
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "uix-scheduling-calendar__tg-gutter", "aria-hidden": "true", children: hourLabels(gutterIndex, false) }),
|
|
10641
10857
|
shades.map((placed) => {
|
|
10642
10858
|
const overlay = overlayById.get(placed.id);
|
|
10643
10859
|
const first = columns[placed.startCol];
|
|
@@ -10647,14 +10863,14 @@ function SchedulingTimeGrid({
|
|
|
10647
10863
|
const width = 100 / (placed.endCol - placed.startCol + 1);
|
|
10648
10864
|
const percent = (value) => `${Math.round(value * 1e4) / 100}%`;
|
|
10649
10865
|
const clipPath = placed.startCol === placed.endCol ? `polygon(0 ${percent(from)}, 100% ${percent(from)}, 100% ${percent(to)}, 0 ${percent(to)})` : `polygon(0 ${percent(from)}, ${width}% ${percent(from)}, ${width}% 0, 100% 0, 100% ${percent(to)}, ${100 - width}% ${percent(to)}, ${100 - width}% 100%, 0 100%)`;
|
|
10650
|
-
return /* @__PURE__ */ (0,
|
|
10866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "uix-scheduling-calendar__tg-shade", "aria-hidden": "true", "data-pattern": overlay.pattern ?? "solid", style: { gridColumn: gridColumns(placed), clipPath } }, `shade-${placed.id}`);
|
|
10651
10867
|
}),
|
|
10652
|
-
columns.map((column, index) => /* @__PURE__ */ (0,
|
|
10868
|
+
columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "uix-scheduling-calendar__tg-column", "data-tg-column": column.date, style: { gridColumn: `${index + 2}`, ...vars({ "--uix-scheduling-calendar-hours": column.dayHours }) }, children: [
|
|
10653
10869
|
slotSignature(slots[index]) !== gutterSignature && hourLabels(index, true),
|
|
10654
10870
|
column.segments.map((segment) => {
|
|
10655
10871
|
const entry = entryById.get(segment.id);
|
|
10656
10872
|
const alone = segment.part === "continuation" && index === 0;
|
|
10657
|
-
return /* @__PURE__ */ (0,
|
|
10873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
10658
10874
|
GridItem,
|
|
10659
10875
|
{
|
|
10660
10876
|
entry,
|
|
@@ -10675,7 +10891,7 @@ function SchedulingTimeGrid({
|
|
|
10675
10891
|
`${segment.id}-${segment.part}`
|
|
10676
10892
|
);
|
|
10677
10893
|
}),
|
|
10678
|
-
ghostParts?.[index].map((segment) => /* @__PURE__ */ (0,
|
|
10894
|
+
ghostParts?.[index].map((segment) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
10679
10895
|
"div",
|
|
10680
10896
|
{
|
|
10681
10897
|
className: "uix-scheduling-calendar__tg-ghost",
|
|
@@ -10685,20 +10901,20 @@ function SchedulingTimeGrid({
|
|
|
10685
10901
|
},
|
|
10686
10902
|
`ghost-${segment.part}`
|
|
10687
10903
|
)),
|
|
10688
|
-
index === nowColumn && nowAt !== null && /* @__PURE__ */ (0,
|
|
10904
|
+
index === nowColumn && nowAt !== null && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "uix-scheduling-calendar__tg-now", "aria-hidden": "true", style: vars({ "--uix-scheduling-calendar-offset": (nowAt - column.dayStart) / HOUR_MS2 }) })
|
|
10689
10905
|
] }, column.date))
|
|
10690
10906
|
] }),
|
|
10691
|
-
emptyNote != null && emptyNote !== false && nothingToShow && /* @__PURE__ */ (0,
|
|
10692
|
-
moving && /* @__PURE__ */ (0,
|
|
10693
|
-
/* @__PURE__ */ (0,
|
|
10694
|
-
/* @__PURE__ */ (0,
|
|
10907
|
+
emptyNote != null && emptyNote !== false && nothingToShow && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "uix-scheduling-calendar__empty", children: emptyNote }),
|
|
10908
|
+
moving && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("p", { id: hintId, className: "uix-visually-hidden", children: labels.moveHint }),
|
|
10909
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "uix-scheduling-calendar__tg-probe", "aria-hidden": "true", children: "00:00 abcdef" }),
|
|
10910
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "uix-visually-hidden", "aria-live": "polite", children: announcement })
|
|
10695
10911
|
]
|
|
10696
10912
|
}
|
|
10697
10913
|
);
|
|
10698
10914
|
}
|
|
10699
10915
|
|
|
10700
10916
|
// src/components/SchedulingCalendar.tsx
|
|
10701
|
-
var
|
|
10917
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
10702
10918
|
var DEFAULT_SCHEDULING_CALENDAR_LABELS = {
|
|
10703
10919
|
region: "Scheduling calendar in {timeZone}",
|
|
10704
10920
|
previous: "Previous",
|
|
@@ -10767,12 +10983,12 @@ function coveredDays(start, end, timeZone) {
|
|
|
10767
10983
|
}
|
|
10768
10984
|
function Marker({ marker, showLabel }) {
|
|
10769
10985
|
const emphasis = marker.emphasis ?? "neutral";
|
|
10770
|
-
return /* @__PURE__ */ (0,
|
|
10771
|
-
marker.icon != null && /* @__PURE__ */ (0,
|
|
10772
|
-
/* @__PURE__ */ (0,
|
|
10986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "uix-scheduling-calendar__marker", "data-emphasis": emphasis, "data-glyph": marker.icon == null ? emphasis : void 0, children: [
|
|
10987
|
+
marker.icon != null && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-scheduling-calendar__marker-icon", "aria-hidden": "true", children: marker.icon }),
|
|
10988
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: showLabel ? "uix-scheduling-calendar__marker-label" : "uix-visually-hidden", children: marker.label })
|
|
10773
10989
|
] });
|
|
10774
10990
|
}
|
|
10775
|
-
var renderMarker = (marker, showLabel) => /* @__PURE__ */ (0,
|
|
10991
|
+
var renderMarker = (marker, showLabel) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Marker, { marker, showLabel });
|
|
10776
10992
|
function SchedulingCalendar({
|
|
10777
10993
|
entries,
|
|
10778
10994
|
anchorDate,
|
|
@@ -11036,15 +11252,15 @@ function SchedulingCalendar({
|
|
|
11036
11252
|
});
|
|
11037
11253
|
const entryContent = (entry, withTime = true) => {
|
|
11038
11254
|
const markers = markersOf(entry);
|
|
11039
|
-
return /* @__PURE__ */ (0,
|
|
11040
|
-
/* @__PURE__ */ (0,
|
|
11041
|
-
withTime && /* @__PURE__ */ (0,
|
|
11042
|
-
/* @__PURE__ */ (0,
|
|
11255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
|
|
11256
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-scheduling-calendar__entry-text", children: renderEntry?.(entry) ?? /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
|
|
11257
|
+
withTime && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
|
|
11258
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-scheduling-calendar__time", children: zonedTimeOfDay(entry.start, timeZone) }),
|
|
11043
11259
|
" "
|
|
11044
11260
|
] }),
|
|
11045
|
-
/* @__PURE__ */ (0,
|
|
11261
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-scheduling-calendar__title", children: entry.title })
|
|
11046
11262
|
] }) }),
|
|
11047
|
-
markers.length > 0 && /* @__PURE__ */ (0,
|
|
11263
|
+
markers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-scheduling-calendar__markers", children: markers.map((marker) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Marker, { marker }, marker.id)) })
|
|
11048
11264
|
] });
|
|
11049
11265
|
};
|
|
11050
11266
|
const laneStyle = (placed, windowLanes) => ({
|
|
@@ -11063,25 +11279,25 @@ function SchedulingCalendar({
|
|
|
11063
11279
|
const onDay = picksGiven ? all : entriesOn(date);
|
|
11064
11280
|
const badge = renderDayBadge?.(date, onDay);
|
|
11065
11281
|
const hasBadge = badge != null && badge !== false;
|
|
11066
|
-
const dateButton = /* @__PURE__ */ (0,
|
|
11282
|
+
const dateButton = /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("button", { type: "button", className: "uix-scheduling-calendar__date", "data-calendar-date": date, tabIndex: activeDate === date ? 0 : -1, onFocus: () => setActiveDate(date), onKeyDown: (event) => onDayKeyDown(event, date), onClick: onSelectDate ? () => onSelectDate(date) : void 0, "aria-label": info?.label ? fillLabel(labels.dayName, { date: dateText(date, "day"), label: info.label }) : dateText(date, "day"), children: Number(date.slice(-2)) });
|
|
11067
11283
|
const moreText = fillLabel(labels.moreEntries, { count: hiddenCount });
|
|
11068
11284
|
const moreName = fillLabel(labels.moreEntriesLabel, { count: hiddenCount, date: dateText(date, "day") });
|
|
11069
|
-
return /* @__PURE__ */ (0,
|
|
11070
|
-
hasBadge || info ? /* @__PURE__ */ (0,
|
|
11071
|
-
hasBadge && /* @__PURE__ */ (0,
|
|
11072
|
-
info && /* @__PURE__ */ (0,
|
|
11073
|
-
/* @__PURE__ */ (0,
|
|
11074
|
-
/* @__PURE__ */ (0,
|
|
11285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "uix-scheduling-calendar__day", "data-outside": view === "month" && !monthDays[index].inMonth || void 0, children: [
|
|
11286
|
+
hasBadge || info ? /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "uix-scheduling-calendar__dayhead", children: [
|
|
11287
|
+
hasBadge && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-scheduling-calendar__badge", children: badge }),
|
|
11288
|
+
info && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "uix-scheduling-calendar__count", "aria-hidden": info.label ? true : void 0, children: [
|
|
11289
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { "aria-hidden": "true", children: info.count }),
|
|
11290
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-visually-hidden", children: info.label ?? fillLabel(labels.dayCount, { count: info.count }) })
|
|
11075
11291
|
] }),
|
|
11076
|
-
info?.markers && info.markers.length > 0 && /* @__PURE__ */ (0,
|
|
11292
|
+
info?.markers && info.markers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-scheduling-calendar__markers", children: info.markers.map((marker) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Marker, { marker }, marker.id)) }),
|
|
11077
11293
|
dateButton
|
|
11078
11294
|
] }) : dateButton,
|
|
11079
|
-
/* @__PURE__ */ (0,
|
|
11080
|
-
shown.map((entry) => /* @__PURE__ */ (0,
|
|
11081
|
-
countsOnly ? null : controlled ? hiddenCount > 0 && (onShowMore ? /* @__PURE__ */ (0,
|
|
11082
|
-
/* @__PURE__ */ (0,
|
|
11083
|
-
/* @__PURE__ */ (0,
|
|
11084
|
-
] })) : overflowing && /* @__PURE__ */ (0,
|
|
11295
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "uix-scheduling-calendar__entries", children: [
|
|
11296
|
+
shown.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("button", { className: "uix-scheduling-calendar__entry", ...entryProps(entry), children: entryContent(entry) }, entry.id)),
|
|
11297
|
+
countsOnly ? null : controlled ? hiddenCount > 0 && (onShowMore ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("button", { type: "button", tabIndex: -1, className: "uix-scheduling-calendar__more", "aria-label": moreName, onClick: () => onShowMore(date, onDay), children: moreText }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "uix-scheduling-calendar__more", children: [
|
|
11298
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { "aria-hidden": "true", children: moreText }),
|
|
11299
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-visually-hidden", children: moreName })
|
|
11300
|
+
] })) : overflowing && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("button", { type: "button", tabIndex: -1, className: "uix-scheduling-calendar__more", "aria-expanded": onShowMore ? void 0 : !collapsed, "aria-label": collapsed ? moreName : void 0, onClick: () => toggleMore(date, onDay), children: collapsed ? moreText : labels.fewerEntries })
|
|
11085
11301
|
] })
|
|
11086
11302
|
] }, date);
|
|
11087
11303
|
};
|
|
@@ -11096,26 +11312,26 @@ function SchedulingCalendar({
|
|
|
11096
11312
|
const moreText = fillLabel(labels.moreSpans, { count: hidden });
|
|
11097
11313
|
const moreName = fillLabel(labels.moreSpansLabel, { count: hidden, date: dateText(firstHiddenDay, "day") });
|
|
11098
11314
|
const style = { ["--uix-scheduling-calendar-lanes"]: Math.max(windowLanes + spanLanes, hidden > 0 ? 1 : 0) };
|
|
11099
|
-
return /* @__PURE__ */ (0,
|
|
11315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "uix-scheduling-calendar__week", style, children: [
|
|
11100
11316
|
rowDays.map((date, column) => renderDay(date, row * 7 + column)),
|
|
11101
11317
|
(placedByRow.get(row) ?? []).map((placed) => {
|
|
11102
11318
|
const continues = { "data-continues-before": placed.continuesBefore || void 0, "data-continues-after": placed.continuesAfter || void 0 };
|
|
11103
11319
|
if (placed.group === "window") {
|
|
11104
11320
|
const overlay = overlayById.get(placed.id);
|
|
11105
11321
|
if (!overlay) return null;
|
|
11106
|
-
return /* @__PURE__ */ (0,
|
|
11107
|
-
overlay.kindLabel && /* @__PURE__ */ (0,
|
|
11108
|
-
/* @__PURE__ */ (0,
|
|
11109
|
-
overlay.scopeLabel && /* @__PURE__ */ (0,
|
|
11322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("button", { type: "button", tabIndex: -1, className: "uix-scheduling-calendar__window", "data-overlay-id": overlay.id, "data-pattern": overlay.pattern ?? "solid", "data-global": overlay.global || void 0, "data-kind": overlay.kind, ...continues, style: laneStyle(placed, windowLanes), onClick: () => onSelectOverlay?.(overlay), "aria-label": overlayName(overlay), children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "uix-scheduling-calendar__window-text", children: [
|
|
11323
|
+
overlay.kindLabel && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-scheduling-calendar__window-kind", children: overlay.kindLabel }),
|
|
11324
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-scheduling-calendar__window-name", children: overlay.label }),
|
|
11325
|
+
overlay.scopeLabel && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-scheduling-calendar__window-scope", children: overlay.scopeLabel })
|
|
11110
11326
|
] }) }, `window-${placed.id}`);
|
|
11111
11327
|
}
|
|
11112
11328
|
const entry = entryById.get(placed.id);
|
|
11113
11329
|
if (!entry || countsOnly) return null;
|
|
11114
|
-
return /* @__PURE__ */ (0,
|
|
11330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("button", { className: "uix-scheduling-calendar__entry uix-scheduling-calendar__span", ...entryProps(entry), ...continues, style: laneStyle(placed, windowLanes), children: entryContent(entry, !placed.continuesBefore) }, `span-${placed.id}`);
|
|
11115
11331
|
}),
|
|
11116
|
-
hidden > 0 && (onShowMore ? /* @__PURE__ */ (0,
|
|
11117
|
-
/* @__PURE__ */ (0,
|
|
11118
|
-
/* @__PURE__ */ (0,
|
|
11332
|
+
hidden > 0 && (onShowMore ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("button", { type: "button", tabIndex: -1, className: "uix-scheduling-calendar__rowmore", "data-more-date": rowDays.includes(firstHiddenDay) ? firstHiddenDay : rowDays[0], "aria-label": moreName, onClick: () => onShowMore(firstHiddenDay, picksGiven ? dayEntries[firstHiddenDay] ?? EMPTY_ENTRIES : entriesOn(firstHiddenDay)), children: moreText }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "uix-scheduling-calendar__rowmore", children: [
|
|
11333
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { "aria-hidden": "true", children: moreText }),
|
|
11334
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-visually-hidden", children: moreName })
|
|
11119
11335
|
] }))
|
|
11120
11336
|
] }, rowDays[0]);
|
|
11121
11337
|
};
|
|
@@ -11126,20 +11342,20 @@ function SchedulingCalendar({
|
|
|
11126
11342
|
Object.keys(layout.hiddenByRow ?? {}).length > 0 ? 1 : 0
|
|
11127
11343
|
)
|
|
11128
11344
|
} : void 0;
|
|
11129
|
-
return /* @__PURE__ */ (0,
|
|
11130
|
-
showHeader && /* @__PURE__ */ (0,
|
|
11131
|
-
/* @__PURE__ */ (0,
|
|
11132
|
-
/* @__PURE__ */ (0,
|
|
11133
|
-
/* @__PURE__ */ (0,
|
|
11345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("section", { className: cx("uix-scheduling-calendar", className), "aria-label": fillLabel(labels.region, { timeZone }), children: [
|
|
11346
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "uix-scheduling-calendar__header", children: [
|
|
11347
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { children: [
|
|
11348
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("button", { type: "button", className: "uix-btn uix-btn--ghost uix-btn--sm", onClick: () => movePeriod(-1), disabled: !onAnchorDateChange, children: periodLabel("previous") }),
|
|
11349
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("button", { type: "button", className: "uix-btn uix-btn--ghost uix-btn--sm", onClick: () => movePeriod(1), disabled: !onAnchorDateChange, children: periodLabel("next") })
|
|
11134
11350
|
] }),
|
|
11135
|
-
/* @__PURE__ */ (0,
|
|
11136
|
-
/* @__PURE__ */ (0,
|
|
11351
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("strong", { children: view === "month" ? dateText(startOfMonth(anchorDate), "month") : view === "day" ? dateText(anchorDate, "day") : `${dateText(weekStart, "day")} \u2013 ${dateText(weekDays[weekDays.length - 1], "day")}` }),
|
|
11352
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "uix-segmented", role: "group", "aria-label": labels.viewGroup, children: (timeGrid || view === "day" ? ["month", "week", "day", "agenda"] : ["month", "week", "agenda"]).map((option) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("button", { type: "button", className: "uix-segmented__option", "aria-pressed": view === option, "data-selected": view === option || void 0, onClick: () => setView(option), children: viewLabel[option] }, option)) })
|
|
11137
11353
|
] }),
|
|
11138
|
-
notice != null && notice !== false && /* @__PURE__ */ (0,
|
|
11139
|
-
loading ? /* @__PURE__ */ (0,
|
|
11140
|
-
/* @__PURE__ */ (0,
|
|
11141
|
-
onRetry && /* @__PURE__ */ (0,
|
|
11142
|
-
] }) : view === "agenda" && agendaGroups ? /* @__PURE__ */ (0,
|
|
11354
|
+
notice != null && notice !== false && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "uix-scheduling-calendar__notice", children: notice }),
|
|
11355
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "uix-scheduling-calendar__state", role: "status", children: labels.loading }) : error ? /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "uix-scheduling-calendar__state", role: "alert", children: [
|
|
11356
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { children: error }),
|
|
11357
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("button", { type: "button", className: "uix-btn uix-btn--secondary", onClick: onRetry, children: labels.retry })
|
|
11358
|
+
] }) : view === "agenda" && agendaGroups ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
11143
11359
|
SchedulingAgenda,
|
|
11144
11360
|
{
|
|
11145
11361
|
groups: agendaGroups,
|
|
@@ -11160,22 +11376,22 @@ function SchedulingCalendar({
|
|
|
11160
11376
|
onSelectOverlay,
|
|
11161
11377
|
onShowMore
|
|
11162
11378
|
}
|
|
11163
|
-
) : view === "agenda" ? /* @__PURE__ */ (0,
|
|
11379
|
+
) : view === "agenda" ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { ref: flatAgendaRef, className: "uix-scheduling-calendar__agenda", role: "region", "aria-label": labels.agenda, onKeyDown: onFlatAgendaKeyDown, onFocus: onFlatAgendaFocus, children: visibleEntries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { children: labels.agendaEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("ol", { children: [...visibleEntries].sort((a, b) => a.start.localeCompare(b.start)).map((entry) => {
|
|
11164
11380
|
const markers = markersOf(entry);
|
|
11165
|
-
return /* @__PURE__ */ (0,
|
|
11166
|
-
/* @__PURE__ */ (0,
|
|
11167
|
-
/* @__PURE__ */ (0,
|
|
11168
|
-
/* @__PURE__ */ (0,
|
|
11381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("button", { type: "button", "data-item-id": entry.id, "data-highlight": entry.emphasis === "highlight" || void 0, "data-dim": entry.emphasis === "dim" || void 0, "data-band": entry.band ?? "none", "data-status": statusOf(entry), "data-state": entry.state, onClick: () => onSelectEntry?.(entry), children: [
|
|
11382
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { children: [
|
|
11383
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("strong", { children: renderEntry?.(entry) ?? entry.title }),
|
|
11384
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { children: [
|
|
11169
11385
|
formatInstant(entry.start),
|
|
11170
11386
|
" \u2013 ",
|
|
11171
11387
|
formatInstant(entry.end)
|
|
11172
11388
|
] }),
|
|
11173
|
-
entry.meta && /* @__PURE__ */ (0,
|
|
11389
|
+
entry.meta && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { children: entry.meta })
|
|
11174
11390
|
] }),
|
|
11175
|
-
markers.length > 0 && /* @__PURE__ */ (0,
|
|
11176
|
-
entry.state ? /* @__PURE__ */ (0,
|
|
11391
|
+
markers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-scheduling-calendar__markers", children: markers.map((marker) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Marker, { marker }, marker.id)) }),
|
|
11392
|
+
entry.state ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(StatusPill, { tone: stateTone(entry.state), children: stateLabel[entry.state] }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-scheduling-calendar__status", children: stateText(entry) })
|
|
11177
11393
|
] }) }, entry.id);
|
|
11178
|
-
}) }) }) : timeGridView ? /* @__PURE__ */ (0,
|
|
11394
|
+
}) }) }) : timeGridView ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
11179
11395
|
SchedulingTimeGrid,
|
|
11180
11396
|
{
|
|
11181
11397
|
view: view === "day" ? "day" : "week",
|
|
@@ -11209,20 +11425,20 @@ function SchedulingCalendar({
|
|
|
11209
11425
|
emptyNote,
|
|
11210
11426
|
nothingToShow
|
|
11211
11427
|
}
|
|
11212
|
-
) : /* @__PURE__ */ (0,
|
|
11213
|
-
days.slice(0, 7).map((date) => /* @__PURE__ */ (0,
|
|
11428
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { ref: gridRef, className: cx("uix-scheduling-calendar__grid", view === "week" && "uix-scheduling-calendar__grid--week"), "data-fixed": fixed || void 0, "data-density": countsOnly ? "counts" : void 0, style: gridStyle, onKeyDown: onGridKeyDown, onFocus: onGridFocus, role: "group", "aria-label": fillLabel(labels.grid, { view: viewLabel[view] }), children: [
|
|
11429
|
+
days.slice(0, 7).map((date) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "uix-scheduling-calendar__weekday", "aria-hidden": "true", children: dateText(date, "weekday") }, `weekday-${date}`)),
|
|
11214
11430
|
Array.from({ length: days.length / 7 }, (_, row) => renderWeek(row)),
|
|
11215
|
-
emptyNote != null && emptyNote !== false && nothingToShow && /* @__PURE__ */ (0,
|
|
11431
|
+
emptyNote != null && emptyNote !== false && nothingToShow && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "uix-scheduling-calendar__empty", children: emptyNote })
|
|
11216
11432
|
] }),
|
|
11217
|
-
legend ? (legend.length > 0 || legendCaption != null && legendCaption !== false) && /* @__PURE__ */ (0,
|
|
11218
|
-
legend.length > 0 && /* @__PURE__ */ (0,
|
|
11219
|
-
/* @__PURE__ */ (0,
|
|
11433
|
+
legend ? (legend.length > 0 || legendCaption != null && legendCaption !== false) && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "uix-scheduling-calendar__legend", role: "group", "aria-label": labels.legend, children: [
|
|
11434
|
+
legend.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("ul", { className: "uix-scheduling-calendar__legend-list", children: legend.map((item) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("li", { "data-legend-id": item.id, children: [
|
|
11435
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "uix-scheduling-calendar__swatch", "aria-hidden": "true", "data-band": item.swatch.band, "data-status": item.swatch.status, "data-pattern": item.swatch.pattern, children: item.swatch.icon }),
|
|
11220
11436
|
item.label
|
|
11221
11437
|
] }, item.id)) }),
|
|
11222
|
-
legendCaption != null && legendCaption !== false && /* @__PURE__ */ (0,
|
|
11223
|
-
] }) : /* @__PURE__ */ (0,
|
|
11224
|
-
["scheduled", "conflicted", "in-progress", "blackout-violation"].map((state) => /* @__PURE__ */ (0,
|
|
11225
|
-
legendCaption != null && legendCaption !== false && /* @__PURE__ */ (0,
|
|
11438
|
+
legendCaption != null && legendCaption !== false && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { className: "uix-scheduling-calendar__legend-caption", children: legendCaption })
|
|
11439
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "uix-scheduling-calendar__legend", role: "group", "aria-label": labels.legend, children: [
|
|
11440
|
+
["scheduled", "conflicted", "in-progress", "blackout-violation"].map((state) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { "data-state": state, children: stateLabel[state] }, state)),
|
|
11441
|
+
legendCaption != null && legendCaption !== false && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { className: "uix-scheduling-calendar__legend-caption", children: legendCaption })
|
|
11226
11442
|
] })
|
|
11227
11443
|
] });
|
|
11228
11444
|
}
|
|
@@ -11414,7 +11630,7 @@ function timelineWindow(offsets, top, bottom, options = {}) {
|
|
|
11414
11630
|
}
|
|
11415
11631
|
|
|
11416
11632
|
// src/components/SchedulingTimeline.tsx
|
|
11417
|
-
var
|
|
11633
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
11418
11634
|
var DEFAULT_SCHEDULING_TIMELINE_LABELS = {
|
|
11419
11635
|
region: "Schedule timeline in {timeZone}",
|
|
11420
11636
|
lanes: "Lanes",
|
|
@@ -11473,9 +11689,9 @@ function uniqueKeys2(ids) {
|
|
|
11473
11689
|
var lanesOf = (target) => target.laneIds !== void 0 ? new Set(target.laneIds) : target.laneId ? /* @__PURE__ */ new Set([target.laneId]) : null;
|
|
11474
11690
|
function ItemMarker({ marker, showLabel }) {
|
|
11475
11691
|
const emphasis = marker.emphasis ?? "neutral";
|
|
11476
|
-
return /* @__PURE__ */ (0,
|
|
11477
|
-
marker.icon != null && /* @__PURE__ */ (0,
|
|
11478
|
-
/* @__PURE__ */ (0,
|
|
11692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("span", { className: "uix-scheduling-timeline__item-marker", "data-emphasis": emphasis, "data-glyph": marker.icon == null ? emphasis : void 0, children: [
|
|
11693
|
+
marker.icon != null && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__item-marker-icon", "aria-hidden": "true", children: marker.icon }),
|
|
11694
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: showLabel ? "uix-scheduling-timeline__item-marker-label" : "uix-visually-hidden", children: marker.label })
|
|
11479
11695
|
] });
|
|
11480
11696
|
}
|
|
11481
11697
|
function SchedulingTimeline({
|
|
@@ -12054,17 +12270,17 @@ function SchedulingTimeline({
|
|
|
12054
12270
|
"data-scope": scope.scope,
|
|
12055
12271
|
style: { left: `${pos.left}%`, width: `${pos.width}%`, ...vars2({ "--uix-timeline-clip": scope.clip }) }
|
|
12056
12272
|
};
|
|
12057
|
-
const text = scope.labelTops.map((top) => /* @__PURE__ */ (0,
|
|
12058
|
-
overlay.kindLabel && /* @__PURE__ */ (0,
|
|
12059
|
-
/* @__PURE__ */ (0,
|
|
12060
|
-
overlay.scopeLabel && /* @__PURE__ */ (0,
|
|
12273
|
+
const text = scope.labelTops.map((top) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("span", { className: "uix-scheduling-timeline__overlay-label", style: vars2({ "--uix-timeline-label-top": top }), children: [
|
|
12274
|
+
overlay.kindLabel && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__overlay-kind", children: overlay.kindLabel }),
|
|
12275
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__overlay-name", children: overlay.label }),
|
|
12276
|
+
overlay.scopeLabel && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__overlay-scope", children: overlay.scopeLabel })
|
|
12061
12277
|
] }, top));
|
|
12062
|
-
return onSelectOverlay ? /* @__PURE__ */ (0,
|
|
12278
|
+
return onSelectOverlay ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("button", { type: "button", ...shared, "aria-label": overlayName(overlay), onClick: () => onSelectOverlay(overlay), children: text }, key) : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { ...shared, "aria-hidden": "true", children: text }, key);
|
|
12063
12279
|
};
|
|
12064
12280
|
const renderMarker2 = (marker, key, scope) => {
|
|
12065
12281
|
const pos = placeSpan({ start: marker.at, end: marker.at }, range);
|
|
12066
12282
|
if (!pos || !scope) return null;
|
|
12067
|
-
return /* @__PURE__ */ (0,
|
|
12283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__marker", "data-marker-id": marker.id, "data-scope": scope.scope, style: { left: `${pos.left}%`, ...vars2({ "--uix-timeline-clip": scope.clip }) }, title: marker.label, "aria-hidden": "true" }, key);
|
|
12068
12284
|
};
|
|
12069
12285
|
const overlayKeys = uniqueKeys2(overlays.map((overlay) => overlay.id));
|
|
12070
12286
|
const markerKeys = uniqueKeys2(markers.map((marker) => marker.id));
|
|
@@ -12089,7 +12305,7 @@ function SchedulingTimeline({
|
|
|
12089
12305
|
const movable = canMove(item);
|
|
12090
12306
|
const described = movable || canResize(item);
|
|
12091
12307
|
const itemMarkers = markersOf(item);
|
|
12092
|
-
return /* @__PURE__ */ (0,
|
|
12308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("li", { className: "uix-scheduling-timeline__slot", style: { left: `${shown.left}%`, width: `${shown.width}%`, ...vars2({ "--uix-timeline-row": p.row }) }, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12093
12309
|
"button",
|
|
12094
12310
|
{
|
|
12095
12311
|
type: "button",
|
|
@@ -12127,9 +12343,9 @@ function SchedulingTimeline({
|
|
|
12127
12343
|
onSelectItem?.(item);
|
|
12128
12344
|
},
|
|
12129
12345
|
children: [
|
|
12130
|
-
/* @__PURE__ */ (0,
|
|
12131
|
-
item.meta && /* @__PURE__ */ (0,
|
|
12132
|
-
itemMarkers.length > 0 && /* @__PURE__ */ (0,
|
|
12346
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__item-title", children: renderItem?.(item) ?? item.title }),
|
|
12347
|
+
item.meta && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__item-meta", children: item.meta }),
|
|
12348
|
+
itemMarkers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__item-markers", children: itemMarkers.map((marker) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ItemMarker, { marker }, marker.id)) })
|
|
12133
12349
|
]
|
|
12134
12350
|
}
|
|
12135
12351
|
) }, row.keys[index]);
|
|
@@ -12137,41 +12353,41 @@ function SchedulingTimeline({
|
|
|
12137
12353
|
const renderRow = (row, rowIndex) => {
|
|
12138
12354
|
if (row.kind === "head") {
|
|
12139
12355
|
const { group, collapsed } = row;
|
|
12140
|
-
return /* @__PURE__ */ (0,
|
|
12141
|
-
/* @__PURE__ */ (0,
|
|
12142
|
-
/* @__PURE__ */ (0,
|
|
12143
|
-
/* @__PURE__ */ (0,
|
|
12144
|
-
/* @__PURE__ */ (0,
|
|
12356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: cx("uix-scheduling-timeline__row", "uix-scheduling-timeline__row--group", collapsed && "uix-scheduling-timeline__row--summary"), "data-row-key": row.key, "data-group-id": group.id, "data-collapsed": collapsed || void 0, "data-strip": strips.has(rowIndex) || void 0, children: [
|
|
12357
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "uix-scheduling-timeline__group-head", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "uix-scheduling-timeline__group-label", children: [
|
|
12358
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("button", { type: "button", className: "uix-scheduling-timeline__group-toggle", "aria-expanded": !collapsed, onClick: () => toggleGroup(group), children: [
|
|
12359
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__group-chevron", "aria-hidden": "true" }),
|
|
12360
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__group-name", id: `${id}-group-${row.groupIndex}`, children: group.label })
|
|
12145
12361
|
] }),
|
|
12146
|
-
group.meta != null && /* @__PURE__ */ (0,
|
|
12147
|
-
collapsed && group.summary && /* @__PURE__ */ (0,
|
|
12148
|
-
/* @__PURE__ */ (0,
|
|
12149
|
-
group.summary.markers && group.summary.markers.length > 0 && /* @__PURE__ */ (0,
|
|
12362
|
+
group.meta != null && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__group-meta", children: group.meta }),
|
|
12363
|
+
collapsed && group.summary && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("span", { className: "uix-scheduling-timeline__group-summary", children: [
|
|
12364
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__group-count", children: fillLabel(labels.groupSummary, { count: group.summary.count }) }),
|
|
12365
|
+
group.summary.markers && group.summary.markers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__item-markers", children: group.summary.markers.map((marker) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ItemMarker, { marker, showLabel: true }, marker.id)) })
|
|
12150
12366
|
] })
|
|
12151
12367
|
] }) }),
|
|
12152
|
-
strips.has(rowIndex) && /* @__PURE__ */ (0,
|
|
12368
|
+
strips.has(rowIndex) && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "uix-scheduling-timeline__group-strip", "aria-hidden": "true" })
|
|
12153
12369
|
] }, row.key);
|
|
12154
12370
|
}
|
|
12155
12371
|
const { lane } = row;
|
|
12156
12372
|
const laneLabelId = `${id}-lane-${row.laneIndex}`;
|
|
12157
12373
|
const ghostPlaced = ghost ? row.placed.find((p) => p.item.id === ghost.id) : void 0;
|
|
12158
12374
|
const ghostPos = ghost && ghostPlaced && rowOfItem.get(ghost.id) === rowIndex ? placeSpan(ghost.proposal, range) : null;
|
|
12159
|
-
return /* @__PURE__ */ (0,
|
|
12160
|
-
/* @__PURE__ */ (0,
|
|
12161
|
-
/* @__PURE__ */ (0,
|
|
12162
|
-
lane.meta != null && /* @__PURE__ */ (0,
|
|
12375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "uix-scheduling-timeline__row", "data-row-key": row.key, "data-lane-id": lane.id, style: vars2({ "--uix-timeline-rows": row.subRows }), children: [
|
|
12376
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "uix-scheduling-timeline__lane-label", id: laneLabelId, children: [
|
|
12377
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__lane-name", children: lane.label }),
|
|
12378
|
+
lane.meta != null && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__lane-meta", children: lane.meta })
|
|
12163
12379
|
] }),
|
|
12164
|
-
/* @__PURE__ */ (0,
|
|
12380
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "uix-scheduling-timeline__track", style: trackStyle, children: [
|
|
12165
12381
|
overlays.map((overlay, index) => !inLayer(overlay) && lanesOf(overlay).has(lane.id) ? renderOverlay(overlay, overlayKeys[index], IN_LANE) : null),
|
|
12166
12382
|
markers.map((marker, index) => !inLayer(marker) && lanesOf(marker).has(lane.id) ? renderMarker2(marker, markerKeys[index], IN_LANE) : null),
|
|
12167
|
-
/* @__PURE__ */ (0,
|
|
12168
|
-
ghostPos && /* @__PURE__ */ (0,
|
|
12383
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("ul", { className: "uix-scheduling-timeline__items", "aria-labelledby": row.groupIndex === void 0 ? laneLabelId : `${id}-group-${row.groupIndex} ${laneLabelId}`, children: renderItems(row, rowIndex) }),
|
|
12384
|
+
ghostPos && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__ghost", "aria-hidden": "true", "data-sent": ghost?.source === "sent" || void 0, style: { left: `${ghostPos.left}%`, width: `${ghostPos.width}%`, ...vars2({ "--uix-timeline-row": ghostPlaced.row }) } })
|
|
12169
12385
|
] })
|
|
12170
12386
|
] }, row.key);
|
|
12171
12387
|
};
|
|
12172
12388
|
const body = [];
|
|
12173
12389
|
let cursor = 0;
|
|
12174
|
-
const spacer = (from, to) => /* @__PURE__ */ (0,
|
|
12390
|
+
const spacer = (from, to) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "uix-scheduling-timeline__spacer", "aria-hidden": "true", style: { height: extentCss(between(extents[from], extents[to])) } }, `spacer-${from}`);
|
|
12175
12391
|
for (const index of mounted) {
|
|
12176
12392
|
if (index > cursor) body.push(spacer(cursor, index));
|
|
12177
12393
|
body.push(renderRow(rows[index], index));
|
|
@@ -12179,7 +12395,7 @@ function SchedulingTimeline({
|
|
|
12179
12395
|
}
|
|
12180
12396
|
if (cursor < rows.length) body.push(spacer(cursor, rows.length));
|
|
12181
12397
|
const listed = onSelectOverlay ? EMPTY_OVERLAYS2 : overlays;
|
|
12182
|
-
return /* @__PURE__ */ (0,
|
|
12398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12183
12399
|
"section",
|
|
12184
12400
|
{
|
|
12185
12401
|
ref: rootRef,
|
|
@@ -12194,45 +12410,45 @@ function SchedulingTimeline({
|
|
|
12194
12410
|
}
|
|
12195
12411
|
},
|
|
12196
12412
|
children: [
|
|
12197
|
-
notice != null && notice !== false && /* @__PURE__ */ (0,
|
|
12198
|
-
loading ? /* @__PURE__ */ (0,
|
|
12199
|
-
/* @__PURE__ */ (0,
|
|
12200
|
-
onRetry && /* @__PURE__ */ (0,
|
|
12201
|
-
] }) : /* @__PURE__ */ (0,
|
|
12202
|
-
(listed.length > 0 || markers.length > 0) && /* @__PURE__ */ (0,
|
|
12203
|
-
/* @__PURE__ */ (0,
|
|
12204
|
-
/* @__PURE__ */ (0,
|
|
12205
|
-
listed.map((o, index) => /* @__PURE__ */ (0,
|
|
12413
|
+
notice != null && notice !== false && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "uix-scheduling-timeline__notice", children: notice }),
|
|
12414
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "uix-scheduling-timeline__state", role: "status", children: labels.loading }) : error ? /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "uix-scheduling-timeline__state", role: "alert", children: [
|
|
12415
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("p", { children: error }),
|
|
12416
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("button", { type: "button", className: "uix-btn uix-btn--secondary", onClick: onRetry, children: labels.retry })
|
|
12417
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_jsx_runtime90.Fragment, { children: [
|
|
12418
|
+
(listed.length > 0 || markers.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "uix-visually-hidden", children: [
|
|
12419
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("p", { id: `${id}-windows`, children: labels.windows }),
|
|
12420
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("ul", { "aria-labelledby": `${id}-windows`, children: [
|
|
12421
|
+
listed.map((o, index) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("li", { children: o.accessibleName ?? /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_jsx_runtime90.Fragment, { children: [
|
|
12206
12422
|
o.kindLabel === void 0 && o.kind ? `${labels.overlays[o.kind]}: ${o.label}${o.scopeLabel ? `, ${o.scopeLabel}` : ""}` : overlayWords(o),
|
|
12207
12423
|
", ",
|
|
12208
12424
|
fmtInstant(o.start),
|
|
12209
12425
|
" \u2013 ",
|
|
12210
12426
|
fmtInstant(o.end)
|
|
12211
12427
|
] }) }, overlayKeys[index])),
|
|
12212
|
-
markers.map((m, index) => /* @__PURE__ */ (0,
|
|
12428
|
+
markers.map((m, index) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("li", { children: [
|
|
12213
12429
|
m.label,
|
|
12214
12430
|
", ",
|
|
12215
12431
|
fmtInstant(m.at)
|
|
12216
12432
|
] }, markerKeys[index]))
|
|
12217
12433
|
] })
|
|
12218
12434
|
] }),
|
|
12219
|
-
/* @__PURE__ */ (0,
|
|
12220
|
-
/* @__PURE__ */ (0,
|
|
12221
|
-
/* @__PURE__ */ (0,
|
|
12222
|
-
/* @__PURE__ */ (0,
|
|
12223
|
-
/* @__PURE__ */ (0,
|
|
12224
|
-
ticks.map((tick) => /* @__PURE__ */ (0,
|
|
12435
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { ref: setScroller, className: "uix-scheduling-timeline__scroller", "data-virtual": virtual || void 0, "data-scroll-y": maxHeight !== void 0 || void 0, style: maxHeight !== void 0 ? { maxHeight } : void 0, children: [
|
|
12436
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "uix-scheduling-timeline__grid", "data-sub-ticks": minorTicks.length > 0 || void 0, children: [
|
|
12437
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "uix-scheduling-timeline__row uix-scheduling-timeline__row--axis", "aria-hidden": "true", children: [
|
|
12438
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "uix-scheduling-timeline__lane-label", children: labels.lanes }),
|
|
12439
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "uix-scheduling-timeline__track uix-scheduling-timeline__axis", style: trackStyle, children: [
|
|
12440
|
+
ticks.map((tick) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__tick", "data-major": tick.major || void 0, style: { left: `${tick.offset}%` }, children: tick.offset < 100 && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("span", { className: "uix-scheduling-timeline__tick-label", children: [
|
|
12225
12441
|
fmtTick(tick.at),
|
|
12226
|
-
tick.offsetLabel && /* @__PURE__ */ (0,
|
|
12442
|
+
tick.offsetLabel && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__tick-offset", children: tick.offsetLabel })
|
|
12227
12443
|
] }) }, tick.at)),
|
|
12228
|
-
minorTicks.map((tick) => /* @__PURE__ */ (0,
|
|
12444
|
+
minorTicks.map((tick) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__tick", "data-minor": "true", style: { left: `${tick.offset}%` }, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__tick-label", children: formatTick?.(new Date(tick.at), "hour") ?? tick.label }) }, `minor-${tick.at}`))
|
|
12229
12445
|
] })
|
|
12230
12446
|
] }),
|
|
12231
|
-
columnNoteList.length > 0 && /* @__PURE__ */ (0,
|
|
12232
|
-
/* @__PURE__ */ (0,
|
|
12233
|
-
/* @__PURE__ */ (0,
|
|
12447
|
+
columnNoteList.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "uix-scheduling-timeline__row uix-scheduling-timeline__row--notes", children: [
|
|
12448
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "uix-scheduling-timeline__lane-label" }),
|
|
12449
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "uix-scheduling-timeline__track", style: trackStyle, children: columnNoteList.map(({ date, node, pos }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "uix-scheduling-timeline__column-note", "data-date": date, style: { left: `${pos.left}%`, width: `${pos.width}%` }, children: node }, date)) })
|
|
12234
12450
|
] }),
|
|
12235
|
-
/* @__PURE__ */ (0,
|
|
12451
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12236
12452
|
"div",
|
|
12237
12453
|
{
|
|
12238
12454
|
ref: bodyRef,
|
|
@@ -12242,15 +12458,15 @@ function SchedulingTimeline({
|
|
|
12242
12458
|
if (!event.currentTarget.contains(event.relatedTarget)) setFocusRowKey(null);
|
|
12243
12459
|
},
|
|
12244
12460
|
children: [
|
|
12245
|
-
/* @__PURE__ */ (0,
|
|
12246
|
-
/* @__PURE__ */ (0,
|
|
12247
|
-
/* @__PURE__ */ (0,
|
|
12248
|
-
/* @__PURE__ */ (0,
|
|
12249
|
-
ticks.map((tick) => /* @__PURE__ */ (0,
|
|
12250
|
-
minorTicks.map((tick) => /* @__PURE__ */ (0,
|
|
12461
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "uix-scheduling-timeline__layer", children: [
|
|
12462
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "uix-scheduling-timeline__lane-label", "aria-hidden": "true" }),
|
|
12463
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { ref: setLayerTrack, className: "uix-scheduling-timeline__track", style: trackStyle, children: [
|
|
12464
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { ref: barMinRef, className: "uix-scheduling-timeline__bar-min", "aria-hidden": "true" }),
|
|
12465
|
+
ticks.map((tick) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__gridline", "data-major": tick.major || void 0, style: { left: `${tick.offset}%` }, "aria-hidden": "true" }, tick.at)),
|
|
12466
|
+
minorTicks.map((tick) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__gridline", "data-minor": "true", style: { left: `${tick.offset}%` }, "aria-hidden": "true" }, `minor-${tick.at}`)),
|
|
12251
12467
|
overlays.map((overlay, index) => inLayer(overlay) ? renderOverlay(overlay, overlayKeys[index], scopeOf(lanesOf(overlay))) : null),
|
|
12252
12468
|
markers.map((marker, index) => inLayer(marker) ? renderMarker2(marker, markerKeys[index], scopeOf(lanesOf(marker))) : null),
|
|
12253
|
-
nowPos && /* @__PURE__ */ (0,
|
|
12469
|
+
nowPos && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__now", style: { left: `${nowPos.left}%` }, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-scheduling-timeline__now-label", children: labels.now }) })
|
|
12254
12470
|
] })
|
|
12255
12471
|
] }),
|
|
12256
12472
|
body
|
|
@@ -12258,16 +12474,16 @@ function SchedulingTimeline({
|
|
|
12258
12474
|
}
|
|
12259
12475
|
)
|
|
12260
12476
|
] }),
|
|
12261
|
-
virtual && /* @__PURE__ */ (0,
|
|
12262
|
-
/* @__PURE__ */ (0,
|
|
12263
|
-
/* @__PURE__ */ (0,
|
|
12264
|
-
/* @__PURE__ */ (0,
|
|
12477
|
+
virtual && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("span", { ref: probeRef, className: "uix-scheduling-timeline__probe", "aria-hidden": "true", children: [
|
|
12478
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", {}),
|
|
12479
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", {}),
|
|
12480
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", {})
|
|
12265
12481
|
] })
|
|
12266
12482
|
] }),
|
|
12267
|
-
nothingToShow && /* @__PURE__ */ (0,
|
|
12483
|
+
nothingToShow && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("p", { className: "uix-scheduling-timeline__empty", children: labels.empty })
|
|
12268
12484
|
] }),
|
|
12269
|
-
hint && /* @__PURE__ */ (0,
|
|
12270
|
-
/* @__PURE__ */ (0,
|
|
12485
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { id: hintId, className: "uix-visually-hidden", children: hint }),
|
|
12486
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "uix-visually-hidden", role: "status", "aria-live": "polite", children: announcement })
|
|
12271
12487
|
]
|
|
12272
12488
|
}
|
|
12273
12489
|
);
|
|
@@ -12349,7 +12565,7 @@ function timeZoneName(timeZone, date, locale) {
|
|
|
12349
12565
|
|
|
12350
12566
|
// src/components/DateFieldParts.tsx
|
|
12351
12567
|
var import_react65 = require("react");
|
|
12352
|
-
var
|
|
12568
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
12353
12569
|
var localDateKey = (now = /* @__PURE__ */ new Date()) => `${now.getFullYear().toString().padStart(4, "0")}-${(now.getMonth() + 1).toString().padStart(2, "0")}-${now.getDate().toString().padStart(2, "0")}`;
|
|
12354
12570
|
var utc = (date) => /* @__PURE__ */ new Date(`${date}T00:00:00Z`);
|
|
12355
12571
|
var monthLabel = (date, locale) => new Intl.DateTimeFormat(locale, { month: "long", year: "numeric", timeZone: "UTC" }).format(utc(date));
|
|
@@ -12493,22 +12709,22 @@ function MonthCalendar({
|
|
|
12493
12709
|
};
|
|
12494
12710
|
const atMin = !!min && month <= startOfMonth(min);
|
|
12495
12711
|
const atMax = !!max && month >= startOfMonth(max);
|
|
12496
|
-
return /* @__PURE__ */ (0,
|
|
12497
|
-
/* @__PURE__ */ (0,
|
|
12498
|
-
/* @__PURE__ */ (0,
|
|
12712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "uix-date-picker__calendar", children: [
|
|
12713
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "uix-date-picker__nav", children: [
|
|
12714
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("button", { type: "button", className: "uix-date-picker__nav-btn", "aria-label": labels.previousMonth, "aria-disabled": atMin || void 0, onClick: () => {
|
|
12499
12715
|
if (!atMin) showMonth(-1);
|
|
12500
|
-
}, children: /* @__PURE__ */ (0,
|
|
12501
|
-
/* @__PURE__ */ (0,
|
|
12502
|
-
/* @__PURE__ */ (0,
|
|
12716
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ChevronLeftIcon, { size: "sm" }) }),
|
|
12717
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "uix-date-picker__month", "aria-live": "polite", children: monthLabel(month, locale) }),
|
|
12718
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("button", { type: "button", className: "uix-date-picker__nav-btn", "aria-label": labels.nextMonth, "aria-disabled": atMax || void 0, onClick: () => {
|
|
12503
12719
|
if (!atMax) showMonth(1);
|
|
12504
|
-
}, children: /* @__PURE__ */ (0,
|
|
12720
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ChevronRightIcon, { size: "sm" }) })
|
|
12505
12721
|
] }),
|
|
12506
|
-
/* @__PURE__ */ (0,
|
|
12507
|
-
/* @__PURE__ */ (0,
|
|
12508
|
-
Array.from({ length: blanks }, (_, index) => /* @__PURE__ */ (0,
|
|
12722
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "uix-date-range-picker__weekdays", "aria-hidden": "true", children: weekdays.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { children: day }, index)) }),
|
|
12723
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { ref: gridRef, className: "uix-date-range-picker__grid uix-date-picker__grid", role: "group", "aria-label": monthLabel(month, locale), children: [
|
|
12724
|
+
Array.from({ length: blanks }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { "aria-hidden": "true" }, `blank-${index}`)),
|
|
12509
12725
|
days.map((day) => {
|
|
12510
12726
|
const off = unavailable(day.date);
|
|
12511
|
-
return /* @__PURE__ */ (0,
|
|
12727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
12512
12728
|
"button",
|
|
12513
12729
|
{
|
|
12514
12730
|
type: "button",
|
|
@@ -12534,7 +12750,7 @@ function MonthCalendar({
|
|
|
12534
12750
|
}
|
|
12535
12751
|
|
|
12536
12752
|
// src/components/DateRangePicker.tsx
|
|
12537
|
-
var
|
|
12753
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
12538
12754
|
var DEFAULT_DATE_RANGE_PICKER_LABELS = {
|
|
12539
12755
|
previous: "Previous",
|
|
12540
12756
|
previousMonth: "Show previous month",
|
|
@@ -12630,23 +12846,23 @@ function RangeCalendar({
|
|
|
12630
12846
|
}
|
|
12631
12847
|
};
|
|
12632
12848
|
const announcement = !value.start ? labels.noneSelected : !value.end ? labels.startSelected.replace("{start}", dateLabel(value.start, locale)) : labels.rangeSelected.replace("{start}", dateLabel(value.start, locale)).replace("{end}", dateLabel(value.end, locale));
|
|
12633
|
-
return /* @__PURE__ */ (0,
|
|
12634
|
-
/* @__PURE__ */ (0,
|
|
12635
|
-
/* @__PURE__ */ (0,
|
|
12636
|
-
/* @__PURE__ */ (0,
|
|
12637
|
-
/* @__PURE__ */ (0,
|
|
12638
|
-
/* @__PURE__ */ (0,
|
|
12849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("section", { className: cx("uix-date-range-picker", rangeInvalid && "uix-date-range-picker--invalid", className), "aria-labelledby": `${id}-label`, children: [
|
|
12850
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "uix-date-range-picker__header", children: [
|
|
12851
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("h3", { id: `${id}-label`, children: label }),
|
|
12852
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { children: [
|
|
12853
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("button", { type: "button", className: "uix-btn uix-btn--ghost uix-btn--sm", onClick: () => setMonth(addCalendarMonths(visibleMonth, -1)), "aria-label": labels.previousMonth, children: labels.previous }),
|
|
12854
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("button", { type: "button", className: "uix-btn uix-btn--ghost uix-btn--sm", onClick: () => setMonth(addCalendarMonths(visibleMonth, 1)), "aria-label": labels.nextMonth, children: labels.next })
|
|
12639
12855
|
] })
|
|
12640
12856
|
] }),
|
|
12641
|
-
/* @__PURE__ */ (0,
|
|
12642
|
-
/* @__PURE__ */ (0,
|
|
12643
|
-
/* @__PURE__ */ (0,
|
|
12644
|
-
/* @__PURE__ */ (0,
|
|
12645
|
-
Array.from({ length: ((/* @__PURE__ */ new Date(`${month}T00:00:00Z`)).getUTCDay() - weekStartsOn + 7) % 7 }, (_, index) => /* @__PURE__ */ (0,
|
|
12857
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { ref: rootRef, className: "uix-date-range-picker__months", children: calendars.map(({ month, days }) => /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "uix-date-range-picker__month", children: [
|
|
12858
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("h4", { children: monthLabel2(month, locale) }),
|
|
12859
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "uix-date-range-picker__weekdays", "aria-hidden": "true", children: weekdays.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { children: day }, index)) }),
|
|
12860
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "uix-date-range-picker__grid", role: "group", "aria-label": monthLabel2(month, locale), children: [
|
|
12861
|
+
Array.from({ length: ((/* @__PURE__ */ new Date(`${month}T00:00:00Z`)).getUTCDay() - weekStartsOn + 7) % 7 }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { "aria-hidden": "true" }, `blank-${index}`)),
|
|
12646
12862
|
days.map((day) => {
|
|
12647
12863
|
const unavailable = disabled || isDateUnavailable(day.date, { min, max, isDisabled: isDateDisabled });
|
|
12648
12864
|
const edge = day.date === value.start ? "start" : day.date === value.end ? "end" : void 0;
|
|
12649
|
-
return /* @__PURE__ */ (0,
|
|
12865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
12650
12866
|
"button",
|
|
12651
12867
|
{
|
|
12652
12868
|
type: "button",
|
|
@@ -12668,15 +12884,15 @@ function RangeCalendar({
|
|
|
12668
12884
|
})
|
|
12669
12885
|
] })
|
|
12670
12886
|
] }, month)) }),
|
|
12671
|
-
/* @__PURE__ */ (0,
|
|
12672
|
-
rangeInvalid && /* @__PURE__ */ (0,
|
|
12887
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", { className: "uix-date-range-picker__selection", "aria-live": "polite", children: announcement }),
|
|
12888
|
+
rangeInvalid && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", { className: "uix-field__error", role: "alert", children: invalidMessage })
|
|
12673
12889
|
] });
|
|
12674
12890
|
}
|
|
12675
12891
|
function DateRangePicker({ labels: labelOverrides, ...props }) {
|
|
12676
12892
|
const uixLabels = useUixLabels();
|
|
12677
12893
|
const words = { ...DEFAULT_DATE_RANGE_PICKER_LABELS, ...uixLabels.dateRangePicker, ...labelOverrides };
|
|
12678
|
-
if (props.mode === "field") return /* @__PURE__ */ (0,
|
|
12679
|
-
return /* @__PURE__ */ (0,
|
|
12894
|
+
if (props.mode === "field") return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(DateRangeField, { ...props, words });
|
|
12895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(RangeCalendar, { ...props, words });
|
|
12680
12896
|
}
|
|
12681
12897
|
function DateRangeField(props) {
|
|
12682
12898
|
const {
|
|
@@ -12711,7 +12927,7 @@ function DateRangeField(props) {
|
|
|
12711
12927
|
const text = !value.start ? null : !value.end ? words.fieldStart.replace("{start}", format(value.start)) : words.fieldRange.replace("{start}", format(value.start)).replace("{end}", format(value.end));
|
|
12712
12928
|
const rangeInvalid = invalid || !!value.start && !!value.end && value.start > value.end;
|
|
12713
12929
|
const describedBy = [ariaDescribedBy, labelled && text ? valueId : void 0].filter(Boolean).join(" ") || void 0;
|
|
12714
|
-
return /* @__PURE__ */ (0,
|
|
12930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
12715
12931
|
"div",
|
|
12716
12932
|
{
|
|
12717
12933
|
ref: anchorRef,
|
|
@@ -12723,7 +12939,7 @@ function DateRangeField(props) {
|
|
|
12723
12939
|
hide();
|
|
12724
12940
|
},
|
|
12725
12941
|
children: [
|
|
12726
|
-
/* @__PURE__ */ (0,
|
|
12942
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
12727
12943
|
"button",
|
|
12728
12944
|
{
|
|
12729
12945
|
ref: triggerRef,
|
|
@@ -12735,16 +12951,16 @@ function DateRangeField(props) {
|
|
|
12735
12951
|
"aria-invalid": rangeInvalid || ariaInvalid === true || ariaInvalid === "true" || void 0,
|
|
12736
12952
|
...triggerProps,
|
|
12737
12953
|
children: [
|
|
12738
|
-
/* @__PURE__ */ (0,
|
|
12739
|
-
/* @__PURE__ */ (0,
|
|
12954
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "uix-date-range-field__icon", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CalendarIcon, { size: "sm" }) }),
|
|
12955
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("span", { className: "uix-visually-hidden", children: [
|
|
12740
12956
|
label,
|
|
12741
12957
|
": "
|
|
12742
12958
|
] }),
|
|
12743
|
-
/* @__PURE__ */ (0,
|
|
12959
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { id: valueId, className: cx("uix-date-range-field__value", !text && "uix-date-range-field__value--empty"), children: text ?? words.placeholder })
|
|
12744
12960
|
]
|
|
12745
12961
|
}
|
|
12746
12962
|
),
|
|
12747
|
-
/* @__PURE__ */ (0,
|
|
12963
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
12748
12964
|
Popover,
|
|
12749
12965
|
{
|
|
12750
12966
|
id: popoverId,
|
|
@@ -12755,7 +12971,7 @@ function DateRangeField(props) {
|
|
|
12755
12971
|
"aria-label": label,
|
|
12756
12972
|
capHeight: true,
|
|
12757
12973
|
closeWhenAnchorHidden: true,
|
|
12758
|
-
children: open && /* @__PURE__ */ (0,
|
|
12974
|
+
children: open && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
12759
12975
|
RangeCalendar,
|
|
12760
12976
|
{
|
|
12761
12977
|
...props,
|
|
@@ -12776,7 +12992,7 @@ function DateRangeField(props) {
|
|
|
12776
12992
|
|
|
12777
12993
|
// src/components/DatePicker.tsx
|
|
12778
12994
|
var import_react67 = require("react");
|
|
12779
|
-
var
|
|
12995
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
12780
12996
|
var DEFAULT_DATE_PICKER_LABELS = {
|
|
12781
12997
|
open: "Choose date",
|
|
12782
12998
|
openSelected: "Change date, {date}",
|
|
@@ -12891,7 +13107,7 @@ var DatePicker = (0, import_react67.forwardRef)(function DatePicker2({
|
|
|
12891
13107
|
const expected = placeholder ?? (parseDate ? null : pattern);
|
|
12892
13108
|
const describedBy = [ariaDescribedBy, problem ? errorId : void 0].filter(Boolean).join(" ") || void 0;
|
|
12893
13109
|
const isInvalid = !!invalid || !!problem || ariaInvalid === true || ariaInvalid === "true";
|
|
12894
|
-
return /* @__PURE__ */ (0,
|
|
13110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
|
|
12895
13111
|
"div",
|
|
12896
13112
|
{
|
|
12897
13113
|
ref: anchorRef,
|
|
@@ -12904,8 +13120,8 @@ var DatePicker = (0, import_react67.forwardRef)(function DatePicker2({
|
|
|
12904
13120
|
hide();
|
|
12905
13121
|
},
|
|
12906
13122
|
children: [
|
|
12907
|
-
/* @__PURE__ */ (0,
|
|
12908
|
-
/* @__PURE__ */ (0,
|
|
13123
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "uix-date-picker__control", children: [
|
|
13124
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
12909
13125
|
"input",
|
|
12910
13126
|
{
|
|
12911
13127
|
ref: inputRef,
|
|
@@ -12934,7 +13150,7 @@ var DatePicker = (0, import_react67.forwardRef)(function DatePicker2({
|
|
|
12934
13150
|
onKeyDown: onInputKeyDown
|
|
12935
13151
|
}
|
|
12936
13152
|
),
|
|
12937
|
-
/* @__PURE__ */ (0,
|
|
13153
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
12938
13154
|
"button",
|
|
12939
13155
|
{
|
|
12940
13156
|
type: "button",
|
|
@@ -12942,13 +13158,13 @@ var DatePicker = (0, import_react67.forwardRef)(function DatePicker2({
|
|
|
12942
13158
|
disabled: locked,
|
|
12943
13159
|
"aria-label": value && isValidDateKey(value) ? fillLabel(labels.openSelected, { date: fullDateLabel(value, locale) }) : labels.open,
|
|
12944
13160
|
...triggerProps,
|
|
12945
|
-
children: /* @__PURE__ */ (0,
|
|
13161
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(CalendarIcon, { size: "sm" })
|
|
12946
13162
|
}
|
|
12947
13163
|
)
|
|
12948
13164
|
] }),
|
|
12949
|
-
name && /* @__PURE__ */ (0,
|
|
12950
|
-
problem && /* @__PURE__ */ (0,
|
|
12951
|
-
/* @__PURE__ */ (0,
|
|
13165
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("input", { type: "hidden", name, value: value ?? "", disabled }),
|
|
13166
|
+
problem && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { id: errorId, className: "uix-field__error uix-date-picker__error", role: "alert", children: problem !== "format" ? labels.unavailable : expected ? fillLabel(labels.invalidDate, { pattern: expected }) : labels.notADate }),
|
|
13167
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
12952
13168
|
Popover,
|
|
12953
13169
|
{
|
|
12954
13170
|
id: popoverId,
|
|
@@ -12958,7 +13174,7 @@ var DatePicker = (0, import_react67.forwardRef)(function DatePicker2({
|
|
|
12958
13174
|
role: "dialog",
|
|
12959
13175
|
"aria-label": labels.calendar,
|
|
12960
13176
|
closeWhenAnchorHidden: true,
|
|
12961
|
-
children: open && /* @__PURE__ */ (0,
|
|
13177
|
+
children: open && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
12962
13178
|
MonthCalendar,
|
|
12963
13179
|
{
|
|
12964
13180
|
value,
|
|
@@ -13036,7 +13252,7 @@ var DateTimePicker = (0, import_react67.forwardRef)(function DateTimePicker2({
|
|
|
13036
13252
|
const zoneText = timeZoneLabel === null ? null : timeZoneLabel ?? (zone ? timeZoneName(zone, date, locale) : null);
|
|
13037
13253
|
const timeName = grouped ? labels.time : fieldLabel ? fillLabel(labels.timeOf, { label: fieldLabel }) : labels.time;
|
|
13038
13254
|
const step = Math.max(1, Math.round(minuteStep)) * 60;
|
|
13039
|
-
return /* @__PURE__ */ (0,
|
|
13255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
|
|
13040
13256
|
"div",
|
|
13041
13257
|
{
|
|
13042
13258
|
className: cx("uix-date-time-picker", size === "sm" && "uix-date-time-picker--sm", className),
|
|
@@ -13045,7 +13261,7 @@ var DateTimePicker = (0, import_react67.forwardRef)(function DateTimePicker2({
|
|
|
13045
13261
|
"aria-label": ariaLabel,
|
|
13046
13262
|
"aria-labelledby": ariaLabelledBy,
|
|
13047
13263
|
children: [
|
|
13048
|
-
/* @__PURE__ */ (0,
|
|
13264
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
13049
13265
|
DatePicker,
|
|
13050
13266
|
{
|
|
13051
13267
|
...dateProps,
|
|
@@ -13072,7 +13288,7 @@ var DateTimePicker = (0, import_react67.forwardRef)(function DateTimePicker2({
|
|
|
13072
13288
|
}
|
|
13073
13289
|
}
|
|
13074
13290
|
),
|
|
13075
|
-
/* @__PURE__ */ (0,
|
|
13291
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
13076
13292
|
"input",
|
|
13077
13293
|
{
|
|
13078
13294
|
type: "time",
|
|
@@ -13091,11 +13307,11 @@ var DateTimePicker = (0, import_react67.forwardRef)(function DateTimePicker2({
|
|
|
13091
13307
|
}
|
|
13092
13308
|
}
|
|
13093
13309
|
),
|
|
13094
|
-
zoneText && /* @__PURE__ */ (0,
|
|
13095
|
-
/* @__PURE__ */ (0,
|
|
13096
|
-
/* @__PURE__ */ (0,
|
|
13310
|
+
zoneText && /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("span", { className: "uix-date-time-picker__zone", children: [
|
|
13311
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { "aria-hidden": "true", children: zoneText }),
|
|
13312
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { id: zoneId, className: "uix-visually-hidden", children: fillLabel(labels.timeZone, { zone: zoneText }) })
|
|
13097
13313
|
] }),
|
|
13098
|
-
name && /* @__PURE__ */ (0,
|
|
13314
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("input", { type: "hidden", name, value: value ?? "", disabled })
|
|
13099
13315
|
]
|
|
13100
13316
|
}
|
|
13101
13317
|
);
|
|
@@ -13586,7 +13802,7 @@ function layeredNeighbor(layout, currentId, key) {
|
|
|
13586
13802
|
var import_react68 = require("react");
|
|
13587
13803
|
|
|
13588
13804
|
// src/components/RelationshipGraphList.tsx
|
|
13589
|
-
var
|
|
13805
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
13590
13806
|
function EquivalentRelationshipList({
|
|
13591
13807
|
nodes,
|
|
13592
13808
|
edges,
|
|
@@ -13597,19 +13813,19 @@ function EquivalentRelationshipList({
|
|
|
13597
13813
|
onOpenDetails
|
|
13598
13814
|
}) {
|
|
13599
13815
|
const labelById = new Map(nodes.map((node) => [node.id, node.label]));
|
|
13600
|
-
return /* @__PURE__ */ (0,
|
|
13601
|
-
/* @__PURE__ */ (0,
|
|
13602
|
-
/* @__PURE__ */ (0,
|
|
13816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "uix-relationship-graph__list", role: "region", "aria-label": labels.list, children: [
|
|
13817
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("h3", { children: labels.listHeading }),
|
|
13818
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("ul", { children: nodes.map((node) => {
|
|
13603
13819
|
const neighbors = relationshipNeighbors(node.id, edges).map((id) => labelById.get(id) ?? id);
|
|
13604
|
-
return /* @__PURE__ */ (0,
|
|
13605
|
-
/* @__PURE__ */ (0,
|
|
13606
|
-
/* @__PURE__ */ (0,
|
|
13607
|
-
node.type && /* @__PURE__ */ (0,
|
|
13608
|
-
/* @__PURE__ */ (0,
|
|
13820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("li", { "data-selected": selectedId === node.id || void 0, children: [
|
|
13821
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("button", { type: "button", onClick: () => onSelect(node.id), "aria-pressed": selectedId === node.id, children: [
|
|
13822
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("strong", { children: node.label }),
|
|
13823
|
+
node.type && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: node.type }),
|
|
13824
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { children: neighbors.length ? labels.connectedTo(neighbors.join(", ")) : labels.noConnections })
|
|
13609
13825
|
] }),
|
|
13610
|
-
/* @__PURE__ */ (0,
|
|
13611
|
-
onExpandNeighbors && /* @__PURE__ */ (0,
|
|
13612
|
-
onOpenDetails && /* @__PURE__ */ (0,
|
|
13826
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("span", { className: "uix-relationship-graph__list-actions", children: [
|
|
13827
|
+
onExpandNeighbors && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("button", { type: "button", onClick: () => onExpandNeighbors(node), children: labels.expandNeighbors }),
|
|
13828
|
+
onOpenDetails && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("button", { type: "button", onClick: () => onOpenDetails(node), children: labels.openDetails })
|
|
13613
13829
|
] })
|
|
13614
13830
|
] }, node.id);
|
|
13615
13831
|
}) })
|
|
@@ -13617,7 +13833,7 @@ function EquivalentRelationshipList({
|
|
|
13617
13833
|
}
|
|
13618
13834
|
|
|
13619
13835
|
// src/components/RelationshipGraphLayered.tsx
|
|
13620
|
-
var
|
|
13836
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
13621
13837
|
var EMPTY_IDS2 = /* @__PURE__ */ new Set();
|
|
13622
13838
|
var MIN_ZOOM = 0.4;
|
|
13623
13839
|
var MAX_ZOOM = 1.5;
|
|
@@ -13890,21 +14106,21 @@ function LayeredRelationshipGraph({
|
|
|
13890
14106
|
height: layout.height,
|
|
13891
14107
|
transform: `translate(${view.x}px, ${view.y}px) scale(${view.zoom})`
|
|
13892
14108
|
};
|
|
13893
|
-
return /* @__PURE__ */ (0,
|
|
13894
|
-
/* @__PURE__ */ (0,
|
|
13895
|
-
/* @__PURE__ */ (0,
|
|
13896
|
-
/* @__PURE__ */ (0,
|
|
13897
|
-
/* @__PURE__ */ (0,
|
|
13898
|
-
/* @__PURE__ */ (0,
|
|
13899
|
-
/* @__PURE__ */ (0,
|
|
13900
|
-
/* @__PURE__ */ (0,
|
|
13901
|
-
/* @__PURE__ */ (0,
|
|
13902
|
-
/* @__PURE__ */ (0,
|
|
13903
|
-
/* @__PURE__ */ (0,
|
|
14109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("section", { className: cx("uix-relationship-graph", "uix-relationship-graph--layered", density === "compact" && "uix-relationship-graph--compact", className), "aria-label": labels.graph, children: [
|
|
14110
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "uix-relationship-graph__toolbar", role: "group", "aria-label": labels.controls, children: [
|
|
14111
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("button", { type: "button", onClick: () => zoomBy(ZOOM_STEP), disabled: view.zoom >= MAX_ZOOM, children: labels.zoomIn }),
|
|
14112
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("button", { type: "button", onClick: () => zoomBy(1 / ZOOM_STEP), disabled: view.zoom <= MIN_ZOOM, children: labels.zoomOut }),
|
|
14113
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("button", { type: "button", onClick: () => moveView(fitView(layout, size), true), children: labels.fit }),
|
|
14114
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("button", { type: "button", onClick: () => moveView(initialView(layout, size), true), children: labels.reset }),
|
|
14115
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("button", { type: "button", onClick: () => panBy(PAN_STEP, 0), "aria-label": labels.panLeft, children: labels.left }),
|
|
14116
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("button", { type: "button", onClick: () => panBy(0, PAN_STEP), "aria-label": labels.panUp, children: labels.up }),
|
|
14117
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("button", { type: "button", onClick: () => panBy(0, -PAN_STEP), "aria-label": labels.panDown, children: labels.down }),
|
|
14118
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("button", { type: "button", onClick: () => panBy(-PAN_STEP, 0), "aria-label": labels.panRight, children: labels.right }),
|
|
14119
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { "aria-live": "polite", children: labels.zoomLevel(Math.round(view.zoom * 100)) })
|
|
13904
14120
|
] }),
|
|
13905
|
-
bounded.omittedNodeCount > 0 && /* @__PURE__ */ (0,
|
|
13906
|
-
/* @__PURE__ */ (0,
|
|
13907
|
-
/* @__PURE__ */ (0,
|
|
14121
|
+
bounded.omittedNodeCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("p", { className: "uix-relationship-graph__bounded", role: "status", children: labels.bounded(bounded.nodes.length, bounded.omittedNodeCount) }),
|
|
14122
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("p", { id: hintId, className: "uix-visually-hidden", children: labels.keyboardHint }),
|
|
14123
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
13908
14124
|
"div",
|
|
13909
14125
|
{
|
|
13910
14126
|
ref: viewportRef,
|
|
@@ -13914,11 +14130,11 @@ function LayeredRelationshipGraph({
|
|
|
13914
14130
|
onPointerMove,
|
|
13915
14131
|
onPointerUp: onPointerEnd,
|
|
13916
14132
|
onPointerCancel: onPointerEnd,
|
|
13917
|
-
children: /* @__PURE__ */ (0,
|
|
13918
|
-
/* @__PURE__ */ (0,
|
|
14133
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "uix-relationship-graph__stage", style: stageStyle, "data-animate": animate || void 0, onTransitionEnd: () => setAnimate(false), children: [
|
|
14134
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("svg", { className: "uix-relationship-graph__edges", width: layout.width, height: layout.height, "aria-hidden": "true", focusable: "false", children: layout.edges.map((edge) => {
|
|
13919
14135
|
const active = activeIds.has(edge.source) || activeIds.has(edge.target) || edge.edgeIds.some((id) => highlightedEdgeIds.has(id));
|
|
13920
14136
|
const angle = edge.arrowAngle * 180 / Math.PI;
|
|
13921
|
-
return /* @__PURE__ */ (0,
|
|
14137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
13922
14138
|
"g",
|
|
13923
14139
|
{
|
|
13924
14140
|
className: "uix-relationship-graph__link",
|
|
@@ -13928,15 +14144,15 @@ function LayeredRelationshipGraph({
|
|
|
13928
14144
|
"data-conflicted": edge.edgeIds.some((id) => conflictedEdgeIds.has(id)) || void 0,
|
|
13929
14145
|
"data-dimmed": dimmedNodeIds.has(edge.source) && dimmedNodeIds.has(edge.target) || void 0,
|
|
13930
14146
|
children: [
|
|
13931
|
-
/* @__PURE__ */ (0,
|
|
13932
|
-
edge.arrow !== "none" && /* @__PURE__ */ (0,
|
|
13933
|
-
showLabel(edge) && /* @__PURE__ */ (0,
|
|
14147
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("path", { d: edge.path }),
|
|
14148
|
+
edge.arrow !== "none" && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("polygon", { points: arrowPoints, transform: `translate(${edge.arrowX} ${edge.arrowY}) rotate(${angle})` }),
|
|
14149
|
+
showLabel(edge) && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("text", { x: edge.labelX, y: edge.labelY, textAnchor: "middle", dominantBaseline: "middle", children: (edge.kind === "cycle" ? [...edge.labelLines, labels.cycle] : edge.labelLines).map((line, index, lines) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("tspan", { x: edge.labelX, dy: index === 0 ? `${-(lines.length - 1) * 0.55}em` : "1.1em", children: line }, index)) })
|
|
13934
14150
|
]
|
|
13935
14151
|
},
|
|
13936
14152
|
edge.id
|
|
13937
14153
|
);
|
|
13938
14154
|
}) }),
|
|
13939
|
-
layout.columns.map((column) => /* @__PURE__ */ (0,
|
|
14155
|
+
layout.columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
13940
14156
|
"div",
|
|
13941
14157
|
{
|
|
13942
14158
|
className: "uix-relationship-graph__column",
|
|
@@ -13946,17 +14162,17 @@ function LayeredRelationshipGraph({
|
|
|
13946
14162
|
},
|
|
13947
14163
|
column.depth
|
|
13948
14164
|
)),
|
|
13949
|
-
/* @__PURE__ */ (0,
|
|
14165
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { role: "group", "aria-roledescription": labels.roleDescription, "aria-label": labels.graphSummary(bounded.nodes.length, bounded.edges.length), "aria-describedby": hintId, children: layout.items.map((item) => {
|
|
13950
14166
|
const selected = item.id === selectedItemId;
|
|
13951
14167
|
const dimmed = item.node ? dimmedNodeIds.has(item.node.id) : item.cluster.members.every((member) => dimmedNodeIds.has(member.id));
|
|
13952
|
-
const body = item.cluster ? renderCluster?.(item.cluster) ?? /* @__PURE__ */ (0,
|
|
13953
|
-
/* @__PURE__ */ (0,
|
|
13954
|
-
/* @__PURE__ */ (0,
|
|
13955
|
-
] }) : renderNode?.(item.node, { selected, dimmed }) ?? /* @__PURE__ */ (0,
|
|
13956
|
-
/* @__PURE__ */ (0,
|
|
13957
|
-
(item.node.type || item.node.description) && /* @__PURE__ */ (0,
|
|
14168
|
+
const body = item.cluster ? renderCluster?.(item.cluster) ?? /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
|
|
14169
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "uix-relationship-graph__item-label", children: labels.cluster(item.cluster.members.length, item.cluster.type, item.cluster.edgeLabel) }),
|
|
14170
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "uix-relationship-graph__item-meta", children: labels.expandCluster })
|
|
14171
|
+
] }) : renderNode?.(item.node, { selected, dimmed }) ?? /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
|
|
14172
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "uix-relationship-graph__item-label", children: item.node.label }),
|
|
14173
|
+
(item.node.type || item.node.description) && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "uix-relationship-graph__item-meta", children: [item.node.type, item.node.description].filter(Boolean).join(" \xB7 ") })
|
|
13958
14174
|
] });
|
|
13959
|
-
return /* @__PURE__ */ (0,
|
|
14175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
13960
14176
|
"button",
|
|
13961
14177
|
{
|
|
13962
14178
|
ref: (element) => {
|
|
@@ -13987,7 +14203,7 @@ function LayeredRelationshipGraph({
|
|
|
13987
14203
|
onPointerLeave: () => setHoverId((current) => current === item.id ? void 0 : current),
|
|
13988
14204
|
children: [
|
|
13989
14205
|
body,
|
|
13990
|
-
item.inCycle && /* @__PURE__ */ (0,
|
|
14206
|
+
item.inCycle && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "uix-relationship-graph__item-flag", "aria-hidden": "true", children: labels.cycle })
|
|
13991
14207
|
]
|
|
13992
14208
|
},
|
|
13993
14209
|
item.id
|
|
@@ -13995,7 +14211,7 @@ function LayeredRelationshipGraph({
|
|
|
13995
14211
|
}) }),
|
|
13996
14212
|
layout.items.filter((item) => item.expandedGroup).map((item) => {
|
|
13997
14213
|
const group = item.expandedGroup;
|
|
13998
|
-
return /* @__PURE__ */ (0,
|
|
14214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
13999
14215
|
"button",
|
|
14000
14216
|
{
|
|
14001
14217
|
type: "button",
|
|
@@ -14011,8 +14227,8 @@ function LayeredRelationshipGraph({
|
|
|
14011
14227
|
] })
|
|
14012
14228
|
}
|
|
14013
14229
|
),
|
|
14014
|
-
legend.length > 0 && /* @__PURE__ */ (0,
|
|
14015
|
-
showList && /* @__PURE__ */ (0,
|
|
14230
|
+
legend.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("ul", { className: "uix-relationship-graph__legend", "aria-label": labels.legend, children: legend.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("li", { "data-type": entry.id, children: entry.label }, entry.id)) }),
|
|
14231
|
+
showList && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
14016
14232
|
EquivalentRelationshipList,
|
|
14017
14233
|
{
|
|
14018
14234
|
nodes: bounded.nodes,
|
|
@@ -14031,7 +14247,7 @@ function LayeredRelationshipGraph({
|
|
|
14031
14247
|
}
|
|
14032
14248
|
|
|
14033
14249
|
// src/components/RelationshipGraph.tsx
|
|
14034
|
-
var
|
|
14250
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
14035
14251
|
var DEFAULT_RELATIONSHIP_GRAPH_LABELS = {
|
|
14036
14252
|
graph: "Relationship graph",
|
|
14037
14253
|
controls: "Graph view controls",
|
|
@@ -14095,19 +14311,19 @@ function radialViewBox(nodes) {
|
|
|
14095
14311
|
function RelationshipGraph(props) {
|
|
14096
14312
|
const labels = (0, import_react69.useMemo)(() => ({ ...DEFAULT_RELATIONSHIP_GRAPH_LABELS, ...props.labels }), [props.labels]);
|
|
14097
14313
|
const stateClass = cx("uix-relationship-graph uix-relationship-graph--state", props.className);
|
|
14098
|
-
if (props.loading) return /* @__PURE__ */ (0,
|
|
14314
|
+
if (props.loading) return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: stateClass, role: "status", children: labels.loading });
|
|
14099
14315
|
if (props.error) {
|
|
14100
|
-
return /* @__PURE__ */ (0,
|
|
14101
|
-
/* @__PURE__ */ (0,
|
|
14102
|
-
props.onRetry && /* @__PURE__ */ (0,
|
|
14316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: stateClass, role: "alert", children: [
|
|
14317
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("p", { children: props.error }),
|
|
14318
|
+
props.onRetry && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("button", { type: "button", className: "uix-btn uix-btn--secondary", onClick: props.onRetry, children: labels.retry })
|
|
14103
14319
|
] });
|
|
14104
14320
|
}
|
|
14105
|
-
if (props.nodes.length === 0) return /* @__PURE__ */ (0,
|
|
14106
|
-
/* @__PURE__ */ (0,
|
|
14107
|
-
/* @__PURE__ */ (0,
|
|
14321
|
+
if (props.nodes.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: stateClass, children: [
|
|
14322
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("p", { children: labels.emptyTitle }),
|
|
14323
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("p", { children: labels.emptyHint })
|
|
14108
14324
|
] });
|
|
14109
|
-
if (props.layout === "layered") return /* @__PURE__ */ (0,
|
|
14110
|
-
return /* @__PURE__ */ (0,
|
|
14325
|
+
if (props.layout === "layered") return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(LayeredRelationshipGraph, { ...props, labels });
|
|
14326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(RadialRelationshipGraph, { ...props, labels });
|
|
14111
14327
|
}
|
|
14112
14328
|
function RadialRelationshipGraph({
|
|
14113
14329
|
nodes,
|
|
@@ -14160,25 +14376,25 @@ function RadialRelationshipGraph({
|
|
|
14160
14376
|
setZoom(1);
|
|
14161
14377
|
setPan({ x: 0, y: 0 });
|
|
14162
14378
|
};
|
|
14163
|
-
return /* @__PURE__ */ (0,
|
|
14164
|
-
/* @__PURE__ */ (0,
|
|
14165
|
-
/* @__PURE__ */ (0,
|
|
14166
|
-
/* @__PURE__ */ (0,
|
|
14167
|
-
/* @__PURE__ */ (0,
|
|
14168
|
-
/* @__PURE__ */ (0,
|
|
14169
|
-
/* @__PURE__ */ (0,
|
|
14170
|
-
/* @__PURE__ */ (0,
|
|
14171
|
-
/* @__PURE__ */ (0,
|
|
14172
|
-
/* @__PURE__ */ (0,
|
|
14379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("section", { className: cx("uix-relationship-graph", `uix-relationship-graph--${density}`, className), "aria-label": labels.graph, children: [
|
|
14380
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "uix-relationship-graph__toolbar", "aria-label": labels.controls, children: [
|
|
14381
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("button", { type: "button", onClick: () => setPan((value) => ({ ...value, x: value.x - 24 })), "aria-label": labels.panLeft, children: labels.left }),
|
|
14382
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("button", { type: "button", onClick: () => setPan((value) => ({ ...value, y: value.y - 24 })), "aria-label": labels.panUp, children: labels.up }),
|
|
14383
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("button", { type: "button", onClick: () => setPan((value) => ({ ...value, y: value.y + 24 })), "aria-label": labels.panDown, children: labels.down }),
|
|
14384
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("button", { type: "button", onClick: () => setPan((value) => ({ ...value, x: value.x + 24 })), "aria-label": labels.panRight, children: labels.right }),
|
|
14385
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("button", { type: "button", onClick: () => setZoom((value) => Math.min(2, Number((value + 0.2).toFixed(1)))), "aria-label": labels.zoomIn, children: labels.zoomIn }),
|
|
14386
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("button", { type: "button", onClick: () => setZoom((value) => Math.max(0.5, Number((value - 0.2).toFixed(1)))), "aria-label": labels.zoomOut, children: labels.zoomOut }),
|
|
14387
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("button", { type: "button", onClick: reset, children: labels.reset }),
|
|
14388
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { "aria-live": "polite", children: labels.zoomLevel(Math.round(zoom * 100)) })
|
|
14173
14389
|
] }),
|
|
14174
|
-
bounded.omittedNodeCount > 0 && /* @__PURE__ */ (0,
|
|
14175
|
-
/* @__PURE__ */ (0,
|
|
14390
|
+
bounded.omittedNodeCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("p", { className: "uix-relationship-graph__bounded", role: "status", children: labels.bounded(bounded.nodes.length, bounded.omittedNodeCount) }),
|
|
14391
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "uix-relationship-graph__visual", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("svg", { ref: svgRef, viewBox: radialViewBox(positioned), role: "group", "aria-label": labels.graphSummary(bounded.nodes.length, bounded.edges.length), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("g", { transform: `translate(${pan.x} ${pan.y}) scale(${zoom})`, children: [
|
|
14176
14392
|
bounded.edges.map((edge) => {
|
|
14177
14393
|
const source = positionedById.get(edge.source);
|
|
14178
14394
|
const target = positionedById.get(edge.target);
|
|
14179
|
-
return /* @__PURE__ */ (0,
|
|
14395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("line", { x1: source.x * RADIAL_SCALE_X, y1: source.y * RADIAL_SCALE_Y, x2: target.x * RADIAL_SCALE_X, y2: target.y * RADIAL_SCALE_Y, className: "uix-relationship-graph__edge", "data-typed": edge.type != null && typeColor.has(edge.type) || void 0, style: edge.type != null && typeColor.has(edge.type) ? { "--uix-graph-type-color": typeColor.get(edge.type) } : void 0, "data-highlighted": highlightedEdgeIds.has(edge.id) || void 0, "data-conflicted": conflictedEdgeIds.has(edge.id) || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("title", { children: edge.label ?? edge.type ?? labels.relationship }) }, edge.id);
|
|
14180
14396
|
}),
|
|
14181
|
-
positioned.map((node) => /* @__PURE__ */ (0,
|
|
14397
|
+
positioned.map((node) => /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
14182
14398
|
"g",
|
|
14183
14399
|
{
|
|
14184
14400
|
transform: `translate(${node.x * RADIAL_SCALE_X} ${node.y * RADIAL_SCALE_Y})`,
|
|
@@ -14194,22 +14410,22 @@ function RadialRelationshipGraph({
|
|
|
14194
14410
|
onKeyDown: (event) => onNodeKeyDown(event, node.id),
|
|
14195
14411
|
onClick: () => select(node.id),
|
|
14196
14412
|
children: [
|
|
14197
|
-
/* @__PURE__ */ (0,
|
|
14198
|
-
/* @__PURE__ */ (0,
|
|
14199
|
-
/* @__PURE__ */ (0,
|
|
14413
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("title", { children: node.label }),
|
|
14414
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("rect", { x: -RADIAL_NODE_HALF_W, y: -RADIAL_NODE_HALF_H, width: RADIAL_NODE_HALF_W * 2, height: RADIAL_NODE_HALF_H * 2, rx: "8" }),
|
|
14415
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("text", { textAnchor: "middle", dominantBaseline: "middle", children: node.label.length > 16 ? `${node.label.slice(0, 15)}\u2026` : node.label })
|
|
14200
14416
|
]
|
|
14201
14417
|
},
|
|
14202
14418
|
node.id
|
|
14203
14419
|
))
|
|
14204
14420
|
] }) }) }),
|
|
14205
|
-
legend.length > 0 && /* @__PURE__ */ (0,
|
|
14206
|
-
showList && /* @__PURE__ */ (0,
|
|
14421
|
+
legend.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("ul", { className: "uix-relationship-graph__legend", "aria-label": labels.legend, children: legend.map((item) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("li", { "data-type": item.id, style: { "--uix-graph-type-color": typeColor.get(item.id) }, children: item.label }, item.id)) }),
|
|
14422
|
+
showList && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(EquivalentRelationshipList, { nodes: bounded.nodes, edges: bounded.edges, selectedId, labels, onSelect: select, onExpandNeighbors, onOpenDetails })
|
|
14207
14423
|
] });
|
|
14208
14424
|
}
|
|
14209
14425
|
|
|
14210
14426
|
// src/components/MatchReview.tsx
|
|
14211
14427
|
var import_react70 = require("react");
|
|
14212
|
-
var
|
|
14428
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
14213
14429
|
var DEFAULT_MATCH_REVIEW_LABELS = {
|
|
14214
14430
|
region: "Match review",
|
|
14215
14431
|
loading: "Loading match candidates\u2026",
|
|
@@ -14304,48 +14520,48 @@ function MatchReview({
|
|
|
14304
14520
|
setBulkPending(false);
|
|
14305
14521
|
}
|
|
14306
14522
|
};
|
|
14307
|
-
if (loading) return /* @__PURE__ */ (0,
|
|
14308
|
-
if (error) return /* @__PURE__ */ (0,
|
|
14309
|
-
/* @__PURE__ */ (0,
|
|
14310
|
-
onRetry && /* @__PURE__ */ (0,
|
|
14523
|
+
if (loading) return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: cx("uix-match-review uix-match-review--state", className), role: "status", children: labels.loading });
|
|
14524
|
+
if (error) return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: cx("uix-match-review uix-match-review--state", className), role: "alert", children: [
|
|
14525
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("p", { children: error }),
|
|
14526
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("button", { type: "button", className: "uix-btn uix-btn--secondary", onClick: onRetry, children: labels.retry })
|
|
14311
14527
|
] });
|
|
14312
|
-
if (candidates.length === 0) return /* @__PURE__ */ (0,
|
|
14313
|
-
/* @__PURE__ */ (0,
|
|
14314
|
-
/* @__PURE__ */ (0,
|
|
14528
|
+
if (candidates.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: cx("uix-match-review uix-match-review--state", className), children: [
|
|
14529
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("p", { children: labels.empty }),
|
|
14530
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("p", { children: labels.emptyDetail })
|
|
14315
14531
|
] });
|
|
14316
|
-
return /* @__PURE__ */ (0,
|
|
14317
|
-
/* @__PURE__ */ (0,
|
|
14318
|
-
/* @__PURE__ */ (0,
|
|
14319
|
-
/* @__PURE__ */ (0,
|
|
14320
|
-
/* @__PURE__ */ (0,
|
|
14532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("section", { className: cx("uix-match-review", className), "aria-label": labels.region, children: [
|
|
14533
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "uix-match-review__summary", children: [
|
|
14534
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { children: [
|
|
14535
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("strong", { children: incomingLabel }),
|
|
14536
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { children: fillLabel(labels.pendingOf, { pending: pending.length, total: candidates.length }) })
|
|
14321
14537
|
] }),
|
|
14322
|
-
/* @__PURE__ */ (0,
|
|
14323
|
-
/* @__PURE__ */ (0,
|
|
14538
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "uix-match-review__incoming", children: fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { children: [
|
|
14539
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("b", { children: field.label }),
|
|
14324
14540
|
field.render?.(incoming[field.id], incoming) ?? valueText(incoming[field.id])
|
|
14325
14541
|
] }, field.id)) })
|
|
14326
14542
|
] }),
|
|
14327
|
-
onBulkDecision && /* @__PURE__ */ (0,
|
|
14328
|
-
/* @__PURE__ */ (0,
|
|
14329
|
-
/* @__PURE__ */ (0,
|
|
14330
|
-
/* @__PURE__ */ (0,
|
|
14543
|
+
onBulkDecision && /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "uix-match-review__bulk", "aria-label": labels.bulk, children: [
|
|
14544
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { children: fillLabel(labels.selectedCount, { count: selection.size }) }),
|
|
14545
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("button", { type: "button", className: "uix-btn uix-btn--secondary uix-btn--sm", disabled: selection.size === 0 || bulkPending, onClick: () => void runBulk("accept"), children: bulkPending ? labels.applying : labels.acceptSelected }),
|
|
14546
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("button", { type: "button", className: "uix-btn uix-btn--ghost uix-btn--sm", disabled: selection.size === 0 || bulkPending, onClick: () => void runBulk("dismiss"), children: bulkPending ? labels.applying : labels.dismissSelected })
|
|
14331
14547
|
] }),
|
|
14332
|
-
/* @__PURE__ */ (0,
|
|
14333
|
-
/* @__PURE__ */ (0,
|
|
14334
|
-
/* @__PURE__ */ (0,
|
|
14335
|
-
/* @__PURE__ */ (0,
|
|
14336
|
-
/* @__PURE__ */ (0,
|
|
14337
|
-
fields.map((field) => /* @__PURE__ */ (0,
|
|
14338
|
-
/* @__PURE__ */ (0,
|
|
14339
|
-
/* @__PURE__ */ (0,
|
|
14548
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "uix-match-review__table-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("table", { className: "uix-table uix-match-review__table", children: [
|
|
14549
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("caption", { className: "uix-visually-hidden", children: labels.caption }),
|
|
14550
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("tr", { children: [
|
|
14551
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("th", { scope: "col", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "uix-visually-hidden", children: labels.select }) }),
|
|
14552
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("th", { scope: "col", children: labels.confidence }),
|
|
14553
|
+
fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("th", { scope: "col", children: field.label }, field.id)),
|
|
14554
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("th", { scope: "col", children: labels.status }),
|
|
14555
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("th", { scope: "col", children: labels.actions })
|
|
14340
14556
|
] }) }),
|
|
14341
|
-
/* @__PURE__ */ (0,
|
|
14557
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("tbody", { children: candidates.map((candidate) => {
|
|
14342
14558
|
const resolved = candidate.status === "resolved";
|
|
14343
|
-
return /* @__PURE__ */ (0,
|
|
14344
|
-
/* @__PURE__ */ (0,
|
|
14345
|
-
/* @__PURE__ */ (0,
|
|
14346
|
-
fields.map((field) => /* @__PURE__ */ (0,
|
|
14347
|
-
/* @__PURE__ */ (0,
|
|
14348
|
-
/* @__PURE__ */ (0,
|
|
14559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("tr", { "data-status": candidate.status ?? "pending", children: [
|
|
14560
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("input", { type: "checkbox", checked: selection.has(candidate.id), onChange: () => toggle(candidate.id), "aria-label": fillLabel(labels.selectCandidate, { id: candidate.id }) }) }),
|
|
14561
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "uix-match-review__confidence", children: candidate.confidence == null ? labels.notScored : `${Math.round(candidate.confidence * 100)}%` }) }),
|
|
14562
|
+
fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("td", { children: field.render?.(candidate.record[field.id], candidate.record) ?? valueText(candidate.record[field.id]) }, field.id)),
|
|
14563
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(StatusPill, { tone: resolved ? "success" : "warning", children: resolved ? candidate.decision ? decisionLabel[candidate.decision] : labels.resolved : labels.pending }) }),
|
|
14564
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "uix-match-review__actions", children: ["accept", "dismiss", "split", "pick-other"].map((action) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
14349
14565
|
"button",
|
|
14350
14566
|
{
|
|
14351
14567
|
type: "button",
|
|
@@ -14359,7 +14575,7 @@ function MatchReview({
|
|
|
14359
14575
|
] }, candidate.id);
|
|
14360
14576
|
}) })
|
|
14361
14577
|
] }) }),
|
|
14362
|
-
/* @__PURE__ */ (0,
|
|
14578
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("p", { className: "uix-visually-hidden", "aria-live": "polite", children: announcement })
|
|
14363
14579
|
] });
|
|
14364
14580
|
}
|
|
14365
14581
|
|
|
@@ -14389,7 +14605,7 @@ function parseMetricValue(value) {
|
|
|
14389
14605
|
}
|
|
14390
14606
|
|
|
14391
14607
|
// src/components/MetricInput.tsx
|
|
14392
|
-
var
|
|
14608
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
14393
14609
|
var defaultMetricFormat = (input) => input == null ? "" : String(input);
|
|
14394
14610
|
function MetricInput({
|
|
14395
14611
|
value,
|
|
@@ -14438,10 +14654,10 @@ function MetricInput({
|
|
|
14438
14654
|
const parsed = parse(event.currentTarget.value);
|
|
14439
14655
|
setText(parsed === null && event.currentTarget.value.trim() !== "" ? format(value) : format(parsed));
|
|
14440
14656
|
};
|
|
14441
|
-
return /* @__PURE__ */ (0,
|
|
14442
|
-
/* @__PURE__ */ (0,
|
|
14443
|
-
/* @__PURE__ */ (0,
|
|
14444
|
-
/* @__PURE__ */ (0,
|
|
14657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: cx("uix-metric-input", invalid && "uix-metric-input--invalid", className), children: [
|
|
14658
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("label", { className: "uix-field__label", htmlFor: id, children: label }),
|
|
14659
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "uix-metric-input__control", children: [
|
|
14660
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
14445
14661
|
Input,
|
|
14446
14662
|
{
|
|
14447
14663
|
id,
|
|
@@ -14460,22 +14676,22 @@ function MetricInput({
|
|
|
14460
14676
|
readOnly
|
|
14461
14677
|
}
|
|
14462
14678
|
),
|
|
14463
|
-
unit && /* @__PURE__ */ (0,
|
|
14464
|
-
/* @__PURE__ */ (0,
|
|
14465
|
-
/* @__PURE__ */ (0,
|
|
14466
|
-
/* @__PURE__ */ (0,
|
|
14679
|
+
unit && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "uix-metric-input__unit", "aria-hidden": "true", children: unit }),
|
|
14680
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("span", { className: "uix-metric-input__steps", children: [
|
|
14681
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("button", { type: "button", className: "uix-metric-input__step", onClick: () => stepBy(1), disabled: disabled || readOnly, "aria-label": `Increase ${label}`, children: "+" }),
|
|
14682
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("button", { type: "button", className: "uix-metric-input__step", onClick: () => stepBy(-1), disabled: disabled || readOnly, "aria-label": `Decrease ${label}`, children: "\u2212" })
|
|
14467
14683
|
] })
|
|
14468
14684
|
] }),
|
|
14469
|
-
unit && /* @__PURE__ */ (0,
|
|
14685
|
+
unit && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("span", { className: "uix-visually-hidden", children: [
|
|
14470
14686
|
"Unit: ",
|
|
14471
14687
|
unit
|
|
14472
14688
|
] }),
|
|
14473
|
-
invalid && errorMessage && /* @__PURE__ */ (0,
|
|
14689
|
+
invalid && errorMessage && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { id: errorId, className: "uix-field__error", children: errorMessage })
|
|
14474
14690
|
] });
|
|
14475
14691
|
}
|
|
14476
14692
|
|
|
14477
14693
|
// src/components/LicensePositionBar.tsx
|
|
14478
|
-
var
|
|
14694
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
14479
14695
|
var defaultCapacityFormat = (value) => new Intl.NumberFormat().format(value);
|
|
14480
14696
|
function LicensePositionBar({
|
|
14481
14697
|
consumed,
|
|
@@ -14496,18 +14712,18 @@ function LicensePositionBar({
|
|
|
14496
14712
|
const percent = safeEntitled === 0 ? safeConsumed > 0 ? 100 : 0 : safeConsumed / safeEntitled * 100;
|
|
14497
14713
|
const format = (value) => `${formatValue(value)}${unit ? ` ${unit}` : ""}`;
|
|
14498
14714
|
const summary = `${consumedLabel}: ${format(safeConsumed)}. ${entitledLabel}: ${format(safeEntitled)}. ${over > 0 ? `${format(over)} ${overLabel}` : `${format(available)} ${availableLabel}`}.`;
|
|
14499
|
-
return /* @__PURE__ */ (0,
|
|
14500
|
-
/* @__PURE__ */ (0,
|
|
14501
|
-
/* @__PURE__ */ (0,
|
|
14715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: cx("uix-license-position", over > 0 && "uix-license-position--over", className), ...props, children: [
|
|
14716
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "uix-license-position__header", children: [
|
|
14717
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("span", { className: "uix-license-position__value", children: [
|
|
14502
14718
|
format(safeConsumed),
|
|
14503
14719
|
" / ",
|
|
14504
14720
|
format(safeEntitled)
|
|
14505
14721
|
] }),
|
|
14506
|
-
/* @__PURE__ */ (0,
|
|
14722
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(StatusPill, { tone: over > 0 ? "danger" : percent >= 80 ? "warning" : "success", children: over > 0 ? `${format(over)} ${overLabel}` : `${format(available)} ${availableLabel}` })
|
|
14507
14723
|
] }),
|
|
14508
|
-
/* @__PURE__ */ (0,
|
|
14509
|
-
/* @__PURE__ */ (0,
|
|
14510
|
-
over > 0 && /* @__PURE__ */ (0,
|
|
14724
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "uix-license-position__track", children: [
|
|
14725
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Meter, { value: Math.min(100, percent), tone: over > 0 ? "danger" : percent >= 80 ? "warning" : "success", "aria-label": summary, "aria-valuetext": summary }),
|
|
14726
|
+
over > 0 && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
14511
14727
|
"span",
|
|
14512
14728
|
{
|
|
14513
14729
|
className: "uix-license-position__overflow",
|
|
@@ -14516,7 +14732,7 @@ function LicensePositionBar({
|
|
|
14516
14732
|
}
|
|
14517
14733
|
)
|
|
14518
14734
|
] }),
|
|
14519
|
-
/* @__PURE__ */ (0,
|
|
14735
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("span", { className: "uix-visually-hidden", children: summary })
|
|
14520
14736
|
] });
|
|
14521
14737
|
}
|
|
14522
14738
|
|
|
@@ -14591,7 +14807,7 @@ function meetsContrast(background, foreground, minimum = 4.5) {
|
|
|
14591
14807
|
|
|
14592
14808
|
// src/components/ColorPicker.tsx
|
|
14593
14809
|
var import_react72 = require("react");
|
|
14594
|
-
var
|
|
14810
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
14595
14811
|
var DEFAULT_COLOR_PICKER_LABELS = {
|
|
14596
14812
|
trigger: "{label}: {color}",
|
|
14597
14813
|
sample: "Aa",
|
|
@@ -14675,8 +14891,8 @@ function ColorPicker({
|
|
|
14675
14891
|
if (next) onChange(next);
|
|
14676
14892
|
};
|
|
14677
14893
|
const sampleStyle = { backgroundColor: normalized };
|
|
14678
|
-
return /* @__PURE__ */ (0,
|
|
14679
|
-
/* @__PURE__ */ (0,
|
|
14894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: cx("uix-color-picker", className), children: [
|
|
14895
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
14680
14896
|
"button",
|
|
14681
14897
|
{
|
|
14682
14898
|
ref: triggerRef,
|
|
@@ -14688,12 +14904,12 @@ function ColorPicker({
|
|
|
14688
14904
|
onClick: () => setOpen((current) => !current),
|
|
14689
14905
|
disabled,
|
|
14690
14906
|
children: [
|
|
14691
|
-
/* @__PURE__ */ (0,
|
|
14692
|
-
/* @__PURE__ */ (0,
|
|
14907
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { className: "uix-color-picker__swatch", style: sampleStyle, "aria-hidden": "true" }),
|
|
14908
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { children: normalized })
|
|
14693
14909
|
]
|
|
14694
14910
|
}
|
|
14695
14911
|
),
|
|
14696
|
-
open && /* @__PURE__ */ (0,
|
|
14912
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
14697
14913
|
"div",
|
|
14698
14914
|
{
|
|
14699
14915
|
ref: dialogRef,
|
|
@@ -14704,55 +14920,55 @@ function ColorPicker({
|
|
|
14704
14920
|
className: "uix-color-picker__popover",
|
|
14705
14921
|
onKeyDown: onDialogKeyDown,
|
|
14706
14922
|
children: [
|
|
14707
|
-
/* @__PURE__ */ (0,
|
|
14708
|
-
/* @__PURE__ */ (0,
|
|
14923
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "uix-color-picker__preview", style: sampleStyle, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { style: { color: foreground }, children: labels.sample }) }),
|
|
14924
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("label", { className: "uix-color-picker__range", children: [
|
|
14709
14925
|
labels.hue,
|
|
14710
14926
|
" ",
|
|
14711
|
-
/* @__PURE__ */ (0,
|
|
14927
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("span", { children: [
|
|
14712
14928
|
Math.round(hsv.h),
|
|
14713
14929
|
"\xB0"
|
|
14714
14930
|
] }),
|
|
14715
|
-
/* @__PURE__ */ (0,
|
|
14931
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("input", { type: "range", min: "0", max: "359", value: Math.round(hsv.h), onChange: (event) => updateHsv({ h: Number(event.currentTarget.value) }) })
|
|
14716
14932
|
] }),
|
|
14717
|
-
/* @__PURE__ */ (0,
|
|
14933
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("label", { className: "uix-color-picker__range", children: [
|
|
14718
14934
|
labels.saturation,
|
|
14719
14935
|
" ",
|
|
14720
|
-
/* @__PURE__ */ (0,
|
|
14936
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("span", { children: [
|
|
14721
14937
|
Math.round(hsv.s * 100),
|
|
14722
14938
|
"%"
|
|
14723
14939
|
] }),
|
|
14724
|
-
/* @__PURE__ */ (0,
|
|
14940
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("input", { type: "range", min: "0", max: "100", value: Math.round(hsv.s * 100), onChange: (event) => updateHsv({ s: Number(event.currentTarget.value) / 100 }) })
|
|
14725
14941
|
] }),
|
|
14726
|
-
/* @__PURE__ */ (0,
|
|
14942
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("label", { className: "uix-color-picker__range", children: [
|
|
14727
14943
|
labels.brightness,
|
|
14728
14944
|
" ",
|
|
14729
|
-
/* @__PURE__ */ (0,
|
|
14945
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("span", { children: [
|
|
14730
14946
|
Math.round(hsv.v * 100),
|
|
14731
14947
|
"%"
|
|
14732
14948
|
] }),
|
|
14733
|
-
/* @__PURE__ */ (0,
|
|
14949
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("input", { type: "range", min: "0", max: "100", value: Math.round(hsv.v * 100), onChange: (event) => updateHsv({ v: Number(event.currentTarget.value) / 100 }) })
|
|
14734
14950
|
] }),
|
|
14735
|
-
/* @__PURE__ */ (0,
|
|
14951
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("label", { className: "uix-color-picker__hex", children: [
|
|
14736
14952
|
labels.hex,
|
|
14737
|
-
/* @__PURE__ */ (0,
|
|
14738
|
-
/* @__PURE__ */ (0,
|
|
14953
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("span", { className: "uix-color-picker__hex-row", children: [
|
|
14954
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("input", { className: "uix-input", value: hexText, onChange: (event) => setHexText(event.currentTarget.value), onBlur: commitHex, onKeyDown: (event) => {
|
|
14739
14955
|
if (event.key === "Enter") commitHex();
|
|
14740
14956
|
}, "aria-invalid": !normalizeHex(hexText) }),
|
|
14741
|
-
/* @__PURE__ */ (0,
|
|
14957
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("button", { type: "button", className: "uix-btn uix-btn--secondary uix-btn--sm", onClick: commitHex, disabled: !normalizeHex(hexText), children: labels.set })
|
|
14742
14958
|
] })
|
|
14743
14959
|
] }),
|
|
14744
|
-
(presets.length > 0 || recent.length > 0) && /* @__PURE__ */ (0,
|
|
14745
|
-
presets.length > 0 && /* @__PURE__ */ (0,
|
|
14746
|
-
/* @__PURE__ */ (0,
|
|
14747
|
-
/* @__PURE__ */ (0,
|
|
14960
|
+
(presets.length > 0 || recent.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "uix-color-picker__palettes", children: [
|
|
14961
|
+
presets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("fieldset", { children: [
|
|
14962
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("legend", { children: labels.presets }),
|
|
14963
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { children: presets.map((color) => /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("button", { type: "button", className: "uix-color-picker__preset", style: { backgroundColor: normalizeHex(color) ?? color }, onClick: () => choose(color), "aria-label": fillLabel(labels.usePreset, { color }) }, color)) })
|
|
14748
14964
|
] }),
|
|
14749
|
-
recent.length > 0 && /* @__PURE__ */ (0,
|
|
14750
|
-
/* @__PURE__ */ (0,
|
|
14751
|
-
/* @__PURE__ */ (0,
|
|
14965
|
+
recent.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("fieldset", { children: [
|
|
14966
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("legend", { children: labels.recent }),
|
|
14967
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { children: recent.map((color) => /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("button", { type: "button", className: "uix-color-picker__preset", style: { backgroundColor: normalizeHex(color) ?? color }, onClick: () => choose(color), "aria-label": fillLabel(labels.useRecent, { color }) }, color)) })
|
|
14752
14968
|
] })
|
|
14753
14969
|
] }),
|
|
14754
|
-
/* @__PURE__ */ (0,
|
|
14755
|
-
/* @__PURE__ */ (0,
|
|
14970
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("p", { className: cx("uix-color-picker__contrast", passes ? "uix-color-picker__contrast--pass" : "uix-color-picker__contrast--fail"), role: "status", "aria-live": "polite", children: fillLabel(passes ? labels.contrastPasses : labels.contrastFails, { ratio: ratio.toFixed(2), minimum: minimumContrast }) }),
|
|
14971
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("button", { type: "button", className: "uix-btn uix-btn--primary uix-btn--sm", onClick: close, children: labels.done })
|
|
14756
14972
|
]
|
|
14757
14973
|
}
|
|
14758
14974
|
)
|
|
@@ -14760,7 +14976,7 @@ function ColorPicker({
|
|
|
14760
14976
|
}
|
|
14761
14977
|
|
|
14762
14978
|
// src/components/BrandProfiles.tsx
|
|
14763
|
-
var
|
|
14979
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
14764
14980
|
var PROFILE_PROPERTIES = {
|
|
14765
14981
|
brand: "--uix-brand",
|
|
14766
14982
|
brandForeground: "--uix-brand-fg",
|
|
@@ -14869,54 +15085,54 @@ function BrandProfileEditor({
|
|
|
14869
15085
|
...value.typography?.sans ? { "--uix-font-sans": value.typography.sans } : {},
|
|
14870
15086
|
...value.typography?.heading ? { "--uix-font-heading": value.typography.heading } : {}
|
|
14871
15087
|
};
|
|
14872
|
-
return /* @__PURE__ */ (0,
|
|
14873
|
-
/* @__PURE__ */ (0,
|
|
14874
|
-
profiles.length > 0 && /* @__PURE__ */ (0,
|
|
15088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("section", { className: cx("uix-brand-profiles", className), "aria-label": labels.region, children: [
|
|
15089
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "uix-brand-profiles__form", children: [
|
|
15090
|
+
profiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("label", { className: "uix-field__label", children: [
|
|
14875
15091
|
labels.profile,
|
|
14876
|
-
/* @__PURE__ */ (0,
|
|
15092
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("select", { className: "uix-select", value: value.id, onChange: (event) => {
|
|
14877
15093
|
const selected = profiles.find((profile) => profile.id === event.currentTarget.value);
|
|
14878
15094
|
if (selected) onSelectProfile?.(selected);
|
|
14879
|
-
}, children: profiles.map((profile) => /* @__PURE__ */ (0,
|
|
15095
|
+
}, children: profiles.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("option", { value: profile.id, children: profile.name }, profile.id)) })
|
|
14880
15096
|
] }),
|
|
14881
|
-
/* @__PURE__ */ (0,
|
|
15097
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("label", { className: "uix-field__label", children: [
|
|
14882
15098
|
labels.name,
|
|
14883
|
-
/* @__PURE__ */ (0,
|
|
15099
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("input", { className: "uix-input", value: value.name, onChange: (event) => update({ name: event.currentTarget.value }) })
|
|
14884
15100
|
] }),
|
|
14885
|
-
/* @__PURE__ */ (0,
|
|
14886
|
-
/* @__PURE__ */ (0,
|
|
15101
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "uix-brand-profiles__colors", children: [
|
|
15102
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("label", { children: [
|
|
14887
15103
|
labels.brand,
|
|
14888
|
-
/* @__PURE__ */ (0,
|
|
15104
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(ColorPicker, { label: labels.brandColor, value: value.brand, foreground: value.brandForeground, presets: colorPresets, onChange: (brand) => update({ brand }) })
|
|
14889
15105
|
] }),
|
|
14890
|
-
/* @__PURE__ */ (0,
|
|
15106
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("label", { children: [
|
|
14891
15107
|
labels.onBrand,
|
|
14892
|
-
/* @__PURE__ */ (0,
|
|
15108
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(ColorPicker, { label: labels.onBrandColor, value: value.brandForeground, foreground: value.brand, presets: colorPresets, onChange: (brandForeground) => update({ brandForeground }) })
|
|
14893
15109
|
] })
|
|
14894
15110
|
] }),
|
|
14895
|
-
/* @__PURE__ */ (0,
|
|
15111
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("label", { className: "uix-field__label", children: [
|
|
14896
15112
|
labels.bodyFont,
|
|
14897
|
-
/* @__PURE__ */ (0,
|
|
15113
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("input", { className: "uix-input", value: value.typography?.sans ?? "", onChange: (event) => update({ typography: { ...value.typography, sans: event.currentTarget.value || void 0 } }) })
|
|
14898
15114
|
] }),
|
|
14899
|
-
/* @__PURE__ */ (0,
|
|
15115
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("label", { className: "uix-field__label", children: [
|
|
14900
15116
|
labels.headingFont,
|
|
14901
|
-
/* @__PURE__ */ (0,
|
|
15117
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("input", { className: "uix-input", value: value.typography?.heading ?? "", onChange: (event) => update({ typography: { ...value.typography, heading: event.currentTarget.value || void 0 } }) })
|
|
14902
15118
|
] }),
|
|
14903
|
-
/* @__PURE__ */ (0,
|
|
15119
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("label", { className: "uix-file-upload uix-brand-profiles__upload", children: [
|
|
14904
15120
|
labels.logoFile,
|
|
14905
|
-
/* @__PURE__ */ (0,
|
|
15121
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("input", { type: "file", accept: "image/*", onChange: onFile })
|
|
14906
15122
|
] }),
|
|
14907
|
-
/* @__PURE__ */ (0,
|
|
14908
|
-
/* @__PURE__ */ (0,
|
|
15123
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("button", { type: "button", className: "uix-btn uix-btn--primary", onClick: apply, children: labels.apply }),
|
|
15124
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "uix-visually-hidden", "aria-live": "polite", children: announcement })
|
|
14909
15125
|
] }),
|
|
14910
|
-
/* @__PURE__ */ (0,
|
|
14911
|
-
/* @__PURE__ */ (0,
|
|
14912
|
-
value.logo ? /* @__PURE__ */ (0,
|
|
14913
|
-
/* @__PURE__ */ (0,
|
|
15126
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "uix-brand-profiles__preview", style: previewStyle, "aria-label": fillLabel(labels.preview, { name: value.name }), children: [
|
|
15127
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "uix-brand-profiles__preview-header", children: [
|
|
15128
|
+
value.logo ? /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("img", { src: value.logo.src, alt: value.logo.alt }) : /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "uix-brand-profiles__logo-placeholder", children: labels.logoPlaceholder }),
|
|
15129
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("strong", { children: value.name || labels.previewTitleFallback })
|
|
14914
15130
|
] }),
|
|
14915
|
-
/* @__PURE__ */ (0,
|
|
14916
|
-
/* @__PURE__ */ (0,
|
|
14917
|
-
/* @__PURE__ */ (0,
|
|
14918
|
-
/* @__PURE__ */ (0,
|
|
14919
|
-
/* @__PURE__ */ (0,
|
|
15131
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "uix-brand-profiles__preview-body", children: [
|
|
15132
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("h3", { children: labels.previewHeading }),
|
|
15133
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("p", { children: labels.previewBody }),
|
|
15134
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("button", { type: "button", className: "uix-btn uix-btn--primary", children: labels.previewPrimary }),
|
|
15135
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("a", { href: "#brand-profile-preview", children: labels.previewLink })
|
|
14920
15136
|
] })
|
|
14921
15137
|
] })
|
|
14922
15138
|
] });
|
|
@@ -14975,7 +15191,7 @@ function summarizeDiff(entries, resolutions = {}) {
|
|
|
14975
15191
|
}
|
|
14976
15192
|
|
|
14977
15193
|
// src/components/DiffViewer.tsx
|
|
14978
|
-
var
|
|
15194
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
14979
15195
|
var DEFAULT_DIFF_VIEWER_LABELS = {
|
|
14980
15196
|
base: "Base",
|
|
14981
15197
|
current: "Current",
|
|
@@ -15029,24 +15245,24 @@ function DiffViewer({
|
|
|
15029
15245
|
if (controlledResolutions === void 0) setInternalResolutions((currentState) => ({ ...currentState, [path]: resolution }));
|
|
15030
15246
|
onResolutionChange?.(path, resolution);
|
|
15031
15247
|
};
|
|
15032
|
-
if (entries.length === 0) return /* @__PURE__ */ (0,
|
|
15033
|
-
/* @__PURE__ */ (0,
|
|
15034
|
-
/* @__PURE__ */ (0,
|
|
15248
|
+
if (entries.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("section", { className: cx("uix-diff-viewer uix-diff-viewer--empty", className), "aria-label": labels.region, children: [
|
|
15249
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("h3", { children: labels.noDifferences }),
|
|
15250
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("p", { children: labels.noDifferencesDetail })
|
|
15035
15251
|
] });
|
|
15036
|
-
return /* @__PURE__ */ (0,
|
|
15037
|
-
/* @__PURE__ */ (0,
|
|
15038
|
-
GROUPS.map((kind) => /* @__PURE__ */ (0,
|
|
15039
|
-
/* @__PURE__ */ (0,
|
|
15252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("section", { className: cx("uix-diff-viewer", className), "aria-label": labels.region, "data-control-size": controlSize, children: [
|
|
15253
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "uix-diff-viewer__summary", role: "group", "aria-label": labels.summary, children: [
|
|
15254
|
+
GROUPS.map((kind) => /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("span", { children: [
|
|
15255
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("b", { children: summary[kind] }),
|
|
15040
15256
|
" ",
|
|
15041
15257
|
labels[kind].toLowerCase()
|
|
15042
15258
|
] }, kind)),
|
|
15043
|
-
/* @__PURE__ */ (0,
|
|
15044
|
-
/* @__PURE__ */ (0,
|
|
15259
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("span", { children: [
|
|
15260
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("b", { children: summary.resolved }),
|
|
15045
15261
|
" ",
|
|
15046
15262
|
labels.resolved
|
|
15047
15263
|
] }),
|
|
15048
|
-
/* @__PURE__ */ (0,
|
|
15049
|
-
/* @__PURE__ */ (0,
|
|
15264
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("span", { children: [
|
|
15265
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("b", { children: summary.pending }),
|
|
15050
15266
|
" ",
|
|
15051
15267
|
labels.pending
|
|
15052
15268
|
] })
|
|
@@ -15054,33 +15270,33 @@ function DiffViewer({
|
|
|
15054
15270
|
GROUPS.map((kind) => {
|
|
15055
15271
|
const grouped = entries.filter((entry) => entry.kind === kind);
|
|
15056
15272
|
if (!grouped.length) return null;
|
|
15057
|
-
return /* @__PURE__ */ (0,
|
|
15058
|
-
/* @__PURE__ */ (0,
|
|
15273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("section", { className: "uix-diff-viewer__group", "aria-labelledby": `${id}-${kind}`, children: [
|
|
15274
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("h3", { id: `${id}-${kind}`, children: [
|
|
15059
15275
|
labels[kind],
|
|
15060
15276
|
" ",
|
|
15061
|
-
/* @__PURE__ */ (0,
|
|
15277
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { children: grouped.length })
|
|
15062
15278
|
] }),
|
|
15063
15279
|
grouped.map((entry) => {
|
|
15064
15280
|
const resolution = resolutions[entry.path] ?? "pending";
|
|
15065
|
-
return /* @__PURE__ */ (0,
|
|
15066
|
-
/* @__PURE__ */ (0,
|
|
15067
|
-
/* @__PURE__ */ (0,
|
|
15068
|
-
/* @__PURE__ */ (0,
|
|
15281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("details", { className: "uix-diff-viewer__entry", "data-kind": entry.kind, open: entry.kind === "conflicted", children: [
|
|
15282
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("summary", { children: [
|
|
15283
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("code", { children: entry.path }),
|
|
15284
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(StatusPill, { tone: resolution === "pending" ? "warning" : "success", children: resolutionLabel[resolution] })
|
|
15069
15285
|
] }),
|
|
15070
|
-
/* @__PURE__ */ (0,
|
|
15071
|
-
/* @__PURE__ */ (0,
|
|
15072
|
-
/* @__PURE__ */ (0,
|
|
15286
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "uix-diff-viewer__versions", children: ["base", "current", "incoming"].map((version) => /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { role: "region", "aria-label": fillLabel(labels.valueFor, { version: labels[version], path: entry.path }), children: [
|
|
15287
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("strong", { children: labels[version] }),
|
|
15288
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("pre", { children: renderValue(entry[version], labels.notPresent) })
|
|
15073
15289
|
] }, version)) }),
|
|
15074
|
-
/* @__PURE__ */ (0,
|
|
15075
|
-
/* @__PURE__ */ (0,
|
|
15076
|
-
/* @__PURE__ */ (0,
|
|
15077
|
-
/* @__PURE__ */ (0,
|
|
15290
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "uix-diff-viewer__actions", role: "group", "aria-label": fillLabel(labels.resolve, { path: entry.path }), children: [
|
|
15291
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("button", { type: "button", className: cx("uix-btn uix-btn--primary", buttonSize), "aria-label": fillLabel(labels.acceptIncomingFor, { path: entry.path }), "aria-pressed": resolution === "accept", onClick: () => resolve(entry.path, "accept"), children: labels.acceptIncoming }),
|
|
15292
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("button", { type: "button", className: cx("uix-btn uix-btn--secondary", buttonSize), "aria-label": fillLabel(labels.keepCurrentFor, { path: entry.path }), "aria-pressed": resolution === "skip", onClick: () => resolve(entry.path, "skip"), children: labels.keepCurrent }),
|
|
15293
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("button", { type: "button", className: cx("uix-btn uix-btn--ghost", buttonSize), "aria-label": fillLabel(labels.markPendingFor, { path: entry.path }), "aria-pressed": resolution === "pending", onClick: () => resolve(entry.path, "pending"), children: labels.markPending })
|
|
15078
15294
|
] })
|
|
15079
15295
|
] }, entry.path);
|
|
15080
15296
|
})
|
|
15081
15297
|
] }, kind);
|
|
15082
15298
|
}),
|
|
15083
|
-
/* @__PURE__ */ (0,
|
|
15299
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("p", { className: "uix-visually-hidden", "aria-live": "polite", children: fillLabel(labels.progress, { resolved: summary.resolved, total: entries.length }) })
|
|
15084
15300
|
] });
|
|
15085
15301
|
}
|
|
15086
15302
|
|
|
@@ -15345,7 +15561,7 @@ function textDiffRows(result, { context } = {}) {
|
|
|
15345
15561
|
}
|
|
15346
15562
|
|
|
15347
15563
|
// src/components/TextDiff.tsx
|
|
15348
|
-
var
|
|
15564
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
15349
15565
|
var DEFAULT_TEXT_DIFF_LABELS = {
|
|
15350
15566
|
before: "Before",
|
|
15351
15567
|
after: "After",
|
|
@@ -15358,21 +15574,21 @@ var DEFAULT_TEXT_DIFF_LABELS = {
|
|
|
15358
15574
|
};
|
|
15359
15575
|
function Marked({ segments, side, labels, whole }) {
|
|
15360
15576
|
const Tag = side === "before" ? "del" : "ins";
|
|
15361
|
-
return /* @__PURE__ */ (0,
|
|
15362
|
-
/* @__PURE__ */ (0,
|
|
15577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_jsx_runtime103.Fragment, { children: segments.map((segment, i) => segment.changed ? /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(Tag, { "data-whole": whole || void 0, children: [
|
|
15578
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("span", { className: "uix-visually-hidden", children: [
|
|
15363
15579
|
side === "before" ? labels.removed : labels.added,
|
|
15364
15580
|
": "
|
|
15365
15581
|
] }),
|
|
15366
15582
|
segment.text
|
|
15367
|
-
] }, i) : /* @__PURE__ */ (0,
|
|
15583
|
+
] }, i) : /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_react75.Fragment, { children: segment.text }, i)) });
|
|
15368
15584
|
}
|
|
15369
15585
|
function Cell({ line, side, kind, labels }) {
|
|
15370
|
-
if (!line) return /* @__PURE__ */ (0,
|
|
15586
|
+
if (!line) return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "uix-text-diff__cell", "data-side": side, "data-empty": "", "aria-hidden": "true" });
|
|
15371
15587
|
const changed = kind !== "equal";
|
|
15372
|
-
return /* @__PURE__ */ (0,
|
|
15373
|
-
/* @__PURE__ */ (0,
|
|
15374
|
-
/* @__PURE__ */ (0,
|
|
15375
|
-
/* @__PURE__ */ (0,
|
|
15588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "uix-text-diff__cell", "data-side": side, "data-kind": changed ? side === "before" ? "delete" : "insert" : "equal", children: [
|
|
15589
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "uix-text-diff__num", "aria-hidden": "true", children: line.number }),
|
|
15590
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "uix-text-diff__sign", "aria-hidden": "true", children: changed ? side === "before" ? "\u2212" : "+" : "" }),
|
|
15591
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { className: "uix-text-diff__text", children: line.segments.length === 1 && line.segments[0].text === "" ? "\u200B" : /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Marked, { segments: line.segments, side, labels, whole: line.segments.length === 1 }) })
|
|
15376
15592
|
] });
|
|
15377
15593
|
}
|
|
15378
15594
|
function Rows({ rows, view, labels, focusFirst }) {
|
|
@@ -15382,23 +15598,23 @@ function Rows({ rows, view, labels, focusFirst }) {
|
|
|
15382
15598
|
if (focusFirst) first.current?.focus();
|
|
15383
15599
|
}, [focusFirst]);
|
|
15384
15600
|
const firstProps = (index) => focusFirst && index === 0 ? { ref: first, tabIndex: -1 } : {};
|
|
15385
|
-
return /* @__PURE__ */ (0,
|
|
15601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_jsx_runtime103.Fragment, { children: rows.map((row, index) => {
|
|
15386
15602
|
if (row.kind === "fold") {
|
|
15387
|
-
if (open.has(index)) return /* @__PURE__ */ (0,
|
|
15388
|
-
return /* @__PURE__ */ (0,
|
|
15603
|
+
if (open.has(index)) return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Rows, { rows: row.rows, view, labels, focusFirst: true }, index);
|
|
15604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "uix-text-diff__row", "data-kind": "fold", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("button", { type: "button", className: "uix-text-diff__fold", onClick: () => setOpen((s) => new Set(s).add(index)), children: fillLabel(labels.showUnchanged, { count: row.count }) }) }, index);
|
|
15389
15605
|
}
|
|
15390
15606
|
const before = row.kind === "insert" ? void 0 : row.before;
|
|
15391
15607
|
const after = row.kind === "delete" ? void 0 : row.after;
|
|
15392
15608
|
if (view === "unified") {
|
|
15393
|
-
if (row.kind === "equal") return /* @__PURE__ */ (0,
|
|
15394
|
-
return /* @__PURE__ */ (0,
|
|
15395
|
-
before && /* @__PURE__ */ (0,
|
|
15396
|
-
after && /* @__PURE__ */ (0,
|
|
15609
|
+
if (row.kind === "equal") return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "uix-text-diff__row", "data-kind": "equal", ...firstProps(index), children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Cell, { line: after, side: "after", kind: "equal", labels }) }, index);
|
|
15610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(import_react75.Fragment, { children: [
|
|
15611
|
+
before && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "uix-text-diff__row", "data-kind": "delete", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Cell, { line: before, side: "before", kind: row.kind, labels }) }),
|
|
15612
|
+
after && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "uix-text-diff__row", "data-kind": "insert", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Cell, { line: after, side: "after", kind: row.kind, labels }) })
|
|
15397
15613
|
] }, index);
|
|
15398
15614
|
}
|
|
15399
|
-
return /* @__PURE__ */ (0,
|
|
15400
|
-
/* @__PURE__ */ (0,
|
|
15401
|
-
/* @__PURE__ */ (0,
|
|
15615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "uix-text-diff__row", "data-kind": row.kind, ...firstProps(index), children: [
|
|
15616
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Cell, { line: before, side: "before", kind: row.kind, labels }),
|
|
15617
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Cell, { line: after, side: "after", kind: row.kind, labels })
|
|
15402
15618
|
] }, index);
|
|
15403
15619
|
}) });
|
|
15404
15620
|
}
|
|
@@ -15422,39 +15638,39 @@ function TextDiff({
|
|
|
15422
15638
|
const labels = { ...DEFAULT_TEXT_DIFF_LABELS, ...uixLabels.textDiff, ...labelOverrides };
|
|
15423
15639
|
const result = (0, import_react75.useMemo)(() => diffText(before, after, { granularity, maxTokens, maxEdits }), [before, after, granularity, maxTokens, maxEdits]);
|
|
15424
15640
|
const rows = (0, import_react75.useMemo)(() => granularity === "line" && result.status === "ok" ? textDiffRows(result, { context }) : [], [result, granularity, context]);
|
|
15425
|
-
const heads = /* @__PURE__ */ (0,
|
|
15426
|
-
/* @__PURE__ */ (0,
|
|
15427
|
-
view === "unified" && /* @__PURE__ */ (0,
|
|
15641
|
+
const heads = /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "uix-text-diff__heads", "aria-hidden": view === "unified" || void 0, children: [
|
|
15642
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("span", { className: "uix-text-diff__head", "data-side": "before", children: [
|
|
15643
|
+
view === "unified" && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { "aria-hidden": "true", children: "\u2212 " }),
|
|
15428
15644
|
beforeLabel ?? labels.before
|
|
15429
15645
|
] }),
|
|
15430
|
-
/* @__PURE__ */ (0,
|
|
15431
|
-
view === "unified" && /* @__PURE__ */ (0,
|
|
15646
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("span", { className: "uix-text-diff__head", "data-side": "after", children: [
|
|
15647
|
+
view === "unified" && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("span", { "aria-hidden": "true", children: "+ " }),
|
|
15432
15648
|
afterLabel ?? labels.after
|
|
15433
15649
|
] })
|
|
15434
15650
|
] });
|
|
15435
15651
|
const unchanged = result.status === "ok" && result.added === 0 && result.removed === 0 && result.ops.every((op) => op.type === "equal");
|
|
15436
15652
|
let body;
|
|
15437
|
-
if (result.status === "too-large") body = /* @__PURE__ */ (0,
|
|
15438
|
-
else if (granularity === "line") body = /* @__PURE__ */ (0,
|
|
15653
|
+
if (result.status === "too-large") body = /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "uix-text-diff__note", children: labels.tooLarge });
|
|
15654
|
+
else if (granularity === "line") body = /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "uix-text-diff__body", children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Rows, { rows, view, labels }) });
|
|
15439
15655
|
else {
|
|
15440
|
-
const prose = (side2) => /* @__PURE__ */ (0,
|
|
15656
|
+
const prose = (side2) => /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "uix-text-diff__prose", "data-side": side2, children: result.ops.map((op, i) => {
|
|
15441
15657
|
const text = op.tokens.join("");
|
|
15442
|
-
if (op.type === "equal") return /* @__PURE__ */ (0,
|
|
15658
|
+
if (op.type === "equal") return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_react75.Fragment, { children: text }, i);
|
|
15443
15659
|
if (op.type === "delete" && side2 === "after") return null;
|
|
15444
15660
|
if (op.type === "insert" && side2 === "before") return null;
|
|
15445
|
-
return /* @__PURE__ */ (0,
|
|
15661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Marked, { segments: [{ text, changed: true }], side: op.type === "delete" ? "before" : "after", labels }, i);
|
|
15446
15662
|
}) });
|
|
15447
|
-
const side = (which) => /* @__PURE__ */ (0,
|
|
15448
|
-
/* @__PURE__ */ (0,
|
|
15663
|
+
const side = (which) => /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "uix-text-diff__side", children: [
|
|
15664
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "uix-text-diff__head", children: which === "before" ? beforeLabel ?? labels.before : afterLabel ?? labels.after }),
|
|
15449
15665
|
prose(which)
|
|
15450
15666
|
] });
|
|
15451
|
-
body = /* @__PURE__ */ (0,
|
|
15667
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "uix-text-diff__body", children: view === "unified" ? prose("both") : /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: "uix-text-diff__row", "data-kind": "prose", children: [
|
|
15452
15668
|
side("before"),
|
|
15453
15669
|
side("after")
|
|
15454
15670
|
] }) });
|
|
15455
15671
|
}
|
|
15456
|
-
return /* @__PURE__ */ (0,
|
|
15457
|
-
!hideSummary && result.status === "ok" && /* @__PURE__ */ (0,
|
|
15672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { role: "group", "aria-label": label, className: cx("uix-text-diff", className), "data-view": view, "data-granularity": granularity, ...props, children: [
|
|
15673
|
+
!hideSummary && result.status === "ok" && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "uix-text-diff__summary", children: unchanged ? labels.noChanges : fillLabel(labels.summary, { added: result.added, removed: result.removed }) }),
|
|
15458
15674
|
!(granularity === "word" && view === "split" && result.status === "ok") && heads,
|
|
15459
15675
|
body
|
|
15460
15676
|
] });
|
|
@@ -15473,6 +15689,7 @@ function TextDiff({
|
|
|
15473
15689
|
Breadcrumbs,
|
|
15474
15690
|
BuilderCanvas,
|
|
15475
15691
|
BulkBar,
|
|
15692
|
+
Bullet,
|
|
15476
15693
|
Button,
|
|
15477
15694
|
ButtonGroup,
|
|
15478
15695
|
ButtonLink,
|
|
@@ -15511,6 +15728,7 @@ function TextDiff({
|
|
|
15511
15728
|
DEFAULT_FILTER_EDITOR_LABELS,
|
|
15512
15729
|
DEFAULT_FILTER_SUMMARY_LABELS,
|
|
15513
15730
|
DEFAULT_INLINE_EDIT_LABELS,
|
|
15731
|
+
DEFAULT_INSIGHT_CARD_LABELS,
|
|
15514
15732
|
DEFAULT_LIGHTBOX_LABELS,
|
|
15515
15733
|
DEFAULT_MATCH_REVIEW_LABELS,
|
|
15516
15734
|
DEFAULT_PAGINATION_LABELS,
|
|
@@ -15563,6 +15781,7 @@ function TextDiff({
|
|
|
15563
15781
|
InlineEdit,
|
|
15564
15782
|
Input,
|
|
15565
15783
|
InputGroup,
|
|
15784
|
+
InsightCard,
|
|
15566
15785
|
Kanban,
|
|
15567
15786
|
KanbanCard,
|
|
15568
15787
|
KanbanColumn,
|
|
@@ -15717,6 +15936,7 @@ function TextDiff({
|
|
|
15717
15936
|
layoutMonthSpans,
|
|
15718
15937
|
layoutRelationshipGraph,
|
|
15719
15938
|
layoutTimeGridDay,
|
|
15939
|
+
linearFit,
|
|
15720
15940
|
mapRuleGroup,
|
|
15721
15941
|
matchFilter,
|
|
15722
15942
|
matchFilterPreset,
|
|
@@ -15725,6 +15945,7 @@ function TextDiff({
|
|
|
15725
15945
|
moveRuleNode,
|
|
15726
15946
|
multiSort,
|
|
15727
15947
|
nextSortDir,
|
|
15948
|
+
normalQuantile,
|
|
15728
15949
|
normalizeHex,
|
|
15729
15950
|
packLanes,
|
|
15730
15951
|
parseDateInput,
|
|
@@ -15735,7 +15956,9 @@ function TextDiff({
|
|
|
15735
15956
|
pixelsToMs,
|
|
15736
15957
|
placeSpan,
|
|
15737
15958
|
placesInTopLane,
|
|
15959
|
+
predictionBand,
|
|
15738
15960
|
proposeMove,
|
|
15961
|
+
quantiles,
|
|
15739
15962
|
rankOverflow,
|
|
15740
15963
|
relationshipNeighbors,
|
|
15741
15964
|
relativeTimeValue,
|
|
@@ -15759,6 +15982,7 @@ function TextDiff({
|
|
|
15759
15982
|
splitDateTime,
|
|
15760
15983
|
startOfMonth,
|
|
15761
15984
|
stepMetricValue,
|
|
15985
|
+
studentTQuantile,
|
|
15762
15986
|
summarizeDiff,
|
|
15763
15987
|
summarizeFilter,
|
|
15764
15988
|
summarizeRule,
|