@giro-ds/react 12.1.0 → 12.2.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.cjs CHANGED
@@ -84,7 +84,7 @@ const Tooltip = ({ children, text, side = 'bottom', align = 'start', maxWidth, s
84
84
 
85
85
  var styles$s = {"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"};
86
86
 
87
- const Button = ({ ref, 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 }) => {
87
+ const Button = React.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) => {
88
88
  const generatedId = React.useId();
89
89
  const componentId = id || generatedId;
90
90
  const getComponent = () => {
@@ -200,7 +200,7 @@ const Button = ({ ref, as, children, variant = 'filled', iconPosition = 'left',
200
200
  return (jsxRuntime.jsx(Tooltip, { text: tooltipText, side: tooltipSide, align: tooltipAlign, children: jsxRuntime.jsx(Component, { ...baseProps, ...getNavigationProps(), children: renderContent() }) }));
201
201
  }
202
202
  return (jsxRuntime.jsx(Component, { ...baseProps, ...getNavigationProps(), children: renderContent() }));
203
- };
203
+ });
204
204
  Button.displayName = 'Button';
205
205
 
206
206
  function buildFormatLongFn(args) {
@@ -2864,11 +2864,13 @@ const Checkbox = ({ id, label, onCheckedChange, checked, disabled, className, st
2864
2864
  }), role: "presentation", tabIndex: disabled ? -1 : 0, children: jsxRuntime.jsx(radixUi.Checkbox.Root, { className: styles$o.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: jsxRuntime.jsx(radixUi.Checkbox.Indicator, { className: styles$o.indicator, children: indeterminate ? jsxRuntime.jsx(CheckHalf, {}) : jsxRuntime.jsx(CheckSmall, {}) }) }) }), jsxRuntime.jsx("label", { className: clsx(styles$o.label, { [styles$o.disabled]: disabled }), htmlFor: componentId, children: label })] }));
2865
2865
  };
2866
2866
 
2867
- var styles$n = {"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"};
2867
+ var styles$n = {"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","interactive":"Chips-module__interactive___4ytKl","disabled":"Chips-module__disabled___ElWLI"};
2868
2868
 
