@fayz-ai/ui 0.11.0 → 0.14.0
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/analytics/AnalyticsCard.d.ts.map +1 -1
- package/dist/analytics/AnalyticsControls.d.ts +5 -1
- package/dist/analytics/AnalyticsControls.d.ts.map +1 -1
- package/dist/analytics/derive.d.ts.map +1 -1
- package/dist/{chunk-JGJNRNQW.js → chunk-2EFRFYGF.js} +117 -41
- package/dist/chunk-2EFRFYGF.js.map +1 -0
- package/dist/{chunk-7BMXN7MP.js → chunk-46UZAKFJ.js} +24 -24
- package/dist/chunk-46UZAKFJ.js.map +1 -0
- package/dist/chunk-5KAGNW45.js +152 -0
- package/dist/chunk-5KAGNW45.js.map +1 -0
- package/dist/{chunk-XRDCYOND.js → chunk-77CUIMOI.js} +289 -166
- package/dist/chunk-77CUIMOI.js.map +1 -0
- package/dist/chunk-LFZFBN3P.js +142 -0
- package/dist/chunk-LFZFBN3P.js.map +1 -0
- package/dist/{chunk-QSHA2Q27.js → chunk-MVH64JFG.js} +1049 -771
- package/dist/chunk-MVH64JFG.js.map +1 -0
- package/dist/{chunk-22EVFMS3.js → chunk-UZYXFEQS.js} +4 -3
- package/dist/chunk-UZYXFEQS.js.map +1 -0
- package/dist/dashboard/DashboardCanvas.d.ts.map +1 -1
- package/dist/dashboard/DashboardCustomizeMenu.d.ts.map +1 -1
- package/dist/dashboard/DashboardRange.d.ts +8 -2
- package/dist/dashboard/DashboardRange.d.ts.map +1 -1
- package/dist/dashboard/index.js +4 -5
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +72 -98
- package/dist/index.js.map +1 -1
- package/dist/layout/AppShell.d.ts +1 -0
- package/dist/layout/AppShell.d.ts.map +1 -1
- package/dist/layout/AppShellSkeleton.d.ts +1 -1
- package/dist/layout/ModulePage.d.ts +24 -1
- package/dist/layout/ModulePage.d.ts.map +1 -1
- package/dist/layout/Sidebar.d.ts.map +1 -1
- package/dist/layout/index.d.ts +2 -1
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +4 -5
- package/dist/layout/rail-flyout.d.ts +10 -0
- package/dist/layout/rail-flyout.d.ts.map +1 -1
- package/dist/primitives/bulk-action-bar.d.ts +3 -1
- package/dist/primitives/bulk-action-bar.d.ts.map +1 -1
- package/dist/primitives/header-tabs.d.ts +36 -6
- package/dist/primitives/header-tabs.d.ts.map +1 -1
- package/dist/primitives/index.d.ts +3 -1
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +5 -4
- package/dist/primitives/list-view.d.ts +3 -1
- package/dist/primitives/list-view.d.ts.map +1 -1
- package/dist/primitives/page-toolbar.d.ts +61 -0
- package/dist/primitives/page-toolbar.d.ts.map +1 -0
- package/dist/primitives/refresh-button.d.ts +18 -0
- package/dist/primitives/refresh-button.d.ts.map +1 -0
- package/dist/primitives/search-select.d.ts +3 -1
- package/dist/primitives/search-select.d.ts.map +1 -1
- package/dist/primitives/tabs.d.ts.map +1 -1
- package/dist/stores/index.d.ts +1 -1
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/page-header.store.d.ts +26 -2
- package/dist/stores/page-header.store.d.ts.map +1 -1
- package/dist/styles.css +224 -0
- package/package.json +5 -5
- package/dist/chunk-22EVFMS3.js.map +0 -1
- package/dist/chunk-7BMXN7MP.js.map +0 -1
- package/dist/chunk-JGJNRNQW.js.map +0 -1
- package/dist/chunk-OKZ6WQB3.js +0 -57
- package/dist/chunk-OKZ6WQB3.js.map +0 -1
- package/dist/chunk-QSHA2Q27.js.map +0 -1
- package/dist/chunk-VAKWUUVC.js +0 -425
- package/dist/chunk-VAKWUUVC.js.map +0 -1
- package/dist/chunk-XRDCYOND.js.map +0 -1
- package/dist/chunk-ZBQ772DU.js +0 -17
- package/dist/chunk-ZBQ772DU.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useSaveBarVisible, useCrossModuleBack, useBackHandler,
|
|
2
|
-
import { Dropdown, DropdownTrigger, DropdownContent, DropdownItem, Card, DataTable
|
|
3
|
-
import { cn, Button } from './chunk-
|
|
4
|
-
import * as
|
|
1
|
+
import { useSaveBarVisible, useCrossModuleBack, useBackHandler, PageHeaderActions } from './chunk-MVH64JFG.js';
|
|
2
|
+
import { Dropdown, DropdownTrigger, DropdownContent, DropdownItem, Card, DataTable } from './chunk-2EFRFYGF.js';
|
|
3
|
+
import { cn, Button } from './chunk-LFZFBN3P.js';
|
|
4
|
+
import * as React14 from 'react';
|
|
5
5
|
import { useState, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
6
6
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
9
|
-
import { X, ChevronDown, ChevronUp, Check, ArrowLeft, Search, ChevronLeft, ChevronRight, MoreHorizontal, ImageIcon, Clock, Plus,
|
|
9
|
+
import { X, ChevronDown, ChevronUp, Check, ArrowLeft, Search, ChevronLeft, ChevronRight, MoreHorizontal, ImageIcon, RefreshCw, Clock, Plus, Download, Calendar, Loader2, CheckCircle2, AlertTriangle, XCircle, Info } from 'lucide-react';
|
|
10
10
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
11
11
|
import { Toaster } from 'sonner';
|
|
12
12
|
export { toast } from 'sonner';
|
|
@@ -17,9 +17,9 @@ import { useTranslation, getCountry, unmaskPhone, maskPhone, getCurrentLocale }
|
|
|
17
17
|
import { createPortal } from 'react-dom';
|
|
18
18
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
19
19
|
|
|
20
|
-
var Input =
|
|
20
|
+
var Input = React14.forwardRef(
|
|
21
21
|
({ className, type, error, description, id, ...props }, ref) => {
|
|
22
|
-
const inputId = id ??
|
|
22
|
+
const inputId = id ?? React14.useId();
|
|
23
23
|
const descriptionId = description ? `${inputId}-description` : void 0;
|
|
24
24
|
const errorId = error ? `${inputId}-error` : void 0;
|
|
25
25
|
return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
@@ -107,7 +107,7 @@ var Modal = DialogPrimitive.Root;
|
|
|
107
107
|
var ModalTrigger = DialogPrimitive.Trigger;
|
|
108
108
|
var ModalClose = DialogPrimitive.Close;
|
|
109
109
|
var ModalPortal = DialogPrimitive.Portal;
|
|
110
|
-
var ModalOverlay =
|
|
110
|
+
var ModalOverlay = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
111
111
|
DialogPrimitive.Overlay,
|
|
112
112
|
{
|
|
113
113
|
ref,
|
|
@@ -120,7 +120,7 @@ var ModalOverlay = React13.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
120
120
|
}
|
|
121
121
|
));
|
|
122
122
|
ModalOverlay.displayName = "ModalOverlay";
|
|
123
|
-
var ModalContent =
|
|
123
|
+
var ModalContent = React14.forwardRef(({ className, children, size = "lg", hideClose, noPadding, onPointerDownOutside, onInteractOutside, onCloseAutoFocus, ...props }, ref) => /* @__PURE__ */ jsx(ModalPortal, { children: /* @__PURE__ */ jsx(ModalOverlay, { children: /* @__PURE__ */ jsxs(
|
|
124
124
|
DialogPrimitive.Content,
|
|
125
125
|
{
|
|
126
126
|
ref,
|
|
@@ -175,14 +175,14 @@ function ModalBody({ className, ...props }) {
|
|
|
175
175
|
function ModalFooter({ className, ...props }) {
|
|
176
176
|
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 shrink-0", className), ...props });
|
|
177
177
|
}
|
|
178
|
-
var ModalTitle =
|
|
178
|
+
var ModalTitle = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Title, { ref, className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props }));
|
|
179
179
|
ModalTitle.displayName = "ModalTitle";
|
|
180
|
-
var ModalDescription =
|
|
180
|
+
var ModalDescription = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Description, { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
181
181
|
ModalDescription.displayName = "ModalDescription";
|
|
182
182
|
var Select = SelectPrimitive.Root;
|
|
183
183
|
var SelectGroup = SelectPrimitive.Group;
|
|
184
184
|
var SelectValue = SelectPrimitive.Value;
|
|
185
|
-
var SelectTrigger =
|
|
185
|
+
var SelectTrigger = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
186
186
|
SelectPrimitive.Trigger,
|
|
187
187
|
{
|
|
188
188
|
ref,
|
|
@@ -198,7 +198,7 @@ var SelectTrigger = React13.forwardRef(({ className, children, ...props }, ref)
|
|
|
198
198
|
}
|
|
199
199
|
));
|
|
200
200
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
201
|
-
var SelectScrollUpButton =
|
|
201
|
+
var SelectScrollUpButton = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
202
202
|
SelectPrimitive.ScrollUpButton,
|
|
203
203
|
{
|
|
204
204
|
ref,
|
|
@@ -211,7 +211,7 @@ var SelectScrollUpButton = React13.forwardRef(({ className, ...props }, ref) =>
|
|
|
211
211
|
}
|
|
212
212
|
));
|
|
213
213
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
214
|
-
var SelectScrollDownButton =
|
|
214
|
+
var SelectScrollDownButton = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
215
215
|
SelectPrimitive.ScrollDownButton,
|
|
216
216
|
{
|
|
217
217
|
ref,
|
|
@@ -224,7 +224,7 @@ var SelectScrollDownButton = React13.forwardRef(({ className, ...props }, ref) =
|
|
|
224
224
|
}
|
|
225
225
|
));
|
|
226
226
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
227
|
-
var SelectContent =
|
|
227
|
+
var SelectContent = React14.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
228
228
|
SelectPrimitive.Content,
|
|
229
229
|
{
|
|
230
230
|
ref,
|
|
@@ -252,7 +252,7 @@ var SelectContent = React13.forwardRef(({ className, children, position = "poppe
|
|
|
252
252
|
}
|
|
253
253
|
) }));
|
|
254
254
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
255
|
-
var SelectLabel =
|
|
255
|
+
var SelectLabel = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
256
256
|
SelectPrimitive.Label,
|
|
257
257
|
{
|
|
258
258
|
ref,
|
|
@@ -261,7 +261,7 @@ var SelectLabel = React13.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
261
261
|
}
|
|
262
262
|
));
|
|
263
263
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
264
|
-
var SelectItem =
|
|
264
|
+
var SelectItem = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
265
265
|
SelectPrimitive.Item,
|
|
266
266
|
{
|
|
267
267
|
ref,
|
|
@@ -277,7 +277,7 @@ var SelectItem = React13.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
277
277
|
}
|
|
278
278
|
));
|
|
279
279
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
280
|
-
var SelectSeparator =
|
|
280
|
+
var SelectSeparator = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
281
281
|
SelectPrimitive.Separator,
|
|
282
282
|
{
|
|
283
283
|
ref,
|
|
@@ -315,31 +315,33 @@ function ToastProvider({
|
|
|
315
315
|
);
|
|
316
316
|
}
|
|
317
317
|
var Tabs = TabsPrimitive.Root;
|
|
318
|
-
var TabsList =
|
|
318
|
+
var TabsList = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
319
319
|
TabsPrimitive.List,
|
|
320
320
|
{
|
|
321
321
|
ref,
|
|
322
322
|
className: cn(
|
|
323
|
-
|
|
323
|
+
// Theme radius, not a fixed one: the chip and its track are controls, and
|
|
324
|
+
// an app that states 12px corners had these two answering 6px.
|
|
325
|
+
"inline-flex h-10 items-center justify-center rounded-button bg-muted p-1 text-muted-foreground",
|
|
324
326
|
className
|
|
325
327
|
),
|
|
326
328
|
...props
|
|
327
329
|
}
|
|
328
330
|
));
|
|
329
331
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
330
|
-
var TabsTrigger =
|
|
332
|
+
var TabsTrigger = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
331
333
|
TabsPrimitive.Trigger,
|
|
332
334
|
{
|
|
333
335
|
ref,
|
|
334
336
|
className: cn(
|
|
335
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-
|
|
337
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-button px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
336
338
|
className
|
|
337
339
|
),
|
|
338
340
|
...props
|
|
339
341
|
}
|
|
340
342
|
));
|
|
341
343
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
342
|
-
var TabsContent =
|
|
344
|
+
var TabsContent = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
343
345
|
TabsPrimitive.Content,
|
|
344
346
|
{
|
|
345
347
|
ref,
|
|
@@ -351,7 +353,7 @@ var TabsContent = React13.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
351
353
|
}
|
|
352
354
|
));
|
|
353
355
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
354
|
-
var Separator2 =
|
|
356
|
+
var Separator2 = React14.forwardRef(
|
|
355
357
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
356
358
|
SeparatorPrimitive.Root,
|
|
357
359
|
{
|
|
@@ -402,7 +404,7 @@ function formatPhone(digits, fallback, countryCode) {
|
|
|
402
404
|
const tail = rest.length === 9 ? rest.slice(5) : rest.slice(4);
|
|
403
405
|
return `+55 (${ddd}) ${head}-${tail}`;
|
|
404
406
|
}
|
|
405
|
-
var PhoneLink =
|
|
407
|
+
var PhoneLink = React14.forwardRef(
|
|
406
408
|
({ phone, message, countryCode, raw, className, children, ...props }, ref) => {
|
|
407
409
|
const { e164, display } = normalizePhone(phone, countryCode);
|
|
408
410
|
const label = children ?? (raw ? phone ?? "" : display);
|
|
@@ -451,7 +453,7 @@ function Breadcrumb({ parent, current, onBack }) {
|
|
|
451
453
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
452
454
|
var Tooltip = TooltipPrimitive.Root;
|
|
453
455
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
454
|
-
var TooltipContent =
|
|
456
|
+
var TooltipContent = React14.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
455
457
|
TooltipPrimitive.Content,
|
|
456
458
|
{
|
|
457
459
|
ref,
|
|
@@ -531,6 +533,7 @@ function BulkActionBar({
|
|
|
531
533
|
onSelectAll,
|
|
532
534
|
onClear,
|
|
533
535
|
actions = [],
|
|
536
|
+
variant = "band",
|
|
534
537
|
className
|
|
535
538
|
}) {
|
|
536
539
|
const t = useTranslation();
|
|
@@ -541,7 +544,8 @@ function BulkActionBar({
|
|
|
541
544
|
"div",
|
|
542
545
|
{
|
|
543
546
|
className: cn(
|
|
544
|
-
"flex flex-wrap items-center justify-between gap-2
|
|
547
|
+
"flex flex-wrap items-center justify-between gap-2",
|
|
548
|
+
variant === "band" ? "rounded-lg border border-border bg-muted/30 px-3 py-2" : "w-full min-h-8",
|
|
545
549
|
className
|
|
546
550
|
),
|
|
547
551
|
role: "region",
|
|
@@ -617,8 +621,8 @@ var ICON_CLASSES = {
|
|
|
617
621
|
lg: "h-5 w-5"
|
|
618
622
|
};
|
|
619
623
|
function Thumbnail({ src, alt = "", size = "md", icon: Icon2 = ImageIcon, className }) {
|
|
620
|
-
const [failed, setFailed] =
|
|
621
|
-
|
|
624
|
+
const [failed, setFailed] = React14.useState(false);
|
|
625
|
+
React14.useEffect(() => {
|
|
622
626
|
setFailed(false);
|
|
623
627
|
}, [src]);
|
|
624
628
|
const base = cn("shrink-0 overflow-hidden", SIZE_CLASSES[size], className);
|
|
@@ -644,6 +648,47 @@ function Thumbnail({ src, alt = "", size = "md", icon: Icon2 = ImageIcon, classN
|
|
|
644
648
|
);
|
|
645
649
|
}
|
|
646
650
|
Thumbnail.displayName = "Thumbnail";
|
|
651
|
+
function RefreshButton({ onRefresh, fromCache, label, labelCached, className, ...rest }) {
|
|
652
|
+
const [phase, setPhase] = React14.useState("idle");
|
|
653
|
+
const alive = React14.useRef(true);
|
|
654
|
+
React14.useEffect(() => () => {
|
|
655
|
+
alive.current = false;
|
|
656
|
+
}, []);
|
|
657
|
+
const title = fromCache ? labelCached ?? label : label;
|
|
658
|
+
async function run() {
|
|
659
|
+
if (phase === "busy") return;
|
|
660
|
+
setPhase("busy");
|
|
661
|
+
try {
|
|
662
|
+
await onRefresh();
|
|
663
|
+
} catch {
|
|
664
|
+
}
|
|
665
|
+
if (!alive.current) return;
|
|
666
|
+
setPhase("done");
|
|
667
|
+
setTimeout(() => {
|
|
668
|
+
if (alive.current) setPhase((p) => p === "done" ? "idle" : p);
|
|
669
|
+
}, 1400);
|
|
670
|
+
}
|
|
671
|
+
return /* @__PURE__ */ jsx(
|
|
672
|
+
"button",
|
|
673
|
+
{
|
|
674
|
+
type: "button",
|
|
675
|
+
title,
|
|
676
|
+
"aria-label": title,
|
|
677
|
+
onClick: () => {
|
|
678
|
+
void run();
|
|
679
|
+
},
|
|
680
|
+
className: cn(
|
|
681
|
+
"inline-flex items-center justify-center transition",
|
|
682
|
+
fromCache && phase !== "done" && "text-amber-600 hover:text-amber-700 dark:text-amber-500 dark:hover:text-amber-400",
|
|
683
|
+
phase === "done" && "text-emerald-600 dark:text-emerald-500",
|
|
684
|
+
className
|
|
685
|
+
),
|
|
686
|
+
...rest,
|
|
687
|
+
children: phase === "done" ? /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(RefreshCw, { className: cn("h-4 w-4", phase === "busy" && "animate-spin") })
|
|
688
|
+
}
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
RefreshButton.displayName = "RefreshButton";
|
|
647
692
|
function PhoneField({
|
|
648
693
|
value,
|
|
649
694
|
onChange,
|
|
@@ -704,7 +749,7 @@ var THUMB = {
|
|
|
704
749
|
sm: "h-3 w-3 data-[on=true]:translate-x-3",
|
|
705
750
|
md: "h-4 w-4 data-[on=true]:translate-x-4"
|
|
706
751
|
};
|
|
707
|
-
var Switch =
|
|
752
|
+
var Switch = React14.forwardRef(function Switch2({ checked, onCheckedChange, size = "sm", label, className, disabled, ...rest }, ref) {
|
|
708
753
|
const control = /* @__PURE__ */ jsx(
|
|
709
754
|
"button",
|
|
710
755
|
{
|
|
@@ -755,8 +800,8 @@ var Switch = React13.forwardRef(function Switch2({ checked, onCheckedChange, siz
|
|
|
755
800
|
}
|
|
756
801
|
);
|
|
757
802
|
});
|
|
758
|
-
var Hint =
|
|
759
|
-
if (!label) return
|
|
803
|
+
var Hint = React14.forwardRef(function Hint2({ label, children, side = "top", delayDuration = 0, ...rest }, ref) {
|
|
804
|
+
if (!label) return React14.cloneElement(children, { ...rest, ref });
|
|
760
805
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
761
806
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, ...rest, ref, children }),
|
|
762
807
|
/* @__PURE__ */ jsx(TooltipContent, { side, className: "px-2 py-1 text-xs font-medium", children: label })
|
|
@@ -877,7 +922,39 @@ function TimePicker({ value, onChange, interval = 15, min = "00:00", max = "23:4
|
|
|
877
922
|
)
|
|
878
923
|
] });
|
|
879
924
|
}
|
|
880
|
-
|
|
925
|
+
function FilterChip({ allLabel, options, value, onChange, label, icon: Icon2, className }) {
|
|
926
|
+
const active = value != null && value !== "";
|
|
927
|
+
const current = options.find((o) => o.value === value);
|
|
928
|
+
return /* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
929
|
+
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
930
|
+
"button",
|
|
931
|
+
{
|
|
932
|
+
type: "button",
|
|
933
|
+
"aria-label": label,
|
|
934
|
+
className: cn(
|
|
935
|
+
"inline-flex shrink-0 items-center gap-1 rounded-full border px-2.5 py-1 text-xs font-medium transition-colors",
|
|
936
|
+
active ? "border-primary/30 bg-primary/10 text-primary hover:bg-primary/15" : "border-transparent bg-muted/70 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
937
|
+
className
|
|
938
|
+
),
|
|
939
|
+
children: [
|
|
940
|
+
Icon2 && /* @__PURE__ */ jsx(Icon2, { className: "h-3 w-3 shrink-0 opacity-70" }),
|
|
941
|
+
/* @__PURE__ */ jsx("span", { className: "max-w-[12rem] truncate", children: current?.label ?? allLabel }),
|
|
942
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3 shrink-0 opacity-60" })
|
|
943
|
+
]
|
|
944
|
+
}
|
|
945
|
+
) }),
|
|
946
|
+
/* @__PURE__ */ jsxs(DropdownContent, { align: "start", children: [
|
|
947
|
+
/* @__PURE__ */ jsxs(DropdownItem, { onClick: () => onChange(void 0), children: [
|
|
948
|
+
allLabel,
|
|
949
|
+
!active && /* @__PURE__ */ jsx(Check, { className: "ml-auto h-3.5 w-3.5 shrink-0 pl-1" })
|
|
950
|
+
] }),
|
|
951
|
+
options.map((o) => /* @__PURE__ */ jsxs(DropdownItem, { onClick: () => onChange(o.value), children: [
|
|
952
|
+
o.label,
|
|
953
|
+
value === o.value && /* @__PURE__ */ jsx(Check, { className: "ml-auto h-3.5 w-3.5 shrink-0 pl-1" })
|
|
954
|
+
] }, o.value))
|
|
955
|
+
] })
|
|
956
|
+
] });
|
|
957
|
+
}
|
|
881
958
|
var ICON_BTN = "flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground";
|
|
882
959
|
function ListView({
|
|
883
960
|
columns,
|
|
@@ -889,6 +966,7 @@ function ListView({
|
|
|
889
966
|
searchDebounce = 300,
|
|
890
967
|
tags,
|
|
891
968
|
allTagLabel = "All",
|
|
969
|
+
tagsLabel,
|
|
892
970
|
activeTag,
|
|
893
971
|
onTagChange,
|
|
894
972
|
newLabel,
|
|
@@ -930,8 +1008,16 @@ function ListView({
|
|
|
930
1008
|
const showPagination = onPageChange && totalItems > pageSize;
|
|
931
1009
|
const showSearch = !!onSearchChange;
|
|
932
1010
|
const showTags = tags && tags.length > 0 && onTagChange;
|
|
933
|
-
const
|
|
934
|
-
|
|
1011
|
+
const tagFilter = showTags ? /* @__PURE__ */ jsx(
|
|
1012
|
+
FilterChip,
|
|
1013
|
+
{
|
|
1014
|
+
label: tagsLabel,
|
|
1015
|
+
allLabel: allTagLabel,
|
|
1016
|
+
options: tags.map((t) => ({ value: t.value, label: t.label })),
|
|
1017
|
+
value: activeTag,
|
|
1018
|
+
onChange: (next) => onTagChange(next)
|
|
1019
|
+
}
|
|
1020
|
+
) : null;
|
|
935
1021
|
const emptyState = /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-1 py-6", children: [
|
|
936
1022
|
EmptyIcon && /* @__PURE__ */ jsx(EmptyIcon, { className: "mb-2 h-9 w-9 text-muted-foreground/40" }),
|
|
937
1023
|
/* @__PURE__ */ jsx("p", { className: "text-base font-semibold text-foreground", children: emptyMessage }),
|
|
@@ -941,26 +1027,16 @@ function ListView({
|
|
|
941
1027
|
] })
|
|
942
1028
|
] });
|
|
943
1029
|
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-4", className), children: [
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
{
|
|
948
|
-
|
|
949
|
-
value: activeTag ?? ALL_TAG,
|
|
950
|
-
onChange: (next) => onTagChange(next === ALL_TAG ? void 0 : next)
|
|
951
|
-
}
|
|
952
|
-
) : /* @__PURE__ */ jsx("div", {}),
|
|
953
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
954
|
-
headerActions,
|
|
955
|
-
onNew && newLabel && /* @__PURE__ */ jsxs(Button, { variant: "default", size: "default", onClick: onNew, className: "shrink-0", children: [
|
|
956
|
-
/* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5" }),
|
|
957
|
-
newLabel
|
|
958
|
-
] })
|
|
1030
|
+
(headerActions || onNew && newLabel) && /* @__PURE__ */ jsx(PageHeaderActions, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1031
|
+
headerActions,
|
|
1032
|
+
onNew && newLabel && /* @__PURE__ */ jsxs(Button, { variant: "default", size: "default", onClick: onNew, className: "shrink-0", children: [
|
|
1033
|
+
/* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5" }),
|
|
1034
|
+
newLabel
|
|
959
1035
|
] })
|
|
960
|
-
] }),
|
|
1036
|
+
] }) }),
|
|
961
1037
|
toolbar,
|
|
962
1038
|
/* @__PURE__ */ jsxs(Card, { className: "overflow-hidden", children: [
|
|
963
|
-
(showSearch || filters || onRefresh || onExport) && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 border-b border-border px-3 py-2", children: [
|
|
1039
|
+
(showSearch || tagFilter || filters || onRefresh || onExport) && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 border-b border-border px-3 py-2", children: [
|
|
964
1040
|
showSearch && /* @__PURE__ */ jsxs("div", { className: "relative min-w-0 flex-1", children: [
|
|
965
1041
|
/* @__PURE__ */ jsx(Search, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
966
1042
|
/* @__PURE__ */ jsx(
|
|
@@ -974,7 +1050,8 @@ function ListView({
|
|
|
974
1050
|
}
|
|
975
1051
|
)
|
|
976
1052
|
] }),
|
|
977
|
-
(filters || onRefresh || onExport) && /* @__PURE__ */ jsxs("div", { className: "ml-auto flex flex-wrap items-center justify-end gap-2", children: [
|
|
1053
|
+
(tagFilter || filters || onRefresh || onExport) && /* @__PURE__ */ jsxs("div", { className: "ml-auto flex flex-wrap items-center justify-end gap-2", children: [
|
|
1054
|
+
tagFilter,
|
|
978
1055
|
filters,
|
|
979
1056
|
onRefresh && /* @__PURE__ */ jsx("button", { type: "button", "aria-label": refreshLabel, title: refreshLabel, onClick: onRefresh, className: ICON_BTN, children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4" }) }),
|
|
980
1057
|
onExport && /* @__PURE__ */ jsx("button", { type: "button", "aria-label": exportLabel, title: exportLabel, onClick: onExport, className: ICON_BTN, children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" }) })
|
|
@@ -1211,6 +1288,7 @@ function DatePicker({ value, onChange, className, variant = "input", defaultOpen
|
|
|
1211
1288
|
)
|
|
1212
1289
|
] });
|
|
1213
1290
|
}
|
|
1291
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React14.useLayoutEffect : React14.useEffect;
|
|
1214
1292
|
function SearchSelect({
|
|
1215
1293
|
value,
|
|
1216
1294
|
displayValue,
|
|
@@ -1225,34 +1303,39 @@ function SearchSelect({
|
|
|
1225
1303
|
searchingLabel = "Searching...",
|
|
1226
1304
|
allowCreate,
|
|
1227
1305
|
createLabel = "Add",
|
|
1306
|
+
clearLabel = "Clear",
|
|
1228
1307
|
onCreate,
|
|
1229
1308
|
renderOption,
|
|
1230
1309
|
loadOnOpen = true,
|
|
1231
1310
|
className,
|
|
1232
1311
|
disabled
|
|
1233
1312
|
}) {
|
|
1234
|
-
const
|
|
1235
|
-
const [
|
|
1236
|
-
const [
|
|
1237
|
-
const [
|
|
1238
|
-
const [
|
|
1239
|
-
const [
|
|
1240
|
-
const
|
|
1241
|
-
const
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1313
|
+
const canCreate = !!onCreate && allowCreate !== false;
|
|
1314
|
+
const [open, setOpen] = React14.useState(false);
|
|
1315
|
+
const [query, setQuery] = React14.useState("");
|
|
1316
|
+
const [results, setResults] = React14.useState([]);
|
|
1317
|
+
const [loading, setLoading] = React14.useState(false);
|
|
1318
|
+
const [creating, setCreating] = React14.useState(false);
|
|
1319
|
+
const [selectedLabel, setSelectedLabel] = React14.useState(displayValue ?? "");
|
|
1320
|
+
const containerRef = React14.useRef(null);
|
|
1321
|
+
const inputRef = React14.useRef(null);
|
|
1322
|
+
const timerRef = React14.useRef();
|
|
1323
|
+
const [rect, setRect] = React14.useState(null);
|
|
1324
|
+
const dropdownRef = React14.useRef(null);
|
|
1325
|
+
React14.useEffect(() => {
|
|
1244
1326
|
function handler(e) {
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1327
|
+
const target = e.target;
|
|
1328
|
+
if (containerRef.current?.contains(target)) return;
|
|
1329
|
+
if (dropdownRef.current?.contains(target)) return;
|
|
1330
|
+
setOpen(false);
|
|
1248
1331
|
}
|
|
1249
1332
|
document.addEventListener("mousedown", handler);
|
|
1250
1333
|
return () => document.removeEventListener("mousedown", handler);
|
|
1251
1334
|
}, []);
|
|
1252
|
-
|
|
1335
|
+
React14.useEffect(() => {
|
|
1253
1336
|
if (displayValue !== void 0) setSelectedLabel(displayValue);
|
|
1254
1337
|
}, [displayValue]);
|
|
1255
|
-
|
|
1338
|
+
React14.useEffect(() => {
|
|
1256
1339
|
if (open && loadOnOpen && query.length === 0 && results.length === 0 && !loading) {
|
|
1257
1340
|
setLoading(true);
|
|
1258
1341
|
Promise.resolve(onSearch("")).then(setResults).catch(() => setResults([])).finally(() => setLoading(false));
|
|
@@ -1310,7 +1393,7 @@ function SearchSelect({
|
|
|
1310
1393
|
setResults([]);
|
|
1311
1394
|
setTimeout(() => inputRef.current?.focus(), 0);
|
|
1312
1395
|
}
|
|
1313
|
-
const groups =
|
|
1396
|
+
const groups = React14.useMemo(() => {
|
|
1314
1397
|
const map = /* @__PURE__ */ new Map();
|
|
1315
1398
|
for (const opt of results) {
|
|
1316
1399
|
const group = opt.group ?? "";
|
|
@@ -1321,6 +1404,27 @@ function SearchSelect({
|
|
|
1321
1404
|
}, [results]);
|
|
1322
1405
|
const hasValue = !!value && !!selectedLabel;
|
|
1323
1406
|
const showDropdown = open && (query.length >= minChars || loadOnOpen);
|
|
1407
|
+
useIsomorphicLayoutEffect(() => {
|
|
1408
|
+
if (!showDropdown) {
|
|
1409
|
+
setRect(null);
|
|
1410
|
+
return;
|
|
1411
|
+
}
|
|
1412
|
+
const measure = () => {
|
|
1413
|
+
const el = containerRef.current;
|
|
1414
|
+
if (!el) return;
|
|
1415
|
+
const r = el.getBoundingClientRect();
|
|
1416
|
+
const below = window.innerHeight - r.bottom;
|
|
1417
|
+
const above = below < 240 && r.top > below;
|
|
1418
|
+
setRect({ left: r.left, top: above ? r.top : r.bottom, width: r.width, above });
|
|
1419
|
+
};
|
|
1420
|
+
measure();
|
|
1421
|
+
window.addEventListener("scroll", measure, true);
|
|
1422
|
+
window.addEventListener("resize", measure);
|
|
1423
|
+
return () => {
|
|
1424
|
+
window.removeEventListener("scroll", measure, true);
|
|
1425
|
+
window.removeEventListener("resize", measure);
|
|
1426
|
+
};
|
|
1427
|
+
}, [showDropdown]);
|
|
1324
1428
|
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: cn("relative", className), children: [
|
|
1325
1429
|
label && /* @__PURE__ */ jsxs("label", { className: "text-xs font-medium text-muted-foreground", children: [
|
|
1326
1430
|
label,
|
|
@@ -1367,65 +1471,72 @@ function SearchSelect({
|
|
|
1367
1471
|
]
|
|
1368
1472
|
}
|
|
1369
1473
|
),
|
|
1370
|
-
showDropdown &&
|
|
1371
|
-
/* @__PURE__ */
|
|
1372
|
-
|
|
1373
|
-
searchingLabel
|
|
1374
|
-
] }) : results.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "px-4 py-4 text-center", children: [
|
|
1375
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: noResultsLabel ?? (query ? `No results for "${query}"` : "No results") }),
|
|
1376
|
-
allowCreate && onCreate && /* @__PURE__ */ jsxs(
|
|
1377
|
-
"button",
|
|
1474
|
+
showDropdown && rect && createPortal(
|
|
1475
|
+
/* @__PURE__ */ jsxs(
|
|
1476
|
+
"div",
|
|
1378
1477
|
{
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
query,
|
|
1386
|
-
'"'
|
|
1387
|
-
]
|
|
1388
|
-
}
|
|
1389
|
-
)
|
|
1390
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: "max-h-64 overflow-auto py-1", children: [
|
|
1391
|
-
[...groups.entries()].map(([group, options]) => /* @__PURE__ */ jsxs(React13.Fragment, { children: [
|
|
1392
|
-
group && /* @__PURE__ */ jsx("div", { className: "sticky top-0 bg-muted/50 px-3 py-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: group }),
|
|
1393
|
-
options.map((opt) => /* @__PURE__ */ jsx(
|
|
1394
|
-
"button",
|
|
1395
|
-
{
|
|
1396
|
-
onClick: () => handleSelect(opt),
|
|
1397
|
-
disabled: opt.disabled,
|
|
1398
|
-
className: cn(
|
|
1399
|
-
"w-full text-left px-3 py-2 hover:bg-muted/50 transition-colors flex items-center gap-2.5",
|
|
1400
|
-
opt.disabled && "opacity-40 cursor-not-allowed",
|
|
1401
|
-
opt.id === value && "bg-muted/30"
|
|
1402
|
-
),
|
|
1403
|
-
children: renderOption ? renderOption(opt) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1404
|
-
opt.icon,
|
|
1405
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1406
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm truncate", children: opt.label }),
|
|
1407
|
-
opt.subtitle && /* @__PURE__ */ jsx("p", { className: "text-[10px] text-muted-foreground truncate", children: opt.subtitle })
|
|
1408
|
-
] })
|
|
1409
|
-
] })
|
|
1478
|
+
ref: dropdownRef,
|
|
1479
|
+
style: {
|
|
1480
|
+
position: "fixed",
|
|
1481
|
+
left: rect.left,
|
|
1482
|
+
width: rect.width,
|
|
1483
|
+
...rect.above ? { bottom: window.innerHeight - rect.top + 4 } : { top: rect.top + 4 }
|
|
1410
1484
|
},
|
|
1411
|
-
|
|
1412
|
-
))
|
|
1413
|
-
] }, group)),
|
|
1414
|
-
allowCreate && onCreate && /* @__PURE__ */ jsxs(
|
|
1415
|
-
"button",
|
|
1416
|
-
{
|
|
1417
|
-
onClick: () => handleCreate(query),
|
|
1418
|
-
className: "w-full text-left px-3 py-2 text-xs text-primary hover:bg-muted/50 transition-colors border-t",
|
|
1485
|
+
className: "fayz-glass-surface z-[60] overflow-hidden rounded-lg border bg-popover shadow-lg",
|
|
1419
1486
|
children: [
|
|
1420
|
-
"
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1487
|
+
loading ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 px-4 py-6 text-xs text-muted-foreground", children: [
|
|
1488
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1489
|
+
" ",
|
|
1490
|
+
searchingLabel
|
|
1491
|
+
] }) : results.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-4 py-4 text-center", children: /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: noResultsLabel ?? (query ? `No results for "${query}"` : "No results") }) }) : /* @__PURE__ */ jsx("div", { className: "max-h-64 overflow-auto py-1", children: [...groups.entries()].map(([group, options]) => /* @__PURE__ */ jsxs(React14.Fragment, { children: [
|
|
1492
|
+
group && /* @__PURE__ */ jsx("div", { className: "sticky top-0 bg-muted/50 px-3 py-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: group }),
|
|
1493
|
+
options.map((opt) => /* @__PURE__ */ jsx(
|
|
1494
|
+
"button",
|
|
1495
|
+
{
|
|
1496
|
+
onClick: () => handleSelect(opt),
|
|
1497
|
+
disabled: opt.disabled,
|
|
1498
|
+
className: cn(
|
|
1499
|
+
"w-full text-left px-3 py-2 hover:bg-muted/50 transition-colors flex items-center gap-2.5",
|
|
1500
|
+
opt.disabled && "opacity-40 cursor-not-allowed",
|
|
1501
|
+
opt.id === value && "bg-muted/30"
|
|
1502
|
+
),
|
|
1503
|
+
children: renderOption ? renderOption(opt) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1504
|
+
opt.icon,
|
|
1505
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1506
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm truncate", children: opt.label }),
|
|
1507
|
+
opt.subtitle && /* @__PURE__ */ jsx("p", { className: "text-[10px] text-muted-foreground truncate", children: opt.subtitle })
|
|
1508
|
+
] })
|
|
1509
|
+
] })
|
|
1510
|
+
},
|
|
1511
|
+
opt.id
|
|
1512
|
+
))
|
|
1513
|
+
] }, group)) }),
|
|
1514
|
+
(canCreate || hasValue || query.trim()) && !loading && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 border-t bg-muted/20 px-1.5 py-1", children: [
|
|
1515
|
+
hasValue || query.trim() ? /* @__PURE__ */ jsx(
|
|
1516
|
+
"button",
|
|
1517
|
+
{
|
|
1518
|
+
onClick: handleClear,
|
|
1519
|
+
className: "rounded-md px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground",
|
|
1520
|
+
children: clearLabel
|
|
1521
|
+
}
|
|
1522
|
+
) : /* @__PURE__ */ jsx("span", {}),
|
|
1523
|
+
canCreate && /* @__PURE__ */ jsxs(
|
|
1524
|
+
"button",
|
|
1525
|
+
{
|
|
1526
|
+
onClick: () => handleCreate(query),
|
|
1527
|
+
className: "inline-flex items-center gap-1 rounded-md px-2 py-1.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10",
|
|
1528
|
+
children: [
|
|
1529
|
+
/* @__PURE__ */ jsx(Plus, { className: "h-3 w-3" }),
|
|
1530
|
+
query.trim() ? `${createLabel} "${query.trim()}"` : createLabel
|
|
1531
|
+
]
|
|
1532
|
+
}
|
|
1533
|
+
)
|
|
1534
|
+
] })
|
|
1425
1535
|
]
|
|
1426
1536
|
}
|
|
1427
|
-
)
|
|
1428
|
-
|
|
1537
|
+
),
|
|
1538
|
+
document.body
|
|
1539
|
+
)
|
|
1429
1540
|
] });
|
|
1430
1541
|
}
|
|
1431
1542
|
function CurrencyInput({
|
|
@@ -1439,9 +1550,9 @@ function CurrencyInput({
|
|
|
1439
1550
|
className,
|
|
1440
1551
|
disabled
|
|
1441
1552
|
}) {
|
|
1442
|
-
const inputRef =
|
|
1443
|
-
const [focused, setFocused] =
|
|
1444
|
-
const format =
|
|
1553
|
+
const inputRef = React14.useRef(null);
|
|
1554
|
+
const [focused, setFocused] = React14.useState(false);
|
|
1555
|
+
const format = React14.useCallback((v) => {
|
|
1445
1556
|
return new Intl.NumberFormat(locale, {
|
|
1446
1557
|
minimumFractionDigits: 2,
|
|
1447
1558
|
maximumFractionDigits: 2
|
|
@@ -1550,7 +1661,7 @@ function ConfirmDialog({
|
|
|
1550
1661
|
}) {
|
|
1551
1662
|
const config = VARIANT_CONFIG[variant];
|
|
1552
1663
|
const Icon2 = config.icon;
|
|
1553
|
-
|
|
1664
|
+
React14.useEffect(() => {
|
|
1554
1665
|
if (!open) return;
|
|
1555
1666
|
function handleKey(e) {
|
|
1556
1667
|
if (e.key === "Escape") onCancel();
|
|
@@ -1597,7 +1708,7 @@ function ConfirmDialog({
|
|
|
1597
1708
|
}
|
|
1598
1709
|
var Popover = PopoverPrimitive.Root;
|
|
1599
1710
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1600
|
-
var PopoverContent =
|
|
1711
|
+
var PopoverContent = React14.forwardRef(({ className, align = "start", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
1601
1712
|
PopoverPrimitive.Content,
|
|
1602
1713
|
{
|
|
1603
1714
|
ref,
|
|
@@ -1612,38 +1723,50 @@ var PopoverContent = React13.forwardRef(({ className, align = "start", sideOffse
|
|
|
1612
1723
|
}
|
|
1613
1724
|
) }));
|
|
1614
1725
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1726
|
+
var SIZE = {
|
|
1727
|
+
sm: { container: "h-[26px]", segment: "px-2.5 text-xs" },
|
|
1728
|
+
md: { container: "h-[30px]", segment: "px-3 text-sm" }
|
|
1729
|
+
};
|
|
1730
|
+
function SegmentedControl({
|
|
1731
|
+
options,
|
|
1732
|
+
value,
|
|
1733
|
+
onChange,
|
|
1734
|
+
size = "sm",
|
|
1735
|
+
className,
|
|
1736
|
+
...rest
|
|
1737
|
+
}) {
|
|
1738
|
+
const items = options.map((o) => typeof o === "string" ? { value: o, label: o } : o);
|
|
1739
|
+
return /* @__PURE__ */ jsx(
|
|
1740
|
+
"div",
|
|
1741
|
+
{
|
|
1742
|
+
role: "tablist",
|
|
1743
|
+
"aria-label": rest["aria-label"],
|
|
1744
|
+
className: cn(
|
|
1745
|
+
"inline-flex items-center rounded-button border border-border bg-card p-0.5 shadow-button",
|
|
1746
|
+
SIZE[size].container,
|
|
1747
|
+
className
|
|
1748
|
+
),
|
|
1749
|
+
children: items.map((item) => {
|
|
1750
|
+
const active = item.value === value;
|
|
1751
|
+
return /* @__PURE__ */ jsx(
|
|
1752
|
+
"button",
|
|
1753
|
+
{
|
|
1754
|
+
type: "button",
|
|
1755
|
+
role: "tab",
|
|
1756
|
+
"aria-selected": active,
|
|
1757
|
+
onClick: () => onChange(item.value),
|
|
1758
|
+
className: cn(
|
|
1759
|
+
"flex h-full items-center rounded-button font-semibold transition-colors",
|
|
1760
|
+
SIZE[size].segment,
|
|
1761
|
+
active ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted/60"
|
|
1762
|
+
),
|
|
1763
|
+
children: item.label
|
|
1764
|
+
},
|
|
1765
|
+
item.value
|
|
1766
|
+
);
|
|
1767
|
+
})
|
|
1768
|
+
}
|
|
1769
|
+
);
|
|
1647
1770
|
}
|
|
1648
1771
|
var INLINE_TOKEN = /(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g;
|
|
1649
1772
|
function renderInline(text, keyPrefix) {
|
|
@@ -1658,7 +1781,7 @@ function renderInline(text, keyPrefix) {
|
|
|
1658
1781
|
if (part.startsWith("`") && part.endsWith("`") && part.length > 2) {
|
|
1659
1782
|
return /* @__PURE__ */ jsx("code", { className: "rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]", children: part.slice(1, -1) }, key);
|
|
1660
1783
|
}
|
|
1661
|
-
return part === "" ? null : /* @__PURE__ */ jsx(
|
|
1784
|
+
return part === "" ? null : /* @__PURE__ */ jsx(React14.Fragment, { children: part }, key);
|
|
1662
1785
|
});
|
|
1663
1786
|
}
|
|
1664
1787
|
function parseBlocks(source) {
|
|
@@ -1742,7 +1865,7 @@ function renderMarkdown(source) {
|
|
|
1742
1865
|
case "ol":
|
|
1743
1866
|
return /* @__PURE__ */ jsx("ol", { className: "list-decimal space-y-1 pl-5", children: block.items.map((item, li) => /* @__PURE__ */ jsx("li", { children: renderInline(item, `${key}-${li}`) }, `${key}-${li}`)) }, key);
|
|
1744
1867
|
case "p":
|
|
1745
|
-
return /* @__PURE__ */ jsx("p", { children: block.lines.map((l, li) => /* @__PURE__ */ jsxs(
|
|
1868
|
+
return /* @__PURE__ */ jsx("p", { children: block.lines.map((l, li) => /* @__PURE__ */ jsxs(React14.Fragment, { children: [
|
|
1746
1869
|
li > 0 && /* @__PURE__ */ jsx("br", {}),
|
|
1747
1870
|
renderInline(l, `${key}-${li}`)
|
|
1748
1871
|
] }, `${key}-${li}`)) }, key);
|
|
@@ -1763,7 +1886,7 @@ function MarkdownEditor({
|
|
|
1763
1886
|
renderPreview,
|
|
1764
1887
|
className
|
|
1765
1888
|
}) {
|
|
1766
|
-
const [mode, setMode] =
|
|
1889
|
+
const [mode, setMode] = React14.useState(
|
|
1767
1890
|
defaultMode === "preview" && value.trim() === "" ? "edit" : defaultMode
|
|
1768
1891
|
);
|
|
1769
1892
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
@@ -2006,6 +2129,6 @@ function SearchCombobox({
|
|
|
2006
2129
|
] });
|
|
2007
2130
|
}
|
|
2008
2131
|
|
|
2009
|
-
export { Badge, Breadcrumb, BulkActionBar, ChevronPager, ConfirmDialog, CurrencyInput, DatePicker, FilterChip, Hint, Input, ListView, Markdown, MarkdownEditor, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, PhoneField, PhoneLink, Popover, PopoverContent, PopoverTrigger, SearchCombobox, SearchField, SearchSelect, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, StatTiles, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Thumbnail, TimePicker, ToastProvider, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, formatPhone2 as formatPhone, normalizePhone, renderMarkdown };
|
|
2010
|
-
//# sourceMappingURL=chunk-
|
|
2011
|
-
//# sourceMappingURL=chunk-
|
|
2132
|
+
export { Badge, Breadcrumb, BulkActionBar, ChevronPager, ConfirmDialog, CurrencyInput, DatePicker, FilterChip, Hint, Input, ListView, Markdown, MarkdownEditor, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, PhoneField, PhoneLink, Popover, PopoverContent, PopoverTrigger, RefreshButton, SearchCombobox, SearchField, SearchSelect, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, StatTiles, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Thumbnail, TimePicker, ToastProvider, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, formatPhone2 as formatPhone, normalizePhone, renderMarkdown };
|
|
2133
|
+
//# sourceMappingURL=chunk-77CUIMOI.js.map
|
|
2134
|
+
//# sourceMappingURL=chunk-77CUIMOI.js.map
|