design-zystem 1.0.362 → 1.0.364
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 +170 -125
- package/dist/ui/index.mjs +61 -16
- package/package.json +1 -1
package/dist/ui/index.js
CHANGED
|
@@ -2058,10 +2058,35 @@ var Tabs = ({
|
|
|
2058
2058
|
};
|
|
2059
2059
|
|
|
2060
2060
|
// src/ui/components/ui/Modal.tsx
|
|
2061
|
-
var
|
|
2061
|
+
var import_react21 = require("react");
|
|
2062
2062
|
var RadixDialog = __toESM(require("@radix-ui/react-dialog"));
|
|
2063
|
+
|
|
2064
|
+
// src/ui/lib/portalScroll.ts
|
|
2065
|
+
var import_react20 = require("react");
|
|
2066
|
+
var SCROLL_EVENTS = ["wheel", "touchmove"];
|
|
2067
|
+
var useAllowPortalScroll = (active, contentRef, overlayRef) => {
|
|
2068
|
+
(0, import_react20.useEffect)(() => {
|
|
2069
|
+
if (!active || typeof document === "undefined") return;
|
|
2070
|
+
const release = (event) => {
|
|
2071
|
+
var _a, _b;
|
|
2072
|
+
const target = event.target;
|
|
2073
|
+
if (!target) return;
|
|
2074
|
+
if ((_a = contentRef.current) == null ? void 0 : _a.contains(target)) return;
|
|
2075
|
+
if ((_b = overlayRef.current) == null ? void 0 : _b.contains(target)) return;
|
|
2076
|
+
event.stopPropagation();
|
|
2077
|
+
};
|
|
2078
|
+
SCROLL_EVENTS.forEach(
|
|
2079
|
+
(type) => document.body.addEventListener(type, release)
|
|
2080
|
+
);
|
|
2081
|
+
return () => SCROLL_EVENTS.forEach(
|
|
2082
|
+
(type) => document.body.removeEventListener(type, release)
|
|
2083
|
+
);
|
|
2084
|
+
}, [active, contentRef, overlayRef]);
|
|
2085
|
+
};
|
|
2086
|
+
|
|
2087
|
+
// src/ui/components/ui/Modal.tsx
|
|
2063
2088
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2064
|
-
var ModalDragContext = (0,
|
|
2089
|
+
var ModalDragContext = (0, import_react21.createContext)({
|
|
2065
2090
|
draggable: false,
|
|
2066
2091
|
isDragging: false,
|
|
2067
2092
|
startDrag: () => {
|
|
@@ -2076,13 +2101,16 @@ var Modal = ({
|
|
|
2076
2101
|
onOpenAutoFocus,
|
|
2077
2102
|
className
|
|
2078
2103
|
}) => {
|
|
2079
|
-
const [isDragging, setIsDragging] = (0,
|
|
2080
|
-
const [offset, setOffset] = (0,
|
|
2081
|
-
const lastPointRef = (0,
|
|
2082
|
-
(0,
|
|
2104
|
+
const [isDragging, setIsDragging] = (0, import_react21.useState)(false);
|
|
2105
|
+
const [offset, setOffset] = (0, import_react21.useState)({ x: 0, y: 0 });
|
|
2106
|
+
const lastPointRef = (0, import_react21.useRef)({ x: 0, y: 0 });
|
|
2107
|
+
const contentRef = (0, import_react21.useRef)(null);
|
|
2108
|
+
const overlayRef = (0, import_react21.useRef)(null);
|
|
2109
|
+
useAllowPortalScroll(open, contentRef, overlayRef);
|
|
2110
|
+
(0, import_react21.useEffect)(() => {
|
|
2083
2111
|
if (open) setOffset({ x: 0, y: 0 });
|
|
2084
2112
|
}, [open]);
|
|
2085
|
-
(0,
|
|
2113
|
+
(0, import_react21.useEffect)(() => {
|
|
2086
2114
|
if (!draggable || !isDragging) return;
|
|
2087
2115
|
const onPointerMove = (e) => {
|
|
2088
2116
|
const dx = e.clientX - lastPointRef.current.x;
|
|
@@ -2114,6 +2142,7 @@ var Modal = ({
|
|
|
2114
2142
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2115
2143
|
RadixDialog.Overlay,
|
|
2116
2144
|
{
|
|
2145
|
+
ref: overlayRef,
|
|
2117
2146
|
className: cn(
|
|
2118
2147
|
"fixed inset-0 z-40",
|
|
2119
2148
|
draggable ? "bg-transparent" : "bg-black/50"
|
|
@@ -2123,6 +2152,7 @@ var Modal = ({
|
|
|
2123
2152
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2124
2153
|
RadixDialog.Content,
|
|
2125
2154
|
{
|
|
2155
|
+
ref: contentRef,
|
|
2126
2156
|
onOpenAutoFocus,
|
|
2127
2157
|
className: cn(
|
|
2128
2158
|
"fixed left-1/2 top-1/2 z-50 flex max-h-[90vh] -translate-x-1/2 -translate-y-1/2 flex-col gap-4",
|
|
@@ -2154,7 +2184,7 @@ var ModalHeader = (_a) => {
|
|
|
2154
2184
|
} = _b, props = __objRest(_b, [
|
|
2155
2185
|
"className"
|
|
2156
2186
|
]);
|
|
2157
|
-
const { draggable, isDragging, startDrag } = (0,
|
|
2187
|
+
const { draggable, isDragging, startDrag } = (0, import_react21.useContext)(ModalDragContext);
|
|
2158
2188
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2159
2189
|
"div",
|
|
2160
2190
|
__spreadValues({
|
|
@@ -2214,7 +2244,7 @@ var ModalFooter = (_a) => {
|
|
|
2214
2244
|
var ModalClose = RadixDialog.Close;
|
|
2215
2245
|
|
|
2216
2246
|
// src/ui/components/ui/Select.tsx
|
|
2217
|
-
var
|
|
2247
|
+
var import_react22 = require("react");
|
|
2218
2248
|
var RadixSelect = __toESM(require("@radix-ui/react-select"));
|
|
2219
2249
|
var RadixPopover = __toESM(require("@radix-ui/react-popover"));
|
|
2220
2250
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
@@ -2260,13 +2290,13 @@ var Select = (props) => {
|
|
|
2260
2290
|
hideSearchBar = false,
|
|
2261
2291
|
className
|
|
2262
2292
|
} = props;
|
|
2263
|
-
const [open, setOpen] = (0,
|
|
2264
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2265
|
-
const searchInputRef = (0,
|
|
2293
|
+
const [open, setOpen] = (0, import_react22.useState)(false);
|
|
2294
|
+
const [searchTerm, setSearchTerm] = (0, import_react22.useState)("");
|
|
2295
|
+
const searchInputRef = (0, import_react22.useRef)(null);
|
|
2266
2296
|
const filteredOptions = options.filter(
|
|
2267
2297
|
(option) => option.label.toLowerCase().includes(searchTerm.toLowerCase())
|
|
2268
2298
|
);
|
|
2269
|
-
(0,
|
|
2299
|
+
(0, import_react22.useEffect)(() => {
|
|
2270
2300
|
if (open && !hideSearchBar) {
|
|
2271
2301
|
const id = requestAnimationFrame(() => {
|
|
2272
2302
|
var _a;
|
|
@@ -2458,7 +2488,7 @@ var Select = (props) => {
|
|
|
2458
2488
|
};
|
|
2459
2489
|
|
|
2460
2490
|
// src/ui/components/ui/TagSelect.tsx
|
|
2461
|
-
var
|
|
2491
|
+
var import_react23 = require("react");
|
|
2462
2492
|
var RadixPopover2 = __toESM(require("@radix-ui/react-popover"));
|
|
2463
2493
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2464
2494
|
var TagSelect = ({
|
|
@@ -2471,9 +2501,9 @@ var TagSelect = ({
|
|
|
2471
2501
|
width,
|
|
2472
2502
|
className
|
|
2473
2503
|
}) => {
|
|
2474
|
-
const [open, setOpen] = (0,
|
|
2475
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2476
|
-
const inputRef = (0,
|
|
2504
|
+
const [open, setOpen] = (0, import_react23.useState)(false);
|
|
2505
|
+
const [searchTerm, setSearchTerm] = (0, import_react23.useState)("");
|
|
2506
|
+
const inputRef = (0, import_react23.useRef)(null);
|
|
2477
2507
|
const selectedValues = new Set(value.map((v) => v.value));
|
|
2478
2508
|
const filteredOptions = options.filter(
|
|
2479
2509
|
(o) => !selectedValues.has(o.value) && o.label.toLowerCase().includes(searchTerm.toLowerCase())
|
|
@@ -2584,7 +2614,7 @@ var TagSelect = ({
|
|
|
2584
2614
|
};
|
|
2585
2615
|
|
|
2586
2616
|
// src/ui/components/ui/Pagination.tsx
|
|
2587
|
-
var
|
|
2617
|
+
var import_react24 = require("react");
|
|
2588
2618
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2589
2619
|
var getPageNumbers = (current, total) => {
|
|
2590
2620
|
if (total <= 5) return Array.from({ length: total }, (_, i) => i + 1);
|
|
@@ -2602,7 +2632,7 @@ var Pagination = ({
|
|
|
2602
2632
|
summaryLabel
|
|
2603
2633
|
}) => {
|
|
2604
2634
|
const totalPages = Math.max(1, Math.ceil(totalItems / itemsPerPage));
|
|
2605
|
-
const pages = (0,
|
|
2635
|
+
const pages = (0, import_react24.useMemo)(
|
|
2606
2636
|
() => getPageNumbers(currentPage, totalPages),
|
|
2607
2637
|
[currentPage, totalPages]
|
|
2608
2638
|
);
|
|
@@ -2979,7 +3009,7 @@ var TableFooterCell = ({
|
|
|
2979
3009
|
);
|
|
2980
3010
|
|
|
2981
3011
|
// src/ui/components/ui/Avatar.tsx
|
|
2982
|
-
var
|
|
3012
|
+
var import_react25 = require("react");
|
|
2983
3013
|
var RadixAvatar = __toESM(require("@radix-ui/react-avatar"));
|
|
2984
3014
|
|
|
2985
3015
|
// src/utils/string/capitalizeFirstLetter.ts
|
|
@@ -3061,8 +3091,8 @@ var formatNameWithInitial = (firstname, lastname) => {
|
|
|
3061
3091
|
|
|
3062
3092
|
// src/ui/components/ui/Avatar.tsx
|
|
3063
3093
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3064
|
-
var AvatarSizeContext = (0,
|
|
3065
|
-
var useAvatarSize = () => (0,
|
|
3094
|
+
var AvatarSizeContext = (0, import_react25.createContext)(40);
|
|
3095
|
+
var useAvatarSize = () => (0, import_react25.useContext)(AvatarSizeContext);
|
|
3066
3096
|
var BADGE_BG_CLASS = {
|
|
3067
3097
|
"blue-700": "bg-blue-700",
|
|
3068
3098
|
"blue-900": "bg-blue-900",
|
|
@@ -3093,7 +3123,7 @@ var BADGE_ICON_COLOR_CLASS = {
|
|
|
3093
3123
|
"orange-600": "text-orange-600",
|
|
3094
3124
|
"purple-700": "text-purple-700"
|
|
3095
3125
|
};
|
|
3096
|
-
var Avatar = (0,
|
|
3126
|
+
var Avatar = (0, import_react25.forwardRef)(
|
|
3097
3127
|
(_a, ref) => {
|
|
3098
3128
|
var _b = _a, {
|
|
3099
3129
|
size = 40,
|
|
@@ -3146,7 +3176,7 @@ var Avatar = (0, import_react24.forwardRef)(
|
|
|
3146
3176
|
}
|
|
3147
3177
|
);
|
|
3148
3178
|
Avatar.displayName = "Avatar";
|
|
3149
|
-
var AvatarImage = (0,
|
|
3179
|
+
var AvatarImage = (0, import_react25.forwardRef)((_a, ref) => {
|
|
3150
3180
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3151
3181
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3152
3182
|
RadixAvatar.Image,
|
|
@@ -3172,7 +3202,7 @@ var FALLBACK_COLOR_CLASS = {
|
|
|
3172
3202
|
"orange-600": "bg-orange-600 text-white",
|
|
3173
3203
|
"purple-700": "bg-purple-700 text-white"
|
|
3174
3204
|
};
|
|
3175
|
-
var AvatarFallback = (0,
|
|
3205
|
+
var AvatarFallback = (0, import_react25.forwardRef)((_a, ref) => {
|
|
3176
3206
|
var _b = _a, { color = "grey-600", className, style } = _b, props = __objRest(_b, ["color", "className", "style"]);
|
|
3177
3207
|
const size = useAvatarSize();
|
|
3178
3208
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
@@ -3189,7 +3219,7 @@ var AvatarFallback = (0, import_react24.forwardRef)((_a, ref) => {
|
|
|
3189
3219
|
);
|
|
3190
3220
|
});
|
|
3191
3221
|
AvatarFallback.displayName = "AvatarFallback";
|
|
3192
|
-
var AvatarBadge = (0,
|
|
3222
|
+
var AvatarBadge = (0, import_react25.forwardRef)(
|
|
3193
3223
|
(_a, ref) => {
|
|
3194
3224
|
var _b = _a, { className, style } = _b, props = __objRest(_b, ["className", "style"]);
|
|
3195
3225
|
const size = useAvatarSize();
|
|
@@ -3220,14 +3250,14 @@ var AvatarGroup = (_a) => {
|
|
|
3220
3250
|
"className",
|
|
3221
3251
|
"children"
|
|
3222
3252
|
]);
|
|
3223
|
-
const items =
|
|
3224
|
-
|
|
3253
|
+
const items = import_react25.Children.toArray(children).filter(
|
|
3254
|
+
import_react25.isValidElement
|
|
3225
3255
|
);
|
|
3226
3256
|
const visible = max ? items.slice(0, max) : items;
|
|
3227
3257
|
const overflow = max ? items.length - max : 0;
|
|
3228
3258
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Layout, __spreadProps(__spreadValues({ className: cn("-space-x-2", className) }, props), { children: [
|
|
3229
3259
|
visible.map(
|
|
3230
|
-
(child, index) => (0,
|
|
3260
|
+
(child, index) => (0, import_react25.cloneElement)(child, {
|
|
3231
3261
|
key: index,
|
|
3232
3262
|
size,
|
|
3233
3263
|
className: cn("ring-2 ring-white", child.props.className)
|
|
@@ -3521,7 +3551,7 @@ var CollapsibleContent = (_a) => {
|
|
|
3521
3551
|
};
|
|
3522
3552
|
|
|
3523
3553
|
// src/ui/components/ui/Drawer.tsx
|
|
3524
|
-
var
|
|
3554
|
+
var import_react26 = require("react");
|
|
3525
3555
|
var import_vaul = require("vaul");
|
|
3526
3556
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3527
3557
|
var KEEP_OPEN_SELECTOR = '[role="dialog"], [role="listbox"], [data-drawer-keep-open]';
|
|
@@ -3541,8 +3571,10 @@ var Drawer = ({
|
|
|
3541
3571
|
className
|
|
3542
3572
|
}) => {
|
|
3543
3573
|
const isVertical = direction === "left" || direction === "right";
|
|
3544
|
-
const contentRef = (0,
|
|
3545
|
-
(0,
|
|
3574
|
+
const contentRef = (0, import_react26.useRef)(null);
|
|
3575
|
+
const overlayRef = (0, import_react26.useRef)(null);
|
|
3576
|
+
useAllowPortalScroll(modal && open, contentRef, overlayRef);
|
|
3577
|
+
(0, import_react26.useEffect)(() => {
|
|
3546
3578
|
if (modal || !open || typeof document === "undefined") return;
|
|
3547
3579
|
const handlePointerDown = (event) => {
|
|
3548
3580
|
var _a;
|
|
@@ -3555,6 +3587,13 @@ var Drawer = ({
|
|
|
3555
3587
|
document.addEventListener("pointerdown", handlePointerDown);
|
|
3556
3588
|
return () => document.removeEventListener("pointerdown", handlePointerDown);
|
|
3557
3589
|
}, [modal, open, onClose]);
|
|
3590
|
+
(0, import_react26.useEffect)(() => {
|
|
3591
|
+
if (modal || !open) return;
|
|
3592
|
+
const frame = requestAnimationFrame(() => {
|
|
3593
|
+
document.body.style.pointerEvents = "auto";
|
|
3594
|
+
});
|
|
3595
|
+
return () => cancelAnimationFrame(frame);
|
|
3596
|
+
}, [modal, open]);
|
|
3558
3597
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3559
3598
|
import_vaul.Drawer.Root,
|
|
3560
3599
|
{
|
|
@@ -3563,7 +3602,13 @@ var Drawer = ({
|
|
|
3563
3602
|
open,
|
|
3564
3603
|
onOpenChange: (next) => !next && (onClose == null ? void 0 : onClose()),
|
|
3565
3604
|
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_vaul.Drawer.Portal, { children: [
|
|
3566
|
-
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3605
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3606
|
+
import_vaul.Drawer.Overlay,
|
|
3607
|
+
{
|
|
3608
|
+
ref: overlayRef,
|
|
3609
|
+
className: "fixed inset-0 z-40 bg-black/35"
|
|
3610
|
+
}
|
|
3611
|
+
),
|
|
3567
3612
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3568
3613
|
import_vaul.Drawer.Content,
|
|
3569
3614
|
{
|
|
@@ -3685,17 +3730,17 @@ var Popover = ({
|
|
|
3685
3730
|
] });
|
|
3686
3731
|
|
|
3687
3732
|
// src/ui/components/ui/sidebar/Sidebar.tsx
|
|
3688
|
-
var
|
|
3733
|
+
var import_react28 = require("react");
|
|
3689
3734
|
|
|
3690
3735
|
// src/ui/components/ui/sidebar/SidebarContext.ts
|
|
3691
|
-
var
|
|
3692
|
-
var SidebarCollapsedContext = (0,
|
|
3736
|
+
var import_react27 = require("react");
|
|
3737
|
+
var SidebarCollapsedContext = (0, import_react27.createContext)(false);
|
|
3693
3738
|
var SidebarCollapsedProvider = SidebarCollapsedContext.Provider;
|
|
3694
|
-
var useSidebarCollapsed = () => (0,
|
|
3739
|
+
var useSidebarCollapsed = () => (0, import_react27.useContext)(SidebarCollapsedContext);
|
|
3695
3740
|
|
|
3696
3741
|
// src/ui/components/ui/sidebar/Sidebar.tsx
|
|
3697
3742
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3698
|
-
var Sidebar = (0,
|
|
3743
|
+
var Sidebar = (0, import_react28.forwardRef)(
|
|
3699
3744
|
(_a, ref) => {
|
|
3700
3745
|
var _b = _a, { collapsed = false, className, children } = _b, props = __objRest(_b, ["collapsed", "className", "children"]);
|
|
3701
3746
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SidebarCollapsedProvider, { value: collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
@@ -3716,9 +3761,9 @@ var Sidebar = (0, import_react27.forwardRef)(
|
|
|
3716
3761
|
Sidebar.displayName = "Sidebar";
|
|
3717
3762
|
|
|
3718
3763
|
// src/ui/components/ui/sidebar/SidebarTrigger.tsx
|
|
3719
|
-
var
|
|
3764
|
+
var import_react29 = require("react");
|
|
3720
3765
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3721
|
-
var SidebarTrigger = (0,
|
|
3766
|
+
var SidebarTrigger = (0, import_react29.forwardRef)((_a, ref) => {
|
|
3722
3767
|
var _b = _a, { collapsed, className } = _b, props = __objRest(_b, ["collapsed", "className"]);
|
|
3723
3768
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3724
3769
|
"button",
|
|
@@ -3745,9 +3790,9 @@ var SidebarTrigger = (0, import_react28.forwardRef)((_a, ref) => {
|
|
|
3745
3790
|
SidebarTrigger.displayName = "SidebarTrigger";
|
|
3746
3791
|
|
|
3747
3792
|
// src/ui/components/ui/sidebar/SidebarHeader.tsx
|
|
3748
|
-
var
|
|
3793
|
+
var import_react30 = require("react");
|
|
3749
3794
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3750
|
-
var SidebarHeader = (0,
|
|
3795
|
+
var SidebarHeader = (0, import_react30.forwardRef)(
|
|
3751
3796
|
(_a, ref) => {
|
|
3752
3797
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3753
3798
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
@@ -3762,9 +3807,9 @@ var SidebarHeader = (0, import_react29.forwardRef)(
|
|
|
3762
3807
|
SidebarHeader.displayName = "SidebarHeader";
|
|
3763
3808
|
|
|
3764
3809
|
// src/ui/components/ui/sidebar/SidebarContent.tsx
|
|
3765
|
-
var
|
|
3810
|
+
var import_react31 = require("react");
|
|
3766
3811
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3767
|
-
var SidebarContent = (0,
|
|
3812
|
+
var SidebarContent = (0, import_react31.forwardRef)(
|
|
3768
3813
|
(_a, ref) => {
|
|
3769
3814
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3770
3815
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
@@ -3783,9 +3828,9 @@ var SidebarContent = (0, import_react30.forwardRef)(
|
|
|
3783
3828
|
SidebarContent.displayName = "SidebarContent";
|
|
3784
3829
|
|
|
3785
3830
|
// src/ui/components/ui/sidebar/SidebarGroup.tsx
|
|
3786
|
-
var
|
|
3831
|
+
var import_react32 = require("react");
|
|
3787
3832
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3788
|
-
var SidebarGroup = (0,
|
|
3833
|
+
var SidebarGroup = (0, import_react32.forwardRef)(
|
|
3789
3834
|
(_a, ref) => {
|
|
3790
3835
|
var _b = _a, { label, className, children } = _b, props = __objRest(_b, ["label", "className", "children"]);
|
|
3791
3836
|
const collapsed = useSidebarCollapsed();
|
|
@@ -3806,9 +3851,9 @@ var SidebarGroup = (0, import_react31.forwardRef)(
|
|
|
3806
3851
|
SidebarGroup.displayName = "SidebarGroup";
|
|
3807
3852
|
|
|
3808
3853
|
// src/ui/components/ui/sidebar/SidebarMenuButton.tsx
|
|
3809
|
-
var
|
|
3854
|
+
var import_react33 = require("react");
|
|
3810
3855
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3811
|
-
var SidebarMenuButton = (0,
|
|
3856
|
+
var SidebarMenuButton = (0, import_react33.forwardRef)(
|
|
3812
3857
|
(_a, ref) => {
|
|
3813
3858
|
var _b = _a, {
|
|
3814
3859
|
icon,
|
|
@@ -3888,9 +3933,9 @@ var SidebarMenuButton = (0, import_react32.forwardRef)(
|
|
|
3888
3933
|
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
3889
3934
|
|
|
3890
3935
|
// src/ui/components/ui/sidebar/SidebarMenuSub.tsx
|
|
3891
|
-
var
|
|
3936
|
+
var import_react34 = require("react");
|
|
3892
3937
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3893
|
-
var SidebarMenuSub = (0,
|
|
3938
|
+
var SidebarMenuSub = (0, import_react34.forwardRef)(
|
|
3894
3939
|
(_a, ref) => {
|
|
3895
3940
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3896
3941
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
@@ -3908,22 +3953,22 @@ var SidebarMenuSub = (0, import_react33.forwardRef)(
|
|
|
3908
3953
|
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
3909
3954
|
|
|
3910
3955
|
// src/ui/components/ui/sidebar/SidebarMenuSubItem.tsx
|
|
3911
|
-
var
|
|
3956
|
+
var import_react35 = require("react");
|
|
3912
3957
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3913
|
-
var SidebarMenuSubItem = (0,
|
|
3958
|
+
var SidebarMenuSubItem = (0, import_react35.forwardRef)((_a, ref) => {
|
|
3914
3959
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3915
3960
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("li", __spreadValues({ ref, className: cn("relative", className) }, props));
|
|
3916
3961
|
});
|
|
3917
3962
|
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
3918
3963
|
|
|
3919
3964
|
// src/ui/components/ui/sidebar/SidebarMenuSubButton.tsx
|
|
3920
|
-
var
|
|
3965
|
+
var import_react36 = require("react");
|
|
3921
3966
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3922
3967
|
var SIZE_CLASS = {
|
|
3923
3968
|
default: "h-10",
|
|
3924
3969
|
lg: "h-14"
|
|
3925
3970
|
};
|
|
3926
|
-
var SidebarMenuSubButton = (0,
|
|
3971
|
+
var SidebarMenuSubButton = (0, import_react36.forwardRef)((_a, ref) => {
|
|
3927
3972
|
var _b = _a, { active, size = "default", className } = _b, props = __objRest(_b, ["active", "size", "className"]);
|
|
3928
3973
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3929
3974
|
"button",
|
|
@@ -3944,9 +3989,9 @@ var SidebarMenuSubButton = (0, import_react35.forwardRef)((_a, ref) => {
|
|
|
3944
3989
|
SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
3945
3990
|
|
|
3946
3991
|
// src/ui/components/ui/sidebar/SidebarFooter.tsx
|
|
3947
|
-
var
|
|
3992
|
+
var import_react37 = require("react");
|
|
3948
3993
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3949
|
-
var SidebarFooter = (0,
|
|
3994
|
+
var SidebarFooter = (0, import_react37.forwardRef)(
|
|
3950
3995
|
(_a, ref) => {
|
|
3951
3996
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3952
3997
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
@@ -3984,9 +4029,9 @@ var SidebarSupportInfo = ({
|
|
|
3984
4029
|
};
|
|
3985
4030
|
|
|
3986
4031
|
// src/ui/components/ui/sidebar/SidebarMenuSearchInput.tsx
|
|
3987
|
-
var
|
|
4032
|
+
var import_react38 = require("react");
|
|
3988
4033
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3989
|
-
var SidebarMenuSearchInput = (0,
|
|
4034
|
+
var SidebarMenuSearchInput = (0, import_react38.forwardRef)((_a, ref) => {
|
|
3990
4035
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3991
4036
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(InputGroup, { children: [
|
|
3992
4037
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(InputGroupAddon, { align: "inline-start", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FaIcon, { name: "magnifying-glass", size: 14, className: "text-white/50" }) }),
|
|
@@ -4005,7 +4050,7 @@ var SidebarMenuSearchInput = (0, import_react37.forwardRef)((_a, ref) => {
|
|
|
4005
4050
|
SidebarMenuSearchInput.displayName = "SidebarMenuSearchInput";
|
|
4006
4051
|
|
|
4007
4052
|
// src/ui/components/ui/sidebar/SidebarUserMenu.tsx
|
|
4008
|
-
var
|
|
4053
|
+
var import_react39 = require("react");
|
|
4009
4054
|
var RadixPopover4 = __toESM(require("@radix-ui/react-popover"));
|
|
4010
4055
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4011
4056
|
var panelClassName = cn(
|
|
@@ -4022,7 +4067,7 @@ var SidebarUserMenu = ({
|
|
|
4022
4067
|
className
|
|
4023
4068
|
}) => {
|
|
4024
4069
|
const collapsed = useSidebarCollapsed();
|
|
4025
|
-
const [open, setOpen] = (0,
|
|
4070
|
+
const [open, setOpen] = (0, import_react39.useState)(false);
|
|
4026
4071
|
const runAndClose = (action) => {
|
|
4027
4072
|
action();
|
|
4028
4073
|
setOpen(false);
|
|
@@ -4318,7 +4363,7 @@ var toast = {
|
|
|
4318
4363
|
};
|
|
4319
4364
|
|
|
4320
4365
|
// src/ui/components/ui/PageContainer.tsx
|
|
4321
|
-
var
|
|
4366
|
+
var import_react40 = require("react");
|
|
4322
4367
|
var import_class_variance_authority13 = require("class-variance-authority");
|
|
4323
4368
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4324
4369
|
var pageContainerVariants = (0, import_class_variance_authority13.cva)(
|
|
@@ -4335,7 +4380,7 @@ var pageContainerVariants = (0, import_class_variance_authority13.cva)(
|
|
|
4335
4380
|
defaultVariants: { padding: "md" }
|
|
4336
4381
|
}
|
|
4337
4382
|
);
|
|
4338
|
-
var PageContainer = (0,
|
|
4383
|
+
var PageContainer = (0, import_react40.forwardRef)(
|
|
4339
4384
|
(_a, ref) => {
|
|
4340
4385
|
var _b = _a, { padding, className } = _b, props = __objRest(_b, ["padding", "className"]);
|
|
4341
4386
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
@@ -4350,7 +4395,7 @@ var PageContainer = (0, import_react39.forwardRef)(
|
|
|
4350
4395
|
PageContainer.displayName = "PageContainer";
|
|
4351
4396
|
|
|
4352
4397
|
// src/ui/components/ui/IconTabs.tsx
|
|
4353
|
-
var
|
|
4398
|
+
var import_react41 = require("react");
|
|
4354
4399
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4355
4400
|
var IconTabs = ({
|
|
4356
4401
|
items,
|
|
@@ -4360,10 +4405,10 @@ var IconTabs = ({
|
|
|
4360
4405
|
className
|
|
4361
4406
|
}) => {
|
|
4362
4407
|
var _a;
|
|
4363
|
-
const listRef = (0,
|
|
4364
|
-
const tabRefs = (0,
|
|
4365
|
-
const [bar, setBar] = (0,
|
|
4366
|
-
const updateBar = (0,
|
|
4408
|
+
const listRef = (0, import_react41.useRef)(null);
|
|
4409
|
+
const tabRefs = (0, import_react41.useRef)([]);
|
|
4410
|
+
const [bar, setBar] = (0, import_react41.useState)({ left: 0, top: 0, width: 0, height: 0 });
|
|
4411
|
+
const updateBar = (0, import_react41.useCallback)(() => {
|
|
4367
4412
|
const root = listRef.current;
|
|
4368
4413
|
const activeEl = tabRefs.current[value];
|
|
4369
4414
|
if (!root || !activeEl) return;
|
|
@@ -4376,7 +4421,7 @@ var IconTabs = ({
|
|
|
4376
4421
|
height: box.height
|
|
4377
4422
|
});
|
|
4378
4423
|
}, [value]);
|
|
4379
|
-
(0,
|
|
4424
|
+
(0, import_react41.useEffect)(() => {
|
|
4380
4425
|
updateBar();
|
|
4381
4426
|
const ro = new ResizeObserver(updateBar);
|
|
4382
4427
|
if (listRef.current) ro.observe(listRef.current);
|
|
@@ -4558,7 +4603,7 @@ var Banner = ({
|
|
|
4558
4603
|
};
|
|
4559
4604
|
|
|
4560
4605
|
// src/ui/components/ui/FloatingButton.tsx
|
|
4561
|
-
var
|
|
4606
|
+
var import_react42 = require("react");
|
|
4562
4607
|
|
|
4563
4608
|
// src/ui/lib/floatingArc.ts
|
|
4564
4609
|
var MAX_STEP = 65;
|
|
@@ -4710,17 +4755,17 @@ var FloatingButton = ({
|
|
|
4710
4755
|
persistKey,
|
|
4711
4756
|
safeArea
|
|
4712
4757
|
}) => {
|
|
4713
|
-
const containerRef = (0,
|
|
4714
|
-
const [placement, setPlacement] = (0,
|
|
4758
|
+
const containerRef = (0, import_react42.useRef)(null);
|
|
4759
|
+
const [placement, setPlacement] = (0, import_react42.useState)(() => ({
|
|
4715
4760
|
geometry: __spreadValues({ base: 90 }, arcLayout(actions.length, ARC_RADIUS, SUB_SIZE)),
|
|
4716
4761
|
shift: { x: 0, y: 0 }
|
|
4717
4762
|
}));
|
|
4718
|
-
const [isDragging, setIsDragging] = (0,
|
|
4719
|
-
const [offset, setOffset] = (0,
|
|
4720
|
-
const offsetRef = (0,
|
|
4721
|
-
const lastPointRef = (0,
|
|
4722
|
-
const dragDistanceRef = (0,
|
|
4723
|
-
const clampOffset = (0,
|
|
4763
|
+
const [isDragging, setIsDragging] = (0, import_react42.useState)(false);
|
|
4764
|
+
const [offset, setOffset] = (0, import_react42.useState)(() => readStoredOffset(persistKey));
|
|
4765
|
+
const offsetRef = (0, import_react42.useRef)(offset);
|
|
4766
|
+
const lastPointRef = (0, import_react42.useRef)({ x: 0, y: 0 });
|
|
4767
|
+
const dragDistanceRef = (0, import_react42.useRef)(0);
|
|
4768
|
+
const clampOffset = (0, import_react42.useCallback)(
|
|
4724
4769
|
(next) => {
|
|
4725
4770
|
var _a, _b, _c, _d;
|
|
4726
4771
|
const el = containerRef.current;
|
|
@@ -4740,14 +4785,14 @@ var FloatingButton = ({
|
|
|
4740
4785
|
},
|
|
4741
4786
|
[safeArea == null ? void 0 : safeArea.left, safeArea == null ? void 0 : safeArea.top, safeArea == null ? void 0 : safeArea.right, safeArea == null ? void 0 : safeArea.bottom]
|
|
4742
4787
|
);
|
|
4743
|
-
(0,
|
|
4788
|
+
(0, import_react42.useLayoutEffect)(() => {
|
|
4744
4789
|
const corrected = clampOffset(offsetRef.current);
|
|
4745
4790
|
if (corrected.x === offsetRef.current.x && corrected.y === offsetRef.current.y)
|
|
4746
4791
|
return;
|
|
4747
4792
|
offsetRef.current = corrected;
|
|
4748
4793
|
setOffset(corrected);
|
|
4749
4794
|
}, [clampOffset]);
|
|
4750
|
-
(0,
|
|
4795
|
+
(0, import_react42.useEffect)(() => {
|
|
4751
4796
|
if (!draggable || !isDragging) return;
|
|
4752
4797
|
const onPointerMove = (e) => {
|
|
4753
4798
|
const dx = e.clientX - lastPointRef.current.x;
|
|
@@ -4783,7 +4828,7 @@ var FloatingButton = ({
|
|
|
4783
4828
|
window.removeEventListener("pointercancel", endDrag);
|
|
4784
4829
|
};
|
|
4785
4830
|
}, [draggable, isDragging, persistKey, clampOffset]);
|
|
4786
|
-
const resolvePlacement = (0,
|
|
4831
|
+
const resolvePlacement = (0, import_react42.useCallback)(() => {
|
|
4787
4832
|
var _a, _b, _c, _d;
|
|
4788
4833
|
const el = containerRef.current;
|
|
4789
4834
|
if (!el || typeof window === "undefined") return;
|
|
@@ -4812,13 +4857,13 @@ var FloatingButton = ({
|
|
|
4812
4857
|
safeArea == null ? void 0 : safeArea.right,
|
|
4813
4858
|
safeArea == null ? void 0 : safeArea.bottom
|
|
4814
4859
|
]);
|
|
4815
|
-
(0,
|
|
4860
|
+
(0, import_react42.useLayoutEffect)(() => {
|
|
4816
4861
|
if (isOpen) resolvePlacement();
|
|
4817
4862
|
}, [isOpen, offset, resolvePlacement]);
|
|
4818
|
-
(0,
|
|
4863
|
+
(0, import_react42.useLayoutEffect)(() => {
|
|
4819
4864
|
resolvePlacement();
|
|
4820
4865
|
}, [resolvePlacement]);
|
|
4821
|
-
(0,
|
|
4866
|
+
(0, import_react42.useEffect)(() => {
|
|
4822
4867
|
if (typeof window === "undefined") return;
|
|
4823
4868
|
const onResize = () => {
|
|
4824
4869
|
resolvePlacement();
|
|
@@ -5346,7 +5391,7 @@ var Timeline = ({
|
|
|
5346
5391
|
};
|
|
5347
5392
|
|
|
5348
5393
|
// src/ui/components/ui/ColorPicker.tsx
|
|
5349
|
-
var
|
|
5394
|
+
var import_react43 = require("react");
|
|
5350
5395
|
var import_class_variance_authority15 = require("class-variance-authority");
|
|
5351
5396
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5352
5397
|
var swatchVariants = (0, import_class_variance_authority15.cva)(
|
|
@@ -5375,7 +5420,7 @@ var inputVariants = (0, import_class_variance_authority15.cva)(
|
|
|
5375
5420
|
defaultVariants: { size: "m" }
|
|
5376
5421
|
}
|
|
5377
5422
|
);
|
|
5378
|
-
var ColorPicker = (0,
|
|
5423
|
+
var ColorPicker = (0, import_react43.forwardRef)(
|
|
5379
5424
|
({
|
|
5380
5425
|
label,
|
|
5381
5426
|
value,
|
|
@@ -5385,7 +5430,7 @@ var ColorPicker = (0, import_react42.forwardRef)(
|
|
|
5385
5430
|
size,
|
|
5386
5431
|
className
|
|
5387
5432
|
}, ref) => {
|
|
5388
|
-
const [internalColor, setInternalColor] = (0,
|
|
5433
|
+
const [internalColor, setInternalColor] = (0, import_react43.useState)(defaultValue);
|
|
5389
5434
|
const currentColor = value !== void 0 ? value : internalColor;
|
|
5390
5435
|
const handleChange = (e) => {
|
|
5391
5436
|
const next = e.target.value;
|
|
@@ -5449,7 +5494,7 @@ var ColorPicker = (0, import_react42.forwardRef)(
|
|
|
5449
5494
|
ColorPicker.displayName = "ColorPicker";
|
|
5450
5495
|
|
|
5451
5496
|
// src/ui/components/ui/FileUploadZone.tsx
|
|
5452
|
-
var
|
|
5497
|
+
var import_react44 = require("react");
|
|
5453
5498
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5454
5499
|
var ACCEPT_MAP = {
|
|
5455
5500
|
png: "image/png",
|
|
@@ -5482,23 +5527,23 @@ var FileUploadZone = ({
|
|
|
5482
5527
|
showFileName = false,
|
|
5483
5528
|
className
|
|
5484
5529
|
}) => {
|
|
5485
|
-
const [isDragging, setIsDragging] = (0,
|
|
5486
|
-
const [internalPreviewUrl, setInternalPreviewUrl] = (0,
|
|
5530
|
+
const [isDragging, setIsDragging] = (0, import_react44.useState)(false);
|
|
5531
|
+
const [internalPreviewUrl, setInternalPreviewUrl] = (0, import_react44.useState)(
|
|
5487
5532
|
null
|
|
5488
5533
|
);
|
|
5489
|
-
const [fileType, setFileType] = (0,
|
|
5490
|
-
const [fileName, setFileName] = (0,
|
|
5491
|
-
const [inlineError, setInlineError] = (0,
|
|
5492
|
-
const inputRef = (0,
|
|
5534
|
+
const [fileType, setFileType] = (0, import_react44.useState)(null);
|
|
5535
|
+
const [fileName, setFileName] = (0, import_react44.useState)(null);
|
|
5536
|
+
const [inlineError, setInlineError] = (0, import_react44.useState)(null);
|
|
5537
|
+
const inputRef = (0, import_react44.useRef)(null);
|
|
5493
5538
|
const resolvedAccept = acceptOnlyPdf ? PDF_ONLY : accept;
|
|
5494
5539
|
const mimeTypes = getMimeTypes(resolvedAccept);
|
|
5495
5540
|
const acceptString = mimeTypes.join(",");
|
|
5496
5541
|
const previewUrl = multiple ? null : controlledPreviewUrl || (showPreview ? internalPreviewUrl : null);
|
|
5497
|
-
const emitError = (0,
|
|
5542
|
+
const emitError = (0, import_react44.useCallback)(
|
|
5498
5543
|
(message) => onError ? onError(message) : setInlineError(message),
|
|
5499
5544
|
[onError]
|
|
5500
5545
|
);
|
|
5501
|
-
const validateFile = (0,
|
|
5546
|
+
const validateFile = (0, import_react44.useCallback)(
|
|
5502
5547
|
(file) => {
|
|
5503
5548
|
if (!mimeTypes.includes(file.type))
|
|
5504
5549
|
return { ok: false, error: "Format de fichier non accept\xE9." };
|
|
@@ -5512,7 +5557,7 @@ var FileUploadZone = ({
|
|
|
5512
5557
|
},
|
|
5513
5558
|
[mimeTypes, maxSizeMB]
|
|
5514
5559
|
);
|
|
5515
|
-
const processFile = (0,
|
|
5560
|
+
const processFile = (0, import_react44.useCallback)(
|
|
5516
5561
|
(file) => {
|
|
5517
5562
|
setInlineError(null);
|
|
5518
5563
|
const result = validateFile(file);
|
|
@@ -5527,7 +5572,7 @@ var FileUploadZone = ({
|
|
|
5527
5572
|
},
|
|
5528
5573
|
[validateFile, onSave, showPreview, emitError]
|
|
5529
5574
|
);
|
|
5530
|
-
const processFiles = (0,
|
|
5575
|
+
const processFiles = (0, import_react44.useCallback)(
|
|
5531
5576
|
(files) => {
|
|
5532
5577
|
setInlineError(null);
|
|
5533
5578
|
for (const file of files) {
|
|
@@ -5686,7 +5731,7 @@ var FileUploadZone = ({
|
|
|
5686
5731
|
};
|
|
5687
5732
|
|
|
5688
5733
|
// src/ui/components/ui/FilePicker.tsx
|
|
5689
|
-
var
|
|
5734
|
+
var import_react45 = require("react");
|
|
5690
5735
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5691
5736
|
var FilePicker = ({
|
|
5692
5737
|
label,
|
|
@@ -5700,7 +5745,7 @@ var FilePicker = ({
|
|
|
5700
5745
|
disabled = false,
|
|
5701
5746
|
className
|
|
5702
5747
|
}) => {
|
|
5703
|
-
const inputRef = (0,
|
|
5748
|
+
const inputRef = (0, import_react45.useRef)(null);
|
|
5704
5749
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
5705
5750
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5706
5751
|
"input",
|
|
@@ -5738,7 +5783,7 @@ var FilePicker = ({
|
|
|
5738
5783
|
};
|
|
5739
5784
|
|
|
5740
5785
|
// src/ui/components/ui/Item.tsx
|
|
5741
|
-
var
|
|
5786
|
+
var import_react46 = require("react");
|
|
5742
5787
|
var import_class_variance_authority16 = require("class-variance-authority");
|
|
5743
5788
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
5744
5789
|
var itemVariants = (0, import_class_variance_authority16.cva)(
|
|
@@ -5758,7 +5803,7 @@ var itemVariants = (0, import_class_variance_authority16.cva)(
|
|
|
5758
5803
|
defaultVariants: { variant: "default", size: "default" }
|
|
5759
5804
|
}
|
|
5760
5805
|
);
|
|
5761
|
-
var Item3 = (0,
|
|
5806
|
+
var Item3 = (0, import_react46.forwardRef)(
|
|
5762
5807
|
(_a, ref) => {
|
|
5763
5808
|
var _b = _a, { variant, size, className } = _b, props = __objRest(_b, ["variant", "size", "className"]);
|
|
5764
5809
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
@@ -5917,7 +5962,7 @@ var Attachment = ({
|
|
|
5917
5962
|
};
|
|
5918
5963
|
|
|
5919
5964
|
// src/ui/components/ui/PdfPreview.tsx
|
|
5920
|
-
var
|
|
5965
|
+
var import_react47 = require("react");
|
|
5921
5966
|
var import_react_pdf = require("react-pdf");
|
|
5922
5967
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
5923
5968
|
import_react_pdf.pdfjs.GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${import_react_pdf.pdfjs.version}/build/pdf.worker.min.mjs`;
|
|
@@ -5927,8 +5972,8 @@ var PdfPreview = ({
|
|
|
5927
5972
|
maxHeight = "600px",
|
|
5928
5973
|
className
|
|
5929
5974
|
}) => {
|
|
5930
|
-
const [hasError, setHasError] = (0,
|
|
5931
|
-
const [numPages, setNumPages] = (0,
|
|
5975
|
+
const [hasError, setHasError] = (0, import_react47.useState)(false);
|
|
5976
|
+
const [numPages, setNumPages] = (0, import_react47.useState)(0);
|
|
5932
5977
|
const height = Math.round(width * 1.3);
|
|
5933
5978
|
const thumbnailSkeleton = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Skeleton, { width, height });
|
|
5934
5979
|
if (hasError) {
|
|
@@ -5984,7 +6029,7 @@ var PdfPreview = ({
|
|
|
5984
6029
|
};
|
|
5985
6030
|
|
|
5986
6031
|
// src/ui/components/ui/VideoPlayer.tsx
|
|
5987
|
-
var
|
|
6032
|
+
var import_react48 = require("react");
|
|
5988
6033
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
5989
6034
|
var formatVideoDuration = (seconds) => {
|
|
5990
6035
|
if (seconds === void 0 || !Number.isFinite(seconds) || seconds < 0)
|
|
@@ -6024,20 +6069,20 @@ var VideoPlayer = ({
|
|
|
6024
6069
|
defaultVolume = DEFAULT_VOLUME,
|
|
6025
6070
|
className
|
|
6026
6071
|
}) => {
|
|
6027
|
-
const [isInlinePlaying, setIsInlinePlaying] = (0,
|
|
6028
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
6029
|
-
const [hasPosterError, setHasPosterError] = (0,
|
|
6030
|
-
const [hasFramePreviewError, setHasFramePreviewError] = (0,
|
|
6031
|
-
const inlineVideoRef = (0,
|
|
6032
|
-
const expandedVideoRef = (0,
|
|
6033
|
-
(0,
|
|
6072
|
+
const [isInlinePlaying, setIsInlinePlaying] = (0, import_react48.useState)(false);
|
|
6073
|
+
const [isExpanded, setIsExpanded] = (0, import_react48.useState)(false);
|
|
6074
|
+
const [hasPosterError, setHasPosterError] = (0, import_react48.useState)(false);
|
|
6075
|
+
const [hasFramePreviewError, setHasFramePreviewError] = (0, import_react48.useState)(false);
|
|
6076
|
+
const inlineVideoRef = (0, import_react48.useRef)(null);
|
|
6077
|
+
const expandedVideoRef = (0, import_react48.useRef)(null);
|
|
6078
|
+
(0, import_react48.useEffect)(() => {
|
|
6034
6079
|
setHasPosterError(false);
|
|
6035
6080
|
}, [poster]);
|
|
6036
|
-
(0,
|
|
6081
|
+
(0, import_react48.useEffect)(() => {
|
|
6037
6082
|
setHasFramePreviewError(false);
|
|
6038
6083
|
}, [src]);
|
|
6039
6084
|
const visiblePoster = hasPosterError ? void 0 : poster;
|
|
6040
|
-
const attachExpandedVideo = (0,
|
|
6085
|
+
const attachExpandedVideo = (0, import_react48.useCallback)(
|
|
6041
6086
|
(video) => {
|
|
6042
6087
|
expandedVideoRef.current = video;
|
|
6043
6088
|
if (video) video.volume = clampVolume(defaultVolume);
|
|
@@ -6049,7 +6094,7 @@ var VideoPlayer = ({
|
|
|
6049
6094
|
e.preventDefault();
|
|
6050
6095
|
(_a = expandedVideoRef.current) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
6051
6096
|
};
|
|
6052
|
-
const attachInlineVideo = (0,
|
|
6097
|
+
const attachInlineVideo = (0, import_react48.useCallback)(
|
|
6053
6098
|
(video) => {
|
|
6054
6099
|
inlineVideoRef.current = video;
|
|
6055
6100
|
if (video) video.volume = clampVolume(defaultVolume);
|
|
@@ -6310,7 +6355,7 @@ var ScrollArea = (_a) => {
|
|
|
6310
6355
|
};
|
|
6311
6356
|
|
|
6312
6357
|
// src/ui/components/ui/Message.tsx
|
|
6313
|
-
var
|
|
6358
|
+
var import_react49 = require("react");
|
|
6314
6359
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
6315
6360
|
var BUBBLE_BACKGROUND = {
|
|
6316
6361
|
own: { solid: "bg-blue-700", pale: "bg-blue-50" },
|
|
@@ -6322,7 +6367,7 @@ var BUBBLE_TAIL = {
|
|
|
6322
6367
|
teammate: "rounded-br-none",
|
|
6323
6368
|
other: "rounded-bl-none"
|
|
6324
6369
|
};
|
|
6325
|
-
var Message = (0,
|
|
6370
|
+
var Message = (0, import_react49.forwardRef)(
|
|
6326
6371
|
(_a, ref) => {
|
|
6327
6372
|
var _b = _a, {
|
|
6328
6373
|
isOwn = false,
|
|
@@ -6464,7 +6509,7 @@ var Message = (0, import_react48.forwardRef)(
|
|
|
6464
6509
|
Message.displayName = "Message";
|
|
6465
6510
|
|
|
6466
6511
|
// src/ui/components/ui/MessageScroller.tsx
|
|
6467
|
-
var
|
|
6512
|
+
var import_react50 = require("react");
|
|
6468
6513
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
6469
6514
|
var SEPARATOR_LINE = {
|
|
6470
6515
|
neutral: "",
|
|
@@ -6516,9 +6561,9 @@ var MessageScroller = ({
|
|
|
6516
6561
|
viewportRef,
|
|
6517
6562
|
className
|
|
6518
6563
|
}) => {
|
|
6519
|
-
const fallbackRef = (0,
|
|
6564
|
+
const fallbackRef = (0, import_react50.useRef)(null);
|
|
6520
6565
|
const scrollerRef = viewportRef != null ? viewportRef : fallbackRef;
|
|
6521
|
-
(0,
|
|
6566
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
6522
6567
|
if (!autoScroll) return;
|
|
6523
6568
|
const viewport = scrollerRef.current;
|
|
6524
6569
|
if (!viewport) return;
|
|
@@ -6572,7 +6617,7 @@ var MessageScroller = ({
|
|
|
6572
6617
|
};
|
|
6573
6618
|
|
|
6574
6619
|
// src/ui/components/ui/Stepper.tsx
|
|
6575
|
-
var
|
|
6620
|
+
var import_react51 = require("react");
|
|
6576
6621
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
6577
6622
|
var Stepper = ({
|
|
6578
6623
|
numberOfSteps,
|
|
@@ -6590,7 +6635,7 @@ var Stepper = ({
|
|
|
6590
6635
|
children: Array.from({ length: numberOfSteps }, (_, i) => {
|
|
6591
6636
|
const isActive = i === current;
|
|
6592
6637
|
const isCompleted = i < current;
|
|
6593
|
-
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
6638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_react51.Fragment, { children: [
|
|
6594
6639
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
6595
6640
|
"div",
|
|
6596
6641
|
{
|
|
@@ -6610,7 +6655,7 @@ var Stepper = ({
|
|
|
6610
6655
|
);
|
|
6611
6656
|
|
|
6612
6657
|
// src/ui/components/ui/DatePicker.tsx
|
|
6613
|
-
var
|
|
6658
|
+
var import_react52 = require("react");
|
|
6614
6659
|
var import_react_day_picker = require("react-day-picker");
|
|
6615
6660
|
var import_locale = require("react-day-picker/locale");
|
|
6616
6661
|
var import_style2 = require("react-day-picker/style.css");
|
|
@@ -6671,8 +6716,8 @@ var DatePicker = ({
|
|
|
6671
6716
|
className
|
|
6672
6717
|
}) => {
|
|
6673
6718
|
const isRange = mode === "range";
|
|
6674
|
-
const [open, setOpen] = (0,
|
|
6675
|
-
const [activePreset, setActivePreset] = (0,
|
|
6719
|
+
const [open, setOpen] = (0, import_react52.useState)(false);
|
|
6720
|
+
const [activePreset, setActivePreset] = (0, import_react52.useState)(null);
|
|
6676
6721
|
const resolvedPresets = presets != null ? presets : isRange ? RANGE_PRESETS : SINGLE_PRESETS;
|
|
6677
6722
|
const displayText = isRange ? startDate && endDate ? `${(0, import_date_fns.format)(startDate, "dd/MM/yyyy")} \u2014 ${(0, import_date_fns.format)(endDate, "dd/MM/yyyy")}` : placeholder != null ? placeholder : "S\xE9lectionner une p\xE9riode" : value ? (0, import_date_fns.format)(value, "dd/MM/yyyy") : placeholder != null ? placeholder : "S\xE9lectionner une date";
|
|
6678
6723
|
const hasValue = isRange ? Boolean(startDate && endDate) : Boolean(value);
|
package/dist/ui/index.mjs
CHANGED
|
@@ -1878,11 +1878,36 @@ var Tabs = ({
|
|
|
1878
1878
|
import {
|
|
1879
1879
|
createContext,
|
|
1880
1880
|
useContext,
|
|
1881
|
-
useEffect as
|
|
1881
|
+
useEffect as useEffect4,
|
|
1882
1882
|
useRef as useRef3,
|
|
1883
1883
|
useState as useState3
|
|
1884
1884
|
} from "react";
|
|
1885
1885
|
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
1886
|
+
|
|
1887
|
+
// src/ui/lib/portalScroll.ts
|
|
1888
|
+
import { useEffect as useEffect3 } from "react";
|
|
1889
|
+
var SCROLL_EVENTS = ["wheel", "touchmove"];
|
|
1890
|
+
var useAllowPortalScroll = (active, contentRef, overlayRef) => {
|
|
1891
|
+
useEffect3(() => {
|
|
1892
|
+
if (!active || typeof document === "undefined") return;
|
|
1893
|
+
const release = (event) => {
|
|
1894
|
+
var _a, _b;
|
|
1895
|
+
const target = event.target;
|
|
1896
|
+
if (!target) return;
|
|
1897
|
+
if ((_a = contentRef.current) == null ? void 0 : _a.contains(target)) return;
|
|
1898
|
+
if ((_b = overlayRef.current) == null ? void 0 : _b.contains(target)) return;
|
|
1899
|
+
event.stopPropagation();
|
|
1900
|
+
};
|
|
1901
|
+
SCROLL_EVENTS.forEach(
|
|
1902
|
+
(type) => document.body.addEventListener(type, release)
|
|
1903
|
+
);
|
|
1904
|
+
return () => SCROLL_EVENTS.forEach(
|
|
1905
|
+
(type) => document.body.removeEventListener(type, release)
|
|
1906
|
+
);
|
|
1907
|
+
}, [active, contentRef, overlayRef]);
|
|
1908
|
+
};
|
|
1909
|
+
|
|
1910
|
+
// src/ui/components/ui/Modal.tsx
|
|
1886
1911
|
import { jsx as jsx26, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1887
1912
|
var ModalDragContext = createContext({
|
|
1888
1913
|
draggable: false,
|
|
@@ -1902,10 +1927,13 @@ var Modal = ({
|
|
|
1902
1927
|
const [isDragging, setIsDragging] = useState3(false);
|
|
1903
1928
|
const [offset, setOffset] = useState3({ x: 0, y: 0 });
|
|
1904
1929
|
const lastPointRef = useRef3({ x: 0, y: 0 });
|
|
1905
|
-
|
|
1930
|
+
const contentRef = useRef3(null);
|
|
1931
|
+
const overlayRef = useRef3(null);
|
|
1932
|
+
useAllowPortalScroll(open, contentRef, overlayRef);
|
|
1933
|
+
useEffect4(() => {
|
|
1906
1934
|
if (open) setOffset({ x: 0, y: 0 });
|
|
1907
1935
|
}, [open]);
|
|
1908
|
-
|
|
1936
|
+
useEffect4(() => {
|
|
1909
1937
|
if (!draggable || !isDragging) return;
|
|
1910
1938
|
const onPointerMove = (e) => {
|
|
1911
1939
|
const dx = e.clientX - lastPointRef.current.x;
|
|
@@ -1937,6 +1965,7 @@ var Modal = ({
|
|
|
1937
1965
|
/* @__PURE__ */ jsx26(
|
|
1938
1966
|
RadixDialog.Overlay,
|
|
1939
1967
|
{
|
|
1968
|
+
ref: overlayRef,
|
|
1940
1969
|
className: cn(
|
|
1941
1970
|
"fixed inset-0 z-40",
|
|
1942
1971
|
draggable ? "bg-transparent" : "bg-black/50"
|
|
@@ -1946,6 +1975,7 @@ var Modal = ({
|
|
|
1946
1975
|
/* @__PURE__ */ jsx26(
|
|
1947
1976
|
RadixDialog.Content,
|
|
1948
1977
|
{
|
|
1978
|
+
ref: contentRef,
|
|
1949
1979
|
onOpenAutoFocus,
|
|
1950
1980
|
className: cn(
|
|
1951
1981
|
"fixed left-1/2 top-1/2 z-50 flex max-h-[90vh] -translate-x-1/2 -translate-y-1/2 flex-col gap-4",
|
|
@@ -2037,7 +2067,7 @@ var ModalFooter = (_a) => {
|
|
|
2037
2067
|
var ModalClose = RadixDialog.Close;
|
|
2038
2068
|
|
|
2039
2069
|
// src/ui/components/ui/Select.tsx
|
|
2040
|
-
import { useEffect as
|
|
2070
|
+
import { useEffect as useEffect5, useRef as useRef4, useState as useState4 } from "react";
|
|
2041
2071
|
import * as RadixSelect from "@radix-ui/react-select";
|
|
2042
2072
|
import * as RadixPopover from "@radix-ui/react-popover";
|
|
2043
2073
|
import { jsx as jsx27, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
@@ -2089,7 +2119,7 @@ var Select = (props) => {
|
|
|
2089
2119
|
const filteredOptions = options.filter(
|
|
2090
2120
|
(option) => option.label.toLowerCase().includes(searchTerm.toLowerCase())
|
|
2091
2121
|
);
|
|
2092
|
-
|
|
2122
|
+
useEffect5(() => {
|
|
2093
2123
|
if (open && !hideSearchBar) {
|
|
2094
2124
|
const id = requestAnimationFrame(() => {
|
|
2095
2125
|
var _a;
|
|
@@ -3351,7 +3381,7 @@ var CollapsibleContent = (_a) => {
|
|
|
3351
3381
|
};
|
|
3352
3382
|
|
|
3353
3383
|
// src/ui/components/ui/Drawer.tsx
|
|
3354
|
-
import { useEffect as
|
|
3384
|
+
import { useEffect as useEffect6, useRef as useRef6 } from "react";
|
|
3355
3385
|
import { Drawer as VaulDrawer } from "vaul";
|
|
3356
3386
|
import { jsx as jsx45, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3357
3387
|
var KEEP_OPEN_SELECTOR = '[role="dialog"], [role="listbox"], [data-drawer-keep-open]';
|
|
@@ -3372,7 +3402,9 @@ var Drawer = ({
|
|
|
3372
3402
|
}) => {
|
|
3373
3403
|
const isVertical = direction === "left" || direction === "right";
|
|
3374
3404
|
const contentRef = useRef6(null);
|
|
3375
|
-
|
|
3405
|
+
const overlayRef = useRef6(null);
|
|
3406
|
+
useAllowPortalScroll(modal && open, contentRef, overlayRef);
|
|
3407
|
+
useEffect6(() => {
|
|
3376
3408
|
if (modal || !open || typeof document === "undefined") return;
|
|
3377
3409
|
const handlePointerDown = (event) => {
|
|
3378
3410
|
var _a;
|
|
@@ -3385,6 +3417,13 @@ var Drawer = ({
|
|
|
3385
3417
|
document.addEventListener("pointerdown", handlePointerDown);
|
|
3386
3418
|
return () => document.removeEventListener("pointerdown", handlePointerDown);
|
|
3387
3419
|
}, [modal, open, onClose]);
|
|
3420
|
+
useEffect6(() => {
|
|
3421
|
+
if (modal || !open) return;
|
|
3422
|
+
const frame = requestAnimationFrame(() => {
|
|
3423
|
+
document.body.style.pointerEvents = "auto";
|
|
3424
|
+
});
|
|
3425
|
+
return () => cancelAnimationFrame(frame);
|
|
3426
|
+
}, [modal, open]);
|
|
3388
3427
|
return /* @__PURE__ */ jsx45(
|
|
3389
3428
|
VaulDrawer.Root,
|
|
3390
3429
|
{
|
|
@@ -3393,7 +3432,13 @@ var Drawer = ({
|
|
|
3393
3432
|
open,
|
|
3394
3433
|
onOpenChange: (next) => !next && (onClose == null ? void 0 : onClose()),
|
|
3395
3434
|
children: /* @__PURE__ */ jsxs22(VaulDrawer.Portal, { children: [
|
|
3396
|
-
/* @__PURE__ */ jsx45(
|
|
3435
|
+
/* @__PURE__ */ jsx45(
|
|
3436
|
+
VaulDrawer.Overlay,
|
|
3437
|
+
{
|
|
3438
|
+
ref: overlayRef,
|
|
3439
|
+
className: "fixed inset-0 z-40 bg-black/35"
|
|
3440
|
+
}
|
|
3441
|
+
),
|
|
3397
3442
|
/* @__PURE__ */ jsx45(
|
|
3398
3443
|
VaulDrawer.Content,
|
|
3399
3444
|
{
|
|
@@ -4180,7 +4225,7 @@ var PageContainer = forwardRef29(
|
|
|
4180
4225
|
PageContainer.displayName = "PageContainer";
|
|
4181
4226
|
|
|
4182
4227
|
// src/ui/components/ui/IconTabs.tsx
|
|
4183
|
-
import { useCallback as useCallback2, useEffect as
|
|
4228
|
+
import { useCallback as useCallback2, useEffect as useEffect7, useRef as useRef7, useState as useState7 } from "react";
|
|
4184
4229
|
import { jsx as jsx64, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
4185
4230
|
var IconTabs = ({
|
|
4186
4231
|
items,
|
|
@@ -4206,7 +4251,7 @@ var IconTabs = ({
|
|
|
4206
4251
|
height: box.height
|
|
4207
4252
|
});
|
|
4208
4253
|
}, [value]);
|
|
4209
|
-
|
|
4254
|
+
useEffect7(() => {
|
|
4210
4255
|
updateBar();
|
|
4211
4256
|
const ro = new ResizeObserver(updateBar);
|
|
4212
4257
|
if (listRef.current) ro.observe(listRef.current);
|
|
@@ -4390,7 +4435,7 @@ var Banner = ({
|
|
|
4390
4435
|
// src/ui/components/ui/FloatingButton.tsx
|
|
4391
4436
|
import {
|
|
4392
4437
|
useCallback as useCallback3,
|
|
4393
|
-
useEffect as
|
|
4438
|
+
useEffect as useEffect8,
|
|
4394
4439
|
useLayoutEffect,
|
|
4395
4440
|
useRef as useRef8,
|
|
4396
4441
|
useState as useState8
|
|
@@ -4583,7 +4628,7 @@ var FloatingButton = ({
|
|
|
4583
4628
|
offsetRef.current = corrected;
|
|
4584
4629
|
setOffset(corrected);
|
|
4585
4630
|
}, [clampOffset]);
|
|
4586
|
-
|
|
4631
|
+
useEffect8(() => {
|
|
4587
4632
|
if (!draggable || !isDragging) return;
|
|
4588
4633
|
const onPointerMove = (e) => {
|
|
4589
4634
|
const dx = e.clientX - lastPointRef.current.x;
|
|
@@ -4654,7 +4699,7 @@ var FloatingButton = ({
|
|
|
4654
4699
|
useLayoutEffect(() => {
|
|
4655
4700
|
resolvePlacement();
|
|
4656
4701
|
}, [resolvePlacement]);
|
|
4657
|
-
|
|
4702
|
+
useEffect8(() => {
|
|
4658
4703
|
if (typeof window === "undefined") return;
|
|
4659
4704
|
const onResize = () => {
|
|
4660
4705
|
resolvePlacement();
|
|
@@ -5822,7 +5867,7 @@ var PdfPreview = ({
|
|
|
5822
5867
|
// src/ui/components/ui/VideoPlayer.tsx
|
|
5823
5868
|
import {
|
|
5824
5869
|
useCallback as useCallback5,
|
|
5825
|
-
useEffect as
|
|
5870
|
+
useEffect as useEffect9,
|
|
5826
5871
|
useRef as useRef11,
|
|
5827
5872
|
useState as useState12
|
|
5828
5873
|
} from "react";
|
|
@@ -5871,10 +5916,10 @@ var VideoPlayer = ({
|
|
|
5871
5916
|
const [hasFramePreviewError, setHasFramePreviewError] = useState12(false);
|
|
5872
5917
|
const inlineVideoRef = useRef11(null);
|
|
5873
5918
|
const expandedVideoRef = useRef11(null);
|
|
5874
|
-
|
|
5919
|
+
useEffect9(() => {
|
|
5875
5920
|
setHasPosterError(false);
|
|
5876
5921
|
}, [poster]);
|
|
5877
|
-
|
|
5922
|
+
useEffect9(() => {
|
|
5878
5923
|
setHasFramePreviewError(false);
|
|
5879
5924
|
}, [src]);
|
|
5880
5925
|
const visiblePoster = hasPosterError ? void 0 : poster;
|