analytica-frontend-lib 1.0.22 → 1.0.23

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 (64) hide show
  1. package/dist/Alert/Alert.d.mts +13 -0
  2. package/dist/Alert/Alert.d.ts +13 -0
  3. package/dist/Alert/Alert.js +158 -0
  4. package/dist/Alert/Alert.mjs +85 -0
  5. package/dist/Badge/Badge.d.mts +47 -0
  6. package/dist/Badge/Badge.d.ts +47 -0
  7. package/dist/Badge/Badge.js +117 -0
  8. package/dist/Badge/Badge.mjs +92 -0
  9. package/dist/Button/Button.d.mts +46 -0
  10. package/dist/Button/Button.d.ts +46 -0
  11. package/dist/Button/Button.js +84 -0
  12. package/dist/Button/Button.mjs +59 -0
  13. package/dist/CheckBox/CheckBox.d.mts +74 -0
  14. package/dist/CheckBox/CheckBox.d.ts +74 -0
  15. package/dist/CheckBox/CheckBox.js +264 -0
  16. package/dist/CheckBox/CheckBox.mjs +195 -0
  17. package/dist/DropdownMenu/DropdownMenu.d.mts +29 -0
  18. package/dist/DropdownMenu/DropdownMenu.d.ts +29 -0
  19. package/dist/DropdownMenu/DropdownMenu.js +262 -0
  20. package/dist/DropdownMenu/DropdownMenu.mjs +242 -0
  21. package/dist/IconButton/IconButton.d.mts +77 -0
  22. package/dist/IconButton/IconButton.d.ts +77 -0
  23. package/dist/IconButton/IconButton.js +79 -0
  24. package/dist/IconButton/IconButton.mjs +54 -0
  25. package/dist/IconRoundedButton/IconRoundedButton.d.mts +35 -0
  26. package/dist/IconRoundedButton/IconRoundedButton.d.ts +35 -0
  27. package/dist/IconRoundedButton/IconRoundedButton.js +68 -0
  28. package/dist/IconRoundedButton/IconRoundedButton.mjs +43 -0
  29. package/dist/NavButton/NavButton.d.mts +58 -0
  30. package/dist/NavButton/NavButton.d.ts +58 -0
  31. package/dist/NavButton/NavButton.js +76 -0
  32. package/dist/NavButton/NavButton.mjs +51 -0
  33. package/dist/SelectionButton/SelectionButton.d.mts +58 -0
  34. package/dist/SelectionButton/SelectionButton.d.ts +58 -0
  35. package/dist/SelectionButton/SelectionButton.js +81 -0
  36. package/dist/SelectionButton/SelectionButton.mjs +56 -0
  37. package/dist/Table/Table.d.mts +17 -0
  38. package/dist/Table/Table.d.ts +17 -0
  39. package/dist/Table/Table.js +139 -0
  40. package/dist/Table/Table.mjs +107 -0
  41. package/dist/Text/Text.d.mts +59 -0
  42. package/dist/Text/Text.d.ts +59 -0
  43. package/dist/Text/Text.js +77 -0
  44. package/dist/Text/Text.mjs +6 -0
  45. package/dist/TextArea/TextArea.d.mts +69 -0
  46. package/dist/TextArea/TextArea.d.ts +69 -0
  47. package/dist/TextArea/TextArea.js +211 -0
  48. package/dist/TextArea/TextArea.mjs +142 -0
  49. package/dist/Toast/Toast.d.mts +17 -0
  50. package/dist/Toast/Toast.d.ts +17 -0
  51. package/dist/Toast/Toast.js +100 -0
  52. package/dist/Toast/Toast.mjs +7 -0
  53. package/dist/Toast/utils/ToastStore.d.mts +19 -0
  54. package/dist/Toast/utils/ToastStore.d.ts +19 -0
  55. package/dist/Toast/utils/ToastStore.js +44 -0
  56. package/dist/Toast/utils/ToastStore.mjs +6 -0
  57. package/dist/Toast/utils/Toaster.d.mts +11 -0
  58. package/dist/Toast/utils/Toaster.d.ts +11 -0
  59. package/dist/Toast/utils/Toaster.js +145 -0
  60. package/dist/Toast/utils/Toaster.mjs +35 -0
  61. package/dist/chunk-MI5FIRHM.mjs +75 -0
  62. package/dist/chunk-TT3VCQGR.mjs +53 -0
  63. package/dist/chunk-WIOCQOM7.mjs +20 -0
  64. package/package.json +71 -3
