@snksergio/design-system 0.1.1 → 0.5.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 (67) hide show
  1. package/README.md +34 -1
  2. package/dist-lib/chunks/{app-shell-llilp6pT.cjs → app-shell-BdVam01i.cjs} +55 -55
  3. package/dist-lib/chunks/app-shell-BdVam01i.cjs.map +1 -0
  4. package/dist-lib/chunks/{app-shell-CDy42aNI.mjs → app-shell-C_enrPD8.mjs} +86 -86
  5. package/dist-lib/chunks/app-shell-C_enrPD8.mjs.map +1 -0
  6. package/dist-lib/chunks/{badge-B_2Zt52o.mjs → badge-B0D_PRxn.mjs} +10 -10
  7. package/dist-lib/chunks/badge-B0D_PRxn.mjs.map +1 -0
  8. package/dist-lib/chunks/{badge-ibpffgg9.cjs → badge-CUttkO1X.cjs} +10 -10
  9. package/dist-lib/chunks/badge-CUttkO1X.cjs.map +1 -0
  10. package/dist-lib/chunks/{chip-group-CsKBBHW2.cjs → chip-group-2-f_Yo7Y.cjs} +31 -64
  11. package/dist-lib/chunks/chip-group-2-f_Yo7Y.cjs.map +1 -0
  12. package/dist-lib/chunks/{chip-group-D3D0i72q.mjs → chip-group-_e-yh1Zq.mjs} +31 -64
  13. package/dist-lib/chunks/chip-group-_e-yh1Zq.mjs.map +1 -0
  14. package/dist-lib/chunks/{clientes-showcase-mocks-CSSyPTno.cjs → clientes-showcase-mocks-CPNOhx1G.cjs} +3 -3
  15. package/dist-lib/chunks/clientes-showcase-mocks-CPNOhx1G.cjs.map +1 -0
  16. package/dist-lib/chunks/{clientes-showcase-mocks-Cq9u3nGZ.mjs → clientes-showcase-mocks-DEHCKxMK.mjs} +3 -3
  17. package/dist-lib/chunks/clientes-showcase-mocks-DEHCKxMK.mjs.map +1 -0
  18. package/dist-lib/chunks/{input-BAZKFbZQ.cjs → input-BWevV7up.cjs} +3 -3
  19. package/dist-lib/chunks/input-BWevV7up.cjs.map +1 -0
  20. package/dist-lib/chunks/{input-DF4XAWmr.mjs → input-C9eKSSEb.mjs} +3 -3
  21. package/dist-lib/chunks/input-C9eKSSEb.mjs.map +1 -0
  22. package/dist-lib/chunks/{page-header-mC1gGtOI.mjs → page-header-DM2G1mdi.mjs} +3 -3
  23. package/dist-lib/chunks/page-header-DM2G1mdi.mjs.map +1 -0
  24. package/dist-lib/chunks/{page-header-DkdQkqTk.cjs → page-header-qOywgRWy.cjs} +3 -3
  25. package/dist-lib/chunks/page-header-qOywgRWy.cjs.map +1 -0
  26. package/dist-lib/chunks/{panel-Ds15whqp.mjs → panel-CCYNbXJR.mjs} +777 -293
  27. package/dist-lib/chunks/panel-CCYNbXJR.mjs.map +1 -0
  28. package/dist-lib/chunks/{panel-CEGA_98Q.cjs → panel-CSuFQHMl.cjs} +762 -278
  29. package/dist-lib/chunks/panel-CSuFQHMl.cjs.map +1 -0
  30. package/dist-lib/index.cjs +23 -76
  31. package/dist-lib/index.cjs.map +1 -1
  32. package/dist-lib/index.mjs +89 -142
  33. package/dist-lib/index.mjs.map +1 -1
  34. package/dist-lib/preview/chat.cjs +35 -36
  35. package/dist-lib/preview/chat.cjs.map +1 -1
  36. package/dist-lib/preview/chat.mjs +35 -36
  37. package/dist-lib/preview/chat.mjs.map +1 -1
  38. package/dist-lib/preview/clientes.cjs +20 -20
  39. package/dist-lib/preview/clientes.cjs.map +1 -1
  40. package/dist-lib/preview/clientes.mjs +20 -20
  41. package/dist-lib/preview/clientes.mjs.map +1 -1
  42. package/dist-lib/preview/dashboard.cjs +38 -38
  43. package/dist-lib/preview/dashboard.cjs.map +1 -1
  44. package/dist-lib/preview/dashboard.mjs +38 -38
  45. package/dist-lib/preview/dashboard.mjs.map +1 -1
  46. package/dist-lib/preview/mocks.cjs +1 -1
  47. package/dist-lib/preview/mocks.mjs +1 -1
  48. package/dist-lib/theme.css +18 -122
  49. package/dist-lib/tokens.cjs +24 -160
  50. package/dist-lib/tokens.cjs.map +1 -1
  51. package/dist-lib/tokens.mjs +24 -160
  52. package/dist-lib/tokens.mjs.map +1 -1
  53. package/package.json +142 -142
  54. package/dist-lib/chunks/app-shell-CDy42aNI.mjs.map +0 -1
  55. package/dist-lib/chunks/app-shell-llilp6pT.cjs.map +0 -1
  56. package/dist-lib/chunks/badge-B_2Zt52o.mjs.map +0 -1
  57. package/dist-lib/chunks/badge-ibpffgg9.cjs.map +0 -1
  58. package/dist-lib/chunks/chip-group-CsKBBHW2.cjs.map +0 -1
  59. package/dist-lib/chunks/chip-group-D3D0i72q.mjs.map +0 -1
  60. package/dist-lib/chunks/clientes-showcase-mocks-CSSyPTno.cjs.map +0 -1
  61. package/dist-lib/chunks/clientes-showcase-mocks-Cq9u3nGZ.mjs.map +0 -1
  62. package/dist-lib/chunks/input-BAZKFbZQ.cjs.map +0 -1
  63. package/dist-lib/chunks/input-DF4XAWmr.mjs.map +0 -1
  64. package/dist-lib/chunks/page-header-DkdQkqTk.cjs.map +0 -1
  65. package/dist-lib/chunks/page-header-mC1gGtOI.mjs.map +0 -1
  66. package/dist-lib/chunks/panel-CEGA_98Q.cjs.map +0 -1
  67. package/dist-lib/chunks/panel-Ds15whqp.mjs.map +0 -1
@@ -7,12 +7,12 @@ const React = require("react");
7
7
  const core = require("@dnd-kit/core");
8
8
  const sortable = require("@dnd-kit/sortable");
9
9
  const reactVirtual = require("@tanstack/react-virtual");
10
- const chipGroup = require("./chip-group-CsKBBHW2.cjs");
11
- const badge = require("./badge-ibpffgg9.cjs");
12
- const appShell = require("./app-shell-llilp6pT.cjs");
10
+ const chipGroup = require("./chip-group-2-f_Yo7Y.cjs");
11
+ const badge = require("./badge-CUttkO1X.cjs");
12
+ const appShell = require("./app-shell-BdVam01i.cjs");
13
13
  const lucideReact = require("lucide-react");
14
14
  const PopoverPrimitive = require("@radix-ui/react-popover");
15
- const input = require("./input-BAZKFbZQ.cjs");
15
+ const input = require("./input-BWevV7up.cjs");
16
16
  const AlertDialogPrimitive = require("@radix-ui/react-alert-dialog");
17
17
  const classVarianceAuthority = require("class-variance-authority");
18
18
  const reactDayPicker = require("react-day-picker");
