@oprt/react 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ComboBox/ComboBox.js +9 -1
- package/dist/DataGrid/DataGrid.js +12 -2
- package/dist/DataGrid/DataGrid.manifest.js +2 -2
- package/dist/Skeleton/Skeleton.js +36 -25
- package/dist/Skeleton/Skeleton.manifest.js +10 -2
- package/dist/_internal/loadingStatus.js +30 -0
- package/dist/index.cjs +381 -320
- package/dist/index.d.cts +27 -2
- package/dist/index.d.ts +27 -2
- package/dist/version.js +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -5813,7 +5813,7 @@ var import_clsx27 = __toESM(require("clsx"), 1);
|
|
|
5813
5813
|
// src/Skeleton/Skeleton.manifest.ts
|
|
5814
5814
|
var SkeletonManifest = {
|
|
5815
5815
|
Skeleton: {
|
|
5816
|
-
description: "Loading
|
|
5816
|
+
description: 'Loading placeholder, purely visual and silent: hidden from assistive technology, with no role, name or text, so a screen of placeholders does not say "Loading" once each. block renders one pulsing bar; text stacks `lines` bars with a shortened last line. Bars fill their container and never widen it, whatever width the caller asks for, and are drawn in a system color in forced-colors mode. The area that is loading says it: mark the area `aria-busy`, keep one polite status outside it (on the page before it has anything to say) that says "Loading <what>" and then that the content has arrived.',
|
|
5817
5817
|
props: {
|
|
5818
5818
|
variant: { type: "enum", values: ["block", "text"], default: "block" },
|
|
5819
5819
|
width: {
|
|
@@ -5830,11 +5830,19 @@ var SkeletonManifest = {
|
|
|
5830
5830
|
type: "number",
|
|
5831
5831
|
default: 3,
|
|
5832
5832
|
description: "Number of stacked bars in the text variant, rounded down with a minimum of 1. Non-finite values fall back to 3."
|
|
5833
|
+
},
|
|
5834
|
+
"aria-label": {
|
|
5835
|
+
type: "string",
|
|
5836
|
+
description: 'Deprecated and not applied. A Skeleton used to be a status named "Loading" (or this label); it is decorative now. In development a structured error says so, once. Name the loading area instead. The same holds for aria-labelledby, aria-describedby, role, aria-live and aria-busy.'
|
|
5837
|
+
},
|
|
5838
|
+
role: {
|
|
5839
|
+
type: "string",
|
|
5840
|
+
description: "Deprecated and not applied: a Skeleton is decorative and has no role. See aria-label."
|
|
5833
5841
|
}
|
|
5834
5842
|
},
|
|
5835
5843
|
composable_with: ["Card", "DataTable"],
|
|
5836
5844
|
never_inside: ["Button", "Badge"],
|
|
5837
|
-
example: '<Skeleton variant="text" lines={3} />'
|
|
5845
|
+
example: '<section aria-labelledby="tracks-title">\n <h2 id="tracks-title">Tracks</h2>\n <p role="status" className="sr-only">{note}</p>\n <div aria-busy={loading}>\n {loading ? <Skeleton variant="text" lines={3} /> : <TrackList tracks={tracks} />}\n </div>\n</section>'
|
|
5838
5846
|
}
|
|
5839
5847
|
};
|
|
5840
5848
|
|
|
@@ -5852,26 +5860,55 @@ var barStyles = (0, import_class_variance_authority16.cva)(
|
|
|
5852
5860
|
defaultVariants: { variant: "block" }
|
|
5853
5861
|
}
|
|
5854
5862
|
);
|
|
5863
|
+
var NOT_APPLIED2 = [
|
|
5864
|
+
"aria-label",
|
|
5865
|
+
"aria-labelledby",
|
|
5866
|
+
"aria-describedby",
|
|
5867
|
+
"role",
|
|
5868
|
+
"aria-live",
|
|
5869
|
+
"aria-busy"
|
|
5870
|
+
];
|
|
5871
|
+
var reportedNotApplied2 = /* @__PURE__ */ new Set();
|
|
5872
|
+
function reportNotApplied2(prop, received) {
|
|
5873
|
+
if (process.env.NODE_ENV === "production" || reportedNotApplied2.has(prop)) return;
|
|
5874
|
+
reportedNotApplied2.add(prop);
|
|
5875
|
+
console.error(
|
|
5876
|
+
JSON.stringify(
|
|
5877
|
+
{
|
|
5878
|
+
component: "Skeleton",
|
|
5879
|
+
error: "PROP_NOT_APPLIED",
|
|
5880
|
+
prop,
|
|
5881
|
+
received: typeof received === "string" ? received : String(received),
|
|
5882
|
+
suggestion: 'Skeleton is decorative: hidden from assistive technology, with no role or name, so it stays silent and a page of them does not say "Loading" once each. Mark the area that is loading aria-busy and say "Loading <what>" once in a status that is already on the page (see the Skeleton page).'
|
|
5883
|
+
},
|
|
5884
|
+
null,
|
|
5885
|
+
2
|
|
5886
|
+
)
|
|
5887
|
+
);
|
|
5888
|
+
}
|
|
5855
5889
|
var Skeleton = (0, import_react42.forwardRef)((allProps, ref) => {
|
|
5856
|
-
const { className, variant = "block", width, height, lines = 3, ...
|
|
5890
|
+
const { className, variant = "block", width, height, lines = 3, ...rest } = allProps;
|
|
5891
|
+
const props = { ...rest };
|
|
5857
5892
|
if (process.env.NODE_ENV !== "production") {
|
|
5858
5893
|
devValidate("Skeleton", SkeletonManifest.Skeleton.props, { ...allProps });
|
|
5894
|
+
for (const name of NOT_APPLIED2) {
|
|
5895
|
+
if (props[name] !== void 0) reportNotApplied2(name, props[name]);
|
|
5896
|
+
}
|
|
5859
5897
|
}
|
|
5898
|
+
for (const name of NOT_APPLIED2) delete props[name];
|
|
5899
|
+
delete props["aria-hidden"];
|
|
5860
5900
|
if (variant === "text") {
|
|
5861
5901
|
const count2 = Number.isFinite(lines) ? Math.max(1, Math.floor(lines)) : 3;
|
|
5862
5902
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5863
5903
|
"div",
|
|
5864
5904
|
{
|
|
5905
|
+
...props,
|
|
5865
5906
|
ref,
|
|
5866
|
-
|
|
5867
|
-
"aria-busy": "true",
|
|
5868
|
-
"aria-label": "Loading",
|
|
5907
|
+
"aria-hidden": "true",
|
|
5869
5908
|
className: (0, import_clsx27.default)("flex flex-col gap-1u", className),
|
|
5870
|
-
...props,
|
|
5871
5909
|
children: Array.from({ length: count2 }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5872
5910
|
"div",
|
|
5873
5911
|
{
|
|
5874
|
-
"aria-hidden": "true",
|
|
5875
5912
|
className: (0, import_clsx27.default)(barStyles({ variant: "text" }), i === count2 - 1 && "w-2/3")
|
|
5876
5913
|
},
|
|
5877
5914
|
i
|
|
@@ -5883,25 +5920,7 @@ var Skeleton = (0, import_react42.forwardRef)((allProps, ref) => {
|
|
|
5883
5920
|
if (width !== void 0) style.width = width;
|
|
5884
5921
|
if (height !== void 0) style.height = height;
|
|
5885
5922
|
const hasStyle = width !== void 0 || height !== void 0;
|
|
5886
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5887
|
-
"div",
|
|
5888
|
-
{
|
|
5889
|
-
ref,
|
|
5890
|
-
role: "status",
|
|
5891
|
-
"aria-busy": "true",
|
|
5892
|
-
"aria-label": "Loading",
|
|
5893
|
-
className: (0, import_clsx27.default)("flex flex-col", className),
|
|
5894
|
-
...props,
|
|
5895
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5896
|
-
"div",
|
|
5897
|
-
{
|
|
5898
|
-
"aria-hidden": "true",
|
|
5899
|
-
className: barStyles({ variant: "block" }),
|
|
5900
|
-
...hasStyle ? { style } : {}
|
|
5901
|
-
}
|
|
5902
|
-
)
|
|
5903
|
-
}
|
|
5904
|
-
);
|
|
5923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { ...props, ref, "aria-hidden": "true", className: (0, import_clsx27.default)("flex flex-col", className), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: barStyles({ variant: "block" }), ...hasStyle ? { style } : {} }) });
|
|
5905
5924
|
});
|
|
5906
5925
|
Skeleton.displayName = "Skeleton";
|
|
5907
5926
|
|
|
@@ -9407,9 +9426,34 @@ var Sparkline = (0, import_react55.forwardRef)((allProps, ref) => {
|
|
|
9407
9426
|
Sparkline.displayName = "Sparkline";
|
|
9408
9427
|
|
|
9409
9428
|
// src/DataGrid/DataGrid.tsx
|
|
9410
|
-
var
|
|
9429
|
+
var import_react57 = require("react");
|
|
9411
9430
|
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
9412
9431
|
|
|
9432
|
+
// src/_internal/loadingStatus.ts
|
|
9433
|
+
var import_react56 = require("react");
|
|
9434
|
+
function useLoadingStatusText({
|
|
9435
|
+
loading,
|
|
9436
|
+
loadingText,
|
|
9437
|
+
loadedText
|
|
9438
|
+
}) {
|
|
9439
|
+
const held = useHoldBackNewText(true);
|
|
9440
|
+
const [seen2, setSeen] = (0, import_react56.useState)({ loading, first: loading, arrival: "" });
|
|
9441
|
+
let current = seen2;
|
|
9442
|
+
if (seen2.loading !== loading) {
|
|
9443
|
+
current = {
|
|
9444
|
+
loading,
|
|
9445
|
+
first: false,
|
|
9446
|
+
arrival: loading || seen2.first ? "" : loadedText
|
|
9447
|
+
};
|
|
9448
|
+
setSeen(current);
|
|
9449
|
+
} else if (!loading && seen2.arrival !== "" && seen2.arrival !== loadedText) {
|
|
9450
|
+
current = { ...seen2, arrival: "" };
|
|
9451
|
+
setSeen(current);
|
|
9452
|
+
}
|
|
9453
|
+
if (held || current.first) return "";
|
|
9454
|
+
return loading ? loadingText : current.arrival;
|
|
9455
|
+
}
|
|
9456
|
+
|
|
9413
9457
|
// src/DataGrid/DataGrid.manifest.ts
|
|
9414
9458
|
var DataGridManifest = {
|
|
9415
9459
|
DataGrid: {
|
|
@@ -9446,7 +9490,7 @@ var DataGridManifest = {
|
|
|
9446
9490
|
caption: {
|
|
9447
9491
|
type: "string",
|
|
9448
9492
|
default: "Data grid",
|
|
9449
|
-
description: "Accessible native table caption and controls group name."
|
|
9493
|
+
description: "Accessible native table caption and controls group name. Also names what is loading in the loading and loaded messages."
|
|
9450
9494
|
},
|
|
9451
9495
|
selectedRowIds: {
|
|
9452
9496
|
type: "array",
|
|
@@ -9523,7 +9567,7 @@ var DataGridManifest = {
|
|
|
9523
9567
|
loading: {
|
|
9524
9568
|
type: "boolean",
|
|
9525
9569
|
default: false,
|
|
9526
|
-
description:
|
|
9570
|
+
description: 'Marks the table busy and disables grid-owned controls and row activation while retaining supplied data. A load the person asks for (a reload, a page, a filter: `loading` turns on after the grid has rendered) says "Loading <caption>." once (or "Loading results." when no caption is given) and, when it ends, "<caption> loaded. N rows." once. The load that is under way when the grid first renders is busy but silent, as is the arrival of its rows.'
|
|
9527
9571
|
},
|
|
9528
9572
|
disabled: {
|
|
9529
9573
|
type: "boolean",
|
|
@@ -9591,8 +9635,8 @@ function ColumnWidthInput({
|
|
|
9591
9635
|
label,
|
|
9592
9636
|
onCommit
|
|
9593
9637
|
}) {
|
|
9594
|
-
const [draft, setDraft] = (0,
|
|
9595
|
-
(0,
|
|
9638
|
+
const [draft, setDraft] = (0, import_react57.useState)(null);
|
|
9639
|
+
(0, import_react57.useEffect)(() => setDraft(null), [value]);
|
|
9596
9640
|
const text = draft?.base === value ? draft.text : String(value);
|
|
9597
9641
|
const commit = (requested) => {
|
|
9598
9642
|
setDraft(null);
|
|
@@ -9633,12 +9677,12 @@ function withoutPage(selection, pageIds) {
|
|
|
9633
9677
|
const onPage = new Set(pageIds);
|
|
9634
9678
|
return selection.filter((id) => !onPage.has(id));
|
|
9635
9679
|
}
|
|
9636
|
-
var DataGrid = (0,
|
|
9680
|
+
var DataGrid = (0, import_react57.forwardRef)((allProps, ref) => {
|
|
9637
9681
|
const {
|
|
9638
9682
|
columns,
|
|
9639
9683
|
data,
|
|
9640
9684
|
getRowId,
|
|
9641
|
-
caption
|
|
9685
|
+
caption: captionProp,
|
|
9642
9686
|
selectedRowIds,
|
|
9643
9687
|
onSelectionChange,
|
|
9644
9688
|
sort,
|
|
@@ -9668,18 +9712,19 @@ var DataGrid = (0, import_react56.forwardRef)((allProps, ref) => {
|
|
|
9668
9712
|
if (process.env.NODE_ENV !== "production") {
|
|
9669
9713
|
devValidate("DataGrid", DataGridManifest.DataGrid.props, allProps);
|
|
9670
9714
|
}
|
|
9671
|
-
const
|
|
9672
|
-
const [
|
|
9673
|
-
const [
|
|
9674
|
-
const [
|
|
9675
|
-
const [
|
|
9676
|
-
const [
|
|
9677
|
-
const [
|
|
9678
|
-
const [
|
|
9679
|
-
const
|
|
9715
|
+
const caption = captionProp ?? "Data grid";
|
|
9716
|
+
const [localSelection, setLocalSelection] = (0, import_react57.useState)([]);
|
|
9717
|
+
const [localSort, setLocalSort] = (0, import_react57.useState)(null);
|
|
9718
|
+
const [localPage, setLocalPage] = (0, import_react57.useState)(1);
|
|
9719
|
+
const [hiddenColumns, setHiddenColumns] = (0, import_react57.useState)([]);
|
|
9720
|
+
const [columnsOpen, setColumnsOpen] = (0, import_react57.useState)(false);
|
|
9721
|
+
const [localWidths, setLocalWidths] = (0, import_react57.useState)({});
|
|
9722
|
+
const [localPinned, setLocalPinned] = (0, import_react57.useState)([]);
|
|
9723
|
+
const [localView, setLocalView] = (0, import_react57.useState)("virtualized");
|
|
9724
|
+
const columnsId = (0, import_react57.useId)();
|
|
9680
9725
|
const blocked = disabled || loading;
|
|
9681
9726
|
const selection = selectedRowIds ?? localSelection;
|
|
9682
|
-
const selectionSet = (0,
|
|
9727
|
+
const selectionSet = (0, import_react57.useMemo)(() => new Set(selection), [selection]);
|
|
9683
9728
|
const selectionEnabled = selectedRowIds !== void 0 || Boolean(onSelectionChange);
|
|
9684
9729
|
const effectiveSort = sort === void 0 ? localSort : sort;
|
|
9685
9730
|
const visibleKeys = visibleColumnKeys ?? columns.filter((column) => !hiddenColumns.includes(column.key)).map((column) => column.key);
|
|
@@ -9714,13 +9759,20 @@ var DataGrid = (0, import_react56.forwardRef)((allProps, ref) => {
|
|
|
9714
9759
|
const safePageSize = Number.isFinite(pageSize) && pageSize >= 1 ? Math.floor(pageSize) : 10;
|
|
9715
9760
|
const count2 = mode === "server" && rowCount !== void 0 && Number.isFinite(rowCount) ? Math.max(0, Math.floor(rowCount)) : data.length;
|
|
9716
9761
|
const pageCount = Math.max(1, Math.ceil(count2 / safePageSize));
|
|
9762
|
+
const what = captionProp ?? "results";
|
|
9763
|
+
const loadingNote = `Loading ${what}.`;
|
|
9764
|
+
const loadingStatus = useLoadingStatusText({
|
|
9765
|
+
loading,
|
|
9766
|
+
loadingText: loadingNote,
|
|
9767
|
+
loadedText: `${captionProp ?? "Results"} loaded. ${count2} ${count2 === 1 ? "row" : "rows"}.`
|
|
9768
|
+
});
|
|
9717
9769
|
const requestedPage = page ?? localPage;
|
|
9718
9770
|
const currentPage = Math.min(
|
|
9719
9771
|
pageCount,
|
|
9720
9772
|
Math.max(1, Number.isFinite(requestedPage) ? Math.floor(requestedPage) : 1)
|
|
9721
9773
|
);
|
|
9722
|
-
const correction = (0,
|
|
9723
|
-
(0,
|
|
9774
|
+
const correction = (0, import_react57.useRef)(null);
|
|
9775
|
+
(0, import_react57.useEffect)(() => {
|
|
9724
9776
|
if (requestedPage === currentPage) {
|
|
9725
9777
|
correction.current = null;
|
|
9726
9778
|
return;
|
|
@@ -9752,7 +9804,7 @@ var DataGrid = (0, import_react56.forwardRef)((allProps, ref) => {
|
|
|
9752
9804
|
const sortKey = sortColumn?.key;
|
|
9753
9805
|
const sortCompare = sortColumn?.compare;
|
|
9754
9806
|
const direction = effectiveSort?.direction;
|
|
9755
|
-
const sorted = (0,
|
|
9807
|
+
const sorted = (0, import_react57.useMemo)(() => {
|
|
9756
9808
|
if (mode !== "client" || sortKey === void 0 || direction === void 0) return data;
|
|
9757
9809
|
return sortedOrder(
|
|
9758
9810
|
data.map((row) => row[sortKey]),
|
|
@@ -9762,17 +9814,17 @@ var DataGrid = (0, import_react56.forwardRef)((allProps, ref) => {
|
|
|
9762
9814
|
}, [data, mode, sortKey, direction, sortCompare]);
|
|
9763
9815
|
const pageStart = (currentPage - 1) * safePageSize;
|
|
9764
9816
|
const paged = mode === "client" && !virtual;
|
|
9765
|
-
const pageRows = (0,
|
|
9817
|
+
const pageRows = (0, import_react57.useMemo)(
|
|
9766
9818
|
() => paged ? sorted.slice(pageStart, pageStart + safePageSize) : sorted,
|
|
9767
9819
|
[sorted, paged, pageStart, safePageSize]
|
|
9768
9820
|
);
|
|
9769
|
-
const latestGetRowId = (0,
|
|
9821
|
+
const latestGetRowId = (0, import_react57.useRef)(getRowId);
|
|
9770
9822
|
latestGetRowId.current = getRowId;
|
|
9771
|
-
const pageIdsOf = (0,
|
|
9823
|
+
const pageIdsOf = (0, import_react57.useMemo)(() => {
|
|
9772
9824
|
let ids = null;
|
|
9773
9825
|
return () => ids ??= pageRows.map((row) => latestGetRowId.current(row));
|
|
9774
9826
|
}, [pageRows]);
|
|
9775
|
-
const { allSelected, someSelected } = (0,
|
|
9827
|
+
const { allSelected, someSelected } = (0, import_react57.useMemo)(() => {
|
|
9776
9828
|
if (selectionSet.size === 0) return { allSelected: false, someSelected: false };
|
|
9777
9829
|
const pageIds = pageIdsOf();
|
|
9778
9830
|
let selected = 0;
|
|
@@ -9993,7 +10045,8 @@ var DataGrid = (0, import_react56.forwardRef)((allProps, ref) => {
|
|
|
9993
10045
|
} : {}
|
|
9994
10046
|
}
|
|
9995
10047
|
),
|
|
9996
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { role: "status", className:
|
|
10048
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { role: "status", className: "sr-only", children: loadingStatus }),
|
|
10049
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { "aria-hidden": "true", className: "m-0 text-oprt-text-dim", children: loadingNote }),
|
|
9997
10050
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-2u", children: [
|
|
9998
10051
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("p", { className: "m-0 font-mono tabular-nums text-oprt-text-dim", children: [
|
|
9999
10052
|
count2,
|
|
@@ -10018,7 +10071,7 @@ var DataGrid = (0, import_react56.forwardRef)((allProps, ref) => {
|
|
|
10018
10071
|
DataGrid.displayName = "DataGrid";
|
|
10019
10072
|
|
|
10020
10073
|
// src/ComboBox/ComboBox.tsx
|
|
10021
|
-
var
|
|
10074
|
+
var import_react58 = require("react");
|
|
10022
10075
|
var import_class_variance_authority24 = require("class-variance-authority");
|
|
10023
10076
|
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
10024
10077
|
var import_react_aria_components19 = require("react-aria-components");
|
|
@@ -10144,7 +10197,7 @@ function reportUnknownValue(received, options) {
|
|
|
10144
10197
|
)
|
|
10145
10198
|
);
|
|
10146
10199
|
}
|
|
10147
|
-
var ComboBox = (0,
|
|
10200
|
+
var ComboBox = (0, import_react58.forwardRef)((props, ref) => {
|
|
10148
10201
|
const {
|
|
10149
10202
|
motion = "auto",
|
|
10150
10203
|
options,
|
|
@@ -10169,7 +10222,7 @@ var ComboBox = (0, import_react57.forwardRef)((props, ref) => {
|
|
|
10169
10222
|
className
|
|
10170
10223
|
} = props;
|
|
10171
10224
|
const motionState = useMotion(motion);
|
|
10172
|
-
const editing = (0,
|
|
10225
|
+
const editing = (0, import_react58.useRef)(false);
|
|
10173
10226
|
const {
|
|
10174
10227
|
id: inputId,
|
|
10175
10228
|
labelledBy,
|
|
@@ -10261,7 +10314,15 @@ var ComboBox = (0, import_react57.forwardRef)((props, ref) => {
|
|
|
10261
10314
|
}
|
|
10262
10315
|
)
|
|
10263
10316
|
] }),
|
|
10264
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10317
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10318
|
+
"p",
|
|
10319
|
+
{
|
|
10320
|
+
role: "status",
|
|
10321
|
+
"data-react-aria-top-layer": "",
|
|
10322
|
+
className: loading ? "m-0 text-oprt-text-dim" : "sr-only",
|
|
10323
|
+
children: loading ? "Loading options." : null
|
|
10324
|
+
}
|
|
10325
|
+
),
|
|
10265
10326
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10266
10327
|
MotionPopover,
|
|
10267
10328
|
{
|
|
@@ -10303,7 +10364,7 @@ ComboBox.displayName = "ComboBox";
|
|
|
10303
10364
|
var import_icons16 = require("@oprt/icons");
|
|
10304
10365
|
var import_class_variance_authority25 = require("class-variance-authority");
|
|
10305
10366
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
10306
|
-
var
|
|
10367
|
+
var import_react59 = require("react");
|
|
10307
10368
|
|
|
10308
10369
|
// src/SplitPane/SplitPane.manifest.ts
|
|
10309
10370
|
var SplitPaneManifest = {
|
|
@@ -10409,8 +10470,8 @@ var paneStyles = "min-w-0 min-h-0 overflow-auto focus-visible:outline-hidden foc
|
|
|
10409
10470
|
var BUTTON_STEP = 10;
|
|
10410
10471
|
var clamp = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
10411
10472
|
function usePaneScrolls(pane) {
|
|
10412
|
-
const [scrolls, setScrolls] = (0,
|
|
10413
|
-
(0,
|
|
10473
|
+
const [scrolls, setScrolls] = (0, import_react59.useState)(false);
|
|
10474
|
+
(0, import_react59.useEffect)(() => {
|
|
10414
10475
|
const node = pane.current;
|
|
10415
10476
|
if (!node) return;
|
|
10416
10477
|
const measure = () => setScrolls(
|
|
@@ -10446,7 +10507,7 @@ function usePaneScrolls(pane) {
|
|
|
10446
10507
|
}, [pane]);
|
|
10447
10508
|
return scrolls;
|
|
10448
10509
|
}
|
|
10449
|
-
var SplitPane = (0,
|
|
10510
|
+
var SplitPane = (0, import_react59.forwardRef)(
|
|
10450
10511
|
({
|
|
10451
10512
|
primary,
|
|
10452
10513
|
secondary,
|
|
@@ -10472,15 +10533,15 @@ var SplitPane = (0, import_react58.forwardRef)(
|
|
|
10472
10533
|
}
|
|
10473
10534
|
const vertical = orientation === "vertical";
|
|
10474
10535
|
const axis = vertical ? "vertical" : "horizontal";
|
|
10475
|
-
const rootRef = (0,
|
|
10476
|
-
const primaryRef = (0,
|
|
10477
|
-
const secondaryRef = (0,
|
|
10478
|
-
const separatorRef = (0,
|
|
10536
|
+
const rootRef = (0, import_react59.useRef)(null);
|
|
10537
|
+
const primaryRef = (0, import_react59.useRef)(null);
|
|
10538
|
+
const secondaryRef = (0, import_react59.useRef)(null);
|
|
10539
|
+
const separatorRef = (0, import_react59.useRef)(null);
|
|
10479
10540
|
const ownChild = (selector) => () => Array.from(rootRef.current?.children ?? []).find((child) => child.matches(selector))?.id;
|
|
10480
10541
|
const primaryId = useHydratedId(ownChild('[data-pane="primary"]'));
|
|
10481
10542
|
const helpId = useHydratedId(ownChild("[data-oprt-split-help]"));
|
|
10482
|
-
const [internalSize, setInternalSize] = (0,
|
|
10483
|
-
const drag = (0,
|
|
10543
|
+
const [internalSize, setInternalSize] = (0, import_react59.useState)(defaultSize);
|
|
10544
|
+
const drag = (0, import_react59.useRef)(null);
|
|
10484
10545
|
const lower = clamp(Number.isFinite(minSize) ? minSize : 20, 0, 100);
|
|
10485
10546
|
const upper = clamp(Number.isFinite(maxSize) ? maxSize : 80, lower, 100);
|
|
10486
10547
|
const rawSize = size ?? internalSize;
|
|
@@ -10489,7 +10550,7 @@ var SplitPane = (0, import_react58.forwardRef)(
|
|
|
10489
10550
|
const buttonStep = Math.max(BUTTON_STEP, increment);
|
|
10490
10551
|
const threshold = Number.isFinite(stackBelow) ? Math.max(0, stackBelow) : 640;
|
|
10491
10552
|
const setRef2 = useMergedRefs(rootRef, forwardedRef);
|
|
10492
|
-
const isNarrow = (0,
|
|
10553
|
+
const isNarrow = (0, import_react59.useCallback)((width) => width < threshold, [threshold]);
|
|
10493
10554
|
const narrow = useElementWidth(rootRef, {
|
|
10494
10555
|
initial: false,
|
|
10495
10556
|
select: isNarrow
|
|
@@ -10501,7 +10562,7 @@ var SplitPane = (0, import_react58.forwardRef)(
|
|
|
10501
10562
|
track: (element) => element.closest("[data-oprt-split-divider]")?.parentElement === rootRef.current ? true : null,
|
|
10502
10563
|
findTarget: () => separatorRef.current?.isConnected ? separatorRef.current : primaryRef.current
|
|
10503
10564
|
});
|
|
10504
|
-
(0,
|
|
10565
|
+
(0, import_react59.useEffect)(() => {
|
|
10505
10566
|
drag.current = null;
|
|
10506
10567
|
}, [disabled, stacked, orientation]);
|
|
10507
10568
|
const resize = (next) => {
|
|
@@ -10681,7 +10742,7 @@ SplitPane.displayName = "SplitPane";
|
|
|
10681
10742
|
// src/TimeRange/TimeRange.tsx
|
|
10682
10743
|
var import_class_variance_authority26 = require("class-variance-authority");
|
|
10683
10744
|
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
10684
|
-
var
|
|
10745
|
+
var import_react60 = require("react");
|
|
10685
10746
|
|
|
10686
10747
|
// src/_internal/timestamp.ts
|
|
10687
10748
|
var MAX_TIME = 864e13;
|
|
@@ -10751,7 +10812,7 @@ function describeRange(start, end) {
|
|
|
10751
10812
|
const sameDay = from.slice(0, 10) === to.slice(0, 10);
|
|
10752
10813
|
return `${from} to ${sameDay ? to.slice(11) : to}`;
|
|
10753
10814
|
}
|
|
10754
|
-
var TimeRange = (0,
|
|
10815
|
+
var TimeRange = (0, import_react60.forwardRef)(
|
|
10755
10816
|
({
|
|
10756
10817
|
value,
|
|
10757
10818
|
onValueChange,
|
|
@@ -10764,7 +10825,7 @@ var TimeRange = (0, import_react59.forwardRef)(
|
|
|
10764
10825
|
className,
|
|
10765
10826
|
...props
|
|
10766
10827
|
}, ref) => {
|
|
10767
|
-
const root = (0,
|
|
10828
|
+
const root = (0, import_react60.useRef)(null);
|
|
10768
10829
|
const setRoot = useMergedRefs(root, ref);
|
|
10769
10830
|
const ids = usePartIds(
|
|
10770
10831
|
["start-date", "start-time", "end-date", "end-time", "error", "range", "status"],
|
|
@@ -10772,15 +10833,15 @@ var TimeRange = (0, import_react59.forwardRef)(
|
|
|
10772
10833
|
);
|
|
10773
10834
|
const base = `${value.start}|${value.end}`;
|
|
10774
10835
|
const applied = draftOf(value);
|
|
10775
|
-
const [draft, setDraft] = (0,
|
|
10836
|
+
const [draft, setDraft] = (0, import_react60.useState)(() => ({ base, ...applied }));
|
|
10776
10837
|
const current = draft.base === base ? draft : applied;
|
|
10777
10838
|
const parsed = { start: parseEndpoint(current.start), end: parseEndpoint(current.end) };
|
|
10778
10839
|
const error = validate(parsed, min, max);
|
|
10779
10840
|
const pending = !(unchanged(current.start, parsed.start, applied.start, value.start) && unchanged(current.end, parsed.end, applied.end, value.end));
|
|
10780
10841
|
const valid = !error && !pending;
|
|
10781
|
-
const callback = (0,
|
|
10842
|
+
const callback = (0, import_react60.useRef)(onDraftValidityChange);
|
|
10782
10843
|
callback.current = onDraftValidityChange;
|
|
10783
|
-
(0,
|
|
10844
|
+
(0, import_react60.useEffect)(() => callback.current?.(valid, { pending }), [valid, pending]);
|
|
10784
10845
|
const readout = Number.isNaN(parsed.start) || Number.isNaN(parsed.end) ? null : describeRange(parsed.start, parsed.end);
|
|
10785
10846
|
const unapplied = !error && pending;
|
|
10786
10847
|
const edit = (part, field, next) => setDraft({ ...current, base, [part]: { ...current[part], [field]: next } });
|
|
@@ -10926,7 +10987,7 @@ var TimeRangeManifest = {
|
|
|
10926
10987
|
// src/EventTimeline/EventTimeline.tsx
|
|
10927
10988
|
var import_class_variance_authority27 = require("class-variance-authority");
|
|
10928
10989
|
var import_clsx43 = __toESM(require("clsx"), 1);
|
|
10929
|
-
var
|
|
10990
|
+
var import_react61 = require("react");
|
|
10930
10991
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
10931
10992
|
var timelineStyles = (0, import_class_variance_authority27.cva)("flex min-w-0 flex-col gap-2u font-sans text-oprt-text");
|
|
10932
10993
|
var markStyles = (0, import_class_variance_authority27.cva)("fill-current", {
|
|
@@ -10946,7 +11007,7 @@ var eventValid = (event) => isValidTimestamp(event.start) && (event.end === void
|
|
|
10946
11007
|
var laneOf = (event) => event.lane || "Events";
|
|
10947
11008
|
var DEFAULT_WIDTH = 1e3;
|
|
10948
11009
|
var MIN_WIDTH = 16;
|
|
10949
|
-
var Marker2 = (0,
|
|
11010
|
+
var Marker2 = (0, import_react61.memo)(function Marker3({ id, severity, x, width, selected }) {
|
|
10950
11011
|
const classes = (0, import_clsx43.default)(
|
|
10951
11012
|
markStyles({ severity: severity ?? "neutral" }),
|
|
10952
11013
|
selected && "stroke-oprt-text"
|
|
@@ -10972,7 +11033,7 @@ var Marker2 = (0, import_react60.memo)(function Marker3({ id, severity, x, width
|
|
|
10972
11033
|
}
|
|
10973
11034
|
);
|
|
10974
11035
|
});
|
|
10975
|
-
var TimelineRow = (0,
|
|
11036
|
+
var TimelineRow = (0, import_react61.memo)(function TimelineRow2({
|
|
10976
11037
|
event,
|
|
10977
11038
|
selected,
|
|
10978
11039
|
selectable,
|
|
@@ -11026,7 +11087,7 @@ var TimelineRow = (0, import_react60.memo)(function TimelineRow2({
|
|
|
11026
11087
|
}
|
|
11027
11088
|
);
|
|
11028
11089
|
});
|
|
11029
|
-
var EventTimeline = (0,
|
|
11090
|
+
var EventTimeline = (0, import_react61.forwardRef)(
|
|
11030
11091
|
({
|
|
11031
11092
|
events,
|
|
11032
11093
|
start,
|
|
@@ -11039,21 +11100,21 @@ var EventTimeline = (0, import_react60.forwardRef)(
|
|
|
11039
11100
|
className,
|
|
11040
11101
|
...props
|
|
11041
11102
|
}, forwardedRef) => {
|
|
11042
|
-
const id = (0,
|
|
11043
|
-
const rootRef = (0,
|
|
11103
|
+
const id = (0, import_react61.useId)();
|
|
11104
|
+
const rootRef = (0, import_react61.useRef)(null);
|
|
11044
11105
|
const setRef2 = useMergedRefs(rootRef, forwardedRef);
|
|
11045
11106
|
const observed = useElementWidth(rootRef, {
|
|
11046
11107
|
initial: null,
|
|
11047
11108
|
min: MIN_WIDTH
|
|
11048
11109
|
});
|
|
11049
|
-
const [firstWidth, setFirstWidth] = (0,
|
|
11110
|
+
const [firstWidth, setFirstWidth] = (0, import_react61.useState)(null);
|
|
11050
11111
|
useIsomorphicLayoutEffect(() => {
|
|
11051
11112
|
const width = rootRef.current?.getBoundingClientRect().width;
|
|
11052
11113
|
if (width !== void 0 && Number.isFinite(width) && width > MIN_WIDTH) setFirstWidth(width);
|
|
11053
11114
|
}, []);
|
|
11054
11115
|
const plotWidth = observed ?? firstWidth ?? DEFAULT_WIDTH;
|
|
11055
11116
|
const validRange = isValidTimestamp(start) && isValidTimestamp(end) && start < end;
|
|
11056
|
-
const { visible, omitted, lanes } = (0,
|
|
11117
|
+
const { visible, omitted, lanes } = (0, import_react61.useMemo)(() => {
|
|
11057
11118
|
const validEvents = events.filter(eventValid);
|
|
11058
11119
|
const inWindow = validRange ? validEvents.filter((event) => event.start <= end && (event.end ?? event.start) >= start).sort((a, b) => a.start - b.start) : [];
|
|
11059
11120
|
const byLane = /* @__PURE__ */ new Map();
|
|
@@ -11065,11 +11126,11 @@ var EventTimeline = (0, import_react60.forwardRef)(
|
|
|
11065
11126
|
}
|
|
11066
11127
|
return { visible: inWindow, omitted: events.length - validEvents.length, lanes: byLane };
|
|
11067
11128
|
}, [events, start, end, validRange]);
|
|
11068
|
-
const selectionRef = (0,
|
|
11129
|
+
const selectionRef = (0, import_react61.useRef)(onSelectionChange);
|
|
11069
11130
|
useIsomorphicLayoutEffect(() => {
|
|
11070
11131
|
selectionRef.current = onSelectionChange;
|
|
11071
11132
|
});
|
|
11072
|
-
const select = (0,
|
|
11133
|
+
const select = (0, import_react61.useCallback)((eventId) => selectionRef.current?.(eventId), []);
|
|
11073
11134
|
const extent2 = plotWidth - 16;
|
|
11074
11135
|
const position = (time) => 8 + Math.max(0, Math.min(extent2, (time - start) / (end - start) * extent2));
|
|
11075
11136
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
@@ -11218,7 +11279,7 @@ var EventTimelineManifest = {
|
|
|
11218
11279
|
};
|
|
11219
11280
|
|
|
11220
11281
|
// src/AppShell/AppShell.tsx
|
|
11221
|
-
var
|
|
11282
|
+
var import_react62 = require("react");
|
|
11222
11283
|
var import_class_variance_authority28 = require("class-variance-authority");
|
|
11223
11284
|
var import_clsx44 = __toESM(require("clsx"), 1);
|
|
11224
11285
|
|
|
@@ -11301,7 +11362,7 @@ var connectionVariants = {
|
|
|
11301
11362
|
function connectionVariant(connection) {
|
|
11302
11363
|
return Object.prototype.hasOwnProperty.call(connectionVariants, connection) ? connectionVariants[connection] : "neutral";
|
|
11303
11364
|
}
|
|
11304
|
-
var AppShell = (0,
|
|
11365
|
+
var AppShell = (0, import_react62.forwardRef)(
|
|
11305
11366
|
({
|
|
11306
11367
|
title = "Workspace",
|
|
11307
11368
|
identity,
|
|
@@ -11316,7 +11377,7 @@ var AppShell = (0, import_react61.forwardRef)(
|
|
|
11316
11377
|
className,
|
|
11317
11378
|
...props
|
|
11318
11379
|
}, ref) => {
|
|
11319
|
-
const id = (0,
|
|
11380
|
+
const id = (0, import_react62.useId)();
|
|
11320
11381
|
if (process.env.NODE_ENV !== "production") {
|
|
11321
11382
|
devValidate("AppShell", AppShellManifest.AppShell.props, { mode, connection });
|
|
11322
11383
|
}
|
|
@@ -11378,14 +11439,14 @@ var AppShell = (0, import_react61.forwardRef)(
|
|
|
11378
11439
|
AppShell.displayName = "AppShell";
|
|
11379
11440
|
|
|
11380
11441
|
// src/Inspector/Inspector.tsx
|
|
11381
|
-
var
|
|
11442
|
+
var import_react63 = require("react");
|
|
11382
11443
|
var import_class_variance_authority29 = require("class-variance-authority");
|
|
11383
11444
|
var import_clsx45 = __toESM(require("clsx"), 1);
|
|
11384
11445
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
11385
11446
|
var inspectorStyles = (0, import_class_variance_authority29.cva)(
|
|
11386
11447
|
"flex min-w-0 flex-col gap-2u break-words border border-oprt-border bg-oprt-surface-1 p-2u font-sans text-oprt-base normal-case text-oprt-text"
|
|
11387
11448
|
);
|
|
11388
|
-
var Inspector = (0,
|
|
11449
|
+
var Inspector = (0, import_react63.forwardRef)(
|
|
11389
11450
|
({
|
|
11390
11451
|
open = true,
|
|
11391
11452
|
title,
|
|
@@ -11397,7 +11458,7 @@ var Inspector = (0, import_react62.forwardRef)(
|
|
|
11397
11458
|
"aria-describedby": describedBy,
|
|
11398
11459
|
...props
|
|
11399
11460
|
}, ref) => {
|
|
11400
|
-
const root = (0,
|
|
11461
|
+
const root = (0, import_react63.useRef)(null);
|
|
11401
11462
|
const setRef2 = useMergedRefs(root, ref);
|
|
11402
11463
|
const ids = usePartIds(["title", "description"], {
|
|
11403
11464
|
readRendered: () => root.current?.getAttribute("data-oprt-ids")
|
|
@@ -11467,7 +11528,7 @@ var InspectorManifest = {
|
|
|
11467
11528
|
};
|
|
11468
11529
|
|
|
11469
11530
|
// src/TreeView/TreeView.tsx
|
|
11470
|
-
var
|
|
11531
|
+
var import_react64 = require("react");
|
|
11471
11532
|
var import_react_aria_components20 = require("react-aria-components");
|
|
11472
11533
|
var import_icons17 = require("@oprt/icons");
|
|
11473
11534
|
var import_class_variance_authority30 = require("class-variance-authority");
|
|
@@ -11496,7 +11557,7 @@ function aimAtLabel(tree, row) {
|
|
|
11496
11557
|
row.style.scrollMarginLeft = `${Math.min(0, box.left - left)}px`;
|
|
11497
11558
|
row.style.scrollMarginRight = `${Math.min(0, right - box.right)}px`;
|
|
11498
11559
|
}
|
|
11499
|
-
var TreeView = (0,
|
|
11560
|
+
var TreeView = (0, import_react64.forwardRef)(
|
|
11500
11561
|
({
|
|
11501
11562
|
items,
|
|
11502
11563
|
label = "Navigation",
|
|
@@ -11510,12 +11571,12 @@ var TreeView = (0, import_react63.forwardRef)(
|
|
|
11510
11571
|
className,
|
|
11511
11572
|
...attributes
|
|
11512
11573
|
}, ref) => {
|
|
11513
|
-
const [localSelection, setLocalSelection] = (0,
|
|
11514
|
-
const [localExpanded, setLocalExpanded] = (0,
|
|
11574
|
+
const [localSelection, setLocalSelection] = (0, import_react64.useState)(null);
|
|
11575
|
+
const [localExpanded, setLocalExpanded] = (0, import_react64.useState)(defaultExpandedIds);
|
|
11515
11576
|
const selection = selectedId === void 0 ? localSelection : selectedId;
|
|
11516
|
-
const treeRef = (0,
|
|
11577
|
+
const treeRef = (0, import_react64.useRef)(null);
|
|
11517
11578
|
const setRef2 = useMergedRefs(treeRef, ref);
|
|
11518
|
-
(0,
|
|
11579
|
+
(0, import_react64.useEffect)(() => {
|
|
11519
11580
|
const tree = treeRef.current;
|
|
11520
11581
|
if (!tree) return;
|
|
11521
11582
|
const aim = (event) => {
|
|
@@ -11640,14 +11701,14 @@ var TreeViewManifest = {
|
|
|
11640
11701
|
};
|
|
11641
11702
|
|
|
11642
11703
|
// src/OperationalStatus/OperationalStatus.tsx
|
|
11643
|
-
var
|
|
11704
|
+
var import_react66 = require("react");
|
|
11644
11705
|
var import_class_variance_authority32 = require("class-variance-authority");
|
|
11645
11706
|
var import_clsx48 = __toESM(require("clsx"), 1);
|
|
11646
11707
|
|
|
11647
11708
|
// src/DescriptionList/DescriptionList.tsx
|
|
11648
11709
|
var import_class_variance_authority31 = require("class-variance-authority");
|
|
11649
11710
|
var import_clsx47 = __toESM(require("clsx"), 1);
|
|
11650
|
-
var
|
|
11711
|
+
var import_react65 = require("react");
|
|
11651
11712
|
|
|
11652
11713
|
// src/DescriptionList/DescriptionList.manifest.ts
|
|
11653
11714
|
var DescriptionListManifest = {
|
|
@@ -11728,13 +11789,13 @@ var valueStyles2 = (0, import_class_variance_authority31.cva)(
|
|
|
11728
11789
|
}
|
|
11729
11790
|
);
|
|
11730
11791
|
var isMissing = (value) => value === null || value === void 0 || value === "";
|
|
11731
|
-
var DescriptionList = (0,
|
|
11792
|
+
var DescriptionList = (0, import_react65.forwardRef)(
|
|
11732
11793
|
({ items, layout = "stacked", className, ...props }, ref) => {
|
|
11733
11794
|
if (process.env.NODE_ENV !== "production") {
|
|
11734
11795
|
devValidate("DescriptionList", DescriptionListManifest.DescriptionList.props, { layout });
|
|
11735
11796
|
}
|
|
11736
|
-
const reported3 = (0,
|
|
11737
|
-
(0,
|
|
11797
|
+
const reported3 = (0, import_react65.useRef)(/* @__PURE__ */ new Set());
|
|
11798
|
+
(0, import_react65.useEffect)(() => {
|
|
11738
11799
|
if (process.env.NODE_ENV === "production") return;
|
|
11739
11800
|
const fresh = items.filter(({ id, value }) => isMissing(value) && !reported3.current.has(id)).map(({ id }) => id);
|
|
11740
11801
|
if (fresh.length === 0) return;
|
|
@@ -11819,10 +11880,10 @@ var variants = {
|
|
|
11819
11880
|
unavailable: "error",
|
|
11820
11881
|
unknown: "neutral"
|
|
11821
11882
|
};
|
|
11822
|
-
var OperationalStatus = (0,
|
|
11883
|
+
var OperationalStatus = (0, import_react66.forwardRef)(
|
|
11823
11884
|
(allProps, ref) => {
|
|
11824
11885
|
const { state = "unknown", source, updatedAt, detail, className, ...props } = allProps;
|
|
11825
|
-
const qualityId = `${(0,
|
|
11886
|
+
const qualityId = `${(0, import_react66.useId)()}-quality`;
|
|
11826
11887
|
if (process.env.NODE_ENV !== "production") {
|
|
11827
11888
|
devValidate("OperationalStatus", OperationalStatusManifest.OperationalStatus.props, {
|
|
11828
11889
|
...allProps
|
|
@@ -11885,15 +11946,15 @@ var OperationalStatus = (0, import_react65.forwardRef)(
|
|
|
11885
11946
|
OperationalStatus.displayName = "OperationalStatus";
|
|
11886
11947
|
|
|
11887
11948
|
// src/ActionStatus/ActionStatus.tsx
|
|
11888
|
-
var
|
|
11949
|
+
var import_react68 = require("react");
|
|
11889
11950
|
var import_class_variance_authority33 = require("class-variance-authority");
|
|
11890
11951
|
var import_clsx49 = __toESM(require("clsx"), 1);
|
|
11891
11952
|
|
|
11892
11953
|
// src/_internal/useActionFocus.ts
|
|
11893
|
-
var
|
|
11954
|
+
var import_react67 = require("react");
|
|
11894
11955
|
function useActionFocus(ref, { onFocusCapture, onBlurCapture } = {}) {
|
|
11895
|
-
const root = (0,
|
|
11896
|
-
(0,
|
|
11956
|
+
const root = (0, import_react67.useRef)(null);
|
|
11957
|
+
(0, import_react67.useImperativeHandle)(ref, () => root.current, []);
|
|
11897
11958
|
const restore = useRestoreFocusOnRemoval(root);
|
|
11898
11959
|
return {
|
|
11899
11960
|
ref: root,
|
|
@@ -12026,7 +12087,7 @@ function ActionStatusLine({
|
|
|
12026
12087
|
}
|
|
12027
12088
|
);
|
|
12028
12089
|
}
|
|
12029
|
-
var ActionStatus = (0,
|
|
12090
|
+
var ActionStatus = (0, import_react68.forwardRef)((allProps, ref) => {
|
|
12030
12091
|
const {
|
|
12031
12092
|
state,
|
|
12032
12093
|
label,
|
|
@@ -12072,7 +12133,7 @@ var ActionStatus = (0, import_react67.forwardRef)((allProps, ref) => {
|
|
|
12072
12133
|
ActionStatus.displayName = "ActionStatus";
|
|
12073
12134
|
|
|
12074
12135
|
// src/MultiSelect/MultiSelect.tsx
|
|
12075
|
-
var
|
|
12136
|
+
var import_react69 = require("react");
|
|
12076
12137
|
var import_class_variance_authority34 = require("class-variance-authority");
|
|
12077
12138
|
var import_clsx50 = __toESM(require("clsx"), 1);
|
|
12078
12139
|
var import_icons18 = require("@oprt/icons");
|
|
@@ -12081,7 +12142,7 @@ var styles = (0, import_class_variance_authority34.cva)("m-0 min-w-0 border p-2u
|
|
|
12081
12142
|
variants: { invalid: { true: "border-oprt-error", false: "border-oprt-border" } },
|
|
12082
12143
|
defaultVariants: { invalid: false }
|
|
12083
12144
|
});
|
|
12084
|
-
var MultiSelect = (0,
|
|
12145
|
+
var MultiSelect = (0, import_react69.forwardRef)(
|
|
12085
12146
|
({
|
|
12086
12147
|
label,
|
|
12087
12148
|
options,
|
|
@@ -12096,12 +12157,12 @@ var MultiSelect = (0, import_react68.forwardRef)(
|
|
|
12096
12157
|
"aria-describedby": describedBy,
|
|
12097
12158
|
...props
|
|
12098
12159
|
}, ref) => {
|
|
12099
|
-
const fieldset = (0,
|
|
12160
|
+
const fieldset = (0, import_react69.useRef)(null);
|
|
12100
12161
|
const fieldsetRef = useMergedRefs(fieldset, ref);
|
|
12101
12162
|
const ids = usePartIds(["description", "error"], {
|
|
12102
12163
|
readRendered: () => fieldset.current?.getAttribute("data-oprt-ids")
|
|
12103
12164
|
});
|
|
12104
|
-
const [local, setLocal] = (0,
|
|
12165
|
+
const [local, setLocal] = (0, import_react69.useState)(defaultValue);
|
|
12105
12166
|
const selected = value ?? local;
|
|
12106
12167
|
const descriptions = joinIds(describedBy, description && ids.description, error && ids.error);
|
|
12107
12168
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
@@ -12228,7 +12289,7 @@ var MultiSelectManifest = {
|
|
|
12228
12289
|
};
|
|
12229
12290
|
|
|
12230
12291
|
// src/NumberInput/NumberInput.tsx
|
|
12231
|
-
var
|
|
12292
|
+
var import_react70 = require("react");
|
|
12232
12293
|
var import_class_variance_authority35 = require("class-variance-authority");
|
|
12233
12294
|
var import_clsx51 = __toESM(require("clsx"), 1);
|
|
12234
12295
|
|
|
@@ -12334,7 +12395,7 @@ function validate2(text, unit, min, max, step, required) {
|
|
|
12334
12395
|
function plainDecimal(value) {
|
|
12335
12396
|
return value.toLocaleString("en-US", { useGrouping: false, maximumFractionDigits: 20 });
|
|
12336
12397
|
}
|
|
12337
|
-
var NumberInput = (0,
|
|
12398
|
+
var NumberInput = (0, import_react70.forwardRef)((allProps, ref) => {
|
|
12338
12399
|
const {
|
|
12339
12400
|
label,
|
|
12340
12401
|
unit,
|
|
@@ -12361,22 +12422,22 @@ var NumberInput = (0, import_react69.forwardRef)((allProps, ref) => {
|
|
|
12361
12422
|
if (process.env.NODE_ENV !== "production") {
|
|
12362
12423
|
devValidate("NumberInput", NumberInputManifest.NumberInput.props, { ...allProps });
|
|
12363
12424
|
}
|
|
12364
|
-
const labelRef = (0,
|
|
12425
|
+
const labelRef = (0, import_react70.useRef)(null);
|
|
12365
12426
|
const ids = usePartIds(["unit", "description", "error", "unknown"], {
|
|
12366
12427
|
id,
|
|
12367
12428
|
readRendered: () => labelRef.current?.htmlFor
|
|
12368
12429
|
});
|
|
12369
12430
|
const inputId = ids.base;
|
|
12370
|
-
const inputRef = (0,
|
|
12431
|
+
const inputRef = (0, import_react70.useRef)(null);
|
|
12371
12432
|
const mergedRef = useMergedRefs(inputRef, ref);
|
|
12372
|
-
const [local, setLocal] = (0,
|
|
12433
|
+
const [local, setLocal] = (0, import_react70.useState)(defaultValue);
|
|
12373
12434
|
const numeric = value === void 0 ? local : value;
|
|
12374
|
-
const [draft, setDraft] = (0,
|
|
12435
|
+
const [draft, setDraft] = (0, import_react70.useState)(null);
|
|
12375
12436
|
const text = draft && Object.is(draft.base, numeric) ? draft.text : numeric === null ? "" : String(numeric);
|
|
12376
12437
|
const validation = error || validate2(text, unit, min, max, step, required);
|
|
12377
|
-
const validationRef = (0,
|
|
12438
|
+
const validationRef = (0, import_react70.useRef)(onValidationChange);
|
|
12378
12439
|
validationRef.current = onValidationChange;
|
|
12379
|
-
(0,
|
|
12440
|
+
(0, import_react70.useEffect)(() => {
|
|
12380
12441
|
inputRef.current?.setCustomValidity(validation ?? "");
|
|
12381
12442
|
validationRef.current?.(validation ?? null);
|
|
12382
12443
|
}, [validation]);
|
|
@@ -12485,11 +12546,11 @@ var NumberInput = (0, import_react69.forwardRef)((allProps, ref) => {
|
|
|
12485
12546
|
NumberInput.displayName = "NumberInput";
|
|
12486
12547
|
|
|
12487
12548
|
// src/CoordinateInput/CoordinateInput.tsx
|
|
12488
|
-
var
|
|
12549
|
+
var import_react71 = require("react");
|
|
12489
12550
|
var import_clsx52 = __toESM(require("clsx"), 1);
|
|
12490
12551
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
12491
12552
|
var unknown = { latitude: null, longitude: null };
|
|
12492
|
-
var CoordinateInput = (0,
|
|
12553
|
+
var CoordinateInput = (0, import_react71.forwardRef)(
|
|
12493
12554
|
({
|
|
12494
12555
|
label = "Coordinates",
|
|
12495
12556
|
value,
|
|
@@ -12505,18 +12566,18 @@ var CoordinateInput = (0, import_react70.forwardRef)(
|
|
|
12505
12566
|
"aria-describedby": describedBy,
|
|
12506
12567
|
...props
|
|
12507
12568
|
}, ref) => {
|
|
12508
|
-
const fieldset = (0,
|
|
12569
|
+
const fieldset = (0, import_react71.useRef)(null);
|
|
12509
12570
|
const fieldsetRef = useMergedRefs(fieldset, ref);
|
|
12510
12571
|
const ids = usePartIds(["status", "description", "error"], {
|
|
12511
12572
|
readRendered: () => fieldset.current?.getAttribute("data-oprt-ids")
|
|
12512
12573
|
});
|
|
12513
|
-
const [local, setLocal] = (0,
|
|
12514
|
-
const [invalidAxes, setInvalidAxes] = (0,
|
|
12574
|
+
const [local, setLocal] = (0, import_react71.useState)(defaultValue);
|
|
12575
|
+
const [invalidAxes, setInvalidAxes] = (0, import_react71.useState)({ latitude: false, longitude: false });
|
|
12515
12576
|
const position = value ?? local;
|
|
12516
12577
|
const invalid = Boolean(error) || invalidAxes.latitude || invalidAxes.longitude || position.latitude !== null && (!Number.isFinite(position.latitude) || Math.abs(position.latitude) > 90) || position.longitude !== null && (!Number.isFinite(position.longitude) || Math.abs(position.longitude) > 180);
|
|
12517
|
-
const validationRef = (0,
|
|
12578
|
+
const validationRef = (0, import_react71.useRef)(onValidationChange);
|
|
12518
12579
|
validationRef.current = onValidationChange;
|
|
12519
|
-
(0,
|
|
12580
|
+
(0, import_react71.useEffect)(() => {
|
|
12520
12581
|
validationRef.current?.(invalid);
|
|
12521
12582
|
}, [invalid]);
|
|
12522
12583
|
const status = invalid ? "Position invalid" : position.latitude === null || position.longitude === null ? "Position unknown" : "Decimal degrees";
|
|
@@ -12655,7 +12716,7 @@ var CoordinateInputManifest = {
|
|
|
12655
12716
|
// src/Link/Link.tsx
|
|
12656
12717
|
var import_class_variance_authority36 = require("class-variance-authority");
|
|
12657
12718
|
var import_clsx53 = __toESM(require("clsx"), 1);
|
|
12658
|
-
var
|
|
12719
|
+
var import_react72 = require("react");
|
|
12659
12720
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
12660
12721
|
var linkStyles = (0, import_class_variance_authority36.cva)(
|
|
12661
12722
|
"min-h-oprt-sm min-w-oprt-sm border border-transparent py-[calc((var(--oprt-height-sm)-2px-var(--oprt-line-base))/2)] box-decoration-clone font-sans text-oprt-base font-medium text-oprt-accent underline underline-offset-2 oprt-wrap-anywhere [&_svg]:inline-block hover:text-oprt-accent-hover aria-disabled:text-[color:inherit] aria-disabled:hover:text-[color:inherit] aria-disabled:no-underline aria-disabled:cursor-default focus-visible:outline-hidden focus-visible:border-oprt-border-focus focus-visible:shadow-oprt-focus forced-colors:focus-visible:outline-solid forced-colors:focus-visible:outline-2 forced-colors:focus-visible:outline-[CanvasText]",
|
|
@@ -12668,11 +12729,11 @@ var linkStyles = (0, import_class_variance_authority36.cva)(
|
|
|
12668
12729
|
}
|
|
12669
12730
|
);
|
|
12670
12731
|
function isIconOnly(children) {
|
|
12671
|
-
const parts =
|
|
12732
|
+
const parts = import_react72.Children.toArray(children).filter(
|
|
12672
12733
|
(part) => !(typeof part === "string" && part.trim() === "")
|
|
12673
12734
|
);
|
|
12674
12735
|
const [only] = parts;
|
|
12675
|
-
if (parts.length !== 1 || !(0,
|
|
12736
|
+
if (parts.length !== 1 || !(0, import_react72.isValidElement)(only)) return false;
|
|
12676
12737
|
const hidden = only.props["aria-hidden"];
|
|
12677
12738
|
return only.type === "svg" || hidden === true || hidden === "true" || typeof only.type !== "string" && only.props.children == null;
|
|
12678
12739
|
}
|
|
@@ -12709,7 +12770,7 @@ function reportUnsafeHref(destination) {
|
|
|
12709
12770
|
)
|
|
12710
12771
|
);
|
|
12711
12772
|
}
|
|
12712
|
-
var Link = (0,
|
|
12773
|
+
var Link = (0, import_react72.forwardRef)(
|
|
12713
12774
|
({ className, href, children, ...props }, ref) => {
|
|
12714
12775
|
const safe = typeof href !== "string" || isSafeHref(href, props.download !== void 0 && props.download !== false);
|
|
12715
12776
|
if (!safe) reportUnsafeHref(href);
|
|
@@ -12763,7 +12824,7 @@ var LinkManifest = {
|
|
|
12763
12824
|
};
|
|
12764
12825
|
|
|
12765
12826
|
// src/CopyButton/CopyButton.tsx
|
|
12766
|
-
var
|
|
12827
|
+
var import_react74 = require("react");
|
|
12767
12828
|
var import_class_variance_authority37 = require("class-variance-authority");
|
|
12768
12829
|
var import_icons19 = require("@oprt/icons");
|
|
12769
12830
|
|
|
@@ -12801,16 +12862,16 @@ var CopyButtonManifest = {
|
|
|
12801
12862
|
};
|
|
12802
12863
|
|
|
12803
12864
|
// src/_internal/useIsMounted.ts
|
|
12804
|
-
var
|
|
12865
|
+
var import_react73 = require("react");
|
|
12805
12866
|
function useIsMounted() {
|
|
12806
|
-
const mounted = (0,
|
|
12867
|
+
const mounted = (0, import_react73.useRef)(false);
|
|
12807
12868
|
useIsomorphicLayoutEffect(() => {
|
|
12808
12869
|
mounted.current = true;
|
|
12809
12870
|
return () => {
|
|
12810
12871
|
mounted.current = false;
|
|
12811
12872
|
};
|
|
12812
12873
|
}, []);
|
|
12813
|
-
return (0,
|
|
12874
|
+
return (0, import_react73.useCallback)(() => mounted.current, []);
|
|
12814
12875
|
}
|
|
12815
12876
|
|
|
12816
12877
|
// src/CopyButton/CopyButton.tsx
|
|
@@ -12844,14 +12905,14 @@ function reportLabelWithoutVisibleText(label) {
|
|
|
12844
12905
|
)
|
|
12845
12906
|
);
|
|
12846
12907
|
}
|
|
12847
|
-
var CopyButton = (0,
|
|
12908
|
+
var CopyButton = (0, import_react74.forwardRef)((allProps, ref) => {
|
|
12848
12909
|
const { value, label, onCopy, onCopyError, disabled = false, size = "md", className } = allProps;
|
|
12849
|
-
const [pending, setPending] = (0,
|
|
12910
|
+
const [pending, setPending] = (0, import_react74.useState)(false);
|
|
12850
12911
|
if (!/copy/i.test(label)) reportLabelWithoutVisibleText(label);
|
|
12851
|
-
const [feedback, setFeedback] = (0,
|
|
12852
|
-
const pendingRef = (0,
|
|
12912
|
+
const [feedback, setFeedback] = (0, import_react74.useState)(null);
|
|
12913
|
+
const pendingRef = (0, import_react74.useRef)(false);
|
|
12853
12914
|
const isMounted = useIsMounted();
|
|
12854
|
-
const context = (0,
|
|
12915
|
+
const context = (0, import_react74.useRef)({ value, label, revision: 0 });
|
|
12855
12916
|
if (process.env.NODE_ENV !== "production") {
|
|
12856
12917
|
devValidate("CopyButton", CopyButtonManifest.CopyButton.props, { ...allProps });
|
|
12857
12918
|
}
|
|
@@ -12932,7 +12993,7 @@ CopyButton.displayName = "CopyButton";
|
|
|
12932
12993
|
|
|
12933
12994
|
// src/Popover/Popover.tsx
|
|
12934
12995
|
var import_react_aria_components21 = require("react-aria-components");
|
|
12935
|
-
var
|
|
12996
|
+
var import_react75 = require("react");
|
|
12936
12997
|
var import_class_variance_authority38 = require("class-variance-authority");
|
|
12937
12998
|
var import_clsx54 = __toESM(require("clsx"), 1);
|
|
12938
12999
|
|
|
@@ -12996,7 +13057,7 @@ function topSurface() {
|
|
|
12996
13057
|
);
|
|
12997
13058
|
return surfaces[surfaces.length - 1];
|
|
12998
13059
|
}
|
|
12999
|
-
var Popover2 = (0,
|
|
13060
|
+
var Popover2 = (0, import_react75.forwardRef)(
|
|
13000
13061
|
({
|
|
13001
13062
|
children,
|
|
13002
13063
|
content,
|
|
@@ -13016,38 +13077,38 @@ var Popover2 = (0, import_react74.forwardRef)(
|
|
|
13016
13077
|
id: suppliedId,
|
|
13017
13078
|
...dialogProps
|
|
13018
13079
|
}, ref) => {
|
|
13019
|
-
const [localOpen, setLocalOpen] = (0,
|
|
13080
|
+
const [localOpen, setLocalOpen] = (0, import_react75.useState)(defaultOpen);
|
|
13020
13081
|
const isOpen = open ?? localOpen;
|
|
13021
|
-
const [positioning, setPositioning] = (0,
|
|
13022
|
-
const [tooltipOpen, setTooltipOpen] = (0,
|
|
13082
|
+
const [positioning, setPositioning] = (0, import_react75.useState)(true);
|
|
13083
|
+
const [tooltipOpen, setTooltipOpen] = (0, import_react75.useState)(false);
|
|
13023
13084
|
const motionState = useMotion(motion);
|
|
13024
13085
|
if (process.env.NODE_ENV !== "production") {
|
|
13025
13086
|
devValidate("Popover", PopoverManifest.Popover.props, { ...dialogProps, side, align });
|
|
13026
13087
|
}
|
|
13027
|
-
const generatedId = (0,
|
|
13088
|
+
const generatedId = (0, import_react75.useId)();
|
|
13028
13089
|
const id = suppliedId ?? `oprt-popover-${generatedId}`;
|
|
13029
|
-
const trigger = (0,
|
|
13030
|
-
const lastTrigger = (0,
|
|
13031
|
-
const dialog = (0,
|
|
13032
|
-
const lastDialog = (0,
|
|
13033
|
-
const wasOpen = (0,
|
|
13034
|
-
const focusFrame = (0,
|
|
13035
|
-
const focusScrollClose = (0,
|
|
13036
|
-
const current = (0,
|
|
13090
|
+
const trigger = (0, import_react75.useRef)(null);
|
|
13091
|
+
const lastTrigger = (0, import_react75.useRef)(null);
|
|
13092
|
+
const dialog = (0, import_react75.useRef)(null);
|
|
13093
|
+
const lastDialog = (0, import_react75.useRef)(null);
|
|
13094
|
+
const wasOpen = (0, import_react75.useRef)(false);
|
|
13095
|
+
const focusFrame = (0, import_react75.useRef)(void 0);
|
|
13096
|
+
const focusScrollClose = (0, import_react75.useRef)(false);
|
|
13097
|
+
const current = (0, import_react75.useRef)({ isOpen, onCloseAutoFocus, returnFocusRef });
|
|
13037
13098
|
current.current = { isOpen, onCloseAutoFocus, returnFocusRef };
|
|
13038
13099
|
const triggerChild = children;
|
|
13039
|
-
const childRef = parseInt(
|
|
13040
|
-
const rememberTrigger = (0,
|
|
13100
|
+
const childRef = parseInt(import_react75.version, 10) < 19 ? triggerChild.ref : triggerChild.props.ref;
|
|
13101
|
+
const rememberTrigger = (0, import_react75.useCallback)((node) => {
|
|
13041
13102
|
trigger.current = node;
|
|
13042
13103
|
if (node) lastTrigger.current = node;
|
|
13043
13104
|
}, []);
|
|
13044
13105
|
const setTrigger = useMergedRefs(rememberTrigger, childRef);
|
|
13045
|
-
const rememberDialog = (0,
|
|
13106
|
+
const rememberDialog = (0, import_react75.useCallback)((node) => {
|
|
13046
13107
|
dialog.current = node;
|
|
13047
13108
|
if (node) lastDialog.current = node;
|
|
13048
13109
|
}, []);
|
|
13049
13110
|
const setDialog = useMergedRefs(rememberDialog, ref);
|
|
13050
|
-
const restoreFocus = (0,
|
|
13111
|
+
const restoreFocus = (0, import_react75.useCallback)(() => {
|
|
13051
13112
|
const event = new Event("popovercloseautofocus", { cancelable: true });
|
|
13052
13113
|
current.current.onCloseAutoFocus?.(event);
|
|
13053
13114
|
if (event.defaultPrevented) return;
|
|
@@ -13062,7 +13123,7 @@ var Popover2 = (0, import_react74.forwardRef)(
|
|
|
13062
13123
|
if (target?.isConnected) target.focus({ preventScroll: true });
|
|
13063
13124
|
});
|
|
13064
13125
|
}, []);
|
|
13065
|
-
(0,
|
|
13126
|
+
(0, import_react75.useEffect)(() => {
|
|
13066
13127
|
if (isOpen && !wasOpen.current) {
|
|
13067
13128
|
if (focusFrame.current !== void 0) cancelAnimationFrame(focusFrame.current);
|
|
13068
13129
|
setTooltipOpen(false);
|
|
@@ -13071,13 +13132,13 @@ var Popover2 = (0, import_react74.forwardRef)(
|
|
|
13071
13132
|
if (!isOpen && wasOpen.current) restoreFocus();
|
|
13072
13133
|
wasOpen.current = isOpen;
|
|
13073
13134
|
}, [isOpen, restoreFocus]);
|
|
13074
|
-
(0,
|
|
13135
|
+
(0, import_react75.useEffect)(
|
|
13075
13136
|
() => () => {
|
|
13076
13137
|
if (wasOpen.current && !dialog.current?.isConnected) restoreFocus();
|
|
13077
13138
|
},
|
|
13078
13139
|
[restoreFocus]
|
|
13079
13140
|
);
|
|
13080
|
-
const requestOpen = (0,
|
|
13141
|
+
const requestOpen = (0, import_react75.useCallback)(
|
|
13081
13142
|
(next) => {
|
|
13082
13143
|
if (next && disabled) return;
|
|
13083
13144
|
if (!next && focusScrollClose.current) return;
|
|
@@ -13145,7 +13206,7 @@ var Popover2 = (0, import_react74.forwardRef)(
|
|
|
13145
13206
|
window.removeEventListener(event, interact, true);
|
|
13146
13207
|
};
|
|
13147
13208
|
}, [isOpen]);
|
|
13148
|
-
(0,
|
|
13209
|
+
(0, import_react75.useEffect)(() => {
|
|
13149
13210
|
if (!isOpen) return;
|
|
13150
13211
|
let startedOutside = false;
|
|
13151
13212
|
const start = (event) => {
|
|
@@ -13172,7 +13233,7 @@ var Popover2 = (0, import_react74.forwardRef)(
|
|
|
13172
13233
|
document.removeEventListener("pointercancel", cancel, true);
|
|
13173
13234
|
};
|
|
13174
13235
|
}, [isOpen, requestOpen]);
|
|
13175
|
-
const triggerElement = (0,
|
|
13236
|
+
const triggerElement = (0, import_react75.cloneElement)(triggerChild, {
|
|
13176
13237
|
ref: setTrigger,
|
|
13177
13238
|
disabled: disabled || triggerChild.props.disabled,
|
|
13178
13239
|
"aria-disabled": disabled || triggerChild.props["aria-disabled"],
|
|
@@ -13262,16 +13323,16 @@ var Popover2 = (0, import_react74.forwardRef)(
|
|
|
13262
13323
|
Popover2.displayName = "Popover";
|
|
13263
13324
|
|
|
13264
13325
|
// src/EntityPreview/EntityPreview.tsx
|
|
13265
|
-
var
|
|
13326
|
+
var import_react76 = require("react");
|
|
13266
13327
|
var import_class_variance_authority39 = require("class-variance-authority");
|
|
13267
13328
|
var import_clsx55 = __toESM(require("clsx"), 1);
|
|
13268
13329
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
13269
13330
|
var previewStyles = (0, import_class_variance_authority39.cva)(
|
|
13270
13331
|
"flex min-w-0 flex-col gap-2u font-sans text-oprt-base normal-case tracking-normal text-oprt-text"
|
|
13271
13332
|
);
|
|
13272
|
-
var EntityPreview = (0,
|
|
13333
|
+
var EntityPreview = (0, import_react76.forwardRef)(
|
|
13273
13334
|
({ entity, media, actions: actions2, headingLevel = 3, className, ...props }, ref) => {
|
|
13274
|
-
const instanceId = (0,
|
|
13335
|
+
const instanceId = (0, import_react76.useId)();
|
|
13275
13336
|
const headingId = `${instanceId}-name`;
|
|
13276
13337
|
const conditionId = `${instanceId}-condition`;
|
|
13277
13338
|
const Heading5 = `h${headingLevel}`;
|
|
@@ -13376,16 +13437,16 @@ var EntityPreviewManifest = {
|
|
|
13376
13437
|
};
|
|
13377
13438
|
|
|
13378
13439
|
// src/FormSection/FormSection.tsx
|
|
13379
|
-
var
|
|
13440
|
+
var import_react77 = require("react");
|
|
13380
13441
|
var import_class_variance_authority40 = require("class-variance-authority");
|
|
13381
13442
|
var import_clsx56 = __toESM(require("clsx"), 1);
|
|
13382
13443
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
13383
13444
|
var sectionStyles = (0, import_class_variance_authority40.cva)(
|
|
13384
13445
|
"m-0 min-w-0 border border-oprt-border bg-oprt-surface-1 p-3u font-sans text-oprt-base normal-case tracking-normal text-oprt-text"
|
|
13385
13446
|
);
|
|
13386
|
-
var FormSection = (0,
|
|
13447
|
+
var FormSection = (0, import_react77.forwardRef)(
|
|
13387
13448
|
({ legend, description, children, className, "aria-describedby": describedBy, ...props }, ref) => {
|
|
13388
|
-
const root = (0,
|
|
13449
|
+
const root = (0, import_react77.useRef)(null);
|
|
13389
13450
|
const mergedRef = useMergedRefs(root, ref);
|
|
13390
13451
|
const ids = usePartIds(["description"], {
|
|
13391
13452
|
id: props.id,
|
|
@@ -13449,7 +13510,7 @@ var FormSectionManifest = {
|
|
|
13449
13510
|
};
|
|
13450
13511
|
|
|
13451
13512
|
// src/FormErrorSummary/FormErrorSummary.tsx
|
|
13452
|
-
var
|
|
13513
|
+
var import_react78 = require("react");
|
|
13453
13514
|
var import_class_variance_authority41 = require("class-variance-authority");
|
|
13454
13515
|
var import_clsx57 = __toESM(require("clsx"), 1);
|
|
13455
13516
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
@@ -13459,7 +13520,7 @@ var summaryStyles = (0, import_class_variance_authority41.cva)(
|
|
|
13459
13520
|
var errorStyles = (0, import_class_variance_authority41.cva)(
|
|
13460
13521
|
"inline-flex min-h-3u min-w-3u max-w-full items-center border border-transparent px-1u py-0.5u text-left text-oprt-base font-medium normal-case tracking-normal text-oprt-text underline underline-offset-2 hover:text-oprt-accent outline-hidden focus-visible:border-oprt-border-focus focus-visible:shadow-oprt-focus oprt-wrap-anywhere"
|
|
13461
13522
|
);
|
|
13462
|
-
var FormErrorSummary = (0,
|
|
13523
|
+
var FormErrorSummary = (0, import_react78.forwardRef)(
|
|
13463
13524
|
({
|
|
13464
13525
|
errors,
|
|
13465
13526
|
title = "Check these fields",
|
|
@@ -13469,7 +13530,7 @@ var FormErrorSummary = (0, import_react77.forwardRef)(
|
|
|
13469
13530
|
"aria-labelledby": labelledBy,
|
|
13470
13531
|
...props
|
|
13471
13532
|
}, ref) => {
|
|
13472
|
-
const root = (0,
|
|
13533
|
+
const root = (0, import_react78.useRef)(null);
|
|
13473
13534
|
const mergedRef = useMergedRefs(root, ref);
|
|
13474
13535
|
const ids = usePartIds(["title"], {
|
|
13475
13536
|
id: props.id,
|
|
@@ -13540,7 +13601,7 @@ var FormErrorSummaryManifest = {
|
|
|
13540
13601
|
};
|
|
13541
13602
|
|
|
13542
13603
|
// src/Calendar/Calendar.tsx
|
|
13543
|
-
var
|
|
13604
|
+
var import_react79 = require("react");
|
|
13544
13605
|
var import_date2 = require("@internationalized/date");
|
|
13545
13606
|
var import_react_aria_components22 = require("react-aria-components");
|
|
13546
13607
|
var import_class_variance_authority42 = require("class-variance-authority");
|
|
@@ -13726,7 +13787,7 @@ function CalendarContent() {
|
|
|
13726
13787
|
] })
|
|
13727
13788
|
] });
|
|
13728
13789
|
}
|
|
13729
|
-
var Calendar2 = (0,
|
|
13790
|
+
var Calendar2 = (0, import_react79.forwardRef)(
|
|
13730
13791
|
({
|
|
13731
13792
|
label,
|
|
13732
13793
|
value,
|
|
@@ -13739,10 +13800,10 @@ var Calendar2 = (0, import_react78.forwardRef)(
|
|
|
13739
13800
|
id,
|
|
13740
13801
|
className
|
|
13741
13802
|
}, ref) => {
|
|
13742
|
-
const generated = (0,
|
|
13803
|
+
const generated = (0, import_react79.useId)();
|
|
13743
13804
|
const errorId = `${id ?? generated}-error`;
|
|
13744
13805
|
const hydration = useHydrationRoot(id);
|
|
13745
|
-
const config = (0,
|
|
13806
|
+
const config = (0, import_react79.useMemo)(() => dateConfiguration(value, min, max), [value, min, max]);
|
|
13746
13807
|
const error = config.error ?? (required && value === null ? "A date is required." : null);
|
|
13747
13808
|
return (
|
|
13748
13809
|
// The key remounts the error with the calendar, so both take the client's ids when hydration
|
|
@@ -13817,7 +13878,7 @@ var CalendarManifest = {
|
|
|
13817
13878
|
};
|
|
13818
13879
|
|
|
13819
13880
|
// src/DatePicker/DatePicker.tsx
|
|
13820
|
-
var
|
|
13881
|
+
var import_react81 = require("react");
|
|
13821
13882
|
var import_react_aria_components23 = require("react-aria-components");
|
|
13822
13883
|
var import_date4 = require("@internationalized/date");
|
|
13823
13884
|
var import_icons21 = require("@oprt/icons");
|
|
@@ -13825,12 +13886,12 @@ var import_class_variance_authority43 = require("class-variance-authority");
|
|
|
13825
13886
|
var import_clsx59 = __toESM(require("clsx"), 1);
|
|
13826
13887
|
|
|
13827
13888
|
// src/_internal/segmentField.ts
|
|
13828
|
-
var
|
|
13889
|
+
var import_react80 = require("react");
|
|
13829
13890
|
function sameSnapshot(a, b) {
|
|
13830
13891
|
return a.value === b.value && a.empty === b.empty && a.valid === b.valid;
|
|
13831
13892
|
}
|
|
13832
13893
|
function useReportSegments(segments2, read, report2) {
|
|
13833
|
-
const last = (0,
|
|
13894
|
+
const last = (0, import_react80.useRef)(null);
|
|
13834
13895
|
useIsomorphicLayoutEffect(() => {
|
|
13835
13896
|
const snapshot = read(segments2);
|
|
13836
13897
|
const previous = last.current;
|
|
@@ -13877,11 +13938,11 @@ function useSegmentDraft({
|
|
|
13877
13938
|
rejected: false,
|
|
13878
13939
|
rejection: null
|
|
13879
13940
|
};
|
|
13880
|
-
const [draft, setDraft] = (0,
|
|
13941
|
+
const [draft, setDraft] = (0, import_react80.useState)(initial);
|
|
13881
13942
|
const current = draft.base === value ? draft : initial;
|
|
13882
|
-
const raw = (0,
|
|
13883
|
-
const rejectBlur = (0,
|
|
13884
|
-
const report2 = (0,
|
|
13943
|
+
const raw = (0, import_react80.useRef)(current.snapshot);
|
|
13944
|
+
const rejectBlur = (0, import_react80.useRef)(false);
|
|
13945
|
+
const report2 = (0, import_react80.useCallback)(
|
|
13885
13946
|
(snapshot) => {
|
|
13886
13947
|
raw.current = snapshot;
|
|
13887
13948
|
setDraft(
|
|
@@ -13928,7 +13989,7 @@ function useSegmentDraft({
|
|
|
13928
13989
|
accept: () => setDraft((previous) => ({ ...previous, rejected: false, rejection: null }))
|
|
13929
13990
|
};
|
|
13930
13991
|
}
|
|
13931
|
-
var SegmentGroupContext = (0,
|
|
13992
|
+
var SegmentGroupContext = (0, import_react80.createContext)(null);
|
|
13932
13993
|
|
|
13933
13994
|
// src/DatePicker/DatePicker.tsx
|
|
13934
13995
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
@@ -13937,11 +13998,11 @@ function ObservedYear({
|
|
|
13937
13998
|
segment,
|
|
13938
13999
|
report: report2
|
|
13939
14000
|
}) {
|
|
13940
|
-
const state = (0,
|
|
14001
|
+
const state = (0, import_react81.useContext)(import_react_aria_components23.DateFieldStateContext);
|
|
13941
14002
|
useReportSegments(state.segments, readDateSegments, report2);
|
|
13942
14003
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react_aria_components23.DateSegment, { segment, className: SEGMENT_STYLES });
|
|
13943
14004
|
}
|
|
13944
|
-
var DatePicker = (0,
|
|
14005
|
+
var DatePicker = (0, import_react81.forwardRef)(
|
|
13945
14006
|
({
|
|
13946
14007
|
label,
|
|
13947
14008
|
value,
|
|
@@ -13956,19 +14017,19 @@ var DatePicker = (0, import_react80.forwardRef)(
|
|
|
13956
14017
|
className,
|
|
13957
14018
|
motion = "auto"
|
|
13958
14019
|
}, ref) => {
|
|
13959
|
-
const generated = (0,
|
|
14020
|
+
const generated = (0, import_react81.useId)();
|
|
13960
14021
|
const inputId = id ?? `oprt-date-${generated}`;
|
|
13961
14022
|
const hydration = useHydrationRoot(inputId);
|
|
13962
14023
|
const { locale } = (0, import_react_aria_components23.useLocale)();
|
|
13963
|
-
const gregorianLocale = (0,
|
|
14024
|
+
const gregorianLocale = (0, import_react81.useMemo)(
|
|
13964
14025
|
() => new Intl.Locale(locale, { calendar: "gregory" }).toString(),
|
|
13965
14026
|
[locale]
|
|
13966
14027
|
);
|
|
13967
|
-
const config = (0,
|
|
14028
|
+
const config = (0, import_react81.useMemo)(() => dateConfiguration(value, min, max), [value, min, max]);
|
|
13968
14029
|
const displayedValue = config.date?.toString() ?? null;
|
|
13969
14030
|
const motionState = useMotion(motion);
|
|
13970
|
-
const calendarButton = (0,
|
|
13971
|
-
const group = (0,
|
|
14031
|
+
const calendarButton = (0, import_react81.useRef)(null);
|
|
14032
|
+
const group = (0, import_react81.useContext)(SegmentGroupContext);
|
|
13972
14033
|
const calendarMin = parseDateOnly(group?.calendar?.min);
|
|
13973
14034
|
const calendarMax = parseDateOnly(group?.calendar?.max);
|
|
13974
14035
|
const minValue = calendarMin && calendarMin.compare(config.min) > 0 ? calendarMin : config.min;
|
|
@@ -13985,10 +14046,10 @@ var DatePicker = (0, import_react80.forwardRef)(
|
|
|
13985
14046
|
// The bound an edit crossed, named as for a supplied value (DatePicker-R6).
|
|
13986
14047
|
draft.rejection ?? "Enter a complete, valid date within the allowed bounds."
|
|
13987
14048
|
) : null);
|
|
13988
|
-
const validityCallback = (0,
|
|
14049
|
+
const validityCallback = (0, import_react81.useRef)(onDraftValidityChange);
|
|
13989
14050
|
validityCallback.current = onDraftValidityChange;
|
|
13990
14051
|
const pending = draft.pending;
|
|
13991
|
-
(0,
|
|
14052
|
+
(0, import_react81.useEffect)(() => validityCallback.current?.(!error, { pending }), [error, pending]);
|
|
13992
14053
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react_aria_components23.I18nProvider, { locale: gregorianLocale, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
13993
14054
|
import_react_aria_components23.DatePicker,
|
|
13994
14055
|
{
|
|
@@ -14113,7 +14174,7 @@ var DatePickerManifest = {
|
|
|
14113
14174
|
};
|
|
14114
14175
|
|
|
14115
14176
|
// src/InlineEdit/InlineEdit.tsx
|
|
14116
|
-
var
|
|
14177
|
+
var import_react82 = require("react");
|
|
14117
14178
|
var import_class_variance_authority44 = require("class-variance-authority");
|
|
14118
14179
|
var import_clsx60 = __toESM(require("clsx"), 1);
|
|
14119
14180
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
@@ -14124,35 +14185,35 @@ function matchesAttempt(attempt, value, label) {
|
|
|
14124
14185
|
const acceptedReplacement = value === attempt.submitted && value !== attempt.session.baseline;
|
|
14125
14186
|
return (label === attempt.session.label || acceptedReplacement) && (value === attempt.session.baseline || value === attempt.submitted);
|
|
14126
14187
|
}
|
|
14127
|
-
var InlineEdit = (0,
|
|
14188
|
+
var InlineEdit = (0, import_react82.forwardRef)(
|
|
14128
14189
|
({ label, value, onSave, disabled = false, readOnly = false, validate: validate3, className, ...props }, ref) => {
|
|
14129
|
-
const [editing, setEditing] = (0,
|
|
14130
|
-
const [draft, setDraft] = (0,
|
|
14131
|
-
const [error, setError] = (0,
|
|
14132
|
-
const [pending, setPending] = (0,
|
|
14133
|
-
const [multiline, setMultiline] = (0,
|
|
14134
|
-
const [returnFocus, setReturnFocus] = (0,
|
|
14135
|
-
const [changedTo, setChangedTo] = (0,
|
|
14136
|
-
const rootRef = (0,
|
|
14190
|
+
const [editing, setEditing] = (0, import_react82.useState)(false);
|
|
14191
|
+
const [draft, setDraft] = (0, import_react82.useState)(value);
|
|
14192
|
+
const [error, setError] = (0, import_react82.useState)(null);
|
|
14193
|
+
const [pending, setPending] = (0, import_react82.useState)(false);
|
|
14194
|
+
const [multiline, setMultiline] = (0, import_react82.useState)(false);
|
|
14195
|
+
const [returnFocus, setReturnFocus] = (0, import_react82.useState)(null);
|
|
14196
|
+
const [changedTo, setChangedTo] = (0, import_react82.useState)(null);
|
|
14197
|
+
const rootRef = (0, import_react82.useRef)(null);
|
|
14137
14198
|
const mergedRef = useMergedRefs(rootRef, ref);
|
|
14138
|
-
const inputRef = (0,
|
|
14139
|
-
const editRef = (0,
|
|
14140
|
-
const refocusInput = (0,
|
|
14141
|
-
const session = (0,
|
|
14142
|
-
const request = (0,
|
|
14143
|
-
const composing = (0,
|
|
14199
|
+
const inputRef = (0, import_react82.useRef)(null);
|
|
14200
|
+
const editRef = (0, import_react82.useRef)(null);
|
|
14201
|
+
const refocusInput = (0, import_react82.useRef)(false);
|
|
14202
|
+
const session = (0, import_react82.useRef)(null);
|
|
14203
|
+
const request = (0, import_react82.useRef)(null);
|
|
14204
|
+
const composing = (0, import_react82.useRef)(false);
|
|
14144
14205
|
const isMounted = useIsMounted();
|
|
14145
|
-
const latest = (0,
|
|
14206
|
+
const latest = (0, import_react82.useRef)({ label, value, disabled, readOnly });
|
|
14146
14207
|
latest.current = { label, value, disabled, readOnly };
|
|
14147
14208
|
const ids = usePartIds(["error", "changed"]);
|
|
14148
|
-
(0,
|
|
14209
|
+
(0, import_react82.useEffect)(
|
|
14149
14210
|
() => () => {
|
|
14150
14211
|
session.current = null;
|
|
14151
14212
|
request.current = null;
|
|
14152
14213
|
},
|
|
14153
14214
|
[]
|
|
14154
14215
|
);
|
|
14155
|
-
(0,
|
|
14216
|
+
(0, import_react82.useEffect)(() => {
|
|
14156
14217
|
const current = session.current;
|
|
14157
14218
|
if (!current) return;
|
|
14158
14219
|
const attempt = request.current;
|
|
@@ -14170,17 +14231,17 @@ var InlineEdit = (0, import_react81.forwardRef)(
|
|
|
14170
14231
|
session.current = { baseline: value, label };
|
|
14171
14232
|
if (current.baseline !== value) setChangedTo(value);
|
|
14172
14233
|
}, [value, label, disabled, readOnly]);
|
|
14173
|
-
(0,
|
|
14234
|
+
(0, import_react82.useEffect)(() => {
|
|
14174
14235
|
if (editing) inputRef.current?.focus();
|
|
14175
14236
|
}, [editing]);
|
|
14176
|
-
(0,
|
|
14237
|
+
(0, import_react82.useEffect)(() => {
|
|
14177
14238
|
if (pending || !refocusInput.current) return;
|
|
14178
14239
|
refocusInput.current = false;
|
|
14179
14240
|
const active = document.activeElement;
|
|
14180
14241
|
if (active === null || active === document.body || rootRef.current?.contains(active))
|
|
14181
14242
|
inputRef.current?.focus();
|
|
14182
14243
|
}, [pending]);
|
|
14183
|
-
(0,
|
|
14244
|
+
(0, import_react82.useEffect)(() => {
|
|
14184
14245
|
if (!returnFocus || editing) return;
|
|
14185
14246
|
if (!disabled && !readOnly && matchesAttempt(returnFocus, value, label))
|
|
14186
14247
|
editRef.current?.focus();
|
|
@@ -14402,7 +14463,7 @@ var InlineEditManifest = {
|
|
|
14402
14463
|
};
|
|
14403
14464
|
|
|
14404
14465
|
// src/ContextMenu/ContextMenu.tsx
|
|
14405
|
-
var
|
|
14466
|
+
var import_react83 = require("react");
|
|
14406
14467
|
var import_react_aria_components24 = require("react-aria-components");
|
|
14407
14468
|
var import_react_aria6 = require("react-aria");
|
|
14408
14469
|
var import_class_variance_authority45 = require("class-variance-authority");
|
|
@@ -14421,7 +14482,7 @@ function ContextSurface({
|
|
|
14421
14482
|
disabled,
|
|
14422
14483
|
children
|
|
14423
14484
|
}) {
|
|
14424
|
-
const surfaceRef = (0,
|
|
14485
|
+
const surfaceRef = (0, import_react83.useRef)(null);
|
|
14425
14486
|
const { pressProps } = (0, import_react_aria6.usePress)({ ref: surfaceRef, isDisabled: disabled });
|
|
14426
14487
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14427
14488
|
"div",
|
|
@@ -14458,7 +14519,7 @@ function ContextSurface({
|
|
|
14458
14519
|
}
|
|
14459
14520
|
);
|
|
14460
14521
|
}
|
|
14461
|
-
var ContextMenu = (0,
|
|
14522
|
+
var ContextMenu = (0, import_react83.forwardRef)(
|
|
14462
14523
|
({
|
|
14463
14524
|
label,
|
|
14464
14525
|
items,
|
|
@@ -14469,10 +14530,10 @@ var ContextMenu = (0, import_react82.forwardRef)(
|
|
|
14469
14530
|
className,
|
|
14470
14531
|
...props
|
|
14471
14532
|
}, ref) => {
|
|
14472
|
-
const [open, setOpen] = (0,
|
|
14533
|
+
const [open, setOpen] = (0, import_react83.useState)(null);
|
|
14473
14534
|
const hydration = useHydrationRoot();
|
|
14474
14535
|
const motionState = useMotion("auto", "ContextMenu");
|
|
14475
|
-
(0,
|
|
14536
|
+
(0, import_react83.useEffect)(() => {
|
|
14476
14537
|
if (disabled) setOpen(null);
|
|
14477
14538
|
}, [disabled]);
|
|
14478
14539
|
const menu = () => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
@@ -14608,18 +14669,18 @@ var ContextMenuManifest = {
|
|
|
14608
14669
|
};
|
|
14609
14670
|
|
|
14610
14671
|
// src/TimeField/TimeField.tsx
|
|
14611
|
-
var
|
|
14672
|
+
var import_react84 = require("react");
|
|
14612
14673
|
var import_react_aria_components25 = require("react-aria-components");
|
|
14613
14674
|
var import_class_variance_authority46 = require("class-variance-authority");
|
|
14614
14675
|
var import_clsx62 = __toESM(require("clsx"), 1);
|
|
14615
14676
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
14616
14677
|
var fieldStyles3 = (0, import_class_variance_authority46.cva)("flex min-w-0 flex-col gap-1u font-sans text-oprt-base text-oprt-text");
|
|
14617
14678
|
function DraftObserver({ report: report2 }) {
|
|
14618
|
-
const state = (0,
|
|
14679
|
+
const state = (0, import_react84.useContext)(import_react_aria_components25.TimeFieldStateContext);
|
|
14619
14680
|
useReportSegments(state.segments, readTimeSegments, report2);
|
|
14620
14681
|
return null;
|
|
14621
14682
|
}
|
|
14622
|
-
var TimeField = (0,
|
|
14683
|
+
var TimeField = (0, import_react84.forwardRef)(
|
|
14623
14684
|
({
|
|
14624
14685
|
label,
|
|
14625
14686
|
value,
|
|
@@ -14633,12 +14694,12 @@ var TimeField = (0, import_react83.forwardRef)(
|
|
|
14633
14694
|
id,
|
|
14634
14695
|
className
|
|
14635
14696
|
}, ref) => {
|
|
14636
|
-
const generated = (0,
|
|
14697
|
+
const generated = (0, import_react84.useId)();
|
|
14637
14698
|
const inputId = id ?? `oprt-time-${generated}`;
|
|
14638
14699
|
const hydration = useHydrationRoot(inputId);
|
|
14639
|
-
const config = (0,
|
|
14700
|
+
const config = (0, import_react84.useMemo)(() => timeConfiguration(value, min, max), [value, min, max]);
|
|
14640
14701
|
const displayedValue = config.time ? formatTimeOnly(config.time) : null;
|
|
14641
|
-
const group = (0,
|
|
14702
|
+
const group = (0, import_react84.useContext)(SegmentGroupContext);
|
|
14642
14703
|
const draft = useSegmentDraft({
|
|
14643
14704
|
value,
|
|
14644
14705
|
displayed: displayedValue,
|
|
@@ -14651,10 +14712,10 @@ var TimeField = (0, import_react83.forwardRef)(
|
|
|
14651
14712
|
// The bound an edit crossed, named as for a supplied value (TimeField-R1).
|
|
14652
14713
|
draft.rejection ?? "Enter a complete, valid time within the allowed bounds."
|
|
14653
14714
|
) : null);
|
|
14654
|
-
const callback = (0,
|
|
14715
|
+
const callback = (0, import_react84.useRef)(onDraftValidityChange);
|
|
14655
14716
|
callback.current = onDraftValidityChange;
|
|
14656
14717
|
const pending = draft.pending;
|
|
14657
|
-
(0,
|
|
14718
|
+
(0, import_react84.useEffect)(() => callback.current?.(!error, { pending }), [error, pending]);
|
|
14658
14719
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { ...draft.editProps, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
14659
14720
|
import_react_aria_components25.TimeField,
|
|
14660
14721
|
{
|
|
@@ -14739,14 +14800,14 @@ var TimeFieldManifest = {
|
|
|
14739
14800
|
};
|
|
14740
14801
|
|
|
14741
14802
|
// src/DateTimePicker/DateTimePicker.tsx
|
|
14742
|
-
var
|
|
14803
|
+
var import_react85 = require("react");
|
|
14743
14804
|
var import_class_variance_authority47 = require("class-variance-authority");
|
|
14744
14805
|
var import_clsx63 = __toESM(require("clsx"), 1);
|
|
14745
14806
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14746
14807
|
var pickerStyles = (0, import_class_variance_authority47.cva)(
|
|
14747
14808
|
"flex min-w-0 flex-col gap-2u font-sans text-oprt-base text-oprt-text focus-visible:outline-hidden focus-visible:shadow-oprt-focus"
|
|
14748
14809
|
);
|
|
14749
|
-
var DateTimePicker = (0,
|
|
14810
|
+
var DateTimePicker = (0, import_react85.forwardRef)(
|
|
14750
14811
|
({
|
|
14751
14812
|
label,
|
|
14752
14813
|
value,
|
|
@@ -14761,7 +14822,7 @@ var DateTimePicker = (0, import_react84.forwardRef)(
|
|
|
14761
14822
|
id,
|
|
14762
14823
|
className
|
|
14763
14824
|
}, ref) => {
|
|
14764
|
-
const root = (0,
|
|
14825
|
+
const root = (0, import_react85.useRef)(null);
|
|
14765
14826
|
const setRoot = useMergedRefs(root, ref);
|
|
14766
14827
|
const ids = usePartIds(["label", "zone", "error", "status"], {
|
|
14767
14828
|
id,
|
|
@@ -14769,7 +14830,7 @@ var DateTimePicker = (0, import_react84.forwardRef)(
|
|
|
14769
14830
|
});
|
|
14770
14831
|
const zoneName = typeof timeZone === "string" ? timeZone : "invalid";
|
|
14771
14832
|
const base = `${String(value)}|${String(timeZone)}`;
|
|
14772
|
-
const wall = (0,
|
|
14833
|
+
const wall = (0, import_react85.useMemo)(() => instantWallTime(value, timeZone), [value, timeZone]);
|
|
14773
14834
|
const initial = {
|
|
14774
14835
|
base,
|
|
14775
14836
|
date: wall.date,
|
|
@@ -14779,7 +14840,7 @@ var DateTimePicker = (0, import_react84.forwardRef)(
|
|
|
14779
14840
|
timeValid: true,
|
|
14780
14841
|
dirty: false
|
|
14781
14842
|
};
|
|
14782
|
-
const [draft, setDraft] = (0,
|
|
14843
|
+
const [draft, setDraft] = (0, import_react85.useState)(initial);
|
|
14783
14844
|
const current = draft.base === base ? draft : initial;
|
|
14784
14845
|
const zoneValid = validTimeZone(timeZone);
|
|
14785
14846
|
const boundsValid = (min === void 0 || validInstant(min)) && (max === void 0 || validInstant(max)) && !(min !== void 0 && max !== void 0 && min > max);
|
|
@@ -14789,11 +14850,11 @@ var DateTimePicker = (0, import_react84.forwardRef)(
|
|
|
14789
14850
|
const empty = current.date === null && current.time === null;
|
|
14790
14851
|
const checkedInstant = current.dirty ? candidate : value;
|
|
14791
14852
|
const error = !zoneValid ? "Invalid time zone. Supply an IANA time zone." : !boundsValid ? "Invalid instant bounds. Supply finite epoch milliseconds in ascending order." : !current.dirty && wall.error ? wall.error : !current.dateValid || !current.timeValid ? "Complete the date and time before applying this change." : empty ? required ? "A date and time are required." : null : !current.date || !current.time ? "Enter both a date and a time." : resolution?.status === "invalid" ? resolution.error : ambiguous && current.occurrence === null ? "Choose the earlier or later occurrence of this repeated time." : checkedInstant !== null && min !== void 0 && checkedInstant < min ? `Choose an instant at or after ${formatUtcTimestamp(min)}.` : checkedInstant !== null && max !== void 0 && checkedInstant > max ? `Choose an instant at or before ${formatUtcTimestamp(max)}.` : null;
|
|
14792
|
-
const group = (0,
|
|
14853
|
+
const group = (0, import_react85.useMemo)(() => {
|
|
14793
14854
|
const dayOf = (bound) => bound !== void 0 && zoneValid && boundsValid ? instantWallTime(bound, timeZone).date ?? void 0 : void 0;
|
|
14794
14855
|
return { required, calendar: { min: dayOf(min), max: dayOf(max) } };
|
|
14795
14856
|
}, [required, min, max, timeZone, zoneValid, boundsValid]);
|
|
14796
|
-
const restoring = (0,
|
|
14857
|
+
const restoring = (0, import_react85.useRef)(false);
|
|
14797
14858
|
const restore = useRestoreFocusOnRemoval(root, {
|
|
14798
14859
|
findTarget: () => {
|
|
14799
14860
|
restoring.current = true;
|
|
@@ -14811,9 +14872,9 @@ var DateTimePicker = (0, import_react84.forwardRef)(
|
|
|
14811
14872
|
const from = event.relatedTarget;
|
|
14812
14873
|
return from instanceof Node && event.currentTarget.contains(from);
|
|
14813
14874
|
};
|
|
14814
|
-
const callback = (0,
|
|
14875
|
+
const callback = (0, import_react85.useRef)(onDraftValidityChange);
|
|
14815
14876
|
callback.current = onDraftValidityChange;
|
|
14816
|
-
(0,
|
|
14877
|
+
(0, import_react85.useEffect)(
|
|
14817
14878
|
() => callback.current?.(!error && !current.dirty, { pending: current.dirty }),
|
|
14818
14879
|
[error, current.dirty]
|
|
14819
14880
|
);
|
|
@@ -14975,7 +15036,7 @@ var DateTimePickerManifest = {
|
|
|
14975
15036
|
};
|
|
14976
15037
|
|
|
14977
15038
|
// src/DateRangePicker/DateRangePicker.tsx
|
|
14978
|
-
var
|
|
15039
|
+
var import_react86 = require("react");
|
|
14979
15040
|
var import_class_variance_authority48 = require("class-variance-authority");
|
|
14980
15041
|
var import_clsx64 = __toESM(require("clsx"), 1);
|
|
14981
15042
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
@@ -14984,7 +15045,7 @@ var rangeStyles3 = (0, import_class_variance_authority48.cva)(
|
|
|
14984
15045
|
);
|
|
14985
15046
|
var REQUIRED_GROUP = { required: true };
|
|
14986
15047
|
var keyOf = (value) => value === null ? "null" : JSON.stringify([value.start, value.end]);
|
|
14987
|
-
var DateRangePicker = (0,
|
|
15048
|
+
var DateRangePicker = (0, import_react86.forwardRef)(
|
|
14988
15049
|
({
|
|
14989
15050
|
label,
|
|
14990
15051
|
value,
|
|
@@ -15000,14 +15061,14 @@ var DateRangePicker = (0, import_react85.forwardRef)(
|
|
|
15000
15061
|
id,
|
|
15001
15062
|
className
|
|
15002
15063
|
}, ref) => {
|
|
15003
|
-
const root = (0,
|
|
15064
|
+
const root = (0, import_react86.useRef)(null);
|
|
15004
15065
|
const setRoot = useMergedRefs(root, ref);
|
|
15005
15066
|
const ids = usePartIds(["label", "error", "status"], {
|
|
15006
15067
|
id,
|
|
15007
15068
|
readRendered: () => root.current?.id
|
|
15008
15069
|
});
|
|
15009
15070
|
const base = keyOf(value);
|
|
15010
|
-
const [replacement, setReplacement] = (0,
|
|
15071
|
+
const [replacement, setReplacement] = (0, import_react86.useState)({ base, generation: 0, requested: null });
|
|
15011
15072
|
if (replacement.base !== base) {
|
|
15012
15073
|
setReplacement({
|
|
15013
15074
|
base,
|
|
@@ -15029,7 +15090,7 @@ var DateRangePicker = (0, import_react85.forwardRef)(
|
|
|
15029
15090
|
startPending: false,
|
|
15030
15091
|
endPending: false
|
|
15031
15092
|
};
|
|
15032
|
-
const [draft, setDraft] = (0,
|
|
15093
|
+
const [draft, setDraft] = (0, import_react86.useState)(initial);
|
|
15033
15094
|
const current = draft.base === base ? draft : initial;
|
|
15034
15095
|
const start = parseDateOnly(current.start);
|
|
15035
15096
|
const end = parseDateOnly(current.end);
|
|
@@ -15038,9 +15099,9 @@ var DateRangePicker = (0, import_react85.forwardRef)(
|
|
|
15038
15099
|
const empty = current.start === null && current.end === null;
|
|
15039
15100
|
const pending = current.startPending || current.endPending || current.start !== (value?.start ?? null) || current.end !== (value?.end ?? null);
|
|
15040
15101
|
const error = startConfig.error || endConfig.error || (!current.startValid || !current.endValid ? "Complete both date fields before continuing." : empty ? required ? "A date range is required." : null : !start || !end ? "Enter both a start date and an end date." : start.compare(end) > 0 ? "Start date must be on or before end date." : null);
|
|
15041
|
-
const callback = (0,
|
|
15102
|
+
const callback = (0, import_react86.useRef)(onDraftValidityChange);
|
|
15042
15103
|
callback.current = onDraftValidityChange;
|
|
15043
|
-
(0,
|
|
15104
|
+
(0, import_react86.useEffect)(() => callback.current?.(!error && !pending, { pending }), [error, pending]);
|
|
15044
15105
|
const setEndpoint = (part, next) => {
|
|
15045
15106
|
if (disabled || readOnly) return;
|
|
15046
15107
|
const nextDraft = { ...current, [part]: next };
|
|
@@ -15155,7 +15216,7 @@ var DateRangePickerManifest = {
|
|
|
15155
15216
|
};
|
|
15156
15217
|
|
|
15157
15218
|
// src/FileUpload/FileUpload.tsx
|
|
15158
|
-
var
|
|
15219
|
+
var import_react87 = require("react");
|
|
15159
15220
|
var import_react_aria_components26 = require("react-aria-components");
|
|
15160
15221
|
var import_class_variance_authority49 = require("class-variance-authority");
|
|
15161
15222
|
var import_clsx65 = __toESM(require("clsx"), 1);
|
|
@@ -15183,7 +15244,7 @@ var dropStyles = (0, import_class_variance_authority49.cva)(
|
|
|
15183
15244
|
"flex min-w-0 flex-col items-start gap-2u border border-dashed border-oprt-border bg-oprt-surface-1 p-3u data-[drop-target]:border-oprt-accent data-[focus-visible]:border-oprt-border-focus data-[focus-visible]:shadow-oprt-focus"
|
|
15184
15245
|
);
|
|
15185
15246
|
var validAccept = (token) => /^\.[a-z0-9][a-z0-9._+-]*$/i.test(token) || /^(?:[a-z0-9!#$&^_.+-]+\/(?:[a-z0-9!#$&^_.+-]+|\*)|\*\/\*)$/i.test(token);
|
|
15186
|
-
var FileUpload = (0,
|
|
15247
|
+
var FileUpload = (0, import_react87.forwardRef)(
|
|
15187
15248
|
({
|
|
15188
15249
|
label,
|
|
15189
15250
|
description,
|
|
@@ -15199,29 +15260,29 @@ var FileUpload = (0, import_react86.forwardRef)(
|
|
|
15199
15260
|
"aria-describedby": describedBy,
|
|
15200
15261
|
...props
|
|
15201
15262
|
}, ref) => {
|
|
15202
|
-
const root = (0,
|
|
15263
|
+
const root = (0, import_react87.useRef)(null);
|
|
15203
15264
|
const mergedRef = useMergedRefs(root, ref);
|
|
15204
15265
|
const ids = usePartIds(["label", "description", "configuration"], {
|
|
15205
15266
|
id: props.id,
|
|
15206
15267
|
readRendered: () => root.current?.getAttribute("data-oprt-ids")
|
|
15207
15268
|
});
|
|
15208
|
-
const [issues, setIssues] = (0,
|
|
15209
|
-
const [reading, setReading] = (0,
|
|
15210
|
-
const [feedback, setFeedback] = (0,
|
|
15269
|
+
const [issues, setIssues] = (0, import_react87.useState)([]);
|
|
15270
|
+
const [reading, setReading] = (0, import_react87.useState)(false);
|
|
15271
|
+
const [feedback, setFeedback] = (0, import_react87.useState)("");
|
|
15211
15272
|
const isMounted = useIsMounted();
|
|
15212
|
-
const generation = (0,
|
|
15273
|
+
const generation = (0, import_react87.useRef)(0);
|
|
15213
15274
|
const types = accept?.map((token) => token.trim().toLowerCase()) ?? [];
|
|
15214
15275
|
const configurationError = accept?.some((token) => !validAccept(token.trim())) ? "Invalid accept configuration. Use file extensions or MIME types." : maxFiles !== void 0 && (!Number.isSafeInteger(maxFiles) || maxFiles < 1) ? "Invalid maxFiles configuration. Supply a positive integer." : maxFileSizeBytes !== void 0 && (!Number.isSafeInteger(maxFileSizeBytes) || maxFileSizeBytes < 0) ? "Invalid maxFileSizeBytes configuration. Supply a nonnegative integer." : "";
|
|
15215
15276
|
const signature = JSON.stringify([types, multiple, String(maxFiles), String(maxFileSizeBytes)]);
|
|
15216
|
-
const latest = (0,
|
|
15277
|
+
const latest = (0, import_react87.useRef)({ disabled, configurationError, signature, onFiles, onReject });
|
|
15217
15278
|
latest.current = { disabled, configurationError, signature, onFiles, onReject };
|
|
15218
|
-
(0,
|
|
15279
|
+
(0, import_react87.useEffect)(() => {
|
|
15219
15280
|
const requests = generation;
|
|
15220
15281
|
return () => {
|
|
15221
15282
|
requests.current++;
|
|
15222
15283
|
};
|
|
15223
15284
|
}, []);
|
|
15224
|
-
(0,
|
|
15285
|
+
(0, import_react87.useEffect)(() => {
|
|
15225
15286
|
generation.current++;
|
|
15226
15287
|
setReading(false);
|
|
15227
15288
|
}, [signature, disabled]);
|
|
@@ -15418,7 +15479,7 @@ var FileUploadManifest = {
|
|
|
15418
15479
|
};
|
|
15419
15480
|
|
|
15420
15481
|
// src/UploadQueue/UploadQueue.tsx
|
|
15421
|
-
var
|
|
15482
|
+
var import_react88 = require("react");
|
|
15422
15483
|
var import_class_variance_authority50 = require("class-variance-authority");
|
|
15423
15484
|
var import_clsx66 = __toESM(require("clsx"), 1);
|
|
15424
15485
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
@@ -15500,7 +15561,7 @@ function describeChanges(before, after) {
|
|
|
15500
15561
|
if (after.length === 0 && before.length > 0) parts.push("No files selected.");
|
|
15501
15562
|
return parts.join(" ");
|
|
15502
15563
|
}
|
|
15503
|
-
var UploadQueue = (0,
|
|
15564
|
+
var UploadQueue = (0, import_react88.forwardRef)(
|
|
15504
15565
|
({
|
|
15505
15566
|
label,
|
|
15506
15567
|
items,
|
|
@@ -15514,13 +15575,13 @@ var UploadQueue = (0, import_react87.forwardRef)(
|
|
|
15514
15575
|
"aria-labelledby": labelledBy,
|
|
15515
15576
|
...props
|
|
15516
15577
|
}, ref) => {
|
|
15517
|
-
const root = (0,
|
|
15578
|
+
const root = (0, import_react88.useRef)(null);
|
|
15518
15579
|
const ids = usePartIds(["label"], {
|
|
15519
15580
|
id: props.id,
|
|
15520
15581
|
readRendered: () => root.current?.getAttribute("data-oprt-ids")
|
|
15521
15582
|
});
|
|
15522
|
-
const rows = (0,
|
|
15523
|
-
(0,
|
|
15583
|
+
const rows = (0, import_react88.useRef)(/* @__PURE__ */ new Map());
|
|
15584
|
+
(0, import_react88.useImperativeHandle)(ref, () => root.current, []);
|
|
15524
15585
|
const invalidIdentity = hasInvalidIdentity(items);
|
|
15525
15586
|
const restoreFocus = useRestoreFocusOnRemoval(root, {
|
|
15526
15587
|
track: (element) => {
|
|
@@ -15535,17 +15596,17 @@ var UploadQueue = (0, import_react87.forwardRef)(
|
|
|
15535
15596
|
}
|
|
15536
15597
|
});
|
|
15537
15598
|
const signature = JSON.stringify(rowsOf(items));
|
|
15538
|
-
const announced = (0,
|
|
15539
|
-
const [announcement, setAnnouncement] = (0,
|
|
15540
|
-
const lastAnnouncement = (0,
|
|
15541
|
-
const repeatFrame = (0,
|
|
15542
|
-
(0,
|
|
15599
|
+
const announced = (0, import_react88.useRef)(null);
|
|
15600
|
+
const [announcement, setAnnouncement] = (0, import_react88.useState)("");
|
|
15601
|
+
const lastAnnouncement = (0, import_react88.useRef)("");
|
|
15602
|
+
const repeatFrame = (0, import_react88.useRef)(null);
|
|
15603
|
+
(0, import_react88.useEffect)(
|
|
15543
15604
|
() => () => {
|
|
15544
15605
|
if (repeatFrame.current !== null) cancelAnimationFrame(repeatFrame.current);
|
|
15545
15606
|
},
|
|
15546
15607
|
[]
|
|
15547
15608
|
);
|
|
15548
|
-
(0,
|
|
15609
|
+
(0, import_react88.useEffect)(() => {
|
|
15549
15610
|
const after = JSON.parse(signature);
|
|
15550
15611
|
const before = announced.current;
|
|
15551
15612
|
announced.current = after;
|
|
@@ -15569,7 +15630,7 @@ var UploadQueue = (0, import_react87.forwardRef)(
|
|
|
15569
15630
|
}, [signature]);
|
|
15570
15631
|
const unknownStates = items.filter((item) => !isKnownState(item.state)).map((item) => item.state);
|
|
15571
15632
|
const unknownKey = JSON.stringify(unknownStates);
|
|
15572
|
-
(0,
|
|
15633
|
+
(0, import_react88.useEffect)(() => {
|
|
15573
15634
|
if (process.env.NODE_ENV === "production") return;
|
|
15574
15635
|
for (const state of JSON.parse(unknownKey)) reportUnknownState(state);
|
|
15575
15636
|
}, [unknownKey]);
|
|
@@ -15730,7 +15791,7 @@ var UploadQueueManifest = {
|
|
|
15730
15791
|
};
|
|
15731
15792
|
|
|
15732
15793
|
// src/AttachmentPreview/AttachmentPreview.tsx
|
|
15733
|
-
var
|
|
15794
|
+
var import_react89 = require("react");
|
|
15734
15795
|
var import_class_variance_authority51 = require("class-variance-authority");
|
|
15735
15796
|
var import_clsx67 = __toESM(require("clsx"), 1);
|
|
15736
15797
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
@@ -15753,7 +15814,7 @@ function safeImageSource(src) {
|
|
|
15753
15814
|
return false;
|
|
15754
15815
|
}
|
|
15755
15816
|
}
|
|
15756
|
-
var AttachmentPreview = (0,
|
|
15817
|
+
var AttachmentPreview = (0, import_react89.forwardRef)(
|
|
15757
15818
|
({
|
|
15758
15819
|
label,
|
|
15759
15820
|
attachment,
|
|
@@ -15765,14 +15826,14 @@ var AttachmentPreview = (0, import_react88.forwardRef)(
|
|
|
15765
15826
|
"aria-labelledby": labelledBy,
|
|
15766
15827
|
...props
|
|
15767
15828
|
}, ref) => {
|
|
15768
|
-
const root = (0,
|
|
15829
|
+
const root = (0, import_react89.useRef)(null);
|
|
15769
15830
|
const mergedRef = useMergedRefs(root, ref);
|
|
15770
15831
|
const ids = usePartIds(["label"], {
|
|
15771
15832
|
id: props.id,
|
|
15772
15833
|
readRendered: () => root.current?.getAttribute("data-oprt-ids")
|
|
15773
15834
|
});
|
|
15774
15835
|
const imageKey = `${attachment.id}\0${preview.kind === "image" ? preview.src : ""}`;
|
|
15775
|
-
const [imageState, setImageState] = (0,
|
|
15836
|
+
const [imageState, setImageState] = (0, import_react89.useState)({ key: imageKey, failed: false });
|
|
15776
15837
|
if (imageState.key !== imageKey) setImageState({ key: imageKey, failed: false });
|
|
15777
15838
|
const imageError = preview.kind === "image" ? !safeImageSource(preview.src) ? "Image preview source is not supported." : imageState.key === imageKey && imageState.failed ? "Image preview could not be loaded." : null : null;
|
|
15778
15839
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
@@ -15910,7 +15971,7 @@ var AttachmentPreviewManifest = {
|
|
|
15910
15971
|
};
|
|
15911
15972
|
|
|
15912
15973
|
// src/JobStatus/JobStatus.tsx
|
|
15913
|
-
var
|
|
15974
|
+
var import_react90 = require("react");
|
|
15914
15975
|
var import_class_variance_authority52 = require("class-variance-authority");
|
|
15915
15976
|
var import_clsx68 = __toESM(require("clsx"), 1);
|
|
15916
15977
|
|
|
@@ -15970,7 +16031,7 @@ var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
|
15970
16031
|
var jobStyles = (0, import_class_variance_authority52.cva)(
|
|
15971
16032
|
"flex min-w-0 flex-col gap-2u border border-oprt-border p-2u font-sans text-oprt-base normal-case text-oprt-text outline-hidden focus-visible:shadow-oprt-focus"
|
|
15972
16033
|
);
|
|
15973
|
-
var JobStatus = (0,
|
|
16034
|
+
var JobStatus = (0, import_react90.forwardRef)((allProps, ref) => {
|
|
15974
16035
|
const {
|
|
15975
16036
|
jobId,
|
|
15976
16037
|
label,
|
|
@@ -15996,8 +16057,8 @@ var JobStatus = (0, import_react89.forwardRef)((allProps, ref) => {
|
|
|
15996
16057
|
const canRetry = !!onRetryRequest && ["failed", "partial", "canceled"].includes(state);
|
|
15997
16058
|
const blocked = disabled || requestPending !== null;
|
|
15998
16059
|
const pendingText = requestPending ? `${requestPending === "cancel" ? "Cancellation" : "Retry"} request pending. Awaiting an application update.` : "";
|
|
15999
|
-
const [spokenText, setSpokenText] = (0,
|
|
16000
|
-
(0,
|
|
16060
|
+
const [spokenText, setSpokenText] = (0, import_react90.useState)(pendingText);
|
|
16061
|
+
(0, import_react90.useEffect)(() => {
|
|
16001
16062
|
let second = 0;
|
|
16002
16063
|
const first = requestAnimationFrame(() => {
|
|
16003
16064
|
second = requestAnimationFrame(() => setSpokenText(pendingText));
|
|
@@ -16071,7 +16132,7 @@ var JobStatus = (0, import_react89.forwardRef)((allProps, ref) => {
|
|
|
16071
16132
|
JobStatus.displayName = "JobStatus";
|
|
16072
16133
|
|
|
16073
16134
|
// src/BulkActionBar/BulkActionBar.tsx
|
|
16074
|
-
var
|
|
16135
|
+
var import_react91 = require("react");
|
|
16075
16136
|
var import_class_variance_authority53 = require("class-variance-authority");
|
|
16076
16137
|
var import_clsx69 = __toESM(require("clsx"), 1);
|
|
16077
16138
|
|
|
@@ -16118,7 +16179,7 @@ var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
|
16118
16179
|
var barStyles2 = (0, import_class_variance_authority53.cva)(
|
|
16119
16180
|
"flex min-w-0 flex-col gap-2u border border-oprt-border bg-oprt-surface-1 p-2u font-sans text-oprt-base text-oprt-text outline-hidden focus-visible:shadow-oprt-focus"
|
|
16120
16181
|
);
|
|
16121
|
-
var BulkActionBar = (0,
|
|
16182
|
+
var BulkActionBar = (0, import_react91.forwardRef)(
|
|
16122
16183
|
({
|
|
16123
16184
|
label,
|
|
16124
16185
|
selection,
|
|
@@ -16130,7 +16191,7 @@ var BulkActionBar = (0, import_react90.forwardRef)(
|
|
|
16130
16191
|
headingLevel = 3,
|
|
16131
16192
|
className
|
|
16132
16193
|
}, ref) => {
|
|
16133
|
-
const id = (0,
|
|
16194
|
+
const id = (0, import_react91.useId)();
|
|
16134
16195
|
const focus = useActionFocus(ref);
|
|
16135
16196
|
const Heading5 = `h${headingLevel}`;
|
|
16136
16197
|
const invalidSelection = selectionError(selection);
|
|
@@ -16291,7 +16352,7 @@ var BulkActionBarManifest = {
|
|
|
16291
16352
|
};
|
|
16292
16353
|
|
|
16293
16354
|
// src/BulkResults/BulkResults.tsx
|
|
16294
|
-
var
|
|
16355
|
+
var import_react92 = require("react");
|
|
16295
16356
|
var import_class_variance_authority54 = require("class-variance-authority");
|
|
16296
16357
|
var import_clsx70 = __toESM(require("clsx"), 1);
|
|
16297
16358
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
@@ -16314,7 +16375,7 @@ var COLUMNS = [
|
|
|
16314
16375
|
{ heading: "Details", width: "min-w-16u" },
|
|
16315
16376
|
{ heading: "Actions", width: "" }
|
|
16316
16377
|
];
|
|
16317
|
-
var BulkResults = (0,
|
|
16378
|
+
var BulkResults = (0, import_react92.forwardRef)(
|
|
16318
16379
|
({
|
|
16319
16380
|
label,
|
|
16320
16381
|
selection,
|
|
@@ -16327,10 +16388,10 @@ var BulkResults = (0, import_react91.forwardRef)(
|
|
|
16327
16388
|
className
|
|
16328
16389
|
}, ref) => {
|
|
16329
16390
|
const Heading5 = `h${headingLevel}`;
|
|
16330
|
-
const root = (0,
|
|
16331
|
-
(0,
|
|
16391
|
+
const root = (0, import_react92.useRef)(null);
|
|
16392
|
+
(0, import_react92.useImperativeHandle)(ref, () => root.current, []);
|
|
16332
16393
|
const [box, scrolls] = useScrollsSideways();
|
|
16333
|
-
const rows = (0,
|
|
16394
|
+
const rows = (0, import_react92.useRef)(/* @__PURE__ */ new Map());
|
|
16334
16395
|
const invalidSelection = selectionError(selection);
|
|
16335
16396
|
const selected = new Set(invalidSelection ? [] : selection.ids);
|
|
16336
16397
|
const invalidResults = idsError(items.map((item) => item.id)) || (items.some((item) => !selected.has(item.id)) ? "A result ID is outside the selection snapshot." : null) || (items.some(
|
|
@@ -16338,13 +16399,13 @@ var BulkResults = (0, import_react91.forwardRef)(
|
|
|
16338
16399
|
) ? "Every result needs a valid state, label, and message." : null);
|
|
16339
16400
|
const invalidRetries = idsError(pendingRetryIds) || (pendingRetryIds.some((item) => !selected.has(item)) ? "A pending retry ID is outside the selection snapshot." : null);
|
|
16340
16401
|
const resultMap = new Map((invalidResults ? [] : items).map((item) => [item.id, item]));
|
|
16341
|
-
const pending = (0,
|
|
16402
|
+
const pending = (0, import_react92.useMemo)(() => new Set(pendingRetryIds), [pendingRetryIds]);
|
|
16342
16403
|
const missing = invalidSelection ? 0 : selection.ids.filter((item) => !resultMap.has(item)).length;
|
|
16343
16404
|
const succeeded = invalidResults ? 0 : items.filter((item) => item.state === "succeeded").length;
|
|
16344
16405
|
const ids = invalidSelection ? NO_IDS : selection.ids;
|
|
16345
16406
|
const size = Number.isFinite(pageSize) && pageSize >= 1 ? Math.floor(pageSize) : DEFAULT_PAGE_SIZE;
|
|
16346
16407
|
const pageCount = Math.max(1, Math.ceil(ids.length / size));
|
|
16347
|
-
const [paging, setPaging] = (0,
|
|
16408
|
+
const [paging, setPaging] = (0, import_react92.useState)({ snapshot: selection.id, page: 1 });
|
|
16348
16409
|
const requestedPage = paging.snapshot === selection.id ? paging.page : 1;
|
|
16349
16410
|
const page = Math.min(pageCount, Math.max(1, requestedPage));
|
|
16350
16411
|
const pageIds = ids.length > size ? ids.slice((page - 1) * size, page * size) : ids;
|
|
@@ -16362,14 +16423,14 @@ var BulkResults = (0, import_react91.forwardRef)(
|
|
|
16362
16423
|
return next?.querySelector("button:not(:disabled)") ?? next?.querySelector("th") ?? root.current;
|
|
16363
16424
|
}
|
|
16364
16425
|
});
|
|
16365
|
-
const [spoken, setSpoken] = (0,
|
|
16366
|
-
const announced = (0,
|
|
16367
|
-
const latest = (0,
|
|
16426
|
+
const [spoken, setSpoken] = (0, import_react92.useState)("");
|
|
16427
|
+
const announced = (0, import_react92.useRef)(new Set(invalidRetries ? [] : pendingRetryIds));
|
|
16428
|
+
const latest = (0, import_react92.useRef)({ results: resultMap, pending: pendingRetryIds });
|
|
16368
16429
|
useIsomorphicLayoutEffect(() => {
|
|
16369
16430
|
latest.current = { results: resultMap, pending: pendingRetryIds };
|
|
16370
16431
|
});
|
|
16371
16432
|
const pendingKey = JSON.stringify(pendingRetryIds);
|
|
16372
|
-
(0,
|
|
16433
|
+
(0, import_react92.useEffect)(() => {
|
|
16373
16434
|
const current = invalidRetries ? [] : latest.current.pending;
|
|
16374
16435
|
for (const itemId of [...announced.current])
|
|
16375
16436
|
if (!current.includes(itemId)) announced.current.delete(itemId);
|
|
@@ -16591,7 +16652,7 @@ var BulkResultsManifest = {
|
|
|
16591
16652
|
};
|
|
16592
16653
|
|
|
16593
16654
|
// src/MapControls/MapControls.tsx
|
|
16594
|
-
var
|
|
16655
|
+
var import_react93 = require("react");
|
|
16595
16656
|
var import_react_aria7 = require("react-aria");
|
|
16596
16657
|
var import_class_variance_authority55 = require("class-variance-authority");
|
|
16597
16658
|
var import_clsx71 = __toESM(require("clsx"), 1);
|
|
@@ -16611,7 +16672,7 @@ var actions = [
|
|
|
16611
16672
|
{ id: "reset-north", label: "Reset north" },
|
|
16612
16673
|
{ id: "fit", label: "Fit map" }
|
|
16613
16674
|
];
|
|
16614
|
-
var MapControls = (0,
|
|
16675
|
+
var MapControls = (0, import_react93.forwardRef)(
|
|
16615
16676
|
({
|
|
16616
16677
|
label = "Map controls",
|
|
16617
16678
|
zoom = null,
|
|
@@ -16627,15 +16688,15 @@ var MapControls = (0, import_react92.forwardRef)(
|
|
|
16627
16688
|
onBlurCapture,
|
|
16628
16689
|
...props
|
|
16629
16690
|
}, ref) => {
|
|
16630
|
-
const root = (0,
|
|
16631
|
-
(0,
|
|
16632
|
-
const labelRef = (0,
|
|
16691
|
+
const root = (0, import_react93.useRef)(null);
|
|
16692
|
+
(0, import_react93.useImperativeHandle)(ref, () => root.current, []);
|
|
16693
|
+
const labelRef = (0, import_react93.useRef)(null);
|
|
16633
16694
|
const ids = usePartIds(["label"], {
|
|
16634
16695
|
id,
|
|
16635
16696
|
readRendered: () => labelRef.current?.id.replace(/-label$/, "")
|
|
16636
16697
|
});
|
|
16637
16698
|
const readout = (0, import_react_aria7.useNumberFormatter)(READOUT);
|
|
16638
|
-
const buttons = (0,
|
|
16699
|
+
const buttons = (0, import_react93.useRef)(/* @__PURE__ */ new Map());
|
|
16639
16700
|
const limitsValid = Number.isFinite(minZoom) && Number.isFinite(maxZoom) && minZoom <= maxZoom;
|
|
16640
16701
|
const validZoom = typeof zoom === "number" && Number.isFinite(zoom) && limitsValid && zoom >= minZoom && zoom <= maxZoom;
|
|
16641
16702
|
const validBearing = typeof bearing === "number" && Number.isFinite(bearing) && bearing >= 0 && bearing < 360;
|
|
@@ -16735,7 +16796,7 @@ var MapControlsManifest = {
|
|
|
16735
16796
|
};
|
|
16736
16797
|
|
|
16737
16798
|
// src/LayerControl/LayerControl.tsx
|
|
16738
|
-
var
|
|
16799
|
+
var import_react94 = require("react");
|
|
16739
16800
|
var import_class_variance_authority56 = require("class-variance-authority");
|
|
16740
16801
|
var import_clsx72 = __toESM(require("clsx"), 1);
|
|
16741
16802
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
@@ -16745,7 +16806,7 @@ var controlStyles3 = (0, import_class_variance_authority56.cva)(
|
|
|
16745
16806
|
var rowStyles = (0, import_class_variance_authority56.cva)(
|
|
16746
16807
|
"flex min-w-0 flex-col gap-2u border border-oprt-border p-2u outline-hidden focus-visible:shadow-oprt-focus"
|
|
16747
16808
|
);
|
|
16748
|
-
var LayerControl = (0,
|
|
16809
|
+
var LayerControl = (0, import_react94.forwardRef)(
|
|
16749
16810
|
({
|
|
16750
16811
|
label = "Map layers",
|
|
16751
16812
|
layers,
|
|
@@ -16758,14 +16819,14 @@ var LayerControl = (0, import_react93.forwardRef)(
|
|
|
16758
16819
|
"aria-labelledby": labelledBy,
|
|
16759
16820
|
...props
|
|
16760
16821
|
}, ref) => {
|
|
16761
|
-
const root = (0,
|
|
16762
|
-
const labelRef = (0,
|
|
16822
|
+
const root = (0, import_react94.useRef)(null);
|
|
16823
|
+
const labelRef = (0, import_react94.useRef)(null);
|
|
16763
16824
|
const ids = usePartIds(["label"], {
|
|
16764
16825
|
id,
|
|
16765
16826
|
readRendered: () => labelRef.current?.id.replace(/-label$/, "")
|
|
16766
16827
|
});
|
|
16767
|
-
const rows = (0,
|
|
16768
|
-
(0,
|
|
16828
|
+
const rows = (0, import_react94.useRef)(/* @__PURE__ */ new Map());
|
|
16829
|
+
(0, import_react94.useImperativeHandle)(ref, () => root.current, []);
|
|
16769
16830
|
const invalidIds = layers.some(
|
|
16770
16831
|
(item, index) => !item.id.trim() || layers.findIndex((other) => other.id === item.id) !== index
|
|
16771
16832
|
);
|
|
@@ -16956,7 +17017,7 @@ var LayerControlManifest = {
|
|
|
16956
17017
|
};
|
|
16957
17018
|
|
|
16958
17019
|
// src/MapLegend/MapLegend.tsx
|
|
16959
|
-
var
|
|
17020
|
+
var import_react95 = require("react");
|
|
16960
17021
|
var import_class_variance_authority57 = require("class-variance-authority");
|
|
16961
17022
|
var import_clsx73 = __toESM(require("clsx"), 1);
|
|
16962
17023
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
@@ -16981,9 +17042,9 @@ var symbolStyles = (0, import_class_variance_authority57.cva)("block shrink-0 fo
|
|
|
16981
17042
|
defaultVariants: { variant: "neutral", pattern: "solid" }
|
|
16982
17043
|
});
|
|
16983
17044
|
var kinds = { point: "Point", line: "Line", area: "Area" };
|
|
16984
|
-
var MapLegend = (0,
|
|
17045
|
+
var MapLegend = (0, import_react95.forwardRef)(
|
|
16985
17046
|
({ label = "Map legend", items, className, id, "aria-labelledby": labelledBy, ...props }, ref) => {
|
|
16986
|
-
const labelRef = (0,
|
|
17047
|
+
const labelRef = (0, import_react95.useRef)(null);
|
|
16987
17048
|
const ids = usePartIds(["label"], {
|
|
16988
17049
|
id,
|
|
16989
17050
|
readRendered: () => labelRef.current?.id.replace(/-label$/, "")
|
|
@@ -17067,7 +17128,7 @@ var MapLegendManifest = {
|
|
|
17067
17128
|
};
|
|
17068
17129
|
|
|
17069
17130
|
// src/MapScale/MapScale.tsx
|
|
17070
|
-
var
|
|
17131
|
+
var import_react96 = require("react");
|
|
17071
17132
|
var import_react_aria8 = require("react-aria");
|
|
17072
17133
|
var import_class_variance_authority58 = require("class-variance-authority");
|
|
17073
17134
|
var import_clsx74 = __toESM(require("clsx"), 1);
|
|
@@ -17118,7 +17179,7 @@ function scale2(metersPerPixel, width, units) {
|
|
|
17118
17179
|
if (!Number.isFinite(pixels) || pixels <= 0 || pixels > width) return null;
|
|
17119
17180
|
return { pixels, distance, unit };
|
|
17120
17181
|
}
|
|
17121
|
-
var MapScale = (0,
|
|
17182
|
+
var MapScale = (0, import_react96.forwardRef)((allProps, ref) => {
|
|
17122
17183
|
const {
|
|
17123
17184
|
label = "Map scale",
|
|
17124
17185
|
metersPerPixel = null,
|
|
@@ -17132,13 +17193,13 @@ var MapScale = (0, import_react95.forwardRef)((allProps, ref) => {
|
|
|
17132
17193
|
if (process.env.NODE_ENV !== "production") {
|
|
17133
17194
|
devValidate("MapScale", MapScaleManifest.MapScale.props, { ...allProps });
|
|
17134
17195
|
}
|
|
17135
|
-
const labelRef = (0,
|
|
17196
|
+
const labelRef = (0, import_react96.useRef)(null);
|
|
17136
17197
|
const ids = usePartIds(["label"], {
|
|
17137
17198
|
id,
|
|
17138
17199
|
readRendered: () => labelRef.current?.id.replace(/-label$/, "")
|
|
17139
17200
|
});
|
|
17140
17201
|
const format = (0, import_react_aria8.useNumberFormatter)(DISTANCE);
|
|
17141
|
-
const available = (0,
|
|
17202
|
+
const available = (0, import_react96.useRef)(null);
|
|
17142
17203
|
const measuredWidth = useElementWidth(available, {
|
|
17143
17204
|
initial: null
|
|
17144
17205
|
});
|
|
@@ -17185,7 +17246,7 @@ var MapScale = (0, import_react95.forwardRef)((allProps, ref) => {
|
|
|
17185
17246
|
MapScale.displayName = "MapScale";
|
|
17186
17247
|
|
|
17187
17248
|
// src/MediaFrame/MediaFrame.tsx
|
|
17188
|
-
var
|
|
17249
|
+
var import_react97 = require("react");
|
|
17189
17250
|
var import_react_aria9 = require("react-aria");
|
|
17190
17251
|
var import_class_variance_authority59 = require("class-variance-authority");
|
|
17191
17252
|
var import_clsx75 = __toESM(require("clsx"), 1);
|
|
@@ -17251,7 +17312,7 @@ var EXACT_NUMBER2 = { maximumSignificantDigits: 21 };
|
|
|
17251
17312
|
var frameStyles = (0, import_class_variance_authority59.cva)(
|
|
17252
17313
|
"flex min-w-0 flex-col border border-oprt-border bg-oprt-surface-1 font-sans text-oprt-base normal-case text-oprt-text"
|
|
17253
17314
|
);
|
|
17254
|
-
var MediaFrame = (0,
|
|
17315
|
+
var MediaFrame = (0, import_react97.forwardRef)((allProps, ref) => {
|
|
17255
17316
|
const {
|
|
17256
17317
|
label,
|
|
17257
17318
|
state,
|
|
@@ -17271,7 +17332,7 @@ var MediaFrame = (0, import_react96.forwardRef)((allProps, ref) => {
|
|
|
17271
17332
|
if (process.env.NODE_ENV !== "production") {
|
|
17272
17333
|
devValidate("MediaFrame", MediaFrameManifest.MediaFrame.props, { ...allProps });
|
|
17273
17334
|
}
|
|
17274
|
-
const labelRef = (0,
|
|
17335
|
+
const labelRef = (0, import_react97.useRef)(null);
|
|
17275
17336
|
const ids = usePartIds(["label"], {
|
|
17276
17337
|
id,
|
|
17277
17338
|
readRendered: () => labelRef.current?.id.replace(/-label$/, "")
|
|
@@ -17347,7 +17408,7 @@ MediaFrame.displayName = "MediaFrame";
|
|
|
17347
17408
|
// src/PlaybackControls/PlaybackControls.tsx
|
|
17348
17409
|
var import_class_variance_authority60 = require("class-variance-authority");
|
|
17349
17410
|
var import_clsx76 = __toESM(require("clsx"), 1);
|
|
17350
|
-
var
|
|
17411
|
+
var import_react98 = require("react");
|
|
17351
17412
|
var import_react_aria_components27 = require("react-aria-components");
|
|
17352
17413
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
17353
17414
|
var rootStyles8 = (0, import_class_variance_authority60.cva)(
|
|
@@ -17402,7 +17463,7 @@ function arrowDirection(key, rightToLeft) {
|
|
|
17402
17463
|
if (key === "ArrowLeft" || key === "Left") return rightToLeft ? 1 : -1;
|
|
17403
17464
|
return 0;
|
|
17404
17465
|
}
|
|
17405
|
-
var PlaybackControls = (0,
|
|
17466
|
+
var PlaybackControls = (0, import_react98.forwardRef)(
|
|
17406
17467
|
({
|
|
17407
17468
|
start,
|
|
17408
17469
|
end,
|
|
@@ -17426,12 +17487,12 @@ var PlaybackControls = (0, import_react97.forwardRef)(
|
|
|
17426
17487
|
onBlurCapture,
|
|
17427
17488
|
...props
|
|
17428
17489
|
}, ref) => {
|
|
17429
|
-
const descriptionId = (0,
|
|
17430
|
-
const root = (0,
|
|
17431
|
-
(0,
|
|
17432
|
-
const previousRef = (0,
|
|
17433
|
-
const playRef = (0,
|
|
17434
|
-
const nextRef = (0,
|
|
17490
|
+
const descriptionId = (0, import_react98.useId)();
|
|
17491
|
+
const root = (0, import_react98.useRef)(null);
|
|
17492
|
+
(0, import_react98.useImperativeHandle)(ref, () => root.current, []);
|
|
17493
|
+
const previousRef = (0, import_react98.useRef)(null);
|
|
17494
|
+
const playRef = (0, import_react98.useRef)(null);
|
|
17495
|
+
const nextRef = (0, import_react98.useRef)(null);
|
|
17435
17496
|
const { direction } = (0, import_react_aria_components27.useLocale)();
|
|
17436
17497
|
const validBounds = validTime(start) && validTime(end);
|
|
17437
17498
|
const validRange = validBounds && start < end;
|
|
@@ -17443,7 +17504,7 @@ var PlaybackControls = (0, import_react97.forwardRef)(
|
|
|
17443
17504
|
const sliderEnd = validRange ? end : 1;
|
|
17444
17505
|
const displayValue = validRange && validCursor ? Math.min(end, Math.max(start, value)) : sliderStart;
|
|
17445
17506
|
const positionText = validRange && validCursor ? formatTime(displayValue) : validBounds && start === end ? formatTime(start) : "Unknown playback position";
|
|
17446
|
-
const events = (0,
|
|
17507
|
+
const events = (0, import_react98.useMemo)(
|
|
17447
17508
|
() => [
|
|
17448
17509
|
...new Set(
|
|
17449
17510
|
(eventTimes ?? []).filter((time) => validTime(time) && time >= start && time <= end)
|
|
@@ -17701,7 +17762,7 @@ var PlaybackControlsManifest = {
|
|
|
17701
17762
|
};
|
|
17702
17763
|
|
|
17703
17764
|
// package.json
|
|
17704
|
-
var version3 = "0.
|
|
17765
|
+
var version3 = "0.4.0";
|
|
17705
17766
|
|
|
17706
17767
|
// src/version.ts
|
|
17707
17768
|
var VERSION = version3;
|