@fayz-ai/ui 0.14.0 → 0.16.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/{ChartWidgetInner-GDE5PBTR.js → ChartWidgetInner-IOLIUYTB.js} +21 -8
- package/dist/ChartWidgetInner-IOLIUYTB.js.map +1 -0
- package/dist/analytics/AnalyticsCard.d.ts.map +1 -1
- package/dist/analytics/AnalyticsControls.d.ts.map +1 -1
- package/dist/analytics/context.d.ts +15 -1
- package/dist/analytics/context.d.ts.map +1 -1
- package/dist/analytics/index.d.ts +1 -1
- package/dist/analytics/index.d.ts.map +1 -1
- package/dist/chunk-3OVZ5JJQ.js +540 -0
- package/dist/chunk-3OVZ5JJQ.js.map +1 -0
- package/dist/{chunk-UZYXFEQS.js → chunk-4GK6IHOI.js} +16 -3
- package/dist/chunk-4GK6IHOI.js.map +1 -0
- package/dist/{chunk-46UZAKFJ.js → chunk-5VF45NLE.js} +7 -6
- package/dist/chunk-5VF45NLE.js.map +1 -0
- package/dist/{chunk-5KAGNW45.js → chunk-6BJTH3L6.js} +5 -5
- package/dist/chunk-6BJTH3L6.js.map +1 -0
- package/dist/chunk-AASANYXN.js +601 -0
- package/dist/chunk-AASANYXN.js.map +1 -0
- package/dist/{chunk-2EFRFYGF.js → chunk-E44WOPCR.js} +198 -39
- package/dist/chunk-E44WOPCR.js.map +1 -0
- package/dist/chunk-HKGTF2YA.js +117 -0
- package/dist/chunk-HKGTF2YA.js.map +1 -0
- package/dist/chunk-OKZ6WQB3.js +57 -0
- package/dist/chunk-OKZ6WQB3.js.map +1 -0
- package/dist/{chunk-MVH64JFG.js → chunk-PZU7XC2M.js} +780 -719
- package/dist/chunk-PZU7XC2M.js.map +1 -0
- package/dist/{chunk-77CUIMOI.js → chunk-SDPYDWWV.js} +459 -226
- package/dist/chunk-SDPYDWWV.js.map +1 -0
- package/dist/dashboard/ChartWidgetInner.d.ts.map +1 -1
- package/dist/dashboard/index.js +5 -4
- package/dist/hooks/useIsWide.d.ts +16 -0
- package/dist/hooks/useIsWide.d.ts.map +1 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -17
- package/dist/index.js.map +1 -1
- package/dist/layout/AppShell.d.ts +31 -3
- package/dist/layout/AppShell.d.ts.map +1 -1
- package/dist/layout/ModulePage.d.ts +4 -0
- package/dist/layout/ModulePage.d.ts.map +1 -1
- package/dist/layout/SaveBar.d.ts.map +1 -1
- package/dist/layout/Sidebar.d.ts +27 -4
- package/dist/layout/Sidebar.d.ts.map +1 -1
- package/dist/layout/Topbar.d.ts +14 -3
- package/dist/layout/Topbar.d.ts.map +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +5 -4
- package/dist/primitives/SearchCombobox.d.ts +9 -1
- package/dist/primitives/SearchCombobox.d.ts.map +1 -1
- package/dist/primitives/checkbox.d.ts +4 -0
- package/dist/primitives/checkbox.d.ts.map +1 -1
- package/dist/primitives/color-palette.d.ts +24 -0
- package/dist/primitives/color-palette.d.ts.map +1 -0
- package/dist/primitives/header-tabs.d.ts +11 -1
- package/dist/primitives/header-tabs.d.ts.map +1 -1
- package/dist/primitives/image-drop.d.ts +28 -0
- package/dist/primitives/image-drop.d.ts.map +1 -0
- package/dist/primitives/index.d.ts +11 -3
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +7 -5
- package/dist/primitives/list-view.d.ts +11 -1
- package/dist/primitives/list-view.d.ts.map +1 -1
- package/dist/primitives/modal.d.ts.map +1 -1
- package/dist/primitives/option-select.d.ts +46 -0
- package/dist/primitives/option-select.d.ts.map +1 -0
- package/dist/primitives/page-actions.d.ts +55 -0
- package/dist/primitives/page-actions.d.ts.map +1 -0
- package/dist/primitives/page-header.d.ts +5 -2
- package/dist/primitives/page-header.d.ts.map +1 -1
- package/dist/primitives/page-toolbar.d.ts +20 -1
- package/dist/primitives/page-toolbar.d.ts.map +1 -1
- package/dist/primitives/refresh-button.d.ts.map +1 -1
- package/dist/primitives/row-actions.d.ts +11 -0
- package/dist/primitives/row-actions.d.ts.map +1 -0
- package/dist/primitives/sheet.d.ts.map +1 -1
- package/dist/primitives/step-progress.d.ts +20 -0
- package/dist/primitives/step-progress.d.ts.map +1 -0
- package/dist/primitives/use-row-selection.d.ts +50 -0
- package/dist/primitives/use-row-selection.d.ts.map +1 -0
- package/dist/primitives/whatsapp-icon.d.ts +7 -0
- package/dist/primitives/whatsapp-icon.d.ts.map +1 -0
- package/dist/stores/index.d.ts +1 -1
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/layout.store.d.ts +1 -0
- package/dist/stores/layout.store.d.ts.map +1 -1
- package/dist/stores/page-header.store.d.ts +39 -5
- package/dist/stores/page-header.store.d.ts.map +1 -1
- package/dist/styles.css +186 -3
- package/dist/wizard/Wizard.d.ts +38 -0
- package/dist/wizard/Wizard.d.ts.map +1 -0
- package/dist/wizard/WizardField.d.ts +22 -0
- package/dist/wizard/WizardField.d.ts.map +1 -0
- package/dist/wizard/index.d.ts +6 -0
- package/dist/wizard/index.d.ts.map +1 -0
- package/dist/wizard/index.js +5 -0
- package/dist/wizard/index.js.map +1 -0
- package/dist/wizard/logic.d.ts +39 -0
- package/dist/wizard/logic.d.ts.map +1 -0
- package/dist/wizard/types.d.ts +95 -0
- package/dist/wizard/types.d.ts.map +1 -0
- package/dist/wizard/useWizard.d.ts +47 -0
- package/dist/wizard/useWizard.d.ts.map +1 -0
- package/package.json +12 -6
- package/dist/ChartWidgetInner-GDE5PBTR.js.map +0 -1
- package/dist/chunk-2EFRFYGF.js.map +0 -1
- package/dist/chunk-46UZAKFJ.js.map +0 -1
- package/dist/chunk-5KAGNW45.js.map +0 -1
- package/dist/chunk-77CUIMOI.js.map +0 -1
- package/dist/chunk-LFZFBN3P.js +0 -142
- package/dist/chunk-LFZFBN3P.js.map +0 -1
- package/dist/chunk-MVH64JFG.js.map +0 -1
- package/dist/chunk-UZYXFEQS.js.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { useSaveBarVisible, useCrossModuleBack, useBackHandler, PageHeaderActions } from './chunk-
|
|
2
|
-
import { Dropdown, DropdownTrigger, DropdownContent, DropdownItem, Card, DataTable } from './chunk-
|
|
3
|
-
import { cn, Button } from './chunk-
|
|
4
|
-
import * as
|
|
1
|
+
import { useSaveBarVisible, useCrossModuleBack, useBackHandler, PageHeaderActions } from './chunk-PZU7XC2M.js';
|
|
2
|
+
import { useIsWide, Dropdown, DropdownTrigger, DropdownContent, DropdownSeparator, DropdownItem, Card, DataTable } from './chunk-E44WOPCR.js';
|
|
3
|
+
import { cn, Button } from './chunk-OKZ6WQB3.js';
|
|
4
|
+
import * as React16 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,
|
|
9
|
+
import { X, ChevronDown, ChevronUp, Check, ArrowLeft, MoreHorizontal, Plus, MoreVertical, Search, ChevronLeft, ChevronRight, ImageIcon, RefreshCw, Clock, Download, Calendar, Loader2 } 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';
|
|
13
13
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
14
14
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
15
15
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
16
|
-
import { useTranslation, getCountry, unmaskPhone, maskPhone, getCurrentLocale } from '@fayz-ai/core';
|
|
17
16
|
import { createPortal } from 'react-dom';
|
|
17
|
+
import { useTranslation, getCountry, unmaskPhone, maskPhone, getCurrentLocale } from '@fayz-ai/core';
|
|
18
18
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
19
19
|
|
|
20
|
-
var Input =
|
|
20
|
+
var Input = React16.forwardRef(
|
|
21
21
|
({ className, type, error, description, id, ...props }, ref) => {
|
|
22
|
-
const inputId = id ??
|
|
22
|
+
const inputId = id ?? React16.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,12 +107,12 @@ 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 = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
111
111
|
DialogPrimitive.Overlay,
|
|
112
112
|
{
|
|
113
113
|
ref,
|
|
114
114
|
className: cn(
|
|
115
|
-
"fayz-modal-overlay saas-mdl-ov fixed inset-0 z-
|
|
115
|
+
"fayz-modal-overlay saas-mdl-ov fixed inset-0 z-[100]",
|
|
116
116
|
"flex items-center justify-center p-0 sm:p-6",
|
|
117
117
|
className
|
|
118
118
|
),
|
|
@@ -120,7 +120,7 @@ var ModalOverlay = React14.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
120
120
|
}
|
|
121
121
|
));
|
|
122
122
|
ModalOverlay.displayName = "ModalOverlay";
|
|
123
|
-
var ModalContent =
|
|
123
|
+
var ModalContent = React16.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,
|
|
@@ -146,7 +146,7 @@ var ModalContent = React14.forwardRef(({ className, children, size = "lg", hideC
|
|
|
146
146
|
// fz-container: a form inside a dialog measures the DIALOG. Without
|
|
147
147
|
// it a two-column field grid in an `sm` modal read the window's width
|
|
148
148
|
// and kept both columns in 380px.
|
|
149
|
-
"fayz-glass-surface fayz-modal-content saas-mdl-ct fz-container relative z-
|
|
149
|
+
"fayz-glass-surface fayz-modal-content saas-mdl-ct fz-container relative z-[100] flex flex-col w-full outline-none",
|
|
150
150
|
// Mobile fullscreen
|
|
151
151
|
"h-full rounded-none border-0",
|
|
152
152
|
// Desktop centered card
|
|
@@ -173,16 +173,16 @@ function ModalBody({ className, ...props }) {
|
|
|
173
173
|
return /* @__PURE__ */ jsx("div", { className: cn("flex-1 overflow-y-auto min-h-0", className), ...props });
|
|
174
174
|
}
|
|
175
175
|
function ModalFooter({ className, ...props }) {
|
|
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 });
|
|
176
|
+
return /* @__PURE__ */ jsx("div", { className: cn("mt-auto flex flex-col-reverse gap-2 sm:mt-0 sm:flex-row sm:justify-end sm:gap-0 sm:space-x-2 shrink-0", className), ...props });
|
|
177
177
|
}
|
|
178
|
-
var ModalTitle =
|
|
178
|
+
var ModalTitle = React16.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 = React16.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 = React16.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
186
186
|
SelectPrimitive.Trigger,
|
|
187
187
|
{
|
|
188
188
|
ref,
|
|
@@ -198,7 +198,7 @@ var SelectTrigger = React14.forwardRef(({ className, children, ...props }, ref)
|
|
|
198
198
|
}
|
|
199
199
|
));
|
|
200
200
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
201
|
-
var SelectScrollUpButton =
|
|
201
|
+
var SelectScrollUpButton = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
202
202
|
SelectPrimitive.ScrollUpButton,
|
|
203
203
|
{
|
|
204
204
|
ref,
|
|
@@ -211,7 +211,7 @@ var SelectScrollUpButton = React14.forwardRef(({ className, ...props }, ref) =>
|
|
|
211
211
|
}
|
|
212
212
|
));
|
|
213
213
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
214
|
-
var SelectScrollDownButton =
|
|
214
|
+
var SelectScrollDownButton = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
215
215
|
SelectPrimitive.ScrollDownButton,
|
|
216
216
|
{
|
|
217
217
|
ref,
|
|
@@ -224,12 +224,12 @@ var SelectScrollDownButton = React14.forwardRef(({ className, ...props }, ref) =
|
|
|
224
224
|
}
|
|
225
225
|
));
|
|
226
226
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
227
|
-
var SelectContent =
|
|
227
|
+
var SelectContent = React16.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
228
228
|
SelectPrimitive.Content,
|
|
229
229
|
{
|
|
230
230
|
ref,
|
|
231
231
|
className: cn(
|
|
232
|
-
"fayz-glass-surface relative z-
|
|
232
|
+
"fayz-glass-surface relative z-[110] max-h-96 min-w-[8rem] overflow-hidden rounded-card border bg-popover text-popover-foreground shadow-md",
|
|
233
233
|
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
234
234
|
className
|
|
235
235
|
),
|
|
@@ -252,7 +252,7 @@ var SelectContent = React14.forwardRef(({ className, children, position = "poppe
|
|
|
252
252
|
}
|
|
253
253
|
) }));
|
|
254
254
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
255
|
-
var SelectLabel =
|
|
255
|
+
var SelectLabel = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
256
256
|
SelectPrimitive.Label,
|
|
257
257
|
{
|
|
258
258
|
ref,
|
|
@@ -261,7 +261,7 @@ var SelectLabel = React14.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
261
261
|
}
|
|
262
262
|
));
|
|
263
263
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
264
|
-
var SelectItem =
|
|
264
|
+
var SelectItem = React16.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
265
265
|
SelectPrimitive.Item,
|
|
266
266
|
{
|
|
267
267
|
ref,
|
|
@@ -277,7 +277,7 @@ var SelectItem = React14.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
277
277
|
}
|
|
278
278
|
));
|
|
279
279
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
280
|
-
var SelectSeparator =
|
|
280
|
+
var SelectSeparator = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
281
281
|
SelectPrimitive.Separator,
|
|
282
282
|
{
|
|
283
283
|
ref,
|
|
@@ -315,7 +315,7 @@ function ToastProvider({
|
|
|
315
315
|
);
|
|
316
316
|
}
|
|
317
317
|
var Tabs = TabsPrimitive.Root;
|
|
318
|
-
var TabsList =
|
|
318
|
+
var TabsList = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
319
319
|
TabsPrimitive.List,
|
|
320
320
|
{
|
|
321
321
|
ref,
|
|
@@ -329,7 +329,7 @@ var TabsList = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
329
329
|
}
|
|
330
330
|
));
|
|
331
331
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
332
|
-
var TabsTrigger =
|
|
332
|
+
var TabsTrigger = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
333
333
|
TabsPrimitive.Trigger,
|
|
334
334
|
{
|
|
335
335
|
ref,
|
|
@@ -341,7 +341,7 @@ var TabsTrigger = React14.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
341
341
|
}
|
|
342
342
|
));
|
|
343
343
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
344
|
-
var TabsContent =
|
|
344
|
+
var TabsContent = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
345
345
|
TabsPrimitive.Content,
|
|
346
346
|
{
|
|
347
347
|
ref,
|
|
@@ -353,7 +353,7 @@ var TabsContent = React14.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
353
353
|
}
|
|
354
354
|
));
|
|
355
355
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
356
|
-
var Separator2 =
|
|
356
|
+
var Separator2 = React16.forwardRef(
|
|
357
357
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
358
358
|
SeparatorPrimitive.Root,
|
|
359
359
|
{
|
|
@@ -404,7 +404,7 @@ function formatPhone(digits, fallback, countryCode) {
|
|
|
404
404
|
const tail = rest.length === 9 ? rest.slice(5) : rest.slice(4);
|
|
405
405
|
return `+55 (${ddd}) ${head}-${tail}`;
|
|
406
406
|
}
|
|
407
|
-
var PhoneLink =
|
|
407
|
+
var PhoneLink = React16.forwardRef(
|
|
408
408
|
({ phone, message, countryCode, raw, className, children, ...props }, ref) => {
|
|
409
409
|
const { e164, display } = normalizePhone(phone, countryCode);
|
|
410
410
|
const label = children ?? (raw ? phone ?? "" : display);
|
|
@@ -428,6 +428,20 @@ var PhoneLink = React14.forwardRef(
|
|
|
428
428
|
}
|
|
429
429
|
);
|
|
430
430
|
PhoneLink.displayName = "PhoneLink";
|
|
431
|
+
var WHATSAPP_BRAND_COLOR = "#25D366";
|
|
432
|
+
function WhatsAppIcon({ className, ...props }) {
|
|
433
|
+
return /* @__PURE__ */ jsx(
|
|
434
|
+
"svg",
|
|
435
|
+
{
|
|
436
|
+
viewBox: "0 0 24 24",
|
|
437
|
+
fill: "currentColor",
|
|
438
|
+
"aria-hidden": "true",
|
|
439
|
+
className,
|
|
440
|
+
...props,
|
|
441
|
+
children: /* @__PURE__ */ jsx("path", { d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.297-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z" })
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
}
|
|
431
445
|
function Breadcrumb({ parent, current, onBack }) {
|
|
432
446
|
const { onBack: effectiveOnBack, parentLabel: effectiveParent } = useCrossModuleBack(onBack, parent);
|
|
433
447
|
useBackHandler(effectiveOnBack);
|
|
@@ -453,19 +467,283 @@ function Breadcrumb({ parent, current, onBack }) {
|
|
|
453
467
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
454
468
|
var Tooltip = TooltipPrimitive.Root;
|
|
455
469
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
456
|
-
var TooltipContent =
|
|
470
|
+
var TooltipContent = React16.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
457
471
|
TooltipPrimitive.Content,
|
|
458
472
|
{
|
|
459
473
|
ref,
|
|
460
474
|
sideOffset,
|
|
461
475
|
className: cn(
|
|
462
|
-
"fayz-glass-surface z-
|
|
476
|
+
"fayz-glass-surface z-[120] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
463
477
|
className
|
|
464
478
|
),
|
|
465
479
|
...props
|
|
466
480
|
}
|
|
467
481
|
));
|
|
468
482
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
483
|
+
function iconOf(action, className) {
|
|
484
|
+
const Icon2 = action.icon;
|
|
485
|
+
return Icon2 ? /* @__PURE__ */ jsx(Icon2, { className }) : null;
|
|
486
|
+
}
|
|
487
|
+
function PageActionBar({ actions, className }) {
|
|
488
|
+
const wide = useIsWide();
|
|
489
|
+
const visible = actions.filter((a) => !a.hidden);
|
|
490
|
+
if (visible.length === 0) return null;
|
|
491
|
+
if (!wide) {
|
|
492
|
+
const usable = visible.filter((a) => !a.desktopOnly);
|
|
493
|
+
return usable.length > 0 ? /* @__PURE__ */ jsx(PageActionFab, { actions: usable }) : null;
|
|
494
|
+
}
|
|
495
|
+
let seenPrimary = false;
|
|
496
|
+
const primary = [];
|
|
497
|
+
const secondary = [];
|
|
498
|
+
const utility = [];
|
|
499
|
+
const danger = [];
|
|
500
|
+
for (const a of visible) {
|
|
501
|
+
const intent = a.intent ?? "secondary";
|
|
502
|
+
if (intent === "primary" && !seenPrimary) {
|
|
503
|
+
seenPrimary = true;
|
|
504
|
+
primary.push(a);
|
|
505
|
+
continue;
|
|
506
|
+
}
|
|
507
|
+
if (intent === "danger") {
|
|
508
|
+
danger.push(a);
|
|
509
|
+
continue;
|
|
510
|
+
}
|
|
511
|
+
if (intent === "utility") {
|
|
512
|
+
utility.push(a);
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
secondary.push(a);
|
|
516
|
+
}
|
|
517
|
+
const head = primary[0];
|
|
518
|
+
const menu = [...secondary, ...danger];
|
|
519
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex shrink-0 items-center gap-2", className), children: [
|
|
520
|
+
utility.map((a) => /* @__PURE__ */ jsx(
|
|
521
|
+
Button,
|
|
522
|
+
{
|
|
523
|
+
variant: "outline",
|
|
524
|
+
size: "icon",
|
|
525
|
+
onClick: () => void a.onSelect(),
|
|
526
|
+
disabled: a.disabled,
|
|
527
|
+
"aria-label": a.label,
|
|
528
|
+
title: a.label,
|
|
529
|
+
"data-testid": a.testId,
|
|
530
|
+
children: iconOf(a, "h-4 w-4")
|
|
531
|
+
},
|
|
532
|
+
a.id
|
|
533
|
+
)),
|
|
534
|
+
head && menu.length === 0 && /* @__PURE__ */ jsxs(Button, { onClick: () => void head.onSelect(), disabled: head.disabled, "data-testid": head.testId, children: [
|
|
535
|
+
iconOf(head, "mr-1.5 h-4 w-4"),
|
|
536
|
+
head.label
|
|
537
|
+
] }),
|
|
538
|
+
head && menu.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
539
|
+
/* @__PURE__ */ jsxs(Button, { className: "rounded-r-none", onClick: () => void head.onSelect(), disabled: head.disabled, "data-testid": head.testId, children: [
|
|
540
|
+
iconOf(head, "mr-1.5 h-4 w-4"),
|
|
541
|
+
head.label
|
|
542
|
+
] }),
|
|
543
|
+
/* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
544
|
+
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { className: "-ml-px rounded-l-none px-2", "aria-label": `${head.label}\u2026`, children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }) }) }),
|
|
545
|
+
/* @__PURE__ */ jsx(DropdownContent, { align: "end", className: "w-56", children: /* @__PURE__ */ jsx(ActionItems, { actions: menu }) })
|
|
546
|
+
] })
|
|
547
|
+
] }),
|
|
548
|
+
!head && menu.length > 0 && /* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
549
|
+
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", "aria-label": "A\xE7\xF5es", children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }),
|
|
550
|
+
/* @__PURE__ */ jsx(DropdownContent, { align: "end", className: "w-56", children: /* @__PURE__ */ jsx(ActionItems, { actions: menu }) })
|
|
551
|
+
] })
|
|
552
|
+
] });
|
|
553
|
+
}
|
|
554
|
+
function ActionItems({ actions, stagger }) {
|
|
555
|
+
const out = [];
|
|
556
|
+
actions.forEach((a, i) => {
|
|
557
|
+
const isDanger = a.intent === "danger";
|
|
558
|
+
const prevSafe = i > 0 && actions[i - 1].intent !== "danger";
|
|
559
|
+
if (isDanger && prevSafe) out.push(/* @__PURE__ */ jsx(DropdownSeparator, {}, `${a.id}-sep`));
|
|
560
|
+
out.push(
|
|
561
|
+
/* @__PURE__ */ jsxs(
|
|
562
|
+
DropdownItem,
|
|
563
|
+
{
|
|
564
|
+
disabled: a.disabled,
|
|
565
|
+
onSelect: () => void a.onSelect(),
|
|
566
|
+
"data-testid": a.testId,
|
|
567
|
+
style: stagger ? { ["--i"]: i } : void 0,
|
|
568
|
+
className: cn("gap-2", stagger && "fz-fab-item", isDanger && "text-destructive focus:text-destructive"),
|
|
569
|
+
children: [
|
|
570
|
+
iconOf(a, "h-4 w-4 shrink-0"),
|
|
571
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
|
|
572
|
+
/* @__PURE__ */ jsx("span", { className: "block truncate", children: a.label }),
|
|
573
|
+
a.description && /* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-muted-foreground", children: a.description })
|
|
574
|
+
] })
|
|
575
|
+
]
|
|
576
|
+
},
|
|
577
|
+
a.id
|
|
578
|
+
)
|
|
579
|
+
);
|
|
580
|
+
});
|
|
581
|
+
return /* @__PURE__ */ jsx(Fragment, { children: out });
|
|
582
|
+
}
|
|
583
|
+
function PageActionFab({ actions }) {
|
|
584
|
+
const byIntent = (i) => actions.filter((a) => (a.intent ?? "secondary") === i);
|
|
585
|
+
const utility = byIntent("utility");
|
|
586
|
+
const main = [...byIntent("primary"), ...byIntent("secondary"), ...byIntent("danger")];
|
|
587
|
+
if (main.length === 0) return /* @__PURE__ */ jsx(FabButton, { actions: utility, tone: "neutral" });
|
|
588
|
+
const isCreate = main.every((a) => a.creates ?? a.icon === Plus);
|
|
589
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
590
|
+
utility.length > 0 && /* @__PURE__ */ jsx(FabButton, { actions: utility, tone: "neutral", mini: true }),
|
|
591
|
+
/* @__PURE__ */ jsx(FabButton, { actions: main, tone: isCreate ? "primary" : "neutral" })
|
|
592
|
+
] });
|
|
593
|
+
}
|
|
594
|
+
function useScrim(open) {
|
|
595
|
+
const [mounted, setMounted] = React16.useState(open);
|
|
596
|
+
const [visible, setVisible] = React16.useState(open);
|
|
597
|
+
React16.useEffect(() => {
|
|
598
|
+
if (open) {
|
|
599
|
+
setMounted(true);
|
|
600
|
+
const frame = requestAnimationFrame(() => setVisible(true));
|
|
601
|
+
return () => cancelAnimationFrame(frame);
|
|
602
|
+
}
|
|
603
|
+
setVisible(false);
|
|
604
|
+
const timer = window.setTimeout(() => setMounted(false), SCRIM_MS);
|
|
605
|
+
return () => window.clearTimeout(timer);
|
|
606
|
+
}, [open]);
|
|
607
|
+
return { mounted, visible };
|
|
608
|
+
}
|
|
609
|
+
var SCRIM_MS = 200;
|
|
610
|
+
function FabButton({ actions, tone, mini }) {
|
|
611
|
+
const [open, setOpen] = React16.useState(false);
|
|
612
|
+
const scrim = useScrim(open);
|
|
613
|
+
if (actions.length === 0) return null;
|
|
614
|
+
const isCreate = tone === "primary";
|
|
615
|
+
const FabIcon = isCreate ? Plus : MoreVertical;
|
|
616
|
+
const style = {
|
|
617
|
+
bottom: mini ? "calc(var(--fz-bottom-bar, 0px) + 4.75rem)" : "calc(var(--fz-bottom-bar, 0px) + 1rem)"
|
|
618
|
+
};
|
|
619
|
+
const shell = cn(
|
|
620
|
+
"fz-tap fixed z-40 flex items-center justify-center rounded-full",
|
|
621
|
+
"transition-transform active:scale-95 md:hidden",
|
|
622
|
+
// Centred on the main circle's column, so the two read as one stack.
|
|
623
|
+
mini ? "right-5 h-12 w-12" : "right-4 h-14 w-14",
|
|
624
|
+
isCreate ? "bg-primary text-primary-foreground shadow-lg shadow-primary/30 ring-4 ring-background" : "bg-card text-foreground shadow-lg ring-1 ring-border"
|
|
625
|
+
);
|
|
626
|
+
if (actions.length === 1) {
|
|
627
|
+
const only = actions[0];
|
|
628
|
+
const Icon2 = only.icon ?? FabIcon;
|
|
629
|
+
return /* @__PURE__ */ jsx(
|
|
630
|
+
"button",
|
|
631
|
+
{
|
|
632
|
+
type: "button",
|
|
633
|
+
style,
|
|
634
|
+
className: shell,
|
|
635
|
+
onClick: () => void only.onSelect(),
|
|
636
|
+
disabled: only.disabled,
|
|
637
|
+
"aria-label": only.label,
|
|
638
|
+
"data-testid": only.testId,
|
|
639
|
+
children: /* @__PURE__ */ jsx(Icon2, { className: mini ? "h-5 w-5" : "h-6 w-6" })
|
|
640
|
+
}
|
|
641
|
+
);
|
|
642
|
+
}
|
|
643
|
+
return /* @__PURE__ */ jsxs(Dropdown, { open, onOpenChange: setOpen, children: [
|
|
644
|
+
scrim.mounted && typeof document !== "undefined" && createPortal(
|
|
645
|
+
/* @__PURE__ */ jsx(
|
|
646
|
+
"div",
|
|
647
|
+
{
|
|
648
|
+
"aria-hidden": true,
|
|
649
|
+
onClick: () => setOpen(false),
|
|
650
|
+
className: cn(
|
|
651
|
+
"fixed inset-0 z-[100] bg-foreground/40 transition-opacity duration-200 md:hidden",
|
|
652
|
+
"motion-reduce:transition-none",
|
|
653
|
+
scrim.visible ? "opacity-100" : "opacity-0"
|
|
654
|
+
)
|
|
655
|
+
}
|
|
656
|
+
),
|
|
657
|
+
document.body
|
|
658
|
+
),
|
|
659
|
+
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
660
|
+
"button",
|
|
661
|
+
{
|
|
662
|
+
type: "button",
|
|
663
|
+
style,
|
|
664
|
+
className: cn(shell, open && "z-[105]", isCreate && "fz-fab-trigger"),
|
|
665
|
+
"aria-label": actionsMenuLabel,
|
|
666
|
+
children: /* @__PURE__ */ jsx(FabIcon, { className: mini ? "h-5 w-5" : "h-6 w-6" })
|
|
667
|
+
}
|
|
668
|
+
) }),
|
|
669
|
+
/* @__PURE__ */ jsx(DropdownContent, { side: "top", align: "end", sideOffset: 12, className: "fz-fab-menu w-60 md:hidden", children: /* @__PURE__ */ jsx(ActionItems, { actions, stagger: true }) })
|
|
670
|
+
] });
|
|
671
|
+
}
|
|
672
|
+
var actionsMenuLabel = "A\xE7\xF5es";
|
|
673
|
+
function setActionsMenuLabel(label) {
|
|
674
|
+
actionsMenuLabel = label;
|
|
675
|
+
}
|
|
676
|
+
var INLINE_LIMIT = 2;
|
|
677
|
+
function RowActions({
|
|
678
|
+
actions,
|
|
679
|
+
className,
|
|
680
|
+
inlineLimit = INLINE_LIMIT
|
|
681
|
+
}) {
|
|
682
|
+
const visible = actions.filter((a) => !a.hidden);
|
|
683
|
+
if (visible.length === 0) return null;
|
|
684
|
+
const safe = visible.filter((a) => a.intent !== "danger");
|
|
685
|
+
const danger = visible.filter((a) => a.intent === "danger");
|
|
686
|
+
const inline = danger.length === 0 && safe.length <= inlineLimit ? safe : safe.slice(0, 0);
|
|
687
|
+
const overflow = visible.filter((a) => !inline.includes(a));
|
|
688
|
+
const stop = (e) => e.stopPropagation();
|
|
689
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex shrink-0 items-center justify-end gap-0.5", className), onClick: stop, children: [
|
|
690
|
+
inline.map((a) => {
|
|
691
|
+
const Icon2 = a.icon;
|
|
692
|
+
return /* @__PURE__ */ jsx(
|
|
693
|
+
Button,
|
|
694
|
+
{
|
|
695
|
+
variant: "ghost",
|
|
696
|
+
size: "icon",
|
|
697
|
+
className: "fz-tap text-muted-foreground",
|
|
698
|
+
onClick: () => void a.onSelect(),
|
|
699
|
+
disabled: a.disabled,
|
|
700
|
+
"aria-label": a.label,
|
|
701
|
+
title: a.label,
|
|
702
|
+
"data-testid": a.testId,
|
|
703
|
+
children: Icon2 ? /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4" }) : null
|
|
704
|
+
},
|
|
705
|
+
a.id
|
|
706
|
+
);
|
|
707
|
+
}),
|
|
708
|
+
overflow.length > 0 && /* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
709
|
+
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
710
|
+
Button,
|
|
711
|
+
{
|
|
712
|
+
variant: "ghost",
|
|
713
|
+
size: "icon",
|
|
714
|
+
className: "fz-tap text-muted-foreground",
|
|
715
|
+
"aria-label": rowActionsLabel,
|
|
716
|
+
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" })
|
|
717
|
+
}
|
|
718
|
+
) }),
|
|
719
|
+
/* @__PURE__ */ jsx(DropdownContent, { align: "end", className: "w-52", children: overflow.map((a, i) => {
|
|
720
|
+
const Icon2 = a.icon;
|
|
721
|
+
const isDanger = a.intent === "danger";
|
|
722
|
+
const prevSafe = i > 0 && overflow[i - 1].intent !== "danger";
|
|
723
|
+
return /* @__PURE__ */ jsxs(React16.Fragment, { children: [
|
|
724
|
+
isDanger && prevSafe && /* @__PURE__ */ jsx(DropdownSeparator, {}),
|
|
725
|
+
/* @__PURE__ */ jsxs(
|
|
726
|
+
DropdownItem,
|
|
727
|
+
{
|
|
728
|
+
disabled: a.disabled,
|
|
729
|
+
onSelect: () => void a.onSelect(),
|
|
730
|
+
"data-testid": a.testId,
|
|
731
|
+
className: cn("gap-2", isDanger && "text-destructive focus:text-destructive"),
|
|
732
|
+
children: [
|
|
733
|
+
Icon2 ? /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4 shrink-0" }) : null,
|
|
734
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: a.label })
|
|
735
|
+
]
|
|
736
|
+
}
|
|
737
|
+
)
|
|
738
|
+
] }, a.id);
|
|
739
|
+
}) })
|
|
740
|
+
] })
|
|
741
|
+
] });
|
|
742
|
+
}
|
|
743
|
+
var rowActionsLabel = "A\xE7\xF5es";
|
|
744
|
+
function setRowActionsLabel(label) {
|
|
745
|
+
rowActionsLabel = label;
|
|
746
|
+
}
|
|
469
747
|
function SearchField({ value, onChange, placeholder, ...rest }) {
|
|
470
748
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
471
749
|
/* @__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" }),
|
|
@@ -621,8 +899,8 @@ var ICON_CLASSES = {
|
|
|
621
899
|
lg: "h-5 w-5"
|
|
622
900
|
};
|
|
623
901
|
function Thumbnail({ src, alt = "", size = "md", icon: Icon2 = ImageIcon, className }) {
|
|
624
|
-
const [failed, setFailed] =
|
|
625
|
-
|
|
902
|
+
const [failed, setFailed] = React16.useState(false);
|
|
903
|
+
React16.useEffect(() => {
|
|
626
904
|
setFailed(false);
|
|
627
905
|
}, [src]);
|
|
628
906
|
const base = cn("shrink-0 overflow-hidden", SIZE_CLASSES[size], className);
|
|
@@ -649,9 +927,9 @@ function Thumbnail({ src, alt = "", size = "md", icon: Icon2 = ImageIcon, classN
|
|
|
649
927
|
}
|
|
650
928
|
Thumbnail.displayName = "Thumbnail";
|
|
651
929
|
function RefreshButton({ onRefresh, fromCache, label, labelCached, className, ...rest }) {
|
|
652
|
-
const [phase, setPhase] =
|
|
653
|
-
const alive =
|
|
654
|
-
|
|
930
|
+
const [phase, setPhase] = React16.useState("idle");
|
|
931
|
+
const alive = React16.useRef(true);
|
|
932
|
+
React16.useEffect(() => () => {
|
|
655
933
|
alive.current = false;
|
|
656
934
|
}, []);
|
|
657
935
|
const title = fromCache ? labelCached ?? label : label;
|
|
@@ -669,16 +947,20 @@ function RefreshButton({ onRefresh, fromCache, label, labelCached, className, ..
|
|
|
669
947
|
}, 1400);
|
|
670
948
|
}
|
|
671
949
|
return /* @__PURE__ */ jsx(
|
|
672
|
-
|
|
950
|
+
Button,
|
|
673
951
|
{
|
|
674
952
|
type: "button",
|
|
953
|
+
variant: "ghost",
|
|
954
|
+
size: "icon",
|
|
675
955
|
title,
|
|
676
956
|
"aria-label": title,
|
|
677
957
|
onClick: () => {
|
|
678
958
|
void run();
|
|
679
959
|
},
|
|
680
960
|
className: cn(
|
|
681
|
-
|
|
961
|
+
// The state colours are the point of this control, so they stay; what
|
|
962
|
+
// it was missing is the shared button underneath them.
|
|
963
|
+
"transition",
|
|
682
964
|
fromCache && phase !== "done" && "text-amber-600 hover:text-amber-700 dark:text-amber-500 dark:hover:text-amber-400",
|
|
683
965
|
phase === "done" && "text-emerald-600 dark:text-emerald-500",
|
|
684
966
|
className
|
|
@@ -741,67 +1023,8 @@ function StatTiles({ tiles, loading, className }) {
|
|
|
741
1023
|
] }, tile.id);
|
|
742
1024
|
}) });
|
|
743
1025
|
}
|
|
744
|
-
var
|
|
745
|
-
|
|
746
|
-
md: "h-5 w-9"
|
|
747
|
-
};
|
|
748
|
-
var THUMB = {
|
|
749
|
-
sm: "h-3 w-3 data-[on=true]:translate-x-3",
|
|
750
|
-
md: "h-4 w-4 data-[on=true]:translate-x-4"
|
|
751
|
-
};
|
|
752
|
-
var Switch = React14.forwardRef(function Switch2({ checked, onCheckedChange, size = "sm", label, className, disabled, ...rest }, ref) {
|
|
753
|
-
const control = /* @__PURE__ */ jsx(
|
|
754
|
-
"button",
|
|
755
|
-
{
|
|
756
|
-
ref,
|
|
757
|
-
type: "button",
|
|
758
|
-
role: "switch",
|
|
759
|
-
"aria-checked": checked,
|
|
760
|
-
disabled,
|
|
761
|
-
onClick: (e) => {
|
|
762
|
-
e.stopPropagation();
|
|
763
|
-
rest.onClick?.(e);
|
|
764
|
-
if (!disabled) onCheckedChange(!checked);
|
|
765
|
-
},
|
|
766
|
-
className: cn(
|
|
767
|
-
"relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-colors",
|
|
768
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
769
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
770
|
-
TRACK[size],
|
|
771
|
-
checked ? "bg-primary" : "bg-muted-foreground/30",
|
|
772
|
-
className
|
|
773
|
-
),
|
|
774
|
-
...rest,
|
|
775
|
-
children: /* @__PURE__ */ jsx(
|
|
776
|
-
"span",
|
|
777
|
-
{
|
|
778
|
-
"data-on": checked,
|
|
779
|
-
className: cn(
|
|
780
|
-
"pointer-events-none ml-0.5 inline-block rounded-full bg-background shadow-sm transition-transform",
|
|
781
|
-
THUMB[size]
|
|
782
|
-
)
|
|
783
|
-
}
|
|
784
|
-
)
|
|
785
|
-
}
|
|
786
|
-
);
|
|
787
|
-
if (label == null) return control;
|
|
788
|
-
return /* @__PURE__ */ jsxs(
|
|
789
|
-
"label",
|
|
790
|
-
{
|
|
791
|
-
className: cn(
|
|
792
|
-
"inline-flex items-center gap-2 text-xs text-muted-foreground",
|
|
793
|
-
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
794
|
-
),
|
|
795
|
-
onClick: (e) => e.stopPropagation(),
|
|
796
|
-
children: [
|
|
797
|
-
control,
|
|
798
|
-
/* @__PURE__ */ jsx("span", { children: label })
|
|
799
|
-
]
|
|
800
|
-
}
|
|
801
|
-
);
|
|
802
|
-
});
|
|
803
|
-
var Hint = React14.forwardRef(function Hint2({ label, children, side = "top", delayDuration = 0, ...rest }, ref) {
|
|
804
|
-
if (!label) return React14.cloneElement(children, { ...rest, ref });
|
|
1026
|
+
var Hint = React16.forwardRef(function Hint2({ label, children, side = "top", delayDuration = 0, ...rest }, ref) {
|
|
1027
|
+
if (!label) return React16.cloneElement(children, { ...rest, ref });
|
|
805
1028
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
806
1029
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, ...rest, ref, children }),
|
|
807
1030
|
/* @__PURE__ */ jsx(TooltipContent, { side, className: "px-2 py-1 text-xs font-medium", children: label })
|
|
@@ -884,7 +1107,7 @@ function TimePicker({ value, onChange, interval = 15, min = "00:00", max = "23:4
|
|
|
884
1107
|
onClick: () => !readOnly && setOpen((p) => !p),
|
|
885
1108
|
onKeyDown: handleKeyDown,
|
|
886
1109
|
disabled: readOnly,
|
|
887
|
-
className: `flex items-center gap-2 rounded-
|
|
1110
|
+
className: `flex items-center gap-2 rounded-button border px-3 py-2 text-sm w-full text-left transition-colors ${readOnly ? "bg-muted/40 text-muted-foreground cursor-default" : "bg-background hover:bg-muted/30"}`,
|
|
888
1111
|
children: [
|
|
889
1112
|
/* @__PURE__ */ jsx(Clock, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }),
|
|
890
1113
|
/* @__PURE__ */ jsx("span", { children: displayValue || "--:--" })
|
|
@@ -922,6 +1145,58 @@ function TimePicker({ value, onChange, interval = 15, min = "00:00", max = "23:4
|
|
|
922
1145
|
)
|
|
923
1146
|
] });
|
|
924
1147
|
}
|
|
1148
|
+
function useRowSelection({
|
|
1149
|
+
rows,
|
|
1150
|
+
actions,
|
|
1151
|
+
getRowId,
|
|
1152
|
+
enabled = true
|
|
1153
|
+
}) {
|
|
1154
|
+
const identify = React16.useCallback(
|
|
1155
|
+
(row) => getRowId ? getRowId(row) : String(row?.id ?? ""),
|
|
1156
|
+
[getRowId]
|
|
1157
|
+
);
|
|
1158
|
+
const visible = React16.useMemo(() => rows ?? [], [rows]);
|
|
1159
|
+
const [rawSelection, setRawSelection] = React16.useState([]);
|
|
1160
|
+
const visibleIds = React16.useMemo(() => new Set(visible.map(identify)), [visible, identify]);
|
|
1161
|
+
const selectedIds = React16.useMemo(
|
|
1162
|
+
() => rawSelection.filter((id) => visibleIds.has(id)),
|
|
1163
|
+
[rawSelection, visibleIds]
|
|
1164
|
+
);
|
|
1165
|
+
const selectedRows = React16.useMemo(() => {
|
|
1166
|
+
const picked = new Set(selectedIds);
|
|
1167
|
+
return visible.filter((row) => picked.has(identify(row)));
|
|
1168
|
+
}, [visible, selectedIds, identify]);
|
|
1169
|
+
const clear = React16.useCallback(() => setRawSelection([]), []);
|
|
1170
|
+
const selectAll = React16.useCallback(
|
|
1171
|
+
() => setRawSelection(visible.map(identify)),
|
|
1172
|
+
[visible, identify]
|
|
1173
|
+
);
|
|
1174
|
+
const barActions = React16.useMemo(
|
|
1175
|
+
() => (actions ?? []).map((action) => ({
|
|
1176
|
+
id: action.id,
|
|
1177
|
+
label: action.label,
|
|
1178
|
+
icon: action.icon,
|
|
1179
|
+
destructive: action.destructive,
|
|
1180
|
+
overflow: action.overflow,
|
|
1181
|
+
disabled: action.disabled,
|
|
1182
|
+
onSelect: () => action.onSelect(selectedRows)
|
|
1183
|
+
})),
|
|
1184
|
+
[actions, selectedRows]
|
|
1185
|
+
);
|
|
1186
|
+
const selectable = enabled && barActions.length > 0;
|
|
1187
|
+
return {
|
|
1188
|
+
selectedIds,
|
|
1189
|
+
selectedRows,
|
|
1190
|
+
setSelectedIds: setRawSelection,
|
|
1191
|
+
clear,
|
|
1192
|
+
selectAll,
|
|
1193
|
+
barActions,
|
|
1194
|
+
selectable,
|
|
1195
|
+
hasSelection: selectable && selectedIds.length > 0,
|
|
1196
|
+
getRowId: identify,
|
|
1197
|
+
total: visible.length
|
|
1198
|
+
};
|
|
1199
|
+
}
|
|
925
1200
|
function FilterChip({ allLabel, options, value, onChange, label, icon: Icon2, className }) {
|
|
926
1201
|
const active = value != null && value !== "";
|
|
927
1202
|
const current = options.find((o) => o.value === value);
|
|
@@ -955,7 +1230,7 @@ function FilterChip({ allLabel, options, value, onChange, label, icon: Icon2, cl
|
|
|
955
1230
|
] })
|
|
956
1231
|
] });
|
|
957
1232
|
}
|
|
958
|
-
var ICON_BTN = "
|
|
1233
|
+
var ICON_BTN = "fz-tap text-muted-foreground";
|
|
959
1234
|
function ListView({
|
|
960
1235
|
columns,
|
|
961
1236
|
data,
|
|
@@ -972,6 +1247,8 @@ function ListView({
|
|
|
972
1247
|
newLabel,
|
|
973
1248
|
onNew,
|
|
974
1249
|
onRowClick,
|
|
1250
|
+
bulkActions,
|
|
1251
|
+
getRowId,
|
|
975
1252
|
emptyIcon: EmptyIcon,
|
|
976
1253
|
emptyMessage = "No results found.",
|
|
977
1254
|
emptyActionLabel,
|
|
@@ -987,7 +1264,8 @@ function ListView({
|
|
|
987
1264
|
exportLabel = "Export",
|
|
988
1265
|
onRefresh,
|
|
989
1266
|
refreshLabel = "Refresh",
|
|
990
|
-
className
|
|
1267
|
+
className,
|
|
1268
|
+
actions
|
|
991
1269
|
}) {
|
|
992
1270
|
const [internalSearch, setInternalSearch] = useState(controlledSearch ?? "");
|
|
993
1271
|
const debounceRef = useRef();
|
|
@@ -1008,6 +1286,7 @@ function ListView({
|
|
|
1008
1286
|
const showPagination = onPageChange && totalItems > pageSize;
|
|
1009
1287
|
const showSearch = !!onSearchChange;
|
|
1010
1288
|
const showTags = tags && tags.length > 0 && onTagChange;
|
|
1289
|
+
const selection = useRowSelection({ rows: loading ? [] : data, actions: bulkActions, getRowId });
|
|
1011
1290
|
const tagFilter = showTags ? /* @__PURE__ */ jsx(
|
|
1012
1291
|
FilterChip,
|
|
1013
1292
|
{
|
|
@@ -1027,16 +1306,31 @@ function ListView({
|
|
|
1027
1306
|
] })
|
|
1028
1307
|
] });
|
|
1029
1308
|
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-4", className), children: [
|
|
1030
|
-
(headerActions || onNew && newLabel) && /* @__PURE__ */ jsx(PageHeaderActions, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1309
|
+
(headerActions || actions?.length || onNew && newLabel) && /* @__PURE__ */ jsx(PageHeaderActions, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1031
1310
|
headerActions,
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1311
|
+
/* @__PURE__ */ jsx(
|
|
1312
|
+
PageActionBar,
|
|
1313
|
+
{
|
|
1314
|
+
actions: [
|
|
1315
|
+
...actions ?? [],
|
|
1316
|
+
...onNew && newLabel ? [{ id: "new", label: newLabel, icon: Plus, intent: "primary", onSelect: onNew }] : []
|
|
1317
|
+
]
|
|
1318
|
+
}
|
|
1319
|
+
)
|
|
1036
1320
|
] }) }),
|
|
1037
1321
|
toolbar,
|
|
1038
1322
|
/* @__PURE__ */ jsxs(Card, { className: "overflow-hidden", children: [
|
|
1039
|
-
(showSearch || tagFilter || filters || onRefresh || onExport) && /* @__PURE__ */
|
|
1323
|
+
(showSearch || tagFilter || filters || onRefresh || onExport || selection.hasSelection) && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-2 border-b border-border px-3 py-2", children: selection.hasSelection ? /* @__PURE__ */ jsx(
|
|
1324
|
+
BulkActionBar,
|
|
1325
|
+
{
|
|
1326
|
+
variant: "inline",
|
|
1327
|
+
count: selection.selectedIds.length,
|
|
1328
|
+
total: selection.total,
|
|
1329
|
+
onSelectAll: selection.selectAll,
|
|
1330
|
+
onClear: selection.clear,
|
|
1331
|
+
actions: selection.barActions
|
|
1332
|
+
}
|
|
1333
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1040
1334
|
showSearch && /* @__PURE__ */ jsxs("div", { className: "relative min-w-0 flex-1", children: [
|
|
1041
1335
|
/* @__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" }),
|
|
1042
1336
|
/* @__PURE__ */ jsx(
|
|
@@ -1053,10 +1347,10 @@ function ListView({
|
|
|
1053
1347
|
(tagFilter || filters || onRefresh || onExport) && /* @__PURE__ */ jsxs("div", { className: "ml-auto flex flex-wrap items-center justify-end gap-2", children: [
|
|
1054
1348
|
tagFilter,
|
|
1055
1349
|
filters,
|
|
1056
|
-
onRefresh && /* @__PURE__ */ jsx(
|
|
1057
|
-
onExport && /* @__PURE__ */ jsx(
|
|
1350
|
+
onRefresh && /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": refreshLabel, title: refreshLabel, onClick: onRefresh, className: ICON_BTN, children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4" }) }),
|
|
1351
|
+
onExport && /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": exportLabel, title: exportLabel, onClick: onExport, className: ICON_BTN, children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" }) })
|
|
1058
1352
|
] })
|
|
1059
|
-
] }),
|
|
1353
|
+
] }) }),
|
|
1060
1354
|
/* @__PURE__ */ jsx(
|
|
1061
1355
|
DataTable,
|
|
1062
1356
|
{
|
|
@@ -1066,7 +1360,11 @@ function ListView({
|
|
|
1066
1360
|
loading,
|
|
1067
1361
|
skeletonRows: loading ? 3 : void 0,
|
|
1068
1362
|
emptyMessage: emptyState,
|
|
1069
|
-
onRowClick
|
|
1363
|
+
onRowClick,
|
|
1364
|
+
selectable: selection.selectable,
|
|
1365
|
+
selectedIds: selection.selectedIds,
|
|
1366
|
+
onSelectedIdsChange: selection.setSelectedIds,
|
|
1367
|
+
getRowId
|
|
1070
1368
|
}
|
|
1071
1369
|
)
|
|
1072
1370
|
] }),
|
|
@@ -1288,7 +1586,7 @@ function DatePicker({ value, onChange, className, variant = "input", defaultOpen
|
|
|
1288
1586
|
)
|
|
1289
1587
|
] });
|
|
1290
1588
|
}
|
|
1291
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
1589
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React16.useLayoutEffect : React16.useEffect;
|
|
1292
1590
|
function SearchSelect({
|
|
1293
1591
|
value,
|
|
1294
1592
|
displayValue,
|
|
@@ -1311,18 +1609,18 @@ function SearchSelect({
|
|
|
1311
1609
|
disabled
|
|
1312
1610
|
}) {
|
|
1313
1611
|
const canCreate = !!onCreate && allowCreate !== false;
|
|
1314
|
-
const [open, setOpen] =
|
|
1315
|
-
const [query, setQuery] =
|
|
1316
|
-
const [results, setResults] =
|
|
1317
|
-
const [loading, setLoading] =
|
|
1318
|
-
const [creating, setCreating] =
|
|
1319
|
-
const [selectedLabel, setSelectedLabel] =
|
|
1320
|
-
const containerRef =
|
|
1321
|
-
const inputRef =
|
|
1322
|
-
const timerRef =
|
|
1323
|
-
const [rect, setRect] =
|
|
1324
|
-
const dropdownRef =
|
|
1325
|
-
|
|
1612
|
+
const [open, setOpen] = React16.useState(false);
|
|
1613
|
+
const [query, setQuery] = React16.useState("");
|
|
1614
|
+
const [results, setResults] = React16.useState([]);
|
|
1615
|
+
const [loading, setLoading] = React16.useState(false);
|
|
1616
|
+
const [creating, setCreating] = React16.useState(false);
|
|
1617
|
+
const [selectedLabel, setSelectedLabel] = React16.useState(displayValue ?? "");
|
|
1618
|
+
const containerRef = React16.useRef(null);
|
|
1619
|
+
const inputRef = React16.useRef(null);
|
|
1620
|
+
const timerRef = React16.useRef();
|
|
1621
|
+
const [rect, setRect] = React16.useState(null);
|
|
1622
|
+
const dropdownRef = React16.useRef(null);
|
|
1623
|
+
React16.useEffect(() => {
|
|
1326
1624
|
function handler(e) {
|
|
1327
1625
|
const target = e.target;
|
|
1328
1626
|
if (containerRef.current?.contains(target)) return;
|
|
@@ -1332,10 +1630,10 @@ function SearchSelect({
|
|
|
1332
1630
|
document.addEventListener("mousedown", handler);
|
|
1333
1631
|
return () => document.removeEventListener("mousedown", handler);
|
|
1334
1632
|
}, []);
|
|
1335
|
-
|
|
1633
|
+
React16.useEffect(() => {
|
|
1336
1634
|
if (displayValue !== void 0) setSelectedLabel(displayValue);
|
|
1337
1635
|
}, [displayValue]);
|
|
1338
|
-
|
|
1636
|
+
React16.useEffect(() => {
|
|
1339
1637
|
if (open && loadOnOpen && query.length === 0 && results.length === 0 && !loading) {
|
|
1340
1638
|
setLoading(true);
|
|
1341
1639
|
Promise.resolve(onSearch("")).then(setResults).catch(() => setResults([])).finally(() => setLoading(false));
|
|
@@ -1393,7 +1691,7 @@ function SearchSelect({
|
|
|
1393
1691
|
setResults([]);
|
|
1394
1692
|
setTimeout(() => inputRef.current?.focus(), 0);
|
|
1395
1693
|
}
|
|
1396
|
-
const groups =
|
|
1694
|
+
const groups = React16.useMemo(() => {
|
|
1397
1695
|
const map = /* @__PURE__ */ new Map();
|
|
1398
1696
|
for (const opt of results) {
|
|
1399
1697
|
const group = opt.group ?? "";
|
|
@@ -1488,7 +1786,7 @@ function SearchSelect({
|
|
|
1488
1786
|
/* @__PURE__ */ jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1489
1787
|
" ",
|
|
1490
1788
|
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(
|
|
1789
|
+
] }) : 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(React16.Fragment, { children: [
|
|
1492
1790
|
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
1791
|
options.map((opt) => /* @__PURE__ */ jsx(
|
|
1494
1792
|
"button",
|
|
@@ -1550,9 +1848,9 @@ function CurrencyInput({
|
|
|
1550
1848
|
className,
|
|
1551
1849
|
disabled
|
|
1552
1850
|
}) {
|
|
1553
|
-
const inputRef =
|
|
1554
|
-
const [focused, setFocused] =
|
|
1555
|
-
const format =
|
|
1851
|
+
const inputRef = React16.useRef(null);
|
|
1852
|
+
const [focused, setFocused] = React16.useState(false);
|
|
1853
|
+
const format = React16.useCallback((v) => {
|
|
1556
1854
|
return new Intl.NumberFormat(locale, {
|
|
1557
1855
|
minimumFractionDigits: 2,
|
|
1558
1856
|
maximumFractionDigits: 2
|
|
@@ -1622,93 +1920,10 @@ function CurrencyInput({
|
|
|
1622
1920
|
)
|
|
1623
1921
|
] });
|
|
1624
1922
|
}
|
|
1625
|
-
var VARIANT_CONFIG = {
|
|
1626
|
-
default: {
|
|
1627
|
-
icon: Info,
|
|
1628
|
-
iconBg: "bg-info/10",
|
|
1629
|
-
iconColor: "text-info",
|
|
1630
|
-
buttonVariant: "default"
|
|
1631
|
-
},
|
|
1632
|
-
destructive: {
|
|
1633
|
-
icon: XCircle,
|
|
1634
|
-
iconBg: "bg-destructive/10",
|
|
1635
|
-
iconColor: "text-destructive",
|
|
1636
|
-
buttonVariant: "destructive"
|
|
1637
|
-
},
|
|
1638
|
-
warning: {
|
|
1639
|
-
icon: AlertTriangle,
|
|
1640
|
-
iconBg: "bg-warning/10",
|
|
1641
|
-
iconColor: "text-warning",
|
|
1642
|
-
buttonVariant: "destructive"
|
|
1643
|
-
},
|
|
1644
|
-
success: {
|
|
1645
|
-
icon: CheckCircle2,
|
|
1646
|
-
iconBg: "bg-success/10",
|
|
1647
|
-
iconColor: "text-success",
|
|
1648
|
-
buttonVariant: "default"
|
|
1649
|
-
}
|
|
1650
|
-
};
|
|
1651
|
-
function ConfirmDialog({
|
|
1652
|
-
open,
|
|
1653
|
-
onConfirm,
|
|
1654
|
-
onCancel,
|
|
1655
|
-
title,
|
|
1656
|
-
description,
|
|
1657
|
-
confirmLabel = "Confirm",
|
|
1658
|
-
cancelLabel = "Cancel",
|
|
1659
|
-
variant = "default",
|
|
1660
|
-
loading = false
|
|
1661
|
-
}) {
|
|
1662
|
-
const config = VARIANT_CONFIG[variant];
|
|
1663
|
-
const Icon2 = config.icon;
|
|
1664
|
-
React14.useEffect(() => {
|
|
1665
|
-
if (!open) return;
|
|
1666
|
-
function handleKey(e) {
|
|
1667
|
-
if (e.key === "Escape") onCancel();
|
|
1668
|
-
}
|
|
1669
|
-
document.addEventListener("keydown", handleKey);
|
|
1670
|
-
return () => document.removeEventListener("keydown", handleKey);
|
|
1671
|
-
}, [open, onCancel]);
|
|
1672
|
-
if (!open) return null;
|
|
1673
|
-
return createPortal(
|
|
1674
|
-
/* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-[60] flex items-center justify-center", children: [
|
|
1675
|
-
/* @__PURE__ */ jsx(
|
|
1676
|
-
"div",
|
|
1677
|
-
{
|
|
1678
|
-
className: "absolute inset-0 bg-black/50 backdrop-blur-[2px] animate-fade-in",
|
|
1679
|
-
onClick: onCancel
|
|
1680
|
-
}
|
|
1681
|
-
),
|
|
1682
|
-
/* @__PURE__ */ jsx(
|
|
1683
|
-
"div",
|
|
1684
|
-
{
|
|
1685
|
-
className: "relative z-10 w-full max-w-sm mx-4 rounded-modal border border-border bg-card shadow-lg animate-zoom-in",
|
|
1686
|
-
role: "alertdialog",
|
|
1687
|
-
"aria-modal": "true",
|
|
1688
|
-
"aria-labelledby": "confirm-title",
|
|
1689
|
-
"aria-describedby": description ? "confirm-desc" : void 0,
|
|
1690
|
-
children: /* @__PURE__ */ jsxs("div", { className: "p-6", children: [
|
|
1691
|
-
/* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
|
|
1692
|
-
/* @__PURE__ */ jsx("div", { className: cn("flex h-10 w-10 items-center justify-center rounded-full shrink-0", config.iconBg), children: /* @__PURE__ */ jsx(Icon2, { className: cn("h-5 w-5", config.iconColor) }) }),
|
|
1693
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 pt-0.5", children: [
|
|
1694
|
-
/* @__PURE__ */ jsx("h3", { id: "confirm-title", className: "text-sm font-semibold text-foreground", children: title }),
|
|
1695
|
-
description && /* @__PURE__ */ jsx("p", { id: "confirm-desc", className: "text-xs text-muted-foreground mt-1 leading-relaxed", children: description })
|
|
1696
|
-
] })
|
|
1697
|
-
] }),
|
|
1698
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2 mt-5", children: [
|
|
1699
|
-
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: onCancel, disabled: loading, children: cancelLabel }),
|
|
1700
|
-
/* @__PURE__ */ jsx(Button, { variant: config.buttonVariant, size: "sm", onClick: onConfirm, disabled: loading, children: loading ? "Processing..." : confirmLabel })
|
|
1701
|
-
] })
|
|
1702
|
-
] })
|
|
1703
|
-
}
|
|
1704
|
-
)
|
|
1705
|
-
] }),
|
|
1706
|
-
document.body
|
|
1707
|
-
);
|
|
1708
|
-
}
|
|
1709
1923
|
var Popover = PopoverPrimitive.Root;
|
|
1710
1924
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1711
|
-
var
|
|
1925
|
+
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
1926
|
+
var PopoverContent = React16.forwardRef(({ className, align = "start", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
1712
1927
|
PopoverPrimitive.Content,
|
|
1713
1928
|
{
|
|
1714
1929
|
ref,
|
|
@@ -1781,7 +1996,7 @@ function renderInline(text, keyPrefix) {
|
|
|
1781
1996
|
if (part.startsWith("`") && part.endsWith("`") && part.length > 2) {
|
|
1782
1997
|
return /* @__PURE__ */ jsx("code", { className: "rounded bg-muted px-1 py-0.5 font-mono text-[0.85em]", children: part.slice(1, -1) }, key);
|
|
1783
1998
|
}
|
|
1784
|
-
return part === "" ? null : /* @__PURE__ */ jsx(
|
|
1999
|
+
return part === "" ? null : /* @__PURE__ */ jsx(React16.Fragment, { children: part }, key);
|
|
1785
2000
|
});
|
|
1786
2001
|
}
|
|
1787
2002
|
function parseBlocks(source) {
|
|
@@ -1865,7 +2080,7 @@ function renderMarkdown(source) {
|
|
|
1865
2080
|
case "ol":
|
|
1866
2081
|
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);
|
|
1867
2082
|
case "p":
|
|
1868
|
-
return /* @__PURE__ */ jsx("p", { children: block.lines.map((l, li) => /* @__PURE__ */ jsxs(
|
|
2083
|
+
return /* @__PURE__ */ jsx("p", { children: block.lines.map((l, li) => /* @__PURE__ */ jsxs(React16.Fragment, { children: [
|
|
1869
2084
|
li > 0 && /* @__PURE__ */ jsx("br", {}),
|
|
1870
2085
|
renderInline(l, `${key}-${li}`)
|
|
1871
2086
|
] }, `${key}-${li}`)) }, key);
|
|
@@ -1886,7 +2101,7 @@ function MarkdownEditor({
|
|
|
1886
2101
|
renderPreview,
|
|
1887
2102
|
className
|
|
1888
2103
|
}) {
|
|
1889
|
-
const [mode, setMode] =
|
|
2104
|
+
const [mode, setMode] = React16.useState(
|
|
1890
2105
|
defaultMode === "preview" && value.trim() === "" ? "edit" : defaultMode
|
|
1891
2106
|
);
|
|
1892
2107
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
@@ -1935,7 +2150,9 @@ function SearchCombobox({
|
|
|
1935
2150
|
inlineLabel,
|
|
1936
2151
|
inlineIcon = "search",
|
|
1937
2152
|
loading,
|
|
1938
|
-
onFocus: onFocusProp
|
|
2153
|
+
onFocus: onFocusProp,
|
|
2154
|
+
chevron,
|
|
2155
|
+
required
|
|
1939
2156
|
}) {
|
|
1940
2157
|
const [open, setOpen] = useState(false);
|
|
1941
2158
|
const [activeIndex, setActiveIndex] = useState(-1);
|
|
@@ -2020,10 +2237,11 @@ function SearchCombobox({
|
|
|
2020
2237
|
setExpanded(true);
|
|
2021
2238
|
setTimeout(() => inputRef.current?.focus(), 50);
|
|
2022
2239
|
},
|
|
2023
|
-
className: `flex items-center gap-1.5 w-full text-left text-sm py-1.5 pl-2 transition-colors ${isPlus ? "text-primary hover:text-primary/80" : "text-muted-foreground hover:text-foreground"} ${className ?? ""}`,
|
|
2240
|
+
className: `flex items-center gap-1.5 w-full text-left text-sm py-1.5 pl-2 ${chevron ? "pr-2" : ""} transition-colors ${isPlus ? "text-primary hover:text-primary/80" : "text-muted-foreground hover:text-foreground"} ${className ?? ""}`,
|
|
2024
2241
|
children: [
|
|
2025
2242
|
isPlus && /* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
2026
|
-
inlineLabel
|
|
2243
|
+
inlineLabel,
|
|
2244
|
+
chevron && /* @__PURE__ */ jsx(ChevronDown, { className: "ml-auto h-3 w-3 shrink-0 text-muted-foreground" })
|
|
2027
2245
|
]
|
|
2028
2246
|
}
|
|
2029
2247
|
);
|
|
@@ -2050,13 +2268,28 @@ function SearchCombobox({
|
|
|
2050
2268
|
onKeyDown: handleKeyDown,
|
|
2051
2269
|
placeholder,
|
|
2052
2270
|
autoFocus,
|
|
2053
|
-
className: minimal ?
|
|
2271
|
+
className: minimal ? `w-full bg-transparent pl-2 ${chevron ? "pr-7" : "pr-3"} py-1.5 text-sm placeholder:text-muted-foreground focus:outline-none border-b border-transparent hover:border-border focus:border-foreground transition-colors` : `w-full rounded-lg border bg-background pl-8 ${chevron ? "pr-8" : "pr-3"} py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring`,
|
|
2054
2272
|
role: "combobox",
|
|
2055
2273
|
"aria-expanded": hasDropdown,
|
|
2056
2274
|
"aria-autocomplete": "list",
|
|
2275
|
+
"aria-required": required || void 0,
|
|
2057
2276
|
"aria-activedescendant": activeIndex >= 0 ? `combobox-opt-${activeIndex}` : void 0
|
|
2058
2277
|
}
|
|
2059
2278
|
),
|
|
2279
|
+
chevron && /* @__PURE__ */ jsx(
|
|
2280
|
+
"button",
|
|
2281
|
+
{
|
|
2282
|
+
type: "button",
|
|
2283
|
+
tabIndex: -1,
|
|
2284
|
+
"aria-hidden": "true",
|
|
2285
|
+
onMouseDown: (e) => {
|
|
2286
|
+
e.preventDefault();
|
|
2287
|
+
inputRef.current?.focus();
|
|
2288
|
+
},
|
|
2289
|
+
className: `absolute ${minimal ? "right-2" : "right-2.5"} top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors`,
|
|
2290
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" })
|
|
2291
|
+
}
|
|
2292
|
+
),
|
|
2060
2293
|
hasDropdown && dropRect && createPortal(
|
|
2061
2294
|
/* @__PURE__ */ jsxs(
|
|
2062
2295
|
"div",
|
|
@@ -2129,6 +2362,6 @@ function SearchCombobox({
|
|
|
2129
2362
|
] });
|
|
2130
2363
|
}
|
|
2131
2364
|
|
|
2132
|
-
export { Badge, Breadcrumb, BulkActionBar, ChevronPager,
|
|
2133
|
-
//# sourceMappingURL=chunk-
|
|
2134
|
-
//# sourceMappingURL=chunk-
|
|
2365
|
+
export { Badge, Breadcrumb, BulkActionBar, ChevronPager, CurrencyInput, DatePicker, FilterChip, Hint, Input, ListView, Markdown, MarkdownEditor, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, PageActionBar, PhoneField, PhoneLink, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RefreshButton, RowActions, SearchCombobox, SearchField, SearchSelect, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, StatTiles, Tabs, TabsContent, TabsList, TabsTrigger, Thumbnail, TimePicker, ToastProvider, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, WHATSAPP_BRAND_COLOR, WhatsAppIcon, badgeVariants, formatPhone2 as formatPhone, normalizePhone, renderMarkdown, setActionsMenuLabel, setRowActionsLabel, useRowSelection };
|
|
2366
|
+
//# sourceMappingURL=chunk-SDPYDWWV.js.map
|
|
2367
|
+
//# sourceMappingURL=chunk-SDPYDWWV.js.map
|