@snksergio/design-system 0.42.1 → 0.43.1

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 (37) hide show
  1. package/dist-lib/chunks/{kpi-delta-DaDwKOaP.mjs → kpi-delta-B_1xjDu_.mjs} +2 -2
  2. package/dist-lib/chunks/{kpi-delta-DaDwKOaP.mjs.map → kpi-delta-B_1xjDu_.mjs.map} +1 -1
  3. package/dist-lib/chunks/{kpi-delta-DAfakvFp.cjs → kpi-delta-CXGg2nBx.cjs} +2 -2
  4. package/dist-lib/chunks/{kpi-delta-DAfakvFp.cjs.map → kpi-delta-CXGg2nBx.cjs.map} +1 -1
  5. package/dist-lib/chunks/{panel-CMRliQb2.mjs → panel-BhXMif_f.mjs} +38 -13
  6. package/dist-lib/chunks/panel-BhXMif_f.mjs.map +1 -0
  7. package/dist-lib/chunks/{panel-BSyHW2J5.cjs → panel-D43Xnc-N.cjs} +38 -13
  8. package/dist-lib/chunks/panel-D43Xnc-N.cjs.map +1 -0
  9. package/dist-lib/chunks/{useTheme-3iZAognE.cjs → useTheme-C9Y6vxTf.cjs} +103 -52
  10. package/dist-lib/chunks/useTheme-C9Y6vxTf.cjs.map +1 -0
  11. package/dist-lib/chunks/{useTheme-B3ZakPqk.mjs → useTheme-DCmzLBUR.mjs} +103 -52
  12. package/dist-lib/chunks/{useTheme-3iZAognE.cjs.map → useTheme-DCmzLBUR.mjs.map} +1 -1
  13. package/dist-lib/index.cjs +3 -3
  14. package/dist-lib/index.mjs +5 -5
  15. package/dist-lib/preview/chat.cjs +1 -1
  16. package/dist-lib/preview/chat.mjs +1 -1
  17. package/dist-lib/preview/clientes.cjs +7 -13
  18. package/dist-lib/preview/clientes.cjs.map +1 -1
  19. package/dist-lib/preview/clientes.mjs +7 -13
  20. package/dist-lib/preview/clientes.mjs.map +1 -1
  21. package/dist-lib/preview/dashboard.cjs +2 -2
  22. package/dist-lib/preview/dashboard.mjs +2 -2
  23. package/dist-lib/src/components/ui/DataTable/column-types/definitions/date-column-type.d.ts.map +1 -1
  24. package/dist-lib/src/components/ui/DataTable/column-types/definitions/datetime-column-type.d.ts.map +1 -1
  25. package/dist-lib/src/components/ui/DataTable/data-table.types.d.ts +3 -1
  26. package/dist-lib/src/components/ui/DataTable/data-table.types.d.ts.map +1 -1
  27. package/dist-lib/src/components/ui/DataTable/utils/calculate-column-widths.d.ts.map +1 -1
  28. package/dist-lib/src/components/ui/SingleMenuSidebar/single-menu-sidebar.d.ts.map +1 -1
  29. package/dist-lib/src/components/ui/SingleMenuSidebar/single-menu-sidebar.styles.d.ts +82 -3
  30. package/dist-lib/src/components/ui/SingleMenuSidebar/single-menu-sidebar.styles.d.ts.map +1 -1
  31. package/dist-lib/src/components/ui/TableToolbar/parts/table-toolbar-views.d.ts.map +1 -1
  32. package/dist-lib/src/preview/pages/ChatV2/components/FiltersColumn/filters-column.styles.d.ts +3 -3
  33. package/dist-lib/src/preview/pages/ClientesShowcase/ClientesShowcase.d.ts.map +1 -1
  34. package/package.json +2 -2
  35. package/dist-lib/chunks/panel-BSyHW2J5.cjs.map +0 -1
  36. package/dist-lib/chunks/panel-CMRliQb2.mjs.map +0 -1
  37. package/dist-lib/chunks/useTheme-B3ZakPqk.mjs.map +0 -1
@@ -10,7 +10,7 @@ const sortable = require("@dnd-kit/sortable");
10
10
  const reactVirtual = require("@tanstack/react-virtual");
11
11
  const avatar = require("./avatar-eM5txRFZ.cjs");
12
12
  const lucideReact = require("lucide-react");
13
- const useTheme = require("./useTheme-3iZAognE.cjs");
13
+ const useTheme = require("./useTheme-C9Y6vxTf.cjs");
14
14
  const input = require("./input-az2SuVXQ.cjs");
15
15
  const reactDom = require("react-dom");
16
16
  const dnd = require("@hello-pangea/dnd");
