@giro-ds/react 4.0.0 → 5.0.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 (145) hide show
  1. package/dist/dts-temp/components/Calendar/Calendar.d.ts +3 -0
  2. package/dist/dts-temp/components/Calendar/Calendar.types.d.ts +55 -0
  3. package/dist/{components → dts-temp/components}/DatePicker/DatePicker.types.d.ts +5 -3
  4. package/dist/dts-temp/components/DatePicker/Utils/DateUtils.d.ts +6 -0
  5. package/dist/{components → dts-temp/components}/Dialog/Dialog.types.d.ts +3 -4
  6. package/dist/dts-temp/components/Drawer/Drawer.d.ts +4 -0
  7. package/dist/{components → dts-temp/components}/Drawer/Drawer.types.d.ts +2 -0
  8. package/dist/{components → dts-temp/components}/Filter/Filter.types.d.ts +15 -6
  9. package/dist/dts-temp/components/Filter/index.d.ts +2 -0
  10. package/dist/dts-temp/components/Popover/Popover.types.d.ts +25 -0
  11. package/dist/{components → dts-temp/components}/Table/TableHeader.d.ts +5 -3
  12. package/dist/dts-temp/components/TextArea/TextArea.d.ts +4 -0
  13. package/dist/dts-temp/components/TextArea/TextArea.types.d.ts +56 -0
  14. package/dist/dts-temp/components/TextArea/index.d.ts +2 -0
  15. package/dist/{components → dts-temp/components}/TextField/TextField.types.d.ts +9 -1
  16. package/dist/dts-temp/components/TextField/utils/__tests__/validation.test.d.ts +1 -0
  17. package/dist/dts-temp/components/Toast/__tests__/Toast.test.d.ts +1 -0
  18. package/dist/dts-temp/components/Tooltip/__tests__/Tooltip.test.d.ts +1 -0
  19. package/dist/{components → dts-temp/components}/index.d.ts +2 -2
  20. package/dist/dts-temp/index.d.ts +1 -0
  21. package/dist/index.cjs +429 -703
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.esm.js +431 -705
  24. package/dist/index.esm.js.map +1 -1
  25. package/dist/styles.css +1 -1
  26. package/package.json +1 -1
  27. package/dist/components/Calendar/Calendar.d.ts +0 -3
  28. package/dist/components/Calendar/Calendar.types.d.ts +0 -109
  29. package/dist/components/DatePicker/DateUtils.d.ts +0 -23
  30. package/dist/components/Drawer/Drawer.d.ts +0 -9
  31. package/dist/components/Dropdown/Dropdown.d.ts +0 -4
  32. package/dist/components/Dropdown/Dropdown.types.d.ts +0 -91
  33. package/dist/components/Dropdown/DropdownUtils.d.ts +0 -8
  34. package/dist/components/Dropdown/index.d.ts +0 -2
  35. package/dist/components/Filter/index.d.ts +0 -2
  36. package/dist/components/Popover/Popover.types.d.ts +0 -8
  37. package/dist/index.d.ts +0 -1618
  38. /package/dist/{components → dts-temp/components}/Avatar/Avatar.d.ts +0 -0
  39. /package/dist/{components → dts-temp/components}/Avatar/Avatar.types.d.ts +0 -0
  40. /package/dist/{components → dts-temp/components}/Avatar/__tests__/Avatar.test.d.ts +0 -0
  41. /package/dist/{components → dts-temp/components}/Avatar/index.d.ts +0 -0
  42. /package/dist/{components → dts-temp/components}/Badge/Badge.d.ts +0 -0
  43. /package/dist/{components → dts-temp/components}/Badge/Badge.types.d.ts +0 -0
  44. /package/dist/{components → dts-temp/components}/Badge/index.d.ts +0 -0
  45. /package/dist/{components → dts-temp/components}/Button/Button.d.ts +0 -0
  46. /package/dist/{components → dts-temp/components}/Button/Button.types.d.ts +0 -0
  47. /package/dist/{components → dts-temp/components}/Button/__tests__/Button.test.d.ts +0 -0
  48. /package/dist/{components → dts-temp/components}/Button/index.d.ts +0 -0
  49. /package/dist/{components → dts-temp/components}/Calendar/__tests__/Calendar.test.d.ts +0 -0
  50. /package/dist/{components → dts-temp/components}/Calendar/index.d.ts +0 -0
  51. /package/dist/{components → dts-temp/components}/Callout/Callout.d.ts +0 -0
  52. /package/dist/{components → dts-temp/components}/Callout/Callout.types.d.ts +0 -0
  53. /package/dist/{components → dts-temp/components}/Callout/index.d.ts +0 -0
  54. /package/dist/{components → dts-temp/components}/Checkbox/Checkbox.d.ts +0 -0
  55. /package/dist/{components → dts-temp/components}/Checkbox/Checkbox.types.d.ts +0 -0
  56. /package/dist/{components → dts-temp/components}/Checkbox/__tests__/Checkbox.test.d.ts +0 -0
  57. /package/dist/{components → dts-temp/components}/Checkbox/index.d.ts +0 -0
  58. /package/dist/{components → dts-temp/components}/Chips/Chips.d.ts +0 -0
  59. /package/dist/{components → dts-temp/components}/Chips/Chips.types.d.ts +0 -0
  60. /package/dist/{components → dts-temp/components}/Chips/index.d.ts +0 -0
  61. /package/dist/{components → dts-temp/components}/Container/Container.d.ts +0 -0
  62. /package/dist/{components → dts-temp/components}/Container/Container.types.d.ts +0 -0
  63. /package/dist/{components → dts-temp/components}/Container/__tests__/Container.test.d.ts +0 -0
  64. /package/dist/{components → dts-temp/components}/DatePicker/DatePicker.d.ts +0 -0
  65. /package/dist/{components/Dialog/__tests__/Dialog.test.d.ts → dts-temp/components/DatePicker/__test__/DatePicker.test.d.ts} +0 -0
  66. /package/dist/{components → dts-temp/components}/DatePicker/index.d.ts +0 -0
  67. /package/dist/{components → dts-temp/components}/Dialog/Dialog.d.ts +0 -0
  68. /package/dist/{components/Menu/__tests__/Menu.test.d.ts → dts-temp/components/Dialog/__tests__/Dialog.test.d.ts} +0 -0
  69. /package/dist/{components → dts-temp/components}/Dialog/index.d.ts +0 -0
  70. /package/dist/{components/Popover/__test__/Popover.test.d.ts → dts-temp/components/Drawer/__tests__/Drawer.test.d.ts} +0 -0
  71. /package/dist/{components → dts-temp/components}/Drawer/index.d.ts +0 -0
  72. /package/dist/{components → dts-temp/components}/Filter/Filter.d.ts +0 -0
  73. /package/dist/{components → dts-temp/components}/ListItem/ListItem.d.ts +0 -0
  74. /package/dist/{components → dts-temp/components}/ListItem/ListItem.types.d.ts +0 -0
  75. /package/dist/{components → dts-temp/components}/ListItem/index.d.ts +0 -0
  76. /package/dist/{components → dts-temp/components}/Menu/Menu.d.ts +0 -0
  77. /package/dist/{components → dts-temp/components}/Menu/Menu.types.d.ts +0 -0
  78. /package/dist/{components/Radio/__tests__/Radio.test.d.ts → dts-temp/components/Menu/__tests__/Menu.test.d.ts} +0 -0
  79. /package/dist/{components → dts-temp/components}/Menu/components/MenuItem.d.ts +0 -0
  80. /package/dist/{components → dts-temp/components}/Menu/hooks/useMenuLogic.d.ts +0 -0
  81. /package/dist/{components → dts-temp/components}/Menu/hooks/useSearchLogic.d.ts +0 -0
  82. /package/dist/{components → dts-temp/components}/Menu/index.d.ts +0 -0
  83. /package/dist/{components → dts-temp/components}/Popover/Popover.d.ts +0 -0
  84. /package/dist/{components/Search/__tests__/Search.test.d.ts → dts-temp/components/Popover/__test__/Popover.test.d.ts} +0 -0
  85. /package/dist/{components → dts-temp/components}/Popover/index.d.ts +0 -0
  86. /package/dist/{components → dts-temp/components}/Quantity/Quantity.d.ts +0 -0
  87. /package/dist/{components → dts-temp/components}/Quantity/Quantity.types.d.ts +0 -0
  88. /package/dist/{components → dts-temp/components}/Quantity/index.d.ts +0 -0
  89. /package/dist/{components → dts-temp/components}/Radio/Radio.d.ts +0 -0
  90. /package/dist/{components → dts-temp/components}/Radio/Radio.types.d.ts +0 -0
  91. /package/dist/{components/Select/__tests__/SelectRadix.test.d.ts → dts-temp/components/Radio/__tests__/Radio.test.d.ts} +0 -0
  92. /package/dist/{components → dts-temp/components}/Radio/index.d.ts +0 -0
  93. /package/dist/{components → dts-temp/components}/Search/Search.d.ts +0 -0
  94. /package/dist/{components → dts-temp/components}/Search/Search.types.d.ts +0 -0
  95. /package/dist/{components/Switch/__tests__/Switch.test.d.ts → dts-temp/components/Search/__tests__/Search.test.d.ts} +0 -0
  96. /package/dist/{components → dts-temp/components}/Search/index.d.ts +0 -0
  97. /package/dist/{components → dts-temp/components}/Select/Select.d.ts +0 -0
  98. /package/dist/{components → dts-temp/components}/Select/Select.types.d.ts +0 -0
  99. /package/dist/{components/TextField/__tests__/Textfield.test.d.ts → dts-temp/components/Select/__tests__/SelectRadix.test.d.ts} +0 -0
  100. /package/dist/{components → dts-temp/components}/Select/components/CheckboxSelectItem.d.ts +0 -0
  101. /package/dist/{components → dts-temp/components}/Select/components/ExpandableSelectItem.d.ts +0 -0
  102. /package/dist/{components → dts-temp/components}/Select/components/SelectItem.d.ts +0 -0
  103. /package/dist/{components → dts-temp/components}/Select/hooks/useSelectLogic.d.ts +0 -0
  104. /package/dist/{components → dts-temp/components}/Select/index.d.ts +0 -0
  105. /package/dist/{components → dts-temp/components}/Switch/Switch.d.ts +0 -0
  106. /package/dist/{components → dts-temp/components}/Switch/Switch.types.d.ts +0 -0
  107. /package/dist/{components/TextField/utils/__tests__/validation.test.d.ts → dts-temp/components/Switch/__tests__/Switch.test.d.ts} +0 -0
  108. /package/dist/{components → dts-temp/components}/Switch/index.d.ts +0 -0
  109. /package/dist/{components → dts-temp/components}/Table/EmptyRows150Color.d.ts +0 -0
  110. /package/dist/{components → dts-temp/components}/Table/LoaderList.d.ts +0 -0
  111. /package/dist/{components → dts-temp/components}/Table/MultiLineText/MultiLineText.d.ts +0 -0
  112. /package/dist/{components → dts-temp/components}/Table/MultiLineText/index.d.ts +0 -0
  113. /package/dist/{components → dts-temp/components}/Table/Table.d.ts +0 -0
  114. /package/dist/{components → dts-temp/components}/Table/Table.types.d.ts +0 -0
  115. /package/dist/{components → dts-temp/components}/Table/TablePagination.d.ts +0 -0
  116. /package/dist/{components → dts-temp/components}/Table/index.d.ts +0 -0
  117. /package/dist/{components → dts-temp/components}/Table/utils/tableActions.d.ts +0 -0
  118. /package/dist/{components/Toast/__tests__/Toast.test.d.ts → dts-temp/components/TextArea/__tests__/TextArea.test.d.ts} +0 -0
  119. /package/dist/{components → dts-temp/components}/TextField/TextField.d.ts +0 -0
  120. /package/dist/{components/Tooltip/__tests__/Tooltip.test.d.ts → dts-temp/components/TextField/__tests__/Textfield.test.d.ts} +0 -0
  121. /package/dist/{components → dts-temp/components}/TextField/index.d.ts +0 -0
  122. /package/dist/{components → dts-temp/components}/TextField/utils/index.d.ts +0 -0
  123. /package/dist/{components → dts-temp/components}/TextField/utils/validation.d.ts +0 -0
  124. /package/dist/{components → dts-temp/components}/Toast/Toast.d.ts +0 -0
  125. /package/dist/{components → dts-temp/components}/Toast/Toast.types.d.ts +0 -0
  126. /package/dist/{components → dts-temp/components}/Toast/components/ToastContainer.d.ts +0 -0
  127. /package/dist/{components → dts-temp/components}/Toast/components/ToastProvider.d.ts +0 -0
  128. /package/dist/{components → dts-temp/components}/Toast/index.d.ts +0 -0
  129. /package/dist/{components → dts-temp/components}/Tooltip/Tooltip.d.ts +0 -0
  130. /package/dist/{components → dts-temp/components}/Tooltip/Tooltip.types.d.ts +0 -0
  131. /package/dist/{components → dts-temp/components}/Tooltip/index.d.ts +0 -0
  132. /package/dist/{components → dts-temp/components}/VerificationCode/VerificationCode.d.ts +0 -0
  133. /package/dist/{components → dts-temp/components}/VerificationCode/VerificationCode.types.d.ts +0 -0
  134. /package/dist/{components → dts-temp/components}/VerificationCode/index.d.ts +0 -0
  135. /package/dist/{contexts → dts-temp/contexts}/ToastContext.d.ts +0 -0
  136. /package/dist/{hooks → dts-temp/hooks}/ApiSimulation.d.ts +0 -0
  137. /package/dist/{hooks → dts-temp/hooks}/InfiniteScroll.d.ts +0 -0
  138. /package/dist/{hooks → dts-temp/hooks}/NormalizeText.d.ts +0 -0
  139. /package/dist/{hooks → dts-temp/hooks}/useToast.d.ts +0 -0
  140. /package/dist/{shared → dts-temp/shared}/Label/index.d.ts +0 -0
  141. /package/dist/{shared → dts-temp/shared}/icons/CheckHalf.d.ts +0 -0
  142. /package/dist/{shared → dts-temp/shared}/icons/CheckSmall.d.ts +0 -0
  143. /package/dist/{shared → dts-temp/shared}/icons/index.d.ts +0 -0
  144. /package/dist/{types → dts-temp/types}/common.types.d.ts +0 -0
  145. /package/dist/{types → dts-temp/types}/index.d.ts +0 -0
package/dist/index.cjs CHANGED
@@ -7,6 +7,7 @@ var React = require('react');
7
7
  var reactIcons = require('@fluentui/react-icons');
8
8
  var reactDayPicker = require('react-day-picker');
9
9
  var dateFns = require('date-fns');
10
+ var reactDom = require('react-dom');
10
11
 
11
12
  function _interopNamespaceDefault(e) {
12
13
  var n = Object.create(null);
@@ -2428,16 +2429,29 @@ const ptBR = {
2428
2429
  },
2429
2430
  };
2430
2431
 
2431
- var styles$m = {"root":"Calendar-module__root___vQEhz","day":"Calendar-module__day___dseUA","day_button":"Calendar-module__day_button___r3WNU","caption_label":"Calendar-module__caption_label___Dhkie","button_next":"Calendar-module__button_next___iRaNz","button_previous":"Calendar-module__button_previous___r7JBs","chevron":"Calendar-module__chevron___NPDg-","nav":"Calendar-module__nav___MT3Dm","dropdowns":"Calendar-module__dropdowns___xBVtv","dropdown":"Calendar-module__dropdown___D7OlW","dropdown_root":"Calendar-module__dropdown_root___v4DlK","month_caption":"Calendar-module__month_caption___P3Hlu","month":"Calendar-module__month___0RA-L","months":"Calendar-module__months___rmJdy","month_grid":"Calendar-module__month_grid___f6YkX","weekday":"Calendar-module__weekday___Spb2f","week_number":"Calendar-module__week_number___EXJD9","today":"Calendar-module__today___U36wP","outside":"Calendar-module__outside___UeJFZ","selected":"Calendar-module__selected___5Nryr","disabled":"Calendar-module__disabled___T3658","hidden":"Calendar-module__hidden___uL3uc","range_start":"Calendar-module__range_start___c1eNH","range_middle":"Calendar-module__range_middle___Uv4gt","range_end":"Calendar-module__range_end___4qDh5","focusable":"Calendar-module__focusable___V7w-Q","weeks_before_enter":"Calendar-module__weeks_before_enter___O1ytQ","slide_in_left":"Calendar-module__slide_in_left___hfrfr","weeks_before_exit":"Calendar-module__weeks_before_exit___v7nDr","slide_out_left":"Calendar-module__slide_out_left___kib4j","weeks_after_enter":"Calendar-module__weeks_after_enter___CEtsD","slide_in_right":"Calendar-module__slide_in_right___ldL0M","weeks_after_exit":"Calendar-module__weeks_after_exit___F8Edz","slide_out_right":"Calendar-module__slide_out_right___X2hxE","caption_after_enter":"Calendar-module__caption_after_enter___0ek1H","fade_in":"Calendar-module__fade_in___YyYoZ","caption_after_exit":"Calendar-module__caption_after_exit___RA1iK","fade_out":"Calendar-module__fade_out___lNcmB","caption_before_enter":"Calendar-module__caption_before_enter___j6sMK","caption_before_exit":"Calendar-module__caption_before_exit___rntl-"};
2432
+ var styles$m = {"root":"Calendar-module__root___vQEhz","day":"Calendar-module__day___dseUA","day_button":"Calendar-module__day_button___r3WNU","caption_label":"Calendar-module__caption_label___Dhkie","button_next":"Calendar-module__button_next___iRaNz","button_previous":"Calendar-module__button_previous___r7JBs","chevron":"Calendar-module__chevron___NPDg-","nav":"Calendar-module__nav___MT3Dm","dropdowns":"Calendar-module__dropdowns___xBVtv","dropdown":"Calendar-module__dropdown___D7OlW","dropdown_root":"Calendar-module__dropdown_root___v4DlK","month_caption":"Calendar-module__month_caption___P3Hlu","month":"Calendar-module__month___0RA-L","months":"Calendar-module__months___rmJdy","month_grid":"Calendar-module__month_grid___f6YkX","weekday":"Calendar-module__weekday___Spb2f","week_number":"Calendar-module__week_number___EXJD9","today":"Calendar-module__today___U36wP","outside":"Calendar-module__outside___UeJFZ","selected":"Calendar-module__selected___5Nryr","disabled":"Calendar-module__disabled___T3658","hidden":"Calendar-module__hidden___uL3uc","range_start":"Calendar-module__range_start___c1eNH","range_middle":"Calendar-module__range_middle___Uv4gt","range_end":"Calendar-module__range_end___4qDh5","focusable":"Calendar-module__focusable___V7w-Q","weeks_before_enter":"Calendar-module__weeks_before_enter___O1ytQ","slide_in_left":"Calendar-module__slide_in_left___hfrfr","weeks_before_exit":"Calendar-module__weeks_before_exit___v7nDr","slide_out_left":"Calendar-module__slide_out_left___kib4j","weeks_after_enter":"Calendar-module__weeks_after_enter___CEtsD","slide_in_right":"Calendar-module__slide_in_right___ldL0M","weeks_after_exit":"Calendar-module__weeks_after_exit___F8Edz","slide_out_right":"Calendar-module__slide_out_right___X2hxE","caption_after_enter":"Calendar-module__caption_after_enter___0ek1H","fade_in":"Calendar-module__fade_in___YyYoZ","caption_after_exit":"Calendar-module__caption_after_exit___RA1iK","fade_out":"Calendar-module__fade_out___lNcmB","caption_before_enter":"Calendar-module__caption_before_enter___j6sMK","caption_before_exit":"Calendar-module__caption_before_exit___rntl-","calendar_grid_wrapper":"Calendar-module__calendar_grid_wrapper___OX0TR","caption_grid_btn":"Calendar-module__caption_grid_btn___qD0-E","caption_year_chevron":"Calendar-module__caption_year_chevron___4ghQV","caption_grid_label":"Calendar-module__caption_grid_label___93Wx4","caption_year_chevron_open":"Calendar-module__caption_year_chevron_open___CNDPO","gridOverlay":"Calendar-module__gridOverlay___Za-y0","gridOverlayCaption":"Calendar-module__gridOverlayCaption___p4OUO","gridOverlayYearsNav":"Calendar-module__gridOverlayYearsNav___U6S-V","gridCells":"Calendar-module__gridCells___Y8DaG","gridCellsYears":"Calendar-module__gridCellsYears___jEV52","gridCell":"Calendar-module__gridCell___RV1co","gridCellActive":"Calendar-module__gridCellActive___UBi5y","gridNavBtn":"Calendar-module__gridNavBtn___Jligz","chevronNavBtnPrev":"Calendar-module__chevronNavBtnPrev___ifEps","chevronNavBtnNext":"Calendar-module__chevronNavBtnNext___qmghm"};
2432
2433
 