2869
2869
  const Chips = ({ children, leftIcon, rightIcon, variant = 'neutral', disabled = false, backgroundColor, textColor, scale = 1, className, style, ...rest }) => {
2870
+ const isInteractive = typeof rest.onClick === 'function';
2870
2871
  const chipsClass = clsx(styles$n.chips, styles$n[variant], {
2871
2872
  [styles$n.disabled]: disabled,
2873
+ [styles$n.interactive]: isInteractive && !disabled,
2872
2874
  [styles$n.hasLeftIcon]: leftIcon,
2873
2875
  [styles$n.hasRightIcon]: rightIcon,
2874
2876
  }, className);
@@ -2878,7 +2880,6 @@ const Chips = ({ children, leftIcon, rightIcon, variant = 'neutral', disabled =
2878
2880
  ...(!disabled && textColor && { '--chips-text': `var(--${textColor})` }),
2879
2881
  ...style,
2880
2882
  };
2881
- const isInteractive = typeof rest.onClick === 'function';
2882
2883
  const { onKeyDown: userOnKeyDown, ...otherRest } = rest;
2883
2884
  const handleKeyDown = (e) => {
2884
2885
  userOnKeyDown?.(e);
@@ -2927,6 +2928,7 @@ const ICON_KEY_MAP = {
2927
2928
  capslock: reactIcons.KeyboardShiftUppercase20Regular,
2928
2929
  downkeyboard: reactIcons.ChevronDown20Regular,
2929
2930
  emoji: reactIcons.Emoji20Regular,
2931
+ enterNumpad: reactIcons.ArrowImport20Regular,
2930
2932
  };
2931
2933
  const SHARED_DISPLAY = {
2932
2934
  '{capslock}': iconSlot('capslock'),
@@ -2952,9 +2954,11 @@ const LAYOUT_DISPLAY = {
2952
2954
  const EMOTICON_KEY = '{emoticon}';
2953
2955
  const DOWN_KEYBOARD_KEY = '{downkeyboard}';
2954
2956
  const ENTER_KEY = '{enter}';
2955
- const removeKeyFromLayout = (layout, key) => Object.fromEntries(Object.entries(layout).map(([layoutName, rows]) => [
2957
+ const removeKeyFromLayout = (layout, key, skipLayouts = []) => Object.fromEntries(Object.entries(layout).map(([layoutName, rows]) => [
2956
2958
  layoutName,
2957
- rows.map((row) => row.split(key).join(' ').replace(/\s+/g, ' ').trim()),
2959
+ skipLayouts.includes(layoutName)
2960
+ ? rows
2961
+ : rows.map((row) => row.split(key).join(' ').replace(/\s+/g, ' ').trim()),
2958
2962
  ]));
2959
2963
  const replaceKeyWithBlank = (layout, key) => Object.fromEntries(Object.entries(layout).map(([layoutName, rows]) => [
2960
2964
  layoutName,
@@ -2967,7 +2971,8 @@ const QWERTY_LOWERCASE = [
2967
2971
  '{shift} z x c v b n m {bksp}',
2968
2972
  '{numbers} {alt} {space} . {enter}',
2969
2973
  ];
2970
- const NUMPAD = ['1 2 3', '4 5 6', '7 8 9', '{bksp} 0 {abc}'];
2974
+ const NUMPAD = ['1 2 3', '4 5 6', '7 8 9', '{abc} 0 {bksp}'];
2975
+ const NUMPAD_WITH_ENTER = ['1 2 3 -', '4 5 6 _', '7 8 9 {bksp}', '{abc} 0 . {enter}'];
2971
2976
  const SHARED_LAYOUTS = {
2972
2977
  shift: [
2973
2978
  '1 2 3 4 5 6 7 8 9 0',
@@ -3017,11 +3022,17 @@ const NATIVE_LAYOUTS = {
3017
3022
  const NATIVE_LAYOUT_KEYS = new Set([
3018
3023
  'default', 'numeric',
3019
3024
  ]);
3020
- const getNativeLayout = (type, Emoji = true, showDownKeyboardButton = true, isFixed = false, showEnterKey = true, showTypeSwitchKey = true) => {
3025
+ const getNativeLayout = (type, Emoji = true, showDownKeyboardButton = true, isFixed = false, showEnterKey = true, showTypeSwitchKey = true, numpadWithEnter = false) => {
3021
3026
  const layout = NATIVE_LAYOUTS[type] ?? NATIVE_LAYOUTS.default ?? null;
3022
3027
  if (!layout)
3023
3028
  return null;
3024
- let computedLayout = layout;
3029
+ let computedLayout = numpadWithEnter
3030
+ ? {
3031
+ ...layout,
3032
+ ...(type === 'numeric' ? { default: NUMPAD_WITH_ENTER } : {}),
3033
+ numbers: NUMPAD_WITH_ENTER,
3034
+ }
3035
+ : layout;
3025
3036
  if (!Emoji) {
3026
3037
  computedLayout = removeKeyFromLayout(computedLayout, EMOTICON_KEY);
3027
3038
  }
@@ -3029,7 +3040,9 @@ const getNativeLayout = (type, Emoji = true, showDownKeyboardButton = true, isFi
3029
3040
  computedLayout = removeKeyFromLayout(computedLayout, DOWN_KEYBOARD_KEY);
3030
3041
  }
3031
3042
  if (!showEnterKey) {
3032
- computedLayout = removeKeyFromLayout(computedLayout, ENTER_KEY);
3043
+ // Numpad layouts always preserve {enter}; only remove from QWERTY layouts
3044
+ const numpadLayouts = type === 'numeric' ? ['default', 'numbers'] : ['numbers'];
3045
+ computedLayout = removeKeyFromLayout(computedLayout, ENTER_KEY, numpadLayouts);
3033
3046
  }
3034
3047
  if (!showTypeSwitchKey) {
3035
3048
  computedLayout = removeKeyFromLayout(computedLayout, '{numbers}');
@@ -3100,13 +3113,16 @@ const ACCENT_OPTIONS = {
3100
3113
  * <VirtualKeyboard targetRef={inputRef} value={value} onChange={setValue} />
3101
3114
  * ```
3102
3115
  */
3103
- const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onChange, onKeyPress, onTypeChange, maxLength, Emoji = false, className, id, placeholder = 'Digite aqui...', helperText, error, errorMessage, targetRef, textFieldScale = 1, showEnterKey = true, showTypeSwitchKey = true, }) => {
3116
+ const VirtualKeyboard = ({ variant = 'native', type = 'default', value, onChange, onKeyPress, onEnterPress, onTypeChange, maxLength, Emoji = false, className, id, placeholder = 'Digite aqui...', helperText, error, errorMessage, targetRef, textFieldScale = 1, showEnterKey = true, showTypeSwitchKey = true, numpadWithEnter = false, }) => {
3117
+ const [internalValue, setInternalValue] = React.useState(value ?? '');
3104
3118
  const [layoutName, setLayoutName] = React.useState('default');
3105
3119
  const [capsLockOn, setCapsLockOn] = React.useState(false);
3106
3120
  const [accentMenu, setAccentMenu] = React.useState(null);
3107
3121
  const [accentMenuOffsetX, setAccentMenuOffsetX] = React.useState(0);
3108
- const [activeLayout, setActiveLayout] = React.useState(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed', showEnterKey, showTypeSwitchKey));
3122
+ const [activeLayout, setActiveLayout] = React.useState(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed', showEnterKey, showTypeSwitchKey, numpadWithEnter));
3109
3123
  const visualType = NATIVE_LAYOUT_KEYS.has(type) ? type : 'default';
3124
+ const effectiveValue = onChange !== undefined ? (value ?? '') : internalValue;
3125
+ const isNumpadLayout = (type === 'numeric' && layoutName === 'default') || layoutName === 'numbers';
3110
3126
  const [isOpen, setIsOpen] = React.useState(variant !== 'native');
3111
3127
  const hideTimeoutRef = React.useRef(null);
3112
3128
  const scrollTimeoutRef = React.useRef(null);
@@ -3119,15 +3135,15 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
3119
3135
  const keyboardInstanceRef = React.useRef(null);
3120
3136
  const accentMenuRef = React.useRef(null);
3121
3137
  const accentButtonRef = React.useRef(null);
3122
- const valueRef = React.useRef(value);
3138
+ const valueRef = React.useRef(value ?? '');
3123
3139
  const [iconSlots, setIconSlots] = React.useState([]);
3124
3140
  const [keyPreview, setKeyPreview] = React.useState(null);
3125
3141
  const [keyPreviewOffsetX, setKeyPreviewOffsetX] = React.useState(0);
3126
3142
  const keyPreviewRef = React.useRef(null);
3127
3143
  const [containerWidth, setContainerWidth] = React.useState(Infinity);
3128
3144
  React.useEffect(() => {
3129
- valueRef.current = value;
3130
- }, [value]);
3145
+ valueRef.current = effectiveValue;
3146
+ }, [effectiveValue]);
3131
3147
  const clearLongPressTimeout = React.useCallback(() => {
3132
3148
  if (longPressTimeoutRef.current !== null) {
3133
3149
  clearTimeout(longPressTimeoutRef.current);
@@ -3142,8 +3158,8 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
3142
3158
  keyboardInstanceRef.current?.setInput(nextValue);
3143
3159
  }, []);
3144
3160
  React.useEffect(() => {
3145
- syncKeyboardInput(value);
3146
- }, [value, syncKeyboardInput]);
3161
+ syncKeyboardInput(effectiveValue);
3162
+ }, [effectiveValue, syncKeyboardInput]);
3147
3163
  React.useEffect(() => {
3148
3164
  onTypeChange?.(type);
3149
3165
  }, [type, onTypeChange]);
@@ -3221,8 +3237,8 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
3221
3237
  React.useEffect(() => {
3222
3238
  setLayoutName('default');
3223
3239
  setCapsLockOn(false);
3224
- setActiveLayout(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed', showEnterKey, showTypeSwitchKey));
3225
- }, [type, Emoji, variant, showEnterKey, showTypeSwitchKey]);
3240
+ setActiveLayout(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed', showEnterKey, showTypeSwitchKey, numpadWithEnter));
3241
+ }, [type, Emoji, variant, showEnterKey, showTypeSwitchKey, numpadWithEnter]);
3226
3242
  React.useEffect(() => {
3227
3243
  if (!Emoji && layoutName === 'emoticon') {
3228
3244
  setLayoutName(type === 'numeric' ? 'abc' : 'default');
@@ -3302,7 +3318,10 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
3302
3318
  if (newSlots.length === 0)
3303
3319
  return;
3304
3320
  newSlots.forEach((s) => s.setAttribute('data-icon-root', 'true'));
3305
- setIconSlots((prev) => [...prev, ...newSlots]);
3321
+ setIconSlots((prev) => [
3322
+ ...prev.filter((slot) => container.contains(slot)),
3323
+ ...newSlots,
3324
+ ]);
3306
3325
  };
3307
3326
  registerNewSlots();
3308
3327
  const observer = new MutationObserver(() => {
@@ -3313,7 +3332,7 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
3313
3332
  return () => {
3314
3333
  observer.disconnect();
3315
3334
  };
3316
- }, []);
3335
+ }, [variant]);
3317
3336
  React.useEffect(() => {
3318
3337
  closeAccentMenu();
3319
3338
  setAccentMenuOffsetX(0);
@@ -3395,6 +3414,8 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
3395
3414
  const currentValue = valueRef.current;
3396
3415
  if (maxLength === undefined || currentValue.length < maxLength) {
3397
3416
  const nextValue = `${currentValue}${heldKey}`;
3417
+ if (onChange === undefined)
3418
+ setInternalValue(nextValue);
3398
3419
  onChange?.(nextValue);
3399
3420
  onKeyPress?.(heldKey);
3400
3421
  syncKeyboardInput(nextValue);
@@ -3428,6 +3449,8 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
3428
3449
  return;
3429
3450
  }
3430
3451
  const nextValue = `${currentValue}${accentedChar}`;
3452
+ if (onChange === undefined)
3453
+ setInternalValue(nextValue);
3431
3454
  onChange?.(nextValue);
3432
3455
  onKeyPress?.(accentedChar);
3433
3456
  closeAccentMenu();
@@ -3518,12 +3541,16 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
3518
3541
  if (isHeldAccentKey) {
3519
3542
  return;
3520
3543
  }
3544
+ if (button === '{enter}') {
3545
+ onEnterPress?.();
3546
+ }
3521
3547
  onKeyPress?.(button);
3522
3548
  }, [
3523
3549
  type,
3524
3550
  layoutName,
3525
3551
  capsLockOn,
3526
3552
  onKeyPress,
3553
+ onEnterPress,
3527
3554
  onTypeChange,
3528
3555
  Emoji,
3529
3556
  variant,
@@ -3550,8 +3577,10 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
3550
3577
  }
3551
3578
  if (maxLength !== undefined && input.length > maxLength)
3552
3579
  return;
3580
+ if (onChange === undefined)
3581
+ setInternalValue(input);
3553
3582
  onChange?.(input);
3554
- }, [maxLength, onChange, syncKeyboardInput]);
3583
+ }, [maxLength, onChange, setInternalValue, syncKeyboardInput]);
3555
3584
  const portalSizes = React.useMemo(() => {
3556
3585
  if (containerWidth <= 360)
3557
3586
  return { preview: 42, option: 44, fontSize: 'var(--font-size-16)' };
@@ -3567,15 +3596,16 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
3567
3596
  const baseDisplay = LAYOUT_DISPLAY[visualType];
3568
3597
  if (!baseDisplay)
3569
3598
  return baseDisplay;
3570
- if (variant !== 'fixed') {
3571
- return baseDisplay;
3599
+ const display = { ...baseDisplay };
3600
+ if (numpadWithEnter && isNumpadLayout) {
3601
+ display['{enter}'] = '<span data-icon-key="enterNumpad"></span>';
3572
3602
  }
3573
- return {
3574
- ...baseDisplay,
3575
- '{bksp}': (baseDisplay['{bksp}'] ?? '').replace(/\s*Apagar$/, ''),
3576
- };
3577
- }, [visualType, variant]);
3578
- const keyboardEl = activeLayout ? (jsxRuntime.jsxs("div", { ref: keyboardWrapperRef, className: clsx(styles$k.keyboardWrapper, ((type === 'numeric' && layoutName === 'default') || layoutName === 'numbers' || type === 'default') && styles$k.keyboardNumpadActive), onPointerDownCapture: handleLongPressStart, onPointerUpCapture: handleLongPressEnd, onPointerLeave: handleLongPressEnd, onPointerCancelCapture: handleLongPressEnd, children: [jsxRuntime.jsx(Keyboard, { keyboardRef: (instance) => {
3603
+ if (variant === 'fixed') {
3604
+ display['{bksp}'] = (display['{bksp}'] ?? '').replace(/\s*Apagar$/, '');
3605
+ }
3606
+ return display;
3607
+ }, [visualType, variant, numpadWithEnter, isNumpadLayout]);
3608
+ const keyboardEl = activeLayout ? (jsxRuntime.jsxs("div", { ref: keyboardWrapperRef, className: clsx(styles$k.keyboardWrapper, isNumpadLayout && styles$k.keyboardNumpadActive), onPointerDownCapture: handleLongPressStart, onPointerUpCapture: handleLongPressEnd, onPointerLeave: handleLongPressEnd, onPointerCancelCapture: handleLongPressEnd, children: [jsxRuntime.jsx(Keyboard, { keyboardRef: (instance) => {
3579
3609
  keyboardInstanceRef.current = instance;
3580
3610
  if (instance) {
3581
3611
  instance.setInput(valueRef.current);
@@ -3613,9 +3643,9 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
3613
3643
  event.stopPropagation();
3614
3644
  }, onClick: () => handleAccentSelect(option), children: option }, `${accentMenu.sourceKey}-${option}`))) }, rowIndex))) }), document.body))] })) : null;
3615
3645
  if (variant === 'native' && typeof document !== 'undefined') {
3616
- return reactDom.createPortal(jsxRuntime.jsx("div", { id: id, className: clsx(styles$k.overlay, { [styles$k.overlayOpen]: isOpen }, styles$k[`layout--${visualType}`], className), children: keyboardEl }), document.body);
3646
+ return reactDom.createPortal(jsxRuntime.jsx("div", { id: id, className: clsx(styles$k.overlay, { [styles$k.overlayOpen]: isOpen }, styles$k[isNumpadLayout ? 'layout--numeric' : 'layout--default'], className), children: keyboardEl }), document.body);
3617
3647
  }
3618
- return (jsxRuntime.jsxs("div", { id: id, className: clsx(styles$k.container, styles$k[`mode--${variant}`], styles$k[`layout--${visualType}`], className), children: [variant === 'fixed' && (jsxRuntime.jsx("div", { className: styles$k.textFieldContainer, children: jsxRuntime.jsx(TextField, { placeholder: placeholder, value: value, onChange: onChange, helperText: helperText, error: error, errorMessage: errorMessage, readOnly: true, disableAutoComplete: true, maxLength: maxLength, attachedToVirtualKeyboard: true, className: styles$k.textFieldWrapper, scale: textFieldScale }) })), keyboardEl] }));
3648
+ return (jsxRuntime.jsxs("div", { id: id, className: clsx(styles$k.container, styles$k[`mode--${variant}`], styles$k[isNumpadLayout ? 'layout--numeric' : 'layout--default'], className), children: [variant === 'fixed' && (jsxRuntime.jsx("div", { className: styles$k.textFieldContainer, children: jsxRuntime.jsx(TextField, { placeholder: placeholder, value: effectiveValue, onChange: onChange, helperText: helperText, error: error, errorMessage: errorMessage, readOnly: true, disableAutoComplete: true, maxLength: maxLength, attachedToVirtualKeyboard: true, className: styles$k.textFieldWrapper, scale: textFieldScale }) })), keyboardEl] }));
3619
3649
  };
3620
3650
 
3621
3651
  var styles$j = {"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","clearButtonIcon":"TextField-module__clearButtonIcon___Z2iyc"};
@@ -3644,7 +3674,7 @@ const LabelComponent = ({ children, htmlFor, required = false, tooltip = false,
3644
3674
  return container;
3645
3675
  };
3646
3676
 
3647
- const TextField$1 = ({ ref, className, style, value, label, placeholder, type = 'text', onChange, disabled = false, maxLength, required = false, helperText, tooltipText, tooltipSide = 'bottom', tooltipAlign = 'start', errorMessage, error, id, icon, scale = 1, onBlur, onFocus, name, persistIcon = false, virtualKeyboard, attachedToVirtualKeyboard, disableAutoComplete = false, ...rest }) => {
3677
+ const TextField$1 = React.forwardRef(({ className, style, value, label, placeholder, type = 'text', onChange, disabled = false, maxLength, required = false, helperText, tooltipText, tooltipSide = 'bottom', tooltipAlign = 'start', errorMessage, error, id, icon, scale = 1, onBlur, onFocus, name, persistIcon = false, virtualKeyboard, attachedToVirtualKeyboard, disableAutoComplete = false, ...rest }, ref) => {
3648
3678
  const normalizeValue = (val) => {
3649
3679
  return val === undefined || val === null ? '' : String(val);
3650
3680
  };
@@ -3708,7 +3738,7 @@ const TextField$1 = ({ ref, className, style, value, label, placeholder, type =
3708
3738
  const containerClass = clsx(styles$j.container, className, {
3709
3739
  [styles$j.attachedToVirtualKeyboard]: attachedToVirtualKeyboard,
3710
3740
  [styles$j.disabled]: disabled,
3711
- [styles$j.error]: error,
3741
+ [styles$j.error]: hasError,
3712
3742
  [styles$j.errorWithMessage]: !!errorMessage,
3713
3743
  });
3714
3744
  return (jsxRuntime.jsxs("div", { className: containerClass, style: { ...containerStyle, ...style }, children: [label && (jsxRuntime.jsx(LabelComponent, { scale: scale, htmlFor: componentId, required: required, tooltip: !!tooltipText, tooltipText: tooltipText, side: tooltipSide, align: tooltipAlign, error: hasError, disabled: disabled, children: label })), jsxRuntime.jsxs("div", { className: styles$j.inputWrapper, children: [jsxRuntime.jsxs("div", { className: styles$j.inputContainer, children: [jsxRuntime.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 === 'default' || virtualKeyboard === 'numeric') ? 'none' : rest.inputMode, autoComplete: (disableAutoComplete || virtualKeyboard === 'default' || virtualKeyboard === 'numeric') ? 'off' : rest.autoComplete, className: clsx({
@@ -3722,7 +3752,7 @@ const TextField$1 = ({ ref, className, style, value, label, placeholder, type =
3722
3752
  onChange?.(val);
3723
3753
  }
3724
3754
  } }) }))] }));
3725
- };
3755
+ });
3726
3756
  TextField$1.displayName = 'TextField';
3727
3757
  var TextField = React.memo(TextField$1);
3728
3758
 
@@ -3818,7 +3848,7 @@ function validatePartialDate(value, locale = 'pt-br') {
3818
3848
  return 'incomplete';
3819
3849
  }
3820
3850
 
3821
- 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, scale = 1, className, style, ...rest }) => {
3851
+ 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, scale = 1, id, className, style, ...rest }) => {
3822
3852
  const fieldId = React.useId();
3823
3853
  const calendarId = `${fieldId}-calendar`;
3824
3854
  const containerStyle = { '--giro-scale': scale };
@@ -3948,7 +3978,7 @@ const DatePicker = ({ locale = 'pt-br', calendarSide = 'bottom', calendarAlign =
3948
3978
  }
3949
3979
  }
3950
3980
  };
3951
- return (jsxRuntime.jsx("div", { ref: wrapperRef, className: clsx(styles$h.datePicker, className), style: { ...containerStyle, ...style }, ...rest, children: jsxRuntime.jsx(Popover, { open: showCalendar, onOpenChange: setShowCalendar, asAnchor: true, trigger: jsxRuntime.jsx(TextField, { className: styles$h.textfieldContainer, type: "tel", icon: jsxRuntime.jsx(reactIcons.Calendar16Regular, { onClick: !disabled ? handleIconClick : undefined, className: clsx(styles$h.datePickerIcon, disabled && styles$h.datePickerIconDisabled) }), onChange: (e) => {
3981
+ return (jsxRuntime.jsx("div", { ref: wrapperRef, id: id, className: clsx(styles$h.datePicker, className), style: { ...containerStyle, ...style }, ...rest, children: jsxRuntime.jsx(Popover, { open: showCalendar, onOpenChange: setShowCalendar, asAnchor: true, trigger: jsxRuntime.jsx(TextField, { className: styles$h.textfieldContainer, type: "tel", icon: jsxRuntime.jsx(reactIcons.Calendar16Regular, { onClick: !disabled ? handleIconClick : undefined, className: clsx(styles$h.datePickerIcon, disabled && styles$h.datePickerIconDisabled) }), onChange: (e) => {
3952
3982
  handleTextFieldChange(String(e));
3953
3983
  }, 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, scale: scale, id: fieldId, "data-testid": testId, placeholder: locale === 'en-us' ? 'MM/DD/YYYY' : 'DD/MM/YYYY', "aria-label": "Open calendar", "aria-expanded": showCalendar, "aria-controls": calendarId, "aria-invalid": hasValidationError, "aria-describedby": externalError ? undefined : (helperText ? `${fieldId}-help` : undefined) }), content: jsxRuntime.jsx(Calendar, { selected: currentSelectedDate, currentDate: currentDate, onDateChange: setCurrentDate, onDaySelect: handleDaySelect, locale: locale, format: locale === 'en-us' ? 'mm/dd/yyyy' : 'dd/mm/yyyy', minDate: minDate, maxDate: maxDate, scale: scale, id: calendarId, onClear: () => {
3954
3984
  handleDateChange(null);
@@ -4052,7 +4082,7 @@ const matchesAccept = (file, accept) => {
4052
4082
  return fileType === type;
4053
4083
  });
4054
4084
  };
4055
- const FileUpload = ({ ref, value, onChange, helperText, error = false, errorMessage, maxFileSize, maxFilesQuantity, disabled = false, className, id, accept, multiple = true, description = 'Clique ou arraste os arquivos aqui', descriptionErrorMessage = 'Falha ao subir um ou mais arquivos.', ...rest }) => {
4085
+ const FileUpload = React.forwardRef(({ value, onChange, helperText, error = false, errorMessage, maxFileSize, maxFilesQuantity, disabled = false, className, id, accept, multiple = true, description = 'Clique ou arraste os arquivos aqui', descriptionErrorMessage = 'Falha ao subir um ou mais arquivos.', ...rest }, ref) => {
4056
4086
  const generatedId = React.useId();
4057
4087
  const componentId = id || generatedId;
4058
4088
  const helperId = `${componentId}-helper`;
@@ -4187,7 +4217,7 @@ const FileUpload = ({ ref, value, onChange, helperText, error = false, errorMess
4187
4217
  }
4188
4218
  }, children: jsxRuntime.jsx(reactIcons.Dismiss16Regular, { "aria-hidden": "true" }) })] }, `${file.name}-${index}`));
4189
4219
  }) }))] }), displayedHelper && (jsxRuntime.jsx("span", { id: helperId, role: isError ? 'alert' : undefined, className: clsx(styles$e.helperText, isError && styles$e.errorText), children: displayedHelper }))] }));
4190
- };
4220
+ });
4191
4221
  FileUpload.displayName = 'FileUpload';
4192
4222
 
4193
4223
  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"};
@@ -4214,7 +4244,7 @@ const Combined = ({ buttonText = 'Filtrar', icon, variant = 'outlined', disabled
4214
4244
 
4215
4245
  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"};
4216
4246
 
4217
- const Search = ({ ref, placeholder = 'Dica do que deve ser buscado', disabled = false, value, onChange, onKeyDown, onFocus, onBlur, onClear, onClick, onMouseDown, searchMode = 'instant', onSearch, id, scale = 1, className, style, virtualKeyboard, 'data-testid': testId, ...rest }) => {
4247
+ const Search = React.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, style, virtualKeyboard, 'data-testid': testId, ...rest }, ref) => {
4218
4248
  const [internalValue, setInternalValue] = React.useState('');
4219
4249
  const { internalRef: inputRef, setRefs: setInputRefs } = useInputKeyboardValue(ref);
4220
4250
  const isControlled = value !== undefined && onChange !== undefined;
@@ -4286,7 +4316,7 @@ const Search = ({ ref, placeholder = 'Dica do que deve ser buscado', disabled =
4286
4316
  setInternalValue(val);
4287
4317
  }
4288
4318
  } }) }))] }));
4289
- };
4319
+ });
4290
4320
  Search.displayName = 'Search';
4291
4321
 
4292
4322
  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 }) => {
@@ -5116,13 +5146,13 @@ const ExpandableSelectItem = ({ item, variant, onSelect, selectedValues, level =
5116
5146
  }, role: "button", tabIndex: item.disabled ? -1 : 0, "data-disabled": item.disabled || undefined, "data-selected": isSelected && !hasChildren ? 'true' : undefined, "data-testid": `select-item-${item.value}`, children: [variant === 'icon' && item.icon && (jsxRuntime.jsx("span", { className: styles$6.icon, children: item.icon })), jsxRuntime.jsxs("div", { className: styles$6.textContent, children: [jsxRuntime.jsx("div", { className: styles$6.title, children: item.text }), item.subTitle && jsxRuntime.jsx("div", { className: styles$6.subTitle, children: item.subTitle })] }), hasChildren && (jsxRuntime.jsx("span", { className: styles$6.chevron, children: isExpanded ? jsxRuntime.jsx(reactIcons.ChevronDown16Regular, {}) : jsxRuntime.jsx(reactIcons.ChevronRight16Regular, {}) }))] }) }), hasChildren && isExpanded && (jsxRuntime.jsx("div", { className: styles$6.childrenWrapper, children: item.children.map((child) => (jsxRuntime.jsx(ExpandableSelectItem, { item: child, variant: variant, onSelect: onSelect, selectedValues: selectedValues, level: level + 1 }, child.id || child.value))) }))] }));
5117
5147
  };
5118
5148
 
5119
- const SelectItem = ({ ref, text, subTitle, icon, disabled, value, variant, disableFocusOnHover, ...restProps }) => {
5149
+ const SelectItem = React.forwardRef(({ text, subTitle, icon, disabled, value, variant, disableFocusOnHover, ...restProps }, ref) => {
5120
5150
  return (jsxRuntime.jsxs("div", { className: clsx(styles$6.itemWrapper, {
5121
5151
  [styles$6.disabled]: disabled,
5122
5152
  }), "data-disabled": disabled || undefined, "data-testid": `select-item-${value}`, ref: ref, children: [variant === 'icon' && icon && (jsxRuntime.jsx("span", { className: styles$6.icon, children: icon })), jsxRuntime.jsxs(radixUi.Select.Item, { className: clsx(styles$6.item, {
5123
5153
  [styles$6.disabled]: disabled,
5124
5154
  }), value: value, disabled: disabled, onPointerMove: disableFocusOnHover ? (e) => e.preventDefault() : undefined, ...restProps, children: [jsxRuntime.jsx(radixUi.Select.ItemText, { className: styles$6.title, children: text }), subTitle && jsxRuntime.jsx("div", { className: styles$6.subTitle, children: subTitle }), jsxRuntime.jsx(radixUi.Select.ItemIndicator, { className: styles$6.itemIndicator })] })] }));
5125
- };
5155
+ });
5126
5156
  SelectItem.displayName = 'SelectItem';
5127
5157
 
5128
5158
  const initialState = {
@@ -5692,7 +5722,7 @@ const TableV2 = ({ columns, data, rowSelection: rowSelectionConfig, enableSortin
5692
5722
  maxWidth: col.column.columnDef.maxSize !== Number.MAX_SAFE_INTEGER
5693
5723
  ? col.column.columnDef.maxSize
5694
5724
  : undefined,
5695
- }, children: jsxRuntime.jsx("div", { className: styles$5.tableThContent, children: col.isPlaceholder ? null : col.column.getCanSort() ? (jsxRuntime.jsxs("button", { type: "button", className: styles$5.tableSortButton, onClick: col.column.getToggleSortingHandler(), "aria-label": `Ordenar por ${typeof col.column.columnDef.header === 'string' ? col.column.columnDef.header : col.id}`, children: [reactTable.flexRender(col.column.columnDef.header, col.getContext()), col.column.getIsSorted() === 'asc' ? (jsxRuntime.jsx(reactIcons.ArrowSortUp16Regular, { className: styles$5.tableSortIcon })) : col.column.getIsSorted() === 'desc' ? (jsxRuntime.jsx(reactIcons.ArrowSortDown16Regular, { className: styles$5.tableSortIcon })) : (jsxRuntime.jsx(reactIcons.ArrowSort16Regular, { className: clsx(styles$5.tableSortIcon, styles$5.tableSortIconNeutral) }))] })) : (reactTable.flexRender(col.column.columnDef.header, col.getContext())) }) }, col.id))) }, headerGroup.id))) }), jsxRuntime.jsx("tbody", { className: styles$5.tableBody, children: loading ? (Array.from({ length: skeletonRowCount }).map((_, rowIdx) => (jsxRuntime.jsx("tr", { className: styles$5.tableRow, children: table.getVisibleLeafColumns().map((col) => (jsxRuntime.jsx("td", { className: styles$5.tableTd, children: jsxRuntime.jsx(Skeleton, {}) }, col.id))) }, `skeleton-row-${rowIdx}`)))) : table.getRowModel().rows.length > 0 ? (table.getRowModel().rows.map((row, index) => {
5725
+ }, children: jsxRuntime.jsx("div", { className: styles$5.tableThContent, children: col.isPlaceholder ? null : col.column.getCanSort() ? (jsxRuntime.jsxs("button", { type: "button", className: styles$5.tableSortButton, onClick: col.column.getToggleSortingHandler(), "aria-label": `Ordenar por ${typeof col.column.columnDef.header === 'string' ? col.column.columnDef.header : col.id}`, children: [reactTable.flexRender(col.column.columnDef.header, col.getContext()), col.column.getIsSorted() === 'asc' ? (jsxRuntime.jsx(reactIcons.ArrowSortUp16Regular, { className: styles$5.tableSortIcon })) : col.column.getIsSorted() === 'desc' ? (jsxRuntime.jsx(reactIcons.ArrowSortDown16Regular, { className: styles$5.tableSortIcon })) : (jsxRuntime.jsx(reactIcons.ArrowSort16Regular, { className: styles$5.tableSortIconNeutral }))] })) : (reactTable.flexRender(col.column.columnDef.header, col.getContext())) }) }, col.id))) }, headerGroup.id))) }), jsxRuntime.jsx("tbody", { className: styles$5.tableBody, children: loading ? (Array.from({ length: skeletonRowCount }).map((_, rowIdx) => (jsxRuntime.jsx("tr", { className: styles$5.tableRow, children: table.getVisibleLeafColumns().map((col) => (jsxRuntime.jsx("td", { className: styles$5.tableTd, children: jsxRuntime.jsx(Skeleton, {}) }, col.id))) }, `skeleton-row-${rowIdx}`)))) : table.getRowModel().rows.length > 0 ? (table.getRowModel().rows.map((row, index) => {
5696
5726
  const rowProps = onRow?.(row.original, index) ?? {};
5697
5727
  return (jsxRuntime.jsx("tr", { className: clsx(styles$5.tableRow, rowProps.className), onClick: rowProps.onClick, onDoubleClick: rowProps.onDoubleClick, children: row.getVisibleCells().map((cell) => (jsxRuntime.jsx("td", { className: styles$5.tableTd, style: {
5698
5728
  textAlign: cell.column.columnDef.meta?.align,
@@ -5717,7 +5747,7 @@ const TableV2 = ({ columns, data, rowSelection: rowSelectionConfig, enableSortin
5717
5747
 
5718
5748
  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"};
5719
5749
 
5720
- const TextArea = ({ ref, className, value, label, placeholder, onChange, disabled = false, maxLength, required = false, helperText, tooltipText, tooltipSide = 'bottom', tooltipAlign = 'start', errorMessage, error, id, onBlur, onFocus, name, resize = 'vertical', charCount = false, height, virtualKeyboard, ...rest }) => {
5750
+ const TextArea = React.forwardRef(({ className, value, label, placeholder, onChange, disabled = false, maxLength, required = false, helperText, tooltipText, tooltipSide = 'bottom', tooltipAlign = 'start', errorMessage, error, id, onBlur, onFocus, name, resize = 'vertical', charCount = false, height, virtualKeyboard, ...rest }, ref) => {
5721
5751
  const normalizeValue = (val) => {
5722
5752
  return val === undefined || val === null ? '' : String(val);
5723
5753
  };
@@ -5762,7 +5792,7 @@ const TextArea = ({ ref, className, value, label, placeholder, onChange, disable
5762
5792
  onChange?.(val);
5763
5793
  }
5764
5794
  } }) }))] }));
5765
- };
5795
+ });
5766
5796
  TextArea.displayName = 'TextArea';
5767
5797
  var TextArea_default = React.memo(TextArea);
5768
5798