@snksergio/design-system 0.44.0 → 0.46.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 (54) hide show
  1. package/README.md +1 -1
  2. package/dist-lib/chunks/{kpi-delta-B_1xjDu_.mjs → kpi-delta-DuxCD93G.mjs} +2 -2
  3. package/dist-lib/chunks/{kpi-delta-B_1xjDu_.mjs.map → kpi-delta-DuxCD93G.mjs.map} +1 -1
  4. package/dist-lib/chunks/{kpi-delta-CXGg2nBx.cjs → kpi-delta-DwQWNM-F.cjs} +2 -2
  5. package/dist-lib/chunks/{kpi-delta-CXGg2nBx.cjs.map → kpi-delta-DwQWNM-F.cjs.map} +1 -1
  6. package/dist-lib/chunks/{panel-CCPe1H70.mjs → panel-BxYvTvlN.mjs} +30 -9
  7. package/dist-lib/chunks/panel-BxYvTvlN.mjs.map +1 -0
  8. package/dist-lib/chunks/{panel-CvfP8eP1.cjs → panel-DTVjD2gJ.cjs} +30 -9
  9. package/dist-lib/chunks/panel-DTVjD2gJ.cjs.map +1 -0
  10. package/dist-lib/chunks/{toggle-group-CFiAGdm7.mjs → toggle-group-DPzjrk6O.mjs} +29 -6
  11. package/dist-lib/chunks/{toggle-group-BC4eS3Gt.cjs.map → toggle-group-DPzjrk6O.mjs.map} +1 -1
  12. package/dist-lib/chunks/{toggle-group-BC4eS3Gt.cjs → toggle-group-FJHFIlJP.cjs} +29 -6
  13. package/dist-lib/chunks/{toggle-group-CFiAGdm7.mjs.map → toggle-group-FJHFIlJP.cjs.map} +1 -1
  14. package/dist-lib/chunks/{useTheme-C9Y6vxTf.cjs → useTheme-BB3QhUpu.cjs} +5 -2
  15. package/dist-lib/chunks/useTheme-BB3QhUpu.cjs.map +1 -0
  16. package/dist-lib/chunks/{useTheme-DCmzLBUR.mjs → useTheme-CS_no6zP.mjs} +5 -2
  17. package/dist-lib/chunks/useTheme-CS_no6zP.mjs.map +1 -0
  18. package/dist-lib/index.cjs +164 -96
  19. package/dist-lib/index.cjs.map +1 -1
  20. package/dist-lib/index.mjs +168 -100
  21. package/dist-lib/index.mjs.map +1 -1
  22. package/dist-lib/preview/chat.cjs +1 -1
  23. package/dist-lib/preview/chat.mjs +1 -1
  24. package/dist-lib/preview/clientes.cjs +2 -2
  25. package/dist-lib/preview/clientes.mjs +2 -2
  26. package/dist-lib/preview/dashboard.cjs +2 -2
  27. package/dist-lib/preview/dashboard.mjs +2 -2
  28. package/dist-lib/shadcn.cjs +1 -1
  29. package/dist-lib/shadcn.mjs +1 -1
  30. package/dist-lib/src/components/shadcn/tabs.d.ts +40 -8
  31. package/dist-lib/src/components/shadcn/tabs.d.ts.map +1 -1
  32. package/dist-lib/src/components/ui/AppShell/app-shell.types.d.ts +10 -3
  33. package/dist-lib/src/components/ui/AppShell/app-shell.types.d.ts.map +1 -1
  34. package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.d.ts.map +1 -1
  35. package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.styles.d.ts +24 -6
  36. package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.styles.d.ts.map +1 -1
  37. package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.types.d.ts +11 -2
  38. package/dist-lib/src/components/ui/ChoroplethMap/choropleth-map.types.d.ts.map +1 -1
  39. package/dist-lib/src/components/ui/DataTable/hooks/use-grab-to-scroll.d.ts.map +1 -1
  40. package/dist-lib/src/components/ui/FormField/form-field-select.d.ts.map +1 -1
  41. package/dist-lib/src/components/ui/MenuSidebar/sidebar-brand.d.ts +15 -0
  42. package/dist-lib/src/components/ui/MenuSidebar/sidebar-brand.d.ts.map +1 -1
  43. package/dist-lib/src/components/ui/MessageBubble/message-bubble.d.ts.map +1 -1
  44. package/dist-lib/src/components/ui/MessageBubble/message-bubble.styles.d.ts.map +1 -1
  45. package/dist-lib/src/components/ui/MessageComposer/message-composer.styles.d.ts +9 -3
  46. package/dist-lib/src/components/ui/MessageComposer/message-composer.styles.d.ts.map +1 -1
  47. package/dist-lib/src/components/ui/SingleMenuSidebar/header.d.ts.map +1 -1
  48. package/dist-lib/src/components/ui/SingleMenuSidebar/single-menu-sidebar.types.d.ts +8 -4
  49. package/dist-lib/src/components/ui/SingleMenuSidebar/single-menu-sidebar.types.d.ts.map +1 -1
  50. package/package.json +4 -2
  51. package/dist-lib/chunks/panel-CCPe1H70.mjs.map +0 -1
  52. package/dist-lib/chunks/panel-CvfP8eP1.cjs.map +0 -1
  53. package/dist-lib/chunks/useTheme-C9Y6vxTf.cjs.map +0 -1
  54. package/dist-lib/chunks/useTheme-DCmzLBUR.mjs.map +0 -1
