reactigoded 1.0.0-beta.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/CHANGELOG.md +3001 -0
  2. package/LICENSE +21 -0
  3. package/README.md +556 -0
  4. package/dist/Toast-FZUdYH1L.js +594 -0
  5. package/dist/cn.js +7 -0
  6. package/dist/components/Accordion/Accordion.d.ts +49 -0
  7. package/dist/components/Accordion/AccordionContent.d.ts +15 -0
  8. package/dist/components/Accordion/AccordionContext.d.ts +59 -0
  9. package/dist/components/Accordion/AccordionHeader.d.ts +22 -0
  10. package/dist/components/Accordion/AccordionItem.d.ts +11 -0
  11. package/dist/components/Accordion/index.d.ts +8 -0
  12. package/dist/components/Alert/Alert.d.ts +39 -0
  13. package/dist/components/Alert/index.d.ts +2 -0
  14. package/dist/components/AlertDialog/AlertDialogClose.d.ts +64 -0
  15. package/dist/components/AlertDialog/AlertDialogContent.d.ts +58 -0
  16. package/dist/components/AlertDialog/index.d.ts +14 -0
  17. package/dist/components/Avatar/Avatar.d.ts +62 -0
  18. package/dist/components/Avatar/AvatarGroup.d.ts +13 -0
  19. package/dist/components/Avatar/index.d.ts +4 -0
  20. package/dist/components/Badge/Badge.d.ts +33 -0
  21. package/dist/components/Badge/index.d.ts +2 -0
  22. package/dist/components/Breadcrumb/Breadcrumb.d.ts +14 -0
  23. package/dist/components/Breadcrumb/BreadcrumbItem.d.ts +21 -0
  24. package/dist/components/Breadcrumb/index.d.ts +4 -0
  25. package/dist/components/Button/Button.d.ts +61 -0
  26. package/dist/components/Button/IconButton.d.ts +48 -0
  27. package/dist/components/Button/index.d.ts +4 -0
  28. package/dist/components/Card/Card.d.ts +79 -0
  29. package/dist/components/Card/CardBody.d.ts +8 -0
  30. package/dist/components/Card/CardDivider.d.ts +8 -0
  31. package/dist/components/Card/CardFooter.d.ts +8 -0
  32. package/dist/components/Card/CardHeader.d.ts +8 -0
  33. package/dist/components/Card/CardImage.d.ts +15 -0
  34. package/dist/components/Card/index.d.ts +12 -0
  35. package/dist/components/Checkbox/Checkbox.d.ts +47 -0
  36. package/dist/components/Checkbox/index.d.ts +2 -0
  37. package/dist/components/Chip/Chip.d.ts +38 -0
  38. package/dist/components/Chip/index.d.ts +2 -0
  39. package/dist/components/Dialog/Dialog.d.ts +80 -0
  40. package/dist/components/Dialog/DialogBody.d.ts +8 -0
  41. package/dist/components/Dialog/DialogClose.d.ts +61 -0
  42. package/dist/components/Dialog/DialogContent.d.ts +36 -0
  43. package/dist/components/Dialog/DialogContext.d.ts +1 -0
  44. package/dist/components/Dialog/DialogFooter.d.ts +8 -0
  45. package/dist/components/Dialog/DialogHeader.d.ts +13 -0
  46. package/dist/components/Dialog/DialogTrigger.d.ts +44 -0
  47. package/dist/components/Dialog/index.d.ts +16 -0
  48. package/dist/components/Divider/Divider.d.ts +34 -0
  49. package/dist/components/Divider/index.d.ts +2 -0
  50. package/dist/components/Input/ErrorText.d.ts +13 -0
  51. package/dist/components/Input/Helper.d.ts +11 -0
  52. package/dist/components/Input/Input.d.ts +35 -0
  53. package/dist/components/Input/InputAddon.d.ts +8 -0
  54. package/dist/components/Input/InputGroup.d.ts +17 -0
  55. package/dist/components/Input/Label.d.ts +12 -0
  56. package/dist/components/Input/index.d.ts +12 -0
  57. package/dist/components/NativeSelect/NativeSelect.d.ts +41 -0
  58. package/dist/components/NativeSelect/index.d.ts +2 -0
  59. package/dist/components/Navbar/Navbar.d.ts +46 -0
  60. package/dist/components/Navbar/NavbarActions.d.ts +10 -0
  61. package/dist/components/Navbar/NavbarLink.d.ts +13 -0
  62. package/dist/components/Navbar/NavbarLogo.d.ts +22 -0
  63. package/dist/components/Navbar/NavbarMenuButton.d.ts +15 -0
  64. package/dist/components/Navbar/NavbarNav.d.ts +14 -0
  65. package/dist/components/Navbar/index.d.ts +12 -0
  66. package/dist/components/Pagination/Pagination.d.ts +77 -0
  67. package/dist/components/Pagination/index.d.ts +2 -0
  68. package/dist/components/Progress/Progress.d.ts +63 -0
  69. package/dist/components/Progress/index.d.ts +2 -0
  70. package/dist/components/Radio/Radio.d.ts +28 -0
  71. package/dist/components/Radio/index.d.ts +2 -0
  72. package/dist/components/Rating/Rating.d.ts +85 -0
  73. package/dist/components/Rating/index.d.ts +2 -0
  74. package/dist/components/Sidebar/Sidebar.d.ts +28 -0
  75. package/dist/components/Sidebar/SidebarContext.d.ts +32 -0
  76. package/dist/components/Sidebar/SidebarDivider.d.ts +8 -0
  77. package/dist/components/Sidebar/SidebarFooter.d.ts +8 -0
  78. package/dist/components/Sidebar/SidebarHeader.d.ts +13 -0
  79. package/dist/components/Sidebar/SidebarItem.d.ts +42 -0
  80. package/dist/components/Sidebar/SidebarNav.d.ts +13 -0
  81. package/dist/components/Sidebar/SidebarSection.d.ts +11 -0
  82. package/dist/components/Sidebar/SidebarToggle.d.ts +17 -0
  83. package/dist/components/Sidebar/index.d.ts +16 -0
  84. package/dist/components/Skeleton/Skeleton.d.ts +60 -0
  85. package/dist/components/Skeleton/index.d.ts +2 -0
  86. package/dist/components/Slider/Slider.d.ts +44 -0
  87. package/dist/components/Slider/index.d.ts +2 -0
  88. package/dist/components/Slot/Slot.d.ts +1 -0
  89. package/dist/components/Slot/composeEventHandlers.d.ts +1 -0
  90. package/dist/components/Slot/composeRefs.d.ts +1 -0
  91. package/dist/components/Slot/index.d.ts +3 -0
  92. package/dist/components/Spinner/Spinner.d.ts +31 -0
  93. package/dist/components/Spinner/index.d.ts +2 -0
  94. package/dist/components/Stepper/Step.d.ts +17 -0
  95. package/dist/components/Stepper/Stepper.d.ts +97 -0
  96. package/dist/components/Stepper/index.d.ts +4 -0
  97. package/dist/components/Switch/Switch.d.ts +53 -0
  98. package/dist/components/Switch/index.d.ts +2 -0
  99. package/dist/components/Table/Table.d.ts +74 -0
  100. package/dist/components/Table/index.d.ts +2 -0
  101. package/dist/components/Tabs/Tabs.d.ts +41 -0
  102. package/dist/components/Tabs/TabsContent.d.ts +15 -0
  103. package/dist/components/Tabs/TabsContext.d.ts +61 -0
  104. package/dist/components/Tabs/TabsList.d.ts +10 -0
  105. package/dist/components/Tabs/TabsTrigger.d.ts +15 -0
  106. package/dist/components/Tabs/index.d.ts +8 -0
  107. package/dist/components/Textarea/Textarea.d.ts +51 -0
  108. package/dist/components/Textarea/index.d.ts +2 -0
  109. package/dist/components/ThemeToggle/ThemeToggle.d.ts +43 -0
  110. package/dist/components/ThemeToggle/index.d.ts +2 -0
  111. package/dist/components/Timeline/Timeline.d.ts +20 -0
  112. package/dist/components/Timeline/TimelineItem.d.ts +32 -0
  113. package/dist/components/Timeline/index.d.ts +4 -0
  114. package/dist/components/Toast/Toast.d.ts +47 -0
  115. package/dist/components/Toast/ToastContext.d.ts +93 -0
  116. package/dist/components/Toast/ToastProvider.d.ts +116 -0
  117. package/dist/components/Toast/index.d.ts +6 -0
  118. package/dist/components/floating/Menu/Menu.d.ts +67 -0
  119. package/dist/components/floating/Menu/MenuContent.d.ts +60 -0
  120. package/dist/components/floating/Menu/MenuContext.d.ts +78 -0
  121. package/dist/components/floating/Menu/MenuItem.d.ts +47 -0
  122. package/dist/components/floating/Menu/MenuLabel.d.ts +6 -0
  123. package/dist/components/floating/Menu/MenuSeparator.d.ts +6 -0
  124. package/dist/components/floating/Menu/MenuTrigger.d.ts +53 -0
  125. package/dist/components/floating/Menu/index.d.ts +12 -0
  126. package/dist/components/floating/Menu/menuSelectors.d.ts +15 -0
  127. package/dist/components/floating/Tooltip/Tooltip.d.ts +194 -0
  128. package/dist/components/floating/Tooltip/index.d.ts +2 -0
  129. package/dist/components/floating/index.d.ts +3 -0
  130. package/dist/components/floating/primitives/FloatingTreeRoot.d.ts +55 -0
  131. package/dist/components/floating/primitives/index.d.ts +2 -0
  132. package/dist/components/floating/primitives/useFloatingNode.d.ts +1 -0
  133. package/dist/components/index.d.ts +38 -0
  134. package/dist/hooks/useControllableState.d.ts +152 -0
  135. package/dist/hooks/useTheme.d.ts +44 -0
  136. package/dist/index.d.ts +36 -0
  137. package/dist/index.js +1843 -0
  138. package/dist/server-safe.d.ts +69 -0
  139. package/dist/server-safe.js +47 -0
  140. package/dist/styles/igoded-base.css +1 -0
  141. package/dist/styles/igoded-components.css +1 -0
  142. package/dist/styles/igoded-design.css +1 -0
  143. package/dist/styles/igoded-fonts.css +1 -0
  144. package/dist/styles/igoded-reset.css +1 -0
  145. package/dist/styles/igoded-state-css.css +1 -0
  146. package/dist/styles/igoded-tokens.css +1 -0
  147. package/dist/styles/index.css +3 -0
  148. package/dist/styles/state/active.css +1 -0
  149. package/dist/styles/state/checked.css +1 -0
  150. package/dist/styles/state/default.css +1 -0
  151. package/dist/styles/state/disabled.css +1 -0
  152. package/dist/styles/state/empty.css +1 -0
  153. package/dist/styles/state/first-child.css +1 -0
  154. package/dist/styles/state/first-of-type.css +1 -0
  155. package/dist/styles/state/focus-visible.css +1 -0
  156. package/dist/styles/state/focus-within.css +1 -0
  157. package/dist/styles/state/focus.css +1 -0
  158. package/dist/styles/state/group-hover.css +1 -0
  159. package/dist/styles/state/hover.css +1 -0
  160. package/dist/styles/state/in-range.css +1 -0
  161. package/dist/styles/state/indeterminate.css +1 -0
  162. package/dist/styles/state/invalid.css +1 -0
  163. package/dist/styles/state/last-child.css +1 -0
  164. package/dist/styles/state/last-of-type.css +1 -0
  165. package/dist/styles/state/nth-child.css +1 -0
  166. package/dist/styles/state/only-child.css +1 -0
  167. package/dist/styles/state/optional.css +1 -0
  168. package/dist/styles/state/other.css +1 -0
  169. package/dist/styles/state/out-of-range.css +1 -0
  170. package/dist/styles/state/placeholder-shown.css +1 -0
  171. package/dist/styles/state/read-only.css +1 -0
  172. package/dist/styles/state/read-write.css +1 -0
  173. package/dist/styles/state/required.css +1 -0
  174. package/dist/styles/state/target.css +1 -0
  175. package/dist/styles/state/valid.css +1 -0
  176. package/dist/utils/cn.d.ts +11 -0
  177. package/package.json +282 -0
