@fayz-ai/ui 0.19.0 → 0.21.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/{chunk-SB6DWHXI.js → chunk-AIUHVTVK.js} +9 -3
- package/dist/chunk-AIUHVTVK.js.map +1 -0
- package/dist/{chunk-6YFPPK7X.js → chunk-EGHEU3U5.js} +131 -37
- package/dist/chunk-EGHEU3U5.js.map +1 -0
- package/dist/{chunk-ERSX3C7T.js → chunk-MBGTFL4I.js} +3 -3
- package/dist/{chunk-ERSX3C7T.js.map → chunk-MBGTFL4I.js.map} +1 -1
- package/dist/{chunk-5WSKZU7M.js → chunk-OYH7CEMB.js} +76 -113
- package/dist/chunk-OYH7CEMB.js.map +1 -0
- package/dist/{chunk-5NEADAIP.js → chunk-P3YTL3MF.js} +140 -16
- package/dist/chunk-P3YTL3MF.js.map +1 -0
- package/dist/dashboard/index.js +2 -2
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -7
- package/dist/layout/AppShell.d.ts +3 -1
- package/dist/layout/AppShell.d.ts.map +1 -1
- package/dist/layout/ModulePage.d.ts +13 -0
- package/dist/layout/ModulePage.d.ts.map +1 -1
- package/dist/layout/Sidebar.d.ts +7 -1
- package/dist/layout/Sidebar.d.ts.map +1 -1
- package/dist/layout/Takeover.d.ts +31 -0
- package/dist/layout/Takeover.d.ts.map +1 -0
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +3 -3
- package/dist/primitives/header-tabs.d.ts +16 -0
- package/dist/primitives/header-tabs.d.ts.map +1 -1
- package/dist/primitives/index.js +3 -3
- package/dist/primitives/list-view.d.ts.map +1 -1
- package/dist/primitives/page-actions.d.ts.map +1 -1
- package/dist/primitives/refresh-button.d.ts.map +1 -1
- package/dist/primitives/row-actions.d.ts.map +1 -1
- package/dist/styles.css +24 -0
- package/package.json +2 -2
- package/dist/chunk-5NEADAIP.js.map +0 -1
- package/dist/chunk-5WSKZU7M.js.map +0 -1
- package/dist/chunk-6YFPPK7X.js.map +0 -1
- package/dist/chunk-SB6DWHXI.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useSaveBarVisible, useCrossModuleBack, useBackHandler, PageHeaderActions } from './chunk-
|
|
1
|
+
import { useSaveBarVisible, useCrossModuleBack, useBackHandler, PageHeaderActions, SegmentedControl } from './chunk-EGHEU3U5.js';
|
|
2
2
|
import { useIsWide, Dropdown, DropdownTrigger, DropdownContent, DropdownSeparator, DropdownItem, Card, DataTable, Checkbox } from './chunk-E44WOPCR.js';
|
|
3
3
|
import { cn, Button } from './chunk-OKZ6WQB3.js';
|
|
4
4
|
import * as React18 from 'react';
|
|
@@ -483,6 +483,13 @@ var TooltipContent = React18.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
483
483
|
}
|
|
484
484
|
));
|
|
485
485
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
486
|
+
var Hint = React18.forwardRef(function Hint2({ label, children, side = "top", delayDuration = 0, ...rest }, ref) {
|
|
487
|
+
if (!label) return React18.cloneElement(children, { ...rest, ref });
|
|
488
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
489
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, ...rest, ref, children }),
|
|
490
|
+
/* @__PURE__ */ jsx(TooltipContent, { side, className: "px-2 py-1 text-xs font-medium", children: label })
|
|
491
|
+
] }) });
|
|
492
|
+
});
|
|
486
493
|
function iconOf(action, className) {
|
|
487
494
|
const Icon2 = action.icon;
|
|
488
495
|
return Icon2 ? /* @__PURE__ */ jsx(Icon2, { className }) : null;
|
|
@@ -520,20 +527,24 @@ function PageActionBar({ actions, className }) {
|
|
|
520
527
|
const head = primary[0];
|
|
521
528
|
const menu = [...secondary, ...danger];
|
|
522
529
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex shrink-0 items-center gap-2", className), children: [
|
|
523
|
-
utility.map((a) =>
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
530
|
+
utility.map((a) => (
|
|
531
|
+
// Um botão só de ícone não diz o que faz. `title=` parecia resolver e
|
|
532
|
+
// não resolve: espera ~1s que ninguém controla, sai na pintura do
|
|
533
|
+
// sistema operacional, nunca aparece no toque e vários leitores de tela
|
|
534
|
+
// pulam. Hint é o tooltip do design system, e o texto é ANUNCIADO.
|
|
535
|
+
/* @__PURE__ */ jsx(Hint, { label: a.label, children: /* @__PURE__ */ jsx(
|
|
536
|
+
Button,
|
|
537
|
+
{
|
|
538
|
+
variant: "outline",
|
|
539
|
+
size: "icon",
|
|
540
|
+
onClick: () => void a.onSelect(),
|
|
541
|
+
disabled: a.disabled,
|
|
542
|
+
"aria-label": a.label,
|
|
543
|
+
"data-testid": a.testId,
|
|
544
|
+
"data-tour": `action.${a.id}`,
|
|
545
|
+
children: iconOf(a, "h-4 w-4")
|
|
546
|
+
}
|
|
547
|
+
) }, a.id)
|
|
537
548
|
)),
|
|
538
549
|
head && menu.length === 0 && /* @__PURE__ */ jsxs(Button, { onClick: () => void head.onSelect(), disabled: head.disabled, "data-testid": head.testId, "data-tour": `action.${head.id}`, children: [
|
|
539
550
|
iconOf(head, "mr-1.5 h-4 w-4"),
|
|
@@ -545,7 +556,7 @@ function PageActionBar({ actions, className }) {
|
|
|
545
556
|
head.label
|
|
546
557
|
] }),
|
|
547
558
|
/* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
548
|
-
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
559
|
+
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Hint, { label: `${head.label}\u2026`, children: /* @__PURE__ */ jsx(
|
|
549
560
|
Button,
|
|
550
561
|
{
|
|
551
562
|
className: "-ml-px rounded-l-none px-2",
|
|
@@ -553,12 +564,12 @@ function PageActionBar({ actions, className }) {
|
|
|
553
564
|
"data-tour": menu.map((a) => `action.${a.id}`).join(" "),
|
|
554
565
|
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
|
|
555
566
|
}
|
|
556
|
-
) }),
|
|
567
|
+
) }) }),
|
|
557
568
|
/* @__PURE__ */ jsx(DropdownContent, { align: "end", className: "w-56", children: /* @__PURE__ */ jsx(ActionItems, { actions: menu }) })
|
|
558
569
|
] })
|
|
559
570
|
] }),
|
|
560
571
|
!head && menu.length > 0 && /* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
561
|
-
/* @__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" }) }) }),
|
|
572
|
+
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Hint, { label: "A\xE7\xF5es", children: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", "aria-label": "A\xE7\xF5es", children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }) }) }) }),
|
|
562
573
|
/* @__PURE__ */ jsx(DropdownContent, { align: "end", className: "w-56", children: /* @__PURE__ */ jsx(ActionItems, { actions: menu }) })
|
|
563
574
|
] })
|
|
564
575
|
] });
|
|
@@ -701,24 +712,25 @@ function RowActions({
|
|
|
701
712
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex shrink-0 items-center justify-end gap-0.5", className), onClick: stop, children: [
|
|
702
713
|
inline.map((a) => {
|
|
703
714
|
const Icon2 = a.icon;
|
|
704
|
-
return
|
|
705
|
-
|
|
706
|
-
{
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
715
|
+
return (
|
|
716
|
+
// Uma linha de tabela com três ícones cinza é três adivinhações.
|
|
717
|
+
/* @__PURE__ */ jsx(Hint, { label: a.label, children: /* @__PURE__ */ jsx(
|
|
718
|
+
Button,
|
|
719
|
+
{
|
|
720
|
+
variant: "ghost",
|
|
721
|
+
size: "icon",
|
|
722
|
+
className: "fz-tap text-muted-foreground",
|
|
723
|
+
onClick: () => void a.onSelect(),
|
|
724
|
+
disabled: a.disabled,
|
|
725
|
+
"aria-label": a.label,
|
|
726
|
+
"data-testid": a.testId,
|
|
727
|
+
children: Icon2 ? /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4" }) : null
|
|
728
|
+
}
|
|
729
|
+
) }, a.id)
|
|
718
730
|
);
|
|
719
731
|
}),
|
|
720
732
|
overflow.length > 0 && /* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
721
|
-
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
733
|
+
/* @__PURE__ */ jsx(DropdownTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Hint, { label: rowActionsLabel, children: /* @__PURE__ */ jsx(
|
|
722
734
|
Button,
|
|
723
735
|
{
|
|
724
736
|
variant: "ghost",
|
|
@@ -727,7 +739,7 @@ function RowActions({
|
|
|
727
739
|
"aria-label": rowActionsLabel,
|
|
728
740
|
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" })
|
|
729
741
|
}
|
|
730
|
-
) }),
|
|
742
|
+
) }) }),
|
|
731
743
|
/* @__PURE__ */ jsx(DropdownContent, { align: "end", className: "w-52", children: overflow.map((a, i) => {
|
|
732
744
|
const Icon2 = a.icon;
|
|
733
745
|
const isDanger = a.intent === "danger";
|
|
@@ -998,28 +1010,31 @@ function RefreshButton({ onRefresh, fromCache, label, labelCached, className, ..
|
|
|
998
1010
|
if (alive.current) setPhase((p) => p === "done" ? "idle" : p);
|
|
999
1011
|
}, 1400);
|
|
1000
1012
|
}
|
|
1001
|
-
return
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1013
|
+
return (
|
|
1014
|
+
// Só o ícone: sem o tooltip do design system, o que este botão faz depende
|
|
1015
|
+
// de o usuário arriscar um clique. `title=` não conta — ver Hint.
|
|
1016
|
+
/* @__PURE__ */ jsx(Hint, { label: title, children: /* @__PURE__ */ jsx(
|
|
1017
|
+
Button,
|
|
1018
|
+
{
|
|
1019
|
+
type: "button",
|
|
1020
|
+
variant: "ghost",
|
|
1021
|
+
size: "icon",
|
|
1022
|
+
"aria-label": title,
|
|
1023
|
+
onClick: () => {
|
|
1024
|
+
void run();
|
|
1025
|
+
},
|
|
1026
|
+
className: cn(
|
|
1027
|
+
// The state colours are the point of this control, so they stay; what
|
|
1028
|
+
// it was missing is the shared button underneath them.
|
|
1029
|
+
"transition",
|
|
1030
|
+
fromCache && phase !== "done" && "text-amber-600 hover:text-amber-700 dark:text-amber-500 dark:hover:text-amber-400",
|
|
1031
|
+
phase === "done" && "text-emerald-600 dark:text-emerald-500",
|
|
1032
|
+
className
|
|
1033
|
+
),
|
|
1034
|
+
...rest,
|
|
1035
|
+
children: phase === "done" ? /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(RefreshCw, { className: cn("h-4 w-4", phase === "busy" && "animate-spin") })
|
|
1036
|
+
}
|
|
1037
|
+
) })
|
|
1023
1038
|
);
|
|
1024
1039
|
}
|
|
1025
1040
|
RefreshButton.displayName = "RefreshButton";
|
|
@@ -1075,13 +1090,6 @@ function StatTiles({ tiles, loading, className }) {
|
|
|
1075
1090
|
] }, tile.id);
|
|
1076
1091
|
}) });
|
|
1077
1092
|
}
|
|
1078
|
-
var Hint = React18.forwardRef(function Hint2({ label, children, side = "top", delayDuration = 0, ...rest }, ref) {
|
|
1079
|
-
if (!label) return React18.cloneElement(children, { ...rest, ref });
|
|
1080
|
-
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
1081
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, ...rest, ref, children }),
|
|
1082
|
-
/* @__PURE__ */ jsx(TooltipContent, { side, className: "px-2 py-1 text-xs font-medium", children: label })
|
|
1083
|
-
] }) });
|
|
1084
|
-
});
|
|
1085
1093
|
function formatTime12(h, m) {
|
|
1086
1094
|
const period = h >= 12 ? "pm" : "am";
|
|
1087
1095
|
const h12 = h % 12 || 12;
|
|
@@ -1399,8 +1407,8 @@ function ListView({
|
|
|
1399
1407
|
(tagFilter || filters || onRefresh || onExport) && /* @__PURE__ */ jsxs("div", { className: "ml-auto flex flex-wrap items-center justify-end gap-2", children: [
|
|
1400
1408
|
tagFilter,
|
|
1401
1409
|
filters,
|
|
1402
|
-
onRefresh && /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": refreshLabel,
|
|
1403
|
-
onExport && /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": exportLabel,
|
|
1410
|
+
onRefresh && /* @__PURE__ */ jsx(Hint, { label: refreshLabel, children: /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": refreshLabel, onClick: onRefresh, className: ICON_BTN, children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4" }) }) }),
|
|
1411
|
+
onExport && /* @__PURE__ */ jsx(Hint, { label: exportLabel, children: /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": exportLabel, onClick: onExport, className: ICON_BTN, children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" }) }) })
|
|
1404
1412
|
] })
|
|
1405
1413
|
] }) }),
|
|
1406
1414
|
/* @__PURE__ */ jsx(
|
|
@@ -2163,51 +2171,6 @@ var PopoverContent = React18.forwardRef(({ className, align = "start", sideOffse
|
|
|
2163
2171
|
}
|
|
2164
2172
|
) }));
|
|
2165
2173
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
2166
|
-
var SIZE = {
|
|
2167
|
-
sm: { container: "h-[26px]", segment: "px-2.5 text-xs" },
|
|
2168
|
-
md: { container: "h-[30px]", segment: "px-3 text-sm" }
|
|
2169
|
-
};
|
|
2170
|
-
function SegmentedControl({
|
|
2171
|
-
options,
|
|
2172
|
-
value,
|
|
2173
|
-
onChange,
|
|
2174
|
-
size = "sm",
|
|
2175
|
-
className,
|
|
2176
|
-
...rest
|
|
2177
|
-
}) {
|
|
2178
|
-
const items = options.map((o) => typeof o === "string" ? { value: o, label: o } : o);
|
|
2179
|
-
return /* @__PURE__ */ jsx(
|
|
2180
|
-
"div",
|
|
2181
|
-
{
|
|
2182
|
-
role: "tablist",
|
|
2183
|
-
"aria-label": rest["aria-label"],
|
|
2184
|
-
className: cn(
|
|
2185
|
-
"inline-flex items-center rounded-button border border-border bg-card p-0.5 shadow-button",
|
|
2186
|
-
SIZE[size].container,
|
|
2187
|
-
className
|
|
2188
|
-
),
|
|
2189
|
-
children: items.map((item) => {
|
|
2190
|
-
const active = item.value === value;
|
|
2191
|
-
return /* @__PURE__ */ jsx(
|
|
2192
|
-
"button",
|
|
2193
|
-
{
|
|
2194
|
-
type: "button",
|
|
2195
|
-
role: "tab",
|
|
2196
|
-
"aria-selected": active,
|
|
2197
|
-
onClick: () => onChange(item.value),
|
|
2198
|
-
className: cn(
|
|
2199
|
-
"flex h-full items-center rounded-button font-semibold transition-colors",
|
|
2200
|
-
SIZE[size].segment,
|
|
2201
|
-
active ? "bg-foreground text-background" : "text-muted-foreground hover:bg-muted/60"
|
|
2202
|
-
),
|
|
2203
|
-
children: item.label
|
|
2204
|
-
},
|
|
2205
|
-
item.value
|
|
2206
|
-
);
|
|
2207
|
-
})
|
|
2208
|
-
}
|
|
2209
|
-
);
|
|
2210
|
-
}
|
|
2211
2174
|
function MultiSelect({
|
|
2212
2175
|
options,
|
|
2213
2176
|
value,
|
|
@@ -2844,6 +2807,6 @@ function StockEntryForm({
|
|
|
2844
2807
|
] }) });
|
|
2845
2808
|
}
|
|
2846
2809
|
|
|
2847
|
-
export { Badge, Breadcrumb, BulkActionBar, ChevronPager, CurrencyInput, DatePicker, DotBadge, DraftCommitBar, FilterCheckBox, FilterCheckList, FilterCheckRow, FilterChip, FilterSection, Hint, Input, ListView, Markdown, MarkdownEditor, MiniCalendar, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, MultiSelect, PageActionBar, PhoneField, PhoneLink, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RefreshButton, RowActions, SearchCombobox, SearchField, SearchSelect,
|
|
2848
|
-
//# sourceMappingURL=chunk-
|
|
2849
|
-
//# sourceMappingURL=chunk-
|
|
2810
|
+
export { Badge, Breadcrumb, BulkActionBar, ChevronPager, CurrencyInput, DatePicker, DotBadge, DraftCommitBar, FilterCheckBox, FilterCheckList, FilterCheckRow, FilterChip, FilterSection, Hint, Input, ListView, Markdown, MarkdownEditor, MiniCalendar, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, MultiSelect, PageActionBar, PhoneField, PhoneLink, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RefreshButton, RowActions, SearchCombobox, SearchField, SearchSelect, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, StatTiles, StockEntryForm, Tabs, TabsContent, TabsList, TabsTrigger, Thumbnail, TimePicker, ToastProvider, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, WHATSAPP_BRAND_COLOR, WhatsAppIcon, badgeVariants, formatPhone2 as formatPhone, normalizePhone, renderMarkdown, setActionsMenuLabel, setRowActionsLabel, toLocalISODate, useRowSelection };
|
|
2811
|
+
//# sourceMappingURL=chunk-OYH7CEMB.js.map
|
|
2812
|
+
//# sourceMappingURL=chunk-OYH7CEMB.js.map
|