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.
- package/CHANGELOG.md +3001 -0
- package/LICENSE +21 -0
- package/README.md +556 -0
- package/dist/Toast-FZUdYH1L.js +594 -0
- package/dist/cn.js +7 -0
- package/dist/components/Accordion/Accordion.d.ts +49 -0
- package/dist/components/Accordion/AccordionContent.d.ts +15 -0
- package/dist/components/Accordion/AccordionContext.d.ts +59 -0
- package/dist/components/Accordion/AccordionHeader.d.ts +22 -0
- package/dist/components/Accordion/AccordionItem.d.ts +11 -0
- package/dist/components/Accordion/index.d.ts +8 -0
- package/dist/components/Alert/Alert.d.ts +39 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/AlertDialog/AlertDialogClose.d.ts +64 -0
- package/dist/components/AlertDialog/AlertDialogContent.d.ts +58 -0
- package/dist/components/AlertDialog/index.d.ts +14 -0
- package/dist/components/Avatar/Avatar.d.ts +62 -0
- package/dist/components/Avatar/AvatarGroup.d.ts +13 -0
- package/dist/components/Avatar/index.d.ts +4 -0
- package/dist/components/Badge/Badge.d.ts +33 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +14 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.d.ts +21 -0
- package/dist/components/Breadcrumb/index.d.ts +4 -0
- package/dist/components/Button/Button.d.ts +61 -0
- package/dist/components/Button/IconButton.d.ts +48 -0
- package/dist/components/Button/index.d.ts +4 -0
- package/dist/components/Card/Card.d.ts +79 -0
- package/dist/components/Card/CardBody.d.ts +8 -0
- package/dist/components/Card/CardDivider.d.ts +8 -0
- package/dist/components/Card/CardFooter.d.ts +8 -0
- package/dist/components/Card/CardHeader.d.ts +8 -0
- package/dist/components/Card/CardImage.d.ts +15 -0
- package/dist/components/Card/index.d.ts +12 -0
- package/dist/components/Checkbox/Checkbox.d.ts +47 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Chip/Chip.d.ts +38 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts +80 -0
- package/dist/components/Dialog/DialogBody.d.ts +8 -0
- package/dist/components/Dialog/DialogClose.d.ts +61 -0
- package/dist/components/Dialog/DialogContent.d.ts +36 -0
- package/dist/components/Dialog/DialogContext.d.ts +1 -0
- package/dist/components/Dialog/DialogFooter.d.ts +8 -0
- package/dist/components/Dialog/DialogHeader.d.ts +13 -0
- package/dist/components/Dialog/DialogTrigger.d.ts +44 -0
- package/dist/components/Dialog/index.d.ts +16 -0
- package/dist/components/Divider/Divider.d.ts +34 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Input/ErrorText.d.ts +13 -0
- package/dist/components/Input/Helper.d.ts +11 -0
- package/dist/components/Input/Input.d.ts +35 -0
- package/dist/components/Input/InputAddon.d.ts +8 -0
- package/dist/components/Input/InputGroup.d.ts +17 -0
- package/dist/components/Input/Label.d.ts +12 -0
- package/dist/components/Input/index.d.ts +12 -0
- package/dist/components/NativeSelect/NativeSelect.d.ts +41 -0
- package/dist/components/NativeSelect/index.d.ts +2 -0
- package/dist/components/Navbar/Navbar.d.ts +46 -0
- package/dist/components/Navbar/NavbarActions.d.ts +10 -0
- package/dist/components/Navbar/NavbarLink.d.ts +13 -0
- package/dist/components/Navbar/NavbarLogo.d.ts +22 -0
- package/dist/components/Navbar/NavbarMenuButton.d.ts +15 -0
- package/dist/components/Navbar/NavbarNav.d.ts +14 -0
- package/dist/components/Navbar/index.d.ts +12 -0
- package/dist/components/Pagination/Pagination.d.ts +77 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Progress/Progress.d.ts +63 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Radio/Radio.d.ts +28 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Rating/Rating.d.ts +85 -0
- package/dist/components/Rating/index.d.ts +2 -0
- package/dist/components/Sidebar/Sidebar.d.ts +28 -0
- package/dist/components/Sidebar/SidebarContext.d.ts +32 -0
- package/dist/components/Sidebar/SidebarDivider.d.ts +8 -0
- package/dist/components/Sidebar/SidebarFooter.d.ts +8 -0
- package/dist/components/Sidebar/SidebarHeader.d.ts +13 -0
- package/dist/components/Sidebar/SidebarItem.d.ts +42 -0
- package/dist/components/Sidebar/SidebarNav.d.ts +13 -0
- package/dist/components/Sidebar/SidebarSection.d.ts +11 -0
- package/dist/components/Sidebar/SidebarToggle.d.ts +17 -0
- package/dist/components/Sidebar/index.d.ts +16 -0
- package/dist/components/Skeleton/Skeleton.d.ts +60 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Slider/Slider.d.ts +44 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Slot/Slot.d.ts +1 -0
- package/dist/components/Slot/composeEventHandlers.d.ts +1 -0
- package/dist/components/Slot/composeRefs.d.ts +1 -0
- package/dist/components/Slot/index.d.ts +3 -0
- package/dist/components/Spinner/Spinner.d.ts +31 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Stepper/Step.d.ts +17 -0
- package/dist/components/Stepper/Stepper.d.ts +97 -0
- package/dist/components/Stepper/index.d.ts +4 -0
- package/dist/components/Switch/Switch.d.ts +53 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +74 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +41 -0
- package/dist/components/Tabs/TabsContent.d.ts +15 -0
- package/dist/components/Tabs/TabsContext.d.ts +61 -0
- package/dist/components/Tabs/TabsList.d.ts +10 -0
- package/dist/components/Tabs/TabsTrigger.d.ts +15 -0
- package/dist/components/Tabs/index.d.ts +8 -0
- package/dist/components/Textarea/Textarea.d.ts +51 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/ThemeToggle/ThemeToggle.d.ts +43 -0
- package/dist/components/ThemeToggle/index.d.ts +2 -0
- package/dist/components/Timeline/Timeline.d.ts +20 -0
- package/dist/components/Timeline/TimelineItem.d.ts +32 -0
- package/dist/components/Timeline/index.d.ts +4 -0
- package/dist/components/Toast/Toast.d.ts +47 -0
- package/dist/components/Toast/ToastContext.d.ts +93 -0
- package/dist/components/Toast/ToastProvider.d.ts +116 -0
- package/dist/components/Toast/index.d.ts +6 -0
- package/dist/components/floating/Menu/Menu.d.ts +67 -0
- package/dist/components/floating/Menu/MenuContent.d.ts +60 -0
- package/dist/components/floating/Menu/MenuContext.d.ts +78 -0
- package/dist/components/floating/Menu/MenuItem.d.ts +47 -0
- package/dist/components/floating/Menu/MenuLabel.d.ts +6 -0
- package/dist/components/floating/Menu/MenuSeparator.d.ts +6 -0
- package/dist/components/floating/Menu/MenuTrigger.d.ts +53 -0
- package/dist/components/floating/Menu/index.d.ts +12 -0
- package/dist/components/floating/Menu/menuSelectors.d.ts +15 -0
- package/dist/components/floating/Tooltip/Tooltip.d.ts +194 -0
- package/dist/components/floating/Tooltip/index.d.ts +2 -0
- package/dist/components/floating/index.d.ts +3 -0
- package/dist/components/floating/primitives/FloatingTreeRoot.d.ts +55 -0
- package/dist/components/floating/primitives/index.d.ts +2 -0
- package/dist/components/floating/primitives/useFloatingNode.d.ts +1 -0
- package/dist/components/index.d.ts +38 -0
- package/dist/hooks/useControllableState.d.ts +152 -0
- package/dist/hooks/useTheme.d.ts +44 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +1843 -0
- package/dist/server-safe.d.ts +69 -0
- package/dist/server-safe.js +47 -0
- package/dist/styles/igoded-base.css +1 -0
- package/dist/styles/igoded-components.css +1 -0
- package/dist/styles/igoded-design.css +1 -0
- package/dist/styles/igoded-fonts.css +1 -0
- package/dist/styles/igoded-reset.css +1 -0
- package/dist/styles/igoded-state-css.css +1 -0
- package/dist/styles/igoded-tokens.css +1 -0
- package/dist/styles/index.css +3 -0
- package/dist/styles/state/active.css +1 -0
- package/dist/styles/state/checked.css +1 -0
- package/dist/styles/state/default.css +1 -0
- package/dist/styles/state/disabled.css +1 -0
- package/dist/styles/state/empty.css +1 -0
- package/dist/styles/state/first-child.css +1 -0
- package/dist/styles/state/first-of-type.css +1 -0
- package/dist/styles/state/focus-visible.css +1 -0
- package/dist/styles/state/focus-within.css +1 -0
- package/dist/styles/state/focus.css +1 -0
- package/dist/styles/state/group-hover.css +1 -0
- package/dist/styles/state/hover.css +1 -0
- package/dist/styles/state/in-range.css +1 -0
- package/dist/styles/state/indeterminate.css +1 -0
- package/dist/styles/state/invalid.css +1 -0
- package/dist/styles/state/last-child.css +1 -0
- package/dist/styles/state/last-of-type.css +1 -0
- package/dist/styles/state/nth-child.css +1 -0
- package/dist/styles/state/only-child.css +1 -0
- package/dist/styles/state/optional.css +1 -0
- package/dist/styles/state/other.css +1 -0
- package/dist/styles/state/out-of-range.css +1 -0
- package/dist/styles/state/placeholder-shown.css +1 -0
- package/dist/styles/state/read-only.css +1 -0
- package/dist/styles/state/read-write.css +1 -0
- package/dist/styles/state/required.css +1 -0
- package/dist/styles/state/target.css +1 -0
- package/dist/styles/state/valid.css +1 -0
- package/dist/utils/cn.d.ts +11 -0
- package/package.json +282 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface CardBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
4
|
+
}
|
|
5
|
+
/** CardBody — cuerpo principal de una `Card`. *
|
|
6
|
+
* @server-safe
|
|
7
|
+
*/
|
|
8
|
+
export declare function CardBody({ className, children, ref, ...rest }: CardBodyProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface CardDividerProps extends HTMLAttributes<HTMLHRElement> {
|
|
3
|
+
ref?: Ref<HTMLHRElement> | undefined;
|
|
4
|
+
}
|
|
5
|
+
/** CardDivider — separador horizontal entre secciones de una `Card`. *
|
|
6
|
+
* @server-safe
|
|
7
|
+
*/
|
|
8
|
+
export declare function CardDivider({ className, ref, ...rest }: CardDividerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
4
|
+
}
|
|
5
|
+
/** CardFooter — pie de una `Card`. Típicamente acciones o metadata. *
|
|
6
|
+
* @server-safe
|
|
7
|
+
*/
|
|
8
|
+
export declare function CardFooter({ className, children, ref, ...rest }: CardFooterProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
4
|
+
}
|
|
5
|
+
/** CardHeader — cabecera de una `Card`. Suele contener título + acciones. *
|
|
6
|
+
* @server-safe
|
|
7
|
+
*/
|
|
8
|
+
export declare function CardHeader({ className, children, ref, ...rest }: CardHeaderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ImgHTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface CardImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
3
|
+
/** Si la imagen va en la parte superior de la card (esquinas top redondeadas). */
|
|
4
|
+
top?: boolean | undefined;
|
|
5
|
+
/** Texto alternativo obligatorio para a11y. */
|
|
6
|
+
alt: string;
|
|
7
|
+
ref?: Ref<HTMLImageElement> | undefined;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* CardImage — imagen integrada en una `Card`. Con `top=true` se renderiza
|
|
11
|
+
* pegada al borde superior con esquinas redondeadas a juego.
|
|
12
|
+
*
|
|
13
|
+
* @server-safe
|
|
14
|
+
*/
|
|
15
|
+
export declare function CardImage({ top, alt, className, ref, ...rest }: CardImageProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { Card } from './Card.js';
|
|
2
|
+
export type { CardProps, CardVariant } from './Card.js';
|
|
3
|
+
export { CardHeader } from './CardHeader.js';
|
|
4
|
+
export type { CardHeaderProps } from './CardHeader.js';
|
|
5
|
+
export { CardBody } from './CardBody.js';
|
|
6
|
+
export type { CardBodyProps } from './CardBody.js';
|
|
7
|
+
export { CardFooter } from './CardFooter.js';
|
|
8
|
+
export type { CardFooterProps } from './CardFooter.js';
|
|
9
|
+
export { CardImage } from './CardImage.js';
|
|
10
|
+
export type { CardImageProps } from './CardImage.js';
|
|
11
|
+
export { CardDivider } from './CardDivider.js';
|
|
12
|
+
export type { CardDividerProps } from './CardDivider.js';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { InputHTMLAttributes, Ref } from 'react';
|
|
2
|
+
export type CheckboxVariant = "brand" | "secondary" | "success" | "warning" | "danger" | "info";
|
|
3
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
|
|
4
|
+
/** Color del check cuando está activo. */
|
|
5
|
+
variant?: CheckboxVariant | undefined;
|
|
6
|
+
/** Etiqueta visible junto al checkbox. */
|
|
7
|
+
children?: React.ReactNode | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Activa el tercer estado visual del checkbox (línea horizontal en
|
|
10
|
+
* lugar del tick). Se aplica vía `el.indeterminate = true` en el
|
|
11
|
+
* `<input>` nativo (la única forma soportada por la plataforma) y
|
|
12
|
+
* añade `aria-checked="mixed"` para lectores de pantalla.
|
|
13
|
+
*
|
|
14
|
+
* Nota: `indeterminate` es estado del DOM, no del modelo de datos.
|
|
15
|
+
* El `value` del checkbox sigue siendo `checked`/`unchecked`. Mantén
|
|
16
|
+
* tú la sincronización con los hijos cuyo estado lo justifique.
|
|
17
|
+
*/
|
|
18
|
+
indeterminate?: boolean | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Ids extra para `aria-describedby`. Pasar string para un único id o
|
|
21
|
+
* array para varios. Se concatenan con cualquier `aria-describedby`
|
|
22
|
+
* que el consumer pase por rest. Patrón canónico del DS para enlazar
|
|
23
|
+
* `Helper` / `ErrorText` / live-regions con tecnologías asistivas.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const helperId = useId();
|
|
27
|
+
* <Checkbox describedBy={helperId}>Acepto</Checkbox>
|
|
28
|
+
* <Helper id={helperId}>Solo email; no spam.</Helper>
|
|
29
|
+
*/
|
|
30
|
+
describedBy?: string | string[] | undefined;
|
|
31
|
+
ref?: Ref<HTMLInputElement> | undefined;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Checkbox — `<input type="checkbox">` con marca visual personalizada.
|
|
35
|
+
* Wrappeado en `<label>` para que click en el texto active el input.
|
|
36
|
+
*
|
|
37
|
+
* Soporta tri-state vía `indeterminate` prop (desde 1.0.0-beta.8) o via
|
|
38
|
+
* `ref` manual (`ref.current.indeterminate = true`).
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* <Checkbox defaultChecked>Acepto los términos</Checkbox>
|
|
42
|
+
* <Checkbox indeterminate>Selección parcial</Checkbox>
|
|
43
|
+
* <Checkbox checked={on} onChange={(e) => setOn(e.target.checked)}>
|
|
44
|
+
* Recibir newsletter
|
|
45
|
+
* </Checkbox>
|
|
46
|
+
*/
|
|
47
|
+
export declare function Checkbox({ variant, className, children, ref, disabled, indeterminate, describedBy, onChange, ...rest }: CheckboxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export type ChipVariant = "brand" | "secondary" | "success" | "warning" | "danger" | "info";
|
|
3
|
+
export type ChipSize = "sm" | "md" | "lg";
|
|
4
|
+
interface ChipBase {
|
|
5
|
+
variant?: ChipVariant | undefined;
|
|
6
|
+
size?: ChipSize | undefined;
|
|
7
|
+
/** Si está marcado como seleccionable + seleccionado, aplica el estado activo. */
|
|
8
|
+
selected?: boolean | undefined;
|
|
9
|
+
/** Callback opcional para mostrar la X de eliminación. */
|
|
10
|
+
onRemove?: (() => void) | undefined;
|
|
11
|
+
/** Texto a11y para el botón de eliminación. */
|
|
12
|
+
removeLabel?: string | undefined;
|
|
13
|
+
children?: React.ReactNode | undefined;
|
|
14
|
+
}
|
|
15
|
+
export type ChipProps = (ChipBase & {
|
|
16
|
+
selectable: true;
|
|
17
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof ChipBase> & {
|
|
18
|
+
ref?: Ref<HTMLButtonElement>;
|
|
19
|
+
}) | (ChipBase & {
|
|
20
|
+
selectable?: false;
|
|
21
|
+
} & Omit<HTMLAttributes<HTMLSpanElement>, keyof ChipBase> & {
|
|
22
|
+
ref?: Ref<HTMLSpanElement>;
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Chip — etiqueta compacta. Por defecto inline (`<span>`); con `selectable`
|
|
26
|
+
* se renderiza como `<button>` clickeable. `onRemove` añade una X cerrar.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* <Chip variant="info">Tag</Chip>
|
|
30
|
+
* <Chip selectable selected={picked} onClick={() => setPicked(p => !p)}>
|
|
31
|
+
* React
|
|
32
|
+
* </Chip>
|
|
33
|
+
* <Chip variant="success" onRemove={() => removeTag(id)}>Removible</Chip>
|
|
34
|
+
*
|
|
35
|
+
* @server-safe
|
|
36
|
+
*/
|
|
37
|
+
export declare function Chip(props: ChipProps): import("react").JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface DialogProps {
|
|
3
|
+
/**
|
|
4
|
+
* Estado abierto/cerrado en **modo controlled**. Tu app gestiona el
|
|
5
|
+
* estado y debe actualizarlo en respuesta a `onOpenChange`.
|
|
6
|
+
*
|
|
7
|
+
* **D6 (beta.24)**: `open` ahora es opcional. Patrón controlled/
|
|
8
|
+
* uncontrolled DS-wide:
|
|
9
|
+
*
|
|
10
|
+
* - Pasas `open` → controlled.
|
|
11
|
+
* - Omites `open` (y opcionalmente pasas `defaultOpen`) → uncontrolled.
|
|
12
|
+
* El Dialog gestiona su estado interno; `DialogTrigger` y `DialogClose`
|
|
13
|
+
* llaman al setter del provider sin necesidad de useState externo.
|
|
14
|
+
*/
|
|
15
|
+
open?: boolean | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Valor inicial en **modo uncontrolled** (cuando `open` es undefined).
|
|
18
|
+
* Por defecto `false` (cerrado). Ignorado en modo controlled.
|
|
19
|
+
*/
|
|
20
|
+
defaultOpen?: boolean | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Callback cuando el estado cambia. Dispara en ambos modos:
|
|
23
|
+
* - Controlled: único mecanismo para que el consumer actualice `open`.
|
|
24
|
+
* - Uncontrolled: actúa como observer.
|
|
25
|
+
*/
|
|
26
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated B-02: usa `onOpenChange`. Eliminado en 2.0. Solo dispara
|
|
29
|
+
* con `open=false` (cierres). Para apertura programática usa el state
|
|
30
|
+
* del Dialog (`<DialogTrigger>` en uncontrolled, o `open` prop en
|
|
31
|
+
* controlled).
|
|
32
|
+
*/
|
|
33
|
+
onClose?: (() => void) | undefined;
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Dialog — Provider para el patrón compound canónico (D6 beta.24).
|
|
38
|
+
*
|
|
39
|
+
* Renderiza solo un contexto; no produce DOM por sí mismo. El modal real
|
|
40
|
+
* vive en `<DialogContent>` (el `<dialog>` HTML nativo) y opcionalmente
|
|
41
|
+
* un `<DialogTrigger>` para abrir desde la UI.
|
|
42
|
+
*
|
|
43
|
+
* Pre-D6 `Dialog` era el `<dialog>` mismo. Migración mecánica: envolver
|
|
44
|
+
* los children actuales en `<DialogContent>`:
|
|
45
|
+
*
|
|
46
|
+
* ```diff
|
|
47
|
+
* - <Dialog open={x} onOpenChange={fn}>
|
|
48
|
+
* - <DialogHeader />
|
|
49
|
+
* - <DialogBody>...</DialogBody>
|
|
50
|
+
* - </Dialog>
|
|
51
|
+
* + <Dialog open={x} onOpenChange={fn}>
|
|
52
|
+
* + <DialogContent>
|
|
53
|
+
* + <DialogHeader />
|
|
54
|
+
* + <DialogBody>...</DialogBody>
|
|
55
|
+
* + </DialogContent>
|
|
56
|
+
* + </Dialog>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* // Uncontrolled (nuevo en D6):
|
|
61
|
+
* <Dialog defaultOpen={false}>
|
|
62
|
+
* <DialogTrigger>Abrir</DialogTrigger>
|
|
63
|
+
* <DialogContent>
|
|
64
|
+
* <DialogHeader>Confirmar <DialogClose /></DialogHeader>
|
|
65
|
+
* <DialogBody>¿Seguro?</DialogBody>
|
|
66
|
+
* <DialogFooter><Button>Aceptar</Button></DialogFooter>
|
|
67
|
+
* </DialogContent>
|
|
68
|
+
* </Dialog>
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* // Controlled (backward-compat con la API pre-D6 + DialogContent):
|
|
72
|
+
* const [open, setOpen] = useState(false);
|
|
73
|
+
* <Dialog open={open} onOpenChange={setOpen}>
|
|
74
|
+
* <DialogContent>
|
|
75
|
+
* <DialogHeader>Confirmar <DialogClose /></DialogHeader>
|
|
76
|
+
* ...
|
|
77
|
+
* </DialogContent>
|
|
78
|
+
* </Dialog>
|
|
79
|
+
*/
|
|
80
|
+
export declare function Dialog({ open, defaultOpen, onOpenChange, onClose, children, }: DialogProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface DialogBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
4
|
+
}
|
|
5
|
+
/** DialogBody — cuerpo scrollable del modal. *
|
|
6
|
+
* @server-safe
|
|
7
|
+
*/
|
|
8
|
+
export declare function DialogBody({ className, children, ref, ...rest }: DialogBodyProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface DialogCloseProps 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 (`onClick` que cierra el dialog + `aria-label`
|
|
7
|
+
* default "Cerrar") sin renderizar un `<button>` propio ni aplicar
|
|
8
|
+
* `ig-dialog-close` (consumer trae su propio styling).
|
|
9
|
+
*
|
|
10
|
+
* Cubre el caso de CTAs del footer del Dialog: en lugar del antiguo
|
|
11
|
+
* `<DialogAction>` (eliminado en beta.27, D14), el patrón canónico
|
|
12
|
+
* ahora es `<DialogClose asChild><Button>...</Button></DialogClose>`.
|
|
13
|
+
* Esto cierra la asimetría léxica DialogClose styled / DialogAction
|
|
14
|
+
* unstyled / AlertDialogClose clónico que era deuda heredada pre-D14.
|
|
15
|
+
*
|
|
16
|
+
* Sin `asChild`, DialogClose renderiza el icon-button "×" tradicional
|
|
17
|
+
* con clase `ig-dialog-close` — comportamiento backwards-compat para
|
|
18
|
+
* uso como × del header.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Header X icon (default, backwards-compat):
|
|
22
|
+
* <DialogHeader>
|
|
23
|
+
* <h2>Confirmar</h2>
|
|
24
|
+
* <DialogClose />
|
|
25
|
+
* </DialogHeader>
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Footer CTA (Slot pattern, reemplaza el viejo DialogAction):
|
|
29
|
+
* <DialogFooter>
|
|
30
|
+
* <DialogClose asChild>
|
|
31
|
+
* <Button variant="brand">Aceptar</Button>
|
|
32
|
+
* </DialogClose>
|
|
33
|
+
* </DialogFooter>
|
|
34
|
+
*/
|
|
35
|
+
asChild?: boolean | undefined;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* DialogClose — botón que cierra el modal. Dos modos:
|
|
39
|
+
*
|
|
40
|
+
* - **Default** (`asChild=false`): renderiza el icon-button "×" tradicional
|
|
41
|
+
* con clase `ig-dialog-close` (fuerza dimensiones 2rem × 2rem, sin
|
|
42
|
+
* padding). Para la × del header.
|
|
43
|
+
*
|
|
44
|
+
* - **Slot pattern** (`asChild=true`, D14): clona el child del consumer
|
|
45
|
+
* y le aplica el close handler + aria-label. **No aplica
|
|
46
|
+
* `ig-dialog-close`** — el consumer trae su propio styling. Reemplaza
|
|
47
|
+
* el antiguo `<DialogAction>` para CTAs del footer.
|
|
48
|
+
*
|
|
49
|
+
* **D6 (beta.24)**: si vive dentro de `<Dialog>` consume el contexto y
|
|
50
|
+
* llama a `setOpen(false)` automáticamente — el consumer no necesita
|
|
51
|
+
* conectar `onClick` para cerrar. Si pasa un `onClick` propio, se
|
|
52
|
+
* chainea (consumer primero; si hace `preventDefault`, no cerramos).
|
|
53
|
+
*
|
|
54
|
+
* Tolerante a uso fuera de `<Dialog>`: si no hay contexto, el componente
|
|
55
|
+
* sigue siendo un botón pero el click NO cierra nada (responsabilidad
|
|
56
|
+
* del consumer via `onClick`).
|
|
57
|
+
*
|
|
58
|
+
* Es client-component (`"use client"`) porque consume el `DialogContext`
|
|
59
|
+
* via hook — NO marcado server-safe.
|
|
60
|
+
*/
|
|
61
|
+
export declare function DialogClose({ asChild, className, children, type, "aria-label": consumerAriaLabel, onClick: consumerOnClick, ref, ...rest }: DialogCloseProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DialogHTMLAttributes, Ref } from 'react';
|
|
2
|
+
export type DialogContentSize = "sm" | "md" | "lg" | "xl" | "full";
|
|
3
|
+
export type DialogContentBackdrop = "default" | "blur" | "dark" | "light" | "none";
|
|
4
|
+
export interface DialogContentProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, "open" | "id"> {
|
|
5
|
+
/** Tamaño del modal. Por defecto `"md"`. */
|
|
6
|
+
size?: DialogContentSize | undefined;
|
|
7
|
+
/** Estilo del backdrop. Por defecto `"default"`. */
|
|
8
|
+
backdrop?: DialogContentBackdrop | undefined;
|
|
9
|
+
/** Cerrar al hacer click fuera del contenido. Por defecto `true`. */
|
|
10
|
+
closeOnBackdrop?: boolean | undefined;
|
|
11
|
+
/** Permitir cerrar con la tecla ESC. Por defecto `true`. */
|
|
12
|
+
closeOnEsc?: boolean | undefined;
|
|
13
|
+
/** Estado de carga (aplica `ig-dialog-loading`). */
|
|
14
|
+
loading?: boolean | undefined;
|
|
15
|
+
ref?: Ref<HTMLDialogElement> | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* DialogContent — el `<dialog>` HTML nativo gestionado por el Provider
|
|
19
|
+
* `Dialog`. Sale en top-layer (sobre cualquier z-index/overflow ancestro),
|
|
20
|
+
* aplica `role="dialog"` + `aria-modal` automáticos del browser, y reusa
|
|
21
|
+
* el focus trap + restauración nativos.
|
|
22
|
+
*
|
|
23
|
+
* Debe usarse dentro de `<Dialog>`. Si necesitas componer header / body /
|
|
24
|
+
* footer, mete `<DialogHeader>` / `<DialogBody>` / `<DialogFooter>` como
|
|
25
|
+
* children de este componente.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* <Dialog defaultOpen>
|
|
29
|
+
* <DialogTrigger>Abrir</DialogTrigger>
|
|
30
|
+
* <DialogContent size="md">
|
|
31
|
+
* <DialogHeader>Título <DialogClose /></DialogHeader>
|
|
32
|
+
* <DialogBody>Contenido</DialogBody>
|
|
33
|
+
* </DialogContent>
|
|
34
|
+
* </Dialog>
|
|
35
|
+
*/
|
|
36
|
+
export declare function DialogContent({ size, backdrop, closeOnBackdrop, closeOnEsc, loading, className, children, ref, onPointerDown: consumerOnPointerDown, onClick: consumerOnClick, onClose: consumerOnClose, ...rest }: DialogContentProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface DialogFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
4
|
+
}
|
|
5
|
+
/** DialogFooter — pie del modal con acciones alineadas a la derecha. *
|
|
6
|
+
* @server-safe
|
|
7
|
+
*/
|
|
8
|
+
export declare function DialogFooter({ className, children, ref, ...rest }: DialogFooterProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface DialogHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* DialogHeader — cabecera del modal. Suele contener título + `DialogClose`.
|
|
7
|
+
*
|
|
8
|
+
* Genera un `id` único y lo registra en el `Dialog` padre, que lo aplica como
|
|
9
|
+
* `aria-labelledby` para que los lectores de pantalla anuncien el título.
|
|
10
|
+
* Si el consumer pasa `id` propio, ese tiene prioridad. Si pasa
|
|
11
|
+
* `aria-labelledby` directamente al `Dialog`, ese gana sobre el del header.
|
|
12
|
+
*/
|
|
13
|
+
export declare function DialogHeader({ className, children, id: idProp, ref, ...rest }: DialogHeaderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface DialogTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
ref?: Ref<HTMLButtonElement> | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Slot pattern (D14): si `true`, clona el child del consumer y le aplica
|
|
6
|
+
* trigger semantics (`aria-haspopup="dialog"`, `aria-expanded`,
|
|
7
|
+
* `aria-controls={contentId}` + `onClick` que abre el dialog) sin
|
|
8
|
+
* renderizar un `<button>` propio. Permite usar cualquier element como
|
|
9
|
+
* trigger (`<Button>`, `<a>`, custom component) preservando su tipo,
|
|
10
|
+
* styling y eventos.
|
|
11
|
+
*
|
|
12
|
+
* Sin `asChild`, DialogTrigger renderiza un `<button>` plano que envuelve
|
|
13
|
+
* los children — comportamiento backwards-compat con 1.0.0-beta.26.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Slot pattern (recomendado para Buttons del DS):
|
|
17
|
+
* <DialogTrigger asChild>
|
|
18
|
+
* <Button variant="brand">Abrir modal</Button>
|
|
19
|
+
* </DialogTrigger>
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Default (backwards-compat):
|
|
23
|
+
* <DialogTrigger>Abrir</DialogTrigger>
|
|
24
|
+
*/
|
|
25
|
+
asChild?: boolean | undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* DialogTrigger — botón que abre el `DialogContent` asociado. Anuncia la
|
|
29
|
+
* relación al SR via `aria-haspopup="dialog"` + `aria-controls={contentId}` +
|
|
30
|
+
* `aria-expanded={open}` (estándar APG para disclosure de dialog).
|
|
31
|
+
*
|
|
32
|
+
* Dos modos de render:
|
|
33
|
+
*
|
|
34
|
+
* - **Default** (`asChild=false`): renderiza un `<button>` plano que envuelve
|
|
35
|
+
* los children. Comportamiento idéntico al de 1.0.0-beta.26.
|
|
36
|
+
*
|
|
37
|
+
* - **Slot pattern** (`asChild=true`, D14): clona el child del consumer y
|
|
38
|
+
* le aplica los aria props + onClick handler. El child es renderizado
|
|
39
|
+
* directamente (no wrapper). Patrón canónico Radix/shadcn.
|
|
40
|
+
*
|
|
41
|
+
* Debe usarse dentro de `<Dialog>`. Es client-component (`"use client"`)
|
|
42
|
+
* porque consume el `DialogContext` via hook — NO marcado server-safe.
|
|
43
|
+
*/
|
|
44
|
+
export declare function DialogTrigger({ asChild, type, onClick: consumerOnClick, children, ref, ...rest }: DialogTriggerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { Dialog } from './Dialog.js';
|
|
2
|
+
export type { DialogProps } from './Dialog.js';
|
|
3
|
+
export { DialogContent } from './DialogContent.js';
|
|
4
|
+
export type { DialogContentProps, DialogContentSize, DialogContentBackdrop, } from './DialogContent.js';
|
|
5
|
+
export type { DialogContentSize as DialogSize } from './DialogContent.js';
|
|
6
|
+
export type { DialogContentBackdrop as DialogBackdrop } from './DialogContent.js';
|
|
7
|
+
export { DialogTrigger } from './DialogTrigger.js';
|
|
8
|
+
export type { DialogTriggerProps } from './DialogTrigger.js';
|
|
9
|
+
export { DialogHeader } from './DialogHeader.js';
|
|
10
|
+
export type { DialogHeaderProps } from './DialogHeader.js';
|
|
11
|
+
export { DialogBody } from './DialogBody.js';
|
|
12
|
+
export type { DialogBodyProps } from './DialogBody.js';
|
|
13
|
+
export { DialogFooter } from './DialogFooter.js';
|
|
14
|
+
export type { DialogFooterProps } from './DialogFooter.js';
|
|
15
|
+
export { DialogClose } from './DialogClose.js';
|
|
16
|
+
export type { DialogCloseProps } from './DialogClose.js';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
export type DividerVariant = "default" | "brand" | "secondary" | "success" | "warning" | "danger" | "info";
|
|
3
|
+
export interface DividerProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/** Orientación. Vertical renderiza un `<span>` inline-block; horizontal un `<hr>`. */
|
|
5
|
+
vertical?: boolean | undefined;
|
|
6
|
+
/** Borde discontinuo. */
|
|
7
|
+
dashed?: boolean | undefined;
|
|
8
|
+
/** Color del separador. `default` usa el color neutro de borde. */
|
|
9
|
+
variant?: DividerVariant | undefined;
|
|
10
|
+
/** Si se pasan, renderiza un divider con texto centrado en lugar de la línea. */
|
|
11
|
+
children?: ReactNode | undefined;
|
|
12
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Divider — línea separadora horizontal o vertical, con o sin texto.
|
|
16
|
+
*
|
|
17
|
+
* - Sin `children` y horizontal → `<hr class="ig-divider">`.
|
|
18
|
+
* - Sin `children` y vertical → `<span class="ig-divider-vertical">`.
|
|
19
|
+
* - Con `children` → `<div class="ig-divider-with-text">` con texto centrado.
|
|
20
|
+
*
|
|
21
|
+
* Como el elemento renderizado depende de las props, `ref` se tipa como
|
|
22
|
+
* `Ref<HTMLElement>` (común a los 3). Si necesitas un ref más concreto en tu
|
|
23
|
+
* código, narrow con `as RefObject<HTMLHRElement>` cuando uses la variante
|
|
24
|
+
* por defecto.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* <Divider />
|
|
28
|
+
* <Divider variant="brand" dashed />
|
|
29
|
+
* <Divider>o</Divider>
|
|
30
|
+
* <Divider vertical aria-orientation="vertical" />
|
|
31
|
+
*
|
|
32
|
+
* @server-safe
|
|
33
|
+
*/
|
|
34
|
+
export declare function Divider({ vertical, dashed, variant, children, className, ref, ...rest }: DividerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface ErrorTextProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
3
|
+
ref?: Ref<HTMLParagraphElement> | undefined;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* ErrorText — mensaje de error bajo un input. Usa `role="alert"` y
|
|
7
|
+
* `aria-live="polite"` para anunciar el error a tecnologías asistivas.
|
|
8
|
+
*
|
|
9
|
+
* (Nombrado `ErrorText` en lugar de `Error` para evitar shadow del global.)
|
|
10
|
+
*
|
|
11
|
+
* @server-safe
|
|
12
|
+
*/
|
|
13
|
+
export declare function ErrorText({ className, children, ref, ...rest }: ErrorTextProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface HelperProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
3
|
+
ref?: Ref<HTMLParagraphElement> | undefined;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Helper — texto de ayuda discreto bajo un input. Usa `id` y `aria-describedby`
|
|
7
|
+
* en el input para que los lectores de pantalla lo asocien.
|
|
8
|
+
*
|
|
9
|
+
* @server-safe
|
|
10
|
+
*/
|
|
11
|
+
export declare function Helper({ className, children, ref, ...rest }: HelperProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { InputHTMLAttributes, Ref } from 'react';
|
|
2
|
+
export type InputSize = "sm" | "md" | "lg";
|
|
3
|
+
export type InputState = "default" | "invalid" | "valid";
|
|
4
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
5
|
+
/** Tamaño del input. `md` no añade clase. */
|
|
6
|
+
size?: InputSize | undefined;
|
|
7
|
+
/** Estado de validación visual. `error` y `success` aplican color y borde. */
|
|
8
|
+
state?: InputState | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* IDs de elementos descriptivos (típicamente `Helper`/`ErrorText`) que se
|
|
11
|
+
* combinan en `aria-describedby`. Acepta un id o lista de ids.
|
|
12
|
+
*
|
|
13
|
+
* Si pasas también `aria-describedby` directo (vía rest), AMBOS se
|
|
14
|
+
* concatenan en el atributo final — desde `1.0.0-beta.3`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const helperId = useId();
|
|
18
|
+
* const errorId = useId();
|
|
19
|
+
* <Input describedBy={[helperId, errorId]} ... />
|
|
20
|
+
* <Helper id={helperId}>...</Helper>
|
|
21
|
+
* <ErrorText id={errorId}>...</ErrorText>
|
|
22
|
+
*/
|
|
23
|
+
describedBy?: string | string[] | undefined;
|
|
24
|
+
ref?: Ref<HTMLInputElement> | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Input — `<input>` estilizado con tamaños y estados de validación visual.
|
|
28
|
+
* Acepta cualquier `type` válido de input nativo. Para enlazar `Helper` y
|
|
29
|
+
* `ErrorText` a tecnologías asistivas, pasa sus `id` en `describedBy`.
|
|
30
|
+
*
|
|
31
|
+
* **A11y dev warn**: si en desarrollo se monta sin `<Label htmlFor>`,
|
|
32
|
+
* `aria-label`, `aria-labelledby` ni `placeholder`, se emite warn
|
|
33
|
+
* `[reactigoded] <Input> sin label asociado.` (capa 1.1 debt doc).
|
|
34
|
+
*/
|
|
35
|
+
export declare function Input({ size, state, describedBy, className, ref, ...rest }: InputProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface InputAddonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
ref?: Ref<HTMLSpanElement> | undefined;
|
|
4
|
+
}
|
|
5
|
+
/** InputAddon — prefijo/sufijo decorativo dentro de un `InputGroup`. *
|
|
6
|
+
* @server-safe
|
|
7
|
+
*/
|
|
8
|
+
export declare function InputAddon({ className, children, ref, ...rest }: InputAddonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface InputGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* InputGroup — agrupa un input con `InputAddon`s (prefijo/sufijo).
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <InputGroup>
|
|
10
|
+
* <InputAddon>$</InputAddon>
|
|
11
|
+
* <Input type="number" />
|
|
12
|
+
* <InputAddon>USD</InputAddon>
|
|
13
|
+
* </InputGroup>
|
|
14
|
+
*
|
|
15
|
+
* @server-safe
|
|
16
|
+
*/
|
|
17
|
+
export declare function InputGroup({ className, children, ref, ...rest }: InputGroupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LabelHTMLAttributes, Ref } from 'react';
|
|
2
|
+
export interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
3
|
+
/** Marca el label como obligatorio (añade asterisco). */
|
|
4
|
+
required?: boolean | undefined;
|
|
5
|
+
ref?: Ref<HTMLLabelElement> | undefined;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Label — etiqueta para campos de formulario. Asocia con un input via `htmlFor`.
|
|
9
|
+
*
|
|
10
|
+
* @server-safe
|
|
11
|
+
*/
|
|
12
|
+
export declare function Label({ required, className, children, ref, ...rest }: LabelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { Input } from './Input.js';
|
|
2
|
+
export type { InputProps, InputSize, InputState } from './Input.js';
|
|
3
|
+
export { Label } from './Label.js';
|
|
4
|
+
export type { LabelProps } from './Label.js';
|
|
5
|
+
export { Helper } from './Helper.js';
|
|
6
|
+
export type { HelperProps } from './Helper.js';
|
|
7
|
+
export { ErrorText } from './ErrorText.js';
|
|
8
|
+
export type { ErrorTextProps } from './ErrorText.js';
|
|
9
|
+
export { InputGroup } from './InputGroup.js';
|
|
10
|
+
export type { InputGroupProps } from './InputGroup.js';
|
|
11
|
+
export { InputAddon } from './InputAddon.js';
|
|
12
|
+
export type { InputAddonProps } from './InputAddon.js';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Ref, SelectHTMLAttributes } from 'react';
|
|
2
|
+
export type NativeSelectState = "default" | "invalid" | "valid";
|
|
3
|
+
export interface NativeSelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
4
|
+
/** Estado de validación visual. */
|
|
5
|
+
state?: NativeSelectState | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* IDs de elementos descriptivos (`Helper`/`ErrorText`) combinados en
|
|
8
|
+
* `aria-describedby`. Acepta un id o lista de ids. Si pasas también
|
|
9
|
+
* `aria-describedby` directo (vía rest), AMBOS se concatenan.
|
|
10
|
+
*/
|
|
11
|
+
describedBy?: string | string[] | undefined;
|
|
12
|
+
ref?: Ref<HTMLSelectElement> | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* NativeSelect — `<select>` nativo estilizado. Pasa `<option>` como children.
|
|
16
|
+
*
|
|
17
|
+
* **Limitación de plataforma**: la apariencia depende de
|
|
18
|
+
* `appearance: none` + un caret SVG inyectado en CSS. Cubre Chrome,
|
|
19
|
+
* Firefox, Safari y Edge modernos (los del browserslist). En motores
|
|
20
|
+
* antiguos sin soporte de `appearance: none` el `<select>` cae al chrome
|
|
21
|
+
* nativo del navegador (caret nativo, sin el icono igoded). El menú de
|
|
22
|
+
* opciones siempre lo pinta el sistema operativo — la librería no
|
|
23
|
+
* intenta reemplazarlo (un combobox custom requeriría un componente
|
|
24
|
+
* separado, fuera del alcance del DS).
|
|
25
|
+
*
|
|
26
|
+
* **A11y dev warn**: si en desarrollo se monta sin `<Label htmlFor>`,
|
|
27
|
+
* `aria-label` ni `aria-labelledby`, se emite warn
|
|
28
|
+
* `[reactigoded] <NativeSelect> sin label asociado.` (capa 1.1 debt doc).
|
|
29
|
+
* Nota: `<select>` no tiene `placeholder`.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* <NativeSelect value={country} onChange={(e) => setCountry(e.target.value)}>
|
|
33
|
+
* <option value="es">España</option>
|
|
34
|
+
* <option value="mx">México</option>
|
|
35
|
+
* <option value="ar">Argentina</option>
|
|
36
|
+
* </NativeSelect>
|
|
37
|
+
* <NativeSelect state="invalid" describedBy={errorId}>
|
|
38
|
+
* <option value="">Selecciona…</option>
|
|
39
|
+
* </NativeSelect>
|
|
40
|
+
*/
|
|
41
|
+
export declare function NativeSelect({ state, describedBy, className, children, ref, ...rest }: NativeSelectProps): import("react").JSX.Element;
|