design-zystem 1.0.363 → 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 +164 -126
- package/dist/ui/index.mjs +55 -17
- 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,7 +3587,7 @@ var Drawer = ({
|
|
|
3555
3587
|
document.addEventListener("pointerdown", handlePointerDown);
|
|
3556
3588
|
return () => document.removeEventListener("pointerdown", handlePointerDown);
|
|
3557
3589
|
}, [modal, open, onClose]);
|
|
3558
|
-
(0,
|
|
3590
|
+
(0, import_react26.useEffect)(() => {
|
|
3559
3591
|
if (modal || !open) return;
|
|
3560
3592
|
const frame = requestAnimationFrame(() => {
|
|
3561
3593
|
document.body.style.pointerEvents = "auto";
|
|
@@ -3570,7 +3602,13 @@ var Drawer = ({
|
|
|
3570
3602
|
open,
|
|
3571
3603
|
onOpenChange: (next) => !next && (onClose == null ? void 0 : onClose()),
|
|
3572
3604
|
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_vaul.Drawer.Portal, { children: [
|
|
3573
|
-
/* @__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
|
+
),
|
|
3574
3612
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3575
3613
|
import_vaul.Drawer.Content,
|
|
3576
3614
|
{
|
|
@@ -3692,17 +3730,17 @@ var Popover = ({
|
|
|
3692
3730
|
] });
|
|
3693
3731
|
|
|
3694
3732
|
// src/ui/components/ui/sidebar/Sidebar.tsx
|
|
3695
|
-
var
|
|
3733
|
+
var import_react28 = require("react");
|
|
3696
3734
|
|
|
3697
3735
|
// src/ui/components/ui/sidebar/SidebarContext.ts
|
|
3698
|
-
var
|
|
3699
|
-
var SidebarCollapsedContext = (0,
|
|
3736
|
+
var import_react27 = require("react");
|
|
3737
|
+
var SidebarCollapsedContext = (0, import_react27.createContext)(false);
|
|
3700
3738
|
var SidebarCollapsedProvider = SidebarCollapsedContext.Provider;
|
|
3701
|
-
var useSidebarCollapsed = () => (0,
|
|
3739
|
+
var useSidebarCollapsed = () => (0, import_react27.useContext)(SidebarCollapsedContext);
|
|
3702
3740
|
|
|
3703
3741
|
// src/ui/components/ui/sidebar/Sidebar.tsx
|
|
3704
3742
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3705
|
-
var Sidebar = (0,
|
|
3743
|
+
var Sidebar = (0, import_react28.forwardRef)(
|
|
3706
3744
|
(_a, ref) => {
|
|
3707
3745
|
var _b = _a, { collapsed = false, className, children } = _b, props = __objRest(_b, ["collapsed", "className", "children"]);
|
|
3708
3746
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SidebarCollapsedProvider, { value: collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
@@ -3723,9 +3761,9 @@ var Sidebar = (0, import_react27.forwardRef)(
|
|
|
3723
3761
|
Sidebar.displayName = "Sidebar";
|
|
3724
3762
|
|
|
3725
3763
|
// src/ui/components/ui/sidebar/SidebarTrigger.tsx
|
|
3726
|
-
var
|
|
3764
|
+
var import_react29 = require("react");
|
|
3727
3765
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3728
|
-
var SidebarTrigger = (0,
|
|
3766
|
+
var SidebarTrigger = (0, import_react29.forwardRef)((_a, ref) => {
|
|
3729
3767
|
var _b = _a, { collapsed, className } = _b, props = __objRest(_b, ["collapsed", "className"]);
|
|
3730
3768
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3731
3769
|
"button",
|
|
@@ -3752,9 +3790,9 @@ var SidebarTrigger = (0, import_react28.forwardRef)((_a, ref) => {
|
|
|
3752
3790
|
SidebarTrigger.displayName = "SidebarTrigger";
|
|
3753
3791
|
|
|
3754
3792
|
// src/ui/components/ui/sidebar/SidebarHeader.tsx
|
|
3755
|
-
var
|
|
3793
|
+
var import_react30 = require("react");
|
|
3756
3794
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3757
|
-
var SidebarHeader = (0,
|
|
3795
|
+
var SidebarHeader = (0, import_react30.forwardRef)(
|
|
3758
3796
|
(_a, ref) => {
|
|
3759
3797
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3760
3798
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
@@ -3769,9 +3807,9 @@ var SidebarHeader = (0, import_react29.forwardRef)(
|
|
|
3769
3807
|
SidebarHeader.displayName = "SidebarHeader";
|
|
3770
3808
|
|
|
3771
3809
|
// src/ui/components/ui/sidebar/SidebarContent.tsx
|
|
3772
|
-
var
|
|
3810
|
+
var import_react31 = require("react");
|
|
3773
3811
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3774
|
-
var SidebarContent = (0,
|
|
3812
|
+
var SidebarContent = (0, import_react31.forwardRef)(
|
|
3775
3813
|
(_a, ref) => {
|
|
3776
3814
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3777
3815
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
@@ -3790,9 +3828,9 @@ var SidebarContent = (0, import_react30.forwardRef)(
|
|
|
3790
3828
|
SidebarContent.displayName = "SidebarContent";
|
|
3791
3829
|
|
|
3792
3830
|
// src/ui/components/ui/sidebar/SidebarGroup.tsx
|
|
3793
|
-
var
|
|
3831
|
+
var import_react32 = require("react");
|
|
3794
3832
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3795
|
-
var SidebarGroup = (0,
|
|
3833
|
+
var SidebarGroup = (0, import_react32.forwardRef)(
|
|
3796
3834
|
(_a, ref) => {
|
|
3797
3835
|
var _b = _a, { label, className, children } = _b, props = __objRest(_b, ["label", "className", "children"]);
|
|
3798
3836
|
const collapsed = useSidebarCollapsed();
|
|
@@ -3813,9 +3851,9 @@ var SidebarGroup = (0, import_react31.forwardRef)(
|
|
|
3813
3851
|
SidebarGroup.displayName = "SidebarGroup";
|
|
3814
3852
|
|
|
3815
3853
|
// src/ui/components/ui/sidebar/SidebarMenuButton.tsx
|
|
3816
|
-
var
|
|
3854
|
+
var import_react33 = require("react");
|
|
3817
3855
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3818
|
-
var SidebarMenuButton = (0,
|
|
3856
|
+
var SidebarMenuButton = (0, import_react33.forwardRef)(
|
|
3819
3857
|
(_a, ref) => {
|
|
3820
3858
|
var _b = _a, {
|
|
3821
3859
|
icon,
|
|
@@ -3895,9 +3933,9 @@ var SidebarMenuButton = (0, import_react32.forwardRef)(
|
|
|
3895
3933
|
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
3896
3934
|
|
|
3897
3935
|
// src/ui/components/ui/sidebar/SidebarMenuSub.tsx
|
|
3898
|
-
var
|
|
3936
|
+
var import_react34 = require("react");
|
|
3899
3937
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3900
|
-
var SidebarMenuSub = (0,
|
|
3938
|
+
var SidebarMenuSub = (0, import_react34.forwardRef)(
|
|
3901
3939
|
(_a, ref) => {
|
|
3902
3940
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3903
3941
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
@@ -3915,22 +3953,22 @@ var SidebarMenuSub = (0, import_react33.forwardRef)(
|
|
|
3915
3953
|
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
3916
3954
|
|
|
3917
3955
|
// src/ui/components/ui/sidebar/SidebarMenuSubItem.tsx
|
|
3918
|
-
var
|
|
3956
|
+
var import_react35 = require("react");
|
|
3919
3957
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3920
|
-
var SidebarMenuSubItem = (0,
|
|
3958
|
+
var SidebarMenuSubItem = (0, import_react35.forwardRef)((_a, ref) => {
|
|
3921
3959
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3922
3960
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("li", __spreadValues({ ref, className: cn("relative", className) }, props));
|
|
3923
3961
|
});
|
|
3924
3962
|
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
3925
3963
|
|
|
3926
3964
|
// src/ui/components/ui/sidebar/SidebarMenuSubButton.tsx
|
|
3927
|
-
var
|
|
3965
|
+
var import_react36 = require("react");
|
|
3928
3966
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3929
3967
|
var SIZE_CLASS = {
|
|
3930
3968
|
default: "h-10",
|
|
3931
3969
|
lg: "h-14"
|
|
3932
3970
|
};
|
|
3933
|
-
var SidebarMenuSubButton = (0,
|
|
3971
|
+
var SidebarMenuSubButton = (0, import_react36.forwardRef)((_a, ref) => {
|
|
3934
3972
|
var _b = _a, { active, size = "default", className } = _b, props = __objRest(_b, ["active", "size", "className"]);
|
|
3935
3973
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3936
3974
|
"button",
|
|
@@ -3951,9 +3989,9 @@ var SidebarMenuSubButton = (0, import_react35.forwardRef)((_a, ref) => {
|
|
|
3951
3989
|
SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
3952
3990
|
|
|
3953
3991
|
// src/ui/components/ui/sidebar/SidebarFooter.tsx
|
|
3954
|
-
var
|
|
3992
|
+
var import_react37 = require("react");
|
|
3955
3993
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3956
|
-
var SidebarFooter = (0,
|
|
3994
|
+
var SidebarFooter = (0, import_react37.forwardRef)(
|
|
3957
3995
|
(_a, ref) => {
|
|
3958
3996
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3959
3997
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
@@ -3991,9 +4029,9 @@ var SidebarSupportInfo = ({
|
|
|
3991
4029
|
};
|
|
3992
4030
|
|
|
3993
4031
|
// src/ui/components/ui/sidebar/SidebarMenuSearchInput.tsx
|
|
3994
|
-
var
|
|
4032
|
+
var import_react38 = require("react");
|
|
3995
4033
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3996
|
-
var SidebarMenuSearchInput = (0,
|
|
4034
|
+
var SidebarMenuSearchInput = (0, import_react38.forwardRef)((_a, ref) => {
|
|
3997
4035
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3998
4036
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(InputGroup, { children: [
|
|
3999
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" }) }),
|
|
@@ -4012,7 +4050,7 @@ var SidebarMenuSearchInput = (0, import_react37.forwardRef)((_a, ref) => {
|
|
|
4012
4050
|
SidebarMenuSearchInput.displayName = "SidebarMenuSearchInput";
|
|
4013
4051
|
|
|
4014
4052
|
// src/ui/components/ui/sidebar/SidebarUserMenu.tsx
|
|
4015
|
-
var
|
|
4053
|
+
var import_react39 = require("react");
|
|
4016
4054
|
var RadixPopover4 = __toESM(require("@radix-ui/react-popover"));
|
|
4017
4055
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4018
4056
|
var panelClassName = cn(
|
|
@@ -4029,7 +4067,7 @@ var SidebarUserMenu = ({
|
|
|
4029
4067
|
className
|
|
4030
4068
|
}) => {
|
|
4031
4069
|
const collapsed = useSidebarCollapsed();
|
|
4032
|
-
const [open, setOpen] = (0,
|
|
4070
|
+
const [open, setOpen] = (0, import_react39.useState)(false);
|
|
4033
4071
|
const runAndClose = (action) => {
|
|
4034
4072
|
action();
|
|
4035
4073
|
setOpen(false);
|
|
@@ -4325,7 +4363,7 @@ var toast = {
|
|
|
4325
4363
|
};
|
|
4326
4364
|
|
|
4327
4365
|
// src/ui/components/ui/PageContainer.tsx
|
|
4328
|
-
var
|
|
4366
|
+
var import_react40 = require("react");
|
|
4329
4367
|
var import_class_variance_authority13 = require("class-variance-authority");
|
|
4330
4368
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4331
4369
|
var pageContainerVariants = (0, import_class_variance_authority13.cva)(
|
|
@@ -4342,7 +4380,7 @@ var pageContainerVariants = (0, import_class_variance_authority13.cva)(
|
|
|
4342
4380
|
defaultVariants: { padding: "md" }
|
|
4343
4381
|
}
|
|
4344
4382
|
);
|
|
4345
|
-
var PageContainer = (0,
|
|
4383
|
+
var PageContainer = (0, import_react40.forwardRef)(
|
|
4346
4384
|
(_a, ref) => {
|
|
4347
4385
|
var _b = _a, { padding, className } = _b, props = __objRest(_b, ["padding", "className"]);
|
|
4348
4386
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
@@ -4357,7 +4395,7 @@ var PageContainer = (0, import_react39.forwardRef)(
|
|
|
4357
4395
|
PageContainer.displayName = "PageContainer";
|
|
4358
4396
|
|
|
4359
4397
|
// src/ui/components/ui/IconTabs.tsx
|
|
4360
|
-
var
|
|
4398
|
+
var import_react41 = require("react");
|
|
4361
4399
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4362
4400
|
var IconTabs = ({
|
|
4363
4401
|
items,
|
|
@@ -4367,10 +4405,10 @@ var IconTabs = ({
|
|
|
4367
4405
|
className
|
|
4368
4406
|
}) => {
|
|
4369
4407
|
var _a;
|
|
4370
|
-
const listRef = (0,
|
|
4371
|
-
const tabRefs = (0,
|
|
4372
|
-
const [bar, setBar] = (0,
|
|
4373
|
-
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)(() => {
|
|
4374
4412
|
const root = listRef.current;
|
|
4375
4413
|
const activeEl = tabRefs.current[value];
|
|
4376
4414
|
if (!root || !activeEl) return;
|
|
@@ -4383,7 +4421,7 @@ var IconTabs = ({
|
|
|
4383
4421
|
height: box.height
|
|
4384
4422
|
});
|
|
4385
4423
|
}, [value]);
|
|
4386
|
-
(0,
|
|
4424
|
+
(0, import_react41.useEffect)(() => {
|
|
4387
4425
|
updateBar();
|
|
4388
4426
|
const ro = new ResizeObserver(updateBar);
|
|
4389
4427
|
if (listRef.current) ro.observe(listRef.current);
|
|
@@ -4565,7 +4603,7 @@ var Banner = ({
|
|
|
4565
4603
|
};
|
|
4566
4604
|
|
|
4567
4605
|
// src/ui/components/ui/FloatingButton.tsx
|
|
4568
|
-
var
|
|
4606
|
+
var import_react42 = require("react");
|
|
4569
4607
|
|
|
4570
4608
|
// src/ui/lib/floatingArc.ts
|
|
4571
4609
|
var MAX_STEP = 65;
|
|
@@ -4717,17 +4755,17 @@ var FloatingButton = ({
|
|
|
4717
4755
|
persistKey,
|
|
4718
4756
|
safeArea
|
|
4719
4757
|
}) => {
|
|
4720
|
-
const containerRef = (0,
|
|
4721
|
-
const [placement, setPlacement] = (0,
|
|
4758
|
+
const containerRef = (0, import_react42.useRef)(null);
|
|
4759
|
+
const [placement, setPlacement] = (0, import_react42.useState)(() => ({
|
|
4722
4760
|
geometry: __spreadValues({ base: 90 }, arcLayout(actions.length, ARC_RADIUS, SUB_SIZE)),
|
|
4723
4761
|
shift: { x: 0, y: 0 }
|
|
4724
4762
|
}));
|
|
4725
|
-
const [isDragging, setIsDragging] = (0,
|
|
4726
|
-
const [offset, setOffset] = (0,
|
|
4727
|
-
const offsetRef = (0,
|
|
4728
|
-
const lastPointRef = (0,
|
|
4729
|
-
const dragDistanceRef = (0,
|
|
4730
|
-
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)(
|
|
4731
4769
|
(next) => {
|
|
4732
4770
|
var _a, _b, _c, _d;
|
|
4733
4771
|
const el = containerRef.current;
|
|
@@ -4747,14 +4785,14 @@ var FloatingButton = ({
|
|
|
4747
4785
|
},
|
|
4748
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]
|
|
4749
4787
|
);
|
|
4750
|
-
(0,
|
|
4788
|
+
(0, import_react42.useLayoutEffect)(() => {
|
|
4751
4789
|
const corrected = clampOffset(offsetRef.current);
|
|
4752
4790
|
if (corrected.x === offsetRef.current.x && corrected.y === offsetRef.current.y)
|
|
4753
4791
|
return;
|
|
4754
4792
|
offsetRef.current = corrected;
|
|
4755
4793
|
setOffset(corrected);
|
|
4756
4794
|
}, [clampOffset]);
|
|
4757
|
-
(0,
|
|
4795
|
+
(0, import_react42.useEffect)(() => {
|
|
4758
4796
|
if (!draggable || !isDragging) return;
|
|
4759
4797
|
const onPointerMove = (e) => {
|
|
4760
4798
|
const dx = e.clientX - lastPointRef.current.x;
|
|
@@ -4790,7 +4828,7 @@ var FloatingButton = ({
|
|
|
4790
4828
|
window.removeEventListener("pointercancel", endDrag);
|
|
4791
4829
|
};
|
|
4792
4830
|
}, [draggable, isDragging, persistKey, clampOffset]);
|
|
4793
|
-
const resolvePlacement = (0,
|
|
4831
|
+
const resolvePlacement = (0, import_react42.useCallback)(() => {
|
|
4794
4832
|
var _a, _b, _c, _d;
|
|
4795
4833
|
const el = containerRef.current;
|
|
4796
4834
|
if (!el || typeof window === "undefined") return;
|
|
@@ -4819,13 +4857,13 @@ var FloatingButton = ({
|
|
|
4819
4857
|
safeArea == null ? void 0 : safeArea.right,
|
|
4820
4858
|
safeArea == null ? void 0 : safeArea.bottom
|
|
4821
4859
|
]);
|
|
4822
|
-
(0,
|
|
4860
|
+
(0, import_react42.useLayoutEffect)(() => {
|
|
4823
4861
|
if (isOpen) resolvePlacement();
|
|
4824
4862
|
}, [isOpen, offset, resolvePlacement]);
|
|
4825
|
-
(0,
|
|
4863
|
+
(0, import_react42.useLayoutEffect)(() => {
|
|
4826
4864
|
resolvePlacement();
|
|
4827
4865
|
}, [resolvePlacement]);
|
|
4828
|
-
(0,
|
|
4866
|
+
(0, import_react42.useEffect)(() => {
|
|
4829
4867
|
if (typeof window === "undefined") return;
|
|
4830
4868
|
const onResize = () => {
|
|
4831
4869
|
resolvePlacement();
|
|
@@ -5353,7 +5391,7 @@ var Timeline = ({
|
|
|
5353
5391
|
};
|
|
5354
5392
|
|
|
5355
5393
|
// src/ui/components/ui/ColorPicker.tsx
|
|
5356
|
-
var
|
|
5394
|
+
var import_react43 = require("react");
|
|
5357
5395
|
var import_class_variance_authority15 = require("class-variance-authority");
|
|
5358
5396
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5359
5397
|
var swatchVariants = (0, import_class_variance_authority15.cva)(
|
|
@@ -5382,7 +5420,7 @@ var inputVariants = (0, import_class_variance_authority15.cva)(
|
|
|
5382
5420
|
defaultVariants: { size: "m" }
|
|
5383
5421
|
}
|
|
5384
5422
|
);
|
|
5385
|
-
var ColorPicker = (0,
|
|
5423
|
+
var ColorPicker = (0, import_react43.forwardRef)(
|
|
5386
5424
|
({
|
|
5387
5425
|
label,
|
|
5388
5426
|
value,
|
|
@@ -5392,7 +5430,7 @@ var ColorPicker = (0, import_react42.forwardRef)(
|
|
|
5392
5430
|
size,
|
|
5393
5431
|
className
|
|
5394
5432
|
}, ref) => {
|
|
5395
|
-
const [internalColor, setInternalColor] = (0,
|
|
5433
|
+
const [internalColor, setInternalColor] = (0, import_react43.useState)(defaultValue);
|
|
5396
5434
|
const currentColor = value !== void 0 ? value : internalColor;
|
|
5397
5435
|
const handleChange = (e) => {
|
|
5398
5436
|
const next = e.target.value;
|
|
@@ -5456,7 +5494,7 @@ var ColorPicker = (0, import_react42.forwardRef)(
|
|
|
5456
5494
|
ColorPicker.displayName = "ColorPicker";
|
|
5457
5495
|
|
|
5458
5496
|
// src/ui/components/ui/FileUploadZone.tsx
|
|
5459
|
-
var
|
|
5497
|
+
var import_react44 = require("react");
|
|
5460
5498
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5461
5499
|
var ACCEPT_MAP = {
|
|
5462
5500
|
png: "image/png",
|
|
@@ -5489,23 +5527,23 @@ var FileUploadZone = ({
|
|
|
5489
5527
|
showFileName = false,
|
|
5490
5528
|
className
|
|
5491
5529
|
}) => {
|
|
5492
|
-
const [isDragging, setIsDragging] = (0,
|
|
5493
|
-
const [internalPreviewUrl, setInternalPreviewUrl] = (0,
|
|
5530
|
+
const [isDragging, setIsDragging] = (0, import_react44.useState)(false);
|
|
5531
|
+
const [internalPreviewUrl, setInternalPreviewUrl] = (0, import_react44.useState)(
|
|
5494
5532
|
null
|
|
5495
5533
|
);
|
|
5496
|
-
const [fileType, setFileType] = (0,
|
|
5497
|
-
const [fileName, setFileName] = (0,
|
|
5498
|
-
const [inlineError, setInlineError] = (0,
|
|
5499
|
-
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);
|
|
5500
5538
|
const resolvedAccept = acceptOnlyPdf ? PDF_ONLY : accept;
|
|
5501
5539
|
const mimeTypes = getMimeTypes(resolvedAccept);
|
|
5502
5540
|
const acceptString = mimeTypes.join(",");
|
|
5503
5541
|
const previewUrl = multiple ? null : controlledPreviewUrl || (showPreview ? internalPreviewUrl : null);
|
|
5504
|
-
const emitError = (0,
|
|
5542
|
+
const emitError = (0, import_react44.useCallback)(
|
|
5505
5543
|
(message) => onError ? onError(message) : setInlineError(message),
|
|
5506
5544
|
[onError]
|
|
5507
5545
|
);
|
|
5508
|
-
const validateFile = (0,
|
|
5546
|
+
const validateFile = (0, import_react44.useCallback)(
|
|
5509
5547
|
(file) => {
|
|
5510
5548
|
if (!mimeTypes.includes(file.type))
|
|
5511
5549
|
return { ok: false, error: "Format de fichier non accept\xE9." };
|
|
@@ -5519,7 +5557,7 @@ var FileUploadZone = ({
|
|
|
5519
5557
|
},
|
|
5520
5558
|
[mimeTypes, maxSizeMB]
|
|
5521
5559
|
);
|
|
5522
|
-
const processFile = (0,
|
|
5560
|
+
const processFile = (0, import_react44.useCallback)(
|
|
5523
5561
|
(file) => {
|
|
5524
5562
|
setInlineError(null);
|
|
5525
5563
|
const result = validateFile(file);
|
|
@@ -5534,7 +5572,7 @@ var FileUploadZone = ({
|
|
|
5534
5572
|
},
|
|
5535
5573
|
[validateFile, onSave, showPreview, emitError]
|
|
5536
5574
|
);
|
|
5537
|
-
const processFiles = (0,
|
|
5575
|
+
const processFiles = (0, import_react44.useCallback)(
|
|
5538
5576
|
(files) => {
|
|
5539
5577
|
setInlineError(null);
|
|
5540
5578
|
for (const file of files) {
|
|
@@ -5693,7 +5731,7 @@ var FileUploadZone = ({
|
|
|
5693
5731
|
};
|
|
5694
5732
|
|
|
5695
5733
|
// src/ui/components/ui/FilePicker.tsx
|
|
5696
|
-
var
|
|
5734
|
+
var import_react45 = require("react");
|
|
5697
5735
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5698
5736
|
var FilePicker = ({
|
|
5699
5737
|
label,
|
|
@@ -5707,7 +5745,7 @@ var FilePicker = ({
|
|
|
5707
5745
|
disabled = false,
|
|
5708
5746
|
className
|
|
5709
5747
|
}) => {
|
|
5710
|
-
const inputRef = (0,
|
|
5748
|
+
const inputRef = (0, import_react45.useRef)(null);
|
|
5711
5749
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
5712
5750
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5713
5751
|
"input",
|
|
@@ -5745,7 +5783,7 @@ var FilePicker = ({
|
|
|
5745
5783
|
};
|
|
5746
5784
|
|
|
5747
5785
|
// src/ui/components/ui/Item.tsx
|
|
5748
|
-
var
|
|
5786
|
+
var import_react46 = require("react");
|
|
5749
5787
|
var import_class_variance_authority16 = require("class-variance-authority");
|
|
5750
5788
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
5751
5789
|
var itemVariants = (0, import_class_variance_authority16.cva)(
|
|
@@ -5765,7 +5803,7 @@ var itemVariants = (0, import_class_variance_authority16.cva)(
|
|
|
5765
5803
|
defaultVariants: { variant: "default", size: "default" }
|
|
5766
5804
|
}
|
|
5767
5805
|
);
|
|
5768
|
-
var Item3 = (0,
|
|
5806
|
+
var Item3 = (0, import_react46.forwardRef)(
|
|
5769
5807
|
(_a, ref) => {
|
|
5770
5808
|
var _b = _a, { variant, size, className } = _b, props = __objRest(_b, ["variant", "size", "className"]);
|
|
5771
5809
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
@@ -5924,7 +5962,7 @@ var Attachment = ({
|
|
|
5924
5962
|
};
|
|
5925
5963
|
|
|
5926
5964
|
// src/ui/components/ui/PdfPreview.tsx
|
|
5927
|
-
var
|
|
5965
|
+
var import_react47 = require("react");
|
|
5928
5966
|
var import_react_pdf = require("react-pdf");
|
|
5929
5967
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
5930
5968
|
import_react_pdf.pdfjs.GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${import_react_pdf.pdfjs.version}/build/pdf.worker.min.mjs`;
|
|
@@ -5934,8 +5972,8 @@ var PdfPreview = ({
|
|
|
5934
5972
|
maxHeight = "600px",
|
|
5935
5973
|
className
|
|
5936
5974
|
}) => {
|
|
5937
|
-
const [hasError, setHasError] = (0,
|
|
5938
|
-
const [numPages, setNumPages] = (0,
|
|
5975
|
+
const [hasError, setHasError] = (0, import_react47.useState)(false);
|
|
5976
|
+
const [numPages, setNumPages] = (0, import_react47.useState)(0);
|
|
5939
5977
|
const height = Math.round(width * 1.3);
|
|
5940
5978
|
const thumbnailSkeleton = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Skeleton, { width, height });
|
|
5941
5979
|
if (hasError) {
|
|
@@ -5991,7 +6029,7 @@ var PdfPreview = ({
|
|
|
5991
6029
|
};
|
|
5992
6030
|
|
|
5993
6031
|
// src/ui/components/ui/VideoPlayer.tsx
|
|
5994
|
-
var
|
|
6032
|
+
var import_react48 = require("react");
|
|
5995
6033
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
5996
6034
|
var formatVideoDuration = (seconds) => {
|
|
5997
6035
|
if (seconds === void 0 || !Number.isFinite(seconds) || seconds < 0)
|
|
@@ -6031,20 +6069,20 @@ var VideoPlayer = ({
|
|
|
6031
6069
|
defaultVolume = DEFAULT_VOLUME,
|
|
6032
6070
|
className
|
|
6033
6071
|
}) => {
|
|
6034
|
-
const [isInlinePlaying, setIsInlinePlaying] = (0,
|
|
6035
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
6036
|
-
const [hasPosterError, setHasPosterError] = (0,
|
|
6037
|
-
const [hasFramePreviewError, setHasFramePreviewError] = (0,
|
|
6038
|
-
const inlineVideoRef = (0,
|
|
6039
|
-
const expandedVideoRef = (0,
|
|
6040
|
-
(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)(() => {
|
|
6041
6079
|
setHasPosterError(false);
|
|
6042
6080
|
}, [poster]);
|
|
6043
|
-
(0,
|
|
6081
|
+
(0, import_react48.useEffect)(() => {
|
|
6044
6082
|
setHasFramePreviewError(false);
|
|
6045
6083
|
}, [src]);
|
|
6046
6084
|
const visiblePoster = hasPosterError ? void 0 : poster;
|
|
6047
|
-
const attachExpandedVideo = (0,
|
|
6085
|
+
const attachExpandedVideo = (0, import_react48.useCallback)(
|
|
6048
6086
|
(video) => {
|
|
6049
6087
|
expandedVideoRef.current = video;
|
|
6050
6088
|
if (video) video.volume = clampVolume(defaultVolume);
|
|
@@ -6056,7 +6094,7 @@ var VideoPlayer = ({
|
|
|
6056
6094
|
e.preventDefault();
|
|
6057
6095
|
(_a = expandedVideoRef.current) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
6058
6096
|
};
|
|
6059
|
-
const attachInlineVideo = (0,
|
|
6097
|
+
const attachInlineVideo = (0, import_react48.useCallback)(
|
|
6060
6098
|
(video) => {
|
|
6061
6099
|
inlineVideoRef.current = video;
|
|
6062
6100
|
if (video) video.volume = clampVolume(defaultVolume);
|
|
@@ -6317,7 +6355,7 @@ var ScrollArea = (_a) => {
|
|
|
6317
6355
|
};
|
|
6318
6356
|
|
|
6319
6357
|
// src/ui/components/ui/Message.tsx
|
|
6320
|
-
var
|
|
6358
|
+
var import_react49 = require("react");
|
|
6321
6359
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
6322
6360
|
var BUBBLE_BACKGROUND = {
|
|
6323
6361
|
own: { solid: "bg-blue-700", pale: "bg-blue-50" },
|
|
@@ -6329,7 +6367,7 @@ var BUBBLE_TAIL = {
|
|
|
6329
6367
|
teammate: "rounded-br-none",
|
|
6330
6368
|
other: "rounded-bl-none"
|
|
6331
6369
|
};
|
|
6332
|
-
var Message = (0,
|
|
6370
|
+
var Message = (0, import_react49.forwardRef)(
|
|
6333
6371
|
(_a, ref) => {
|
|
6334
6372
|
var _b = _a, {
|
|
6335
6373
|
isOwn = false,
|
|
@@ -6471,7 +6509,7 @@ var Message = (0, import_react48.forwardRef)(
|
|
|
6471
6509
|
Message.displayName = "Message";
|
|
6472
6510
|
|
|
6473
6511
|
// src/ui/components/ui/MessageScroller.tsx
|
|
6474
|
-
var
|
|
6512
|
+
var import_react50 = require("react");
|
|
6475
6513
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
6476
6514
|
var SEPARATOR_LINE = {
|
|
6477
6515
|
neutral: "",
|
|
@@ -6523,9 +6561,9 @@ var MessageScroller = ({
|
|
|
6523
6561
|
viewportRef,
|
|
6524
6562
|
className
|
|
6525
6563
|
}) => {
|
|
6526
|
-
const fallbackRef = (0,
|
|
6564
|
+
const fallbackRef = (0, import_react50.useRef)(null);
|
|
6527
6565
|
const scrollerRef = viewportRef != null ? viewportRef : fallbackRef;
|
|
6528
|
-
(0,
|
|
6566
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
6529
6567
|
if (!autoScroll) return;
|
|
6530
6568
|
const viewport = scrollerRef.current;
|
|
6531
6569
|
if (!viewport) return;
|
|
@@ -6579,7 +6617,7 @@ var MessageScroller = ({
|
|
|
6579
6617
|
};
|
|
6580
6618
|
|
|
6581
6619
|
// src/ui/components/ui/Stepper.tsx
|
|
6582
|
-
var
|
|
6620
|
+
var import_react51 = require("react");
|
|
6583
6621
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
6584
6622
|
var Stepper = ({
|
|
6585
6623
|
numberOfSteps,
|
|
@@ -6597,7 +6635,7 @@ var Stepper = ({
|
|
|
6597
6635
|
children: Array.from({ length: numberOfSteps }, (_, i) => {
|
|
6598
6636
|
const isActive = i === current;
|
|
6599
6637
|
const isCompleted = i < current;
|
|
6600
|
-
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
6638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_react51.Fragment, { children: [
|
|
6601
6639
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
6602
6640
|
"div",
|
|
6603
6641
|
{
|
|
@@ -6617,7 +6655,7 @@ var Stepper = ({
|
|
|
6617
6655
|
);
|
|
6618
6656
|
|
|
6619
6657
|
// src/ui/components/ui/DatePicker.tsx
|
|
6620
|
-
var
|
|
6658
|
+
var import_react52 = require("react");
|
|
6621
6659
|
var import_react_day_picker = require("react-day-picker");
|
|
6622
6660
|
var import_locale = require("react-day-picker/locale");
|
|
6623
6661
|
var import_style2 = require("react-day-picker/style.css");
|
|
@@ -6678,8 +6716,8 @@ var DatePicker = ({
|
|
|
6678
6716
|
className
|
|
6679
6717
|
}) => {
|
|
6680
6718
|
const isRange = mode === "range";
|
|
6681
|
-
const [open, setOpen] = (0,
|
|
6682
|
-
const [activePreset, setActivePreset] = (0,
|
|
6719
|
+
const [open, setOpen] = (0, import_react52.useState)(false);
|
|
6720
|
+
const [activePreset, setActivePreset] = (0, import_react52.useState)(null);
|
|
6683
6721
|
const resolvedPresets = presets != null ? presets : isRange ? RANGE_PRESETS : SINGLE_PRESETS;
|
|
6684
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";
|
|
6685
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,7 +3417,7 @@ var Drawer = ({
|
|
|
3385
3417
|
document.addEventListener("pointerdown", handlePointerDown);
|
|
3386
3418
|
return () => document.removeEventListener("pointerdown", handlePointerDown);
|
|
3387
3419
|
}, [modal, open, onClose]);
|
|
3388
|
-
|
|
3420
|
+
useEffect6(() => {
|
|
3389
3421
|
if (modal || !open) return;
|
|
3390
3422
|
const frame = requestAnimationFrame(() => {
|
|
3391
3423
|
document.body.style.pointerEvents = "auto";
|
|
@@ -3400,7 +3432,13 @@ var Drawer = ({
|
|
|
3400
3432
|
open,
|
|
3401
3433
|
onOpenChange: (next) => !next && (onClose == null ? void 0 : onClose()),
|
|
3402
3434
|
children: /* @__PURE__ */ jsxs22(VaulDrawer.Portal, { children: [
|
|
3403
|
-
/* @__PURE__ */ jsx45(
|
|
3435
|
+
/* @__PURE__ */ jsx45(
|
|
3436
|
+
VaulDrawer.Overlay,
|
|
3437
|
+
{
|
|
3438
|
+
ref: overlayRef,
|
|
3439
|
+
className: "fixed inset-0 z-40 bg-black/35"
|
|
3440
|
+
}
|
|
3441
|
+
),
|
|
3404
3442
|
/* @__PURE__ */ jsx45(
|
|
3405
3443
|
VaulDrawer.Content,
|
|
3406
3444
|
{
|
|
@@ -4187,7 +4225,7 @@ var PageContainer = forwardRef29(
|
|
|
4187
4225
|
PageContainer.displayName = "PageContainer";
|
|
4188
4226
|
|
|
4189
4227
|
// src/ui/components/ui/IconTabs.tsx
|
|
4190
|
-
import { useCallback as useCallback2, useEffect as
|
|
4228
|
+
import { useCallback as useCallback2, useEffect as useEffect7, useRef as useRef7, useState as useState7 } from "react";
|
|
4191
4229
|
import { jsx as jsx64, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
4192
4230
|
var IconTabs = ({
|
|
4193
4231
|
items,
|
|
@@ -4213,7 +4251,7 @@ var IconTabs = ({
|
|
|
4213
4251
|
height: box.height
|
|
4214
4252
|
});
|
|
4215
4253
|
}, [value]);
|
|
4216
|
-
|
|
4254
|
+
useEffect7(() => {
|
|
4217
4255
|
updateBar();
|
|
4218
4256
|
const ro = new ResizeObserver(updateBar);
|
|
4219
4257
|
if (listRef.current) ro.observe(listRef.current);
|
|
@@ -4397,7 +4435,7 @@ var Banner = ({
|
|
|
4397
4435
|
// src/ui/components/ui/FloatingButton.tsx
|
|
4398
4436
|
import {
|
|
4399
4437
|
useCallback as useCallback3,
|
|
4400
|
-
useEffect as
|
|
4438
|
+
useEffect as useEffect8,
|
|
4401
4439
|
useLayoutEffect,
|
|
4402
4440
|
useRef as useRef8,
|
|
4403
4441
|
useState as useState8
|
|
@@ -4590,7 +4628,7 @@ var FloatingButton = ({
|
|
|
4590
4628
|
offsetRef.current = corrected;
|
|
4591
4629
|
setOffset(corrected);
|
|
4592
4630
|
}, [clampOffset]);
|
|
4593
|
-
|
|
4631
|
+
useEffect8(() => {
|
|
4594
4632
|
if (!draggable || !isDragging) return;
|
|
4595
4633
|
const onPointerMove = (e) => {
|
|
4596
4634
|
const dx = e.clientX - lastPointRef.current.x;
|
|
@@ -4661,7 +4699,7 @@ var FloatingButton = ({
|
|
|
4661
4699
|
useLayoutEffect(() => {
|
|
4662
4700
|
resolvePlacement();
|
|
4663
4701
|
}, [resolvePlacement]);
|
|
4664
|
-
|
|
4702
|
+
useEffect8(() => {
|
|
4665
4703
|
if (typeof window === "undefined") return;
|
|
4666
4704
|
const onResize = () => {
|
|
4667
4705
|
resolvePlacement();
|
|
@@ -5829,7 +5867,7 @@ var PdfPreview = ({
|
|
|
5829
5867
|
// src/ui/components/ui/VideoPlayer.tsx
|
|
5830
5868
|
import {
|
|
5831
5869
|
useCallback as useCallback5,
|
|
5832
|
-
useEffect as
|
|
5870
|
+
useEffect as useEffect9,
|
|
5833
5871
|
useRef as useRef11,
|
|
5834
5872
|
useState as useState12
|
|
5835
5873
|
} from "react";
|
|
@@ -5878,10 +5916,10 @@ var VideoPlayer = ({
|
|
|
5878
5916
|
const [hasFramePreviewError, setHasFramePreviewError] = useState12(false);
|
|
5879
5917
|
const inlineVideoRef = useRef11(null);
|
|
5880
5918
|
const expandedVideoRef = useRef11(null);
|
|
5881
|
-
|
|
5919
|
+
useEffect9(() => {
|
|
5882
5920
|
setHasPosterError(false);
|
|
5883
5921
|
}, [poster]);
|
|
5884
|
-
|
|
5922
|
+
useEffect9(() => {
|
|
5885
5923
|
setHasFramePreviewError(false);
|
|
5886
5924
|
}, [src]);
|
|
5887
5925
|
const visiblePoster = hasPosterError ? void 0 : poster;
|