@giro-ds/react 8.0.0 → 9.1.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.
package/dist/index.esm.js CHANGED
@@ -2,26 +2,27 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import clsx from 'clsx';
3
3
  import { Avatar as Avatar$1, Tooltip as Tooltip$1, Checkbox as Checkbox$1, Popover as Popover$1, Label, AlertDialog, RadioGroup, DropdownMenu, Dialog as Dialog$1, Select as Select$1, Toast as Toast$1, Switch as Switch$1 } from 'radix-ui';
4
4
  import * as React from 'react';
5
- import React__default, { useId, useMemo, createContext, useState, useContext, forwardRef, useEffect, useCallback, useRef, memo, useReducer, createElement, isValidElement } from 'react';
6
- import { SpinnerIos16Regular, ChevronUp16Regular, ChevronLeft16Regular, ChevronRight16Regular, ChevronDown16Regular, Dismiss24Regular, Info12Regular, Dismiss16Regular, Calendar16Regular, Search16Regular, ChevronDownRegular, ChevronRight16Filled, Subtract16Regular, Add16Regular, SearchInfo20Regular, ArrowSortUp16Regular, ArrowSortDown16Regular, ArrowSort16Regular, Info20Filled, CheckmarkCircle20Filled, Warning20Filled, Dismiss16Filled } from '@fluentui/react-icons';
5
+ import React__default, { useId, useMemo, createContext, useState, useContext, useRef, useCallback, useEffect, useLayoutEffect, createElement, forwardRef, memo, useReducer, isValidElement } from 'react';
6
+ import { SpinnerIos16Regular, ChevronUp16Regular, ChevronLeft16Regular, ChevronRight16Regular, ChevronDown16Regular, Dismiss24Regular, Emoji20Regular, ChevronDown20Regular, KeyboardShiftUppercase20Regular, KeyboardShift20Filled, KeyboardShift20Regular, Backspace20Regular, Info12Regular, Dismiss16Regular, Calendar16Regular, FilterRegular, Search16Regular, ChevronDownRegular, ChevronRight16Filled, Subtract16Regular, Add16Regular, SearchInfo20Regular, ArrowSortUp16Regular, ArrowSortDown16Regular, ArrowSort16Regular, Info20Filled, CheckmarkCircle20Filled, Warning20Filled, Dismiss16Filled } from '@fluentui/react-icons';
7
7
  import { DayPicker } from 'react-day-picker';
8
8
  import { format, addDays, addMonths, addWeeks, addYears, differenceInCalendarDays, differenceInCalendarMonths, eachMonthOfInterval, eachYearOfInterval, endOfISOWeek, endOfMonth, endOfWeek, endOfYear, getISOWeek, getMonth, getYear, getWeek, isAfter, isBefore, isDate, isSameDay, isSameMonth, isSameYear, max, min, setMonth, setYear, startOfDay, startOfISOWeek, startOfMonth, startOfWeek, startOfYear } from 'date-fns';
9
9
  import { createPortal } from 'react-dom';