@@ -120,7 +120,7 @@ const AlertDialogTitle = React__namespace.forwardRef(({ className, ...props }, r
120
120
  {
121
121
  ref,
122
122
  className: chipGroup.cn(
123
- "text-[18px] font-bold tracking-[-0.01em] text-fg-default leading-tight",
123
+ "text-body-xl font-bold tracking-[-0.01em] text-fg-default leading-tight",
124
124
  className
125
125
  ),
126
126
  ...props
@@ -132,7 +132,7 @@ const AlertDialogDescription = React__namespace.forwardRef(({ className, ...prop
132
132
  {
133
133
  ref,
134
134
  className: chipGroup.cn(
135
- "text-[13px] leading-[1.5] text-fg-muted max-w-[340px]",
135
+ "text-body-sm font-normal leading-[1.5] text-fg-muted max-w-[340px]",
136
136
  className
137
137
  ),
138
138
  ...props
@@ -259,9 +259,9 @@ const avatarVariants = chipGroup.tv({
259
259
  // 24px / 11px
260
260
  md: "size-comp-sm text-caption-sm",
261
261
  // 28px / 11px — default
262
- lg: "size-comp-md text-caption-md",
262
+ lg: "size-comp-md text-body-sm font-normal",
263
263
  // 32px / 13px
264
- xl: "size-comp-xl text-label-sm"
264
+ xl: "size-comp-xl text-body-md font-medium"
265
265
  // 40px / 14px
266
266
  },
267
267
  color: {
@@ -312,7 +312,7 @@ const Avatar = React.forwardRef(
312
312
  }
313
313
  );
314
314
  Avatar.displayName = "Avatar";
315
- const DEFAULT_COLUMN_WIDTH = 160;
315
+ const DEFAULT_COLUMN_WIDTH$1 = 160;
316
316
  function useColumnWidths(columns) {
317
317
  return React.useMemo(() => {
318
318
  const widths = {};
@@ -320,7 +320,7 @@ function useColumnWidths(columns) {
320
320
  let totalPinLeft = 0;
321
321
  let totalPinRight = 0;
322
322
  for (const col of columns) {
323
- widths[col.field] = col.width ?? col.defaultWidth ?? DEFAULT_COLUMN_WIDTH;
323
+ widths[col.field] = col.width ?? col.defaultWidth ?? DEFAULT_COLUMN_WIDTH$1;
324
324
  }
325
325
  let leftSum = 0;
326
326
  for (const col of columns) {
@@ -399,7 +399,7 @@ const toolbarSearch = chipGroup.tv({
399
399
  const toolbarSearchInput = chipGroup.tv({
400
400
  base: [
401
401
  "flex-1 min-w-0 bg-transparent border-0 outline-none",
402
- "text-[13px] text-fg-default",
402
+ "text-body-sm font-normal text-fg-default",
403
403
  "placeholder:text-fg-muted"
404
404
  ]
405
405
  });
@@ -429,7 +429,7 @@ const toolbarSegmentedButton = chipGroup.tv({
429
429
  "grid place-items-center",
430
430
  "h-[34px] min-w-[36px] px-pad-md",
431
431
  "rounded-radius-md border-0 bg-transparent cursor-pointer outline-none",
432
- "text-[13px] text-fg-muted",
432
+ "text-body-sm font-normal text-fg-muted",
433
433
  "transition-[background-color,color,box-shadow] duration-150",
434
434
  "hover:text-fg-default",
435
435
  "focus-visible:shadow-sh-ring",
@@ -485,7 +485,7 @@ const toolbarTabButton = chipGroup.tv({
485
485
  base: [
486
486
  "inline-flex items-center gap-gp-sm h-[34px] px-[14px]",
487
487
  "rounded-radius-md border-0 bg-transparent cursor-pointer outline-none",
488
- "text-[13px] font-medium text-fg-muted whitespace-nowrap",
488
+ "text-body-sm font-medium text-fg-muted whitespace-nowrap",
489
489
  "transition-[color,padding-right] duration-[220ms] ease-[cubic-bezier(0.4,0,0.2,1)]",
490
490
  "hover:text-fg-default",
491
491
  "focus-visible:shadow-sh-ring"
@@ -535,7 +535,7 @@ const toolbarAppliedChip = chipGroup.tv({
535
535
  "h-form-md pl-pad-sm pr-pad-lg",
536
536
  "bg-bg-surface dark:bg-bg-muted",
537
537
  "border border-dashed border-border-input rounded-radius-lg",
538
- "text-[12px] text-fg-default",
538
+ "text-body-xs font-normal text-fg-default",
539
539
  "transition-[background-color,border-color] duration-150"
540
540
  ],
541
541
  variants: {
@@ -563,19 +563,19 @@ const toolbarAppliedChipName = chipGroup.tv({
563
563
  base: "font-semibold text-fg-default"
564
564
  });
565
565
  const toolbarAppliedChipOp = chipGroup.tv({
566
- base: "text-fg-muted text-[11.5px]"
566
+ base: "text-fg-muted text-caption-sm"
567
567
  });
568
568
  const toolbarAppliedChipValue = chipGroup.tv({
569
569
  base: [
570
570
  "inline-flex items-center h-[22px] px-pad-md",
571
571
  "rounded-radius-sm",
572
572
  "bg-bg-muted dark:bg-bg-accent",
573
- "text-[12px] font-medium text-fg-default"
573
+ "text-body-xs font-medium text-fg-default"
574
574
  ]
575
575
  });
576
576
  const toolbarAppliedClearLink = chipGroup.tv({
577
577
  base: [
578
- "ml-pad-sm text-[12px] font-medium text-fg-brand cursor-pointer outline-none",
578
+ "ml-pad-sm text-body-xs font-medium text-fg-brand cursor-pointer outline-none",
579
579
  "bg-transparent border-0 p-0",
580
580
  "transition-opacity duration-150",
581
581
  "hover:underline underline-offset-2",
@@ -593,7 +593,7 @@ const bulkBarRoot = chipGroup.tv({
593
593
  const bulkBarCount = chipGroup.tv({
594
594
  base: [
595
595
  "inline-flex items-center gap-gp-md shrink-0",
596
- "text-[13px] font-semibold",
596
+ "text-body-sm font-semibold",
597
597
  "text-fg-brand dark:text-fg-default",
598
598
  "[&_svg]:size-[14px]"
599
599
  ]
@@ -608,7 +608,7 @@ const bulkBarClear = chipGroup.tv({
608
608
  base: [
609
609
  "shrink-0 ml-auto",
610
610
  "bg-transparent border-0 p-0 cursor-pointer outline-none",
611
- "text-[12px] font-semibold text-fg-brand",
611
+ "text-body-xs font-semibold text-fg-brand",
612
612
  "transition-opacity duration-150",
613
613
  "hover:underline underline-offset-2",
614
614
  "focus-visible:underline",
@@ -863,6 +863,68 @@ function ToolbarApplied({
863
863
  )
864
864
  ] });
865
865
  }
866
+ const HIDDEN_AT = {
867
+ md: "md:hidden",
868
+ lg: "lg:hidden",
869
+ xl: "xl:hidden",
870
+ "2xl": "2xl:hidden"
871
+ };
872
+ function ToolbarMobileDialog({
873
+ children,
874
+ trigger,
875
+ title: title2 = "Filtros e ações",
876
+ open: openProp,
877
+ onOpenChange,
878
+ desktopBreakpoint = "md",
879
+ className,
880
+ contentClassName
881
+ }) {
882
+ const [internalOpen, setInternalOpen] = React.useState(false);
883
+ const open = openProp ?? internalOpen;
884
+ const setOpen = onOpenChange ?? setInternalOpen;
885
+ const titleId = React.useId();
886
+ return /* @__PURE__ */ jsxRuntime.jsxs(appShell.Dialog, { open, onOpenChange: setOpen, children: [
887
+ /* @__PURE__ */ jsxRuntime.jsx(appShell.DialogTrigger, { asChild: true, children: trigger ?? /* @__PURE__ */ jsxRuntime.jsx(
888
+ chipGroup.Button,
889
+ {
890
+ color: "secondary",
891
+ variant: "outline",
892
+ size: "icon-md",
893
+ "aria-label": "Mais opções",
894
+ className: chipGroup.cn(HIDDEN_AT[desktopBreakpoint], className),
895
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, {})
896
+ }
897
+ ) }),
898
+ /* @__PURE__ */ jsxRuntime.jsxs(
899
+ appShell.DialogContent,
900
+ {
901
+ hideClose: true,
902
+ "aria-labelledby": titleId,
903
+ className: chipGroup.cn(
904
+ // Visual alinhado com CommandDialog
905
+ "overflow-hidden p-0 gap-0 sm:max-w-[384px]",
906
+ "rounded-[12px] border border-border-default outline-float",
907
+ contentClassName
908
+ ),
909
+ children: [
910
+ /* @__PURE__ */ jsxRuntime.jsx(appShell.DialogTitle, { id: titleId, className: "sr-only", children: title2 }),
911
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-gp-3xl p-pad-2xl max-h-[85vh] overflow-y-auto", children })
912
+ ]
913
+ }
914
+ )
915
+ ] });
916
+ }
917
+ const ToolbarMobileSheet = ToolbarMobileDialog;
918
+ function ToolbarMobileSection({
919
+ title: title2,
920
+ children,
921
+ className
922
+ }) {
923
+ return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: chipGroup.cn("flex flex-col gap-gp-md", className), children: [
924
+ title2 && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-body-xs font-medium text-fg-muted", children: title2 }),
925
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-gp-md", children })
926
+ ] });
927
+ }
866
928
  function BulkActionsBar({
867
929
  count,
868
930
  countLabel,
@@ -1051,7 +1113,7 @@ function ColsPopover({
1051
1113
  className
1052
1114
  ),
1053
1115
  children: [
1054
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none px-pad-xl py-pad-2xl border-b border-border-default", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[11px] font-semibold text-fg-muted uppercase tracking-wide leading-none m-0", children: title2 }) }),
1116
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none px-pad-xl py-pad-2xl border-b border-border-default", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-caption-sm font-semibold text-fg-muted uppercase tracking-wide leading-none m-0", children: title2 }) }),
1055
1117
  /* @__PURE__ */ jsxRuntime.jsx(
1056
1118
  "div",
1057
1119
  {
@@ -1113,7 +1175,7 @@ function ColsPopover({
1113
1175
  "label",
1114
1176
  {
1115
1177
  htmlFor: `col-vis-${col.key}`,
1116
- className: "flex-1 text-[13px] font-medium text-fg-default cursor-pointer truncate",
1178
+ className: "flex-1 text-body-sm font-medium text-fg-default cursor-pointer truncate",
1117
1179
  children: col.label
1118
1180
  }
1119
1181
  ),
@@ -1150,7 +1212,7 @@ function ColsPopover({
1150
1212
  {
1151
1213
  type: "button",
1152
1214
  onClick: showAll,
1153
- className: "text-[12px] font-medium text-fg-brand bg-transparent border-0 p-0 cursor-pointer outline-none hover:underline focus-visible:underline underline-offset-2",
1215
+ className: "text-body-xs font-medium text-fg-brand bg-transparent border-0 p-0 cursor-pointer outline-none hover:underline focus-visible:underline underline-offset-2",
1154
1216
  children: showAllLabel
1155
1217
  }
1156
1218
  ) : /* @__PURE__ */ jsxRuntime.jsx("span", {}),
@@ -1159,7 +1221,7 @@ function ColsPopover({
1159
1221
  {
1160
1222
  type: "button",
1161
1223
  onClick: onlyPinned,
1162
- className: "text-[12px] font-medium text-fg-brand bg-transparent border-0 p-0 cursor-pointer outline-none hover:underline focus-visible:underline underline-offset-2",
1224
+ className: "text-body-xs font-medium text-fg-brand bg-transparent border-0 p-0 cursor-pointer outline-none hover:underline focus-visible:underline underline-offset-2",
1163
1225
  children: onlyPinnedLabel
1164
1226
  }
1165
1227
  )
@@ -1207,7 +1269,7 @@ function SortPopover({
1207
1269
  className
1208
1270
  ),
1209
1271
  children: [
1210
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none flex items-center justify-between gap-gp-md px-pad-xl py-pad-lg border-b border-border-default", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[11px] font-semibold text-fg-muted uppercase tracking-wide leading-none m-0", children: title2 }) }),
1272
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none flex items-center justify-between gap-gp-md px-pad-xl py-pad-lg border-b border-border-default", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-caption-sm font-semibold text-fg-muted uppercase tracking-wide leading-none m-0", children: title2 }) }),
1211
1273
  /* @__PURE__ */ jsxRuntime.jsxs(
1212
1274
  "div",
1213
1275
  {
@@ -1219,15 +1281,15 @@ function SortPopover({
1219
1281
  "[&::-webkit-scrollbar-track]:bg-transparent"
1220
1282
  ),
1221
1283
  children: [
1222
- /* @__PURE__ */ jsxRuntime.jsx("section", { className: "px-pad-xl py-pad-lg border-b border-border-default", children: sortBy.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-fg-muted m-0 py-pad-sm", children: emptyMessage }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-[2px]", children: sortBy.map((s, i) => {
1284
+ /* @__PURE__ */ jsxRuntime.jsx("section", { className: "px-pad-xl py-pad-lg border-b border-border-default", children: sortBy.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-body-xs font-normal text-fg-muted m-0 py-pad-sm", children: emptyMessage }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-[2px]", children: sortBy.map((s, i) => {
1223
1285
  const col = columns.find((c) => c.key === s.key);
1224
1286
  return /* @__PURE__ */ jsxRuntime.jsxs(
1225
1287
  "div",
1226
1288
  {
1227
1289
  className: "group/row flex items-center gap-gp-md px-pad-md py-[4px] rounded-radius-md hover:bg-bg-muted",
1228
1290
  children: [
1229
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-fg-subtle shrink-0", children: i === 0 ? "Por" : "depois por" }),
1230
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-[13px] font-medium text-fg-default truncate", children: col?.label ?? s.key }),
1291
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-caption-sm text-fg-subtle shrink-0", children: i === 0 ? "Por" : "depois por" }),
1292
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-body-sm font-medium text-fg-default truncate", children: col?.label ?? s.key }),
1231
1293
  /* @__PURE__ */ jsxRuntime.jsxs(
1232
1294
  "button",
1233
1295
  {
@@ -1235,7 +1297,7 @@ function SortPopover({
1235
1297
  onClick: () => toggleDir(i),
1236
1298
  className: chipGroup.cn(
1237
1299
  "inline-flex items-center gap-gp-xs h-[22px] px-pad-md shrink-0",
1238
- "rounded-radius-sm bg-bg-muted text-fg-default text-[11.5px] font-medium",
1300
+ "rounded-radius-sm bg-bg-muted text-fg-default text-caption-sm font-medium",
1239
1301
  "outline-none cursor-pointer",
1240
1302
  "hover:bg-bg-muted-hover focus-visible:bg-bg-muted-hover",
1241
1303
  "[&_svg]:size-[12px]"
@@ -1272,7 +1334,7 @@ function SortPopover({
1272
1334
  );
1273
1335
  }) }) }),
1274
1336
  available.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "px-pad-xl py-pad-lg", children: [
1275
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-[11px] font-semibold text-fg-muted uppercase tracking-wide leading-none m-0 mb-pad-md", children: addSectionLabel }),
1337
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-caption-sm font-semibold text-fg-muted uppercase tracking-wide leading-none m-0 mb-pad-md", children: addSectionLabel }),
1276
1338
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-[2px]", children: available.map((col) => {
1277
1339
  const Icon = col.icon;
1278
1340
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1289,7 +1351,7 @@ function SortPopover({
1289
1351
  ),
1290
1352
  children: [
1291
1353
  Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-[14px] shrink-0 text-fg-muted" }),
1292
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-[13px] font-medium text-fg-default truncate", children: col.label }),
1354
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-body-sm font-medium text-fg-default truncate", children: col.label }),
1293
1355
  /* @__PURE__ */ jsxRuntime.jsx(
1294
1356
  lucideReact.Plus,
1295
1357
  {
@@ -1311,7 +1373,7 @@ function SortPopover({
1311
1373
  {
1312
1374
  type: "button",
1313
1375
  onClick: clearAll,
1314
- className: "text-[12px] font-medium text-fg-brand bg-transparent border-0 p-0 cursor-pointer outline-none hover:underline focus-visible:underline underline-offset-2",
1376
+ className: "text-body-xs font-medium text-fg-brand bg-transparent border-0 p-0 cursor-pointer outline-none hover:underline focus-visible:underline underline-offset-2",
1315
1377
  children: clearLabel
1316
1378
  }
1317
1379
  ) })
@@ -1382,7 +1444,7 @@ function ViewsPopover({
1382
1444
  onClick: () => setTab("all"),
1383
1445
  className: chipGroup.cn(
1384
1446
  "flex-1 h-form-sm px-pad-lg rounded-radius-sm",
1385
- "text-[12px] font-medium cursor-pointer outline-none",
1447
+ "text-body-xs font-medium cursor-pointer outline-none",
1386
1448
  "transition-[background-color,color,box-shadow] duration-150",
1387
1449
  tab === "all" ? "bg-bg-accent text-fg-default font-semibold shadow-sh-sm" : "bg-transparent text-fg-muted hover:text-fg-default"
1388
1450
  ),
@@ -1398,7 +1460,7 @@ function ViewsPopover({
1398
1460
  onClick: () => setTab("mine"),
1399
1461
  className: chipGroup.cn(
1400
1462
  "flex-1 h-form-sm px-pad-lg rounded-radius-sm",
1401
- "text-[12px] font-medium cursor-pointer outline-none",
1463
+ "text-body-xs font-medium cursor-pointer outline-none",
1402
1464
  "transition-[background-color,color,box-shadow] duration-150",
1403
1465
  tab === "mine" ? "bg-bg-accent text-fg-default font-semibold shadow-sh-sm" : "bg-transparent text-fg-muted hover:text-fg-default"
1404
1466
  ),
@@ -1425,7 +1487,7 @@ function ViewsPopover({
1425
1487
  value: search,
1426
1488
  onChange: (e) => setSearch(e.target.value),
1427
1489
  autoFocus: true,
1428
- className: "flex-1 min-w-0 bg-transparent border-0 outline-none text-[13px] text-fg-default placeholder:text-fg-muted"
1490
+ className: "flex-1 min-w-0 bg-transparent border-0 outline-none text-body-sm font-normal text-fg-default placeholder:text-fg-muted"
1429
1491
  }
1430
1492
  )
1431
1493
  ] }),
@@ -1440,7 +1502,7 @@ function ViewsPopover({
1440
1502
  "[&::-webkit-scrollbar-thumb]:bg-border-default [&::-webkit-scrollbar-thumb]:rounded-full",
1441
1503
  "[&::-webkit-scrollbar-track]:bg-transparent"
1442
1504
  ),
1443
- children: filtered.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-fg-muted m-0 px-pad-md py-pad-2xl text-center", children: search.trim() ? emptySearchMessage(search.trim()) : emptyMessage }) : filtered.map((view) => {
1505
+ children: filtered.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-body-xs font-normal text-fg-muted m-0 px-pad-md py-pad-2xl text-center", children: search.trim() ? emptySearchMessage(search.trim()) : emptyMessage }) : filtered.map((view) => {
1444
1506
  const isActive = view.id === activeViewId;
1445
1507
  const isMine = view.owner === myOwnerKey;
1446
1508
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1469,13 +1531,13 @@ function ViewsPopover({
1469
1531
  "span",
1470
1532
  {
1471
1533
  className: chipGroup.cn(
1472
- "flex-1 text-[13px] truncate",
1534
+ "flex-1 text-body-sm font-normal truncate",
1473
1535
  isActive ? "font-semibold" : "font-medium"
1474
1536
  ),
1475
1537
  children: view.name
1476
1538
  }
1477
1539
  ),
1478
- !isMine && view.ownerName && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[11px] text-fg-muted shrink-0", children: [
1540
+ !isMine && view.ownerName && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-caption-sm text-fg-muted shrink-0", children: [
1479
1541
  "por ",
1480
1542
  view.ownerName
1481
1543
  ] })
@@ -1522,7 +1584,7 @@ function ViewsPopover({
1522
1584
  "bg-bg-surface dark:bg-bg-muted",
1523
1585
  "border border-border-subtle dark:border-border-input",
1524
1586
  "shadow-sh-sm dark:shadow-sh-none",
1525
- "text-[13px] font-semibold text-fg-default dark:text-fg-muted",
1587
+ "text-body-sm font-semibold text-fg-default dark:text-fg-muted",
1526
1588
  "outline-none cursor-pointer",
1527
1589
  "transition-[background-color,color,box-shadow] duration-150",
1528
1590
  "hover:bg-bg-muted-hover hover:text-fg-default",
@@ -1575,7 +1637,7 @@ const formFieldRoot = chipGroup.tv({
1575
1637
  });
1576
1638
  const formFieldLabel = chipGroup.tv({
1577
1639
  base: [
1578
- "text-[12.5px] font-semibold tracking-[0.01em] leading-none",
1640
+ "text-body-sm font-semibold tracking-[0.01em] leading-none",
1579
1641
  "text-fg-default dark:text-fg-muted",
1580
1642
  "select-none"
1581
1643
  ],
@@ -1589,7 +1651,7 @@ const formFieldRequired = chipGroup.tv({
1589
1651
  base: "ml-[2px] text-fg-danger"
1590
1652
  });
1591
1653
  const formFieldMessage = chipGroup.tv({
1592
- base: "text-[11.5px] leading-snug",
1654
+ base: "text-caption-sm leading-snug",
1593
1655
  variants: {
1594
1656
  state: {
1595
1657
  default: "text-fg-muted",
@@ -1763,13 +1825,13 @@ const title = chipGroup.tv({
1763
1825
  "m-0 mb-[2px]",
1764
1826
  // leading-[1.3] balanceia o bloco verticalmente com o icon container 40px
1765
1827
  // (leading-none deixava o glyph colado no top → parecia subido).
1766
- "text-[17px] font-bold leading-[1.3]",
1828
+ "text-body-lg font-bold leading-[1.3]",
1767
1829
  "text-fg-default",
1768
1830
  "tracking-[-0.01em]"
1769
1831
  ]
1770
1832
  });
1771
1833
  const sub = chipGroup.tv({
1772
- base: "m-0 text-[12.5px] text-fg-muted leading-[1.45]"
1834
+ base: "m-0 text-body-xs font-normal text-fg-muted leading-[1.45]"
1773
1835
  });
1774
1836
  const body = chipGroup.tv({
1775
1837
  base: "flex flex-col gap-[18px] px-pad-4xl py-[22px]"
@@ -1808,10 +1870,10 @@ const toggleText = chipGroup.tv({
1808
1870
  base: "flex-1 min-w-0 flex flex-col gap-[3px]"
1809
1871
  });
1810
1872
  const toggleLabel = chipGroup.tv({
1811
- base: "text-[13.5px] font-semibold text-fg-default leading-[1.3]"
1873
+ base: "text-body-md font-semibold text-fg-default leading-[1.3]"
1812
1874
  });
1813
1875
  const toggleDesc = chipGroup.tv({
1814
- base: "text-[12px] text-fg-muted leading-[1.45]"
1876
+ base: "text-body-xs font-normal text-fg-muted leading-[1.45]"
1815
1877
  });
1816
1878
  const foot = chipGroup.tv({
1817
1879
  base: [
@@ -2118,7 +2180,7 @@ const SelectTrigger = React__namespace.forwardRef(({ className, children, state
2118
2180
  "bg-bg-input dark:bg-bg-muted",
2119
2181
  "hover:bg-bg-input-hover dark:hover:bg-bg-muted-hover",
2120
2182
  "border border-border-input",
2121
- "text-[13px] text-fg-default",
2183
+ "text-body-sm font-normal text-fg-default",
2122
2184
  "transition-[color,box-shadow,background-color,border-color] outline-none",
2123
2185
  "data-[placeholder]:text-fg-muted data-[placeholder]:opacity-70",
2124
2186
  state === "default" && "focus-visible:border-border-brand data-[state=open]:border-border-brand focus-visible:shadow-sh-ring data-[state=open]:shadow-sh-ring",
@@ -2201,7 +2263,7 @@ const SelectLabel = React__namespace.forwardRef(({ className, ...props }, ref) =
2201
2263
  SelectPrimitive__namespace.Label,
2202
2264
  {
2203
2265
  ref,
2204
- className: chipGroup.cn("py-pad-sm pl-8 pr-2 text-label-sm text-fg-muted", className),
2266
+ className: chipGroup.cn("py-pad-sm pl-8 pr-2 text-body-md font-medium text-fg-muted", className),
2205
2267
  ...props
2206
2268
  }
2207
2269
  ));
@@ -2213,7 +2275,7 @@ const SelectItem = React__namespace.forwardRef(({ className, children, ...props
2213
2275
  className: chipGroup.cn(
2214
2276
  "relative flex w-full cursor-default select-none items-center gap-pad-md",
2215
2277
  "rounded-radius-sm py-pad-md pl-8 pr-pad-lg",
2216
- "text-[13px] font-medium text-fg-muted",
2278
+ "text-body-sm font-medium text-fg-muted",
2217
2279
  "outline-none transition-colors",
2218
2280
  "focus:bg-bg-muted focus:text-fg-default",
2219
2281
  "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
@@ -2264,7 +2326,7 @@ function isFilterEntryActive(entry) {
2264
2326
  const FIELD_BASE = chipGroup.cn(
2265
2327
  "min-h-form-md h-form-md min-w-0 w-full",
2266
2328
  "rounded-radius-md",
2267
- "text-[13px]"
2329
+ "text-body-sm font-normal"
2268
2330
  );
2269
2331
  const INPUT_FIELD = chipGroup.cn(
2270
2332
  FIELD_BASE,
@@ -2303,7 +2365,7 @@ function FilterRowEditor({
2303
2365
  "flex flex-col sm:flex-row sm:items-center gap-gp-md"
2304
2366
  ),
2305
2367
  children: [
2306
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-fg-muted shrink-0 sm:w-[18px] sm:text-center", children: index === 0 ? conjLabels.first : conjLabels.rest }),
2368
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-caption-sm text-fg-muted shrink-0 sm:w-[18px] sm:text-center", children: index === 0 ? conjLabels.first : conjLabels.rest }),
2307
2369
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full sm:flex-[1_1_0%] sm:basis-0 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsxs(
2308
2370
  Select,
2309
2371
  {
@@ -2497,7 +2559,7 @@ function FilterPopover({
2497
2559
  ),
2498
2560
  children: [
2499
2561
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-none flex items-center justify-between gap-gp-md px-pad-xl py-pad-lg border-b border-border-default", children: [
2500
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[11px] font-semibold text-fg-muted uppercase tracking-wide leading-none m-0", children: title2 }),
2562
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-caption-sm font-semibold text-fg-muted uppercase tracking-wide leading-none m-0", children: title2 }),
2501
2563
  enableAdvanced && /* @__PURE__ */ jsxRuntime.jsxs(
2502
2564
  "div",
2503
2565
  {
@@ -2512,7 +2574,7 @@ function FilterPopover({
2512
2574
  "aria-selected": mode === "visual",
2513
2575
  onClick: () => setMode("visual"),
2514
2576
  className: chipGroup.cn(
2515
- "h-[30px] px-pad-lg rounded-radius-sm text-[12px] font-medium cursor-pointer outline-none",
2577
+ "h-[30px] px-pad-lg rounded-radius-sm text-body-xs font-medium cursor-pointer outline-none",
2516
2578
  "transition-[background-color,color,box-shadow] duration-150",
2517
2579
  mode === "visual" ? "bg-bg-accent text-fg-default font-semibold shadow-sh-sm" : "bg-transparent text-fg-muted hover:text-fg-default"
2518
2580
  ),
@@ -2527,7 +2589,7 @@ function FilterPopover({
2527
2589
  "aria-selected": mode === "advanced",
2528
2590
  onClick: () => setMode("advanced"),
2529
2591
  className: chipGroup.cn(
2530
- "h-[30px] px-pad-lg rounded-radius-sm text-[12px] font-medium cursor-pointer outline-none",
2592
+ "h-[30px] px-pad-lg rounded-radius-sm text-body-xs font-medium cursor-pointer outline-none",
2531
2593
  "transition-[background-color,color,box-shadow] duration-150",
2532
2594
  mode === "advanced" ? "bg-bg-accent text-fg-default font-semibold shadow-sh-sm" : "bg-transparent text-fg-muted hover:text-fg-default"
2533
2595
  ),
@@ -2546,8 +2608,8 @@ function FilterPopover({
2546
2608
  className: "size-[20px] text-fg-muted mb-pad-xl"
2547
2609
  }
2548
2610
  ),
2549
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[13px] font-semibold text-fg-default m-0", children: "Nenhuma condição" }),
2550
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-fg-muted m-0 mt-pad-2xs mb-pad-2xl", children: "Adicione filtros pra refinar a lista." }),
2611
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-body-sm font-semibold text-fg-default m-0", children: "Nenhuma condição" }),
2612
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-body-xs font-normal text-fg-muted m-0 mt-pad-2xs mb-pad-2xl", children: "Adicione filtros pra refinar a lista." }),
2551
2613
  /* @__PURE__ */ jsxRuntime.jsxs(
2552
2614
  "button",
2553
2615
  {
@@ -2556,7 +2618,7 @@ function FilterPopover({
2556
2618
  className: chipGroup.cn(
2557
2619
  "inline-flex items-center gap-gp-sm h-form-md px-pad-2xl rounded-radius-lg",
2558
2620
  "bg-bg-brand text-fg-on-brand",
2559
- "text-[13px] font-semibold cursor-pointer outline-none",
2621
+ "text-body-sm font-semibold cursor-pointer outline-none",
2560
2622
  "transition-[background-color] duration-150",
2561
2623
  "hover:bg-bg-brand-hover focus-visible:shadow-sh-ring",
2562
2624
  "[&_svg]:size-[14px]"
@@ -2604,7 +2666,7 @@ function FilterPopover({
2604
2666
  "min-h-form-md px-pad-xl rounded-radius-md",
2605
2667
  "bg-transparent text-fg-muted",
2606
2668
  "border border-dashed border-border-default",
2607
- "text-[13px] font-medium cursor-pointer outline-none",
2669
+ "text-body-sm font-medium cursor-pointer outline-none",
2608
2670
  "transition-[background-color,color,border-color] duration-150",
2609
2671
  "hover:bg-bg-muted hover:text-fg-default hover:border-border-default",
2610
2672
  "focus-visible:bg-bg-muted focus-visible:text-fg-default",
@@ -2617,7 +2679,7 @@ function FilterPopover({
2617
2679
  }
2618
2680
  ) })
2619
2681
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-h-0 flex flex-col gap-gp-md p-pad-xl overflow-y-auto", children: [
2620
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[11px] text-fg-muted", children: [
2682
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-caption-sm text-fg-muted", children: [
2621
2683
  "Editor livre — sintaxe estilo SQL. Operadores: ",
2622
2684
  /* @__PURE__ */ jsxRuntime.jsx("code", { children: "=" }),
2623
2685
  " ",
@@ -2652,14 +2714,14 @@ AND value > 1000`,
2652
2714
  "bg-bg-input dark:bg-bg-muted",
2653
2715
  "border",
2654
2716
  advancedError ? "border-border-critical" : "border-border-input",
2655
- "text-[12px] font-mono text-fg-default placeholder:text-fg-muted",
2717
+ "text-body-xs font-normal font-mono text-fg-default placeholder:text-fg-muted",
2656
2718
  "outline-none resize-y",
2657
2719
  "transition-[border-color,box-shadow] duration-150",
2658
2720
  advancedError ? "focus:border-border-critical focus:shadow-sh-ring-danger" : "focus:border-border-brand focus:shadow-sh-ring"
2659
2721
  )
2660
2722
  }
2661
2723
  ),
2662
- advancedError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-fg-critical", children: advancedError }),
2724
+ advancedError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-caption-sm text-fg-critical", children: advancedError }),
2663
2725
  /* @__PURE__ */ jsxRuntime.jsx(
2664
2726
  "button",
2665
2727
  {
@@ -2668,7 +2730,7 @@ AND value > 1000`,
2668
2730
  className: chipGroup.cn(
2669
2731
  "self-end px-pad-xl h-form-md rounded-radius-md",
2670
2732
  "bg-bg-brand text-fg-on-brand",
2671
- "text-[12px] font-semibold",
2733
+ "text-body-xs font-semibold",
2672
2734
  "hover:bg-bg-brand-hover focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand",
2673
2735
  "transition-[background-color,box-shadow] duration-150"
2674
2736
  ),
@@ -2684,14 +2746,14 @@ AND value > 1000`,
2684
2746
  onClick: clearAll,
2685
2747
  disabled: filters.length === 0,
2686
2748
  className: chipGroup.cn(
2687
- "text-[12px] font-medium text-fg-brand bg-transparent border-0 p-0 cursor-pointer outline-none",
2749
+ "text-body-xs font-medium text-fg-brand bg-transparent border-0 p-0 cursor-pointer outline-none",
2688
2750
  "hover:underline focus-visible:underline underline-offset-2",
2689
2751
  "disabled:opacity-50 disabled:pointer-events-none disabled:no-underline"
2690
2752
  ),
2691
2753
  children: "Limpar todos"
2692
2754
  }
2693
2755
  ),
2694
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-fg-muted", children: validCount === 0 ? "Nenhum filtro ativo" : `${validCount} ${validCount > 1 ? "condições ativas" : "condição ativa"}` })
2756
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-caption-sm text-fg-muted", children: validCount === 0 ? "Nenhum filtro ativo" : `${validCount} ${validCount > 1 ? "condições ativas" : "condição ativa"}` })
2695
2757
  ] })
2696
2758
  ]
2697
2759
  }
@@ -2730,7 +2792,7 @@ const paginationLinkVariants = classVarianceAuthority.cva(
2730
2792
  [
2731
2793
  "inline-flex items-center justify-center",
2732
2794
  "min-w-[30px] h-[30px] px-pad-md",
2733
- "rounded-radius-md text-[13px] font-medium tabular-nums",
2795
+ "rounded-radius-md text-body-sm font-medium tabular-nums",
2734
2796
  "outline-none cursor-pointer transition-[background-color,color,box-shadow]",
2735
2797
  "focus-visible:shadow-sh-ring",
2736
2798
  "disabled:opacity-50 disabled:pointer-events-none"
@@ -2831,7 +2893,7 @@ const PaginationEllipsis = ({
2831
2893
  "aria-hidden": "true",
2832
2894
  className: chipGroup.cn(
2833
2895
  "inline-flex items-center justify-center min-w-[22px] h-[30px]",
2834
- "text-[13px] text-fg-muted tracking-wider select-none",
2896
+ "text-body-sm font-normal text-fg-muted tracking-wider select-none",
2835
2897
  className
2836
2898
  ),
2837
2899
  ...props,
@@ -2880,7 +2942,7 @@ function FooterTable({
2880
2942
  // Mobile: empilha vertical (left em cima, paginação embaixo)
2881
2943
  "flex flex-col sm:flex-row sm:items-center sm:justify-between",
2882
2944
  "gap-gp-2xl px-pad-xs pt-pad-xl",
2883
- "text-[13px] text-fg-default",
2945
+ "text-body-sm font-normal text-fg-default",
2884
2946
  className
2885
2947
  ),
2886
2948
  children: [
@@ -3033,7 +3095,7 @@ const columnDot = chipGroup.tv({
3033
3095
  });
3034
3096
  const columnTitle = chipGroup.tv({
3035
3097
  base: [
3036
- "m-0 text-label-sm text-fg-default",
3098
+ "m-0 text-body-md font-medium text-fg-default",
3037
3099
  // Não expande (badge fica grudado à direita do título)
3038
3100
  "shrink min-w-0",
3039
3101
  "whitespace-nowrap overflow-hidden text-ellipsis"
@@ -3062,7 +3124,7 @@ const columnEmpty = chipGroup.tv({
3062
3124
  base: [
3063
3125
  "flex flex-1 flex-col items-center justify-center gap-gp-sm",
3064
3126
  "py-pad-3xl px-pad-xl",
3065
- "text-center text-caption-md text-fg-subtle"
3127
+ "text-center text-body-sm font-normal text-fg-subtle"
3066
3128
  ]
3067
3129
  });
3068
3130
  const columnEmptyIcon = chipGroup.tv({
@@ -3074,7 +3136,7 @@ const columnAdd = chipGroup.tv({
3074
3136
  "mx-pad-md mb-pad-md mt-sp-2xs",
3075
3137
  "px-pad-lg min-h-form-sm",
3076
3138
  "bg-transparent border border-dashed border-border-input rounded-radius-md",
3077
- "text-caption-md font-medium text-fg-muted",
3139
+ "text-body-sm font-medium text-fg-muted",
3078
3140
  "cursor-pointer",
3079
3141
  "transition-[background-color,color,border-color] duration-150",
3080
3142
  "hover:bg-bg-surface hover:text-fg-default hover:border-border-default",
@@ -3153,7 +3215,7 @@ const cardTitleWrap = chipGroup.tv({
3153
3215
  });
3154
3216
  const cardTitle = chipGroup.tv({
3155
3217
  base: [
3156
- "text-label-sm text-fg-default leading-[1.3]",
3218
+ "text-body-md font-medium text-fg-default leading-[1.3]",
3157
3219
  "whitespace-nowrap overflow-hidden text-ellipsis"
3158
3220
  ]
3159
3221
  });
@@ -3162,7 +3224,7 @@ const cardSubtitle = chipGroup.tv({
3162
3224
  });
3163
3225
  const cardDesc = chipGroup.tv({
3164
3226
  base: [
3165
- "m-0 text-caption-md leading-[1.45] text-fg-muted",
3227
+ "m-0 text-body-sm font-normal leading-[1.45] text-fg-muted",
3166
3228
  "[display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical]",
3167
3229
  "overflow-hidden"
3168
3230
  ]
@@ -3171,7 +3233,7 @@ const cardMeta = chipGroup.tv({
3171
3233
  base: "flex items-center justify-between gap-gp-md"
3172
3234
  });
3173
3235
  const cardValue = chipGroup.tv({
3174
- base: "text-caption-md font-semibold text-fg-default [font-variant-numeric:tabular-nums]"
3236
+ base: "text-body-sm font-semibold text-fg-default [font-variant-numeric:tabular-nums]"
3175
3237
  });
3176
3238
  const cardFoot = chipGroup.tv({
3177
3239
  base: [
@@ -3713,7 +3775,7 @@ const dataTableStyles = chipGroup.tv({
3713
3775
  "text-title-md text-fg-default"
3714
3776
  ],
3715
3777
  emptyDescription: [
3716
- "text-paragraph-sm text-fg-muted text-center max-w-[360px]"
3778
+ "text-body-md text-fg-muted text-center max-w-[360px]"
3717
3779
  ],
3718
3780
  bulkBar: [
3719
3781
  "fixed bottom-pad-3xl left-1/2 -translate-x-1/2 z-[var(--z-index-toast,600)]",
@@ -3778,7 +3840,7 @@ const FILTER_FIELD_CLASS = chipGroup.cn(
3778
3840
  "flex min-h-form-md h-form-md w-full items-center justify-between gap-gp-md",
3779
3841
  "rounded-radius-md px-pad-xl",
3780
3842
  // Tipografia
3781
- "text-[13px]",
3843
+ "text-body-sm font-normal",
3782
3844
  // Visual
3783
3845
  "bg-bg-input dark:bg-bg-muted",
3784
3846
  "border border-border-input text-fg-default",
@@ -3934,7 +3996,7 @@ function Calendar({
3934
3996
  defaultClassNames.month_caption
3935
3997
  ),
3936
3998
  caption_label: chipGroup.cn(
3937
- "text-label-sm font-semibold select-none",
3999
+ "text-body-md font-medium font-semibold select-none",
3938
4000
  captionLayout === "dropdown" ? "hidden" : "",
3939
4001
  defaultClassNames.caption_label
3940
4002
  ),
@@ -3943,7 +4005,7 @@ function Calendar({
3943
4005
  defaultClassNames.dropdowns
3944
4006
  ),
3945
4007
  dropdown: chipGroup.cn(
3946
- "cursor-pointer appearance-none bg-transparent text-label-sm font-semibold text-fg-default outline-none",
4008
+ "cursor-pointer appearance-none bg-transparent text-body-md font-medium font-semibold text-fg-default outline-none",
3947
4009
  defaultClassNames.dropdown
3948
4010
  ),
3949
4011
  months_dropdown: chipGroup.cn("", defaultClassNames.months_dropdown),
@@ -3951,7 +4013,7 @@ function Calendar({
3951
4013
  table: "w-full border-collapse",
3952
4014
  weekdays: chipGroup.cn("flex", defaultClassNames.weekdays),
3953
4015
  weekday: chipGroup.cn(
3954
- "flex-1 min-w-8 max-w-12 text-[0.8rem] font-normal text-fg-muted select-none text-center",
4016
+ "flex-1 min-w-8 max-w-12 text-body-sm font-normal text-fg-muted select-none text-center",
3955
4017
  defaultClassNames.weekday
3956
4018
  ),
3957
4019
  week: chipGroup.cn("mt-gp-md flex w-full", defaultClassNames.week),
@@ -4008,7 +4070,7 @@ function CalendarDayButton({
4008
4070
  "data-range-end": isRangeEnd || void 0,
4009
4071
  "data-range-middle": isRangeMiddle || void 0,
4010
4072
  className: chipGroup.cn(
4011
- "relative flex aspect-square w-full items-center justify-center text-paragraph-sm font-normal leading-none outline-none transition-colors",
4073
+ "relative flex aspect-square w-full items-center justify-center text-body-md font-normal leading-none outline-none transition-colors",
4012
4074
  // Default shape
4013
4075
  "rounded-full",
4014
4076
  // Hover
@@ -4244,7 +4306,7 @@ function MultiSelectDropdown({
4244
4306
  onChange(Array.from(set));
4245
4307
  };
4246
4308
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-gp-3xs p-pad-2xs min-w-[200px]", children: [
4247
- options.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-paragraph-xs text-fg-muted px-pad-md py-pad-sm", children: "Sem opções disponíveis" }),
4309
+ options.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-body-xs font-normal text-fg-muted px-pad-md py-pad-sm", children: "Sem opções disponíveis" }),
4248
4310
  options.map((opt) => {
4249
4311
  const isChecked = selected.map(String).includes(String(opt.value));
4250
4312
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4253,7 +4315,7 @@ function MultiSelectDropdown({
4253
4315
  className: chipGroup.cn(
4254
4316
  "flex items-center gap-gp-md w-full",
4255
4317
  "px-pad-md py-pad-sm rounded-radius-md",
4256
- "text-paragraph-sm text-fg-default text-left cursor-pointer",
4318
+ "text-body-md text-fg-default text-left cursor-pointer",
4257
4319
  "hover:bg-bg-muted focus-within:bg-bg-muted",
4258
4320
  "transition-colors duration-100"
4259
4321
  ),
@@ -5042,7 +5104,7 @@ const TagsColumnType = {
5042
5104
  onCheckedChange: () => toggle(String(o.value))
5043
5105
  }
5044
5106
  ),
5045
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-paragraph-sm text-fg-default", children: o.label })
5107
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-body-md text-fg-default", children: o.label })
5046
5108
  ]
5047
5109
  },
5048
5110
  String(o.value)
@@ -5069,7 +5131,7 @@ const TagsColumnType = {
5069
5131
  onCheckedChange: () => toggle(String(o.value))
5070
5132
  }
5071
5133
  ),
5072
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-paragraph-sm text-fg-default", children: o.label })
5134
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-body-md text-fg-default", children: o.label })
5073
5135
  ]
5074
5136
  },
5075
5137
  String(o.value)
@@ -5286,7 +5348,8 @@ function useDataTableColumns({
5286
5348
  initialWidthOverrides,
5287
5349
  initialPinnedOverrides,
5288
5350
  initialHiddenColumns,
5289
- initialColumnOrder
5351
+ initialColumnOrder,
5352
+ autoWidths
5290
5353
  }) {
5291
5354
  const [widthOverrides, setWidthOverrides] = React.useState(
5292
5355
  () => initialWidthOverrides ?? {}
@@ -5315,13 +5378,13 @@ function useDataTableColumns({
5315
5378
  const typeDef = col.type ? columnTypeRegistry.get(col.type) : void 0;
5316
5379
  ordered.push({
5317
5380
  ...col,
5318
- width: widthOverrides[field] ?? col.width ?? typeDef?.defaultWidth,
5381
+ width: widthOverrides[field] ?? autoWidths?.[field] ?? col.width ?? typeDef?.defaultWidth,
5319
5382
  sortable: col.sortable ?? typeDef?.defaultSortable,
5320
5383
  pinned: field in pinnedOverrides ? pinnedOverrides[field] : col.pinned
5321
5384
  });
5322
5385
  }
5323
5386
  return ordered;
5324
- }, [columns, columnOrder, hiddenColumns, widthOverrides, pinnedOverrides]);
5387
+ }, [columns, columnOrder, hiddenColumns, widthOverrides, pinnedOverrides, autoWidths]);
5325
5388
  const widthsInput = React.useMemo(
5326
5389
  () => effectiveColumns.map((c) => ({
5327
5390
  field: String(c.field),
@@ -5389,6 +5452,177 @@ function useDataTableColumns({
5389
5452
  applyColumnState
5390
5453
  };
5391
5454
  }
5455
+ let measureCanvas = null;
5456
+ let measureCtx = null;
5457
+ const DEFAULT_FONT = "13px Geist, system-ui, -apple-system, BlinkMacSystemFont, sans-serif";
5458
+ function ensureCtx(font = DEFAULT_FONT) {
5459
+ if (typeof document === "undefined") return null;
5460
+ if (!measureCanvas) {
5461
+ measureCanvas = document.createElement("canvas");
5462
+ measureCtx = measureCanvas.getContext("2d");
5463
+ }
5464
+ if (measureCtx) measureCtx.font = font;
5465
+ return measureCtx;
5466
+ }
5467
+ function measureTextWidth(text, font) {
5468
+ if (!text) return 0;
5469
+ const ctx = ensureCtx(font);
5470
+ if (!ctx) return 0;
5471
+ return ctx.measureText(text).width;
5472
+ }
5473
+ function getFieldValue$1(row, field) {
5474
+ if (!field.includes(".")) {
5475
+ return row[field];
5476
+ }
5477
+ return field.split(".").reduce(
5478
+ (acc, key) => acc?.[key],
5479
+ row
5480
+ );
5481
+ }
5482
+ function applyValueGetter(row, column2) {
5483
+ if (column2.valueGetter) return column2.valueGetter(row);
5484
+ return getFieldValue$1(row, String(column2.field));
5485
+ }
5486
+ function applyFormatter(row, column2) {
5487
+ const value = applyValueGetter(row, column2);
5488
+ if (column2.valueFormatter) return column2.valueFormatter(value);
5489
+ return value == null ? "" : String(value);
5490
+ }
5491
+ const DEFAULT_COLUMN_WIDTH = 160;
5492
+ const CELL_PADDING_PX = 32;
5493
+ const DEFAULT_SAMPLE_SIZE = 20;
5494
+ function calculateColumnWidths(columns, rows, options) {
5495
+ const { containerWidth, autoFit, sampleSize = DEFAULT_SAMPLE_SIZE } = options;
5496
+ if (containerWidth <= 0) return {};
5497
+ const widths = {};
5498
+ let totalContentWidth = 0;
5499
+ for (const col of columns) {
5500
+ const field = String(col.field);
5501
+ if (col.width !== void 0) {
5502
+ totalContentWidth += col.width;
5503
+ continue;
5504
+ }
5505
+ const typeDef = col.type ? columnTypeRegistry.get(col.type) : void 0;
5506
+ let calculatedWidth = typeDef?.defaultWidth ?? DEFAULT_COLUMN_WIDTH;
5507
+ if (autoFit) {
5508
+ const headerText = String(col.headerName ?? field);
5509
+ let maxWidth = measureTextWidth(headerText) + CELL_PADDING_PX;
5510
+ const sample = rows.slice(0, sampleSize);
5511
+ for (const row of sample) {
5512
+ const text = applyFormatter(row, col);
5513
+ if (!text) continue;
5514
+ const w = measureTextWidth(text) + CELL_PADDING_PX;
5515
+ if (w > maxWidth) maxWidth = w;
5516
+ }
5517
+ if (maxWidth > calculatedWidth) calculatedWidth = maxWidth;
5518
+ }
5519
+ if (col.minWidth !== void 0 && calculatedWidth < col.minWidth) {
5520
+ calculatedWidth = col.minWidth;
5521
+ }
5522
+ if (col.maxWidth !== void 0 && calculatedWidth > col.maxWidth) {
5523
+ calculatedWidth = col.maxWidth;
5524
+ }
5525
+ widths[field] = Math.round(calculatedWidth);
5526
+ totalContentWidth += calculatedWidth;
5527
+ }
5528
+ if (totalContentWidth < containerWidth) {
5529
+ const remainingSpace = containerWidth - totalContentWidth;
5530
+ const flexibleColumns = columns.filter((col) => col.width === void 0);
5531
+ const targets = flexibleColumns.length > 0 ? flexibleColumns : autoFit ? columns : [];
5532
+ if (targets.length > 0) {
5533
+ const extraPerColumn = Math.floor(remainingSpace / targets.length);
5534
+ let distributed = 0;
5535
+ targets.forEach((col, index) => {
5536
+ const field = String(col.field);
5537
+ const isLast = index === targets.length - 1;
5538
+ const extra = isLast ? remainingSpace - distributed : extraPerColumn;
5539
+ const current = widths[field] ?? col.width ?? 0;
5540
+ let next = current + extra;
5541
+ if (col.maxWidth !== void 0 && next > col.maxWidth) {
5542
+ next = col.maxWidth;
5543
+ }
5544
+ widths[field] = Math.round(next);
5545
+ distributed += extra;
5546
+ });
5547
+ }
5548
+ }
5549
+ return widths;
5550
+ }
5551
+ function useColumnAutoWidth(containerRef, columns, rows, options) {
5552
+ const { enabled, sampleSize, reservedWidth = 0 } = options;
5553
+ const [autoWidths, setAutoWidths] = React.useState({});
5554
+ const rafIdRef = React.useRef(null);
5555
+ const columnsRef = React.useRef(columns);
5556
+ const rowsRef = React.useRef(rows);
5557
+ columnsRef.current = columns;
5558
+ rowsRef.current = rows;
5559
+ React.useEffect(() => {
5560
+ if (!enabled) {
5561
+ setAutoWidths((prev) => Object.keys(prev).length === 0 ? prev : {});
5562
+ return;
5563
+ }
5564
+ const el = containerRef.current;
5565
+ if (!el) return;
5566
+ if (typeof ResizeObserver === "undefined") return;
5567
+ const recalculate = (containerWidth) => {
5568
+ const effectiveWidth = Math.max(0, containerWidth - reservedWidth);
5569
+ const calcOptions = {
5570
+ containerWidth: effectiveWidth,
5571
+ autoFit: enabled,
5572
+ sampleSize
5573
+ };
5574
+ const next = calculateColumnWidths(
5575
+ columnsRef.current,
5576
+ rowsRef.current,
5577
+ calcOptions
5578
+ );
5579
+ setAutoWidths((prev) => {
5580
+ const prevKeys = Object.keys(prev);
5581
+ const nextKeys = Object.keys(next);
5582
+ if (prevKeys.length === nextKeys.length) {
5583
+ let same = true;
5584
+ for (const k of nextKeys) {
5585
+ if (prev[k] !== next[k]) {
5586
+ same = false;
5587
+ break;
5588
+ }
5589
+ }
5590
+ if (same) return prev;
5591
+ }
5592
+ return next;
5593
+ });
5594
+ };
5595
+ const initialRect = el.getBoundingClientRect();
5596
+ recalculate(initialRect.width);
5597
+ const observer = new ResizeObserver((entries) => {
5598
+ const entry = entries[0];
5599
+ if (!entry) return;
5600
+ if (rafIdRef.current !== null) cancelAnimationFrame(rafIdRef.current);
5601
+ rafIdRef.current = requestAnimationFrame(() => {
5602
+ rafIdRef.current = null;
5603
+ recalculate(entry.contentRect.width);
5604
+ });
5605
+ });
5606
+ observer.observe(el);
5607
+ return () => {
5608
+ observer.disconnect();
5609
+ if (rafIdRef.current !== null) {
5610
+ cancelAnimationFrame(rafIdRef.current);
5611
+ rafIdRef.current = null;
5612
+ }
5613
+ };
5614
+ }, [
5615
+ enabled,
5616
+ containerRef,
5617
+ sampleSize,
5618
+ reservedWidth,
5619
+ columns.length,
5620
+ rows.length,
5621
+ // Inclui campos das columns pra recalcular quando consumer muda a schema
5622
+ columns.map((c) => String(c.field)).join("|")
5623
+ ]);
5624
+ return { autoWidths };
5625
+ }
5392
5626
  function toArray(v) {
5393
5627
  if (v == null) return [];
5394
5628
  if (Array.isArray(v)) return v;
@@ -5443,10 +5677,11 @@ function useDataTablePagination({
5443
5677
  paginationModel: controlledModel,
5444
5678
  onPaginationModelChange,
5445
5679
  initialPageSize = DEFAULT_PAGE_SIZE,
5680
+ initialPage = 1,
5446
5681
  resetTriggers = []
5447
5682
  } = {}) {
5448
5683
  const [uncontrolled, setUncontrolled] = React.useState({
5449
- page: 1,
5684
+ page: initialPage,
5450
5685
  pageSize: initialPageSize
5451
5686
  });
5452
5687
  const isControlled = controlledModel !== void 0;
@@ -5601,9 +5836,10 @@ const DEFAULT_DEBOUNCE = 500;
5601
5836
  function useDataTableSearch({
5602
5837
  search: controlledSearch,
5603
5838
  onSearchChange,
5604
- debounceMs = DEFAULT_DEBOUNCE
5839
+ debounceMs = DEFAULT_DEBOUNCE,
5840
+ initialSearch
5605
5841
  } = {}) {
5606
- const [uncontrolled, setUncontrolled] = React.useState("");
5842
+ const [uncontrolled, setUncontrolled] = React.useState(initialSearch ?? "");
5607
5843
  const isControlled = controlledSearch !== void 0;
5608
5844
  const inputValue = isControlled ? controlledSearch : uncontrolled;
5609
5845
  const [debouncedValue, setDebouncedValue] = React.useState(inputValue);
@@ -5653,24 +5889,6 @@ function useDataTableFilters({
5653
5889
  }, [setFilterModel]);
5654
5890
  return { filterModel, setFilterModel, clearFilters };
5655
5891
  }
5656
- function getFieldValue$1(row, field) {
5657
- if (!field.includes(".")) {
5658
- return row[field];
5659
- }
5660
- return field.split(".").reduce(
5661
- (acc, key) => acc?.[key],
5662
- row
5663
- );
5664
- }
5665
- function applyValueGetter(row, column2) {
5666
- if (column2.valueGetter) return column2.valueGetter(row);
5667
- return getFieldValue$1(row, String(column2.field));
5668
- }
5669
- function applyFormatter(row, column2) {
5670
- const value = applyValueGetter(row, column2);
5671
- if (column2.valueFormatter) return column2.valueFormatter(value);
5672
- return value == null ? "" : String(value);
5673
- }
5674
5892
  function matchesFilter(value, item, col) {
5675
5893
  const { operator } = item;
5676
5894
  const target = item.value;
@@ -5916,7 +6134,7 @@ function downloadCsv(csv, filename) {
5916
6134
  URL.revokeObjectURL(url);
5917
6135
  }
5918
6136
  const STORAGE_PREFIX$1 = "igreen-datatable:";
5919
- const SCHEMA_VERSION = 3;
6137
+ const SCHEMA_VERSION = 4;
5920
6138
  function storageKey$1(persistId) {
5921
6139
  return `${STORAGE_PREFIX$1}${persistId}`;
5922
6140
  }
@@ -6081,12 +6299,22 @@ function useDataTableController(props, ref) {
6081
6299
  () => loadPersistedState(props.persistId),
6082
6300
  [props.persistId]
6083
6301
  );
6302
+ const scrollContainerRef = React.useRef(null);
6303
+ const autoFitEnabled = props.autoFit !== false;
6304
+ const selectionReservedWidth = props.selectionConfig?.enabled ? SELECTION_COLUMN_WIDTH : 0;
6305
+ const { autoWidths } = useColumnAutoWidth(
6306
+ scrollContainerRef,
6307
+ props.columns,
6308
+ props.rows ?? [],
6309
+ { enabled: autoFitEnabled, reservedWidth: selectionReservedWidth }
6310
+ );
6084
6311
  const cols = useDataTableColumns({
6085
6312
  columns: props.columns,
6086
6313
  initialWidthOverrides: persistedInitial?.columnWidths,
6087
6314
  initialPinnedOverrides: persistedInitial?.pinnedColumns,
6088
6315
  initialHiddenColumns: persistedInitial?.hiddenColumns,
6089
- initialColumnOrder: persistedInitial?.columnOrder
6316
+ initialColumnOrder: persistedInitial?.columnOrder,
6317
+ autoWidths
6090
6318
  });
6091
6319
  const sort = useDataTableSort({
6092
6320
  sortModel: props.sortModel,
@@ -6095,16 +6323,23 @@ function useDataTableController(props, ref) {
6095
6323
  });
6096
6324
  const filters = useDataTableFilters({
6097
6325
  filterModel: props.filterModel,
6098
- onFilterModelChange: props.onFilterModelChange
6326
+ onFilterModelChange: props.onFilterModelChange,
6327
+ // Hidrata filtros do workspace Default (v4+). Quando uma view custom estava
6328
+ // ativa no último mount, o effect de restore (linha ~410) aplica a view depois.
6329
+ initialFilterModel: persistedInitial?.filterModel
6099
6330
  });
6100
6331
  const search = useDataTableSearch({
6101
6332
  search: props.search,
6102
- onSearchChange: props.onSearchChange
6333
+ onSearchChange: props.onSearchChange,
6334
+ // Hidrata texto de busca do workspace Default (v4+).
6335
+ initialSearch: persistedInitial?.search
6103
6336
  });
6104
6337
  const pagination = useDataTablePagination({
6105
6338
  paginationModel: props.paginationModel,
6106
6339
  onPaginationModelChange: props.onPaginationModelChange,
6107
6340
  initialPageSize: persistedInitial?.pageSize ?? props.paginationConfig?.initialPageSize,
6341
+ // Hidrata página atual do workspace Default (v4+).
6342
+ initialPage: persistedInitial?.currentPage,
6108
6343
  resetTriggers: [filters.filterModel.items.length, search.debouncedValue]
6109
6344
  });
6110
6345
  const density = useDataTableDensity({
@@ -6228,10 +6463,17 @@ function useDataTableController(props, ref) {
6228
6463
  density: density.density,
6229
6464
  sortModel: sort.sortModels,
6230
6465
  pageSize: pagination.paginationModel.pageSize,
6466
+ // v4 — currentPage/filterModel/search persistem como parte do workspace Default.
6467
+ // O defaultSnapshotRef abaixo só atualiza quando currentViewId === null, ou seja
6468
+ // só "captura" esses valores quando a Default está ativa. Aplicar uma view custom
6469
+ // não polui o Default (o save sempre usa defaultSnapshotRef, não persistedSnapshot).
6470
+ currentPage: pagination.paginationModel.page,
6231
6471
  columnWidths: cols.columnWidths,
6232
6472
  pinnedColumns: cols.pinnedColumns,
6233
6473
  hiddenColumns: Array.from(cols.hiddenColumns),
6234
6474
  columnOrder: cols.columnOrder,
6475
+ filterModel: filters.filterModel,
6476
+ search: search.debouncedValue,
6235
6477
  // Fase v3 — features novas também persistem (workspace completo da Default)
6236
6478
  viewMode,
6237
6479
  groupBy,
@@ -6242,10 +6484,13 @@ function useDataTableController(props, ref) {
6242
6484
  density.density,
6243
6485
  sort.sortModels,
6244
6486
  pagination.paginationModel.pageSize,
6487
+ pagination.paginationModel.page,
6245
6488
  cols.columnWidths,
6246
6489
  cols.pinnedColumns,
6247
6490
  cols.hiddenColumns,
6248
6491
  cols.columnOrder,
6492
+ filters.filterModel,
6493
+ search.debouncedValue,
6249
6494
  viewMode,
6250
6495
  groupBy,
6251
6496
  expandedRowIds,
@@ -6258,9 +6503,13 @@ function useDataTableController(props, ref) {
6258
6503
  defaultSnapshotRef.current = rest;
6259
6504
  }
6260
6505
  }, [persistedSnapshot, savedViews.currentViewId]);
6506
+ const persistedSnapshotForSave = React.useMemo(() => {
6507
+ const base = savedViews.currentViewId === null ? persistedSnapshot : { ...defaultSnapshotRef.current, lastActiveViewId: savedViews.currentViewId };
6508
+ return base;
6509
+ }, [persistedSnapshot, savedViews.currentViewId]);
6261
6510
  useDataTableStatePersistence({
6262
6511
  persistId: props.persistId,
6263
- state: persistedSnapshot
6512
+ state: persistedSnapshotForSave
6264
6513
  });
6265
6514
  const applyViewState = React.useCallback(
6266
6515
  (id, state) => {
@@ -6372,6 +6621,12 @@ function useDataTableController(props, ref) {
6372
6621
  setViewMode(snapshot.viewMode ?? "table");
6373
6622
  setGroupBy(snapshot.groupBy);
6374
6623
  setExpandedRowIds(snapshot.expandedRowIds ?? []);
6624
+ filters.setFilterModel(snapshot.filterModel ?? { items: [], logicOperator: "AND" });
6625
+ search.setInputValue(snapshot.search ?? "");
6626
+ pagination.setPaginationModel({
6627
+ page: snapshot.currentPage ?? 1,
6628
+ pageSize: snapshot.pageSize ?? pagination.paginationModel.pageSize
6629
+ });
6375
6630
  } else {
6376
6631
  density.setDensity("standard");
6377
6632
  sort.setSortModels([]);
@@ -6384,10 +6639,11 @@ function useDataTableController(props, ref) {
6384
6639
  setViewMode("table");
6385
6640
  setGroupBy(void 0);
6386
6641
  setExpandedRowIds([]);
6642
+ filters.setFilterModel({ items: [], logicOperator: "AND" });
6643
+ search.setInputValue("");
6387
6644
  }
6388
- filters.setFilterModel({ items: [], logicOperator: "AND" });
6389
6645
  savedViews.setCurrentViewId(null);
6390
- }, [props.persistId, props.columns, density, sort, filters, cols, setViewMode, setGroupBy, setExpandedRowIds, savedViews]);
6646
+ }, [props.persistId, props.columns, density, sort, filters, search, pagination, cols, setViewMode, setGroupBy, setExpandedRowIds, savedViews]);
6391
6647
  React.useImperativeHandle(ref, () => ({
6392
6648
  refresh: () => {
6393
6649
  if (isServerMode) query.refresh();
@@ -6443,6 +6699,8 @@ function useDataTableController(props, ref) {
6443
6699
  isLoading,
6444
6700
  isDataEmpty,
6445
6701
  isNoResults,
6702
+ /** Ref ao scroll container (compartilhado entre Table.scrollRef + useColumnAutoWidth). */
6703
+ scrollContainerRef,
6446
6704
  rowsToRender: effectiveRows,
6447
6705
  /** Todas as rows após filter/search/sort (sem paginate) — usado por totalizers
6448
6706
  * pra agregar sobre tudo, nao só pagina atual. Em server mode = current page. */
@@ -6490,7 +6748,7 @@ function DataTableEmpty({
6490
6748
  ),
6491
6749
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-gp-2xs items-center", children: [
6492
6750
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-title-md text-fg-strong", children: title2 }),
6493
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-paragraph-sm text-fg-muted max-w-[360px]", children: description })
6751
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-body-md text-fg-muted max-w-[360px]", children: description })
6494
6752
  ] }),
6495
6753
  action && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-pad-md", children: action })
6496
6754
  ] });
@@ -6586,7 +6844,7 @@ function DataTableNoResults({
6586
6844
  ),
6587
6845
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-gp-2xs items-center", children: [
6588
6846
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-title-md text-fg-strong", children: title2 }),
6589
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-paragraph-sm text-fg-muted max-w-[360px]", children: description })
6847
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-body-md text-fg-muted max-w-[360px]", children: description })
6590
6848
  ] }),
6591
6849
  resolvedAction && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-pad-md", children: resolvedAction })
6592
6850
  ] });
@@ -7028,7 +7286,7 @@ function DataTableTotalizerRow({
7028
7286
  pinOffset: stickyOffsets[field],
7029
7287
  align: col.align,
7030
7288
  ellipsis: col.ellipsis,
7031
- className: "text-label-sm text-fg-strong bg-bg-table-head",
7289
+ className: "text-body-md font-medium text-fg-strong bg-bg-table-head",
7032
7290
  children: content
7033
7291
  },
7034
7292
  field
@@ -7157,7 +7415,7 @@ function DataTableGroupHeaderRow({
7157
7415
  "data-field": field,
7158
7416
  className: chipGroup.cn(
7159
7417
  "shrink-0 flex items-center px-pad-2xl gap-gp-md",
7160
- "text-label-sm text-fg-strong",
7418
+ "text-body-md font-medium text-fg-strong",
7161
7419
  isPinned && "sticky z-[5] bg-bg-subtle"
7162
7420
  ),
7163
7421
  style: cellStyle,
@@ -7701,6 +7959,24 @@ const DEFAULT_VIEW_MODE_ITEMS = [
7701
7959
  { value: "table", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Table, {}), label: "Tabela" },
7702
7960
  { value: "kanban", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LayoutGrid, {}), label: "Kanban" }
7703
7961
  ];
7962
+ const MOBILE_VIEW_MODE_ITEMS = [
7963
+ {
7964
+ value: "table",
7965
+ label: "Tabela",
7966
+ children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-gp-sm", children: [
7967
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Table, {}),
7968
+ " Tabela"
7969
+ ] })
7970
+ },
7971
+ {
7972
+ value: "kanban",
7973
+ label: "Kanban",
7974
+ children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-gp-sm", children: [
7975
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LayoutGrid, {}),
7976
+ " Kanban"
7977
+ ] })
7978
+ }
7979
+ ];
7704
7980
  function resolveCellValue(row, col) {
7705
7981
  return applyValueGetter(row, col);
7706
7982
  }
@@ -7711,6 +7987,7 @@ function DataTableInternal(props, ref) {
7711
7987
  isLoading,
7712
7988
  isDataEmpty,
7713
7989
  isNoResults,
7990
+ scrollContainerRef,
7714
7991
  rowsToRender,
7715
7992
  rowsAllPagesProcessed,
7716
7993
  totalAfterFilter,
@@ -8105,7 +8382,6 @@ function DataTableInternal(props, ref) {
8105
8382
  rowsToRender,
8106
8383
  contextValue
8107
8384
  ]);
8108
- const scrollContainerRef = React.useRef(null);
8109
8385
  const defaultRowHeight = density.density === "compact" ? 40 : density.density === "comfortable" ? 64 : 56;
8110
8386
  const estimateRowHeight = props.estimateRowHeight ?? defaultRowHeight;
8111
8387
  const virtualize = props.virtualize === true;
@@ -8504,38 +8780,40 @@ function DataTableInternal(props, ref) {
8504
8780
  placeholder: "Buscar..."
8505
8781
  }
8506
8782
  ),
8507
- toolbarConfig.enableRefresh !== false && /* @__PURE__ */ jsxRuntime.jsx(
8508
- ToolbarToolButton,
8509
- {
8510
- icon: /* @__PURE__ */ jsxRuntime.jsx(
8511
- lucideReact.RefreshCw,
8512
- {
8513
- className: isRefreshing ? "animate-spin" : ""
8514
- }
8515
- ),
8516
- "aria-label": "Atualizar",
8517
- onClick: handleRefresh
8518
- }
8519
- ),
8520
- (resolvedViewToggle || props.persistId || toolbarConfig.customLeft) && /* @__PURE__ */ jsxRuntime.jsx(ToolbarDivider, {}),
8521
- resolvedViewToggle,
8522
- props.persistId && /* @__PURE__ */ jsxRuntime.jsx(
8523
- TableToolbarViews,
8524
- {
8525
- views: viewsForToolbar,
8526
- activeViewId: savedViews.currentViewId ?? void 0,
8527
- onApply: handleViewApply,
8528
- onApplyDefault: applyDefault,
8529
- onDelete: savedViews.deleteView,
8530
- onSave: async (data) => {
8531
- await saveCurrentAsView(data.name, {
8532
- isPublic: data.isPublic
8533
- });
8534
- },
8535
- hideDivider: true
8536
- }
8537
- ),
8538
- toolbarConfig.customLeft
8783
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hidden md:contents", children: [
8784
+ toolbarConfig.enableRefresh !== false && /* @__PURE__ */ jsxRuntime.jsx(
8785
+ ToolbarToolButton,
8786
+ {
8787
+ icon: /* @__PURE__ */ jsxRuntime.jsx(
8788
+ lucideReact.RefreshCw,
8789
+ {
8790
+ className: isRefreshing ? "animate-spin" : ""
8791
+ }
8792
+ ),
8793
+ "aria-label": "Atualizar",
8794
+ onClick: handleRefresh
8795
+ }
8796
+ ),
8797
+ (resolvedViewToggle || props.persistId || toolbarConfig.customLeft) && /* @__PURE__ */ jsxRuntime.jsx(ToolbarDivider, {}),
8798
+ resolvedViewToggle,
8799
+ props.persistId && /* @__PURE__ */ jsxRuntime.jsx(
8800
+ TableToolbarViews,
8801
+ {
8802
+ views: viewsForToolbar,
8803
+ activeViewId: savedViews.currentViewId ?? void 0,
8804
+ onApply: handleViewApply,
8805
+ onApplyDefault: applyDefault,
8806
+ onDelete: savedViews.deleteView,
8807
+ onSave: async (data) => {
8808
+ await saveCurrentAsView(data.name, {
8809
+ isPublic: data.isPublic
8810
+ });
8811
+ },
8812
+ hideDivider: true
8813
+ }
8814
+ ),
8815
+ toolbarConfig.customLeft
8816
+ ] })
8539
8817
  ] }),
8540
8818
  actions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8541
8819
  toolbarConfig.enableFilters !== false && filterPopoverColumns.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
@@ -8567,115 +8845,142 @@ function DataTableInternal(props, ref) {
8567
8845
  )
8568
8846
  }
8569
8847
  ),
8570
- /* @__PURE__ */ jsxRuntime.jsx(
8571
- SortPopover,
8572
- {
8573
- columns: sortPopoverColumns,
8574
- sortBy: sortPopoverCriteria,
8575
- onSortByChange: handleSortChange,
8576
- trigger: /* @__PURE__ */ jsxRuntime.jsx(
8577
- ToolbarToolButton,
8578
- {
8579
- icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpDown, {}),
8580
- "aria-label": "Ordenar",
8581
- hasIndicator: sortPopoverCriteria.length > 0
8582
- }
8583
- )
8584
- }
8585
- ),
8586
- toolbarConfig.enableColumns !== false && /* @__PURE__ */ jsxRuntime.jsx(
8587
- ColsPopover,
8588
- {
8589
- columns: colsPopoverColumns,
8590
- visibleCols: visibleColsSet,
8591
- onVisibleChange: handleVisibleChange,
8592
- pinnedCols: pinnedColsSet,
8593
- onPinnedChange: handlePinnedChange,
8594
- onColumnsReorder: handleColumnsReorder,
8595
- trigger: /* @__PURE__ */ jsxRuntime.jsx(
8596
- ToolbarToolButton,
8597
- {
8598
- icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Columns, {}),
8599
- "aria-label": "Colunas"
8600
- }
8601
- )
8602
- }
8603
- ),
8604
- toolbarConfig.enableDensity !== false && /* @__PURE__ */ jsxRuntime.jsx(ToolbarDivider, {}),
8605
- toolbarConfig.enableDensity !== false && /* @__PURE__ */ jsxRuntime.jsx(
8606
- ToolbarSegmented,
8607
- {
8608
- value: density.density,
8609
- onValueChange: (v) => density.setDensity(v),
8610
- items: props.densityItems ?? DENSITY_ITEMS,
8611
- ariaLabel: "Densidade da tabela"
8612
- }
8613
- ),
8614
- (exportConfig || toolbarConfig.moreMenu?.items?.length) && /* @__PURE__ */ jsxRuntime.jsx(ToolbarDivider, {}),
8615
- exportConfig && /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenu, { children: [
8616
- /* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
8617
- ToolbarToolButton,
8848
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hidden xl:contents", children: [
8849
+ /* @__PURE__ */ jsxRuntime.jsx(
8850
+ SortPopover,
8618
8851
  {
8619
- icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, {}),
8620
- label: "Exportar"
8852
+ columns: sortPopoverColumns,
8853
+ sortBy: sortPopoverCriteria,
8854
+ onSortByChange: handleSortChange,
8855
+ trigger: /* @__PURE__ */ jsxRuntime.jsx(
8856
+ ToolbarToolButton,
8857
+ {
8858
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpDown, {}),
8859
+ "aria-label": "Ordenar",
8860
+ hasIndicator: sortPopoverCriteria.length > 0
8861
+ }
8862
+ )
8621
8863
  }
8622
- ) }),
8623
- /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenuContent, { align: "end", children: [
8624
- exportConfig.formats.map((fmt) => {
8625
- const isCsvDefault = fmt.id === "csv" && !fmt.onSelect;
8626
- if (!isCsvDefault) {
8627
- return /* @__PURE__ */ jsxRuntime.jsxs(
8628
- appShell.DropdownMenuItem,
8629
- {
8630
- onClick: fmt.onSelect,
8631
- children: [
8632
- fmt.icon,
8633
- fmt.label
8634
- ]
8635
- },
8636
- fmt.id
8637
- );
8864
+ ),
8865
+ toolbarConfig.enableColumns !== false && /* @__PURE__ */ jsxRuntime.jsx(
8866
+ ColsPopover,
8867
+ {
8868
+ columns: colsPopoverColumns,
8869
+ visibleCols: visibleColsSet,
8870
+ onVisibleChange: handleVisibleChange,
8871
+ pinnedCols: pinnedColsSet,
8872
+ onPinnedChange: handlePinnedChange,
8873
+ onColumnsReorder: handleColumnsReorder,
8874
+ trigger: /* @__PURE__ */ jsxRuntime.jsx(
8875
+ ToolbarToolButton,
8876
+ {
8877
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Columns, {}),
8878
+ "aria-label": "Colunas"
8879
+ }
8880
+ )
8881
+ }
8882
+ ),
8883
+ toolbarConfig.enableDensity !== false && /* @__PURE__ */ jsxRuntime.jsx(ToolbarDivider, {}),
8884
+ toolbarConfig.enableDensity !== false && /* @__PURE__ */ jsxRuntime.jsx(
8885
+ ToolbarSegmented,
8886
+ {
8887
+ value: density.density,
8888
+ onValueChange: (v) => density.setDensity(v),
8889
+ items: props.densityItems ?? DENSITY_ITEMS,
8890
+ ariaLabel: "Densidade da tabela"
8891
+ }
8892
+ ),
8893
+ (exportConfig || toolbarConfig.moreMenu?.items?.length) && /* @__PURE__ */ jsxRuntime.jsx(ToolbarDivider, {}),
8894
+ exportConfig && /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenu, { children: [
8895
+ /* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
8896
+ ToolbarToolButton,
8897
+ {
8898
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, {}),
8899
+ label: "Exportar"
8638
8900
  }
8639
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
8640
- isServerMode ? /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenuItem, { onClick: () => exportHook.exportCsv("all"), children: [
8641
- fmt.icon,
8642
- fmt.label,
8643
- " Página atual"
8644
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8645
- /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenuItem, { onClick: () => exportHook.exportCsv("all"), children: [
8901
+ ) }),
8902
+ /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenuContent, { align: "end", children: [
8903
+ exportConfig.formats.map((fmt) => {
8904
+ const isCsvDefault = fmt.id === "csv" && !fmt.onSelect;
8905
+ if (!isCsvDefault) {
8906
+ return /* @__PURE__ */ jsxRuntime.jsxs(
8907
+ appShell.DropdownMenuItem,
8908
+ {
8909
+ onClick: fmt.onSelect,
8910
+ children: [
8911
+ fmt.icon,
8912
+ fmt.label
8913
+ ]
8914
+ },
8915
+ fmt.id
8916
+ );
8917
+ }
8918
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
8919
+ isServerMode ? /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenuItem, { onClick: () => exportHook.exportCsv("all"), children: [
8646
8920
  fmt.icon,
8647
8921
  fmt.label,
8648
- " — Todos"
8922
+ " — Página atual"
8923
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8924
+ /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenuItem, { onClick: () => exportHook.exportCsv("all"), children: [
8925
+ fmt.icon,
8926
+ fmt.label,
8927
+ " — Todos"
8928
+ ] }),
8929
+ /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenuItem, { onClick: () => exportHook.exportCsv("filtered"), children: [
8930
+ fmt.icon,
8931
+ fmt.label,
8932
+ " — Filtrados"
8933
+ ] })
8649
8934
  ] }),
8650
- /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenuItem, { onClick: () => exportHook.exportCsv("filtered"), children: [
8651
- fmt.icon,
8652
- fmt.label,
8653
- " Filtrados"
8654
- ] })
8655
- ] }),
8656
- /* @__PURE__ */ jsxRuntime.jsxs(
8935
+ /* @__PURE__ */ jsxRuntime.jsxs(
8936
+ appShell.DropdownMenuItem,
8937
+ {
8938
+ onClick: () => exportHook.exportCsv("selected"),
8939
+ disabled: selection.selectedCount === 0,
8940
+ children: [
8941
+ fmt.icon,
8942
+ fmt.label,
8943
+ " — Selecionados (",
8944
+ selection.selectedCount,
8945
+ ")"
8946
+ ]
8947
+ }
8948
+ )
8949
+ ] }, fmt.id);
8950
+ }),
8951
+ exportConfig.items.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8952
+ /* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuItem, { disabled: true, className: "opacity-50", children: "───" }),
8953
+ exportConfig.items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs(
8657
8954
  appShell.DropdownMenuItem,
8658
8955
  {
8659
- onClick: () => exportHook.exportCsv("selected"),
8660
- disabled: selection.selectedCount === 0,
8956
+ onClick: it.onSelect,
8957
+ disabled: it.disabled,
8661
8958
  children: [
8662
- fmt.icon,
8663
- fmt.label,
8664
- " — Selecionados (",
8665
- selection.selectedCount,
8666
- ")"
8959
+ it.icon,
8960
+ it.label
8667
8961
  ]
8668
- }
8669
- )
8670
- ] }, fmt.id);
8671
- }),
8672
- exportConfig.items.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8673
- /* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuItem, { disabled: true, className: "opacity-50", children: "───" }),
8674
- exportConfig.items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs(
8962
+ },
8963
+ it.id
8964
+ ))
8965
+ ] })
8966
+ ] })
8967
+ ] }),
8968
+ toolbarConfig.moreMenu?.items?.length ? /* @__PURE__ */ jsxRuntime.jsx(
8969
+ MoreMenu,
8970
+ {
8971
+ trigger: /* @__PURE__ */ jsxRuntime.jsx(
8972
+ ToolbarToolButton,
8973
+ {
8974
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, {}),
8975
+ "aria-label": "Mais opções"
8976
+ }
8977
+ ),
8978
+ children: toolbarConfig.moreMenu.items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs(
8675
8979
  appShell.DropdownMenuItem,
8676
8980
  {
8677
- onClick: it.onSelect,
8981
+ onSelect: it.onSelect,
8678
8982
  disabled: it.disabled,
8983
+ variant: it.destructive ? "destructive" : "default",
8679
8984
  children: [
8680
8985
  it.icon,
8681
8986
  it.label
@@ -8683,35 +8988,211 @@ function DataTableInternal(props, ref) {
8683
8988
  },
8684
8989
  it.id
8685
8990
  ))
8686
- ] })
8687
- ] })
8991
+ }
8992
+ ) : null,
8993
+ toolbarConfig.customActions
8688
8994
  ] }),
8689
- toolbarConfig.moreMenu?.items?.length ? /* @__PURE__ */ jsxRuntime.jsx(
8690
- MoreMenu,
8691
- {
8692
- trigger: /* @__PURE__ */ jsxRuntime.jsx(
8693
- ToolbarToolButton,
8995
+ /* @__PURE__ */ jsxRuntime.jsxs(ToolbarMobileDialog, { desktopBreakpoint: "xl", children: [
8996
+ (toolbarConfig.enableDensity !== false || resolvedViewToggle) && /* @__PURE__ */ jsxRuntime.jsxs(ToolbarMobileSection, { title: "Visualização", children: [
8997
+ toolbarConfig.enableDensity !== false && /* @__PURE__ */ jsxRuntime.jsx(
8998
+ ToolbarSegmented,
8694
8999
  {
8695
- icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, {}),
8696
- "aria-label": "Mais opções"
9000
+ fluid: true,
9001
+ value: density.density,
9002
+ onValueChange: (v) => density.setDensity(v),
9003
+ items: props.densityItems ?? DENSITY_ITEMS,
9004
+ ariaLabel: "Densidade da tabela"
8697
9005
  }
8698
9006
  ),
8699
- children: toolbarConfig.moreMenu.items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs(
8700
- appShell.DropdownMenuItem,
9007
+ resolvedViewToggle && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:hidden", children: props.kanbanConfig && props.toolbar?.viewToggle === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
9008
+ ToolbarSegmented,
8701
9009
  {
8702
- onSelect: it.onSelect,
8703
- disabled: it.disabled,
8704
- variant: it.destructive ? "destructive" : "default",
8705
- children: [
8706
- it.icon,
8707
- it.label
8708
- ]
8709
- },
8710
- it.id
8711
- ))
8712
- }
8713
- ) : null,
8714
- toolbarConfig.customActions
9010
+ fluid: true,
9011
+ value: viewMode,
9012
+ onValueChange: handleViewModeChange,
9013
+ items: MOBILE_VIEW_MODE_ITEMS,
9014
+ ariaLabel: "Modo de visualização"
9015
+ }
9016
+ ) : resolvedViewToggle })
9017
+ ] }),
9018
+ /* @__PURE__ */ jsxRuntime.jsxs(ToolbarMobileSection, { title: "Organizar", children: [
9019
+ /* @__PURE__ */ jsxRuntime.jsx(
9020
+ SortPopover,
9021
+ {
9022
+ columns: sortPopoverColumns,
9023
+ sortBy: sortPopoverCriteria,
9024
+ onSortByChange: handleSortChange,
9025
+ trigger: /* @__PURE__ */ jsxRuntime.jsxs(
9026
+ chipGroup.Button,
9027
+ {
9028
+ color: "secondary",
9029
+ variant: "outline",
9030
+ size: "md",
9031
+ fullWidth: true,
9032
+ iconLeft: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpDown, {}),
9033
+ className: "justify-start",
9034
+ children: [
9035
+ "Ordenar",
9036
+ sortPopoverCriteria.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto text-fg-muted", children: sortPopoverCriteria.length })
9037
+ ]
9038
+ }
9039
+ )
9040
+ }
9041
+ ),
9042
+ toolbarConfig.enableColumns !== false && /* @__PURE__ */ jsxRuntime.jsx(
9043
+ ColsPopover,
9044
+ {
9045
+ columns: colsPopoverColumns,
9046
+ visibleCols: visibleColsSet,
9047
+ onVisibleChange: handleVisibleChange,
9048
+ pinnedCols: pinnedColsSet,
9049
+ onPinnedChange: handlePinnedChange,
9050
+ onColumnsReorder: handleColumnsReorder,
9051
+ trigger: /* @__PURE__ */ jsxRuntime.jsx(
9052
+ chipGroup.Button,
9053
+ {
9054
+ color: "secondary",
9055
+ variant: "outline",
9056
+ size: "md",
9057
+ fullWidth: true,
9058
+ iconLeft: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Columns, {}),
9059
+ className: "justify-start",
9060
+ children: "Colunas"
9061
+ }
9062
+ )
9063
+ }
9064
+ )
9065
+ ] }),
9066
+ (toolbarConfig.enableRefresh !== false || exportConfig || toolbarConfig.moreMenu?.items?.length) && /* @__PURE__ */ jsxRuntime.jsxs(ToolbarMobileSection, { title: "Mais ações", children: [
9067
+ toolbarConfig.enableRefresh !== false && /* @__PURE__ */ jsxRuntime.jsx(
9068
+ chipGroup.Button,
9069
+ {
9070
+ color: "secondary",
9071
+ variant: "outline",
9072
+ size: "md",
9073
+ fullWidth: true,
9074
+ iconLeft: /* @__PURE__ */ jsxRuntime.jsx(
9075
+ lucideReact.RefreshCw,
9076
+ {
9077
+ className: isRefreshing ? "animate-spin" : ""
9078
+ }
9079
+ ),
9080
+ onClick: handleRefresh,
9081
+ className: "md:hidden justify-start",
9082
+ children: "Atualizar"
9083
+ }
9084
+ ),
9085
+ exportConfig && /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenu, { children: [
9086
+ /* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
9087
+ chipGroup.Button,
9088
+ {
9089
+ color: "secondary",
9090
+ variant: "outline",
9091
+ size: "md",
9092
+ fullWidth: true,
9093
+ iconLeft: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, {}),
9094
+ className: "justify-start",
9095
+ children: "Exportar"
9096
+ }
9097
+ ) }),
9098
+ /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenuContent, { align: "end", children: [
9099
+ exportConfig.formats.map((fmt) => {
9100
+ const isCsvDefault = fmt.id === "csv" && !fmt.onSelect;
9101
+ if (!isCsvDefault) {
9102
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9103
+ appShell.DropdownMenuItem,
9104
+ {
9105
+ onClick: fmt.onSelect,
9106
+ children: [
9107
+ fmt.icon,
9108
+ fmt.label
9109
+ ]
9110
+ },
9111
+ fmt.id
9112
+ );
9113
+ }
9114
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
9115
+ isServerMode ? /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenuItem, { onClick: () => exportHook.exportCsv("all"), children: [
9116
+ fmt.icon,
9117
+ fmt.label,
9118
+ " — Página atual"
9119
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9120
+ /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenuItem, { onClick: () => exportHook.exportCsv("all"), children: [
9121
+ fmt.icon,
9122
+ fmt.label,
9123
+ " — Todos"
9124
+ ] }),
9125
+ /* @__PURE__ */ jsxRuntime.jsxs(appShell.DropdownMenuItem, { onClick: () => exportHook.exportCsv("filtered"), children: [
9126
+ fmt.icon,
9127
+ fmt.label,
9128
+ " — Filtrados"
9129
+ ] })
9130
+ ] }),
9131
+ /* @__PURE__ */ jsxRuntime.jsxs(
9132
+ appShell.DropdownMenuItem,
9133
+ {
9134
+ onClick: () => exportHook.exportCsv("selected"),
9135
+ disabled: selection.selectedCount === 0,
9136
+ children: [
9137
+ fmt.icon,
9138
+ fmt.label,
9139
+ " — Selecionados (",
9140
+ selection.selectedCount,
9141
+ ")"
9142
+ ]
9143
+ }
9144
+ )
9145
+ ] }, fmt.id);
9146
+ }),
9147
+ exportConfig.items.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9148
+ /* @__PURE__ */ jsxRuntime.jsx(appShell.DropdownMenuItem, { disabled: true, className: "opacity-50", children: "───" }),
9149
+ exportConfig.items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs(
9150
+ appShell.DropdownMenuItem,
9151
+ {
9152
+ onClick: it.onSelect,
9153
+ disabled: it.disabled,
9154
+ children: [
9155
+ it.icon,
9156
+ it.label
9157
+ ]
9158
+ },
9159
+ it.id
9160
+ ))
9161
+ ] })
9162
+ ] })
9163
+ ] }),
9164
+ toolbarConfig.moreMenu?.items?.length ? /* @__PURE__ */ jsxRuntime.jsx(
9165
+ MoreMenu,
9166
+ {
9167
+ trigger: /* @__PURE__ */ jsxRuntime.jsx(
9168
+ chipGroup.Button,
9169
+ {
9170
+ color: "secondary",
9171
+ variant: "outline",
9172
+ size: "md",
9173
+ fullWidth: true,
9174
+ iconLeft: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, {}),
9175
+ className: "justify-start",
9176
+ children: "Mais ações"
9177
+ }
9178
+ ),
9179
+ children: toolbarConfig.moreMenu.items.map((it) => /* @__PURE__ */ jsxRuntime.jsxs(
9180
+ appShell.DropdownMenuItem,
9181
+ {
9182
+ onSelect: it.onSelect,
9183
+ disabled: it.disabled,
9184
+ variant: it.destructive ? "destructive" : "default",
9185
+ children: [
9186
+ it.icon,
9187
+ it.label
9188
+ ]
9189
+ },
9190
+ it.id
9191
+ ))
9192
+ }
9193
+ ) : null
9194
+ ] })
9195
+ ] })
8715
9196
  ] }),
8716
9197
  bulkBar: selectionConfig.enabled && selection.selectedCount > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
8717
9198
  BulkActionsBar,
@@ -8837,7 +9318,7 @@ function DataTableFloatingBulkBar({
8837
9318
  }) {
8838
9319
  if (count === 0) return null;
8839
9320
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.bulkBar(), role: "region", "aria-label": "Acoes em massa", children: [
8840
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-label-sm whitespace-nowrap", children: [
9321
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-body-md font-medium whitespace-nowrap", children: [
8841
9322
  count,
8842
9323
  " selecionado",
8843
9324
  count > 1 ? "s" : ""
@@ -8933,10 +9414,10 @@ const floatingPanelStyles = chipGroup.tv({
8933
9414
  headerText: "flex flex-col gap-gp-2xs min-w-0 flex-1",
8934
9415
  headerTitle: [
8935
9416
  "flex items-center gap-gp-md min-w-0",
8936
- "text-[16px] font-bold tracking-[-0.01em] text-fg-default truncate"
9417
+ "text-body-lg font-bold tracking-[-0.01em] text-fg-default truncate"
8937
9418
  ],
8938
9419
  headerTitleIcon: "size-[18px] text-fg-brand shrink-0",
8939
- headerDescription: "text-paragraph-sm text-fg-muted truncate",
9420
+ headerDescription: "text-body-md text-fg-muted truncate",
8940
9421
  headerActions: "flex items-center gap-gp-xs flex-none",
8941
9422
  body: [
8942
9423
  "flex-1 overflow-y-auto scrollbar-thin"
@@ -9167,7 +9648,7 @@ const textareaVariants = classVarianceAuthority.cva(
9167
9648
  "hover:bg-bg-input-hover dark:hover:bg-bg-muted-hover",
9168
9649
  "border border-border-input rounded-radius-lg",
9169
9650
  "px-pad-xl py-pad-lg",
9170
- "text-[13px] leading-[1.5] text-fg-default",
9651
+ "text-body-sm font-normal leading-[1.5] text-fg-default",
9171
9652
  "placeholder:text-fg-muted placeholder:opacity-70",
9172
9653
  "transition-[color,box-shadow,background-color,border-color] outline-none",
9173
9654
  "disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-bg-input dark:disabled:hover:bg-bg-muted"
@@ -9480,7 +9961,7 @@ const SheetTitle = React__namespace.forwardRef(({ className, ...props }, ref) =>
9480
9961
  SheetPrimitive__namespace.Title,
9481
9962
  {
9482
9963
  ref,
9483
- className: chipGroup.cn("text-label-md font-semibold text-fg-default", className),
9964
+ className: chipGroup.cn("text-body-lg font-medium font-semibold text-fg-default", className),
9484
9965
  ...props
9485
9966
  }
9486
9967
  ));
@@ -9489,7 +9970,7 @@ const SheetDescription = React__namespace.forwardRef(({ className, ...props }, r
9489
9970
  SheetPrimitive__namespace.Description,
9490
9971
  {
9491
9972
  ref,
9492
- className: chipGroup.cn("text-paragraph-sm text-fg-muted", className),
9973
+ className: chipGroup.cn("text-body-md text-fg-muted", className),
9493
9974
  ...props
9494
9975
  }
9495
9976
  ));
@@ -9538,7 +10019,7 @@ const panelHeaderText = chipGroup.tv({
9538
10019
  const panelTitle = chipGroup.tv({
9539
10020
  base: [
9540
10021
  "flex items-center gap-gp-md min-w-0",
9541
- "text-[16px] font-bold text-fg-default tracking-[-0.01em]",
10022
+ "text-body-lg font-bold text-fg-default tracking-[-0.01em]",
9542
10023
  "truncate"
9543
10024
  ]
9544
10025
  });
@@ -9546,7 +10027,7 @@ const panelTitleIcon = chipGroup.tv({
9546
10027
  base: "size-[18px] text-fg-brand shrink-0"
9547
10028
  });
9548
10029
  const panelDescription = chipGroup.tv({
9549
- base: "text-paragraph-sm text-fg-muted"
10030
+ base: "text-body-md text-fg-muted"
9550
10031
  });
9551
10032
  const panelClose = chipGroup.tv({
9552
10033
  base: [
@@ -9719,6 +10200,9 @@ exports.TableToolbar = TableToolbar;
9719
10200
  exports.TableToolbarViews = TableToolbarViews;
9720
10201
  exports.ToolbarApplied = ToolbarApplied;
9721
10202
  exports.ToolbarDivider = ToolbarDivider;
10203
+ exports.ToolbarMobileDialog = ToolbarMobileDialog;
10204
+ exports.ToolbarMobileSection = ToolbarMobileSection;
10205
+ exports.ToolbarMobileSheet = ToolbarMobileSheet;
9722
10206
  exports.ToolbarSaveButton = ToolbarSaveButton;
9723
10207
  exports.ToolbarSearch = ToolbarSearch;
9724
10208
  exports.ToolbarSegmented = ToolbarSegmented;
@@ -9734,4 +10218,4 @@ exports.savedViewsMockService = savedViewsMockService;
9734
10218
  exports.useColumnWidths = useColumnWidths;
9735
10219
  exports.useDataTableContext = useDataTableContext;
9736
10220
  exports.useFloatingPanelResize = useFloatingPanelResize;
9737
- //# sourceMappingURL=panel-CEGA_98Q.cjs.map
10221
+ //# sourceMappingURL=panel-CSuFQHMl.cjs.map