@@ -3,14 +3,14 @@ var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  const jsxRuntime = require("react/jsx-runtime");
6
- const sheet = require("./sheet-j-d_UX7R.cjs");
7
6
  const React = require("react");
7
+ const sheet = require("./sheet-j-d_UX7R.cjs");
8
8
  const core = require("@dnd-kit/core");
9
9
  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-C9Y6vxTf.cjs");
13
+ const useTheme = require("./useTheme-BB3QhUpu.cjs");
14
14
  const input = require("./input-az2SuVXQ.cjs");
15
15
  const reactDom = require("react-dom");
16
16
  const dnd = require("@hello-pangea/dnd");
@@ -518,6 +518,7 @@ const FormFieldTextarea = React.forwardRef(
518
518
  )
519
519
  );
520
520
  FormFieldTextarea.displayName = "FormFieldTextarea";
521
+ const SENTINELA_VAZIO = "__ds_select_vazio__";
521
522
  function FormFieldSelect({
522
523
  label,
523
524
  required,
@@ -537,6 +538,13 @@ function FormFieldSelect({
537
538
  triggerClassName,
538
539
  contentClassName
539
540
  }) {
541
+ const abertoRef = React.useRef(false);
542
+ const valorEhOrfao = value !== void 0 && value !== "" && !options.some((opt) => opt.value === value);
543
+ const paraRadix = (v) => v === "" ? SENTINELA_VAZIO : v;
544
+ const aoMudarValor = (proximo) => {
545
+ if (proximo === "" && valorEhOrfao && !abertoRef.current) return;
546
+ onValueChange?.(proximo === SENTINELA_VAZIO ? "" : proximo);
547
+ };
540
548
  return /* @__PURE__ */ jsxRuntime.jsx(
541
549
  FormField,
542
550
  {
@@ -553,9 +561,12 @@ function FormFieldSelect({
553
561
  children: ({ id: fieldId, state: fieldState }) => /* @__PURE__ */ jsxRuntime.jsxs(
554
562
  sheet.Select,
555
563
  {
556
- value,
557
- defaultValue,
558
- onValueChange,
564
+ value: paraRadix(value),
565
+ defaultValue: paraRadix(defaultValue),
566
+ onValueChange: aoMudarValor,
567
+ onOpenChange: (aberto) => {
568
+ abertoRef.current = aberto;
569
+ },
559
570
  disabled,
560
571
  children: [
561
572
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -570,7 +581,7 @@ function FormFieldSelect({
570
581
  /* @__PURE__ */ jsxRuntime.jsx(sheet.SelectContent, { className: contentClassName, children: options.map((opt) => /* @__PURE__ */ jsxRuntime.jsx(
571
582
  sheet.SelectItem,
572
583
  {
573
- value: opt.value,
584
+ value: paraRadix(opt.value),
574
585
  disabled: opt.disabled,
575
586
  children: opt.label
576
587
  },
@@ -9635,7 +9646,16 @@ function useGrabToScroll(scrollContainerRef, enabled, thresholdPx = 6) {
9635
9646
  ].join(",");
9636
9647
  const prevCursor = scroller.style.cursor;
9637
9648
  const prevUserSelect = scroller.style.userSelect;
9638
- scroller.style.cursor = "grab";
9649
+ const syncCursor = () => {
9650
+ const rolavel = scroller.scrollWidth > scroller.clientWidth;
9651
+ scroller.style.cursor = rolavel ? "grab" : prevCursor;
9652
+ };
9653
+ syncCursor();
9654
+ const ro = typeof ResizeObserver === "function" ? new ResizeObserver(syncCursor) : null;
9655
+ if (ro) {
9656
+ ro.observe(scroller);
9657
+ if (scroller.firstElementChild) ro.observe(scroller.firstElementChild);
9658
+ }
9639
9659
  let isPointerDown = false;
9640
9660
  let isDragging = false;
9641
9661
  let activePointerId = null;
@@ -9687,7 +9707,7 @@ function useGrabToScroll(scrollContainerRef, enabled, thresholdPx = 6) {
9687
9707
  isPointerDown = false;
9688
9708
  isDragging = false;
9689
9709
  activePointerId = null;
9690
- scroller.style.cursor = "grab";
9710
+ syncCursor();
9691
9711
  scroller.style.userSelect = prevUserSelect;
9692
9712
  try {
9693
9713
  scroller.releasePointerCapture(event.pointerId);
@@ -9705,6 +9725,7 @@ function useGrabToScroll(scrollContainerRef, enabled, thresholdPx = 6) {
9705
9725
  scroller.removeEventListener("pointermove", onPointerMove);
9706
9726
  scroller.removeEventListener("pointerup", finish);
9707
9727
  scroller.removeEventListener("pointercancel", finish);
9728
+ ro?.disconnect();
9708
9729
  scroller.style.cursor = prevCursor;
9709
9730
  scroller.style.userSelect = prevUserSelect;
9710
9731
  };
@@ -13060,4 +13081,4 @@ exports.useColumnResize = useColumnResize;
13060
13081
  exports.useColumnWidths = useColumnWidths;
13061
13082
  exports.useDataTableContext = useDataTableContext;
13062
13083
  exports.useFloatingPanelResize = useFloatingPanelResize;
13063
- //# sourceMappingURL=panel-CvfP8eP1.cjs.map
13084
+ //# sourceMappingURL=panel-DTVjD2gJ.cjs.map