analytica-frontend-lib 1.0.22 → 1.0.24
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/chunk-CETSS3RA.mjs +52 -0
- package/dist/chunk-GSEO6POW.mjs +93 -0
- package/dist/chunk-IB4IJ3GF.mjs +60 -0
- package/dist/chunk-IH5TEC64.mjs +35 -0
- package/dist/chunk-JNPCNN67.mjs +86 -0
- package/dist/chunk-KT6HNGRV.mjs +241 -0
- package/dist/chunk-LYOJCBOM.mjs +195 -0
- package/dist/chunk-MI5FIRHM.mjs +75 -0
- package/dist/chunk-NWGRQN6R.mjs +108 -0
- package/dist/chunk-QODEDLAX.mjs +142 -0
- package/dist/chunk-QOFMTSHE.mjs +44 -0
- package/dist/chunk-RPYPJ5O5.mjs +55 -0
- package/dist/chunk-SESX5OEP.mjs +57 -0
- package/dist/chunk-TT3VCQGR.mjs +53 -0
- package/dist/chunk-WIOCQOM7.mjs +20 -0
- package/dist/client-components.d.mts +9 -0
- package/dist/client-components.d.ts +9 -0
- package/dist/client-components.js +755 -0
- package/dist/client-components.mjs +39 -0
- package/dist/components/Alert/Alert.d.mts +13 -0
- package/dist/components/Alert/Alert.d.ts +13 -0
- package/dist/components/Alert/Alert.js +158 -0
- package/dist/components/Alert/Alert.mjs +7 -0
- package/dist/components/Badge/Badge.d.mts +47 -0
- package/dist/components/Badge/Badge.d.ts +47 -0
- package/dist/components/Badge/Badge.js +117 -0
- package/dist/components/Badge/Badge.mjs +6 -0
- package/dist/components/Button/Button.d.mts +46 -0
- package/dist/components/Button/Button.d.ts +46 -0
- package/dist/components/Button/Button.js +84 -0
- package/dist/components/Button/Button.mjs +6 -0
- package/dist/components/CheckBox/CheckBox.d.mts +74 -0
- package/dist/components/CheckBox/CheckBox.d.ts +74 -0
- package/dist/components/CheckBox/CheckBox.js +264 -0
- package/dist/components/CheckBox/CheckBox.mjs +8 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.mts +29 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +29 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +262 -0
- package/dist/components/DropdownMenu/DropdownMenu.mjs +17 -0
- package/dist/components/IconButton/IconButton.d.mts +77 -0
- package/dist/components/IconButton/IconButton.d.ts +77 -0
- package/dist/components/IconButton/IconButton.js +79 -0
- package/dist/components/IconButton/IconButton.mjs +6 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.d.mts +35 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.d.ts +35 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.js +68 -0
- package/dist/components/IconRoundedButton/IconRoundedButton.mjs +6 -0
- package/dist/components/NavButton/NavButton.d.mts +58 -0
- package/dist/components/NavButton/NavButton.d.ts +58 -0
- package/dist/components/NavButton/NavButton.js +76 -0
- package/dist/components/NavButton/NavButton.mjs +6 -0
- package/dist/components/SelectionButton/SelectionButton.d.mts +58 -0
- package/dist/components/SelectionButton/SelectionButton.d.ts +58 -0
- package/dist/components/SelectionButton/SelectionButton.js +81 -0
- package/dist/components/SelectionButton/SelectionButton.mjs +6 -0
- package/dist/components/Table/Table.d.mts +17 -0
- package/dist/components/Table/Table.d.ts +17 -0
- package/dist/components/Table/Table.js +139 -0
- package/dist/components/Table/Table.mjs +20 -0
- package/dist/components/Text/Text.d.mts +59 -0
- package/dist/components/Text/Text.d.ts +59 -0
- package/dist/components/Text/Text.js +77 -0
- package/dist/components/Text/Text.mjs +6 -0
- package/dist/components/TextArea/TextArea.d.mts +69 -0
- package/dist/components/TextArea/TextArea.d.ts +69 -0
- package/dist/components/TextArea/TextArea.js +211 -0
- package/dist/components/TextArea/TextArea.mjs +8 -0
- package/dist/components/Toast/Toast.d.mts +17 -0
- package/dist/components/Toast/Toast.d.ts +17 -0
- package/dist/components/Toast/Toast.js +100 -0
- package/dist/components/Toast/Toast.mjs +7 -0
- package/dist/components/Toast/utils/ToastStore.d.mts +19 -0
- package/dist/components/Toast/utils/ToastStore.d.ts +19 -0
- package/dist/components/Toast/utils/ToastStore.js +44 -0
- package/dist/components/Toast/utils/ToastStore.mjs +6 -0
- package/dist/components/Toast/utils/Toaster.d.mts +11 -0
- package/dist/components/Toast/utils/Toaster.d.ts +11 -0
- package/dist/components/Toast/utils/Toaster.js +145 -0
- package/dist/components/Toast/utils/Toaster.mjs +11 -0
- package/dist/index.d.mts +168 -355
- package/dist/index.d.ts +168 -355
- package/dist/index.js +341 -936
- package/dist/index.mjs +340 -941
- package/dist/server-components.d.mts +11 -0
- package/dist/server-components.d.ts +11 -0
- package/dist/server-components.js +629 -0
- package/dist/server-components.mjs +52 -0
- package/package.json +76 -3
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* NavButton component for Analytica Ensino platforms
|
|
6
|
+
*
|
|
7
|
+
* Um botão de navegação com ícone e texto para navegação principal.
|
|
8
|
+
* Ideal para menus de navegação, sidebar, tabs de navegação, etc.
|
|
9
|
+
* Compatível com Next.js 15 e React 19.
|
|
10
|
+
* Suporta forwardRef para acesso programático ao elemento DOM.
|
|
11
|
+
*
|
|
12
|
+
* @param icon - O ícone a ser exibido no botão
|
|
13
|
+
* @param label - O texto/label a ser exibido
|
|
14
|
+
* @param selected - Estado de seleção do botão
|
|
15
|
+
* @param className - Classes CSS adicionais
|
|
16
|
+
* @param props - Todos os outros atributos HTML padrão de button
|
|
17
|
+
* @returns Um elemento button estilizado para navegação
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <NavButton
|
|
22
|
+
* icon={<HomeIcon />}
|
|
23
|
+
* label="Início"
|
|
24
|
+
* selected={false}
|
|
25
|
+
* onClick={() => navigate('/')}
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // Usando ref para foco programático
|
|
32
|
+
* const buttonRef = useRef<HTMLButtonElement>(null);
|
|
33
|
+
*
|
|
34
|
+
* const handleFocus = () => {
|
|
35
|
+
* buttonRef.current?.focus();
|
|
36
|
+
* };
|
|
37
|
+
*
|
|
38
|
+
* <NavButton
|
|
39
|
+
* ref={buttonRef}
|
|
40
|
+
* icon={<HomeIcon />}
|
|
41
|
+
* label="Dashboard"
|
|
42
|
+
* selected={isActive}
|
|
43
|
+
* onClick={() => setActiveTab('dashboard')}
|
|
44
|
+
* />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare const NavButton: react.ForwardRefExoticComponent<{
|
|
48
|
+
/** Ícone a ser exibido no botão */
|
|
49
|
+
icon: ReactNode;
|
|
50
|
+
/** Texto/label a ser exibido ao lado do ícone */
|
|
51
|
+
label: string;
|
|
52
|
+
/** Estado de seleção do botão */
|
|
53
|
+
selected?: boolean;
|
|
54
|
+
/** Additional CSS classes to apply */
|
|
55
|
+
className?: string;
|
|
56
|
+
} & ButtonHTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
|
|
57
|
+
|
|
58
|
+
export { NavButton };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* NavButton component for Analytica Ensino platforms
|
|
6
|
+
*
|
|
7
|
+
* Um botão de navegação com ícone e texto para navegação principal.
|
|
8
|
+
* Ideal para menus de navegação, sidebar, tabs de navegação, etc.
|
|
9
|
+
* Compatível com Next.js 15 e React 19.
|
|
10
|
+
* Suporta forwardRef para acesso programático ao elemento DOM.
|
|
11
|
+
*
|
|
12
|
+
* @param icon - O ícone a ser exibido no botão
|
|
13
|
+
* @param label - O texto/label a ser exibido
|
|
14
|
+
* @param selected - Estado de seleção do botão
|
|
15
|
+
* @param className - Classes CSS adicionais
|
|
16
|
+
* @param props - Todos os outros atributos HTML padrão de button
|
|
17
|
+
* @returns Um elemento button estilizado para navegação
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <NavButton
|
|
22
|
+
* icon={<HomeIcon />}
|
|
23
|
+
* label="Início"
|
|
24
|
+
* selected={false}
|
|
25
|
+
* onClick={() => navigate('/')}
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // Usando ref para foco programático
|
|
32
|
+
* const buttonRef = useRef<HTMLButtonElement>(null);
|
|
33
|
+
*
|
|
34
|
+
* const handleFocus = () => {
|
|
35
|
+
* buttonRef.current?.focus();
|
|
36
|
+
* };
|
|
37
|
+
*
|
|
38
|
+
* <NavButton
|
|
39
|
+
* ref={buttonRef}
|
|
40
|
+
* icon={<HomeIcon />}
|
|
41
|
+
* label="Dashboard"
|
|
42
|
+
* selected={isActive}
|
|
43
|
+
* onClick={() => setActiveTab('dashboard')}
|
|
44
|
+
* />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare const NavButton: react.ForwardRefExoticComponent<{
|
|
48
|
+
/** Ícone a ser exibido no botão */
|
|
49
|
+
icon: ReactNode;
|
|
50
|
+
/** Texto/label a ser exibido ao lado do ícone */
|
|
51
|
+
label: string;
|
|
52
|
+
/** Estado de seleção do botão */
|
|
53
|
+
selected?: boolean;
|
|
54
|
+
/** Additional CSS classes to apply */
|
|
55
|
+
className?: string;
|
|
56
|
+
} & ButtonHTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
|
|
57
|
+
|
|
58
|
+
export { NavButton };
|
|
@@ -0,0 +1,76 @@
|
|
|
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/NavButton/NavButton.tsx
|
|
21
|
+
var NavButton_exports = {};
|
|
22
|
+
__export(NavButton_exports, {
|
|
23
|
+
NavButton: () => NavButton
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(NavButton_exports);
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
var NavButton = (0, import_react.forwardRef)(
|
|
29
|
+
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
30
|
+
const baseClasses = [
|
|
31
|
+
"flex",
|
|
32
|
+
"flex-col",
|
|
33
|
+
"items-center",
|
|
34
|
+
"justify-center",
|
|
35
|
+
"gap-0.5",
|
|
36
|
+
"px-12",
|
|
37
|
+
"py-1",
|
|
38
|
+
"rounded-sm",
|
|
39
|
+
"cursor-pointer",
|
|
40
|
+
"text-text-950",
|
|
41
|
+
"text-xs",
|
|
42
|
+
"font-medium",
|
|
43
|
+
"hover:text-text",
|
|
44
|
+
"hover:bg-primary-600",
|
|
45
|
+
"focus-visible:outline-none",
|
|
46
|
+
"focus-visible:ring-2",
|
|
47
|
+
"focus-visible:ring-offset-0",
|
|
48
|
+
"focus-visible:ring-indicator-info",
|
|
49
|
+
"disabled:opacity-50",
|
|
50
|
+
"disabled:cursor-not-allowed",
|
|
51
|
+
"disabled:pointer-events-none"
|
|
52
|
+
];
|
|
53
|
+
const stateClasses = selected ? ["bg-primary-50", "text-primary-950"] : [];
|
|
54
|
+
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
56
|
+
"button",
|
|
57
|
+
{
|
|
58
|
+
ref,
|
|
59
|
+
type: "button",
|
|
60
|
+
className: `${allClasses} ${className}`,
|
|
61
|
+
disabled,
|
|
62
|
+
"aria-pressed": selected,
|
|
63
|
+
...props,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "flex items-center justify-center w-5 h-5", children: icon }),
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "whitespace-nowrap", children: label })
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
NavButton.displayName = "NavButton";
|
|
73
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
74
|
+
0 && (module.exports = {
|
|
75
|
+
NavButton
|
|
76
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* SelectionButton component for Analytica Ensino platforms
|
|
6
|
+
*
|
|
7
|
+
* Um botão com ícone e texto para ações e navegação com estado de seleção.
|
|
8
|
+
* Ideal para filtros, tags, categorias, seleção de tipos, etc.
|
|
9
|
+
* Compatível com Next.js 15 e React 19.
|
|
10
|
+
* Suporta forwardRef para acesso programático ao elemento DOM.
|
|
11
|
+
*
|
|
12
|
+
* @param icon - O ícone a ser exibido no botão
|
|
13
|
+
* @param label - O texto/label a ser exibido
|
|
14
|
+
* @param selected - Estado de seleção do botão
|
|
15
|
+
* @param className - Classes CSS adicionais
|
|
16
|
+
* @param props - Todos os outros atributos HTML padrão de button
|
|
17
|
+
* @returns Um elemento button estilizado
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <SelectionButton
|
|
22
|
+
* icon={<TagIcon />}
|
|
23
|
+
* label="Categoria"
|
|
24
|
+
* selected={false}
|
|
25
|
+
* onClick={() => handleSelection()}
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // Usando ref para foco programático
|
|
32
|
+
* const buttonRef = useRef<HTMLButtonElement>(null);
|
|
33
|
+
*
|
|
34
|
+
* const handleFocus = () => {
|
|
35
|
+
* buttonRef.current?.focus();
|
|
36
|
+
* };
|
|
37
|
+
*
|
|
38
|
+
* <SelectionButton
|
|
39
|
+
* ref={buttonRef}
|
|
40
|
+
* icon={<TagIcon />}
|
|
41
|
+
* label="Categoria"
|
|
42
|
+
* selected={isSelected}
|
|
43
|
+
* onClick={() => setSelected(!isSelected)}
|
|
44
|
+
* />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare const SelectionButton: react.ForwardRefExoticComponent<{
|
|
48
|
+
/** Ícone a ser exibido no botão */
|
|
49
|
+
icon: ReactNode;
|
|
50
|
+
/** Texto/label a ser exibido ao lado do ícone */
|
|
51
|
+
label: string;
|
|
52
|
+
/** Estado de seleção do botão */
|
|
53
|
+
selected?: boolean;
|
|
54
|
+
/** Additional CSS classes to apply */
|
|
55
|
+
className?: string;
|
|
56
|
+
} & ButtonHTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
|
|
57
|
+
|
|
58
|
+
export { SelectionButton };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* SelectionButton component for Analytica Ensino platforms
|
|
6
|
+
*
|
|
7
|
+
* Um botão com ícone e texto para ações e navegação com estado de seleção.
|
|
8
|
+
* Ideal para filtros, tags, categorias, seleção de tipos, etc.
|
|
9
|
+
* Compatível com Next.js 15 e React 19.
|
|
10
|
+
* Suporta forwardRef para acesso programático ao elemento DOM.
|
|
11
|
+
*
|
|
12
|
+
* @param icon - O ícone a ser exibido no botão
|
|
13
|
+
* @param label - O texto/label a ser exibido
|
|
14
|
+
* @param selected - Estado de seleção do botão
|
|
15
|
+
* @param className - Classes CSS adicionais
|
|
16
|
+
* @param props - Todos os outros atributos HTML padrão de button
|
|
17
|
+
* @returns Um elemento button estilizado
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <SelectionButton
|
|
22
|
+
* icon={<TagIcon />}
|
|
23
|
+
* label="Categoria"
|
|
24
|
+
* selected={false}
|
|
25
|
+
* onClick={() => handleSelection()}
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // Usando ref para foco programático
|
|
32
|
+
* const buttonRef = useRef<HTMLButtonElement>(null);
|
|
33
|
+
*
|
|
34
|
+
* const handleFocus = () => {
|
|
35
|
+
* buttonRef.current?.focus();
|
|
36
|
+
* };
|
|
37
|
+
*
|
|
38
|
+
* <SelectionButton
|
|
39
|
+
* ref={buttonRef}
|
|
40
|
+
* icon={<TagIcon />}
|
|
41
|
+
* label="Categoria"
|
|
42
|
+
* selected={isSelected}
|
|
43
|
+
* onClick={() => setSelected(!isSelected)}
|
|
44
|
+
* />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare const SelectionButton: react.ForwardRefExoticComponent<{
|
|
48
|
+
/** Ícone a ser exibido no botão */
|
|
49
|
+
icon: ReactNode;
|
|
50
|
+
/** Texto/label a ser exibido ao lado do ícone */
|
|
51
|
+
label: string;
|
|
52
|
+
/** Estado de seleção do botão */
|
|
53
|
+
selected?: boolean;
|
|
54
|
+
/** Additional CSS classes to apply */
|
|
55
|
+
className?: string;
|
|
56
|
+
} & ButtonHTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
|
|
57
|
+
|
|
58
|
+
export { SelectionButton };
|
|
@@ -0,0 +1,81 @@
|
|
|
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/SelectionButton/SelectionButton.tsx
|
|
21
|
+
var SelectionButton_exports = {};
|
|
22
|
+
__export(SelectionButton_exports, {
|
|
23
|
+
SelectionButton: () => SelectionButton
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(SelectionButton_exports);
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
var SelectionButton = (0, import_react.forwardRef)(
|
|
29
|
+
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
30
|
+
const baseClasses = [
|
|
31
|
+
"inline-flex",
|
|
32
|
+
"items-center",
|
|
33
|
+
"justify-start",
|
|
34
|
+
"gap-2",
|
|
35
|
+
"p-4",
|
|
36
|
+
"rounded-xl",
|
|
37
|
+
"cursor-pointer",
|
|
38
|
+
"border",
|
|
39
|
+
"border-border-50",
|
|
40
|
+
"bg-background",
|
|
41
|
+
"text-sm",
|
|
42
|
+
"text-text-700",
|
|
43
|
+
"font-bold",
|
|
44
|
+
"shadow-soft-shadow-1",
|
|
45
|
+
"hover:bg-background-100",
|
|
46
|
+
"focus-visible:outline-none",
|
|
47
|
+
"focus-visible:ring-2",
|
|
48
|
+
"focus-visible:ring-indicator-info",
|
|
49
|
+
"focus-visible:ring-offset-0",
|
|
50
|
+
"focus-visible:shadow-none",
|
|
51
|
+
"active:ring-2",
|
|
52
|
+
"active:ring-primary-950",
|
|
53
|
+
"active:ring-offset-0",
|
|
54
|
+
"active:shadow-none",
|
|
55
|
+
"disabled:opacity-50",
|
|
56
|
+
"disabled:cursor-not-allowed"
|
|
57
|
+
];
|
|
58
|
+
const stateClasses = selected ? ["ring-primary-950", "ring-2", "ring-offset-0", "shadow-none"] : [];
|
|
59
|
+
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
61
|
+
"button",
|
|
62
|
+
{
|
|
63
|
+
ref,
|
|
64
|
+
type: "button",
|
|
65
|
+
className: `${allClasses} ${className}`,
|
|
66
|
+
disabled,
|
|
67
|
+
"aria-pressed": selected,
|
|
68
|
+
...props,
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "flex items-center justify-center w-6 h-6", children: icon }),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: label })
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
SelectionButton.displayName = "SelectionButton";
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
SelectionButton
|
|
81
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, TdHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type TableRowState = 'default' | 'selected' | 'invalid' | 'disabled';
|
|
5
|
+
interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
|
|
6
|
+
state?: TableRowState;
|
|
7
|
+
}
|
|
8
|
+
declare const Table: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableElement> & react.RefAttributes<HTMLTableElement>>;
|
|
9
|
+
declare const TableHeader: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
10
|
+
declare const TableBody: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
11
|
+
declare const TableFooter: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
12
|
+
declare const TableRow: react.ForwardRefExoticComponent<TableRowProps & react.RefAttributes<HTMLTableRowElement>>;
|
|
13
|
+
declare const TableHead: react.ForwardRefExoticComponent<TdHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>>;
|
|
14
|
+
declare const TableCell: react.ForwardRefExoticComponent<TdHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>>;
|
|
15
|
+
declare const TableCaption: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableCaptionElement> & react.RefAttributes<HTMLTableCaptionElement>>;
|
|
16
|
+
|
|
17
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, TdHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type TableRowState = 'default' | 'selected' | 'invalid' | 'disabled';
|
|
5
|
+
interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
|
|
6
|
+
state?: TableRowState;
|
|
7
|
+
}
|
|
8
|
+
declare const Table: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableElement> & react.RefAttributes<HTMLTableElement>>;
|
|
9
|
+
declare const TableHeader: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
10
|
+
declare const TableBody: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
11
|
+
declare const TableFooter: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
12
|
+
declare const TableRow: react.ForwardRefExoticComponent<TableRowProps & react.RefAttributes<HTMLTableRowElement>>;
|
|
13
|
+
declare const TableHead: react.ForwardRefExoticComponent<TdHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>>;
|
|
14
|
+
declare const TableCell: react.ForwardRefExoticComponent<TdHTMLAttributes<HTMLTableCellElement> & react.RefAttributes<HTMLTableCellElement>>;
|
|
15
|
+
declare const TableCaption: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableCaptionElement> & react.RefAttributes<HTMLTableCaptionElement>>;
|
|
16
|
+
|
|
17
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -0,0 +1,139 @@
|
|
|
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/Table/Table.tsx
|
|
21
|
+
var Table_exports = {};
|
|
22
|
+
__export(Table_exports, {
|
|
23
|
+
Table: () => Table,
|
|
24
|
+
TableBody: () => TableBody,
|
|
25
|
+
TableCaption: () => TableCaption,
|
|
26
|
+
TableCell: () => TableCell,
|
|
27
|
+
TableFooter: () => TableFooter,
|
|
28
|
+
TableHead: () => TableHead,
|
|
29
|
+
TableHeader: () => TableHeader,
|
|
30
|
+
TableRow: () => TableRow
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(Table_exports);
|
|
33
|
+
var import_react = require("react");
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var Table = (0, import_react.forwardRef)(
|
|
36
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "border border-border-200 rounded-xl relative w-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
37
|
+
"table",
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
className: `w-full caption-bottom text-sm ${className ?? ""}`,
|
|
41
|
+
...props,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("caption", { className: "sr-only", children: "My Table" }),
|
|
44
|
+
children
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
) })
|
|
48
|
+
);
|
|
49
|
+
Table.displayName = "Table";
|
|
50
|
+
var TableHeader = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
"thead",
|
|
52
|
+
{
|
|
53
|
+
ref,
|
|
54
|
+
className: `[&_tr:first-child]:border-0 ${className}`,
|
|
55
|
+
...props
|
|
56
|
+
}
|
|
57
|
+
));
|
|
58
|
+
TableHeader.displayName = "TableHeader";
|
|
59
|
+
var TableBody = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
"tbody",
|
|
61
|
+
{
|
|
62
|
+
ref,
|
|
63
|
+
className: `[&_tr:last-child]:border-0 border-t border-border-200 ${className}`,
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
));
|
|
67
|
+
TableBody.displayName = "TableBody";
|
|
68
|
+
var TableFooter = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
|
+
"tfoot",
|
|
70
|
+
{
|
|
71
|
+
ref,
|
|
72
|
+
className: `border-t bg-background-50 border-border-200 font-medium [&>tr]:last:border-b-0 px-6 py-3.5 ${className}`,
|
|
73
|
+
...props
|
|
74
|
+
}
|
|
75
|
+
));
|
|
76
|
+
TableFooter.displayName = "TableFooter";
|
|
77
|
+
var VARIANT_STATES_ROW = {
|
|
78
|
+
default: "border-b border-border-200",
|
|
79
|
+
selected: "border-b-2 border-indicator-primary",
|
|
80
|
+
invalid: "border-b-2 border-indicator-error",
|
|
81
|
+
disabled: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed"
|
|
82
|
+
};
|
|
83
|
+
var TableRow = (0, import_react.forwardRef)(
|
|
84
|
+
({ state = "default", className, ...props }, ref) => {
|
|
85
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
86
|
+
"tr",
|
|
87
|
+
{
|
|
88
|
+
ref,
|
|
89
|
+
className: `
|
|
90
|
+
transition-colors
|
|
91
|
+
${state !== "disabled" ? "hover:bg-muted/50" : ""}
|
|
92
|
+
${VARIANT_STATES_ROW[state]}
|
|
93
|
+
${className}
|
|
94
|
+
`,
|
|
95
|
+
"aria-disabled": state === "disabled",
|
|
96
|
+
...props
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
TableRow.displayName = "TableRow";
|
|
102
|
+
var TableHead = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
103
|
+
"th",
|
|
104
|
+
{
|
|
105
|
+
ref,
|
|
106
|
+
className: `h-10 px-6 py-3.5 bg-bg-secondary bg-muted/50 text-left align-middle font-bold text-text-800 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] ${className}`,
|
|
107
|
+
...props
|
|
108
|
+
}
|
|
109
|
+
));
|
|
110
|
+
TableHead.displayName = "TableHead";
|
|
111
|
+
var TableCell = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
112
|
+
"td",
|
|
113
|
+
{
|
|
114
|
+
ref,
|
|
115
|
+
className: `p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-md text-text-800 px-6 py-3.5 ${className}`,
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
));
|
|
119
|
+
TableCell.displayName = "TableCell";
|
|
120
|
+
var TableCaption = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
121
|
+
"caption",
|
|
122
|
+
{
|
|
123
|
+
ref,
|
|
124
|
+
className: `border-t border-border-200 text-sm text-text-800 px-6 py-3.5 ${className}`,
|
|
125
|
+
...props
|
|
126
|
+
}
|
|
127
|
+
));
|
|
128
|
+
TableCaption.displayName = "TableCaption";
|
|
129
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
130
|
+
0 && (module.exports = {
|
|
131
|
+
Table,
|
|
132
|
+
TableBody,
|
|
133
|
+
TableCaption,
|
|
134
|
+
TableCell,
|
|
135
|
+
TableFooter,
|
|
136
|
+
TableHead,
|
|
137
|
+
TableHeader,
|
|
138
|
+
TableRow
|
|
139
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Table,
|
|
3
|
+
TableBody,
|
|
4
|
+
TableCaption,
|
|
5
|
+
TableCell,
|
|
6
|
+
TableFooter,
|
|
7
|
+
TableHead,
|
|
8
|
+
TableHeader,
|
|
9
|
+
TableRow
|
|
10
|
+
} from "../../chunk-NWGRQN6R.mjs";
|
|
11
|
+
export {
|
|
12
|
+
Table,
|
|
13
|
+
TableBody,
|
|
14
|
+
TableCaption,
|
|
15
|
+
TableCell,
|
|
16
|
+
TableFooter,
|
|
17
|
+
TableHead,
|
|
18
|
+
TableHeader,
|
|
19
|
+
TableRow
|
|
20
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ElementType, ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Base text component props
|
|
6
|
+
*/
|
|
7
|
+
type BaseTextProps = {
|
|
8
|
+
/** Content to be displayed */
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
/** Text size variant */
|
|
11
|
+
size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl';
|
|
12
|
+
/** Font weight variant */
|
|
13
|
+
weight?: 'hairline' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black';
|
|
14
|
+
/** Color variant - white for light backgrounds, black for dark backgrounds */
|
|
15
|
+
color?: string;
|
|
16
|
+
/** Additional CSS classes to apply */
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Polymorphic text component props that ensures type safety based on the 'as' prop
|
|
21
|
+
*/
|
|
22
|
+
type TextProps<T extends ElementType = 'p'> = BaseTextProps & {
|
|
23
|
+
/** HTML tag to render */
|
|
24
|
+
as?: T;
|
|
25
|
+
} & Omit<ComponentPropsWithoutRef<T>, keyof BaseTextProps>;
|
|
26
|
+
/**
|
|
27
|
+
* Text component for Analytica Ensino platforms
|
|
28
|
+
*
|
|
29
|
+
* A flexible polymorphic text component with multiple sizes, weights, and colors.
|
|
30
|
+
* Automatically adapts to dark and light themes with full type safety.
|
|
31
|
+
* Fully compatible with Next.js 15 and React 19.
|
|
32
|
+
*
|
|
33
|
+
* @param children - The content to display
|
|
34
|
+
* @param size - The text size variant (2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl)
|
|
35
|
+
* @param weight - The font weight variant (hairline, light, normal, medium, semibold, bold, extrabold, black)
|
|
36
|
+
* @param color - The color variant - adapts to theme
|
|
37
|
+
* @param as - The HTML tag to render - determines allowed attributes via TypeScript
|
|
38
|
+
* @param className - Additional CSS classes
|
|
39
|
+
* @param props - HTML attributes valid for the chosen tag only
|
|
40
|
+
* @returns A styled text element with type-safe attributes
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <Text size="lg" weight="bold" color="text-info-800">
|
|
45
|
+
* This is a large, bold text
|
|
46
|
+
* </Text>
|
|
47
|
+
*
|
|
48
|
+
* <Text as="a" href="/link" target="_blank">
|
|
49
|
+
* Link with type-safe anchor attributes
|
|
50
|
+
* </Text>
|
|
51
|
+
*
|
|
52
|
+
* <Text as="button" onClick={handleClick} disabled>
|
|
53
|
+
* Button with type-safe button attributes
|
|
54
|
+
* </Text>
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
declare const Text: <T extends ElementType = "p">({ children, size, weight, color, as, className, ...props }: TextProps<T>) => react_jsx_runtime.JSX.Element;
|
|
58
|
+
|
|
59
|
+
export { Text };
|