@@ -3167,6 +3167,10 @@ function TableToolbarViews({
3167
3167
  []
3168
3168
  );
3169
3169
  const [tabViewIds, setTabViewIds] = React.useState(initialIds);
3170
+ React.useRef(null);
3171
+ React.useEffect(() => {
3172
+ return;
3173
+ }, [views, maxCustomTabs, maxTabs, myOwnerKey]);
3170
3174
  const prevIdsRef = React.useRef(views.map((v) => v.id));
3171
3175
  React.useEffect(() => {
3172
3176
  const currentIds = views.map((v) => v.id);
@@ -4712,14 +4716,24 @@ const NumberColumnType = {
4712
4716
  defaultSortable: true,
4713
4717
  defaultIcon: lucideReact.Hash
4714
4718
  };
4715
- const ptBrShort$1 = new Intl.DateTimeFormat("pt-BR", {
4719
+ const ptBrData = new Intl.DateTimeFormat("pt-BR", {
4720
+ day: "2-digit",
4721
+ month: "2-digit",
4722
+ year: "numeric"
4723
+ });
4724
+ const ptBrCompacto = new Intl.DateTimeFormat("pt-BR", {
4716
4725
  day: "2-digit",
4717
4726
  month: "short"
4718
4727
  });
4728
+ function formatData(v) {
4729
+ const d = toDate(v);
4730
+ if (!d) return "";
4731
+ return ptBrData.format(d);
4732
+ }
4719
4733
  function formatShort$1(v) {
4720
4734
  const d = toDate(v);
4721
4735
  if (!d) return "";
4722
- return ptBrShort$1.format(d).replace(".", "");
4736
+ return ptBrCompacto.format(d).replace(".", "");
4723
4737
  }
4724
4738
  const DateColumnType = {
4725
4739
  type: "date",
@@ -4845,8 +4859,16 @@ const DateColumnType = {
4845
4859
  return null;
4846
4860
  },
4847
4861
  /* G.2 slots */
4848
- renderCell: ({ value }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-fg-muted tabular-nums", children: formatShort$1(value) }),
4849
- formatValue: (v) => formatShort$1(v),
4862
+ // `column.valueFormatter` vence o formato do tipo — é o escape hatch pra quem quer
4863
+ // outro formato (mês escrito, ISO, relativo) sem escrever `render` inteiro.
4864
+ //
4865
+ // Isso é o que o próprio `CellRenderProps` já prometia: o campo `column` existe ali
4866
+ // com o comentário "campos auxiliares como valueFormatter", e o JSDoc de `formatValue`
4867
+ // diz "aplicado quando consumer não passa `column.valueFormatter`". Nenhum column-type
4868
+ // lia esse campo, então na prática `valueFormatter` num `type: "date"` mudava export,
4869
+ // totalizador e clipboard e **não mudava a célula** — a doc afirmava o contrário.
4870
+ renderCell: ({ value, column: column2 }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-fg-muted tabular-nums", children: column2?.valueFormatter ? column2.valueFormatter(value) : formatData(value) }),
4871
+ formatValue: (v) => formatData(v),
4850
4872
  defaultAlign: "left",
4851
4873
  defaultWidth: 130,
4852
4874
  defaultSortable: true,
@@ -5742,9 +5764,10 @@ const ptBrShort = new Intl.DateTimeFormat("pt-BR", {
5742
5764
  day: "2-digit",
5743
5765
  month: "short"
5744
5766
  });
5745
- const ptBrShortTime = new Intl.DateTimeFormat("pt-BR", {
5767
+ const ptBrDataHora = new Intl.DateTimeFormat("pt-BR", {
5746
5768
  day: "2-digit",
5747
- month: "short",
5769
+ month: "2-digit",
5770
+ year: "numeric",
5748
5771
  hour: "2-digit",
5749
5772
  minute: "2-digit"
5750
5773
  });
@@ -5753,10 +5776,10 @@ function formatShort(v) {
5753
5776
  if (!d) return "";
5754
5777
  return ptBrShort.format(d).replace(".", "");
5755
5778
  }
5756
- function formatShortTime(v) {
5779
+ function formatDataHora(v) {
5757
5780
  const d = toDate(v);
5758
5781
  if (!d) return "";
5759
- return ptBrShortTime.format(d).replace(".", "");
5782
+ return ptBrDataHora.format(d).replace(",", "");
5760
5783
  }
5761
5784
  const DatetimeColumnType = {
5762
5785
  type: "datetime",
@@ -5869,8 +5892,9 @@ const DatetimeColumnType = {
5869
5892
  if (operator === "lte") return cellDay <= filterDay;
5870
5893
  return null;
5871
5894
  },
5872
- renderCell: ({ value }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-fg-muted tabular-nums", children: formatShortTime(value) }),
5873
- formatValue: (v) => formatShortTime(v),
5895
+ // `column.valueFormatter` vence o formato do tipo — mesmo escape hatch do `date`.
5896
+ renderCell: ({ value, column: column2 }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-fg-muted tabular-nums", children: column2?.valueFormatter ? column2.valueFormatter(value) : formatDataHora(value) }),
5897
+ formatValue: (v) => formatDataHora(v),
5874
5898
  defaultAlign: "left",
5875
5899
  defaultWidth: 160,
5876
5900
  defaultSortable: true,
@@ -8170,6 +8194,7 @@ function calculateColumnWidths(columns, rows, options) {
8170
8194
  growable = stillGrowable;
8171
8195
  if (consumedThisPass < 0.5) break;
8172
8196
  }
8197
+ const larguraFixa = columns.filter(isFixed).reduce((soma, col) => soma + (widths[String(col.field)] ?? 0), 0);
8173
8198
  let lastFlexField;
8174
8199
  let roundedTotal = 0;
8175
8200
  for (const col of targets) {
@@ -8180,7 +8205,7 @@ function calculateColumnWidths(columns, rows, options) {
8180
8205
  if (!maxed) lastFlexField = f;
8181
8206
  }
8182
8207
  if (lastFlexField !== void 0) {
8183
- const residue = Math.round(containerWidth) - roundedTotal;
8208
+ const residue = Math.round(containerWidth) - larguraFixa - roundedTotal;
8184
8209
  if (residue !== 0) {
8185
8210
  widths[lastFlexField] = Math.max(0, widths[lastFlexField] + residue);
8186
8211
  }
@@ -13016,4 +13041,4 @@ exports.useColumnResize = useColumnResize;
13016
13041
  exports.useColumnWidths = useColumnWidths;
13017
13042
  exports.useDataTableContext = useDataTableContext;
13018
13043
  exports.useFloatingPanelResize = useFloatingPanelResize;
13019
- //# sourceMappingURL=panel-BSyHW2J5.cjs.map
13044
+ //# sourceMappingURL=panel-D43Xnc-N.cjs.map