@giro-ds/react 11.1.0 → 11.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 +279 -205
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +80 -32
- package/dist/index.esm.js +281 -208
- package/dist/index.esm.js.map +1 -1
- package/dist/styles.css +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -31,17 +31,17 @@ function _interopNamespaceDefault(e) {
|
|
|
31
31
|
|
|
32
32
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
33
33
|
|
|
34
|
-
var styles$
|
|
34
|
+
var styles$v = {"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"};
|
|
35
35
|
|
|
36
36
|
const Avatar = ({ icon, size = 'lg', src, className, initialLetters, ...rest }) => {
|
|
37
|
-
const AvatarClass = clsx(styles$
|
|
38
|
-
[styles$
|
|
39
|
-
[styles$
|
|
37
|
+
const AvatarClass = clsx(styles$v.AvatarRoot, {
|
|
38
|
+
[styles$v['AvatarRoot--lg']]: size === 'lg',
|
|
39
|
+
[styles$v['AvatarRoot--sm']]: size === 'sm',
|
|
40
40
|
}, className);
|
|
41
|
-
return (jsxRuntime.jsxs(radixUi.Avatar.Root, { className: AvatarClass, ...rest, children: [src && (jsxRuntime.jsx(radixUi.Avatar.Image, { className: styles$
|
|
41
|
+
return (jsxRuntime.jsxs(radixUi.Avatar.Root, { className: AvatarClass, ...rest, children: [src && (jsxRuntime.jsx(radixUi.Avatar.Image, { className: styles$v.AvatarImage, src: src, alt: "Avatar" })), jsxRuntime.jsx(radixUi.Avatar.Fallback, { className: styles$v.AvatarFallback, children: icon || initialLetters })] }));
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
var styles$
|
|
44
|
+
var styles$u = {"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"};
|
|
45
45
|
|
|
46
46
|
const getDisplayValue = (value) => {
|
|
47
47
|
if (value === null || value === undefined)
|
|
@@ -63,25 +63,25 @@ const Badge = ({ children, badgeValue = null, className, id, filterVariant = fal
|
|
|
63
63
|
const displayValue = getDisplayValue(badgeValue);
|
|
64
64
|
const isEmpty = displayValue === '';
|
|
65
65
|
if (children) {
|
|
66
|
-
return (jsxRuntime.jsxs("div", { className: styles$
|
|
67
|
-
[styles$
|
|
68
|
-
[styles$
|
|
66
|
+
return (jsxRuntime.jsxs("div", { className: styles$u.badgeContainer, ...rest, children: [jsxRuntime.jsx("div", { "data-testid": "badge-content", children: children }), jsxRuntime.jsx("div", { id: componentId, className: clsx(styles$u.badge, {
|
|
67
|
+
[styles$u['badge__empty']]: isEmpty,
|
|
68
|
+
[styles$u['badge__flex']]: displayValue.length >= 2,
|
|
69
69
|
}, className), "data-testid": "badge", children: !isEmpty && jsxRuntime.jsx("span", { "aria-hidden": !!ariaLabel, children: displayValue }) })] }));
|
|
70
70
|
}
|
|
71
|
-
return (jsxRuntime.jsx("div", { className: styles$
|
|
72
|
-
[styles$
|
|
73
|
-
[styles$
|
|
74
|
-
[styles$
|
|
71
|
+
return (jsxRuntime.jsx("div", { className: styles$u.badgeContainer, children: jsxRuntime.jsx("div", { className: clsx(styles$u['badge__status'], {
|
|
72
|
+
[styles$u['badge__status__empty']]: isEmpty,
|
|
73
|
+
[styles$u['badge__status__flex']]: displayValue.length >= 2,
|
|
74
|
+
[styles$u['badge__status__filterBadge']]: filterVariant,
|
|
75
75
|
}, className), "data-testid": "badge", children: !isEmpty && (jsxRuntime.jsx("span", { "aria-hidden": !!ariaLabel, children: displayValue })) }) }));
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
var styles$
|
|
78
|
+
var styles$t = {"tooltipContent":"Tooltip-module__tooltipContent___xycUg","triggerWrapper":"Tooltip-module__triggerWrapper___x83XR"};
|
|
79
79
|
|
|
80
80
|
const Tooltip = ({ children, text, side = 'bottom', align = 'start', maxWidth, sideOffset = 10, className, ...rest }) => {
|
|
81
|
-
return (jsxRuntime.jsx(radixUi.Tooltip.Provider, { children: jsxRuntime.jsxs(radixUi.Tooltip.Root, { children: [jsxRuntime.jsx(radixUi.Tooltip.Trigger, { asChild: true, children: jsxRuntime.jsx("span", { className: styles$
|
|
81
|
+
return (jsxRuntime.jsx(radixUi.Tooltip.Provider, { children: jsxRuntime.jsxs(radixUi.Tooltip.Root, { children: [jsxRuntime.jsx(radixUi.Tooltip.Trigger, { asChild: true, children: jsxRuntime.jsx("span", { className: styles$t.triggerWrapper, children: children }) }), jsxRuntime.jsx(radixUi.Tooltip.Portal, { children: jsxRuntime.jsx(radixUi.Tooltip.Content, { className: clsx(styles$t.tooltipContent, className), side: side, align: align, sideOffset: sideOffset, style: { maxWidth: maxWidth ? `${maxWidth}px` : 'auto' }, ...rest, children: text }) })] }) }));
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
var styles$
|
|
84
|
+
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"};
|
|
85
85
|
|
|
86
86
|
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) => {
|
|
87
87
|
const generatedId = React.useId();
|
|
@@ -110,14 +110,14 @@ const Button = React.forwardRef(({ as, children, variant = 'filled', iconPositio
|
|
|
110
110
|
'Forneça um ícone via `icon={<MeuIcone />}`.');
|
|
111
111
|
}
|
|
112
112
|
const resolvedIcon = icon;
|
|
113
|
-
const buttonClasses = clsx(styles$
|
|
114
|
-
[styles$
|
|
115
|
-
[styles$
|
|
116
|
-
[styles$
|
|
117
|
-
[styles$
|
|
118
|
-
[styles$
|
|
119
|
-
[styles$
|
|
120
|
-
[styles$
|
|
113
|
+
const buttonClasses = clsx(styles$s.button, styles$s[`button-${variant}`], styles$s[`button-${size}`], {
|
|
114
|
+
[styles$s['disabled']]: disabled,
|
|
115
|
+
[styles$s['buttonLoading']]: loading,
|
|
116
|
+
[styles$s['buttonWithIcon']]: resolvedIcon && !iconOnly,
|
|
117
|
+
[styles$s[`buttonIconPosition-${iconPosition}`]]: resolvedIcon && !iconOnly,
|
|
118
|
+
[styles$s['buttonNoContent']]: resolvedIcon && !hasContent && !iconOnly,
|
|
119
|
+
[styles$s['buttonFullWidth']]: fullWidth,
|
|
120
|
+
[styles$s['buttonIconOnly']]: iconOnly,
|
|
121
121
|
}, className);
|
|
122
122
|
const getAriaLabel = () => {
|
|
123
123
|
if (ariaLabel)
|
|
@@ -143,12 +143,12 @@ const Button = React.forwardRef(({ as, children, variant = 'filled', iconPositio
|
|
|
143
143
|
};
|
|
144
144
|
const renderContent = () => {
|
|
145
145
|
if (iconOnly && !loading) {
|
|
146
|
-
return (jsxRuntime.jsx("span", { className: styles$
|
|
146
|
+
return (jsxRuntime.jsx("span", { className: styles$s.buttonIconOnly, "aria-hidden": "true", children: resolvedIcon }));
|
|
147
147
|
}
|
|
148
148
|
if (loading) {
|
|
149
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!iconOnly && (jsxRuntime.jsxs("span", { className: styles$
|
|
149
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!iconOnly && (jsxRuntime.jsxs("span", { className: styles$s.buttonContentHidden, "aria-hidden": "true", children: [resolvedIcon && (iconPosition === 'left' || iconPosition === 'both') && (jsxRuntime.jsx("span", { className: styles$s.buttonIconLeft, children: resolvedIcon })), children, resolvedIcon && (iconPosition === 'right' || iconPosition === 'both') && (jsxRuntime.jsx("span", { className: styles$s.buttonIconRight, children: resolvedIcon }))] })), jsxRuntime.jsx("span", { className: styles$s.buttonLoadingSpinner, "aria-hidden": "true", children: jsxRuntime.jsx(reactIcons.SpinnerIos16Regular, { "aria-hidden": "true" }) })] }));
|
|
150
150
|
}
|
|
151
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [resolvedIcon && (iconPosition === 'left' || iconPosition === 'both') && (jsxRuntime.jsx("span", { className: styles$
|
|
151
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [resolvedIcon && (iconPosition === 'left' || iconPosition === 'both') && (jsxRuntime.jsx("span", { className: styles$s.buttonIconLeft, "aria-hidden": "true", children: resolvedIcon })), children, resolvedIcon && (iconPosition === 'right' || iconPosition === 'both') && (jsxRuntime.jsx("span", { className: styles$s.buttonIconRight, "aria-hidden": "true", children: resolvedIcon }))] }));
|
|
152
152
|
};
|
|
153
153
|
const { style: externalStyle, ...otherRest } = rest;
|
|
154
154
|
const baseProps = {
|
|
@@ -2458,7 +2458,7 @@ const ptBR = {
|
|
|
2458
2458
|
},
|
|
2459
2459
|
};
|
|
2460
2460
|
|
|
2461
|
-
var styles$
|
|
2461
|
+
var styles$r = {"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","chevron_wrapper":"Calendar-module__chevron_wrapper___BfN9a"};
|
|
2462
2462
|
|
|
2463
2463
|
const FLUENT_CHEVRON_MAP = {
|
|
2464
2464
|
down: reactIcons.ChevronDown16Regular,
|
|
@@ -2468,7 +2468,7 @@ const FLUENT_CHEVRON_MAP = {
|
|
|
2468
2468
|
};
|
|
2469
2469
|
const CustomChevron = ({ orientation = "left", className, }) => {
|
|
2470
2470
|
const Icon = FLUENT_CHEVRON_MAP[orientation];
|
|
2471
|
-
return jsxRuntime.jsx("span", { className: styles$
|
|
2471
|
+
return jsxRuntime.jsx("span", { className: styles$r.chevron_wrapper, children: jsxRuntime.jsx(Icon, { className: className, "aria-hidden": true }) });
|
|
2472
2472
|
};
|
|
2473
2473
|
const GridCtx = React.createContext(null);
|
|
2474
2474
|
const GridMonthCaption = ({ calendarMonth, displayIndex: _displayIndex, ...divProps }) => {
|
|
@@ -2477,7 +2477,7 @@ const GridMonthCaption = ({ calendarMonth, displayIndex: _displayIndex, ...divPr
|
|
|
2477
2477
|
const date = calendarMonth.date;
|
|
2478
2478
|
const monthLabel = new Intl.DateTimeFormat(intlLocale, { month: "long" }).format(date);
|
|
2479
2479
|
const yearLabel = String(date.getFullYear());
|
|
2480
|
-
return (jsxRuntime.jsxs("div", { ...divProps, children: [jsxRuntime.jsx("span", { className: styles$
|
|
2480
|
+
return (jsxRuntime.jsxs("div", { ...divProps, children: [jsxRuntime.jsx("span", { className: styles$r.caption_grid_label, children: monthLabel }), jsxRuntime.jsxs("button", { type: "button", className: styles$r.caption_grid_btn, "aria-pressed": view === "years", onClick: onYearLabelClick, children: [yearLabel, view !== "days" ? (jsxRuntime.jsx("span", { className: styles$r.chevron_wrapper, children: jsxRuntime.jsx(reactIcons.ChevronUp16Regular, { className: styles$r.caption_year_chevron, "aria-hidden": true }) })) : (jsxRuntime.jsx("span", { className: styles$r.chevron_wrapper, children: jsxRuntime.jsx(reactIcons.ChevronDown16Regular, { className: styles$r.caption_year_chevron, "aria-hidden": true }) }))] })] }));
|
|
2481
2481
|
};
|
|
2482
2482
|
const YEARS_PER_PAGE = 20;
|
|
2483
2483
|
const Calendar = ({ selected, currentDate, defaultMonth, startMonth, endMonth, onDaySelect, onDateChange, onClear: _onClear, minDate, maxDate, disabled, format: _format, locale = "pt-br", autoFocus, className, style, scale = 1, id, "aria-label": ariaLabel, ...rest }) => {
|
|
@@ -2545,7 +2545,7 @@ const Calendar = ({ selected, currentDate, defaultMonth, startMonth, endMonth, o
|
|
|
2545
2545
|
onYearLabelClick: handleYearLabelClick,
|
|
2546
2546
|
};
|
|
2547
2547
|
const sharedDayPickerProps = {
|
|
2548
|
-
classNames: styles$
|
|
2548
|
+
classNames: styles$r,
|
|
2549
2549
|
animate,
|
|
2550
2550
|
mode: "single",
|
|
2551
2551
|
selected: resolvedSelected,
|
|
@@ -2558,10 +2558,10 @@ const Calendar = ({ selected, currentDate, defaultMonth, startMonth, endMonth, o
|
|
|
2558
2558
|
"aria-label": ariaLabel,
|
|
2559
2559
|
};
|
|
2560
2560
|
const containerStyle = { '--giro-scale': scale };
|
|
2561
|
-
return (jsxRuntime.jsx(GridCtx.Provider, { value: gridCtxValue, children: jsxRuntime.jsxs("div", { className: clsx(styles$
|
|
2561
|
+
return (jsxRuntime.jsx(GridCtx.Provider, { value: gridCtxValue, children: jsxRuntime.jsxs("div", { className: clsx(styles$r.calendar_grid_wrapper, className), style: { ...containerStyle, ...style }, children: [jsxRuntime.jsx(reactDayPicker.DayPicker, { id: id, ...sharedDayPickerProps, ...rest, captionLayout: "label", month: resolvedDisplayMonth, onMonthChange: handleMonthChange, components: { MonthCaption: GridMonthCaption, Chevron: CustomChevron } }), gridView !== "days" && (jsxRuntime.jsxs("div", { className: `${styles$r.gridOverlay}${gridView === "years" ? ` ${styles$r.gridOverlayYears}` : ""}`, role: "dialog", "aria-modal": "true", "aria-label": gridView === "months" ? "Selecione o mês" : "Selecione o ano", children: [gridView === "months" && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: styles$r.gridOverlayCaption, children: [jsxRuntime.jsx("span", { className: styles$r.caption_grid_label, children: new Intl.DateTimeFormat(intlLocale, { month: "long" }).format(resolvedDisplayMonth) }), jsxRuntime.jsxs("button", { type: "button", className: styles$r.caption_grid_btn, onClick: () => setGridView("days"), "aria-label": "Fechar sele\u00E7\u00E3o de m\u00EAs", children: [displayedYear, jsxRuntime.jsx("span", { className: styles$r.chevron_wrapper, children: jsxRuntime.jsx(reactIcons.ChevronUp16Regular, { className: styles$r.caption_year_chevron, "aria-hidden": true }) })] })] }), jsxRuntime.jsx("div", { className: styles$r.gridCells, children: monthsGrid.map(({ index, label, disabled: monthDisabled }) => (jsxRuntime.jsx("button", { type: "button", disabled: monthDisabled, className: `${styles$r.gridCell}${displayedMonthIndex === index ? ` ${styles$r.gridCellActive}` : ""}`, onClick: () => handleGridMonthSelect(index), children: label }, index))) })] })), gridView === "years" && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: styles$r.gridOverlayCaption, children: [jsxRuntime.jsx("span", { className: styles$r.caption_grid_label, children: new Intl.DateTimeFormat(intlLocale, { month: "long" }).format(resolvedDisplayMonth) }), jsxRuntime.jsxs("button", { type: "button", className: styles$r.caption_grid_btn, onClick: () => setGridView("days"), "aria-label": "Fechar sele\u00E7\u00E3o de ano", children: [displayedYear, jsxRuntime.jsx("span", { className: styles$r.chevron_wrapper, children: jsxRuntime.jsx(reactIcons.ChevronUp16Regular, { className: styles$r.caption_year_chevron, "aria-hidden": true }) })] }), jsxRuntime.jsxs("div", { className: styles$r.gridOverlayYearsNav, children: [jsxRuntime.jsx("button", { type: "button", className: styles$r.gridNavBtn, disabled: !canGoPrevYears, onClick: () => setYearPageStart((s) => s - YEARS_PER_PAGE), "aria-label": "Anos anteriores", children: jsxRuntime.jsx("span", { className: styles$r.chevron_wrapper, children: jsxRuntime.jsx(reactIcons.ChevronLeft16Regular, { className: styles$r.chevronNavBtnPrev, "aria-hidden": true }) }) }), jsxRuntime.jsx("button", { type: "button", className: styles$r.gridNavBtn, disabled: !canGoNextYears, onClick: () => setYearPageStart((s) => s + YEARS_PER_PAGE), "aria-label": "Pr\u00F3ximos anos", children: jsxRuntime.jsx("span", { className: styles$r.chevron_wrapper, children: jsxRuntime.jsx(reactIcons.ChevronRight16Regular, { className: styles$r.chevronNavBtnNext, "aria-hidden": true }) }) })] })] }), jsxRuntime.jsx("div", { className: `${styles$r.gridCells} ${styles$r.gridCellsYears}`, children: yearsInPage.map((year) => (jsxRuntime.jsx("button", { type: "button", className: `${styles$r.gridCell}${displayedYear === year ? ` ${styles$r.gridCellActive}` : ""}`, onClick: () => handleGridYearSelect(year), children: year }, year))) })] }))] }))] }) }));
|
|
2562
2562
|
};
|
|
2563
2563
|
|
|
2564
|
-
var styles$
|
|
2564
|
+
var styles$q = {"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"};
|
|
2565
2565
|
|
|
2566
2566
|
const Callout = ({ variant = 'neutral', title, text, icon, onDismiss, dismiss, backgroundColor, textColor, className, id, style, ...rest }) => {
|
|
2567
2567
|
if (process.env.NODE_ENV !== 'production' && (text === '' || (typeof text === 'string' && !text.trim()))) {
|
|
@@ -2571,19 +2571,19 @@ const Callout = ({ variant = 'neutral', title, text, icon, onDismiss, dismiss, b
|
|
|
2571
2571
|
const titleId = `callout-title-${id || generatedId}`;
|
|
2572
2572
|
const componentId = id || generatedId;
|
|
2573
2573
|
const isAlert = variant === 'alert';
|
|
2574
|
-
const containerClass = clsx(styles$
|
|
2574
|
+
const containerClass = clsx(styles$q.container, styles$q[variant], { [styles$q.withTitle]: title }, className);
|
|
2575
2575
|
const customStyle = {
|
|
2576
2576
|
...style,
|
|
2577
2577
|
...(backgroundColor && { '--callout-bg': `var(--${backgroundColor})` }),
|
|
2578
2578
|
...(textColor && { '--callout-text': `var(--${textColor})` }),
|
|
2579
2579
|
};
|
|
2580
|
-
return (jsxRuntime.jsx("div", { id: componentId, className: containerClass, role: isAlert ? 'alert' : 'status', "aria-live": isAlert ? 'assertive' : 'polite', "aria-labelledby": title ? titleId : undefined, style: customStyle, ...rest, children: jsxRuntime.jsxs("div", { className: styles$
|
|
2580
|
+
return (jsxRuntime.jsx("div", { id: componentId, className: containerClass, role: isAlert ? 'alert' : 'status', "aria-live": isAlert ? 'assertive' : 'polite', "aria-labelledby": title ? titleId : undefined, style: customStyle, ...rest, children: jsxRuntime.jsxs("div", { className: styles$q.content, children: [icon && jsxRuntime.jsx("span", { className: styles$q.icon, "aria-hidden": "true", children: icon }), jsxRuntime.jsxs("div", { className: styles$q.subcontent, children: [title && (jsxRuntime.jsx("span", { id: titleId, className: styles$q.title, children: title })), text && jsxRuntime.jsx("span", { className: styles$q.text, children: text })] }), dismiss && (jsxRuntime.jsx("button", { className: styles$q.dismiss, onClick: onDismiss, type: "button", "aria-label": "Fechar", children: jsxRuntime.jsx(reactIcons.Dismiss24Regular, { "aria-hidden": "true" }) }))] }) }));
|
|
2581
2581
|
};
|
|
2582
2582
|
|
|
2583
|
-
var styles$
|
|
2583
|
+
var styles$p = {"card":"Card-module__card___LzN-3","card--hoverable":"Card-module__card--hoverable___orpJZ"};
|
|
2584
2584
|
|
|
2585
2585
|
function Card({ children, className, hoverable }) {
|
|
2586
|
-
return (jsxRuntime.jsx("main", { className: clsx(styles$
|
|
2586
|
+
return (jsxRuntime.jsx("main", { className: clsx(styles$p['card'], hoverable && styles$p['card--hoverable'], className), children: children }));
|
|
2587
2587
|
}
|
|
2588
2588
|
|
|
2589
2589
|
const CheckSmall = ({ className = '', width = 12, height = 10, fill = 'white', ...restProps }) => {
|
|
@@ -2594,22 +2594,22 @@ const CheckHalf = ({ className = '', width = 16, height = 16, fill = 'white', ..
|
|
|
2594
2594
|
return (jsxRuntime.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: jsxRuntime.jsx("g", { id: "Icons/check_indeterminate_small", children: jsxRuntime.jsx("path", { id: "icon", d: "M3 9V7H13V9H3Z", fill: fill }) }) }));
|
|
2595
2595
|
};
|
|
2596
2596
|
|
|
2597
|
-
var styles$
|
|
2597
|
+
var styles$o = {"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"};
|
|
2598
2598
|
|
|
2599
2599
|
const Checkbox = ({ id, label, onCheckedChange, checked, disabled, className, style, scale = 1, indeterminate = false, ...rest }) => {
|
|
2600
2600
|
const componentId = id || React__namespace.useId();
|
|
2601
|
-
return (jsxRuntime.jsxs("div", { className: clsx(styles$
|
|
2602
|
-
[styles$
|
|
2603
|
-
}), role: "presentation", tabIndex: disabled ? -1 : 0, children: jsxRuntime.jsx(radixUi.Checkbox.Root, { className: styles$
|
|
2601
|
+
return (jsxRuntime.jsxs("div", { className: clsx(styles$o.container, className), style: { '--giro-scale': scale, ...style }, children: [jsxRuntime.jsx("div", { className: clsx(styles$o.wrapperCheckbox, {
|
|
2602
|
+
[styles$o.disabled]: disabled,
|
|
2603
|
+
}), 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 })] }));
|
|
2604
2604
|
};
|
|
2605
2605
|
|
|
2606
|
-
var styles$
|
|
2606
|
+
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"};
|
|
2607
2607
|
|
|
2608
2608
|
const Chips = ({ children, leftIcon, rightIcon, variant = 'neutral', disabled = false, backgroundColor, textColor, scale = 1, className, style, ...rest }) => {
|
|
2609
|
-
const chipsClass = clsx(styles$
|
|
2610
|
-
[styles$
|
|
2611
|
-
[styles$
|
|
2612
|
-
[styles$
|
|
2609
|
+
const chipsClass = clsx(styles$n.chips, styles$n[variant], {
|
|
2610
|
+
[styles$n.disabled]: disabled,
|
|
2611
|
+
[styles$n.hasLeftIcon]: leftIcon,
|
|
2612
|
+
[styles$n.hasRightIcon]: rightIcon,
|
|
2613
2613
|
}, className);
|
|
2614
2614
|
const colorStyle = {
|
|
2615
2615
|
'--giro-scale': scale,
|
|
@@ -2618,21 +2618,21 @@ const Chips = ({ children, leftIcon, rightIcon, variant = 'neutral', disabled =
|
|
|
2618
2618
|
...style,
|
|
2619
2619
|
};
|
|
2620
2620
|
const isInteractive = typeof rest.onClick === 'function';
|
|
2621
|
-
return (jsxRuntime.jsxs("div", { className: chipsClass, "aria-disabled": disabled, style: colorStyle, role: isInteractive ? 'button' : undefined, tabIndex: isInteractive ? (disabled ? -1 : 0) : undefined, ...rest, children: [leftIcon && (jsxRuntime.jsx("span", { className: styles$
|
|
2621
|
+
return (jsxRuntime.jsxs("div", { className: chipsClass, "aria-disabled": disabled, style: colorStyle, role: isInteractive ? 'button' : undefined, tabIndex: isInteractive ? (disabled ? -1 : 0) : undefined, ...rest, children: [leftIcon && (jsxRuntime.jsx("span", { className: styles$n.iconLeft, "aria-hidden": "true", children: leftIcon })), jsxRuntime.jsx("span", { className: styles$n.title, children: children }), rightIcon && (jsxRuntime.jsx("span", { className: styles$n.iconRight, children: rightIcon }))] }));
|
|
2622
2622
|
};
|
|
2623
2623
|
const MemoizedChips = React.memo(Chips);
|
|
2624
2624
|
MemoizedChips.displayName = 'Chips';
|
|
2625
2625
|
|
|
2626
|
-
var styles$
|
|
2626
|
+
var styles$m = {"container":"Container-module__container___exPuE"};
|
|
2627
2627
|
|
|
2628
2628
|
function Container({ children, className }) {
|
|
2629
|
-
return (jsxRuntime.jsx("main", { className: clsx(styles$
|
|
2629
|
+
return (jsxRuntime.jsx("main", { className: clsx(styles$m['container'], 'mx-auto', className), children: children }));
|
|
2630
2630
|
}
|
|
2631
2631
|
|
|
2632
|
-
var styles$
|
|
2632
|
+
var styles$l = {"Content":"Popover-module__Content___RIETg"};
|
|
2633
2633
|
|
|
2634
2634
|
const Popover = ({ trigger, content, side = "left", align = "start", sideOffset = 8, open, onOpenChange, asAnchor = false, onOpenAutoFocus, onCloseAutoFocus, showArrow = false, className, ...rest }) => {
|
|
2635
|
-
return (jsxRuntime.jsxs(radixUi.Popover.Root, { open: open, onOpenChange: onOpenChange, ...rest, children: [asAnchor ? (jsxRuntime.jsx(radixUi.Popover.Anchor, { asChild: true, children: trigger })) : (jsxRuntime.jsx(radixUi.Popover.Trigger, { asChild: true, children: trigger })), jsxRuntime.jsx(radixUi.Popover.Portal, { children: jsxRuntime.jsxs(radixUi.Popover.Content, { className: clsx(styles$
|
|
2635
|
+
return (jsxRuntime.jsxs(radixUi.Popover.Root, { open: open, onOpenChange: onOpenChange, ...rest, children: [asAnchor ? (jsxRuntime.jsx(radixUi.Popover.Anchor, { asChild: true, children: trigger })) : (jsxRuntime.jsx(radixUi.Popover.Trigger, { asChild: true, children: trigger })), jsxRuntime.jsx(radixUi.Popover.Portal, { children: jsxRuntime.jsxs(radixUi.Popover.Content, { className: clsx(styles$l.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 && jsxRuntime.jsx(radixUi.Popover.Arrow, {})] }) })] }));
|
|
2636
2636
|
};
|
|
2637
2637
|
|
|
2638
2638
|
function useInputKeyboardValue(externalRef) {
|
|
@@ -2687,6 +2687,10 @@ const removeKeyFromLayout = (layout, key) => Object.fromEntries(Object.entries(l
|
|
|
2687
2687
|
layoutName,
|
|
2688
2688
|
rows.map((row) => row.split(key).join(' ').replace(/\s+/g, ' ').trim()),
|
|
2689
2689
|
]));
|
|
2690
|
+
const replaceKeyWithBlank = (layout, key) => Object.fromEntries(Object.entries(layout).map(([layoutName, rows]) => [
|
|
2691
|
+
layoutName,
|
|
2692
|
+
rows.map((row) => row.split(key).join('{//}')),
|
|
2693
|
+
]));
|
|
2690
2694
|
const QWERTY_LOWERCASE = [
|
|
2691
2695
|
'1 2 3 4 5 6 7 8 9 0',
|
|
2692
2696
|
'q w e r t y u i o p',
|
|
@@ -2744,7 +2748,7 @@ const NATIVE_LAYOUTS = {
|
|
|
2744
2748
|
const NATIVE_LAYOUT_KEYS = new Set([
|
|
2745
2749
|
'default', 'numeric',
|
|
2746
2750
|
]);
|
|
2747
|
-
const getNativeLayout = (type, Emoji = true, showDownKeyboardButton = true, isFixed = false, showEnterKey = true) => {
|
|
2751
|
+
const getNativeLayout = (type, Emoji = true, showDownKeyboardButton = true, isFixed = false, showEnterKey = true, showTypeSwitchKey = true) => {
|
|
2748
2752
|
const layout = NATIVE_LAYOUTS[type] ?? NATIVE_LAYOUTS.default ?? null;
|
|
2749
2753
|
if (!layout)
|
|
2750
2754
|
return null;
|
|
@@ -2758,6 +2762,10 @@ const getNativeLayout = (type, Emoji = true, showDownKeyboardButton = true, isFi
|
|
|
2758
2762
|
if (!showEnterKey) {
|
|
2759
2763
|
computedLayout = removeKeyFromLayout(computedLayout, ENTER_KEY);
|
|
2760
2764
|
}
|
|
2765
|
+
if (!showTypeSwitchKey) {
|
|
2766
|
+
computedLayout = removeKeyFromLayout(computedLayout, '{numbers}');
|
|
2767
|
+
computedLayout = replaceKeyWithBlank(computedLayout, '{abc}');
|
|
2768
|
+
}
|
|
2761
2769
|
if (isFixed) {
|
|
2762
2770
|
computedLayout = Object.fromEntries(Object.entries(computedLayout).map(([layoutName, rows]) => [
|
|
2763
2771
|
layoutName,
|
|
@@ -2783,7 +2791,7 @@ const SHIFT_TOGGLES = {
|
|
|
2783
2791
|
alt2: 'alt',
|
|
2784
2792
|
};
|
|
2785
2793
|
|
|
2786
|
-
var styles$
|
|
2794
|
+
var styles$k = {"container":"VirtualKeyboard-module__container___A-e0I","layout--numeric":"VirtualKeyboard-module__layout--numeric___zfd7G","mode--fixed":"VirtualKeyboard-module__mode--fixed___1eFY1","layout--default":"VirtualKeyboard-module__layout--default___qyY1b","textFieldContainer":"VirtualKeyboard-module__textFieldContainer___XxGen","keyboardWrapper":"VirtualKeyboard-module__keyboardWrapper___jryTf","keyboardNumpadActive":"VirtualKeyboard-module__keyboardNumpadActive___jPpJD","overlay":"VirtualKeyboard-module__overlay___a5y7i","overlayOpen":"VirtualKeyboard-module__overlayOpen___hREu-","textFieldWrapper":"VirtualKeyboard-module__textFieldWrapper___bmi-z","keyPreview":"VirtualKeyboard-module__keyPreview___oWaO1","accentMenu":"VirtualKeyboard-module__accentMenu___A6tTy","accentMenuRow":"VirtualKeyboard-module__accentMenuRow___3kbvT","accentOption":"VirtualKeyboard-module__accentOption___ao-Ta"};
|
|
2787
2795
|
|
|
2788
2796
|
const LONG_PRESS_DELAY_MS = 400;
|
|
2789
2797
|
const ACCENT_OPTIONS = {
|
|
@@ -2823,12 +2831,12 @@ const ACCENT_OPTIONS = {
|
|
|
2823
2831
|
* <VirtualKeyboard targetRef={inputRef} value={value} onChange={setValue} />
|
|
2824
2832
|
* ```
|
|
2825
2833
|
*/
|
|
2826
|
-
const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onChange, onKeyPress, maxLength, Emoji = false, className, id, textFieldPlaceholder = 'Digite aqui...', helperText, error, errorMessage, targetRef, textFieldScale = 1, showEnterKey = true, }) => {
|
|
2834
|
+
const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onChange, onKeyPress, onTypeChange, maxLength, Emoji = false, className, id, textFieldPlaceholder = 'Digite aqui...', helperText, error, errorMessage, targetRef, textFieldScale = 1, showEnterKey = true, showTypeSwitchKey = true, }) => {
|
|
2827
2835
|
const [layoutName, setLayoutName] = React.useState('default');
|
|
2828
2836
|
const [capsLockOn, setCapsLockOn] = React.useState(false);
|
|
2829
2837
|
const [accentMenu, setAccentMenu] = React.useState(null);
|
|
2830
2838
|
const [accentMenuOffsetX, setAccentMenuOffsetX] = React.useState(0);
|
|
2831
|
-
const [activeLayout, setActiveLayout] = React.useState(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed', showEnterKey));
|
|
2839
|
+
const [activeLayout, setActiveLayout] = React.useState(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed', showEnterKey, showTypeSwitchKey));
|
|
2832
2840
|
const visualType = NATIVE_LAYOUT_KEYS.has(type) ? type : 'default';
|
|
2833
2841
|
const [isOpen, setIsOpen] = React.useState(variant !== 'native');
|
|
2834
2842
|
const hideTimeoutRef = React.useRef(null);
|
|
@@ -2867,6 +2875,9 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
2867
2875
|
React.useEffect(() => {
|
|
2868
2876
|
syncKeyboardInput(value);
|
|
2869
2877
|
}, [value, syncKeyboardInput]);
|
|
2878
|
+
React.useEffect(() => {
|
|
2879
|
+
onTypeChange?.(type);
|
|
2880
|
+
}, [type, onTypeChange]);
|
|
2870
2881
|
const scheduleHideIfBlurred = React.useCallback(() => {
|
|
2871
2882
|
if (variant !== 'native')
|
|
2872
2883
|
return;
|
|
@@ -2941,8 +2952,8 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
2941
2952
|
React.useEffect(() => {
|
|
2942
2953
|
setLayoutName('default');
|
|
2943
2954
|
setCapsLockOn(false);
|
|
2944
|
-
setActiveLayout(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed', showEnterKey));
|
|
2945
|
-
}, [type, Emoji, variant, showEnterKey]);
|
|
2955
|
+
setActiveLayout(getNativeLayout(type, Emoji, variant === 'native', variant === 'fixed', showEnterKey, showTypeSwitchKey));
|
|
2956
|
+
}, [type, Emoji, variant, showEnterKey, showTypeSwitchKey]);
|
|
2946
2957
|
React.useEffect(() => {
|
|
2947
2958
|
if (!Emoji && layoutName === 'emoticon') {
|
|
2948
2959
|
setLayoutName(type === 'numeric' ? 'abc' : 'default');
|
|
@@ -3184,10 +3195,12 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3184
3195
|
}
|
|
3185
3196
|
if (button === '{numbers}') {
|
|
3186
3197
|
setLayoutName('numbers');
|
|
3198
|
+
onTypeChange?.('numeric');
|
|
3187
3199
|
return;
|
|
3188
3200
|
}
|
|
3189
3201
|
if (button === '{abc}') {
|
|
3190
3202
|
setLayoutName(baseLayout);
|
|
3203
|
+
onTypeChange?.('default');
|
|
3191
3204
|
return;
|
|
3192
3205
|
}
|
|
3193
3206
|
if (button === '{alt}' || button === '{altright}') {
|
|
@@ -3242,6 +3255,7 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3242
3255
|
layoutName,
|
|
3243
3256
|
capsLockOn,
|
|
3244
3257
|
onKeyPress,
|
|
3258
|
+
onTypeChange,
|
|
3245
3259
|
Emoji,
|
|
3246
3260
|
variant,
|
|
3247
3261
|
closeAccentMenu,
|
|
@@ -3292,7 +3306,7 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3292
3306
|
'{bksp}': (baseDisplay['{bksp}'] ?? '').replace(/\s*Apagar$/, ''),
|
|
3293
3307
|
};
|
|
3294
3308
|
}, [visualType, variant]);
|
|
3295
|
-
const keyboardEl = activeLayout ? (jsxRuntime.jsxs("div", { ref: keyboardWrapperRef, className: clsx(styles$
|
|
3309
|
+
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) => {
|
|
3296
3310
|
keyboardInstanceRef.current = instance;
|
|
3297
3311
|
if (instance) {
|
|
3298
3312
|
instance.setInput(valueRef.current);
|
|
@@ -3311,17 +3325,17 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3311
3325
|
}
|
|
3312
3326
|
return reactDom.createPortal(React.createElement(Icon), slot, `icon-${key}`);
|
|
3313
3327
|
});
|
|
3314
|
-
})(), keyPreview && typeof document !== 'undefined' && reactDom.createPortal(jsxRuntime.jsx("div", { ref: keyPreviewRef, className: styles$
|
|
3328
|
+
})(), keyPreview && typeof document !== 'undefined' && reactDom.createPortal(jsxRuntime.jsx("div", { ref: keyPreviewRef, className: styles$k.keyPreview, style: {
|
|
3315
3329
|
top: keyPreview.top,
|
|
3316
3330
|
left: keyPreview.left + keyPreviewOffsetX,
|
|
3317
3331
|
width: portalSizes.preview,
|
|
3318
3332
|
height: portalSizes.preview,
|
|
3319
3333
|
...(portalSizes.fontSize ? { fontSize: portalSizes.fontSize } : {}),
|
|
3320
3334
|
}, "aria-hidden": true, children: keyPreview.char }), document.body), accentMenu && (typeof document !== 'undefined' &&
|
|
3321
|
-
reactDom.createPortal(jsxRuntime.jsx("div", { ref: accentMenuRef, className: styles$
|
|
3335
|
+
reactDom.createPortal(jsxRuntime.jsx("div", { ref: accentMenuRef, className: styles$k.accentMenu, style: {
|
|
3322
3336
|
top: accentMenu.top,
|
|
3323
3337
|
left: accentMenu.left + accentMenuOffsetX,
|
|
3324
|
-
}, role: "listbox", "aria-label": `Opcoes de acento para ${accentMenu.sourceKey}`, children: Array.from({ length: Math.ceil(accentMenu.options.length / 5) }, (_, rowIndex) => accentMenu.options.slice(rowIndex * 5, rowIndex * 5 + 5)).map((rowOptions, rowIndex) => (jsxRuntime.jsx("div", { className: styles$
|
|
3338
|
+
}, role: "listbox", "aria-label": `Opcoes de acento para ${accentMenu.sourceKey}`, children: Array.from({ length: Math.ceil(accentMenu.options.length / 5) }, (_, rowIndex) => accentMenu.options.slice(rowIndex * 5, rowIndex * 5 + 5)).map((rowOptions, rowIndex) => (jsxRuntime.jsx("div", { className: styles$k.accentMenuRow, children: rowOptions.map((option) => (jsxRuntime.jsx("button", { type: "button", className: styles$k.accentOption, style: {
|
|
3325
3339
|
minWidth: portalSizes.option,
|
|
3326
3340
|
height: portalSizes.option,
|
|
3327
3341
|
...(portalSizes.fontSize ? { fontSize: portalSizes.fontSize } : {}),
|
|
@@ -3330,12 +3344,12 @@ const VirtualKeyboard = ({ variant = 'native', type = 'default', value = '', onC
|
|
|
3330
3344
|
event.stopPropagation();
|
|
3331
3345
|
}, onClick: () => handleAccentSelect(option), children: option }, `${accentMenu.sourceKey}-${option}`))) }, rowIndex))) }), document.body))] })) : null;
|
|
3332
3346
|
if (variant === 'native' && typeof document !== 'undefined') {
|
|
3333
|
-
return reactDom.createPortal(jsxRuntime.jsx("div", { id: id, className: clsx(styles$
|
|
3347
|
+
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);
|
|
3334
3348
|
}
|
|
3335
|
-
return (jsxRuntime.jsxs("div", { id: id, className: clsx(styles$
|
|
3349
|
+
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: textFieldPlaceholder, 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] }));
|
|
3336
3350
|
};
|
|
3337
3351
|
|
|
3338
|
-
var styles$
|
|
3352
|
+
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"};
|
|
3339
3353
|
|
|
3340
3354
|
const validateInput = ({ value, maxLength, errorMessage, required }) => {
|
|
3341
3355
|
if (required && value.trim() === '') {
|
|
@@ -3347,14 +3361,14 @@ const validateInput = ({ value, maxLength, errorMessage, required }) => {
|
|
|
3347
3361
|
return '';
|
|
3348
3362
|
};
|
|
3349
3363
|
|
|
3350
|
-
var styles$
|
|
3364
|
+
var styles$i = {"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"};
|
|
3351
3365
|
|
|
3352
3366
|
const LabelComponent = ({ children, htmlFor, required = false, tooltip = false, tooltipText, side = 'bottom', align = 'start', className, error = false, disabled = false, scale = 1, }) => {
|
|
3353
3367
|
const containerStyle = {
|
|
3354
3368
|
'--giro-scale': scale,
|
|
3355
3369
|
};
|
|
3356
|
-
const container = (jsxRuntime.jsxs("div", { className: clsx(styles$
|
|
3357
|
-
styles$
|
|
3370
|
+
const container = (jsxRuntime.jsxs("div", { className: clsx(styles$i.labelContainer, disabled && styles$i.disabledContainer), style: containerStyle, children: [jsxRuntime.jsxs(radixUi.Label.Root, { className: clsx(styles$i.wrapperLabel, error && !disabled && styles$i.errorLabel, disabled && styles$i.disabledLabel, className), htmlFor: htmlFor, children: [children, required && jsxRuntime.jsx("span", { className: styles$i.requiredLabel, children: "*" })] }), tooltip && (jsxRuntime.jsx("span", { className: disabled ? styles$i.disabledIcon : error ?
|
|
3371
|
+
styles$i.errorIcon : styles$i.infoIcon, children: jsxRuntime.jsx(reactIcons.Info12Regular, {}) }))] }));
|
|
3358
3372
|
if (tooltip) {
|
|
3359
3373
|
return (jsxRuntime.jsx(Tooltip, { side: side, align: align, text: tooltipText || '', children: container }));
|
|
3360
3374
|
}
|
|
@@ -3422,19 +3436,19 @@ const TextField$1 = React.forwardRef(({ className, style, value, label, placehol
|
|
|
3422
3436
|
? `${componentId}-helper`
|
|
3423
3437
|
: undefined;
|
|
3424
3438
|
const containerStyle = { '--giro-scale': scale };
|
|
3425
|
-
const containerClass = clsx(styles$
|
|
3426
|
-
[styles$
|
|
3427
|
-
[styles$
|
|
3428
|
-
[styles$
|
|
3429
|
-
[styles$
|
|
3439
|
+
const containerClass = clsx(styles$j.container, {
|
|
3440
|
+
[styles$j.attachedToVirtualKeyboard]: attachedToVirtualKeyboard,
|
|
3441
|
+
[styles$j.disabled]: disabled,
|
|
3442
|
+
[styles$j.error]: error,
|
|
3443
|
+
[styles$j.errorWithMessage]: !!errorMessage,
|
|
3430
3444
|
[className]: className,
|
|
3431
3445
|
});
|
|
3432
|
-
return (jsxRuntime.jsxs("div", { className: containerClass, style: { ...containerStyle, ...style }, children: [label && (jsxRuntime.jsx(LabelComponent, { scale: scale, htmlFor: componentId, required: required, tooltip: tooltip, tooltipText: tooltipText, side: tooltipSide, align: tooltipAlign, error: hasError, disabled: disabled, children: label })), jsxRuntime.jsxs("div", { className: styles$
|
|
3433
|
-
[styles$
|
|
3434
|
-
}) }), showCustomIcon && jsxRuntime.jsx("span", { className: styles$
|
|
3446
|
+
return (jsxRuntime.jsxs("div", { className: containerClass, style: { ...containerStyle, ...style }, children: [label && (jsxRuntime.jsx(LabelComponent, { scale: scale, htmlFor: componentId, required: required, tooltip: tooltip, 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({
|
|
3447
|
+
[styles$j.inputWithIcon]: showCustomIcon || showClearIcon,
|
|
3448
|
+
}) }), showCustomIcon && jsxRuntime.jsx("span", { className: styles$j.icon, children: icon }), showClearIcon && (jsxRuntime.jsx("button", { type: "button", className: styles$j.clearButton, onMouseDown: (e) => {
|
|
3435
3449
|
e.preventDefault();
|
|
3436
3450
|
handleClear();
|
|
3437
|
-
}, "aria-label": "Limpar campo", tabIndex: -1, children: jsxRuntime.jsx("span", { className: styles$
|
|
3451
|
+
}, "aria-label": "Limpar campo", tabIndex: -1, children: jsxRuntime.jsx("span", { className: styles$j.clearButtonIcon, children: jsxRuntime.jsx(reactIcons.Dismiss16Regular, {}) }) }))] }), ((error && errorMessage) || inputError || helperText) && (jsxRuntime.jsx("span", { id: helperId, className: styles$j.helperText, "aria-live": hasError ? 'polite' : undefined, children: displayHelperText }))] }), (virtualKeyboard === 'default' || virtualKeyboard === 'numeric') && (jsxRuntime.jsx("div", { className: "virtualKeyboardWrapper", children: jsxRuntime.jsx(VirtualKeyboard, { variant: "native", type: virtualKeyboard, value: inputValue, maxLength: maxLength, targetRef: inputRef, onChange: (val) => {
|
|
3438
3452
|
if (!disabled && (!maxLength || val.length <= maxLength)) {
|
|
3439
3453
|
setInputValue(val);
|
|
3440
3454
|
onChange?.(val);
|
|
@@ -3444,7 +3458,7 @@ const TextField$1 = React.forwardRef(({ className, style, value, label, placehol
|
|
|
3444
3458
|
TextField$1.displayName = 'TextField';
|
|
3445
3459
|
var TextField = React.memo(TextField$1);
|
|
3446
3460
|
|
|
3447
|
-
var styles$
|
|
3461
|
+
var styles$h = {"datePicker":"DatePicker-module__datePicker___raJYg","textfieldContainer":"DatePicker-module__textfieldContainer___yy8pT","datePickerIcon":"DatePicker-module__datePickerIcon___XCZsn","datePickerIconDisabled":"DatePicker-module__datePickerIconDisabled___BB-Gx"};
|
|
3448
3462
|
|
|
3449
3463
|
function formatDate(date, locale = 'pt-br') {
|
|
3450
3464
|
if (!date || !(date instanceof Date)) {
|
|
@@ -3666,7 +3680,7 @@ const DatePicker = ({ locale = 'pt-br', calendarSide = 'bottom', calendarAlign =
|
|
|
3666
3680
|
}
|
|
3667
3681
|
}
|
|
3668
3682
|
};
|
|
3669
|
-
return (jsxRuntime.jsx("div", { ref: wrapperRef, className: clsx(styles$
|
|
3683
|
+
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) => {
|
|
3670
3684
|
handleTextFieldChange(String(e));
|
|
3671
3685
|
}, 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: () => {
|
|
3672
3686
|
handleDateChange(null);
|
|
@@ -3675,11 +3689,11 @@ const DatePicker = ({ locale = 'pt-br', calendarSide = 'bottom', calendarAlign =
|
|
|
3675
3689
|
};
|
|
3676
3690
|
var DatePicker_default = React.memo(DatePicker);
|
|
3677
3691
|
|
|
3678
|
-
var styles$
|
|
3692
|
+
var styles$g = {"DialogOverlay":"Dialog-module__DialogOverlay___LEX2O","DialogContent":"Dialog-module__DialogContent___ziVXb","DialogTitle":"Dialog-module__DialogTitle___ay1tD","DialogDescription":"Dialog-module__DialogDescription___odslw","DivButtons":"Dialog-module__DivButtons___BiwX-"};
|
|
3679
3693
|
|
|
3680
|
-
const Dialog = ({ show = false, title, bodyContent, textPrimaryAction, textSecondaryAction, onPrimaryAction, onSecondaryAction, className, ...rest }) => (jsxRuntime.jsx(radixUi.AlertDialog.Root, { open: show, ...rest, children: jsxRuntime.jsxs(radixUi.AlertDialog.Portal, { children: [jsxRuntime.jsx(radixUi.AlertDialog.Overlay, { className: styles$
|
|
3694
|
+
const Dialog = ({ show = false, title, bodyContent, textPrimaryAction, textSecondaryAction, onPrimaryAction, onSecondaryAction, className, ...rest }) => (jsxRuntime.jsx(radixUi.AlertDialog.Root, { open: show, ...rest, children: jsxRuntime.jsxs(radixUi.AlertDialog.Portal, { children: [jsxRuntime.jsx(radixUi.AlertDialog.Overlay, { className: styles$g.DialogOverlay }), jsxRuntime.jsxs(radixUi.AlertDialog.Content, { className: clsx(styles$g.DialogContent, className), children: [jsxRuntime.jsx(radixUi.AlertDialog.Title, { className: styles$g.DialogTitle, children: title }), jsxRuntime.jsx(radixUi.AlertDialog.Description, { className: styles$g.DialogDescription, children: bodyContent }), jsxRuntime.jsxs("div", { className: styles$g.DivButtons, children: [!!(textSecondaryAction && textSecondaryAction.trim()) && (jsxRuntime.jsx(radixUi.AlertDialog.Cancel, { asChild: true, children: jsxRuntime.jsx(Button, { variant: "outlined", ...(onSecondaryAction && { onClick: onSecondaryAction }), children: textSecondaryAction }) })), jsxRuntime.jsx(radixUi.AlertDialog.Action, { asChild: true, children: jsxRuntime.jsx(Button, { variant: "filled", ...(onPrimaryAction && { onClick: onPrimaryAction }), children: textPrimaryAction }) })] })] })] }) }));
|
|
3681
3695
|
|
|
3682
|
-
var styles$
|
|
3696
|
+
var styles$f = {"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"};
|
|
3683
3697
|
|
|
3684
3698
|
const Drawer = ({ children, headerContent, footer, customWidth = '400px', onClose, title = 'Título', isOpen = false, onOpen, className, id, disabled = false, onOverlayClick, closeOnOverlayClick = true, closeOnEscape = true, ...rest }) => {
|
|
3685
3699
|
const internalClose = React.useCallback(() => {
|
|
@@ -3728,15 +3742,185 @@ const Drawer = ({ children, headerContent, footer, customWidth = '400px', onClos
|
|
|
3728
3742
|
event.stopPropagation();
|
|
3729
3743
|
internalClose();
|
|
3730
3744
|
};
|
|
3731
|
-
return reactDom.createPortal(jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: clsx(styles$
|
|
3732
|
-
[styles$
|
|
3733
|
-
}), onClick: handleOverlayClick, role: "presentation", "aria-hidden": "true", "data-testid": "drawer-overlay" }), jsxRuntime.jsxs("div", { className: clsx(styles$
|
|
3734
|
-
[styles$
|
|
3735
|
-
[styles$
|
|
3745
|
+
return reactDom.createPortal(jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: clsx(styles$f['drawerShadow'], {
|
|
3746
|
+
[styles$f['drawerShadow--visible']]: isOpen,
|
|
3747
|
+
}), onClick: handleOverlayClick, role: "presentation", "aria-hidden": "true", "data-testid": "drawer-overlay" }), jsxRuntime.jsxs("div", { className: clsx(styles$f['drawerSidebar'], {
|
|
3748
|
+
[styles$f['drawerSidebar--open']]: isOpen,
|
|
3749
|
+
[styles$f['drawerSidebar--disabled']]: disabled,
|
|
3736
3750
|
}, className), style: {
|
|
3737
3751
|
'--drawer-custom-width': customWidth,
|
|
3738
|
-
}, 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: [jsxRuntime.jsxs("div", { className: styles$
|
|
3752
|
+
}, 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: [jsxRuntime.jsxs("div", { className: styles$f.drawerTitleClose, children: [jsxRuntime.jsx("div", { className: styles$f.drawerTitle, id: id ? `${id}-title` : 'drawer-title', children: title }), headerContent && (jsxRuntime.jsx("div", { className: styles$f.drawerHeaderContent, children: headerContent })), jsxRuntime.jsx(Button, { onClick: handleCloseClick, variant: 'outlined', iconOnly: true, icon: jsxRuntime.jsx(reactIcons.Dismiss16Regular, {}), size: 'lg', tooltipText: 'Fechar' })] }), jsxRuntime.jsx("div", { className: styles$f.drawerChildren, "data-testid": "drawer-content", children: children }), footer] })] }), document.body);
|
|
3753
|
+
};
|
|
3754
|
+
|
|
3755
|
+
var styles$e = {"container":"FileUpload-module__container___hFeKV","dropZone":"FileUpload-module__dropZone___716hF","disabled":"FileUpload-module__disabled___mwePo","alert":"FileUpload-module__alert___Dnzqc","dragging":"FileUpload-module__dragging___XZghy","emptyState":"FileUpload-module__emptyState___6Ll9D","uploadIcon":"FileUpload-module__uploadIcon___MkBLe","uploadText":"FileUpload-module__uploadText___VWc9g","alertIcon":"FileUpload-module__alertIcon___pTaMS","alertText":"FileUpload-module__alertText___sfV4z","fileList":"FileUpload-module__fileList___K6KQD","thumb":"FileUpload-module__thumb___eg59D","removeButton":"FileUpload-module__removeButton___jUFNv","thumbClip":"FileUpload-module__thumbClip___sP9wp","thumbImage":"FileUpload-module__thumbImage___Swxhd","thumbFile":"FileUpload-module__thumbFile___y7lg5","thumbFileName":"FileUpload-module__thumbFileName___LPSCX","helperText":"FileUpload-module__helperText___DzPqP","errorText":"FileUpload-module__errorText___cHd1Z"};
|
|
3756
|
+
|
|
3757
|
+
const truncateFileName = (fileName, maxChars = 18) => {
|
|
3758
|
+
if (fileName.length <= maxChars)
|
|
3759
|
+
return fileName;
|
|
3760
|
+
const lastDot = fileName.lastIndexOf('.');
|
|
3761
|
+
const hasExtension = lastDot > 0 && lastDot < fileName.length - 1;
|
|
3762
|
+
const baseName = hasExtension ? fileName.substring(0, lastDot) : fileName;
|
|
3763
|
+
const extension = hasExtension ? fileName.substring(lastDot) : '';
|
|
3764
|
+
const reserved = 3 + extension.length; // "..."
|
|
3765
|
+
const available = maxChars - reserved;
|
|
3766
|
+
if (available <= 1) {
|
|
3767
|
+
return fileName.substring(0, maxChars - 3) + '...';
|
|
3768
|
+
}
|
|
3769
|
+
return baseName.substring(0, available) + '...' + extension;
|
|
3770
|
+
};
|
|
3771
|
+
const matchesAccept = (file, accept) => {
|
|
3772
|
+
if (!accept)
|
|
3773
|
+
return true;
|
|
3774
|
+
const types = accept.split(',').map((t) => t.trim().toLowerCase());
|
|
3775
|
+
const fileName = file.name.toLowerCase();
|
|
3776
|
+
const fileType = file.type.toLowerCase();
|
|
3777
|
+
return types.some((type) => {
|
|
3778
|
+
if (type.startsWith('.')) {
|
|
3779
|
+
return fileName.endsWith(type);
|
|
3780
|
+
}
|
|
3781
|
+
if (type.endsWith('/*')) {
|
|
3782
|
+
return fileType.startsWith(type.slice(0, -1));
|
|
3783
|
+
}
|
|
3784
|
+
return fileType === type;
|
|
3785
|
+
});
|
|
3739
3786
|
};
|
|
3787
|
+
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) => {
|
|
3788
|
+
const generatedId = React.useId();
|
|
3789
|
+
const componentId = id || generatedId;
|
|
3790
|
+
const helperId = `${componentId}-helper`;
|
|
3791
|
+
const listId = `${componentId}-list`;
|
|
3792
|
+
const inputRef = React.useRef(null);
|
|
3793
|
+
const [internalFiles, setInternalFiles] = React.useState([]);
|
|
3794
|
+
const [isDragging, setIsDragging] = React.useState(false);
|
|
3795
|
+
const [objectUrls, setObjectUrls] = React.useState(new Map());
|
|
3796
|
+
const [internalError, setInternalError] = React.useState(null);
|
|
3797
|
+
const isControlled = value !== undefined;
|
|
3798
|
+
const files = isControlled ? value : internalFiles;
|
|
3799
|
+
React.useEffect(() => {
|
|
3800
|
+
return () => {
|
|
3801
|
+
objectUrls.forEach((url) => URL.revokeObjectURL(url));
|
|
3802
|
+
};
|
|
3803
|
+
}, [objectUrls]);
|
|
3804
|
+
const getObjectUrl = React.useCallback((file) => {
|
|
3805
|
+
const key = `${file.name}-${file.size}`;
|
|
3806
|
+
const existing = objectUrls.get(key);
|
|
3807
|
+
if (existing)
|
|
3808
|
+
return existing;
|
|
3809
|
+
const url = URL.createObjectURL(file);
|
|
3810
|
+
setObjectUrls((prev) => new Map(prev).set(key, url));
|
|
3811
|
+
return url;
|
|
3812
|
+
}, [objectUrls]);
|
|
3813
|
+
const revokeUrl = React.useCallback((file) => {
|
|
3814
|
+
const key = `${file.name}-${file.size}`;
|
|
3815
|
+
setObjectUrls((prev) => {
|
|
3816
|
+
const next = new Map(prev);
|
|
3817
|
+
const url = next.get(key);
|
|
3818
|
+
if (url)
|
|
3819
|
+
URL.revokeObjectURL(url);
|
|
3820
|
+
next.delete(key);
|
|
3821
|
+
return next;
|
|
3822
|
+
});
|
|
3823
|
+
}, []);
|
|
3824
|
+
const processFiles = React.useCallback((incoming) => {
|
|
3825
|
+
if (disabled)
|
|
3826
|
+
return;
|
|
3827
|
+
const all = Array.from(incoming);
|
|
3828
|
+
const validFiles = all.filter((file) => {
|
|
3829
|
+
if (maxFileSize && file.size > maxFileSize)
|
|
3830
|
+
return false;
|
|
3831
|
+
if (!matchesAccept(file, accept))
|
|
3832
|
+
return false;
|
|
3833
|
+
return true;
|
|
3834
|
+
});
|
|
3835
|
+
const merged = multiple
|
|
3836
|
+
? [...files, ...validFiles]
|
|
3837
|
+
: validFiles.slice(0, 1);
|
|
3838
|
+
const limited = maxFilesQuantity && multiple ? merged.slice(0, maxFilesQuantity) : merged;
|
|
3839
|
+
// Prioridade de erro: tipo > tamanho > quantidade
|
|
3840
|
+
const hasTypeError = all.some((file) => !matchesAccept(file, accept));
|
|
3841
|
+
const hasSizeError = all.some((file) => maxFileSize && file.size > maxFileSize);
|
|
3842
|
+
const hasQuantityError = maxFilesQuantity && multiple && merged.length > maxFilesQuantity;
|
|
3843
|
+
if (hasTypeError && hasSizeError) {
|
|
3844
|
+
setInternalError('Um ou mais arquivos possuem tipo ou tamanho inválido.');
|
|
3845
|
+
}
|
|
3846
|
+
else if (hasTypeError) {
|
|
3847
|
+
setInternalError('Um ou mais arquivos não são do tipo aceito.');
|
|
3848
|
+
}
|
|
3849
|
+
else if (hasSizeError) {
|
|
3850
|
+
setInternalError('Um ou mais arquivos excedem o tamanho máximo permitido.');
|
|
3851
|
+
}
|
|
3852
|
+
else if (hasQuantityError) {
|
|
3853
|
+
setInternalError(`Não é possível adicionar mais de ${maxFilesQuantity} arquivo(s).`);
|
|
3854
|
+
}
|
|
3855
|
+
else {
|
|
3856
|
+
setInternalError(null);
|
|
3857
|
+
}
|
|
3858
|
+
if (!isControlled)
|
|
3859
|
+
setInternalFiles(limited);
|
|
3860
|
+
onChange?.(limited);
|
|
3861
|
+
}, [disabled, files, isControlled, maxFilesQuantity, maxFileSize, multiple, onChange, accept]);
|
|
3862
|
+
const handleInputChange = React.useCallback((e) => {
|
|
3863
|
+
if (e.target.files) {
|
|
3864
|
+
processFiles(e.target.files);
|
|
3865
|
+
e.target.value = '';
|
|
3866
|
+
}
|
|
3867
|
+
}, [processFiles]);
|
|
3868
|
+
const handleClick = React.useCallback(() => {
|
|
3869
|
+
if (!disabled)
|
|
3870
|
+
inputRef.current?.click();
|
|
3871
|
+
}, [disabled]);
|
|
3872
|
+
const handleKeyDown = React.useCallback((e) => {
|
|
3873
|
+
if (!disabled && (e.key === 'Enter' || e.key === ' ')) {
|
|
3874
|
+
e.preventDefault();
|
|
3875
|
+
inputRef.current?.click();
|
|
3876
|
+
}
|
|
3877
|
+
}, [disabled]);
|
|
3878
|
+
const handleDragOver = React.useCallback((e) => {
|
|
3879
|
+
e.preventDefault();
|
|
3880
|
+
if (!disabled)
|
|
3881
|
+
setIsDragging(true);
|
|
3882
|
+
}, [disabled]);
|
|
3883
|
+
const handleDragLeave = React.useCallback((e) => {
|
|
3884
|
+
e.preventDefault();
|
|
3885
|
+
setIsDragging(false);
|
|
3886
|
+
}, []);
|
|
3887
|
+
const handleDrop = React.useCallback((e) => {
|
|
3888
|
+
e.preventDefault();
|
|
3889
|
+
setIsDragging(false);
|
|
3890
|
+
if (!disabled && e.dataTransfer.files.length > 0) {
|
|
3891
|
+
processFiles(e.dataTransfer.files);
|
|
3892
|
+
}
|
|
3893
|
+
}, [disabled, processFiles]);
|
|
3894
|
+
const handleRemove = React.useCallback((e, index) => {
|
|
3895
|
+
e.stopPropagation();
|
|
3896
|
+
const removed = files[index];
|
|
3897
|
+
revokeUrl(removed);
|
|
3898
|
+
const updated = files.filter((_, i) => i !== index);
|
|
3899
|
+
if (!isControlled)
|
|
3900
|
+
setInternalFiles(updated);
|
|
3901
|
+
onChange?.(updated);
|
|
3902
|
+
}, [files, isControlled, onChange, revokeUrl]);
|
|
3903
|
+
const hasFiles = files.length > 0;
|
|
3904
|
+
const isError = error || !!errorMessage || !!internalError;
|
|
3905
|
+
const displayedHelper = isError ? errorMessage || internalError || helperText : helperText;
|
|
3906
|
+
const setRefs = React.useCallback((node) => {
|
|
3907
|
+
inputRef.current = node;
|
|
3908
|
+
if (typeof ref === 'function')
|
|
3909
|
+
ref(node);
|
|
3910
|
+
else if (ref)
|
|
3911
|
+
ref.current = node;
|
|
3912
|
+
}, [ref]);
|
|
3913
|
+
return (jsxRuntime.jsxs("div", { id: componentId, className: clsx(styles$e.container, className), children: [jsxRuntime.jsx("input", { ref: setRefs, type: "file", accept: accept, multiple: multiple, disabled: disabled, "aria-hidden": "true", tabIndex: -1, style: { display: 'none' }, onChange: handleInputChange, ...rest }), jsxRuntime.jsxs("div", { role: "button", tabIndex: disabled ? -1 : 0, "aria-label": description, "aria-disabled": disabled, "aria-describedby": displayedHelper ? helperId : undefined, "aria-controls": hasFiles ? listId : undefined, "data-invalid": isError || undefined, className: clsx(styles$e.dropZone, isDragging && styles$e.dragging, isError && styles$e.alert, disabled && styles$e.disabled), onClick: handleClick, onKeyDown: handleKeyDown, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, children: [!hasFiles && !isError && (jsxRuntime.jsxs("div", { className: styles$e.emptyState, "aria-hidden": "true", children: [jsxRuntime.jsx("span", { className: styles$e.uploadIcon, children: jsxRuntime.jsx(reactIcons.DocumentAdd24Regular, {}) }), jsxRuntime.jsx("span", { className: styles$e.uploadText, children: description })] })), !hasFiles && isError && (jsxRuntime.jsxs("div", { className: styles$e.emptyState, "aria-hidden": "true", children: [jsxRuntime.jsx("span", { className: styles$e.alertIcon, children: jsxRuntime.jsx(reactIcons.Warning24Regular, {}) }), descriptionErrorMessage && (jsxRuntime.jsx("span", { className: styles$e.alertText, children: descriptionErrorMessage }))] })), hasFiles && (jsxRuntime.jsx("ul", { id: listId, className: styles$e.fileList, "aria-label": `${files.length} arquivo${files.length !== 1 ? 's' : ''} selecionado${files.length !== 1 ? 's' : ''}`, "aria-live": "polite", children: files.map((file, index) => {
|
|
3914
|
+
const isImage = file.type.startsWith('image/');
|
|
3915
|
+
return (jsxRuntime.jsxs("li", { className: styles$e.thumb, children: [jsxRuntime.jsx("div", { className: styles$e.thumbClip, children: isImage ? (jsxRuntime.jsx("img", { src: getObjectUrl(file), alt: file.name, title: file.name, className: styles$e.thumbImage })) : (jsxRuntime.jsxs("div", { className: styles$e.thumbFile, "aria-hidden": "true", title: file.name, children: [jsxRuntime.jsx(reactIcons.Document24Regular, {}), jsxRuntime.jsx("span", { className: styles$e.thumbFileName, children: truncateFileName(file.name) })] })) }), jsxRuntime.jsx("button", { type: "button", className: styles$e.removeButton, "aria-label": `Remover ${file.name}`, disabled: disabled, onClick: (e) => handleRemove(e, index), onKeyDown: (e) => {
|
|
3916
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
3917
|
+
e.preventDefault();
|
|
3918
|
+
handleRemove(e, index);
|
|
3919
|
+
}
|
|
3920
|
+
}, children: jsxRuntime.jsx(reactIcons.Dismiss16Regular, { "aria-hidden": "true" }) })] }, `${file.name}-${index}`));
|
|
3921
|
+
}) }))] }), displayedHelper && (jsxRuntime.jsx("span", { id: helperId, role: isError ? 'alert' : undefined, className: clsx(styles$e.helperText, isError && styles$e.errorText), children: displayedHelper }))] }));
|
|
3922
|
+
});
|
|
3923
|
+
FileUpload.displayName = 'FileUpload';
|
|
3740
3924
|
|
|
3741
3925
|
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"};
|
|
3742
3926
|
|
|
@@ -4311,9 +4495,9 @@ const Menu = ({ items, children, onItemSelect, search, enableInfiniteScroll, onS
|
|
|
4311
4495
|
}, ...rest, children: [search && (jsxRuntime.jsx("div", { className: styles$9.searchWrapper, children: jsxRuntime.jsx(Search, { placeholder: "Buscar", onChange: handleSearchChange, value: searchInput, onKeyDown: handleSearchKeyDown }) })), jsxRuntime.jsxs("div", { className: styles$9.itemsWrapper, ref: itemsWrapperRef, style: { maxHeight: maxHeightStyle }, children: [filteredItems.length > 0 ? (filteredItems.map((item, index) => renderMenuItem(item, item.value || item.text || `item-${index}`))) : (jsxRuntime.jsx("div", { className: styles$9.emptyState, children: "Nenhum item encontrado" })), enableInfiniteScroll && isLoadingMore && (jsxRuntime.jsx("div", { className: styles$9.loadingMore, children: "Carregando mais itens..." })), enableInfiniteScroll && (jsxRuntime.jsx("div", { ref: sentinelRef, "data-scroll-sentinel": true, style: { height: '1px', visibility: 'hidden' } }))] })] }) })] }));
|
|
4312
4496
|
};
|
|
4313
4497
|
|
|
4314
|
-
var styles$8 = {"modalOverlay":"Modal-module__modalOverlay___rI8Wz","modalContent":"Modal-module__modalContent___6Cgb1","modalContent--fullscreen":"Modal-module__modalContent--fullscreen___QeBlG","modalHeader":"Modal-module__modalHeader___IuHIg","modalTitle":"Modal-module__modalTitle___9VDmr","modalBody":"Modal-module__modalBody___ohjQm"};
|
|
4498
|
+
var styles$8 = {"modalOverlay":"Modal-module__modalOverlay___rI8Wz","modalContent":"Modal-module__modalContent___6Cgb1","modalContent--fullscreen":"Modal-module__modalContent--fullscreen___QeBlG","modalHeader":"Modal-module__modalHeader___IuHIg","modalTitle":"Modal-module__modalTitle___9VDmr","modalBody":"Modal-module__modalBody___ohjQm","modalFooter":"Modal-module__modalFooter___TEqdK"};
|
|
4315
4499
|
|
|
4316
|
-
const Modal = ({ isOpen = false, onClose, title, children, headerContent, closeOnOverlayClick = true, className, id, footer, customWidth, fullscreen = false, ...rest }) => {
|
|
4500
|
+
const Modal = ({ isOpen = false, onClose, title, children, headerContent, closeOnOverlayClick = true, className, id, footer, customWidth, customHeight, fullscreen = false, ...rest }) => {
|
|
4317
4501
|
const contentRef = React__namespace.useRef(null);
|
|
4318
4502
|
const handleOpenChange = (open) => {
|
|
4319
4503
|
if (!open) {
|
|
@@ -4326,7 +4510,8 @@ const Modal = ({ isOpen = false, onClose, title, children, headerContent, closeO
|
|
|
4326
4510
|
};
|
|
4327
4511
|
return (jsxRuntime.jsx(radixUi.Dialog.Root, { open: isOpen, onOpenChange: handleOpenChange, ...rest, children: jsxRuntime.jsxs(radixUi.Dialog.Portal, { children: [jsxRuntime.jsx(radixUi.Dialog.Overlay, { className: styles$8.modalOverlay }), jsxRuntime.jsxs(radixUi.Dialog.Content, { ref: contentRef, className: clsx(styles$8.modalContent, fullscreen && styles$8['modalContent--fullscreen'], className), id: id, style: {
|
|
4328
4512
|
'--modal-custom-width': customWidth,
|
|
4329
|
-
|
|
4513
|
+
'--modal-custom-height': customHeight,
|
|
4514
|
+
}, onInteractOutside: !closeOnOverlayClick ? (e) => e.preventDefault() : undefined, onOpenAutoFocus: handleOpenAutoFocus, "aria-labelledby": id ? `${id}-title` : 'modal-title', tabIndex: -1, children: [jsxRuntime.jsxs("header", { className: styles$8.modalHeader, children: [title && (jsxRuntime.jsx(radixUi.Dialog.Title, { className: styles$8.modalTitle, id: id ? `${id}-title` : 'modal-title', children: title })), headerContent && (jsxRuntime.jsx("div", { children: headerContent })), jsxRuntime.jsx(radixUi.Dialog.Close, { asChild: true, children: jsxRuntime.jsx(Button, { variant: "outlined", iconOnly: true, icon: jsxRuntime.jsx(reactIcons.Dismiss16Regular, {}), size: "lg", tooltipText: 'Fechar' }) })] }), jsxRuntime.jsx("section", { className: styles$8.modalBody, children: children }), footer && (jsxRuntime.jsx("footer", { className: styles$8.modalFooter, children: footer }))] })] }) }));
|
|
4330
4515
|
};
|
|
4331
4516
|
|
|
4332
4517
|
var styles$7 = {"quantity":"Quantity-module__quantity___-vndR","quantityInput":"Quantity-module__quantityInput___xZG-v","disabled":"Quantity-module__disabled___X6p5l"};
|
|
@@ -5637,123 +5822,11 @@ const Switch = ({ disabled = false, defaultChecked = false, checked, onCheckedCh
|
|
|
5637
5822
|
return (jsxRuntime.jsx("div", { className: clsx(styles$1.container, className), style: { '--giro-scale': scale, ...style }, children: jsxRuntime.jsx(radixUi.Switch.Root, { className: styles$1.switchRoot, disabled: disabled, defaultChecked: defaultChecked, checked: checked, onCheckedChange: onCheckedChange, ...rest, children: jsxRuntime.jsx(radixUi.Switch.Thumb, { className: styles$1.switchThumb }) }) }));
|
|
5638
5823
|
};
|
|
5639
5824
|
|
|
5640
|
-
var styles = {"
|
|
5825
|
+
var styles = {"container":"VerificationCode-module__container___5Kxo6","inputGroup":"VerificationCode-module__inputGroup___ose3E","input":"VerificationCode-module__input___Vu-jM","inputError":"VerificationCode-module__inputError___gI-Bl","inputDisabled":"VerificationCode-module__inputDisabled___wUj2Y","errorMessage":"VerificationCode-module__errorMessage___NnYtO"};
|
|
5641
5826
|
|
|
5642
|
-
|
|
5643
|
-
* Mapa de regex para validação dos tipos de entrada
|
|
5644
|
-
*/
|
|
5645
|
-
const REGEX_MAP = {
|
|
5646
|
-
numeric: /^[0-9]$/,
|
|
5647
|
-
alpha: /^[a-zA-Z]$/,
|
|
5648
|
-
alphanumeric: /^[a-zA-Z0-9]$/,
|
|
5649
|
-
};
|
|
5650
|
-
/**
|
|
5651
|
-
* Componente VerificationCode para entrada de códigos de verificação
|
|
5652
|
-
*
|
|
5653
|
-
* @description Permite entrada de códigos com múltiplos dígitos,
|
|
5654
|
-
* suportando diferentes tipos de caracteres e navegação por teclado.
|
|
5655
|
-
*
|
|
5656
|
-
* @example
|
|
5657
|
-
* ```tsx
|
|
5658
|
-
* <VerificationCode
|
|
5659
|
-
* length={6}
|
|
5660
|
-
* inputType="numeric"
|
|
5661
|
-
* onComplete={(code) => console.log('Código:', code)}
|
|
5662
|
-
* hasError={false}
|
|
5663
|
-
* />
|
|
5664
|
-
* ```
|
|
5665
|
-
*/
|
|
5666
|
-
const VerificationCode = ({ length = 6, inputType = 'numeric', onComplete, hasError = false, errorMessage, disabled = false, className, ...rest }) => {
|
|
5827
|
+
const VerificationCode = ({ length = 6, validationType = 'numeric', value, defaultValue, onValueChange, autoSubmit = false, onAutoSubmit, name, form, hasError = false, errorMessage, disabled = false, readOnly = false, className, id, }) => {
|
|
5667
5828
|
const validLength = Math.min(Math.max(length, 1), 100);
|
|
5668
|
-
|
|
5669
|
-
const inputsRef = React.useRef([]);
|
|
5670
|
-
const currentRegex = REGEX_MAP[inputType] || REGEX_MAP.numeric;
|
|
5671
|
-
React.useEffect(() => {
|
|
5672
|
-
setValues(Array(validLength).fill(''));
|
|
5673
|
-
}, [inputType, validLength]);
|
|
5674
|
-
const handleChange = React.useCallback((index, value) => {
|
|
5675
|
-
if (!currentRegex.test(value))
|
|
5676
|
-
return;
|
|
5677
|
-
const newValues = [...values];
|
|
5678
|
-
newValues[index] = value;
|
|
5679
|
-
setValues(newValues);
|
|
5680
|
-
if (value && index < validLength - 1) {
|
|
5681
|
-
inputsRef.current[index + 1]?.focus();
|
|
5682
|
-
}
|
|
5683
|
-
if (newValues.every(v => v !== '')) {
|
|
5684
|
-
onComplete?.(newValues.join(''));
|
|
5685
|
-
}
|
|
5686
|
-
}, [values, currentRegex, onComplete, validLength]);
|
|
5687
|
-
const handlePaste = React.useCallback((e) => {
|
|
5688
|
-
e.preventDefault();
|
|
5689
|
-
const pasteData = e.clipboardData.getData('Text');
|
|
5690
|
-
const valuesToPaste = pasteData.split('').slice(0, validLength);
|
|
5691
|
-
const newValues = [...values];
|
|
5692
|
-
valuesToPaste.forEach((value, index) => {
|
|
5693
|
-
if (currentRegex.test(value)) {
|
|
5694
|
-
newValues[index] = value;
|
|
5695
|
-
}
|
|
5696
|
-
});
|
|
5697
|
-
setValues(newValues);
|
|
5698
|
-
const firstEmptyIndex = newValues.findIndex(v => v === '');
|
|
5699
|
-
const focusIndex = firstEmptyIndex === -1 ? validLength - 1 : firstEmptyIndex;
|
|
5700
|
-
inputsRef.current[focusIndex]?.focus();
|
|
5701
|
-
if (newValues.every(v => v !== '')) {
|
|
5702
|
-
onComplete?.(newValues.join(''));
|
|
5703
|
-
}
|
|
5704
|
-
}, [values, currentRegex, onComplete, validLength]);
|
|
5705
|
-
const handleKeyDown = React.useCallback((index, e) => {
|
|
5706
|
-
if (e.key === 'Backspace') {
|
|
5707
|
-
e.preventDefault();
|
|
5708
|
-
const newValues = [...values];
|
|
5709
|
-
if (values[index]) {
|
|
5710
|
-
newValues[index] = '';
|
|
5711
|
-
setValues(newValues);
|
|
5712
|
-
}
|
|
5713
|
-
else if (index > 0) {
|
|
5714
|
-
inputsRef.current[index - 1]?.focus();
|
|
5715
|
-
newValues[index - 1] = '';
|
|
5716
|
-
setValues(newValues);
|
|
5717
|
-
}
|
|
5718
|
-
}
|
|
5719
|
-
if (e.key === 'Delete') {
|
|
5720
|
-
e.preventDefault();
|
|
5721
|
-
const newValues = [...values];
|
|
5722
|
-
newValues[index] = '';
|
|
5723
|
-
setValues(newValues);
|
|
5724
|
-
if (index < validLength - 1) {
|
|
5725
|
-
inputsRef.current[index + 1]?.focus();
|
|
5726
|
-
}
|
|
5727
|
-
}
|
|
5728
|
-
if (e.key === 'ArrowLeft' && index > 0) {
|
|
5729
|
-
e.preventDefault();
|
|
5730
|
-
inputsRef.current[index - 1]?.focus();
|
|
5731
|
-
}
|
|
5732
|
-
if (e.key === 'ArrowRight' && index < validLength - 1) {
|
|
5733
|
-
e.preventDefault();
|
|
5734
|
-
inputsRef.current[index + 1]?.focus();
|
|
5735
|
-
}
|
|
5736
|
-
}, [values, validLength]);
|
|
5737
|
-
const handleKeyUp = React.useCallback((index, e) => {
|
|
5738
|
-
if (e.key === 'Enter') {
|
|
5739
|
-
e.preventDefault();
|
|
5740
|
-
if (values[index] && index < validLength - 1) {
|
|
5741
|
-
inputsRef.current[index + 1]?.focus();
|
|
5742
|
-
}
|
|
5743
|
-
else if (values[index] && index === validLength - 1) {
|
|
5744
|
-
inputsRef.current[index]?.blur();
|
|
5745
|
-
}
|
|
5746
|
-
}
|
|
5747
|
-
}, [values, validLength]);
|
|
5748
|
-
const handleFocus = React.useCallback((e) => {
|
|
5749
|
-
e.target.select();
|
|
5750
|
-
}, []);
|
|
5751
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: clsx(styles['zds-verification-code__container'], className), ...rest, children: values.map((val, i) => (jsxRuntime.jsx("input", { id: `zds-verification-code__element-${i}`, ref: (el) => {
|
|
5752
|
-
inputsRef.current[i] = el;
|
|
5753
|
-
}, type: "text", inputMode: inputType === 'numeric' ? 'numeric' : 'text', maxLength: 1, value: val, onChange: (e) => handleChange(i, e.target.value), onKeyDown: (e) => handleKeyDown(i, e), onKeyUp: (e) => handleKeyUp(i, e), onPaste: i === 0 ? handlePaste : undefined, onFocus: handleFocus, disabled: disabled, className: clsx(styles['zds-verification-code__input'], {
|
|
5754
|
-
[styles['zds-verification-code__has-error']]: hasError,
|
|
5755
|
-
[styles['zds-verification-code__filled']]: val,
|
|
5756
|
-
}), "aria-invalid": hasError, "aria-label": `Dígito ${i + 1} de ${validLength}`, "aria-describedby": hasError && errorMessage ? 'verification-code-error' : undefined, autoComplete: "one-time-code" }, i))) }), hasError && errorMessage && (jsxRuntime.jsx("div", { id: "verification-code-error", className: styles['zds-verification-code__error'], role: "alert", "aria-live": "assertive", children: errorMessage }))] }));
|
|
5829
|
+
return (jsxRuntime.jsxs("div", { id: id, className: clsx(styles.container, className), children: [jsxRuntime.jsxs(radixUi.unstable_OneTimePasswordField.Root, { className: styles.inputGroup, validationType: validationType, value: value, defaultValue: defaultValue, onValueChange: onValueChange, autoSubmit: autoSubmit, onAutoSubmit: onAutoSubmit, name: name, form: form, disabled: disabled, readOnly: readOnly, "data-error": hasError || undefined, children: [Array.from({ length: validLength }, (_, i) => (jsxRuntime.jsx(radixUi.unstable_OneTimePasswordField.Input, { className: clsx(styles.input, hasError && styles.inputError, disabled && styles.inputDisabled) }, i))), jsxRuntime.jsx(radixUi.unstable_OneTimePasswordField.HiddenInput, {})] }), hasError && errorMessage && (jsxRuntime.jsx("span", { className: styles.errorMessage, children: errorMessage }))] }));
|
|
5757
5830
|
};
|
|
5758
5831
|
|
|
5759
5832
|
function useApiSimulation(config = {}) {
|
|
@@ -6067,6 +6140,7 @@ exports.Container = Container;
|
|
|
6067
6140
|
exports.DatePicker = DatePicker_default;
|
|
6068
6141
|
exports.Dialog = Dialog;
|
|
6069
6142
|
exports.Drawer = Drawer;
|
|
6143
|
+
exports.FileUpload = FileUpload;
|
|
6070
6144
|
exports.Filter = Filter;
|
|
6071
6145
|
exports.ListItem = ListItem;
|
|
6072
6146
|
exports.Menu = Menu;
|