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,60 @@
1
+ import { HTMLAttributes, ReactNode, Ref } from 'react';
2
+ export type SkeletonVariant = "text" | "title" | "avatar" | "avatar-lg" | "card" | "image" | "button";
3
+ export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
4
+ /**
5
+ * Forma del placeholder. `text` (default) es una línea de texto, `title` una
6
+ * más alta, `avatar`/`avatar-lg` círculos, `card`/`image` rectángulos
7
+ * grandes y `button` un placeholder de botón.
8
+ */
9
+ variant?: SkeletonVariant | undefined;
10
+ ref?: Ref<HTMLDivElement> | undefined;
11
+ }
12
+ /**
13
+ * Skeleton — placeholder animado **decorativo** mientras se carga
14
+ * contenido. NO anuncia carga al lector de pantalla por sí solo:
15
+ * `role="presentation"` + `aria-hidden="true"`.
16
+ *
17
+ * Para anunciar el estado de carga al SR, envuelve un grupo de
18
+ * `Skeleton` en `<SkeletonContainer label="...">`. El container
19
+ * dispara UN solo aviso al SR (no uno por cada `Skeleton`, que era
20
+ * el bug del patrón anterior con `role="status"` por instancia).
21
+ *
22
+ * Cualquier tamaño extra puede pasarse por `style` (`width`, `height`).
23
+ *
24
+ * @example
25
+ * <SkeletonContainer label="Cargando perfil">
26
+ * <Skeleton variant="avatar" />
27
+ * <Skeleton variant="title" />
28
+ * <Skeleton variant="text" />
29
+ * </SkeletonContainer>
30
+ *
31
+ * <Skeleton variant="card" style={{ height: 200 }} />
32
+ *
33
+ * @server-safe
34
+ */
35
+ export declare function Skeleton({ variant, className, ref, ...rest }: SkeletonProps): import("react").JSX.Element;
36
+ export interface SkeletonContainerProps extends HTMLAttributes<HTMLDivElement> {
37
+ /**
38
+ * Etiqueta para SR. Por defecto `"Cargando contenido…"` (ES).
39
+ * Pasa una string específica del contexto para mejor UX SR.
40
+ */
41
+ label?: string | undefined;
42
+ children: ReactNode;
43
+ ref?: Ref<HTMLDivElement> | undefined;
44
+ }
45
+ /**
46
+ * SkeletonContainer — wrapper accesible para grupos de `Skeleton`.
47
+ * Anuncia estado de carga UNA vez al lector de pantalla
48
+ * (`role="status"` + `aria-busy="true"` + `aria-live="polite"` +
49
+ * `aria-label`). El layout es neutro (`display: contents`): NO
50
+ * añade caja al flujo, los hijos se posicionan como si el container
51
+ * no existiese.
52
+ *
53
+ * @example
54
+ * <SkeletonContainer label="Cargando lista de pedidos">
55
+ * <Skeleton variant="text" />
56
+ * <Skeleton variant="text" />
57
+ * <Skeleton variant="text" />
58
+ * </SkeletonContainer>
59
+ */
60
+ export declare function SkeletonContainer({ label, children, className, ref, ...rest }: SkeletonContainerProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Skeleton, SkeletonContainer } from './Skeleton.js';
2
+ export type { SkeletonProps, SkeletonContainerProps, SkeletonVariant, } from './Skeleton.js';
@@ -0,0 +1,44 @@
1
+ import { InputHTMLAttributes, Ref } from 'react';
2
+ export interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> {
3
+ /** Mostrar el valor actual junto al slider. */
4
+ showValue?: boolean | undefined;
5
+ /** Formateador opcional para el valor visible y para `aria-valuetext`. */
6
+ formatValue?: ((value: number) => string) | undefined;
7
+ /**
8
+ * Callback con el valor numérico decodificado.
9
+ *
10
+ * B-02 / H-17 (RC1): pre-RC1 Slider exponía `onChange` (ChangeEvent
11
+ * nativo) Y `onValueChange` (number). Ambos en paralelo confundían al
12
+ * consumer (¿cuál uso?). RC1 estandariza con el resto del DS: queda
13
+ * solo `onValueChange<number>`. Si necesitas el ChangeEvent nativo
14
+ * por algún motivo (analytics del DOM event, e.g.), añade un wrapper
15
+ * `<input type="range" onChange={...}>` manual.
16
+ */
17
+ onValueChange?: ((value: number) => void) | undefined;
18
+ /**
19
+ * Ids extra para `aria-describedby`. Pasar string para un único id o
20
+ * array para varios. Se concatenan con cualquier `aria-describedby`
21
+ * que el consumer pase por rest. Patrón canónico del DS para enlazar
22
+ * `Helper` / `ErrorText` / live-regions con tecnologías asistivas.
23
+ */
24
+ describedBy?: string | string[] | undefined;
25
+ ref?: Ref<HTMLInputElement> | undefined;
26
+ }
27
+ /**
28
+ * Slider — `<input type="range">` estilizado. Con `showValue` muestra el
29
+ * valor actual al lado (controlado o no). Soporta `formatValue` para
30
+ * formatear (ej. `(v) => `${v}%``).
31
+ *
32
+ * `formatValue` también se aplica a `aria-valuetext` para que los lectores
33
+ * de pantalla anuncien el formato (`50%` en vez de `50`).
34
+ *
35
+ * @example
36
+ * <Slider
37
+ * aria-label="Volumen"
38
+ * value={vol}
39
+ * onValueChange={setVol}
40
+ * showValue
41
+ * formatValue={(v) => `${v}%`}
42
+ * />
43
+ */
44
+ export declare function Slider({ min, max, step, value, defaultValue, showValue, formatValue, className, onValueChange, describedBy, ref, ...rest }: SliderProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Slider } from './Slider.js';
2
+ export type { SliderProps } from './Slider.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export type { SlotProps } from './Slot.js';
2
+ export { composeRefs } from './composeRefs.js';
3
+ export { composeEventHandlers } from './composeEventHandlers.js';
@@ -0,0 +1,31 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export type SpinnerVariant = "brand" | "secondary" | "success" | "warning" | "danger" | "info";
3
+ export type SpinnerSize = "xs" | "sm" | "md" | "lg" | "xl";
4
+ export interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
5
+ /** Color del spinner. Por defecto `"brand"`. */
6
+ variant?: SpinnerVariant | undefined;
7
+ /** Tamaño. `"md"` por defecto. */
8
+ size?: SpinnerSize | undefined;
9
+ /**
10
+ * Etiqueta accesible para SR. Por defecto `"Cargando…"` (ES). Sustituye
11
+ * el `aria-label` del componente para i18n. Si pasas también
12
+ * `aria-label` directo (vía rest), `aria-label` gana sobre `label`.
13
+ */
14
+ label?: string | undefined;
15
+ ref?: Ref<HTMLSpanElement> | undefined;
16
+ }
17
+ /**
18
+ * Spinner — indicador de carga circular animado.
19
+ *
20
+ * Aplica `role="status"` y `aria-label` (default "Cargando…") para que los
21
+ * lectores de pantalla anuncien el estado de carga. Pasa `aria-label` para
22
+ * personalizar (i18n o contexto específico).
23
+ *
24
+ * @example
25
+ * <Spinner />
26
+ * <Spinner variant="success" size="lg" />
27
+ * <Spinner aria-label="Procesando pago…" />
28
+ *
29
+ * @server-safe
30
+ */
31
+ export declare function Spinner({ variant, size, label, className, ref, ...rest }: SpinnerProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Spinner } from './Spinner.js';
2
+ export type { SpinnerProps, SpinnerVariant, SpinnerSize } from './Spinner.js';
@@ -0,0 +1,17 @@
1
+ import { HTMLAttributes, ReactNode, Ref } from 'react';
2
+ export interface StepProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Etiqueta debajo del círculo (sólo aplica con `Stepper labeled`). */
4
+ label?: ReactNode | undefined;
5
+ ref?: Ref<HTMLDivElement> | undefined;
6
+ }
7
+ /**
8
+ * Step — un paso de un `Stepper`. No se usa suelto: pasa los `Step`s como
9
+ * children del `Stepper` y este se encarga de inyectar `index`/`active`/`complete`.
10
+ *
11
+ * Cuando el Stepper padre es interactivo (`onActiveChange` definido),
12
+ * el dot del Step lleva `role="button"` + `tabIndex` roving y soporta
13
+ * activación por teclado (Enter/Space) y navegación (ArrowKey/Home/End).
14
+ *
15
+ * @server-safe
16
+ */
17
+ export declare function Step(props: StepProps): import("react").JSX.Element;
@@ -0,0 +1,97 @@
1
+ import { HTMLAttributes, ReactNode, Ref } from 'react';
2
+ export interface StepperProps extends HTMLAttributes<HTMLDivElement> {
3
+ /**
4
+ * Índice (0-based) del step activo en **modo controlled**. Steps
5
+ * anteriores se marcan completos; el de este índice lleva
6
+ * `aria-current="step"`.
7
+ *
8
+ * **D5 (beta.24)**: `active` ahora es opcional. Patrón controlled/
9
+ * uncontrolled DS-wide alineado con Pagination, Sidebar, Tabs,
10
+ * Switch, Accordion:
11
+ *
12
+ * - Pasas `active` → controlled. Tu app gestiona el estado y este
13
+ * debe actualizarse en respuesta a `onActiveChange`. Si lo dejas
14
+ * congelado, el Stepper se queda congelado (consciente).
15
+ * - Omites `active` (y opcionalmente pasas `defaultActive`) →
16
+ * uncontrolled. El Stepper mantiene su propio estado interno y
17
+ * `onActiveChange` actúa como observer (callback opcional).
18
+ *
19
+ * En modo controlled SIN `onActiveChange` el Stepper queda
20
+ * presentational (sin keyboard nav ni clicks activos). En modo
21
+ * uncontrolled siempre es interactive — `defaultActive` solo describe
22
+ * el valor inicial; sin un mecanismo para mutarlo el componente sería
23
+ * un display estático sin razón de ser.
24
+ */
25
+ active?: number | undefined;
26
+ /**
27
+ * Valor inicial en **modo uncontrolled** (cuando `active` es
28
+ * undefined). Por defecto `0`. Ignorado en modo controlled.
29
+ */
30
+ defaultActive?: number | undefined;
31
+ /**
32
+ * Callback cuando el usuario navega o activa por teclado / click.
33
+ * Dispara en ambos modos:
34
+ *
35
+ * - **Controlled** (`active` definido): el callback es el único
36
+ * mecanismo para que el consumer actualice `active`. Si está
37
+ * omitido en controlled, el Stepper queda presentational
38
+ * (consumer no puede observar cambios → sin sentido habilitar
39
+ * interactive).
40
+ * - **Uncontrolled** (`active` undefined): el callback actúa como
41
+ * observer. El Stepper actualiza su estado interno aunque el
42
+ * consumer no pase callback.
43
+ *
44
+ * Interactive mode (focus + keyboard nav):
45
+ * - Cada step lleva `role="button"` + `tabIndex` roving.
46
+ * - ArrowLeft / ArrowUp → step anterior.
47
+ * - ArrowRight / ArrowDown → step siguiente.
48
+ * - Home → primer step.
49
+ * - End → último step.
50
+ * - Enter / Space → activa el step focuseado.
51
+ *
52
+ * El callback recibe el índice 0-based del step destino. En modo
53
+ * controlled el consumer decide si lo aplica (puede rechazar saltos
54
+ * hacia adelante en un wizard, p.ej.).
55
+ */
56
+ onActiveChange?: ((next: number) => void) | undefined;
57
+ /** Si true, usa el layout con labels debajo (`ig-stepper-labeled`). */
58
+ labeled?: boolean | undefined;
59
+ /** Una lista de `Step`. */
60
+ children: ReactNode;
61
+ ref?: Ref<HTMLDivElement> | undefined;
62
+ }
63
+ /**
64
+ * Stepper — secuencia visual de pasos. Steps con índice menor que `active`
65
+ * se marcan como `complete`; el del índice `active` lleva `aria-current="step"`.
66
+ *
67
+ * Dos layouts:
68
+ * - **Compacto** (default): círculos conectados por una línea fina.
69
+ * - **Labeled** (`labeled`): círculos sobre labels; conector como `::after`.
70
+ *
71
+ * Pasa los `Step`s como children — el Stepper inyecta `index`/`active`/`complete`
72
+ * a cada uno automáticamente.
73
+ *
74
+ * **Modo interactive** (cuando `onActiveChange` está definido):
75
+ * cada step es focuseable con roving tabIndex y soporta teclado completo
76
+ * (ArrowKey, Home/End, Enter/Space). Patrón inspirado en WAI-ARIA APG
77
+ * Tabs adaptado a stepper. El consumer es quien finalmente aplica el
78
+ * cambio actualizando `active`.
79
+ *
80
+ * @example
81
+ * // Presentational (sin keyboard nav, default)
82
+ * <Stepper active={2}>
83
+ * <Step label="Paso 1" />
84
+ * <Step label="Paso 2" />
85
+ * <Step label="Paso 3" />
86
+ * </Stepper>
87
+ *
88
+ * @example
89
+ * // Interactive (teclado completo)
90
+ * const [step, setStep] = useState(0);
91
+ * <Stepper active={step} onActiveChange={setStep} labeled>
92
+ * <Step label="Datos" />
93
+ * <Step label="Pago" />
94
+ * <Step label="Confirmar" />
95
+ * </Stepper>
96
+ */
97
+ export declare function Stepper({ active, defaultActive, onActiveChange, labeled, className, children, ref, ...rest }: StepperProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export { Stepper } from './Stepper.js';
2
+ export type { StepperProps } from './Stepper.js';
3
+ export { Step } from './Step.js';
4
+ export type { StepProps } from './Step.js';
@@ -0,0 +1,53 @@
1
+ import { InputHTMLAttributes, Ref } from 'react';
2
+ export type SwitchVariant = "brand" | "secondary" | "success" | "warning" | "danger" | "info";
3
+ export interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
4
+ /** Color del switch cuando está activo. */
5
+ variant?: SwitchVariant | undefined;
6
+ /** Etiqueta visible junto al switch. */
7
+ children?: React.ReactNode | undefined;
8
+ /**
9
+ * Activa el tercer estado visual del switch (thumb centrado en el
10
+ * track, color de variante de fondo). Se aplica vía
11
+ * `el.indeterminate = true` en el `<input>` nativo y reemplaza
12
+ * `aria-checked` por `"mixed"` para lectores de pantalla. Útil en
13
+ * toggles maestros que controlan un grupo donde unos hijos están
14
+ * on y otros off (desde 1.0.0-beta.8).
15
+ */
16
+ indeterminate?: boolean | undefined;
17
+ /**
18
+ * Ids extra para `aria-describedby`. Pasar string para un único id o
19
+ * array para varios. Se concatenan con cualquier `aria-describedby`
20
+ * que el consumer pase por rest. Patrón canónico del DS para enlazar
21
+ * `Helper` / `ErrorText` / live-regions con tecnologías asistivas.
22
+ */
23
+ describedBy?: string | string[] | undefined;
24
+ ref?: Ref<HTMLInputElement> | undefined;
25
+ }
26
+ /**
27
+ * Switch — toggle accesible. Internamente es un `<input type="checkbox">`
28
+ * con `role="switch"` + `aria-checked` para que los lectores de pantalla lo
29
+ * anuncien como toggle (no como checkbox). Va envuelto en `<label>` con una
30
+ * pista visual decorativa.
31
+ *
32
+ * **Estructura DOM**:
33
+ * ```
34
+ * <label class="ig-switch ig-switch-{variant}">
35
+ * <input type="checkbox" role="switch" />
36
+ * <span class="ig-switch-track" aria-hidden="true" />
37
+ * {children} ← label de texto opcional
38
+ * </label>
39
+ * ```
40
+ *
41
+ * La clase `ig-switch` vive en el `<label>` wrapper, NO en el `<input>`.
42
+ * En tests, `screen.getByRole("switch")` devuelve el input — para
43
+ * asserts sobre la clase wrapper desde el input usar
44
+ * `input.closest("label")`.
45
+ *
46
+ * @example
47
+ * <Switch defaultChecked>Recibir notificaciones</Switch>
48
+ * <Switch indeterminate>Notificaciones por categoría</Switch>
49
+ * <Switch checked={on} onChange={(e) => setOn(e.target.checked)}>
50
+ * Modo experimental
51
+ * </Switch>
52
+ */
53
+ export declare function Switch({ variant, className, children, ref, disabled, checked, defaultChecked, indeterminate, describedBy, onChange, ...rest }: SwitchProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Switch } from './Switch.js';
2
+ export type { SwitchProps, SwitchVariant } from './Switch.js';
@@ -0,0 +1,74 @@
1
+ import { HTMLAttributes, Ref, TableHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes } from 'react';
2
+ export type TableLayout = "auto" | "fixed";
3
+ export interface TableProps extends TableHTMLAttributes<HTMLTableElement> {
4
+ /** Filas alternas con color de fondo. */
5
+ striped?: boolean | undefined;
6
+ /** Fila destacada al hover. */
7
+ hover?: boolean | undefined;
8
+ /** Bordes en todas las celdas. */
9
+ bordered?: boolean | undefined;
10
+ /** Padding reducido. */
11
+ compact?: boolean | undefined;
12
+ /** `table-layout`: `auto` (defecto del navegador) o `fixed`. */
13
+ layout?: TableLayout | undefined;
14
+ /**
15
+ * Si se proporciona, envuelve la tabla en un `<div>` con scroll horizontal.
16
+ * Útil para tablas anchas en mobile.
17
+ */
18
+ scrollable?: boolean | undefined;
19
+ /**
20
+ * Etiqueta accesible del wrapper scrollable. Aplica sólo cuando
21
+ * `scrollable=true`. Por defecto "Tabla con scroll horizontal".
22
+ */
23
+ scrollAreaLabel?: string | undefined;
24
+ ref?: Ref<HTMLTableElement> | undefined;
25
+ }
26
+ /**
27
+ * Table — tabla con clases del design system.
28
+ *
29
+ * Componer con `TableHead`, `TableBody`, `TableFoot`, `TableRow`,
30
+ * `TableHeaderCell` (`<th>`) y `TableCell` (`<td>`), o usar las etiquetas
31
+ * HTML nativas directamente — todas las variantes se aplican vía clases en
32
+ * `<table>`.
33
+ *
34
+ * @server-safe
35
+ */
36
+ export declare function Table({ className, striped, hover, bordered, compact, layout, scrollable, scrollAreaLabel, ref, ...rest }: TableProps): import("react").JSX.Element;
37
+ export interface TableHeadProps extends HTMLAttributes<HTMLTableSectionElement> {
38
+ ref?: Ref<HTMLTableSectionElement> | undefined;
39
+ }
40
+ /** TableHead — sección `<thead>` de la tabla. */
41
+ export declare function TableHead({ ref, ...rest }: TableHeadProps): import("react").JSX.Element;
42
+ export interface TableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
43
+ ref?: Ref<HTMLTableSectionElement> | undefined;
44
+ }
45
+ /** TableBody — sección `<tbody>` de la tabla. */
46
+ export declare function TableBody({ ref, ...rest }: TableBodyProps): import("react").JSX.Element;
47
+ export interface TableFootProps extends HTMLAttributes<HTMLTableSectionElement> {
48
+ ref?: Ref<HTMLTableSectionElement> | undefined;
49
+ }
50
+ /** TableFoot — sección `<tfoot>` de la tabla. */
51
+ export declare function TableFoot({ ref, ...rest }: TableFootProps): import("react").JSX.Element;
52
+ export interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
53
+ ref?: Ref<HTMLTableRowElement> | undefined;
54
+ }
55
+ /** TableRow — fila `<tr>`. */
56
+ export declare function TableRow({ ref, ...rest }: TableRowProps): import("react").JSX.Element;
57
+ export interface TableHeaderCellProps extends ThHTMLAttributes<HTMLTableCellElement> {
58
+ ref?: Ref<HTMLTableCellElement> | undefined;
59
+ }
60
+ /** TableHeaderCell — celda `<th>`. Acepta `scope`, `colSpan`, etc. */
61
+ export declare function TableHeaderCell({ ref, ...rest }: TableHeaderCellProps): import("react").JSX.Element;
62
+ export interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
63
+ ref?: Ref<HTMLTableCellElement> | undefined;
64
+ }
65
+ /** TableCell — celda `<td>`. */
66
+ export declare function TableCell({ ref, ...rest }: TableCellProps): import("react").JSX.Element;
67
+ export type TableCaptionSide = "top" | "bottom";
68
+ export interface TableCaptionProps extends HTMLAttributes<HTMLTableCaptionElement> {
69
+ /** Posiciona el caption arriba o abajo de la tabla. */
70
+ side?: TableCaptionSide | undefined;
71
+ ref?: Ref<HTMLTableCaptionElement> | undefined;
72
+ }
73
+ /** TableCaption — `<caption>` de la tabla con prop `side` (top/bottom). */
74
+ export declare function TableCaption({ className, side, ref, ...rest }: TableCaptionProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Table, TableHead, TableBody, TableFoot, TableRow, TableHeaderCell, TableCell, TableCaption, } from './Table.js';
2
+ export type { TableProps, TableHeadProps, TableBodyProps, TableFootProps, TableRowProps, TableHeaderCellProps, TableCellProps, TableCaptionProps, TableLayout, TableCaptionSide, } from './Table.js';
@@ -0,0 +1,41 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export type TabsVariant = "brand" | "secondary" | "success" | "warning" | "danger" | "info";
3
+ export interface TabsProps extends HTMLAttributes<HTMLDivElement> {
4
+ /** TabsTrigger seleccionado (modo controlado). */
5
+ value?: string | undefined;
6
+ /** TabsTrigger inicial (modo no controlado). */
7
+ defaultValue?: string | undefined;
8
+ /** Callback al cambiar de tab. */
9
+ onValueChange?: ((value: string) => void) | undefined;
10
+ /** Color del indicador del tab activo. */
11
+ variant?: TabsVariant | undefined;
12
+ /** Estilo "pills" en vez de underline. */
13
+ pills?: boolean | undefined;
14
+ /** Orientación del tablist. */
15
+ orientation?: "horizontal" | "vertical" | undefined;
16
+ ref?: Ref<HTMLDivElement> | undefined;
17
+ }
18
+ /**
19
+ * Tabs — wrapper que provee contexto a `TabsList`+`TabsTrigger`+`TabsContent`.
20
+ *
21
+ * Soporta controlled (`value`+`onValueChange`) y uncontrolled (`defaultValue`).
22
+ * `TabsTrigger` es un `<button role="tab">` y `TabsContent` un `<div role="tabpanel">`
23
+ * conectados por `aria-controls`/`aria-labelledby`. Keyboard nav con flechas
24
+ * (←→ horizontal, ↑↓ vertical) + Home/End.
25
+ *
26
+ * **Auto-selección del primer TabsTrigger desde `1.0.0-beta.3`**: si el consumer no
27
+ * pasa ni `value` ni `defaultValue`, el primer `TabsTrigger` que se monte queda
28
+ * seleccionado automáticamente. Antes el tablist se quedaba sin tab stop
29
+ * (todos los `tabIndex=-1`), inaccesible por teclado.
30
+ *
31
+ * @example
32
+ * <Tabs defaultValue="perfil">
33
+ * <TabsList aria-label="Cuenta">
34
+ * <TabsTrigger value="perfil">Perfil</TabsTrigger>
35
+ * <TabsTrigger value="seguridad">Seguridad</TabsTrigger>
36
+ * </TabsList>
37
+ * <TabsContent value="perfil">Datos personales</TabsContent>
38
+ * <TabsContent value="seguridad" keepMounted>Contraseña y 2FA</TabsContent>
39
+ * </Tabs>
40
+ */
41
+ export declare function Tabs({ value, defaultValue, onValueChange, variant, pills, orientation, className, children, ref, ...rest }: TabsProps): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export interface TabsContentProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Identificador del tab al que pertenece este panel. */
4
+ value: string;
5
+ /** Si `true`, el panel se mantiene en el DOM aunque no sea el activo (oculto con `hidden`). */
6
+ keepMounted?: boolean | undefined;
7
+ ref?: Ref<HTMLDivElement> | undefined;
8
+ }
9
+ /**
10
+ * TabsContent — contenedor `role="tabpanel"`. Por defecto sólo se renderiza
11
+ * cuando su `value` coincide con el tab activo; con `keepMounted` se mantiene
12
+ * en el DOM y se oculta vía atributo `hidden` (útil si necesitas conservar
13
+ * estado interno del panel al cambiar de tab).
14
+ */
15
+ export declare function TabsContent({ value, keepMounted, className, children, ref, ...rest }: TabsContentProps): import("react").JSX.Element | null;
@@ -0,0 +1,61 @@
1
+ export interface TabsContextValue {
2
+ /** Id del tab seleccionado. */
3
+ selected: string;
4
+ /** Cambia el tab seleccionado. */
5
+ setSelected: (value: string) => void;
6
+ /** Prefijo único para generar IDs de tab/panel relacionados. */
7
+ baseId: string;
8
+ /** Orientación: condiciona el keyboard nav (←→ vs ↑↓). */
9
+ orientation: "horizontal" | "vertical";
10
+ /**
11
+ * Registra un TabsTrigger al montarse. Devuelve un cleanup que lo desregistra.
12
+ * Si el Tabs no recibió `value`/`defaultValue`, usa el primer TabsTrigger
13
+ * registrado como selección inicial. Permite que el consumer omita
14
+ * `defaultValue` sin dejar el tablist sin tab stop accesible.
15
+ */
16
+ register: (value: string) => () => void;
17
+ /**
18
+ * H-26: `true` si `selected` matchea el `value` de algún TabsTrigger montado.
19
+ * En modo controlled con `value` inválido, este flag es `false` y
20
+ * el primer TabsTrigger registrado entra en modo "fallback tabindex" para
21
+ * NO dejar el tablist sin tab stop accesible.
22
+ */
23
+ selectedExists: boolean;
24
+ /**
25
+ * H-26: `value` del primer TabsTrigger registrado. Sirve como fallback de
26
+ * tab stop cuando `selectedExists === false`.
27
+ */
28
+ firstRegistered: string | undefined;
29
+ }
30
+ export declare const TabsContext: import('react').Context<TabsContextValue | null>;
31
+ /**
32
+ * Hook que expone el contexto de un `<Tabs>` (selected, setSelected,
33
+ * orientation, baseId, register). Lo usan internamente `TabsTrigger`, `TabsList` y
34
+ * `TabsContent`. Útil también si construyes tu propio sub-componente que
35
+ * vive dentro del árbol de un `<Tabs>` y necesita reaccionar al tab
36
+ * seleccionado.
37
+ *
38
+ * @example
39
+ * // Indicador "tab actual" custom:
40
+ * function CurrentTabBadge() {
41
+ * const { selected } = useTabs();
42
+ * return <Badge variant="brand">{selected || "ninguno"}</Badge>;
43
+ * }
44
+ *
45
+ * function App() {
46
+ * return (
47
+ * <Tabs defaultValue="perfil">
48
+ * <TabsList aria-label="Cuenta">
49
+ * <TabsTrigger value="perfil">Perfil</TabsTrigger>
50
+ * <TabsTrigger value="seguridad">Seguridad</TabsTrigger>
51
+ * </TabsList>
52
+ * <CurrentTabBadge />
53
+ * <TabsContent value="perfil">…</TabsContent>
54
+ * <TabsContent value="seguridad">…</TabsContent>
55
+ * </Tabs>
56
+ * );
57
+ * }
58
+ *
59
+ * @throws Error si se usa fuera de `<Tabs>`.
60
+ */
61
+ export declare function useTabs(): TabsContextValue;
@@ -0,0 +1,10 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export interface TabsListProps extends HTMLAttributes<HTMLDivElement> {
3
+ ref?: Ref<HTMLDivElement> | undefined;
4
+ }
5
+ /**
6
+ * TabsList — contenedor `role="tablist"` para `TabsTrigger`s. Hereda la orientación
7
+ * del `Tabs` padre. Pasa `aria-label` para etiquetar el tablist (i18n vía
8
+ * el atributo HTML estándar).
9
+ */
10
+ export declare function TabsList({ className, children, ref, ...rest }: TabsListProps): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { ButtonHTMLAttributes, Ref } from 'react';
2
+ export interface TabsTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
+ /** Identificador único del tab. Debe coincidir con el `value` del `TabsContent` correspondiente. */
4
+ value: string;
5
+ ref?: Ref<HTMLButtonElement> | undefined;
6
+ }
7
+ /**
8
+ * TabsTrigger — botón `role="tab"` dentro de `TabsList`. Incluye `aria-selected`,
9
+ * `aria-controls` y roving tabindex (sólo el activo es focuseable directamente).
10
+ *
11
+ * Keyboard:
12
+ * - ←/→ (horizontal) o ↑/↓ (vertical): mueve foco al sibling y lo activa.
13
+ * - Home/End: salta al primero/último activable.
14
+ */
15
+ export declare function TabsTrigger({ value, className, children, disabled, onKeyDown, ref, ...rest }: TabsTriggerProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export { Tabs } from './Tabs.js';
2
+ export type { TabsProps, TabsVariant } from './Tabs.js';
3
+ export { TabsList } from './TabsList.js';
4
+ export type { TabsListProps } from './TabsList.js';
5
+ export { TabsTrigger } from './TabsTrigger.js';
6
+ export type { TabsTriggerProps } from './TabsTrigger.js';
7
+ export { TabsContent } from './TabsContent.js';
8
+ export type { TabsContentProps } from './TabsContent.js';
@@ -0,0 +1,51 @@
1
+ import { Ref, TextareaHTMLAttributes } from 'react';
2
+ export type TextareaState = "default" | "invalid" | "valid";
3
+ export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
4
+ /** Auto-resize basado en contenido. */
5
+ auto?: boolean | undefined;
6
+ /** Estado de validación visual. */
7
+ state?: TextareaState | undefined;
8
+ /**
9
+ * IDs de elementos descriptivos (`Helper`/`ErrorText`) combinados en
10
+ * `aria-describedby`. Acepta un id o lista de ids. Si pasas también
11
+ * `aria-describedby` directo (vía rest), AMBOS se concatenan.
12
+ */
13
+ describedBy?: string | string[] | undefined;
14
+ ref?: Ref<HTMLTextAreaElement> | undefined;
15
+ }
16
+ /**
17
+ * Textarea — `<textarea>` estilizado. `auto=true` activa auto-grow basado en
18
+ * contenido (clase `ig-textarea-auto`).
19
+ *
20
+ * **Soporte de `auto`**: usa `field-sizing: content` (CSS).
21
+ * - Chrome/Edge 123+ (mar 2024) ✅
22
+ * - Safari 17.4+ (mar 2024) ✅
23
+ * - Firefox: aún no (en progreso, sin ETA pública).
24
+ * Bugs Mozilla: #1977176 (input), #1977177 (textarea).
25
+ *
26
+ * En Firefox el textarea cae al comportamiento por defecto (`rows`) sin
27
+ * auto-grow. Para auto-grow universal, gestiona el alto vía JS desde el
28
+ * consumer, idealmente envuelto en un `@supports not (field-sizing: content)`.
29
+ *
30
+ * Detección runtime para activar fallback JS:
31
+ * ```js
32
+ * const needsJsFallback = !CSS.supports('field-sizing', 'content');
33
+ * ```
34
+ *
35
+ * Y a nivel CSS:
36
+ * ```css
37
+ * @supports not (field-sizing: content) {
38
+ * // estilos del fallback
39
+ * }
40
+ * ```
41
+ *
42
+ * **A11y dev warn**: si en desarrollo se monta sin `<Label htmlFor>`,
43
+ * `aria-label`, `aria-labelledby` ni `placeholder`, se emite warn
44
+ * `[reactigoded] <Textarea> sin label asociado.` (capa 1.1 debt doc).
45
+ *
46
+ * @example
47
+ * <Textarea placeholder="Cuéntanos…" rows={4} />
48
+ * <Textarea state="invalid" describedBy={errorId} />
49
+ * <Textarea auto value={text} onChange={(e) => setText(e.target.value)} />
50
+ */
51
+ export declare function Textarea({ auto, state, describedBy, className, ref, ...rest }: TextareaProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Textarea } from './Textarea.js';
2
+ export type { TextareaProps, TextareaState } from './Textarea.js';