design-zystem 1.0.432 → 1.0.434
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/ui/index.js +256 -181
- package/dist/ui/index.mjs +104 -29
- package/package.json +2 -1
package/dist/ui/index.js
CHANGED
|
@@ -2264,8 +2264,9 @@ var Tabs = ({
|
|
|
2264
2264
|
};
|
|
2265
2265
|
|
|
2266
2266
|
// src/ui/components/ui/Modal.tsx
|
|
2267
|
-
var
|
|
2267
|
+
var import_react23 = require("react");
|
|
2268
2268
|
var RadixDialog = __toESM(require("@radix-ui/react-dialog"));
|
|
2269
|
+
var import_react_dismissable_layer = require("@radix-ui/react-dismissable-layer");
|
|
2269
2270
|
|
|
2270
2271
|
// src/ui/lib/layers.ts
|
|
2271
2272
|
var MODAL_LAYER = "z-[1000]";
|
|
@@ -2293,9 +2294,62 @@ var useAllowPortalScroll = (active, contentRef, overlayRef) => {
|
|
|
2293
2294
|
}, [active, contentRef, overlayRef]);
|
|
2294
2295
|
};
|
|
2295
2296
|
|
|
2297
|
+
// src/ui/lib/layerAbove/bodyChildContaining.ts
|
|
2298
|
+
var bodyChildContaining = (node) => {
|
|
2299
|
+
let current = node;
|
|
2300
|
+
while (current && current.parentNode !== document.body)
|
|
2301
|
+
current = current.parentNode;
|
|
2302
|
+
return current;
|
|
2303
|
+
};
|
|
2304
|
+
|
|
2305
|
+
// src/ui/lib/layerAbove/isMountedAbove.ts
|
|
2306
|
+
var isMountedAbove = (target, panel) => {
|
|
2307
|
+
const targetLayer = target instanceof Node && bodyChildContaining(target);
|
|
2308
|
+
const panelLayer = panel && bodyChildContaining(panel);
|
|
2309
|
+
if (!targetLayer || !panelLayer || targetLayer === panelLayer) return false;
|
|
2310
|
+
return Boolean(
|
|
2311
|
+
panelLayer.compareDocumentPosition(targetLayer) & Node.DOCUMENT_POSITION_FOLLOWING
|
|
2312
|
+
);
|
|
2313
|
+
};
|
|
2314
|
+
|
|
2315
|
+
// src/ui/lib/layerAbove/useKeepLayersAboveUsable.ts
|
|
2316
|
+
var import_react22 = require("react");
|
|
2317
|
+
var useKeepLayersAboveUsable = (active, contentRef) => {
|
|
2318
|
+
(0, import_react22.useEffect)(() => {
|
|
2319
|
+
if (!active) return;
|
|
2320
|
+
const isThirdPartyLayerAbove = (node) => node instanceof Element && !node.closest(SELF_FOCUS_MANAGING_LAYER) && isMountedAbove(node, contentRef.current);
|
|
2321
|
+
const keepFocusAbove = (event) => {
|
|
2322
|
+
const focusDestination = event.type === "focusin" ? event.target : event.relatedTarget;
|
|
2323
|
+
if (isThirdPartyLayerAbove(focusDestination)) event.stopPropagation();
|
|
2324
|
+
};
|
|
2325
|
+
const releasedLayers = /* @__PURE__ */ new Set();
|
|
2326
|
+
const releasePointerOnLayersAbove = () => Array.from(document.body.children).forEach((layer) => {
|
|
2327
|
+
const isUntouchedLayerAbove = layer instanceof HTMLElement && !layer.style.pointerEvents && isMountedAbove(layer, contentRef.current);
|
|
2328
|
+
if (!isUntouchedLayerAbove) return;
|
|
2329
|
+
layer.style.pointerEvents = "auto";
|
|
2330
|
+
releasedLayers.add(layer);
|
|
2331
|
+
});
|
|
2332
|
+
releasePointerOnLayersAbove();
|
|
2333
|
+
const observer = new MutationObserver(releasePointerOnLayersAbove);
|
|
2334
|
+
observer.observe(document.body, { childList: true });
|
|
2335
|
+
FOCUS_EVENTS.forEach(
|
|
2336
|
+
(type) => document.body.addEventListener(type, keepFocusAbove)
|
|
2337
|
+
);
|
|
2338
|
+
return () => {
|
|
2339
|
+
observer.disconnect();
|
|
2340
|
+
releasedLayers.forEach((layer) => layer.style.pointerEvents = "");
|
|
2341
|
+
FOCUS_EVENTS.forEach(
|
|
2342
|
+
(type) => document.body.removeEventListener(type, keepFocusAbove)
|
|
2343
|
+
);
|
|
2344
|
+
};
|
|
2345
|
+
}, [active, contentRef]);
|
|
2346
|
+
};
|
|
2347
|
+
var FOCUS_EVENTS = ["focusin", "focusout"];
|
|
2348
|
+
var SELF_FOCUS_MANAGING_LAYER = '[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]';
|
|
2349
|
+
|
|
2296
2350
|
// src/ui/components/ui/Modal.tsx
|
|
2297
2351
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2298
|
-
var ModalDragContext = (0,
|
|
2352
|
+
var ModalDragContext = (0, import_react23.createContext)({
|
|
2299
2353
|
draggable: false,
|
|
2300
2354
|
isDragging: false,
|
|
2301
2355
|
startDrag: () => {
|
|
@@ -2311,16 +2365,19 @@ var Modal = ({
|
|
|
2311
2365
|
className,
|
|
2312
2366
|
overlayClassName
|
|
2313
2367
|
}) => {
|
|
2314
|
-
const [isDragging, setIsDragging] = (0,
|
|
2315
|
-
const [offset, setOffset] = (0,
|
|
2316
|
-
const lastPointRef = (0,
|
|
2317
|
-
const contentRef = (0,
|
|
2318
|
-
const overlayRef = (0,
|
|
2368
|
+
const [isDragging, setIsDragging] = (0, import_react23.useState)(false);
|
|
2369
|
+
const [offset, setOffset] = (0, import_react23.useState)({ x: 0, y: 0 });
|
|
2370
|
+
const lastPointRef = (0, import_react23.useRef)({ x: 0, y: 0 });
|
|
2371
|
+
const contentRef = (0, import_react23.useRef)(null);
|
|
2372
|
+
const overlayRef = (0, import_react23.useRef)(null);
|
|
2373
|
+
const markOverlaySurface = (0, import_react_dismissable_layer.useDismissableLayerSurface)();
|
|
2374
|
+
const markContentSurface = (0, import_react_dismissable_layer.useDismissableLayerSurface)();
|
|
2319
2375
|
useAllowPortalScroll(open, contentRef, overlayRef);
|
|
2320
|
-
(
|
|
2376
|
+
useKeepLayersAboveUsable(open, contentRef);
|
|
2377
|
+
(0, import_react23.useEffect)(() => {
|
|
2321
2378
|
if (open) setOffset({ x: 0, y: 0 });
|
|
2322
2379
|
}, [open]);
|
|
2323
|
-
(0,
|
|
2380
|
+
(0, import_react23.useEffect)(() => {
|
|
2324
2381
|
if (!draggable || !isDragging) return;
|
|
2325
2382
|
const onPointerMove = (e) => {
|
|
2326
2383
|
const dx = e.clientX - lastPointRef.current.x;
|
|
@@ -2352,7 +2409,10 @@ var Modal = ({
|
|
|
2352
2409
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2353
2410
|
RadixDialog.Overlay,
|
|
2354
2411
|
{
|
|
2355
|
-
ref:
|
|
2412
|
+
ref: (node) => {
|
|
2413
|
+
overlayRef.current = node;
|
|
2414
|
+
markOverlaySurface(node);
|
|
2415
|
+
},
|
|
2356
2416
|
"data-drawer-keep-open": true,
|
|
2357
2417
|
onClick: (event) => event.stopPropagation(),
|
|
2358
2418
|
className: cn(
|
|
@@ -2366,8 +2426,15 @@ var Modal = ({
|
|
|
2366
2426
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2367
2427
|
RadixDialog.Content,
|
|
2368
2428
|
{
|
|
2369
|
-
ref:
|
|
2429
|
+
ref: (node) => {
|
|
2430
|
+
contentRef.current = node;
|
|
2431
|
+
markContentSurface(node);
|
|
2432
|
+
},
|
|
2370
2433
|
onOpenAutoFocus,
|
|
2434
|
+
onInteractOutside: (event) => {
|
|
2435
|
+
if (isMountedAbove(event.target, contentRef.current))
|
|
2436
|
+
event.preventDefault();
|
|
2437
|
+
},
|
|
2371
2438
|
onClick: (event) => event.stopPropagation(),
|
|
2372
2439
|
className: cn(
|
|
2373
2440
|
MODAL_LAYER,
|
|
@@ -2400,7 +2467,7 @@ var ModalHeader = (_a) => {
|
|
|
2400
2467
|
} = _b, props = __objRest(_b, [
|
|
2401
2468
|
"className"
|
|
2402
2469
|
]);
|
|
2403
|
-
const { draggable, isDragging, startDrag } = (0,
|
|
2470
|
+
const { draggable, isDragging, startDrag } = (0, import_react23.useContext)(ModalDragContext);
|
|
2404
2471
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2405
2472
|
"div",
|
|
2406
2473
|
__spreadValues({
|
|
@@ -2460,7 +2527,7 @@ var ModalFooter = (_a) => {
|
|
|
2460
2527
|
var ModalClose = RadixDialog.Close;
|
|
2461
2528
|
|
|
2462
2529
|
// src/ui/components/ui/Select.tsx
|
|
2463
|
-
var
|
|
2530
|
+
var import_react24 = require("react");
|
|
2464
2531
|
var RadixSelect2 = __toESM(require("@radix-ui/react-select"));
|
|
2465
2532
|
var RadixPopover = __toESM(require("@radix-ui/react-popover"));
|
|
2466
2533
|
|
|
@@ -2622,12 +2689,12 @@ var SelectField = (props) => {
|
|
|
2622
2689
|
hideSearchBar = false,
|
|
2623
2690
|
className
|
|
2624
2691
|
} = props;
|
|
2625
|
-
const [open, setOpen] = (0,
|
|
2626
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2627
|
-
const searchInputRef = (0,
|
|
2692
|
+
const [open, setOpen] = (0, import_react24.useState)(false);
|
|
2693
|
+
const [searchTerm, setSearchTerm] = (0, import_react24.useState)("");
|
|
2694
|
+
const searchInputRef = (0, import_react24.useRef)(null);
|
|
2628
2695
|
const sections = filterSelectItems(options, searchTerm);
|
|
2629
2696
|
const isEmpty = sections.length === 0;
|
|
2630
|
-
(0,
|
|
2697
|
+
(0, import_react24.useEffect)(() => {
|
|
2631
2698
|
if (open && !hideSearchBar) {
|
|
2632
2699
|
const id = requestAnimationFrame(() => {
|
|
2633
2700
|
var _a;
|
|
@@ -2851,7 +2918,7 @@ var Select = (props) => {
|
|
|
2851
2918
|
};
|
|
2852
2919
|
|
|
2853
2920
|
// src/ui/components/ui/TagSelect.tsx
|
|
2854
|
-
var
|
|
2921
|
+
var import_react25 = require("react");
|
|
2855
2922
|
var RadixPopover2 = __toESM(require("@radix-ui/react-popover"));
|
|
2856
2923
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2857
2924
|
var TagSelect = ({
|
|
@@ -2864,9 +2931,9 @@ var TagSelect = ({
|
|
|
2864
2931
|
width,
|
|
2865
2932
|
className
|
|
2866
2933
|
}) => {
|
|
2867
|
-
const [open, setOpen] = (0,
|
|
2868
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2869
|
-
const inputRef = (0,
|
|
2934
|
+
const [open, setOpen] = (0, import_react25.useState)(false);
|
|
2935
|
+
const [searchTerm, setSearchTerm] = (0, import_react25.useState)("");
|
|
2936
|
+
const inputRef = (0, import_react25.useRef)(null);
|
|
2870
2937
|
const selectedValues = new Set(value.map((v) => v.value));
|
|
2871
2938
|
const filteredOptions = options.filter(
|
|
2872
2939
|
(o) => !selectedValues.has(o.value) && o.label.toLowerCase().includes(searchTerm.toLowerCase())
|
|
@@ -2977,7 +3044,7 @@ var TagSelect = ({
|
|
|
2977
3044
|
};
|
|
2978
3045
|
|
|
2979
3046
|
// src/ui/components/ui/TagLevelPicker.tsx
|
|
2980
|
-
var
|
|
3047
|
+
var import_react26 = require("react");
|
|
2981
3048
|
var RadixPopover3 = __toESM(require("@radix-ui/react-popover"));
|
|
2982
3049
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2983
3050
|
var TEXT_COLOR = "#15303B";
|
|
@@ -3087,7 +3154,7 @@ var TagChip = ({
|
|
|
3087
3154
|
const sizeStyle = SIZE_STYLES[size];
|
|
3088
3155
|
const hasLevel = tag.level != null;
|
|
3089
3156
|
const current = hasLevel ? getLevelStyle(tag.level, levelCount) : NO_LEVEL_STYLE;
|
|
3090
|
-
const levels = (0,
|
|
3157
|
+
const levels = (0, import_react26.useMemo)(
|
|
3091
3158
|
() => Array.from({ length: levelCount }, (_, i) => i + 1),
|
|
3092
3159
|
[levelCount]
|
|
3093
3160
|
);
|
|
@@ -3217,11 +3284,11 @@ var TagLevelPicker = ({
|
|
|
3217
3284
|
className
|
|
3218
3285
|
}) => {
|
|
3219
3286
|
const sizeStyle = SIZE_STYLES[size];
|
|
3220
|
-
const [query, setQuery] = (0,
|
|
3221
|
-
const [isFocused, setIsFocused] = (0,
|
|
3222
|
-
const [isDismissed, setIsDismissed] = (0,
|
|
3223
|
-
const boxRef = (0,
|
|
3224
|
-
const [openTagValue, setOpenTagValue] = (0,
|
|
3287
|
+
const [query, setQuery] = (0, import_react26.useState)("");
|
|
3288
|
+
const [isFocused, setIsFocused] = (0, import_react26.useState)(false);
|
|
3289
|
+
const [isDismissed, setIsDismissed] = (0, import_react26.useState)(false);
|
|
3290
|
+
const boxRef = (0, import_react26.useRef)(null);
|
|
3291
|
+
const [openTagValue, setOpenTagValue] = (0, import_react26.useState)(null);
|
|
3225
3292
|
const trimmed = query.trim().toLowerCase();
|
|
3226
3293
|
const matching = trimmed ? options.filter((option) => option.label.toLowerCase().includes(trimmed)) : options;
|
|
3227
3294
|
const suggestions = maxSuggestions != null ? matching.slice(0, maxSuggestions) : matching;
|
|
@@ -3379,7 +3446,7 @@ var warnDeprecatedTableProp = (component, prop, replacement) => {
|
|
|
3379
3446
|
};
|
|
3380
3447
|
|
|
3381
3448
|
// src/ui/components/ui/Pagination.tsx
|
|
3382
|
-
var
|
|
3449
|
+
var import_react27 = require("react");
|
|
3383
3450
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3384
3451
|
var getPageNumbers = (current, total) => {
|
|
3385
3452
|
if (total <= 5) return Array.from({ length: total }, (_, i) => i + 1);
|
|
@@ -3397,7 +3464,7 @@ var Pagination = ({
|
|
|
3397
3464
|
summaryLabel
|
|
3398
3465
|
}) => {
|
|
3399
3466
|
const totalPages = Math.max(1, Math.ceil(totalItems / itemsPerPage));
|
|
3400
|
-
const pages = (0,
|
|
3467
|
+
const pages = (0, import_react27.useMemo)(
|
|
3401
3468
|
() => getPageNumbers(currentPage, totalPages),
|
|
3402
3469
|
[currentPage, totalPages]
|
|
3403
3470
|
);
|
|
@@ -4031,7 +4098,7 @@ var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
|
4031
4098
|
var TableHeaderRow = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("tr", { children });
|
|
4032
4099
|
|
|
4033
4100
|
// src/ui/components/ui/table/TableHeaderCell.tsx
|
|
4034
|
-
var
|
|
4101
|
+
var import_react28 = require("react");
|
|
4035
4102
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4036
4103
|
var SURFACE_CLASS = {
|
|
4037
4104
|
white: "bg-white",
|
|
@@ -4051,7 +4118,7 @@ var TableHeaderCell = ({
|
|
|
4051
4118
|
sortOrder = null,
|
|
4052
4119
|
onClick
|
|
4053
4120
|
}) => {
|
|
4054
|
-
const [hovered, setHovered] = (0,
|
|
4121
|
+
const [hovered, setHovered] = (0, import_react28.useState)(false);
|
|
4055
4122
|
const showArrow = useSort && (isSort || hovered);
|
|
4056
4123
|
const arrowChar = isSort && sortOrder === "asc" ? "\u2191" : "\u2193";
|
|
4057
4124
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
@@ -4107,9 +4174,9 @@ var TableHeaderCell = ({
|
|
|
4107
4174
|
};
|
|
4108
4175
|
|
|
4109
4176
|
// src/ui/components/ui/table/TableRow.tsx
|
|
4110
|
-
var
|
|
4177
|
+
var import_react29 = require("react");
|
|
4111
4178
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4112
|
-
var TableRow = (0,
|
|
4179
|
+
var TableRow = (0, import_react29.forwardRef)(
|
|
4113
4180
|
({
|
|
4114
4181
|
children,
|
|
4115
4182
|
onClick,
|
|
@@ -4488,11 +4555,11 @@ var formatNameWithInitial = (firstname, lastname) => {
|
|
|
4488
4555
|
};
|
|
4489
4556
|
|
|
4490
4557
|
// src/ui/components/ui/Avatar.tsx
|
|
4491
|
-
var
|
|
4558
|
+
var import_react30 = require("react");
|
|
4492
4559
|
var RadixAvatar = __toESM(require("@radix-ui/react-avatar"));
|
|
4493
4560
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4494
|
-
var AvatarSizeContext = (0,
|
|
4495
|
-
var useAvatarSize = () => (0,
|
|
4561
|
+
var AvatarSizeContext = (0, import_react30.createContext)(40);
|
|
4562
|
+
var useAvatarSize = () => (0, import_react30.useContext)(AvatarSizeContext);
|
|
4496
4563
|
var BADGE_BG_CLASS = {
|
|
4497
4564
|
"blue-700": "bg-blue-700",
|
|
4498
4565
|
"blue-900": "bg-blue-900",
|
|
@@ -4523,7 +4590,7 @@ var BADGE_ICON_COLOR_CLASS = {
|
|
|
4523
4590
|
"orange-600": "text-orange-600",
|
|
4524
4591
|
"purple-700": "text-purple-700"
|
|
4525
4592
|
};
|
|
4526
|
-
var Avatar = (0,
|
|
4593
|
+
var Avatar = (0, import_react30.forwardRef)(
|
|
4527
4594
|
(_a, ref) => {
|
|
4528
4595
|
var _b = _a, {
|
|
4529
4596
|
size = 40,
|
|
@@ -4588,7 +4655,7 @@ var Avatar = (0, import_react29.forwardRef)(
|
|
|
4588
4655
|
}
|
|
4589
4656
|
);
|
|
4590
4657
|
Avatar.displayName = "Avatar";
|
|
4591
|
-
var AvatarImage = (0,
|
|
4658
|
+
var AvatarImage = (0, import_react30.forwardRef)((_a, ref) => {
|
|
4592
4659
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
4593
4660
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4594
4661
|
RadixAvatar.Image,
|
|
@@ -4614,7 +4681,7 @@ var FALLBACK_COLOR_CLASS = {
|
|
|
4614
4681
|
"orange-600": "bg-orange-600 text-white",
|
|
4615
4682
|
"purple-700": "bg-purple-700 text-white"
|
|
4616
4683
|
};
|
|
4617
|
-
var AvatarFallback = (0,
|
|
4684
|
+
var AvatarFallback = (0, import_react30.forwardRef)(
|
|
4618
4685
|
(_a, ref) => {
|
|
4619
4686
|
var _b = _a, {
|
|
4620
4687
|
color = "grey-600",
|
|
@@ -4649,7 +4716,7 @@ var AvatarFallback = (0, import_react29.forwardRef)(
|
|
|
4649
4716
|
}
|
|
4650
4717
|
);
|
|
4651
4718
|
AvatarFallback.displayName = "AvatarFallback";
|
|
4652
|
-
var AvatarBadge = (0,
|
|
4719
|
+
var AvatarBadge = (0, import_react30.forwardRef)(
|
|
4653
4720
|
(_a, ref) => {
|
|
4654
4721
|
var _b = _a, { size, className, style } = _b, props = __objRest(_b, ["size", "className", "style"]);
|
|
4655
4722
|
const avatarSize = useAvatarSize();
|
|
@@ -4680,14 +4747,14 @@ var AvatarGroup = (_a) => {
|
|
|
4680
4747
|
"className",
|
|
4681
4748
|
"children"
|
|
4682
4749
|
]);
|
|
4683
|
-
const items =
|
|
4684
|
-
|
|
4750
|
+
const items = import_react30.Children.toArray(children).filter(
|
|
4751
|
+
import_react30.isValidElement
|
|
4685
4752
|
);
|
|
4686
4753
|
const visible = max ? items.slice(0, max) : items;
|
|
4687
4754
|
const overflow = max ? items.length - max : 0;
|
|
4688
4755
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Layout, __spreadProps(__spreadValues({ className: cn("-space-x-2", className) }, props), { children: [
|
|
4689
4756
|
visible.map(
|
|
4690
|
-
(child, index) => (0,
|
|
4757
|
+
(child, index) => (0, import_react30.cloneElement)(child, {
|
|
4691
4758
|
key: index,
|
|
4692
4759
|
size,
|
|
4693
4760
|
className: cn("ring-2 ring-white", child.props.className)
|
|
@@ -4856,7 +4923,7 @@ var TableActionsCell = ({ actions, width }) => {
|
|
|
4856
4923
|
};
|
|
4857
4924
|
|
|
4858
4925
|
// src/ui/components/ui/table/TableSelectCell.tsx
|
|
4859
|
-
var
|
|
4926
|
+
var import_react31 = require("react");
|
|
4860
4927
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4861
4928
|
var TableSelectCell = ({
|
|
4862
4929
|
isSelected,
|
|
@@ -4864,7 +4931,7 @@ var TableSelectCell = ({
|
|
|
4864
4931
|
label,
|
|
4865
4932
|
width = "40px"
|
|
4866
4933
|
}) => {
|
|
4867
|
-
const isRange = (0,
|
|
4934
|
+
const isRange = (0, import_react31.useRef)(false);
|
|
4868
4935
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(TableCell, { width, centerContent: true, className: "table-select-cell", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4869
4936
|
Checkbox,
|
|
4870
4937
|
{
|
|
@@ -4894,20 +4961,20 @@ var TableSelectHeaderCell = ({
|
|
|
4894
4961
|
) }) }) });
|
|
4895
4962
|
|
|
4896
4963
|
// src/ui/hooks/useRowSelection.ts
|
|
4897
|
-
var
|
|
4964
|
+
var import_react32 = require("react");
|
|
4898
4965
|
var useRowSelection = ({
|
|
4899
4966
|
rowIds,
|
|
4900
4967
|
totalCount
|
|
4901
4968
|
}) => {
|
|
4902
|
-
const [selectedIds, setSelectedIds] = (0,
|
|
4903
|
-
const [isAllResultsSelected, setIsAllResultsSelected] = (0,
|
|
4904
|
-
const anchorId = (0,
|
|
4969
|
+
const [selectedIds, setSelectedIds] = (0, import_react32.useState)(/* @__PURE__ */ new Set());
|
|
4970
|
+
const [isAllResultsSelected, setIsAllResultsSelected] = (0, import_react32.useState)(false);
|
|
4971
|
+
const anchorId = (0, import_react32.useRef)(null);
|
|
4905
4972
|
const resolvedTotal = totalCount != null ? totalCount : rowIds.length;
|
|
4906
4973
|
const selectedOnPage = rowIds.filter((id) => selectedIds.has(id)).length;
|
|
4907
4974
|
const isPageFullySelected = rowIds.length > 0 && selectedOnPage === rowIds.length;
|
|
4908
4975
|
const canSelectAllResults = isPageFullySelected && !isAllResultsSelected && resolvedTotal > rowIds.length;
|
|
4909
4976
|
const headerState = isAllResultsSelected || isPageFullySelected ? true : selectedOnPage > 0 ? "indeterminate" : false;
|
|
4910
|
-
const clear = (0,
|
|
4977
|
+
const clear = (0, import_react32.useCallback)(() => {
|
|
4911
4978
|
setSelectedIds(/* @__PURE__ */ new Set());
|
|
4912
4979
|
setIsAllResultsSelected(false);
|
|
4913
4980
|
anchorId.current = null;
|
|
@@ -5262,9 +5329,10 @@ var CollapsibleContent = (_a) => {
|
|
|
5262
5329
|
};
|
|
5263
5330
|
|
|
5264
5331
|
// src/ui/components/ui/Drawer.tsx
|
|
5265
|
-
var
|
|
5332
|
+
var import_react33 = require("react");
|
|
5266
5333
|
var import_vaul = require("vaul");
|
|
5267
5334
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
5335
|
+
var import_react_dismissable_layer2 = require("@radix-ui/react-dismissable-layer");
|
|
5268
5336
|
|
|
5269
5337
|
// src/ui/lib/drawer/nestedDrawerAttributes.ts
|
|
5270
5338
|
var NESTED_DRAWER_ATTRIBUTES = {
|
|
@@ -5352,11 +5420,14 @@ var Drawer = ({
|
|
|
5352
5420
|
overlayClassName
|
|
5353
5421
|
}) => {
|
|
5354
5422
|
const isVertical = direction === "left" || direction === "right";
|
|
5355
|
-
const contentRef = (0,
|
|
5356
|
-
const [panel, setPanel] = (0,
|
|
5357
|
-
const overlayRef = (0,
|
|
5423
|
+
const contentRef = (0, import_react33.useRef)(null);
|
|
5424
|
+
const [panel, setPanel] = (0, import_react33.useState)(null);
|
|
5425
|
+
const overlayRef = (0, import_react33.useRef)(null);
|
|
5426
|
+
const markOverlaySurface = (0, import_react_dismissable_layer2.useDismissableLayerSurface)();
|
|
5427
|
+
const markContentSurface = (0, import_react_dismissable_layer2.useDismissableLayerSurface)();
|
|
5358
5428
|
useAllowPortalScroll(modal && open, contentRef, overlayRef);
|
|
5359
|
-
(
|
|
5429
|
+
useKeepLayersAboveUsable(modal && open, contentRef);
|
|
5430
|
+
(0, import_react33.useEffect)(() => {
|
|
5360
5431
|
if (!open || !panel) return;
|
|
5361
5432
|
return registerOpenDrawer(panel, overlayRef.current);
|
|
5362
5433
|
}, [open, panel]);
|
|
@@ -5369,9 +5440,9 @@ var Drawer = ({
|
|
|
5369
5440
|
};
|
|
5370
5441
|
const belongsToLayerAbove = (target) => {
|
|
5371
5442
|
const overlay = target.closest("[data-vaul-overlay]");
|
|
5372
|
-
return Boolean(target.closest(KEEP_OPEN_SELECTOR)) || overlay !== null && isOverlayOfDrawerAbove(overlay, contentRef.current);
|
|
5443
|
+
return Boolean(target.closest(KEEP_OPEN_SELECTOR)) || isMountedAbove(target, contentRef.current) || overlay !== null && isOverlayOfDrawerAbove(overlay, contentRef.current);
|
|
5373
5444
|
};
|
|
5374
|
-
(0,
|
|
5445
|
+
(0, import_react33.useEffect)(() => {
|
|
5375
5446
|
if (modal || !open || typeof document === "undefined") return;
|
|
5376
5447
|
const handlePointerDown = (event) => {
|
|
5377
5448
|
var _a;
|
|
@@ -5390,7 +5461,7 @@ var Drawer = ({
|
|
|
5390
5461
|
document.addEventListener("pointerdown", handlePointerDown, true);
|
|
5391
5462
|
return () => document.removeEventListener("pointerdown", handlePointerDown, true);
|
|
5392
5463
|
}, [modal, open, onClose]);
|
|
5393
|
-
(0,
|
|
5464
|
+
(0, import_react33.useEffect)(() => {
|
|
5394
5465
|
if (modal || !open) return;
|
|
5395
5466
|
const frame = requestAnimationFrame(() => {
|
|
5396
5467
|
document.body.style.pointerEvents = "auto";
|
|
@@ -5402,7 +5473,10 @@ var Drawer = ({
|
|
|
5402
5473
|
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5403
5474
|
import_vaul.Drawer.Overlay,
|
|
5404
5475
|
{
|
|
5405
|
-
ref:
|
|
5476
|
+
ref: (node) => {
|
|
5477
|
+
overlayRef.current = node;
|
|
5478
|
+
markOverlaySurface(node);
|
|
5479
|
+
},
|
|
5406
5480
|
onClick: (event) => event.stopPropagation(),
|
|
5407
5481
|
className: cn(
|
|
5408
5482
|
MODAL_LAYER,
|
|
@@ -5417,6 +5491,7 @@ var Drawer = ({
|
|
|
5417
5491
|
ref: (node) => {
|
|
5418
5492
|
contentRef.current = node;
|
|
5419
5493
|
setPanel(node);
|
|
5494
|
+
markContentSurface(node);
|
|
5420
5495
|
}
|
|
5421
5496
|
}, { [NESTED_DRAWER_ATTRIBUTES.panel]: "" }), {
|
|
5422
5497
|
onPointerDownOutside: (event) => {
|
|
@@ -5520,17 +5595,17 @@ var DrawerFooter = (_a) => {
|
|
|
5520
5595
|
var DrawerClose = import_vaul.Drawer.Close;
|
|
5521
5596
|
|
|
5522
5597
|
// src/ui/components/ui/sidebar/Sidebar.tsx
|
|
5523
|
-
var
|
|
5598
|
+
var import_react35 = require("react");
|
|
5524
5599
|
|
|
5525
5600
|
// src/ui/components/ui/sidebar/SidebarContext.ts
|
|
5526
|
-
var
|
|
5527
|
-
var SidebarCollapsedContext = (0,
|
|
5601
|
+
var import_react34 = require("react");
|
|
5602
|
+
var SidebarCollapsedContext = (0, import_react34.createContext)(false);
|
|
5528
5603
|
var SidebarCollapsedProvider = SidebarCollapsedContext.Provider;
|
|
5529
|
-
var useSidebarCollapsed = () => (0,
|
|
5604
|
+
var useSidebarCollapsed = () => (0, import_react34.useContext)(SidebarCollapsedContext);
|
|
5530
5605
|
|
|
5531
5606
|
// src/ui/components/ui/sidebar/Sidebar.tsx
|
|
5532
5607
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5533
|
-
var Sidebar = (0,
|
|
5608
|
+
var Sidebar = (0, import_react35.forwardRef)(
|
|
5534
5609
|
(_a, ref) => {
|
|
5535
5610
|
var _b = _a, { collapsed = false, className, children } = _b, props = __objRest(_b, ["collapsed", "className", "children"]);
|
|
5536
5611
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(SidebarCollapsedProvider, { value: collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
@@ -5551,9 +5626,9 @@ var Sidebar = (0, import_react34.forwardRef)(
|
|
|
5551
5626
|
Sidebar.displayName = "Sidebar";
|
|
5552
5627
|
|
|
5553
5628
|
// src/ui/components/ui/sidebar/SidebarTrigger.tsx
|
|
5554
|
-
var
|
|
5629
|
+
var import_react36 = require("react");
|
|
5555
5630
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5556
|
-
var SidebarTrigger = (0,
|
|
5631
|
+
var SidebarTrigger = (0, import_react36.forwardRef)((_a, ref) => {
|
|
5557
5632
|
var _b = _a, { collapsed, className } = _b, props = __objRest(_b, ["collapsed", "className"]);
|
|
5558
5633
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5559
5634
|
"button",
|
|
@@ -5580,9 +5655,9 @@ var SidebarTrigger = (0, import_react35.forwardRef)((_a, ref) => {
|
|
|
5580
5655
|
SidebarTrigger.displayName = "SidebarTrigger";
|
|
5581
5656
|
|
|
5582
5657
|
// src/ui/components/ui/sidebar/SidebarHeader.tsx
|
|
5583
|
-
var
|
|
5658
|
+
var import_react37 = require("react");
|
|
5584
5659
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5585
|
-
var SidebarHeader = (0,
|
|
5660
|
+
var SidebarHeader = (0, import_react37.forwardRef)(
|
|
5586
5661
|
(_a, ref) => {
|
|
5587
5662
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5588
5663
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
@@ -5597,9 +5672,9 @@ var SidebarHeader = (0, import_react36.forwardRef)(
|
|
|
5597
5672
|
SidebarHeader.displayName = "SidebarHeader";
|
|
5598
5673
|
|
|
5599
5674
|
// src/ui/components/ui/sidebar/SidebarContent.tsx
|
|
5600
|
-
var
|
|
5675
|
+
var import_react38 = require("react");
|
|
5601
5676
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5602
|
-
var SidebarContent = (0,
|
|
5677
|
+
var SidebarContent = (0, import_react38.forwardRef)(
|
|
5603
5678
|
(_a, ref) => {
|
|
5604
5679
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5605
5680
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
@@ -5618,9 +5693,9 @@ var SidebarContent = (0, import_react37.forwardRef)(
|
|
|
5618
5693
|
SidebarContent.displayName = "SidebarContent";
|
|
5619
5694
|
|
|
5620
5695
|
// src/ui/components/ui/sidebar/SidebarGroup.tsx
|
|
5621
|
-
var
|
|
5696
|
+
var import_react39 = require("react");
|
|
5622
5697
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
5623
|
-
var SidebarGroup = (0,
|
|
5698
|
+
var SidebarGroup = (0, import_react39.forwardRef)(
|
|
5624
5699
|
(_a, ref) => {
|
|
5625
5700
|
var _b = _a, { label, className, children } = _b, props = __objRest(_b, ["label", "className", "children"]);
|
|
5626
5701
|
const collapsed = useSidebarCollapsed();
|
|
@@ -5641,9 +5716,9 @@ var SidebarGroup = (0, import_react38.forwardRef)(
|
|
|
5641
5716
|
SidebarGroup.displayName = "SidebarGroup";
|
|
5642
5717
|
|
|
5643
5718
|
// src/ui/components/ui/sidebar/SidebarMenuButton.tsx
|
|
5644
|
-
var
|
|
5719
|
+
var import_react40 = require("react");
|
|
5645
5720
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5646
|
-
var SidebarMenuButton = (0,
|
|
5721
|
+
var SidebarMenuButton = (0, import_react40.forwardRef)(
|
|
5647
5722
|
(_a, ref) => {
|
|
5648
5723
|
var _b = _a, {
|
|
5649
5724
|
icon,
|
|
@@ -5723,9 +5798,9 @@ var SidebarMenuButton = (0, import_react39.forwardRef)(
|
|
|
5723
5798
|
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
5724
5799
|
|
|
5725
5800
|
// src/ui/components/ui/sidebar/SidebarActionCard.tsx
|
|
5726
|
-
var
|
|
5801
|
+
var import_react41 = require("react");
|
|
5727
5802
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5728
|
-
var SidebarActionCard = (0,
|
|
5803
|
+
var SidebarActionCard = (0, import_react41.forwardRef)(
|
|
5729
5804
|
(_a, ref) => {
|
|
5730
5805
|
var _b = _a, {
|
|
5731
5806
|
icon,
|
|
@@ -5789,9 +5864,9 @@ var SidebarActionCard = (0, import_react40.forwardRef)(
|
|
|
5789
5864
|
SidebarActionCard.displayName = "SidebarActionCard";
|
|
5790
5865
|
|
|
5791
5866
|
// src/ui/components/ui/sidebar/SidebarMenuSub.tsx
|
|
5792
|
-
var
|
|
5867
|
+
var import_react42 = require("react");
|
|
5793
5868
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5794
|
-
var SidebarMenuSub = (0,
|
|
5869
|
+
var SidebarMenuSub = (0, import_react42.forwardRef)(
|
|
5795
5870
|
(_a, ref) => {
|
|
5796
5871
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5797
5872
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
@@ -5809,22 +5884,22 @@ var SidebarMenuSub = (0, import_react41.forwardRef)(
|
|
|
5809
5884
|
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
5810
5885
|
|
|
5811
5886
|
// src/ui/components/ui/sidebar/SidebarMenuSubItem.tsx
|
|
5812
|
-
var
|
|
5887
|
+
var import_react43 = require("react");
|
|
5813
5888
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
5814
|
-
var SidebarMenuSubItem = (0,
|
|
5889
|
+
var SidebarMenuSubItem = (0, import_react43.forwardRef)((_a, ref) => {
|
|
5815
5890
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5816
5891
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("li", __spreadValues({ ref, className: cn("relative", className) }, props));
|
|
5817
5892
|
});
|
|
5818
5893
|
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
5819
5894
|
|
|
5820
5895
|
// src/ui/components/ui/sidebar/SidebarMenuSubButton.tsx
|
|
5821
|
-
var
|
|
5896
|
+
var import_react44 = require("react");
|
|
5822
5897
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
5823
5898
|
var SIZE_CLASS = {
|
|
5824
5899
|
default: "h-10",
|
|
5825
5900
|
lg: "h-14"
|
|
5826
5901
|
};
|
|
5827
|
-
var SidebarMenuSubButton = (0,
|
|
5902
|
+
var SidebarMenuSubButton = (0, import_react44.forwardRef)((_a, ref) => {
|
|
5828
5903
|
var _b = _a, { active, size = "default", className } = _b, props = __objRest(_b, ["active", "size", "className"]);
|
|
5829
5904
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
5830
5905
|
"button",
|
|
@@ -5845,9 +5920,9 @@ var SidebarMenuSubButton = (0, import_react43.forwardRef)((_a, ref) => {
|
|
|
5845
5920
|
SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
5846
5921
|
|
|
5847
5922
|
// src/ui/components/ui/sidebar/SidebarFooter.tsx
|
|
5848
|
-
var
|
|
5923
|
+
var import_react45 = require("react");
|
|
5849
5924
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
5850
|
-
var SidebarFooter = (0,
|
|
5925
|
+
var SidebarFooter = (0, import_react45.forwardRef)(
|
|
5851
5926
|
(_a, ref) => {
|
|
5852
5927
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5853
5928
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
@@ -5885,9 +5960,9 @@ var SidebarSupportInfo = ({
|
|
|
5885
5960
|
};
|
|
5886
5961
|
|
|
5887
5962
|
// src/ui/components/ui/sidebar/SidebarMenuSearchInput.tsx
|
|
5888
|
-
var
|
|
5963
|
+
var import_react46 = require("react");
|
|
5889
5964
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
5890
|
-
var SidebarMenuSearchInput = (0,
|
|
5965
|
+
var SidebarMenuSearchInput = (0, import_react46.forwardRef)((_a, ref) => {
|
|
5891
5966
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5892
5967
|
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(InputGroup, { children: [
|
|
5893
5968
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(InputGroupAddon, { align: "inline-start", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(FaIcon, { name: "magnifying-glass", size: 14, className: "text-white/50" }) }),
|
|
@@ -5906,7 +5981,7 @@ var SidebarMenuSearchInput = (0, import_react45.forwardRef)((_a, ref) => {
|
|
|
5906
5981
|
SidebarMenuSearchInput.displayName = "SidebarMenuSearchInput";
|
|
5907
5982
|
|
|
5908
5983
|
// src/ui/components/ui/sidebar/SidebarUserMenu.tsx
|
|
5909
|
-
var
|
|
5984
|
+
var import_react47 = require("react");
|
|
5910
5985
|
var RadixPopover5 = __toESM(require("@radix-ui/react-popover"));
|
|
5911
5986
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
5912
5987
|
var panelClassName = cn(
|
|
@@ -5925,7 +6000,7 @@ var SidebarUserMenu = ({
|
|
|
5925
6000
|
className
|
|
5926
6001
|
}) => {
|
|
5927
6002
|
const collapsed = useSidebarCollapsed();
|
|
5928
|
-
const [open, setOpen] = (0,
|
|
6003
|
+
const [open, setOpen] = (0, import_react47.useState)(false);
|
|
5929
6004
|
const runAndClose = (action) => {
|
|
5930
6005
|
action();
|
|
5931
6006
|
setOpen(false);
|
|
@@ -6244,7 +6319,7 @@ var toast = {
|
|
|
6244
6319
|
};
|
|
6245
6320
|
|
|
6246
6321
|
// src/ui/components/ui/PageContainer.tsx
|
|
6247
|
-
var
|
|
6322
|
+
var import_react48 = require("react");
|
|
6248
6323
|
var import_class_variance_authority14 = require("class-variance-authority");
|
|
6249
6324
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
6250
6325
|
var pageContainerVariants = (0, import_class_variance_authority14.cva)(
|
|
@@ -6261,7 +6336,7 @@ var pageContainerVariants = (0, import_class_variance_authority14.cva)(
|
|
|
6261
6336
|
defaultVariants: { padding: "md" }
|
|
6262
6337
|
}
|
|
6263
6338
|
);
|
|
6264
|
-
var PageContainer = (0,
|
|
6339
|
+
var PageContainer = (0, import_react48.forwardRef)(
|
|
6265
6340
|
(_a, ref) => {
|
|
6266
6341
|
var _b = _a, { padding, className } = _b, props = __objRest(_b, ["padding", "className"]);
|
|
6267
6342
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
@@ -6276,7 +6351,7 @@ var PageContainer = (0, import_react47.forwardRef)(
|
|
|
6276
6351
|
PageContainer.displayName = "PageContainer";
|
|
6277
6352
|
|
|
6278
6353
|
// src/ui/components/ui/IconTabs.tsx
|
|
6279
|
-
var
|
|
6354
|
+
var import_react49 = require("react");
|
|
6280
6355
|
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
6281
6356
|
var IconTabs = ({
|
|
6282
6357
|
items,
|
|
@@ -6286,10 +6361,10 @@ var IconTabs = ({
|
|
|
6286
6361
|
className
|
|
6287
6362
|
}) => {
|
|
6288
6363
|
var _a;
|
|
6289
|
-
const listRef = (0,
|
|
6290
|
-
const tabRefs = (0,
|
|
6291
|
-
const [bar, setBar] = (0,
|
|
6292
|
-
const updateBar = (0,
|
|
6364
|
+
const listRef = (0, import_react49.useRef)(null);
|
|
6365
|
+
const tabRefs = (0, import_react49.useRef)([]);
|
|
6366
|
+
const [bar, setBar] = (0, import_react49.useState)({ left: 0, top: 0, width: 0, height: 0 });
|
|
6367
|
+
const updateBar = (0, import_react49.useCallback)(() => {
|
|
6293
6368
|
const root = listRef.current;
|
|
6294
6369
|
const activeEl = tabRefs.current[value];
|
|
6295
6370
|
if (!root || !activeEl) return;
|
|
@@ -6302,7 +6377,7 @@ var IconTabs = ({
|
|
|
6302
6377
|
height: box.height
|
|
6303
6378
|
});
|
|
6304
6379
|
}, [value]);
|
|
6305
|
-
(0,
|
|
6380
|
+
(0, import_react49.useEffect)(() => {
|
|
6306
6381
|
updateBar();
|
|
6307
6382
|
const ro = new ResizeObserver(updateBar);
|
|
6308
6383
|
if (listRef.current) ro.observe(listRef.current);
|
|
@@ -6484,7 +6559,7 @@ var Banner = ({
|
|
|
6484
6559
|
};
|
|
6485
6560
|
|
|
6486
6561
|
// src/ui/components/ui/FloatingButton.tsx
|
|
6487
|
-
var
|
|
6562
|
+
var import_react50 = require("react");
|
|
6488
6563
|
|
|
6489
6564
|
// src/ui/lib/floatingArc.ts
|
|
6490
6565
|
var MAX_STEP = 65;
|
|
@@ -6638,20 +6713,20 @@ var FloatingButton = ({
|
|
|
6638
6713
|
safeArea,
|
|
6639
6714
|
onOffsetChange
|
|
6640
6715
|
}) => {
|
|
6641
|
-
const containerRef = (0,
|
|
6642
|
-
const [placement, setPlacement] = (0,
|
|
6716
|
+
const containerRef = (0, import_react50.useRef)(null);
|
|
6717
|
+
const [placement, setPlacement] = (0, import_react50.useState)(() => ({
|
|
6643
6718
|
geometry: __spreadValues({ base: 90 }, arcLayout(actions.length, ARC_RADIUS, SUB_SIZE)),
|
|
6644
6719
|
shift: { x: 0, y: 0 }
|
|
6645
6720
|
}));
|
|
6646
|
-
const [isDragging, setIsDragging] = (0,
|
|
6647
|
-
const [offset, setOffset] = (0,
|
|
6648
|
-
const offsetRef = (0,
|
|
6649
|
-
const lastPointRef = (0,
|
|
6650
|
-
const dragDistanceRef = (0,
|
|
6651
|
-
(0,
|
|
6721
|
+
const [isDragging, setIsDragging] = (0, import_react50.useState)(false);
|
|
6722
|
+
const [offset, setOffset] = (0, import_react50.useState)(() => readStoredOffset(persistKey));
|
|
6723
|
+
const offsetRef = (0, import_react50.useRef)(offset);
|
|
6724
|
+
const lastPointRef = (0, import_react50.useRef)({ x: 0, y: 0 });
|
|
6725
|
+
const dragDistanceRef = (0, import_react50.useRef)(0);
|
|
6726
|
+
(0, import_react50.useEffect)(() => {
|
|
6652
6727
|
onOffsetChange == null ? void 0 : onOffsetChange(offset);
|
|
6653
6728
|
}, [offset, onOffsetChange]);
|
|
6654
|
-
const clampOffset = (0,
|
|
6729
|
+
const clampOffset = (0, import_react50.useCallback)(
|
|
6655
6730
|
(next) => {
|
|
6656
6731
|
var _a, _b, _c, _d;
|
|
6657
6732
|
const el = containerRef.current;
|
|
@@ -6671,14 +6746,14 @@ var FloatingButton = ({
|
|
|
6671
6746
|
},
|
|
6672
6747
|
[safeArea == null ? void 0 : safeArea.left, safeArea == null ? void 0 : safeArea.top, safeArea == null ? void 0 : safeArea.right, safeArea == null ? void 0 : safeArea.bottom]
|
|
6673
6748
|
);
|
|
6674
|
-
(0,
|
|
6749
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
6675
6750
|
const corrected = clampOffset(offsetRef.current);
|
|
6676
6751
|
if (corrected.x === offsetRef.current.x && corrected.y === offsetRef.current.y)
|
|
6677
6752
|
return;
|
|
6678
6753
|
offsetRef.current = corrected;
|
|
6679
6754
|
setOffset(corrected);
|
|
6680
6755
|
}, [clampOffset]);
|
|
6681
|
-
(0,
|
|
6756
|
+
(0, import_react50.useEffect)(() => {
|
|
6682
6757
|
if (!draggable || !isDragging) return;
|
|
6683
6758
|
const onPointerMove = (e) => {
|
|
6684
6759
|
const dx = e.clientX - lastPointRef.current.x;
|
|
@@ -6714,7 +6789,7 @@ var FloatingButton = ({
|
|
|
6714
6789
|
window.removeEventListener("pointercancel", endDrag);
|
|
6715
6790
|
};
|
|
6716
6791
|
}, [draggable, isDragging, persistKey, clampOffset]);
|
|
6717
|
-
const resolvePlacement = (0,
|
|
6792
|
+
const resolvePlacement = (0, import_react50.useCallback)(() => {
|
|
6718
6793
|
var _a, _b, _c, _d;
|
|
6719
6794
|
const el = containerRef.current;
|
|
6720
6795
|
if (!el || typeof window === "undefined") return;
|
|
@@ -6743,13 +6818,13 @@ var FloatingButton = ({
|
|
|
6743
6818
|
safeArea == null ? void 0 : safeArea.right,
|
|
6744
6819
|
safeArea == null ? void 0 : safeArea.bottom
|
|
6745
6820
|
]);
|
|
6746
|
-
(0,
|
|
6821
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
6747
6822
|
if (isOpen) resolvePlacement();
|
|
6748
6823
|
}, [isOpen, offset, resolvePlacement]);
|
|
6749
|
-
(0,
|
|
6824
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
6750
6825
|
resolvePlacement();
|
|
6751
6826
|
}, [resolvePlacement]);
|
|
6752
|
-
(0,
|
|
6827
|
+
(0, import_react50.useEffect)(() => {
|
|
6753
6828
|
if (typeof window === "undefined") return;
|
|
6754
6829
|
const onResize = () => {
|
|
6755
6830
|
resolvePlacement();
|
|
@@ -6845,7 +6920,7 @@ var FloatingButton = ({
|
|
|
6845
6920
|
};
|
|
6846
6921
|
|
|
6847
6922
|
// src/ui/components/ui/ActivityFeedPanel.tsx
|
|
6848
|
-
var
|
|
6923
|
+
var import_react51 = require("react");
|
|
6849
6924
|
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
6850
6925
|
var PANEL_WIDTH = 500;
|
|
6851
6926
|
var PANEL_MAX_HEIGHT = 750;
|
|
@@ -6880,15 +6955,15 @@ var ActivityFeedPanel = ({
|
|
|
6880
6955
|
emptyMessage = "Rien de neuf pour l\u2019instant.",
|
|
6881
6956
|
items
|
|
6882
6957
|
}) => {
|
|
6883
|
-
const panelRef = (0,
|
|
6884
|
-
const [placement, setPlacement] = (0,
|
|
6958
|
+
const panelRef = (0, import_react51.useRef)(null);
|
|
6959
|
+
const [placement, setPlacement] = (0, import_react51.useState)(
|
|
6885
6960
|
() => typeof window === "undefined" ? {} : resolveFloatingPanelPlacement(
|
|
6886
6961
|
offset,
|
|
6887
6962
|
window.innerWidth,
|
|
6888
6963
|
window.innerHeight
|
|
6889
6964
|
)
|
|
6890
6965
|
);
|
|
6891
|
-
(0,
|
|
6966
|
+
(0, import_react51.useEffect)(() => {
|
|
6892
6967
|
if (!open || typeof document === "undefined") return;
|
|
6893
6968
|
const handlePointerDown = (event) => {
|
|
6894
6969
|
var _a;
|
|
@@ -6899,7 +6974,7 @@ var ActivityFeedPanel = ({
|
|
|
6899
6974
|
document.addEventListener("pointerdown", handlePointerDown);
|
|
6900
6975
|
return () => document.removeEventListener("pointerdown", handlePointerDown);
|
|
6901
6976
|
}, [open, onClose]);
|
|
6902
|
-
(0,
|
|
6977
|
+
(0, import_react51.useEffect)(() => {
|
|
6903
6978
|
if (!open || typeof window === "undefined") return;
|
|
6904
6979
|
const recompute = () => setPlacement(
|
|
6905
6980
|
resolveFloatingPanelPlacement(
|
|
@@ -7403,7 +7478,7 @@ var HistoryDrawer = (_a) => {
|
|
|
7403
7478
|
};
|
|
7404
7479
|
|
|
7405
7480
|
// src/ui/components/ui/history/HistoryButton.tsx
|
|
7406
|
-
var
|
|
7481
|
+
var import_react52 = require("react");
|
|
7407
7482
|
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
7408
7483
|
var LABEL = "Historique";
|
|
7409
7484
|
var SHORT_TOOLTIP = "Voir l\u2019historique des actions";
|
|
@@ -7419,7 +7494,7 @@ var HistoryButton = (_a) => {
|
|
|
7419
7494
|
"tooltip",
|
|
7420
7495
|
"onOpenChange"
|
|
7421
7496
|
]);
|
|
7422
|
-
const [isOpen, setIsOpen] = (0,
|
|
7497
|
+
const [isOpen, setIsOpen] = (0, import_react52.useState)(false);
|
|
7423
7498
|
const changeOpen = (nextIsOpen) => {
|
|
7424
7499
|
setIsOpen(nextIsOpen);
|
|
7425
7500
|
onOpenChange == null ? void 0 : onOpenChange(nextIsOpen);
|
|
@@ -7643,7 +7718,7 @@ var Timeline = ({
|
|
|
7643
7718
|
};
|
|
7644
7719
|
|
|
7645
7720
|
// src/ui/components/ui/ColorPicker.tsx
|
|
7646
|
-
var
|
|
7721
|
+
var import_react53 = require("react");
|
|
7647
7722
|
var import_class_variance_authority16 = require("class-variance-authority");
|
|
7648
7723
|
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
7649
7724
|
var swatchVariants = (0, import_class_variance_authority16.cva)(
|
|
@@ -7672,7 +7747,7 @@ var inputVariants = (0, import_class_variance_authority16.cva)(
|
|
|
7672
7747
|
defaultVariants: { size: "m" }
|
|
7673
7748
|
}
|
|
7674
7749
|
);
|
|
7675
|
-
var ColorPicker = (0,
|
|
7750
|
+
var ColorPicker = (0, import_react53.forwardRef)(
|
|
7676
7751
|
({
|
|
7677
7752
|
label,
|
|
7678
7753
|
value,
|
|
@@ -7682,7 +7757,7 @@ var ColorPicker = (0, import_react52.forwardRef)(
|
|
|
7682
7757
|
size,
|
|
7683
7758
|
className
|
|
7684
7759
|
}, ref) => {
|
|
7685
|
-
const [internalColor, setInternalColor] = (0,
|
|
7760
|
+
const [internalColor, setInternalColor] = (0, import_react53.useState)(defaultValue);
|
|
7686
7761
|
const currentColor = value !== void 0 ? value : internalColor;
|
|
7687
7762
|
const handleChange = (e) => {
|
|
7688
7763
|
const next = e.target.value;
|
|
@@ -7746,7 +7821,7 @@ var ColorPicker = (0, import_react52.forwardRef)(
|
|
|
7746
7821
|
ColorPicker.displayName = "ColorPicker";
|
|
7747
7822
|
|
|
7748
7823
|
// src/ui/components/ui/ColorTokenPicker.tsx
|
|
7749
|
-
var
|
|
7824
|
+
var import_react54 = require("react");
|
|
7750
7825
|
|
|
7751
7826
|
// src/ui/lib/tokens.ts
|
|
7752
7827
|
var COLOR_TOKENS = [
|
|
@@ -7787,7 +7862,7 @@ var ColorTokenPicker = ({
|
|
|
7787
7862
|
onChange,
|
|
7788
7863
|
disabled = false
|
|
7789
7864
|
}) => {
|
|
7790
|
-
const [open, setOpen] = (0,
|
|
7865
|
+
const [open, setOpen] = (0, import_react54.useState)(false);
|
|
7791
7866
|
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
7792
7867
|
Popover,
|
|
7793
7868
|
{
|
|
@@ -7839,7 +7914,7 @@ var ColorTokenPicker = ({
|
|
|
7839
7914
|
};
|
|
7840
7915
|
|
|
7841
7916
|
// src/ui/components/ui/FileUploadZone.tsx
|
|
7842
|
-
var
|
|
7917
|
+
var import_react55 = require("react");
|
|
7843
7918
|
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
7844
7919
|
var ACCEPT_MAP = {
|
|
7845
7920
|
png: "image/png",
|
|
@@ -7872,23 +7947,23 @@ var FileUploadZone = ({
|
|
|
7872
7947
|
showFileName = false,
|
|
7873
7948
|
className
|
|
7874
7949
|
}) => {
|
|
7875
|
-
const [isDragging, setIsDragging] = (0,
|
|
7876
|
-
const [internalPreviewUrl, setInternalPreviewUrl] = (0,
|
|
7950
|
+
const [isDragging, setIsDragging] = (0, import_react55.useState)(false);
|
|
7951
|
+
const [internalPreviewUrl, setInternalPreviewUrl] = (0, import_react55.useState)(
|
|
7877
7952
|
null
|
|
7878
7953
|
);
|
|
7879
|
-
const [fileType, setFileType] = (0,
|
|
7880
|
-
const [fileName, setFileName] = (0,
|
|
7881
|
-
const [inlineError, setInlineError] = (0,
|
|
7882
|
-
const inputRef = (0,
|
|
7954
|
+
const [fileType, setFileType] = (0, import_react55.useState)(null);
|
|
7955
|
+
const [fileName, setFileName] = (0, import_react55.useState)(null);
|
|
7956
|
+
const [inlineError, setInlineError] = (0, import_react55.useState)(null);
|
|
7957
|
+
const inputRef = (0, import_react55.useRef)(null);
|
|
7883
7958
|
const resolvedAccept = acceptOnlyPdf ? PDF_ONLY : accept;
|
|
7884
7959
|
const mimeTypes = getMimeTypes(resolvedAccept);
|
|
7885
7960
|
const acceptString = mimeTypes.join(",");
|
|
7886
7961
|
const previewUrl = multiple ? null : controlledPreviewUrl || (showPreview ? internalPreviewUrl : null);
|
|
7887
|
-
const emitError = (0,
|
|
7962
|
+
const emitError = (0, import_react55.useCallback)(
|
|
7888
7963
|
(message) => onError ? onError(message) : setInlineError(message),
|
|
7889
7964
|
[onError]
|
|
7890
7965
|
);
|
|
7891
|
-
const validateFile = (0,
|
|
7966
|
+
const validateFile = (0, import_react55.useCallback)(
|
|
7892
7967
|
(file) => {
|
|
7893
7968
|
if (!mimeTypes.includes(file.type))
|
|
7894
7969
|
return { ok: false, error: "Format de fichier non accept\xE9." };
|
|
@@ -7902,7 +7977,7 @@ var FileUploadZone = ({
|
|
|
7902
7977
|
},
|
|
7903
7978
|
[mimeTypes, maxSizeMB]
|
|
7904
7979
|
);
|
|
7905
|
-
const processFile = (0,
|
|
7980
|
+
const processFile = (0, import_react55.useCallback)(
|
|
7906
7981
|
(file) => {
|
|
7907
7982
|
setInlineError(null);
|
|
7908
7983
|
const result = validateFile(file);
|
|
@@ -7917,7 +7992,7 @@ var FileUploadZone = ({
|
|
|
7917
7992
|
},
|
|
7918
7993
|
[validateFile, onSave, showPreview, emitError]
|
|
7919
7994
|
);
|
|
7920
|
-
const processFiles = (0,
|
|
7995
|
+
const processFiles = (0, import_react55.useCallback)(
|
|
7921
7996
|
(files) => {
|
|
7922
7997
|
setInlineError(null);
|
|
7923
7998
|
for (const file of files) {
|
|
@@ -8076,7 +8151,7 @@ var FileUploadZone = ({
|
|
|
8076
8151
|
};
|
|
8077
8152
|
|
|
8078
8153
|
// src/ui/components/ui/FilePicker.tsx
|
|
8079
|
-
var
|
|
8154
|
+
var import_react56 = require("react");
|
|
8080
8155
|
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
8081
8156
|
var FilePicker = ({
|
|
8082
8157
|
label,
|
|
@@ -8091,7 +8166,7 @@ var FilePicker = ({
|
|
|
8091
8166
|
variant = "icon",
|
|
8092
8167
|
className
|
|
8093
8168
|
}) => {
|
|
8094
|
-
const inputRef = (0,
|
|
8169
|
+
const inputRef = (0, import_react56.useRef)(null);
|
|
8095
8170
|
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
|
|
8096
8171
|
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
8097
8172
|
"input",
|
|
@@ -8142,7 +8217,7 @@ var FilePicker = ({
|
|
|
8142
8217
|
};
|
|
8143
8218
|
|
|
8144
8219
|
// src/ui/components/ui/Item.tsx
|
|
8145
|
-
var
|
|
8220
|
+
var import_react57 = require("react");
|
|
8146
8221
|
var import_class_variance_authority17 = require("class-variance-authority");
|
|
8147
8222
|
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
8148
8223
|
var itemVariants = (0, import_class_variance_authority17.cva)(
|
|
@@ -8162,7 +8237,7 @@ var itemVariants = (0, import_class_variance_authority17.cva)(
|
|
|
8162
8237
|
defaultVariants: { variant: "default", size: "default" }
|
|
8163
8238
|
}
|
|
8164
8239
|
);
|
|
8165
|
-
var Item4 = (0,
|
|
8240
|
+
var Item4 = (0, import_react57.forwardRef)(
|
|
8166
8241
|
(_a, ref) => {
|
|
8167
8242
|
var _b = _a, { variant, size, className } = _b, props = __objRest(_b, ["variant", "size", "className"]);
|
|
8168
8243
|
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
@@ -8321,7 +8396,7 @@ var Attachment = ({
|
|
|
8321
8396
|
};
|
|
8322
8397
|
|
|
8323
8398
|
// src/ui/components/ui/PdfPreview.tsx
|
|
8324
|
-
var
|
|
8399
|
+
var import_react58 = require("react");
|
|
8325
8400
|
var import_react_pdf = require("react-pdf");
|
|
8326
8401
|
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
8327
8402
|
import_react_pdf.pdfjs.GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${import_react_pdf.pdfjs.version}/build/pdf.worker.min.mjs`;
|
|
@@ -8331,8 +8406,8 @@ var PdfPreview = ({
|
|
|
8331
8406
|
maxHeight = "600px",
|
|
8332
8407
|
className
|
|
8333
8408
|
}) => {
|
|
8334
|
-
const [hasError, setHasError] = (0,
|
|
8335
|
-
const [numPages, setNumPages] = (0,
|
|
8409
|
+
const [hasError, setHasError] = (0, import_react58.useState)(false);
|
|
8410
|
+
const [numPages, setNumPages] = (0, import_react58.useState)(0);
|
|
8336
8411
|
const height = Math.round(width * 1.3);
|
|
8337
8412
|
const thumbnailSkeleton = /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Skeleton, { width, height });
|
|
8338
8413
|
if (hasError) {
|
|
@@ -8388,10 +8463,10 @@ var PdfPreview = ({
|
|
|
8388
8463
|
};
|
|
8389
8464
|
|
|
8390
8465
|
// src/ui/components/ui/AudioPlayer.tsx
|
|
8391
|
-
var
|
|
8466
|
+
var import_react60 = require("react");
|
|
8392
8467
|
|
|
8393
8468
|
// src/ui/components/ui/VideoPlayer.tsx
|
|
8394
|
-
var
|
|
8469
|
+
var import_react59 = require("react");
|
|
8395
8470
|
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
8396
8471
|
var formatVideoDuration = (seconds) => {
|
|
8397
8472
|
if (seconds === void 0 || !Number.isFinite(seconds) || seconds < 0)
|
|
@@ -8431,20 +8506,20 @@ var VideoPlayer = ({
|
|
|
8431
8506
|
defaultVolume = DEFAULT_VOLUME,
|
|
8432
8507
|
className
|
|
8433
8508
|
}) => {
|
|
8434
|
-
const [isInlinePlaying, setIsInlinePlaying] = (0,
|
|
8435
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
8436
|
-
const [hasPosterError, setHasPosterError] = (0,
|
|
8437
|
-
const [hasFramePreviewError, setHasFramePreviewError] = (0,
|
|
8438
|
-
const inlineVideoRef = (0,
|
|
8439
|
-
const expandedVideoRef = (0,
|
|
8440
|
-
(0,
|
|
8509
|
+
const [isInlinePlaying, setIsInlinePlaying] = (0, import_react59.useState)(false);
|
|
8510
|
+
const [isExpanded, setIsExpanded] = (0, import_react59.useState)(false);
|
|
8511
|
+
const [hasPosterError, setHasPosterError] = (0, import_react59.useState)(false);
|
|
8512
|
+
const [hasFramePreviewError, setHasFramePreviewError] = (0, import_react59.useState)(false);
|
|
8513
|
+
const inlineVideoRef = (0, import_react59.useRef)(null);
|
|
8514
|
+
const expandedVideoRef = (0, import_react59.useRef)(null);
|
|
8515
|
+
(0, import_react59.useEffect)(() => {
|
|
8441
8516
|
setHasPosterError(false);
|
|
8442
8517
|
}, [poster]);
|
|
8443
|
-
(0,
|
|
8518
|
+
(0, import_react59.useEffect)(() => {
|
|
8444
8519
|
setHasFramePreviewError(false);
|
|
8445
8520
|
}, [src]);
|
|
8446
8521
|
const visiblePoster = hasPosterError ? void 0 : poster;
|
|
8447
|
-
const attachExpandedVideo = (0,
|
|
8522
|
+
const attachExpandedVideo = (0, import_react59.useCallback)(
|
|
8448
8523
|
(video) => {
|
|
8449
8524
|
expandedVideoRef.current = video;
|
|
8450
8525
|
if (video) video.volume = clampVolume(defaultVolume);
|
|
@@ -8456,7 +8531,7 @@ var VideoPlayer = ({
|
|
|
8456
8531
|
e.preventDefault();
|
|
8457
8532
|
(_a = expandedVideoRef.current) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
8458
8533
|
};
|
|
8459
|
-
const attachInlineVideo = (0,
|
|
8534
|
+
const attachInlineVideo = (0, import_react59.useCallback)(
|
|
8460
8535
|
(video) => {
|
|
8461
8536
|
inlineVideoRef.current = video;
|
|
8462
8537
|
if (video) video.volume = clampVolume(defaultVolume);
|
|
@@ -8675,11 +8750,11 @@ var AudioPlayer = ({
|
|
|
8675
8750
|
title = "Audio",
|
|
8676
8751
|
className
|
|
8677
8752
|
}) => {
|
|
8678
|
-
const audioRef = (0,
|
|
8679
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
8680
|
-
const [currentTime, setCurrentTime] = (0,
|
|
8681
|
-
const [duration, setDuration] = (0,
|
|
8682
|
-
const attachAudio = (0,
|
|
8753
|
+
const audioRef = (0, import_react60.useRef)(null);
|
|
8754
|
+
const [isPlaying, setIsPlaying] = (0, import_react60.useState)(false);
|
|
8755
|
+
const [currentTime, setCurrentTime] = (0, import_react60.useState)(0);
|
|
8756
|
+
const [duration, setDuration] = (0, import_react60.useState)(0);
|
|
8757
|
+
const attachAudio = (0, import_react60.useCallback)(
|
|
8683
8758
|
(audio) => {
|
|
8684
8759
|
audioRef.current = audio;
|
|
8685
8760
|
if (audio) audio.volume = clampVolume2(defaultVolume);
|
|
@@ -8827,7 +8902,7 @@ var ScrollArea = (_a) => {
|
|
|
8827
8902
|
};
|
|
8828
8903
|
|
|
8829
8904
|
// src/ui/components/ui/Message.tsx
|
|
8830
|
-
var
|
|
8905
|
+
var import_react61 = require("react");
|
|
8831
8906
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
8832
8907
|
var BUBBLE_BACKGROUND = {
|
|
8833
8908
|
own: { solid: "bg-blue-700", pale: "bg-blue-50" },
|
|
@@ -8839,7 +8914,7 @@ var BUBBLE_TAIL = {
|
|
|
8839
8914
|
teammate: "rounded-br-none",
|
|
8840
8915
|
other: "rounded-bl-none"
|
|
8841
8916
|
};
|
|
8842
|
-
var Message = (0,
|
|
8917
|
+
var Message = (0, import_react61.forwardRef)(
|
|
8843
8918
|
(_a, ref) => {
|
|
8844
8919
|
var _b = _a, {
|
|
8845
8920
|
isOwn = false,
|
|
@@ -8981,7 +9056,7 @@ var Message = (0, import_react60.forwardRef)(
|
|
|
8981
9056
|
Message.displayName = "Message";
|
|
8982
9057
|
|
|
8983
9058
|
// src/ui/components/ui/MessageScroller.tsx
|
|
8984
|
-
var
|
|
9059
|
+
var import_react62 = require("react");
|
|
8985
9060
|
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
8986
9061
|
var SEPARATOR_LINE = {
|
|
8987
9062
|
neutral: "",
|
|
@@ -9033,9 +9108,9 @@ var MessageScroller = ({
|
|
|
9033
9108
|
viewportRef,
|
|
9034
9109
|
className
|
|
9035
9110
|
}) => {
|
|
9036
|
-
const fallbackRef = (0,
|
|
9111
|
+
const fallbackRef = (0, import_react62.useRef)(null);
|
|
9037
9112
|
const scrollerRef = viewportRef != null ? viewportRef : fallbackRef;
|
|
9038
|
-
(0,
|
|
9113
|
+
(0, import_react62.useLayoutEffect)(() => {
|
|
9039
9114
|
if (!autoScroll) return;
|
|
9040
9115
|
const viewport = scrollerRef.current;
|
|
9041
9116
|
if (!viewport) return;
|
|
@@ -9089,7 +9164,7 @@ var MessageScroller = ({
|
|
|
9089
9164
|
};
|
|
9090
9165
|
|
|
9091
9166
|
// src/ui/components/ui/Stepper.tsx
|
|
9092
|
-
var
|
|
9167
|
+
var import_react63 = require("react");
|
|
9093
9168
|
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
9094
9169
|
var Stepper = ({
|
|
9095
9170
|
numberOfSteps,
|
|
@@ -9107,7 +9182,7 @@ var Stepper = ({
|
|
|
9107
9182
|
children: Array.from({ length: numberOfSteps }, (_, i) => {
|
|
9108
9183
|
const isActive = i === current;
|
|
9109
9184
|
const isCompleted = i < current;
|
|
9110
|
-
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
9185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_react63.Fragment, { children: [
|
|
9111
9186
|
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
9112
9187
|
"div",
|
|
9113
9188
|
{
|
|
@@ -9127,7 +9202,7 @@ var Stepper = ({
|
|
|
9127
9202
|
);
|
|
9128
9203
|
|
|
9129
9204
|
// src/ui/components/ui/DatePicker.tsx
|
|
9130
|
-
var
|
|
9205
|
+
var import_react64 = require("react");
|
|
9131
9206
|
var import_react_day_picker = require("react-day-picker");
|
|
9132
9207
|
var import_locale = require("react-day-picker/locale");
|
|
9133
9208
|
var import_style2 = require("react-day-picker/style.css");
|
|
@@ -9221,12 +9296,12 @@ var DatePicker = ({
|
|
|
9221
9296
|
className
|
|
9222
9297
|
}) => {
|
|
9223
9298
|
const isRange = mode === "range";
|
|
9224
|
-
const [open, setOpen] = (0,
|
|
9225
|
-
const [isEditing, setIsEditing] = (0,
|
|
9226
|
-
const [draftValue, setDraftValue] = (0,
|
|
9227
|
-
const [isDirty, setIsDirty] = (0,
|
|
9299
|
+
const [open, setOpen] = (0, import_react64.useState)(false);
|
|
9300
|
+
const [isEditing, setIsEditing] = (0, import_react64.useState)(false);
|
|
9301
|
+
const [draftValue, setDraftValue] = (0, import_react64.useState)("");
|
|
9302
|
+
const [isDirty, setIsDirty] = (0, import_react64.useState)(false);
|
|
9228
9303
|
const resolvedPresets = presets != null ? presets : isRange ? RANGE_PRESETS : SINGLE_PRESETS;
|
|
9229
|
-
const activePreset = (0,
|
|
9304
|
+
const activePreset = (0, import_react64.useMemo)(() => {
|
|
9230
9305
|
var _a;
|
|
9231
9306
|
const match = resolvedPresets.find((preset) => {
|
|
9232
9307
|
const result = preset.getValue();
|
|
@@ -9894,7 +9969,7 @@ var optimizeImage = async (file, desiredBaseName, opts = {}) => {
|
|
|
9894
9969
|
};
|
|
9895
9970
|
|
|
9896
9971
|
// src/ui/components/ui/Tour.tsx
|
|
9897
|
-
var
|
|
9972
|
+
var import_react65 = require("react");
|
|
9898
9973
|
var import_driver = require("driver.js");
|
|
9899
9974
|
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
9900
9975
|
var TOUR_TARGET_ATTRIBUTE = "data-tour-target";
|
|
@@ -9949,9 +10024,9 @@ var Tour = ({
|
|
|
9949
10024
|
const current = steps[step];
|
|
9950
10025
|
const total = steps.length;
|
|
9951
10026
|
const isLast = step === total - 1;
|
|
9952
|
-
const driverRef = (0,
|
|
9953
|
-
const ghostRef = (0,
|
|
9954
|
-
const actions = (0,
|
|
10027
|
+
const driverRef = (0, import_react65.useRef)(null);
|
|
10028
|
+
const ghostRef = (0, import_react65.useRef)(null);
|
|
10029
|
+
const actions = (0, import_react65.useRef)({
|
|
9955
10030
|
next: () => {
|
|
9956
10031
|
},
|
|
9957
10032
|
previous: () => {
|
|
@@ -9966,7 +10041,7 @@ var Tour = ({
|
|
|
9966
10041
|
},
|
|
9967
10042
|
close: () => onClose("close")
|
|
9968
10043
|
};
|
|
9969
|
-
(0,
|
|
10044
|
+
(0, import_react65.useEffect)(() => {
|
|
9970
10045
|
if (!open) return;
|
|
9971
10046
|
const ghost = document.createElement("div");
|
|
9972
10047
|
ghost.className = "dz-tour-target";
|
|
@@ -9992,7 +10067,7 @@ var Tour = ({
|
|
|
9992
10067
|
ghostRef.current = null;
|
|
9993
10068
|
};
|
|
9994
10069
|
}, [open]);
|
|
9995
|
-
(0,
|
|
10070
|
+
(0, import_react65.useEffect)(() => {
|
|
9996
10071
|
if (!open) return;
|
|
9997
10072
|
const onKeyDown = (event) => {
|
|
9998
10073
|
if (event.key === "Escape") {
|
|
@@ -10004,7 +10079,7 @@ var Tour = ({
|
|
|
10004
10079
|
window.addEventListener("keydown", onKeyDown, true);
|
|
10005
10080
|
return () => window.removeEventListener("keydown", onKeyDown, true);
|
|
10006
10081
|
}, [open]);
|
|
10007
|
-
const view = (0,
|
|
10082
|
+
const view = (0, import_react65.useRef)({ current, text, step, total, isLast });
|
|
10008
10083
|
view.current = { current, text, step, total, isLast };
|
|
10009
10084
|
const targetKey = [(_a = current == null ? void 0 : current.target) != null ? _a : []].flat().join("|");
|
|
10010
10085
|
const popoverKey = [
|
|
@@ -10017,7 +10092,7 @@ var Tour = ({
|
|
|
10017
10092
|
isLast ? text.finish : text.next,
|
|
10018
10093
|
text.close
|
|
10019
10094
|
].join("|");
|
|
10020
|
-
(0,
|
|
10095
|
+
(0, import_react65.useEffect)(() => {
|
|
10021
10096
|
const instance = driverRef.current;
|
|
10022
10097
|
const ghost = ghostRef.current;
|
|
10023
10098
|
const { current: current2, text: text2, step: step2, total: total2, isLast: isLast2 } = view.current;
|