@@ -0,0 +1,59 @@
1
+ export interface AccordionContextValue {
2
+ /** Devuelve si el item con ese `value` está abierto. */
3
+ isOpen: (value: string) => boolean;
4
+ /** Alterna el item con ese `value` respetando el modo (single/multiple). */
5
+ toggle: (value: string) => void;
6
+ /** Prefijo único para generar `id` de header/content por item. */
7
+ baseId: string;
8
+ }
9
+ export declare const AccordionContext: import('react').Context<AccordionContextValue | null>;
10
+ /**
11
+ * Hook que expone el contexto de un `<Accordion>` (isOpen, toggle, baseId).
12
+ * Lo usan internamente `AccordionItem`, `AccordionHeader` y
13
+ * `AccordionContent`. También útil para consumers que quieran inspeccionar
14
+ * el estado del accordion (por ejemplo, mostrar "X de Y items abiertos").
15
+ *
16
+ * @example
17
+ * function OpenCounter({ values }: { values: string[] }) {
18
+ * const { isOpen } = useAccordion();
19
+ * const openCount = values.filter(isOpen).length;
20
+ * return <span>{openCount}/{values.length} abiertos</span>;
21
+ * }
22
+ *
23
+ * @throws Error si se usa fuera de `<Accordion>`.
24
+ */
25
+ export declare function useAccordion(): AccordionContextValue;
26
+ export interface AccordionItemContextValue {
27
+ /** Identificador único del item (para `aria-controls`/`aria-labelledby`). */
28
+ value: string;
29
+ /** Si el item está abierto. */
30
+ open: boolean;
31
+ /** Alterna el item. */
32
+ toggle: () => void;
33
+ /** ID del header. */
34
+ headerId: string;
35
+ /** ID del panel de contenido. */
36
+ contentId: string;
37
+ }
38
+ export declare const AccordionItemContext: import('react').Context<AccordionItemContextValue | null>;
39
+ /**
40
+ * Hook que expone el contexto de un `<AccordionItem>` (value, open, toggle,
41
+ * headerId, contentId). Lo usan internamente `AccordionHeader` y
42
+ * `AccordionContent`. También útil si construyes tu propio Header custom
43
+ * que necesita el estado open + el toggle.
44
+ *
45
+ * @example
46
+ * function CustomHeader({ children }: { children: ReactNode }) {
47
+ * const { open, toggle, headerId, contentId } = useAccordionItem();
48
+ * return (
49
+ * <h3>
50
+ * <button id={headerId} aria-expanded={open} aria-controls={contentId} onClick={toggle}>
51
+ * {children} {open ? "▾" : "▸"}
52
+ * </button>
53
+ * </h3>
54
+ * );
55
+ * }
56
+ *
57
+ * @throws Error si se usa fuera de `<AccordionItem>`.
58
+ */
59
+ export declare function useAccordionItem(): AccordionItemContextValue;
@@ -0,0 +1,22 @@
1
+ import { ButtonHTMLAttributes, ReactNode, Ref } from 'react';
2
+ export interface AccordionHeaderProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> {
3
+ /** Texto/contenido del header. */
4
+ children: ReactNode;
5
+ /** Si `true`, oculta el icono indicador. */
6
+ hideIcon?: boolean | undefined;
7
+ /** Reemplaza el icono por defecto (▼). */
8
+ icon?: ReactNode | undefined;
9
+ /** Callback al togglear (además del toggle interno). */
10
+ onOpenChange?: ((open: boolean) => void) | undefined;
11
+ ref?: Ref<HTMLButtonElement> | undefined;
12
+ }
13
+ /**
14
+ * AccordionHeader — botón clicable que abre/cierra el item.
15
+ *
16
+ * Acepta keyboard navigation entre headers del mismo Accordion: ↑/↓ ciclan,
17
+ * Home/End van a extremos. Los items con `disabled` se saltan.
18
+ *
19
+ * Renderiza un `<button>` con `aria-expanded` y `aria-controls` apuntando al
20
+ * panel asociado.
21
+ */
22
+ export declare function AccordionHeader({ className, children, hideIcon, icon, disabled, onOpenChange, onKeyDown, ref, ...rest }: AccordionHeaderProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export interface AccordionItemProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Identificador único del item dentro del Accordion. */
4
+ value: string;
5
+ ref?: Ref<HTMLDivElement> | undefined;
6
+ }
7
+ /**
8
+ * AccordionItem — sección colapsable. Provee context con `value`/`open` y
9
+ * los IDs de header/content a los componentes anidados.
10
+ */
11
+ export declare function AccordionItem({ value, className, children, ref, ...rest }: AccordionItemProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export { Accordion } from './Accordion.js';
2
+ export type { AccordionProps } from './Accordion.js';
3
+ export { AccordionItem } from './AccordionItem.js';
4
+ export type { AccordionItemProps } from './AccordionItem.js';
5
+ export { AccordionHeader } from './AccordionHeader.js';
6
+ export type { AccordionHeaderProps } from './AccordionHeader.js';
7
+ export { AccordionContent } from './AccordionContent.js';
8
+ export type { AccordionContentProps } from './AccordionContent.js';
@@ -0,0 +1,39 @@
1
+ import { HTMLAttributes, ReactNode, Ref } from 'react';
2
+ export type AlertVariant = "success" | "warning" | "danger" | "info" | "brand" | "secondary" | "neutral";
3
+ export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
4
+ /** Color/semántica del alert. */
5
+ variant?: AlertVariant | undefined;
6
+ /** Icono opcional al inicio (suele ser un SVG o emoji). */
7
+ icon?: ReactNode | undefined;
8
+ /** Título destacado. */
9
+ title?: ReactNode | undefined;
10
+ /** Permite cerrar el alert (muestra botón ×). */
11
+ dismissible?: boolean | undefined;
12
+ /** Callback al pulsar el botón ×. Disparado tanto en modo controlado como uncontrolled. */
13
+ onClose?: (() => void) | undefined;
14
+ /** Texto a11y para el botón de cerrar. */
15
+ closeLabel?: string | undefined;
16
+ /** Si está abierto (modo controlado). */
17
+ open?: boolean | undefined;
18
+ /** Estado inicial (modo no controlado). Por defecto `true`. */
19
+ defaultOpen?: boolean | undefined;
20
+ /** Callback con el siguiente estado. Modo controlado o uncontrolled. */
21
+ onOpenChange?: ((open: boolean) => void) | undefined;
22
+ ref?: Ref<HTMLDivElement> | undefined;
23
+ }
24
+ /**
25
+ * Alert — mensaje de feedback con variants semánticos.
26
+ *
27
+ * Variants `danger`/`warning` usan `role="alert"` (anuncio assertivo);
28
+ * el resto `role="status"` con `aria-live="polite"`. Soporta `dismissible`
29
+ * controlado o no, icono y título.
30
+ *
31
+ * @example
32
+ * <Alert variant="success" title="Guardado">
33
+ * Cambios persistidos correctamente.
34
+ * </Alert>
35
+ * <Alert variant="warning" dismissible onOpenChange={setOpen}>
36
+ * Tu plan vence en 3 días.
37
+ * </Alert>
38
+ */
39
+ export declare function Alert({ variant, icon, title, dismissible, onClose, closeLabel, open, defaultOpen, onOpenChange, className, children, ref, ...rest }: AlertProps): import("react").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ export { Alert } from './Alert.js';
2
+ export type { AlertProps, AlertVariant } from './Alert.js';
@@ -0,0 +1,64 @@
1
+ import { ButtonHTMLAttributes, Ref } from 'react';
2
+ export interface AlertDialogCloseProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
+ ref?: Ref<HTMLButtonElement> | undefined;
4
+ /**
5
+ * Slot pattern (D14): si `true`, clona el child del consumer y le aplica
6
+ * close semantics sin renderizar un `<button>` propio ni aplicar
7
+ * `ig-dialog-close`. Patrón canónico para CTAs del footer del
8
+ * AlertDialog (Cancelar, Confirmar, etc.):
9
+ * `<AlertDialogClose asChild><Button variant="danger">Borrar</Button></AlertDialogClose>`.
10
+ *
11
+ * Sin `asChild`, `AlertDialogClose` renderiza un icon-button "×" idéntico
12
+ * a `DialogClose` (cierre asimetría léxica heredada — D14 Bloque B
13
+ * BREAKING vs beta.26 donde AlertDialogClose era unstyled).
14
+ */
15
+ asChild?: boolean | undefined;
16
+ }
17
+ /**
18
+ * AlertDialogClose — botón que cierra el AlertDialog via contexto. Dos modos:
19
+ *
20
+ * - **Default** (`asChild=false`): renderiza el icon-button "×" tradicional
21
+ * con clase `ig-dialog-close` (forzado 2rem × 2rem). Coherente con
22
+ * `DialogClose` (D14 Bloque B cerró la asimetría léxica heredada).
23
+ * **BREAKING vs beta.26**: antes era unstyled `<button>` para usar como
24
+ * CTA con `className="ig-btn ig-btn-*"`. Migración: usa `asChild` para
25
+ * ese caso.
26
+ *
27
+ * - **Slot pattern** (`asChild=true`, D14): clona el child del consumer y
28
+ * le aplica el close handler + aria-label. No aplica `ig-dialog-close`.
29
+ * Reemplaza el viejo uso unstyled. Permite CTAs ricos:
30
+ * `<AlertDialogClose asChild><Button variant="danger">Sí, borrar</Button></AlertDialogClose>`.
31
+ *
32
+ * Si necesitas el X del header dentro de un AlertDialog, usar
33
+ * `<AlertDialogClose>` sin children (o `<DialogClose>` directamente — es
34
+ * el mismo Provider, mismo contexto, sigue funcionando).
35
+ *
36
+ * Tolerante a uso fuera de `<AlertDialog>` / `<Dialog>`: si no hay
37
+ * contexto, el componente sigue siendo un botón pero el click NO cierra
38
+ * nada (responsabilidad del consumer via `onClick`).
39
+ *
40
+ * @example
41
+ * // Header X icon (default tras D14):
42
+ * <AlertDialogContent>
43
+ * <DialogHeader>
44
+ * <h2>Confirmar borrado</h2>
45
+ * <AlertDialogClose />
46
+ * </DialogHeader>
47
+ * ...
48
+ * </AlertDialogContent>
49
+ *
50
+ * @example
51
+ * // Footer CTAs (Slot pattern, reemplaza el viejo uso unstyled):
52
+ * <AlertDialogFooter>
53
+ * <AlertDialogClose asChild>
54
+ * <Button variant="secondary">Cancelar</Button>
55
+ * </AlertDialogClose>
56
+ * <AlertDialogClose asChild>
57
+ * <Button variant="danger">Sí, borrar</Button>
58
+ * </AlertDialogClose>
59
+ * </AlertDialogFooter>
60
+ *
61
+ * Es client-component (`"use client"`) porque consume el `DialogContext`
62
+ * via hook — NO marcado server-safe.
63
+ */
64
+ export declare function AlertDialogClose({ asChild, className, children, type, "aria-label": consumerAriaLabel, onClick: consumerOnClick, ref, ...rest }: AlertDialogCloseProps): import("react").JSX.Element;
@@ -0,0 +1,58 @@
1
+ import { Ref } from 'react';
2
+ import { DialogContentProps } from '../Dialog/index.js';
3
+ export interface AlertDialogContentProps extends DialogContentProps {
4
+ ref?: Ref<HTMLDialogElement> | undefined;
5
+ }
6
+ /**
7
+ * AlertDialogContent — el `<dialog>` HTML nativo con `role="alertdialog"`.
8
+ *
9
+ * Diferencias DS-wide respecto a `<DialogContent>`:
10
+ *
11
+ * 1. **`role="alertdialog"`** (vs `role="dialog"` automático del `<dialog>`).
12
+ * WAI-ARIA APG: `alertdialog` indica que el modal demanda atención
13
+ * del usuario y NO debe cerrarse sin decisión consciente. Browsers
14
+ * aplican `role="dialog"` por defecto al `<dialog>`; lo
15
+ * sobreescribimos explícitamente.
16
+ *
17
+ * 2. **`closeOnBackdrop={false}` por defecto** (vs `true` en
18
+ * `DialogContent`). Un AlertDialog típico ("¿Borrar permanentemente?")
19
+ * requiere un click consciente en Cancel/Confirm. Permitir cerrar por
20
+ * click outside ablanda la intención del role. El consumer puede
21
+ * sobreescribir pasando `closeOnBackdrop={true}` si su caso es más
22
+ * suave (ej. notice no destructivo).
23
+ *
24
+ * `closeOnEsc` sigue `true` por defecto — ESC es ergonómico universal
25
+ * y los SR lo anuncian como cancel implícito; no contraviene el
26
+ * carácter consciente del role.
27
+ *
28
+ * Composición: igual que DialogContent — `<AlertDialogHeader>`,
29
+ * `<AlertDialogBody>`, `<AlertDialogFooter>` (todos aliases de los
30
+ * componentes equivalentes de Dialog) más `<AlertDialogClose>`.
31
+ *
32
+ * Debe usarse dentro de `<AlertDialog>` (que es alias del Provider
33
+ * `<Dialog>`).
34
+ *
35
+ * @example
36
+ * <AlertDialog defaultOpen={false}>
37
+ * <AlertDialogTrigger className="ig-btn ig-btn-danger">
38
+ * Borrar permanentemente
39
+ * </AlertDialogTrigger>
40
+ * <AlertDialogContent>
41
+ * <AlertDialogHeader>
42
+ * <h2>Confirmar borrado</h2>
43
+ * </AlertDialogHeader>
44
+ * <AlertDialogBody>
45
+ * Esta acción es irreversible. ¿Continuar?
46
+ * </AlertDialogBody>
47
+ * <AlertDialogFooter>
48
+ * <AlertDialogClose className="ig-btn ig-btn-secondary">
49
+ * Cancelar
50
+ * </AlertDialogClose>
51
+ * <AlertDialogClose className="ig-btn ig-btn-danger">
52
+ * Sí, borrar
53
+ * </AlertDialogClose>
54
+ * </AlertDialogFooter>
55
+ * </AlertDialogContent>
56
+ * </AlertDialog>
57
+ */
58
+ export declare function AlertDialogContent({ closeOnBackdrop, role, ref, ...rest }: AlertDialogContentProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ export { Dialog as AlertDialog } from '../Dialog/index.js';
2
+ export type { DialogProps as AlertDialogProps } from '../Dialog/index.js';
3
+ export { AlertDialogContent } from './AlertDialogContent.js';
4
+ export type { AlertDialogContentProps } from './AlertDialogContent.js';
5
+ export { DialogTrigger as AlertDialogTrigger } from '../Dialog/index.js';
6
+ export type { DialogTriggerProps as AlertDialogTriggerProps } from '../Dialog/index.js';
7
+ export { DialogHeader as AlertDialogHeader } from '../Dialog/index.js';
8
+ export type { DialogHeaderProps as AlertDialogHeaderProps } from '../Dialog/index.js';
9
+ export { DialogBody as AlertDialogBody } from '../Dialog/index.js';
10
+ export type { DialogBodyProps as AlertDialogBodyProps } from '../Dialog/index.js';
11
+ export { DialogFooter as AlertDialogFooter } from '../Dialog/index.js';
12
+ export type { DialogFooterProps as AlertDialogFooterProps } from '../Dialog/index.js';
13
+ export { AlertDialogClose } from './AlertDialogClose.js';
14
+ export type { AlertDialogCloseProps } from './AlertDialogClose.js';
@@ -0,0 +1,62 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
3
+ export type AvatarStatus = "online" | "offline" | "busy" | "away";
4
+ interface AvatarBase extends HTMLAttributes<HTMLDivElement> {
5
+ size?: AvatarSize | undefined;
6
+ /** Cuadrado (default) → con bordes ligeramente redondeados; `rounded` lo hace círculo. */
7
+ rounded?: boolean | undefined;
8
+ /** Punto de estado en la esquina inferior derecha. */
9
+ status?: AvatarStatus | undefined;
10
+ /**
11
+ * Override del `aria-label` del punto de estado, para i18n. Si no se
12
+ * pasa, se usa "Estado: {label en español}". Pasa la traducción
13
+ * completa, no solo la palabra de estado.
14
+ */
15
+ statusLabel?: string | undefined;
16
+ ref?: Ref<HTMLDivElement> | undefined;
17
+ }
18
+ interface AvatarImage extends AvatarBase {
19
+ src: string;
20
+ alt: string;
21
+ /**
22
+ * Fallback opcional de iniciales si la imagen falla al cargar
23
+ * (M-10 gate review). Si la `<img>` dispara `error`, se renderizan
24
+ * estas iniciales en su lugar y se preserva la a11y. Sin `initials`
25
+ * el avatar queda vacío al fallar — el consumer es responsable de
26
+ * dar fallback explícito.
27
+ */
28
+ initials?: string | undefined;
29
+ /**
30
+ * Estrategia de carga del `<img>`. Por defecto `"lazy"` para no
31
+ * bloquear el LCP cuando el avatar está fuera del viewport (M-10).
32
+ * Pasa `"eager"` si el avatar es above-the-fold y crítico para LCP.
33
+ */
34
+ loading?: "lazy" | "eager" | undefined;
35
+ }
36
+ interface AvatarInitials extends AvatarBase {
37
+ src?: never;
38
+ alt?: never;
39
+ initials: string;
40
+ loading?: never;
41
+ }
42
+ export type AvatarProps = AvatarImage | AvatarInitials;
43
+ /**
44
+ * Avatar — imagen de usuario o iniciales.
45
+ *
46
+ * Pasa `src` + `alt` para imagen, o `initials` para fallback de texto.
47
+ * `status` añade un punto de estado (`online`, `offline`, `busy`, `away`).
48
+ *
49
+ * **M-10 (gate review)**: si pasas `src` Y `initials`, las iniciales
50
+ * actúan como fallback automático cuando la imagen falla a cargar
51
+ * (`onError` del `<img>`). Por defecto las imágenes cargan con
52
+ * `loading="lazy"`; pasa `loading="eager"` para avatares
53
+ * above-the-fold críticos para LCP.
54
+ *
55
+ * @example // imagen con fallback automático a iniciales
56
+ * <Avatar src="/avatar.jpg" alt="Iván" initials="IV" />
57
+ *
58
+ * @example // solo iniciales
59
+ * <Avatar initials="IV" />
60
+ */
61
+ export declare function Avatar(props: AvatarProps): import("react").JSX.Element;
62
+ export {};
@@ -0,0 +1,13 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export interface AvatarGroupProps extends HTMLAttributes<HTMLDivElement> {
3
+ ref?: Ref<HTMLDivElement> | undefined;
4
+ }
5
+ /**
6
+ * AvatarGroup — agrupa varios `Avatar` solapados (típico para listar miembros).
7
+ *
8
+ * Coloca avatares directamente como children; el CSS los solapa via offset
9
+ * negativo.
10
+ *
11
+ * @server-safe
12
+ */
13
+ export declare function AvatarGroup({ className, children, ref, ...rest }: AvatarGroupProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export { Avatar } from './Avatar.js';
2
+ export type { AvatarProps, AvatarSize, AvatarStatus } from './Avatar.js';
3
+ export { AvatarGroup } from './AvatarGroup.js';
4
+ export type { AvatarGroupProps } from './AvatarGroup.js';
@@ -0,0 +1,33 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export type BadgeVariant = "brand" | "secondary" | "success" | "warning" | "danger" | "info";
3
+ export type BadgeSize = "sm" | "md" | "lg";
4
+ export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
5
+ /** Variante de color. Por defecto `"brand"`. */
6
+ variant?: BadgeVariant | undefined;
7
+ /** Tamaño. `"md"` (default) no añade clase modificadora. */
8
+ size?: BadgeSize | undefined;
9
+ /** Pill/píldora con esquinas totalmente redondeadas. */
10
+ pill?: boolean | undefined;
11
+ /** Outline en vez de relleno sólido. */
12
+ outline?: boolean | undefined;
13
+ /**
14
+ * Modo "punto": un círculo sin texto. Cuando `dot=true`, los `children`
15
+ * se ignoran visualmente y se mueven a `aria-label` para SR. Útil como
16
+ * indicador de estado (online, notificación, etc.).
17
+ */
18
+ dot?: boolean | undefined;
19
+ ref?: Ref<HTMLSpanElement> | undefined;
20
+ }
21
+ /**
22
+ * Badge — etiqueta breve de estado o categoría. Inline, no clickeable
23
+ * (si necesitas algo clickeable usa Chip o Button).
24
+ *
25
+ * @example
26
+ * <Badge>Nuevo</Badge>
27
+ * <Badge variant="success" pill>Activo</Badge>
28
+ * <Badge variant="danger" outline>Bloqueado</Badge>
29
+ * <Badge variant="success" dot>Conectado</Badge>
30
+ *
31
+ * @server-safe
32
+ */
33
+ export declare function Badge({ variant, size, pill, outline, dot, className, children, ref, role: roleProp, "aria-label": ariaLabelProp, ...rest }: BadgeProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Badge } from './Badge.js';
2
+ export type { BadgeProps, BadgeVariant, BadgeSize } from './Badge.js';
@@ -0,0 +1,14 @@
1
+ import { HTMLAttributes, ReactNode, Ref } from 'react';
2
+ export interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
3
+ /** Separador entre items. Por defecto `"/"`. Puede ser nodo (icono). */
4
+ separator?: ReactNode | undefined;
5
+ ref?: Ref<HTMLElement> | undefined;
6
+ }
7
+ /**
8
+ * Breadcrumb — `<nav>` con jerarquía de navegación. Pasa `BreadcrumbItem`s
9
+ * como children; el componente intercala el `separator` automáticamente.
10
+ *
11
+ * El último item debería tener `current=true` (renderiza `<span aria-current="page">`
12
+ * en vez de `<a>`).
13
+ */
14
+ export declare function Breadcrumb({ separator, className, children, ref, ...rest }: BreadcrumbProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { AnchorHTMLAttributes, HTMLAttributes, Ref } from 'react';
2
+ type BreadcrumbItemAsCurrent = HTMLAttributes<HTMLSpanElement> & {
3
+ /** Marca este item como la página actual (renderiza `<span aria-current="page">`). */
4
+ current: true;
5
+ href?: never;
6
+ ref?: Ref<HTMLSpanElement> | undefined;
7
+ };
8
+ type BreadcrumbItemAsLink = AnchorHTMLAttributes<HTMLAnchorElement> & {
9
+ current?: false | undefined;
10
+ ref?: Ref<HTMLAnchorElement> | undefined;
11
+ };
12
+ export type BreadcrumbItemProps = BreadcrumbItemAsCurrent | BreadcrumbItemAsLink;
13
+ /**
14
+ * BreadcrumbItem — un item de un `Breadcrumb`. Si `current=true`, se
15
+ * renderiza como `<span>` con `aria-current="page"` (no clickable). En caso
16
+ * contrario es un `<a>` con todos los atributos de anchor.
17
+ *
18
+ * @server-safe
19
+ */
20
+ export declare function BreadcrumbItem(props: BreadcrumbItemProps): import("react").JSX.Element;
21
+ export {};
@@ -0,0 +1,4 @@
1
+ export { Breadcrumb } from './Breadcrumb.js';
2
+ export type { BreadcrumbProps } from './Breadcrumb.js';
3
+ export { BreadcrumbItem } from './BreadcrumbItem.js';
4
+ export type { BreadcrumbItemProps } from './BreadcrumbItem.js';
@@ -0,0 +1,61 @@
1
+ import { ButtonHTMLAttributes, Ref } from 'react';
2
+ /**
3
+ * Variantes semánticas de color (las 6 cardinales del DS). Cada una
4
+ * corresponde a una clase `.ig-btn-<variant>` (solid) y a su par
5
+ * `.ig-btn-outline-<variant>` / `.ig-btn-ghost-<variant>` para apariencias.
6
+ *
7
+ * `outline`, `ghost` y `link` ya NO viven aquí — pasaron a `appearance`
8
+ * (1.0.0-beta.1) para separar el eje "color/semántica" del eje
9
+ * "estilo visual". Antes se podía hacer `variant="outline"` Y
10
+ * `appearance="outline"`: redundante y confuso.
11
+ */
12
+ export type ButtonVariant = "brand" | "secondary" | "success" | "warning" | "danger" | "info";
13
+ /**
14
+ * Tamaños del botón. `md` es el por defecto (sin clase de tamaño aplicada).
15
+ * Los demás corresponden a `.ig-btn-<size>`.
16
+ */
17
+ export type ButtonSize = "xs" | "sm" | "md" | "lg" | "xl";
18
+ /**
19
+ * Apariencia visual del botón. Combina con `variant` para producir la clase
20
+ * CSS final.
21
+ *
22
+ * - `"solid"` (default): fondo sólido del color de la variant → `ig-btn-<variant>`.
23
+ * - `"outline"`: borde del color, fondo transparente → `ig-btn-outline-<variant>`.
24
+ * - `"ghost"`: sin borde, hover sutil → `ig-btn-ghost-<variant>`.
25
+ * - `"link"`: aspecto de link de texto → `ig-btn-link` (variant ignorado).
26
+ */
27
+ export type ButtonAppearance = "solid" | "outline" | "ghost" | "link";
28
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
29
+ /** Variante semántica de color. Por defecto `"brand"`. */
30
+ variant?: ButtonVariant | undefined;
31
+ /** Apariencia visual. Por defecto `"solid"`. */
32
+ appearance?: ButtonAppearance | undefined;
33
+ /** Tamaño. `"md"` (default) no añade clase modificadora. */
34
+ size?: ButtonSize | undefined;
35
+ /** Muestra spinner y bloquea clicks. */
36
+ loading?: boolean | undefined;
37
+ /** Ocupa el ancho completo del contenedor. */
38
+ block?: boolean | undefined;
39
+ /** Botón solo-icono (cuadrado, padding equilibrado). */
40
+ icon?: boolean | undefined;
41
+ /** Ref al `<button>` subyacente. En React 19 es prop normal. */
42
+ ref?: Ref<HTMLButtonElement> | undefined;
43
+ }
44
+ /**
45
+ * Botón base del design system.
46
+ *
47
+ * API en dos ejes ortogonales: `variant` (color/semántica) × `appearance`
48
+ * (estilo visual). Junto con `size`/`loading`/`block`/`icon` cubre todos los
49
+ * casos sin combinaciones redundantes.
50
+ *
51
+ * @example
52
+ * <Button onClick={save}>Guardar</Button>
53
+ * <Button variant="danger" loading>Eliminando…</Button>
54
+ * <Button variant="success" appearance="outline">OK</Button>
55
+ * <Button appearance="link">Saber más</Button>
56
+ * <Button icon aria-label="Favorito">★</Button>
57
+ *
58
+ * @server-safe Renderiza determinísticamente en server (sin DOM access
59
+ * en render path). Compatible con React Server Components y SSR puro.
60
+ */
61
+ export declare function Button({ variant, appearance, size, loading, block, icon, disabled, className, children, ref, ...rest }: ButtonProps): import("react").JSX.Element;
@@ -0,0 +1,48 @@
1
+ import { ReactNode, Ref } from 'react';
2
+ import { ButtonProps } from './Button.js';
3
+ /**
4
+ * Props del IconButton: hereda todo de `Button` excepto `icon`
5
+ * (forzado a `true` por el componente) y exige `aria-label` como
6
+ * required vía TS.
7
+ */
8
+ export interface IconButtonProps extends Omit<ButtonProps, "icon" | "aria-label"> {
9
+ /**
10
+ * Etiqueta accesible obligatoria. Como el botón solo contiene un
11
+ * icono, los lectores de pantalla necesitan este texto para
12
+ * anunciar la acción.
13
+ *
14
+ * El typing es intencionalmente required: TS impide montar un
15
+ * `<IconButton>` sin `aria-label` en compile-time, sin necesidad
16
+ * de un dev warn runtime.
17
+ */
18
+ "aria-label": string;
19
+ /** Icono visual (svg, span con emoji, glyph, etc.). */
20
+ children: ReactNode;
21
+ ref?: Ref<HTMLButtonElement> | undefined;
22
+ }
23
+ /**
24
+ * IconButton — botón solo-icono accesible. Sub-componente de Button
25
+ * con `icon=true` enforced y `aria-label` como prop required vía TS.
26
+ *
27
+ * Cuando un Button contiene solo un icono (sin texto visible para
28
+ * lectores de pantalla), el `aria-label` es obligatorio por
29
+ * accesibilidad. Olvidarlo es un error frecuente que axe captura solo
30
+ * en runtime; este sub-componente lo eleva a error de compilación.
31
+ *
32
+ * Hereda todo el resto de `ButtonProps` (variant, appearance, size,
33
+ * loading, block, disabled). El consumer no puede pasar `icon={false}`
34
+ * por la firma `Omit<ButtonProps, "icon">`.
35
+ *
36
+ * @example
37
+ * <IconButton aria-label="Favorito" variant="brand">★</IconButton>
38
+ * <IconButton aria-label="Cerrar" appearance="ghost" size="sm">×</IconButton>
39
+ * <IconButton aria-label="Editar" variant="info" loading>
40
+ * <PencilIcon />
41
+ * </IconButton>
42
+ *
43
+ * @example // ✗ TS error: aria-label is required
44
+ * <IconButton variant="brand">★</IconButton>
45
+ *
46
+ * @server-safe
47
+ */
48
+ export declare function IconButton({ children, ref, ...rest }: IconButtonProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export { Button } from './Button.js';
2
+ export type { ButtonProps, ButtonVariant, ButtonSize, ButtonAppearance, } from './Button.js';
3
+ export { IconButton } from './IconButton.js';
4
+ export type { IconButtonProps } from './IconButton.js';
@@ -0,0 +1,79 @@
1
+ import { ComponentPropsWithoutRef, ComponentPropsWithRef, ElementType, ReactElement } from 'react';
2
+ export type CardVariant = "brand" | "secondary" | "success" | "warning" | "danger" | "info";
3
+ /**
4
+ * Apariencia visual cuando hay `variant`:
5
+ * - `"outline"` (default): borde del color, fondo neutro → `ig-card-<variant>`.
6
+ * - `"filled"`: fondo sólido del color → `ig-card-<variant>-filled`.
7
+ *
8
+ * Sin `variant` la apariencia se ignora (la card es plana).
9
+ */
10
+ export type CardAppearance = "outline" | "filled";
11
+ /**
12
+ * Props propios del Card (sin contar los HTML estándar del elemento subyacente).
13
+ */
14
+ interface CardOwnProps<C extends ElementType = "div"> {
15
+ /**
16
+ * Elemento HTML o componente que renderea la card. Por defecto `"div"`.
17
+ * Acepta strings (`"article"`, `"section"`, `"a"`, …) y componentes
18
+ * (`as={Link}`, `as={NextLink}`).
19
+ *
20
+ * Cuando pasas un componente, las props específicas del componente
21
+ * (`href` para `<a>`, `to` para react-router, etc.) se tipan
22
+ * automáticamente.
23
+ */
24
+ as?: C | undefined;
25
+ /** Color semántico de la card. */
26
+ variant?: CardVariant | undefined;
27
+ /** Apariencia visual. Por defecto `"outline"`. Solo aplica si hay `variant`. */
28
+ appearance?: CardAppearance | undefined;
29
+ /** Borde más marcado. */
30
+ bordered?: boolean | undefined;
31
+ /** Sombra elevada. */
32
+ elevated?: boolean | undefined;
33
+ /** Efecto glass (backdrop-filter). */
34
+ glass?: boolean | undefined;
35
+ /** Hover lift + cursor pointer (úsalo cuando la card es clickable). */
36
+ interactive?: boolean | undefined;
37
+ /**
38
+ * Ref polimórfica al elemento subyacente. El tipo se infiere de `as`.
39
+ */
40
+ ref?: ComponentPropsWithRef<C>["ref"] | undefined;
41
+ }
42
+ export type CardProps<C extends ElementType = "div"> = CardOwnProps<C> & Omit<ComponentPropsWithoutRef<C>, keyof CardOwnProps<C>>;
43
+ /**
44
+ * Card — contenedor de contenido con variantes de color y modificadores
45
+ * visuales (bordered, elevated, glass, interactive).
46
+ *
47
+ * **Polimórfica**: por defecto renderea `<div>`, pero acepta cualquier
48
+ * elemento HTML o componente vía la prop `as`.
49
+ *
50
+ * @example
51
+ * // Como elemento semántico
52
+ * <Card as="article" elevated>...</Card>
53
+ *
54
+ * // Como link nativo
55
+ * <Card as="a" href="/posts/1" interactive>...</Card>
56
+ *
57
+ * // Como componente (react-router, next, etc.)
58
+ * <Card as={Link} to="/posts/1" interactive>...</Card>
59
+ *
60
+ * **Card como botón**: pasa `interactive` + `role="button"` + `onClick`.
61
+ * Cuando se cumplen las 3 condiciones, la card activa Enter/Space
62
+ * automáticamente como un `<button>` nativo (la keyboard activation es
63
+ * obligatoria por WAI-ARIA APG si añades `role="button"` a un elemento no
64
+ * interactivo) y aplica `tabIndex={0}` por defecto para que sea
65
+ * focuseable. Si pasas un `tabIndex` explícito (incluido `-1`) tu valor
66
+ * se respeta. Si pasas tu propio `onKeyDown`, el handler interno se
67
+ * encadena después — tu lógica corre primero y puedes llamar
68
+ * `event.preventDefault()` para evitar la activación por defecto.
69
+ *
70
+ * Combina con `CardHeader`, `CardBody`, `CardFooter`, `CardImage`,
71
+ * `CardDivider` para layouts compuestos.
72
+ *
73
+ * @example
74
+ * <Card interactive role="button" onClick={() => navigate("/x")}>
75
+ * <CardBody>Click o Enter/Space para navegar</CardBody>
76
+ * </Card>
77
+ */
78
+ export declare function Card<C extends ElementType = "div">({ as, variant, appearance, bordered, elevated, glass, interactive, className, children, ref, role, onClick, onKeyDown, ...rest }: CardProps<C>): ReactElement;
79
+ export {};