@beweco/aurora-ui 1.0.0-beta.113 → 1.0.0-beta.116

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -7666,6 +7666,19 @@ class $2aaf608024c21ca1$export$ca871e8dbb80966f {
7666
7666
  }
7667
7667
  }
7668
7668
 
7669
+ // TECH-2459 (08-sep-2026, a petición de la sesión de backoffice) — esta fachada pasa a ocupar el
7670
+ // nombre público `Switch`. Antes existía igual, pero `src/components/switch/index.ts` la publicaba
7671
+ // como `SwitchComponent` y el nombre bueno lo servía `src/index.tsx` reexportando el `Switch`
7672
+ // CRUDO de v3: el mismo FALSO AMIGO que Alert y Checkbox en la beta.112 — el símbolo resolvía, el
7673
+ // JSX v2 de las apps (`isSelected` + `onValueChange` + `color` + children como label) compilaba
7674
+ // contra el tipo de v3 en lo que coincidía, y en pantalla salía otro componente (o ninguno: el
7675
+ // crudo no pinta pista ni thumb si no le pasas los subcomponentes). Impacto medido por grep real:
7676
+ // 3 ficheros en backoffice-beweos, 39 en beweossmbs, 2 en beweosagency, 0 en loginos.
7677
+ //
7678
+ // `SwitchComponent` se conserva como ALIAS del mismo objeto (backoffice y `schedule-row` de esta
7679
+ // misma librería lo importan por ese nombre), y los subcomponentes compound de v3 quedan colgados
7680
+ // como estáticos al final del fichero, igual que en `Alert`/`Checkbox`.
7681
+ //
7669
7682
  // TECH-2459 · F3 · G1-forms — v3 convierte Switch en compound (Root > Content > Control > Thumb)
7670
7683
  // y quita `color` (usar Tailwind, ver guía oficial `switch`). El estado activado ya usa
7671
7684
  // `--switch-control-bg-checked: var(--accent)` (= --color-primary vía F1), así que "primary" no
