@oomol-lab/open-flow 0.1.0-beta.57 → 0.1.0-beta.59
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/browser/event-sources.d.ts +1 -0
- package/dist/browser/{flowChanges-fBiAeTzR.js → flowChanges-DL0Njlg6.js} +129 -122
- package/dist/browser/{flowWorkspace-MqcEfg7T.js → flowWorkspace-Cp5CcEGu.js} +3 -2
- package/dist/browser/preview.css +91 -0
- package/dist/browser/preview.js +121 -120
- package/dist/browser/ui.css +91 -0
- package/dist/browser/ui.d.ts +17 -0
- package/dist/browser/ui.js +1412 -9
- package/dist/browser/workbench.css +91 -0
- package/dist/browser/workbench.js +2 -2
- package/dist/common/control-requests.js +1 -1
- package/dist/common/event-source-definition.d.ts +39 -0
- package/dist/common/event-source-feishu.d.ts +3 -0
- package/dist/common/event-source.d.ts +6 -0
- package/dist/common/event-source.js +289 -0
- package/dist/common/feishu-events.d.ts +1 -1
- package/dist/common/flow-semantics.js +4 -4
- package/package.json +5 -1
package/dist/browser/ui.js
CHANGED
|
@@ -641,7 +641,7 @@ function warn(...messages) {
|
|
|
641
641
|
//#endregion
|
|
642
642
|
//#region ../../node_modules/.bun/@base-ui+utils@0.2.8+b87d06724be9db7a/node_modules/@base-ui/utils/esm/empty.js
|
|
643
643
|
function NOOP() {}
|
|
644
|
-
Object.freeze([]);
|
|
644
|
+
var EMPTY_ARRAY$1 = Object.freeze([]);
|
|
645
645
|
var EMPTY_OBJECT = Object.freeze({});
|
|
646
646
|
//#endregion
|
|
647
647
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/internals/getStateAttributesProps.js
|
|
@@ -4390,7 +4390,7 @@ var popupStateMapping = {
|
|
|
4390
4390
|
};
|
|
4391
4391
|
//#endregion
|
|
4392
4392
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/dialog/backdrop/DialogBackdrop.js
|
|
4393
|
-
var stateAttributesMapping$
|
|
4393
|
+
var stateAttributesMapping$3 = {
|
|
4394
4394
|
...popupStateMapping,
|
|
4395
4395
|
...transitionStatusMapping
|
|
4396
4396
|
};
|
|
@@ -4412,7 +4412,7 @@ var DialogBackdrop = /*#__PURE__*/ React.forwardRef(function DialogBackdrop(comp
|
|
|
4412
4412
|
transitionStatus: store.useState("transitionStatus")
|
|
4413
4413
|
},
|
|
4414
4414
|
ref: [store.context.backdropRef, forwardedRef],
|
|
4415
|
-
stateAttributesMapping: stateAttributesMapping$
|
|
4415
|
+
stateAttributesMapping: stateAttributesMapping$3,
|
|
4416
4416
|
props: [{
|
|
4417
4417
|
role: "presentation",
|
|
4418
4418
|
hidden: !mounted,
|
|
@@ -5179,6 +5179,250 @@ function rectToClientRect(rect) {
|
|
|
5179
5179
|
}
|
|
5180
5180
|
//#endregion
|
|
5181
5181
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/floating-ui-react/utils/composite.js
|
|
5182
|
+
function isDifferentGridRow(index, cols, prevRow) {
|
|
5183
|
+
return Math.floor(index / cols) !== prevRow;
|
|
5184
|
+
}
|
|
5185
|
+
function isIndexOutOfListBounds(list, index) {
|
|
5186
|
+
return index < 0 || index >= list.length;
|
|
5187
|
+
}
|
|
5188
|
+
function getMinListIndex(listRef, disabledIndices) {
|
|
5189
|
+
return findNonDisabledListIndex(listRef.current, { disabledIndices });
|
|
5190
|
+
}
|
|
5191
|
+
function getMaxListIndex(listRef, disabledIndices) {
|
|
5192
|
+
return findNonDisabledListIndex(listRef.current, {
|
|
5193
|
+
decrement: true,
|
|
5194
|
+
startingIndex: listRef.current.length,
|
|
5195
|
+
disabledIndices
|
|
5196
|
+
});
|
|
5197
|
+
}
|
|
5198
|
+
function findNonDisabledListIndex(list, { startingIndex = -1, decrement = false, disabledIndices, amount = 1 } = {}) {
|
|
5199
|
+
let index = startingIndex;
|
|
5200
|
+
do
|
|
5201
|
+
index += decrement ? -amount : amount;
|
|
5202
|
+
while (index >= 0 && index <= list.length - 1 && isListIndexDisabled(list, index, disabledIndices));
|
|
5203
|
+
return index;
|
|
5204
|
+
}
|
|
5205
|
+
function getGridNavigatedIndex(list, { event, orientation, loopFocus, onLoop, rtl, cols, disabledIndices, minIndex, maxIndex, prevIndex, stopEvent: stop = false }) {
|
|
5206
|
+
let nextIndex = prevIndex;
|
|
5207
|
+
let verticalDirection;
|
|
5208
|
+
if (event.key === "ArrowUp") verticalDirection = "up";
|
|
5209
|
+
else if (event.key === "ArrowDown") verticalDirection = "down";
|
|
5210
|
+
if (verticalDirection) {
|
|
5211
|
+
const rows = [];
|
|
5212
|
+
const rowIndexMap = [];
|
|
5213
|
+
let hasRoleRow = false;
|
|
5214
|
+
let visibleItemCount = 0;
|
|
5215
|
+
{
|
|
5216
|
+
let currentRowEl = null;
|
|
5217
|
+
let currentRowIndex = -1;
|
|
5218
|
+
list.forEach((el, idx) => {
|
|
5219
|
+
if (el == null) return;
|
|
5220
|
+
visibleItemCount += 1;
|
|
5221
|
+
const rowEl = el.closest("[role=\"row\"]");
|
|
5222
|
+
if (rowEl) hasRoleRow = true;
|
|
5223
|
+
if (rowEl !== currentRowEl || currentRowIndex === -1) {
|
|
5224
|
+
currentRowEl = rowEl;
|
|
5225
|
+
currentRowIndex += 1;
|
|
5226
|
+
rows[currentRowIndex] = [];
|
|
5227
|
+
}
|
|
5228
|
+
rows[currentRowIndex].push(idx);
|
|
5229
|
+
rowIndexMap[idx] = currentRowIndex;
|
|
5230
|
+
});
|
|
5231
|
+
}
|
|
5232
|
+
let hasDomRows = false;
|
|
5233
|
+
let inferredDomCols = 0;
|
|
5234
|
+
if (hasRoleRow) for (const row of rows) {
|
|
5235
|
+
const rowLength = row.length;
|
|
5236
|
+
if (rowLength > inferredDomCols) inferredDomCols = rowLength;
|
|
5237
|
+
if (rowLength !== cols) hasDomRows = true;
|
|
5238
|
+
}
|
|
5239
|
+
const hasVirtualizedGaps = hasDomRows && visibleItemCount < list.length;
|
|
5240
|
+
const verticalCols = inferredDomCols || cols;
|
|
5241
|
+
const navigateVertically = (direction) => {
|
|
5242
|
+
if (!hasDomRows || prevIndex === -1) return;
|
|
5243
|
+
const currentRow = rowIndexMap[prevIndex];
|
|
5244
|
+
if (currentRow == null) return;
|
|
5245
|
+
const colInRow = rows[currentRow].indexOf(prevIndex);
|
|
5246
|
+
const step = direction === "up" ? -1 : 1;
|
|
5247
|
+
for (let nextRow = currentRow + step, i = 0; i < rows.length; i += 1, nextRow += step) {
|
|
5248
|
+
if (nextRow < 0 || nextRow >= rows.length) {
|
|
5249
|
+
if (!loopFocus || hasVirtualizedGaps) return;
|
|
5250
|
+
nextRow = nextRow < 0 ? rows.length - 1 : 0;
|
|
5251
|
+
if (onLoop) {
|
|
5252
|
+
const clampedCol = Math.min(colInRow, rows[nextRow].length - 1);
|
|
5253
|
+
const returnedItemIndex = onLoop(event, prevIndex, rows[nextRow][clampedCol] ?? rows[nextRow][0]);
|
|
5254
|
+
nextRow = rowIndexMap[returnedItemIndex] ?? nextRow;
|
|
5255
|
+
}
|
|
5256
|
+
}
|
|
5257
|
+
const targetRow = rows[nextRow];
|
|
5258
|
+
for (let col = Math.min(colInRow, targetRow.length - 1); col >= 0; col -= 1) {
|
|
5259
|
+
const candidate = targetRow[col];
|
|
5260
|
+
if (!isListIndexDisabled(list, candidate, disabledIndices)) return candidate;
|
|
5261
|
+
}
|
|
5262
|
+
}
|
|
5263
|
+
};
|
|
5264
|
+
const navigateVerticallyWithInferredRows = (direction) => {
|
|
5265
|
+
if (!hasVirtualizedGaps || prevIndex === -1) return;
|
|
5266
|
+
const colInRow = prevIndex % verticalCols;
|
|
5267
|
+
const rowStep = direction === "up" ? -verticalCols : verticalCols;
|
|
5268
|
+
const lastRowStart = maxIndex - maxIndex % verticalCols;
|
|
5269
|
+
const rowCount = floor(maxIndex / verticalCols) + 1;
|
|
5270
|
+
for (let rowStart = prevIndex - colInRow + rowStep, i = 0; i < rowCount; i += 1, rowStart += rowStep) {
|
|
5271
|
+
if (rowStart < 0 || rowStart > maxIndex) {
|
|
5272
|
+
if (!loopFocus) return;
|
|
5273
|
+
rowStart = rowStart < 0 ? lastRowStart : 0;
|
|
5274
|
+
}
|
|
5275
|
+
const rowEnd = Math.min(rowStart + verticalCols - 1, maxIndex);
|
|
5276
|
+
for (let candidate = Math.min(rowStart + colInRow, rowEnd); candidate >= rowStart; candidate -= 1) if (!isListIndexDisabled(list, candidate, disabledIndices)) return candidate;
|
|
5277
|
+
}
|
|
5278
|
+
};
|
|
5279
|
+
if (stop) stopEvent(event);
|
|
5280
|
+
const verticalCandidate = navigateVertically(verticalDirection) ?? navigateVerticallyWithInferredRows(verticalDirection);
|
|
5281
|
+
if (verticalCandidate !== void 0) nextIndex = verticalCandidate;
|
|
5282
|
+
else if (prevIndex === -1) nextIndex = verticalDirection === "up" ? maxIndex : minIndex;
|
|
5283
|
+
else {
|
|
5284
|
+
nextIndex = findNonDisabledListIndex(list, {
|
|
5285
|
+
startingIndex: prevIndex,
|
|
5286
|
+
amount: verticalCols,
|
|
5287
|
+
decrement: verticalDirection === "up",
|
|
5288
|
+
disabledIndices
|
|
5289
|
+
});
|
|
5290
|
+
if (loopFocus) {
|
|
5291
|
+
if (verticalDirection === "up" && (prevIndex - verticalCols < minIndex || nextIndex < 0)) {
|
|
5292
|
+
const col = prevIndex % verticalCols;
|
|
5293
|
+
const maxCol = maxIndex % verticalCols;
|
|
5294
|
+
const offset = maxIndex - (maxCol - col);
|
|
5295
|
+
if (maxCol === col) nextIndex = maxIndex;
|
|
5296
|
+
else nextIndex = maxCol > col ? offset : offset - verticalCols;
|
|
5297
|
+
if (onLoop) nextIndex = onLoop(event, prevIndex, nextIndex);
|
|
5298
|
+
}
|
|
5299
|
+
if (verticalDirection === "down" && prevIndex + verticalCols > maxIndex) {
|
|
5300
|
+
nextIndex = findNonDisabledListIndex(list, {
|
|
5301
|
+
startingIndex: prevIndex % verticalCols - verticalCols,
|
|
5302
|
+
amount: verticalCols,
|
|
5303
|
+
disabledIndices
|
|
5304
|
+
});
|
|
5305
|
+
if (onLoop) nextIndex = onLoop(event, prevIndex, nextIndex);
|
|
5306
|
+
}
|
|
5307
|
+
}
|
|
5308
|
+
}
|
|
5309
|
+
if (isIndexOutOfListBounds(list, nextIndex)) nextIndex = prevIndex;
|
|
5310
|
+
}
|
|
5311
|
+
if (orientation === "both") {
|
|
5312
|
+
const prevRow = floor(prevIndex / cols);
|
|
5313
|
+
if (event.key === (rtl ? "ArrowLeft" : "ArrowRight")) {
|
|
5314
|
+
if (stop) stopEvent(event);
|
|
5315
|
+
if (prevIndex % cols !== cols - 1) {
|
|
5316
|
+
nextIndex = findNonDisabledListIndex(list, {
|
|
5317
|
+
startingIndex: prevIndex,
|
|
5318
|
+
disabledIndices
|
|
5319
|
+
});
|
|
5320
|
+
if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {
|
|
5321
|
+
nextIndex = findNonDisabledListIndex(list, {
|
|
5322
|
+
startingIndex: prevIndex - prevIndex % cols - 1,
|
|
5323
|
+
disabledIndices
|
|
5324
|
+
});
|
|
5325
|
+
if (onLoop) nextIndex = onLoop(event, prevIndex, nextIndex);
|
|
5326
|
+
}
|
|
5327
|
+
} else if (loopFocus) {
|
|
5328
|
+
nextIndex = findNonDisabledListIndex(list, {
|
|
5329
|
+
startingIndex: prevIndex - prevIndex % cols - 1,
|
|
5330
|
+
disabledIndices
|
|
5331
|
+
});
|
|
5332
|
+
if (onLoop) nextIndex = onLoop(event, prevIndex, nextIndex);
|
|
5333
|
+
}
|
|
5334
|
+
if (isDifferentGridRow(nextIndex, cols, prevRow)) nextIndex = prevIndex;
|
|
5335
|
+
}
|
|
5336
|
+
if (event.key === (rtl ? "ArrowRight" : "ArrowLeft")) {
|
|
5337
|
+
if (stop) stopEvent(event);
|
|
5338
|
+
if (prevIndex % cols !== 0) {
|
|
5339
|
+
nextIndex = findNonDisabledListIndex(list, {
|
|
5340
|
+
startingIndex: prevIndex,
|
|
5341
|
+
decrement: true,
|
|
5342
|
+
disabledIndices
|
|
5343
|
+
});
|
|
5344
|
+
if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {
|
|
5345
|
+
nextIndex = findNonDisabledListIndex(list, {
|
|
5346
|
+
startingIndex: prevIndex + (cols - prevIndex % cols),
|
|
5347
|
+
decrement: true,
|
|
5348
|
+
disabledIndices
|
|
5349
|
+
});
|
|
5350
|
+
if (onLoop) nextIndex = onLoop(event, prevIndex, nextIndex);
|
|
5351
|
+
}
|
|
5352
|
+
} else if (loopFocus) {
|
|
5353
|
+
nextIndex = findNonDisabledListIndex(list, {
|
|
5354
|
+
startingIndex: prevIndex + (cols - prevIndex % cols),
|
|
5355
|
+
decrement: true,
|
|
5356
|
+
disabledIndices
|
|
5357
|
+
});
|
|
5358
|
+
if (onLoop) nextIndex = onLoop(event, prevIndex, nextIndex);
|
|
5359
|
+
}
|
|
5360
|
+
if (isDifferentGridRow(nextIndex, cols, prevRow)) nextIndex = prevIndex;
|
|
5361
|
+
}
|
|
5362
|
+
const lastRow = floor(maxIndex / cols) === prevRow;
|
|
5363
|
+
if (isIndexOutOfListBounds(list, nextIndex)) {
|
|
5364
|
+
if (loopFocus && lastRow) {
|
|
5365
|
+
nextIndex = event.key === (rtl ? "ArrowRight" : "ArrowLeft") ? maxIndex : findNonDisabledListIndex(list, {
|
|
5366
|
+
startingIndex: prevIndex - prevIndex % cols - 1,
|
|
5367
|
+
disabledIndices
|
|
5368
|
+
});
|
|
5369
|
+
if (onLoop) nextIndex = onLoop(event, prevIndex, nextIndex);
|
|
5370
|
+
} else nextIndex = prevIndex;
|
|
5371
|
+
}
|
|
5372
|
+
}
|
|
5373
|
+
return nextIndex;
|
|
5374
|
+
}
|
|
5375
|
+
/** For each cell index, gets the item index that occupies that cell */
|
|
5376
|
+
function createGridCellMap(sizes, cols, dense) {
|
|
5377
|
+
const cellMap = [];
|
|
5378
|
+
let startIndex = 0;
|
|
5379
|
+
sizes.forEach(({ width, height }, index) => {
|
|
5380
|
+
if (width > cols) {
|
|
5381
|
+
if (process.env.NODE_ENV !== "production") throw new Error(`[Floating UI]: Invalid grid - item width at index ${index} is greater than grid columns`);
|
|
5382
|
+
}
|
|
5383
|
+
let itemPlaced = false;
|
|
5384
|
+
if (dense) startIndex = 0;
|
|
5385
|
+
while (!itemPlaced) {
|
|
5386
|
+
const targetCells = [];
|
|
5387
|
+
for (let i = 0; i < width; i += 1) for (let j = 0; j < height; j += 1) targetCells.push(startIndex + i + j * cols);
|
|
5388
|
+
if (startIndex % cols + width <= cols && targetCells.every((cell) => cellMap[cell] == null)) {
|
|
5389
|
+
targetCells.forEach((cell) => {
|
|
5390
|
+
cellMap[cell] = index;
|
|
5391
|
+
});
|
|
5392
|
+
itemPlaced = true;
|
|
5393
|
+
} else startIndex += 1;
|
|
5394
|
+
}
|
|
5395
|
+
});
|
|
5396
|
+
return [...cellMap];
|
|
5397
|
+
}
|
|
5398
|
+
/** Gets cell index of an item's corner or -1 when index is -1. */
|
|
5399
|
+
function getGridCellIndexOfCorner(index, sizes, cellMap, cols, corner) {
|
|
5400
|
+
if (index === -1) return -1;
|
|
5401
|
+
const firstCellIndex = cellMap.indexOf(index);
|
|
5402
|
+
const sizeItem = sizes[index];
|
|
5403
|
+
switch (corner) {
|
|
5404
|
+
case "tl": return firstCellIndex;
|
|
5405
|
+
case "tr":
|
|
5406
|
+
if (!sizeItem) return firstCellIndex;
|
|
5407
|
+
return firstCellIndex + sizeItem.width - 1;
|
|
5408
|
+
case "bl":
|
|
5409
|
+
if (!sizeItem) return firstCellIndex;
|
|
5410
|
+
return firstCellIndex + (sizeItem.height - 1) * cols;
|
|
5411
|
+
case "br": return cellMap.lastIndexOf(index);
|
|
5412
|
+
default: return -1;
|
|
5413
|
+
}
|
|
5414
|
+
}
|
|
5415
|
+
/** Gets all cell indices that correspond to the specified indices */
|
|
5416
|
+
function getGridCellIndices(indices, cellMap) {
|
|
5417
|
+
return cellMap.flatMap((index, cellIndex) => indices.includes(index) ? [cellIndex] : []);
|
|
5418
|
+
}
|
|
5419
|
+
function isListIndexDisabled(list, index, disabledIndices) {
|
|
5420
|
+
if (typeof disabledIndices === "function" ? disabledIndices(index) : disabledIndices?.includes(index) ?? false) return true;
|
|
5421
|
+
const element = list[index];
|
|
5422
|
+
if (!element) return false;
|
|
5423
|
+
if (!isElementVisible(element)) return true;
|
|
5424
|
+
return !disabledIndices && (element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true");
|
|
5425
|
+
}
|
|
5182
5426
|
function isHiddenByStyles(styles) {
|
|
5183
5427
|
return styles.visibility === "hidden" || styles.visibility === "collapse";
|
|
5184
5428
|
}
|
|
@@ -10302,8 +10546,25 @@ var ARROW_LEFT = "ArrowLeft";
|
|
|
10302
10546
|
var ARROW_RIGHT = "ArrowRight";
|
|
10303
10547
|
var HOME = "Home";
|
|
10304
10548
|
var HORIZONTAL_KEYS = /* @__PURE__ */ new Set([ARROW_LEFT, ARROW_RIGHT]);
|
|
10549
|
+
var HORIZONTAL_KEYS_WITH_EXTRA_KEYS = /* @__PURE__ */ new Set([
|
|
10550
|
+
ARROW_LEFT,
|
|
10551
|
+
ARROW_RIGHT,
|
|
10552
|
+
HOME,
|
|
10553
|
+
"End"
|
|
10554
|
+
]);
|
|
10305
10555
|
var VERTICAL_KEYS = /* @__PURE__ */ new Set([ARROW_UP, ARROW_DOWN]);
|
|
10306
|
-
|
|
10556
|
+
var VERTICAL_KEYS_WITH_EXTRA_KEYS = /* @__PURE__ */ new Set([
|
|
10557
|
+
ARROW_UP,
|
|
10558
|
+
ARROW_DOWN,
|
|
10559
|
+
HOME,
|
|
10560
|
+
"End"
|
|
10561
|
+
]);
|
|
10562
|
+
var ARROW_KEYS = /* @__PURE__ */ new Set([...HORIZONTAL_KEYS, ...VERTICAL_KEYS]);
|
|
10563
|
+
var ALL_KEYS = /* @__PURE__ */ new Set([
|
|
10564
|
+
...ARROW_KEYS,
|
|
10565
|
+
HOME,
|
|
10566
|
+
"End"
|
|
10567
|
+
]);
|
|
10307
10568
|
var COMPOSITE_KEYS = /* @__PURE__ */ new Set([
|
|
10308
10569
|
ARROW_UP,
|
|
10309
10570
|
ARROW_DOWN,
|
|
@@ -10312,9 +10573,78 @@ var COMPOSITE_KEYS = /* @__PURE__ */ new Set([
|
|
|
10312
10573
|
HOME,
|
|
10313
10574
|
"End"
|
|
10314
10575
|
]);
|
|
10576
|
+
var MODIFIER_KEYS = /* @__PURE__ */ new Set([
|
|
10577
|
+
"Shift",
|
|
10578
|
+
"Control",
|
|
10579
|
+
"Alt",
|
|
10580
|
+
"Meta"
|
|
10581
|
+
]);
|
|
10582
|
+
function isInputElement(element) {
|
|
10583
|
+
return isHTMLElement(element) && element.tagName === "INPUT";
|
|
10584
|
+
}
|
|
10585
|
+
function isNativeInput(element) {
|
|
10586
|
+
if (isInputElement(element) && element.selectionStart != null) return true;
|
|
10587
|
+
if (isHTMLElement(element) && element.tagName === "TEXTAREA") return true;
|
|
10588
|
+
return false;
|
|
10589
|
+
}
|
|
10590
|
+
function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) {
|
|
10591
|
+
if (!scrollContainer || !element || !element.scrollTo) return;
|
|
10592
|
+
let targetX = scrollContainer.scrollLeft;
|
|
10593
|
+
let targetY = scrollContainer.scrollTop;
|
|
10594
|
+
const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth;
|
|
10595
|
+
const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight;
|
|
10596
|
+
if (isOverflowingX && orientation !== "vertical") {
|
|
10597
|
+
const elementOffsetLeft = getOffset(scrollContainer, element, "left");
|
|
10598
|
+
const containerStyles = getStyles(scrollContainer);
|
|
10599
|
+
const elementStyles = getStyles(element);
|
|
10600
|
+
if (direction === "ltr") {
|
|
10601
|
+
if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;
|
|
10602
|
+
else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
|
|
10603
|
+
}
|
|
10604
|
+
if (direction === "rtl") {
|
|
10605
|
+
if (elementOffsetLeft - elementStyles.scrollMarginRight < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
|
|
10606
|
+
else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;
|
|
10607
|
+
}
|
|
10608
|
+
}
|
|
10609
|
+
if (isOverflowingY && orientation !== "horizontal") {
|
|
10610
|
+
const elementOffsetTop = getOffset(scrollContainer, element, "top");
|
|
10611
|
+
const containerStyles = getStyles(scrollContainer);
|
|
10612
|
+
const elementStyles = getStyles(element);
|
|
10613
|
+
if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop;
|
|
10614
|
+
else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom;
|
|
10615
|
+
}
|
|
10616
|
+
scrollContainer.scrollTo({
|
|
10617
|
+
left: targetX,
|
|
10618
|
+
top: targetY,
|
|
10619
|
+
behavior: "auto"
|
|
10620
|
+
});
|
|
10621
|
+
}
|
|
10622
|
+
function getOffset(ancestor, element, side) {
|
|
10623
|
+
const propName = side === "left" ? "offsetLeft" : "offsetTop";
|
|
10624
|
+
let result = 0;
|
|
10625
|
+
while (element.offsetParent) {
|
|
10626
|
+
result += element[propName];
|
|
10627
|
+
if (element.offsetParent === ancestor) break;
|
|
10628
|
+
element = element.offsetParent;
|
|
10629
|
+
}
|
|
10630
|
+
return result;
|
|
10631
|
+
}
|
|
10632
|
+
function getStyles(element) {
|
|
10633
|
+
const styles = getComputedStyle(element);
|
|
10634
|
+
return {
|
|
10635
|
+
scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0,
|
|
10636
|
+
scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0,
|
|
10637
|
+
scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0,
|
|
10638
|
+
scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0,
|
|
10639
|
+
scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0,
|
|
10640
|
+
scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0,
|
|
10641
|
+
scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0,
|
|
10642
|
+
scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0
|
|
10643
|
+
};
|
|
10644
|
+
}
|
|
10315
10645
|
//#endregion
|
|
10316
10646
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/dialog/popup/DialogPopup.js
|
|
10317
|
-
var stateAttributesMapping$
|
|
10647
|
+
var stateAttributesMapping$2 = {
|
|
10318
10648
|
...popupStateMapping,
|
|
10319
10649
|
...transitionStatusMapping,
|
|
10320
10650
|
nestedDialogOpen(value) {
|
|
@@ -10383,7 +10713,7 @@ var DialogPopup = /*#__PURE__*/ React.forwardRef(function DialogPopup(componentP
|
|
|
10383
10713
|
store.context.popupRef,
|
|
10384
10714
|
store.useStateSetter("popupElement")
|
|
10385
10715
|
],
|
|
10386
|
-
stateAttributesMapping: stateAttributesMapping$
|
|
10716
|
+
stateAttributesMapping: stateAttributesMapping$2
|
|
10387
10717
|
});
|
|
10388
10718
|
return /*#__PURE__*/ jsx(FloatingFocusManager, {
|
|
10389
10719
|
context: floatingRootContext,
|
|
@@ -11991,7 +12321,7 @@ var TooltipPositioner = /*#__PURE__*/ React.forwardRef(function TooltipPositione
|
|
|
11991
12321
|
if (process.env.NODE_ENV !== "production") TooltipPositioner.displayName = "TooltipPositioner";
|
|
11992
12322
|
//#endregion
|
|
11993
12323
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tooltip/popup/TooltipPopup.js
|
|
11994
|
-
var stateAttributesMapping = {
|
|
12324
|
+
var stateAttributesMapping$1 = {
|
|
11995
12325
|
...popupStateMapping,
|
|
11996
12326
|
...transitionStatusMapping
|
|
11997
12327
|
};
|
|
@@ -12041,7 +12371,7 @@ var TooltipPopup = /*#__PURE__*/ React.forwardRef(function TooltipPopup(componen
|
|
|
12041
12371
|
getDisabledMountTransitionStyles(transitionStatus),
|
|
12042
12372
|
elementProps
|
|
12043
12373
|
],
|
|
12044
|
-
stateAttributesMapping
|
|
12374
|
+
stateAttributesMapping: stateAttributesMapping$1
|
|
12045
12375
|
});
|
|
12046
12376
|
});
|
|
12047
12377
|
if (process.env.NODE_ENV !== "production") TooltipPopup.displayName = "TooltipPopup";
|
|
@@ -12641,6 +12971,1075 @@ function NativeSelectOption$1({ className, ...props }) {
|
|
|
12641
12971
|
});
|
|
12642
12972
|
}
|
|
12643
12973
|
//#endregion
|
|
12974
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/internals/composite/list/CompositeListContext.js
|
|
12975
|
+
var CompositeListContext = /*#__PURE__*/ React.createContext({
|
|
12976
|
+
register: () => {},
|
|
12977
|
+
unregister: () => {},
|
|
12978
|
+
subscribeMapChange: () => {
|
|
12979
|
+
return () => {};
|
|
12980
|
+
},
|
|
12981
|
+
elementsRef: { current: [] },
|
|
12982
|
+
nextIndexRef: { current: 0 }
|
|
12983
|
+
});
|
|
12984
|
+
if (process.env.NODE_ENV !== "production") CompositeListContext.displayName = "CompositeListContext";
|
|
12985
|
+
function useCompositeListContext() {
|
|
12986
|
+
return React.useContext(CompositeListContext);
|
|
12987
|
+
}
|
|
12988
|
+
//#endregion
|
|
12989
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/internals/composite/list/CompositeList.js
|
|
12990
|
+
/**
|
|
12991
|
+
* Provides context for a list of items in a composite component.
|
|
12992
|
+
* @internal
|
|
12993
|
+
*/
|
|
12994
|
+
function CompositeList(props) {
|
|
12995
|
+
const { children, elementsRef, labelsRef, onMapChange: onMapChangeProp } = props;
|
|
12996
|
+
const onMapChange = useStableCallback(onMapChangeProp);
|
|
12997
|
+
const nextIndexRef = React.useRef(0);
|
|
12998
|
+
const listeners = useRefWithInit(createListeners).current;
|
|
12999
|
+
const map = useRefWithInit(createMap).current;
|
|
13000
|
+
const [mapTick, setMapTick] = React.useState(0);
|
|
13001
|
+
const lastTickRef = React.useRef(mapTick);
|
|
13002
|
+
const register = useStableCallback((node, metadata) => {
|
|
13003
|
+
map.set(node, metadata ?? null);
|
|
13004
|
+
lastTickRef.current += 1;
|
|
13005
|
+
setMapTick(lastTickRef.current);
|
|
13006
|
+
});
|
|
13007
|
+
const unregister = useStableCallback((node) => {
|
|
13008
|
+
map.delete(node);
|
|
13009
|
+
lastTickRef.current += 1;
|
|
13010
|
+
setMapTick(lastTickRef.current);
|
|
13011
|
+
});
|
|
13012
|
+
const sortedMap = React.useMemo(() => {
|
|
13013
|
+
const newMap = /* @__PURE__ */ new Map();
|
|
13014
|
+
Array.from(map.keys()).filter((node) => node.isConnected).sort(sortByDocumentPosition).forEach((node, index) => {
|
|
13015
|
+
const metadata = map.get(node) ?? {};
|
|
13016
|
+
newMap.set(node, {
|
|
13017
|
+
...metadata,
|
|
13018
|
+
index
|
|
13019
|
+
});
|
|
13020
|
+
});
|
|
13021
|
+
return newMap;
|
|
13022
|
+
}, [map, mapTick]);
|
|
13023
|
+
useIsoLayoutEffect(() => {
|
|
13024
|
+
if (typeof MutationObserver !== "function" || sortedMap.size === 0) return;
|
|
13025
|
+
const mutationObserver = new MutationObserver((entries) => {
|
|
13026
|
+
const diff = /* @__PURE__ */ new Set();
|
|
13027
|
+
const updateDiff = (node) => diff.has(node) ? diff.delete(node) : diff.add(node);
|
|
13028
|
+
entries.forEach((entry) => {
|
|
13029
|
+
entry.removedNodes.forEach(updateDiff);
|
|
13030
|
+
entry.addedNodes.forEach(updateDiff);
|
|
13031
|
+
});
|
|
13032
|
+
if (diff.size === 0) {
|
|
13033
|
+
lastTickRef.current += 1;
|
|
13034
|
+
setMapTick(lastTickRef.current);
|
|
13035
|
+
}
|
|
13036
|
+
});
|
|
13037
|
+
sortedMap.forEach((_, node) => {
|
|
13038
|
+
if (node.parentElement) mutationObserver.observe(node.parentElement, { childList: true });
|
|
13039
|
+
});
|
|
13040
|
+
return () => {
|
|
13041
|
+
mutationObserver.disconnect();
|
|
13042
|
+
};
|
|
13043
|
+
}, [sortedMap]);
|
|
13044
|
+
useIsoLayoutEffect(() => {
|
|
13045
|
+
if (lastTickRef.current === mapTick) {
|
|
13046
|
+
if (elementsRef.current.length !== sortedMap.size) elementsRef.current.length = sortedMap.size;
|
|
13047
|
+
if (labelsRef && labelsRef.current.length !== sortedMap.size) labelsRef.current.length = sortedMap.size;
|
|
13048
|
+
nextIndexRef.current = sortedMap.size;
|
|
13049
|
+
}
|
|
13050
|
+
onMapChange(sortedMap);
|
|
13051
|
+
}, [
|
|
13052
|
+
onMapChange,
|
|
13053
|
+
sortedMap,
|
|
13054
|
+
elementsRef,
|
|
13055
|
+
labelsRef,
|
|
13056
|
+
mapTick
|
|
13057
|
+
]);
|
|
13058
|
+
useIsoLayoutEffect(() => {
|
|
13059
|
+
return () => {
|
|
13060
|
+
elementsRef.current = [];
|
|
13061
|
+
};
|
|
13062
|
+
}, [elementsRef]);
|
|
13063
|
+
useIsoLayoutEffect(() => {
|
|
13064
|
+
return () => {
|
|
13065
|
+
if (labelsRef) labelsRef.current = [];
|
|
13066
|
+
};
|
|
13067
|
+
}, [labelsRef]);
|
|
13068
|
+
const subscribeMapChange = useStableCallback((fn) => {
|
|
13069
|
+
listeners.add(fn);
|
|
13070
|
+
return () => {
|
|
13071
|
+
listeners.delete(fn);
|
|
13072
|
+
};
|
|
13073
|
+
});
|
|
13074
|
+
useIsoLayoutEffect(() => {
|
|
13075
|
+
listeners.forEach((l) => l(sortedMap));
|
|
13076
|
+
}, [listeners, sortedMap]);
|
|
13077
|
+
const contextValue = React.useMemo(() => ({
|
|
13078
|
+
register,
|
|
13079
|
+
unregister,
|
|
13080
|
+
subscribeMapChange,
|
|
13081
|
+
elementsRef,
|
|
13082
|
+
labelsRef,
|
|
13083
|
+
nextIndexRef
|
|
13084
|
+
}), [
|
|
13085
|
+
register,
|
|
13086
|
+
unregister,
|
|
13087
|
+
subscribeMapChange,
|
|
13088
|
+
elementsRef,
|
|
13089
|
+
labelsRef,
|
|
13090
|
+
nextIndexRef
|
|
13091
|
+
]);
|
|
13092
|
+
return /*#__PURE__*/ jsx(CompositeListContext.Provider, {
|
|
13093
|
+
value: contextValue,
|
|
13094
|
+
children
|
|
13095
|
+
});
|
|
13096
|
+
}
|
|
13097
|
+
function createMap() {
|
|
13098
|
+
return /* @__PURE__ */ new Map();
|
|
13099
|
+
}
|
|
13100
|
+
function createListeners() {
|
|
13101
|
+
return /* @__PURE__ */ new Set();
|
|
13102
|
+
}
|
|
13103
|
+
function sortByDocumentPosition(a, b) {
|
|
13104
|
+
const position = a.compareDocumentPosition(b);
|
|
13105
|
+
if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) return -1;
|
|
13106
|
+
if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) return 1;
|
|
13107
|
+
return 0;
|
|
13108
|
+
}
|
|
13109
|
+
//#endregion
|
|
13110
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/root/TabsRootContext.js
|
|
13111
|
+
/**
|
|
13112
|
+
* @internal
|
|
13113
|
+
*/
|
|
13114
|
+
var TabsRootContext = /*#__PURE__*/ React.createContext(void 0);
|
|
13115
|
+
if (process.env.NODE_ENV !== "production") TabsRootContext.displayName = "TabsRootContext";
|
|
13116
|
+
function useTabsRootContext() {
|
|
13117
|
+
const context = React.useContext(TabsRootContext);
|
|
13118
|
+
if (context === void 0) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : formatErrorMessage(64));
|
|
13119
|
+
return context;
|
|
13120
|
+
}
|
|
13121
|
+
//#endregion
|
|
13122
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/root/TabsRootDataAttributes.js
|
|
13123
|
+
var TabsRootDataAttributes = /*#__PURE__*/ function(TabsRootDataAttributes) {
|
|
13124
|
+
/**
|
|
13125
|
+
* Indicates the direction of the activation (based on the previous active tab).
|
|
13126
|
+
* @type {'left' | 'right' | 'up' | 'down' | 'none'}
|
|
13127
|
+
*/
|
|
13128
|
+
TabsRootDataAttributes["activationDirection"] = "data-activation-direction";
|
|
13129
|
+
/**
|
|
13130
|
+
* Indicates the orientation of the tabs.
|
|
13131
|
+
* @type {'horizontal' | 'vertical'}
|
|
13132
|
+
*/
|
|
13133
|
+
TabsRootDataAttributes["orientation"] = "data-orientation";
|
|
13134
|
+
return TabsRootDataAttributes;
|
|
13135
|
+
}({});
|
|
13136
|
+
//#endregion
|
|
13137
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/root/stateAttributesMapping.js
|
|
13138
|
+
var tabsStateAttributesMapping = { tabActivationDirection: (dir) => ({ [TabsRootDataAttributes.activationDirection]: dir }) };
|
|
13139
|
+
//#endregion
|
|
13140
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/root/TabsRoot.js
|
|
13141
|
+
/**
|
|
13142
|
+
* Groups the tabs and the corresponding panels.
|
|
13143
|
+
* Renders a `<div>` element.
|
|
13144
|
+
*
|
|
13145
|
+
* Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)
|
|
13146
|
+
*/
|
|
13147
|
+
var TabsRoot = /*#__PURE__*/ React.forwardRef(function TabsRoot(componentProps, forwardedRef) {
|
|
13148
|
+
const { className, defaultValue: defaultValueProp = 0, onValueChange: onValueChangeProp, orientation = "horizontal", render, value: valueProp, style, ...elementProps } = componentProps;
|
|
13149
|
+
const hasExplicitDefaultValueProp = Object.hasOwn(componentProps, "defaultValue");
|
|
13150
|
+
const tabPanelRefs = React.useRef([]);
|
|
13151
|
+
const [mountedTabPanels, setMountedTabPanels] = React.useState(() => /* @__PURE__ */ new Map());
|
|
13152
|
+
const [value, setValue] = useControlled({
|
|
13153
|
+
controlled: valueProp,
|
|
13154
|
+
default: defaultValueProp,
|
|
13155
|
+
name: "Tabs",
|
|
13156
|
+
state: "value"
|
|
13157
|
+
});
|
|
13158
|
+
const isControlled = valueProp !== void 0;
|
|
13159
|
+
const [tabMap, setTabMap] = React.useState(() => /* @__PURE__ */ new Map());
|
|
13160
|
+
const getTabElementBySelectedValue = React.useCallback((selectedValue) => {
|
|
13161
|
+
if (selectedValue === void 0) return null;
|
|
13162
|
+
for (const [tabElement, tabMetadata] of tabMap.entries()) if (tabMetadata != null && selectedValue === (tabMetadata.value ?? tabMetadata.index)) return tabElement;
|
|
13163
|
+
return null;
|
|
13164
|
+
}, [tabMap]);
|
|
13165
|
+
const [activationDirectionState, setActivationDirectionState] = React.useState(() => ({
|
|
13166
|
+
previousValue: value,
|
|
13167
|
+
tabActivationDirection: "none"
|
|
13168
|
+
}));
|
|
13169
|
+
const { previousValue, tabActivationDirection: committedTabActivationDirection } = activationDirectionState;
|
|
13170
|
+
let tabActivationDirection = committedTabActivationDirection;
|
|
13171
|
+
let directionComputationIncomplete = false;
|
|
13172
|
+
if (previousValue !== value) {
|
|
13173
|
+
tabActivationDirection = computeActivationDirection(previousValue, value, orientation, tabMap);
|
|
13174
|
+
directionComputationIncomplete = previousValue != null && value != null && getTabElementBySelectedValue(value) == null;
|
|
13175
|
+
}
|
|
13176
|
+
const nextPreviousValue = directionComputationIncomplete ? previousValue : value;
|
|
13177
|
+
const shouldSyncActivationDirectionState = previousValue !== nextPreviousValue || committedTabActivationDirection !== tabActivationDirection;
|
|
13178
|
+
useIsoLayoutEffect(() => {
|
|
13179
|
+
if (!shouldSyncActivationDirectionState) return;
|
|
13180
|
+
setActivationDirectionState({
|
|
13181
|
+
previousValue: nextPreviousValue,
|
|
13182
|
+
tabActivationDirection
|
|
13183
|
+
});
|
|
13184
|
+
}, [
|
|
13185
|
+
nextPreviousValue,
|
|
13186
|
+
shouldSyncActivationDirectionState,
|
|
13187
|
+
tabActivationDirection
|
|
13188
|
+
]);
|
|
13189
|
+
const onValueChange = useStableCallback((newValue, eventDetails) => {
|
|
13190
|
+
eventDetails.activationDirection = computeActivationDirection(value, newValue, orientation, tabMap);
|
|
13191
|
+
onValueChangeProp?.(newValue, eventDetails);
|
|
13192
|
+
if (eventDetails.isCanceled) return;
|
|
13193
|
+
setValue(newValue);
|
|
13194
|
+
});
|
|
13195
|
+
const registerMountedTabPanel = useStableCallback((panelValue, panelId) => {
|
|
13196
|
+
setMountedTabPanels((prev) => {
|
|
13197
|
+
if (prev.get(panelValue) === panelId) return prev;
|
|
13198
|
+
const next = new Map(prev);
|
|
13199
|
+
next.set(panelValue, panelId);
|
|
13200
|
+
return next;
|
|
13201
|
+
});
|
|
13202
|
+
});
|
|
13203
|
+
const unregisterMountedTabPanel = useStableCallback((panelValue, panelId) => {
|
|
13204
|
+
setMountedTabPanels((prev) => {
|
|
13205
|
+
if (!prev.has(panelValue) || prev.get(panelValue) !== panelId) return prev;
|
|
13206
|
+
const next = new Map(prev);
|
|
13207
|
+
next.delete(panelValue);
|
|
13208
|
+
return next;
|
|
13209
|
+
});
|
|
13210
|
+
});
|
|
13211
|
+
const getTabPanelIdByValue = React.useCallback((tabValue) => {
|
|
13212
|
+
return mountedTabPanels.get(tabValue);
|
|
13213
|
+
}, [mountedTabPanels]);
|
|
13214
|
+
const getTabIdByPanelValue = React.useCallback((tabPanelValue) => {
|
|
13215
|
+
for (const tabMetadata of tabMap.values()) if (tabPanelValue === tabMetadata?.value) return tabMetadata?.id;
|
|
13216
|
+
}, [tabMap]);
|
|
13217
|
+
const tabsContextValue = React.useMemo(() => ({
|
|
13218
|
+
getTabElementBySelectedValue,
|
|
13219
|
+
getTabIdByPanelValue,
|
|
13220
|
+
getTabPanelIdByValue,
|
|
13221
|
+
onValueChange,
|
|
13222
|
+
orientation,
|
|
13223
|
+
registerMountedTabPanel,
|
|
13224
|
+
setTabMap,
|
|
13225
|
+
unregisterMountedTabPanel,
|
|
13226
|
+
tabActivationDirection,
|
|
13227
|
+
value
|
|
13228
|
+
}), [
|
|
13229
|
+
getTabElementBySelectedValue,
|
|
13230
|
+
getTabIdByPanelValue,
|
|
13231
|
+
getTabPanelIdByValue,
|
|
13232
|
+
onValueChange,
|
|
13233
|
+
orientation,
|
|
13234
|
+
registerMountedTabPanel,
|
|
13235
|
+
setTabMap,
|
|
13236
|
+
unregisterMountedTabPanel,
|
|
13237
|
+
tabActivationDirection,
|
|
13238
|
+
value
|
|
13239
|
+
]);
|
|
13240
|
+
const selectedTabMetadata = React.useMemo(() => {
|
|
13241
|
+
for (const tabMetadata of tabMap.values()) if (tabMetadata != null && tabMetadata.value === value) return tabMetadata;
|
|
13242
|
+
}, [tabMap, value]);
|
|
13243
|
+
const firstEnabledTabValue = React.useMemo(() => {
|
|
13244
|
+
for (const tabMetadata of tabMap.values()) if (tabMetadata != null && !tabMetadata.disabled) return tabMetadata.value;
|
|
13245
|
+
}, [tabMap]);
|
|
13246
|
+
useIsoLayoutEffect(() => {
|
|
13247
|
+
if (isControlled || tabMap.size === 0) return;
|
|
13248
|
+
const selectionIsDisabled = selectedTabMetadata?.disabled;
|
|
13249
|
+
const selectionIsMissing = selectedTabMetadata == null && value !== null;
|
|
13250
|
+
if (hasExplicitDefaultValueProp && selectionIsDisabled && value === defaultValueProp) return;
|
|
13251
|
+
if (!selectionIsDisabled && !selectionIsMissing) return;
|
|
13252
|
+
const fallbackValue = firstEnabledTabValue ?? null;
|
|
13253
|
+
if (value === fallbackValue) return;
|
|
13254
|
+
setValue(fallbackValue);
|
|
13255
|
+
setActivationDirectionState((prev) => {
|
|
13256
|
+
if (prev.tabActivationDirection === "none") return prev;
|
|
13257
|
+
return {
|
|
13258
|
+
...prev,
|
|
13259
|
+
tabActivationDirection: "none"
|
|
13260
|
+
};
|
|
13261
|
+
});
|
|
13262
|
+
}, [
|
|
13263
|
+
defaultValueProp,
|
|
13264
|
+
firstEnabledTabValue,
|
|
13265
|
+
hasExplicitDefaultValueProp,
|
|
13266
|
+
isControlled,
|
|
13267
|
+
selectedTabMetadata,
|
|
13268
|
+
setValue,
|
|
13269
|
+
tabMap,
|
|
13270
|
+
value
|
|
13271
|
+
]);
|
|
13272
|
+
const element = useRenderElement("div", componentProps, {
|
|
13273
|
+
state: {
|
|
13274
|
+
orientation,
|
|
13275
|
+
tabActivationDirection
|
|
13276
|
+
},
|
|
13277
|
+
ref: forwardedRef,
|
|
13278
|
+
props: elementProps,
|
|
13279
|
+
stateAttributesMapping: tabsStateAttributesMapping
|
|
13280
|
+
});
|
|
13281
|
+
return /*#__PURE__*/ jsx(TabsRootContext.Provider, {
|
|
13282
|
+
value: tabsContextValue,
|
|
13283
|
+
children: /*#__PURE__*/ jsx(CompositeList, {
|
|
13284
|
+
elementsRef: tabPanelRefs,
|
|
13285
|
+
children: element
|
|
13286
|
+
})
|
|
13287
|
+
});
|
|
13288
|
+
});
|
|
13289
|
+
if (process.env.NODE_ENV !== "production") TabsRoot.displayName = "TabsRoot";
|
|
13290
|
+
function computeActivationDirection(oldValue, newValue, orientation, tabMap) {
|
|
13291
|
+
if (oldValue == null || newValue == null) return "none";
|
|
13292
|
+
let oldTab = null;
|
|
13293
|
+
let newTab = null;
|
|
13294
|
+
for (const [tabElement, tabMetadata] of tabMap.entries()) {
|
|
13295
|
+
if (tabMetadata == null) continue;
|
|
13296
|
+
const tabValue = tabMetadata.value ?? tabMetadata.index;
|
|
13297
|
+
if (oldValue === tabValue) oldTab = tabElement;
|
|
13298
|
+
if (newValue === tabValue) newTab = tabElement;
|
|
13299
|
+
if (oldTab != null && newTab != null) break;
|
|
13300
|
+
}
|
|
13301
|
+
if (oldTab == null || newTab == null) {
|
|
13302
|
+
if (oldTab !== newTab && (typeof oldValue === "number" || typeof oldValue === "string") && typeof oldValue === typeof newValue) {
|
|
13303
|
+
if (orientation === "horizontal") return newValue > oldValue ? "right" : "left";
|
|
13304
|
+
return newValue > oldValue ? "down" : "up";
|
|
13305
|
+
}
|
|
13306
|
+
return "none";
|
|
13307
|
+
}
|
|
13308
|
+
const oldRect = oldTab.getBoundingClientRect();
|
|
13309
|
+
const newRect = newTab.getBoundingClientRect();
|
|
13310
|
+
if (orientation === "horizontal") {
|
|
13311
|
+
if (newRect.left < oldRect.left) return "left";
|
|
13312
|
+
if (newRect.left > oldRect.left) return "right";
|
|
13313
|
+
} else {
|
|
13314
|
+
if (newRect.top < oldRect.top) return "up";
|
|
13315
|
+
if (newRect.top > oldRect.top) return "down";
|
|
13316
|
+
}
|
|
13317
|
+
return "none";
|
|
13318
|
+
}
|
|
13319
|
+
//#endregion
|
|
13320
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/internals/composite/constants.js
|
|
13321
|
+
var ACTIVE_COMPOSITE_ITEM = "data-composite-item-active";
|
|
13322
|
+
//#endregion
|
|
13323
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/internals/composite/list/useCompositeListItem.js
|
|
13324
|
+
var IndexGuessBehavior = /*#__PURE__*/ function(IndexGuessBehavior) {
|
|
13325
|
+
IndexGuessBehavior[IndexGuessBehavior["None"] = 0] = "None";
|
|
13326
|
+
IndexGuessBehavior[IndexGuessBehavior["GuessFromOrder"] = 1] = "GuessFromOrder";
|
|
13327
|
+
return IndexGuessBehavior;
|
|
13328
|
+
}({});
|
|
13329
|
+
/**
|
|
13330
|
+
* Used to register a list item and its index (DOM position) in the `CompositeList`.
|
|
13331
|
+
*/
|
|
13332
|
+
function useCompositeListItem(params = {}) {
|
|
13333
|
+
const { label, metadata, textRef, indexGuessBehavior, index: externalIndex } = params;
|
|
13334
|
+
const { register, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef } = useCompositeListContext();
|
|
13335
|
+
const indexRef = React.useRef(-1);
|
|
13336
|
+
const [index, setIndex] = React.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => {
|
|
13337
|
+
if (indexRef.current === -1) {
|
|
13338
|
+
const newIndex = nextIndexRef.current;
|
|
13339
|
+
nextIndexRef.current += 1;
|
|
13340
|
+
indexRef.current = newIndex;
|
|
13341
|
+
}
|
|
13342
|
+
return indexRef.current;
|
|
13343
|
+
} : -1));
|
|
13344
|
+
const componentRef = React.useRef(null);
|
|
13345
|
+
const ref = React.useCallback((node) => {
|
|
13346
|
+
componentRef.current = node;
|
|
13347
|
+
if (index !== -1 && node !== null) {
|
|
13348
|
+
elementsRef.current[index] = node;
|
|
13349
|
+
if (labelsRef) {
|
|
13350
|
+
const isLabelDefined = label !== void 0;
|
|
13351
|
+
labelsRef.current[index] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent;
|
|
13352
|
+
}
|
|
13353
|
+
}
|
|
13354
|
+
}, [
|
|
13355
|
+
index,
|
|
13356
|
+
elementsRef,
|
|
13357
|
+
labelsRef,
|
|
13358
|
+
label,
|
|
13359
|
+
textRef
|
|
13360
|
+
]);
|
|
13361
|
+
useIsoLayoutEffect(() => {
|
|
13362
|
+
if (externalIndex != null) return;
|
|
13363
|
+
const node = componentRef.current;
|
|
13364
|
+
if (node) {
|
|
13365
|
+
register(node, metadata);
|
|
13366
|
+
return () => {
|
|
13367
|
+
unregister(node);
|
|
13368
|
+
};
|
|
13369
|
+
}
|
|
13370
|
+
}, [
|
|
13371
|
+
externalIndex,
|
|
13372
|
+
register,
|
|
13373
|
+
unregister,
|
|
13374
|
+
metadata
|
|
13375
|
+
]);
|
|
13376
|
+
useIsoLayoutEffect(() => {
|
|
13377
|
+
if (externalIndex != null) return;
|
|
13378
|
+
return subscribeMapChange((map) => {
|
|
13379
|
+
const i = componentRef.current ? map.get(componentRef.current)?.index : null;
|
|
13380
|
+
if (i != null) setIndex(i);
|
|
13381
|
+
});
|
|
13382
|
+
}, [
|
|
13383
|
+
externalIndex,
|
|
13384
|
+
subscribeMapChange,
|
|
13385
|
+
setIndex
|
|
13386
|
+
]);
|
|
13387
|
+
return React.useMemo(() => ({
|
|
13388
|
+
ref,
|
|
13389
|
+
index
|
|
13390
|
+
}), [index, ref]);
|
|
13391
|
+
}
|
|
13392
|
+
//#endregion
|
|
13393
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/internals/composite/item/useCompositeItem.js
|
|
13394
|
+
function useCompositeItem(params = {}) {
|
|
13395
|
+
const { highlightItemOnHover, highlightedIndex, onHighlightedIndexChange } = useCompositeRootContext();
|
|
13396
|
+
const { ref, index } = useCompositeListItem(params);
|
|
13397
|
+
const isHighlighted = highlightedIndex === index;
|
|
13398
|
+
const itemRef = React.useRef(null);
|
|
13399
|
+
const mergedRef = useMergedRefs(ref, itemRef);
|
|
13400
|
+
return {
|
|
13401
|
+
compositeProps: React.useMemo(() => ({
|
|
13402
|
+
tabIndex: isHighlighted ? 0 : -1,
|
|
13403
|
+
onFocus() {
|
|
13404
|
+
onHighlightedIndexChange(index);
|
|
13405
|
+
},
|
|
13406
|
+
onMouseMove() {
|
|
13407
|
+
const item = itemRef.current;
|
|
13408
|
+
if (!highlightItemOnHover || !item) return;
|
|
13409
|
+
const disabled = item.hasAttribute("disabled") || item.ariaDisabled === "true";
|
|
13410
|
+
if (!isHighlighted && !disabled) item.focus();
|
|
13411
|
+
}
|
|
13412
|
+
}), [
|
|
13413
|
+
isHighlighted,
|
|
13414
|
+
onHighlightedIndexChange,
|
|
13415
|
+
index,
|
|
13416
|
+
highlightItemOnHover
|
|
13417
|
+
]),
|
|
13418
|
+
compositeRef: mergedRef,
|
|
13419
|
+
index
|
|
13420
|
+
};
|
|
13421
|
+
}
|
|
13422
|
+
//#endregion
|
|
13423
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/list/TabsListContext.js
|
|
13424
|
+
var TabsListContext = /*#__PURE__*/ React.createContext(void 0);
|
|
13425
|
+
if (process.env.NODE_ENV !== "production") TabsListContext.displayName = "TabsListContext";
|
|
13426
|
+
function useTabsListContext() {
|
|
13427
|
+
const context = React.useContext(TabsListContext);
|
|
13428
|
+
if (context === void 0) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : formatErrorMessage(65));
|
|
13429
|
+
return context;
|
|
13430
|
+
}
|
|
13431
|
+
//#endregion
|
|
13432
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/tab/TabsTab.js
|
|
13433
|
+
/**
|
|
13434
|
+
* An individual interactive tab button that toggles the corresponding panel.
|
|
13435
|
+
* Renders a `<button>` element.
|
|
13436
|
+
*
|
|
13437
|
+
* Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)
|
|
13438
|
+
*/
|
|
13439
|
+
var TabsTab = /*#__PURE__*/ React.forwardRef(function TabsTab(componentProps, forwardedRef) {
|
|
13440
|
+
const { className, disabled = false, render, value, id: idProp, nativeButton = true, style, ...elementProps } = componentProps;
|
|
13441
|
+
const { value: activeTabValue, getTabPanelIdByValue, orientation } = useTabsRootContext();
|
|
13442
|
+
const { activateOnFocus, highlightedTabIndex, onTabActivation, registerTabResizeObserverElement, setHighlightedTabIndex, tabsListElement } = useTabsListContext();
|
|
13443
|
+
const id = useBaseUiId(idProp);
|
|
13444
|
+
const { compositeProps, compositeRef, index } = useCompositeItem({ metadata: React.useMemo(() => ({
|
|
13445
|
+
disabled,
|
|
13446
|
+
id,
|
|
13447
|
+
value
|
|
13448
|
+
}), [
|
|
13449
|
+
disabled,
|
|
13450
|
+
id,
|
|
13451
|
+
value
|
|
13452
|
+
]) });
|
|
13453
|
+
const active = value === activeTabValue;
|
|
13454
|
+
const isNavigatingRef = React.useRef(false);
|
|
13455
|
+
const tabElementRef = React.useRef(null);
|
|
13456
|
+
React.useEffect(() => {
|
|
13457
|
+
const tabElement = tabElementRef.current;
|
|
13458
|
+
if (!tabElement) return;
|
|
13459
|
+
return registerTabResizeObserverElement(tabElement);
|
|
13460
|
+
}, [registerTabResizeObserverElement]);
|
|
13461
|
+
useIsoLayoutEffect(() => {
|
|
13462
|
+
if (isNavigatingRef.current) {
|
|
13463
|
+
isNavigatingRef.current = false;
|
|
13464
|
+
return;
|
|
13465
|
+
}
|
|
13466
|
+
if (!(active && index > -1 && highlightedTabIndex !== index)) return;
|
|
13467
|
+
const listElement = tabsListElement;
|
|
13468
|
+
if (listElement != null) {
|
|
13469
|
+
const activeEl = activeElement(ownerDocument(listElement));
|
|
13470
|
+
if (activeEl && contains(listElement, activeEl)) return;
|
|
13471
|
+
}
|
|
13472
|
+
if (!disabled) setHighlightedTabIndex(index);
|
|
13473
|
+
}, [
|
|
13474
|
+
active,
|
|
13475
|
+
index,
|
|
13476
|
+
highlightedTabIndex,
|
|
13477
|
+
setHighlightedTabIndex,
|
|
13478
|
+
disabled,
|
|
13479
|
+
tabsListElement
|
|
13480
|
+
]);
|
|
13481
|
+
const { getButtonProps, buttonRef } = useButton({
|
|
13482
|
+
disabled,
|
|
13483
|
+
native: nativeButton,
|
|
13484
|
+
focusableWhenDisabled: true
|
|
13485
|
+
});
|
|
13486
|
+
const tabPanelId = getTabPanelIdByValue(value);
|
|
13487
|
+
const isPressingRef = React.useRef(false);
|
|
13488
|
+
const isMainButtonRef = React.useRef(false);
|
|
13489
|
+
function onClick(event) {
|
|
13490
|
+
if (active || disabled) return;
|
|
13491
|
+
onTabActivation(value, createChangeEventDetails(none, event.nativeEvent, void 0, { activationDirection: "none" }));
|
|
13492
|
+
}
|
|
13493
|
+
function onFocus(event) {
|
|
13494
|
+
if (active) return;
|
|
13495
|
+
if (index > -1 && !disabled) setHighlightedTabIndex(index);
|
|
13496
|
+
if (disabled) return;
|
|
13497
|
+
if (activateOnFocus && (!isPressingRef.current || isPressingRef.current && isMainButtonRef.current)) onTabActivation(value, createChangeEventDetails(none, event.nativeEvent, void 0, { activationDirection: "none" }));
|
|
13498
|
+
}
|
|
13499
|
+
function onPointerDown(event) {
|
|
13500
|
+
if (active || disabled) return;
|
|
13501
|
+
isPressingRef.current = true;
|
|
13502
|
+
function handlePointerUp() {
|
|
13503
|
+
isPressingRef.current = false;
|
|
13504
|
+
isMainButtonRef.current = false;
|
|
13505
|
+
}
|
|
13506
|
+
if (!event.button || event.button === 0) {
|
|
13507
|
+
isMainButtonRef.current = true;
|
|
13508
|
+
ownerDocument(event.currentTarget).addEventListener("pointerup", handlePointerUp, { once: true });
|
|
13509
|
+
}
|
|
13510
|
+
}
|
|
13511
|
+
return useRenderElement("button", componentProps, {
|
|
13512
|
+
state: {
|
|
13513
|
+
disabled,
|
|
13514
|
+
active,
|
|
13515
|
+
orientation
|
|
13516
|
+
},
|
|
13517
|
+
ref: [
|
|
13518
|
+
forwardedRef,
|
|
13519
|
+
buttonRef,
|
|
13520
|
+
compositeRef,
|
|
13521
|
+
tabElementRef
|
|
13522
|
+
],
|
|
13523
|
+
props: [
|
|
13524
|
+
compositeProps,
|
|
13525
|
+
{
|
|
13526
|
+
role: "tab",
|
|
13527
|
+
"aria-controls": tabPanelId,
|
|
13528
|
+
"aria-selected": active,
|
|
13529
|
+
id,
|
|
13530
|
+
onClick,
|
|
13531
|
+
onFocus,
|
|
13532
|
+
onPointerDown,
|
|
13533
|
+
[ACTIVE_COMPOSITE_ITEM]: active ? "" : void 0,
|
|
13534
|
+
onKeyDownCapture() {
|
|
13535
|
+
isNavigatingRef.current = true;
|
|
13536
|
+
}
|
|
13537
|
+
},
|
|
13538
|
+
elementProps,
|
|
13539
|
+
getButtonProps
|
|
13540
|
+
]
|
|
13541
|
+
});
|
|
13542
|
+
});
|
|
13543
|
+
if (process.env.NODE_ENV !== "production") TabsTab.displayName = "TabsTab";
|
|
13544
|
+
//#endregion
|
|
13545
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/panel/TabsPanelDataAttributes.js
|
|
13546
|
+
var TabsPanelDataAttributes = function(TabsPanelDataAttributes) {
|
|
13547
|
+
/**
|
|
13548
|
+
* Indicates the index of the tab panel.
|
|
13549
|
+
*/
|
|
13550
|
+
TabsPanelDataAttributes["index"] = "data-index";
|
|
13551
|
+
/**
|
|
13552
|
+
* Indicates the direction of the activation (based on the previous active tab).
|
|
13553
|
+
* @type {'left' | 'right' | 'up' | 'down' | 'none'}
|
|
13554
|
+
*/
|
|
13555
|
+
TabsPanelDataAttributes["activationDirection"] = "data-activation-direction";
|
|
13556
|
+
/**
|
|
13557
|
+
* Indicates the orientation of the tabs.
|
|
13558
|
+
* @type {'horizontal' | 'vertical'}
|
|
13559
|
+
*/
|
|
13560
|
+
TabsPanelDataAttributes["orientation"] = "data-orientation";
|
|
13561
|
+
/**
|
|
13562
|
+
* Present when the panel is hidden.
|
|
13563
|
+
*/
|
|
13564
|
+
TabsPanelDataAttributes["hidden"] = "data-hidden";
|
|
13565
|
+
/**
|
|
13566
|
+
* Present when the panel is animating in.
|
|
13567
|
+
*/
|
|
13568
|
+
TabsPanelDataAttributes[TabsPanelDataAttributes["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle";
|
|
13569
|
+
/**
|
|
13570
|
+
* Present when the panel is animating out.
|
|
13571
|
+
*/
|
|
13572
|
+
TabsPanelDataAttributes[TabsPanelDataAttributes["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle";
|
|
13573
|
+
return TabsPanelDataAttributes;
|
|
13574
|
+
}({});
|
|
13575
|
+
//#endregion
|
|
13576
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/panel/TabsPanel.js
|
|
13577
|
+
var stateAttributesMapping = {
|
|
13578
|
+
...tabsStateAttributesMapping,
|
|
13579
|
+
...transitionStatusMapping
|
|
13580
|
+
};
|
|
13581
|
+
/**
|
|
13582
|
+
* A panel displayed when the corresponding tab is active.
|
|
13583
|
+
* Renders a `<div>` element.
|
|
13584
|
+
*
|
|
13585
|
+
* Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)
|
|
13586
|
+
*/
|
|
13587
|
+
var TabsPanel = /*#__PURE__*/ React.forwardRef(function TabPanel(componentProps, forwardedRef) {
|
|
13588
|
+
const { className, value, render, keepMounted = false, style, ...elementProps } = componentProps;
|
|
13589
|
+
const { value: selectedValue, getTabIdByPanelValue, orientation, tabActivationDirection, registerMountedTabPanel, unregisterMountedTabPanel } = useTabsRootContext();
|
|
13590
|
+
const id = useBaseUiId();
|
|
13591
|
+
const { ref: listItemRef, index } = useCompositeListItem({ metadata: React.useMemo(() => ({
|
|
13592
|
+
id,
|
|
13593
|
+
value
|
|
13594
|
+
}), [id, value]) });
|
|
13595
|
+
const open = value === selectedValue;
|
|
13596
|
+
const { mounted, transitionStatus, setMounted } = useTransitionStatus(open);
|
|
13597
|
+
const hidden = !mounted;
|
|
13598
|
+
const correspondingTabId = getTabIdByPanelValue(value);
|
|
13599
|
+
const state = {
|
|
13600
|
+
hidden,
|
|
13601
|
+
orientation,
|
|
13602
|
+
tabActivationDirection,
|
|
13603
|
+
transitionStatus
|
|
13604
|
+
};
|
|
13605
|
+
const panelRef = React.useRef(null);
|
|
13606
|
+
const element = useRenderElement("div", componentProps, {
|
|
13607
|
+
state,
|
|
13608
|
+
ref: [
|
|
13609
|
+
forwardedRef,
|
|
13610
|
+
listItemRef,
|
|
13611
|
+
panelRef
|
|
13612
|
+
],
|
|
13613
|
+
props: [{
|
|
13614
|
+
"aria-labelledby": correspondingTabId,
|
|
13615
|
+
hidden,
|
|
13616
|
+
id,
|
|
13617
|
+
role: "tabpanel",
|
|
13618
|
+
tabIndex: open ? 0 : -1,
|
|
13619
|
+
inert: inertValue(!open),
|
|
13620
|
+
[TabsPanelDataAttributes.index]: index
|
|
13621
|
+
}, elementProps],
|
|
13622
|
+
stateAttributesMapping
|
|
13623
|
+
});
|
|
13624
|
+
useOpenChangeComplete({
|
|
13625
|
+
open,
|
|
13626
|
+
ref: panelRef,
|
|
13627
|
+
onComplete() {
|
|
13628
|
+
if (!open) setMounted(false);
|
|
13629
|
+
}
|
|
13630
|
+
});
|
|
13631
|
+
useIsoLayoutEffect(() => {
|
|
13632
|
+
if (hidden && !keepMounted) return;
|
|
13633
|
+
if (id == null) return;
|
|
13634
|
+
registerMountedTabPanel(value, id);
|
|
13635
|
+
return () => {
|
|
13636
|
+
unregisterMountedTabPanel(value, id);
|
|
13637
|
+
};
|
|
13638
|
+
}, [
|
|
13639
|
+
hidden,
|
|
13640
|
+
keepMounted,
|
|
13641
|
+
value,
|
|
13642
|
+
id,
|
|
13643
|
+
registerMountedTabPanel,
|
|
13644
|
+
unregisterMountedTabPanel
|
|
13645
|
+
]);
|
|
13646
|
+
if (!(keepMounted || mounted)) return null;
|
|
13647
|
+
return element;
|
|
13648
|
+
});
|
|
13649
|
+
if (process.env.NODE_ENV !== "production") TabsPanel.displayName = "TabsPanel";
|
|
13650
|
+
//#endregion
|
|
13651
|
+
//#region ../../node_modules/.bun/@base-ui+utils@0.2.8+b87d06724be9db7a/node_modules/@base-ui/utils/esm/isElementDisabled.js
|
|
13652
|
+
function isElementDisabled(element) {
|
|
13653
|
+
return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
|
|
13654
|
+
}
|
|
13655
|
+
//#endregion
|
|
13656
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/internals/composite/root/useCompositeRoot.js
|
|
13657
|
+
var EMPTY_ARRAY = [];
|
|
13658
|
+
function useCompositeRoot(params) {
|
|
13659
|
+
const { itemSizes, cols = 1, loopFocus = true, onLoop, dense = false, orientation = "both", direction, highlightedIndex: externalHighlightedIndex, onHighlightedIndexChange: externalSetHighlightedIndex, rootRef: externalRef, enableHomeAndEndKeys = false, stopEventPropagation = false, disabledIndices, modifierKeys = EMPTY_ARRAY } = params;
|
|
13660
|
+
const [internalHighlightedIndex, internalSetHighlightedIndex] = React.useState(0);
|
|
13661
|
+
const isGrid = cols > 1;
|
|
13662
|
+
const rootRef = React.useRef(null);
|
|
13663
|
+
const mergedRef = useMergedRefs(rootRef, externalRef);
|
|
13664
|
+
const elementsRef = React.useRef([]);
|
|
13665
|
+
const hasSetDefaultIndexRef = React.useRef(false);
|
|
13666
|
+
const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;
|
|
13667
|
+
const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => {
|
|
13668
|
+
(externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index);
|
|
13669
|
+
if (shouldScrollIntoView) {
|
|
13670
|
+
const newActiveItem = elementsRef.current[index];
|
|
13671
|
+
scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);
|
|
13672
|
+
}
|
|
13673
|
+
});
|
|
13674
|
+
const onMapChange = useStableCallback((map) => {
|
|
13675
|
+
if (map.size === 0 || hasSetDefaultIndexRef.current) return;
|
|
13676
|
+
hasSetDefaultIndexRef.current = true;
|
|
13677
|
+
const sortedElements = Array.from(map.keys());
|
|
13678
|
+
const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute("data-composite-item-active")) ?? null;
|
|
13679
|
+
const activeIndex = activeItem ? sortedElements.indexOf(activeItem) : -1;
|
|
13680
|
+
if (activeIndex !== -1) onHighlightedIndexChange(activeIndex);
|
|
13681
|
+
scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation);
|
|
13682
|
+
});
|
|
13683
|
+
const wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => {
|
|
13684
|
+
if (!onLoop) return nextIndex;
|
|
13685
|
+
return onLoop?.(event, prevIndex, nextIndex, elementsRef);
|
|
13686
|
+
});
|
|
13687
|
+
const props = React.useMemo(() => ({
|
|
13688
|
+
"aria-orientation": orientation === "both" ? void 0 : orientation,
|
|
13689
|
+
ref: mergedRef,
|
|
13690
|
+
onFocus(event) {
|
|
13691
|
+
const element = rootRef.current;
|
|
13692
|
+
const target = getTarget(event.nativeEvent);
|
|
13693
|
+
if (!element || target == null || !isNativeInput(target)) return;
|
|
13694
|
+
target.setSelectionRange(0, target.value.length ?? 0);
|
|
13695
|
+
},
|
|
13696
|
+
onKeyDown(event) {
|
|
13697
|
+
const RELEVANT_KEYS = enableHomeAndEndKeys ? ALL_KEYS : ARROW_KEYS;
|
|
13698
|
+
if (!RELEVANT_KEYS.has(event.key)) return;
|
|
13699
|
+
if (isModifierKeySet(event, modifierKeys)) return;
|
|
13700
|
+
if (!rootRef.current) return;
|
|
13701
|
+
const isRtl = direction === "rtl";
|
|
13702
|
+
const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT;
|
|
13703
|
+
const forwardKey = {
|
|
13704
|
+
horizontal: horizontalForwardKey,
|
|
13705
|
+
vertical: ARROW_DOWN,
|
|
13706
|
+
both: horizontalForwardKey
|
|
13707
|
+
}[orientation];
|
|
13708
|
+
const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT;
|
|
13709
|
+
const backwardKey = {
|
|
13710
|
+
horizontal: horizontalBackwardKey,
|
|
13711
|
+
vertical: ARROW_UP,
|
|
13712
|
+
both: horizontalBackwardKey
|
|
13713
|
+
}[orientation];
|
|
13714
|
+
const target = getTarget(event.nativeEvent);
|
|
13715
|
+
if (target != null && isNativeInput(target) && !isElementDisabled(target)) {
|
|
13716
|
+
const selectionStart = target.selectionStart;
|
|
13717
|
+
const selectionEnd = target.selectionEnd;
|
|
13718
|
+
const textContent = target.value ?? "";
|
|
13719
|
+
if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) return;
|
|
13720
|
+
if (event.key !== backwardKey && selectionStart < textContent.length) return;
|
|
13721
|
+
if (event.key !== forwardKey && selectionStart > 0) return;
|
|
13722
|
+
}
|
|
13723
|
+
let nextIndex = highlightedIndex;
|
|
13724
|
+
const minIndex = getMinListIndex(elementsRef, disabledIndices);
|
|
13725
|
+
const maxIndex = getMaxListIndex(elementsRef, disabledIndices);
|
|
13726
|
+
if (isGrid) {
|
|
13727
|
+
const sizes = itemSizes || Array.from({ length: elementsRef.current.length }, () => ({
|
|
13728
|
+
width: 1,
|
|
13729
|
+
height: 1
|
|
13730
|
+
}));
|
|
13731
|
+
const cellMap = createGridCellMap(sizes, cols, dense);
|
|
13732
|
+
const minGridIndex = cellMap.findIndex((index) => index != null && !isListIndexDisabled(elementsRef.current, index, disabledIndices));
|
|
13733
|
+
const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isListIndexDisabled(elementsRef.current, index, disabledIndices) ? cellIndex : foundIndex, -1);
|
|
13734
|
+
nextIndex = cellMap[getGridNavigatedIndex(cellMap.map((itemIndex) => itemIndex != null ? elementsRef.current[itemIndex] : null), {
|
|
13735
|
+
event,
|
|
13736
|
+
orientation,
|
|
13737
|
+
loopFocus,
|
|
13738
|
+
onLoop: wrappedOnLoop,
|
|
13739
|
+
cols,
|
|
13740
|
+
disabledIndices: getGridCellIndices([...disabledIndices || elementsRef.current.map((_, index) => isListIndexDisabled(elementsRef.current, index) ? index : void 0), void 0], cellMap),
|
|
13741
|
+
minIndex: minGridIndex,
|
|
13742
|
+
maxIndex: maxGridIndex,
|
|
13743
|
+
prevIndex: getGridCellIndexOfCorner(highlightedIndex > maxIndex ? minIndex : highlightedIndex, sizes, cellMap, cols, event.key === "ArrowDown" ? "bl" : event.key === "ArrowRight" ? "tr" : "tl"),
|
|
13744
|
+
rtl: isRtl
|
|
13745
|
+
})];
|
|
13746
|
+
}
|
|
13747
|
+
const forwardKeys = {
|
|
13748
|
+
horizontal: [horizontalForwardKey],
|
|
13749
|
+
vertical: [ARROW_DOWN],
|
|
13750
|
+
both: [horizontalForwardKey, ARROW_DOWN]
|
|
13751
|
+
}[orientation];
|
|
13752
|
+
const backwardKeys = {
|
|
13753
|
+
horizontal: [horizontalBackwardKey],
|
|
13754
|
+
vertical: [ARROW_UP],
|
|
13755
|
+
both: [horizontalBackwardKey, ARROW_UP]
|
|
13756
|
+
}[orientation];
|
|
13757
|
+
const preventedKeys = isGrid ? RELEVANT_KEYS : {
|
|
13758
|
+
horizontal: enableHomeAndEndKeys ? HORIZONTAL_KEYS_WITH_EXTRA_KEYS : HORIZONTAL_KEYS,
|
|
13759
|
+
vertical: enableHomeAndEndKeys ? VERTICAL_KEYS_WITH_EXTRA_KEYS : VERTICAL_KEYS,
|
|
13760
|
+
both: RELEVANT_KEYS
|
|
13761
|
+
}[orientation];
|
|
13762
|
+
if (enableHomeAndEndKeys) {
|
|
13763
|
+
if (event.key === "Home") nextIndex = minIndex;
|
|
13764
|
+
else if (event.key === "End") nextIndex = maxIndex;
|
|
13765
|
+
}
|
|
13766
|
+
if (nextIndex === highlightedIndex && (forwardKeys.includes(event.key) || backwardKeys.includes(event.key))) {
|
|
13767
|
+
if (loopFocus && nextIndex === maxIndex && forwardKeys.includes(event.key)) {
|
|
13768
|
+
nextIndex = minIndex;
|
|
13769
|
+
if (onLoop) nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
|
|
13770
|
+
} else if (loopFocus && nextIndex === minIndex && backwardKeys.includes(event.key)) {
|
|
13771
|
+
nextIndex = maxIndex;
|
|
13772
|
+
if (onLoop) nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
|
|
13773
|
+
} else nextIndex = findNonDisabledListIndex(elementsRef.current, {
|
|
13774
|
+
startingIndex: nextIndex,
|
|
13775
|
+
decrement: backwardKeys.includes(event.key),
|
|
13776
|
+
disabledIndices
|
|
13777
|
+
});
|
|
13778
|
+
}
|
|
13779
|
+
if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) {
|
|
13780
|
+
if (stopEventPropagation) event.stopPropagation();
|
|
13781
|
+
if (preventedKeys.has(event.key)) event.preventDefault();
|
|
13782
|
+
onHighlightedIndexChange(nextIndex, true);
|
|
13783
|
+
queueMicrotask(() => {
|
|
13784
|
+
elementsRef.current[nextIndex]?.focus();
|
|
13785
|
+
});
|
|
13786
|
+
}
|
|
13787
|
+
}
|
|
13788
|
+
}), [
|
|
13789
|
+
cols,
|
|
13790
|
+
dense,
|
|
13791
|
+
direction,
|
|
13792
|
+
disabledIndices,
|
|
13793
|
+
elementsRef,
|
|
13794
|
+
enableHomeAndEndKeys,
|
|
13795
|
+
highlightedIndex,
|
|
13796
|
+
isGrid,
|
|
13797
|
+
itemSizes,
|
|
13798
|
+
loopFocus,
|
|
13799
|
+
onLoop,
|
|
13800
|
+
wrappedOnLoop,
|
|
13801
|
+
mergedRef,
|
|
13802
|
+
modifierKeys,
|
|
13803
|
+
onHighlightedIndexChange,
|
|
13804
|
+
orientation,
|
|
13805
|
+
stopEventPropagation
|
|
13806
|
+
]);
|
|
13807
|
+
return React.useMemo(() => ({
|
|
13808
|
+
props,
|
|
13809
|
+
highlightedIndex,
|
|
13810
|
+
onHighlightedIndexChange,
|
|
13811
|
+
elementsRef,
|
|
13812
|
+
disabledIndices,
|
|
13813
|
+
onMapChange,
|
|
13814
|
+
relayKeyboardEvent: props.onKeyDown
|
|
13815
|
+
}), [
|
|
13816
|
+
props,
|
|
13817
|
+
highlightedIndex,
|
|
13818
|
+
onHighlightedIndexChange,
|
|
13819
|
+
elementsRef,
|
|
13820
|
+
disabledIndices,
|
|
13821
|
+
onMapChange
|
|
13822
|
+
]);
|
|
13823
|
+
}
|
|
13824
|
+
function isModifierKeySet(event, ignoredModifierKeys) {
|
|
13825
|
+
for (const key of MODIFIER_KEYS.values()) {
|
|
13826
|
+
if (ignoredModifierKeys.includes(key)) continue;
|
|
13827
|
+
if (event.getModifierState(key)) return true;
|
|
13828
|
+
}
|
|
13829
|
+
return false;
|
|
13830
|
+
}
|
|
13831
|
+
//#endregion
|
|
13832
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/internals/composite/root/CompositeRoot.js
|
|
13833
|
+
/**
|
|
13834
|
+
* @internal
|
|
13835
|
+
*/
|
|
13836
|
+
function CompositeRoot(componentProps) {
|
|
13837
|
+
const { render, className, style, refs = EMPTY_ARRAY$1, props = EMPTY_ARRAY$1, state = EMPTY_OBJECT, stateAttributesMapping, highlightedIndex: highlightedIndexProp, onHighlightedIndexChange: onHighlightedIndexChangeProp, orientation, dense, itemSizes, loopFocus, onLoop, cols, enableHomeAndEndKeys, onMapChange: onMapChangeProp, stopEventPropagation = true, rootRef, disabledIndices, modifierKeys, highlightItemOnHover = false, tag = "div", ...elementProps } = componentProps;
|
|
13838
|
+
const { props: defaultProps, highlightedIndex, onHighlightedIndexChange, elementsRef, onMapChange: onMapChangeUnwrapped, relayKeyboardEvent } = useCompositeRoot({
|
|
13839
|
+
itemSizes,
|
|
13840
|
+
cols,
|
|
13841
|
+
loopFocus,
|
|
13842
|
+
onLoop,
|
|
13843
|
+
dense,
|
|
13844
|
+
orientation,
|
|
13845
|
+
highlightedIndex: highlightedIndexProp,
|
|
13846
|
+
onHighlightedIndexChange: onHighlightedIndexChangeProp,
|
|
13847
|
+
rootRef,
|
|
13848
|
+
stopEventPropagation,
|
|
13849
|
+
enableHomeAndEndKeys,
|
|
13850
|
+
direction: useDirection(),
|
|
13851
|
+
disabledIndices,
|
|
13852
|
+
modifierKeys
|
|
13853
|
+
});
|
|
13854
|
+
const element = useRenderElement(tag, componentProps, {
|
|
13855
|
+
state,
|
|
13856
|
+
ref: refs,
|
|
13857
|
+
props: [
|
|
13858
|
+
defaultProps,
|
|
13859
|
+
...props,
|
|
13860
|
+
elementProps
|
|
13861
|
+
],
|
|
13862
|
+
stateAttributesMapping
|
|
13863
|
+
});
|
|
13864
|
+
const contextValue = React.useMemo(() => ({
|
|
13865
|
+
highlightedIndex,
|
|
13866
|
+
onHighlightedIndexChange,
|
|
13867
|
+
highlightItemOnHover,
|
|
13868
|
+
relayKeyboardEvent
|
|
13869
|
+
}), [
|
|
13870
|
+
highlightedIndex,
|
|
13871
|
+
onHighlightedIndexChange,
|
|
13872
|
+
highlightItemOnHover,
|
|
13873
|
+
relayKeyboardEvent
|
|
13874
|
+
]);
|
|
13875
|
+
return /*#__PURE__*/ jsx(CompositeRootContext.Provider, {
|
|
13876
|
+
value: contextValue,
|
|
13877
|
+
children: /*#__PURE__*/ jsx(CompositeList, {
|
|
13878
|
+
elementsRef,
|
|
13879
|
+
onMapChange: (newMap) => {
|
|
13880
|
+
onMapChangeProp?.(newMap);
|
|
13881
|
+
onMapChangeUnwrapped(newMap);
|
|
13882
|
+
},
|
|
13883
|
+
children: element
|
|
13884
|
+
})
|
|
13885
|
+
});
|
|
13886
|
+
}
|
|
13887
|
+
//#endregion
|
|
13888
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/list/TabsList.js
|
|
13889
|
+
/**
|
|
13890
|
+
* Groups the individual tab buttons.
|
|
13891
|
+
* Renders a `<div>` element.
|
|
13892
|
+
*
|
|
13893
|
+
* Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)
|
|
13894
|
+
*/
|
|
13895
|
+
var TabsList$2 = /*#__PURE__*/ React.forwardRef(function TabsList(componentProps, forwardedRef) {
|
|
13896
|
+
const { activateOnFocus = false, className, loopFocus = true, render, style, ...elementProps } = componentProps;
|
|
13897
|
+
const { onValueChange, orientation, value, setTabMap, tabActivationDirection } = useTabsRootContext();
|
|
13898
|
+
const [highlightedTabIndex, setHighlightedTabIndex] = React.useState(0);
|
|
13899
|
+
const [tabsListElement, setTabsListElement] = React.useState(null);
|
|
13900
|
+
const indicatorUpdateListenersRef = React.useRef(/* @__PURE__ */ new Set());
|
|
13901
|
+
const tabResizeObserverElementsRef = React.useRef(/* @__PURE__ */ new Set());
|
|
13902
|
+
const resizeObserverRef = React.useRef(null);
|
|
13903
|
+
const notifyIndicatorUpdateListeners = useStableCallback(() => {
|
|
13904
|
+
indicatorUpdateListenersRef.current.forEach((listener) => {
|
|
13905
|
+
listener();
|
|
13906
|
+
});
|
|
13907
|
+
});
|
|
13908
|
+
React.useEffect(() => {
|
|
13909
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
13910
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
13911
|
+
if (!indicatorUpdateListenersRef.current.size) return;
|
|
13912
|
+
notifyIndicatorUpdateListeners();
|
|
13913
|
+
});
|
|
13914
|
+
resizeObserverRef.current = resizeObserver;
|
|
13915
|
+
if (tabsListElement) resizeObserver.observe(tabsListElement);
|
|
13916
|
+
tabResizeObserverElementsRef.current.forEach((element) => {
|
|
13917
|
+
resizeObserver.observe(element);
|
|
13918
|
+
});
|
|
13919
|
+
return () => {
|
|
13920
|
+
resizeObserver.disconnect();
|
|
13921
|
+
resizeObserverRef.current = null;
|
|
13922
|
+
};
|
|
13923
|
+
}, [tabsListElement, notifyIndicatorUpdateListeners]);
|
|
13924
|
+
const registerIndicatorUpdateListener = useStableCallback((listener) => {
|
|
13925
|
+
indicatorUpdateListenersRef.current.add(listener);
|
|
13926
|
+
return () => {
|
|
13927
|
+
indicatorUpdateListenersRef.current.delete(listener);
|
|
13928
|
+
};
|
|
13929
|
+
});
|
|
13930
|
+
const registerTabResizeObserverElement = useStableCallback((element) => {
|
|
13931
|
+
tabResizeObserverElementsRef.current.add(element);
|
|
13932
|
+
resizeObserverRef.current?.observe(element);
|
|
13933
|
+
return () => {
|
|
13934
|
+
tabResizeObserverElementsRef.current.delete(element);
|
|
13935
|
+
resizeObserverRef.current?.unobserve(element);
|
|
13936
|
+
};
|
|
13937
|
+
});
|
|
13938
|
+
const onTabActivation = useStableCallback((newValue, eventDetails) => {
|
|
13939
|
+
if (newValue !== value) onValueChange(newValue, eventDetails);
|
|
13940
|
+
});
|
|
13941
|
+
const state = {
|
|
13942
|
+
orientation,
|
|
13943
|
+
tabActivationDirection
|
|
13944
|
+
};
|
|
13945
|
+
const defaultProps = {
|
|
13946
|
+
"aria-orientation": orientation === "vertical" ? "vertical" : void 0,
|
|
13947
|
+
role: "tablist"
|
|
13948
|
+
};
|
|
13949
|
+
const tabsListContextValue = React.useMemo(() => ({
|
|
13950
|
+
activateOnFocus,
|
|
13951
|
+
highlightedTabIndex,
|
|
13952
|
+
registerIndicatorUpdateListener,
|
|
13953
|
+
registerTabResizeObserverElement,
|
|
13954
|
+
onTabActivation,
|
|
13955
|
+
setHighlightedTabIndex,
|
|
13956
|
+
tabsListElement
|
|
13957
|
+
}), [
|
|
13958
|
+
activateOnFocus,
|
|
13959
|
+
highlightedTabIndex,
|
|
13960
|
+
registerIndicatorUpdateListener,
|
|
13961
|
+
registerTabResizeObserverElement,
|
|
13962
|
+
onTabActivation,
|
|
13963
|
+
setHighlightedTabIndex,
|
|
13964
|
+
tabsListElement
|
|
13965
|
+
]);
|
|
13966
|
+
return /*#__PURE__*/ jsx(TabsListContext.Provider, {
|
|
13967
|
+
value: tabsListContextValue,
|
|
13968
|
+
children: /*#__PURE__*/ jsx(CompositeRoot, {
|
|
13969
|
+
render,
|
|
13970
|
+
className,
|
|
13971
|
+
style,
|
|
13972
|
+
state,
|
|
13973
|
+
refs: [forwardedRef, setTabsListElement],
|
|
13974
|
+
props: [defaultProps, elementProps],
|
|
13975
|
+
stateAttributesMapping: tabsStateAttributesMapping,
|
|
13976
|
+
highlightedIndex: highlightedTabIndex,
|
|
13977
|
+
enableHomeAndEndKeys: true,
|
|
13978
|
+
loopFocus,
|
|
13979
|
+
orientation,
|
|
13980
|
+
onHighlightedIndexChange: setHighlightedTabIndex,
|
|
13981
|
+
onMapChange: setTabMap,
|
|
13982
|
+
disabledIndices: EMPTY_ARRAY$1
|
|
13983
|
+
})
|
|
13984
|
+
});
|
|
13985
|
+
});
|
|
13986
|
+
if (process.env.NODE_ENV !== "production") TabsList$2.displayName = "TabsList";
|
|
13987
|
+
//#endregion
|
|
13988
|
+
//#region src/ui/browser/tabs.tsx
|
|
13989
|
+
function Tabs$1({ className, orientation = "horizontal", ...props }) {
|
|
13990
|
+
return /* @__PURE__ */ jsx(TabsRoot, {
|
|
13991
|
+
"data-slot": "tabs",
|
|
13992
|
+
"data-orientation": orientation,
|
|
13993
|
+
className: cn("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col", className),
|
|
13994
|
+
orientation,
|
|
13995
|
+
...props
|
|
13996
|
+
});
|
|
13997
|
+
}
|
|
13998
|
+
var tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg text-muted-foreground group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
13999
|
+
variants: {
|
|
14000
|
+
size: {
|
|
14001
|
+
default: "p-[3px] group-data-[orientation=horizontal]/tabs:h-8",
|
|
14002
|
+
sm: "rounded-[6px] p-0.5 group-data-[orientation=horizontal]/tabs:h-6"
|
|
14003
|
+
},
|
|
14004
|
+
variant: {
|
|
14005
|
+
default: "bg-muted",
|
|
14006
|
+
line: "gap-1 bg-transparent",
|
|
14007
|
+
navigation: "gap-1 bg-transparent data-[variant=navigation]:p-0 group-data-[orientation=horizontal]/tabs:data-[variant=navigation]:h-auto",
|
|
14008
|
+
flat: "gap-1 bg-[color-mix(in_srgb,var(--ui-foreground)_8%,var(--ui-popover))] dark:bg-[color-mix(in_srgb,black_16%,var(--ui-popover))]"
|
|
14009
|
+
}
|
|
14010
|
+
},
|
|
14011
|
+
defaultVariants: {
|
|
14012
|
+
size: "default",
|
|
14013
|
+
variant: "default"
|
|
14014
|
+
}
|
|
14015
|
+
});
|
|
14016
|
+
function TabsList$1({ className, variant = "default", size = "default", ...props }) {
|
|
14017
|
+
return /* @__PURE__ */ jsx(TabsList$2, {
|
|
14018
|
+
"data-slot": "tabs-list",
|
|
14019
|
+
"data-variant": variant,
|
|
14020
|
+
"data-size": size,
|
|
14021
|
+
className: cn(tabsListVariants({
|
|
14022
|
+
variant,
|
|
14023
|
+
size
|
|
14024
|
+
}), className),
|
|
14025
|
+
...props
|
|
14026
|
+
});
|
|
14027
|
+
}
|
|
14028
|
+
function TabsTrigger$1({ className, ...props }) {
|
|
14029
|
+
return /* @__PURE__ */ jsx(TabsTab, {
|
|
14030
|
+
"data-slot": "tabs-trigger",
|
|
14031
|
+
className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-[color,background-color,border-color,box-shadow,opacity] group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-border focus-visible:outline-2 focus-visible:outline-solid focus-visible:ring-0 focus-visible:aria-invalid:ring-0 focus-visible:outline-offset-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "group-data-[variant=navigation]/tabs-list:h-auto group-data-[variant=navigation]/tabs-list:flex-none group-data-[variant=navigation]/tabs-list:rounded-[6px] group-data-[variant=navigation]/tabs-list:border-0 group-data-[variant=navigation]/tabs-list:px-3 group-data-[variant=navigation]/tabs-list:py-2 group-data-[variant=navigation]/tabs-list:text-[13px] group-data-[variant=navigation]/tabs-list:font-normal group-data-[variant=navigation]/tabs-list:text-muted-foreground group-data-[variant=navigation]/tabs-list:hover:bg-muted group-data-[variant=navigation]/tabs-list:hover:text-foreground group-data-[variant=navigation]/tabs-list:data-active:bg-muted group-data-[variant=navigation]/tabs-list:data-active:font-semibold group-data-[variant=navigation]/tabs-list:data-active:text-foreground dark:group-data-[variant=navigation]/tabs-list:data-active:bg-muted dark:group-data-[variant=navigation]/tabs-list:data-active:text-foreground", "group-data-[variant=flat]/tabs-list:h-full group-data-[variant=flat]/tabs-list:border-0 group-data-[variant=flat]/tabs-list:data-active:bg-popover group-data-[variant=flat]/tabs-list:data-active:shadow-[0_1px_2px_rgb(0_0_0/0.08)] dark:group-data-[variant=flat]/tabs-list:data-active:bg-[color-mix(in_srgb,var(--ui-foreground)_8%,var(--ui-popover))]", "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100 motion-reduce:after:transition-none", "group-data-[size=sm]/tabs-list:rounded-[4px] group-data-[size=sm]/tabs-list:gap-1 group-data-[size=sm]/tabs-list:py-0 group-data-[size=sm]/tabs-list:text-[11px] group-data-[size=sm]/tabs-list:leading-4 group-data-[orientation=horizontal]/tabs:group-data-[size=sm]/tabs-list:after:bottom-[-4px]", "group-data-[variant=navigation]/tabs-list:group-data-[size=sm]/tabs-list:rounded-[4px] group-data-[variant=navigation]/tabs-list:group-data-[size=sm]/tabs-list:px-2 group-data-[variant=navigation]/tabs-list:group-data-[size=sm]/tabs-list:py-1 group-data-[variant=navigation]/tabs-list:group-data-[size=sm]/tabs-list:text-[12px]", className),
|
|
14032
|
+
...props
|
|
14033
|
+
});
|
|
14034
|
+
}
|
|
14035
|
+
function TabsContent$1({ className, ...props }) {
|
|
14036
|
+
return /* @__PURE__ */ jsx(TabsPanel, {
|
|
14037
|
+
"data-slot": "tabs-content",
|
|
14038
|
+
className: cn("flex-1 text-sm outline-none", className),
|
|
14039
|
+
...props
|
|
14040
|
+
});
|
|
14041
|
+
}
|
|
14042
|
+
//#endregion
|
|
12644
14043
|
//#region src/ui/browser/label.tsx
|
|
12645
14044
|
function Label({ className, ...props }) {
|
|
12646
14045
|
return /* @__PURE__ */ jsx("label", {
|
|
@@ -12876,6 +14275,10 @@ var DialogHeader = DialogHeader$1;
|
|
|
12876
14275
|
var DialogFooter = DialogFooter$1;
|
|
12877
14276
|
var DialogTitle = DialogTitle$1;
|
|
12878
14277
|
var DialogDescription = DialogDescription$1;
|
|
14278
|
+
var Tabs = Tabs$1;
|
|
14279
|
+
var TabsList = TabsList$1;
|
|
14280
|
+
var TabsTrigger = TabsTrigger$1;
|
|
14281
|
+
var TabsContent = TabsContent$1;
|
|
12879
14282
|
var InputGroup = InputGroup$1;
|
|
12880
14283
|
var InputGroupAddon = InputGroupAddon$1;
|
|
12881
14284
|
var InputGroupInput = InputGroupInput$1;
|
|
@@ -12916,4 +14319,4 @@ function NotificationUndoLabel({ children }) {
|
|
|
12916
14319
|
}), children);
|
|
12917
14320
|
}
|
|
12918
14321
|
//#endregion
|
|
12919
|
-
export { Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, HostNavigationActions, HostTooltip, IdTooltip, Input, InputGroup, InputGroupAddon, InputGroupInput, Label, NativeSelect, NativeSelectOption, NotificationUndoLabel, OpenFlowLogo, Textarea, notificationToasterProps };
|
|
14322
|
+
export { Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, HostNavigationActions, HostTooltip, IdTooltip, Input, InputGroup, InputGroupAddon, InputGroupInput, Label, NativeSelect, NativeSelectOption, NotificationUndoLabel, OpenFlowLogo, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, notificationToasterProps };
|