@wellingtonhlc/shared-ui 0.29.0 → 0.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/README.md +25 -10
  2. package/dist/cli/check-page-actions.d.ts +9 -0
  3. package/dist/cli/check-page-actions.d.ts.map +1 -0
  4. package/dist/cli/check-page-actions.js +108 -0
  5. package/dist/components/ActionBar.d.ts +26 -0
  6. package/dist/components/ActionBar.d.ts.map +1 -0
  7. package/dist/components/ActionBar.js +29 -0
  8. package/dist/components/ActionPrimitives.d.ts +31 -0
  9. package/dist/components/ActionPrimitives.d.ts.map +1 -0
  10. package/dist/components/ActionPrimitives.js +27 -0
  11. package/dist/components/AppShell.d.ts +65 -0
  12. package/dist/components/AppShell.d.ts.map +1 -0
  13. package/dist/components/AppShell.js +50 -0
  14. package/dist/components/AppShellActions.d.ts +24 -0
  15. package/dist/components/AppShellActions.d.ts.map +1 -0
  16. package/dist/components/AppShellActions.js +15 -0
  17. package/dist/components/Badge.d.ts +16 -0
  18. package/dist/components/Badge.d.ts.map +1 -0
  19. package/dist/components/Badge.js +36 -0
  20. package/dist/components/Banner.d.ts +13 -0
  21. package/dist/components/Banner.d.ts.map +1 -0
  22. package/dist/components/Banner.js +29 -0
  23. package/dist/components/Button.d.ts +14 -0
  24. package/dist/components/Button.d.ts.map +1 -0
  25. package/dist/components/Button.js +39 -0
  26. package/dist/components/Card.d.ts +36 -0
  27. package/dist/components/Card.d.ts.map +1 -0
  28. package/dist/components/Card.js +56 -0
  29. package/dist/components/ConfirmationDialog.d.ts +74 -0
  30. package/dist/components/ConfirmationDialog.d.ts.map +1 -0
  31. package/dist/components/ConfirmationDialog.js +234 -0
  32. package/dist/components/CopyableField.d.ts +10 -0
  33. package/dist/components/CopyableField.d.ts.map +1 -0
  34. package/dist/components/CopyableField.js +60 -0
  35. package/dist/components/DateField.d.ts +20 -0
  36. package/dist/components/DateField.d.ts.map +1 -0
  37. package/dist/components/DateField.js +172 -0
  38. package/dist/components/DecimalField.d.ts +21 -0
  39. package/dist/components/DecimalField.d.ts.map +1 -0
  40. package/dist/components/DecimalField.js +137 -0
  41. package/dist/components/DismissiblePopover.d.ts +14 -0
  42. package/dist/components/DismissiblePopover.d.ts.map +1 -0
  43. package/dist/components/DismissiblePopover.js +51 -0
  44. package/dist/components/EmptyState.d.ts +15 -0
  45. package/dist/components/EmptyState.d.ts.map +1 -0
  46. package/dist/components/EmptyState.js +32 -0
  47. package/dist/components/FieldControl.d.ts +20 -0
  48. package/dist/components/FieldControl.d.ts.map +1 -0
  49. package/dist/components/FieldControl.js +73 -0
  50. package/dist/components/FieldGroup.d.ts +11 -0
  51. package/dist/components/FieldGroup.d.ts.map +1 -0
  52. package/dist/components/FieldGroup.js +11 -0
  53. package/dist/components/FieldSkeleton.d.ts +14 -0
  54. package/dist/components/FieldSkeleton.d.ts.map +1 -0
  55. package/dist/components/FieldSkeleton.js +23 -0
  56. package/dist/components/FieldValidationError.d.ts +8 -0
  57. package/dist/components/FieldValidationError.d.ts.map +1 -0
  58. package/dist/components/FieldValidationError.js +7 -0
  59. package/dist/components/Filter.d.ts +51 -0
  60. package/dist/components/Filter.d.ts.map +1 -0
  61. package/dist/components/Filter.js +68 -0
  62. package/dist/components/Loading.d.ts +17 -0
  63. package/dist/components/Loading.d.ts.map +1 -0
  64. package/dist/components/Loading.js +15 -0
  65. package/dist/components/LoadingOverlay.d.ts +11 -0
  66. package/dist/components/LoadingOverlay.d.ts.map +1 -0
  67. package/dist/components/LoadingOverlay.js +8 -0
  68. package/dist/components/Modal.d.ts +49 -0
  69. package/dist/components/Modal.d.ts.map +1 -0
  70. package/dist/components/Modal.js +108 -0
  71. package/dist/components/MultiSelectField.d.ts +22 -0
  72. package/dist/components/MultiSelectField.d.ts.map +1 -0
  73. package/dist/components/MultiSelectField.js +84 -0
  74. package/dist/components/NavCard.d.ts +15 -0
  75. package/dist/components/NavCard.d.ts.map +1 -0
  76. package/dist/components/NavCard.js +13 -0
  77. package/dist/components/Page.d.ts +89 -0
  78. package/dist/components/Page.d.ts.map +1 -0
  79. package/dist/components/Page.js +347 -0
  80. package/dist/components/PageMessage.d.ts +12 -0
  81. package/dist/components/PageMessage.d.ts.map +1 -0
  82. package/dist/components/PageMessage.js +36 -0
  83. package/dist/components/Pagination.d.ts +15 -0
  84. package/dist/components/Pagination.d.ts.map +1 -0
  85. package/dist/components/Pagination.js +57 -0
  86. package/dist/components/PasswordInput.d.ts +8 -0
  87. package/dist/components/PasswordInput.d.ts.map +1 -0
  88. package/dist/components/PasswordInput.js +17 -0
  89. package/dist/components/RadioGroup.d.ts +32 -0
  90. package/dist/components/RadioGroup.d.ts.map +1 -0
  91. package/dist/components/RadioGroup.js +86 -0
  92. package/dist/components/RenderCase.d.ts +20 -0
  93. package/dist/components/RenderCase.d.ts.map +1 -0
  94. package/dist/components/RenderCase.js +31 -0
  95. package/dist/components/RenderIf.d.ts +10 -0
  96. package/dist/components/RenderIf.d.ts.map +1 -0
  97. package/dist/components/RenderIf.js +9 -0
  98. package/dist/components/SearchField.d.ts +22 -0
  99. package/dist/components/SearchField.d.ts.map +1 -0
  100. package/dist/components/SearchField.js +43 -0
  101. package/dist/components/SelectField.d.ts +31 -0
  102. package/dist/components/SelectField.d.ts.map +1 -0
  103. package/dist/components/SelectField.js +26 -0
  104. package/dist/components/SelectionField.d.ts +39 -0
  105. package/dist/components/SelectionField.d.ts.map +1 -0
  106. package/dist/components/SelectionField.js +105 -0
  107. package/dist/components/Sidebar.d.ts +104 -0
  108. package/dist/components/Sidebar.d.ts.map +1 -0
  109. package/dist/components/Sidebar.js +146 -0
  110. package/dist/components/StatCard.d.ts +16 -0
  111. package/dist/components/StatCard.d.ts.map +1 -0
  112. package/dist/components/StatCard.js +62 -0
  113. package/dist/components/Switch.d.ts +20 -0
  114. package/dist/components/Switch.d.ts.map +1 -0
  115. package/dist/components/Switch.js +63 -0
  116. package/dist/components/Table.d.ts +65 -0
  117. package/dist/components/Table.d.ts.map +1 -0
  118. package/dist/components/Table.js +118 -0
  119. package/dist/components/TabsUnderlined.d.ts +23 -0
  120. package/dist/components/TabsUnderlined.d.ts.map +1 -0
  121. package/dist/components/TabsUnderlined.js +29 -0
  122. package/dist/components/TextField.d.ts +25 -0
  123. package/dist/components/TextField.d.ts.map +1 -0
  124. package/dist/components/TextField.js +71 -0
  125. package/dist/components/TextareaField.d.ts +14 -0
  126. package/dist/components/TextareaField.d.ts.map +1 -0
  127. package/dist/components/TextareaField.js +34 -0
  128. package/dist/components/ThemePreferencesSelector.d.ts +29 -0
  129. package/dist/components/ThemePreferencesSelector.d.ts.map +1 -0
  130. package/dist/components/ThemePreferencesSelector.js +37 -0
  131. package/dist/components/Tooltip.d.ts +13 -0
  132. package/dist/components/Tooltip.d.ts.map +1 -0
  133. package/dist/components/Tooltip.js +40 -0
  134. package/dist/components/Workspace.d.ts +22 -0
  135. package/dist/components/Workspace.d.ts.map +1 -0
  136. package/dist/components/Workspace.js +33 -0
  137. package/dist/components/WorkspaceContext.d.ts +2 -0
  138. package/dist/components/WorkspaceContext.d.ts.map +1 -0
  139. package/dist/components/WorkspaceContext.js +2 -0
  140. package/dist/components/form-control-helpers.d.ts +24 -0
  141. package/dist/components/form-control-helpers.d.ts.map +1 -0
  142. package/dist/components/form-control-helpers.js +20 -0
  143. package/dist/index.d.ts +45 -0
  144. package/dist/index.d.ts.map +1 -0
  145. package/dist/index.js +44 -0
  146. package/dist/styles.css +21 -41
  147. package/dist/tailwind-preset.d.ts +23 -0
  148. package/dist/tailwind-preset.d.ts.map +1 -0
  149. package/dist/tailwind-preset.js +22 -0
  150. package/dist/utils/cn.d.ts +2 -0
  151. package/dist/utils/cn.d.ts.map +1 -0
  152. package/dist/utils/cn.js +33 -0
  153. package/package.json +1 -1
