@bmsuisse/ui 0.16.0 → 0.16.2
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/index.d.ts +3 -1
- package/dist/index.js +126 -44
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ declare const DialogContent: react.ForwardRefExoticComponent<Omit<DialogPrimitiv
|
|
|
55
55
|
declare const DialogHeader: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => ReactElement;
|
|
56
56
|
declare const DialogTitle: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
|
|
57
57
|
declare const DialogDescription: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
|
|
58
|
+
declare const DialogBody: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
58
59
|
declare const DialogFooter: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => ReactElement;
|
|
59
60
|
|
|
60
61
|
declare const Popover: react.FC<PopoverPrimitive.PopoverProps>;
|
|
@@ -144,6 +145,7 @@ interface SheetContentProps extends ComponentPropsWithoutRef<typeof DialogPrimit
|
|
|
144
145
|
}
|
|
145
146
|
declare const SheetContent: react.ForwardRefExoticComponent<SheetContentProps & react.RefAttributes<HTMLDivElement>>;
|
|
146
147
|
declare const SheetHeader: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => ReactElement;
|
|
148
|
+
declare const SheetBody: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => ReactElement;
|
|
147
149
|
declare const SheetFooter: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => ReactElement;
|
|
148
150
|
declare const SheetTitle: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
|
|
149
151
|
declare const SheetDescription: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
|
|
@@ -1194,4 +1196,4 @@ type ConfirmButtonPlacement = "leading" | "trailing";
|
|
|
1194
1196
|
*/
|
|
1195
1197
|
declare function getConfirmButtonPlacement(): ConfirmButtonPlacement;
|
|
1196
1198
|
|
|
1197
|
-
export { AiButton, type AiButtonProps, type AiButtonVariant, AiExplainButton, type AiExplainButtonProps, AlertBox, type AlertBoxProps, type AlertBoxVariant, Badge, type BadgeProps, Button, ButtonGroup, type ButtonGroupOption, type ButtonGroupProps, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, type GridColumn as ComboboxColumn, type ComboboxMultiProps, type ComboboxOption, type ComboboxProps, type ComboboxSingleProps, type ConfirmButtonPlacement, ConfirmDialog, type ConfirmDialogProps, Dialog, DialogActions, type DialogActionsProps, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DonutChart, type DonutSegment, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FormField, type FormFieldProps, FormModal, type FormModalProps, Input, type InputProps, KpiCard, type KpiCardProps, Label, LoadingOverlay, type LoadingOverlayProps, LoadingSpinner, type LoadingSpinnerProps, Modal, type ModalProps, NavGroup, type NavGroupProps, type NavIconProps, NavItem, type NavItemProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, QuestionDialog, type QuestionDialogAction, type QuestionDialogProps, ResponsivePanel, type ResponsivePanelProps, type ResponsivePanelSize, ScrollArea, ScrollBar, SearchBar, type SearchBarProps, SearchPanel, type SearchPanelMode, type SearchPanelProps, SearchTrigger, type SearchTriggerProps, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarNav, type SidebarNavProps, type SidebarProps, Skeleton, Sparkline, type SpeechRecognitionEngine, type SpeechRecognitionEngineFactory, type SpeechRecognitionState, StatusBadge, type StatusBadgeProps, type StatusTone, Stepper, type StepperProps, type StepperStep, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagCombobox, type TagComboboxOption, type TagComboboxProps, Textarea, type TextareaProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseSpeechRecognitionOptions, VoiceInputButton, type VoiceInputButtonProps, VoiceTranscript, type VoiceTranscriptProps, badgeVariants, buttonVariants, cn, describeSpeechError, getConfirmButtonPlacement, isWindowsPlatform, loadingSpinnerIconVariants, sheetVariants, useMediaQuery, useSidebarCollapsed, useSpeechRecognition };
|
|
1199
|
+
export { AiButton, type AiButtonProps, type AiButtonVariant, AiExplainButton, type AiExplainButtonProps, AlertBox, type AlertBoxProps, type AlertBoxVariant, Badge, type BadgeProps, Button, ButtonGroup, type ButtonGroupOption, type ButtonGroupProps, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Combobox, type GridColumn as ComboboxColumn, type ComboboxMultiProps, type ComboboxOption, type ComboboxProps, type ComboboxSingleProps, type ConfirmButtonPlacement, ConfirmDialog, type ConfirmDialogProps, Dialog, DialogActions, type DialogActionsProps, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DonutChart, type DonutSegment, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FormField, type FormFieldProps, FormModal, type FormModalProps, Input, type InputProps, KpiCard, type KpiCardProps, Label, LoadingOverlay, type LoadingOverlayProps, LoadingSpinner, type LoadingSpinnerProps, Modal, type ModalProps, NavGroup, type NavGroupProps, type NavIconProps, NavItem, type NavItemProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, QuestionDialog, type QuestionDialogAction, type QuestionDialogProps, ResponsivePanel, type ResponsivePanelProps, type ResponsivePanelSize, ScrollArea, ScrollBar, SearchBar, type SearchBarProps, SearchPanel, type SearchPanelMode, type SearchPanelProps, SearchTrigger, type SearchTriggerProps, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetBody, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarNav, type SidebarNavProps, type SidebarProps, Skeleton, Sparkline, type SpeechRecognitionEngine, type SpeechRecognitionEngineFactory, type SpeechRecognitionState, StatusBadge, type StatusBadgeProps, type StatusTone, Stepper, type StepperProps, type StepperStep, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagCombobox, type TagComboboxOption, type TagComboboxProps, Textarea, type TextareaProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseSpeechRecognitionOptions, VoiceInputButton, type VoiceInputButtonProps, VoiceTranscript, type VoiceTranscriptProps, badgeVariants, buttonVariants, cn, describeSpeechError, getConfirmButtonPlacement, isWindowsPlatform, loadingSpinnerIconVariants, sheetVariants, useMediaQuery, useSidebarCollapsed, useSpeechRecognition };
|
package/dist/index.js
CHANGED
|
@@ -168,7 +168,7 @@ var Badge = ({ className, variant, ...props }) => /* @__PURE__ */ jsx6("div", {
|
|
|
168
168
|
// src/primitives/dialog.tsx
|
|
169
169
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
170
170
|
import { X } from "lucide-react";
|
|
171
|
-
import { forwardRef as forwardRef5 } from "react";
|
|
171
|
+
import { forwardRef as forwardRef5, useCallback, useLayoutEffect, useRef } from "react";
|
|
172
172
|
import { jsx as jsx7, jsxs } from "react/jsx-runtime";
|
|
173
173
|
var Dialog = DialogPrimitive.Root;
|
|
174
174
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
@@ -188,7 +188,7 @@ var DialogContent = forwardRef5(({ className, children, showCloseButton = true,
|
|
|
188
188
|
{
|
|
189
189
|
ref,
|
|
190
190
|
className: cn(
|
|
191
|
-
"fixed left-1/2 top-1/2 z-50 max-h-[85vh] w-full max-w-md -translate-x-1/2 -translate-y-1/2 overflow-
|
|
191
|
+
"fixed left-1/2 top-1/2 z-50 flex max-h-[85vh] [--dialog-divider:color-mix(in_oklab,var(--color-foreground)_12%,transparent)] dark:[--dialog-divider:var(--color-border)] w-full max-w-md -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg border bg-background shadow-lg",
|
|
192
192
|
className
|
|
193
193
|
),
|
|
194
194
|
...props,
|
|
@@ -198,7 +198,7 @@ var DialogContent = forwardRef5(({ className, children, showCloseButton = true,
|
|
|
198
198
|
DialogPrimitive.Close,
|
|
199
199
|
{
|
|
200
200
|
"data-testid": closeButtonTestId,
|
|
201
|
-
className: "absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",
|
|
201
|
+
className: "absolute right-4 top-4 z-20 rounded-sm opacity-70 hover:opacity-100",
|
|
202
202
|
children: [
|
|
203
203
|
/* @__PURE__ */ jsx7(X, { className: "h-4 w-4" }),
|
|
204
204
|
/* @__PURE__ */ jsx7("span", { className: "sr-only", children: "Close" })
|
|
@@ -213,7 +213,17 @@ DialogContent.displayName = "DialogContent";
|
|
|
213
213
|
var DialogHeader = ({
|
|
214
214
|
className,
|
|
215
215
|
...props
|
|
216
|
-
}) => /* @__PURE__ */ jsx7(
|
|
216
|
+
}) => /* @__PURE__ */ jsx7(
|
|
217
|
+
"div",
|
|
218
|
+
{
|
|
219
|
+
"data-slot": "dialog-header",
|
|
220
|
+
className: cn(
|
|
221
|
+
"flex shrink-0 flex-col gap-1.5 bg-background px-6 pb-3 pt-6 transition-shadow [&:has(+[data-overflow-top])]:shadow-[inset_0_-1px_0_var(--dialog-divider)]",
|
|
222
|
+
className
|
|
223
|
+
),
|
|
224
|
+
...props
|
|
225
|
+
}
|
|
226
|
+
);
|
|
217
227
|
var DialogTitle = forwardRef5(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(DialogPrimitive.Title, { ref, className: cn("text-lg font-semibold", className), ...props }));
|
|
218
228
|
DialogTitle.displayName = "DialogTitle";
|
|
219
229
|
var DialogDescription = forwardRef5(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(
|
|
@@ -225,10 +235,80 @@ var DialogDescription = forwardRef5(({ className, ...props }, ref) => /* @__PURE
|
|
|
225
235
|
}
|
|
226
236
|
));
|
|
227
237
|
DialogDescription.displayName = "DialogDescription";
|
|
238
|
+
function useScrollEdges(ref) {
|
|
239
|
+
useLayoutEffect(() => {
|
|
240
|
+
const el = ref.current;
|
|
241
|
+
if (!el) return void 0;
|
|
242
|
+
const update = () => {
|
|
243
|
+
el.toggleAttribute("data-overflow-top", el.scrollTop > 0.5);
|
|
244
|
+
el.toggleAttribute(
|
|
245
|
+
"data-overflow-bottom",
|
|
246
|
+
el.scrollTop + el.clientHeight < el.scrollHeight - 0.5
|
|
247
|
+
);
|
|
248
|
+
};
|
|
249
|
+
update();
|
|
250
|
+
el.addEventListener("scroll", update, { passive: true });
|
|
251
|
+
const resizeObserver = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(update);
|
|
252
|
+
const observeChildren = () => {
|
|
253
|
+
if (!resizeObserver) return;
|
|
254
|
+
resizeObserver.disconnect();
|
|
255
|
+
resizeObserver.observe(el);
|
|
256
|
+
for (const child of Array.from(el.children)) resizeObserver.observe(child);
|
|
257
|
+
};
|
|
258
|
+
observeChildren();
|
|
259
|
+
const mutationObserver = typeof MutationObserver === "undefined" ? void 0 : new MutationObserver(() => {
|
|
260
|
+
observeChildren();
|
|
261
|
+
update();
|
|
262
|
+
});
|
|
263
|
+
mutationObserver?.observe(el, { childList: true });
|
|
264
|
+
return () => {
|
|
265
|
+
el.removeEventListener("scroll", update);
|
|
266
|
+
resizeObserver?.disconnect();
|
|
267
|
+
mutationObserver?.disconnect();
|
|
268
|
+
};
|
|
269
|
+
}, [ref]);
|
|
270
|
+
}
|
|
271
|
+
var DialogBody = forwardRef5(
|
|
272
|
+
({ className, ...props }, forwardedRef) => {
|
|
273
|
+
const ref = useRef(null);
|
|
274
|
+
useScrollEdges(ref);
|
|
275
|
+
const setRefs = useCallback(
|
|
276
|
+
(node) => {
|
|
277
|
+
ref.current = node;
|
|
278
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
279
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
280
|
+
},
|
|
281
|
+
[forwardedRef]
|
|
282
|
+
);
|
|
283
|
+
return /* @__PURE__ */ jsx7(
|
|
284
|
+
"div",
|
|
285
|
+
{
|
|
286
|
+
ref: setRefs,
|
|
287
|
+
"data-slot": "dialog-body",
|
|
288
|
+
className: cn(
|
|
289
|
+
"min-h-0 flex-1 overflow-y-auto px-6 pb-6 pt-1 empty:pb-3 empty:pt-0 [&:empty:has(+[data-slot=dialog-footer])]:hidden [&:has(+[data-slot=dialog-footer])]:pb-1",
|
|
290
|
+
className
|
|
291
|
+
),
|
|
292
|
+
...props
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
DialogBody.displayName = "DialogBody";
|
|
228
298
|
var DialogFooter = ({
|
|
229
299
|
className,
|
|
230
300
|
...props
|
|
231
|
-
}) => /* @__PURE__ */ jsx7(
|
|
301
|
+
}) => /* @__PURE__ */ jsx7(
|
|
302
|
+
"div",
|
|
303
|
+
{
|
|
304
|
+
"data-slot": "dialog-footer",
|
|
305
|
+
className: cn(
|
|
306
|
+
"flex shrink-0 justify-end gap-2 bg-background px-6 pb-6 pt-3 transition-shadow [[data-overflow-bottom]+&]:shadow-[inset_0_1px_0_var(--dialog-divider)] [[data-slot=dialog-body]:empty+&]:pt-1 [[data-slot=dialog-header]+&]:pt-1",
|
|
307
|
+
className
|
|
308
|
+
),
|
|
309
|
+
...props
|
|
310
|
+
}
|
|
311
|
+
);
|
|
232
312
|
|
|
233
313
|
// src/primitives/popover.tsx
|
|
234
314
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
@@ -634,7 +714,7 @@ DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
|
|
|
634
714
|
import { cva as cva3 } from "class-variance-authority";
|
|
635
715
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
636
716
|
import { X as X2 } from "lucide-react";
|
|
637
|
-
import { forwardRef as forwardRef15, useEffect, useRef, useState } from "react";
|
|
717
|
+
import { forwardRef as forwardRef15, useEffect, useRef as useRef2, useState } from "react";
|
|
638
718
|
import { jsx as jsx18, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
639
719
|
var Sheet = DialogPrimitive2.Root;
|
|
640
720
|
var SheetTrigger = DialogPrimitive2.Trigger;
|
|
@@ -650,7 +730,7 @@ var SheetOverlay = forwardRef15(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
650
730
|
));
|
|
651
731
|
SheetOverlay.displayName = "SheetOverlay";
|
|
652
732
|
var sheetVariants = cva3(
|
|
653
|
-
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition-[transform,box-shadow] duration-300 ease-in-out",
|
|
733
|
+
"fixed z-50 flex flex-col gap-4 overflow-hidden bg-background p-6 shadow-lg transition-[transform,box-shadow] duration-300 ease-in-out",
|
|
654
734
|
{
|
|
655
735
|
variants: {
|
|
656
736
|
side: {
|
|
@@ -685,7 +765,7 @@ var SheetContent = forwardRef15(
|
|
|
685
765
|
}, []);
|
|
686
766
|
const [dragHeight, setDragHeight] = useState(null);
|
|
687
767
|
const [isDragging, setIsDragging] = useState(false);
|
|
688
|
-
const dragStart =
|
|
768
|
+
const dragStart = useRef2(null);
|
|
689
769
|
const canResize = resizable && side === "bottom";
|
|
690
770
|
const onHandlePointerDown = (e) => {
|
|
691
771
|
const popup = e.currentTarget.closest('[data-slot="sheet-content"]');
|
|
@@ -753,11 +833,15 @@ SheetContent.displayName = "SheetContent";
|
|
|
753
833
|
var SheetHeader = ({
|
|
754
834
|
className,
|
|
755
835
|
...props
|
|
756
|
-
}) => /* @__PURE__ */ jsx18("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
836
|
+
}) => /* @__PURE__ */ jsx18("div", { className: cn("flex shrink-0 flex-col gap-1.5", className), ...props });
|
|
837
|
+
var SheetBody = ({
|
|
838
|
+
className,
|
|
839
|
+
...props
|
|
840
|
+
}) => /* @__PURE__ */ jsx18("div", { className: cn("min-h-0 flex-1 overflow-y-auto", className), ...props });
|
|
757
841
|
var SheetFooter = ({
|
|
758
842
|
className,
|
|
759
843
|
...props
|
|
760
|
-
}) => /* @__PURE__ */ jsx18("div", { className: cn("flex justify-end gap-2", className), ...props });
|
|
844
|
+
}) => /* @__PURE__ */ jsx18("div", { className: cn("flex shrink-0 justify-end gap-2", className), ...props });
|
|
761
845
|
var SheetTitle = forwardRef15(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(DialogPrimitive2.Title, { ref, className: cn("text-lg font-semibold", className), ...props }));
|
|
762
846
|
SheetTitle.displayName = "SheetTitle";
|
|
763
847
|
var SheetDescription = forwardRef15(({ className, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
@@ -806,7 +890,7 @@ var Modal = ({
|
|
|
806
890
|
/* @__PURE__ */ jsx20(DialogTitle, { children: title }),
|
|
807
891
|
description ? /* @__PURE__ */ jsx20(DialogDescription, { children: description }) : null
|
|
808
892
|
] }),
|
|
809
|
-
children,
|
|
893
|
+
/* @__PURE__ */ jsx20(DialogBody, { children }),
|
|
810
894
|
footer ? /* @__PURE__ */ jsx20(DialogFooter, { children: footer }) : null
|
|
811
895
|
] }) });
|
|
812
896
|
|
|
@@ -928,12 +1012,12 @@ var FormModal = ({
|
|
|
928
1012
|
const handleCancel = () => {
|
|
929
1013
|
onOpenChange(false);
|
|
930
1014
|
};
|
|
931
|
-
return /* @__PURE__ */ jsx23(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsx23(DialogContent, { className, children: /* @__PURE__ */ jsxs8("form", { onSubmit: handleSubmit, children: [
|
|
1015
|
+
return /* @__PURE__ */ jsx23(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsx23(DialogContent, { className, children: /* @__PURE__ */ jsxs8("form", { onSubmit: handleSubmit, className: "flex min-h-0 flex-1 flex-col", children: [
|
|
932
1016
|
/* @__PURE__ */ jsxs8(DialogHeader, { children: [
|
|
933
1017
|
/* @__PURE__ */ jsx23(DialogTitle, { children: title }),
|
|
934
1018
|
description ? /* @__PURE__ */ jsx23(DialogDescription, { children: description }) : null
|
|
935
1019
|
] }),
|
|
936
|
-
children,
|
|
1020
|
+
/* @__PURE__ */ jsx23(DialogBody, { children }),
|
|
937
1021
|
/* @__PURE__ */ jsxs8(DialogFooter, { children: [
|
|
938
1022
|
/* @__PURE__ */ jsx23(
|
|
939
1023
|
Button,
|
|
@@ -952,7 +1036,7 @@ var FormModal = ({
|
|
|
952
1036
|
};
|
|
953
1037
|
|
|
954
1038
|
// src/patterns/modal/ResponsivePanel.tsx
|
|
955
|
-
import { useRef as
|
|
1039
|
+
import { useRef as useRef3, useState as useState6 } from "react";
|
|
956
1040
|
|
|
957
1041
|
// src/lib/useMediaQuery.ts
|
|
958
1042
|
import { useEffect as useEffect2, useState as useState5 } from "react";
|
|
@@ -1008,8 +1092,8 @@ var cornerGripPosition = {
|
|
|
1008
1092
|
function useDesktopPanelGeometry() {
|
|
1009
1093
|
const [style, setStyle] = useState6(void 0);
|
|
1010
1094
|
const [isDragging, setIsDragging] = useState6(false);
|
|
1011
|
-
const drag =
|
|
1012
|
-
const lastRect =
|
|
1095
|
+
const drag = useRef3(null);
|
|
1096
|
+
const lastRect = useRef3(null);
|
|
1013
1097
|
const beginDrag = (mode, corner) => (e) => {
|
|
1014
1098
|
const content = e.currentTarget.closest('[data-slot="dialog-content"]');
|
|
1015
1099
|
if (!(content instanceof HTMLElement)) return;
|
|
@@ -1104,7 +1188,7 @@ var ResponsivePanel = ({
|
|
|
1104
1188
|
onInteractOutside,
|
|
1105
1189
|
style: resizable || draggable ? geometry.style : void 0,
|
|
1106
1190
|
className: cn(
|
|
1107
|
-
"max-h-[85vh]
|
|
1191
|
+
"max-h-[85vh] transition-shadow duration-150 ease-out",
|
|
1108
1192
|
geometry.isDragging && "shadow-2xl ring-2 ring-primary/30",
|
|
1109
1193
|
desktopSizeClasses[size],
|
|
1110
1194
|
className
|
|
@@ -1149,7 +1233,7 @@ var ResponsivePanel = ({
|
|
|
1149
1233
|
]
|
|
1150
1234
|
}
|
|
1151
1235
|
),
|
|
1152
|
-
children,
|
|
1236
|
+
/* @__PURE__ */ jsx24(DialogBody, { children }),
|
|
1153
1237
|
footer ? /* @__PURE__ */ jsx24(DialogFooter, { children: footer }) : null
|
|
1154
1238
|
]
|
|
1155
1239
|
}
|
|
@@ -1161,17 +1245,13 @@ var ResponsivePanel = ({
|
|
|
1161
1245
|
side: "bottom",
|
|
1162
1246
|
resizable,
|
|
1163
1247
|
onInteractOutside,
|
|
1164
|
-
className: cn(
|
|
1165
|
-
"flex flex-col overflow-y-auto rounded-t-2xl",
|
|
1166
|
-
drawerSizeClasses[size],
|
|
1167
|
-
className
|
|
1168
|
-
),
|
|
1248
|
+
className: cn("rounded-t-2xl", drawerSizeClasses[size], className),
|
|
1169
1249
|
children: [
|
|
1170
1250
|
/* @__PURE__ */ jsxs9(SheetHeader, { children: [
|
|
1171
1251
|
/* @__PURE__ */ jsx24(SheetTitle, { children: title }),
|
|
1172
1252
|
description ? /* @__PURE__ */ jsx24(SheetDescription, { children: description }) : null
|
|
1173
1253
|
] }),
|
|
1174
|
-
children,
|
|
1254
|
+
/* @__PURE__ */ jsx24(SheetBody, { children }),
|
|
1175
1255
|
footer ? /* @__PURE__ */ jsx24(SheetFooter, { children: footer }) : null
|
|
1176
1256
|
]
|
|
1177
1257
|
}
|
|
@@ -1277,7 +1357,7 @@ function FormField({
|
|
|
1277
1357
|
|
|
1278
1358
|
// src/patterns/combobox/Combobox.tsx
|
|
1279
1359
|
import { Check as Check4, ChevronsUpDown, X as X3 } from "lucide-react";
|
|
1280
|
-
import { useEffect as useEffect3, useMemo, useRef as
|
|
1360
|
+
import { useEffect as useEffect3, useMemo, useRef as useRef4, useState as useState8 } from "react";
|
|
1281
1361
|
|
|
1282
1362
|
// src/lib/optionGrouping.ts
|
|
1283
1363
|
function groupMembers(options, group) {
|
|
@@ -1418,7 +1498,7 @@ function Combobox(props) {
|
|
|
1418
1498
|
const [open, setOpen] = useState8(false);
|
|
1419
1499
|
const [search, setSearch] = useState8("");
|
|
1420
1500
|
const [activeIndex, setActiveIndex] = useState8(0);
|
|
1421
|
-
const inputRef =
|
|
1501
|
+
const inputRef = useRef4(null);
|
|
1422
1502
|
const selectedValues = useMemo(
|
|
1423
1503
|
() => props.multiple ? props.value : props.value ? [props.value] : [],
|
|
1424
1504
|
[props.multiple, props.value]
|
|
@@ -1636,7 +1716,7 @@ function Combobox(props) {
|
|
|
1636
1716
|
|
|
1637
1717
|
// src/patterns/tag-combobox/TagCombobox.tsx
|
|
1638
1718
|
import { X as X4 } from "lucide-react";
|
|
1639
|
-
import { useEffect as useEffect4, useMemo as useMemo2, useRef as
|
|
1719
|
+
import { useEffect as useEffect4, useMemo as useMemo2, useRef as useRef5, useState as useState9 } from "react";
|
|
1640
1720
|
import { jsx as jsx29, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1641
1721
|
function TagCombobox({
|
|
1642
1722
|
options,
|
|
@@ -1659,8 +1739,8 @@ function TagCombobox({
|
|
|
1659
1739
|
const [open, setOpen] = useState9(false);
|
|
1660
1740
|
const [search, setSearch] = useState9("");
|
|
1661
1741
|
const [activeIndex, setActiveIndex] = useState9(0);
|
|
1662
|
-
const inputRef =
|
|
1663
|
-
const fieldRef =
|
|
1742
|
+
const inputRef = useRef5(null);
|
|
1743
|
+
const fieldRef = useRef5(null);
|
|
1664
1744
|
const selectedOptions = useMemo2(
|
|
1665
1745
|
() => value.map((v) => options.find((o) => o.value === v) ?? { value: v, label: v }),
|
|
1666
1746
|
[options, value]
|
|
@@ -2560,9 +2640,9 @@ function NavGroup({
|
|
|
2560
2640
|
// src/patterns/sidebar/Sidebar.tsx
|
|
2561
2641
|
import { PanelLeftClose, PanelLeftOpen } from "lucide-react";
|
|
2562
2642
|
import {
|
|
2563
|
-
useCallback,
|
|
2643
|
+
useCallback as useCallback2,
|
|
2564
2644
|
useEffect as useEffect5,
|
|
2565
|
-
useRef as
|
|
2645
|
+
useRef as useRef6,
|
|
2566
2646
|
useState as useState11
|
|
2567
2647
|
} from "react";
|
|
2568
2648
|
import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
@@ -2587,7 +2667,7 @@ function Sidebar({
|
|
|
2587
2667
|
const [internalWidth, setInternalWidth] = useState11(defaultWidth);
|
|
2588
2668
|
const currentWidth = width ?? internalWidth;
|
|
2589
2669
|
const [isDragging, setIsDragging] = useState11(false);
|
|
2590
|
-
const setWidth =
|
|
2670
|
+
const setWidth = useCallback2(
|
|
2591
2671
|
(next) => {
|
|
2592
2672
|
const clamped = Math.min(maxWidth, Math.max(minWidth, next));
|
|
2593
2673
|
onWidthChange?.(clamped);
|
|
@@ -2595,7 +2675,7 @@ function Sidebar({
|
|
|
2595
2675
|
},
|
|
2596
2676
|
[maxWidth, minWidth, onWidthChange, width]
|
|
2597
2677
|
);
|
|
2598
|
-
const dragStartRef =
|
|
2678
|
+
const dragStartRef = useRef6(null);
|
|
2599
2679
|
const handlePointerDown = (event) => {
|
|
2600
2680
|
event.currentTarget.setPointerCapture(event.pointerId);
|
|
2601
2681
|
dragStartRef.current = { x: event.clientX, width: currentWidth };
|
|
@@ -2677,7 +2757,7 @@ function Sidebar({
|
|
|
2677
2757
|
) }) });
|
|
2678
2758
|
}
|
|
2679
2759
|
function SidebarNav({ children, className, ...rest }) {
|
|
2680
|
-
const ref =
|
|
2760
|
+
const ref = useRef6(null);
|
|
2681
2761
|
const [showFade, setShowFade] = useState11(false);
|
|
2682
2762
|
useEffect5(() => {
|
|
2683
2763
|
const el = ref.current;
|
|
@@ -2789,7 +2869,7 @@ import { Mic, MicOff } from "lucide-react";
|
|
|
2789
2869
|
import { forwardRef as forwardRef18 } from "react";
|
|
2790
2870
|
|
|
2791
2871
|
// src/patterns/ai/useSpeechRecognition.ts
|
|
2792
|
-
import { useCallback as
|
|
2872
|
+
import { useCallback as useCallback3, useEffect as useEffect6, useRef as useRef7, useState as useState13 } from "react";
|
|
2793
2873
|
function getCtor() {
|
|
2794
2874
|
if (typeof window === "undefined") return void 0;
|
|
2795
2875
|
const w = window;
|
|
@@ -2825,18 +2905,18 @@ function useSpeechRecognition({
|
|
|
2825
2905
|
const [listening, setListening] = useState13(false);
|
|
2826
2906
|
const [interim, setInterim] = useState13("");
|
|
2827
2907
|
const [error, setError] = useState13(null);
|
|
2828
|
-
const recognitionRef =
|
|
2829
|
-
const onResultRef =
|
|
2830
|
-
const onErrorRef =
|
|
2831
|
-
const engineRef =
|
|
2908
|
+
const recognitionRef = useRef7(null);
|
|
2909
|
+
const onResultRef = useRef7(onResult);
|
|
2910
|
+
const onErrorRef = useRef7(onError);
|
|
2911
|
+
const engineRef = useRef7(engine);
|
|
2832
2912
|
onResultRef.current = onResult;
|
|
2833
2913
|
onErrorRef.current = onError;
|
|
2834
2914
|
engineRef.current = engine;
|
|
2835
2915
|
const supported = engine !== void 0 || getCtor() !== void 0;
|
|
2836
|
-
const stop =
|
|
2916
|
+
const stop = useCallback3(() => {
|
|
2837
2917
|
recognitionRef.current?.stop();
|
|
2838
2918
|
}, []);
|
|
2839
|
-
const start =
|
|
2919
|
+
const start = useCallback3(() => {
|
|
2840
2920
|
if (recognitionRef.current) return;
|
|
2841
2921
|
const recognition = engineRef.current ? engineRef.current() : browserEngine();
|
|
2842
2922
|
if (!recognition) return;
|
|
@@ -2869,7 +2949,7 @@ function useSpeechRecognition({
|
|
|
2869
2949
|
setListening(true);
|
|
2870
2950
|
recognition.start();
|
|
2871
2951
|
}, [lang]);
|
|
2872
|
-
const toggle =
|
|
2952
|
+
const toggle = useCallback3(() => {
|
|
2873
2953
|
if (recognitionRef.current) stop();
|
|
2874
2954
|
else start();
|
|
2875
2955
|
}, [start, stop]);
|
|
@@ -3029,7 +3109,7 @@ function VoiceTranscript({
|
|
|
3029
3109
|
}
|
|
3030
3110
|
|
|
3031
3111
|
// src/patterns/stepper/Stepper.tsx
|
|
3032
|
-
import { useEffect as useEffect7, useRef as
|
|
3112
|
+
import { useEffect as useEffect7, useRef as useRef8 } from "react";
|
|
3033
3113
|
import { Check as Check5, Plus } from "lucide-react";
|
|
3034
3114
|
import { jsx as jsx45, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3035
3115
|
function Stepper({
|
|
@@ -3043,7 +3123,7 @@ function Stepper({
|
|
|
3043
3123
|
scrollTestId = "stepper-scroll",
|
|
3044
3124
|
newTestId
|
|
3045
3125
|
}) {
|
|
3046
|
-
const stepRefs =
|
|
3126
|
+
const stepRefs = useRef8(/* @__PURE__ */ new Map());
|
|
3047
3127
|
useEffect7(() => {
|
|
3048
3128
|
const activeStep = stepRefs.current.get(step);
|
|
3049
3129
|
activeStep?.scrollIntoView({ block: "nearest", inline: "center" });
|
|
@@ -3151,6 +3231,7 @@ export {
|
|
|
3151
3231
|
ConfirmDialog,
|
|
3152
3232
|
Dialog,
|
|
3153
3233
|
DialogActions,
|
|
3234
|
+
DialogBody,
|
|
3154
3235
|
DialogContent,
|
|
3155
3236
|
DialogDescription,
|
|
3156
3237
|
DialogFooter,
|
|
@@ -3202,6 +3283,7 @@ export {
|
|
|
3202
3283
|
SelectValue,
|
|
3203
3284
|
Separator,
|
|
3204
3285
|
Sheet,
|
|
3286
|
+
SheetBody,
|
|
3205
3287
|
SheetClose,
|
|
3206
3288
|
SheetContent,
|
|
3207
3289
|
SheetDescription,
|