10
- import { useReactTable, getSortedRowModel, getPaginationRowModel, getFilteredRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
10
+ import Keyboard from 'react-simple-keyboard';
11
+ import { useReactTable, getSortedRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
11
12
  export { createColumnHelper as createTableColumnHelper } from '@tanstack/react-table';
12
13
  import Skeleton from 'react-loading-skeleton';
13
14
 
14
- var styles$s = {"AvatarRoot":"Avatar-module__AvatarRoot___7eNx7","AvatarRoot--sm":"Avatar-module__AvatarRoot--sm___LVHoe","AvatarRoot--lg":"Avatar-module__AvatarRoot--lg___QWux5","AvatarImage":"Avatar-module__AvatarImage___-H6iH","AvatarFallback":"Avatar-module__AvatarFallback___RDyNV"};
15
+ var styles$t = {"AvatarRoot":"Avatar-module__AvatarRoot___7eNx7","AvatarRoot--sm":"Avatar-module__AvatarRoot--sm___LVHoe","AvatarRoot--lg":"Avatar-module__AvatarRoot--lg___QWux5","AvatarImage":"Avatar-module__AvatarImage___-H6iH","AvatarFallback":"Avatar-module__AvatarFallback___RDyNV"};
15
16
 
16
17
  const Avatar = ({ icon, size = 'lg', src, className, initialLetters, ...rest }) => {
17
- const AvatarClass = clsx(styles$s.AvatarRoot, {
18
- [styles$s['AvatarRoot--lg']]: size === 'lg',
19
- [styles$s['AvatarRoot--sm']]: size === 'sm',
18
+ const AvatarClass = clsx(styles$t.AvatarRoot, {
19
+ [styles$t['AvatarRoot--lg']]: size === 'lg',
20
+ [styles$t['AvatarRoot--sm']]: size === 'sm',
20
21
  }, className);
21
- return (jsxs(Avatar$1.Root, { className: AvatarClass, ...rest, children: [src && (jsx(Avatar$1.Image, { className: styles$s.AvatarImage, src: src, alt: "Avatar" })), jsx(Avatar$1.Fallback, { className: styles$s.AvatarFallback, children: icon || initialLetters })] }));
22
+ return (jsxs(Avatar$1.Root, { className: AvatarClass, ...rest, children: [src && (jsx(Avatar$1.Image, { className: styles$t.AvatarImage, src: src, alt: "Avatar" })), jsx(Avatar$1.Fallback, { className: styles$t.AvatarFallback, children: icon || initialLetters })] }));
22
23
  };
23
24
 
24
- var styles$r = {"badge__status":"Badge-module__badge__status___-u3xv","badge":"Badge-module__badge___ZbEBU","badgeContainer":"Badge-module__badgeContainer___Guw9Z","badge__empty":"Badge-module__badge__empty___u8ccy","badge__flex":"Badge-module__badge__flex___DSJHW","badge__status__empty":"Badge-module__badge__status__empty___h8L4e","badge__status__flex":"Badge-module__badge__status__flex___703Q6","badge__status__filterBadge":"Badge-module__badge__status__filterBadge___DhjGU"};
25
+ var styles$s = {"badge__status":"Badge-module__badge__status___-u3xv","badge":"Badge-module__badge___ZbEBU","badgeContainer":"Badge-module__badgeContainer___Guw9Z","badge__empty":"Badge-module__badge__empty___u8ccy","badge__flex":"Badge-module__badge__flex___DSJHW","badge__status__empty":"Badge-module__badge__status__empty___h8L4e","badge__status__flex":"Badge-module__badge__status__flex___703Q6","badge__status__filterBadge":"Badge-module__badge__status__filterBadge___DhjGU"};
25
26
 
26
27
  const getDisplayValue = (value) => {
27
28
  if (value === null || value === undefined)
@@ -43,27 +44,27 @@ const Badge = ({ children, badgeValue = null, className, id, filterVariant = fal
43
44
  const displayValue = getDisplayValue(badgeValue);
44
45
  const isEmpty = displayValue === '';
45
46
  if (children) {
46
- return (jsxs("div", { className: styles$r.badgeContainer, ...rest, children: [jsx("div", { "data-testid": "badge-content", children: children }), jsx("div", { id: componentId, className: clsx(styles$r.badge, {
47
- [styles$r['badge__empty']]: isEmpty,
48
- [styles$r['badge__flex']]: displayValue.length >= 2,
47
+ return (jsxs("div", { className: styles$s.badgeContainer, ...rest, children: [jsx("div", { "data-testid": "badge-content", children: children }), jsx("div", { id: componentId, className: clsx(styles$s.badge, {
48
+ [styles$s['badge__empty']]: isEmpty,
49
+ [styles$s['badge__flex']]: displayValue.length >= 2,
49
50
  }, className), "data-testid": "badge", children: !isEmpty && jsx("span", { "aria-hidden": !!ariaLabel, children: displayValue }) })] }));
50
51
  }
51
- return (jsx("div", { className: styles$r.badgeContainer, children: jsx("div", { className: clsx(styles$r['badge__status'], {
52
- [styles$r['badge__status__empty']]: isEmpty,
53
- [styles$r['badge__status__flex']]: displayValue.length >= 2,
54
- [styles$r['badge__status__filterBadge']]: filterVariant,
52
+ return (jsx("div", { className: styles$s.badgeContainer, children: jsx("div", { className: clsx(styles$s['badge__status'], {
53
+ [styles$s['badge__status__empty']]: isEmpty,
54
+ [styles$s['badge__status__flex']]: displayValue.length >= 2,
55
+ [styles$s['badge__status__filterBadge']]: filterVariant,
55
56
  }, className), "data-testid": "badge", children: !isEmpty && (jsx("span", { "aria-hidden": !!ariaLabel, children: displayValue })) }) }));
56
57
  };
57
58
 
58
- var styles$q = {"tooltipContent":"Tooltip-module__tooltipContent___xycUg","triggerWrapper":"Tooltip-module__triggerWrapper___x83XR"};
59
+ var styles$r = {"tooltipContent":"Tooltip-module__tooltipContent___xycUg","triggerWrapper":"Tooltip-module__triggerWrapper___x83XR"};
59
60
 
60
61
  const Tooltip = ({ children, text, side = 'bottom', align = 'start', maxWidth, sideOffset = 10, className, ...rest }) => {
61
- return (jsx(Tooltip$1.Provider, { children: jsxs(Tooltip$1.Root, { children: [jsx(Tooltip$1.Trigger, { asChild: true, children: jsx("span", { className: styles$q.triggerWrapper, children: children }) }), jsx(Tooltip$1.Portal, { children: jsx(Tooltip$1.Content, { className: clsx(styles$q.tooltipContent, className), side: side, align: align, sideOffset: sideOffset, style: { maxWidth: maxWidth ? `${maxWidth}px` : 'auto' }, ...rest, children: text }) })] }) }));
62
+ return (jsx(Tooltip$1.Provider, { children: jsxs(Tooltip$1.Root, { children: [jsx(Tooltip$1.Trigger, { asChild: true, children: jsx("span", { className: styles$r.triggerWrapper, children: children }) }), jsx(Tooltip$1.Portal, { children: jsx(Tooltip$1.Content, { className: clsx(styles$r.tooltipContent, className), side: side, align: align, sideOffset: sideOffset, style: { maxWidth: maxWidth ? `${maxWidth}px` : 'auto' }, ...rest, children: text }) })] }) }));
62
63
  };
63
64
 
64
- var styles$p = {"button":"Button-module__button___18Bed","button-lg":"Button-module__button-lg___-A8B9","button-sm":"Button-module__button-sm___L7aT7","button-filled":"Button-module__button-filled___IQx1z","button-outlined":"Button-module__button-outlined___hLkLN","button-text":"Button-module__button-text___8GFeA","buttonWithIcon":"Button-module__buttonWithIcon___8ehK1","buttonIconPosition-left":"Button-module__buttonIconPosition-left___uOY6b","buttonIconPosition-right":"Button-module__buttonIconPosition-right___eswRS","buttonIconPosition-both":"Button-module__buttonIconPosition-both___1Lith","buttonNoContent":"Button-module__buttonNoContent___Tc9jk","buttonIconOnly":"Button-module__buttonIconOnly___aifk4","buttonIconLeft":"Button-module__buttonIconLeft___RICR3","buttonIconRight":"Button-module__buttonIconRight___71lu2","buttonFullWidth":"Button-module__buttonFullWidth___tXuVE","disabled":"Button-module__disabled___UzdWL","buttonLoading":"Button-module__buttonLoading___RGdNw","buttonContentHidden":"Button-module__buttonContentHidden___CoCiN","buttonLoadingSpinner":"Button-module__buttonLoadingSpinner___oZxEU","spin":"Button-module__spin___kQKH9"};
65
+ var styles$q = {"button":"Button-module__button___18Bed","button-lg":"Button-module__button-lg___-A8B9","button-sm":"Button-module__button-sm___L7aT7","button-filled":"Button-module__button-filled___IQx1z","button-outlined":"Button-module__button-outlined___hLkLN","button-text":"Button-module__button-text___8GFeA","buttonWithIcon":"Button-module__buttonWithIcon___8ehK1","buttonIconPosition-left":"Button-module__buttonIconPosition-left___uOY6b","buttonIconPosition-right":"Button-module__buttonIconPosition-right___eswRS","buttonIconPosition-both":"Button-module__buttonIconPosition-both___1Lith","buttonNoContent":"Button-module__buttonNoContent___Tc9jk","buttonIconOnly":"Button-module__buttonIconOnly___aifk4","buttonIconLeft":"Button-module__buttonIconLeft___RICR3","buttonIconRight":"Button-module__buttonIconRight___71lu2","buttonFullWidth":"Button-module__buttonFullWidth___tXuVE","disabled":"Button-module__disabled___UzdWL","buttonLoading":"Button-module__buttonLoading___RGdNw","buttonContentHidden":"Button-module__buttonContentHidden___CoCiN","buttonLoadingSpinner":"Button-module__buttonLoadingSpinner___oZxEU","spin":"Button-module__spin___kQKH9"};
65
66
 
66
- const Button = React__default.forwardRef(({ as, children, variant = 'filled', iconPosition = 'left', href, to, external = false, target, rel, disabled = false, onClick, size = 'lg', className, type = 'button', id, icon, fullWidth = false, ariaLabel, iconOnly = false, loading = false, tooltipText, tooltipSide = 'top', tooltipAlign = 'center', ...rest }, ref) => {
67
+ const Button = React__default.forwardRef(({ as, children, variant = 'filled', iconPosition = 'left', href, to, external = false, target, rel, disabled = false, onClick, size = 'lg', scale = 1, className, type = 'button', id, icon, fullWidth = false, ariaLabel, iconOnly = false, loading = false, tooltipText, tooltipSide = 'top', tooltipAlign = 'center', ...rest }, ref) => {
67
68
  const generatedId = useId();
68
69
  const componentId = id || generatedId;
69
70
  const getComponent = () => {
@@ -90,14 +91,19 @@ const Button = React__default.forwardRef(({ as, children, variant = 'filled', ic
90
91
  'Forneça um ícone via `icon={<MeuIcone />}`.');
91
92
  }
92
93
  const resolvedIcon = icon;
93
- const buttonClasses = clsx(styles$p.button, styles$p[`button-${variant}`], styles$p[`button-${size}`], {
94
- [styles$p['disabled']]: disabled,
95
- [styles$p['buttonLoading']]: loading,
96
- [styles$p['buttonWithIcon']]: resolvedIcon && !iconOnly,
97
- [styles$p[`buttonIconPosition-${iconPosition}`]]: resolvedIcon && !iconOnly,
98
- [styles$p['buttonNoContent']]: resolvedIcon && !hasContent && !iconOnly,
99
- [styles$p['buttonFullWidth']]: fullWidth,
100
- [styles$p['buttonIconOnly']]: iconOnly,
94
+ const scaleClass = {
95
+ 1: 'scale-1-0',
96
+ 1.5: 'scale-1-5',
97
+ 2: 'scale-2-0',
98
+ }[scale];
99
+ const buttonClasses = clsx(styles$q.button, styles$q[`button-${variant}`], styles$q[`button-${size}`], scaleClass, {
100
+ [styles$q['disabled']]: disabled,
101
+ [styles$q['buttonLoading']]: loading,
102
+ [styles$q['buttonWithIcon']]: resolvedIcon && !iconOnly,
103
+ [styles$q[`buttonIconPosition-${iconPosition}`]]: resolvedIcon && !iconOnly,
104
+ [styles$q['buttonNoContent']]: resolvedIcon && !hasContent && !iconOnly,
105
+ [styles$q['buttonFullWidth']]: fullWidth,
106
+ [styles$q['buttonIconOnly']]: iconOnly,
101
107
  }, className);
102
108
  const getAriaLabel = () => {
103
109
  if (ariaLabel)
@@ -123,12 +129,12 @@ const Button = React__default.forwardRef(({ as, children, variant = 'filled', ic
123
129
  };
124
130
  const renderContent = () => {
125
131
  if (iconOnly && !loading) {
126
- return (jsx("span", { className: styles$p.buttonIconOnly, "aria-hidden": "true", children: resolvedIcon }));
132
+ return (jsx("span", { className: styles$q.buttonIconOnly, "aria-hidden": "true", children: resolvedIcon }));
127
133
  }
128
134
  if (loading) {
129
- return (jsxs(Fragment, { children: [!iconOnly && (jsxs("span", { className: styles$p.buttonContentHidden, "aria-hidden": "true", children: [resolvedIcon && (iconPosition === 'left' || iconPosition === 'both') && (jsx("span", { className: styles$p.buttonIconLeft, children: resolvedIcon })), children, resolvedIcon && (iconPosition === 'right' || iconPosition === 'both') && (jsx("span", { className: styles$p.buttonIconRight, children: resolvedIcon }))] })), jsx("span", { className: styles$p.buttonLoadingSpinner, "aria-hidden": "true", children: jsx(SpinnerIos16Regular, { "aria-hidden": "true" }) })] }));
135
+ return (jsxs(Fragment, { children: [!iconOnly && (jsxs("span", { className: styles$q.buttonContentHidden, "aria-hidden": "true", children: [resolvedIcon && (iconPosition === 'left' || iconPosition === 'both') && (jsx("span", { className: styles$q.buttonIconLeft, children: resolvedIcon })), children, resolvedIcon && (iconPosition === 'right' || iconPosition === 'both') && (jsx("span", { className: styles$q.buttonIconRight, children: resolvedIcon }))] })), jsx("span", { className: styles$q.buttonLoadingSpinner, "aria-hidden": "true", children: jsx(SpinnerIos16Regular, { "aria-hidden": "true" }) })] }));
130
136
  }
131
- return (jsxs(Fragment, { children: [resolvedIcon && (iconPosition === 'left' || iconPosition === 'both') && (jsx("span", { className: styles$p.buttonIconLeft, "aria-hidden": "true", children: resolvedIcon })), children, resolvedIcon && (iconPosition === 'right' || iconPosition === 'both') && (jsx("span", { className: styles$p.buttonIconRight, "aria-hidden": "true", children: resolvedIcon }))] }));
137
+ return (jsxs(Fragment, { children: [resolvedIcon && (iconPosition === 'left' || iconPosition === 'both') && (jsx("span", { className: styles$q.buttonIconLeft, "aria-hidden": "true", children: resolvedIcon })), children, resolvedIcon && (iconPosition === 'right' || iconPosition === 'both') && (jsx("span", { className: styles$q.buttonIconRight, "aria-hidden": "true", children: resolvedIcon }))] }));
132
138
  };
133
139
  const baseProps = {
134
140
  ref,
@@ -2433,7 +2439,7 @@ const ptBR = {
2433
2439
  },
2434
2440
  };
2435
2441
 
2436
- var styles$o = {"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","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"};
2442
+ var styles$p = {"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","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"};
2437
2443
 
2438
2444
  const FLUENT_CHEVRON_MAP = {
2439
2445
  down: ChevronDown16Regular,
@@ -2452,10 +2458,10 @@ const GridMonthCaption = ({ calendarMonth, displayIndex: _displayIndex, ...divPr
2452
2458
  const date = calendarMonth.date;
2453
2459
  const monthLabel = new Intl.DateTimeFormat(intlLocale, { month: "long" }).format(date);
2454
2460
  const yearLabel = String(date.getFullYear());
2455
- return (jsxs("div", { ...divProps, children: [jsx("span", { className: styles$o.caption_grid_label, children: monthLabel }), jsxs("button", { type: "button", className: styles$o.caption_grid_btn, "aria-pressed": view === "years", onClick: onYearLabelClick, children: [yearLabel, view !== "days" ? (jsx(ChevronUp16Regular, { className: styles$o.caption_year_chevron, "aria-hidden": true })) : (jsx(ChevronDown16Regular, { className: styles$o.caption_year_chevron, "aria-hidden": true }))] })] }));
2461
+ return (jsxs("div", { ...divProps, children: [jsx("span", { className: styles$p.caption_grid_label, children: monthLabel }), jsxs("button", { type: "button", className: styles$p.caption_grid_btn, "aria-pressed": view === "years", onClick: onYearLabelClick, children: [yearLabel, view !== "days" ? (jsx(ChevronUp16Regular, { className: styles$p.caption_year_chevron, "aria-hidden": true })) : (jsx(ChevronDown16Regular, { className: styles$p.caption_year_chevron, "aria-hidden": true }))] })] }));
2456
2462
  };
2457
2463
  const YEARS_PER_PAGE = 20;
2458
- const Calendar = ({ selected, currentDate, defaultMonth, startMonth, endMonth, onDaySelect, onDateChange, onClear: _onClear, minDate, maxDate, disabled, format: _format, locale = "pt-br", autoFocus, className, id, "aria-label": ariaLabel, ...rest }) => {
2464
+ const Calendar = ({ selected, currentDate, defaultMonth, startMonth, endMonth, onDaySelect, onDateChange, onClear: _onClear, minDate, maxDate, disabled, format: _format, locale = "pt-br", autoFocus, className, scale = 1, id, "aria-label": ariaLabel, ...rest }) => {
2459
2465
  const animate = true;
2460
2466
  const [internalSelected, setInternalSelected] = useState(selected ?? undefined);
2461
2467
  const [internalDisplayMonth, setInternalDisplayMonth] = useState(() => currentDate ?? defaultMonth ?? new Date());
@@ -2520,7 +2526,7 @@ const Calendar = ({ selected, currentDate, defaultMonth, startMonth, endMonth, o
2520
2526
  onYearLabelClick: handleYearLabelClick,
2521
2527
  };
2522
2528
  const sharedDayPickerProps = {
2523
- classNames: styles$o,
2529
+ classNames: styles$p,
2524
2530
  animate,
2525
2531
  mode: "single",
2526
2532
  selected: resolvedSelected,
@@ -2532,10 +2538,15 @@ const Calendar = ({ selected, currentDate, defaultMonth, startMonth, endMonth, o
2532
2538
  autoFocus,
2533
2539
  "aria-label": ariaLabel,
2534
2540
  };
2535
- return (jsx(GridCtx.Provider, { value: gridCtxValue, children: jsxs("div", { className: clsx(styles$o.calendar_grid_wrapper, className), children: [jsx(DayPicker, { id: id, ...sharedDayPickerProps, ...rest, captionLayout: "label", month: resolvedDisplayMonth, onMonthChange: handleMonthChange, components: { MonthCaption: GridMonthCaption, Chevron: CustomChevron } }), gridView !== "days" && (jsxs("div", { className: `${styles$o.gridOverlay}${gridView === "years" ? ` ${styles$o.gridOverlayYears}` : ""}`, role: "dialog", "aria-modal": "true", "aria-label": gridView === "months" ? "Selecione o mês" : "Selecione o ano", children: [gridView === "months" && (jsxs(Fragment, { children: [jsxs("div", { className: styles$o.gridOverlayCaption, children: [jsx("span", { className: styles$o.caption_grid_label, children: new Intl.DateTimeFormat(intlLocale, { month: "long" }).format(resolvedDisplayMonth) }), jsxs("button", { type: "button", className: styles$o.caption_grid_btn, onClick: () => setGridView("days"), "aria-label": "Fechar sele\u00E7\u00E3o de m\u00EAs", children: [displayedYear, jsx(ChevronUp16Regular, { className: styles$o.caption_year_chevron, "aria-hidden": true })] })] }), jsx("div", { className: styles$o.gridCells, children: monthsGrid.map(({ index, label, disabled: monthDisabled }) => (jsx("button", { type: "button", disabled: monthDisabled, className: `${styles$o.gridCell}${displayedMonthIndex === index ? ` ${styles$o.gridCellActive}` : ""}`, onClick: () => handleGridMonthSelect(index), children: label }, index))) })] })), gridView === "years" && (jsxs(Fragment, { children: [jsxs("div", { className: styles$o.gridOverlayCaption, children: [jsx("span", { className: styles$o.caption_grid_label, children: new Intl.DateTimeFormat(intlLocale, { month: "long" }).format(resolvedDisplayMonth) }), jsxs("button", { type: "button", className: styles$o.caption_grid_btn, onClick: () => setGridView("days"), "aria-label": "Fechar sele\u00E7\u00E3o de ano", children: [displayedYear, jsx(ChevronUp16Regular, { className: styles$o.caption_year_chevron, "aria-hidden": true })] }), jsxs("div", { className: styles$o.gridOverlayYearsNav, children: [jsx("button", { type: "button", className: styles$o.gridNavBtn, disabled: !canGoPrevYears, onClick: () => setYearPageStart((s) => s - YEARS_PER_PAGE), "aria-label": "Anos anteriores", children: jsx(ChevronLeft16Regular, { className: styles$o.chevronNavBtnPrev, "aria-hidden": true }) }), jsx("button", { type: "button", className: styles$o.gridNavBtn, disabled: !canGoNextYears, onClick: () => setYearPageStart((s) => s + YEARS_PER_PAGE), "aria-label": "Pr\u00F3ximos anos", children: jsx(ChevronRight16Regular, { className: styles$o.chevronNavBtnNext, "aria-hidden": true }) })] })] }), jsx("div", { className: `${styles$o.gridCells} ${styles$o.gridCellsYears}`, children: yearsInPage.map((year) => (jsx("button", { type: "button", className: `${styles$o.gridCell}${displayedYear === year ? ` ${styles$o.gridCellActive}` : ""}`, onClick: () => handleGridYearSelect(year), children: year }, year))) })] }))] }))] }) }));
2541
+ const scaleClass = {
2542
+ 1: 'scale-1-0',
2543
+ 1.5: 'scale-1-5',
2544
+ 2: 'scale-2-0',
2545
+ }[scale];
2546
+ return (jsx(GridCtx.Provider, { value: gridCtxValue, children: jsxs("div", { className: clsx(styles$p.calendar_grid_wrapper, scaleClass, className), children: [jsx(DayPicker, { id: id, ...sharedDayPickerProps, ...rest, captionLayout: "label", month: resolvedDisplayMonth, onMonthChange: handleMonthChange, components: { MonthCaption: GridMonthCaption, Chevron: CustomChevron } }), gridView !== "days" && (jsxs("div", { className: `${styles$p.gridOverlay}${gridView === "years" ? ` ${styles$p.gridOverlayYears}` : ""}`, role: "dialog", "aria-modal": "true", "aria-label": gridView === "months" ? "Selecione o mês" : "Selecione o ano", children: [gridView === "months" && (jsxs(Fragment, { children: [jsxs("div", { className: styles$p.gridOverlayCaption, children: [jsx("span", { className: styles$p.caption_grid_label, children: new Intl.DateTimeFormat(intlLocale, { month: "long" }).format(resolvedDisplayMonth) }), jsxs("button", { type: "button", className: styles$p.caption_grid_btn, onClick: () => setGridView("days"), "aria-label": "Fechar sele\u00E7\u00E3o de m\u00EAs", children: [displayedYear, jsx(ChevronUp16Regular, { className: styles$p.caption_year_chevron, "aria-hidden": true })] })] }), jsx("div", { className: styles$p.gridCells, children: monthsGrid.map(({ index, label, disabled: monthDisabled }) => (jsx("button", { type: "button", disabled: monthDisabled, className: `${styles$p.gridCell}${displayedMonthIndex === index ? ` ${styles$p.gridCellActive}` : ""}`, onClick: () => handleGridMonthSelect(index), children: label }, index))) })] })), gridView === "years" && (jsxs(Fragment, { children: [jsxs("div", { className: styles$p.gridOverlayCaption, children: [jsx("span", { className: styles$p.caption_grid_label, children: new Intl.DateTimeFormat(intlLocale, { month: "long" }).format(resolvedDisplayMonth) }), jsxs("button", { type: "button", className: styles$p.caption_grid_btn, onClick: () => setGridView("days"), "aria-label": "Fechar sele\u00E7\u00E3o de ano", children: [displayedYear, jsx(ChevronUp16Regular, { className: styles$p.caption_year_chevron, "aria-hidden": true })] }), jsxs("div", { className: styles$p.gridOverlayYearsNav, children: [jsx("button", { type: "button", className: styles$p.gridNavBtn, disabled: !canGoPrevYears, onClick: () => setYearPageStart((s) => s - YEARS_PER_PAGE), "aria-label": "Anos anteriores", children: jsx(ChevronLeft16Regular, { className: styles$p.chevronNavBtnPrev, "aria-hidden": true }) }), jsx("button", { type: "button", className: styles$p.gridNavBtn, disabled: !canGoNextYears, onClick: () => setYearPageStart((s) => s + YEARS_PER_PAGE), "aria-label": "Pr\u00F3ximos anos", children: jsx(ChevronRight16Regular, { className: styles$p.chevronNavBtnNext, "aria-hidden": true }) })] })] }), jsx("div", { className: `${styles$p.gridCells} ${styles$p.gridCellsYears}`, children: yearsInPage.map((year) => (jsx("button", { type: "button", className: `${styles$p.gridCell}${displayedYear === year ? ` ${styles$p.gridCellActive}` : ""}`, onClick: () => handleGridYearSelect(year), children: year }, year))) })] }))] }))] }) }));
2536
2547
  };
2537
2548
 
2538
- var styles$n = {"container":"Callout-module__container___dggFW","withTitle":"Callout-module__withTitle___e-HEg","brand":"Callout-module__brand___YHDPQ","success":"Callout-module__success___RPS0Q","alert":"Callout-module__alert___LVlJM","content":"Callout-module__content___g44Qz","icon":"Callout-module__icon___4CBkz","subcontent":"Callout-module__subcontent___5hz-f","title":"Callout-module__title___IPSdE","text":"Callout-module__text___0Ys48","dismiss":"Callout-module__dismiss___ZaycS"};
2549
+ var styles$o = {"container":"Callout-module__container___dggFW","withTitle":"Callout-module__withTitle___e-HEg","brand":"Callout-module__brand___YHDPQ","success":"Callout-module__success___RPS0Q","alert":"Callout-module__alert___LVlJM","content":"Callout-module__content___g44Qz","icon":"Callout-module__icon___4CBkz","subcontent":"Callout-module__subcontent___5hz-f","title":"Callout-module__title___IPSdE","text":"Callout-module__text___0Ys48","dismiss":"Callout-module__dismiss___ZaycS"};
2539
2550
 
2540
2551
  const Callout = ({ variant = 'neutral', title, text, icon, onDismiss, dismiss, backgroundColor, textColor, className, id, style, ...rest }) => {
2541
2552
  if (process.env.NODE_ENV !== 'production' && (text === '' || (typeof text === 'string' && !text.trim()))) {
@@ -2545,13 +2556,13 @@ const Callout = ({ variant = 'neutral', title, text, icon, onDismiss, dismiss, b
2545
2556
  const titleId = `callout-title-${id || generatedId}`;
2546
2557
  const componentId = id || generatedId;
2547
2558
  const isAlert = variant === 'alert';
2548
- const containerClass = clsx(styles$n.container, styles$n[variant], { [styles$n.withTitle]: title }, className);
2559
+ const containerClass = clsx(styles$o.container, styles$o[variant], { [styles$o.withTitle]: title }, className);
2549
2560
  const customStyle = {
2550
2561
  ...style,
2551
2562
  ...(backgroundColor && { '--callout-bg': `var(--${backgroundColor})` }),
2552
2563
  ...(textColor && { '--callout-text': `var(--${textColor})` }),
2553
2564
  };
2554
- return (jsx("div", { id: componentId, className: containerClass, role: isAlert ? 'alert' : 'status', "aria-live": isAlert ? 'assertive' : 'polite', "aria-labelledby": title ? titleId : undefined, style: customStyle, ...rest, children: jsxs("div", { className: styles$n.content, children: [icon && jsx("span", { className: styles$n.icon, "aria-hidden": "true", children: icon }), jsxs("div", { className: styles$n.subcontent, children: [title && (jsx("span", { id: titleId, className: styles$n.title, children: title })), text && jsx("span", { className: styles$n.text, children: text })] }), dismiss && (jsx("button", { className: styles$n.dismiss, onClick: onDismiss, type: "button", "aria-label": "Fechar", children: jsx(Dismiss24Regular, { "aria-hidden": "true" }) }))] }) }));
2565
+ return (jsx("div", { id: componentId, className: containerClass, role: isAlert ? 'alert' : 'status', "aria-live": isAlert ? 'assertive' : 'polite', "aria-labelledby": title ? titleId : undefined, style: customStyle, ...rest, children: jsxs("div", { className: styles$o.content, children: [icon && jsx("span", { className: styles$o.icon, "aria-hidden": "true", children: icon }), jsxs("div", { className: styles$o.subcontent, children: [title && (jsx("span", { id: titleId, className: styles$o.title, children: title })), text && jsx("span", { className: styles$o.text, children: text })] }), dismiss && (jsx("button", { className: styles$o.dismiss, onClick: onDismiss, type: "button", "aria-label": "Fechar", children: jsx(Dismiss24Regular, { "aria-hidden": "true" }) }))] }) }));
2555
2566
  };
2556
2567
 
2557
2568
  const CheckSmall = ({ className = '', width = 12, height = 10, fill = 'white', ...restProps }) => {
@@ -2562,22 +2573,32 @@ const CheckHalf = ({ className = '', width = 16, height = 16, fill = 'white', ..
2562
2573
  return (jsx("svg", { width: width, height: height, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, "aria-hidden": "true", ...restProps, children: jsx("g", { id: "Icons/check_indeterminate_small", children: jsx("path", { id: "icon", d: "M3 9V7H13V9H3Z", fill: fill }) }) }));
2563
2574
  };
2564
2575
 
2565
- var styles$m = {"container":"Checkbox-module__container___pUY-s","root":"Checkbox-module__root___BS5dT","disabled":"Checkbox-module__disabled___WagIC","label":"Checkbox-module__label___JBaRm","indicator":"Checkbox-module__indicator___HXLHH","wrapperCheckbox":"Checkbox-module__wrapperCheckbox___m2qIW"};
2576
+ var styles$n = {"container":"Checkbox-module__container___pUY-s","root":"Checkbox-module__root___BS5dT","disabled":"Checkbox-module__disabled___WagIC","label":"Checkbox-module__label___JBaRm","indicator":"Checkbox-module__indicator___HXLHH","wrapperCheckbox":"Checkbox-module__wrapperCheckbox___m2qIW"};
2566
2577
 
2567
- const Checkbox = ({ id, label, onCheckedChange, checked, disabled, className, indeterminate = false, ...rest }) => {
2578
+ const Checkbox = ({ id, label, onCheckedChange, checked, disabled, className, scale = 1, indeterminate = false, ...rest }) => {
2568
2579
  const componentId = id || React.useId();
2569
- return (jsxs("div", { className: clsx(styles$m.container, className), children: [jsx("div", { className: clsx(styles$m.wrapperCheckbox, {
2570
- [styles$m.disabled]: disabled,
2571
- }), role: "presentation", tabIndex: disabled ? -1 : 0, children: jsx(Checkbox$1.Root, { className: styles$m.root, checked: indeterminate ? 'indeterminate' : checked, id: componentId, onCheckedChange: onCheckedChange, disabled: disabled, "data-disabled": disabled, "data-indeterminate": indeterminate, "aria-checked": indeterminate ? 'mixed' : checked ? 'true' : 'false', ...rest, children: jsx(Checkbox$1.Indicator, { className: styles$m.indicator, children: indeterminate ? jsx(CheckHalf, {}) : jsx(CheckSmall, {}) }) }) }), jsx("label", { className: clsx(styles$m.label, { [styles$m.disabled]: disabled }), htmlFor: componentId, children: label })] }));
2580
+ const scaleClass = {
2581
+ 1: 'scale-1-0',
2582
+ 1.5: 'scale-1-5',
2583
+ 2: 'scale-2-0',
2584
+ }[scale];
2585
+ return (jsxs("div", { className: clsx(styles$n.container, scaleClass, className), children: [jsx("div", { className: clsx(styles$n.wrapperCheckbox, {
2586
+ [styles$n.disabled]: disabled,
2587
+ }), role: "presentation", tabIndex: disabled ? -1 : 0, children: jsx(Checkbox$1.Root, { className: styles$n.root, checked: indeterminate ? 'indeterminate' : checked, id: componentId, onCheckedChange: onCheckedChange, disabled: disabled, "data-disabled": disabled, "data-indeterminate": indeterminate, "aria-checked": indeterminate ? 'mixed' : checked ? 'true' : 'false', ...rest, children: jsx(Checkbox$1.Indicator, { className: styles$n.indicator, children: indeterminate ? jsx(CheckHalf, {}) : jsx(CheckSmall, {}) }) }) }), jsx("label", { className: clsx(styles$n.label, { [styles$n.disabled]: disabled }), htmlFor: componentId, children: label })] }));
2572
2588
  };
2573
2589
 
2574
- var styles$l = {"chips":"Chips-module__chips___SOvBe","title":"Chips-module__title___ZhuQi","iconLeft":"Chips-module__iconLeft___tPhnw","iconRight":"Chips-module__iconRight___-HxL2","hasLeftIcon":"Chips-module__hasLeftIcon___D3quS","hasRightIcon":"Chips-module__hasRightIcon___ZMx2Y","brand":"Chips-module__brand___q1Gsm","success":"Chips-module__success___UhxQa","alert":"Chips-module__alert___nvPnr","disabled":"Chips-module__disabled___ElWLI"};
2575
-
2576
- const Chips = ({ children, leftIcon, rightIcon, variant = 'neutral', disabled = false, backgroundColor, textColor, className, style, ...rest }) => {
2577
- const chipsClass = clsx(styles$l.chips, styles$l[variant], {
2578
- [styles$l.disabled]: disabled,
2579
- [styles$l.hasLeftIcon]: leftIcon,
2580
- [styles$l.hasRightIcon]: rightIcon,
2590
+ var styles$m = {"chips":"Chips-module__chips___SOvBe","title":"Chips-module__title___ZhuQi","iconLeft":"Chips-module__iconLeft___tPhnw","iconRight":"Chips-module__iconRight___-HxL2","hasLeftIcon":"Chips-module__hasLeftIcon___D3quS","hasRightIcon":"Chips-module__hasRightIcon___ZMx2Y","brand":"Chips-module__brand___q1Gsm","success":"Chips-module__success___UhxQa","alert":"Chips-module__alert___nvPnr","disabled":"Chips-module__disabled___ElWLI"};
2591
+
2592
+ const Chips = ({ children, leftIcon, rightIcon, variant = 'neutral', disabled = false, backgroundColor, textColor, scale = 1, className, style, ...rest }) => {
2593
+ const scaleClass = {
2594
+ 1: 'scale-1-0',
2595
+ 1.5: 'scale-1-5',
2596
+ 2: 'scale-2-0',
2597
+ }[scale];
2598
+ const chipsClass = clsx(styles$m.chips, styles$m[variant], scaleClass, {
2599
+ [styles$m.disabled]: disabled,
2600
+ [styles$m.hasLeftIcon]: leftIcon,
2601
+ [styles$m.hasRightIcon]: rightIcon,
2581
2602
  }, className);
2582
2603
  const colorStyle = {
2583
2604
  ...(!disabled && backgroundColor && { '--chips-bg': `var(--${backgroundColor})` }),
@@ -2585,24 +2606,631 @@ const Chips = ({ children, leftIcon, rightIcon, variant = 'neutral', disabled =
2585
2606
  ...style,
2586
2607
  };
2587
2608
  const isInteractive = typeof rest.onClick === 'function';
2588
- return (jsxs("div", { className: chipsClass, "aria-disabled": disabled, style: colorStyle, role: isInteractive ? 'button' : undefined, tabIndex: isInteractive ? (disabled ? -1 : 0) : undefined, ...rest, children: [leftIcon && (jsx("span", { className: styles$l.iconLeft, "aria-hidden": "true", children: leftIcon })), jsx("span", { className: styles$l.title, children: children }), rightIcon && (jsx("span", { className: styles$l.iconRight, children: rightIcon }))] }));
2609
+ return (jsxs("div", { className: chipsClass, "aria-disabled": disabled, style: colorStyle, role: isInteractive ? 'button' : undefined, tabIndex: isInteractive ? (disabled ? -1 : 0) : undefined, ...rest, children: [leftIcon && (jsx("span", { className: styles$m.iconLeft, "aria-hidden": "true", children: leftIcon })), jsx("span", { className: styles$m.title, children: children }), rightIcon && (jsx("span", { className: styles$m.iconRight, children: rightIcon }))] }));
2589
2610
  };
2590
2611
  const MemoizedChips = React__default.memo(Chips);
2591
2612
  MemoizedChips.displayName = 'Chips';
2592
2613
 
2593
- var styles$k = {"container":"Container-module__container___exPuE"};
2614
+ var styles$l = {"container":"Container-module__container___exPuE"};
2594
2615
 
2595
2616
  function Container({ children, className }) {
2596
- return (jsx("main", { className: clsx(styles$k['container'], 'mx-auto', className), children: children }));
2617
+ return (jsx("main", { className: clsx(styles$l['container'], 'mx-auto', className), children: children }));
2597
2618
  }
2598
2619
 
2599
- var styles$j = {"Content":"Popover-module__Content___RIETg"};
2620
+ var styles$k = {"Content":"Popover-module__Content___RIETg"};
2600
2621
 
2601
2622
  const Popover = ({ trigger, content, side = "left", align = "start", sideOffset = 8, open, onOpenChange, asAnchor = false, onOpenAutoFocus, onCloseAutoFocus, showArrow = false, className, ...rest }) => {
2602
- return (jsxs(Popover$1.Root, { open: open, onOpenChange: onOpenChange, ...rest, children: [asAnchor ? (jsx(Popover$1.Anchor, { asChild: true, children: trigger })) : (jsx(Popover$1.Trigger, { asChild: true, children: trigger })), jsx(Popover$1.Portal, { children: jsxs(Popover$1.Content, { className: clsx(styles$j.Content, className), 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, showArrow && jsx(Popover$1.Arrow, {})] }) })] }));
2623
+ return (jsxs(Popover$1.Root, { open: open, onOpenChange: onOpenChange, ...rest, children: [asAnchor ? (jsx(Popover$1.Anchor, { asChild: true, children: trigger })) : (jsx(Popover$1.Trigger, { asChild: true, children: trigger })), jsx(Popover$1.Portal, { children: jsxs(Popover$1.Content, { className: clsx(styles$k.Content, className), 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, showArrow && jsx(Popover$1.Arrow, {})] }) })] }));
2603
2624
  };
2604
2625
 
2605
- var styles$i = {"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"};
2626
+ function useInputKeyboardValue(externalRef) {
2627
+ const internalRef = useRef(null);
2628
+ const setRefs = useCallback((node) => {
2629
+ internalRef.current = node;
2630
+ if (typeof externalRef === 'function') {
2631
+ externalRef(node);
2632
+ return;
2633
+ }
2634
+ if (externalRef) {
2635
+ externalRef.current = node;
2636
+ }
2637
+ }, [externalRef]);
2638
+ return { internalRef, setRefs };
2639
+ }
2640
+
2641
+ const iconSlot = (key) => `<span data-icon-key="${key}"></span>`;
2642
+ const ICON_KEY_MAP = {
2643
+ bksp: Backspace20Regular,
2644
+ shift: KeyboardShift20Regular,
2645
+ shiftactivated: KeyboardShift20Filled,
2646
+ capslock: KeyboardShiftUppercase20Regular,
2647
+ downkeyboard: ChevronDown20Regular,
2648
+ emoji: Emoji20Regular,
2649
+ };
2650
+ const SHARED_DISPLAY = {
2651
+ '{capslock}': iconSlot('capslock'),
2652
+ '{numbers}': '123',
2653
+ '{abc}': 'ABC',
2654
+ '{alt}': '.?!',
2655
+ '{alt2}': '#+=',
2656
+ '{emoticon}': iconSlot('emoji'),
2657
+ '{shift}': iconSlot('shift'),
2658
+ '{shiftactivated}': iconSlot('shiftactivated'),
2659
+ '{enter}': 'Enter',
2660
+ '{bksp}': `${iconSlot('bksp')} Apagar`,
2661
+ '{altright}': '.?123',
2662
+ '{downkeyboard}': iconSlot('downkeyboard'),
2663
+ '{space}': ' ',
2664
+ '{default}': 'ABC',
2665
+ };
2666
+ const LAYOUT_DISPLAY = {
2667
+ default: SHARED_DISPLAY,
2668
+ numeric: SHARED_DISPLAY,
2669
+ };
2670
+
2671
+ const EMOTICON_KEY = '{emoticon}';
2672
+ const DOWN_KEYBOARD_KEY = '{downkeyboard}';
2673
+ const removeKeyFromLayout = (layout, key) => Object.fromEntries(Object.entries(layout).map(([layoutName, rows]) => [
2674
+ layoutName,
2675
+ rows.map((row) => row.split(key).join(' ').replace(/\s+/g, ' ').trim()),
2676
+ ]));
2677
+ const QWERTY_LOWERCASE = [
2678
+ '{//} 1 2 3 4 5 6 7 8 9 0 {//}',
2679
+ '{//} q w e r t y u i o p {//}',
2680
+ 'a s d f g h j k l ç {bksp}',
2681
+ '{shift} z x c v b n m , . {shift}',
2682
+ '{numbers} {alt} {space} {downkeyboard} {enter}',
2683
+ ];
2684
+ const NUMPAD = ['1 2 3', '4 5 6', '7 8 9', '{bksp} 0 {abc}'];
2685
+ const SHARED_LAYOUTS = {
2686
+ shift: [
2687
+ '{//} 1 2 3 4 5 6 7 8 9 0 {//}',
2688
+ '{//} Q W E R T Y U I O P {//}',
2689
+ 'A S D F G H J K L Ç {bksp}',
2690
+ '{capslock} Z X C V B N M , . {capslock}',
2691
+ '{numbers} {alt} {emoticon} {space} {downkeyboard} {enter}',
2692
+ ],
2693
+ caps: [
2694
+ '{//} 1 2 3 4 5 6 7 8 9 0 {//}',
2695
+ '{//} Q W E R T Y U I O P {//}',
2696
+ 'A S D F G H J K L Ç {bksp}',
2697
+ '{shiftactivated} Z X C V B N M , . {shiftactivated}',
2698
+ '{numbers} {alt} {emoticon} {space} {downkeyboard} {enter}',
2699
+ ],
2700
+ numbers: NUMPAD,
2701
+ alt: [
2702
+ '1 2 3 4 5 6 7 8 9 0',
2703
+ `- / : ; ( ) $ & @ "`,
2704
+ '{alt2} . , ? ! ´ {bksp}',
2705
+ '{default} {emoticon} {space} {downkeyboard} {enter}',
2706
+ ],
2707
+ alt2: [
2708
+ '[ ] { } # % ^ * + =',
2709
+ '_ \\ | ~ < > ¢ £ ¥ •',
2710
+ `{alt} . , ? ! ' {bksp}`,
2711
+ '{default} {emoticon} {space} {downkeyboard} {enter}',
2712
+ ],
2713
+ emoticon: [
2714
+ '😀 😊 😅 😂 🙂 😉 😍 😛 😠 😎 {bksp}',
2715
+ `😏 😬 😭 😓 😱 😪 🙄 😴 😯 {enter}`,
2716
+ '😐 😇 🤣 😘 😚 😆 😡 😥 😓 {shift}',
2717
+ '{default} {alt} {space} {altright} {downkeyboard}',
2718
+ ],
2719
+ };
2720
+ const NATIVE_LAYOUTS = {
2721
+ default: {
2722
+ default: QWERTY_LOWERCASE,
2723
+ ...SHARED_LAYOUTS,
2724
+ },
2725
+ numeric: {
2726
+ default: NUMPAD,
2727
+ abc: QWERTY_LOWERCASE,
2728
+ ...SHARED_LAYOUTS,
2729
+ },
2730
+ };
2731
+ const NATIVE_LAYOUT_KEYS = new Set([
2732
+ 'default', 'numeric',
2733
+ ]);
2734
+ const getNativeLayout = (type, Emoji = true, showDownKeyboardButton = true, isFixed = false) => {
2735
+ const layout = NATIVE_LAYOUTS[type] ?? NATIVE_LAYOUTS.default ?? null;
2736
+ if (!layout)
2737
+ return null;
2738
+ let computedLayout = layout;
2739
+ if (!Emoji) {
2740
+ computedLayout = removeKeyFromLayout(computedLayout, EMOTICON_KEY);
2741
+ }
2742
+ if (!showDownKeyboardButton) {
2743
+ computedLayout = removeKeyFromLayout(computedLayout, DOWN_KEYBOARD_KEY);
2744
+ }
2745
+ if (isFixed) {
2746
+ computedLayout = Object.fromEntries(Object.entries(computedLayout).map(([layoutName, rows]) => [
2747
+ layoutName,
2748
+ rows.map((row) => {
2749
+ const trimmed = row.trim();
2750
+ if (/^[a-zA-ZçÇ]/.test(trimmed) && trimmed.endsWith('{bksp}')) {
2751
+ return '{//} ' + trimmed.replace(/\s*\{bksp\}$/, '') + ' {//}';
2752
+ }
2753
+ if (/\{(shift|capslock|shiftactivated)\}$/.test(trimmed)) {
2754
+ return trimmed.replace(/\{(shift|capslock|shiftactivated)\}$/, '{bksp}');
2755
+ }
2756
+ return row;
2757
+ }),
2758
+ ]));
2759
+ }
2760
+ return computedLayout;
2761
+ };
2762
+ const SHIFT_TOGGLES = {
2763
+ default: 'shift',
2764
+ abc: 'shift',
2765
+ shift: 'default',
2766
+ alt: 'default',
2767
+ alt2: 'alt',
2768
+ };
2769
+
2770
+ var styles$j = {"container":"VirtualKeyboard-module__container___A-e0I","disabled":"VirtualKeyboard-module__disabled___HGS2n","layout--numeric":"VirtualKeyboard-module__layout--numeric___zfd7G","layout--default":"VirtualKeyboard-module__layout--default___qyY1b","mode--fixed":"VirtualKeyboard-module__mode--fixed___1eFY1","textFieldContainer":"VirtualKeyboard-module__textFieldContainer___XxGen","keyboardWrapper":"VirtualKeyboard-module__keyboardWrapper___jryTf","overlay":"VirtualKeyboard-module__overlay___a5y7i","overlayOpen":"VirtualKeyboard-module__overlayOpen___hREu-","textFieldWrapper":"VirtualKeyboard-module__textFieldWrapper___bmi-z","accentMenu":"VirtualKeyboard-module__accentMenu___A6tTy","accentOption":"VirtualKeyboard-module__accentOption___ao-Ta"};
2771
+
2772
+ const LONG_PRESS_DELAY_MS = 400;
2773
+ const ACCENT_OPTIONS = {
2774
+ a: ['á', 'à', 'â', 'ã', 'ä', 'å', 'æ'],
2775
+ e: ['é', 'è', 'ê', 'ë'],
2776
+ i: ['í', 'ì', 'î', 'ï'],
2777
+ o: ['ó', 'ò', 'ô', 'õ', 'ö', 'ø', 'œ', 'ð'],
2778
+ u: ['ú', 'ù', 'û', 'ü'],
2779
+ y: ['ý', 'ÿ'],
2780
+ n: ['ñ'],
2781
+ c: ['ç'],
2782
+ '?': ['¿'],
2783
+ '!': ['¡'],
2784
+ };
2785
+ /**
2786
+ * Componente VirtualKeyboard — teclado virtual on-screen para entradas controladas.
2787
+ *
2788
+ * @description Baseado em `react-simple-keyboard`, oferece apenas layouts nativos (QWERTY e numérico)
2789
+ * seguindo o visual padrão da biblioteca.
2790
+ *
2791
+ * Possui dois modos:
2792
+ * - **`native`** (padrão): age como teclado nativo — aparece ao focar no campo referenciado por `targetRef` e some ao perder o foco.
2793
+ * - **`fixed`**: teclado sempre visível com um TextField próprio acima.
2794
+ *
2795
+ * @example
2796
+ * ```tsx
2797
+ * // Modo fixed
2798
+ * <VirtualKeyboard variant="fixed" type="default" onChange={setValue} />
2799
+ * ```
2800
+ *
2801
+ * @example
2802
+ * ```tsx
2803
+ * // Modo native — aparece ao focar no input
2804
+ * const inputRef = useRef<HTMLInputElement>(null);
2805
+ * const [value, setValue] = useState('');
2806
+ * <input ref={inputRef} value={value} readOnly />
2807
+ * <VirtualKeyboard targetRef={inputRef} value={value} onChange={setValue} />
2808
+ * ```
2809
+ */
2810
+ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onChange, onKeyPress, maxLength, Emoji = false, className, id, textFieldPlaceholder = 'Digite aqui...', helperText, error, errorMessage, targetRef, }) => {
2811
+ const [layoutName, setLayoutName] = useState('default');
2812
+ const [capsLockOn, setCapsLockOn] = useState(false);
2813
+ const [accentMenu, setAccentMenu] = useState(null);
2814
+ const [accentMenuOffsetX, setAccentMenuOffsetX] = useState(0);
2815
+ const [activeLayout, setActiveLayout] = useState(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed'));
2816
+ const visualType = NATIVE_LAYOUT_KEYS.has(type) ? type : 'default';
2817
+ const [isOpen, setIsOpen] = useState(variant !== 'native');
2818
+ const hideTimeoutRef = useRef(null);
2819
+ const longPressTimeoutRef = useRef(null);
2820
+ const suppressNextInputRef = useRef(null);
2821
+ const heldAccentKeyRef = useRef(null);
2822
+ const longPressTriggeredRef = useRef(false);
2823
+ const isKeyboardInteractingRef = useRef(false);
2824
+ const keyboardWrapperRef = useRef(null);
2825
+ const keyboardInstanceRef = useRef(null);
2826
+ const accentMenuRef = useRef(null);
2827
+ const accentButtonRef = useRef(null);
2828
+ const accentMenuOpenRef = useRef(false);
2829
+ const valueRef = useRef(value);
2830
+ const [iconSlots, setIconSlots] = useState([]);
2831
+ useEffect(() => {
2832
+ valueRef.current = value;
2833
+ }, [value]);
2834
+ const clearLongPressTimeout = useCallback(() => {
2835
+ if (longPressTimeoutRef.current !== null) {
2836
+ clearTimeout(longPressTimeoutRef.current);
2837
+ longPressTimeoutRef.current = null;
2838
+ }
2839
+ }, []);
2840
+ const closeAccentMenu = useCallback(() => {
2841
+ setAccentMenu(null);
2842
+ accentButtonRef.current = null;
2843
+ }, []);
2844
+ const syncKeyboardInput = useCallback((nextValue) => {
2845
+ keyboardInstanceRef.current?.setInput(nextValue);
2846
+ }, []);
2847
+ useEffect(() => {
2848
+ syncKeyboardInput(value);
2849
+ }, [value, syncKeyboardInput]);
2850
+ const scheduleHideIfBlurred = useCallback(() => {
2851
+ if (variant !== 'native')
2852
+ return;
2853
+ if (hideTimeoutRef.current !== null) {
2854
+ clearTimeout(hideTimeoutRef.current);
2855
+ }
2856
+ hideTimeoutRef.current = setTimeout(() => {
2857
+ const targetEl = targetRef?.current;
2858
+ const isTargetFocused = !!targetEl && document.activeElement === targetEl;
2859
+ if (!isTargetFocused && !isKeyboardInteractingRef.current) {
2860
+ setIsOpen(false);
2861
+ }
2862
+ }, 150);
2863
+ }, [variant, targetRef]);
2864
+ useEffect(() => {
2865
+ if (variant !== 'native')
2866
+ return;
2867
+ if (!targetRef?.current) {
2868
+ setIsOpen(true);
2869
+ return;
2870
+ }
2871
+ const el = targetRef.current;
2872
+ const handleFocus = () => {
2873
+ if (hideTimeoutRef.current !== null)
2874
+ clearTimeout(hideTimeoutRef.current);
2875
+ setIsOpen(true);
2876
+ };
2877
+ const handleBlur = () => {
2878
+ scheduleHideIfBlurred();
2879
+ };
2880
+ el.addEventListener('focus', handleFocus);
2881
+ el.addEventListener('blur', handleBlur);
2882
+ return () => {
2883
+ el.removeEventListener('focus', handleFocus);
2884
+ el.removeEventListener('blur', handleBlur);
2885
+ if (hideTimeoutRef.current !== null)
2886
+ clearTimeout(hideTimeoutRef.current);
2887
+ };
2888
+ }, [variant, targetRef, scheduleHideIfBlurred]);
2889
+ useEffect(() => {
2890
+ setLayoutName('default');
2891
+ setCapsLockOn(false);
2892
+ setActiveLayout(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed'));
2893
+ }, [type, Emoji, variant]);
2894
+ useEffect(() => {
2895
+ if (!Emoji && layoutName === 'emoticon') {
2896
+ setLayoutName(type === 'numeric' ? 'abc' : 'default');
2897
+ }
2898
+ }, [Emoji, layoutName, type]);
2899
+ useEffect(() => {
2900
+ return () => {
2901
+ clearLongPressTimeout();
2902
+ };
2903
+ }, [clearLongPressTimeout]);
2904
+ useEffect(() => {
2905
+ if (!accentMenu)
2906
+ return;
2907
+ const handleOutsidePointerDown = (event) => {
2908
+ if (accentMenuRef.current?.contains(event.target))
2909
+ return;
2910
+ closeAccentMenu();
2911
+ };
2912
+ const handleEscape = (event) => {
2913
+ if (event.key === 'Escape') {
2914
+ closeAccentMenu();
2915
+ }
2916
+ };
2917
+ document.addEventListener('pointerdown', handleOutsidePointerDown, true);
2918
+ document.addEventListener('keydown', handleEscape);
2919
+ return () => {
2920
+ document.removeEventListener('pointerdown', handleOutsidePointerDown, true);
2921
+ document.removeEventListener('keydown', handleEscape);
2922
+ };
2923
+ }, [accentMenu, closeAccentMenu]);
2924
+ useLayoutEffect(() => {
2925
+ if (!accentMenu || !accentMenuRef.current)
2926
+ return;
2927
+ const margin = 8;
2928
+ const rect = accentMenuRef.current.getBoundingClientRect();
2929
+ if (rect.width <= 0 || rect.height <= 0)
2930
+ return;
2931
+ const minCenter = margin + rect.width / 2;
2932
+ const maxCenter = window.innerWidth - margin - rect.width / 2;
2933
+ const clampedCenter = Math.min(maxCenter, Math.max(minCenter, accentMenu.left));
2934
+ const nextOffset = clampedCenter - accentMenu.left;
2935
+ if (Math.abs(nextOffset - accentMenuOffsetX) > 0.5) {
2936
+ setAccentMenuOffsetX(nextOffset);
2937
+ }
2938
+ }, [accentMenu, accentMenuOffsetX]);
2939
+ useEffect(() => {
2940
+ if (!keyboardWrapperRef.current)
2941
+ return;
2942
+ const container = keyboardWrapperRef.current;
2943
+ const registerNewSlots = () => {
2944
+ const newSlots = Array.from(container.querySelectorAll('[data-icon-key]:not([data-icon-root])'));
2945
+ if (newSlots.length === 0)
2946
+ return;
2947
+ newSlots.forEach((s) => s.setAttribute('data-icon-root', 'true'));
2948
+ setIconSlots((prev) => [...prev, ...newSlots]);
2949
+ };
2950
+ registerNewSlots();
2951
+ const observer = new MutationObserver(() => {
2952
+ setIconSlots((prev) => prev.filter((slot) => container.contains(slot)));
2953
+ registerNewSlots();
2954
+ });
2955
+ observer.observe(container, { childList: true, subtree: true });
2956
+ return () => {
2957
+ observer.disconnect();
2958
+ };
2959
+ }, []);
2960
+ useEffect(() => {
2961
+ closeAccentMenu();
2962
+ setAccentMenuOffsetX(0);
2963
+ suppressNextInputRef.current = null;
2964
+ clearLongPressTimeout();
2965
+ }, [layoutName, type, closeAccentMenu, clearLongPressTimeout]);
2966
+ useEffect(() => {
2967
+ accentMenuOpenRef.current = !!accentMenu;
2968
+ }, [accentMenu]);
2969
+ useEffect(() => {
2970
+ const updateAccentPosition = () => {
2971
+ if (!accentMenuOpenRef.current)
2972
+ return;
2973
+ const btn = accentButtonRef.current;
2974
+ if (!btn)
2975
+ return;
2976
+ const rect = btn.getBoundingClientRect();
2977
+ setAccentMenu((prev) => prev ? { ...prev, top: rect.top - 8, left: rect.left + rect.width / 2 } : null);
2978
+ };
2979
+ window.addEventListener('scroll', updateAccentPosition, { capture: true, passive: true });
2980
+ window.addEventListener('resize', updateAccentPosition);
2981
+ return () => {
2982
+ window.removeEventListener('scroll', updateAccentPosition, true);
2983
+ window.removeEventListener('resize', updateAccentPosition);
2984
+ };
2985
+ }, []);
2986
+ const handleLongPressStart = useCallback((event) => {
2987
+ isKeyboardInteractingRef.current = true;
2988
+ if (hideTimeoutRef.current !== null) {
2989
+ clearTimeout(hideTimeoutRef.current);
2990
+ }
2991
+ const keyboardWrapper = keyboardWrapperRef.current;
2992
+ if (!keyboardWrapper)
2993
+ return;
2994
+ const buttonEl = event.target.closest('.hg-button');
2995
+ if (!buttonEl || !keyboardWrapper.contains(buttonEl))
2996
+ return;
2997
+ const sourceKey = buttonEl.getAttribute('data-skbtn') ?? '';
2998
+ heldAccentKeyRef.current = null;
2999
+ longPressTriggeredRef.current = false;
3000
+ if (!sourceKey || sourceKey.startsWith('{'))
3001
+ return;
3002
+ const accentOptions = ACCENT_OPTIONS[sourceKey.toLowerCase()];
3003
+ if (!accentOptions)
3004
+ return;
3005
+ heldAccentKeyRef.current = sourceKey;
3006
+ clearLongPressTimeout();
3007
+ longPressTimeoutRef.current = setTimeout(() => {
3008
+ const buttonRect = buttonEl.getBoundingClientRect();
3009
+ const isUpperCaseKey = sourceKey === sourceKey.toUpperCase();
3010
+ longPressTriggeredRef.current = true;
3011
+ accentButtonRef.current = buttonEl;
3012
+ setAccentMenu({
3013
+ sourceKey,
3014
+ options: isUpperCaseKey
3015
+ ? accentOptions.map((option) => option.toUpperCase())
3016
+ : accentOptions,
3017
+ top: buttonRect.top - 8,
3018
+ left: buttonRect.left + buttonRect.width / 2,
3019
+ });
3020
+ setAccentMenuOffsetX(0);
3021
+ suppressNextInputRef.current = sourceKey;
3022
+ }, LONG_PRESS_DELAY_MS);
3023
+ }, [clearLongPressTimeout]);
3024
+ const handleLongPressEnd = useCallback(() => {
3025
+ const heldKey = heldAccentKeyRef.current;
3026
+ const longPressTriggered = longPressTriggeredRef.current;
3027
+ const baseLayout = type === 'numeric' ? 'abc' : 'default';
3028
+ isKeyboardInteractingRef.current = false;
3029
+ clearLongPressTimeout();
3030
+ if (heldKey && !longPressTriggered) {
3031
+ const currentValue = valueRef.current;
3032
+ if (maxLength === undefined || currentValue.length < maxLength) {
3033
+ const nextValue = `${currentValue}${heldKey}`;
3034
+ onChange?.(nextValue);
3035
+ onKeyPress?.(heldKey);
3036
+ syncKeyboardInput(nextValue);
3037
+ }
3038
+ if (layoutName === 'shift' && !capsLockOn) {
3039
+ setLayoutName(baseLayout);
3040
+ }
3041
+ suppressNextInputRef.current = heldKey;
3042
+ }
3043
+ heldAccentKeyRef.current = null;
3044
+ longPressTriggeredRef.current = false;
3045
+ scheduleHideIfBlurred();
3046
+ }, [
3047
+ clearLongPressTimeout,
3048
+ scheduleHideIfBlurred,
3049
+ maxLength,
3050
+ onChange,
3051
+ onKeyPress,
3052
+ syncKeyboardInput,
3053
+ type,
3054
+ layoutName,
3055
+ capsLockOn,
3056
+ ]);
3057
+ const handleAccentSelect = useCallback((accentedChar) => {
3058
+ const currentValue = valueRef.current;
3059
+ const baseLayout = type === 'numeric' ? 'abc' : 'default';
3060
+ if (maxLength !== undefined && currentValue.length >= maxLength) {
3061
+ closeAccentMenu();
3062
+ suppressNextInputRef.current = null;
3063
+ syncKeyboardInput(currentValue);
3064
+ return;
3065
+ }
3066
+ const nextValue = `${currentValue}${accentedChar}`;
3067
+ onChange?.(nextValue);
3068
+ onKeyPress?.(accentedChar);
3069
+ closeAccentMenu();
3070
+ suppressNextInputRef.current = null;
3071
+ heldAccentKeyRef.current = null;
3072
+ longPressTriggeredRef.current = false;
3073
+ if (layoutName === 'shift' && !capsLockOn) {
3074
+ setLayoutName(baseLayout);
3075
+ }
3076
+ syncKeyboardInput(nextValue);
3077
+ }, [maxLength, onChange, onKeyPress, closeAccentMenu, syncKeyboardInput, type, layoutName, capsLockOn]);
3078
+ const handleKeyPress = useCallback((button) => {
3079
+ const baseLayout = type === 'numeric' ? 'abc' : 'default';
3080
+ if (button === '{capslock}') {
3081
+ setCapsLockOn((prev) => {
3082
+ const next = !prev;
3083
+ setLayoutName(next ? 'caps' : baseLayout);
3084
+ return next;
3085
+ });
3086
+ return;
3087
+ }
3088
+ if (button === '{shift}' ||
3089
+ button === '{shiftactivated}') {
3090
+ if (button === '{shiftactivated}') {
3091
+ setCapsLockOn(false);
3092
+ setLayoutName(baseLayout);
3093
+ return;
3094
+ }
3095
+ setLayoutName((prev) => {
3096
+ const next = SHIFT_TOGGLES[prev] ?? 'default';
3097
+ return next === 'default' ? baseLayout : next;
3098
+ });
3099
+ return;
3100
+ }
3101
+ if (button === '{numbers}') {
3102
+ setLayoutName('numbers');
3103
+ return;
3104
+ }
3105
+ if (button === '{abc}') {
3106
+ setLayoutName(baseLayout);
3107
+ return;
3108
+ }
3109
+ if (button === '{alt}' || button === '{altright}') {
3110
+ setLayoutName((prev) => {
3111
+ if (prev === 'alt2')
3112
+ return 'alt';
3113
+ return prev === 'alt' ? baseLayout : 'alt';
3114
+ });
3115
+ return;
3116
+ }
3117
+ if (button === '{alt2}') {
3118
+ setLayoutName((prev) => (prev === 'alt2' ? 'alt' : 'alt2'));
3119
+ return;
3120
+ }
3121
+ if (button === '{emoticon}') {
3122
+ if (!Emoji)
3123
+ return;
3124
+ setLayoutName((prev) => (prev === 'emoticon' ? baseLayout : 'emoticon'));
3125
+ return;
3126
+ }
3127
+ if (button === '{default}') {
3128
+ setLayoutName(baseLayout);
3129
+ return;
3130
+ }
3131
+ if (button === '{downkeyboard}') {
3132
+ setLayoutName(baseLayout);
3133
+ if (variant === 'native') {
3134
+ closeAccentMenu();
3135
+ setIsOpen(false);
3136
+ const targetElement = targetRef?.current;
3137
+ if (targetElement && document.activeElement === targetElement) {
3138
+ targetElement.blur();
3139
+ }
3140
+ }
3141
+ return;
3142
+ }
3143
+ const isHeldAccentKey = heldAccentKeyRef.current === button;
3144
+ if (button !== '{bksp}' && button !== '{enter}' && !isHeldAccentKey) {
3145
+ if (layoutName === 'shift' && !capsLockOn) {
3146
+ setLayoutName(baseLayout);
3147
+ }
3148
+ else if (layoutName === baseLayout && capsLockOn) {
3149
+ setLayoutName('shift');
3150
+ }
3151
+ }
3152
+ if (isHeldAccentKey) {
3153
+ return;
3154
+ }
3155
+ onKeyPress?.(button);
3156
+ }, [
3157
+ type,
3158
+ layoutName,
3159
+ capsLockOn,
3160
+ onKeyPress,
3161
+ Emoji,
3162
+ variant,
3163
+ closeAccentMenu,
3164
+ targetRef,
3165
+ ]);
3166
+ const handleChange = useCallback((input) => {
3167
+ const currentValue = valueRef.current;
3168
+ const suppressedKey = suppressNextInputRef.current;
3169
+ const heldKey = heldAccentKeyRef.current;
3170
+ if (heldKey &&
3171
+ input.length >= currentValue.length + 1 &&
3172
+ input.startsWith(currentValue) &&
3173
+ input.slice(currentValue.length).split('').every((char) => char === heldKey)) {
3174
+ syncKeyboardInput(currentValue);
3175
+ return;
3176
+ }
3177
+ if (suppressedKey &&
3178
+ input.length === currentValue.length + 1 &&
3179
+ input.endsWith(suppressedKey)) {
3180
+ suppressNextInputRef.current = null;
3181
+ syncKeyboardInput(currentValue);
3182
+ return;
3183
+ }
3184
+ if (maxLength !== undefined && input.length > maxLength)
3185
+ return;
3186
+ onChange?.(input);
3187
+ }, [maxLength, onChange, syncKeyboardInput]);
3188
+ const keyboardDisplay = useMemo(() => {
3189
+ const baseDisplay = LAYOUT_DISPLAY[visualType];
3190
+ if (!baseDisplay)
3191
+ return baseDisplay;
3192
+ if (variant !== 'fixed') {
3193
+ return baseDisplay;
3194
+ }
3195
+ return {
3196
+ ...baseDisplay,
3197
+ '{bksp}': (baseDisplay['{bksp}'] ?? '').replace(/\s*Apagar$/, ''),
3198
+ };
3199
+ }, [visualType, variant]);
3200
+ const keyboardEl = activeLayout ? (jsxs("div", { ref: keyboardWrapperRef, className: styles$j.keyboardWrapper, onPointerDownCapture: handleLongPressStart, onPointerUpCapture: handleLongPressEnd, onPointerLeave: handleLongPressEnd, onPointerCancelCapture: handleLongPressEnd, children: [jsx(Keyboard, { keyboardRef: (instance) => {
3201
+ keyboardInstanceRef.current = instance;
3202
+ if (instance) {
3203
+ instance.setInput(valueRef.current);
3204
+ }
3205
+ }, layoutName: layoutName, layout: activeLayout, theme: 'hg-theme-default', display: keyboardDisplay, onChange: handleChange, onKeyPress: handleKeyPress, preventMouseDownDefault: true }), (() => {
3206
+ const shiftCount = { current: 0 };
3207
+ return iconSlots.map((slot) => {
3208
+ const key = slot.getAttribute('data-icon-key');
3209
+ const Icon = key ? ICON_KEY_MAP[key] : undefined;
3210
+ if (!Icon || !key)
3211
+ return null;
3212
+ if (key === 'shift') {
3213
+ const label = shiftCount.current === 0 ? 'left' : 'right';
3214
+ shiftCount.current += 1;
3215
+ return createPortal(createElement(Icon), slot, `icon-shift-${label}`);
3216
+ }
3217
+ return createPortal(createElement(Icon), slot, `icon-${key}`);
3218
+ });
3219
+ })(), accentMenu && (typeof document !== 'undefined' &&
3220
+ createPortal(jsx("div", { ref: accentMenuRef, className: styles$j.accentMenu, style: {
3221
+ top: accentMenu.top,
3222
+ left: accentMenu.left + accentMenuOffsetX,
3223
+ }, role: "listbox", "aria-label": `Opcoes de acento para ${accentMenu.sourceKey}`, children: accentMenu.options.map((option) => (jsx("button", { type: "button", className: styles$j.accentOption, onPointerDown: (event) => {
3224
+ event.preventDefault();
3225
+ event.stopPropagation();
3226
+ }, onClick: () => handleAccentSelect(option), children: option }, `${accentMenu.sourceKey}-${option}`))) }), document.body))] })) : null;
3227
+ if (variant === 'native' && typeof document !== 'undefined') {
3228
+ return createPortal(jsx("div", { id: id, className: clsx(styles$j.overlay, { [styles$j.overlayOpen]: isOpen }, styles$j[`layout--${visualType}`], className), children: keyboardEl }), document.body);
3229
+ }
3230
+ return (jsxs("div", { id: id, className: clsx(styles$j.container, styles$j[`mode--${variant}`], styles$j[`layout--${visualType}`], className), children: [variant === 'fixed' && (jsx("div", { className: styles$j.textFieldContainer, children: jsx(TextField$1, { placeholder: textFieldPlaceholder, value: value, onChange: onChange, helperText: helperText, error: error, errorMessage: errorMessage, readOnly: true, maxLength: maxLength, attachedToVirtualKeyboard: true, className: styles$j.textFieldWrapper }) })), keyboardEl] }));
3231
+ };
3232
+
3233
+ var styles$i = {"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","attachedToVirtualKeyboard":"TextField-module__attachedToVirtualKeyboard___fuO2O","errorWithMessage":"TextField-module__errorWithMessage___m-5AA"};
2606
3234
 
2607
3235
  const validateInput = ({ value, maxLength, errorMessage, required }) => {
2608
3236
  if (required && value.trim() === '') {
@@ -2616,22 +3244,28 @@ const validateInput = ({ value, maxLength, errorMessage, required }) => {
2616
3244
 
2617
3245
  var styles$h = {"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"};
2618
3246
 
2619
- const LabelComponent = ({ children, htmlFor, required = false, tooltip = false, tooltipText, side = 'bottom', align = 'start', className, error = false, disabled = false }) => (jsxs("div", { className: clsx(styles$h.labelContainer, disabled && styles$h.disabledContainer), children: [jsxs(Label.Root, { className: clsx(styles$h.wrapperLabel, error && !disabled && styles$h.errorLabel, disabled && styles$h.disabledLabel, className), htmlFor: htmlFor, children: [children, required && jsx("span", { className: styles$h.requiredLabel, children: "*" })] }), tooltip && (jsx(Tooltip, { side: side, align: align, text: tooltipText || '', children: jsx("span", { className: disabled ? styles$h.disabledIcon : error ?
2620
- styles$h.errorIcon : styles$h.infoIcon, children: jsx(Info12Regular, {}) }) }))] }));
3247
+ const LabelComponent = ({ children, htmlFor, required = false, tooltip = false, tooltipText, side = 'bottom', align = 'start', className, error = false, disabled = false }) => {
3248
+ const container = (jsxs("div", { className: clsx(styles$h.labelContainer, disabled && styles$h.disabledContainer), children: [jsxs(Label.Root, { className: clsx(styles$h.wrapperLabel, error && !disabled && styles$h.errorLabel, disabled && styles$h.disabledLabel, className), htmlFor: htmlFor, children: [children, required && jsx("span", { className: styles$h.requiredLabel, children: "*" })] }), tooltip && (jsx("span", { className: disabled ? styles$h.disabledIcon : error ?
3249
+ styles$h.errorIcon : styles$h.infoIcon, children: jsx(Info12Regular, {}) }))] }));
3250
+ if (tooltip) {
3251
+ return (jsx(Tooltip, { side: side, align: align, text: tooltipText || '', children: container }));
3252
+ }
3253
+ return container;
3254
+ };
2621
3255
 
2622
- const TextField = 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, ...rest }, ref) => {
3256
+ const TextField = 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, scale = 1, onBlur, onFocus, name, persistIcon = false, virtualKeyboard = false, virtualKeyboardType, virtualKeyboardMaxLength, attachedToVirtualKeyboard = false, ...rest }, ref) => {
2623
3257
  const normalizeValue = (val) => {
2624
3258
  return val === undefined || val === null ? '' : String(val);
2625
3259
  };
2626
3260
  const [inputValue, setInputValue] = useState(normalizeValue(value));
2627
3261
  const [inputError, setInputError] = useState('');
2628
3262
  const [isFocused, setIsFocused] = useState(false);
3263
+ const { internalRef: inputRef, setRefs: setInputRefs } = useInputKeyboardValue(ref);
2629
3264
  const generatedId = useId();
2630
3265
  const componentId = id || generatedId;
2631
3266
  useEffect(() => {
2632
3267
  const newValue = normalizeValue(value);
2633
3268
  setInputValue(newValue);
2634
- // Reavaliar erro quando valor muda externamente (ex: DatePicker atualiza o campo)
2635
3269
  if (inputError) {
2636
3270
  const validationError = validateInput({
2637
3271
  value: newValue,
@@ -2679,17 +3313,29 @@ const TextField = forwardRef(({ className, value, label, placeholder, type = 'te
2679
3313
  : helperText
2680
3314
  ? `${componentId}-helper`
2681
3315
  : undefined;
2682
- const containerClass = clsx(styles$i.container, {
3316
+ const scaleClass = {
3317
+ 1: 'scale-1-0',
3318
+ 1.5: 'scale-1-5',
3319
+ 2: 'scale-2-0',
3320
+ }[scale];
3321
+ const containerClass = clsx(styles$i.container, scaleClass, {
2683
3322
  [styles$i.disabled]: disabled,
2684
3323
  [styles$i.error]: hasError && !disabled,
3324
+ [styles$i.errorWithMessage]: Boolean(error) && Boolean(errorMessage) && !disabled,
3325
+ [styles$i.attachedToVirtualKeyboard]: attachedToVirtualKeyboard,
2685
3326
  [className]: className,
2686
3327
  });
2687
- return (jsxs("div", { className: containerClass, children: [label && (jsx(LabelComponent, { htmlFor: componentId, required: required, tooltip: tooltip, tooltipText: tooltipText, side: side, align: align, error: hasError, disabled: disabled, children: label })), jsxs("div", { className: styles$i.inputWrapper, children: [jsxs("div", { className: styles$i.inputContainer, children: [jsx("input", { ...rest, 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({
3328
+ return (jsxs("div", { className: containerClass, children: [label && (jsx(LabelComponent, { htmlFor: componentId, required: required, tooltip: tooltip, tooltipText: tooltipText, side: side, align: align, error: hasError, disabled: disabled, children: label })), jsxs("div", { className: styles$i.inputWrapper, children: [jsxs("div", { className: styles$i.inputContainer, children: [jsx("input", { ...rest, ref: setInputRefs, 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, inputMode: virtualKeyboard ? 'none' : rest.inputMode, className: clsx({
2688
3329
  [styles$i.inputWithIcon]: showCustomIcon || showClearIcon,
2689
3330
  }) }), showCustomIcon && jsx("span", { className: styles$i.icon, children: icon }), showClearIcon && (jsx("button", { type: "button", className: styles$i.clearButton, onMouseDown: (e) => {
2690
3331
  e.preventDefault();
2691
3332
  handleClear();
2692
- }, "aria-label": "Limpar campo", tabIndex: -1, children: jsx(Dismiss16Regular, {}) }))] }), jsx("span", { id: helperId, className: styles$i.helperText, "aria-live": hasError ? 'polite' : undefined, children: displayHelperText })] })] }));
3333
+ }, "aria-label": "Limpar campo", tabIndex: -1, children: jsx(Dismiss16Regular, {}) }))] }), (errorMessage || inputError || helperText) && (jsx("span", { id: helperId, className: styles$i.helperText, "aria-live": hasError ? 'polite' : undefined, children: displayHelperText }))] }), virtualKeyboard && (jsx("div", { className: "virtualKeyboardWrapper", children: jsx(VirtualKeyboard, { variant: "native", type: virtualKeyboardType, value: inputValue, maxLength: maxLength ?? virtualKeyboardMaxLength, targetRef: inputRef, onChange: (val) => {
3334
+ if (!disabled && (!maxLength || val.length <= maxLength)) {
3335
+ setInputValue(val);
3336
+ onChange?.(val);
3337
+ }
3338
+ } }) }))] }));
2693
3339
  });
2694
3340
  TextField.displayName = 'TextField';
2695
3341
  var TextField$1 = React__default.memo(TextField);
@@ -2786,7 +3432,7 @@ function validatePartialDate(value, locale = 'pt-br') {
2786
3432
  return 'incomplete';
2787
3433
  }
2788
3434
 
2789
- 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, className, ...rest }) => {
3435
+ 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, datePickerScale = 1, calendarScale = 1, className, ...rest }) => {
2790
3436
  const fieldId = useId();
2791
3437
  const calendarId = `${fieldId}-calendar`;
2792
3438
  const isControlled = value !== undefined;
@@ -2803,6 +3449,11 @@ const DatePicker = ({ locale = 'pt-br', calendarSide = 'bottom', calendarAlign =
2803
3449
  const combinedHelperText = externalError && helperText
2804
3450
  ? `${helperText} • ${externalError}`
2805
3451
  : externalError || helperText || '';
3452
+ const scaleClass = {
3453
+ 1: 'scale-1-0',
3454
+ 1.5: 'scale-1-5',
3455
+ 2: 'scale-2-0',
3456
+ }[datePickerScale];
2806
3457
  useEffect(() => {
2807
3458
  function handleClickOutside(event) {
2808
3459
  const target = event.target;
@@ -2915,9 +3566,9 @@ const DatePicker = ({ locale = 'pt-br', calendarSide = 'bottom', calendarAlign =
2915
3566
  }
2916
3567
  }
2917
3568
  };
2918
- return (jsx("div", { ref: wrapperRef, className: clsx(styles$g.datePicker, className), ...rest, children: jsx(Popover, { open: showCalendar, onOpenChange: setShowCalendar, asAnchor: true, trigger: jsx(TextField$1, { className: styles$g.textfieldContainer, type: "tel", icon: jsx(Calendar16Regular, { onClick: !disabled ? handleIconClick : undefined, className: clsx(styles$g.datePickerIcon, disabled && styles$g.datePickerIconDisabled) }), onChange: (e) => {
3569
+ return (jsx("div", { ref: wrapperRef, className: clsx(styles$g.datePicker, scaleClass, className), ...rest, children: jsx(Popover, { open: showCalendar, onOpenChange: setShowCalendar, asAnchor: true, trigger: jsx(TextField$1, { className: styles$g.textfieldContainer, type: "tel", icon: jsx(Calendar16Regular, { onClick: !disabled ? handleIconClick : undefined, className: clsx(styles$g.datePickerIcon, disabled && styles$g.datePickerIconDisabled) }), onChange: (e) => {
2919
3570
  handleTextFieldChange(String(e));
2920
- }, onKeyDown: handleKeyDown, onFocus: handleFocus, persistIcon: true, autoComplete: "off", value: displayValue, helperText: !externalError ? (helperText || undefined) : undefined, errorMessage: externalError ? combinedHelperText : undefined, error: hasValidationError ? 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: 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: () => {
3571
+ }, onKeyDown: handleKeyDown, onFocus: handleFocus, persistIcon: true, autoComplete: "off", value: displayValue, helperText: !externalError ? (helperText || undefined) : undefined, errorMessage: externalError ? combinedHelperText : undefined, error: hasValidationError ? 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: 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, scale: calendarScale, id: calendarId, onClear: () => {
2921
3572
  handleDateChange(null);
2922
3573
  setCurrentDate(new Date());
2923
3574
  } }), side: calendarSide, align: calendarAlign, sideOffset: 8 }) }));
@@ -2930,7 +3581,7 @@ const Dialog = ({ show = false, title, bodyContent, textPrimaryAction, textSecon
2930
3581
 
2931
3582
  var styles$e = {"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"};
2932
3583
 
2933
- const Drawer = ({ children, headerContent, customWidth = '400px', onClose, title = 'Título', isOpen = false, onOpen, className, id, disabled = false, onOverlayClick, closeOnOverlayClick = true, closeOnEscape = true, ...rest }) => {
3584
+ const Drawer = ({ children, headerContent, footer, customWidth = '400px', onClose, title = 'Título', isOpen = false, onOpen, className, id, disabled = false, onOverlayClick, closeOnOverlayClick = true, closeOnEscape = true, ...rest }) => {
2934
3585
  const internalClose = useCallback(() => {
2935
3586
  if (disabled)
2936
3587
  return;
@@ -2984,17 +3635,45 @@ const Drawer = ({ children, headerContent, customWidth = '400px', onClose, title
2984
3635
  [styles$e['drawerSidebar--disabled']]: disabled,
2985
3636
  }, className), style: {
2986
3637
  '--drawer-custom-width': customWidth,
2987
- }, onClick: handleDrawerClick, role: "dialog", "aria-modal": "true", "aria-labelledby": id ? `${id}-title` : 'drawer-title', "aria-hidden": !isOpen, "data-testid": "drawer-panel", id: id, ...rest, children: [jsxs("div", { className: styles$e.drawerTitleClose, children: [jsx("div", { className: styles$e.drawerTitle, id: id ? `${id}-title` : 'drawer-title', children: title }), headerContent && (jsx("div", { className: styles$e.drawerHeaderContent, children: headerContent })), jsx(Button, { onClick: handleCloseClick, variant: 'outlined', iconOnly: true, icon: jsx(Dismiss16Regular, {}), size: 'lg', tooltipText: 'Fechar' })] }), jsx("div", { className: styles$e.drawerChildren, "data-testid": "drawer-content", children: children })] })] }), document.body);
3638
+ }, onClick: handleDrawerClick, role: "dialog", "aria-modal": "true", "aria-labelledby": id ? `${id}-title` : 'drawer-title', "aria-hidden": !isOpen, "data-testid": "drawer-panel", id: id, ...rest, children: [jsxs("div", { className: styles$e.drawerTitleClose, children: [jsx("div", { className: styles$e.drawerTitle, id: id ? `${id}-title` : 'drawer-title', children: title }), headerContent && (jsx("div", { className: styles$e.drawerHeaderContent, children: headerContent })), jsx(Button, { onClick: handleCloseClick, variant: 'outlined', iconOnly: true, icon: jsx(Dismiss16Regular, {}), size: 'lg', tooltipText: 'Fechar' })] }), jsx("div", { className: styles$e.drawerChildren, "data-testid": "drawer-content", children: children }), footer] })] }), document.body);
2988
3639
  };
2989
3640
 
2990
- var styles$d = {"search":"Search-module__search___u3QsV","searchLeftIcon":"Search-module__searchLeftIcon___OKOBq","disabled":"Search-module__disabled___adbxO","inputWithClearIcon":"Search-module__inputWithClearIcon___cqvkq","searchClearIcon":"Search-module__searchClearIcon___qX9-h"};
3641
+ var styles$d = {"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","triggerWrapper":"Filter-module__triggerWrapper___ptPRL","triggerContent":"Filter-module__triggerContent___LYo9j","body":"Filter-module__body___qsyhk","combinedFooter":"Filter-module__combinedFooter___kTnHP"};
2991
3642
 
2992
- const Search = React__default.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) => {
3643
+ const Combined = ({ buttonText = 'Filtrar', icon, variant = 'outlined', disabled = false, className, title = 'Filtrar', drawerWidth = "fit-content", activeCount = 0, drawerHeaderContent, children, onApply, onClear, onOpen, onClose, id, ...rest }) => {
3644
+ const [isOpen, setIsOpen] = useState(false);
3645
+ const handleOpen = useCallback(() => {
3646
+ setIsOpen(true);
3647
+ onOpen?.();
3648
+ }, [onOpen]);
3649
+ const handleClose = useCallback(() => {
3650
+ setIsOpen(false);
3651
+ onClose?.();
3652
+ }, [onClose]);
3653
+ const handleApply = useCallback(() => {
3654
+ onApply?.();
3655
+ handleClose();
3656
+ }, [onApply, handleClose]);
3657
+ const handleClear = useCallback(() => {
3658
+ onClear?.();
3659
+ }, [onClear]);
3660
+ return (jsxs("div", { className: clsx(styles$d.triggerWrapper, className), id: id, ...rest, children: [jsx(Button, { variant: variant, disabled: disabled, icon: icon ?? jsx(FilterRegular, {}), iconPosition: "left", onClick: handleOpen, children: jsxs("span", { className: styles$d.triggerContent, children: [buttonText, activeCount > 0 && (jsx(Badge, { badgeValue: activeCount, filterVariant: true }))] }) }), jsx(Drawer, { isOpen: isOpen, onClose: handleClose, title: title, customWidth: drawerWidth, closeOnOverlayClick: true, closeOnEscape: true, headerContent: drawerHeaderContent, footer: jsxs("div", { className: styles$d.combinedFooter, children: [jsx(Button, { variant: "outlined", onClick: handleClear, children: "Limpar" }), jsx(Button, { onClick: handleApply, children: "Aplicar" })] }), children: jsx("div", { className: styles$d.body, children: children }) })] }));
3661
+ };
3662
+
3663
+ var styles$c = {"search":"Search-module__search___u3QsV","searchLeftIcon":"Search-module__searchLeftIcon___OKOBq","disabled":"Search-module__disabled___adbxO","inputWithClearIcon":"Search-module__inputWithClearIcon___cqvkq","searchClearIcon":"Search-module__searchClearIcon___qX9-h"};
3664
+
3665
+ const Search = React__default.forwardRef(({ placeholder = 'Dica do que deve ser buscado', disabled = false, value, onChange, onKeyDown, onFocus, onBlur, onClear, onClick, onMouseDown, searchMode = 'instant', onSearch, id, scale = 1, className, virtualKeyboard = false, virtualKeyboardType, virtualKeyboardMaxLength, 'data-testid': testId, ...rest }, ref) => {
2993
3666
  const [internalValue, setInternalValue] = useState('');
3667
+ const { internalRef: inputRef, setRefs: setInputRefs } = useInputKeyboardValue(ref);
2994
3668
  const isControlled = value !== undefined && onChange !== undefined;
2995
3669
  const currentValue = isControlled ? value : internalValue;
2996
3670
  const generatedId = useId();
2997
3671
  const inputId = id || generatedId;
3672
+ const scaleClass = {
3673
+ 1: 'scale-1-0',
3674
+ 1.5: 'scale-1-5',
3675
+ 2: 'scale-2-0',
3676
+ }[scale];
2998
3677
  const handleChange = (e) => {
2999
3678
  if (disabled)
3000
3679
  return;
@@ -3004,6 +3683,9 @@ const Search = React__default.forwardRef(({ placeholder = 'Dica do que deve ser
3004
3683
  else {
3005
3684
  setInternalValue(e.target.value);
3006
3685
  }
3686
+ if (searchMode === 'instant') {
3687
+ onSearch?.(e.target.value);
3688
+ }
3007
3689
  };
3008
3690
  const handleFocus = (e) => {
3009
3691
  if (disabled)
@@ -3033,20 +3715,34 @@ const Search = React__default.forwardRef(({ placeholder = 'Dica do que deve ser
3033
3715
  const handleKeyDown = (e) => {
3034
3716
  if (disabled)
3035
3717
  return;
3718
+ if (searchMode === 'on-enter' && e.key === 'Enter') {
3719
+ onSearch?.(currentValue || '');
3720
+ }
3036
3721
  onKeyDown?.(e);
3037
3722
  };
3038
- return (jsxs("div", { className: clsx(styles$d.search, { [styles$d.disabled]: disabled }, className), onClick: onClick, onMouseDown: onMouseDown, role: onClick || onMouseDown ? "button" : undefined, tabIndex: onClick || onMouseDown ? 0 : undefined, onKeyDown: onClick || onMouseDown ? (e) => {
3723
+ return (jsxs("div", { className: clsx(styles$c.search, scaleClass, { [styles$c.disabled]: disabled }, className), onClick: onClick, onMouseDown: onMouseDown, role: onClick || onMouseDown ? "button" : undefined, tabIndex: onClick || onMouseDown ? 0 : undefined, onKeyDown: onClick || onMouseDown ? (e) => {
3039
3724
  if (e.key === 'Enter' || e.key === ' ') {
3040
3725
  e.preventDefault();
3041
3726
  onClick?.(e);
3042
3727
  }
3043
- } : undefined, children: [jsx("span", { className: clsx(styles$d.searchLeftIcon, { [styles$d.disabled]: disabled }), tabIndex: -1, role: "presentation", "aria-hidden": "true", children: jsx(Search16Regular, {}) }), 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, className: clsx({ [styles$d.inputWithClearIcon]: currentValue && currentValue.length > 0 }) }), currentValue && currentValue.length > 0 && (jsx("span", { className: styles$d.searchClearIcon, "aria-hidden": "true", onClick: clearInputSearch, children: jsx(Dismiss16Regular, {}) }))] }));
3728
+ } : undefined, children: [jsx("span", { className: clsx(styles$c.searchLeftIcon, { [styles$c.disabled]: disabled }), tabIndex: -1, role: "presentation", "aria-hidden": "true", children: jsx(Search16Regular, {}) }), jsx("input", { ref: setInputRefs, 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, inputMode: virtualKeyboard ? 'none' : rest.inputMode, className: clsx({ [styles$c.inputWithClearIcon]: currentValue && currentValue.length > 0 }) }), currentValue && currentValue.length > 0 && (jsx("span", { className: styles$c.searchClearIcon, "aria-hidden": "true", onClick: clearInputSearch, children: jsx(Dismiss16Regular, {}) })), virtualKeyboard && (jsx("div", { className: "virtualKeyboardWrapper", children: jsx(VirtualKeyboard, { variant: "native", type: virtualKeyboardType, maxLength: virtualKeyboardMaxLength, value: currentValue || '', targetRef: inputRef, onChange: (val) => {
3729
+ if (disabled)
3730
+ return;
3731
+ if (isControlled) {
3732
+ const syntheticEvent = {
3733
+ target: { value: val },
3734
+ currentTarget: { value: val },
3735
+ };
3736
+ onChange?.(syntheticEvent);
3737
+ }
3738
+ else {
3739
+ setInternalValue(val);
3740
+ }
3741
+ } }) }))] }));
3044
3742
  });
3045
3743
  Search.displayName = 'Search';
3046
3744
 
3047
- var styles$c = {"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"};
3048
-
3049
- 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 }) => {
3745
+ const Simple = ({ items, type = 'multiple', 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 }) => {
3050
3746
  const [isOpen, setIsOpen] = useState(false);
3051
3747
  const [tempSelectedItems, setTempSelectedItems] = useState({});
3052
3748
  const [searchQuery, setSearchQuery] = useState('');
@@ -3089,7 +3785,7 @@ const Filter = ({ items, type = 'checkbox', selectedIds, onApplyFilter, placehol
3089
3785
  if (item.disabled)
3090
3786
  return;
3091
3787
  setTempSelectedItems((prev) => {
3092
- if (type === 'checkbox') {
3788
+ if (type === 'multiple') {
3093
3789
  return { ...prev, [itemId]: !prev[itemId] };
3094
3790
  }
3095
3791
  return prev[itemId] ? {} : { [itemId]: true };
@@ -3137,31 +3833,44 @@ const Filter = ({ items, type = 'checkbox', selectedIds, onApplyFilter, placehol
3137
3833
  return null;
3138
3834
  return selectedIds.length - 1;
3139
3835
  }, [selectedIds]);
3140
- const filterClass = clsx(styles$c.container, className);
3141
- const triggerButton = (jsx(Button, { variant: variant, disabled: disabled, icon: type === 'calendar' ? jsx(Calendar16Regular, {}) : jsx(ChevronDownRegular, {}), iconPosition: "right", size: "lg", children: jsxs("div", { className: styles$c.buttonContent, children: [icon && jsx("span", { className: styles$c.buttonIcon, children: icon }), jsx("span", { className: styles$c.buttonText, children: buttonDisplayText }), jsx("span", { className: clsx(styles$c.buttonArrow, { [styles$c.buttonArrowOpen]: isOpen }), children: getBadgeValue() && (jsx(Badge, { badgeValue: `+${getBadgeValue()}`, filterVariant: true })) })] }) }));
3142
- const popoverContent = type === 'calendar' ? (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" })) : (jsxs("div", { className: styles$c.panel, children: [searchVisible && (jsx("div", { className: styles$c.search, children: jsx(Search, { value: searchQuery, placeholder: placeholder, onChange: handleSearchChange, onKeyDown: handleSearchKeyDown, onClear: () => setSearchQuery('') }) })), jsx("ul", { className: styles$c.list, role: "listbox", "aria-multiselectable": type === 'checkbox', children: filteredItems.length > 0 ? (filteredItems.map((item, index) => {
3836
+ const filterClass = clsx(styles$d.container, className);
3837
+ const triggerButton = (jsx(Button, { variant: variant, disabled: disabled, icon: type === 'calendar' ? jsx(Calendar16Regular, {}) : jsx(ChevronDownRegular, {}), iconPosition: "right", size: "lg", children: jsxs("div", { className: styles$d.buttonContent, children: [icon && jsx("span", { className: styles$d.buttonIcon, children: icon }), jsx("span", { className: styles$d.buttonText, children: buttonDisplayText }), jsx("span", { className: clsx(styles$d.buttonArrow, { [styles$d.buttonArrowOpen]: isOpen }), children: getBadgeValue() && (jsx(Badge, { badgeValue: `+${getBadgeValue()}`, filterVariant: true })) })] }) }));
3838
+ const popoverContent = type === 'calendar' ? (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" })) : (jsxs("div", { className: styles$d.panel, children: [searchVisible && (jsx("div", { className: styles$d.search, children: jsx(Search, { value: searchQuery, placeholder: placeholder, onChange: handleSearchChange, onKeyDown: handleSearchKeyDown, onClear: () => setSearchQuery('') }) })), jsx("ul", { className: styles$d.list, role: "listbox", "aria-multiselectable": type === 'multiple', children: filteredItems.length > 0 ? (filteredItems.map((item, index) => {
3143
3839
  const itemId = item.id || `filter-item-${index}`;
3144
3840
  const isSelected = !!tempSelectedItems[itemId];
3145
- return (jsxs("li", { role: "option", "aria-selected": isSelected, "aria-disabled": item.disabled, className: clsx(styles$c.item, {
3146
- [styles$c.itemSelected]: isSelected,
3147
- [styles$c.itemDisabled]: item.disabled,
3841
+ return (jsxs("li", { role: "option", "aria-selected": isSelected, "aria-disabled": item.disabled, className: clsx(styles$d.item, {
3842
+ [styles$d.itemSelected]: isSelected,
3843
+ [styles$d.itemDisabled]: item.disabled,
3148
3844
  }), onMouseDown: (e) => e.preventDefault(), onClick: () => toggleItem(itemId, item), onKeyDown: (e) => {
3149
3845
  if (e.key === 'Enter' || e.key === ' ') {
3150
3846
  e.preventDefault();
3151
3847
  toggleItem(itemId, item);
3152
3848
  }
3153
- }, children: [type === 'checkbox' && (jsx(Checkbox, { checked: isSelected, disabled: item.disabled, label: "" })), type === 'icon' && item.icon && (jsx("span", { className: styles$c.itemIcon, children: item.icon })), jsx("span", { className: styles$c.itemText, children: item.text })] }, itemId));
3154
- })) : (jsx("li", { className: styles$c.noResults, role: "status", "aria-live": "polite", children: "Nenhum item encontrado" })) }), jsxs("div", { className: styles$c.footer, children: [jsx(Button, { fullWidth: true, variant: "outlined", onClick: handleClearFilter, children: "Limpar" }), jsx(Button, { fullWidth: true, onClick: handleApplyFilter, children: "Aplicar" })] })] }));
3849
+ }, children: [type === 'multiple' && (jsx(Checkbox, { checked: isSelected, disabled: item.disabled, label: "" })), item.icon && (jsx("span", { className: styles$d.itemIcon, children: item.icon })), jsx("span", { className: styles$d.itemText, children: item.text })] }, itemId));
3850
+ })) : (jsx("li", { className: styles$d.noResults, role: "status", "aria-live": "polite", children: "Nenhum item encontrado" })) }), jsxs("div", { className: styles$d.footer, children: [jsx(Button, { fullWidth: true, variant: "outlined", onClick: handleClearFilter, children: "Limpar" }), jsx(Button, { fullWidth: true, onClick: handleApplyFilter, children: "Aplicar" })] })] }));
3155
3851
  return (jsx("div", { className: filterClass, id: id, ...rest, children: jsx(Popover, { open: isOpen, onOpenChange: handleOpenChange, side: side, align: align, onOpenAutoFocus: (e) => e.preventDefault(), trigger: triggerButton, content: popoverContent }) }));
3156
3852
  };
3157
3853
 
3854
+ const Filter = ({ mode = 'simple', ...props }) => {
3855
+ if (mode === 'combined') {
3856
+ return jsx(Combined, { ...props });
3857
+ }
3858
+ return jsx(Simple, { ...props });
3859
+ };
3860
+
3158
3861
  var styles$b = {"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"};
3159
3862
 
3160
3863
  var styles$a = {"root":"Radio-module__root___7ElY2","wrapper":"Radio-module__wrapper___NYQ1y","disabled":"Radio-module__disabled___RZ0be","labelText":"Radio-module__labelText___Wkb41","item":"Radio-module__item___3Kvj7","itemWrapper":"Radio-module__itemWrapper___5KbM1","labelWrapper":"Radio-module__labelWrapper___LOHmJ","indicator":"Radio-module__indicator___TJ5hz"};
3161
3864
 
3162
- const Radio = ({ items, onValueChange, defaultValue, name, id, ariaLabel, orientation = 'vertical', className, ...rest }) => {
3163
- const componentId = id || useId();
3164
- return (jsx(RadioGroup.Root, { id: componentId, className: clsx(styles$a.root, className), defaultValue: defaultValue, onValueChange: onValueChange, name: name, "aria-label": ariaLabel, "data-orientation": orientation, orientation: orientation, ...rest, children: items.map(({ id, value, disabled, label }) => {
3865
+ const Radio = ({ items, onValueChange, defaultValue, name, id, ariaLabel, orientation = 'vertical', scale = 1, className, ...rest }) => {
3866
+ const generatedId = useId();
3867
+ const componentId = id || generatedId;
3868
+ const scaleClass = {
3869
+ 1: 'scale-1-0',
3870
+ 1.5: 'scale-1-5',
3871
+ 2: 'scale-2-0',
3872
+ }[scale];
3873
+ return (jsx(RadioGroup.Root, { id: componentId, className: clsx(styles$a.root, scaleClass, className), defaultValue: defaultValue, onValueChange: onValueChange, name: name, "aria-label": ariaLabel, "data-orientation": orientation, orientation: orientation, ...rest, children: items.map(({ id, value, disabled, label }) => {
3165
3874
  const itemKey = id ?? value;
3166
3875
  const uniqueId = `${componentId}-item-${value}`;
3167
3876
  return (jsx("div", { className: clsx(styles$a.wrapper, { [styles$a.disabled]: disabled }), children: jsxs("label", { className: styles$a.labelWrapper, htmlFor: uniqueId, children: [jsx("div", { className: styles$a.itemWrapper, children: jsx(RadioGroup.Item, { disabled: disabled, className: styles$a.item, value: value, id: uniqueId, "data-disabled": disabled, children: jsx(RadioGroup.Indicator, { className: styles$a.indicator }) }) }), jsx("span", { className: styles$a.labelText, children: label })] }) }, itemKey));
@@ -3382,7 +4091,7 @@ const useSearchLogic = ({ items, searchValue, searchTerm, enableApiSearch, onApi
3382
4091
  return { filteredItems: filteredItems() };
3383
4092
  };
3384
4093
 
3385
- const Menu = ({ items, children, onItemSelect, search, enableInfiniteScroll, onScrollEnd, isLoadingMore, onApiSearch, enableApiSearch, selectedItems, onOpenChange, align = 'start', className, maxHeight = 400, ...rest }) => {
4094
+ const Menu = ({ items, children, onItemSelect, search, enableInfiniteScroll, onScrollEnd, isLoadingMore, onApiSearch, enableApiSearch, selectedItems, onOpenChange, align = 'start', dropdownScale = 1, buttonScale, className, maxHeight = 400, ...rest }) => {
3386
4095
  const itemsWrapperRef = useRef(null);
3387
4096
  const hasReachedEndRef = useRef(false);
3388
4097
  const observerRef = useRef(null);
@@ -3392,6 +4101,16 @@ const Menu = ({ items, children, onItemSelect, search, enableInfiniteScroll, onS
3392
4101
  const [searchInput, setSearchInput] = useState('');
3393
4102
  const [searchTerm, setSearchTerm] = useState('');
3394
4103
  const maxHeightStyle = typeof maxHeight === 'number' ? `${maxHeight}px` : maxHeight;
4104
+ const scaleClass = {
4105
+ 1: 'scale-1-0',
4106
+ 1.5: 'scale-1-5',
4107
+ 2: 'scale-2-0',
4108
+ }[dropdownScale];
4109
+ const triggerWithScale = React__default.isValidElement(children) && buttonScale
4110
+ ? React__default.cloneElement(children, {
4111
+ scale: children.props?.scale ?? buttonScale,
4112
+ })
4113
+ : children;
3395
4114
  const { open, setOpen, handleItemSelect: handleItemSelectLogic, isItemSelected } = useMenuLogic({
3396
4115
  selectedItems,
3397
4116
  onItemSelect,
@@ -3494,7 +4213,7 @@ const Menu = ({ items, children, onItemSelect, search, enableInfiniteScroll, onS
3494
4213
  hasReachedEndRef.current = false;
3495
4214
  }
3496
4215
  };
3497
- return (jsxs(DropdownMenu.Root, { open: open, onOpenChange: handleOpenChange, children: [jsx(DropdownMenu.Trigger, { asChild: true, children: children }), jsx(DropdownMenu.Portal, { children: jsxs(DropdownMenu.Content, { className: clsx(styles$9.content, className), sideOffset: 8, align: align, onPointerDown: () => { closedByPointerRef.current = true; }, onInteractOutside: () => { closedByPointerRef.current = true; }, onCloseAutoFocus: (e) => {
4216
+ return (jsxs(DropdownMenu.Root, { open: open, onOpenChange: handleOpenChange, children: [jsx(DropdownMenu.Trigger, { asChild: true, children: triggerWithScale }), jsx(DropdownMenu.Portal, { children: jsxs(DropdownMenu.Content, { className: clsx(styles$9.content, scaleClass, className), sideOffset: 8, align: align, onPointerDown: () => { closedByPointerRef.current = true; }, onInteractOutside: () => { closedByPointerRef.current = true; }, onCloseAutoFocus: (e) => {
3498
4217
  if (closedByPointerRef.current) {
3499
4218
  e.preventDefault();
3500
4219
  closedByPointerRef.current = false;
@@ -3526,7 +4245,7 @@ const Modal = ({ isOpen = false, onClose, title, children, headerContent, closeO
3526
4245
 
3527
4246
  var styles$7 = {"quantity":"Quantity-module__quantity___-vndR","quantityInput":"Quantity-module__quantityInput___xZG-v","disabled":"Quantity-module__disabled___X6p5l"};
3528
4247
 
3529
- const Quantity = ({ value = 0, onChange, disabled = false, decimal = false, decimalPlaces = 2, size = 'lg', id, valueIncrement = 1, className, inputSize, minValue = 0, maxValue = 9999, decrementAriaLabel = 'Decrease quantity', incrementAriaLabel = 'Increase quantity', inputAriaLabel = 'Quantity', ...rest }) => {
4248
+ const Quantity = ({ value = 0, onChange, disabled = false, decimal = false, decimalPlaces = 2, size = 'lg', id, valueIncrement = 1, scale = 1, className, inputSize, minValue = 0, maxValue = 9999, decrementAriaLabel = 'Decrease quantity', incrementAriaLabel = 'Increase quantity', inputAriaLabel = 'Quantity', ...rest }) => {
3530
4249
  const initialValue = Math.min(Math.max(value, minValue), maxValue);
3531
4250
  const [internalValue, setInternalValue] = useState(initialValue);
3532
4251
  const [inputValue, setInputValue] = useState(decimal ? initialValue.toFixed(decimalPlaces) : String(initialValue));
@@ -3705,7 +4424,12 @@ const Quantity = ({ value = 0, onChange, disabled = false, decimal = false, deci
3705
4424
  const inputSizeValue = inputSize !== undefined ? inputSize : Math.max(1, inputValue.length);
3706
4425
  const uniqueId = useId();
3707
4426
  const inputId = id || uniqueId;
3708
- return (jsxs("div", { className: clsx(styles$7.quantity, { [styles$7.disabled]: disabled }, className), ...rest, children: [jsx(Button, { variant: 'outlined', size: size, type: 'button', iconOnly: true, icon: jsx(Subtract16Regular, {}), onClick: decrement, disabled: disabled || isMinValue, "aria-label": decrementAriaLabel, tooltipText: 'Diminuir' }), jsx("input", { ref: inputRef, className: clsx(styles$7.quantityInput, { [styles$7.disabled]: disabled }), type: 'text', value: inputValue, onChange: handleInputChange, onBlur: handleBlur, onKeyDown: handleInputKeyDown, id: inputId, step: stepValue, "aria-label": inputAriaLabel, role: 'spinbutton', "aria-valuenow": internalValue, "aria-valuemin": minValue, "aria-valuemax": maxValue, disabled: disabled, inputMode: decimal ? 'decimal' : 'numeric', size: inputSizeValue }), jsx(Button, { variant: 'outlined', size: size, type: 'button', iconOnly: true, onClick: increment, disabled: disabled || isMaxValue, "aria-label": incrementAriaLabel, icon: jsx(Add16Regular, {}), tooltipText: 'Aumentar' })] }));
4427
+ const scaleClass = {
4428
+ 1: 'scale-1-0',
4429
+ 1.5: 'scale-1-5',
4430
+ 2: 'scale-2-0',
4431
+ }[scale];
4432
+ return (jsxs("div", { className: clsx(styles$7.quantity, scaleClass, { [styles$7.disabled]: disabled }, className), ...rest, children: [jsx(Button, { variant: 'outlined', size: size, type: 'button', iconOnly: true, icon: jsx(Subtract16Regular, {}), onClick: decrement, disabled: disabled || isMinValue, "aria-label": decrementAriaLabel, tooltipText: 'Diminuir' }), jsx("input", { ref: inputRef, className: clsx(styles$7.quantityInput, { [styles$7.disabled]: disabled }), type: 'text', value: inputValue, onChange: handleInputChange, onBlur: handleBlur, onKeyDown: handleInputKeyDown, id: inputId, step: stepValue, "aria-label": inputAriaLabel, role: 'spinbutton', "aria-valuenow": internalValue, "aria-valuemin": minValue, "aria-valuemax": maxValue, disabled: disabled, inputMode: decimal ? 'decimal' : 'numeric', size: inputSizeValue }), jsx(Button, { variant: 'outlined', size: size, type: 'button', iconOnly: true, onClick: increment, disabled: disabled || isMaxValue, "aria-label": incrementAriaLabel, icon: jsx(Add16Regular, {}), tooltipText: 'Aumentar' })] }));
3709
4433
  };
3710
4434
  const memorizedQuantity = React__default.memo(Quantity);
3711
4435
  memorizedQuantity.displayName = 'Quantity';
@@ -4019,7 +4743,7 @@ function useSelectLogic({ value, required = false, search = false, onValueChange
4019
4743
  };
4020
4744
  }
4021
4745
 
4022
- const Select = ({ items, onValueChange, onOpenChange, variant, required = false, value, label, helperText, placeholder = 'Selecione', maxWidth, search = false, errorMessage, disabled = false, className, 'aria-label': ariaLabel, 'data-testid': testId, tooltip = false, tooltipText, side = 'bottom', align = 'start', enableInfiniteScroll = false, onScrollEnd, isLoadingMore = false, enableApiSearch = false, onApiSearch, isSearching = false, ...rest }) => {
4746
+ const Select = ({ items, onValueChange, onOpenChange, variant, required = false, value, label, helperText, placeholder = 'Selecione', maxWidth, search = false, errorMessage, disabled = false, scale = 1, className, 'aria-label': ariaLabel, 'data-testid': testId, tooltip = false, tooltipText, side = 'bottom', align = 'start', enableInfiniteScroll = false, onScrollEnd, isLoadingMore = false, enableApiSearch = false, onApiSearch, isSearching = false, ...rest }) => {
4023
4747
  const componentId = useId();
4024
4748
  const selectId = `select-${componentId}`;
4025
4749
  const viewportRef = useRef(null);
@@ -4067,6 +4791,11 @@ const Select = ({ items, onValueChange, onOpenChange, variant, required = false,
4067
4791
  const containerStyle = useMemo(() => ({
4068
4792
  maxWidth: maxWidth ? `${maxWidth}px` : undefined,
4069
4793
  }), [maxWidth]);
4794
+ const scaleClass = {
4795
+ 1: 'scale-1-0',
4796
+ 1.5: 'scale-1-5',
4797
+ 2: 'scale-2-0',
4798
+ }[scale];
4070
4799
  const handleSearchChange = (e) => {
4071
4800
  const value = e.target.value;
4072
4801
  actions.setSearchInput(value);
@@ -4099,7 +4828,7 @@ const Select = ({ items, onValueChange, onOpenChange, variant, required = false,
4099
4828
  onApiSearch('');
4100
4829
  }
4101
4830
  };
4102
- return (jsx(Select$1.Root, { value: variant === 'checkbox' || (search && state.isOpen) ? '' : (state.selectedValues[0] || ''), onValueChange: variant === 'checkbox' ? undefined : actions.handleSingleSelect, required: required, open: state.isOpen, onOpenChange: actions.setOpen, disabled: disabled, ...rest, children: jsxs("div", { className: clsx(styles$6.container, className), style: containerStyle, "data-testid": testId, children: [jsx("div", { className: styles$6.fieldContainer, children: jsxs("div", { className: styles$6.containerLabel, children: [jsx(LabelComponent, { htmlFor: selectId, required: required, tooltipText: tooltipText, tooltip: tooltip, side: side, align: align, error: state.hasError && state.touched, disabled: disabled, children: label }), jsxs(Select$1.Trigger, { className: clsx(styles$6.trigger, {
4831
+ return (jsx(Select$1.Root, { value: variant === 'checkbox' || (search && state.isOpen) ? '' : (state.selectedValues[0] || ''), onValueChange: variant === 'checkbox' ? undefined : actions.handleSingleSelect, required: required, open: state.isOpen, onOpenChange: actions.setOpen, disabled: disabled, ...rest, children: jsxs("div", { className: clsx(styles$6.container, scaleClass, className), style: containerStyle, "data-testid": testId, children: [jsx("div", { className: styles$6.fieldContainer, children: jsxs("div", { className: styles$6.containerLabel, children: [jsx(LabelComponent, { htmlFor: selectId, required: required, tooltipText: tooltipText, tooltip: tooltip, side: side, align: align, error: state.hasError && state.touched, disabled: disabled, children: label }), jsxs(Select$1.Trigger, { className: clsx(styles$6.trigger, {
4103
4832
  [styles$6.error]: state.hasError && state.touched,
4104
4833
  [styles$6.disabled]: disabled,
4105
4834
  [styles$6.hasValue]: state.selectedValues.length > 0,
@@ -4317,7 +5046,7 @@ const isCalendarFilter = (filter) => {
4317
5046
  return filter.type === 'calendar';
4318
5047
  };
4319
5048
  const isCheckboxFilter = (filter) => {
4320
- return filter.type === 'checkbox' || filter.type === 'text' || filter.type === 'icon';
5049
+ return filter.type === 'multiple' || filter.type === 'single';
4321
5050
  };
4322
5051
  const TableHeader = ({ searchValue = '', onSearchChange, onSearch, searchPlaceholder = 'Pesquisar...', showSearch = true, showFilters = false, filters, filterItems = [], className = '', ...rest }) => {
4323
5052
  const [internalSearchValue, setInternalSearchValue] = useState(searchValue);
@@ -4394,12 +5123,24 @@ var styles$4 = {"wrapper":"Table-module__wrapper___KMc04","tableContainer":"Tabl
4394
5123
 
4395
5124
  const EmptyState = ({ emptyIcon, emptyTitle, emptyText }) => (jsxs("div", { className: styles$4.tableEmpty, children: [jsx("div", { className: styles$4.tableEmptyContent, children: emptyIcon ?? jsx(SearchInfo20Regular, {}) }), jsxs("div", { className: styles$4.tableEmptyText, children: [jsx("h3", { className: styles$4.tableEmptyTitle, children: emptyTitle ?? 'Nenhum dado encontrado' }), jsx("p", { className: styles$4.tableEmptyCaption, children: emptyText ?? 'Nenhum registro encontrado' })] })] }));
4396
5125
 
4397
- const TableV2 = ({ columns, data, enableFilters = false, enableRowSelection = false, enableSorting = true, onRowSelectionChange, bulkActions, header, footer, loading = false, emptyIcon, emptyTitle, emptyText, onRow, className, }) => {
4398
- const [columnFilters, setColumnFilters] = useState([]);
4399
- const [globalFilter, setGlobalFilter] = useState('');
4400
- const [rowSelection, setRowSelection] = useState({});
5126
+ const TableV2 = ({ columns, data, rowSelection: rowSelectionConfig, enableSorting = true, bulkActions, header, footer, loading = false, emptyIcon, emptyTitle, emptyText, onRow, className, }) => {
5127
+ const isRowSelectionEnabled = !!rowSelectionConfig;
5128
+ const isControlled = rowSelectionConfig?.selectedRowKeys !== undefined;
5129
+ const [pendingSearch, setPendingSearch] = useState(header?.searchValue ?? '');
5130
+ useEffect(() => {
5131
+ if (header?.searchValue !== undefined) {
5132
+ setPendingSearch(header.searchValue);
5133
+ }
5134
+ }, [header?.searchValue]);
5135
+ const [rowSelectionState, setRowSelectionState] = useState({});
4401
5136
  const rowSelectionRef = useRef({});
4402
- rowSelectionRef.current = rowSelection;
5137
+ const externalSelectionState = useMemo(() => {
5138
+ if (!rowSelectionConfig?.selectedRowKeys)
5139
+ return {};
5140
+ return Object.fromEntries(rowSelectionConfig.selectedRowKeys.map((key) => [String(key), true]));
5141
+ }, [rowSelectionConfig?.selectedRowKeys]);
5142
+ const effectiveRowSelection = isControlled ? externalSelectionState : rowSelectionState;
5143
+ rowSelectionRef.current = effectiveRowSelection;
4403
5144
  const lastEmittedSelectionKey = useRef('{}');
4404
5145
  const [sorting, setSorting] = useState([]);
4405
5146
  const [pagination, setPagination] = useState({
@@ -4412,27 +5153,22 @@ const TableV2 = ({ columns, data, enableFilters = false, enableRowSelection = fa
4412
5153
  size: 48,
4413
5154
  enableSorting: false,
4414
5155
  enableColumnFilter: false,
4415
- header: ({ table: t }) => (jsx("div", { className: styles$4.checkboxCell, children: jsx(Checkbox, { checked: t.getIsAllPageRowsSelected(), indeterminate: t.getIsSomePageRowsSelected(), onCheckedChange: (checked) => t.toggleAllPageRowsSelected(checked) }) })),
4416
- cell: ({ row }) => (jsx("div", { className: styles$4.checkboxCell, children: jsx(Checkbox, { checked: row.getIsSelected(), onCheckedChange: (checked) => row.toggleSelected(checked) }) })),
4417
- }), []);
4418
- const resolvedColumns = useMemo(() => (enableRowSelection ? [selectionColumn, ...columns] : columns), [enableRowSelection, selectionColumn, columns]);
4419
- const showSearch = !!(header && (header.showSearch ?? true));
5156
+ header: ({ table: t }) => (jsx("div", { className: styles$4.checkboxCell, children: jsx(Checkbox, { checked: t.getIsAllPageRowsSelected(), indeterminate: t.getIsSomePageRowsSelected(), disabled: rowSelectionConfig?.disableSelectAll, onCheckedChange: (checked) => t.toggleAllPageRowsSelected(checked) }) })),
5157
+ cell: ({ row }) => (jsx("div", { className: styles$4.checkboxCell, children: jsx(Checkbox, { checked: row.getIsSelected(), disabled: !row.getCanSelect(), onCheckedChange: (checked) => row.toggleSelected(checked) }) })),
5158
+ }), [rowSelectionConfig?.disableSelectAll]);
5159
+ const resolvedColumns = useMemo(() => (isRowSelectionEnabled ? [selectionColumn, ...columns] : columns), [isRowSelectionEnabled, selectionColumn, columns]);
5160
+ const showSearch = !!(header?.onSearchChange);
4420
5161
  const table = useReactTable({
4421
5162
  data,
4422
5163
  columns: resolvedColumns,
4423
5164
  defaultColumn: { minSize: 44, size: 0 },
4424
5165
  state: {
4425
- ...(enableFilters ? { columnFilters } : {}),
4426
- ...(showSearch ? { globalFilter } : {}),
4427
- ...(footer ? { pagination: { pageIndex, pageSize } } : {}),
4428
- ...(enableRowSelection ? { rowSelection } : {}),
5166
+ ...(isRowSelectionEnabled ? { rowSelection: effectiveRowSelection } : {}),
4429
5167
  ...(enableSorting ? { sorting } : {}),
4430
5168
  },
4431
- onColumnFiltersChange: enableFilters ? setColumnFilters : undefined,
4432
- onGlobalFilterChange: showSearch ? setGlobalFilter : undefined,
4433
5169
  onSortingChange: enableSorting ? setSorting : undefined,
4434
5170
  enableSorting,
4435
- onRowSelectionChange: enableRowSelection
5171
+ onRowSelectionChange: isRowSelectionEnabled
4436
5172
  ? (updater) => {
4437
5173
  const prev = rowSelectionRef.current;
4438
5174
  const next = typeof updater === 'function' ? updater(prev) : updater;
@@ -4441,43 +5177,52 @@ const TableV2 = ({ columns, data, enableFilters = false, enableRowSelection = fa
4441
5177
  return;
4442
5178
  lastEmittedSelectionKey.current = selectionKey;
4443
5179
  rowSelectionRef.current = next;
4444
- setRowSelection(next);
4445
- if (onRowSelectionChange) {
4446
- const selectedRows = table
4447
- .getCoreRowModel()
4448
- .rows.filter((r) => next[r.id])
4449
- .map((r) => r.original);
4450
- onRowSelectionChange(selectedRows);
5180
+ if (!isControlled) {
5181
+ setRowSelectionState(next);
5182
+ }
5183
+ if (rowSelectionConfig?.onRowChange) {
5184
+ const allRows = table.getCoreRowModel().rows;
5185
+ const selectedRows = allRows.filter((r) => next[r.id]).map((r) => r.original);
5186
+ const selectedKeys = allRows.filter((r) => next[r.id]).map((r) => r.index);
5187
+ rowSelectionConfig.onRowChange(selectedRows, selectedKeys);
4451
5188
  }
4452
5189
  }
4453
5190
  : undefined,
4454
- enableRowSelection,
4455
- onPaginationChange: footer ? setPagination : undefined,
5191
+ enableRowSelection: isRowSelectionEnabled
5192
+ ? typeof rowSelectionConfig?.disabled === 'function'
5193
+ ? (row) => !rowSelectionConfig.disabled(row.original, row.index)
5194
+ : typeof rowSelectionConfig?.disabled === 'boolean'
5195
+ ? !rowSelectionConfig.disabled
5196
+ : true
5197
+ : false,
4456
5198
  getCoreRowModel: getCoreRowModel(),
4457
- getFilteredRowModel: enableFilters || showSearch ? getFilteredRowModel() : undefined,
4458
- getPaginationRowModel: footer ? getPaginationRowModel() : undefined,
4459
5199
  getSortedRowModel: enableSorting ? getSortedRowModel() : undefined,
4460
5200
  });
4461
- const filteredRowCount = table.getFilteredRowModel().rows.length;
4462
- const effectiveTotalItems = footer
4463
- ? (enableFilters || showSearch) ? filteredRowCount : footer.totalItems
4464
- : 0;
5201
+ const effectiveTotalItems = footer?.totalItems ?? 0;
4465
5202
  const totalPages = footer ? Math.ceil(effectiveTotalItems / pageSize) : 0;
4466
5203
  const canGoPrev = pageIndex > 0;
4467
5204
  const canGoNext = pageIndex + 1 < totalPages;
4468
5205
  const skeletonRowCount = footer ? pageSize : (data.length > 0 ? data.length : pageSize);
4469
5206
  const selectedRows = useMemo(() => table
4470
5207
  .getCoreRowModel()
4471
- .rows.filter((r) => rowSelection[r.id])
4472
- .map((r) => r.original), [rowSelection, table]);
5208
+ .rows.filter((r) => effectiveRowSelection[r.id])
5209
+ .map((r) => r.original), [effectiveRowSelection, table]);
4473
5210
  const selectedCount = selectedRows.length;
4474
- const showBulkActions = enableRowSelection && !!bulkActions && selectedCount > 0;
5211
+ const showBulkActions = isRowSelectionEnabled && !!bulkActions && selectedCount > 0;
4475
5212
  useEffect(() => {
4476
- if (enableRowSelection) {
5213
+ if (isRowSelectionEnabled) {
4477
5214
  table.resetRowSelection();
4478
5215
  }
4479
5216
  // eslint-disable-next-line react-hooks/exhaustive-deps
4480
5217
  }, [pageIndex]);
5218
+ useEffect(() => {
5219
+ if (footer?.currentPage !== undefined) {
5220
+ const targetPageIndex = footer.currentPage - 1;
5221
+ setPagination((prev) => prev.pageIndex !== targetPageIndex
5222
+ ? { ...prev, pageIndex: targetPageIndex }
5223
+ : prev);
5224
+ }
5225
+ }, [footer?.currentPage]);
4481
5226
  const handleClearSelection = () => {
4482
5227
  table.resetRowSelection();
4483
5228
  bulkActions?.onClear?.();
@@ -4489,11 +5234,22 @@ const TableV2 = ({ columns, data, enableFilters = false, enableRowSelection = fa
4489
5234
  };
4490
5235
  return (jsxs("div", { className: clsx(styles$4.wrapper, className), children: [showBulkActions && (jsxs("div", { className: styles$4.bulkActionsBar, children: [jsxs("div", { className: styles$4.bulkActionsInfo, children: [jsx(Button, { variant: "text", iconOnly: true, icon: jsx(Dismiss16Regular, {}), ariaLabel: "Limpar sele\u00E7\u00E3o", onClick: handleClearSelection, className: styles$4.bulkActionsClearButton }), jsx("span", { className: styles$4.bulkActionsLabel, children: bulkActions.label
4491
5236
  ? bulkActions.label(selectedCount, selectedRows)
4492
- : `${selectedCount} ${selectedCount === 1 ? 'item selecionado' : 'itens selecionados'}` })] }), jsx("div", { className: styles$4.bulkActionsButtons, children: bulkActions.actions.map((action, index) => (jsx(Button, { variant: action.variant ?? 'outlined', type: "button", disabled: action.disabled, onClick: action.onClick, size: "sm", children: action.label }, index))) })] })), header && (jsxs("div", { className: styles$4.tableHeader, children: [showSearch && (jsx("div", { className: styles$4.tableHeaderSearchContainer, children: jsx(Search, { value: globalFilter, onChange: (e) => {
4493
- setGlobalFilter(e.target.value);
4494
- if (footer)
5237
+ : `${selectedCount} ${selectedCount === 1 ? 'item selecionado' : 'itens selecionados'}` })] }), jsx("div", { className: styles$4.bulkActionsButtons, children: bulkActions.actions.map((action, index) => (jsx(Button, { variant: action.variant ?? 'outlined', type: "button", disabled: action.disabled, onClick: action.onClick, size: "sm", children: action.label }, index))) })] })), header && (jsxs("div", { className: styles$4.tableHeader, children: [showSearch && (jsx("div", { className: styles$4.tableHeaderSearchContainer, children: jsx(Search, { value: pendingSearch, virtualKeyboard: header.virtualKeyboard, virtualKeyboardType: header.virtualKeyboardType, virtualKeyboardMaxLength: header.virtualKeyboardMaxLength, searchMode: header?.searchMode ?? "on-enter", onChange: (e) => {
5238
+ setPendingSearch(e.target.value);
5239
+ }, onSearch: (val) => {
5240
+ if (footer) {
5241
+ setPagination((prev) => ({ ...prev, pageIndex: 0 }));
5242
+ footer?.onPageChange?.(1);
5243
+ }
5244
+ header?.onSearchChange?.(val);
5245
+ }, onClear: () => {
5246
+ setPendingSearch('');
5247
+ if (footer) {
4495
5248
  setPagination((prev) => ({ ...prev, pageIndex: 0 }));
4496
- }, placeholder: header.searchPlaceholder ?? 'Pesquisar...', className: styles$4.tableHeaderSearch }) })), !!header.filterItems?.length && (jsxs("div", { className: styles$4.tableHeaderFilters, children: [jsx("span", { className: styles$4.tableHeaderFilterLabel, children: "Filtros" }), jsx("div", { className: styles$4.tableHeaderFilterItems, children: header.filterItems.map((filterItem, index) => {
5249
+ footer?.onPageChange?.(1);
5250
+ }
5251
+ header?.onSearchChange?.('');
5252
+ }, placeholder: header.searchPlaceholder ?? 'Pesquisar...', className: styles$4.tableHeaderSearch }) })), !!header.filterItems?.length && (jsxs("div", { className: styles$4.tableHeaderFilters, children: [header.filterItems.some((item) => item.type !== 'combined') && (jsx("span", { className: styles$4.tableHeaderFilterLabel, children: "Filtros" })), jsx("div", { className: styles$4.tableHeaderFilterItems, children: header.filterItems.map((filterItem, index) => {
4497
5253
  const commonProps = {
4498
5254
  buttonText: filterItem.buttonText,
4499
5255
  icon: filterItem.icon,
@@ -4504,18 +5260,21 @@ const TableV2 = ({ columns, data, enableFilters = false, enableRowSelection = fa
4504
5260
  onOpen: () => filterItem.onToggle?.(true),
4505
5261
  onClose: () => filterItem.onToggle?.(false),
4506
5262
  };
5263
+ if (filterItem.type === 'combined') {
5264
+ return (jsx(Filter, { mode: "combined", buttonText: filterItem.buttonText, icon: filterItem.icon, title: filterItem.title, drawerWidth: filterItem.drawerWidth, activeCount: filterItem.activeCount, drawerHeaderContent: filterItem.drawerHeaderContent, onApply: filterItem.onApply, onClear: filterItem.onClear, variant: filterItem.variant ?? 'outlined', disabled: filterItem.disabled, children: filterItem.children }, filterItem.id ?? index));
5265
+ }
4507
5266
  if (filterItem.type === 'calendar') {
4508
5267
  return (jsx(Filter, { ...commonProps, type: "calendar", selectedDate: filterItem.selectedDate, onDateSelect: filterItem.onDateSelect, onClearDate: filterItem.onClear, minDate: filterItem.minDate, maxDate: filterItem.maxDate, locale: filterItem.locale, placeholder: filterItem.placeholder }, filterItem.id ?? index));
4509
5268
  }
4510
5269
  return (jsx(Filter, { ...commonProps, type: filterItem.type, items: filterItem.items, selectedIds: filterItem.selectedIds, onApplyFilter: filterItem.onSelectionChange, placeholder: filterItem.placeholder, enableSearch: filterItem.enableSearch }, filterItem.id ?? index));
4511
- }) })] }))] })), jsx("div", { className: styles$4.tableContainer, children: jsx("div", { className: styles$4.tableScrollWrapper, children: jsxs("table", { className: styles$4.table, "aria-label": "Tabela de dados", "aria-rowcount": filteredRowCount + 1, children: [jsx("thead", { className: styles$4.tableHead, children: table.getHeaderGroups().map((headerGroup) => (jsx("tr", { children: headerGroup.headers.map((col) => (jsxs("th", { className: styles$4.tableTh, style: {
5270
+ }) })] }))] })), jsx("div", { className: styles$4.tableContainer, children: jsx("div", { className: styles$4.tableScrollWrapper, children: jsxs("table", { className: styles$4.table, "aria-label": "Tabela de dados", "aria-rowcount": data.length + 1, children: [jsx("thead", { className: styles$4.tableHead, children: table.getHeaderGroups().map((headerGroup) => (jsx("tr", { children: headerGroup.headers.map((col) => (jsx("th", { className: styles$4.tableTh, style: {
4512
5271
  textAlign: col.column.columnDef.meta?.align,
4513
5272
  width: col.column.columnDef.size || undefined,
4514
5273
  minWidth: col.column.columnDef.minSize,
4515
5274
  maxWidth: col.column.columnDef.maxSize !== Number.MAX_SAFE_INTEGER
4516
5275
  ? col.column.columnDef.maxSize
4517
5276
  : undefined,
4518
- }, children: [jsx("div", { className: styles$4.tableThContent, children: col.isPlaceholder ? null : col.column.getCanSort() ? (jsxs("button", { type: "button", className: styles$4.tableSortButton, onClick: col.column.getToggleSortingHandler(), "aria-label": `Ordenar por ${typeof col.column.columnDef.header === 'string' ? col.column.columnDef.header : col.id}`, children: [flexRender(col.column.columnDef.header, col.getContext()), col.column.getIsSorted() === 'asc' ? (jsx(ArrowSortUp16Regular, { className: styles$4.tableSortIcon })) : col.column.getIsSorted() === 'desc' ? (jsx(ArrowSortDown16Regular, { className: styles$4.tableSortIcon })) : (jsx(ArrowSort16Regular, { className: clsx(styles$4.tableSortIcon, styles$4.tableSortIconNeutral) }))] })) : (flexRender(col.column.columnDef.header, col.getContext())) }), enableFilters && col.column.getCanFilter() && (jsx("input", { value: col.column.getFilterValue() ?? '', onChange: (e) => col.column.setFilterValue(e.target.value), placeholder: "Filtrar..." }))] }, col.id))) }, headerGroup.id))) }), jsx("tbody", { className: styles$4.tableBody, children: loading ? (Array.from({ length: skeletonRowCount }).map((_, rowIdx) => (jsx("tr", { className: styles$4.tableRow, children: table.getVisibleLeafColumns().map((col) => (jsx("td", { className: styles$4.tableTd, children: jsx(Skeleton, {}) }, col.id))) }, `skeleton-row-${rowIdx}`)))) : table.getRowModel().rows.length > 0 ? (table.getRowModel().rows.map((row, index) => {
5277
+ }, children: jsx("div", { className: styles$4.tableThContent, children: col.isPlaceholder ? null : col.column.getCanSort() ? (jsxs("button", { type: "button", className: styles$4.tableSortButton, onClick: col.column.getToggleSortingHandler(), "aria-label": `Ordenar por ${typeof col.column.columnDef.header === 'string' ? col.column.columnDef.header : col.id}`, children: [flexRender(col.column.columnDef.header, col.getContext()), col.column.getIsSorted() === 'asc' ? (jsx(ArrowSortUp16Regular, { className: styles$4.tableSortIcon })) : col.column.getIsSorted() === 'desc' ? (jsx(ArrowSortDown16Regular, { className: styles$4.tableSortIcon })) : (jsx(ArrowSort16Regular, { className: clsx(styles$4.tableSortIcon, styles$4.tableSortIconNeutral) }))] })) : (flexRender(col.column.columnDef.header, col.getContext())) }) }, col.id))) }, headerGroup.id))) }), jsx("tbody", { className: styles$4.tableBody, children: loading ? (Array.from({ length: skeletonRowCount }).map((_, rowIdx) => (jsx("tr", { className: styles$4.tableRow, children: table.getVisibleLeafColumns().map((col) => (jsx("td", { className: styles$4.tableTd, children: jsx(Skeleton, {}) }, col.id))) }, `skeleton-row-${rowIdx}`)))) : table.getRowModel().rows.length > 0 ? (table.getRowModel().rows.map((row, index) => {
4519
5278
  const rowProps = onRow?.(row.original, index) ?? {};
4520
5279
  return (jsx("tr", { className: clsx(styles$4.tableRow, rowProps.className), onClick: rowProps.onClick, onDoubleClick: rowProps.onDoubleClick, children: row.getVisibleCells().map((cell) => (jsx("td", { className: styles$4.tableTd, style: {
4521
5280
  textAlign: cell.column.columnDef.meta?.align,
@@ -4540,12 +5299,13 @@ const TableV2 = ({ columns, data, enableFilters = false, enableRowSelection = fa
4540
5299
 
4541
5300
  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"};
4542
5301
 
4543
- const TextArea = 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, ...rest }, ref) => {
5302
+ const TextArea = 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, virtualKeyboard = false, virtualKeyboardType, virtualKeyboardMaxLength, ...rest }, ref) => {
4544
5303
  const normalizeValue = (val) => {
4545
5304
  return val === undefined || val === null ? '' : String(val);
4546
5305
  };
4547
5306
  const [textareaValue, setTextareaValue] = useState(normalizeValue(value));
4548
5307
  const [textareaError, setTextareaError] = useState('');
5308
+ const { internalRef: textareaRef, setRefs: setTextareaRefs } = useInputKeyboardValue(ref);
4549
5309
  const generatedId = useId();
4550
5310
  const componentId = id || generatedId;
4551
5311
  useEffect(() => {
@@ -4578,7 +5338,12 @@ const TextArea = forwardRef(({ className, value, label, placeholder, onChange, d
4578
5338
  ? `${componentId}-helper`
4579
5339
  : undefined;
4580
5340
  const containerClass = clsx(styles$3.container, disabled && styles$3.disabled, hasError && !disabled && styles$3.error, className);
4581
- return (jsxs("div", { className: containerClass, children: [label && (jsx(LabelComponent, { htmlFor: componentId, required: required, tooltip: tooltip, tooltipText: tooltipText, side: side, align: align, error: hasError, disabled: disabled, children: label })), jsxs("div", { className: styles$3.inputWrapper, children: [jsx("div", { className: styles$3.inputContainer, children: jsx("textarea", { ...rest, 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 } }) }), jsxs("div", { className: styles$3.footer, children: [jsx("span", { id: helperId, className: styles$3.helperText, "aria-live": hasError ? 'polite' : undefined, children: displayHelperText }), showCharCount && maxLength && (jsxs("span", { className: styles$3.charCount, children: [textareaValue.length, "/", maxLength] }))] })] })] }));
5341
+ return (jsxs("div", { className: containerClass, children: [label && (jsx(LabelComponent, { htmlFor: componentId, required: required, tooltip: tooltip, tooltipText: tooltipText, side: side, align: align, error: hasError, disabled: disabled, children: label })), jsxs("div", { className: styles$3.inputWrapper, children: [jsx("div", { className: styles$3.inputContainer, children: jsx("textarea", { ...rest, ref: setTextareaRefs, 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 }, inputMode: virtualKeyboard ? 'none' : rest.inputMode }) }), jsxs("div", { className: styles$3.footer, children: [jsx("span", { id: helperId, className: styles$3.helperText, "aria-live": hasError ? 'polite' : undefined, children: displayHelperText }), showCharCount && maxLength && (jsxs("span", { className: styles$3.charCount, children: [textareaValue.length, "/", maxLength] }))] })] }), virtualKeyboard && (jsx("div", { className: "virtualKeyboardWrapper", children: jsx(VirtualKeyboard, { variant: "native", type: virtualKeyboardType, maxLength: virtualKeyboardMaxLength, value: textareaValue, targetRef: textareaRef, onChange: (val) => {
5342
+ if (!disabled && (!maxLength || val.length <= maxLength)) {
5343
+ setTextareaValue(val);
5344
+ onChange?.(val);
5345
+ }
5346
+ } }) }))] }));
4582
5347
  });
4583
5348
  TextArea.displayName = 'TextArea';
4584
5349
  var TextArea_default = React__default.memo(TextArea);
@@ -4791,7 +5556,14 @@ ToastContainer.displayName = 'ToastContainer';
4791
5556
 
4792
5557
  var styles$1 = {"container":"Switch-module__container___BR1OB","switchRoot":"Switch-module__switchRoot___jz2HD","switchThumb":"Switch-module__switchThumb___X3RL7"};
4793
5558
 
4794
- const Switch = ({ disabled = false, defaultChecked = false, checked, onCheckedChange, className, ...rest }) => (jsx("div", { className: clsx(styles$1.container, className), children: jsx(Switch$1.Root, { className: styles$1.switchRoot, disabled: disabled, defaultChecked: defaultChecked, checked: checked, onCheckedChange: onCheckedChange, ...rest, children: jsx(Switch$1.Thumb, { className: styles$1.switchThumb }) }) }));
5559
+ const Switch = ({ disabled = false, defaultChecked = false, checked, onCheckedChange, scale = 1, className, ...rest }) => {
5560
+ const scaleClass = {
5561
+ 1: 'scale-1-0',
5562
+ 1.5: 'scale-1-5',
5563
+ 2: 'scale-2-0',
5564
+ }[scale];
5565
+ return (jsx("div", { className: clsx(styles$1.container, scaleClass, className), children: jsx(Switch$1.Root, { className: styles$1.switchRoot, disabled: disabled, defaultChecked: defaultChecked, checked: checked, onCheckedChange: onCheckedChange, ...rest, children: jsx(Switch$1.Thumb, { className: styles$1.switchThumb }) }) }));
5566
+ };
4795
5567
 
4796
5568
  var styles = {"zds-verification-code__container":"VerificationCode-module__zds-verification-code__container___tUNuJ","zds-verification-code__input":"VerificationCode-module__zds-verification-code__input___wDIQ6","zds-verification-code__filled":"VerificationCode-module__zds-verification-code__filled___-2VVb","zds-verification-code__has-error":"VerificationCode-module__zds-verification-code__has-error___eqKAp","zds-verification-code__error":"VerificationCode-module__zds-verification-code__error___T53i5"};
4797
5569
 
@@ -5207,5 +5979,5 @@ function useInfiniteScroll({ status, page, lastPage, onLoadMore, threshold = 0.1
5207
5979
  };
5208
5980
  }
5209
5981
 
5210
- export { Avatar, Badge, Button, Calendar, Callout, Checkbox, MemoizedChips as Chips, Container, DatePicker_default as DatePicker, Dialog, Drawer, Filter, ListItem, Menu, Modal, Popover, memorizedQuantity as Quantity, Radio, Search, Select, Switch, Table, TableHeader, TablePagination, TableV2, TextArea_default as TextArea, TextField$1 as TextField, Toast, ToastContainer, ToastProvider, Tooltip, VerificationCode, normalizeText, useApiSimulation, useInfiniteScroll, useToast };
5982
+ export { Avatar, Badge, Button, Calendar, Callout, Checkbox, MemoizedChips as Chips, Container, DatePicker_default as DatePicker, Dialog, Drawer, Filter, ListItem, Menu, Modal, Popover, memorizedQuantity as Quantity, Radio, Search, Select, Switch, Table, TableHeader, TablePagination, TableV2, TextArea_default as TextArea, TextField$1 as TextField, Toast, ToastContainer, ToastProvider, Tooltip, VerificationCode, VirtualKeyboard, normalizeText, useApiSimulation, useInfiniteScroll, useToast };
5211
5983
  //# sourceMappingURL=index.esm.js.map