flysoft-react-ui 0.4.0 → 0.5.2
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/App.d.ts.map +1 -1
- package/dist/App.js +20 -4
- package/dist/components/form-controls/AutocompleteInput.d.ts +11 -3
- package/dist/components/form-controls/AutocompleteInput.d.ts.map +1 -1
- package/dist/components/form-controls/AutocompleteInput.js +410 -31
- package/dist/components/form-controls/Button.js +1 -1
- package/dist/components/form-controls/Checkbox.d.ts +14 -0
- package/dist/components/form-controls/Checkbox.d.ts.map +1 -0
- package/dist/components/form-controls/Checkbox.js +77 -0
- package/dist/components/form-controls/DateInput.d.ts +20 -4
- package/dist/components/form-controls/DateInput.d.ts.map +1 -1
- package/dist/components/form-controls/DateInput.js +425 -70
- package/dist/components/form-controls/DatePicker.d.ts +4 -3
- package/dist/components/form-controls/DatePicker.d.ts.map +1 -1
- package/dist/components/form-controls/DatePicker.js +26 -30
- package/dist/components/form-controls/Input.d.ts +10 -1
- package/dist/components/form-controls/Input.d.ts.map +1 -1
- package/dist/components/form-controls/Input.js +16 -10
- package/dist/components/form-controls/Pagination.d.ts +1 -0
- package/dist/components/form-controls/Pagination.d.ts.map +1 -1
- package/dist/components/form-controls/Pagination.js +3 -40
- package/dist/components/form-controls/RadioButtonGroup.d.ts +62 -0
- package/dist/components/form-controls/RadioButtonGroup.d.ts.map +1 -0
- package/dist/components/form-controls/RadioButtonGroup.js +220 -0
- package/dist/components/form-controls/SearchSelectInput-OLD.d.ts +68 -0
- package/dist/components/form-controls/SearchSelectInput-OLD.d.ts.map +1 -0
- package/dist/components/form-controls/SearchSelectInput-OLD.js +962 -0
- package/dist/components/form-controls/SearchSelectInput.d.ts +70 -0
- package/dist/components/form-controls/SearchSelectInput.d.ts.map +1 -0
- package/dist/components/form-controls/SearchSelectInput.js +335 -0
- package/dist/components/form-controls/index.d.ts +7 -1
- package/dist/components/form-controls/index.d.ts.map +1 -1
- package/dist/components/form-controls/index.js +3 -0
- package/dist/components/layout/AppLayout.d.ts +3 -2
- package/dist/components/layout/AppLayout.d.ts.map +1 -1
- package/dist/components/layout/AppLayout.js +104 -31
- package/dist/components/layout/Card.d.ts +4 -1
- package/dist/components/layout/Card.d.ts.map +1 -1
- package/dist/components/layout/Card.js +30 -1
- package/dist/components/layout/Collection.js +1 -1
- package/dist/components/layout/DataTable.d.ts +29 -0
- package/dist/components/layout/DataTable.d.ts.map +1 -0
- package/dist/components/layout/DataTable.js +165 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +1 -0
- package/dist/components/utils/Avatar.d.ts +49 -0
- package/dist/components/utils/Avatar.d.ts.map +1 -0
- package/dist/components/utils/Avatar.js +93 -0
- package/dist/components/utils/Badge.d.ts +3 -0
- package/dist/components/utils/Badge.d.ts.map +1 -1
- package/dist/components/utils/Badge.js +130 -26
- package/dist/components/utils/Dialog.d.ts.map +1 -1
- package/dist/components/utils/Dialog.js +5 -1
- package/dist/components/utils/DropdownMenu.d.ts +25 -0
- package/dist/components/utils/DropdownMenu.d.ts.map +1 -0
- package/dist/components/utils/DropdownMenu.js +145 -0
- package/dist/components/utils/Filter.d.ts +57 -0
- package/dist/components/utils/Filter.d.ts.map +1 -0
- package/dist/components/utils/Filter.js +580 -0
- package/dist/components/utils/FiltersDialog.d.ts +21 -0
- package/dist/components/utils/FiltersDialog.d.ts.map +1 -0
- package/dist/components/utils/FiltersDialog.js +104 -0
- package/dist/components/utils/Loader.js +1 -1
- package/dist/components/utils/RoadMap.d.ts +59 -0
- package/dist/components/utils/RoadMap.d.ts.map +1 -0
- package/dist/components/utils/RoadMap.js +138 -0
- package/dist/components/utils/Snackbar.d.ts +13 -0
- package/dist/components/utils/Snackbar.d.ts.map +1 -0
- package/dist/components/utils/Snackbar.js +121 -0
- package/dist/components/utils/SnackbarContainer.d.ts +7 -0
- package/dist/components/utils/SnackbarContainer.d.ts.map +1 -0
- package/dist/components/utils/SnackbarContainer.js +25 -0
- package/dist/components/utils/index.d.ts +12 -0
- package/dist/components/utils/index.d.ts.map +1 -1
- package/dist/components/utils/index.js +6 -0
- package/dist/contexts/AppLayoutContext.d.ts +40 -0
- package/dist/contexts/AppLayoutContext.d.ts.map +1 -0
- package/dist/contexts/AppLayoutContext.js +98 -0
- package/dist/contexts/ListCrudContext.d.ts +29 -0
- package/dist/contexts/ListCrudContext.d.ts.map +1 -0
- package/dist/contexts/ListCrudContext.js +209 -0
- package/dist/contexts/SnackbarContext.d.ts +26 -0
- package/dist/contexts/SnackbarContext.d.ts.map +1 -0
- package/dist/contexts/SnackbarContext.js +34 -0
- package/dist/contexts/index.d.ts +6 -0
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/contexts/index.js +6 -0
- package/dist/contexts/presets.js +6 -6
- package/dist/docs/AuthDocs.tsx/AuthDocsContent.js +3 -1
- package/dist/docs/AvatarDocs.d.ts +4 -0
- package/dist/docs/AvatarDocs.d.ts.map +1 -0
- package/dist/docs/AvatarDocs.js +7 -0
- package/dist/docs/BadgeDocs.d.ts.map +1 -1
- package/dist/docs/BadgeDocs.js +4 -2
- package/dist/docs/CardDocs.d.ts.map +1 -1
- package/dist/docs/CardDocs.js +7 -1
- package/dist/docs/CheckboxDocs.d.ts +4 -0
- package/dist/docs/CheckboxDocs.d.ts.map +1 -0
- package/dist/docs/CheckboxDocs.js +7 -0
- package/dist/docs/DataTableDocs.d.ts +4 -0
- package/dist/docs/DataTableDocs.d.ts.map +1 -0
- package/dist/docs/DataTableDocs.js +244 -0
- package/dist/docs/DateInputDocs.d.ts +1 -0
- package/dist/docs/DateInputDocs.d.ts.map +1 -1
- package/dist/docs/DateInputDocs.js +7 -9
- package/dist/docs/DatePickerDocs.d.ts +1 -0
- package/dist/docs/DatePickerDocs.d.ts.map +1 -1
- package/dist/docs/DatePickerDocs.js +6 -8
- package/dist/docs/DocAdmin.d.ts +4 -0
- package/dist/docs/DocAdmin.d.ts.map +1 -0
- package/dist/docs/DocAdmin.js +68 -0
- package/dist/docs/DocsMenu.d.ts.map +1 -1
- package/dist/docs/DocsMenu.js +1 -1
- package/dist/docs/DocsRouter.d.ts.map +1 -1
- package/dist/docs/DocsRouter.js +13 -1
- package/dist/docs/DropdownMenuDocs.d.ts +4 -0
- package/dist/docs/DropdownMenuDocs.d.ts.map +1 -0
- package/dist/docs/DropdownMenuDocs.js +66 -0
- package/dist/docs/ExampleFormDocs.d.ts +4 -0
- package/dist/docs/ExampleFormDocs.d.ts.map +1 -0
- package/dist/docs/ExampleFormDocs.js +148 -0
- package/dist/docs/FilterDocs.d.ts +4 -0
- package/dist/docs/FilterDocs.d.ts.map +1 -0
- package/dist/docs/FilterDocs.js +112 -0
- package/dist/docs/InputDocs.d.ts.map +1 -1
- package/dist/docs/InputDocs.js +11 -1
- package/dist/docs/ListCrudDocs.tsx/ListCrudDocs.d.ts +11 -0
- package/dist/docs/ListCrudDocs.tsx/ListCrudDocs.d.ts.map +1 -0
- package/dist/docs/ListCrudDocs.tsx/ListCrudDocs.js +25 -0
- package/dist/docs/ListCrudDocs.tsx/ListCrudDocsContentPersonas.d.ts +2 -0
- package/dist/docs/ListCrudDocs.tsx/ListCrudDocsContentPersonas.d.ts.map +1 -0
- package/dist/docs/ListCrudDocs.tsx/ListCrudDocsContentPersonas.js +51 -0
- package/dist/docs/PaginationDocs.js +6 -6
- package/dist/docs/RadioButtonGroupDocs.d.ts +4 -0
- package/dist/docs/RadioButtonGroupDocs.d.ts.map +1 -0
- package/dist/docs/RadioButtonGroupDocs.js +46 -0
- package/dist/docs/RoadMapDocs.d.ts +4 -0
- package/dist/docs/RoadMapDocs.d.ts.map +1 -0
- package/dist/docs/RoadMapDocs.js +171 -0
- package/dist/docs/SearchSelectInputDocs.d.ts +4 -0
- package/dist/docs/SearchSelectInputDocs.d.ts.map +1 -0
- package/dist/docs/SearchSelectInputDocs.js +168 -0
- package/dist/docs/SnackbarDocs.d.ts +4 -0
- package/dist/docs/SnackbarDocs.d.ts.map +1 -0
- package/dist/docs/SnackbarDocs.js +50 -0
- package/dist/docs/TabsGroupDocs.d.ts.map +1 -1
- package/dist/docs/TabsGroupDocs.js +12 -1
- package/dist/docs/docMockServices/empresaService.d.ts +38 -0
- package/dist/docs/docMockServices/empresaService.d.ts.map +1 -0
- package/dist/docs/docMockServices/empresaService.js +116 -0
- package/dist/docs/docMockServices/index.d.ts +9 -0
- package/dist/docs/docMockServices/index.d.ts.map +1 -0
- package/dist/docs/docMockServices/index.js +8 -0
- package/dist/docs/docMockServices/initialData.d.ts +6 -0
- package/dist/docs/docMockServices/initialData.d.ts.map +1 -0
- package/dist/docs/docMockServices/initialData.js +132 -0
- package/dist/docs/docMockServices/interfaces.d.ts +26 -0
- package/dist/docs/docMockServices/interfaces.d.ts.map +1 -0
- package/dist/docs/docMockServices/interfaces.js +1 -0
- package/dist/docs/docMockServices/personaEmpresaService.d.ts +43 -0
- package/dist/docs/docMockServices/personaEmpresaService.d.ts.map +1 -0
- package/dist/docs/docMockServices/personaEmpresaService.js +113 -0
- package/dist/docs/docMockServices/personaService.d.ts +39 -0
- package/dist/docs/docMockServices/personaService.d.ts.map +1 -0
- package/dist/docs/docMockServices/personaService.js +180 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useAsyncRequest.d.ts +17 -0
- package/dist/hooks/useAsyncRequest.d.ts.map +1 -0
- package/dist/hooks/useAsyncRequest.js +70 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { useAppLayout } from "../../contexts";
|
|
4
|
+
import { ListCrudProvider } from "../../contexts/ListCrudContext";
|
|
5
|
+
import { empresaService, personaService, } from "../docMockServices";
|
|
6
|
+
import { ListCrudDocsContentPersonas } from "./ListCrudDocsContentPersonas";
|
|
7
|
+
import { Collection } from "../../components";
|
|
8
|
+
/**
|
|
9
|
+
* Componente de Documentación del ListCrudContext
|
|
10
|
+
*
|
|
11
|
+
* Este componente muestra cómo usar el ListCrudContext con un servicio mock
|
|
12
|
+
* para propósitos de documentación y desarrollo.
|
|
13
|
+
*
|
|
14
|
+
* El servicio mock simula la operación principal:
|
|
15
|
+
* - getPromise: Obtiene una lista de items (Array o PaginationInterface)
|
|
16
|
+
*/
|
|
17
|
+
export const ListCrudDocs = () => {
|
|
18
|
+
const { listarPaginados, eliminar } = personaService;
|
|
19
|
+
const { listarPaginados: listarPaginadosEmpresa } = empresaService;
|
|
20
|
+
const { setNavBarLeftNode } = useAppLayout();
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
setNavBarLeftNode(_jsx("h3", { className: "text-2xl font-semibold", children: "ListCrudContext" }));
|
|
23
|
+
}, [setNavBarLeftNode]);
|
|
24
|
+
return (_jsxs(Collection, { children: [_jsx(ListCrudProvider, { getPromise: listarPaginados, deletePromise: eliminar, urlParams: ["filtro", "idEmpresa"], children: _jsx(ListCrudDocsContentPersonas, {}) }), _jsx(ListCrudProvider, { getPromise: listarPaginadosEmpresa, urlParams: ["filtroEmpresa", "idEmpresaEmpresa"], children: "Empresas" })] }));
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListCrudDocsContentPersonas.d.ts","sourceRoot":"","sources":["../../../src/docs/ListCrudDocs.tsx/ListCrudDocsContentPersonas.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,2BAA2B,+CAsHvC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useListCrud } from "../../contexts";
|
|
3
|
+
import { Button, Card, Collection, DataTable, Dialog, Filter, } from "../../components";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { empresaService } from "../docMockServices";
|
|
7
|
+
export const ListCrudDocsContentPersonas = () => {
|
|
8
|
+
const { list, pagination, isLoading, refetch, deleteItem } = useListCrud();
|
|
9
|
+
const { listar } = empresaService;
|
|
10
|
+
const [empresas, setEmpresas] = useState([]);
|
|
11
|
+
const [isOpenDeleteDialog, setIsOpenDeleteDialog] = useState(false);
|
|
12
|
+
const [selectedPersona, setSelectedPersona] = useState();
|
|
13
|
+
const onDeletePersona = (persona) => {
|
|
14
|
+
setSelectedPersona(persona);
|
|
15
|
+
setIsOpenDeleteDialog(true);
|
|
16
|
+
};
|
|
17
|
+
const onDeletePersonaSubmit = async () => {
|
|
18
|
+
if (selectedPersona) {
|
|
19
|
+
await deleteItem(selectedPersona);
|
|
20
|
+
refetch();
|
|
21
|
+
setIsOpenDeleteDialog(false);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
listar().then((empresas) => {
|
|
26
|
+
setEmpresas(empresas);
|
|
27
|
+
});
|
|
28
|
+
}, [listar]);
|
|
29
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Collection, { children: [_jsxs(Card, { className: "bg-gray-50", title: "Personas", children: [_jsxs("div", { className: "flex justify-between items-center my-2", children: [_jsx("div", { children: _jsxs(Collection, { direction: "row", wrap: true, gap: "12px", children: [_jsx(Filter, { paramName: "filtro", label: "Buscar", filterType: "search" }), _jsx(Filter, { paramName: "idEmpresa", label: "Empresa", filterType: "autocomplete", options: empresas.map((empresa) => ({
|
|
30
|
+
label: empresa.nombre,
|
|
31
|
+
value: empresa.id.toString(),
|
|
32
|
+
})) })] }) }), _jsx("div", { children: pagination })] }), _jsx(DataTable, { columns: [
|
|
33
|
+
{ header: "Nombre", value: (row) => row.nombre },
|
|
34
|
+
{ header: "Email", value: (row) => row.email },
|
|
35
|
+
{
|
|
36
|
+
header: "Fecha de Nacimiento",
|
|
37
|
+
value: (row) => row.fechaNacimiento.format("DD/MM/YYYY"),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
header: "Empresas",
|
|
41
|
+
value: (row) => row.empresas.map((empresa) => empresa.nombre).join(", "),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
align: "center",
|
|
45
|
+
actions: (row) => [
|
|
46
|
+
_jsx(Button, { size: "sm", variant: "ghost", icon: "fa-edit", onClick: () => console.log("Editar", row), children: "Editar" }, "edit"),
|
|
47
|
+
_jsx(Button, { size: "sm", variant: "ghost", icon: "fa-trash", onClick: () => onDeletePersona(row), children: "Eliminar" }, "delete"),
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
], rows: list || [], maxRows: 10, isLoading: isLoading, loadingRows: 10 })] }), _jsx("div", { children: _jsx(Button, { onClick: () => refetch(), children: "Refetch" }) })] }), isOpenDeleteDialog && (_jsx(Dialog, { isOpen: isOpenDeleteDialog, title: "Eliminar Persona", onClose: () => setIsOpenDeleteDialog(false), dialogBody: _jsx("p", { children: "\u00BFEst\u00E1s seguro de querer eliminar esta persona?" }), dialogActions: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", onClick: () => setIsOpenDeleteDialog(false), children: "Cancelar" }), _jsx(Button, { onClick: onDeletePersonaSubmit, children: "Eliminar" })] }) }))] }));
|
|
51
|
+
};
|
|
@@ -27,12 +27,12 @@ const PaginationDocs = () => {
|
|
|
27
27
|
pages: 5,
|
|
28
28
|
total: 50,
|
|
29
29
|
};
|
|
30
|
-
return (_jsx("div", { className: "max-w-5xl mx-auto space-y-8", children: _jsx(Card, { title: "Pagination - Navegaci\u00F3n de P\u00E1ginas", children: _jsxs("div", { className: "space-y-8", children: [_jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Uso b\u00E1sico" }), _jsx("p", { className: "mb-4 text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "El componente Pagination permite navegar entre p\u00E1ginas de resultados. Modifica autom\u00E1ticamente el query parameter en la URL para mantener el estado de navegaci\u00F3n." }), _jsx("div", { className: "flex justify-center py-8 border border-[var(--color-border-default)] rounded-sm", children: _jsx(Pagination, { page: mockData.page, pages: mockData.pages, total: mockData.total }) })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Con nombre de campo personalizado" }), _jsxs("p", { className: "mb-4 text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: ["Puedes personalizar el nombre del query parameter usando la prop", " ", _jsx("code", { children: "fieldName" }), ". Por defecto es \"p\u00E1gina\"."] }), _jsx("div", { className: "flex justify-center py-8 border border-[var(--color-border-default)] rounded-sm", children: _jsx(Pagination, { fieldName: "page", page: customPage, pages: 10, total: 100 }) })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Primera p\u00E1gina" }), _jsx("p", { className: "mb-4 text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "Los botones de navegaci\u00F3n anterior y primera p\u00E1gina se deshabilitan autom\u00E1ticamente cuando est\u00E1s en la primera p\u00E1gina." }), _jsx("div", { className: "flex justify-center py-8 border border-[var(--color-border-default)] rounded-sm", children: _jsx(Pagination, { page: 1, pages: 5, total: 50 }) })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "\u00DAltima p\u00E1gina" }), _jsx("p", { className: "mb-4 text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "Los botones de navegaci\u00F3n siguiente y \u00FAltima p\u00E1gina se deshabilitan autom\u00E1ticamente cuando est\u00E1s en la \u00FAltima p\u00E1gina." }), _jsx("div", { className: "flex justify-center py-8 border border-[var(--color-border-default)] rounded-sm", children: _jsx(Pagination, { page: 5, pages: 5, total: 50 }) })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Una sola p\u00E1gina" }), _jsx("p", { className: "mb-4 text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "Cuando solo hay una p\u00E1gina, todos los botones de navegaci\u00F3n se deshabilitan autom\u00E1ticamente." }), _jsx("div", { className: "flex justify-center py-8 border border-[var(--color-border-default)] rounded-sm", children: _jsx(Pagination, { page: 1, pages: 1, total: 5 }) })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Interfaz PaginationInterface" }), _jsxs("p", { className: "mb-4 text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: ["La interfaz ", _jsx("code", { children: "PaginationInterface<T>" }), " define la estructura de datos para informaci\u00F3n de paginaci\u00F3n:"] }), _jsx("div", { className: "p-4 rounded-sm bg-[var(--color-bg-secondary)]", style: { fontFamily: "monospace", fontSize: "0.875rem" }, children: _jsx("pre", { style: { color: "var(--color-text-primary)" }, children: `export interface PaginationInterface<T> {
|
|
31
|
-
list: Array<T>;
|
|
32
|
-
limit: number;
|
|
33
|
-
page: number;
|
|
34
|
-
pages: number;
|
|
35
|
-
total: number;
|
|
30
|
+
return (_jsx("div", { className: "max-w-5xl mx-auto space-y-8", children: _jsx(Card, { title: "Pagination - Navegaci\u00F3n de P\u00E1ginas", children: _jsxs("div", { className: "space-y-8", children: [_jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Uso b\u00E1sico" }), _jsx("p", { className: "mb-4 text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "El componente Pagination permite navegar entre p\u00E1ginas de resultados. Modifica autom\u00E1ticamente el query parameter en la URL para mantener el estado de navegaci\u00F3n." }), _jsx("div", { className: "flex justify-center py-8 border border-[var(--color-border-default)] rounded-sm", children: _jsx(Pagination, { page: mockData.page, pages: mockData.pages, total: mockData.total }) })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Con nombre de campo personalizado" }), _jsxs("p", { className: "mb-4 text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: ["Puedes personalizar el nombre del query parameter usando la prop", " ", _jsx("code", { children: "fieldName" }), ". Por defecto es \"p\u00E1gina\"."] }), _jsx("div", { className: "flex justify-center py-8 border border-[var(--color-border-default)] rounded-sm", children: _jsx(Pagination, { fieldName: "page", page: customPage, pages: 10, total: 100 }) })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Primera p\u00E1gina" }), _jsx("p", { className: "mb-4 text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "Los botones de navegaci\u00F3n anterior y primera p\u00E1gina se deshabilitan autom\u00E1ticamente cuando est\u00E1s en la primera p\u00E1gina." }), _jsx("div", { className: "flex justify-center py-8 border border-[var(--color-border-default)] rounded-sm", children: _jsx(Pagination, { page: 1, pages: 5, total: 50 }) })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "\u00DAltima p\u00E1gina" }), _jsx("p", { className: "mb-4 text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "Los botones de navegaci\u00F3n siguiente y \u00FAltima p\u00E1gina se deshabilitan autom\u00E1ticamente cuando est\u00E1s en la \u00FAltima p\u00E1gina." }), _jsx("div", { className: "flex justify-center py-8 border border-[var(--color-border-default)] rounded-sm", children: _jsx(Pagination, { page: 5, pages: 5, total: 50 }) })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Una sola p\u00E1gina" }), _jsx("p", { className: "mb-4 text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "Cuando solo hay una p\u00E1gina, todos los botones de navegaci\u00F3n se deshabilitan autom\u00E1ticamente." }), _jsx("div", { className: "flex justify-center py-8 border border-[var(--color-border-default)] rounded-sm", children: _jsx(Pagination, { page: 1, pages: 1, total: 5 }) })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Interfaz PaginationInterface" }), _jsxs("p", { className: "mb-4 text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: ["La interfaz ", _jsx("code", { children: "PaginationInterface<T>" }), " define la estructura de datos para informaci\u00F3n de paginaci\u00F3n:"] }), _jsx("div", { className: "p-4 rounded-sm bg-[var(--color-bg-secondary)]", style: { fontFamily: "monospace", fontSize: "0.875rem" }, children: _jsx("pre", { style: { color: "var(--color-text-primary)" }, children: `export interface PaginationInterface<T> {
|
|
31
|
+
list: Array<T>;
|
|
32
|
+
limit: number;
|
|
33
|
+
page: number;
|
|
34
|
+
pages: number;
|
|
35
|
+
total: number;
|
|
36
36
|
}` }) })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Props del componente" }), _jsxs("div", { className: "space-y-4", children: [_jsxs("div", { children: [_jsx("h4", { className: "font-semibold mb-2", style: { color: "var(--flysoft-text-primary)" }, children: "fieldName?: string" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "Nombre del query parameter que se usar\u00E1 para la p\u00E1gina. Por defecto es \"pagina\"." })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold mb-2", style: { color: "var(--flysoft-text-primary)" }, children: "page?: number" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "N\u00FAmero de p\u00E1gina actual. Por defecto es 1." })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold mb-2", style: { color: "var(--flysoft-text-primary)" }, children: "pages?: number" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "N\u00FAmero total de p\u00E1ginas. Por defecto es 1." })] }), _jsxs("div", { children: [_jsx("h4", { className: "font-semibold mb-2", style: { color: "var(--flysoft-text-primary)" }, children: "total?: number" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "N\u00FAmero total de elementos. Por defecto es 0." })] })] })] })] }) }) }));
|
|
37
37
|
};
|
|
38
38
|
export default PaginationDocs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButtonGroupDocs.d.ts","sourceRoot":"","sources":["../../src/docs/RadioButtonGroupDocs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAmFxC,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAmUjC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { Card, RadioButtonGroup, Button } from "../index";
|
|
4
|
+
import { useForm, FormProvider } from "react-hook-form";
|
|
5
|
+
const FormExample = () => {
|
|
6
|
+
const methods = useForm({
|
|
7
|
+
defaultValues: {
|
|
8
|
+
gender: "male",
|
|
9
|
+
preferences: "notifications",
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
const { handleSubmit, watch, register, formState: { errors }, } = methods;
|
|
13
|
+
const onSubmit = () => {
|
|
14
|
+
console.log(watch());
|
|
15
|
+
};
|
|
16
|
+
return (_jsx(FormProvider, { ...methods, children: _jsx(Card, { title: "Formulario con RadioButtonGroup", subtitle: "Ejemplo pr\u00E1ctico de uso de RadioButtonGroup en un formulario con react-hook-form", children: _jsxs("form", { onSubmit: handleSubmit(onSubmit), children: [_jsxs("div", { className: "space-y-6", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-sm text-[var(--color-primary)] mb-1 font-[var(--font-default)]", children: "G\u00E9nero" }), _jsx(RadioButtonGroup, { options: [
|
|
17
|
+
{ label: "Masculino", value: "male" },
|
|
18
|
+
{ label: "Femenino", value: "female" },
|
|
19
|
+
{ label: "Otro", value: "other" },
|
|
20
|
+
], ...register("gender", {
|
|
21
|
+
required: "El género es obligatorio",
|
|
22
|
+
}), error: errors.gender?.message })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm text-[var(--color-primary)] mb-1 font-[var(--font-default)]", children: "Preferencias" }), _jsx(RadioButtonGroup, { options: [
|
|
23
|
+
{ label: "Notificaciones", value: "notifications" },
|
|
24
|
+
{ label: "Email", value: "email" },
|
|
25
|
+
{ label: "SMS", value: "sms" },
|
|
26
|
+
], ...register("preferences", {
|
|
27
|
+
required: "Las preferencias son obligatorias",
|
|
28
|
+
}), error: errors.preferences?.message, direction: "horizontal" })] })] }), _jsxs("div", { className: "flex justify-end gap-2", children: [_jsx(Button, { variant: "outline", icon: "fa-times", type: "button", children: "Cancelar" }), _jsx(Button, { variant: "primary", icon: "fa-check", type: "submit", children: "Enviar" })] })] }) }) }));
|
|
29
|
+
};
|
|
30
|
+
const RadioButtonGroupDocs = () => {
|
|
31
|
+
const [selectedValue1, setSelectedValue1] = useState("option1");
|
|
32
|
+
const basicOptions = [
|
|
33
|
+
{ label: "Opción 1", value: "option1" },
|
|
34
|
+
{ label: "Opción 2", value: "option2" },
|
|
35
|
+
{ label: "Opción 3", value: "option3" },
|
|
36
|
+
];
|
|
37
|
+
const optionsWithNumbers = [
|
|
38
|
+
{ label: "Uno", value: 1 },
|
|
39
|
+
{ label: "Dos", value: 2 },
|
|
40
|
+
{ label: "Tres", value: 3 },
|
|
41
|
+
];
|
|
42
|
+
// Crear un FormProvider mínimo para los ejemplos en modo controlado
|
|
43
|
+
const controlMethods = useForm();
|
|
44
|
+
return (_jsx(FormProvider, { ...controlMethods, children: _jsx("div", { className: "max-w-5xl mx-auto space-y-8", children: _jsx(Card, { title: "RadioButtonGroup - Variantes y Ejemplos", children: _jsxs("div", { className: "space-y-10", children: [_jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Uso b\u00E1sico con options" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-3", children: [_jsx(RadioButtonGroup, { options: basicOptions, value: selectedValue1, onChange: (value) => setSelectedValue1(value), name: "basic-group" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "grupo de radio buttons con options, label a la derecha (por defecto)" })] }), _jsxs("div", { className: "space-y-3", children: [_jsx(RadioButtonGroup, { options: basicOptions, value: selectedValue1, onChange: (value) => setSelectedValue1(value), name: "basic-group-left", labelPosition: "left" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "grupo con labels a la izquierda" })] })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Tama\u00F1os" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6", children: [_jsxs("div", { className: "space-y-3", children: [_jsx(RadioButtonGroup, { options: basicOptions, value: selectedValue1, onChange: (value) => setSelectedValue1(value), name: "size-sm", size: "sm" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "tama\u00F1o compacto" })] }), _jsxs("div", { className: "space-y-3", children: [_jsx(RadioButtonGroup, { options: basicOptions, value: selectedValue1, onChange: (value) => setSelectedValue1(value), name: "size-md", size: "md" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "tama\u00F1o por defecto" })] }), _jsxs("div", { className: "space-y-3", children: [_jsx(RadioButtonGroup, { options: basicOptions, value: selectedValue1, onChange: (value) => setSelectedValue1(value), name: "size-lg", size: "lg" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "tama\u00F1o amplio" })] })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Direcci\u00F3n del layout" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-3", children: [_jsx(RadioButtonGroup, { options: basicOptions, value: selectedValue1, onChange: (value) => setSelectedValue1(value), name: "direction-vertical", direction: "vertical" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "direcci\u00F3n vertical (por defecto)" })] }), _jsxs("div", { className: "space-y-3", children: [_jsx(RadioButtonGroup, { options: basicOptions, value: selectedValue1, onChange: (value) => setSelectedValue1(value), name: "direction-horizontal", direction: "horizontal" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "direcci\u00F3n horizontal" })] })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Estados" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-3", children: [_jsx(RadioButtonGroup, { options: basicOptions, value: selectedValue1, onChange: (value) => setSelectedValue1(value), name: "error-group", error: "Debes seleccionar una opci\u00F3n" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "utiliza el prop error para mostrar mensajes y estilos" })] }), _jsxs("div", { className: "space-y-3", children: [_jsx(RadioButtonGroup, { options: basicOptions, value: selectedValue1, onChange: (value) => setSelectedValue1(value), name: "disabled-group", disabled: true }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "el estado disabled aplica estilos y bloqueo de interacci\u00F3n" })] })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Valores num\u00E9ricos" }), _jsxs("div", { className: "space-y-3", children: [_jsx(RadioButtonGroup, { options: optionsWithNumbers, value: selectedValue1, onChange: (value) => setSelectedValue1(value), name: "numeric-group" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "soporta valores num\u00E9ricos adem\u00E1s de strings" })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Espaciado personalizado" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6", children: [_jsxs("div", { className: "space-y-3", children: [_jsx(RadioButtonGroup, { options: basicOptions, value: selectedValue1, onChange: (value) => setSelectedValue1(value), name: "gap-sm", gap: "sm" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "espaciado peque\u00F1o" })] }), _jsxs("div", { className: "space-y-3", children: [_jsx(RadioButtonGroup, { options: basicOptions, value: selectedValue1, onChange: (value) => setSelectedValue1(value), name: "gap-md", gap: "md" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "espaciado mediano (por defecto)" })] }), _jsxs("div", { className: "space-y-3", children: [_jsx(RadioButtonGroup, { options: basicOptions, value: selectedValue1, onChange: (value) => setSelectedValue1(value), name: "gap-lg", gap: "lg" }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "espaciado grande" })] })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Ejemplo de uso" }), _jsx(FormExample, {})] })] }) }) }) }));
|
|
45
|
+
};
|
|
46
|
+
export default RadioButtonGroupDocs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoadMapDocs.d.ts","sourceRoot":"","sources":["../../src/docs/RoadMapDocs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAkTxB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { RoadMap, Card } from "../index";
|
|
4
|
+
const RoadMapDocs = () => {
|
|
5
|
+
const basicStages = [
|
|
6
|
+
{ name: "Inicio", variant: "primary" },
|
|
7
|
+
{ name: "Progreso", variant: "success" },
|
|
8
|
+
{ name: "Finalización", variant: "info" },
|
|
9
|
+
];
|
|
10
|
+
const stagesWithDescriptions = [
|
|
11
|
+
{
|
|
12
|
+
name: "Planificación",
|
|
13
|
+
description: "Definir requisitos y alcance del proyecto",
|
|
14
|
+
variant: "primary",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "Desarrollo",
|
|
18
|
+
description: "Construir las funcionalidades principales",
|
|
19
|
+
variant: "success",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "Pruebas",
|
|
23
|
+
description: "Realizar testing completo del sistema",
|
|
24
|
+
variant: "warning",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "Lanzamiento",
|
|
28
|
+
description: "Publicar y desplegar la aplicación",
|
|
29
|
+
variant: "info",
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
const stagesWithIcons = [
|
|
33
|
+
{
|
|
34
|
+
name: "Análisis",
|
|
35
|
+
description: "Analizar requerimientos",
|
|
36
|
+
icon: "fa-search",
|
|
37
|
+
variant: "primary",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "Diseño",
|
|
41
|
+
description: "Crear el diseño de la solución",
|
|
42
|
+
icon: "fa-pencil-alt",
|
|
43
|
+
variant: "secondary",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "Implementación",
|
|
47
|
+
description: "Desarrollar la solución",
|
|
48
|
+
icon: "fa-code",
|
|
49
|
+
variant: "success",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "Despliegue",
|
|
53
|
+
description: "Publicar en producción",
|
|
54
|
+
icon: "fa-rocket",
|
|
55
|
+
variant: "info",
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
const disabledStages = [
|
|
59
|
+
{
|
|
60
|
+
name: "Completado",
|
|
61
|
+
description: "Esta etapa ya está finalizada",
|
|
62
|
+
icon: "fa-check-circle",
|
|
63
|
+
variant: "success",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "En Progreso",
|
|
67
|
+
description: "Trabajando actualmente en esta etapa",
|
|
68
|
+
icon: "fa-spinner",
|
|
69
|
+
variant: "primary",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "Pendiente",
|
|
73
|
+
description: "Esta etapa aún no ha comenzado",
|
|
74
|
+
icon: "fa-clock",
|
|
75
|
+
variant: "warning",
|
|
76
|
+
disabled: true,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "Bloqueado",
|
|
80
|
+
description: "Esta etapa está bloqueada",
|
|
81
|
+
icon: "fa-lock",
|
|
82
|
+
variant: "danger",
|
|
83
|
+
disabled: true,
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
const customColorStages = [
|
|
87
|
+
{
|
|
88
|
+
name: "Etapa 1",
|
|
89
|
+
description: "Con color personalizado",
|
|
90
|
+
icon: "fa-star",
|
|
91
|
+
bg: "#8b5cf6",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "Etapa 2",
|
|
95
|
+
description: "Otro color personalizado",
|
|
96
|
+
icon: "fa-heart",
|
|
97
|
+
bg: "#ec4899",
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: "Etapa 3",
|
|
101
|
+
description: "Verde personalizado",
|
|
102
|
+
icon: "fa-leaf",
|
|
103
|
+
bg: "#10b981",
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
const allVariantsStages = [
|
|
107
|
+
{
|
|
108
|
+
name: "Primary",
|
|
109
|
+
description: "Variante primaria",
|
|
110
|
+
variant: "primary",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "Secondary",
|
|
114
|
+
description: "Variante secundaria",
|
|
115
|
+
variant: "secondary",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "Success",
|
|
119
|
+
description: "Variante de éxito",
|
|
120
|
+
variant: "success",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "Warning",
|
|
124
|
+
description: "Variante de advertencia",
|
|
125
|
+
variant: "warning",
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: "Danger",
|
|
129
|
+
description: "Variante de peligro",
|
|
130
|
+
variant: "danger",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "Info",
|
|
134
|
+
description: "Variante informativa",
|
|
135
|
+
variant: "info",
|
|
136
|
+
},
|
|
137
|
+
];
|
|
138
|
+
return (_jsx("div", { className: "max-w-5xl mx-auto space-y-8", children: _jsx(Card, { title: "RoadMap - Etapas y Progreso", children: _jsxs("div", { className: "space-y-8", children: [_jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Uso B\u00E1sico" }), _jsx(RoadMap, { stages: basicStages }), _jsx("p", { className: "text-sm mt-3", style: { color: "var(--flysoft-text-secondary)" }, children: "El componente RoadMap muestra una serie de etapas conectadas con l\u00EDneas. Cada etapa tiene un c\u00EDrculo con el color seg\u00FAn su variante." })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Con Descripciones" }), _jsx(RoadMap, { stages: stagesWithDescriptions }), _jsx("p", { className: "text-sm mt-3", style: { color: "var(--flysoft-text-secondary)" }, children: "Puedes agregar descripciones a cada etapa que se mostrar\u00E1n debajo del nombre en un texto m\u00E1s peque\u00F1o." })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Con \u00CDconos" }), _jsx(RoadMap, { stages: stagesWithIcons }), _jsxs("p", { className: "text-sm mt-3", style: { color: "var(--flysoft-text-secondary)" }, children: ["Cada etapa puede tener un \u00EDcono FontAwesome 5 que se mostrar\u00E1 dentro del c\u00EDrculo. Usa clases como ", _jsx("code", { children: "fa-check" }), ",", " ", _jsx("code", { children: "fa-code" }), ", etc."] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Etapas Deshabilitadas" }), _jsx(RoadMap, { stages: disabledStages }), _jsxs("p", { className: "text-sm mt-3", style: { color: "var(--flysoft-text-secondary)" }, children: ["Las etapas con ", _jsx("code", { children: "disabled: true" }), " se muestran con una opacidad de 0.5, tanto el c\u00EDrculo como el texto (nombre y descripci\u00F3n)."] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Colores Personalizados" }), _jsx(RoadMap, { stages: customColorStages }), _jsxs("p", { className: "text-sm mt-3", style: { color: "var(--flysoft-text-secondary)" }, children: ["Puedes usar la propiedad ", _jsx("code", { children: "bg" }), " para definir un color de fondo personalizado (hexadecimal, rgb, o nombre de color). Esto tiene prioridad sobre la variante."] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Todas las Variantes" }), _jsx(RoadMap, { stages: allVariantsStages }), _jsxs("p", { className: "text-sm mt-3", style: { color: "var(--flysoft-text-secondary)" }, children: ["Las variantes disponibles son: ", _jsx("code", { children: "primary" }), ",", " ", _jsx("code", { children: "secondary" }), ", ", _jsx("code", { children: "success" }), ", ", _jsx("code", { children: "warning" }), ", ", _jsx("code", { children: "danger" }), ", e ", _jsx("code", { children: "info" }), ". Las l\u00EDneas conectadoras tienen un gradiente que combina 50% del color de la etapa origen y 50% del color de la etapa destino."] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Ejemplo Completo" }), _jsx(RoadMap, { stages: [
|
|
139
|
+
{
|
|
140
|
+
name: "Inicio del Proyecto",
|
|
141
|
+
description: "Kickoff y definición de objetivos",
|
|
142
|
+
icon: "fa-flag",
|
|
143
|
+
variant: "primary",
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "Desarrollo",
|
|
147
|
+
description: "Implementación de funcionalidades",
|
|
148
|
+
icon: "fa-code",
|
|
149
|
+
variant: "success",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: "Revisión",
|
|
153
|
+
description: "Code review y testing",
|
|
154
|
+
icon: "fa-eye",
|
|
155
|
+
variant: "warning",
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "Despliegue",
|
|
159
|
+
description: "Publicación en producción",
|
|
160
|
+
icon: "fa-rocket",
|
|
161
|
+
variant: "info",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: "Post-Lanzamiento",
|
|
165
|
+
description: "Monitoreo y mejoras continuas",
|
|
166
|
+
icon: "fa-chart-line",
|
|
167
|
+
variant: "secondary",
|
|
168
|
+
},
|
|
169
|
+
] }), _jsx("p", { className: "text-sm mt-3", style: { color: "var(--flysoft-text-secondary)" }, children: "Ejemplo completo combinando todas las caracter\u00EDsticas: variantes, \u00EDconos y descripciones." })] })] }) }) }));
|
|
170
|
+
};
|
|
171
|
+
export default RoadMapDocs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchSelectInputDocs.d.ts","sourceRoot":"","sources":["../../src/docs/SearchSelectInputDocs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoK1B,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EA+elC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Card, SearchSelectInput, Button, Input, DateInput } from "../index";
|
|
4
|
+
import { useForm } from "react-hook-form";
|
|
5
|
+
const sampleOptions = [
|
|
6
|
+
{
|
|
7
|
+
label: "España",
|
|
8
|
+
value: "es",
|
|
9
|
+
icon: "fa-flag",
|
|
10
|
+
description: "Madrid",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
label: "Estados Unidos",
|
|
14
|
+
value: "us",
|
|
15
|
+
icon: "fa-flag",
|
|
16
|
+
description: "Washington D.C.",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: "México",
|
|
20
|
+
value: "mx",
|
|
21
|
+
icon: "fa-flag",
|
|
22
|
+
description: "Ciudad de México",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "Argentina",
|
|
26
|
+
value: "ar",
|
|
27
|
+
icon: "fa-flag",
|
|
28
|
+
description: "Buenos Aires",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: "Chile",
|
|
32
|
+
value: "cl",
|
|
33
|
+
icon: "fa-flag",
|
|
34
|
+
description: "Santiago",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: "Colombia",
|
|
38
|
+
value: "co",
|
|
39
|
+
icon: "fa-flag",
|
|
40
|
+
description: "Bogotá",
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
const users = [
|
|
44
|
+
{
|
|
45
|
+
id: 1,
|
|
46
|
+
firstName: "Juan",
|
|
47
|
+
lastName: "Pérez",
|
|
48
|
+
email: "juan.perez@empresa.com",
|
|
49
|
+
role: "Desarrollador",
|
|
50
|
+
department: "Tecnología",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 2,
|
|
54
|
+
firstName: "María",
|
|
55
|
+
lastName: "García",
|
|
56
|
+
email: "maria.garcia@empresa.com",
|
|
57
|
+
role: "Diseñadora",
|
|
58
|
+
department: "Diseño",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 3,
|
|
62
|
+
firstName: "Carlos",
|
|
63
|
+
lastName: "Rodríguez",
|
|
64
|
+
email: "carlos.rodriguez@empresa.com",
|
|
65
|
+
role: "Gerente",
|
|
66
|
+
department: "Ventas",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 4,
|
|
70
|
+
firstName: "Ana",
|
|
71
|
+
lastName: "Martínez",
|
|
72
|
+
email: "ana.martinez@empresa.com",
|
|
73
|
+
role: "Analista",
|
|
74
|
+
department: "Marketing",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 5,
|
|
78
|
+
firstName: "Luis",
|
|
79
|
+
lastName: "Fernández",
|
|
80
|
+
email: "luis.fernandez@empresa.com",
|
|
81
|
+
role: "Desarrollador",
|
|
82
|
+
department: "Tecnología",
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
// Simular búsqueda asíncrona
|
|
86
|
+
const mockSearchPromise = async (text) => {
|
|
87
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
88
|
+
const search = text.toLowerCase();
|
|
89
|
+
return sampleOptions.filter((option) => option.label.toLowerCase().includes(search) ||
|
|
90
|
+
(option.value && option.value.toLowerCase().includes(search)) ||
|
|
91
|
+
(option.description &&
|
|
92
|
+
String(option.description).toLowerCase().includes(search)));
|
|
93
|
+
};
|
|
94
|
+
// Simular búsqueda de un elemento individual por valor
|
|
95
|
+
const mockSingleSearchPromise = async (value) => {
|
|
96
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
97
|
+
return sampleOptions.find((option) => option.value === value);
|
|
98
|
+
};
|
|
99
|
+
// Simular búsqueda con PaginationInterface
|
|
100
|
+
const mockSearchWithPagination = async (text) => {
|
|
101
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
102
|
+
const search = text.toLowerCase();
|
|
103
|
+
const filtered = sampleOptions.filter((option) => option.label.toLowerCase().includes(search) ||
|
|
104
|
+
(option.value && option.value.toLowerCase().includes(search)) ||
|
|
105
|
+
(option.description &&
|
|
106
|
+
String(option.description).toLowerCase().includes(search)));
|
|
107
|
+
return {
|
|
108
|
+
list: filtered,
|
|
109
|
+
limit: 10,
|
|
110
|
+
page: 1,
|
|
111
|
+
pages: 1,
|
|
112
|
+
total: filtered.length,
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
// Simular búsqueda de usuarios
|
|
116
|
+
const mockUserSearch = async (text) => {
|
|
117
|
+
await new Promise((resolve) => setTimeout(resolve, 600));
|
|
118
|
+
const search = text.toLowerCase();
|
|
119
|
+
return users.filter((user) => user.firstName.toLowerCase().includes(search) ||
|
|
120
|
+
user.lastName.toLowerCase().includes(search) ||
|
|
121
|
+
user.email.toLowerCase().includes(search) ||
|
|
122
|
+
user.role.toLowerCase().includes(search));
|
|
123
|
+
};
|
|
124
|
+
// Simular búsqueda de un usuario individual por ID
|
|
125
|
+
const mockSingleUserSearch = async (userId) => {
|
|
126
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
127
|
+
return users.find((user) => user.id === userId);
|
|
128
|
+
};
|
|
129
|
+
const SearchSelectInputDocs = () => {
|
|
130
|
+
const [selectedCountry, setSelectedCountry] = React.useState();
|
|
131
|
+
const [internalValue, setInternalValue] = React.useState("");
|
|
132
|
+
const [selectedUser, setSelectedUser] = React.useState();
|
|
133
|
+
const { register, handleSubmit, reset, setFocus, formState: { errors, isSubmitted }, watch, } = useForm();
|
|
134
|
+
const onSubmit = (data) => {
|
|
135
|
+
console.log(data);
|
|
136
|
+
};
|
|
137
|
+
// Enfocar el primer campo con error después de un submit fallido
|
|
138
|
+
React.useEffect(() => {
|
|
139
|
+
if (isSubmitted && Object.keys(errors).length > 0) {
|
|
140
|
+
// Usar setTimeout para asegurar que se ejecute después del render
|
|
141
|
+
const timer = setTimeout(() => {
|
|
142
|
+
if (errors.country) {
|
|
143
|
+
setFocus("country");
|
|
144
|
+
}
|
|
145
|
+
else if (errors.birthDate) {
|
|
146
|
+
setFocus("birthDate");
|
|
147
|
+
}
|
|
148
|
+
else if (errors.city) {
|
|
149
|
+
setFocus("city");
|
|
150
|
+
}
|
|
151
|
+
}, 100);
|
|
152
|
+
return () => clearTimeout(timer);
|
|
153
|
+
}
|
|
154
|
+
}, [errors, isSubmitted, setFocus]);
|
|
155
|
+
return (_jsx("div", { className: "max-w-5xl mx-auto space-y-8", children: _jsx(Card, { title: "SearchSelectInput - B\u00FAsqueda as\u00EDncrona y selecci\u00F3n en Dialog", children: _jsxs("div", { className: "space-y-10", children: [_jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Uso b\u00E1sico" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-3", children: [_jsx(SearchSelectInput, { label: "Buscar pa\u00EDs", placeholder: "Escribe y presiona Enter o click en buscar...", icon: "fa-globe", onSearchPromiseFn: mockSearchPromise, onSingleSearchPromiseFn: mockSingleSearchPromise, onSelectOption: (option) => setSelectedCountry(option) }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "Escribe el texto, presiona Enter o haz click en el bot\u00F3n de b\u00FAsqueda para abrir el dialog con los resultados" })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-sm font-medium", style: { color: "var(--flysoft-text-primary)" }, children: "Selecci\u00F3n actual" }), _jsx(Card, { variant: "outlined", children: _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: selectedCountry
|
|
156
|
+
? `${selectedCountry.label} (${selectedCountry.value?.toUpperCase() ?? "N/A"})`
|
|
157
|
+
: "Ningún país seleccionado" }) })] })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Posici\u00F3n del bot\u00F3n de b\u00FAsqueda" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-3", children: [_jsx(SearchSelectInput, { label: "Bot\u00F3n a la derecha (por defecto)", placeholder: "Escribe y busca...", icon: "fa-search", onSearchPromiseFn: mockSearchPromise, onSingleSearchPromiseFn: mockSingleSearchPromise }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "searchButtonPosition=\"right\" (valor por defecto)" })] }), _jsxs("div", { className: "space-y-3", children: [_jsx(SearchSelectInput, { label: "Bot\u00F3n a la izquierda", placeholder: "Escribe y busca...", icon: "fa-search", iconPosition: "left", onSearchPromiseFn: mockSearchPromise, onSingleSearchPromiseFn: mockSingleSearchPromise }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "searchButtonPosition=\"left\"" })] })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Controlado vs no controlado" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-3", children: [_jsx(SearchSelectInput, { label: "SearchSelectInput no controlado", placeholder: "Escribe y busca...", icon: "fa-search", onSearchPromiseFn: mockSearchPromise, onSingleSearchPromiseFn: mockSingleSearchPromise }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "sin prop value: el componente maneja internamente el valor del input" })] }), _jsxs("div", { className: "space-y-3", children: [_jsx(SearchSelectInput, { label: "SearchSelectInput controlado", placeholder: "Escribe y busca...", icon: "fa-search", value: internalValue, getOptionValue: (option) => option.value ?? "", onChange: (val) => {
|
|
158
|
+
if (typeof val === "string") {
|
|
159
|
+
setInternalValue(val);
|
|
160
|
+
}
|
|
161
|
+
}, onSearchPromiseFn: mockSearchPromise, onSingleSearchPromiseFn: mockSingleSearchPromise }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "con value y onChange: el valor del input se controla desde el estado externo" }), _jsx(Input, { label: "Valor actual", value: internalValue, readOnly: true, icon: "fa-code" })] })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Con PaginationInterface" }), _jsxs("div", { className: "space-y-3", children: [_jsx(SearchSelectInput, { label: "B\u00FAsqueda con paginaci\u00F3n", placeholder: "Escribe y busca pa\u00EDses...", icon: "fa-globe", onSearchPromiseFn: mockSearchWithPagination, onSingleSearchPromiseFn: mockSingleSearchPromise, dialogTitle: "Seleccione un pa\u00EDs", onSelectOption: (option) => {
|
|
162
|
+
console.log("País seleccionado:", option);
|
|
163
|
+
} }), _jsxs("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: ["La funci\u00F3n onSearchPromiseFn puede devolver un", " ", _jsx("code", { children: "PaginationInterface<T>" }), ". El componente extraer\u00E1 autom\u00E1ticamente el array de la propiedad", " ", _jsx("code", { children: "list" }), "."] })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Personalizaci\u00F3n del Dialog" }), _jsxs("div", { className: "space-y-3", children: [_jsx(SearchSelectInput, { label: "Dialog personalizado", placeholder: "Escribe y busca...", icon: "fa-search", dialogTitle: "Buscar y seleccionar un pa\u00EDs", noResultsText: "No se encontraron pa\u00EDses con ese criterio", onSearchPromiseFn: mockSearchPromise, onSingleSearchPromiseFn: mockSingleSearchPromise }), _jsxs("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: ["Puedes personalizar el t\u00EDtulo del dialog con", " ", _jsx("code", { children: "dialogTitle" }), " y el mensaje de sin resultados con", " ", _jsx("code", { children: "noResultsText" }), "."] })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Uso gen\u00E9rico con renderOption personalizado" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-3", children: [_jsx(SearchSelectInput, { label: "Buscar usuario", placeholder: "Escribe nombre, email o rol...", icon: "fa-users", onSearchPromiseFn: mockUserSearch, onSingleSearchPromiseFn: mockSingleUserSearch, getOptionLabel: (user) => `${user.firstName} ${user.lastName}`, getOptionValue: (user) => user.id, getOptionDescription: (user) => user.email, onSelectOption: (user, userId) => {
|
|
164
|
+
setSelectedUser(user);
|
|
165
|
+
console.log("Usuario seleccionado:", user, "ID:", userId);
|
|
166
|
+
}, renderOption: (user) => (_jsxs("div", { className: "flex items-start gap-3 w-full", children: [_jsx("div", { className: "flex-shrink-0 w-10 h-10 rounded-full bg-[var(--color-primary-soft)] flex items-center justify-center", children: _jsx("i", { className: "fa fa-user text-[var(--color-primary)]" }) }), _jsxs("div", { className: "flex flex-col flex-1 min-w-0", children: [_jsxs("span", { className: "font-medium text-[var(--color-text-primary)]", children: [user.firstName, " ", user.lastName] }), _jsx("span", { className: "text-xs text-[var(--color-text-secondary)] truncate", children: user.email }), _jsxs("div", { className: "flex items-center gap-2 mt-1", children: [_jsx("span", { className: "text-xs px-2 py-0.5 rounded bg-[var(--color-bg-secondary)] text-[var(--color-text-secondary)]", children: user.role }), _jsxs("span", { className: "text-xs text-[var(--color-text-muted)]", children: ["\u2022 ", user.department] })] })] })] })) }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "usando getOptionLabel, getOptionValue y renderOption para personalizar completamente el renderizado de opciones sin propiedades label/value/description" })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-sm font-medium", style: { color: "var(--flysoft-text-primary)" }, children: "Usuario seleccionado" }), _jsx(Card, { variant: "outlined", children: selectedUser ? (_jsxs("div", { className: "space-y-2", children: [_jsxs("p", { className: "text-sm font-medium", style: { color: "var(--flysoft-text-primary)" }, children: [selectedUser.firstName, " ", selectedUser.lastName] }), _jsx("p", { className: "text-xs", style: { color: "var(--flysoft-text-secondary)" }, children: selectedUser.email }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-xs px-2 py-0.5 rounded bg-[var(--color-bg-secondary)]", style: { color: "var(--flysoft-text-secondary)" }, children: selectedUser.role }), _jsx("span", { className: "text-xs", style: { color: "var(--flysoft-text-muted)" }, children: selectedUser.department })] }), _jsxs("p", { className: "text-xs mt-2", style: { color: "var(--flysoft-text-muted)" }, children: ["ID: ", selectedUser.id] })] })) : (_jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "Ning\u00FAn usuario seleccionado" })) })] })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Ejemplo de formulario" }), _jsx(Card, { title: "Formulario de b\u00FAsqueda con SearchSelectInput", subtitle: "Combinaci\u00F3n de SearchSelectInput, DateInput, Input y Button", children: _jsxs("form", { className: "space-y-4", onSubmit: handleSubmit(onSubmit), children: [_jsx(SearchSelectInput, { label: "Pa\u00EDs de residencia", ...register("country"), placeholder: "Busca y selecciona un pa\u00EDs", getOptionLabel: (option) => option.label, getOptionValue: (option) => option.value ?? "", onSearchPromiseFn: mockSearchPromise, onSingleSearchPromiseFn: mockSingleSearchPromise, dialogTitle: "Seleccione un pa\u00EDs" }), _jsxs("div", { children: ["Pa\u00EDs de residencia: ", watch("country")?.toString()] }), _jsx(DateInput, { label: "Fecha de nacimiento", placeholder: "dd/mm/yyyy", ...register("birthDate") }), _jsx(Input, { label: "Ciudad", placeholder: "Introduce tu ciudad", icon: "fa-city", error: errors.city?.message }), _jsxs("div", { className: "flex justify-end gap-2", children: [_jsx(Button, { variant: "outline", icon: "fa-times", type: "submit", onClick: () => reset(), children: "Limpiar" }), _jsx(Button, { variant: "primary", icon: "fa-search", type: "submit", children: "Buscar" })] })] }) })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Tama\u00F1os" }), _jsxs("div", { className: "space-y-4", children: [_jsx(SearchSelectInput, { label: "Tama\u00F1o peque\u00F1o", placeholder: "Escribe y busca...", size: "sm", onSearchPromiseFn: mockSearchPromise, onSingleSearchPromiseFn: mockSingleSearchPromise }), _jsx(SearchSelectInput, { label: "Tama\u00F1o mediano (por defecto)", placeholder: "Escribe y busca...", size: "md", onSearchPromiseFn: mockSearchPromise, onSingleSearchPromiseFn: mockSingleSearchPromise }), _jsx(SearchSelectInput, { label: "Tama\u00F1o grande", placeholder: "Escribe y busca...", size: "lg", onSearchPromiseFn: mockSearchPromise, onSingleSearchPromiseFn: mockSingleSearchPromise })] })] }), _jsxs("section", { children: [_jsx("h3", { className: "text-lg font-semibold mb-4", style: { color: "var(--flysoft-text-primary)" }, children: "Estados y validaci\u00F3n" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "space-y-3", children: [_jsx(SearchSelectInput, { label: "Con error", placeholder: "Escribe y busca...", error: "Este campo es requerido", onSearchPromiseFn: mockSearchPromise, onSingleSearchPromiseFn: mockSingleSearchPromise }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "respeta el estado error heredado del componente Input" })] }), _jsxs("div", { className: "space-y-3", children: [_jsx(SearchSelectInput, { label: "Deshabilitado", placeholder: "No editable", icon: "fa-ban", disabled: true, onSearchPromiseFn: mockSearchPromise, onSingleSearchPromiseFn: mockSingleSearchPromise }), _jsx("p", { className: "text-sm", style: { color: "var(--flysoft-text-secondary)" }, children: "respeta el estado disabled heredado del componente Input" })] })] })] })] }) }) }));
|
|
167
|
+
};
|
|
168
|
+
export default SearchSelectInputDocs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SnackbarDocs.d.ts","sourceRoot":"","sources":["../../src/docs/SnackbarDocs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA+c1B,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAWzB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|