@@ -0,0 +1,347 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Children, createContext, cloneElement, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
3
+ import { CaptionsIcon, CaptionsOffIcon, CircleHelpIcon, GripVerticalIcon } from 'lucide-react';
4
+ import { ActionButtonPrimitive, ActionGroupPrimitive, ActionSeparatorPrimitive, } from './ActionPrimitives';
5
+ import { Tooltip } from './Tooltip';
6
+ import { cn } from '../utils/cn';
7
+ const PageActionsContext = createContext(null);
8
+ const PageActionsRenderContext = createContext(null);
9
+ const allPositions = ['left', 'top', 'right', 'bottom'];
10
+ const positionLabels = {
11
+ left: 'Esquerda',
12
+ top: 'Topo',
13
+ right: 'Direita',
14
+ bottom: 'Rodape',
15
+ };
16
+ function PageActionsMoveOption({ active, label, onSelect, position }) {
17
+ function handleClick() {
18
+ onSelect(position);
19
+ }
20
+ return (_jsx("button", { type: "button", role: "menuitemradio", "aria-checked": active, className: cn('hover:bg-background-secondary flex w-full cursor-pointer items-center rounded px-2 py-1.5 text-left', active && 'font-semibold text-brand'), onClick: handleClick, children: label }));
21
+ }
22
+ function ActionsHelpContent({ children, className, items, title }) {
23
+ return (_jsxs("div", { className: cn('max-w-[22rem] space-y-2 text-xs leading-5 [overflow-wrap:anywhere]', className), children: [title && _jsx("p", { className: "font-semibold text-foreground", children: title }), children && _jsx("div", { className: "text-foreground-muted", children: children }), items?.length ? (_jsx("ul", { className: "list-disc space-y-1 pl-4 text-foreground-muted", children: items.map((item, index) => (_jsx("li", { children: item }, index))) })) : null] }));
24
+ }
25
+ function getHelpSide(position) {
26
+ const sideByPosition = {
27
+ top: 'bottom',
28
+ bottom: 'top',
29
+ left: 'right',
30
+ right: 'left',
31
+ };
32
+ return sideByPosition[position];
33
+ }
34
+ function hasHelpContent(helpContent) {
35
+ return helpContent !== null && helpContent !== undefined && helpContent !== false && helpContent !== '';
36
+ }
37
+ function isPageActionsMetaElement(child) {
38
+ return Boolean(child
39
+ && typeof child === 'object'
40
+ && 'type' in child
41
+ && child.type
42
+ && child.type.pageActionMeta);
43
+ }
44
+ function getAllowedPositions(props, preferences) {
45
+ const allowed = props.allowedPositions ?? preferences?.allowedPositions ?? allPositions;
46
+ return allowed.filter((position, index, array) => allPositions.includes(position) && array.indexOf(position) === index);
47
+ }
48
+ function firstAllowedPosition(allowedPositions, fallback) {
49
+ return allowedPositions.includes(fallback) ? fallback : (allowedPositions[0] ?? fallback);
50
+ }
51
+ function resolvePageActionsPosition(props, preferences, isMobile) {
52
+ const allowedPositions = getAllowedPositions(props, preferences);
53
+ const explicitPosition = props.position;
54
+ const preferredPosition = preferences?.position;
55
+ const defaultPosition = props.defaultPosition ?? preferences?.defaultPosition ?? 'left';
56
+ const mobilePosition = props.mobilePosition ?? preferences?.mobilePosition ?? 'bottom';
57
+ if (explicitPosition)
58
+ return firstAllowedPosition(allowedPositions, explicitPosition);
59
+ if (isMobile)
60
+ return firstAllowedPosition(allowedPositions, mobilePosition);
61
+ if (preferredPosition)
62
+ return firstAllowedPosition(allowedPositions, preferredPosition);
63
+ return firstAllowedPosition(allowedPositions, defaultPosition);
64
+ }
65
+ function resolvePageActionsMovable(props, preferences) {
66
+ return props.movable ?? preferences?.movable ?? false;
67
+ }
68
+ function resolvePageActionsPositionChange(props, preferences) {
69
+ return props.onPositionChange ?? preferences?.onPositionChange;
70
+ }
71
+ function resolvePageActionsShowLabels(props, preferences) {
72
+ return props.showLabels ?? preferences?.showLabels ?? true;
73
+ }
74
+ function resolvePageActionsShowLabelsChange(props, preferences) {
75
+ return props.onShowLabelsChange ?? preferences?.onShowLabelsChange;
76
+ }
77
+ function getVerticalMetaAlignment(position) {
78
+ return position === 'left' ? 'items-start' : 'items-end';
79
+ }
80
+ function getVerticalMetaJustification(position) {
81
+ return position === 'left' ? 'justify-start' : 'justify-end';
82
+ }
83
+ function useIsMobile() {
84
+ const [isMobile, setIsMobile] = useState(false);
85
+ useEffect(() => {
86
+ if (typeof window === 'undefined' || typeof window.matchMedia !== 'function')
87
+ return undefined;
88
+ const media = window.matchMedia('(max-width: 767px)');
89
+ function handleChange() {
90
+ setIsMobile(media.matches);
91
+ }
92
+ handleChange();
93
+ media.addEventListener('change', handleChange);
94
+ return () => {
95
+ media.removeEventListener('change', handleChange);
96
+ };
97
+ }, []);
98
+ return isMobile;
99
+ }
100
+ function getPointerPosition(event) {
101
+ const workspace = event.currentTarget instanceof HTMLElement
102
+ ? event.currentTarget.closest('[data-page-actions-workspace]')
103
+ : null;
104
+ const rect = workspace?.getBoundingClientRect();
105
+ const width = rect?.width || window.innerWidth || 1;
106
+ const height = rect?.height || window.innerHeight || 1;
107
+ const x = rect ? event.clientX - rect.left : event.clientX;
108
+ const y = rect ? event.clientY - rect.top : event.clientY;
109
+ const leftDistance = x;
110
+ const rightDistance = width - x;
111
+ const topDistance = y;
112
+ const bottomDistance = height - y;
113
+ const minDistance = Math.min(leftDistance, rightDistance, topDistance, bottomDistance);
114
+ if (minDistance === leftDistance)
115
+ return 'left';
116
+ if (minDistance === rightDistance)
117
+ return 'right';
118
+ if (minDistance === bottomDistance)
119
+ return 'bottom';
120
+ return 'top';
121
+ }
122
+ function coerceDropPosition(position, allowedPositions) {
123
+ return allowedPositions.includes(position) ? position : firstAllowedPosition(allowedPositions, position);
124
+ }
125
+ function Actions({ align = 'start', __fromSlot = false, children, className, defaultPosition, mobilePosition, allowedPositions, helpClassName, helpContent, helpLabel = 'Ajuda da tela', metaActions, movable, onShowLabelsChange, onPositionChange, position, showLabels, size = 'md', }) {
126
+ const actionsContext = useContext(PageActionsContext);
127
+ const preferences = actionsContext?.preferences;
128
+ const setPageActions = actionsContext?.setActions;
129
+ const isMobile = useIsMobile();
130
+ const propsForResolution = {
131
+ align,
132
+ children,
133
+ className,
134
+ defaultPosition,
135
+ mobilePosition,
136
+ allowedPositions,
137
+ helpClassName,
138
+ helpContent,
139
+ helpLabel,
140
+ metaActions,
141
+ movable,
142
+ onShowLabelsChange,
143
+ onPositionChange,
144
+ position,
145
+ showLabels,
146
+ size,
147
+ };
148
+ const effectivePosition = resolvePageActionsPosition(propsForResolution, preferences, isMobile);
149
+ const effectiveAllowedPositions = getAllowedPositions(propsForResolution, preferences);
150
+ const effectiveMovable = resolvePageActionsMovable(propsForResolution, preferences);
151
+ const effectiveOnPositionChange = resolvePageActionsPositionChange(propsForResolution, preferences);
152
+ const effectiveShowLabels = resolvePageActionsShowLabels(propsForResolution, preferences);
153
+ const effectiveOnShowLabelsChange = resolvePageActionsShowLabelsChange(propsForResolution, preferences);
154
+ const canMove = effectiveMovable && !!effectiveOnPositionChange && effectiveAllowedPositions.length > 1;
155
+ const canToggleLabels = !!effectiveOnShowLabelsChange;
156
+ const [isMenuOpen, setIsMenuOpen] = useState(false);
157
+ const [dragTarget, setDragTarget] = useState(null);
158
+ const [isDragging, setIsDragging] = useState(false);
159
+ const draggedRef = useRef(false);
160
+ useLayoutEffect(() => {
161
+ if (!setPageActions || __fromSlot)
162
+ return undefined;
163
+ setPageActions(_jsx(Actions, { align: align, allowedPositions: allowedPositions, className: className, defaultPosition: defaultPosition, helpClassName: helpClassName, helpContent: helpContent, helpLabel: helpLabel, metaActions: metaActions, mobilePosition: mobilePosition, movable: movable, onShowLabelsChange: onShowLabelsChange, onPositionChange: onPositionChange, position: position, showLabels: showLabels, size: size, __fromSlot: true, children: children }));
164
+ return () => {
165
+ setPageActions(null);
166
+ };
167
+ }, [
168
+ __fromSlot,
169
+ align,
170
+ allowedPositions,
171
+ children,
172
+ className,
173
+ defaultPosition,
174
+ helpClassName,
175
+ helpContent,
176
+ helpLabel,
177
+ metaActions,
178
+ mobilePosition,
179
+ movable,
180
+ onShowLabelsChange,
181
+ onPositionChange,
182
+ position,
183
+ showLabels,
184
+ setPageActions,
185
+ size,
186
+ ]);
187
+ if (setPageActions && !__fromSlot)
188
+ return null;
189
+ const verticalWidthClass = effectiveShowLabels ? 'w-[min(10rem,24vw)] max-w-40' : 'w-auto max-w-none';
190
+ const positionClasses = {
191
+ top: 'w-full max-w-full self-stretch border-b border-app-border bg-background-secondary p-1',
192
+ bottom: 'w-full border-t border-app-border bg-background-secondary p-1',
193
+ left: cn('h-full min-h-0 self-stretch flex-none flex-col items-stretch border-r border-app-border bg-background-secondary p-1', verticalWidthClass),
194
+ right: cn('h-full min-h-0 self-stretch flex-none flex-col items-stretch border-l border-app-border bg-background-secondary p-1', verticalWidthClass),
195
+ };
196
+ const alignClasses = {
197
+ start: effectivePosition === 'left' || effectivePosition === 'right' ? 'justify-start' : 'justify-start',
198
+ end: effectivePosition === 'left' || effectivePosition === 'right' ? 'justify-end' : 'ml-auto justify-end self-end',
199
+ };
200
+ const helpVisible = hasHelpContent(helpContent);
201
+ const isVertical = effectivePosition === 'left' || effectivePosition === 'right';
202
+ const childrenArray = Children.toArray(children);
203
+ const mainChildren = childrenArray.filter((child) => !isPageActionsMetaElement(child));
204
+ const metaChildren = childrenArray.filter(isPageActionsMetaElement);
205
+ function handleMoveMenuToggle() {
206
+ if (isDragging)
207
+ return;
208
+ setIsMenuOpen((current) => !current);
209
+ }
210
+ function handleMoveKeyDown(event) {
211
+ if (event.key !== 'Enter' && event.key !== ' ')
212
+ return;
213
+ event.preventDefault();
214
+ setIsMenuOpen((current) => !current);
215
+ }
216
+ function handleMovePointerDown(event) {
217
+ if (!canMove || !effectiveOnPositionChange)
218
+ return;
219
+ event.currentTarget.setPointerCapture?.(event.pointerId);
220
+ draggedRef.current = false;
221
+ setIsDragging(true);
222
+ setIsMenuOpen(false);
223
+ setDragTarget(effectivePosition);
224
+ }
225
+ function handleMovePointerMove(event) {
226
+ if (!isDragging)
227
+ return;
228
+ draggedRef.current = true;
229
+ const nextTarget = coerceDropPosition(getPointerPosition(event), effectiveAllowedPositions);
230
+ setDragTarget(nextTarget);
231
+ }
232
+ function handleMovePointerUp(event) {
233
+ if (!isDragging || !effectiveOnPositionChange)
234
+ return;
235
+ event.currentTarget.releasePointerCapture?.(event.pointerId);
236
+ const nextTarget = dragTarget ?? coerceDropPosition(getPointerPosition(event), effectiveAllowedPositions);
237
+ setIsDragging(false);
238
+ setDragTarget(null);
239
+ if (draggedRef.current && nextTarget !== effectivePosition) {
240
+ effectiveOnPositionChange(nextTarget);
241
+ }
242
+ }
243
+ function handleMovePointerCancel(event) {
244
+ if (!isDragging)
245
+ return;
246
+ event.currentTarget.releasePointerCapture?.(event.pointerId);
247
+ setIsDragging(false);
248
+ setDragTarget(null);
249
+ }
250
+ function handleSelectPosition(nextPosition) {
251
+ effectiveOnPositionChange?.(nextPosition);
252
+ setIsMenuOpen(false);
253
+ }
254
+ function handleToggleLabels() {
255
+ effectiveOnShowLabelsChange?.(!effectiveShowLabels);
256
+ }
257
+ const verticalMetaAlignment = getVerticalMetaAlignment(effectivePosition);
258
+ const verticalMetaJustification = getVerticalMetaJustification(effectivePosition);
259
+ const helpButton = helpVisible ? (_jsx("div", { className: cn('flex shrink-0', isVertical && 'w-full', isVertical && verticalMetaJustification), children: _jsx(Tooltip, { className: cn('max-w-[22rem] px-3 py-2', helpClassName), content: helpContent, delayDuration: 120, openOnClick: true, side: getHelpSide(effectivePosition), children: _jsx(ActionButtonPrimitive, { "aria-label": helpLabel, icon: _jsx(CircleHelpIcon, { "aria-hidden": "true" }), tooltip: helpLabel }) }) })) : null;
260
+ const labelToggleButton = canToggleLabels ? (_jsx(ActionButtonPrimitive, { "aria-pressed": effectiveShowLabels, "aria-label": effectiveShowLabels ? 'Ocultar labels das acoes' : 'Mostrar labels das acoes', icon: effectiveShowLabels ? _jsx(CaptionsOffIcon, { "aria-hidden": "true" }) : _jsx(CaptionsIcon, { "aria-hidden": "true" }), tooltip: effectiveShowLabels ? 'Ocultar labels das acoes' : 'Mostrar labels das acoes', onClick: handleToggleLabels })) : null;
261
+ const moveButton = canMove ? (_jsxs("div", { className: cn('relative flex shrink-0', isVertical && 'w-full', isVertical && verticalMetaJustification), children: [_jsx(ActionButtonPrimitive, { "aria-haspopup": "menu", "aria-label": "Mover barra de acoes", "aria-expanded": isMenuOpen, className: cn('touch-none [&]:cursor-grab [&_*]:cursor-grab active:[&]:cursor-grabbing active:[&_*]:cursor-grabbing', isDragging && '[&]:cursor-grabbing [&_*]:cursor-grabbing'), icon: _jsx(GripVerticalIcon, { "aria-hidden": "true" }), tooltip: "Mover barra de acoes", onClick: handleMoveMenuToggle, onKeyDown: handleMoveKeyDown, onPointerCancel: handleMovePointerCancel, onPointerDown: handleMovePointerDown, onPointerMove: handleMovePointerMove, onPointerUp: handleMovePointerUp }), isMenuOpen ? (_jsx("div", { role: "menu", className: cn('border-app-border bg-surface text-foreground absolute z-[var(--z-popover)] min-w-36 rounded-md border p-1 text-xs shadow-[var(--shadow-md)]', isVertical && effectivePosition === 'left' && 'left-full top-0 ml-2', isVertical && effectivePosition === 'right' && 'right-full top-0 mr-2', !isVertical && 'right-0 top-full mt-2'), children: effectiveAllowedPositions.map((nextPosition) => (_jsx(PageActionsMoveOption, { active: nextPosition === effectivePosition, label: positionLabels[nextPosition], onSelect: handleSelectPosition, position: nextPosition }, nextPosition))) })) : null] })) : null;
262
+ const actions = (_jsxs("div", { className: cn('flex min-h-0 min-w-0 gap-2', isVertical ? 'h-full w-full flex-col' : 'w-full items-center'), children: [_jsx(PageActionsRenderContext.Provider, { value: { showLabels: effectiveShowLabels }, children: _jsx(ActionGroupPrimitive, { align: align, size: size, className: cn('min-w-0 flex-1', isVertical
263
+ ? cn('min-h-0 flex-col content-start [&>[data-action-separator=true]]:h-px [&>[data-action-separator=true]]:min-h-0 [&>[data-action-separator=true]]:w-full [&>[data-action-separator=true]]:self-auto', effectiveShowLabels
264
+ ? 'w-full items-stretch [&>button]:w-full [&>button]:justify-start [&>div]:w-full [&>div>button]:w-full [&>div>button]:justify-start'
265
+ : 'w-auto items-center')
266
+ : 'overflow-x-auto overflow-y-hidden', alignClasses[align]), children: mainChildren }) }), _jsx(PageActionsRenderContext.Provider, { value: { showLabels: !isVertical && effectiveShowLabels }, children: _jsxs("div", { className: cn('flex shrink-0 gap-2', isVertical ? cn('w-full flex-col', verticalMetaAlignment) : 'ml-auto items-center'), children: [helpButton, metaActions, metaChildren, labelToggleButton, moveButton] }) })] }));
267
+ return (_jsxs("div", { className: cn('flex min-w-0', positionClasses[effectivePosition], isVertical ? 'flex-col' : 'items-center', className), children: [actions, isDragging ? _jsx(PageActionsDropZones, { activePosition: dragTarget ?? effectivePosition, allowedPositions: effectiveAllowedPositions }) : null] }));
268
+ }
269
+ function PageActionsDropZones({ activePosition, allowedPositions }) {
270
+ return (_jsx("div", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 z-[var(--z-popover)]", children: allPositions.map((position) => {
271
+ if (!allowedPositions.includes(position))
272
+ return null;
273
+ return (_jsx("div", { className: cn('absolute border-2 border-dashed border-brand/50 bg-brand/10 transition-colors', position === 'left' && 'left-2 top-2 h-[calc(100%-1rem)] w-20 rounded-md', position === 'right' && 'right-2 top-2 h-[calc(100%-1rem)] w-20 rounded-md', position === 'top' && 'left-2 top-2 h-14 w-[calc(100%-1rem)] rounded-md', position === 'bottom' && 'bottom-2 left-2 h-14 w-[calc(100%-1rem)] rounded-md', activePosition === position && 'border-brand bg-brand/20 shadow-[0_0_0_4px_color-mix(in_srgb,var(--brand)_18%,transparent)]') }, position));
274
+ }) }));
275
+ }
276
+ function ActionsSeparator(props) {
277
+ return _jsx(ActionSeparatorPrimitive, { ...props });
278
+ }
279
+ function ActionButton({ label, tooltip, ...props }) {
280
+ const renderContext = useContext(PageActionsRenderContext);
281
+ const showLabels = renderContext?.showLabels ?? true;
282
+ const resolvedTooltip = tooltip ?? (typeof label === 'string' ? label : undefined);
283
+ return (_jsx(ActionButtonPrimitive, { label: showLabels ? label : undefined, tooltip: resolvedTooltip, ...props }));
284
+ }
285
+ function Root({ actions, children, className, ...props }) {
286
+ const actionsContext = useContext(PageActionsContext);
287
+ const isMobile = useIsMobile();
288
+ const preferences = actionsContext?.preferences;
289
+ const setPageActions = actionsContext?.setActions;
290
+ const position = actions ? resolvePageActionsPosition(actions.props, preferences, isMobile) : 'left';
291
+ const hasHorizontalActions = position === 'left' || position === 'right';
292
+ const topActions = position === 'top' ? actions : null;
293
+ const bottomActions = position === 'bottom' ? actions : null;
294
+ const leftActions = position === 'left' ? actions : null;
295
+ const rightActions = position === 'right' ? actions : null;
296
+ useLayoutEffect(() => {
297
+ if (!setPageActions)
298
+ return undefined;
299
+ setPageActions(actions ?? null);
300
+ return () => {
301
+ setPageActions(null);
302
+ };
303
+ }, [actions, setPageActions]);
304
+ if (setPageActions) {
305
+ return (_jsx("section", { className: cn('flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden', className), ...props, children: children }));
306
+ }
307
+ if (hasHorizontalActions) {
308
+ return (_jsx("section", { className: cn('flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden', className), ...props, children: _jsxs("div", { className: "flex h-full min-h-0 w-full min-w-0 gap-3", children: [leftActions, _jsx("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden", children: children }), rightActions] }) }));
309
+ }
310
+ return (_jsxs("section", { className: cn('flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden', className), ...props, children: [topActions, children, bottomActions] }));
311
+ }
312
+ function ActionsProvider({ children, preferences }) {
313
+ const [actions, setActions] = useState(null);
314
+ const value = useMemo(() => ({ actions, preferences, setActions }), [actions, preferences]);
315
+ return _jsx(PageActionsContext.Provider, { value: value, children: children });
316
+ }
317
+ function ActionsSlot({ className, position }) {
318
+ const actionsContext = useContext(PageActionsContext);
319
+ const isMobile = useIsMobile();
320
+ const actions = actionsContext?.actions ?? null;
321
+ const actionsPosition = actions ? resolvePageActionsPosition(actions.props, actionsContext?.preferences, isMobile) : null;
322
+ if (!actions || actionsPosition !== position)
323
+ return null;
324
+ return (_jsx("div", { className: cn('flex min-w-0 flex-none', (position === 'top' || position === 'bottom') && 'w-full', (position === 'left' || position === 'right') && 'min-h-0 self-stretch', className), children: cloneElement(actions, { __fromSlot: true }) }));
325
+ }
326
+ function Title({ children, className, ...props }) {
327
+ return (_jsx("h1", { className: cn('text-xl font-semibold tracking-[var(--letter-spacing-tight)] text-foreground', className), ...props, children: children }));
328
+ }
329
+ function Description({ children, className, ...props }) {
330
+ return (_jsx("p", { className: cn('text-sm leading-6 text-foreground-muted', className), ...props, children: children }));
331
+ }
332
+ function Header({ actions, description, eyebrow, title }) {
333
+ const hasLeft = eyebrow || title || description;
334
+ return (_jsxs("div", { className: "mb-3 flex items-start justify-between gap-3", children: [hasLeft && (_jsxs("div", { children: [eyebrow && _jsx("span", { className: "text-xs font-semibold uppercase tracking-[var(--letter-spacing-caps)] text-foreground-muted", children: eyebrow }), title && _jsx(Title, { children: title }), description && _jsx(Description, { children: description })] })), actions && _jsx("div", { className: "flex min-w-0 justify-end", children: actions })] }));
335
+ }
336
+ export const Page = {
337
+ Root,
338
+ Header,
339
+ Title,
340
+ Description,
341
+ Actions,
342
+ ActionsHelpContent,
343
+ ActionButton,
344
+ ActionsSeparator,
345
+ ActionsProvider,
346
+ ActionsSlot,
347
+ };
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from 'react';
2
+ export type PageMessageVariant = 'default' | 'info' | 'success' | 'warning' | 'danger';
3
+ export interface PageMessageProps {
4
+ children?: ReactNode;
5
+ className?: string;
6
+ icon?: ReactNode | false;
7
+ message?: ReactNode;
8
+ title?: ReactNode;
9
+ variant?: PageMessageVariant;
10
+ }
11
+ export declare function PageMessage({ children, className, icon, message, title, variant, }: PageMessageProps): import("react").JSX.Element;
12
+ //# sourceMappingURL=PageMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageMessage.d.ts","sourceRoot":"","sources":["../../src/components/PageMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEvF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IACzB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAqCD,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,OAAO,EACP,KAAK,EACL,OAAmB,GACpB,EAAE,gBAAgB,+BAgBlB"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AlertCircleIcon, AlertTriangleIcon, CheckCircle2Icon, InfoIcon, } from 'lucide-react';
3
+ import { cn } from '../utils/cn';
4
+ const variantClasses = {
5
+ default: {
6
+ container: 'app-page-message--default',
7
+ icon: 'app-page-message__icon--default',
8
+ defaultIcon: _jsx(InfoIcon, { className: "size-4" }),
9
+ },
10
+ info: {
11
+ container: 'app-page-message--info',
12
+ icon: 'app-page-message__icon--info',
13
+ defaultIcon: _jsx(InfoIcon, { className: "size-4" }),
14
+ },
15
+ success: {
16
+ container: 'app-page-message--success',
17
+ icon: 'app-page-message__icon--success',
18
+ defaultIcon: _jsx(CheckCircle2Icon, { className: "size-4" }),
19
+ },
20
+ warning: {
21
+ container: 'app-page-message--warning',
22
+ icon: 'app-page-message__icon--warning',
23
+ defaultIcon: _jsx(AlertTriangleIcon, { className: "size-4" }),
24
+ },
25
+ danger: {
26
+ container: 'app-page-message--danger',
27
+ icon: 'app-page-message__icon--danger',
28
+ defaultIcon: _jsx(AlertCircleIcon, { className: "size-4" }),
29
+ },
30
+ };
31
+ export function PageMessage({ children, className, icon, message, title, variant = 'default', }) {
32
+ const variantStyle = variantClasses[variant];
33
+ const resolvedIcon = icon === false ? null : icon ?? variantStyle.defaultIcon;
34
+ const content = children ?? message;
35
+ return (_jsxs("div", { className: cn('app-page-message flex min-w-0 items-start gap-3 rounded-lg border px-4 py-3 text-sm shadow-sm', variantStyle.container, className), children: [resolvedIcon ? (_jsx("span", { className: cn('mt-0.5 shrink-0', variantStyle.icon), children: resolvedIcon })) : null, _jsxs("div", { className: "min-w-0 flex-1", children: [title ? _jsx("div", { className: "font-semibold leading-5", children: title }) : null, content ? _jsx("div", { className: cn('leading-5', title ? 'mt-0.5' : undefined), children: content }) : null] })] }));
36
+ }
@@ -0,0 +1,15 @@
1
+ export type PaginationSize = 'sm' | 'md' | 'lg';
2
+ export interface PaginationProps {
3
+ page: number;
4
+ totalPages: number;
5
+ totalItems?: number;
6
+ pageSize: number;
7
+ onPageChange: (page: number) => void;
8
+ onPageSizeChange: (size: number) => void;
9
+ pageSizeOptions?: number[];
10
+ label?: string;
11
+ isLoading?: boolean;
12
+ size?: PaginationSize;
13
+ }
14
+ export declare function Pagination({ page, totalPages, totalItems, pageSize, onPageChange, onPageSizeChange, pageSizeOptions, label, isLoading, size, }: PaginationProps): import("react").JSX.Element;
15
+ //# sourceMappingURL=Pagination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/components/Pagination.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AA+ChD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,UAAU,EACV,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,eAA+B,EAC/B,KAA0B,EAC1B,SAAiB,EACjB,IAAW,GACZ,EAAE,eAAe,+BA0GjB"}
@@ -0,0 +1,57 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from 'lucide-react';
3
+ import { cn } from '../utils/cn';
4
+ import { Button } from './Button';
5
+ const sizeClasses = {
6
+ sm: {
7
+ root: 'gap-2 md:gap-3',
8
+ count: 'text-xs md:min-w-[7rem] md:text-[length:var(--font-size-compact)]',
9
+ controls: 'gap-1',
10
+ iconButton: 'h-8 min-h-8 min-w-8 px-2 py-0 [&_svg]:size-3.5',
11
+ navButton: 'h-8 min-h-8 min-w-8 px-2 py-0 min-[901px]:min-w-[5.75rem] [&_svg]:size-3.5',
12
+ pageIndicator: 'h-8 px-2 text-xs md:min-w-[6.75rem] md:text-[length:var(--font-size-compact)]',
13
+ select: 'h-8 min-w-18 px-2.5 text-xs',
14
+ selectLabel: 'text-xs md:text-[length:var(--font-size-compact)]',
15
+ },
16
+ md: {
17
+ root: 'gap-2.5 md:gap-3',
18
+ count: 'text-[length:var(--font-size-compact)] md:min-w-[7.5rem]',
19
+ controls: 'gap-1.5',
20
+ iconButton: 'h-9 min-h-9 min-w-9 px-2.5 py-0 [&_svg]:size-4',
21
+ navButton: 'h-9 min-h-9 min-w-9 px-3 py-0 min-[901px]:min-w-[6.25rem] [&_svg]:size-4',
22
+ pageIndicator: 'h-9 px-3 text-[length:var(--font-size-compact)] md:min-w-[7.25rem]',
23
+ select: 'h-9 min-w-20 px-3 text-[length:var(--font-size-compact)]',
24
+ selectLabel: 'text-[length:var(--font-size-compact)]',
25
+ },
26
+ lg: {
27
+ root: 'gap-3 md:gap-4',
28
+ count: 'text-sm md:min-w-[8rem]',
29
+ controls: 'gap-2',
30
+ iconButton: 'h-10 min-h-10 min-w-10 px-3 py-0 [&_svg]:size-[1.125rem]',
31
+ navButton: 'h-10 min-h-10 min-w-10 px-3.5 py-0 min-[901px]:min-w-[6.75rem] [&_svg]:size-[1.125rem]',
32
+ pageIndicator: 'h-10 px-3.5 text-sm md:min-w-[7.75rem]',
33
+ select: 'h-10 min-w-22 px-3.5 text-sm',
34
+ selectLabel: 'text-sm',
35
+ },
36
+ };
37
+ export function Pagination({ page, totalPages, totalItems, pageSize, onPageChange, onPageSizeChange, pageSizeOptions = [20, 50, 100], label = 'Itens por pagina', isLoading = false, size = 'sm', }) {
38
+ const isFirstPage = page <= 1;
39
+ const isLastPage = page >= totalPages;
40
+ const resolvedSize = sizeClasses[size];
41
+ function handleFirstPage() {
42
+ onPageChange(1);
43
+ }
44
+ function handlePrevPage() {
45
+ onPageChange(Math.max(page - 1, 1));
46
+ }
47
+ function handleNextPage() {
48
+ onPageChange(Math.min(page + 1, totalPages));
49
+ }
50
+ function handleLastPage() {
51
+ onPageChange(totalPages);
52
+ }
53
+ function handleSizeChange(event) {
54
+ onPageSizeChange(Number(event.target.value));
55
+ }
56
+ return (_jsxs("div", { className: cn('flex w-full min-w-0 flex-wrap items-center justify-between md:flex-nowrap', resolvedSize.root), children: [_jsx("div", { className: cn('flex min-w-0 shrink-0 items-center justify-start whitespace-nowrap font-medium text-foreground-muted', resolvedSize.count), children: _jsx("span", { children: typeof totalItems === 'number' ? `${totalItems} registro(s)` : 'Nenhum resultado' }) }), _jsxs("div", { className: cn('order-3 flex min-w-0 flex-1 flex-nowrap items-center justify-center md:order-none', resolvedSize.controls), children: [_jsx(Button, { variant: "outline", size: "xs", className: resolvedSize.iconButton, onClick: handleFirstPage, disabled: isFirstPage || isLoading, "aria-label": "Primeira pagina", tooltip: "Primeira pagina", children: _jsx(ChevronsLeft, { "aria-hidden": "true" }) }), _jsxs(Button, { variant: "outline", size: "xs", className: resolvedSize.navButton, onClick: handlePrevPage, disabled: isFirstPage || isLoading, "aria-label": "Pagina anterior", children: [_jsx(ChevronLeft, { "aria-hidden": "true" }), _jsx("span", { className: "hidden min-[901px]:inline", children: "Anterior" })] }), _jsxs("span", { className: cn('inline-flex min-w-0 items-center justify-center whitespace-nowrap rounded-[var(--radius)] font-semibold text-foreground', resolvedSize.pageIndicator), children: ["Pagina ", page, " de ", totalPages] }), _jsxs(Button, { variant: "outline", size: "xs", className: resolvedSize.navButton, onClick: handleNextPage, disabled: isLastPage || isLoading, "aria-label": "Proxima pagina", children: [_jsx("span", { className: "hidden min-[901px]:inline", children: "Proxima" }), _jsx(ChevronRight, { "aria-hidden": "true" })] }), _jsx(Button, { variant: "outline", size: "xs", className: resolvedSize.iconButton, onClick: handleLastPage, disabled: isLastPage || isLoading, "aria-label": "Ultima pagina", tooltip: "Ultima pagina", children: _jsx(ChevronsRight, { "aria-hidden": "true" }) })] }), _jsxs("div", { className: cn('flex min-w-0 shrink-0 items-center justify-end gap-1.5 md:min-w-[9rem]', pageSizeOptions.length <= 1 && 'invisible'), children: [_jsx("span", { className: cn('whitespace-nowrap text-foreground-muted', resolvedSize.selectLabel), children: label }), _jsx("select", { className: cn('border-app-border bg-surface cursor-pointer rounded-[var(--radius)] border text-foreground transition-colors focus:border-brand focus:outline-none focus:ring-2 focus:ring-brand/20 disabled:cursor-not-allowed disabled:opacity-50', resolvedSize.select), value: pageSize, onChange: handleSizeChange, disabled: isLoading, "aria-label": "Itens por pagina", children: pageSizeOptions.map((option) => (_jsx("option", { value: option, children: option }, option))) })] })] }));
57
+ }
@@ -0,0 +1,8 @@
1
+ import { type InputHTMLAttributes } from 'react';
2
+ export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
3
+ label?: string;
4
+ helperText?: string;
5
+ error?: string;
6
+ }
7
+ export declare const PasswordInput: import("react").ForwardRefExoticComponent<PasswordInputProps & import("react").RefAttributes<HTMLInputElement>>;
8
+ //# sourceMappingURL=PasswordInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordInput.d.ts","sourceRoot":"","sources":["../../src/components/PasswordInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAwBvE,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,iHA6BzB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useState } from 'react';
3
+ import { TextField } from './TextField';
4
+ function EyeIcon({ hidden }) {
5
+ if (hidden) {
6
+ return (_jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "m9.88 9.88 4.24 4.24" }), _jsx("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c5 0 9 5 9 7a8.25 8.25 0 0 1-1.67 2.68" }), _jsx("path", { d: "M6.61 6.61C3.98 8.23 2 10.93 2 12c0 2 4 7 10 7a9.74 9.74 0 0 0 4.34-1" }), _jsx("path", { d: "M2 2l20 20" })] }));
7
+ }
8
+ return (_jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12Z" }), _jsx("circle", { cx: "12", cy: "12", r: "3" })] }));
9
+ }
10
+ export const PasswordInput = forwardRef(({ className, ...props }, ref) => {
11
+ const [isVisible, setIsVisible] = useState(false);
12
+ function toggleVisibility() {
13
+ setIsVisible((current) => !current);
14
+ }
15
+ return (_jsx(TextField, { ref: ref, className: className, type: isVisible ? 'text' : 'password', children: (_jsx("button", { type: "button", className: "pointer-events-auto inline-flex size-7 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-foreground-muted transition-[background-color,color,box-shadow] hover:bg-[color-mix(in_srgb,var(--brand)_10%,transparent)] hover:text-brand focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/30 disabled:cursor-not-allowed disabled:opacity-45", onClick: toggleVisibility, "aria-label": isVisible ? 'Ocultar senha' : 'Mostrar senha', title: isVisible ? 'Ocultar senha' : 'Mostrar senha', disabled: props.disabled, children: _jsx(EyeIcon, { hidden: isVisible }) })), ...props }));
16
+ });
17
+ PasswordInput.displayName = 'PasswordInput';
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { type FieldValues } from 'react-hook-form';
3
+ import { type FormControlSize } from './form-control-helpers';
4
+ export interface RadioGroupProps<TFieldValues extends FieldValues = FieldValues> {
5
+ value?: string | number | null;
6
+ onChange?: (value: string | number) => void;
7
+ name?: string;
8
+ label?: string;
9
+ errorMessage?: string;
10
+ wrapperClassName?: string;
11
+ labelClassName?: string;
12
+ disabled?: boolean;
13
+ size?: FormControlSize;
14
+ direction?: 'row' | 'column';
15
+ variant?: 'plain' | 'boxed';
16
+ children?: React.ReactNode;
17
+ control?: unknown;
18
+ rules?: unknown;
19
+ }
20
+ export interface RadioGroupItemProps {
21
+ value: string | number;
22
+ label: string;
23
+ disabled?: boolean;
24
+ className?: string;
25
+ }
26
+ declare function Item({ className, disabled: itemDisabled, label, value }: RadioGroupItemProps): React.JSX.Element;
27
+ declare function RadioGroupRoot<TFieldValues extends FieldValues = FieldValues>(props: RadioGroupProps<TFieldValues>): React.JSX.Element;
28
+ export declare const RadioGroup: typeof RadioGroupRoot & {
29
+ Item: typeof Item;
30
+ };
31
+ export {};
32
+ //# sourceMappingURL=RadioGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../src/components/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAGL,KAAK,WAAW,EAGjB,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EAAgB,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAe5E,MAAM,WAAW,eAAe,CAAC,YAAY,SAAS,WAAW,GAAG,WAAW;IAC7E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2JD,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,mBAAmB,qBA6BrF;AAaD,iBAAS,cAAc,CAAC,YAAY,SAAS,WAAW,GAAG,WAAW,EAAE,KAAK,EAAE,eAAe,CAAC,YAAY,CAAC,qBAM3G;AAED,eAAO,MAAM,UAAU;;CAA0C,CAAC"}