@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.
Files changed (39) hide show
  1. package/dist/{chunk-SB6DWHXI.js → chunk-AIUHVTVK.js} +9 -3
  2. package/dist/chunk-AIUHVTVK.js.map +1 -0
  3. package/dist/{chunk-6YFPPK7X.js → chunk-EGHEU3U5.js} +131 -37
  4. package/dist/chunk-EGHEU3U5.js.map +1 -0
  5. package/dist/{chunk-ERSX3C7T.js → chunk-MBGTFL4I.js} +3 -3
  6. package/dist/{chunk-ERSX3C7T.js.map → chunk-MBGTFL4I.js.map} +1 -1
  7. package/dist/{chunk-5WSKZU7M.js → chunk-OYH7CEMB.js} +76 -113
  8. package/dist/chunk-OYH7CEMB.js.map +1 -0
  9. package/dist/{chunk-5NEADAIP.js → chunk-P3YTL3MF.js} +140 -16
  10. package/dist/chunk-P3YTL3MF.js.map +1 -0
  11. package/dist/dashboard/index.js +2 -2
  12. package/dist/icons.js +1 -1
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +7 -7
  16. package/dist/layout/AppShell.d.ts +3 -1
  17. package/dist/layout/AppShell.d.ts.map +1 -1
  18. package/dist/layout/ModulePage.d.ts +13 -0
  19. package/dist/layout/ModulePage.d.ts.map +1 -1
  20. package/dist/layout/Sidebar.d.ts +7 -1
  21. package/dist/layout/Sidebar.d.ts.map +1 -1
  22. package/dist/layout/Takeover.d.ts +31 -0
  23. package/dist/layout/Takeover.d.ts.map +1 -0
  24. package/dist/layout/index.d.ts +1 -0
  25. package/dist/layout/index.d.ts.map +1 -1
  26. package/dist/layout/index.js +3 -3
  27. package/dist/primitives/header-tabs.d.ts +16 -0
  28. package/dist/primitives/header-tabs.d.ts.map +1 -1
  29. package/dist/primitives/index.js +3 -3
  30. package/dist/primitives/list-view.d.ts.map +1 -1
  31. package/dist/primitives/page-actions.d.ts.map +1 -1
  32. package/dist/primitives/refresh-button.d.ts.map +1 -1
  33. package/dist/primitives/row-actions.d.ts.map +1 -1
  34. package/dist/styles.css +24 -0
  35. package/package.json +2 -2
  36. package/dist/chunk-5NEADAIP.js.map +0 -1
  37. package/dist/chunk-5WSKZU7M.js.map +0 -1
  38. package/dist/chunk-6YFPPK7X.js.map +0 -1
  39. package/dist/chunk-SB6DWHXI.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { useSaveBarVisible, useCrossModuleBack, useBackHandler, PageHeaderActions } from './chunk-6YFPPK7X.js';
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) => /* @__PURE__ */ jsx(
524
- Button,
525
- {
526
- variant: "outline",
527
- size: "icon",
528
- onClick: () => void a.onSelect(),
529
- disabled: a.disabled,
530
- "aria-label": a.label,
531
- title: a.label,
532
- "data-testid": a.testId,
533
- "data-tour": `action.${a.id}`,
534
- children: iconOf(a, "h-4 w-4")
535
- },
536
- a.id
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 /* @__PURE__ */ jsx(
705
- Button,
706
- {
707
- variant: "ghost",
708
- size: "icon",
709
- className: "fz-tap text-muted-foreground",
710
- onClick: () => void a.onSelect(),
711
- disabled: a.disabled,
712
- "aria-label": a.label,
713
- title: a.label,
714
- "data-testid": a.testId,
715
- children: Icon2 ? /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4" }) : null
716
- },
717
- a.id
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 /* @__PURE__ */ jsx(
1002
- Button,
1003
- {
1004
- type: "button",
1005
- variant: "ghost",
1006
- size: "icon",
1007
- title,
1008
- "aria-label": title,
1009
- onClick: () => {
1010
- void run();
1011
- },
1012
- className: cn(
1013
- // The state colours are the point of this control, so they stay; what
1014
- // it was missing is the shared button underneath them.
1015
- "transition",
1016
- fromCache && phase !== "done" && "text-amber-600 hover:text-amber-700 dark:text-amber-500 dark:hover:text-amber-400",
1017
- phase === "done" && "text-emerald-600 dark:text-emerald-500",
1018
- className
1019
- ),
1020
- ...rest,
1021
- children: phase === "done" ? /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(RefreshCw, { className: cn("h-4 w-4", phase === "busy" && "animate-spin") })
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, title: refreshLabel, onClick: onRefresh, className: ICON_BTN, children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4" }) }),
1403
- 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" }) })
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, SegmentedControl, 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 };
2848
- //# sourceMappingURL=chunk-5WSKZU7M.js.map
2849
- //# sourceMappingURL=chunk-5WSKZU7M.js.map
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