2433
- const Calendar = ({ selected, selectedDate, currentDate, defaultMonth, startMonth, endMonth, numberOfMonths, onDaySelect, onDateChange, onClear: _onClear, minDate, maxDate, disabled, hidden, format: _format, locale = "pt-br", captionLayout = "dropdown", reverseYears, fixedWeeks, showOutsideDays, showWeekNumber, hideNavigation, disableNavigation, navLayout, role, title, animate = true, timeZone = "America/Sao_Paulo", modifiers, modifiersClassNames, footer, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, }) => {
2434
- const [internalSelected, setInternalSelected] = React.useState(selected ?? selectedDate ?? undefined);
2434
+ const GridCtx = React.createContext(null);
2435
+ const GridMonthCaption = ({ calendarMonth, displayIndex: _displayIndex, ...divProps }) => {
2436
+ const ctx = React.useContext(GridCtx);
2437
+ const { view, intlLocale, onYearLabelClick } = ctx ?? {};
2438
+ const date = calendarMonth.date;
2439
+ const monthLabel = new Intl.DateTimeFormat(intlLocale, { month: "long" }).format(date);
2440
+ const yearLabel = String(date.getFullYear());
2441
+ return (jsxRuntime.jsxs("div", { ...divProps, children: [jsxRuntime.jsx("span", { className: styles$m.caption_grid_label, children: monthLabel }), jsxRuntime.jsxs("button", { type: "button", className: styles$m.caption_grid_btn, "aria-pressed": view === "years", onClick: onYearLabelClick, children: [yearLabel, jsxRuntime.jsx("svg", { className: `${styles$m.caption_year_chevron}${view === "years" ? ` ${styles$m.caption_year_chevron_open}` : ""}`, width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: jsxRuntime.jsx("path", { d: "M2 4L6 8L10 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })] })] }));
2442
+ };
2443
+ const YEARS_PER_PAGE = 20;
2444
+ const Calendar = ({ selected, currentDate, defaultMonth, startMonth, endMonth, onDaySelect, onDateChange, onClear: _onClear, minDate, maxDate, disabled, format: _format, locale = "pt-br", autoFocus, id, "aria-label": ariaLabel, }) => {
2445
+ const animate = true;
2446
+ const [internalSelected, setInternalSelected] = React.useState(selected ?? undefined);
2447
+ const [internalDisplayMonth, setInternalDisplayMonth] = React.useState(() => currentDate ?? defaultMonth ?? new Date());
2448
+ const [gridView, setGridView] = React.useState("days");
2449
+ const [yearPageStart, setYearPageStart] = React.useState(() => (currentDate ?? defaultMonth ?? new Date()).getFullYear() - 9);
2435
2450
  const resolvedSelected = selected !== undefined
2436
2451
  ? (selected ?? undefined)
2437
- : selectedDate !== undefined
2438
- ? (selectedDate ?? undefined)
2439
- : internalSelected;
2452
+ : internalSelected;
2440
2453
  const resolvedLocale = locale === "pt-br" ? ptBR : enUS;
2454
+ const intlLocale = locale === "pt-br" ? "pt-BR" : "en-US";
2441
2455
  const disabledMatchers = [
2442
2456
  ...(minDate ? [{ before: minDate }] : []),
2443
2457
  ...(maxDate ? [{ after: maxDate }] : []),
@@ -2449,7 +2463,62 @@ const Calendar = ({ selected, selectedDate, currentDate, defaultMonth, startMont
2449
2463
  onDaySelect?.(date);
2450
2464
  }
2451
2465
  };
2452
- return (jsxRuntime.jsx(reactDayPicker.DayPicker, { id: id, classNames: styles$m, captionLayout: captionLayout, modifiers: modifiers, modifiersClassNames: modifiersClassNames, animate: animate, mode: "single", selected: resolvedSelected, onSelect: handleSelect, month: currentDate ?? undefined, defaultMonth: defaultMonth, startMonth: startMonth, endMonth: endMonth, numberOfMonths: numberOfMonths, onMonthChange: onDateChange, disabled: disabledMatchers.length > 0 ? disabledMatchers : undefined, hidden: hidden, timeZone: timeZone, locale: resolvedLocale, reverseYears: reverseYears, fixedWeeks: fixedWeeks, showOutsideDays: showOutsideDays, showWeekNumber: showWeekNumber, hideNavigation: hideNavigation, disableNavigation: disableNavigation, navLayout: navLayout, role: role, title: title, footer: footer, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }));
2466
+ const handleMonthChange = (date) => {
2467
+ setInternalDisplayMonth(date);
2468
+ onDateChange?.(date);
2469
+ };
2470
+ const resolvedDisplayMonth = currentDate ?? internalDisplayMonth;
2471
+ const displayedMonthIndex = resolvedDisplayMonth.getMonth();
2472
+ const displayedYear = resolvedDisplayMonth.getFullYear();
2473
+ const startYear = startMonth?.getFullYear() ?? 1900;
2474
+ const endYear = endMonth?.getFullYear() ?? 2100;
2475
+ const handleGridMonthSelect = (monthIndex) => {
2476
+ const newDate = new Date(displayedYear, monthIndex, 1);
2477
+ setInternalDisplayMonth(newDate);
2478
+ onDateChange?.(newDate);
2479
+ setGridView("days");
2480
+ };
2481
+ const handleGridYearSelect = (year) => {
2482
+ const newDate = new Date(year, displayedMonthIndex, 1);
2483
+ setInternalDisplayMonth(newDate);
2484
+ onDateChange?.(newDate);
2485
+ setGridView("months");
2486
+ };
2487
+ const handleYearLabelClick = () => {
2488
+ setYearPageStart(displayedYear - 9);
2489
+ setGridView((v) => (v === "years" ? "days" : "years"));
2490
+ };
2491
+ const clampedYearPageStart = Math.max(startYear, yearPageStart);
2492
+ const yearsInPage = Array.from({ length: YEARS_PER_PAGE }, (_, i) => clampedYearPageStart + i).filter((y) => y <= endYear);
2493
+ const canGoPrevYears = clampedYearPageStart - YEARS_PER_PAGE >= startYear;
2494
+ const canGoNextYears = clampedYearPageStart + YEARS_PER_PAGE <= endYear;
2495
+ const monthsGrid = Array.from({ length: 12 }, (_, i) => ({
2496
+ index: i,
2497
+ label: new Intl.DateTimeFormat(intlLocale, { month: "short" }).format(new Date(2000, i, 1)),
2498
+ disabled: (startMonth != null &&
2499
+ new Date(displayedYear, i, 1) < new Date(startMonth.getFullYear(), startMonth.getMonth(), 1)) ||
2500
+ (endMonth != null &&
2501
+ new Date(displayedYear, i, 1) > new Date(endMonth.getFullYear(), endMonth.getMonth(), 1)),
2502
+ }));
2503
+ const gridCtxValue = {
2504
+ view: gridView,
2505
+ intlLocale,
2506
+ onYearLabelClick: handleYearLabelClick,
2507
+ };
2508
+ const sharedDayPickerProps = {
2509
+ classNames: styles$m,
2510
+ animate,
2511
+ mode: "single",
2512
+ selected: resolvedSelected,
2513
+ onSelect: handleSelect,
2514
+ startMonth,
2515
+ endMonth,
2516
+ disabled: disabledMatchers.length > 0 ? disabledMatchers : undefined,
2517
+ locale: resolvedLocale,
2518
+ autoFocus,
2519
+ "aria-label": ariaLabel,
2520
+ };
2521
+ return (jsxRuntime.jsx(GridCtx.Provider, { value: gridCtxValue, children: jsxRuntime.jsxs("div", { className: styles$m.calendar_grid_wrapper, children: [jsxRuntime.jsx(reactDayPicker.DayPicker, { id: id, ...sharedDayPickerProps, captionLayout: "label", month: resolvedDisplayMonth, onMonthChange: handleMonthChange, components: { MonthCaption: GridMonthCaption } }), gridView !== "days" && (jsxRuntime.jsxs("div", { className: `${styles$m.gridOverlay}${gridView === "years" ? ` ${styles$m.gridOverlayYears}` : ""}`, role: "dialog", "aria-modal": "true", "aria-label": gridView === "months" ? "Selecione o mês" : "Selecione o ano", children: [gridView === "months" && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: styles$m.gridOverlayCaption, children: [jsxRuntime.jsx("span", { className: styles$m.caption_grid_label, children: new Intl.DateTimeFormat(intlLocale, { month: "long" }).format(resolvedDisplayMonth) }), jsxRuntime.jsxs("button", { type: "button", className: styles$m.caption_grid_btn, onClick: () => setGridView("days"), "aria-label": "Fechar sele\u00E7\u00E3o de m\u00EAs", children: [displayedYear, jsxRuntime.jsx("svg", { className: `${styles$m.caption_year_chevron} ${styles$m.caption_year_chevron_open}`, width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: jsxRuntime.jsx("path", { d: "M2 4L6 8L10 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })] })] }), jsxRuntime.jsx("div", { className: styles$m.gridCells, children: monthsGrid.map(({ index, label, disabled: monthDisabled }) => (jsxRuntime.jsx("button", { type: "button", disabled: monthDisabled, className: `${styles$m.gridCell}${displayedMonthIndex === index ? ` ${styles$m.gridCellActive}` : ""}`, onClick: () => handleGridMonthSelect(index), children: label }, index))) })] })), gridView === "years" && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: styles$m.gridOverlayCaption, children: [jsxRuntime.jsx("span", { className: styles$m.caption_grid_label, children: new Intl.DateTimeFormat(intlLocale, { month: "long" }).format(resolvedDisplayMonth) }), jsxRuntime.jsxs("button", { type: "button", className: styles$m.caption_grid_btn, onClick: () => setGridView("days"), "aria-label": "Fechar sele\u00E7\u00E3o de ano", children: [displayedYear, jsxRuntime.jsx("svg", { className: `${styles$m.caption_year_chevron} ${styles$m.caption_year_chevron_open}`, width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: jsxRuntime.jsx("path", { d: "M2 4L6 8L10 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })] }), jsxRuntime.jsxs("div", { className: styles$m.gridOverlayYearsNav, children: [jsxRuntime.jsx("button", { type: "button", className: styles$m.gridNavBtn, disabled: !canGoPrevYears, onClick: () => setYearPageStart((s) => s - YEARS_PER_PAGE), "aria-label": "Anos anteriores", children: jsxRuntime.jsx("svg", { viewBox: "0 0 12 12", "aria-hidden": "true", className: styles$m.chevronNavBtnPrev, children: jsxRuntime.jsx("path", { d: "M2 4L6 8L10 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }), jsxRuntime.jsx("button", { type: "button", className: styles$m.gridNavBtn, disabled: !canGoNextYears, onClick: () => setYearPageStart((s) => s + YEARS_PER_PAGE), "aria-label": "Pr\u00F3ximos anos", children: jsxRuntime.jsx("svg", { viewBox: "0 0 12 12", "aria-hidden": "true", className: styles$m.chevronNavBtnNext, children: jsxRuntime.jsx("path", { d: "M2 4L6 8L10 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] })] }), jsxRuntime.jsx("div", { className: `${styles$m.gridCells} ${styles$m.gridCellsYears}`, children: yearsInPage.map((year) => (jsxRuntime.jsx("button", { type: "button", className: `${styles$m.gridCell}${displayedYear === year ? ` ${styles$m.gridCellActive}` : ""}`, onClick: () => handleGridYearSelect(year), children: year }, year))) })] }))] }))] }) }));
2453
2522
  };
2454
2523
 
2455
2524
  var styles$l = {"zds-callout__container":"Callout-module__zds-callout__container___EoOQd","zds-callout__container__with-title":"Callout-module__zds-callout__container__with-title___NUq2k","zds-callout__neutral":"Callout-module__zds-callout__neutral___ib9gW","zds-callout__brand":"Callout-module__zds-callout__brand___UYVny","zds-callout__color":"Callout-module__zds-callout__color___6ojEV","zds-callout__alert":"Callout-module__zds-callout__alert___gSOsh","zds-callout__success":"Callout-module__zds-callout__success___6W096","zds-callout__title":"Callout-module__zds-callout__title___jmmqj","zds-callout__text":"Callout-module__zds-callout__text___MTO5R","zds-callout__icon":"Callout-module__zds-callout__icon___-CaUD","zds-callout__content":"Callout-module__zds-callout__content___hh0Mj","zds-callout__subcontent":"Callout-module__zds-callout__subcontent___olIpt"};
@@ -2505,11 +2574,13 @@ function Container({ children }) {
2505
2574
  return (jsxRuntime.jsx("main", { className: `${styles$i['container']} mx-auto`, children: children }));
2506
2575
  }
2507
2576
 
2508
- var styles$h = {"labelContainer":"index-module__labelContainer___WGyDF","wrapperLabel":"index-module__wrapperLabel___XJzZO","requiredLabel":"index-module__requiredLabel___7oZkh","infoIcon":"index-module__infoIcon___lClx4","errorLabel":"index-module__errorLabel___qa6h6","disabledLabel":"index-module__disabledLabel___U9vL8"};
2577
+ var styles$h = {"Content":"Popover-module__Content___RIETg"};
2509
2578
 
2510
- const LabelComponent = ({ children, htmlFor, required = false, tooltip = false, tooltipText, side = 'bottom', align = 'start', className, error = false, disabled = false }) => (jsxRuntime.jsx(jsxRuntime.Fragment, { children: tooltip ? (jsxRuntime.jsxs("div", { className: styles$h.labelContainer, children: [jsxRuntime.jsxs(radixUi.Label.Root, { className: clsx(styles$h.wrapperLabel, error && styles$h.errorLabel, className), htmlFor: htmlFor, children: [children, required && jsxRuntime.jsx("span", { className: styles$h.requiredLabel, children: "*" })] }), jsxRuntime.jsx(Tooltip, { side: side, align: align, text: tooltipText || '', children: jsxRuntime.jsx(reactIcons.Info12Regular, { className: styles$h.infoIcon }) })] })) : (jsxRuntime.jsxs(radixUi.Label.Root, { className: clsx(styles$h.wrapperLabel, error && !disabled && styles$h.errorLabel, disabled && styles$h.disabledLabel, className), htmlFor: htmlFor, children: [children, required && jsxRuntime.jsx("span", { className: styles$h.requiredLabel, children: "*" })] })) }));
2579
+ const Popover = ({ trigger, content, side = "left", align = "start", sideOffset = 8, open, onOpenChange, asAnchor = false, onOpenAutoFocus, onCloseAutoFocus, }) => {
2580
+ return (jsxRuntime.jsxs(radixUi.Popover.Root, { open: open, onOpenChange: onOpenChange, children: [asAnchor ? (jsxRuntime.jsx(radixUi.Popover.Anchor, { asChild: true, children: trigger })) : (jsxRuntime.jsx(radixUi.Popover.Trigger, { asChild: true, children: trigger })), jsxRuntime.jsx(radixUi.Popover.Portal, { children: jsxRuntime.jsx(radixUi.Popover.Content, { className: styles$h.Content, sideOffset: sideOffset, side: side, align: align, onOpenAutoFocus: asAnchor ? (e) => e.preventDefault() : onOpenAutoFocus, onCloseAutoFocus: asAnchor ? (e) => e.preventDefault() : onCloseAutoFocus, onInteractOutside: asAnchor ? (e) => e.preventDefault() : undefined, children: content }) })] }));
2581
+ };
2511
2582
 
2512
- var styles$g = {"container":"TextField-module__container___WJHFR","inputWrapper":"TextField-module__inputWrapper___INjfd","inputContainer":"TextField-module__inputContainer___3EsFJ","icon":"TextField-module__icon___p1vwi","clearButton":"TextField-module__clearButton___kgOot","helperText":"TextField-module__helperText___d5QGC","error":"TextField-module__error___IGQzp","disabled":"TextField-module__disabled___roIKP"};
2583
+ var styles$g = {"container":"TextField-module__container___WJHFR","inputWrapper":"TextField-module__inputWrapper___INjfd","inputContainer":"TextField-module__inputContainer___3EsFJ","icon":"TextField-module__icon___p1vwi","clearButton":"TextField-module__clearButton___kgOot","inputWithIcon":"TextField-module__inputWithIcon___shqkL","helperText":"TextField-module__helperText___d5QGC","error":"TextField-module__error___IGQzp","disabled":"TextField-module__disabled___roIKP"};
2513
2584
 
2514
2585
  const validateInput = ({ value, maxLength, errorMessage, required }) => {
2515
2586
  if (required && value.trim() === '') {
@@ -2521,7 +2592,12 @@ const validateInput = ({ value, maxLength, errorMessage, required }) => {
2521
2592
  return '';
2522
2593
  };
2523
2594
 
2524
- const TextField$1 = React.forwardRef(({ className, value, label, placeholder, type = 'text', onChange, disabled = false, maxLength = 30, required = false, helperText, tooltip = false, tooltipText, side = 'bottom', align = 'start', errorMessage, id, icon, onBlur, onFocus, name, ...inputProps }, ref) => {
2595
+ var styles$f = {"labelContainer":"index-module__labelContainer___WGyDF","wrapperLabel":"index-module__wrapperLabel___XJzZO","requiredLabel":"index-module__requiredLabel___7oZkh","infoIcon":"index-module__infoIcon___lClx4","errorIcon":"index-module__errorIcon___yN-lq","disabledIcon":"index-module__disabledIcon___89Os7","errorLabel":"index-module__errorLabel___qa6h6","disabledLabel":"index-module__disabledLabel___U9vL8","disabledContainer":"index-module__disabledContainer___MtOvy"};
2596
+
2597
+ const LabelComponent = ({ children, htmlFor, required = false, tooltip = false, tooltipText, side = 'bottom', align = 'start', className, error = false, disabled = false }) => (jsxRuntime.jsxs("div", { className: clsx(styles$f.labelContainer, disabled && styles$f.disabledContainer), children: [jsxRuntime.jsxs(radixUi.Label.Root, { className: clsx(styles$f.wrapperLabel, error && !disabled && styles$f.errorLabel, disabled && styles$f.disabledLabel, className), htmlFor: htmlFor, children: [children, required && jsxRuntime.jsx("span", { className: styles$f.requiredLabel, children: "*" })] }), tooltip && (jsxRuntime.jsx(Tooltip, { side: side, align: align, text: tooltipText || '', children: jsxRuntime.jsx("span", { className: disabled ? styles$f.disabledIcon : error ?
2598
+ styles$f.errorIcon : styles$f.infoIcon, children: jsxRuntime.jsx(reactIcons.Info12Regular, {}) }) }))] }));
2599
+
2600
+ const TextField$1 = React.forwardRef(({ className, value, label, placeholder, type = 'text', onChange, disabled = false, maxLength = 30, required = false, helperText, tooltip = false, tooltipText, side = 'bottom', align = 'start', errorMessage, error, id, icon, onBlur, onFocus, name, persistIcon = false, ...inputProps }, ref) => {
2525
2601
  const normalizeValue = (val) => {
2526
2602
  return val === undefined || val === null ? '' : String(val);
2527
2603
  };
@@ -2535,13 +2611,13 @@ const TextField$1 = React.forwardRef(({ className, value, label, placeholder, ty
2535
2611
  setInputValue(newValue);
2536
2612
  // Reavaliar erro quando valor muda externamente (ex: DatePicker atualiza o campo)
2537
2613
  if (inputError) {
2538
- const error = validateInput({
2614
+ const validationError = validateInput({
2539
2615
  value: newValue,
2540
2616
  maxLength,
2541
2617
  errorMessage,
2542
2618
  required,
2543
2619
  });
2544
- setInputError(error);
2620
+ setInputError(validationError);
2545
2621
  }
2546
2622
  }, [value, inputError, type, maxLength, errorMessage, required]);
2547
2623
  const handleChange = React.useCallback((e) => {
@@ -2574,9 +2650,9 @@ const TextField$1 = React.forwardRef(({ className, value, label, placeholder, ty
2574
2650
  }, [onFocus]);
2575
2651
  const showCustomIcon = inputValue.trim().length === 0 && icon;
2576
2652
  const showClearIcon = isFocused && inputValue.trim().length > 0;
2577
- const hasError = Boolean(inputError);
2578
- const displayHelperText = inputError || helperText || '\u00A0';
2579
- const helperId = inputError
2653
+ const hasError = Boolean(inputError) || Boolean(error);
2654
+ const displayHelperText = (error ? errorMessage : undefined) || inputError || helperText || '\u00A0';
2655
+ const helperId = (inputError || error)
2580
2656
  ? `${componentId}-error`
2581
2657
  : helperText
2582
2658
  ? `${componentId}-helper`
@@ -2586,7 +2662,9 @@ const TextField$1 = React.forwardRef(({ className, value, label, placeholder, ty
2586
2662
  [styles$g.error]: hasError && !disabled,
2587
2663
  [className]: className,
2588
2664
  });
2589
- return (jsxRuntime.jsxs("div", { className: containerClass, children: [label && (jsxRuntime.jsx(LabelComponent, { htmlFor: componentId, required: required, tooltip: tooltip, tooltipText: tooltipText, side: side, align: align, error: hasError, disabled: disabled, children: label })), jsxRuntime.jsxs("div", { className: styles$g.inputWrapper, children: [jsxRuntime.jsxs("div", { className: styles$g.inputContainer, children: [jsxRuntime.jsx("input", { ...inputProps, ref: ref, id: componentId, name: name, type: type, value: inputValue, placeholder: placeholder, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, maxLength: maxLength, disabled: disabled, "aria-invalid": hasError, "aria-required": required, "aria-describedby": helperId }), showCustomIcon && jsxRuntime.jsx("span", { className: styles$g.icon, children: icon }), showClearIcon && (jsxRuntime.jsx("button", { type: "button", className: styles$g.clearButton, onMouseDown: (e) => {
2665
+ return (jsxRuntime.jsxs("div", { className: containerClass, children: [label && (jsxRuntime.jsx(LabelComponent, { htmlFor: componentId, required: required, tooltip: tooltip, tooltipText: tooltipText, side: side, align: align, error: hasError, disabled: disabled, children: label })), jsxRuntime.jsxs("div", { className: styles$g.inputWrapper, children: [jsxRuntime.jsxs("div", { className: styles$g.inputContainer, children: [jsxRuntime.jsx("input", { ...inputProps, ref: ref, id: componentId, name: name, type: type, value: inputValue, placeholder: placeholder, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, maxLength: maxLength, disabled: disabled, "aria-invalid": hasError, "aria-required": required, "aria-describedby": helperId, className: clsx({
2666
+ [styles$g.inputWithIcon]: showCustomIcon || showClearIcon,
2667
+ }) }), showCustomIcon && jsxRuntime.jsx("span", { className: styles$g.icon, children: icon }), showClearIcon && (jsxRuntime.jsx("button", { type: "button", className: styles$g.clearButton, onMouseDown: (e) => {
2590
2668
  e.preventDefault();
2591
2669
  handleClear();
2592
2670
  }, "aria-label": "Limpar campo", tabIndex: -1, children: jsxRuntime.jsx(reactIcons.Dismiss16Regular, {}) }))] }), jsxRuntime.jsx("span", { id: helperId, className: styles$g.helperText, "aria-live": hasError ? 'polite' : undefined, children: displayHelperText })] })] }));
@@ -2594,12 +2672,8 @@ const TextField$1 = React.forwardRef(({ className, value, label, placeholder, ty
2594
2672
  TextField$1.displayName = 'TextField';
2595
2673
  var TextField = React.memo(TextField$1);
2596
2674
 
2597
- /**
2598
- * Formata uma data para string conforme o locale.
2599
- * @param date - Data a ser formatada
2600
- * @param locale - Locale para formatação ('pt-br' ou 'en-us')
2601
- * @returns String formatada da data
2602
- */
2675
+ var styles$e = {"datePicker":"DatePicker-module__datePicker___raJYg","textfieldContainer":"DatePicker-module__textfieldContainer___yy8pT","datePickerIcon":"DatePicker-module__datePickerIcon___XCZsn","datePickerIconDisabled":"DatePicker-module__datePickerIconDisabled___BB-Gx"};
2676
+
2603
2677
  function formatDate(date, locale = 'pt-br') {
2604
2678
  if (!date || !(date instanceof Date)) {
2605
2679
  return '';
@@ -2607,7 +2681,6 @@ function formatDate(date, locale = 'pt-br') {
2607
2681
  const day = String(date.getDate()).padStart(2, '0');
2608
2682
  const month = String(date.getMonth() + 1).padStart(2, '0');
2609
2683
  const year = date.getFullYear();
2610
- // Formatação baseada no locale
2611
2684
  if (locale === 'en-us') {
2612
2685
  return `${month}/${day}/${year}`;
2613
2686
  }
@@ -2615,21 +2688,11 @@ function formatDate(date, locale = 'pt-br') {
2615
2688
  return `${day}/${month}/${year}`;
2616
2689
  }
2617
2690
  }
2618
- /**
2619
- * Aplica máscara de data conforme o usuário digita.
2620
- * @param value - Valor atual do input
2621
- * @param locale - Locale para determinar o formato da máscara
2622
- * @returns String com a máscara aplicada
2623
- */
2624
2691
  function applyDateMask(value, locale = 'pt-br') {
2625
- // Remove todos os caracteres que não são dígitos
2626
2692
  const digitsOnly = value.replace(/\D/g, '');
2627
- // Limita a 8 dígitos (DDMMAAAA ou MMDDAAAA)
2628
2693
  const limitedDigits = digitsOnly.slice(0, 8);
2629
- // Aplica a máscara baseada no locale
2630
2694
  let masked = '';
2631
2695
  for (let i = 0; i < limitedDigits.length; i++) {
2632
- // Adiciona barras nas posições corretas
2633
2696
  if (i === 2 || i === 4) {
2634
2697
  masked += '/';
2635
2698
  }
@@ -2637,12 +2700,6 @@ function applyDateMask(value, locale = 'pt-br') {
2637
2700
  }
2638
2701
  return masked;
2639
2702
  }
2640
- /**
2641
- * Valida se uma string está no formato correto de data para o locale.
2642
- * @param value - String a ser validada
2643
- * @param locale - Locale para validação
2644
- * @returns true se o formato está correto
2645
- */
2646
2703
  function isValidDateFormat(value, locale = 'pt-br') {
2647
2704
  const dateRegex = locale === 'en-us'
2648
2705
  ? /^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$/
@@ -2653,7 +2710,6 @@ function parseDate(dateString, locale = 'pt-br') {
2653
2710
  if (!dateString || typeof dateString !== 'string') {
2654
2711
  return null;
2655
2712
  }
2656
- // Regex para validação básica dd/mm/yyyy ou mm/dd/yyyy
2657
2713
  const dateRegex = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/;
2658
2714
  const match = dateString.trim().match(dateRegex);
2659
2715
  if (!match) {
@@ -2663,7 +2719,6 @@ function parseDate(dateString, locale = 'pt-br') {
2663
2719
  let day;
2664
2720
  let month;
2665
2721
  const year = parseInt(yearStr, 10);
2666
- // Interpretação baseada no locale
2667
2722
  if (locale === 'en-us') {
2668
2723
  month = parseInt(first, 10);
2669
2724
  day = parseInt(second, 10);
@@ -2672,13 +2727,10 @@ function parseDate(dateString, locale = 'pt-br') {
2672
2727
  day = parseInt(first, 10);
2673
2728
  month = parseInt(second, 10);
2674
2729
  }
2675
- // Validação básica de ranges
2676
2730
  if (month < 1 || month > 12 || day < 1 || day > 31) {
2677
2731
  return null;
2678
2732
  }
2679
- // Criar e validar a data
2680
2733
  const date = new Date(year, month - 1, day);
2681
- // Verificar se a data criada corresponde aos componentes originais
2682
2734
  if (date.getFullYear() !== year ||
2683
2735
  date.getMonth() !== month - 1 ||
2684
2736
  date.getDate() !== day) {
@@ -2686,16 +2738,35 @@ function parseDate(dateString, locale = 'pt-br') {
2686
2738
  }
2687
2739
  return date;
2688
2740
  }
2741
+ function validatePartialDate(value, locale = 'pt-br') {
2742
+ if (value.length === 0)
2743
+ return 'valid';
2744
+ if (value.length === 2) {
2745
+ const n = parseInt(value, 10);
2746
+ const isValid = locale === 'en-us' ? n >= 1 && n <= 12 : n >= 1 && n <= 31;
2747
+ return isValid ? 'valid' : 'invalid';
2748
+ }
2749
+ if (value.length === 5) {
2750
+ const parts = value.split('/');
2751
+ const a = parseInt(parts[0], 10);
2752
+ const b = parseInt(parts[1], 10);
2753
+ const isValid = locale === 'en-us'
2754
+ ? a >= 1 && a <= 12 && b >= 1 && b <= 31
2755
+ : a >= 1 && a <= 31 && b >= 1 && b <= 12;
2756
+ return isValid ? 'valid' : 'invalid';
2757
+ }
2758
+ if (value.length === 10) {
2759
+ if (!isValidDateFormat(value, locale))
2760
+ return 'invalid';
2761
+ const parsed = parseDate(value, locale);
2762
+ return parsed ? 'valid' : 'invalid';
2763
+ }
2764
+ return 'incomplete';
2765
+ }
2689
2766
 
2690
- var styles$f = {"zds-date-picker":"DatePicker-module__zds-date-picker___FjFTb","zds-date-picker__calendar-popup":"DatePicker-module__zds-date-picker__calendar-popup___hEkq7","zds-calendar--left":"DatePicker-module__zds-calendar--left___5z2UM","zds-calendar--right":"DatePicker-module__zds-calendar--right___NCJtd","zds-date-picker__icon":"DatePicker-module__zds-date-picker__icon___nYEnv","zds-date-picker__icon--disabled":"DatePicker-module__zds-date-picker__icon--disabled___p4Rr2"};
2691
-
2692
- const DatePicker = ({ locale = 'pt-br', calendarPosition = 'left', helperText, required = false, label = 'Data', value, defaultValue, onChange, disabled = false, error: externalError, minDate, maxDate, className, 'data-testid': testId, }) => {
2693
- // ✅ IDs únicos para acessibilidade
2767
+ const DatePicker = ({ locale = 'pt-br', calendarSide = 'bottom', calendarAlign = 'start', helperText, required = false, label = 'Data', value, defaultValue, onChange, disabled = false, error: externalError, minDate, maxDate, 'data-testid': testId, }) => {
2694
2768
  const fieldId = React.useId();
2695
2769
  const calendarId = `${fieldId}-calendar`;
2696
- const errorId = `${fieldId}-error`;
2697
- const helperTextId = `${fieldId}-help`;
2698
- // ✅ Suporte controlled/uncontrolled adequado
2699
2770
  const isControlled = value !== undefined;
2700
2771
  const [internalDate, setInternalDate] = React.useState(defaultValue || null);
2701
2772
  const [tempInputValue, setTempInputValue] = React.useState('');
@@ -2704,25 +2775,18 @@ const DatePicker = ({ locale = 'pt-br', calendarPosition = 'left', helperText, r
2704
2775
  const [showCalendar, setShowCalendar] = React.useState(false);
2705
2776
  const [currentDate, setCurrentDate] = React.useState(new Date());
2706
2777
  const wrapperRef = React.useRef(null);
2707
- // ✅ Estados derivados - uma única fonte de verdade
2708
2778
  const currentSelectedDate = isControlled ? value : internalDate;
2709
- const currentError = externalError || internalError;
2779
+ const hasValidationError = !!(externalError || internalError);
2710
2780
  const displayValue = isEditing ? tempInputValue : (currentSelectedDate ? formatDate(currentSelectedDate, locale) : '');
2711
- // ✅ Combinar helperText normal com mensagem de erro
2712
- const combinedHelperText = React.useMemo(() => {
2713
- const texts = [];
2714
- if (helperText) {
2715
- texts.push(helperText);
2716
- }
2717
- if (currentError) {
2718
- texts.push(currentError);
2719
- }
2720
- return texts.join(' • ');
2721
- }, [helperText, currentError]);
2722
- // ✅ Click outside handler
2781
+ const combinedHelperText = externalError && helperText
2782
+ ? `${helperText} • ${externalError}`
2783
+ : externalError || helperText || '';
2723
2784
  React.useEffect(() => {
2724
2785
  function handleClickOutside(event) {
2725
- if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
2786
+ const target = event.target;
2787
+ const isInsideWrapper = wrapperRef.current?.contains(target);
2788
+ const isInsideCalendar = !!target.closest?.('[data-radix-popper-content-wrapper]');
2789
+ if (!isInsideWrapper && !isInsideCalendar) {
2726
2790
  setShowCalendar(false);
2727
2791
  }
2728
2792
  }
@@ -2733,7 +2797,6 @@ const DatePicker = ({ locale = 'pt-br', calendarPosition = 'left', helperText, r
2733
2797
  document.removeEventListener('mousedown', handleClickOutside);
2734
2798
  };
2735
2799
  }, [showCalendar]);
2736
- // ✅ Handler unificado para mudança de data - SEMPRE chama onChange
2737
2800
  const handleDateChange = React.useCallback((newDate) => {
2738
2801
  if (!isControlled) {
2739
2802
  setInternalDate(newDate);
@@ -2749,34 +2812,15 @@ const DatePicker = ({ locale = 'pt-br', calendarPosition = 'left', helperText, r
2749
2812
  const handleIconClick = () => {
2750
2813
  setShowCalendar((prev) => !prev);
2751
2814
  };
2752
- const handleFieldClick = () => {
2753
- if (!disabled) {
2754
- setShowCalendar(true);
2755
- }
2756
- };
2757
- const handleFieldFocus = () => {
2758
- if (!disabled) {
2759
- setShowCalendar(true);
2760
- }
2761
- };
2762
- // ✅ FUNÇÃO CORRIGIDA: Permite números e barras da máscara
2763
- const filterNumericInput = (inputValue) => {
2764
- // Permite apenas números e barras (para manter a máscara)
2765
- return inputValue.replace(/[^\d/]/g, '');
2766
- };
2767
- // ✅ Handler para prevenir teclas não numéricas
2768
2815
  const handleKeyDown = (event) => {
2769
- const { key, ctrlKey, metaKey } = event;
2770
- // ✅ NOVA FUNCIONALIDADE: Enter fecha calendário se data válida
2816
+ const { key } = event;
2771
2817
  if (key === 'Enter') {
2772
2818
  if (showCalendar) {
2773
- // Se há uma data válida selecionada, fechar calendário
2774
2819
  if (currentSelectedDate) {
2775
2820
  setShowCalendar(false);
2776
2821
  event.preventDefault();
2777
2822
  return;
2778
2823
  }
2779
- // Se a data digitada está completa e válida, processar e fechar
2780
2824
  if (tempInputValue.length === 10 && isValidDateFormat(tempInputValue, locale)) {
2781
2825
  const parsedDate = parseDate(tempInputValue, locale);
2782
2826
  if (parsedDate && !isNaN(parsedDate.getTime())) {
@@ -2788,13 +2832,11 @@ const DatePicker = ({ locale = 'pt-br', calendarPosition = 'left', helperText, r
2788
2832
  }
2789
2833
  }
2790
2834
  else {
2791
- // Se calendário está fechado, Enter abre o calendário
2792
2835
  setShowCalendar(true);
2793
2836
  event.preventDefault();
2794
2837
  return;
2795
2838
  }
2796
2839
  }
2797
- // ✅ Escape sempre fecha o calendário
2798
2840
  if (key === 'Escape') {
2799
2841
  if (showCalendar) {
2800
2842
  setShowCalendar(false);
@@ -2802,19 +2844,12 @@ const DatePicker = ({ locale = 'pt-br', calendarPosition = 'left', helperText, r
2802
2844
  return;
2803
2845
  }
2804
2846
  }
2805
- // Permite teclas de controle (Backspace, Delete, Tab, etc.)
2806
2847
  const controlKeys = [
2807
- 'Backspace', 'Delete', 'Tab', 'ArrowLeft', 'ArrowRight',
2808
- 'ArrowUp', 'ArrowDown', 'Home', 'End'
2848
+ 'Backspace', 'Delete', 'ArrowLeft', 'ArrowRight',
2809
2849
  ];
2810
- // Permite Ctrl+A, Ctrl+C, Ctrl+V, Ctrl+X (atalhos de teclado)
2811
- const isCtrlCommand = ctrlKey || metaKey;
2812
- const allowedCtrlKeys = ['a', 'c', 'v', 'x'];
2813
- // Se é uma tecla de controle ou atalho permitido, deixa passar
2814
- if (controlKeys.includes(key) || (isCtrlCommand && allowedCtrlKeys.includes(key.toLowerCase()))) {
2850
+ if (controlKeys.includes(key)) {
2815
2851
  return;
2816
2852
  }
2817
- // Se não é um número (0-9), previne a entrada
2818
2853
  if (!/^\d$/.test(key)) {
2819
2854
  event.preventDefault();
2820
2855
  }
@@ -2823,87 +2858,62 @@ const DatePicker = ({ locale = 'pt-br', calendarPosition = 'left', helperText, r
2823
2858
  setShowCalendar(false);
2824
2859
  handleDateChange(newSelectedDate);
2825
2860
  };
2861
+ const handleFocus = () => {
2862
+ if (!disabled) {
2863
+ setShowCalendar(true);
2864
+ }
2865
+ };
2826
2866
  const handleTextFieldChange = (value) => {
2827
- // ✅ Filtra caracteres inválidos, mantendo números e barras
2828
- const filteredValue = filterNumericInput(value);
2829
- // ✅ Remove barras para processar apenas números
2830
- const numbersOnly = filteredValue.replace(/[^\d]/g, '');
2831
- // ✅ Aplica máscara progressiva em tempo real
2832
- const maskedValue = applyDateMask(numbersOnly, locale);
2833
- // ✅ Atualizar valor temporário SEMPRE (máscara em tempo real)
2867
+ const maskedValue = applyDateMask(value, locale);
2834
2868
  setTempInputValue(maskedValue);
2835
2869
  setIsEditing(true);
2836
- // ✅ Limpar erro se campo estiver vazio
2837
2870
  if (maskedValue === '') {
2838
2871
  setInternalError('');
2839
2872
  handleDateChange(null);
2840
2873
  setCurrentDate(new Date());
2841
2874
  return;
2842
2875
  }
2843
- // ✅ Validar apenas quando data estiver completa (10 caracteres)
2844
- if (maskedValue.length === 10) {
2845
- if (isValidDateFormat(maskedValue, locale)) {
2876
+ const result = validatePartialDate(maskedValue, locale);
2877
+ if (result === 'invalid') {
2878
+ setInternalError('invalid');
2879
+ if (maskedValue.length === 10) {
2880
+ if (!isControlled)
2881
+ setInternalDate(null);
2882
+ onChange?.(null);
2883
+ }
2884
+ }
2885
+ else if (result === 'valid') {
2886
+ setInternalError('');
2887
+ if (maskedValue.length === 10) {
2846
2888
  const parsedDate = parseDate(maskedValue, locale);
2847
- if (parsedDate && !isNaN(parsedDate.getTime())) {
2848
- setInternalError('');
2889
+ if (parsedDate) {
2849
2890
  handleDateChange(parsedDate);
2850
2891
  setCurrentDate(parsedDate);
2851
2892
  }
2852
- else {
2853
- setInternalError('Data inválida');
2854
- handleDateChange(null);
2855
- }
2856
2893
  }
2857
- else {
2858
- setInternalError('Data inválida');
2859
- handleDateChange(null);
2860
- }
2861
- }
2862
- else {
2863
- // ✅ Data incompleta - limpar erro mas não validar ainda
2864
- setInternalError('');
2865
- // ✅ Não chamar handleDateChange para data incompleta
2866
2894
  }
2867
2895
  };
2868
- // ✅ Effect para atualizar valor do campo quando data muda
2869
- React.useEffect(() => {
2870
- if (!isEditing && currentSelectedDate) {
2871
- setTempInputValue(formatDate(currentSelectedDate, locale));
2872
- }
2873
- }, [locale, currentSelectedDate, isEditing]);
2874
- return (jsxRuntime.jsx("div", { ref: wrapperRef, children: jsxRuntime.jsxs("div", { className: clsx(styles$f['zds-date-picker']), children: [jsxRuntime.jsx(TextField, { type: "tel", icon: jsxRuntime.jsx(reactIcons.Calendar16Regular, { onClick: !disabled ? handleIconClick : undefined, className: clsx(styles$f['zds-date-picker__icon'], disabled && styles$f['zds-date-picker__icon--disabled']) }), onChange: (e) => {
2875
- handleTextFieldChange(String(e));
2876
- }, onClick: !disabled ? handleFieldClick : undefined, onFocus: !disabled ? handleFieldFocus : undefined, onKeyDown: handleKeyDown, value: displayValue, helperText: combinedHelperText, maxLength: 10, required: required, label: label, disabled: disabled, id: fieldId, className: className, "data-testid": testId, placeholder: locale === 'en-us' ? 'MM/DD/YYYY' : 'DD/MM/YYYY', "aria-label": "Open calendar", "aria-expanded": showCalendar, "aria-controls": calendarId, "aria-invalid": !!currentError, "aria-describedby": currentError ? errorId : (helperText ? helperTextId : undefined) }), jsxRuntime.jsx("div", { className: clsx(styles$f['zds-date-picker__calendar-popup'], calendarPosition === 'left' && styles$f['zds-calendar--left'], calendarPosition === 'right' && styles$f['zds-calendar--right']), children: showCalendar && (jsxRuntime.jsx(Calendar, { selected: currentSelectedDate, currentDate: currentDate, onDateChange: setCurrentDate, onDaySelect: handleDaySelect, locale: locale, format: locale === 'en-us' ? 'mm/dd/yyyy' : 'dd/mm/yyyy', minDate: minDate, maxDate: maxDate, id: calendarId, onClear: () => {
2877
- handleDateChange(null);
2878
- setCurrentDate(new Date());
2879
- } })) })] }) }));
2896
+ return (jsxRuntime.jsx("div", { ref: wrapperRef, className: styles$e.datePicker, children: jsxRuntime.jsx(Popover, { open: showCalendar, onOpenChange: setShowCalendar, asAnchor: true, trigger: jsxRuntime.jsx(TextField, { className: styles$e.textfieldContainer, type: "tel", icon: jsxRuntime.jsx(reactIcons.Calendar16Regular, { onClick: !disabled ? handleIconClick : undefined, className: clsx(styles$e.datePickerIcon, disabled && styles$e.datePickerIconDisabled) }), onChange: (e) => {
2897
+ handleTextFieldChange(String(e));
2898
+ }, onKeyDown: handleKeyDown, onFocus: handleFocus, persistIcon: true, autoComplete: "off", value: displayValue, helperText: !externalError ? (helperText || undefined) : undefined, error: hasValidationError ? (externalError ? combinedHelperText : true) : undefined, maxLength: 10, required: required, label: label, disabled: disabled, id: fieldId, "data-testid": testId, placeholder: locale === 'en-us' ? 'MM/DD/YYYY' : 'DD/MM/YYYY', "aria-label": "Open calendar", "aria-expanded": showCalendar, "aria-controls": calendarId, "aria-invalid": hasValidationError, "aria-describedby": externalError ? undefined : (helperText ? `${fieldId}-help` : undefined) }), content: jsxRuntime.jsx(Calendar, { selected: currentSelectedDate, currentDate: currentDate, onDateChange: setCurrentDate, onDaySelect: handleDaySelect, locale: locale, format: locale === 'en-us' ? 'mm/dd/yyyy' : 'dd/mm/yyyy', minDate: minDate, maxDate: maxDate, id: calendarId, onClear: () => {
2899
+ handleDateChange(null);
2900
+ setCurrentDate(new Date());
2901
+ } }), side: calendarSide, align: calendarAlign, sideOffset: 8 }) }));
2880
2902
  };
2881
2903
  var DatePicker_default = React.memo(DatePicker);
2882
2904
 
2883
- var styles$e = {"DialogOverlay":"Dialog-module__DialogOverlay___LEX2O","DialogContent":"Dialog-module__DialogContent___ziVXb","DialogTitle":"Dialog-module__DialogTitle___ay1tD","DialogDescription":"Dialog-module__DialogDescription___odslw","DivButtons":"Dialog-module__DivButtons___BiwX-"};
2905
+ var styles$d = {"DialogOverlay":"Dialog-module__DialogOverlay___LEX2O","DialogContent":"Dialog-module__DialogContent___ziVXb","DialogTitle":"Dialog-module__DialogTitle___ay1tD","DialogDescription":"Dialog-module__DialogDescription___odslw","DivButtons":"Dialog-module__DivButtons___BiwX-"};
2884
2906
 
2885
- const Dialog = ({
2886
- // children,
2887
- show = false, title, bodyContent, textPrimaryAction, textSecondaryAction, onPrimaryAction, onSecondaryAction, ...restProps }) => (jsxRuntime.jsx(radixUi.AlertDialog.Root, { open: show, ...restProps, children: jsxRuntime.jsxs(radixUi.AlertDialog.Portal, { children: [jsxRuntime.jsx(radixUi.AlertDialog.Overlay, { className: styles$e.DialogOverlay }), jsxRuntime.jsxs(radixUi.AlertDialog.Content, { className: styles$e.DialogContent, children: [jsxRuntime.jsx(radixUi.AlertDialog.Title, { className: styles$e.DialogTitle, children: title }), jsxRuntime.jsx(radixUi.AlertDialog.Description, { className: styles$e.DialogDescription, children: bodyContent }), jsxRuntime.jsxs("div", { className: styles$e.DivButtons, children: [!!(textSecondaryAction && textSecondaryAction.trim()) && (jsxRuntime.jsx(radixUi.AlertDialog.Cancel, { asChild: true, children: jsxRuntime.jsx(Button, { variant: "outlined", ...(onSecondaryAction && { onClick: onSecondaryAction }), children: textSecondaryAction }) })), jsxRuntime.jsx(radixUi.AlertDialog.Action, { asChild: true, children: jsxRuntime.jsx(Button, { variant: "filled", ...(onPrimaryAction && { onClick: onPrimaryAction }), children: textPrimaryAction }) })] })] })] }) }));
2907
+ const Dialog = ({ show = false, title, bodyContent, textPrimaryAction, textSecondaryAction, onPrimaryAction, onSecondaryAction, ...restProps }) => (jsxRuntime.jsx(radixUi.AlertDialog.Root, { open: show, ...restProps, children: jsxRuntime.jsxs(radixUi.AlertDialog.Portal, { children: [jsxRuntime.jsx(radixUi.AlertDialog.Overlay, { className: styles$d.DialogOverlay }), jsxRuntime.jsxs(radixUi.AlertDialog.Content, { className: styles$d.DialogContent, children: [jsxRuntime.jsx(radixUi.AlertDialog.Title, { className: styles$d.DialogTitle, children: title }), jsxRuntime.jsx(radixUi.AlertDialog.Description, { className: styles$d.DialogDescription, children: bodyContent }), jsxRuntime.jsxs("div", { className: styles$d.DivButtons, children: [!!(textSecondaryAction && textSecondaryAction.trim()) && (jsxRuntime.jsx(radixUi.AlertDialog.Cancel, { asChild: true, children: jsxRuntime.jsx(Button, { variant: "outlined", ...(onSecondaryAction && { onClick: onSecondaryAction }), children: textSecondaryAction }) })), jsxRuntime.jsx(radixUi.AlertDialog.Action, { asChild: true, children: jsxRuntime.jsx(Button, { variant: "filled", ...(onPrimaryAction && { onClick: onPrimaryAction }), children: textPrimaryAction }) })] })] })] }) }));
2888
2908
 
2889
- var styles$d = {"zds-custom__drawer-shadow":"Drawer-module__zds-custom__drawer-shadow___xoF-q","zds-custom__drawer-shadow--visible":"Drawer-module__zds-custom__drawer-shadow--visible___9JUdU","zds-custom__drawer-sidebar":"Drawer-module__zds-custom__drawer-sidebar___MC8Zt","zds-custom__drawer-sidebar--open":"Drawer-module__zds-custom__drawer-sidebar--open___DiMJb","zds-custom__drawer-sidebar--disabled":"Drawer-module__zds-custom__drawer-sidebar--disabled___6OGsA","zds-drawer__title-close":"Drawer-module__zds-drawer__title-close___g9K3D","zds-drawer__title":"Drawer-module__zds-drawer__title___lqHFw","zds-drawer__children":"Drawer-module__zds-drawer__children___ZnzF6"};
2909
+ var styles$c = {"drawerShadow":"Drawer-module__drawerShadow___0Z6iL","drawerShadow--visible":"Drawer-module__drawerShadow--visible___FspoH","drawerSidebar":"Drawer-module__drawerSidebar___cdyyb","drawerSidebar--open":"Drawer-module__drawerSidebar--open___ee2-Y","drawerSidebar--disabled":"Drawer-module__drawerSidebar--disabled___MYrBI","drawerTitleClose":"Drawer-module__drawerTitleClose___QzqN-","drawerTitle":"Drawer-module__drawerTitle___naMX0","drawerChildren":"Drawer-module__drawerChildren___xGdg9","drawerHeaderContent":"Drawer-module__drawerHeaderContent___NLSwj"};
2890
2910
 
2891
- /**
2892
- * Componente Drawer do Zanthus Design System
2893
- * Implementa um painel lateral deslizante com overlay
2894
- * Segue padrões WCAG 2.1 AA para acessibilidade
2895
- */
2896
- const Drawer = ({ children, customWidth = '400px', // ✅ Valor padrão útil
2897
- onClose, title = 'Título', isOpen = false, onOpen, className, id, disabled = false, onOverlayClick, closeOnOverlayClick = true, closeOnEscape = true, }) => {
2911
+ const Drawer = ({ children, headerContent, customWidth = '400px', onClose, title = 'Título', isOpen = false, onOpen, className, id, disabled = false, onOverlayClick, closeOnOverlayClick = true, closeOnEscape = true, }) => {
2898
2912
  const internalClose = React.useCallback(() => {
2899
2913
  if (disabled)
2900
2914
  return;
2901
2915
  onClose();
2902
2916
  }, [onClose, disabled]);
2903
- /**
2904
- * Manipula clique no overlay
2905
- * Fecha o drawer se closeOnOverlayClick estiver habilitado
2906
- */
2907
2917
  const handleOverlayClick = React.useCallback(() => {
2908
2918
  if (onOverlayClick) {
2909
2919
  onOverlayClick();
@@ -2912,17 +2922,9 @@ onClose, title = 'Título', isOpen = false, onOpen, className, id, disabled = fa
2912
2922
  internalClose();
2913
2923
  }
2914
2924
  }, [onOverlayClick, closeOnOverlayClick, internalClose, disabled]);
2915
- /**
2916
- * Fecha o drawer ao pressionar ESC
2917
- * Adiciona e remove event listener baseado no estado isOpen
2918
- */
2919
2925
  React.useEffect(() => {
2920
2926
  if (!isOpen || !closeOnEscape)
2921
2927
  return;
2922
- /**
2923
- * Manipula teclas pressionadas
2924
- * @param event - Evento de teclado
2925
- */
2926
2928
  const handleKeyDown = (event) => {
2927
2929
  if (event.key === 'Escape') {
2928
2930
  event.preventDefault();
@@ -2932,54 +2934,38 @@ onClose, title = 'Título', isOpen = false, onOpen, className, id, disabled = fa
2932
2934
  window.addEventListener('keydown', handleKeyDown);
2933
2935
  return () => window.removeEventListener('keydown', handleKeyDown);
2934
2936
  }, [isOpen, internalClose, closeOnEscape]);
2935
- /**
2936
- * Gerencia overflow do body baseado no estado isOpen
2937
- */
2938
2937
  React.useEffect(() => {
2939
2938
  if (isOpen && !disabled) {
2940
- // Executa callback de abertura se fornecido
2941
2939
  if (onOpen) {
2942
2940
  onOpen();
2943
2941
  }
2944
- // Previne scroll do body quando drawer está aberto
2945
2942
  document.body.style.overflow = 'hidden';
2946
2943
  }
2947
2944
  else {
2948
- // Restaura scroll do body
2949
2945
  document.body.style.overflow = 'unset';
2950
2946
  }
2951
2947
  return () => {
2952
2948
  document.body.style.overflow = 'unset';
2953
2949
  };
2954
2950
  }, [isOpen, onOpen, disabled]);
2955
- /**
2956
- * Previne propagação de eventos no drawer
2957
- * Evita fechamento acidental ao clicar no conteúdo
2958
- * @param event - Evento de clique
2959
- */
2960
2951
  const handleDrawerClick = (event) => {
2961
2952
  event.stopPropagation();
2962
2953
  };
2963
- /**
2964
- * Manipula clique no botão de fechar
2965
- * @param event - Evento de clique
2966
- */
2967
2954
  const handleCloseClick = (event) => {
2968
2955
  event.stopPropagation();
2969
2956
  internalClose();
2970
2957
  };
2971
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: clsx(styles$d['zds-custom__drawer-shadow'], {
2972
- [styles$d['zds-custom__drawer-shadow--visible']]: isOpen,
2973
- }), onClick: handleOverlayClick, role: "presentation", "aria-hidden": "true", "data-testid": "drawer-overlay" }), jsxRuntime.jsxs("div", { className: clsx(styles$d['zds-custom__drawer-sidebar'], {
2974
- [styles$d['zds-custom__drawer-sidebar--open']]: isOpen,
2975
- [styles$d['zds-custom__drawer-sidebar--disabled']]: disabled,
2958
+ return reactDom.createPortal(jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: clsx(styles$c['drawerShadow'], {
2959
+ [styles$c['drawerShadow--visible']]: isOpen,
2960
+ }), onClick: handleOverlayClick, role: "presentation", "aria-hidden": "true", "data-testid": "drawer-overlay" }), jsxRuntime.jsxs("div", { className: clsx(styles$c['drawerSidebar'], {
2961
+ [styles$c['drawerSidebar--open']]: isOpen,
2962
+ [styles$c['drawerSidebar--disabled']]: disabled,
2976
2963
  }, className), style: {
2977
- // ✅ APENAS: Width customizável via CSS custom property
2978
2964
  '--drawer-custom-width': customWidth,
2979
- }, onClick: handleDrawerClick, role: "dialog", "aria-modal": "true", "aria-labelledby": id ? `${id}-title` : 'drawer-title', "aria-hidden": !isOpen, "data-testid": "drawer-panel", id: id, children: [jsxRuntime.jsxs("div", { className: clsx(styles$d['zds-drawer__title-close']), children: [jsxRuntime.jsx("div", { className: clsx(styles$d['zds-drawer__title']), id: id ? `${id}-title` : 'drawer-title', children: title }), jsxRuntime.jsx(Button, { onClick: handleCloseClick, variant: 'text', iconOnly: true, icon: jsxRuntime.jsx(reactIcons.Dismiss16Regular, {}), size: 'lg' })] }), jsxRuntime.jsx("div", { className: clsx(styles$d['zds-drawer__children']), "data-testid": "drawer-content", children: children })] })] }));
2965
+ }, onClick: handleDrawerClick, role: "dialog", "aria-modal": "true", "aria-labelledby": id ? `${id}-title` : 'drawer-title', "aria-hidden": !isOpen, "data-testid": "drawer-panel", id: id, children: [jsxRuntime.jsxs("div", { className: styles$c.drawerTitleClose, children: [jsxRuntime.jsx("div", { className: styles$c.drawerTitle, id: id ? `${id}-title` : 'drawer-title', children: title }), headerContent && (jsxRuntime.jsx("div", { className: styles$c.drawerHeaderContent, children: headerContent })), jsxRuntime.jsx(Button, { onClick: handleCloseClick, variant: 'outlined', iconOnly: true, icon: jsxRuntime.jsx(reactIcons.Dismiss16Regular, {}), size: 'lg' })] }), jsxRuntime.jsx("div", { className: styles$c.drawerChildren, "data-testid": "drawer-content", children: children })] })] }), document.body);
2980
2966
  };
2981
2967
 
2982
- var styles$c = {"search":"Search-module__search___u3QsV","searchLeftIcon":"Search-module__searchLeftIcon___OKOBq","disabled":"Search-module__disabled___adbxO","searchClearIcon":"Search-module__searchClearIcon___qX9-h"};
2968
+ var styles$b = {"search":"Search-module__search___u3QsV","searchLeftIcon":"Search-module__searchLeftIcon___OKOBq","disabled":"Search-module__disabled___adbxO","searchClearIcon":"Search-module__searchClearIcon___qX9-h"};
2983
2969
 
2984
2970
  const Search = React.forwardRef(({ placeholder = 'Dica do que deve ser buscado', disabled = false, value, onChange, onKeyDown, onFocus, onBlur, onClear, onClick, onMouseDown, id, className, 'data-testid': testId, ...rest }, ref) => {
2985
2971
  const [internalValue, setInternalValue] = React.useState('');
@@ -3027,439 +3013,22 @@ const Search = React.forwardRef(({ placeholder = 'Dica do que deve ser buscado',
3027
3013
  return;
3028
3014
  onKeyDown?.(e);
3029
3015
  };
3030
- return (jsxRuntime.jsxs("div", { className: clsx(styles$c.search, { [styles$c.disabled]: disabled }, className), onClick: onClick, onMouseDown: onMouseDown, role: onClick || onMouseDown ? "button" : undefined, tabIndex: onClick || onMouseDown ? 0 : undefined, onKeyDown: onClick || onMouseDown ? (e) => {
3016
+ return (jsxRuntime.jsxs("div", { className: clsx(styles$b.search, { [styles$b.disabled]: disabled }, className), onClick: onClick, onMouseDown: onMouseDown, role: onClick || onMouseDown ? "button" : undefined, tabIndex: onClick || onMouseDown ? 0 : undefined, onKeyDown: onClick || onMouseDown ? (e) => {
3031
3017
  if (e.key === 'Enter' || e.key === ' ') {
3032
3018
  e.preventDefault();
3033
3019
  onClick?.(e);
3034
3020
  }
3035
- } : undefined, children: [jsxRuntime.jsx("span", { className: clsx(styles$c.searchLeftIcon, { [styles$c.disabled]: disabled }), tabIndex: -1, role: "presentation", "aria-hidden": "true", children: jsxRuntime.jsx(reactIcons.Search16Regular, {}) }), jsxRuntime.jsx("input", { ref: ref, id: inputId, type: "text", placeholder: placeholder, "aria-label": placeholder, value: currentValue || '', onChange: handleChange, onKeyDown: handleKeyDown, disabled: disabled, onFocus: handleFocus, onBlur: handleBlur, "data-testid": testId, ...rest }), currentValue && currentValue.length > 0 && (jsxRuntime.jsx("span", { className: styles$c.searchClearIcon, "aria-hidden": "true", onClick: clearInputSearch, children: jsxRuntime.jsx(reactIcons.Dismiss16Regular, {}) }))] }));
3021
+ } : undefined, children: [jsxRuntime.jsx("span", { className: clsx(styles$b.searchLeftIcon, { [styles$b.disabled]: disabled }), tabIndex: -1, role: "presentation", "aria-hidden": "true", children: jsxRuntime.jsx(reactIcons.Search16Regular, {}) }), jsxRuntime.jsx("input", { ref: ref, id: inputId, type: "text", placeholder: placeholder, "aria-label": placeholder, value: currentValue || '', onChange: handleChange, onKeyDown: handleKeyDown, disabled: disabled, onFocus: handleFocus, onBlur: handleBlur, "data-testid": testId, ...rest }), currentValue && currentValue.length > 0 && (jsxRuntime.jsx("span", { className: styles$b.searchClearIcon, "aria-hidden": "true", onClick: clearInputSearch, children: jsxRuntime.jsx(reactIcons.Dismiss16Regular, {}) }))] }));
3036
3022
  });
3037
3023
  Search.displayName = 'Search';
3038
3024
 
3039
- /**
3040
- * Valida e filtra itens do dropdown baseado no tipo especificado
3041
- * @param items - Array de itens para validar
3042
- * @param type - Tipo do dropdown ('text' | 'checkbox' | 'icon')
3043
- * @returns Array de itens válidos filtrados
3044
- */
3045
- const validateItems = (items, type) => {
3046
- if (!Array.isArray(items))
3047
- return [];
3048
- return items.filter((item, index) => {
3049
- // Remove items inválidos
3050
- if (!item || typeof item !== 'object') {
3051
- console.warn(`Dropdown: Item ${index} inválido`);
3052
- return false;
3053
- }
3054
- // Type assertion segura após verificação de tipo
3055
- const dropdownItem = item;
3056
- // Validação específica para tipo icon
3057
- if (type === 'icon' && !dropdownItem.icon) {
3058
- console.error(`Dropdown: Item ${index} precisa de ícone quando type='icon'`);
3059
- return false;
3060
- }
3061
- // Precisa ter text ou id
3062
- if (!dropdownItem.text && !dropdownItem.id) {
3063
- console.warn(`Dropdown: Item ${index} precisa de text ou id`);
3064
- return false;
3065
- }
3066
- return true;
3067
- });
3068
- };
3069
-
3070
- var styles$b = {"zds-dropdown__container":"Dropdown-module__zds-dropdown__container___UMV5O","zds-dropdown__container--top":"Dropdown-module__zds-dropdown__container--top___nys1y","zds-dropdown__container--bottom":"Dropdown-module__zds-dropdown__container--bottom___5ncXH","zds-dropdown__search-container":"Dropdown-module__zds-dropdown__search-container___5igq1","zds-dropdown__item":"Dropdown-module__zds-dropdown__item___bqAnI","zds-dropdown--disabled":"Dropdown-module__zds-dropdown--disabled___WF-ao","zds-dropdown__item--focused":"Dropdown-module__zds-dropdown__item--focused___ulKda","zds-dropdown__item--selected":"Dropdown-module__zds-dropdown__item--selected___K-Mk-","zds-dropdown__title":"Dropdown-module__zds-dropdown__title___emxcQ","zds-dropdown__subtext":"Dropdown-module__zds-dropdown__subtext___YzXrw","zds-dropdown__item-content":"Dropdown-module__zds-dropdown__item-content___E3qkd","zds-dropdown__item-content--disabled":"Dropdown-module__zds-dropdown__item-content--disabled___RmhHd","zds-dropdown__item-text":"Dropdown-module__zds-dropdown__item-text___D39Qy","zds-dropdown__item-icon":"Dropdown-module__zds-dropdown__item-icon___QdCJz","zds-dropdown__item-icon-container":"Dropdown-module__zds-dropdown__item-icon-container___ULMHu","zds-dropdown__no-results":"Dropdown-module__zds-dropdown__no-results___rUZ-Z","zds-dropdown__list":"Dropdown-module__zds-dropdown__list___d65nL","zds-checkbox":"Dropdown-module__zds-checkbox___rJTmR","zds-dropdown__item--checkbox":"Dropdown-module__zds-dropdown__item--checkbox___z94nE","zds-dropdown__container-filter":"Dropdown-module__zds-dropdown__container-filter___Deixf","zds-dropdown__infinite-scroll-trigger":"Dropdown-module__zds-dropdown__infinite-scroll-trigger___RA9Gd","zds-dropdown__loading-indicator":"Dropdown-module__zds-dropdown__loading-indicator___Zf-uW"};
3025
+ var styles$a = {"container":"Filter-module__container___cqntK","panel":"Filter-module__panel___19HqD","search":"Filter-module__search___f0gzj","list":"Filter-module__list___UpBk1","item":"Filter-module__item___oNdeY","itemSelected":"Filter-module__itemSelected___JIpJV","itemText":"Filter-module__itemText___RS--0","itemDisabled":"Filter-module__itemDisabled___X-ktg","itemIcon":"Filter-module__itemIcon___RjJSa","noResults":"Filter-module__noResults___3m6pn","footer":"Filter-module__footer___yYS5j","buttonContent":"Filter-module__buttonContent___28fKe","buttonArrow":"Filter-module__buttonArrow___VJlpc","buttonIcon":"Filter-module__buttonIcon___OOBpZ"};
3071
3026
 
3072
- /**
3073
- * Hook otimizado para scroll infinito usando IntersectionObserver
3074
- */
3075
- function useInfiniteScroll({ status, page, lastPage, onLoadMore, threshold = 0.1, rootMargin = '100px', enabled = true, debug = false }) {
3076
- const observerRef = React.useRef(null);
3077
- const [isIntersecting, setIsIntersecting] = React.useState(false);
3078
- // Refs para controle de estado
3079
- const loadingRef = React.useRef(false);
3080
- const lastTriggeredPageRef = React.useRef(0);
3081
- const onLoadMoreRef = React.useRef(onLoadMore);
3082
- // Manter referência atualizada do callback
3083
- React.useEffect(() => {
3084
- onLoadMoreRef.current = onLoadMore;
3085
- }, [onLoadMore]);
3086
- // ✅ NOVO: Debug logger
3087
- const debugLog = React.useCallback((message, data) => {
3088
- if (debug) {
3089
- console.log(`🔄 [InfiniteScroll] ${message}`, data || '');
3090
- }
3091
- }, [debug]);
3092
- // ✅ MELHORADO: Callback do IntersectionObserver com mais controles
3093
- const handleIntersect = React.useCallback((entries) => {
3094
- const [target] = entries;
3095
- const isVisible = target.isIntersecting;
3096
- setIsIntersecting(isVisible);
3097
- debugLog('Element intersecting:', isVisible);
3098
- // Verificar se pode carregar mais
3099
- const canLoadMore = enabled &&
3100
- isVisible &&
3101
- status !== 'loading' &&
3102
- !loadingRef.current &&
3103
- page < lastPage &&
3104
- page !== lastTriggeredPageRef.current;
3105
- debugLog('Can load more check:', {
3106
- enabled,
3107
- isVisible,
3108
- status,
3109
- isLoading: loadingRef.current,
3110
- page,
3111
- lastPage,
3112
- lastTriggered: lastTriggeredPageRef.current,
3113
- canLoad: canLoadMore
3114
- });
3115
- if (canLoadMore) {
3116
- debugLog('Triggering load more for next page');
3117
- loadingRef.current = true;
3118
- lastTriggeredPageRef.current = page;
3119
- onLoadMoreRef.current();
3120
- }
3121
- }, [enabled, status, page, lastPage, debugLog]);
3122
- // ✅ MELHORADO: Observer com configurações personalizáveis
3123
- React.useEffect(() => {
3124
- if (!enabled) {
3125
- debugLog('Hook disabled, skipping observer setup');
3126
- return;
3127
- }
3128
- const observer = new IntersectionObserver(handleIntersect, {
3129
- root: null,
3130
- rootMargin,
3131
- threshold,
3132
- });
3133
- const currentObserverRef = observerRef.current;
3134
- if (currentObserverRef) {
3135
- observer.observe(currentObserverRef);
3136
- debugLog('IntersectionObserver attached', { rootMargin, threshold });
3137
- }
3138
- return () => {
3139
- if (currentObserverRef) {
3140
- observer.unobserve(currentObserverRef);
3141
- debugLog('IntersectionObserver detached');
3142
- }
3143
- };
3144
- }, [handleIntersect, rootMargin, threshold, enabled, debugLog]);
3145
- // ✅ NOVO: Reset do loading flag quando status muda
3146
- React.useEffect(() => {
3147
- if (status !== 'loading') {
3148
- loadingRef.current = false;
3149
- debugLog('Loading flag reset', { status });
3150
- }
3151
- }, [status, debugLog]);
3152
- // ✅ NOVO: Função de reset manual
3153
- const reset = React.useCallback(() => {
3154
- loadingRef.current = false;
3155
- lastTriggeredPageRef.current = 0;
3156
- setIsIntersecting(false);
3157
- debugLog('Hook manually reset');
3158
- }, [debugLog]);
3159
- // Estados calculados
3160
- const hasNextPage = page < lastPage;
3161
- const isCompleted = page >= lastPage;
3162
- return {
3163
- observerRef,
3164
- isIntersecting,
3165
- hasNextPage,
3166
- isCompleted,
3167
- reset
3168
- };
3169
- }
3170
-
3171
- const Dropdown = ({ className, items, id, type = 'text', applySearch = false, placeholder, onSelectionChange, showSubText = false, defaultSelectedIds, initialItemsSelected, maxWidth, minWidth, width, maxHeight, filter = false, position, infiniteScroll, }) => {
3172
- const [selectedItems, setSelectedItems] = React.useState(() => {
3173
- if (initialItemsSelected && Object.keys(initialItemsSelected).length > 0) {
3174
- return initialItemsSelected;
3175
- }
3176
- if (defaultSelectedIds && defaultSelectedIds.length > 0) {
3177
- const initialState = {};
3178
- defaultSelectedIds.forEach((itemId) => {
3179
- initialState[itemId] = true;
3180
- });
3181
- return initialState;
3182
- }
3183
- return {};
3184
- });
3185
- const [internalItems, setInternalItems] = React.useState(items);
3186
- const [focusedIndex, setFocusedIndex] = React.useState(-1);
3187
- const [inputValue, setInputValue] = React.useState('');
3188
- const [searchQuery, setSearchQuery] = React.useState('');
3189
- const [isSearchFocused, setIsSearchFocused] = React.useState(false);
3190
- const [tempSelectedItems, setTempSelectedItems] = React.useState({});
3191
- const containerRef = React.useRef(null);
3192
- const infiniteScrollHook = useInfiniteScroll({
3193
- status: infiniteScroll?.status || 'idle',
3194
- page: infiniteScroll?.page || 1,
3195
- lastPage: infiniteScroll?.lastPage || 1,
3196
- onLoadMore: infiniteScroll?.onLoadMore || (() => { }),
3197
- threshold: infiniteScroll?.threshold,
3198
- rootMargin: infiniteScroll?.rootMargin,
3199
- enabled: !!infiniteScroll,
3200
- debug: infiniteScroll?.debug,
3201
- });
3202
- const searchVisible = applySearch || internalItems.length > 4;
3203
- React.useEffect(() => {
3204
- if (filter) {
3205
- setTempSelectedItems(selectedItems);
3206
- }
3207
- }, [selectedItems, filter]);
3208
- const handleSearchChange = React.useCallback((event) => {
3209
- const newValue = event.target.value;
3210
- setInputValue(newValue);
3211
- setFocusedIndex(-1);
3212
- if (newValue === '' && searchQuery !== '') {
3213
- setSearchQuery('');
3214
- }
3215
- }, [searchQuery]);
3216
- const safeItems = React.useMemo(() => {
3217
- if (!Array.isArray(items)) {
3218
- console.warn('Dropdown: items deve ser um array. Recebido:', typeof items);
3219
- return [];
3220
- }
3221
- if (items.length === 0) {
3222
- return [];
3223
- }
3224
- return items;
3225
- }, [items]);
3226
- const validItems = React.useMemo(() => {
3227
- return validateItems(safeItems, type);
3228
- }, [safeItems, type]);
3229
- const generateItemId = React.useCallback((item, index) => {
3230
- return item.id || `dropdown-item-${index}`;
3231
- }, []);
3232
- const executeSearch = React.useCallback(() => {
3233
- setSearchQuery(inputValue.trim());
3234
- setFocusedIndex(-1);
3235
- }, [inputValue]);
3236
- const handleSearchClear = React.useCallback(() => {
3237
- setInputValue('');
3238
- setSearchQuery('');
3239
- setFocusedIndex(-1);
3240
- setIsSearchFocused(false);
3241
- }, []);
3242
- const handleSearchKeyDown = React.useCallback((event) => {
3243
- if (event.key === 'Enter') {
3244
- event.preventDefault();
3245
- event.stopPropagation();
3246
- executeSearch();
3247
- return;
3248
- }
3249
- if (event.key === 'Escape') {
3250
- event.preventDefault();
3251
- event.stopPropagation();
3252
- handleSearchClear();
3253
- return;
3254
- }
3255
- if (event.key === 'Backspace') {
3256
- if (inputValue.length < 2) {
3257
- event.preventDefault();
3258
- event.stopPropagation();
3259
- handleSearchClear();
3260
- }
3261
- }
3262
- }, [executeSearch, handleSearchClear, inputValue]);
3263
- const toggleSelection = React.useCallback((itemId, item) => {
3264
- if (item?.disabled)
3265
- return;
3266
- if (filter) {
3267
- setTempSelectedItems((prevSelected) => {
3268
- let newSelected;
3269
- if (type === 'checkbox') {
3270
- newSelected = {
3271
- ...prevSelected,
3272
- [itemId]: !prevSelected[itemId],
3273
- };
3274
- }
3275
- else {
3276
- newSelected = prevSelected[itemId] ? {} : { [itemId]: true };
3277
- }
3278
- return newSelected;
3279
- });
3280
- }
3281
- else {
3282
- setSelectedItems((prevSelected) => {
3283
- let newSelected;
3284
- if (type === 'checkbox') {
3285
- newSelected = {
3286
- ...prevSelected,
3287
- [itemId]: !prevSelected[itemId],
3288
- };
3289
- }
3290
- else {
3291
- newSelected = prevSelected[itemId] ? {} : { [itemId]: true };
3292
- }
3293
- return newSelected;
3294
- });
3295
- }
3296
- }, [filter, type]);
3297
- const handleApplyFilter = React.useCallback(() => {
3298
- if (!filter)
3299
- return;
3300
- setSelectedItems(tempSelectedItems);
3301
- const selectedIds = Object.keys(tempSelectedItems).filter((key) => tempSelectedItems[key]);
3302
- onSelectionChange?.(selectedIds);
3303
- }, [filter, tempSelectedItems, onSelectionChange]);
3304
- const handleClearFilter = React.useCallback(() => {
3305
- if (!filter)
3306
- return;
3307
- setTempSelectedItems({});
3308
- setSelectedItems({});
3309
- onSelectionChange?.([]);
3310
- }, [filter, onSelectionChange]);
3311
- const isFirstRender = React.useRef(true);
3312
- React.useEffect(() => {
3313
- if (isFirstRender.current) {
3314
- isFirstRender.current = false;
3315
- return;
3316
- }
3317
- if (!onSelectionChange)
3318
- return;
3319
- const selectedIds = Object.keys(selectedItems).filter((key) => selectedItems[key]);
3320
- onSelectionChange(selectedIds);
3321
- }, [selectedItems, onSelectionChange]);
3322
- React.useEffect(() => {
3323
- setInternalItems(validItems);
3324
- }, [validItems]);
3325
- const handleItemClick = React.useCallback((event, itemId, item) => {
3326
- event.preventDefault();
3327
- event.stopPropagation();
3328
- if (!item?.disabled) {
3329
- toggleSelection(itemId, item);
3330
- }
3331
- }, [toggleSelection]);
3332
- const renderItemContent = React.useCallback((item, index) => {
3333
- const itemId = item.id || `dropdown-item-${index}`;
3334
- const currentSelection = filter ? tempSelectedItems : selectedItems;
3335
- return (jsxRuntime.jsxs("div", { className: clsx(styles$b['zds-dropdown__item-content'], {
3336
- [styles$b['zds-dropdown__item-content--disabled']]: item.disabled,
3337
- }), children: [type === 'checkbox' && (jsxRuntime.jsx(Checkbox, { checked: !!currentSelection[itemId], onCheckedChange: (checked) => {
3338
- if (checked === 'indeterminate')
3339
- return;
3340
- toggleSelection(itemId, item);
3341
- }, disabled: item.disabled, label: "" })), type === 'icon' && item.icon && (jsxRuntime.jsx("div", { className: styles$b['zds-dropdown__item-icon-container'], children: jsxRuntime.jsx("span", { className: styles$b['zds-dropdown__item-icon'], onClick: (event) => {
3342
- event.preventDefault();
3343
- event.stopPropagation();
3344
- handleItemClick(event, itemId, item);
3345
- }, children: item.icon }) })), jsxRuntime.jsxs("div", { className: styles$b['zds-dropdown__item-text'], children: [jsxRuntime.jsx("span", { id: `dropdown-item-${itemId}-label`, className: styles$b['zds-dropdown__title'], children: item.text }), showSubText && item.subText && (jsxRuntime.jsx("span", { id: `dropdown-item-${itemId}-desc`, className: styles$b['zds-dropdown__subtext'], children: item.subText }))] })] }));
3346
- }, [
3347
- type,
3348
- selectedItems,
3349
- tempSelectedItems,
3350
- filter,
3351
- toggleSelection,
3352
- handleItemClick,
3353
- showSubText,
3354
- ]);
3355
- const isMultiSelectable = React.useMemo(() => {
3356
- return type === 'checkbox';
3357
- }, [type]);
3358
- const filteredItems = React.useMemo(() => {
3359
- if (!searchQuery.trim()) {
3360
- return internalItems;
3361
- }
3362
- return internalItems.filter((item) => {
3363
- const searchText = searchQuery.toLowerCase();
3364
- const itemText = item.text?.toLowerCase() || '';
3365
- const itemSubText = item.subText?.toLowerCase() || '';
3366
- return itemText.includes(searchText) || itemSubText.includes(searchText);
3367
- });
3368
- }, [internalItems, searchQuery]);
3369
- const handleKeyDown = React.useCallback((e) => {
3370
- if (isSearchFocused)
3371
- return;
3372
- if (filteredItems.length === 0)
3373
- return;
3374
- switch (e.key) {
3375
- case 'ArrowDown':
3376
- e.preventDefault();
3377
- e.stopPropagation();
3378
- setFocusedIndex((prevIndex) => prevIndex < filteredItems.length - 1 ? prevIndex + 1 : 0);
3379
- return;
3380
- case 'ArrowUp':
3381
- e.preventDefault();
3382
- e.stopPropagation();
3383
- setFocusedIndex((prevIndex) => prevIndex > 0 ? prevIndex - 1 : filteredItems.length - 1);
3384
- return;
3385
- case 'Enter':
3386
- e.preventDefault();
3387
- e.stopPropagation();
3388
- if (focusedIndex >= 0 && focusedIndex < filteredItems.length) {
3389
- const focusedItem = filteredItems[focusedIndex];
3390
- const focusedItemId = focusedItem.id || `dropdown-item-${focusedIndex}`;
3391
- toggleSelection(focusedItemId, focusedItem);
3392
- }
3393
- return;
3394
- case 'Escape':
3395
- e.preventDefault();
3396
- e.stopPropagation();
3397
- setFocusedIndex(-1);
3398
- handleSearchClear();
3399
- return;
3400
- default:
3401
- return;
3402
- }
3403
- }, [
3404
- filteredItems,
3405
- focusedIndex,
3406
- toggleSelection,
3407
- isSearchFocused,
3408
- handleSearchClear,
3409
- ]);
3410
- const DropdownClass = clsx(styles$b['zds-dropdown__container'], styles$b[`zds-dropdown__container--${position}`], {
3411
- [className || '']: className,
3412
- [styles$b['zds-dropdown__container--search-active']]: searchQuery.length > 0,
3413
- [styles$b['zds-dropdown__container--fixed-width']]: !!maxWidth,
3414
- });
3415
- const dropdownStyles = React.useMemo(() => {
3416
- const styles = {};
3417
- if (maxWidth) {
3418
- styles.maxWidth =
3419
- typeof maxWidth === 'number' ? `${maxWidth}px` : maxWidth;
3420
- styles.width = typeof maxWidth === 'number' ? `${maxWidth}px` : maxWidth;
3421
- }
3422
- if (minWidth) {
3423
- styles.minWidth =
3424
- typeof minWidth === 'number' ? `${minWidth}px` : minWidth;
3425
- }
3426
- if (width) {
3427
- styles.width = typeof width === 'number' ? `${width}px` : width;
3428
- }
3429
- if (maxHeight) {
3430
- styles.maxHeight =
3431
- typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight;
3432
- }
3433
- return styles;
3434
- }, [maxWidth, minWidth, width, maxHeight]);
3435
- return (jsxRuntime.jsx("div", { ref: containerRef, className: DropdownClass, tabIndex: 0, role: "combobox", "aria-expanded": filteredItems.length > 0 ? 'true' : 'false', "aria-haspopup": "listbox", "aria-owns": id ? `${id}-listbox` : undefined, "aria-controls": id ? `${id}-listbox` : undefined, "aria-activedescendant": focusedIndex >= 0 ? `${id}-option-${focusedIndex}` : undefined, "aria-label": "Dropdown de sele\u00E7\u00E3o", "aria-describedby": searchVisible ? `${id}-search-help` : undefined, onKeyDown: handleKeyDown, style: dropdownStyles, children: jsxRuntime.jsxs("ul", { className: styles$b['zds-dropdown__list'], id: id || undefined, role: "listbox", "aria-label": "Lista de op\u00E7\u00F5es", "aria-multiselectable": isMultiSelectable, children: [searchVisible && (jsxRuntime.jsx("li", { role: "none", className: styles$b['zds-dropdown__search-container'], children: jsxRuntime.jsx(Search, { value: inputValue, placeholder: placeholder || 'Digite e pressione Enter para buscar...', onChange: handleSearchChange, onKeyDown: handleSearchKeyDown, onFocus: () => setIsSearchFocused(true), onBlur: () => setIsSearchFocused(false), onClear: handleSearchClear, "aria-label": "Campo de busca - pressione Enter para pesquisar" }) })), filteredItems.length > 0 ? (filteredItems.map((item, index) => {
3436
- const itemId = generateItemId(item, index);
3437
- const currentSelection = filter ? tempSelectedItems : selectedItems;
3438
- return (jsxRuntime.jsx("li", { role: "option", "aria-selected": !!currentSelection[itemId], "aria-labelledby": `dropdown-item-${itemId}-label`, "aria-describedby": item.subText ? `dropdown-item-${itemId}-desc` : undefined, className: clsx(styles$b['zds-dropdown__item'], {
3439
- [styles$b[`zds-dropdown__item--${type}`]]: type,
3440
- [styles$b['zds-dropdown__item--selected']]: currentSelection[itemId],
3441
- [styles$b['zds-dropdown__item--focused']]: focusedIndex === index,
3442
- [styles$b['zds-dropdown__item--disabled']]: item.disabled,
3443
- }), tabIndex: focusedIndex === index ? 0 : -1, onFocus: () => setFocusedIndex(index), onClick: (event) => {
3444
- event.stopPropagation();
3445
- handleItemClick(event, itemId, item);
3446
- }, onMouseDown: (e) => {
3447
- if (!item.disabled) {
3448
- e.preventDefault();
3449
- setFocusedIndex(index);
3450
- }
3451
- }, children: renderItemContent(item, index) }, itemId));
3452
- })) : (jsxRuntime.jsx("li", { className: styles$b['zds-dropdown__no-results'], role: "status", "aria-live": "polite", children: "Nenhum item corresponde \u00E0 sua busca" })), filter && (jsxRuntime.jsxs("div", { className: styles$b['zds-dropdown__container-filter'], children: [jsxRuntime.jsx(Button, { size: "sm", variant: "outlined", onClick: handleClearFilter, children: "Limpar" }), jsxRuntime.jsx(Button, { size: "sm", onClick: handleApplyFilter, children: "Aplicar" })] })), infiniteScrollHook && infiniteScrollHook.hasNextPage && (jsxRuntime.jsx("li", { role: "none", className: styles$b['zds-dropdown__infinite-scroll-trigger'], children: jsxRuntime.jsx("div", { ref: infiniteScrollHook.observerRef, className: styles$b['zds-dropdown__loading-indicator'], children: infiniteScroll?.status === 'loading' ? (jsxRuntime.jsx("span", { children: "Carregando..." })) : (jsxRuntime.jsx("span", { children: "Trigger" })) }) }))] }) }));
3453
- };
3454
- const MemoizedDropdown = React.memo(Dropdown);
3455
- MemoizedDropdown.displayName = 'Dropdown';
3456
-
3457
- var styles$a = {"zds-filter__container":"Filter-module__zds-filter__container___0E-nC","zds-filter__button":"Filter-module__zds-filter__button___gT9yM","zds-filter__icon":"Filter-module__zds-filter__icon___ypiCu","zds-filter__text":"Filter-module__zds-filter__text___1iywL","zds-filter__arrow":"Filter-module__zds-filter__arrow___xflU2","zds-filter__arrow--up":"Filter-module__zds-filter__arrow--up___R0HR-","zds-filter__arrow--down":"Filter-module__zds-filter__arrow--down___4YMmg","zds-filter__button--open":"Filter-module__zds-filter__button--open___OA6EF","zds-filter__dropdown":"Filter-module__zds-filter__dropdown___-67MJ","zds-filter__dropdown--left":"Filter-module__zds-filter__dropdown--left___GgonW","zds-filter__dropdown--right":"Filter-module__zds-filter__dropdown--right___7GS9L","zds-filter-button__content":"Filter-module__zds-filter-button__content___eNIIz","zds-filter-button__arrow":"Filter-module__zds-filter-button__arrow___ZhymS","zds-filter-button__icon":"Filter-module__zds-filter-button__icon___-42Ey"};
3458
-
3459
- const Filter = ({ items, type = 'checkbox', selectedIds, onApplyFilter, placeholder = 'Selecionar...', enableSearch = false, buttonText = 'Filter', icon, variant = 'outlined', onOpen, onClose, position = 'left', disabled = false, className, selectedDate, onDateSelect, onClearDate, minDate, maxDate, locale = 'pt-br', ...rest }) => {
3027
+ const Filter = ({ items, type = 'checkbox', selectedIds, onApplyFilter, placeholder = 'Selecionar...', enableSearch = false, buttonText = 'Filter', icon, variant = 'outlined', onOpen, onClose, side = 'bottom', align = 'start', disabled = false, className, selectedDate, onDateSelect, onClearDate, minDate, maxDate, locale = 'pt-br', id, ...rest }) => {
3460
3028
  const [isOpen, setIsOpen] = React.useState(false);
3029
+ const [tempSelectedItems, setTempSelectedItems] = React.useState({});
3030
+ const [searchQuery, setSearchQuery] = React.useState('');
3461
3031
  const [currentCalendarDate, setCurrentCalendarDate] = React.useState(() => selectedDate || new Date());
3462
- const filterRef = React.useRef(null);
3463
3032
  React.useEffect(() => {
3464
3033
  if (selectedDate) {
3465
3034
  setCurrentCalendarDate(selectedDate);
@@ -3479,6 +3048,59 @@ const Filter = ({ items, type = 'checkbox', selectedIds, onApplyFilter, placehol
3479
3048
  setIsOpen(false);
3480
3049
  onClose?.();
3481
3050
  }, [onClearDate, onClose]);
3051
+ const handleOpenChange = React.useCallback((open) => {
3052
+ if (disabled && open)
3053
+ return;
3054
+ if (open) {
3055
+ const initial = {};
3056
+ selectedIds?.forEach((itemId) => { initial[itemId] = true; });
3057
+ setTempSelectedItems(initial);
3058
+ setSearchQuery('');
3059
+ onOpen?.();
3060
+ }
3061
+ else {
3062
+ onClose?.();
3063
+ }
3064
+ setIsOpen(open);
3065
+ }, [disabled, selectedIds, onOpen, onClose]);
3066
+ const toggleItem = React.useCallback((itemId, item) => {
3067
+ if (item.disabled)
3068
+ return;
3069
+ setTempSelectedItems((prev) => {
3070
+ if (type === 'checkbox') {
3071
+ return { ...prev, [itemId]: !prev[itemId] };
3072
+ }
3073
+ return prev[itemId] ? {} : { [itemId]: true };
3074
+ });
3075
+ }, [type]);
3076
+ const handleApplyFilter = React.useCallback(() => {
3077
+ const ids = Object.keys(tempSelectedItems).filter((k) => tempSelectedItems[k]);
3078
+ onApplyFilter?.(ids);
3079
+ setIsOpen(false);
3080
+ onClose?.();
3081
+ }, [tempSelectedItems, onApplyFilter, onClose]);
3082
+ const handleClearFilter = React.useCallback(() => {
3083
+ setTempSelectedItems({});
3084
+ onApplyFilter?.([]);
3085
+ }, [onApplyFilter]);
3086
+ const handleSearchChange = React.useCallback((e) => {
3087
+ setSearchQuery(e.target.value);
3088
+ }, []);
3089
+ const handleSearchKeyDown = React.useCallback((e) => {
3090
+ if (e.key === 'Escape') {
3091
+ e.preventDefault();
3092
+ setSearchQuery('');
3093
+ }
3094
+ }, []);
3095
+ const searchVisible = enableSearch || (items?.length ?? 0) > 4;
3096
+ const filteredItems = React.useMemo(() => {
3097
+ if (!items?.length)
3098
+ return [];
3099
+ if (!searchQuery.trim())
3100
+ return items;
3101
+ const q = searchQuery.toLowerCase();
3102
+ return items.filter((item) => item.text.toLowerCase().includes(q));
3103
+ }, [items, searchQuery]);
3482
3104
  const buttonDisplayText = React.useMemo(() => {
3483
3105
  if (type === 'calendar' && selectedDate) {
3484
3106
  return selectedDate.toLocaleDateString(locale === 'pt-br' ? 'pt-BR' : 'en-US');
@@ -3489,60 +3111,26 @@ const Filter = ({ items, type = 'checkbox', selectedIds, onApplyFilter, placehol
3489
3111
  return firstItem?.text || selectedIds[0];
3490
3112
  }, [type, selectedDate, selectedIds, items, buttonText, locale]);
3491
3113
  const getBadgeValue = React.useCallback(() => {
3492
- if (!selectedIds || selectedIds.length <= 1) {
3114
+ if (!selectedIds || selectedIds.length <= 1)
3493
3115
  return null;
3494
- }
3495
3116
  return selectedIds.length - 1;
3496
3117
  }, [selectedIds]);
3497
- const handleToggle = React.useCallback(() => {
3498
- if (disabled)
3499
- return;
3500
- const newState = !isOpen;
3501
- setIsOpen(newState);
3502
- if (newState) {
3503
- onOpen?.();
3504
- }
3505
- else {
3506
- onClose?.();
3507
- }
3508
- }, [disabled, isOpen, onOpen, onClose]);
3509
- const handleApplyFilter = React.useCallback((newSelectedIds) => {
3510
- onApplyFilter?.(newSelectedIds);
3511
- setIsOpen(false);
3512
- onClose?.();
3513
- }, [onApplyFilter, onClose]);
3514
- React.useEffect(() => {
3515
- const handleClickOutside = (event) => {
3516
- if (filterRef.current &&
3517
- !filterRef.current.contains(event.target)) {
3518
- if (isOpen) {
3519
- setIsOpen(false);
3520
- onClose?.();
3521
- }
3522
- }
3523
- };
3524
- if (isOpen) {
3525
- document.addEventListener('mousedown', handleClickOutside);
3526
- }
3527
- return () => document.removeEventListener('mousedown', handleClickOutside);
3528
- }, [isOpen, onClose]);
3529
- React.useEffect(() => {
3530
- const handleEscape = (event) => {
3531
- if (event.key === 'Escape' && isOpen) {
3532
- setIsOpen(false);
3533
- onClose?.();
3534
- }
3535
- };
3536
- if (isOpen) {
3537
- document.addEventListener('keydown', handleEscape);
3538
- }
3539
- return () => document.removeEventListener('keydown', handleEscape);
3540
- }, [isOpen, onClose]);
3541
- const filterClass = clsx(styles$a['zds-filter__container'], className);
3542
- const dropdownClass = clsx(styles$a['zds-filter__dropdown'], {
3543
- [styles$a[`zds-filter__dropdown--${position}`]]: position,
3544
- });
3545
- return (jsxRuntime.jsxs("div", { ref: filterRef, className: filterClass, ...rest, children: [jsxRuntime.jsx(Button, { variant: variant, onClick: handleToggle, disabled: disabled, icon: type === 'calendar' ? jsxRuntime.jsx(reactIcons.Calendar16Regular, {}) : jsxRuntime.jsx(reactIcons.ChevronDownRegular, {}), iconPosition: "right", size: "lg", children: jsxRuntime.jsxs("div", { className: styles$a['zds-filter-button__content'], children: [icon && jsxRuntime.jsx("span", { className: styles$a['zds-filter-button__icon'], children: icon }), jsxRuntime.jsx("span", { className: styles$a['zds-filter-button__text'], children: buttonDisplayText }), jsxRuntime.jsx("span", { className: `${styles$a['zds-filter-button__arrow']} ${isOpen ? styles$a['zds-filter-button__arrow--open'] : ''}`, children: getBadgeValue() && (jsxRuntime.jsx(Badge, { badgeValue: `+${getBadgeValue()}`, type: "status" })) })] }) }), isOpen && (jsxRuntime.jsx("div", { className: dropdownClass, children: type === 'calendar' ? (jsxRuntime.jsx(Calendar, { currentDate: currentCalendarDate, selectedDate: selectedDate, onDaySelect: handleDateSelection, onDateChange: handleCalendarNavigation, minDate: minDate, maxDate: maxDate, locale: locale, onClear: handleClear, id: `filter-calendar-${filterRef.current?.id || ''}`, "aria-label": "Selecionar data para filtro" })) : (jsxRuntime.jsx(MemoizedDropdown, { items: items || [], type: type, defaultSelectedIds: selectedIds, placeholder: placeholder, applySearch: enableSearch, filter: true, onSelectionChange: handleApplyFilter })) }))] }));
3118
+ const filterClass = clsx(styles$a.container, className);
3119
+ const triggerButton = (jsxRuntime.jsx(Button, { variant: variant, disabled: disabled, icon: type === 'calendar' ? jsxRuntime.jsx(reactIcons.Calendar16Regular, {}) : jsxRuntime.jsx(reactIcons.ChevronDownRegular, {}), iconPosition: "right", size: "lg", children: jsxRuntime.jsxs("div", { className: styles$a.buttonContent, children: [icon && jsxRuntime.jsx("span", { className: styles$a.buttonIcon, children: icon }), jsxRuntime.jsx("span", { className: styles$a.buttonText, children: buttonDisplayText }), jsxRuntime.jsx("span", { className: clsx(styles$a.buttonArrow, { [styles$a.buttonArrowOpen]: isOpen }), children: getBadgeValue() && (jsxRuntime.jsx(Badge, { badgeValue: `+${getBadgeValue()}`, type: "status" })) })] }) }));
3120
+ const popoverContent = type === 'calendar' ? (jsxRuntime.jsx(Calendar, { currentDate: currentCalendarDate, selected: selectedDate, onDaySelect: handleDateSelection, onDateChange: handleCalendarNavigation, minDate: minDate, maxDate: maxDate, locale: locale, onClear: handleClear, id: `filter-calendar-${id || ''}`, "aria-label": "Selecionar data para filtro" })) : (jsxRuntime.jsxs("div", { className: styles$a.panel, children: [searchVisible && (jsxRuntime.jsx("div", { className: styles$a.search, children: jsxRuntime.jsx(Search, { value: searchQuery, placeholder: placeholder, onChange: handleSearchChange, onKeyDown: handleSearchKeyDown, onClear: () => setSearchQuery('') }) })), jsxRuntime.jsx("ul", { className: styles$a.list, role: "listbox", "aria-multiselectable": type === 'checkbox', children: filteredItems.length > 0 ? (filteredItems.map((item, index) => {
3121
+ const itemId = item.id || `filter-item-${index}`;
3122
+ const isSelected = !!tempSelectedItems[itemId];
3123
+ return (jsxRuntime.jsxs("li", { role: "option", "aria-selected": isSelected, "aria-disabled": item.disabled, className: clsx(styles$a.item, {
3124
+ [styles$a.itemSelected]: isSelected,
3125
+ [styles$a.itemDisabled]: item.disabled,
3126
+ }), onMouseDown: (e) => e.preventDefault(), onClick: () => toggleItem(itemId, item), onKeyDown: (e) => {
3127
+ if (e.key === 'Enter' || e.key === ' ') {
3128
+ e.preventDefault();
3129
+ toggleItem(itemId, item);
3130
+ }
3131
+ }, children: [type === 'checkbox' && (jsxRuntime.jsx(Checkbox, { checked: isSelected, disabled: item.disabled, label: "" })), type === 'icon' && item.icon && (jsxRuntime.jsx("span", { className: styles$a.itemIcon, children: item.icon })), jsxRuntime.jsx("span", { className: styles$a.itemText, children: item.text })] }, itemId));
3132
+ })) : (jsxRuntime.jsx("li", { className: styles$a.noResults, role: "status", "aria-live": "polite", children: "Nenhum item encontrado" })) }), jsxRuntime.jsxs("div", { className: styles$a.footer, children: [jsxRuntime.jsx(Button, { fullWidth: true, variant: "outlined", onClick: handleClearFilter, children: "Limpar" }), jsxRuntime.jsx(Button, { fullWidth: true, onClick: handleApplyFilter, children: "Aplicar" })] })] }));
3133
+ return (jsxRuntime.jsx("div", { className: filterClass, id: id, ...rest, children: jsxRuntime.jsx(Popover, { open: isOpen, onOpenChange: handleOpenChange, side: side, align: align, onOpenAutoFocus: (e) => e.preventDefault(), trigger: triggerButton, content: popoverContent }) }));
3546
3134
  };
3547
3135
 
3548
3136
  var styles$9 = {"zds-list-item__container":"ListItem-module__zds-list-item__container___mEIUK","zds-list-item--checkbox":"ListItem-module__zds-list-item--checkbox___wfi9-","zds-list-item--icon":"ListItem-module__zds-list-item--icon___h3Ijt","zds-list-item--radio":"ListItem-module__zds-list-item--radio___2l7mK","zds-list-item--text":"ListItem-module__zds-list-item--text___F0PDx","zds-list-item--hovered":"ListItem-module__zds-list-item--hovered___XrDWn","zds-list-item--disabled":"ListItem-module__zds-list-item--disabled___p1xZF","zds-list-item__wrapper-text":"ListItem-module__zds-list-item__wrapper-text___5-TX2","zds-list-item__wrapper-icon":"ListItem-module__zds-list-item__wrapper-icon___S6Fr1","zds-list-item__title":"ListItem-module__zds-list-item__title___AV7nz","zds-list-item__subtext":"ListItem-module__zds-list-item__subtext___nfXky","zds-list-item__text":"ListItem-module__zds-list-item__text___3y0sB"};
@@ -3890,13 +3478,7 @@ const Menu = ({ items, children, onItemSelect, search, enableInfiniteScroll, onS
3890
3478
  }, ...rest, children: [search && (jsxRuntime.jsx("div", { className: styles$7.searchWrapper, children: jsxRuntime.jsx(Search, { placeholder: "Buscar", onChange: handleSearchChange, value: searchInput, onKeyDown: handleSearchKeyDown }) })), jsxRuntime.jsxs("div", { className: styles$7.itemsWrapper, ref: itemsWrapperRef, style: { maxHeight: maxHeightStyle }, children: [filteredItems.length > 0 ? (filteredItems.map((item, index) => renderMenuItem(item, item.value || item.text || `item-${index}`))) : (jsxRuntime.jsx("div", { className: styles$7.emptyState, children: "Nenhum item encontrado" })), enableInfiniteScroll && isLoadingMore && (jsxRuntime.jsx("div", { className: styles$7.loadingMore, children: "Carregando mais itens..." })), enableInfiniteScroll && (jsxRuntime.jsx("div", { ref: sentinelRef, "data-scroll-sentinel": true, style: { height: '1px', visibility: 'hidden' } }))] })] }) })] }));
3891
3479
  };
3892
3480
 
3893
- var styles$6 = {"Content":"Popover-module__Content___RIETg","Arrow":"Popover-module__Arrow___ue4Mg"};
3894
-
3895
- const Popover = ({ trigger, content, side = "left", align = "end", }) => {
3896
- return (jsxRuntime.jsxs(radixUi.Popover.Root, { children: [jsxRuntime.jsx(radixUi.Popover.Trigger, { asChild: true, children: trigger }), jsxRuntime.jsx(radixUi.Popover.Portal, { children: jsxRuntime.jsxs(radixUi.Popover.Content, { className: styles$6.Content, sideOffset: 5, side: side, align: align, children: [content, jsxRuntime.jsx(radixUi.Popover.Arrow, { className: styles$6.Arrow })] }) })] }));
3897
- };
3898
-
3899
- var styles$5 = {"zds-quantity":"Quantity-module__zds-quantity___AymLj","zds-quantity__input":"Quantity-module__zds-quantity__input___Wlhmo"};
3481
+ var styles$6 = {"zds-quantity":"Quantity-module__zds-quantity___AymLj","zds-quantity__input":"Quantity-module__zds-quantity__input___Wlhmo"};
3900
3482
 
3901
3483
  const Quantity = ({ defaultValue = 0, value: controlledValue, onChange, disabled = false, decimal = false, decimalPlaces = 2, size = 'lg', id, step, className, ...rest }) => {
3902
3484
  const isControlled = controlledValue !== undefined;
@@ -4105,12 +3687,12 @@ const Quantity = ({ defaultValue = 0, value: controlledValue, onChange, disabled
4105
3687
  }, [disabled, increment, decrement, decimal, decimalPlaces, isControlled, onChange, computedValue]);
4106
3688
  const uniqueId = React.useId();
4107
3689
  const inputId = id || uniqueId;
4108
- return (jsxRuntime.jsxs("div", { className: clsx(styles$5['zds-quantity'], { disabled }, className), ...rest, children: [jsxRuntime.jsx(Button, { variant: 'outlined', size: size, type: 'button', iconOnly: true, icon: jsxRuntime.jsx(reactIcons.Subtract16Regular, {}), onClick: decrement, disabled: disabled || isMinValue, "aria-label": 'Diminuir quantidade' }), jsxRuntime.jsx("input", { ref: inputRef, className: clsx(styles$5['zds-quantity__input'], { disabled }), type: 'text', value: inputValue, onChange: handleInputChange, onBlur: handleBlur, onKeyDown: handleInputKeyDown, id: inputId, min: '0', step: stepValue, "aria-label": 'Quantidade', role: 'spinbutton', "aria-valuenow": computedValue, "aria-valuemin": 0, "aria-valuemax": decimal ? undefined : 9999, disabled: disabled, inputMode: decimal ? 'decimal' : 'numeric' }), jsxRuntime.jsx(Button, { variant: 'outlined', size: size, type: 'button', iconOnly: true, onClick: increment, disabled: disabled, "aria-label": 'Aumentar quantidade', icon: jsxRuntime.jsx(reactIcons.Add16Regular, {}) })] }));
3690
+ return (jsxRuntime.jsxs("div", { className: clsx(styles$6['zds-quantity'], { disabled }, className), ...rest, children: [jsxRuntime.jsx(Button, { variant: 'outlined', size: size, type: 'button', iconOnly: true, icon: jsxRuntime.jsx(reactIcons.Subtract16Regular, {}), onClick: decrement, disabled: disabled || isMinValue, "aria-label": 'Diminuir quantidade' }), jsxRuntime.jsx("input", { ref: inputRef, className: clsx(styles$6['zds-quantity__input'], { disabled }), type: 'text', value: inputValue, onChange: handleInputChange, onBlur: handleBlur, onKeyDown: handleInputKeyDown, id: inputId, min: '0', step: stepValue, "aria-label": 'Quantidade', role: 'spinbutton', "aria-valuenow": computedValue, "aria-valuemin": 0, "aria-valuemax": decimal ? undefined : 9999, disabled: disabled, inputMode: decimal ? 'decimal' : 'numeric' }), jsxRuntime.jsx(Button, { variant: 'outlined', size: size, type: 'button', iconOnly: true, onClick: increment, disabled: disabled, "aria-label": 'Aumentar quantidade', icon: jsxRuntime.jsx(reactIcons.Add16Regular, {}) })] }));
4109
3691
  };
4110
3692
  const memorizedQuantity = React.memo(Quantity);
4111
3693
  memorizedQuantity.displayName = 'Quantity';
4112
3694
 
4113
- var styles$4 = {"fieldContainer":"index-module__fieldContainer___gp5Hz","trigger":"index-module__trigger___rHQJz","disabled":"index-module__disabled___MIJba","open":"index-module__open___bVB-1","error":"index-module__error___nPFjW","hasValue":"index-module__hasValue___a4Sy4","triggerText":"index-module__triggerText___tyjAQ","containerLabel":"index-module__containerLabel___CExNh","content":"index-module__content___9nWeY","viewport":"index-module__viewport___nkVG9","group":"index-module__group___-PiX6","container":"index-module__container___Wg-pd","searchWrapper":"index-module__searchWrapper___umf9d","item":"index-module__item___R-Xle","subTitle":"index-module__subTitle___sXaqd","checkboxItem":"index-module__checkboxItem___FTUbN","checkboxContent":"index-module__checkboxContent___skcd5","itemWrapper":"index-module__itemWrapper___PAglx","title":"index-module__title___x1Bia","icon":"index-module__icon___l2Zze","itemIndicator":"index-module__itemIndicator___FhOim","textContent":"index-module__textContent___cBJbp","helper":"index-module__helper___w4VC7","errorMessage":"index-module__errorMessage___gquqW","noResults":"index-module__noResults___qgzod","loadingMore":"index-module__loadingMore___GHc31","expandableItemContainer":"index-module__expandableItemContainer___NexPi","chevron":"index-module__chevron___c6mu-","childrenWrapper":"index-module__childrenWrapper___tj2R-"};
3695
+ var styles$5 = {"fieldContainer":"index-module__fieldContainer___gp5Hz","trigger":"index-module__trigger___rHQJz","disabled":"index-module__disabled___MIJba","open":"index-module__open___bVB-1","error":"index-module__error___nPFjW","hasValue":"index-module__hasValue___a4Sy4","triggerText":"index-module__triggerText___tyjAQ","containerLabel":"index-module__containerLabel___CExNh","content":"index-module__content___9nWeY","viewport":"index-module__viewport___nkVG9","group":"index-module__group___-PiX6","container":"index-module__container___Wg-pd","searchWrapper":"index-module__searchWrapper___umf9d","item":"index-module__item___R-Xle","subTitle":"index-module__subTitle___sXaqd","checkboxItem":"index-module__checkboxItem___FTUbN","checkboxContent":"index-module__checkboxContent___skcd5","itemWrapper":"index-module__itemWrapper___PAglx","title":"index-module__title___x1Bia","icon":"index-module__icon___l2Zze","itemIndicator":"index-module__itemIndicator___FhOim","textContent":"index-module__textContent___cBJbp","helper":"index-module__helper___w4VC7","errorMessage":"index-module__errorMessage___gquqW","noResults":"index-module__noResults___qgzod","loadingMore":"index-module__loadingMore___GHc31","expandableItemContainer":"index-module__expandableItemContainer___NexPi","chevron":"index-module__chevron___c6mu-","childrenWrapper":"index-module__childrenWrapper___tj2R-"};
4114
3696
 
4115
3697
  const CheckboxSelectItem = ({ text, subTitle, disabled, checked, onCheckedChange, value, ...restProps }) => {
4116
3698
  const itemRef = React.useRef(null);
@@ -4154,9 +3736,9 @@ const CheckboxSelectItem = ({ text, subTitle, disabled, checked, onCheckedChange
4154
3736
  onCheckedChange(!checked);
4155
3737
  }
4156
3738
  };
4157
- return (jsxRuntime.jsx("div", { ref: itemRef, className: clsx(styles$4.checkboxItem, {
4158
- [styles$4.disabled]: disabled,
4159
- }), role: "option", "aria-selected": checked, "aria-disabled": disabled, "data-selected": checked, "data-testid": `checkbox-item-${value}`, tabIndex: disabled ? -1 : 0, onKeyDown: handleKeyDown, onClick: handleClick, ...restProps, children: jsxRuntime.jsx("div", { className: styles$4.checkboxContent, children: jsxRuntime.jsx(Checkbox, { checked: checked, onCheckedChange: handleCheckboxChange, disabled: disabled, label: jsxRuntime.jsxs("div", { className: styles$4.textContent, children: [jsxRuntime.jsx("span", { className: styles$4.title, children: text }), subTitle && jsxRuntime.jsx("div", { className: styles$4.subTitle, children: subTitle })] }) }) }) }));
3739
+ return (jsxRuntime.jsx("div", { ref: itemRef, className: clsx(styles$5.checkboxItem, {
3740
+ [styles$5.disabled]: disabled,
3741
+ }), role: "option", "aria-selected": checked, "aria-disabled": disabled, "data-selected": checked, "data-testid": `checkbox-item-${value}`, tabIndex: disabled ? -1 : 0, onKeyDown: handleKeyDown, onClick: handleClick, ...restProps, children: jsxRuntime.jsx("div", { className: styles$5.checkboxContent, children: jsxRuntime.jsx(Checkbox, { checked: checked, onCheckedChange: handleCheckboxChange, disabled: disabled, label: jsxRuntime.jsxs("div", { className: styles$5.textContent, children: [jsxRuntime.jsx("span", { className: styles$5.title, children: text }), subTitle && jsxRuntime.jsx("div", { className: styles$5.subTitle, children: subTitle })] }) }) }) }));
4160
3742
  };
4161
3743
  CheckboxSelectItem.displayName = 'CheckboxSelectItem';
4162
3744
 
@@ -4174,23 +3756,23 @@ const ExpandableSelectItem = ({ item, variant, onSelect, selectedValues, level =
4174
3756
  onSelect(item.value);
4175
3757
  }
4176
3758
  };
4177
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: styles$4.expandableItemContainer, style: { paddingLeft: `${level * 16}px` }, children: jsxRuntime.jsxs("div", { className: clsx(styles$4.itemWrapper, {
4178
- [styles$4.selected]: isSelected && !hasChildren,
4179
- [styles$4.disabled]: item.disabled,
3759
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: styles$5.expandableItemContainer, style: { paddingLeft: `${level * 16}px` }, children: jsxRuntime.jsxs("div", { className: clsx(styles$5.itemWrapper, {
3760
+ [styles$5.selected]: isSelected && !hasChildren,
3761
+ [styles$5.disabled]: item.disabled,
4180
3762
  }), onClick: handleClick, onKeyDown: (e) => {
4181
3763
  if (e.key === 'Enter' || e.key === ' ') {
4182
3764
  e.preventDefault();
4183
3765
  handleClick(e);
4184
3766
  }
4185
- }, role: "button", tabIndex: item.disabled ? -1 : 0, "data-disabled": item.disabled || undefined, "data-selected": isSelected && !hasChildren ? 'true' : undefined, "data-testid": `select-item-${item.value}`, children: [variant === 'icon' && item.icon && (jsxRuntime.jsx("span", { className: styles$4.icon, children: item.icon })), jsxRuntime.jsxs("div", { className: styles$4.textContent, children: [jsxRuntime.jsx("div", { className: styles$4.title, children: item.text }), item.subTitle && jsxRuntime.jsx("div", { className: styles$4.subTitle, children: item.subTitle })] }), hasChildren && (jsxRuntime.jsx("span", { className: styles$4.chevron, children: isExpanded ? jsxRuntime.jsx(reactIcons.ChevronDown16Regular, {}) : jsxRuntime.jsx(reactIcons.ChevronRight16Regular, {}) }))] }) }), hasChildren && isExpanded && (jsxRuntime.jsx("div", { className: styles$4.childrenWrapper, children: item.children.map((child) => (jsxRuntime.jsx(ExpandableSelectItem, { item: child, variant: variant, onSelect: onSelect, selectedValues: selectedValues, level: level + 1 }, child.id || child.value))) }))] }));
3767
+ }, role: "button", tabIndex: item.disabled ? -1 : 0, "data-disabled": item.disabled || undefined, "data-selected": isSelected && !hasChildren ? 'true' : undefined, "data-testid": `select-item-${item.value}`, children: [variant === 'icon' && item.icon && (jsxRuntime.jsx("span", { className: styles$5.icon, children: item.icon })), jsxRuntime.jsxs("div", { className: styles$5.textContent, children: [jsxRuntime.jsx("div", { className: styles$5.title, children: item.text }), item.subTitle && jsxRuntime.jsx("div", { className: styles$5.subTitle, children: item.subTitle })] }), hasChildren && (jsxRuntime.jsx("span", { className: styles$5.chevron, children: isExpanded ? jsxRuntime.jsx(reactIcons.ChevronDown16Regular, {}) : jsxRuntime.jsx(reactIcons.ChevronRight16Regular, {}) }))] }) }), hasChildren && isExpanded && (jsxRuntime.jsx("div", { className: styles$5.childrenWrapper, children: item.children.map((child) => (jsxRuntime.jsx(ExpandableSelectItem, { item: child, variant: variant, onSelect: onSelect, selectedValues: selectedValues, level: level + 1 }, child.id || child.value))) }))] }));
4186
3768
  };
4187
3769
 
4188
3770
  const SelectItem = React.forwardRef(({ text, subTitle, icon, disabled, value, variant, ...restProps }, ref) => {
4189
- return (jsxRuntime.jsxs("div", { className: clsx(styles$4.itemWrapper, {
4190
- [styles$4.disabled]: disabled,
4191
- }), "data-disabled": disabled || undefined, "data-testid": `select-item-${value}`, ref: ref, children: [variant === 'icon' && icon && (jsxRuntime.jsx("span", { className: styles$4.icon, children: icon })), jsxRuntime.jsxs(radixUi.Select.Item, { className: clsx(styles$4.item, {
4192
- [styles$4.disabled]: disabled,
4193
- }), value: value, disabled: disabled, ...restProps, children: [jsxRuntime.jsx(radixUi.Select.ItemText, { className: styles$4.title, children: text }), subTitle && jsxRuntime.jsx("div", { className: styles$4.subTitle, children: subTitle }), jsxRuntime.jsx(radixUi.Select.ItemIndicator, { className: styles$4.itemIndicator })] })] }));
3771
+ return (jsxRuntime.jsxs("div", { className: clsx(styles$5.itemWrapper, {
3772
+ [styles$5.disabled]: disabled,
3773
+ }), "data-disabled": disabled || undefined, "data-testid": `select-item-${value}`, ref: ref, children: [variant === 'icon' && icon && (jsxRuntime.jsx("span", { className: styles$5.icon, children: icon })), jsxRuntime.jsxs(radixUi.Select.Item, { className: clsx(styles$5.item, {
3774
+ [styles$5.disabled]: disabled,
3775
+ }), value: value, disabled: disabled, ...restProps, children: [jsxRuntime.jsx(radixUi.Select.ItemText, { className: styles$5.title, children: text }), subTitle && jsxRuntime.jsx("div", { className: styles$5.subTitle, children: subTitle }), jsxRuntime.jsx(radixUi.Select.ItemIndicator, { className: styles$5.itemIndicator })] })] }));
4194
3776
  });
4195
3777
  SelectItem.displayName = 'SelectItem';
4196
3778
 
@@ -4499,14 +4081,14 @@ const Select = ({ items, onValueChange, onOpenChange, variant, required = false,
4499
4081
  onApiSearch('');
4500
4082
  }
4501
4083
  };
4502
- return (jsxRuntime.jsx(radixUi.Select.Root, { value: variant === 'checkbox' ? '' : (state.selectedValues[0] || ''), onValueChange: variant === 'checkbox' ? undefined : actions.handleSingleSelect, required: required, open: state.isOpen, onOpenChange: actions.setOpen, disabled: disabled, ...restProps, children: jsxRuntime.jsxs("div", { className: clsx(styles$4.container, className), style: containerStyle, "data-testid": testId, children: [jsxRuntime.jsx("div", { className: styles$4.fieldContainer, children: jsxRuntime.jsxs("div", { className: styles$4.containerLabel, children: [jsxRuntime.jsx(LabelComponent, { htmlFor: selectId, required: required, tooltipText: tooltipText, tooltip: tooltip, side: side, align: align, error: state.hasError && state.touched, disabled: disabled, children: label }), jsxRuntime.jsxs(radixUi.Select.Trigger, { className: clsx(styles$4.trigger, {
4503
- [styles$4.error]: state.hasError && state.touched,
4504
- [styles$4.disabled]: disabled,
4505
- [styles$4.hasValue]: state.selectedValues.length > 0,
4506
- [styles$4.open]: state.isOpen,
4507
- }), id: selectId, "aria-label": ariaLabel, "data-testid": `${testId}-trigger`, children: [variant === 'checkbox' ? (jsxRuntime.jsx("span", { className: styles$4.triggerText, children: displayText })) : (jsxRuntime.jsx(radixUi.Select.Value, { placeholder: placeholder, className: styles$4.placeholder, children: displayText })), state.isOpen ? jsxRuntime.jsx(reactIcons.ChevronUp16Regular, {}) : jsxRuntime.jsx(reactIcons.ChevronDown16Regular, {})] }), !state.isOpen && helperText && !state.hasError && (jsxRuntime.jsx("span", { className: clsx(styles$4.helper, {
4508
- [styles$4.disabled]: disabled
4509
- }), children: helperText })), state.hasError && state.touched && (jsxRuntime.jsx("span", { className: styles$4.errorMessage, children: errorMessage || 'Campo obrigatório' }))] }) }), jsxRuntime.jsx(radixUi.Select.Portal, { children: jsxRuntime.jsxs(radixUi.Select.Content, { className: styles$4.content, position: "popper", side: "bottom", sideOffset: 8, align: "start", avoidCollisions: true, children: [search && (jsxRuntime.jsx("div", { className: styles$4.searchWrapper, children: jsxRuntime.jsx(Search, { ref: refs.searchInputRef, className: styles$4.search, placeholder: "Buscar", value: state.searchInput, onChange: handleSearchChange, onKeyDown: handleSearchKeyDown, onClear: handleClear, "data-testid": `${testId}-search` }) })), jsxRuntime.jsx(radixUi.Select.Viewport, { ref: viewportRef, className: styles$4.viewport, children: jsxRuntime.jsx(radixUi.Select.Group, { className: styles$4.group, children: filteredItems.length === 0 ? (jsxRuntime.jsx("div", { className: styles$4.noResults, children: "Nenhum resultado encontrado" })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [filteredItems.map((item) => {
4084
+ return (jsxRuntime.jsx(radixUi.Select.Root, { value: variant === 'checkbox' ? '' : (state.selectedValues[0] || ''), onValueChange: variant === 'checkbox' ? undefined : actions.handleSingleSelect, required: required, open: state.isOpen, onOpenChange: actions.setOpen, disabled: disabled, ...restProps, children: jsxRuntime.jsxs("div", { className: clsx(styles$5.container, className), style: containerStyle, "data-testid": testId, children: [jsxRuntime.jsx("div", { className: styles$5.fieldContainer, children: jsxRuntime.jsxs("div", { className: styles$5.containerLabel, children: [jsxRuntime.jsx(LabelComponent, { htmlFor: selectId, required: required, tooltipText: tooltipText, tooltip: tooltip, side: side, align: align, error: state.hasError && state.touched, disabled: disabled, children: label }), jsxRuntime.jsxs(radixUi.Select.Trigger, { className: clsx(styles$5.trigger, {
4085
+ [styles$5.error]: state.hasError && state.touched,
4086
+ [styles$5.disabled]: disabled,
4087
+ [styles$5.hasValue]: state.selectedValues.length > 0,
4088
+ [styles$5.open]: state.isOpen,
4089
+ }), id: selectId, "aria-label": ariaLabel, "data-testid": `${testId}-trigger`, children: [variant === 'checkbox' ? (jsxRuntime.jsx("span", { className: styles$5.triggerText, children: displayText })) : (jsxRuntime.jsx(radixUi.Select.Value, { placeholder: placeholder, className: styles$5.placeholder, children: displayText })), state.isOpen ? jsxRuntime.jsx(reactIcons.ChevronUp16Regular, {}) : jsxRuntime.jsx(reactIcons.ChevronDown16Regular, {})] }), !state.isOpen && helperText && !state.hasError && (jsxRuntime.jsx("span", { className: clsx(styles$5.helper, {
4090
+ [styles$5.disabled]: disabled
4091
+ }), children: helperText })), state.hasError && state.touched && (jsxRuntime.jsx("span", { className: styles$5.errorMessage, children: errorMessage || 'Campo obrigatório' }))] }) }), jsxRuntime.jsx(radixUi.Select.Portal, { children: jsxRuntime.jsxs(radixUi.Select.Content, { className: styles$5.content, position: "popper", side: "bottom", sideOffset: 8, align: "start", avoidCollisions: true, children: [search && (jsxRuntime.jsx("div", { className: styles$5.searchWrapper, children: jsxRuntime.jsx(Search, { ref: refs.searchInputRef, className: styles$5.search, placeholder: "Buscar", value: state.searchInput, onChange: handleSearchChange, onKeyDown: handleSearchKeyDown, onClear: handleClear, "data-testid": `${testId}-search` }) })), jsxRuntime.jsx(radixUi.Select.Viewport, { ref: viewportRef, className: styles$5.viewport, children: jsxRuntime.jsx(radixUi.Select.Group, { className: styles$5.group, children: filteredItems.length === 0 ? (jsxRuntime.jsx("div", { className: styles$5.noResults, children: "Nenhum resultado encontrado" })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [filteredItems.map((item) => {
4510
4092
  const hasChildren = item.children && item.children.length > 0;
4511
4093
  if (hasChildren) {
4512
4094
  return (jsxRuntime.jsx(ExpandableSelectItem, { item: item, variant: variant, selectedValues: state.selectedValues, onSelect: (value) => {
@@ -4520,11 +4102,11 @@ const Select = ({ items, onValueChange, onOpenChange, variant, required = false,
4520
4102
  } }, item.id || item.value));
4521
4103
  }
4522
4104
  return variant === 'checkbox' ? (jsxRuntime.jsx(CheckboxSelectItem, { ...item, checked: state.selectedValues.includes(item.value), onCheckedChange: (checked) => actions.handleMultipleSelect(item.value, checked) }, item.id || item.value)) : (jsxRuntime.jsx(SelectItem, { ...item, variant: variant }, item.id || item.value));
4523
- }), enableInfiniteScroll && isLoadingMore && (jsxRuntime.jsx("div", { className: styles$4.loadingMore, children: "Carregando mais itens..." }))] })) }) })] }) })] }) }));
4105
+ }), enableInfiniteScroll && isLoadingMore && (jsxRuntime.jsx("div", { className: styles$5.loadingMore, children: "Carregando mais itens..." }))] })) }) })] }) })] }) }));
4524
4106
  };
4525
4107
  Select.displayName = 'Select';
4526
4108
 
4527
- var styles$3 = {"zds-table__container":"Table-module__zds-table__container___9xeVY","zds-table-header":"Table-module__zds-table-header___uPRjd","zds-table__scroll-wrapper":"Table-module__zds-table__scroll-wrapper___xQZPq","zds-table":"Table-module__zds-table___bPvaS","zds-table__head":"Table-module__zds-table__head___FvQuS","zds-table__th":"Table-module__zds-table__th___R03sj","zds-table__th-content":"Table-module__zds-table__th-content___duR3c","zds-table__td":"Table-module__zds-table__td___aY-Nt","zds-table-header__filters-placeholder":"Table-module__zds-table-header__filters-placeholder___GhVwi","zds-table__body":"Table-module__zds-table__body___kuKXb","zds-table__empty":"Table-module__zds-table__empty___ZM4iu","zds-table__empty__content":"Table-module__zds-table__empty__content___8xl-u","zds-table__empty__title":"Table-module__zds-table__empty__title___7Y9Pj","zds-table__empty__caption":"Table-module__zds-table__empty__caption___toS00","zds-table__row":"Table-module__zds-table__row___8cEjq","zds-table__empty-cell":"Table-module__zds-table__empty-cell___Ldb6Z","zds-table-header__search":"Table-module__zds-table-header__search___yzLxw","zds-table__pagination":"Table-module__zds-table__pagination___FR5GH","zds-table-header__search-container":"Table-module__zds-table-header__search-container___-Fzz1","zds-table-header__filters":"Table-module__zds-table-header__filters___ViH07","zds-table-header__filter-label":"Table-module__zds-table-header__filter-label___c3BWI","zds-table-header__custom-filters":"Table-module__zds-table-header__custom-filters___oTuoM","zds-table-header__filters-content":"Table-module__zds-table-header__filters-content___nKlgL","zds-table-header__filters-wrapper":"Table-module__zds-table-header__filters-wrapper___BrZ9A","zds-table-header__filter-items":"Table-module__zds-table-header__filter-items___Tn8Yv","zds-table__pagination-select":"Table-module__zds-table__pagination-select___TZK-y","zds-table__pagination-info":"Table-module__zds-table__pagination-info___3k-B2","zds-table__pagination-controls":"Table-module__zds-table__pagination-controls___S-zs7","zds-table__pagination-button":"Table-module__zds-table__pagination-button___Wvq9W"};
4109
+ var styles$4 = {"zds-table__container":"Table-module__zds-table__container___9xeVY","zds-table-header":"Table-module__zds-table-header___uPRjd","zds-table__scroll-wrapper":"Table-module__zds-table__scroll-wrapper___xQZPq","zds-table":"Table-module__zds-table___bPvaS","zds-table__head":"Table-module__zds-table__head___FvQuS","zds-table__th":"Table-module__zds-table__th___R03sj","zds-table__th-content":"Table-module__zds-table__th-content___duR3c","zds-table__td":"Table-module__zds-table__td___aY-Nt","zds-table-header__filters-placeholder":"Table-module__zds-table-header__filters-placeholder___GhVwi","zds-table__body":"Table-module__zds-table__body___kuKXb","zds-table__empty":"Table-module__zds-table__empty___ZM4iu","zds-table__empty__content":"Table-module__zds-table__empty__content___8xl-u","zds-table__empty__title":"Table-module__zds-table__empty__title___7Y9Pj","zds-table__empty__caption":"Table-module__zds-table__empty__caption___toS00","zds-table__row":"Table-module__zds-table__row___8cEjq","zds-table__empty-cell":"Table-module__zds-table__empty-cell___Ldb6Z","zds-table-header__search":"Table-module__zds-table-header__search___yzLxw","zds-table__pagination":"Table-module__zds-table__pagination___FR5GH","zds-table-header__search-container":"Table-module__zds-table-header__search-container___-Fzz1","zds-table-header__filters":"Table-module__zds-table-header__filters___ViH07","zds-table-header__filter-label":"Table-module__zds-table-header__filter-label___c3BWI","zds-table-header__custom-filters":"Table-module__zds-table-header__custom-filters___oTuoM","zds-table-header__filters-content":"Table-module__zds-table-header__filters-content___nKlgL","zds-table-header__filters-wrapper":"Table-module__zds-table-header__filters-wrapper___BrZ9A","zds-table-header__filter-items":"Table-module__zds-table-header__filter-items___Tn8Yv","zds-table__pagination-select":"Table-module__zds-table__pagination-select___TZK-y","zds-table__pagination-info":"Table-module__zds-table__pagination-info___3k-B2","zds-table__pagination-controls":"Table-module__zds-table__pagination-controls___S-zs7","zds-table__pagination-button":"Table-module__zds-table__pagination-button___Wvq9W"};
4528
4110
 
4529
4111
  /**
4530
4112
  * Componente de ícone SVG para estado vazio da tabela
@@ -4704,13 +4286,13 @@ const Table = ({ columns, dataSource, className, loading = false, rowSelection,
4704
4286
  }, [columns, rowSelection, isAllSelected, isIndeterminate, toggleAll, selectedSet, toggleRow, dataSource]);
4705
4287
  const tableId = React.useMemo(() => `table-${Math.random().toString(36).substr(2, 9)}`, []);
4706
4288
  if (loading) {
4707
- return (jsxRuntime.jsx("div", { className: clsx(styles$3['zds-table__container'], className), children: jsxRuntime.jsx("div", { className: styles$3['zds-table__loader'], children: jsxRuntime.jsx(LoaderList, {}) }) }));
4289
+ return (jsxRuntime.jsx("div", { className: clsx(styles$4['zds-table__container'], className), children: jsxRuntime.jsx("div", { className: styles$4['zds-table__loader'], children: jsxRuntime.jsx(LoaderList, {}) }) }));
4708
4290
  }
4709
- const emptyText = locale?.emptyText || (jsxRuntime.jsxs("div", { className: styles$3['zds-table__empty'], children: [jsxRuntime.jsx("div", { className: styles$3['zds-table__empty__content'], children: jsxRuntime.jsx(EmptyRows150Color, {}) }), jsxRuntime.jsxs("div", { className: styles$3['zds-table__empty__text'], children: [jsxRuntime.jsx("h3", { className: styles$3['zds-table__empty__title'], children: "Nenhum dado encontrado" }), jsxRuntime.jsx("p", { className: styles$3['zds-table__empty__caption'], children: "Nenhum registro encontrado" })] })] }));
4710
- return (jsxRuntime.jsx("div", { className: clsx(styles$3['zds-table__container'], className), ...rest, children: jsxRuntime.jsx("div", { className: styles$3['zds-table__scroll-wrapper'], children: jsxRuntime.jsxs("table", { className: styles$3['zds-table'], role: "table", "aria-label": "Tabela de dados", "aria-describedby": loading ? `${tableId}-loading` : undefined, "aria-rowcount": dataSource.length + 1, children: [jsxRuntime.jsx("thead", { className: styles$3['zds-table__head'], children: jsxRuntime.jsx("tr", { children: finalColumns.map((column) => (jsxRuntime.jsx("th", { className: clsx(styles$3['zds-table__th'], column.align && `text-${column.align}`), style: column.style, children: jsxRuntime.jsx("div", { className: styles$3['zds-table__th-content'], children: column.label }) }, column.key))) }) }), jsxRuntime.jsx("tbody", { className: styles$3['zds-table__body'], children: dataSource.length > 0 ? (dataSource.map((row, index) => {
4291
+ const emptyText = locale?.emptyText || (jsxRuntime.jsxs("div", { className: styles$4['zds-table__empty'], children: [jsxRuntime.jsx("div", { className: styles$4['zds-table__empty__content'], children: jsxRuntime.jsx(EmptyRows150Color, {}) }), jsxRuntime.jsxs("div", { className: styles$4['zds-table__empty__text'], children: [jsxRuntime.jsx("h3", { className: styles$4['zds-table__empty__title'], children: "Nenhum dado encontrado" }), jsxRuntime.jsx("p", { className: styles$4['zds-table__empty__caption'], children: "Nenhum registro encontrado" })] })] }));
4292
+ return (jsxRuntime.jsx("div", { className: clsx(styles$4['zds-table__container'], className), ...rest, children: jsxRuntime.jsx("div", { className: styles$4['zds-table__scroll-wrapper'], children: jsxRuntime.jsxs("table", { className: styles$4['zds-table'], role: "table", "aria-label": "Tabela de dados", "aria-describedby": loading ? `${tableId}-loading` : undefined, "aria-rowcount": dataSource.length + 1, children: [jsxRuntime.jsx("thead", { className: styles$4['zds-table__head'], children: jsxRuntime.jsx("tr", { children: finalColumns.map((column) => (jsxRuntime.jsx("th", { className: clsx(styles$4['zds-table__th'], column.align && `text-${column.align}`), style: column.style, children: jsxRuntime.jsx("div", { className: styles$4['zds-table__th-content'], children: column.label }) }, column.key))) }) }), jsxRuntime.jsx("tbody", { className: styles$4['zds-table__body'], children: dataSource.length > 0 ? (dataSource.map((row, index) => {
4711
4293
  const rowProps = onRow?.(row, index) || {};
4712
- return (jsxRuntime.jsx("tr", { className: clsx(styles$3['zds-table__row'], rowProps.className), onClick: rowProps.onClick, onDoubleClick: rowProps.onDoubleClick, children: finalColumns.map((column) => (jsxRuntime.jsx("td", { className: clsx(styles$3['zds-table__td'], column.align && `text-${column.align}`), children: renderCell(column, row, index) }, column.key))) }, index));
4713
- })) : (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: finalColumns.length, className: styles$3['zds-table__empty-cell'], children: emptyText }) })) })] }) }) }));
4294
+ return (jsxRuntime.jsx("tr", { className: clsx(styles$4['zds-table__row'], rowProps.className), onClick: rowProps.onClick, onDoubleClick: rowProps.onDoubleClick, children: finalColumns.map((column) => (jsxRuntime.jsx("td", { className: clsx(styles$4['zds-table__td'], column.align && `text-${column.align}`), children: renderCell(column, row, index) }, column.key))) }, index));
4295
+ })) : (jsxRuntime.jsx("tr", { children: jsxRuntime.jsx("td", { colSpan: finalColumns.length, className: styles$4['zds-table__empty-cell'], children: emptyText }) })) })] }) }) }));
4714
4296
  };
4715
4297
 
4716
4298
  const isCalendarFilter = (filter) => {
@@ -4743,26 +4325,26 @@ const TableHeader = ({ searchValue = '', onSearchChange, onSearch, searchPlaceho
4743
4325
  }
4744
4326
  };
4745
4327
  const hasFilters = filters || (filterItems && filterItems.length > 0);
4746
- return (jsxRuntime.jsxs("div", { className: `${styles$3['zds-table-header']} ${className}`.trim(), ...rest, children: [showSearch && (onSearchChange || onSearch) && (jsxRuntime.jsx("div", { className: styles$3['zds-table-header__search-container'], children: jsxRuntime.jsx(Search, { value: internalSearchValue, onChange: handleInputChange, onKeyDown: handleKeyDown, placeholder: searchPlaceholder, className: styles$3['zds-table-header__search'] }) })), showFilters && (jsxRuntime.jsx("div", { className: styles$3['zds-table-header__filters'], children: hasFilters ? (jsxRuntime.jsxs("div", { className: styles$3['zds-table-header__filters-content'], children: [filters && (jsxRuntime.jsx("div", { className: styles$3['zds-table-header__custom-filters'], children: filters })), jsxRuntime.jsxs("div", { className: styles$3['zds-table-header__filters-wrapper'], children: [jsxRuntime.jsx("span", { className: styles$3['zds-table-header__filter-label'], children: "Filtros" }), jsxRuntime.jsx("div", { className: styles$3['zds-table-header__filter-items'], children: filterItems && filterItems.map((filterItem, index) => {
4328
+ return (jsxRuntime.jsxs("div", { className: `${styles$4['zds-table-header']} ${className}`.trim(), ...rest, children: [showSearch && (onSearchChange || onSearch) && (jsxRuntime.jsx("div", { className: styles$4['zds-table-header__search-container'], children: jsxRuntime.jsx(Search, { value: internalSearchValue, onChange: handleInputChange, onKeyDown: handleKeyDown, placeholder: searchPlaceholder, className: styles$4['zds-table-header__search'] }) })), showFilters && (jsxRuntime.jsx("div", { className: styles$4['zds-table-header__filters'], children: hasFilters ? (jsxRuntime.jsxs("div", { className: styles$4['zds-table-header__filters-content'], children: [filters && (jsxRuntime.jsx("div", { className: styles$4['zds-table-header__custom-filters'], children: filters })), jsxRuntime.jsxs("div", { className: styles$4['zds-table-header__filters-wrapper'], children: [jsxRuntime.jsx("span", { className: styles$4['zds-table-header__filter-label'], children: "Filtros" }), jsxRuntime.jsx("div", { className: styles$4['zds-table-header__filter-items'], children: filterItems && filterItems.map((filterItem, index) => {
4747
4329
  const commonProps = {
4748
- key: filterItem.id || index,
4749
4330
  buttonText: filterItem.buttonText,
4750
4331
  icon: filterItem.icon,
4751
- position: filterItem.position || 'right',
4332
+ side: filterItem.side,
4333
+ align: filterItem.align,
4752
4334
  disabled: filterItem.disabled,
4753
4335
  variant: 'outlined',
4754
4336
  onOpen: () => filterItem.onToggle?.(true),
4755
4337
  onClose: () => filterItem.onToggle?.(false),
4756
4338
  };
4757
4339
  if (isCalendarFilter(filterItem)) {
4758
- return (jsxRuntime.jsx(Filter, { ...commonProps, type: "calendar", selectedDate: filterItem.selectedDate, onDateSelect: filterItem.onDateSelect, onClearDate: filterItem.onClear, minDate: filterItem.minDate, maxDate: filterItem.maxDate, placeholder: filterItem.placeholder }));
4340
+ return (jsxRuntime.jsx(Filter, { ...commonProps, type: "calendar", selectedDate: filterItem.selectedDate, onDateSelect: filterItem.onDateSelect, onClearDate: filterItem.onClear, minDate: filterItem.minDate, maxDate: filterItem.maxDate, placeholder: filterItem.placeholder }, filterItem.id || index));
4759
4341
  }
4760
4342
  if (isCheckboxFilter(filterItem)) {
4761
- return (jsxRuntime.jsx(Filter, { ...commonProps, type: filterItem.type, items: filterItem.items, selectedIds: filterItem.selectedIds, onApplyFilter: filterItem.onSelectionChange, placeholder: filterItem.placeholder, enableSearch: filterItem.enableSearch }));
4343
+ return (jsxRuntime.jsx(Filter, { ...commonProps, type: filterItem.type, items: filterItem.items, selectedIds: filterItem.selectedIds, onApplyFilter: filterItem.onSelectionChange, placeholder: filterItem.placeholder, enableSearch: filterItem.enableSearch }, filterItem.id || index));
4762
4344
  }
4763
4345
  console.warn('TableHeader: Tipo de filtro não reconhecido:', filterItem);
4764
4346
  return null;
4765
- }) })] })] })) : (jsxRuntime.jsx("div", { className: styles$3['zds-table-header__filters-placeholder'], children: jsxRuntime.jsx("span", { children: "Nenhum filtro dispon\u00EDvel" }) })) }))] }));
4347
+ }) })] })] })) : (jsxRuntime.jsx("div", { className: styles$4['zds-table-header__filters-placeholder'], children: jsxRuntime.jsx("span", { children: "Nenhum filtro dispon\u00EDvel" }) })) }))] }));
4766
4348
  };
4767
4349
 
4768
4350
  const TablePagination = ({ currentPage, totalItems, itemsPerPage, onPageChange, onItemsPerPageChange, pageSizeOptions = [10, 25, 50, 100], disabled = false, className, ...rest }) => {
@@ -4785,11 +4367,56 @@ const TablePagination = ({ currentPage, totalItems, itemsPerPage, onPageChange,
4785
4367
  const newItemsPerPage = Number(event.target.value);
4786
4368
  onItemsPerPageChange(newItemsPerPage);
4787
4369
  };
4788
- return (jsxRuntime.jsxs("div", { className: `${styles$3['zds-table__pagination']} ${className}`.trim(), ...rest, children: [jsxRuntime.jsxs("div", { className: styles$3['zds-table__pagination-select'], children: [jsxRuntime.jsx("label", { htmlFor: "items-per-page", className: styles$3['zds-table__pagination-label'], children: "Itens por p\u00E1gina" }), jsxRuntime.jsx("select", { id: "items-per-page", value: itemsPerPage, onChange: handleItemsPerPageChange, disabled: disabled, className: styles$3['zds-table__pagination-select-input'], children: pageSizeOptions.map((option) => (jsxRuntime.jsx("option", { value: option, children: option }, option))) })] }), jsxRuntime.jsx("div", { className: styles$3['zds-table__pagination-info'], children: jsxRuntime.jsx("span", { children: totalItems > 0
4370
+ return (jsxRuntime.jsxs("div", { className: `${styles$4['zds-table__pagination']} ${className}`.trim(), ...rest, children: [jsxRuntime.jsxs("div", { className: styles$4['zds-table__pagination-select'], children: [jsxRuntime.jsx("label", { htmlFor: "items-per-page", className: styles$4['zds-table__pagination-label'], children: "Itens por p\u00E1gina" }), jsxRuntime.jsx("select", { id: "items-per-page", value: itemsPerPage, onChange: handleItemsPerPageChange, disabled: disabled, className: styles$4['zds-table__pagination-select-input'], children: pageSizeOptions.map((option) => (jsxRuntime.jsx("option", { value: option, children: option }, option))) })] }), jsxRuntime.jsx("div", { className: styles$4['zds-table__pagination-info'], children: jsxRuntime.jsx("span", { children: totalItems > 0
4789
4371
  ? `${startItem}–${endItem} de ${totalItems}`
4790
- : '0 itens' }) }), jsxRuntime.jsxs("div", { className: styles$3['zds-table__pagination-controls'], children: [jsxRuntime.jsx("button", { className: styles$3['zds-table__pagination-button'], onClick: handlePrevious, disabled: !canGoPrev, "aria-label": "P\u00E1gina anterior", children: jsxRuntime.jsx(reactIcons.ChevronLeft16Regular, {}) }), jsxRuntime.jsx("button", { className: styles$3['zds-table__pagination-button'], onClick: handleNext, disabled: !canGoNext, "aria-label": "Pr\u00F3xima p\u00E1gina", children: jsxRuntime.jsx(reactIcons.ChevronRight16Regular, {}) })] })] }));
4372
+ : '0 itens' }) }), jsxRuntime.jsxs("div", { className: styles$4['zds-table__pagination-controls'], children: [jsxRuntime.jsx("button", { className: styles$4['zds-table__pagination-button'], onClick: handlePrevious, disabled: !canGoPrev, "aria-label": "P\u00E1gina anterior", children: jsxRuntime.jsx(reactIcons.ChevronLeft16Regular, {}) }), jsxRuntime.jsx("button", { className: styles$4['zds-table__pagination-button'], onClick: handleNext, disabled: !canGoNext, "aria-label": "Pr\u00F3xima p\u00E1gina", children: jsxRuntime.jsx(reactIcons.ChevronRight16Regular, {}) })] })] }));
4791
4373
  };
4792
4374
 
4375
+ var styles$3 = {"container":"TextArea-module__container___WEBC-","inputWrapper":"TextArea-module__inputWrapper___-omPx","inputContainer":"TextArea-module__inputContainer___0-jKY","footer":"TextArea-module__footer___7XMlj","helperText":"TextArea-module__helperText___709rD","charCount":"TextArea-module__charCount___zdbxM","error":"TextArea-module__error___DWDms","disabled":"TextArea-module__disabled___lHxCa"};
4376
+
4377
+ const TextArea = React.forwardRef(({ className, value, label, placeholder, onChange, disabled = false, maxLength, required = false, helperText, tooltip = false, tooltipText, side = 'bottom', align = 'start', errorMessage, error, id, onBlur, onFocus, name, resize = 'vertical', showCharCount = false, height, ...textareaProps }, ref) => {
4378
+ const normalizeValue = (val) => {
4379
+ return val === undefined || val === null ? '' : String(val);
4380
+ };
4381
+ const [textareaValue, setTextareaValue] = React.useState(normalizeValue(value));
4382
+ const [textareaError, setTextareaError] = React.useState('');
4383
+ const generatedId = React.useId();
4384
+ const componentId = id || generatedId;
4385
+ React.useEffect(() => {
4386
+ setTextareaValue(normalizeValue(value));
4387
+ }, [value]);
4388
+ const handleChange = React.useCallback((e) => {
4389
+ const newValue = e.target.value;
4390
+ if (!disabled && (!maxLength || newValue.length <= maxLength)) {
4391
+ setTextareaValue(newValue);
4392
+ onChange?.(newValue);
4393
+ }
4394
+ }, [disabled, maxLength, onChange]);
4395
+ const handleBlur = React.useCallback((e) => {
4396
+ if (required && textareaValue.trim() === '') {
4397
+ setTextareaError(errorMessage || 'Campo obrigatório.');
4398
+ }
4399
+ else {
4400
+ setTextareaError('');
4401
+ }
4402
+ onBlur?.(e);
4403
+ }, [textareaValue, required, errorMessage, onBlur]);
4404
+ const handleFocus = React.useCallback((e) => {
4405
+ onFocus?.(e);
4406
+ }, [onFocus]);
4407
+ const hasError = Boolean(textareaError) || Boolean(error);
4408
+ const displayHelperText = (error ? errorMessage : undefined) || textareaError || helperText || '\u00A0';
4409
+ const helperId = (textareaError || error)
4410
+ ? `${componentId}-error`
4411
+ : helperText
4412
+ ? `${componentId}-helper`
4413
+ : undefined;
4414
+ const containerClass = clsx(styles$3.container, disabled && styles$3.disabled, hasError && !disabled && styles$3.error, className);
4415
+ return (jsxRuntime.jsxs("div", { className: containerClass, children: [label && (jsxRuntime.jsx(LabelComponent, { htmlFor: componentId, required: required, tooltip: tooltip, tooltipText: tooltipText, side: side, align: align, error: hasError, disabled: disabled, children: label })), jsxRuntime.jsxs("div", { className: styles$3.inputWrapper, children: [jsxRuntime.jsx("div", { className: styles$3.inputContainer, children: jsxRuntime.jsx("textarea", { ...textareaProps, ref: ref, id: componentId, name: name, value: textareaValue, placeholder: placeholder, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, maxLength: maxLength, disabled: disabled, "aria-invalid": hasError, "aria-required": required, "aria-describedby": helperId, style: { resize, height } }) }), jsxRuntime.jsxs("div", { className: styles$3.footer, children: [jsxRuntime.jsx("span", { id: helperId, className: styles$3.helperText, "aria-live": hasError ? 'polite' : undefined, children: displayHelperText }), showCharCount && maxLength && (jsxRuntime.jsxs("span", { className: styles$3.charCount, children: [textareaValue.length, "/", maxLength] }))] })] })] }));
4416
+ });
4417
+ TextArea.displayName = 'TextArea';
4418
+ var TextArea_default = React.memo(TextArea);
4419
+
4793
4420
  var styles$2 = {"toastViewport":"Toast-module__toastViewport___Ns71-","toastRoot":"Toast-module__toastRoot___ZtA3x","slideIn":"Toast-module__slideIn___QcXWP","toastTitle":"Toast-module__toastTitle___WbjNH","toastContent":"Toast-module__toastContent___IY5QB","toastClose":"Toast-module__toastClose___FqVsT","Icon":"Toast-module__Icon___ERU9c","iconInfo":"Toast-module__iconInfo___G-II3","iconSuccess":"Toast-module__iconSuccess___N8iF1","iconAlert":"Toast-module__iconAlert___SSf8u"};
4794
4421
 
4795
4422
  /**
@@ -5315,6 +4942,105 @@ function useApiSimulation(config = {}) {
5315
4942
  };
5316
4943
  }
5317
4944
 
4945
+ /**
4946
+ * Hook otimizado para scroll infinito usando IntersectionObserver
4947
+ */
4948
+ function useInfiniteScroll({ status, page, lastPage, onLoadMore, threshold = 0.1, rootMargin = '100px', enabled = true, debug = false }) {
4949
+ const observerRef = React.useRef(null);
4950
+ const [isIntersecting, setIsIntersecting] = React.useState(false);
4951
+ // Refs para controle de estado
4952
+ const loadingRef = React.useRef(false);
4953
+ const lastTriggeredPageRef = React.useRef(0);
4954
+ const onLoadMoreRef = React.useRef(onLoadMore);
4955
+ // Manter referência atualizada do callback
4956
+ React.useEffect(() => {
4957
+ onLoadMoreRef.current = onLoadMore;
4958
+ }, [onLoadMore]);
4959
+ // ✅ NOVO: Debug logger
4960
+ const debugLog = React.useCallback((message, data) => {
4961
+ if (debug) {
4962
+ console.log(`🔄 [InfiniteScroll] ${message}`, data || '');
4963
+ }
4964
+ }, [debug]);
4965
+ // ✅ MELHORADO: Callback do IntersectionObserver com mais controles
4966
+ const handleIntersect = React.useCallback((entries) => {
4967
+ const [target] = entries;
4968
+ const isVisible = target.isIntersecting;
4969
+ setIsIntersecting(isVisible);
4970
+ debugLog('Element intersecting:', isVisible);
4971
+ // Verificar se pode carregar mais
4972
+ const canLoadMore = enabled &&
4973
+ isVisible &&
4974
+ status !== 'loading' &&
4975
+ !loadingRef.current &&
4976
+ page < lastPage &&
4977
+ page !== lastTriggeredPageRef.current;
4978
+ debugLog('Can load more check:', {
4979
+ enabled,
4980
+ isVisible,
4981
+ status,
4982
+ isLoading: loadingRef.current,
4983
+ page,
4984
+ lastPage,
4985
+ lastTriggered: lastTriggeredPageRef.current,
4986
+ canLoad: canLoadMore
4987
+ });
4988
+ if (canLoadMore) {
4989
+ debugLog('Triggering load more for next page');
4990
+ loadingRef.current = true;
4991
+ lastTriggeredPageRef.current = page;
4992
+ onLoadMoreRef.current();
4993
+ }
4994
+ }, [enabled, status, page, lastPage, debugLog]);
4995
+ // ✅ MELHORADO: Observer com configurações personalizáveis
4996
+ React.useEffect(() => {
4997
+ if (!enabled) {
4998
+ debugLog('Hook disabled, skipping observer setup');
4999
+ return;
5000
+ }
5001
+ const observer = new IntersectionObserver(handleIntersect, {
5002
+ root: null,
5003
+ rootMargin,
5004
+ threshold,
5005
+ });
5006
+ const currentObserverRef = observerRef.current;
5007
+ if (currentObserverRef) {
5008
+ observer.observe(currentObserverRef);
5009
+ debugLog('IntersectionObserver attached', { rootMargin, threshold });
5010
+ }
5011
+ return () => {
5012
+ if (currentObserverRef) {
5013
+ observer.unobserve(currentObserverRef);
5014
+ debugLog('IntersectionObserver detached');
5015
+ }
5016
+ };
5017
+ }, [handleIntersect, rootMargin, threshold, enabled, debugLog]);
5018
+ // ✅ NOVO: Reset do loading flag quando status muda
5019
+ React.useEffect(() => {
5020
+ if (status !== 'loading') {
5021
+ loadingRef.current = false;
5022
+ debugLog('Loading flag reset', { status });
5023
+ }
5024
+ }, [status, debugLog]);
5025
+ // ✅ NOVO: Função de reset manual
5026
+ const reset = React.useCallback(() => {
5027
+ loadingRef.current = false;
5028
+ lastTriggeredPageRef.current = 0;
5029
+ setIsIntersecting(false);
5030
+ debugLog('Hook manually reset');
5031
+ }, [debugLog]);
5032
+ // Estados calculados
5033
+ const hasNextPage = page < lastPage;
5034
+ const isCompleted = page >= lastPage;
5035
+ return {
5036
+ observerRef,
5037
+ isIntersecting,
5038
+ hasNextPage,
5039
+ isCompleted,
5040
+ reset
5041
+ };
5042
+ }
5043
+
5318
5044
  exports.Avatar = Avatar;
5319
5045
  exports.Badge = Badge;
5320
5046
  exports.Button = Button;
@@ -5326,7 +5052,6 @@ exports.Container = Container;
5326
5052
  exports.DatePicker = DatePicker_default;
5327
5053
  exports.Dialog = Dialog;
5328
5054
  exports.Drawer = Drawer;
5329
- exports.Dropdown = MemoizedDropdown;
5330
5055
  exports.Filter = Filter;
5331
5056
  exports.ListItem = ListItem;
5332
5057
  exports.Menu = Menu;
@@ -5339,6 +5064,7 @@ exports.Switch = Switch;
5339
5064
  exports.Table = Table;
5340
5065
  exports.TableHeader = TableHeader;
5341
5066
  exports.TablePagination = TablePagination;
5067
+ exports.TextArea = TextArea_default;
5342
5068
  exports.TextField = TextField;
5343
5069
  exports.Toast = Toast;
5344
5070
  exports.ToastContainer = ToastContainer;