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,46 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export type NavbarPosition = "sticky" | "fixed";
3
+ export interface NavbarProps extends HTMLAttributes<HTMLElement> {
4
+ /**
5
+ * Posición del navbar.
6
+ * - `"sticky"`: pegado en top mientras scrolleas dentro de su contenedor.
7
+ * - `"fixed"`: anclado en top fuera del flujo (overlay).
8
+ *
9
+ * Antes existían dos booleans `sticky` y `fixed`; eran mutuamente
10
+ * excluyentes solo en docs. Ahora la elección es una sola prop con
11
+ * unión discriminada — el typing impide pasar ambas a la vez.
12
+ */
13
+ position?: NavbarPosition | undefined;
14
+ /** Estilo glassmorphism (fondo translúcido + blur). */
15
+ glass?: boolean | undefined;
16
+ ref?: Ref<HTMLElement> | undefined;
17
+ }
18
+ /**
19
+ * Navbar — barra de navegación horizontal superior (`<header>`).
20
+ *
21
+ * Compón con `NavbarLogo`, `NavbarNav`, `NavbarLink` y `NavbarActions`.
22
+ * `position` controla el comportamiento sticky/fixed; `glass` se puede
23
+ * combinar con cualquier `position`.
24
+ *
25
+ * **A11y dev warn**: `<header>` es role banner por defecto. Axe rule
26
+ * `landmark-no-duplicate-banner` solo permite UN banner top-level por
27
+ * documento. Si se montan dos `<Navbar>` top-level (típico en galerías
28
+ * `AllStates`), se emite warn (capa 1.3 debt doc). Mitigación
29
+ * documentada en `docs/STORY_CATALOG_CONVENTIONS.md`: envolver cada
30
+ * instancia en `<section aria-label="Demo X">` que la despromueve a
31
+ * `region`.
32
+ *
33
+ * @example
34
+ * <Navbar position="sticky">
35
+ * <NavbarLogo href="/">Mi App</NavbarLogo>
36
+ * <NavbarNav>
37
+ * <NavbarLink href="/" active>Inicio</NavbarLink>
38
+ * <NavbarLink href="/precios">Precios</NavbarLink>
39
+ * </NavbarNav>
40
+ * <NavbarActions>
41
+ * <Button appearance="ghost">Login</Button>
42
+ * <Button variant="brand">Sign Up</Button>
43
+ * </NavbarActions>
44
+ * </Navbar>
45
+ */
46
+ export declare function Navbar({ className, position, glass, ref, ...rest }: NavbarProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export interface NavbarActionsProps extends HTMLAttributes<HTMLDivElement> {
3
+ ref?: Ref<HTMLDivElement> | undefined;
4
+ }
5
+ /**
6
+ * NavbarActions — contenedor de acciones globales (botones, menús de cuenta).
7
+ *
8
+ * @server-safe
9
+ */
10
+ export declare function NavbarActions({ className, ref, ...rest }: NavbarActionsProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { AnchorHTMLAttributes, Ref } from 'react';
2
+ export interface NavbarLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
3
+ /** Marca el link como activo (`aria-current="page"`). */
4
+ active?: boolean | undefined;
5
+ ref?: Ref<HTMLAnchorElement> | undefined;
6
+ }
7
+ /**
8
+ * NavbarLink — link de navegación dentro de `NavbarNav`. Aplica
9
+ * `aria-current="page"` cuando `active` es true.
10
+ *
11
+ * @server-safe
12
+ */
13
+ export declare function NavbarLink({ className, active, ref, ...rest }: NavbarLinkProps): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { AnchorHTMLAttributes, HTMLAttributes, Ref } from 'react';
2
+ type CommonProps = {
3
+ className?: string | undefined;
4
+ };
5
+ type AsAnchor = CommonProps & AnchorHTMLAttributes<HTMLAnchorElement> & {
6
+ /** Si se proporciona `href`, se renderiza como `<a>`. */
7
+ href: string;
8
+ ref?: Ref<HTMLAnchorElement> | undefined;
9
+ };
10
+ type AsDiv = CommonProps & HTMLAttributes<HTMLDivElement> & {
11
+ href?: undefined;
12
+ ref?: Ref<HTMLDivElement> | undefined;
13
+ };
14
+ export type NavbarLogoProps = AsAnchor | AsDiv;
15
+ /**
16
+ * NavbarLogo — área del logo y nombre. Por defecto es `<div>`; si se pasa
17
+ * `href` se renderiza como `<a>` (clicable).
18
+ *
19
+ * @server-safe
20
+ */
21
+ export declare function NavbarLogo(props: NavbarLogoProps): import("react").JSX.Element;
22
+ export {};
@@ -0,0 +1,15 @@
1
+ import { ButtonHTMLAttributes, Ref } from 'react';
2
+ export interface NavbarMenuButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
+ /** Si el menú asociado está expandido. */
4
+ expanded?: boolean | undefined;
5
+ /** ID del elemento que controla (para `aria-controls`). */
6
+ controlsId?: string | undefined;
7
+ ref?: Ref<HTMLButtonElement> | undefined;
8
+ }
9
+ /**
10
+ * NavbarMenuButton — botón hamburguesa que sólo se muestra en mobile vía CSS
11
+ * (`@media max-width: 768px`). Pensado para abrir un menú lateral o drawer.
12
+ *
13
+ * @server-safe
14
+ */
15
+ export declare function NavbarMenuButton({ className, expanded, controlsId, children, "aria-label": ariaLabel, ref, ...rest }: NavbarMenuButtonProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export interface NavbarNavProps extends HTMLAttributes<HTMLElement> {
3
+ ref?: Ref<HTMLElement> | undefined;
4
+ }
5
+ /**
6
+ * NavbarNav — `<nav>` que contiene los `NavbarLink`s del navbar. `aria-label`
7
+ * por defecto "Principal"; sobreescribible vía atributo HTML estándar.
8
+ *
9
+ * **A11y dev warn**: si dos NavbarNav (u otro `<nav>` con role
10
+ * navigation) comparten `aria-label` vivos al mismo tiempo, se emite
11
+ * warn `[reactigoded] dos landmarks role="navigation" comparten…`
12
+ * (capa 1.2 debt doc).
13
+ */
14
+ export declare function NavbarNav({ className, ref, ...rest }: NavbarNavProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ export { Navbar } from './Navbar.js';
2
+ export type { NavbarProps } from './Navbar.js';
3
+ export { NavbarLogo } from './NavbarLogo.js';
4
+ export type { NavbarLogoProps } from './NavbarLogo.js';
5
+ export { NavbarNav } from './NavbarNav.js';
6
+ export type { NavbarNavProps } from './NavbarNav.js';
7
+ export { NavbarLink } from './NavbarLink.js';
8
+ export type { NavbarLinkProps } from './NavbarLink.js';
9
+ export { NavbarActions } from './NavbarActions.js';
10
+ export type { NavbarActionsProps } from './NavbarActions.js';
11
+ export { NavbarMenuButton } from './NavbarMenuButton.js';
12
+ export type { NavbarMenuButtonProps } from './NavbarMenuButton.js';
@@ -0,0 +1,77 @@
1
+ import { HTMLAttributes, ReactNode, Ref } from 'react';
2
+ export type PaginationVariant = "brand" | "secondary" | "success" | "warning" | "danger" | "info";
3
+ export interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
4
+ /**
5
+ * Página actual (1-based) en modo **controlled**. Si se pasa, el
6
+ * consumer es responsable de actualizar la prop en respuesta a
7
+ * `onPageChange`. Si se omite, el componente arranca en `defaultPage`
8
+ * y maneja el state internamente.
9
+ */
10
+ page?: number | undefined;
11
+ /**
12
+ * Página inicial (1-based) en modo **uncontrolled**. Default `1`.
13
+ * Ignorado si `page` está definido.
14
+ */
15
+ defaultPage?: number | undefined;
16
+ /** Número total de páginas (>=1). */
17
+ totalPages: number;
18
+ /** Cuántas páginas mostrar a cada lado de la actual antes de elipsis. Por defecto 1. */
19
+ siblingCount?: number | undefined;
20
+ /**
21
+ * Callback al cambiar de página. Opcional en modo uncontrolled (el
22
+ * componente actualiza su state interno) y útil para reaccionar al
23
+ * cambio (fetch de datos, sync con URL, etc.).
24
+ */
25
+ onPageChange?: ((page: number) => void) | undefined;
26
+ /** Color de la página activa. */
27
+ variant?: PaginationVariant | undefined;
28
+ /**
29
+ * Contenido del botón anterior. Si es string también se usa como
30
+ * `aria-label` (a menos que se pase `prevAriaLabel` explícito).
31
+ * Si es ReactNode (p.ej. un icono), pasa `prevAriaLabel` con el texto
32
+ * legible para SR.
33
+ */
34
+ prevLabel?: ReactNode | undefined;
35
+ /**
36
+ * Contenido del botón siguiente. Mismas reglas que `prevLabel`.
37
+ */
38
+ nextLabel?: ReactNode | undefined;
39
+ /**
40
+ * `aria-label` del botón anterior. Override explícito; si se omite y
41
+ * `prevLabel` es string se usa éste, en otro caso "Página anterior".
42
+ */
43
+ prevAriaLabel?: string | undefined;
44
+ /**
45
+ * `aria-label` del botón siguiente. Override explícito; si se omite y
46
+ * `nextLabel` es string se usa éste, en otro caso "Página siguiente".
47
+ */
48
+ nextAriaLabel?: string | undefined;
49
+ /**
50
+ * Genera el `aria-label` de cada botón de página. Por defecto
51
+ * `(p) => "Página N"` en español. Útil para i18n: pasar
52
+ * `(p) => \`Page ${p}\`` para inglés, `(p) => \`Seite ${p}\`` para
53
+ * alemán, etc. (L-12 gate review).
54
+ */
55
+ getPageLabel?: ((page: number) => string) | undefined;
56
+ ref?: Ref<HTMLElement> | undefined;
57
+ }
58
+ /**
59
+ * Pagination — navegación paginada accesible.
60
+ *
61
+ * Renderiza un `<nav>` con `aria-label`, botón "anterior", páginas (con
62
+ * elipsis cuando hay muchas) y botón "siguiente". La página activa lleva
63
+ * `aria-current="page"`. Cada página tiene `aria-label="Página N"`.
64
+ *
65
+ * Soporta **controlled** (`page` + `onPageChange`) y **uncontrolled**
66
+ * (`defaultPage`, opcional `onPageChange` para reaccionar). Idéntico
67
+ * patrón a otros componentes con state del DS (Tabs, Accordion, etc.).
68
+ *
69
+ * @example
70
+ * // Uncontrolled — el componente maneja el state internamente
71
+ * <Pagination totalPages={20} defaultPage={1} onPageChange={fetchPage} />
72
+ *
73
+ * // Controlled — el consumer mantiene page
74
+ * const [page, setPage] = useState(1);
75
+ * <Pagination totalPages={20} page={page} onPageChange={setPage} />
76
+ */
77
+ export declare function Pagination({ page: pageProp, defaultPage, totalPages, siblingCount, onPageChange, variant, prevLabel, nextLabel, prevAriaLabel, nextAriaLabel, getPageLabel, className, ref, ...rest }: PaginationProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Pagination } from './Pagination.js';
2
+ export type { PaginationProps, PaginationVariant } from './Pagination.js';
@@ -0,0 +1,63 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export type ProgressVariant = "brand" | "secondary" | "success" | "warning" | "danger" | "info";
3
+ export type ProgressSize = "sm" | "md" | "lg";
4
+ export interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
5
+ /** Valor actual (0..max). Ignorado si `indeterminate`. */
6
+ value?: number | undefined;
7
+ /** Valor máximo. Por defecto 100. */
8
+ max?: number | undefined;
9
+ /** Color del progress bar. */
10
+ variant?: ProgressVariant | undefined;
11
+ /** Altura del track. */
12
+ size?: ProgressSize | undefined;
13
+ /** Modo indeterminado: barra animada sin valor concreto. */
14
+ indeterminate?: boolean | undefined;
15
+ /**
16
+ * Etiqueta accesible (aria-label) cuando el componente no recibe
17
+ * `aria-label` explícito. Default `"Cargando"` (ES intencional —
18
+ * audience inicial hispanohablante; ver Storybook → *Fundamentos /
19
+ * CSS API pública* (renderizada desde `docs/CSSAPI.mdx`) sección
20
+ * "i18n y a11y strings").
21
+ *
22
+ * Override para apps en otros idiomas:
23
+ * ```tsx
24
+ * <Progress loadingLabel="Loading" indeterminate />
25
+ * ```
26
+ *
27
+ * Si pasas `aria-label` como prop HTML estándar, gana sobre
28
+ * `loadingLabel` y `formatLabel`.
29
+ */
30
+ loadingLabel?: string | undefined;
31
+ /**
32
+ * Función opcional para formatear el `aria-label` con el porcentaje
33
+ * actual. Útil con sistemas i18n con interpolación. No aplica en
34
+ * `indeterminate` (no hay porcentaje).
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * <Progress value={75} formatLabel={(p) => `${p}% done`} />
39
+ * // i18n:
40
+ * <Progress
41
+ * value={percent}
42
+ * formatLabel={(p) => t("progress.format", { percent: p })}
43
+ * />
44
+ * ```
45
+ */
46
+ formatLabel?: ((percent: number) => string) | undefined;
47
+ ref?: Ref<HTMLDivElement> | undefined;
48
+ }
49
+ /**
50
+ * Progress — barra de progreso lineal.
51
+ *
52
+ * Expone `role="progressbar"` con `aria-valuenow/min/max` (o sin `valuenow`
53
+ * en modo `indeterminate`). El relleno es un `<div>` interno cuya `width`
54
+ * se calcula a partir de `value/max`.
55
+ *
56
+ * @example
57
+ * <Progress value={70} variant="success" />
58
+ * <Progress indeterminate aria-label="Subiendo archivo" />
59
+ * <Progress value={3} max={5} size="lg" />
60
+ *
61
+ * @server-safe
62
+ */
63
+ export declare function Progress({ value, max, variant, size, indeterminate, loadingLabel, formatLabel, className, ref, ...rest }: ProgressProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Progress } from './Progress.js';
2
+ export type { ProgressProps, ProgressVariant, ProgressSize } from './Progress.js';
@@ -0,0 +1,28 @@
1
+ import { InputHTMLAttributes, Ref } from 'react';
2
+ export type RadioVariant = "brand" | "secondary" | "success" | "warning" | "danger" | "info";
3
+ export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
4
+ /** Color del punto cuando está seleccionado. */
5
+ variant?: RadioVariant | undefined;
6
+ /** Etiqueta visible junto al radio. */
7
+ children?: React.ReactNode | undefined;
8
+ /**
9
+ * Ids extra para `aria-describedby`. Pasar string para un único id o
10
+ * array para varios. Se concatenan con cualquier `aria-describedby`
11
+ * que el consumer pase por rest. Patrón canónico del DS para enlazar
12
+ * `Helper` / `ErrorText` / live-regions con tecnologías asistivas.
13
+ */
14
+ describedBy?: string | string[] | undefined;
15
+ ref?: Ref<HTMLInputElement> | undefined;
16
+ }
17
+ /**
18
+ * Radio — `<input type="radio">` con punto visual personalizado.
19
+ * Recuerda agrupar varios con el mismo `name`.
20
+ *
21
+ * @example
22
+ * <Radio name="plan" value="free" defaultChecked>Free</Radio>
23
+ * <Radio name="plan" value="pro" variant="success">Pro</Radio>
24
+ * <Radio name="plan" value="enterprise" disabled>Enterprise</Radio>
25
+ *
26
+ * @server-safe
27
+ */
28
+ export declare function Radio({ variant, className, children, ref, disabled, describedBy, ...rest }: RadioProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Radio } from './Radio.js';
2
+ export type { RadioProps, RadioVariant } from './Radio.js';
@@ -0,0 +1,85 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export type RatingSize = "sm" | "md" | "lg" | "xl";
3
+ export interface RatingProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
4
+ /** Valor actual (modo controlado, 0..max). */
5
+ value?: number | undefined;
6
+ /** Valor inicial (modo no controlado). Por defecto 0. */
7
+ defaultValue?: number | undefined;
8
+ /** Máximo de estrellas. Por defecto 5. */
9
+ max?: number | undefined;
10
+ /** Sólo lectura: no responde a interacción. */
11
+ readOnly?: boolean | undefined;
12
+ /**
13
+ * Si se proporciona, Rating participa en form submission nativo
14
+ * renderizando un `<input type="hidden" name={name} value={value}>`
15
+ * adyacente al `radiogroup`. El value del hidden input espeja el
16
+ * valor efectivo (clamped, controlled o uncontrolled), por lo que un
17
+ * `new FormData(form)` recoge la puntuación sin necesidad de librería
18
+ * de forms. Sin `name`, Rating es display-only para form submission y
19
+ * el consumer debe leer el valor vía `onValueChange` + state.
20
+ *
21
+ * Cierra la asimetría con los otros inputs del DS (Checkbox/Switch/
22
+ * Radio/Slider/NativeSelect serializan vía el `<input>` nativo
23
+ * heredado de `InputHTMLAttributes`). Rating usa buttons en
24
+ * `role="radiogroup"` por el canal-de-forma WCAG (#102), así que
25
+ * añadimos el bridge nativo sin tocar el patrón APG visible.
26
+ *
27
+ * @example
28
+ * <form action="/rate" method="post">
29
+ * <Rating name="score" defaultValue={3} max={5} />
30
+ * <button type="submit">Enviar</button>
31
+ * </form>
32
+ */
33
+ name?: string | undefined;
34
+ /** Tamaño visual. */
35
+ size?: RatingSize | undefined;
36
+ /** Callback al elegir un valor. */
37
+ onValueChange?: ((value: number) => void) | undefined;
38
+ /**
39
+ * Ids extra para `aria-describedby` del radiogroup. Pasar string para
40
+ * un único id o array para varios. Se concatenan con cualquier
41
+ * `aria-describedby` que el consumer pase por rest. Patrón canónico
42
+ * del DS para enlazar `Helper` / `ErrorText` / live-regions con
43
+ * tecnologías asistivas.
44
+ */
45
+ describedBy?: string | string[] | undefined;
46
+ /**
47
+ * Override del `aria-label` por estrella individual. Recibe el valor
48
+ * 1..max y devuelve la cadena. Default ES: `"1 estrella"` / `"N estrellas"`.
49
+ * Cierra el hueco i18n del componente — el grupo ya era overrideable
50
+ * vía `aria-label`, los hijos no lo eran (ver `docs/decisions/D12-es-defaults-i18n.md`).
51
+ *
52
+ * @example
53
+ * <Rating max={5} getStarLabel={(n) => `${n} of 5 stars`} />
54
+ */
55
+ getStarLabel?: ((value: number) => string) | undefined;
56
+ ref?: Ref<HTMLDivElement> | undefined;
57
+ }
58
+ /**
59
+ * Rating — N estrellas clicables con preview por hover y navegación
60
+ * completa por teclado siguiendo el patrón WAI-ARIA APG de radiogroup:
61
+ *
62
+ * - El contenedor es `role="radiogroup"`.
63
+ * - Cada estrella es `<button role="radio">` con `aria-checked`.
64
+ * - **Roving tabindex**: solo la estrella seleccionada (o la primera si
65
+ * no hay selección) tiene `tabIndex=0`; el resto `tabIndex=-1`.
66
+ * - **Keyboard**:
67
+ * - `ArrowRight` / `ArrowDown` → siguiente estrella + selecciona (clamp en `max`).
68
+ * - `ArrowLeft` / `ArrowUp` → anterior estrella + selecciona (clamp en 1).
69
+ * - `Home` → primera estrella (valor 1).
70
+ * - `End` → última estrella (valor `max`).
71
+ * - `Space` / `Enter` → selecciona la estrella focuseada.
72
+ *
73
+ * Soporta controlled (`value`+`onValueChange`) y uncontrolled (`defaultValue`).
74
+ *
75
+ * **Robustez frente a inputs inválidos** (desde `1.0.0-beta.4`):
76
+ * - `value` o `defaultValue` fuera de `[0, max]` se clampa silenciosamente.
77
+ * - `max` no entero se redondea hacia abajo, mínimo 1.
78
+ * - Las flechas no envuelven (clamp, no wrap) — patrón estándar APG.
79
+ *
80
+ * @example
81
+ * <Rating defaultValue={3} max={5} />
82
+ * <Rating value={r} onValueChange={setR} aria-label="Puntuación del producto" />
83
+ * <Rating value={4} readOnly />
84
+ */
85
+ export declare function Rating({ value: valueProp, defaultValue, max, readOnly, size, onValueChange, describedBy, getStarLabel, name, className, ref, ...rest }: RatingProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Rating } from './Rating.js';
2
+ export type { RatingProps, RatingSize } from './Rating.js';
@@ -0,0 +1,28 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export interface SidebarProps extends HTMLAttributes<HTMLElement> {
3
+ /** Estado colapsado (modo controlado). */
4
+ collapsed?: boolean | undefined;
5
+ /** Estado inicial (modo no controlado). Por defecto `false`. */
6
+ defaultCollapsed?: boolean | undefined;
7
+ /** Callback al cambiar collapsed. */
8
+ onCollapsedChange?: ((collapsed: boolean) => void) | undefined;
9
+ ref?: Ref<HTMLElement> | undefined;
10
+ }
11
+ /**
12
+ * Sidebar — barra lateral persistente tipo "rail" con modo colapsado.
13
+ *
14
+ * Provee context a `SidebarToggle`, `SidebarItem`, etc. Compón con
15
+ * `SidebarHeader`, `SidebarNav`, `SidebarItem`, `SidebarSection`,
16
+ * `SidebarDivider`, `SidebarFooter`, `SidebarToggle`. En modo colapsado el
17
+ * CSS oculta automáticamente `.ig-sidebar-text` y `.ig-sidebar-section`.
18
+ *
19
+ * @example
20
+ * <Sidebar>
21
+ * <SidebarHeader>Mi App</SidebarHeader>
22
+ * <SidebarNav>
23
+ * <SidebarItem href="/" icon="🏠" active>Inicio</SidebarItem>
24
+ * </SidebarNav>
25
+ * <SidebarFooter><SidebarToggle /></SidebarFooter>
26
+ * </Sidebar>
27
+ */
28
+ export declare function Sidebar({ collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, className, children, ref, ...rest }: SidebarProps): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ export interface SidebarContextValue {
2
+ /** Si la sidebar está colapsada (modo "rail" sólo iconos). */
3
+ collapsed: boolean;
4
+ /** Cambia el estado y dispara `onCollapsedChange`. */
5
+ setCollapsed: (next: boolean) => void;
6
+ /**
7
+ * Id del `<aside>` (útil para que `<SidebarToggle>` referencie su
8
+ * panel via `aria-controls`). Si el consumer pasó `id` al
9
+ * `<Sidebar>`, ese id se respeta; si no, viene de `useId()`.
10
+ */
11
+ asideId: string;
12
+ }
13
+ export declare const SidebarContext: import('react').Context<SidebarContextValue | null>;
14
+ /**
15
+ * Hook **interno** consumido por sub-componentes del DS (`SidebarToggle`,
16
+ * `SidebarItem` para auto-derivar `aria-label` cuando text se oculta en
17
+ * estado colapsado). NO está re-exportado en el barrel público de Sidebar
18
+ * — el bundle del DS no lo expone (`B-04 RC1` retiro confirmado, D4 RC1
19
+ * gate review).
20
+ *
21
+ * Si necesitas persist state en localStorage o sincronizar con router,
22
+ * usa **controlled mode external** desde tu app — pasa `collapsed` +
23
+ * `onCollapsedChange` a `<Sidebar>` desde un `useState` que tú manejes.
24
+ * Ver README sección "Persisting Sidebar state" para el patrón completo
25
+ * con guard SSR-safe en el initializer del useState (necesario porque
26
+ * `localStorage` no existe en server-render).
27
+ *
28
+ * @throws Error si se usa fuera de `<Sidebar>` desde un sub-componente.
29
+ * Esto es regla DS-wide D11.4: hooks que requieren ancestor lanzan
30
+ * (consistent con `useMenu`, `useTabs`, `useAccordion`, `useDialog`).
31
+ */
32
+ export declare function useSidebar(): SidebarContextValue;
@@ -0,0 +1,8 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export interface SidebarDividerProps extends HTMLAttributes<HTMLDivElement> {
3
+ ref?: Ref<HTMLDivElement> | undefined;
4
+ }
5
+ /** SidebarDivider — separador horizontal entre grupos de items. *
6
+ * @server-safe
7
+ */
8
+ export declare function SidebarDivider({ className, ref, ...rest }: SidebarDividerProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export interface SidebarFooterProps extends HTMLAttributes<HTMLDivElement> {
3
+ ref?: Ref<HTMLDivElement> | undefined;
4
+ }
5
+ /** SidebarFooter — sección inferior de la sidebar (suele alojar `SidebarToggle`). *
6
+ * @server-safe
7
+ */
8
+ export declare function SidebarFooter({ className, children, ref, ...rest }: SidebarFooterProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { HTMLAttributes, ReactNode, Ref } from 'react';
2
+ export interface SidebarHeaderProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Icono / logo a la izquierda. Visible incluso colapsada. */
4
+ icon?: ReactNode | undefined;
5
+ ref?: Ref<HTMLDivElement> | undefined;
6
+ }
7
+ /**
8
+ * SidebarHeader — cabecera de la sidebar. El icono/logo permanece visible
9
+ * en modo colapsado; el texto (children) lo oculta el CSS automáticamente.
10
+ *
11
+ * @server-safe
12
+ */
13
+ export declare function SidebarHeader({ icon, className, children, ref, ...rest }: SidebarHeaderProps): import("react").JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode, Ref } from 'react';
2
+ interface CommonProps {
3
+ /** Icono al inicio (siempre visible, incluso colapsada). */
4
+ icon?: ReactNode | undefined;
5
+ /** Marca el item como ruta/sección actual. Aplica `aria-current="page"`. */
6
+ active?: boolean | undefined;
7
+ }
8
+ type AnchorItemProps = CommonProps & AnchorHTMLAttributes<HTMLAnchorElement> & {
9
+ href: string;
10
+ ref?: Ref<HTMLAnchorElement> | undefined;
11
+ };
12
+ type ButtonItemProps = CommonProps & ButtonHTMLAttributes<HTMLButtonElement> & {
13
+ href?: undefined;
14
+ ref?: Ref<HTMLButtonElement> | undefined;
15
+ };
16
+ export type SidebarItemProps = AnchorItemProps | ButtonItemProps;
17
+ /**
18
+ * SidebarItem — entrada navegable. Renderiza `<a>` si recibe `href`,
19
+ * `<button>` si no. El icono permanece visible en modo colapsado y el texto
20
+ * lo oculta el CSS automáticamente.
21
+ *
22
+ * **D4 (RC1 gate review)**: `aria-label` se aplica condicionalmente:
23
+ * - **Sidebar expandida**: el texto del item está en el a11y tree
24
+ * (visible + parseado por SR como nombre accesible). NO se aplica
25
+ * `aria-label` automático — duplicaría el nombre (anti-pattern ARIA
26
+ * APG: "if visible text serves as accessible name, do not add
27
+ * aria-label").
28
+ * - **Sidebar colapsada**: CSS `.ig-sidebar-collapsed .ig-sidebar-text`
29
+ * con `display: none` saca el texto del a11y tree. SIN `aria-label`,
30
+ * el item queda sin nombre accesible (icono es `aria-hidden`). Por
31
+ * eso aplicamos `aria-label = children` cuando collapsed y children
32
+ * es string.
33
+ *
34
+ * Override explícito de `aria-label` siempre tiene prioridad sobre
35
+ * cualquier fallback automático.
36
+ *
37
+ * SidebarItem es client component porque consume `useSidebar()` para
38
+ * detectar el estado collapsed. Debe estar dentro de `<Sidebar>` —
39
+ * `useSidebar` lanza si no hay ancestor (D11.4 regla DS-wide).
40
+ */
41
+ export declare function SidebarItem(props: SidebarItemProps): import("react").JSX.Element;
42
+ export {};
@@ -0,0 +1,13 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export interface SidebarNavProps extends HTMLAttributes<HTMLElement> {
3
+ ref?: Ref<HTMLElement> | undefined;
4
+ }
5
+ /**
6
+ * SidebarNav — `<nav>` que envuelve los items de navegación. `aria-label`
7
+ * por defecto "Principal"; sobreescribible vía rest.
8
+ *
9
+ * **A11y dev warn**: si dos SidebarNav (u otro `<nav>` con role
10
+ * navigation) comparten `aria-label`, se emite warn (capa 1.2 debt
11
+ * doc).
12
+ */
13
+ export declare function SidebarNav({ className, children, ref, ...rest }: SidebarNavProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { HTMLAttributes, Ref } from 'react';
2
+ export interface SidebarSectionProps extends HTMLAttributes<HTMLDivElement> {
3
+ ref?: Ref<HTMLDivElement> | undefined;
4
+ }
5
+ /**
6
+ * SidebarSection — etiqueta de grupo (estilo "Principal", "Herramientas").
7
+ * Oculta automáticamente cuando la sidebar está colapsada (vía CSS).
8
+ *
9
+ * @server-safe
10
+ */
11
+ export declare function SidebarSection({ className, children, ref, ...rest }: SidebarSectionProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { ButtonHTMLAttributes, ReactNode, Ref } from 'react';
2
+ export interface SidebarToggleProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
+ /** Contenido del botón. Por defecto `"☰"`. */
4
+ children?: ReactNode | undefined;
5
+ /** Texto a11y al expandir. Por defecto `"Expandir sidebar"`. */
6
+ expandLabel?: string | undefined;
7
+ /** Texto a11y al colapsar. Por defecto `"Colapsar sidebar"`. */
8
+ collapseLabel?: string | undefined;
9
+ ref?: Ref<HTMLButtonElement> | undefined;
10
+ }
11
+ /**
12
+ * SidebarToggle — botón que alterna el estado colapsado de la `Sidebar`.
13
+ * Aplica `aria-expanded` (true cuando expandida), `aria-controls`
14
+ * apuntando al `<aside>` del Sidebar, y un `aria-label` distinto según
15
+ * el estado para que los lectores de pantalla anuncien la acción.
16
+ */
17
+ export declare function SidebarToggle({ className, children, type, expandLabel, collapseLabel, onClick, ref, ...rest }: SidebarToggleProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ export { Sidebar } from './Sidebar.js';
2
+ export type { SidebarProps } from './Sidebar.js';
3
+ export { SidebarHeader } from './SidebarHeader.js';
4
+ export type { SidebarHeaderProps } from './SidebarHeader.js';
5
+ export { SidebarNav } from './SidebarNav.js';
6
+ export type { SidebarNavProps } from './SidebarNav.js';
7
+ export { SidebarItem } from './SidebarItem.js';
8
+ export type { SidebarItemProps } from './SidebarItem.js';
9
+ export { SidebarFooter } from './SidebarFooter.js';
10
+ export type { SidebarFooterProps } from './SidebarFooter.js';
11
+ export { SidebarToggle } from './SidebarToggle.js';
12
+ export type { SidebarToggleProps } from './SidebarToggle.js';
13
+ export { SidebarDivider } from './SidebarDivider.js';
14
+ export type { SidebarDividerProps } from './SidebarDivider.js';
15
+ export { SidebarSection } from './SidebarSection.js';
16
+ export type { SidebarSectionProps } from './SidebarSection.js';