@@ -0,0 +1,242 @@
1
+ "use client";
2
+
3
+ // src/components/DropdownMenu/DropdownMenu.tsx
4
+ import {
5
+ createContext,
6
+ useState,
7
+ useCallback,
8
+ useContext,
9
+ forwardRef,
10
+ useEffect,
11
+ useRef,
12
+ useMemo
13
+ } from "react";
14
+ import { jsx, jsxs } from "react/jsx-runtime";
15
+ var DropdownMenuContext = createContext(
16
+ void 0
17
+ );
18
+ var DropdownMenu = ({ children, open, onOpenChange }) => {
19
+ const [internalOpen, setInternalOpen] = useState(false);
20
+ const isControlled = open !== void 0;
21
+ const currentOpen = isControlled ? open : internalOpen;
22
+ const setOpen = useCallback(
23
+ (newOpen) => {
24
+ if (onOpenChange) onOpenChange(newOpen);
25
+ if (!isControlled) setInternalOpen(newOpen);
26
+ },
27
+ [isControlled, onOpenChange]
28
+ );
29
+ const menuRef = useRef(null);
30
+ const handleArrowDownOrArrowUp = (event) => {
31
+ const menuContent = menuRef.current?.querySelector('[role="menu"]');
32
+ if (menuContent) {
33
+ event.preventDefault();
34
+ const items = Array.from(
35
+ menuContent.querySelectorAll(
36
+ '[role="menuitem"]:not([aria-disabled="true"])'
37
+ )
38
+ ).filter((el) => el instanceof HTMLElement);
39
+ if (items.length === 0) return;
40
+ const focusedItem = document.activeElement;
41
+ const currentIndex = items.findIndex((item) => item === focusedItem);
42
+ let nextIndex;
43
+ if (event.key === "ArrowDown") {
44
+ nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;
45
+ } else {
46
+ nextIndex = currentIndex === -1 ? items.length - 1 : (currentIndex - 1 + items.length) % items.length;
47
+ }
48
+ items[nextIndex]?.focus();
49
+ }
50
+ };
51
+ const handleDownkey = (event) => {
52
+ if (event.key === "Escape") {
53
+ setOpen(false);
54
+ } else if (event.key === "ArrowDown" || event.key === "ArrowUp") {
55
+ handleArrowDownOrArrowUp(event);
56
+ }
57
+ };
58
+ const handleClickOutside = (event) => {
59
+ if (menuRef.current && !menuRef.current.contains(event.target)) {
60
+ setOpen(false);
61
+ }
62
+ };
63
+ useEffect(() => {
64
+ if (currentOpen) {
65
+ document.addEventListener("mousedown", handleClickOutside);
66
+ document.addEventListener("keydown", handleDownkey);
67
+ }
68
+ return () => {
69
+ document.removeEventListener("mousedown", handleClickOutside);
70
+ document.removeEventListener("keydown", handleDownkey);
71
+ };
72
+ }, [currentOpen]);
73
+ const value = useMemo(
74
+ () => ({ open: currentOpen, setOpen }),
75
+ [currentOpen, setOpen]
76
+ );
77
+ return /* @__PURE__ */ jsx(DropdownMenuContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { className: "relative", ref: menuRef, children }) });
78
+ };
79
+ var DropdownMenuTrigger = forwardRef(({ className, children, onClick, ...props }, ref) => {
80
+ const context = useContext(DropdownMenuContext);
81
+ if (!context)
82
+ throw new Error("DropdownMenuTrigger must be used within a DropdownMenu");
83
+ const { open, setOpen } = context;
84
+ return /* @__PURE__ */ jsx(
85
+ "button",
86
+ {
87
+ ref,
88
+ className: `border border-border-200 cursor-pointer bg-background-muted hover:bg-background-200 transition-colors px-4 py-2 rounded-sm ${className}`,
89
+ onClick: (e) => {
90
+ e.stopPropagation();
91
+ setOpen(!open);
92
+ if (onClick) onClick(e);
93
+ },
94
+ "aria-expanded": open,
95
+ ...props,
96
+ children
97
+ }
98
+ );
99
+ });
100
+ DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
101
+ var ITEM_SIZE_CLASSES = {
102
+ small: "text-sm",
103
+ medium: "text-md"
104
+ };
105
+ var SIDE_CLASSES = {
106
+ top: "bottom-full",
107
+ right: "top-full",
108
+ bottom: "top-full",
109
+ left: "top-full"
110
+ };
111
+ var ALIGN_CLASSES = {
112
+ start: "left-0",
113
+ center: "left-1/2 -translate-x-1/2",
114
+ end: "right-0"
115
+ };
116
+ var MenuLabel = forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
117
+ "fieldset",
118
+ {
119
+ ref,
120
+ role: "group",
121
+ className: `text-sm w-full ${inset ? "pl-8" : ""} ${className ?? ""}`,
122
+ ...props
123
+ }
124
+ ));
125
+ MenuLabel.displayName = "MenuLabel";
126
+ var MenuContent = forwardRef(
127
+ ({
128
+ className,
129
+ align = "start",
130
+ side = "bottom",
131
+ sideOffset = 4,
132
+ children,
133
+ ...props
134
+ }, ref) => {
135
+ const { open } = useContext(DropdownMenuContext);
136
+ const [isVisible, setIsVisible] = useState(open);
137
+ useEffect(() => {
138
+ if (open) {
139
+ setIsVisible(true);
140
+ } else {
141
+ const timer = setTimeout(() => setIsVisible(false), 200);
142
+ return () => clearTimeout(timer);
143
+ }
144
+ }, [open]);
145
+ if (!isVisible) return null;
146
+ const getPositionClasses = () => {
147
+ const vertical = SIDE_CLASSES[side];
148
+ const horizontal = ALIGN_CLASSES[align];
149
+ return `absolute ${vertical} ${horizontal}`;
150
+ };
151
+ return /* @__PURE__ */ jsx(
152
+ "div",
153
+ {
154
+ ref,
155
+ role: "menu",
156
+ className: `
157
+ bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md border-border-100
158
+ ${open ? "animate-in fade-in-0 zoom-in-95" : "animate-out fade-out-0 zoom-out-95"}
159
+ ${getPositionClasses()}
160
+ ${className}
161
+ `,
162
+ style: {
163
+ marginTop: side === "bottom" ? sideOffset : void 0,
164
+ marginBottom: side === "top" ? sideOffset : void 0,
165
+ marginLeft: side === "right" ? sideOffset : void 0,
166
+ marginRight: side === "left" ? sideOffset : void 0
167
+ },
168
+ ...props,
169
+ children
170
+ }
171
+ );
172
+ }
173
+ );
174
+ MenuContent.displayName = "MenuContent";
175
+ var MenuItem = forwardRef(
176
+ ({
177
+ className,
178
+ inset,
179
+ size = "small",
180
+ children,
181
+ iconRight,
182
+ iconLeft,
183
+ disabled = false,
184
+ onClick,
185
+ ...props
186
+ }, ref) => {
187
+ const sizeClasses = ITEM_SIZE_CLASSES[size];
188
+ const handleClick = (e) => {
189
+ if (disabled) {
190
+ e.preventDefault();
191
+ e.stopPropagation();
192
+ return;
193
+ }
194
+ onClick?.(e);
195
+ };
196
+ return /* @__PURE__ */ jsxs(
197
+ "div",
198
+ {
199
+ ref,
200
+ role: "menuitem",
201
+ "aria-disabled": disabled,
202
+ className: `
203
+ focus-visible:bg-background-50
204
+ relative flex select-none items-center gap-2 rounded-sm p-3 text-sm outline-none transition-colors [&>svg]:size-4 [&>svg]:shrink-0
205
+ ${inset && "pl-8"}
206
+ ${sizeClasses}
207
+ ${className}
208
+ ${disabled ? "cursor-not-allowed text-text-400" : "cursor-pointer hover:bg-background-50 text-text-700 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground"}
209
+ `,
210
+ onClick: handleClick,
211
+ onKeyDown: (e) => {
212
+ if (e.key === "Enter" || e.key === " ") handleClick(e);
213
+ },
214
+ tabIndex: disabled ? -1 : 0,
215
+ ...props,
216
+ children: [
217
+ iconLeft,
218
+ children,
219
+ iconRight
220
+ ]
221
+ }
222
+ );
223
+ }
224
+ );
225
+ MenuItem.displayName = "MenuItem";
226
+ var MenuSeparator = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
227
+ "div",
228
+ {
229
+ ref,
230
+ className: `my-1 h-px bg-border-200 ${className}`,
231
+ ...props
232
+ }
233
+ ));
234
+ MenuSeparator.displayName = "MenuSeparator";
235
+ export {
236
+ DropdownMenu,
237
+ DropdownMenuTrigger,
238
+ MenuContent,
239
+ MenuItem,
240
+ MenuLabel,
241
+ MenuSeparator
242
+ };
@@ -0,0 +1,77 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, ButtonHTMLAttributes } from 'react';
3
+
4
+ /**
5
+ * IconButton component props interface
6
+ */
7
+ type IconButtonProps = {
8
+ /** Ícone a ser exibido no botão */
9
+ icon: ReactNode;
10
+ /** Tamanho do botão */
11
+ size?: 'sm' | 'md';
12
+ /** Estado de seleção/ativo do botão - permanece ativo até ser clicado novamente ou outro botão ser ativado */
13
+ active?: boolean;
14
+ /** Additional CSS classes to apply */
15
+ className?: string;
16
+ } & ButtonHTMLAttributes<HTMLButtonElement>;
17
+ /**
18
+ * IconButton component for Analytica Ensino platforms
19
+ *
20
+ * Um botão compacto apenas com ícone, ideal para menus dropdown,
21
+ * barras de ferramentas e ações secundárias.
22
+ * Oferece dois tamanhos com estilo consistente.
23
+ * Estado ativo permanece até ser clicado novamente ou outro botão ser ativado.
24
+ * Compatível com Next.js 15 e React 19.
25
+ * Suporta forwardRef para acesso programático ao elemento DOM.
26
+ *
27
+ * @param icon - O ícone a ser exibido no botão
28
+ * @param size - Tamanho do botão (sm, md)
29
+ * @param active - Estado ativo/selecionado do botão
30
+ * @param className - Classes CSS adicionais
31
+ * @param props - Todos os outros atributos HTML padrão de button
32
+ * @returns Um elemento button compacto estilizado apenas com ícone
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <IconButton
37
+ * icon={<MoreVerticalIcon />}
38
+ * size="sm"
39
+ * onClick={() => openMenu()}
40
+ * />
41
+ * ```
42
+ *
43
+ * @example
44
+ * ```tsx
45
+ * // Botão ativo em uma barra de ferramentas - permanece ativo até outro clique
46
+ * <IconButton
47
+ * icon={<BoldIcon />}
48
+ * active={isBold}
49
+ * onClick={toggleBold}
50
+ * />
51
+ * ```
52
+ *
53
+ * @example
54
+ * ```tsx
55
+ * // Usando ref para controle programático
56
+ * const buttonRef = useRef<HTMLButtonElement>(null);
57
+ *
58
+ * <IconButton
59
+ * ref={buttonRef}
60
+ * icon={<EditIcon />}
61
+ * size="md"
62
+ * onClick={() => startEditing()}
63
+ * />
64
+ * ```
65
+ */
66
+ declare const IconButton: react.ForwardRefExoticComponent<{
67
+ /** Ícone a ser exibido no botão */
68
+ icon: ReactNode;
69
+ /** Tamanho do botão */
70
+ size?: "sm" | "md";
71
+ /** Estado de seleção/ativo do botão - permanece ativo até ser clicado novamente ou outro botão ser ativado */
72
+ active?: boolean;
73
+ /** Additional CSS classes to apply */
74
+ className?: string;
75
+ } & ButtonHTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
76
+
77
+ export { IconButton, type IconButtonProps };
@@ -0,0 +1,77 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, ButtonHTMLAttributes } from 'react';
3
+
4
+ /**
5
+ * IconButton component props interface
6
+ */
7
+ type IconButtonProps = {
8
+ /** Ícone a ser exibido no botão */
9
+ icon: ReactNode;
10
+ /** Tamanho do botão */
11
+ size?: 'sm' | 'md';
12
+ /** Estado de seleção/ativo do botão - permanece ativo até ser clicado novamente ou outro botão ser ativado */
13
+ active?: boolean;
14
+ /** Additional CSS classes to apply */
15
+ className?: string;
16
+ } & ButtonHTMLAttributes<HTMLButtonElement>;
17
+ /**
18
+ * IconButton component for Analytica Ensino platforms
19
+ *
20
+ * Um botão compacto apenas com ícone, ideal para menus dropdown,
21
+ * barras de ferramentas e ações secundárias.
22
+ * Oferece dois tamanhos com estilo consistente.
23
+ * Estado ativo permanece até ser clicado novamente ou outro botão ser ativado.
24
+ * Compatível com Next.js 15 e React 19.
25
+ * Suporta forwardRef para acesso programático ao elemento DOM.
26
+ *
27
+ * @param icon - O ícone a ser exibido no botão
28
+ * @param size - Tamanho do botão (sm, md)
29
+ * @param active - Estado ativo/selecionado do botão
30
+ * @param className - Classes CSS adicionais
31
+ * @param props - Todos os outros atributos HTML padrão de button
32
+ * @returns Um elemento button compacto estilizado apenas com ícone
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <IconButton
37
+ * icon={<MoreVerticalIcon />}
38
+ * size="sm"
39
+ * onClick={() => openMenu()}
40
+ * />
41
+ * ```
42
+ *
43
+ * @example
44
+ * ```tsx
45
+ * // Botão ativo em uma barra de ferramentas - permanece ativo até outro clique
46
+ * <IconButton
47
+ * icon={<BoldIcon />}
48
+ * active={isBold}
49
+ * onClick={toggleBold}
50
+ * />
51
+ * ```
52
+ *
53
+ * @example
54
+ * ```tsx
55
+ * // Usando ref para controle programático
56
+ * const buttonRef = useRef<HTMLButtonElement>(null);
57
+ *
58
+ * <IconButton
59
+ * ref={buttonRef}
60
+ * icon={<EditIcon />}
61
+ * size="md"
62
+ * onClick={() => startEditing()}
63
+ * />
64
+ * ```
65
+ */
66
+ declare const IconButton: react.ForwardRefExoticComponent<{
67
+ /** Ícone a ser exibido no botão */
68
+ icon: ReactNode;
69
+ /** Tamanho do botão */
70
+ size?: "sm" | "md";
71
+ /** Estado de seleção/ativo do botão - permanece ativo até ser clicado novamente ou outro botão ser ativado */
72
+ active?: boolean;
73
+ /** Additional CSS classes to apply */
74
+ className?: string;
75
+ } & ButtonHTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
76
+
77
+ export { IconButton, type IconButtonProps };
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/IconButton/IconButton.tsx
21
+ var IconButton_exports = {};
22
+ __export(IconButton_exports, {
23
+ IconButton: () => IconButton
24
+ });
25
+ module.exports = __toCommonJS(IconButton_exports);
26
+ var import_react = require("react");
27
+ var import_jsx_runtime = require("react/jsx-runtime");
28
+ var IconButton = (0, import_react.forwardRef)(
29
+ ({ icon, size = "md", active = false, className = "", disabled, ...props }, ref) => {
30
+ const baseClasses = [
31
+ "inline-flex",
32
+ "items-center",
33
+ "justify-center",
34
+ "rounded-lg",
35
+ "font-medium",
36
+ "bg-transparent",
37
+ "text-text-950",
38
+ "cursor-pointer",
39
+ "hover:bg-primary-600",
40
+ "hover:text-text",
41
+ "focus-visible:outline-none",
42
+ "focus-visible:ring-2",
43
+ "focus-visible:ring-offset-0",
44
+ "focus-visible:ring-indicator-info",
45
+ "disabled:opacity-50",
46
+ "disabled:cursor-not-allowed",
47
+ "disabled:pointer-events-none"
48
+ ];
49
+ const sizeClasses = {
50
+ sm: ["w-6", "h-6", "text-sm"],
51
+ md: ["w-10", "h-10", "text-base"]
52
+ };
53
+ const activeClasses = active ? ["!bg-primary-50", "!text-primary-950", "hover:!bg-primary-100"] : [];
54
+ const allClasses = [
55
+ ...baseClasses,
56
+ ...sizeClasses[size],
57
+ ...activeClasses
58
+ ].join(" ");
59
+ const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
60
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
61
+ "button",
62
+ {
63
+ ref,
64
+ type: "button",
65
+ className: `${allClasses} ${className}`,
66
+ disabled,
67
+ "aria-pressed": active,
68
+ "aria-label": ariaLabel,
69
+ ...props,
70
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "flex items-center justify-center", children: icon })
71
+ }
72
+ );
73
+ }
74
+ );
75
+ IconButton.displayName = "IconButton";
76
+ // Annotate the CommonJS export names for ESM import in node:
77
+ 0 && (module.exports = {
78
+ IconButton
79
+ });
@@ -0,0 +1,54 @@
1
+ // src/components/IconButton/IconButton.tsx
2
+ import { forwardRef } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var IconButton = forwardRef(
5
+ ({ icon, size = "md", active = false, className = "", disabled, ...props }, ref) => {
6
+ const baseClasses = [
7
+ "inline-flex",
8
+ "items-center",
9
+ "justify-center",
10
+ "rounded-lg",
11
+ "font-medium",
12
+ "bg-transparent",
13
+ "text-text-950",
14
+ "cursor-pointer",
15
+ "hover:bg-primary-600",
16
+ "hover:text-text",
17
+ "focus-visible:outline-none",
18
+ "focus-visible:ring-2",
19
+ "focus-visible:ring-offset-0",
20
+ "focus-visible:ring-indicator-info",
21
+ "disabled:opacity-50",
22
+ "disabled:cursor-not-allowed",
23
+ "disabled:pointer-events-none"
24
+ ];
25
+ const sizeClasses = {
26
+ sm: ["w-6", "h-6", "text-sm"],
27
+ md: ["w-10", "h-10", "text-base"]
28
+ };
29
+ const activeClasses = active ? ["!bg-primary-50", "!text-primary-950", "hover:!bg-primary-100"] : [];
30
+ const allClasses = [
31
+ ...baseClasses,
32
+ ...sizeClasses[size],
33
+ ...activeClasses
34
+ ].join(" ");
35
+ const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
36
+ return /* @__PURE__ */ jsx(
37
+ "button",
38
+ {
39
+ ref,
40
+ type: "button",
41
+ className: `${allClasses} ${className}`,
42
+ disabled,
43
+ "aria-pressed": active,
44
+ "aria-label": ariaLabel,
45
+ ...props,
46
+ children: /* @__PURE__ */ jsx("span", { className: "flex items-center justify-center", children: icon })
47
+ }
48
+ );
49
+ }
50
+ );
51
+ IconButton.displayName = "IconButton";
52
+ export {
53
+ IconButton
54
+ };
@@ -0,0 +1,35 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, ButtonHTMLAttributes } from 'react';
3
+
4
+ /**
5
+ * IconRoundedButton component props interface
6
+ */
7
+ type IconRoundedButtonProps = {
8
+ /** Ícone a ser exibido no botão */
9
+ icon: ReactNode;
10
+ /** Additional CSS classes to apply */
11
+ className?: string;
12
+ } & ButtonHTMLAttributes<HTMLButtonElement>;
13
+ /**
14
+ * IconRoundedButton component for Analytica Ensino platforms
15
+ *
16
+ * Um botão redondo simples que exibe apenas um ícone.
17
+ * Ideal para ações como navegação, fechar, editar, etc.
18
+ * Compatível com Next.js 15 e React 19.
19
+ *
20
+ * @param icon - O ícone a ser exibido no botão
21
+ * @param className - Classes CSS adicionais
22
+ * @param props - Todos os outros atributos HTML padrão de button
23
+ * @returns Um elemento button estilizado e redondo
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * <IconRoundedButton
28
+ * icon={<ChevronRightIcon />}
29
+ * onClick={() => console.log('clicked')}
30
+ * />
31
+ * ```
32
+ */
33
+ declare const IconRoundedButton: ({ icon, className, disabled, ...props }: IconRoundedButtonProps) => react_jsx_runtime.JSX.Element;
34
+
35
+ export { IconRoundedButton };
@@ -0,0 +1,35 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, ButtonHTMLAttributes } from 'react';
3
+
4
+ /**
5
+ * IconRoundedButton component props interface
6
+ */
7
+ type IconRoundedButtonProps = {
8
+ /** Ícone a ser exibido no botão */
9
+ icon: ReactNode;
10
+ /** Additional CSS classes to apply */
11
+ className?: string;
12
+ } & ButtonHTMLAttributes<HTMLButtonElement>;
13
+ /**
14
+ * IconRoundedButton component for Analytica Ensino platforms
15
+ *
16
+ * Um botão redondo simples que exibe apenas um ícone.
17
+ * Ideal para ações como navegação, fechar, editar, etc.
18
+ * Compatível com Next.js 15 e React 19.
19
+ *
20
+ * @param icon - O ícone a ser exibido no botão
21
+ * @param className - Classes CSS adicionais
22
+ * @param props - Todos os outros atributos HTML padrão de button
23
+ * @returns Um elemento button estilizado e redondo
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * <IconRoundedButton
28
+ * icon={<ChevronRightIcon />}
29
+ * onClick={() => console.log('clicked')}
30
+ * />
31
+ * ```
32
+ */
33
+ declare const IconRoundedButton: ({ icon, className, disabled, ...props }: IconRoundedButtonProps) => react_jsx_runtime.JSX.Element;
34
+
35
+ export { IconRoundedButton };
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/IconRoundedButton/IconRoundedButton.tsx
21
+ var IconRoundedButton_exports = {};
22
+ __export(IconRoundedButton_exports, {
23
+ IconRoundedButton: () => IconRoundedButton
24
+ });
25
+ module.exports = __toCommonJS(IconRoundedButton_exports);
26
+ var import_jsx_runtime = require("react/jsx-runtime");
27
+ var IconRoundedButton = ({
28
+ icon,
29
+ className = "",
30
+ disabled,
31
+ ...props
32
+ }) => {
33
+ const baseClasses = [
34
+ "inline-flex",
35
+ "items-center",
36
+ "justify-center",
37
+ "w-8",
38
+ "h-8",
39
+ "rounded-full",
40
+ "cursor-pointer",
41
+ "border",
42
+ "border-background-200",
43
+ "bg-background",
44
+ "text-text-950",
45
+ "hover:shadow-hard-shadow-1",
46
+ "focus-visible:outline-none",
47
+ "focus-visible:shadow-hard-shadow-1",
48
+ "focus-visible:ring-2",
49
+ "focus-visible:ring-indicator-info",
50
+ "focus-visible:ring-offset-0",
51
+ "disabled:opacity-50",
52
+ "disabled:cursor-not-allowed"
53
+ ].join(" ");
54
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
55
+ "button",
56
+ {
57
+ type: "button",
58
+ className: `${baseClasses} ${className}`,
59
+ disabled,
60
+ ...props,
61
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "flex items-center justify-center w-5 h-5", children: icon })
62
+ }
63
+ );
64
+ };
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ IconRoundedButton
68
+ });