@@ -7729,13 +7742,38 @@ const COLOR_VAR = {
7729
7742
  * como CAMBIO-V3 en `vrt/classification-overrides.json`, con las cifras en
7730
7743
  * `.bewe/epics/TECH-2459/findings/p6-switch-aspecto-v3.md`.
7731
7744
  */
7745
+ // Los subcomponentes compound de v3, adjuntos como estáticos para que la API v3 siga funcionando a
7746
+ // través de la fachada (`<Switch><Switch.Content><Switch.Control><Switch.Thumb/>…`). `Root` se deja
7747
+ // FUERA a propósito (mismo criterio que `Alert` y `Checkbox`): la raíz de v3 es justo la pieza que
7748
+ // esta fachada envuelve, así que exponerla colgada del nombre público sería servir el crudo otra
7749
+ // vez, con la apariencia de formar parte de la fachada. Ninguna app usa hoy el compound del Switch
7750
+ // (grep en los 4 repos: 0 usos de `Switch.Root`/`Content`/`Control`/`Thumb`/`Icon`); esto es
7751
+ // garantía de futuro, igual que en `Alert` — donde loginos SÍ había migrado su JSX.
7752
+ const COMPOUND_PARTS$2 = new Set([
7753
+ react.Switch.Content,
7754
+ react.Switch.Control,
7755
+ react.Switch.Thumb,
7756
+ react.Switch.Icon,
7757
+ ]);
7758
+ /**
7759
+ * Detecta la API compound de v3 por hijos directos: si el consumidor ya compone la estructura, la
7760
+ * fachada NO debe envolver nada (si lo hiciera saldrían dos pistas). `<Switch>Etiqueta</Switch>`
7761
+ * (sin partes compound) sigue siendo API v2: children como label.
7762
+ */
7763
+ function hasCompoundChildren$2(children) {
7764
+ return $8WNJc$react.Children.toArray(children).some((child) => $8WNJc$react.isValidElement(child) && COMPOUND_PARTS$2.has(child.type));
7765
+ }
7732
7766
  /**
7733
7767
  * Switch genérico basado en HeroUI v3 (TECH-2459 · F3 · G1-forms).
7734
7768
  *
7735
- * La API pública v2 (children como label, `isSelected`, `onValueChange`, `color`) se conserva
7736
- * intacta; por dentro compone `Switch.Content`/`Switch.Control`/`Switch.Thumb`.
7769
+ * Dos modos, decididos por los `children`:
7770
+ * - **API v2** (`children` como label, `isSelected`/`defaultSelected`, `onValueChange`, `color`,
7771
+ * `size`): la fachada compone `Switch.Content`/`Switch.Control`/`Switch.Thumb` por dentro y
7772
+ * repone `color` pisando `--switch-control-bg-checked`.
7773
+ * - **API compound v3** (`<Switch><Switch.Content>…`): pasa los children tal cual a la raíz de
7774
+ * HeroUI, sin geometría ni colocación propias.
7737
7775
  */
7738
- const Switch = ({ id, size = "md", color = "primary", children, onChange, onValueChange, className, style, ...props }) => {
7776
+ const SwitchFacade = ({ id, size = "md", color, children, onChange, onValueChange, className, style, ...props }) => {
7739
7777
  const generatedId = $8WNJc$react.useId();
7740
7778
  const autoId = id || generatedId;
7741
7779
  const handleChange = (isSelected) => {
@@ -7745,9 +7783,16 @@ const Switch = ({ id, size = "md", color = "primary", children, onChange, onValu
7745
7783
  const colorStyle = {
7746
7784
  // Solo el color del estado ENCENDIDO, y solo porque sostiene la prop `color` de la API v2
7747
7785
  // (ver el bloque de arriba). El apagado lo pinta v3 con su propio `--default`.
7748
- "--switch-control-bg-checked": COLOR_VAR[color],
7786
+ "--switch-control-bg-checked": COLOR_VAR[color ?? "primary"],
7749
7787
  ...style,
7750
7788
  };
7789
+ if (hasCompoundChildren$2(children)) {
7790
+ return (jsxRuntime.jsx(react.Switch, { ...props, id: autoId, size: size, className: className,
7791
+ // `color` es prop v2 y en compound manda el JSX del consumidor, así que solo se pisa
7792
+ // el token si lo pasó EXPLÍCITAMENTE (mismo criterio que `Alert`, que traduce `color`
7793
+ // a `status` también en compound). Sin `color`, el encendido es el `--accent` de v3.
7794
+ style: color === undefined ? style : colorStyle, onChange: handleChange, children: children }));
7795
+ }
7751
7796
  return (jsxRuntime.jsx(react.Switch, { ...props, id: autoId, size: size,
7752
7797
  // COLOCACIÓN, no aspecto (ver el bloque de arriba): v3 usa `flex flex-col items-start`
7753
7798
  // para poder apilar `description`/`field-error`, slots que esta fachada no renderiza.
@@ -7760,6 +7805,17 @@ const Switch = ({ id, size = "md", color = "primary", children, onChange, onValu
7760
7805
  .filter(Boolean)
7761
7806
  .join(" "), style: colorStyle, onChange: handleChange, children: jsxRuntime.jsxs(react.Switch.Content, { children: [jsxRuntime.jsx(react.Switch.Control, { children: jsxRuntime.jsx(react.Switch.Thumb, {}) }), children] }) }));
7762
7807
  };
7808
+ SwitchFacade.displayName = "Aurora.Switch";
7809
+ /**
7810
+ * `Switch` de Aurora: fachada v2 + estáticos compound de v3 (`Switch.Content`, `Switch.Control`,
7811
+ * `Switch.Thumb`, `Switch.Icon`), los mismos objetos que exporta `@heroui/react`.
7812
+ */
7813
+ const Switch = Object.assign(SwitchFacade, {
7814
+ Content: react.Switch.Content,
7815
+ Control: react.Switch.Control,
7816
+ Thumb: react.Switch.Thumb,
7817
+ Icon: react.Switch.Icon,
7818
+ });
7763
7819
 
7764
7820
  // TECH-2459 · F3 · G1-forms — cierre del "ajuste fino de estilo" que F2 dejó pendiente
7765
7821
  // explícitamente (ver el comentario anterior de este fichero). `TimeField.Group` ES
@@ -8805,20 +8861,6 @@ const useAuraToast = () => {
8805
8861
  return context;
8806
8862
  };
8807
8863
 
8808
- // TECH-2459 · G2-overlays-nav — v3 trae un `Toast` nativo con cola/posicionamiento/auto-dismiss
8809
- // propios (`Toast.Provider` + el singleton `toast.success()/danger()/...`, ver `toast/index.d.ts`),
8810
- // pero está construido sobre la cola de react-aria-components (`UNSTABLE_ToastQueue`): montar el
8811
- // `Toast` root fuera de esa cola no es viable (su `toast` prop exige el objeto interno de la cola).
8812
- // Decisión conservadora (ver findings/decisiones-aceptadas-g2.md): la fachada pública
8813
- // (`useAuraToast`/`showToast`/`hideToast`, estado único con `isVisible`) NO CAMBIA — se mantiene
8814
- // tal cual estaba, sin adoptar la cola imperativa de v3. Por dentro, se tira el posicionamiento
8815
- // manual a mano y se usan las clases REALES de `toastVariants` (mismo helper que usa el `Toast`
8816
- // nativo) para que el toast luzca igual que cualquier otro de v3, sin reimplementar su CSS.
8817
- //
8818
- // v3 solo trae 5 variantes semánticas (accent/danger/default/success/warning, sin "primary" ni
8819
- // "secondary" de marca — mismo caso que Avatar/Spinner). `primary` se mapea a "accent" (= token
8820
- // `--color-primary` vía F1, decisiones-aceptadas-f1.md D-F1-3). `secondary` no tiene variante
8821
- // nativa: se parte de "default" y se recolorea el título/indicador con el token propio de Aurora.
8822
8864
  const VARIANT_BY_COLOR = {
8823
8865
  primary: "accent",
8824
8866
  secondary: "default",
@@ -8852,6 +8894,56 @@ const CLOSE_BY_COLOR = {
8852
8894
  danger: "text-danger-500 hover:bg-danger-200",
8853
8895
  default: "text-default-400 hover:bg-default-200",
8854
8896
  };
8897
+ // TECH-2459 · Indicador de estado — REPUESTO el 8-sep-2026 por decisión del usuario, a partir del
8898
+ // finding `app-loginos-toast-v3-visual.md` (smoke de loginos contra QA, beta.114): con el MISMO
8899
+ // toast (`color="danger"`, login con credenciales inválidas) v2 pintaba un glifo de estado a la
8900
+ // izquierda del texto y v3 no pintaba ninguno, con el título pegado al borde. El comentario que
8901
+ // había aquí decía que el icono no se reponía «porque no forma parte de P-25»: ya no aplica.
8902
+ //
8903
+ // Vía elegida: los MISMOS componentes de icono que v3 usa para el estado
8904
+ // (`InfoIcon`/`SuccessIcon`/`WarningIcon`/`DangerIcon`, exportados por `@heroui/react`), con el
8905
+ // mismo reparto por estado que hace su `getDefaultIcon()` — el de `alert.js` y el de `toast.js`
8906
+ // son idénticos. Así el glifo del toast es literalmente el que hoy muestra `<Alert color="…">` de
8907
+ // la fachada Aurora, no un equivalente parecido.
8908
+ //
8909
+ // Por qué NO se reutiliza `Alert.Indicator` (medido en el navegador, no supuesto): `AlertIndicator`
8910
+ // lee `status` de `AlertContext` con `use(...)` (`alert.js`), así que FUERA de un `Alert` root ese
8911
+ // contexto llega vacío y su `switch` cae siempre en la rama por defecto. Renderizado dentro de
8912
+ // este toast pintaba el círculo de INFORMACIÓN en los cinco colores (danger/success/warning/
8913
+ // primary/secondary, comprobado uno a uno por el `path` del SVG) — tercer caso de un slot de v3
8914
+ // que se comporta mal fuera de su contexto, junto a `slots.close()` y al `pointer-events` de más
8915
+ // abajo.
8916
+ const ICON_BY_VARIANT = {
8917
+ accent: react.InfoIcon,
8918
+ danger: react.DangerIcon,
8919
+ default: react.InfoIcon,
8920
+ success: react.SuccessIcon,
8921
+ warning: react.WarningIcon,
8922
+ };
8923
+ // Color del glifo: los literales del `tv` de v2 (`alert.js`, `colorVariants.flat.<color>`), que
8924
+ // son los mismos que ya usa la fachada `Alert` (su mapa `FLAT_BASE`), porque en v2 el icono era
8925
+ // `fill-current` y heredaba el color del texto del alert. Hace falta declararlo estado a estado y
8926
+ // no vale con dejar que herede de v3: `.toast__indicator` solo tiñe success/warning/danger, y su
8927
+ // base es `text-overlay-foreground` (= `--foreground`, medido `oklch(0.9911 0 0)` en oscuro), o
8928
+ // sea que un toast `primary`/`secondary`/`default` pintaría un glifo NEUTRO (blanco en oscuro,
8929
+ // gris oscuro en claro) en vez del color del estado — se ve, pero no es el icono de v2.
8930
+ // `secondary` se trata como en el resto del fichero: v3 no tiene esa variante de marca (se parte
8931
+ // de "default"), así que se recolorea con el token propio de Aurora.
8932
+ const ICON_BY_COLOR = {
8933
+ primary: "text-primary-600",
8934
+ secondary: "text-secondary-600",
8935
+ success: "text-success-700 dark:text-success",
8936
+ warning: "text-warning-700 dark:text-warning",
8937
+ danger: "text-danger-600 dark:text-danger-500",
8938
+ default: "text-default-foreground",
8939
+ };
8940
+ // Geometría del hueco del icono en v2 (slot `iconWrapper`: `flex-none relative w-9 h-9
8941
+ // rounded-full grid place-items-center`, con el glifo a `w-6`). El toast de v2 pasaba
8942
+ // `hideIconWrapper`, que solo dejaba transparente el círculo (`!bg-transparent !shadow-none
8943
+ // !border-none`) sin ocultar el glifo, así que aquí se repone la caja de 36 px y el glifo de
8944
+ // 24 px, sin fondo ni borde. `p-0` y `[&_svg]:size-6` anulan el `p-1` + icono de 16 px de
8945
+ // `.toast__indicator`; son utilidades, así que ganan a la capa `components` de `@heroui/styles`.
8946
+ const INDICATOR_BASE = "size-9 p-0 [&_svg]:size-6 [&_svg]:fill-current";
8855
8947
  const DEFAULT_TRANSLATIONS$6 = {
8856
8948
  closeButtonAriaLabel: "Cerrar notificación",
8857
8949
  };
@@ -8867,7 +8959,8 @@ function GlobalToast({ translations = {} } = {}) {
8867
8959
  // en `top-4 right-4`); con el default "bottom" se colaba un `bottom: 0` sin sentido aquí.
8868
8960
  const slots = react.toastVariants({ placement: "top end", variant });
8869
8961
  const isSecondary = color === "secondary";
8870
- return (jsxRuntime.jsx("div", { className: "fixed top-4 right-4 z-[2000] w-full max-w-sm", children: jsxRuntime.jsxs("div", { className: react.cn(slots.toast(), "rounded-[12px]", SURFACE_BY_COLOR[color]), "data-frontmost": "true", style: { position: "relative" }, children: [jsxRuntime.jsxs("div", { className: slots.content(), children: [jsxRuntime.jsx("div", { className: slots.title(), style: isSecondary ? { color: "var(--color-secondary-600)" } : undefined, children: toast.title }), toast.description && (jsxRuntime.jsx("div", { className: slots.description(), children: toast.description }))] }), jsxRuntime.jsx(react.CloseButton, { "aria-label": t.closeButtonAriaLabel, className: react.cn("shrink-0 self-center bg-transparent", CLOSE_BY_COLOR[color]), onPress: hideToast })] }) }));
8962
+ const StatusIcon = ICON_BY_VARIANT[variant];
8963
+ return (jsxRuntime.jsx("div", { className: "fixed top-4 right-4 z-[2000] w-full max-w-sm", children: jsxRuntime.jsxs("div", { className: react.cn(slots.toast(), "gap-x-0 rounded-[12px]", SURFACE_BY_COLOR[color]), "data-frontmost": "true", style: { position: "relative" }, children: [jsxRuntime.jsx("div", { className: react.cn(slots.indicator(), INDICATOR_BASE, ICON_BY_COLOR[color]), children: jsxRuntime.jsx(StatusIcon, {}) }), jsxRuntime.jsxs("div", { className: react.cn(slots.content(), "ms-2 box-border min-h-10 justify-center"), children: [jsxRuntime.jsx("div", { className: slots.title(), style: isSecondary ? { color: "var(--color-secondary-600)" } : undefined, children: toast.title }), toast.description && (jsxRuntime.jsx("div", { className: slots.description(), children: toast.description }))] }), jsxRuntime.jsx(react.CloseButton, { "aria-label": t.closeButtonAriaLabel, className: react.cn("shrink-0 self-center bg-transparent", CLOSE_BY_COLOR[color]), onPress: hideToast })] }) }));
8871
8964
  }
8872
8965
 
8873
8966
  /**
@@ -14210,6 +14303,21 @@ function removeLindaTones(style) {
14210
14303
  }
14211
14304
  }
14212
14305
 
14306
+ /**
14307
+ * Deja en el `<html>` la clase del pack `theme` y ninguna otra de {@link ALL_THEMES}.
14308
+ *
14309
+ * El DOM se escribe SÍNCRONAMENTE y no se delega el `add` a un efecto de React a propósito:
14310
+ * cuando una app reaplica el pack que ya estaba (tema de sesión + brand-config asíncrono con
14311
+ * el mismo valor), el `setState` recibe un valor idéntico, React hace bail-out y el efecto no
14312
+ * vuelve a correr. Con el `remove` aquí y el `add` allí, ese caso dejaba el `<html>` sin clase
14313
+ * de tema y `--color-primary` caía al azul base del `@theme static`. Quitar y añadir juntas
14314
+ * hace la función idempotente por construcción.
14315
+ */
14316
+ function applyThemeClass(root, theme) {
14317
+ root.classList.remove(...ALL_THEMES);
14318
+ root.classList.add(theme);
14319
+ }
14320
+
14213
14321
  /**
14214
14322
  * Clave de `localStorage` donde HeroUI v2 persistía el tema. Se conserva LITERAL: hay
14215
14323
  * usuarios con el valor ya guardado y `force-light-only-theme.ts` la lee para normalizarlo.
@@ -14256,14 +14364,17 @@ const useThemeManager = () => {
14256
14364
  forceLightOnlyThemeBeforeReact();
14257
14365
  }, []);
14258
14366
  const setTheme = $8WNJc$react.useCallback((theme) => {
14259
- const html = document.documentElement;
14260
- html.classList.remove(...ALL_THEMES);
14367
+ /*
14368
+ * La clase queda puesta YA, sin esperar al efecto de abajo: si `theme` es igual al
14369
+ * que ya había, React hace bail-out, el efecto no corre y el `<html>` se quedaría
14370
+ * sin clase de tema (ver `apply-theme-class.ts`).
14371
+ */
14372
+ applyThemeClass(document.documentElement, theme);
14261
14373
  setRawTheme(theme);
14262
14374
  }, [setRawTheme]);
14375
+ /** Cubre el montaje inicial y cualquier cambio de `rawTheme` ajeno a `setTheme`. */
14263
14376
  $8WNJc$react.useEffect(() => {
14264
- const html = document.documentElement;
14265
- html.classList.remove(...ALL_THEMES);
14266
- html.classList.add(rawTheme);
14377
+ applyThemeClass(document.documentElement, rawTheme);
14267
14378
  }, [rawTheme]);
14268
14379
  const { mode, color } = $8WNJc$react.useMemo(() => {
14269
14380
  const parts = rawTheme.split("-");
@@ -14542,10 +14653,6 @@ Object.defineProperty(exports, "Spinner", {
14542
14653
  enumerable: true,
14543
14654
  get: function () { return react.Spinner; }
14544
14655
  });
14545
- Object.defineProperty(exports, "Switch", {
14546
- enumerable: true,
14547
- get: function () { return react.Switch; }
14548
- });
14549
14656
  Object.defineProperty(exports, "Tab", {
14550
14657
  enumerable: true,
14551
14658
  get: function () { return react.Tab; }
@@ -14674,6 +14781,7 @@ exports.SocialMediaCarousel = SocialMediaCarousel;
14674
14781
  exports.SocialMediaPreview = SocialMediaPreview;
14675
14782
  exports.StatTile = StatTile;
14676
14783
  exports.StepIndicator = StepIndicator;
14784
+ exports.Switch = Switch;
14677
14785
  exports.SwitchComponent = Switch;
14678
14786
  exports.THEME_COLOR_HEX_MAP = THEME_COLOR_HEX_MAP;
14679
14787
  exports.TagsFilter = TagsFilter;
package/dist/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
- import { Card as Card$1, Breadcrumbs, ListBoxSection, ListBoxItem, Separator, ProgressBar, useOverlayState, Spinner, Button as Button$1, Chip as Chip$1, cn, CloseButton, Pagination as Pagination$1, Skeleton, Accordion, DatePicker as DatePicker$1, Label, DateField, Description, Calendar, FieldError, DateRangePicker as DateRangePicker$1, RangeCalendar, TextField, InputGroup, RadioGroup, Radio, Tabs, Dropdown, ComboBox, Input as Input$1, ListBox, Tooltip as Tooltip$2, DropdownTrigger, DropdownPopover, DropdownMenu, DropdownSection, DropdownItem, Badge as Badge$1, Popover, PopoverTrigger, PopoverContent, Header, Avatar, Link, Switch as Switch$1, TimeField, Select as Select$1, Table, TextArea, toastVariants, Modal as Modal$1, Slider, Drawer, Checkbox as Checkbox$1, ModalHeader as ModalHeader$1, ModalBody as ModalBody$1, ModalFooter as ModalFooter$1, Alert as Alert$1 } from '@heroui/react';
2
- export { Accordion, AccordionItem, Avatar, Breadcrumbs, CardFooter, CardHeader, CheckboxGroup, CloseButton, Drawer, DrawerBody, DrawerContent, DrawerFooter, DrawerHeader, Dropdown, DropdownItem, DropdownMenu, DropdownSection, DropdownTrigger, Link, Popover, PopoverContent, PopoverTrigger, Radio, RadioGroup, Skeleton, Slider, Spinner, Switch, Tab, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow, Tabs, cn } from '@heroui/react';
1
+ import { Card as Card$1, Breadcrumbs, ListBoxSection, ListBoxItem, Separator, ProgressBar, useOverlayState, Spinner, Button as Button$1, Chip as Chip$1, cn, CloseButton, Pagination as Pagination$1, Skeleton, Accordion, DatePicker as DatePicker$1, Label, DateField, Description, Calendar, FieldError, DateRangePicker as DateRangePicker$1, RangeCalendar, TextField, InputGroup, RadioGroup, Radio, Tabs, Dropdown, ComboBox, Input as Input$1, ListBox, Tooltip as Tooltip$2, DropdownTrigger, DropdownPopover, DropdownMenu, DropdownSection, DropdownItem, Badge as Badge$1, Popover, PopoverTrigger, PopoverContent, Header, Avatar, Link, Switch as Switch$1, TimeField, Select as Select$1, Table, TextArea, toastVariants, WarningIcon, SuccessIcon, InfoIcon, DangerIcon, Modal as Modal$1, Slider, Drawer, Checkbox as Checkbox$1, ModalHeader as ModalHeader$1, ModalBody as ModalBody$1, ModalFooter as ModalFooter$1, Alert as Alert$1 } from '@heroui/react';
2
+ export { Accordion, AccordionItem, Avatar, Breadcrumbs, CardFooter, CardHeader, CheckboxGroup, CloseButton, Drawer, DrawerBody, DrawerContent, DrawerFooter, DrawerHeader, Dropdown, DropdownItem, DropdownMenu, DropdownSection, DropdownTrigger, Link, Popover, PopoverContent, PopoverTrigger, Radio, RadioGroup, Skeleton, Slider, Spinner, Tab, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow, Tabs, cn } from '@heroui/react';
3
3
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
4
- import $8WNJc$react, { useState, useRef, useCallback, useEffect, useId, useMemo, isValidElement, cloneElement, forwardRef, useImperativeHandle, createContext, useContext, useLayoutEffect, memo, useReducer, Fragment as Fragment$1, Children } from 'react';
4
+ import $8WNJc$react, { useState, useRef, useCallback, useEffect, useId, useMemo, isValidElement, cloneElement, forwardRef, useImperativeHandle, createContext, useContext, useLayoutEffect, memo, useReducer, Children, Fragment as Fragment$1 } from 'react';
5
5
  import { Icon } from '@iconify/react';
6
6
  export { loadIcons } from '@iconify/react';
7
7
  import { ResponsiveContainer, AreaChart, CartesianGrid, XAxis, Tooltip as Tooltip$1, Area, LineChart, YAxis, Line, PieChart, Pie, Cell } from 'recharts';
@@ -7666,6 +7666,19 @@ class $2aaf608024c21ca1$export$ca871e8dbb80966f {
7666
7666
  }
7667
7667
  }
7668
7668
 
7669
+ // TECH-2459 (08-sep-2026, a petición de la sesión de backoffice) — esta fachada pasa a ocupar el
7670
+ // nombre público `Switch`. Antes existía igual, pero `src/components/switch/index.ts` la publicaba
7671
+ // como `SwitchComponent` y el nombre bueno lo servía `src/index.tsx` reexportando el `Switch`
7672
+ // CRUDO de v3: el mismo FALSO AMIGO que Alert y Checkbox en la beta.112 — el símbolo resolvía, el
7673
+ // JSX v2 de las apps (`isSelected` + `onValueChange` + `color` + children como label) compilaba
7674
+ // contra el tipo de v3 en lo que coincidía, y en pantalla salía otro componente (o ninguno: el
7675
+ // crudo no pinta pista ni thumb si no le pasas los subcomponentes). Impacto medido por grep real:
7676
+ // 3 ficheros en backoffice-beweos, 39 en beweossmbs, 2 en beweosagency, 0 en loginos.
7677
+ //
7678
+ // `SwitchComponent` se conserva como ALIAS del mismo objeto (backoffice y `schedule-row` de esta
7679
+ // misma librería lo importan por ese nombre), y los subcomponentes compound de v3 quedan colgados
7680
+ // como estáticos al final del fichero, igual que en `Alert`/`Checkbox`.
7681
+ //
7669
7682
  // TECH-2459 · F3 · G1-forms — v3 convierte Switch en compound (Root > Content > Control > Thumb)
7670
7683
  // y quita `color` (usar Tailwind, ver guía oficial `switch`). El estado activado ya usa
7671
7684
  // `--switch-control-bg-checked: var(--accent)` (= --color-primary vía F1), así que "primary" no
@@ -7729,13 +7742,38 @@ const COLOR_VAR = {
7729
7742
  * como CAMBIO-V3 en `vrt/classification-overrides.json`, con las cifras en
7730
7743
  * `.bewe/epics/TECH-2459/findings/p6-switch-aspecto-v3.md`.
7731
7744
  */
7745
+ // Los subcomponentes compound de v3, adjuntos como estáticos para que la API v3 siga funcionando a
7746
+ // través de la fachada (`<Switch><Switch.Content><Switch.Control><Switch.Thumb/>…`). `Root` se deja
7747
+ // FUERA a propósito (mismo criterio que `Alert` y `Checkbox`): la raíz de v3 es justo la pieza que
7748
+ // esta fachada envuelve, así que exponerla colgada del nombre público sería servir el crudo otra
7749
+ // vez, con la apariencia de formar parte de la fachada. Ninguna app usa hoy el compound del Switch
7750
+ // (grep en los 4 repos: 0 usos de `Switch.Root`/`Content`/`Control`/`Thumb`/`Icon`); esto es
7751
+ // garantía de futuro, igual que en `Alert` — donde loginos SÍ había migrado su JSX.
7752
+ const COMPOUND_PARTS$2 = new Set([
7753
+ Switch$1.Content,
7754
+ Switch$1.Control,
7755
+ Switch$1.Thumb,
7756
+ Switch$1.Icon,
7757
+ ]);
7758
+ /**
7759
+ * Detecta la API compound de v3 por hijos directos: si el consumidor ya compone la estructura, la
7760
+ * fachada NO debe envolver nada (si lo hiciera saldrían dos pistas). `<Switch>Etiqueta</Switch>`
7761
+ * (sin partes compound) sigue siendo API v2: children como label.
7762
+ */
7763
+ function hasCompoundChildren$2(children) {
7764
+ return Children.toArray(children).some((child) => isValidElement(child) && COMPOUND_PARTS$2.has(child.type));
7765
+ }
7732
7766
  /**
7733
7767
  * Switch genérico basado en HeroUI v3 (TECH-2459 · F3 · G1-forms).
7734
7768
  *
7735
- * La API pública v2 (children como label, `isSelected`, `onValueChange`, `color`) se conserva
7736
- * intacta; por dentro compone `Switch.Content`/`Switch.Control`/`Switch.Thumb`.
7769
+ * Dos modos, decididos por los `children`:
7770
+ * - **API v2** (`children` como label, `isSelected`/`defaultSelected`, `onValueChange`, `color`,
7771
+ * `size`): la fachada compone `Switch.Content`/`Switch.Control`/`Switch.Thumb` por dentro y
7772
+ * repone `color` pisando `--switch-control-bg-checked`.
7773
+ * - **API compound v3** (`<Switch><Switch.Content>…`): pasa los children tal cual a la raíz de
7774
+ * HeroUI, sin geometría ni colocación propias.
7737
7775
  */
7738
- const Switch = ({ id, size = "md", color = "primary", children, onChange, onValueChange, className, style, ...props }) => {
7776
+ const SwitchFacade = ({ id, size = "md", color, children, onChange, onValueChange, className, style, ...props }) => {
7739
7777
  const generatedId = useId();
7740
7778
  const autoId = id || generatedId;
7741
7779
  const handleChange = (isSelected) => {
@@ -7745,9 +7783,16 @@ const Switch = ({ id, size = "md", color = "primary", children, onChange, onValu
7745
7783
  const colorStyle = {
7746
7784
  // Solo el color del estado ENCENDIDO, y solo porque sostiene la prop `color` de la API v2
7747
7785
  // (ver el bloque de arriba). El apagado lo pinta v3 con su propio `--default`.
7748
- "--switch-control-bg-checked": COLOR_VAR[color],
7786
+ "--switch-control-bg-checked": COLOR_VAR[color ?? "primary"],
7749
7787
  ...style,
7750
7788
  };
7789
+ if (hasCompoundChildren$2(children)) {
7790
+ return (jsx(Switch$1, { ...props, id: autoId, size: size, className: className,
7791
+ // `color` es prop v2 y en compound manda el JSX del consumidor, así que solo se pisa
7792
+ // el token si lo pasó EXPLÍCITAMENTE (mismo criterio que `Alert`, que traduce `color`
7793
+ // a `status` también en compound). Sin `color`, el encendido es el `--accent` de v3.
7794
+ style: color === undefined ? style : colorStyle, onChange: handleChange, children: children }));
7795
+ }
7751
7796
  return (jsx(Switch$1, { ...props, id: autoId, size: size,
7752
7797
  // COLOCACIÓN, no aspecto (ver el bloque de arriba): v3 usa `flex flex-col items-start`
7753
7798
  // para poder apilar `description`/`field-error`, slots que esta fachada no renderiza.
@@ -7760,6 +7805,17 @@ const Switch = ({ id, size = "md", color = "primary", children, onChange, onValu
7760
7805
  .filter(Boolean)
7761
7806
  .join(" "), style: colorStyle, onChange: handleChange, children: jsxs(Switch$1.Content, { children: [jsx(Switch$1.Control, { children: jsx(Switch$1.Thumb, {}) }), children] }) }));
7762
7807
  };
7808
+ SwitchFacade.displayName = "Aurora.Switch";
7809
+ /**
7810
+ * `Switch` de Aurora: fachada v2 + estáticos compound de v3 (`Switch.Content`, `Switch.Control`,
7811
+ * `Switch.Thumb`, `Switch.Icon`), los mismos objetos que exporta `@heroui/react`.
7812
+ */
7813
+ const Switch = Object.assign(SwitchFacade, {
7814
+ Content: Switch$1.Content,
7815
+ Control: Switch$1.Control,
7816
+ Thumb: Switch$1.Thumb,
7817
+ Icon: Switch$1.Icon,
7818
+ });
7763
7819
 
7764
7820
  // TECH-2459 · F3 · G1-forms — cierre del "ajuste fino de estilo" que F2 dejó pendiente
7765
7821
  // explícitamente (ver el comentario anterior de este fichero). `TimeField.Group` ES
@@ -8805,20 +8861,6 @@ const useAuraToast = () => {
8805
8861
  return context;
8806
8862
  };
8807
8863
 
8808
- // TECH-2459 · G2-overlays-nav — v3 trae un `Toast` nativo con cola/posicionamiento/auto-dismiss
8809
- // propios (`Toast.Provider` + el singleton `toast.success()/danger()/...`, ver `toast/index.d.ts`),
8810
- // pero está construido sobre la cola de react-aria-components (`UNSTABLE_ToastQueue`): montar el
8811
- // `Toast` root fuera de esa cola no es viable (su `toast` prop exige el objeto interno de la cola).
8812
- // Decisión conservadora (ver findings/decisiones-aceptadas-g2.md): la fachada pública
8813
- // (`useAuraToast`/`showToast`/`hideToast`, estado único con `isVisible`) NO CAMBIA — se mantiene
8814
- // tal cual estaba, sin adoptar la cola imperativa de v3. Por dentro, se tira el posicionamiento
8815
- // manual a mano y se usan las clases REALES de `toastVariants` (mismo helper que usa el `Toast`
8816
- // nativo) para que el toast luzca igual que cualquier otro de v3, sin reimplementar su CSS.
8817
- //
8818
- // v3 solo trae 5 variantes semánticas (accent/danger/default/success/warning, sin "primary" ni
8819
- // "secondary" de marca — mismo caso que Avatar/Spinner). `primary` se mapea a "accent" (= token
8820
- // `--color-primary` vía F1, decisiones-aceptadas-f1.md D-F1-3). `secondary` no tiene variante
8821
- // nativa: se parte de "default" y se recolorea el título/indicador con el token propio de Aurora.
8822
8864
  const VARIANT_BY_COLOR = {
8823
8865
  primary: "accent",
8824
8866
  secondary: "default",
@@ -8852,6 +8894,56 @@ const CLOSE_BY_COLOR = {
8852
8894
  danger: "text-danger-500 hover:bg-danger-200",
8853
8895
  default: "text-default-400 hover:bg-default-200",
8854
8896
  };
8897
+ // TECH-2459 · Indicador de estado — REPUESTO el 8-sep-2026 por decisión del usuario, a partir del
8898
+ // finding `app-loginos-toast-v3-visual.md` (smoke de loginos contra QA, beta.114): con el MISMO
8899
+ // toast (`color="danger"`, login con credenciales inválidas) v2 pintaba un glifo de estado a la
8900
+ // izquierda del texto y v3 no pintaba ninguno, con el título pegado al borde. El comentario que
8901
+ // había aquí decía que el icono no se reponía «porque no forma parte de P-25»: ya no aplica.
8902
+ //
8903
+ // Vía elegida: los MISMOS componentes de icono que v3 usa para el estado
8904
+ // (`InfoIcon`/`SuccessIcon`/`WarningIcon`/`DangerIcon`, exportados por `@heroui/react`), con el
8905
+ // mismo reparto por estado que hace su `getDefaultIcon()` — el de `alert.js` y el de `toast.js`
8906
+ // son idénticos. Así el glifo del toast es literalmente el que hoy muestra `<Alert color="…">` de
8907
+ // la fachada Aurora, no un equivalente parecido.
8908
+ //
8909
+ // Por qué NO se reutiliza `Alert.Indicator` (medido en el navegador, no supuesto): `AlertIndicator`
8910
+ // lee `status` de `AlertContext` con `use(...)` (`alert.js`), así que FUERA de un `Alert` root ese
8911
+ // contexto llega vacío y su `switch` cae siempre en la rama por defecto. Renderizado dentro de
8912
+ // este toast pintaba el círculo de INFORMACIÓN en los cinco colores (danger/success/warning/
8913
+ // primary/secondary, comprobado uno a uno por el `path` del SVG) — tercer caso de un slot de v3
8914
+ // que se comporta mal fuera de su contexto, junto a `slots.close()` y al `pointer-events` de más
8915
+ // abajo.
8916
+ const ICON_BY_VARIANT = {
8917
+ accent: InfoIcon,
8918
+ danger: DangerIcon,
8919
+ default: InfoIcon,
8920
+ success: SuccessIcon,
8921
+ warning: WarningIcon,
8922
+ };
8923
+ // Color del glifo: los literales del `tv` de v2 (`alert.js`, `colorVariants.flat.<color>`), que
8924
+ // son los mismos que ya usa la fachada `Alert` (su mapa `FLAT_BASE`), porque en v2 el icono era
8925
+ // `fill-current` y heredaba el color del texto del alert. Hace falta declararlo estado a estado y
8926
+ // no vale con dejar que herede de v3: `.toast__indicator` solo tiñe success/warning/danger, y su
8927
+ // base es `text-overlay-foreground` (= `--foreground`, medido `oklch(0.9911 0 0)` en oscuro), o
8928
+ // sea que un toast `primary`/`secondary`/`default` pintaría un glifo NEUTRO (blanco en oscuro,
8929
+ // gris oscuro en claro) en vez del color del estado — se ve, pero no es el icono de v2.
8930
+ // `secondary` se trata como en el resto del fichero: v3 no tiene esa variante de marca (se parte
8931
+ // de "default"), así que se recolorea con el token propio de Aurora.
8932
+ const ICON_BY_COLOR = {
8933
+ primary: "text-primary-600",
8934
+ secondary: "text-secondary-600",
8935
+ success: "text-success-700 dark:text-success",
8936
+ warning: "text-warning-700 dark:text-warning",
8937
+ danger: "text-danger-600 dark:text-danger-500",
8938
+ default: "text-default-foreground",
8939
+ };
8940
+ // Geometría del hueco del icono en v2 (slot `iconWrapper`: `flex-none relative w-9 h-9
8941
+ // rounded-full grid place-items-center`, con el glifo a `w-6`). El toast de v2 pasaba
8942
+ // `hideIconWrapper`, que solo dejaba transparente el círculo (`!bg-transparent !shadow-none
8943
+ // !border-none`) sin ocultar el glifo, así que aquí se repone la caja de 36 px y el glifo de
8944
+ // 24 px, sin fondo ni borde. `p-0` y `[&_svg]:size-6` anulan el `p-1` + icono de 16 px de
8945
+ // `.toast__indicator`; son utilidades, así que ganan a la capa `components` de `@heroui/styles`.
8946
+ const INDICATOR_BASE = "size-9 p-0 [&_svg]:size-6 [&_svg]:fill-current";
8855
8947
  const DEFAULT_TRANSLATIONS$6 = {
8856
8948
  closeButtonAriaLabel: "Cerrar notificación",
8857
8949
  };
@@ -8867,7 +8959,8 @@ function GlobalToast({ translations = {} } = {}) {
8867
8959
  // en `top-4 right-4`); con el default "bottom" se colaba un `bottom: 0` sin sentido aquí.
8868
8960
  const slots = toastVariants({ placement: "top end", variant });
8869
8961
  const isSecondary = color === "secondary";
8870
- return (jsx("div", { className: "fixed top-4 right-4 z-[2000] w-full max-w-sm", children: jsxs("div", { className: cn(slots.toast(), "rounded-[12px]", SURFACE_BY_COLOR[color]), "data-frontmost": "true", style: { position: "relative" }, children: [jsxs("div", { className: slots.content(), children: [jsx("div", { className: slots.title(), style: isSecondary ? { color: "var(--color-secondary-600)" } : undefined, children: toast.title }), toast.description && (jsx("div", { className: slots.description(), children: toast.description }))] }), jsx(CloseButton, { "aria-label": t.closeButtonAriaLabel, className: cn("shrink-0 self-center bg-transparent", CLOSE_BY_COLOR[color]), onPress: hideToast })] }) }));
8962
+ const StatusIcon = ICON_BY_VARIANT[variant];
8963
+ return (jsx("div", { className: "fixed top-4 right-4 z-[2000] w-full max-w-sm", children: jsxs("div", { className: cn(slots.toast(), "gap-x-0 rounded-[12px]", SURFACE_BY_COLOR[color]), "data-frontmost": "true", style: { position: "relative" }, children: [jsx("div", { className: cn(slots.indicator(), INDICATOR_BASE, ICON_BY_COLOR[color]), children: jsx(StatusIcon, {}) }), jsxs("div", { className: cn(slots.content(), "ms-2 box-border min-h-10 justify-center"), children: [jsx("div", { className: slots.title(), style: isSecondary ? { color: "var(--color-secondary-600)" } : undefined, children: toast.title }), toast.description && (jsx("div", { className: slots.description(), children: toast.description }))] }), jsx(CloseButton, { "aria-label": t.closeButtonAriaLabel, className: cn("shrink-0 self-center bg-transparent", CLOSE_BY_COLOR[color]), onPress: hideToast })] }) }));
8871
8964
  }
8872
8965
 
8873
8966
  /**
@@ -14210,6 +14303,21 @@ function removeLindaTones(style) {
14210
14303
  }
14211
14304
  }
14212
14305
 
14306
+ /**
14307
+ * Deja en el `<html>` la clase del pack `theme` y ninguna otra de {@link ALL_THEMES}.
14308
+ *
14309
+ * El DOM se escribe SÍNCRONAMENTE y no se delega el `add` a un efecto de React a propósito:
14310
+ * cuando una app reaplica el pack que ya estaba (tema de sesión + brand-config asíncrono con
14311
+ * el mismo valor), el `setState` recibe un valor idéntico, React hace bail-out y el efecto no
14312
+ * vuelve a correr. Con el `remove` aquí y el `add` allí, ese caso dejaba el `<html>` sin clase
14313
+ * de tema y `--color-primary` caía al azul base del `@theme static`. Quitar y añadir juntas
14314
+ * hace la función idempotente por construcción.
14315
+ */
14316
+ function applyThemeClass(root, theme) {
14317
+ root.classList.remove(...ALL_THEMES);
14318
+ root.classList.add(theme);
14319
+ }
14320
+
14213
14321
  /**
14214
14322
  * Clave de `localStorage` donde HeroUI v2 persistía el tema. Se conserva LITERAL: hay
14215
14323
  * usuarios con el valor ya guardado y `force-light-only-theme.ts` la lee para normalizarlo.
@@ -14256,14 +14364,17 @@ const useThemeManager = () => {
14256
14364
  forceLightOnlyThemeBeforeReact();
14257
14365
  }, []);
14258
14366
  const setTheme = useCallback((theme) => {
14259
- const html = document.documentElement;
14260
- html.classList.remove(...ALL_THEMES);
14367
+ /*
14368
+ * La clase queda puesta YA, sin esperar al efecto de abajo: si `theme` es igual al
14369
+ * que ya había, React hace bail-out, el efecto no corre y el `<html>` se quedaría
14370
+ * sin clase de tema (ver `apply-theme-class.ts`).
14371
+ */
14372
+ applyThemeClass(document.documentElement, theme);
14261
14373
  setRawTheme(theme);
14262
14374
  }, [setRawTheme]);
14375
+ /** Cubre el montaje inicial y cualquier cambio de `rawTheme` ajeno a `setTheme`. */
14263
14376
  useEffect(() => {
14264
- const html = document.documentElement;
14265
- html.classList.remove(...ALL_THEMES);
14266
- html.classList.add(rawTheme);
14377
+ applyThemeClass(document.documentElement, rawTheme);
14267
14378
  }, [rawTheme]);
14268
14379
  const { mode, color } = useMemo(() => {
14269
14380
  const parts = rawTheme.split("-");
@@ -14434,4 +14545,4 @@ const NavigationLoadingProvider = ({ children, }) => {
14434
14545
  return (jsxs(NavigationLoadingContext.Provider, { value: value, children: [children, jsx(NavigationLoadingOverlay, { isVisible: isVisible })] }));
14435
14546
  };
14436
14547
 
14437
- export { ALL_THEMES, AURORA_THEME_FAMILIES, AURORA_THEME_REGISTRY, AccordionList, AddHolidayForm, Alert, AnalyticsCard, AreaLineChart, AuraAutocomplete, AuraTable, AuraToastProvider, AuraAutocomplete as Autocomplete, AutocompleteItem, BEWEOS_THEME_MODE_COOKIE_NAME, Badge, BreadcrumbItem, BreadcrumbsComponent, Button, CONTAINER_ATTRIBUTE, Card, CardBody, Checkbox, Chip, ColorPicker, ColorSelector, ContentCarousel, Currency, DEFAULT_DONUT_COLORS, DEFAULT_PREDEFINED_COLORS, DEFAULT_RANKED_BAR_COLORS, DISMISS_CONTROL_ATTRIBUTE, DatePicker, DateRangePicker, DateSelector, Divider, DonutChart, DrawerFilters, EmailPreview, EnumMenuNavListItem, GlobalToast, H1, H2, H3, H4, HeaderComponent, HeroUIProvider, HolidayType, IconComponent, Image$1 as Image, ImagePreview, Input, InputPassword, Kanban, KanbanCard, KanbanColumn, LINDA_TONE_PROPERTIES, LindaIcon, MenuClaw, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, Progress, PromotionalBanner, REGISTERED_THEME_COLORS, RangeFilter, RankedBarList, RowSteps, DEFAULT_TRANSLATIONS$2 as SEGMENTATION_DEFAULT_TRANSLATIONS, ScheduleRow, SearchInput, SegmentationBuilder, Select, SelectItem, SelectSection, SimpleLineChart, SocialMediaBar, SocialMediaCarousel, SocialMediaPreview, StatTile, StepIndicator, Switch as SwitchComponent, THEME_COLOR_HEX_MAP, TagsFilter, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput, TimeInput as TimeInputComponent, ToastContext, Tooltip, TwoColumnLayoutAgent, UploadFile, VerticalSteps, ViolinPlot, WhatsAppPreview, Wizard, WizardNavigation, WizardSidebar, applyCustomPrimaryColor, applyLindaTones, computeBars, computeMax, computeSlices, computeTotal, containerProps, createCurrencyFormatter, uniqueCountries as defaultCountries, defaultCurrencyOptions, defaultTranslations$5 as defaultTranslations, deriveLindaTones, dismissControlProps, forceLightOnlyThemeBeforeReact, formatAuroraThemeTooltip, generateThemeColorScale, getContrastForeground, getRegisteredThemeColorBases, getSelectedKeyFromPath, hexToHsl, hexToThemeColor, hslToCssValue, isAuroraFullThemeId, isDismissControl, isDonutEmpty, isExactThemeColor, isGroupState, isHexColor, isRankedBarListEmpty, isSegmentationGroup, parseColorToHsl, removeCustomPrimaryColor, removeLindaTones, shouldClosePopoverOnInteractOutside, sizeMap, themeColors, useAuraToast, useCloseOnAncestorScroll, useDisclosure, useMediaQuery, useNavigationLoading, useThemeContext };
14548
+ export { ALL_THEMES, AURORA_THEME_FAMILIES, AURORA_THEME_REGISTRY, AccordionList, AddHolidayForm, Alert, AnalyticsCard, AreaLineChart, AuraAutocomplete, AuraTable, AuraToastProvider, AuraAutocomplete as Autocomplete, AutocompleteItem, BEWEOS_THEME_MODE_COOKIE_NAME, Badge, BreadcrumbItem, BreadcrumbsComponent, Button, CONTAINER_ATTRIBUTE, Card, CardBody, Checkbox, Chip, ColorPicker, ColorSelector, ContentCarousel, Currency, DEFAULT_DONUT_COLORS, DEFAULT_PREDEFINED_COLORS, DEFAULT_RANKED_BAR_COLORS, DISMISS_CONTROL_ATTRIBUTE, DatePicker, DateRangePicker, DateSelector, Divider, DonutChart, DrawerFilters, EmailPreview, EnumMenuNavListItem, GlobalToast, H1, H2, H3, H4, HeaderComponent, HeroUIProvider, HolidayType, IconComponent, Image$1 as Image, ImagePreview, Input, InputPassword, Kanban, KanbanCard, KanbanColumn, LINDA_TONE_PROPERTIES, LindaIcon, MenuClaw, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, Progress, PromotionalBanner, REGISTERED_THEME_COLORS, RangeFilter, RankedBarList, RowSteps, DEFAULT_TRANSLATIONS$2 as SEGMENTATION_DEFAULT_TRANSLATIONS, ScheduleRow, SearchInput, SegmentationBuilder, Select, SelectItem, SelectSection, SimpleLineChart, SocialMediaBar, SocialMediaCarousel, SocialMediaPreview, StatTile, StepIndicator, Switch, Switch as SwitchComponent, THEME_COLOR_HEX_MAP, TagsFilter, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput, TimeInput as TimeInputComponent, ToastContext, Tooltip, TwoColumnLayoutAgent, UploadFile, VerticalSteps, ViolinPlot, WhatsAppPreview, Wizard, WizardNavigation, WizardSidebar, applyCustomPrimaryColor, applyLindaTones, computeBars, computeMax, computeSlices, computeTotal, containerProps, createCurrencyFormatter, uniqueCountries as defaultCountries, defaultCurrencyOptions, defaultTranslations$5 as defaultTranslations, deriveLindaTones, dismissControlProps, forceLightOnlyThemeBeforeReact, formatAuroraThemeTooltip, generateThemeColorScale, getContrastForeground, getRegisteredThemeColorBases, getSelectedKeyFromPath, hexToHsl, hexToThemeColor, hslToCssValue, isAuroraFullThemeId, isDismissControl, isDonutEmpty, isExactThemeColor, isGroupState, isHexColor, isRankedBarListEmpty, isSegmentationGroup, parseColorToHsl, removeCustomPrimaryColor, removeLindaTones, shouldClosePopoverOnInteractOutside, sizeMap, themeColors, useAuraToast, useCloseOnAncestorScroll, useDisclosure, useMediaQuery, useNavigationLoading, useThemeContext };
@@ -23,11 +23,11 @@
23
23
  * siguen siendo parte de la superficie v2 que las apps consumen; el smoke test no distingue de
24
24
  * dónde viene cada uno, solo que la API pública del paquete los sigue sirviendo.
25
25
  *
26
- * Símbolo conocido NO cubierto con API v2 a propósito: `Switch` (ver "Brechas conocidas" al final
27
- * de `heroui-v2-shims.tsx`) el nombre resuelve (se importa más abajo solo para probarlo), pero
28
- * su API de props v2 (`isSelected`/`onValueChange`) es tarea de F3 · G1-forms.
26
+ * `Switch` dejó de ser el símbolo "solo resuelve el nombre" el 08-sep-2026: su fachada v2 ya se
27
+ * publica bajo ese nombre (ver el histórico al final de `heroui-v2-shims.tsx`), así que aquí se
28
+ * ejercita con el JSX v2 completo, como Alert y Checkbox.
29
29
  */
30
- import { type AlertProps, type CheckboxProps, type SortDescriptor, Switch, type TextAreaProps } from "../index";
30
+ import { type AlertProps, type CheckboxProps, type SortDescriptor, type SwitchProps, type SwitchPropsComponent, type TextAreaProps } from "../index";
31
31
  /** AuraAutocomplete: API v2 (label, icon, children con AutocompleteItem). */
32
32
  declare function smokeAutocomplete(): import("react").JSX.Element;
33
33
  /** `Autocomplete` crudo (beweosagency, 1 fichero) sigue resolviendo. */
@@ -59,7 +59,32 @@ declare function smokeBreadcrumbs(): import("react").JSX.Element;
59
59
  /** HeroUIProvider (v2, eliminado en v3) — envuelve la raíz de las 4 apps (App.tsx). */
60
60
  declare function smokeHeroUIProvider(): import("react").JSX.Element;
61
61
  declare function smokeProgress(): import("react").JSX.Element;
62
- declare function smokeSwitchNameResolves(): typeof Switch;
62
+ /**
63
+ * Los TRES usos reales de backoffice-beweos, uno a uno (extraídos del tag, no de un grep de
64
+ * líneas vecinas — backoffice no pasa `size` ni `color` en ninguno):
65
+ *
66
+ * 1. `SpecialDateFormModal.tsx:144` — **sin children**, con `aria-label`. El más importante de los
67
+ * tres: fija que la etiqueta es OPCIONAL. Con el `Switch` crudo de v3 este JSX ni compilaba
68
+ * (`onValueChange` no existe) ni pintaba control.
69
+ * 2. `AgencyAcademyUrlModal.tsx:77` — sin children, con `aria-label` + `isDisabled`.
70
+ * 3. `AddonPackageForm.tsx:233` — children de texto como etiqueta, sobre estado de `Controller`.
71
+ */
72
+ declare function smokeSwitchV2Backoffice(value: boolean, onChange: (v: boolean) => void, label: string, isSaving: boolean): import("react").JSX.Element;
73
+ /**
74
+ * Lo que añade beweossmbs (39 ficheros) sobre esos tres patrones: `size="sm"` (el único tamaño que
75
+ * usa), los 5 valores de `color` distintos del default, `isReadOnly` sin handler y `data-testid`.
76
+ */
77
+ declare function smokeSwitchV2Smbs(value: boolean, onChange: (v: boolean) => void): import("react").JSX.Element;
78
+ /** `SwitchProps` exportado y con las props v2 en su forma. */
79
+ declare function smokeSwitchProps(): SwitchProps;
80
+ /**
81
+ * `SwitchComponent`/`SwitchPropsComponent` siguen siendo la MISMA fachada bajo el nombre antiguo:
82
+ * beweossmbs los importa así en 4 ficheros (`finance/…/collection-cart`, `register-expense-modal`,
83
+ * `add-cash-register-modal`), y su test los mockea por ese nombre.
84
+ */
85
+ declare function smokeSwitchLegacyAlias(props: SwitchPropsComponent): import("react").JSX.Element;
86
+ /** Switch con la API compound de v3 a través de la fachada. */
87
+ declare function smokeSwitchV3Compound(): import("react").JSX.Element;
63
88
  /** Selection/SortDescriptor: mismas formas que en v2 (pass-through verificado, no shim real). */
64
89
  declare function smokeCollectionTypes(): {
65
90
  selection: "all";
@@ -106,7 +131,11 @@ export declare const v2ApiSurfaceSmokeTest: {
106
131
  smokeBreadcrumbs: typeof smokeBreadcrumbs;
107
132
  smokeHeroUIProvider: typeof smokeHeroUIProvider;
108
133
  smokeProgress: typeof smokeProgress;
109
- smokeSwitchNameResolves: typeof smokeSwitchNameResolves;
134
+ smokeSwitchV2Backoffice: typeof smokeSwitchV2Backoffice;
135
+ smokeSwitchV2Smbs: typeof smokeSwitchV2Smbs;
136
+ smokeSwitchProps: typeof smokeSwitchProps;
137
+ smokeSwitchLegacyAlias: typeof smokeSwitchLegacyAlias;
138
+ smokeSwitchV3Compound: typeof smokeSwitchV3Compound;
110
139
  smokeCollectionTypes: typeof smokeCollectionTypes;
111
140
  smokeAlertProps: typeof smokeAlertProps;
112
141
  smokeAlertColorUnion: typeof smokeAlertColorUnion;
@@ -1 +1 @@
1
- {"version":3,"file":"v2-api-surface.d.ts","sourceRoot":"","sources":["../../../src/__smoke__/v2-api-surface.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAIN,KAAK,UAAU,EAUf,KAAK,aAAa,EAqBlB,KAAK,cAAc,EACnB,MAAM,EASN,KAAK,aAAa,EAI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import type { SwitchProps } from "./Switch.types";
3
3
  /**
4
- * Switch genérico basado en HeroUI v3 (TECH-2459 · F3 · G1-forms).
5
- *
6
- * La API pública v2 (children como label, `isSelected`, `onValueChange`, `color`) se conserva
7
- * intacta; por dentro compone `Switch.Content`/`Switch.Control`/`Switch.Thumb`.
4
+ * `Switch` de Aurora: fachada v2 + estáticos compound de v3 (`Switch.Content`, `Switch.Control`,
5
+ * `Switch.Thumb`, `Switch.Icon`), los mismos objetos que exporta `@heroui/react`.
8
6
  */
9
- export declare const Switch: React.FC<SwitchProps>;
7
+ export declare const Switch: React.FC<SwitchProps> & {
8
+ Content: {
9
+ ({ children, className, ...props }: import("@heroui/react").SwitchContentProps): import("react/jsx-runtime").JSX.Element;
10
+ displayName: string;
11
+ };
12
+ Control: {
13
+ <E extends keyof React.JSX.IntrinsicElements = "span">({ children, className, ...props }: import("@heroui/react").SwitchControlProps<E> & Omit<React.JSX.IntrinsicElements[E], keyof import("@heroui/react").SwitchControlProps<E>>): import("react/jsx-runtime").JSX.Element;
14
+ displayName: string;
15
+ };
16
+ Thumb: {
17
+ <E extends keyof React.JSX.IntrinsicElements = "span">({ children, className, ...props }: import("@heroui/react").SwitchThumbProps<E> & Omit<React.JSX.IntrinsicElements[E], keyof import("@heroui/react").SwitchThumbProps<E>>): import("react/jsx-runtime").JSX.Element;
18
+ displayName: string;
19
+ };
20
+ Icon: {
21
+ <E extends keyof React.JSX.IntrinsicElements = "span">({ children, className, ...props }: import("@heroui/react").SwitchIconProps<E> & Omit<React.JSX.IntrinsicElements[E], keyof import("@heroui/react").SwitchIconProps<E>>): import("react/jsx-runtime").JSX.Element;
22
+ displayName: string;
23
+ };
24
+ };
10
25
  export default Switch;
11
26
  //# sourceMappingURL=Switch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/components/switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAqE/D;;;;;GAKG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAsDxC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/components/switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAiM/D;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;CAKjB,CAAC;AAEH,eAAe,MAAM,CAAC"}