@william-callao/antonella-ui 1.0.0 → 1.0.1

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.d.ts CHANGED
@@ -21,8 +21,10 @@ interface ButtonProps extends Omit<PressableProps, "style"> {
21
21
  variant?: ButtonVariant;
22
22
  size?: ButtonSize;
23
23
  style?: StyleProp<ViewStyle>;
24
+ /** Muestra un spinner centrado en lugar del label (y deshabilita el botón). */
25
+ loading?: boolean;
24
26
  }
25
- declare function Button({ label, variant, size, style, disabled, android_ripple, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
27
+ declare function Button({ label, variant, size, style, disabled, loading, android_ripple, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
26
28
 
27
29
  interface CalendarProps extends ViewProps {
28
30
  date?: Date;
@@ -47,7 +49,7 @@ interface CardTitleProps {
47
49
  }
48
50
  declare function CardTitle({ title, subtitle, style }: CardTitleProps): react_jsx_runtime.JSX.Element;
49
51
 
50
- type IconName = "home" | "home-filled" | "mail" | "mail-filled" | "calendar" | "calendar-filled" | "bar-chart" | "bar-chart-filled" | "settings" | "settings-filled" | "user" | "user-filled" | "search" | "clipboard" | "clipboard-filled" | "checklist" | "checklist-filled" | "menu" | "close" | "chevron-down" | "chevron-forward" | "chevron-back" | "arrow-back" | "arrow-forward" | "arrow-down" | "arrow-up" | "arrow-up-filled" | "add" | "checkmark" | "pencil" | "trash" | "chevron-up" | "alert-circle" | "checkmark-circle" | "information-circle" | "notifications" | "notifications-filled" | "more-horizontal" | "more-vertical" | "log-in" | "log-out" | "git-network" | "construct" | "chatbubble" | "camera" | "time" | "analytics" | "barn" | "barn-filled" | "farm" | "farm-filled" | "people" | "people-filled" | "document-text" | "document-text-filled" | "backspace" | "palette" | "folder" | "folder-open" | "file" | "loader" | "inbox" | "triangle-alert";
52
+ type IconName = "home" | "home-filled" | "mail" | "mail-filled" | "calendar" | "calendar-filled" | "bar-chart" | "bar-chart-filled" | "settings" | "settings-filled" | "user" | "user-filled" | "search" | "clipboard" | "clipboard-filled" | "checklist" | "checklist-filled" | "menu" | "close" | "chevron-down" | "chevron-forward" | "chevron-back" | "arrow-back" | "arrow-forward" | "arrow-down" | "arrow-up" | "arrow-up-filled" | "add" | "checkmark" | "pencil" | "trash" | "chevron-up" | "alert-circle" | "checkmark-circle" | "information-circle" | "notifications" | "notifications-filled" | "more-horizontal" | "more-vertical" | "log-in" | "log-out" | "git-network" | "construct" | "chatbubble" | "camera" | "time" | "analytics" | "barn" | "barn-filled" | "farm" | "farm-filled" | "people" | "people-filled" | "document-text" | "document-text-filled" | "backspace" | "palette" | "folder" | "folder-open" | "file" | "loader" | "inbox" | "triangle-alert" | "eye" | "eye-off";
51
53
  declare const iconMap: Record<IconName, ComponentType<{
52
54
  size?: number;
53
55
  color?: string;
@@ -146,8 +148,10 @@ type HeaderBarProps = {
146
148
  /** Acción del botón de menú (hamburguesa, lado izquierdo). */
147
149
  onMenuPress?: () => void;
148
150
  menuIcon?: IconName;
151
+ /** Label de accesibilidad del botón izquierdo. */
152
+ accessibilityLabel?: string;
149
153
  };
150
- declare function HeaderBar({ title, description, style, onMenuPress, menuIcon, }: HeaderBarProps): react_jsx_runtime.JSX.Element;
154
+ declare function HeaderBar({ title, description, style, onMenuPress, menuIcon, accessibilityLabel, }: HeaderBarProps): react_jsx_runtime.JSX.Element;
151
155
 
152
156
  declare enum StateMessageType {
153
157
  LOADING = "LOADING",
@@ -221,8 +225,10 @@ type CardStackSheetProps = {
221
225
  children: React.ReactNode;
222
226
  contentStyle?: StyleProp<ViewStyle>;
223
227
  snapPoints?: Array<string | number>;
228
+ /** Color del área semitransparente del sheet (fondo entre y bajo las cards). */
229
+ areaColor?: string;
224
230
  };
225
- declare function CardStackSheet({ visible, onClose, dismissible, children, contentStyle, snapPoints, }: CardStackSheetProps): react_jsx_runtime.JSX.Element;
231
+ declare function CardStackSheet({ visible, onClose, dismissible, children, contentStyle, snapPoints, areaColor, }: CardStackSheetProps): react_jsx_runtime.JSX.Element;
226
232
 
227
233
  declare enum OptionListItemVariant {
228
234
  Default = "default",
@@ -544,8 +550,15 @@ declare function ReverseHeaderCardLayout({ headerBackgroundColor, bodyBackground
544
550
 
545
551
  interface InputProps extends TextInputProps {
546
552
  icon?: IconName;
553
+ /** Estilos aplicados al campo de texto interno (también cuando hay icono/ojito). */
554
+ inputStyle?: StyleProp<TextStyle>;
555
+ /** Muestra el ojito para alternar ver/ocultar en campos `secureTextEntry`. */
556
+ showToggle?: boolean;
557
+ /** Si se define, marca el input con borde rojo y muestra el mensaje debajo
558
+ * (errores de validación previos a consultar el backend). */
559
+ error?: string;
547
560
  }
548
- declare function Input({ style, placeholderTextColor, icon, ...rest }: InputProps): react_jsx_runtime.JSX.Element;
561
+ declare function Input({ style, inputStyle, placeholderTextColor, icon, showToggle, error, secureTextEntry, onFocus, onBlur, ...rest }: InputProps): react_jsx_runtime.JSX.Element;
549
562
 
550
563
  type LayoutRowChildProps = {
551
564
  size?: LayoutRowSize;
package/dist/index.js CHANGED
@@ -237,7 +237,9 @@ var iconMap = {
237
237
  file: import_lucide_react_native.File,
238
238
  loader: import_lucide_react_native.LoaderCircle,
239
239
  inbox: import_lucide_react_native.Inbox,
240
- "triangle-alert": import_lucide_react_native.TriangleAlert
240
+ "triangle-alert": import_lucide_react_native.TriangleAlert,
241
+ eye: import_lucide_react_native.Eye,
242
+ "eye-off": import_lucide_react_native.EyeOff
241
243
  };
242
244
  var STROKE_WIDTH = 2.25;
243
245
  function Icon({ name, size = 20, color, style, testID }) {
@@ -374,28 +376,31 @@ function Button({
374
376
  size = "md",
375
377
  style,
376
378
  disabled,
379
+ loading = false,
377
380
  android_ripple,
378
381
  ...rest
379
382
  }) {
380
383
  const defaultRipple = android_ripple ?? {
381
384
  color: variant === "primary" || variant === "danger" ? "rgba(255, 255, 255, 0.2)" : "rgba(0, 0, 0, 0.08)"
382
385
  };
386
+ const isDisabled = disabled === true || loading;
383
387
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
384
388
  import_react_native5.Pressable,
385
389
  {
386
390
  accessibilityRole: "button",
387
- disabled,
388
- android_ripple: disabled ? void 0 : defaultRipple,
391
+ accessibilityState: { disabled: isDisabled, busy: loading },
392
+ disabled: isDisabled,
393
+ android_ripple: isDisabled ? void 0 : defaultRipple,
389
394
  style: ({ pressed }) => [
390
395
  styles4.base,
391
396
  sizeStyles[size],
392
397
  variantStyles[variant],
393
- pressed && !disabled && styles4.pressed,
398
+ pressed && !isDisabled && styles4.pressed,
394
399
  disabled && styles4.disabled,
395
400
  style
396
401
  ],
397
402
  ...rest,
398
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
403
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native5.ActivityIndicator, { color: labelColors[variant], size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
399
404
  import_react_native5.Text,
400
405
  {
401
406
  style: [
@@ -412,7 +417,7 @@ function Button({
412
417
  }
413
418
  var styles4 = import_react_native5.StyleSheet.create({
414
419
  base: {
415
- borderRadius: 10,
420
+ borderRadius: 999,
416
421
  alignItems: "center",
417
422
  justifyContent: "center"
418
423
  },
@@ -423,9 +428,9 @@ var styles4 = import_react_native5.StyleSheet.create({
423
428
  labelDisabled: { opacity: 0.6 }
424
429
  });
425
430
  var sizeStyles = import_react_native5.StyleSheet.create({
426
- sm: { paddingVertical: 6, paddingHorizontal: 12 },
427
- md: { paddingVertical: 10, paddingHorizontal: 16 },
428
- lg: { paddingVertical: 14, paddingHorizontal: 20 }
431
+ sm: { height: 36, paddingHorizontal: 12 },
432
+ md: { height: 44, paddingHorizontal: 16 },
433
+ lg: { height: 54, paddingHorizontal: 20 }
429
434
  });
430
435
  var variantStyles = import_react_native5.StyleSheet.create({
431
436
  primary: { backgroundColor: import_antonella_theme5.palette.primary },
@@ -1027,7 +1032,8 @@ function HeaderBar({
1027
1032
  description,
1028
1033
  style = "DEFAULT" /* DEFAULT */,
1029
1034
  onMenuPress,
1030
- menuIcon = "menu"
1035
+ menuIcon = "menu",
1036
+ accessibilityLabel = "Abrir men\xFA"
1031
1037
  }) {
1032
1038
  const c = STYLE_COLORS3[style];
1033
1039
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native14.View, { style: styles13.container, children: [
@@ -1041,7 +1047,7 @@ function HeaderBar({
1041
1047
  { backgroundColor: pressed ? c.buttonPressedBg : c.buttonBg }
1042
1048
  ],
1043
1049
  accessibilityRole: "button",
1044
- accessibilityLabel: "Abrir men\xFA",
1050
+ accessibilityLabel,
1045
1051
  children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { name: menuIcon, size: 22, color: c.iconColor })
1046
1052
  }
1047
1053
  ),
@@ -1596,7 +1602,8 @@ function CardStackSheet({
1596
1602
  dismissible = true,
1597
1603
  children,
1598
1604
  contentStyle,
1599
- snapPoints
1605
+ snapPoints,
1606
+ areaColor
1600
1607
  }) {
1601
1608
  const { height: screenHeight } = (0, import_react_native21.useWindowDimensions)();
1602
1609
  const insets = (0, import_react_native_safe_area_context2.useSafeAreaInsets)();
@@ -1691,7 +1698,11 @@ function CardStackSheet({
1691
1698
  {
1692
1699
  showsVerticalScrollIndicator: false,
1693
1700
  keyboardShouldPersistTaps: "handled",
1694
- contentContainerStyle: [styles19.content, contentStyle],
1701
+ contentContainerStyle: [
1702
+ styles19.content,
1703
+ contentStyle,
1704
+ areaColor ? { backgroundColor: areaColor } : void 0
1705
+ ],
1695
1706
  children
1696
1707
  }
1697
1708
  ) })
@@ -1824,12 +1835,12 @@ function Toast({
1824
1835
  {
1825
1836
  style: [
1826
1837
  styles21.toast,
1827
- { backgroundColor: c.bg, paddingTop: topInset + BASE_VPAD },
1838
+ { backgroundColor: c.bg, marginTop: (topInset || 0) + BASE_VPAD },
1828
1839
  containerStyle
1829
1840
  ],
1830
1841
  children: [
1831
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: TONE_ICONS[tone], size: 18, color: c.content }),
1832
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { variant: import_antonella_theme22.TextType.Caption, color: c.content, style: styles21.message, children: message }),
1842
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: TONE_ICONS[tone], size: 20, color: c.content }),
1843
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { variant: import_antonella_theme22.TextType.Body, color: c.content, style: styles21.message, children: message }),
1833
1844
  onClose ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1834
1845
  import_react_native23.Pressable,
1835
1846
  {
@@ -1838,7 +1849,7 @@ function Toast({
1838
1849
  accessibilityRole: "button",
1839
1850
  accessibilityLabel: "Cerrar aviso",
1840
1851
  style: ({ pressed }) => [styles21.close, pressed && styles21.closePressed],
1841
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: "close", size: 15, color: c.content })
1852
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: "close", size: 16, color: c.content })
1842
1853
  }
1843
1854
  ) : null
1844
1855
  ]
@@ -1863,14 +1874,14 @@ var STYLE_COLORS6 = {
1863
1874
  };
1864
1875
  var styles21 = import_react_native23.StyleSheet.create({
1865
1876
  toast: {
1866
- width: "100%",
1877
+ minHeight: 52,
1867
1878
  flexDirection: "row",
1868
1879
  alignItems: "center",
1869
1880
  gap: import_antonella_theme22.space.space2,
1870
- minHeight: 52,
1871
- borderRadius: 0,
1872
- paddingVertical: import_antonella_theme22.space.space3 + 2,
1881
+ borderRadius: 16,
1882
+ paddingVertical: import_antonella_theme22.space.space3,
1873
1883
  paddingHorizontal: import_antonella_theme22.space.space4,
1884
+ marginHorizontal: import_antonella_theme22.space.space4,
1874
1885
  shadowColor: "#000000",
1875
1886
  shadowOpacity: 0.25,
1876
1887
  shadowRadius: 10,
@@ -5078,68 +5089,163 @@ var styles39 = import_react_native43.StyleSheet.create({
5078
5089
  });
5079
5090
 
5080
5091
  // src/components/Input.tsx
5092
+ var import_react20 = require("react");
5081
5093
  var import_react_native44 = require("react-native");
5082
5094
  var import_antonella_theme41 = require("@william-callao/antonella-theme");
5083
5095
  var import_jsx_runtime44 = require("react/jsx-runtime");
5084
- function Input({ style, placeholderTextColor, icon, ...rest }) {
5085
- if (icon) {
5086
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_native44.View, { style: [styles40.inputContainer, style], children: [
5087
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Icon, { name: icon, size: 18, color: import_antonella_theme41.text.secondary, style: styles40.icon }),
5088
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
5089
- import_react_native44.TextInput,
5090
- {
5091
- placeholderTextColor: placeholderTextColor ?? import_antonella_theme41.appInput.placeholder,
5092
- style: styles40.inputFlex,
5093
- ...rest
5094
- }
5095
- )
5096
- ] });
5097
- }
5098
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
5096
+ var INPUT_RADIUS = 16;
5097
+ function Input({
5098
+ style,
5099
+ inputStyle,
5100
+ placeholderTextColor,
5101
+ icon,
5102
+ showToggle,
5103
+ error,
5104
+ secureTextEntry = false,
5105
+ onFocus,
5106
+ onBlur,
5107
+ ...rest
5108
+ }) {
5109
+ const [focused, setFocused] = (0, import_react20.useState)(false);
5110
+ const [visible, setVisible] = (0, import_react20.useState)(false);
5111
+ const isSecure = secureTextEntry === true;
5112
+ const effectiveSecure = isSecure && !visible;
5113
+ const showEye = showToggle === true && isSecure;
5114
+ const hasDecorations = icon != null || showEye;
5115
+ const hasError = Boolean(error);
5116
+ const borderColor = hasError ? import_antonella_theme41.appInput.error : focused ? import_antonella_theme41.text.secondary : import_antonella_theme41.appInputCard.border;
5117
+ const toggleVisible = () => setVisible((prev) => !prev);
5118
+ const field = hasDecorations ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
5119
+ import_react_native44.View,
5120
+ {
5121
+ style: [
5122
+ styles40.container,
5123
+ { borderColor },
5124
+ showEye ? styles40.eyeContainer : null,
5125
+ style
5126
+ ],
5127
+ children: [
5128
+ icon ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Icon, { name: icon, size: 18, color: import_antonella_theme41.text.secondary, style: styles40.sideIcon }) : null,
5129
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
5130
+ import_react_native44.TextInput,
5131
+ {
5132
+ placeholderTextColor: placeholderTextColor ?? import_antonella_theme41.appInput.placeholder,
5133
+ style: [styles40.field, inputStyle],
5134
+ secureTextEntry: effectiveSecure,
5135
+ onFocus: (e) => {
5136
+ setFocused(true);
5137
+ onFocus?.(e);
5138
+ },
5139
+ onBlur: (e) => {
5140
+ setFocused(false);
5141
+ onBlur?.(e);
5142
+ },
5143
+ ...rest
5144
+ }
5145
+ ),
5146
+ showEye ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
5147
+ import_react_native44.Pressable,
5148
+ {
5149
+ onPress: toggleVisible,
5150
+ hitSlop: 8,
5151
+ style: styles40.toggle,
5152
+ accessibilityRole: "button",
5153
+ accessibilityLabel: effectiveSecure ? "Mostrar contrase\xF1a" : "Ocultar contrase\xF1a",
5154
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
5155
+ Icon,
5156
+ {
5157
+ name: effectiveSecure ? "eye" : "eye-off",
5158
+ size: 20,
5159
+ color: import_antonella_theme41.text.secondary
5160
+ }
5161
+ )
5162
+ }
5163
+ ) : null
5164
+ ]
5165
+ }
5166
+ ) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
5099
5167
  import_react_native44.TextInput,
5100
5168
  {
5101
5169
  placeholderTextColor: placeholderTextColor ?? import_antonella_theme41.appInput.placeholder,
5102
- style: [styles40.input, style],
5170
+ style: [
5171
+ styles40.input,
5172
+ { borderColor },
5173
+ inputStyle
5174
+ ],
5175
+ secureTextEntry,
5176
+ onFocus: (e) => {
5177
+ setFocused(true);
5178
+ onFocus?.(e);
5179
+ },
5180
+ onBlur: (e) => {
5181
+ setFocused(false);
5182
+ onBlur?.(e);
5183
+ },
5103
5184
  ...rest
5104
5185
  }
5105
5186
  );
5187
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_native44.View, { style: styles40.wrapper, children: [
5188
+ field,
5189
+ hasError ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Text, { variant: import_antonella_theme41.TextType.Caption, color: import_antonella_theme41.appInput.error, style: styles40.error, children: error }) : null
5190
+ ] });
5106
5191
  }
5107
5192
  var styles40 = import_react_native44.StyleSheet.create({
5108
5193
  input: {
5109
- borderRadius: 10,
5110
- paddingHorizontal: import_antonella_theme41.spacing.md,
5194
+ borderWidth: 1,
5195
+ borderColor: import_antonella_theme41.appInputCard.border,
5196
+ borderRadius: INPUT_RADIUS,
5197
+ paddingLeft: import_antonella_theme41.space.space5,
5198
+ paddingRight: import_antonella_theme41.spacing.xl,
5111
5199
  paddingVertical: import_antonella_theme41.spacing.sm,
5112
5200
  fontSize: import_antonella_theme41.texts.caption.fontSize,
5113
5201
  lineHeight: import_antonella_theme41.texts.caption.lineHeight,
5114
5202
  color: import_antonella_theme41.appInput.text,
5115
5203
  backgroundColor: import_antonella_theme41.appInput.background
5116
5204
  },
5117
- inputContainer: {
5205
+ container: {
5118
5206
  flexDirection: "row",
5119
5207
  alignItems: "center",
5120
- borderRadius: 10,
5121
- paddingHorizontal: import_antonella_theme41.spacing.md,
5122
- backgroundColor: import_antonella_theme41.appInput.background
5208
+ borderWidth: 1,
5209
+ borderColor: import_antonella_theme41.appInputCard.border,
5210
+ borderRadius: INPUT_RADIUS,
5211
+ paddingHorizontal: import_antonella_theme41.spacing.lg,
5212
+ backgroundColor: import_antonella_theme41.appInput.background,
5213
+ overflow: "hidden"
5123
5214
  },
5124
- icon: {
5125
- marginRight: import_antonella_theme41.spacing.sm
5215
+ eyeContainer: {
5216
+ paddingRight: 0
5126
5217
  },
5127
- inputFlex: {
5218
+ field: {
5128
5219
  flex: 1,
5129
5220
  paddingVertical: import_antonella_theme41.spacing.sm,
5130
5221
  fontSize: import_antonella_theme41.texts.caption.fontSize,
5131
5222
  lineHeight: import_antonella_theme41.texts.caption.lineHeight,
5132
5223
  color: import_antonella_theme41.appInput.text
5224
+ },
5225
+ sideIcon: {
5226
+ marginRight: import_antonella_theme41.spacing.sm
5227
+ },
5228
+ toggle: {
5229
+ marginLeft: import_antonella_theme41.spacing.xs,
5230
+ paddingRight: import_antonella_theme41.spacing.lg,
5231
+ paddingVertical: import_antonella_theme41.spacing.xs,
5232
+ justifyContent: "center"
5233
+ },
5234
+ wrapper: {
5235
+ alignItems: "stretch"
5236
+ },
5237
+ error: {
5238
+ marginTop: import_antonella_theme41.spacing.xs
5133
5239
  }
5134
5240
  });
5135
5241
 
5136
5242
  // src/components/LayoutRow.tsx
5137
- var import_react20 = require("react");
5243
+ var import_react21 = require("react");
5138
5244
  var import_react_native45 = require("react-native");
5139
5245
  var import_antonella_theme42 = require("@william-callao/antonella-theme");
5140
5246
  var import_jsx_runtime45 = require("react/jsx-runtime");
5141
- var LayoutRowContext = (0, import_react20.createContext)({ debug: false, isSmall: false });
5142
- var useLayoutRowContext = () => (0, import_react20.useContext)(LayoutRowContext);
5247
+ var LayoutRowContext = (0, import_react21.createContext)({ debug: false, isSmall: false });
5248
+ var useLayoutRowContext = () => (0, import_react21.useContext)(LayoutRowContext);
5143
5249
  var debugColors = ["#FF6B6B", "#4ECDC4"];
5144
5250
  var BREAKPOINT_SMALL = 600;
5145
5251
  function LayoutRowFirst({ size = import_antonella_theme42.LayoutRowSize.EXPAND, scroll, children }) {
@@ -5198,12 +5304,12 @@ var styles41 = {
5198
5304
  };
5199
5305
 
5200
5306
  // src/components/LayoutColumn.tsx
5201
- var import_react21 = require("react");
5307
+ var import_react22 = require("react");
5202
5308
  var import_react_native46 = require("react-native");
5203
5309
  var import_antonella_theme43 = require("@william-callao/antonella-theme");
5204
5310
  var import_jsx_runtime46 = require("react/jsx-runtime");
5205
- var LayoutColumnContext = (0, import_react21.createContext)({ debug: false });
5206
- var useLayoutColumnContext = () => (0, import_react21.useContext)(LayoutColumnContext);
5311
+ var LayoutColumnContext = (0, import_react22.createContext)({ debug: false });
5312
+ var useLayoutColumnContext = () => (0, import_react22.useContext)(LayoutColumnContext);
5207
5313
  var debugColors2 = ["#FF6B6B", "#4ECDC4"];
5208
5314
  function LayoutColumnFirst({ size = import_antonella_theme43.LayoutColumnSize.EXPAND, scroll, children }) {
5209
5315
  const { debug } = useLayoutColumnContext();
@@ -5308,7 +5414,7 @@ var styles42 = import_react_native47.StyleSheet.create({
5308
5414
  });
5309
5415
 
5310
5416
  // src/components/ToolsCard.tsx
5311
- var import_react22 = __toESM(require("react"));
5417
+ var import_react23 = __toESM(require("react"));
5312
5418
  var import_react_native48 = require("react-native");
5313
5419
  var import_antonella_theme45 = require("@william-callao/antonella-theme");
5314
5420
  var import_jsx_runtime50 = require("react/jsx-runtime");
@@ -5318,7 +5424,7 @@ function ToolsCard({ tools, style }) {
5318
5424
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Icon, { name: tool.icon, size: 16, color: import_antonella_theme45.card.text.primary }),
5319
5425
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Text, { variant: import_antonella_theme45.TextType.BodyMedium, color: import_antonella_theme45.card.text.primary, numberOfLines: 1, children: tool.label })
5320
5426
  ] });
5321
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_react22.default.Fragment, { children: [
5427
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_react23.default.Fragment, { children: [
5322
5428
  index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_react_native48.View, { style: styles43.separator }) : null,
5323
5429
  tool.onPress ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5324
5430
  import_react_native48.Pressable,
@@ -5362,7 +5468,7 @@ var styles43 = import_react_native48.StyleSheet.create({
5362
5468
  });
5363
5469
 
5364
5470
  // src/components/TreeEditor.tsx
5365
- var import_react23 = require("react");
5471
+ var import_react24 = __toESM(require("react"));
5366
5472
  var import_react_native49 = require("react-native");
5367
5473
  var import_antonella_theme46 = require("@william-callao/antonella-theme");
5368
5474
  var import_jsx_runtime51 = require("react/jsx-runtime");
@@ -5501,21 +5607,9 @@ var CARD_MARGIN = 12;
5501
5607
  var CARD_PADDING_H = import_antonella_theme46.space.space4;
5502
5608
  var CARD_RADIUS3 = 24;
5503
5609
  var LINE_X = 10;
5504
- var EXPAND_DURATION = 220;
5505
5610
  var EXPAND_FADE = 180;
5506
- var COLLAPSE_FADE = 120;
5507
5611
  var NODE_ICON_SIZE = 18;
5508
- function buildRows(nodes, depth, collapsed, out) {
5509
- nodes.forEach((node) => {
5510
- out.push({ node, depth });
5511
- const isCollapsed = !!collapsed[node.id];
5512
- if (node.children.length > 0 && !isCollapsed) {
5513
- buildRows(node.children, depth + 1, collapsed, out);
5514
- }
5515
- });
5516
- return out;
5517
- }
5518
- function NodeGutter({
5612
+ var NodeGutter = import_react24.default.memo(function NodeGutter2({
5519
5613
  depth,
5520
5614
  lineColor,
5521
5615
  terminal
@@ -5545,7 +5639,7 @@ function NodeGutter({
5545
5639
  );
5546
5640
  }
5547
5641
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: columns });
5548
- }
5642
+ });
5549
5643
  function renderForest(ctx, nodes, depth, parentName) {
5550
5644
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: nodes.map((node, i) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5551
5645
  TreeNodeItem,
@@ -5559,7 +5653,7 @@ function renderForest(ctx, nodes, depth, parentName) {
5559
5653
  node.id
5560
5654
  )) });
5561
5655
  }
5562
- function TreeNodeItem({
5656
+ var TreeNodeItem = import_react24.default.memo(function TreeNodeItem2({
5563
5657
  node,
5564
5658
  depth,
5565
5659
  isLast,
@@ -5570,39 +5664,18 @@ function TreeNodeItem({
5570
5664
  const isCollapsed = !!ctx.collapsed[node.id];
5571
5665
  const isActive = hasChildren && !isCollapsed;
5572
5666
  const terminalElbow = isLast;
5573
- const subtreeRows = [];
5574
- buildRows(node.children, depth + 1, ctx.collapsed, subtreeRows);
5575
- const expandedHeight = (0, import_react23.useMemo)(
5576
- () => subtreeRows.length * (ROW_HEIGHT + CARD_MARGIN) + 2,
5577
- [subtreeRows.length]
5578
- );
5579
- const heightAnim = (0, import_react23.useRef)(new import_react_native49.Animated.Value(isCollapsed ? 0 : expandedHeight)).current;
5580
- const contentOpacity = (0, import_react23.useRef)(new import_react_native49.Animated.Value(isCollapsed ? 0 : 1)).current;
5581
- const measured = (0, import_react23.useRef)(false);
5582
- (0, import_react23.useEffect)(() => {
5583
- if (!measured.current) {
5584
- measured.current = true;
5585
- heightAnim.setValue(isCollapsed ? 0 : expandedHeight);
5586
- contentOpacity.setValue(isCollapsed ? 0 : 1);
5587
- return;
5588
- }
5589
- const toHeight = isCollapsed ? 0 : expandedHeight;
5590
- const animation = import_react_native49.Animated.parallel([
5591
- import_react_native49.Animated.timing(heightAnim, {
5592
- toValue: toHeight,
5593
- duration: EXPAND_DURATION,
5594
- easing: import_react_native49.Easing.out(import_react_native49.Easing.cubic),
5595
- useNativeDriver: false
5596
- }),
5597
- import_react_native49.Animated.timing(contentOpacity, {
5598
- toValue: isCollapsed ? 0 : 1,
5599
- duration: isCollapsed ? COLLAPSE_FADE : EXPAND_FADE,
5600
- useNativeDriver: false
5601
- })
5602
- ]);
5667
+ const contentOpacity = (0, import_react24.useRef)(new import_react_native49.Animated.Value(0)).current;
5668
+ (0, import_react24.useEffect)(() => {
5669
+ if (isCollapsed) return;
5670
+ const animation = import_react_native49.Animated.timing(contentOpacity, {
5671
+ toValue: 1,
5672
+ duration: EXPAND_FADE,
5673
+ easing: import_react_native49.Easing.out(import_react_native49.Easing.quad),
5674
+ useNativeDriver: true
5675
+ });
5603
5676
  animation.start();
5604
5677
  return () => animation.stop();
5605
- }, [isCollapsed, expandedHeight]);
5678
+ }, [isCollapsed, node.id, node.name, contentOpacity]);
5606
5679
  const defaultContent = /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_react_native49.View, { style: styles44.textBlock, children: [
5607
5680
  /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_react_native49.View, { style: styles44.titleRow, children: [
5608
5681
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
@@ -5689,20 +5762,19 @@ function TreeNodeItem({
5689
5762
  }
5690
5763
  ) : null
5691
5764
  ] }),
5692
- hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_native49.Animated.View, { style: [styles44.subtree, { height: heightAnim }], children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_native49.Animated.View, { style: { opacity: contentOpacity }, children: renderForest(ctx, node.children, depth + 1, node.name) }) }) : null
5765
+ hasChildren && !isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_native49.Animated.View, { style: [styles44.subtreeFade, { opacity: contentOpacity }], children: renderForest(ctx, node.children, depth + 1, node.name) }) : null
5693
5766
  ] });
5694
- }
5767
+ });
5695
5768
  function TreeEditor({ value, onChange, mode = "view", variant = "default", collapsed: collapsedProp, onCollapsedChange, rootLabel = "Agregar ra\xEDz", renderNode, onRequestAdd, onRequestEdit, onRequestDelete, style }) {
5696
- const t0 = performance.now();
5697
- const [internalCollapsed, setInternalCollapsed] = (0, import_react23.useState)({});
5769
+ const [internalCollapsed, setInternalCollapsed] = (0, import_react24.useState)({});
5698
5770
  const source = collapsedProp ?? internalCollapsed;
5699
5771
  const needsImplicitInit = value.length > 0 && Object.keys(source).length === 0;
5700
- const implicitInit = (0, import_react23.useMemo)(
5772
+ const implicitInit = (0, import_react24.useMemo)(
5701
5773
  () => needsImplicitInit ? buildInitialCollapsed(value) : null,
5702
5774
  [needsImplicitInit, value]
5703
5775
  );
5704
5776
  const collapsed = implicitInit ?? source;
5705
- (0, import_react23.useEffect)(() => {
5777
+ (0, import_react24.useEffect)(() => {
5706
5778
  if (implicitInit == null) return;
5707
5779
  if (collapsedProp != null) {
5708
5780
  onCollapsedChange?.(implicitInit);
@@ -5712,67 +5784,77 @@ function TreeEditor({ value, onChange, mode = "view", variant = "default", colla
5712
5784
  }, [implicitInit]);
5713
5785
  const vt = VARIANT_TOKENS[variant];
5714
5786
  const isEdit = mode === "edit";
5715
- const ctx = {
5716
- isEdit,
5717
- collapsed,
5718
- onToggle: toggleCollapse,
5719
- onOpenActions: (nodeId) => {
5787
+ const toggleCollapse = (0, import_react24.useCallback)(
5788
+ (id) => {
5789
+ const collapsing = !collapsed[id];
5790
+ let next;
5791
+ if (collapsing) {
5792
+ next = { ...collapsed, [id]: true };
5793
+ const node = findNode(value, id);
5794
+ if (node) markBranchCollapsed(node.children, next);
5795
+ } else {
5796
+ next = { ...collapsed, [id]: false };
5797
+ const siblings = findSiblingGroup(value, id);
5798
+ const rootId = value.length > 0 ? value[0].id : null;
5799
+ if (siblings) {
5800
+ for (const s of siblings) {
5801
+ if (s.id !== id && s.id !== rootId && s.children.length > 0) {
5802
+ next[s.id] = true;
5803
+ markBranchCollapsed(s.children, next);
5804
+ }
5805
+ }
5806
+ }
5807
+ }
5808
+ if (collapsedProp != null) {
5809
+ onCollapsedChange?.(next);
5810
+ } else {
5811
+ setInternalCollapsed(next);
5812
+ }
5813
+ },
5814
+ [collapsed, collapsedProp, value, onCollapsedChange]
5815
+ );
5816
+ const onOpenActions = (0, import_react24.useCallback)(
5817
+ (nodeId) => {
5720
5818
  const node = findNode(value, nodeId);
5721
5819
  if (node) onRequestEdit?.(node);
5722
5820
  },
5723
- renderNode,
5724
- vt
5725
- };
5726
- function toggleCollapse(id) {
5727
- const collapsing = !collapsed[id];
5728
- let next;
5729
- if (collapsing) {
5730
- next = { ...collapsed, [id]: true };
5731
- const node = findNode(value, id);
5732
- if (node) markBranchCollapsed(node.children, next);
5733
- } else {
5734
- next = { ...collapsed, [id]: false };
5735
- const siblings = findSiblingGroup(value, id);
5736
- const rootId = value.length > 0 ? value[0].id : null;
5737
- if (siblings) {
5738
- for (const s of siblings) {
5739
- if (s.id !== id && s.id !== rootId && s.children.length > 0) {
5740
- next[s.id] = true;
5741
- markBranchCollapsed(s.children, next);
5821
+ [value, onRequestEdit]
5822
+ );
5823
+ const ctx = (0, import_react24.useMemo)(
5824
+ () => ({
5825
+ isEdit,
5826
+ collapsed,
5827
+ onToggle: toggleCollapse,
5828
+ onOpenActions,
5829
+ renderNode,
5830
+ vt
5831
+ }),
5832
+ [isEdit, collapsed, toggleCollapse, onOpenActions, renderNode, vt]
5833
+ );
5834
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
5835
+ import_react_native49.View,
5836
+ {
5837
+ style: [styles44.container, { backgroundColor: vt.containerBg }, style],
5838
+ children: [
5839
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_native49.View, { children: renderForest(ctx, value, 0) }),
5840
+ isEdit ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
5841
+ import_react_native49.Pressable,
5842
+ {
5843
+ onPress: () => onRequestAdd?.(null),
5844
+ style: ({ pressed }) => [
5845
+ styles44.addRoot,
5846
+ pressed && { backgroundColor: vt.pressedBg }
5847
+ ],
5848
+ accessibilityRole: "button",
5849
+ children: [
5850
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_native49.View, { style: [styles44.addChip, { borderColor: vt.addRootText }], children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Icon, { name: "add", size: 13, color: vt.addRootText }) }),
5851
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text, { variant: import_antonella_theme46.TextType.BodyMedium, color: vt.addRootText, children: rootLabel })
5852
+ ]
5742
5853
  }
5743
- }
5744
- }
5745
- }
5746
- if (collapsedProp != null) {
5747
- onCollapsedChange?.(next);
5748
- } else {
5749
- setInternalCollapsed(next);
5854
+ ) : null
5855
+ ]
5750
5856
  }
5751
- }
5752
- console.log("[TreeEditor] render", Math.round(performance.now() - t0), "ms", {
5753
- valueLen: value.length,
5754
- mode,
5755
- variant,
5756
- collapsedKeys: Object.keys(collapsed).length
5757
- });
5758
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_react_native49.View, { style: [styles44.container, { backgroundColor: vt.containerBg }, style], children: [
5759
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_native49.View, { children: renderForest(ctx, value, 0) }),
5760
- isEdit ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
5761
- import_react_native49.Pressable,
5762
- {
5763
- onPress: () => onRequestAdd?.(null),
5764
- style: ({ pressed }) => [
5765
- styles44.addRoot,
5766
- pressed && { backgroundColor: vt.pressedBg }
5767
- ],
5768
- accessibilityRole: "button",
5769
- children: [
5770
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_native49.View, { style: [styles44.addChip, { borderColor: vt.addRootText }], children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Icon, { name: "add", size: 13, color: vt.addRootText }) }),
5771
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Text, { variant: import_antonella_theme46.TextType.BodyMedium, color: vt.addRootText, children: rootLabel })
5772
- ]
5773
- }
5774
- ) : null
5775
- ] });
5857
+ );
5776
5858
  }
5777
5859
  var styles44 = import_react_native49.StyleSheet.create({
5778
5860
  container: {
@@ -5848,8 +5930,9 @@ var styles44 = import_react_native49.StyleSheet.create({
5848
5930
  marginBottom: CARD_MARGIN,
5849
5931
  borderRadius: import_antonella_theme46.radius.sm
5850
5932
  },
5851
- subtree: {
5852
- overflow: "hidden"
5933
+ subtreeFade: {
5934
+ // Fade puro (native driver): sin medir/animar altura, evita el layout en
5935
+ // cascada al expandir/colapsar subárboles anidados.
5853
5936
  },
5854
5937
  addChip: {
5855
5938
  width: 22,
@@ -6084,15 +6167,15 @@ var styles46 = import_react_native51.StyleSheet.create({
6084
6167
  });
6085
6168
 
6086
6169
  // src/components/card-form/AppFormCard.tsx
6087
- var import_react24 = __toESM(require("react"));
6170
+ var import_react25 = __toESM(require("react"));
6088
6171
  var import_react_native52 = require("react-native");
6089
6172
  var import_antonella_theme48 = require("@william-callao/antonella-theme");
6090
6173
  var import_jsx_runtime54 = require("react/jsx-runtime");
6091
6174
  function AppFormCard({ children, labelWidth, style }) {
6092
- const items = import_react24.default.Children.toArray(children).filter((child) => import_react24.default.isValidElement(child)).map((child) => child);
6175
+ const items = import_react25.default.Children.toArray(children).filter((child) => import_react25.default.isValidElement(child)).map((child) => child);
6093
6176
  return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react_native52.View, { style: [styles47.container, style], children: items.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_react_native52.View, { style: styles47.row, children: [
6094
6177
  index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react_native52.View, { style: styles47.divider }) : null,
6095
- import_react24.default.cloneElement(child, {
6178
+ import_react25.default.cloneElement(child, {
6096
6179
  ...labelWidth != null ? { labelWidth } : {}
6097
6180
  })
6098
6181
  ] }, index)) });
@@ -6117,7 +6200,7 @@ var styles47 = import_react_native52.StyleSheet.create({
6117
6200
  });
6118
6201
 
6119
6202
  // src/components/card-form/AppTextInput.tsx
6120
- var import_react25 = require("react");
6203
+ var import_react26 = require("react");
6121
6204
  var import_react_native53 = require("react-native");
6122
6205
  var import_antonella_theme49 = require("@william-callao/antonella-theme");
6123
6206
  var import_jsx_runtime55 = require("react/jsx-runtime");
@@ -6133,8 +6216,8 @@ function AppTextInput({
6133
6216
  maxLength,
6134
6217
  editable = true
6135
6218
  }) {
6136
- const inputRef = (0, import_react25.useRef)(null);
6137
- const [inputHeight, setInputHeight] = (0, import_react25.useState)(void 0);
6219
+ const inputRef = (0, import_react26.useRef)(null);
6220
+ const [inputHeight, setInputHeight] = (0, import_react26.useState)(void 0);
6138
6221
  const focus = () => {
6139
6222
  if (editable) inputRef.current?.focus();
6140
6223
  };
@@ -6232,7 +6315,7 @@ var styles48 = import_react_native53.StyleSheet.create({
6232
6315
  });
6233
6316
 
6234
6317
  // src/components/card-form/AppTextArea.tsx
6235
- var import_react26 = require("react");
6318
+ var import_react27 = require("react");
6236
6319
  var import_react_native54 = require("react-native");
6237
6320
  var import_antonella_theme50 = require("@william-callao/antonella-theme");
6238
6321
  var import_jsx_runtime56 = require("react/jsx-runtime");
@@ -6248,8 +6331,8 @@ function AppTextArea({
6248
6331
  maxLength,
6249
6332
  editable = true
6250
6333
  }) {
6251
- const inputRef = (0, import_react26.useRef)(null);
6252
- const [inputHeight, setInputHeight] = (0, import_react26.useState)(void 0);
6334
+ const inputRef = (0, import_react27.useRef)(null);
6335
+ const [inputHeight, setInputHeight] = (0, import_react27.useState)(void 0);
6253
6336
  const focus = () => {
6254
6337
  if (editable) inputRef.current?.focus();
6255
6338
  };
@@ -6337,7 +6420,7 @@ var styles49 = import_react_native54.StyleSheet.create({
6337
6420
  });
6338
6421
 
6339
6422
  // src/components/card-form/AppSelector.tsx
6340
- var import_react27 = require("react");
6423
+ var import_react28 = require("react");
6341
6424
  var import_react_native55 = require("react-native");
6342
6425
  var import_antonella_theme51 = require("@william-callao/antonella-theme");
6343
6426
  var import_jsx_runtime57 = require("react/jsx-runtime");
@@ -6353,17 +6436,17 @@ function AppSelector({
6353
6436
  placeholder = "Seleccionar",
6354
6437
  disabled = false
6355
6438
  }) {
6356
- const [open, setOpen] = (0, import_react27.useState)(false);
6357
- const [contentHeight, setContentHeight] = (0, import_react27.useState)(0);
6358
- const chevron = (0, import_react27.useRef)(new import_react_native55.Animated.Value(0)).current;
6359
- const height = (0, import_react27.useRef)(new import_react_native55.Animated.Value(0)).current;
6360
- const contentOpacity = (0, import_react27.useRef)(new import_react_native55.Animated.Value(0)).current;
6439
+ const [open, setOpen] = (0, import_react28.useState)(false);
6440
+ const [contentHeight, setContentHeight] = (0, import_react28.useState)(0);
6441
+ const chevron = (0, import_react28.useRef)(new import_react_native55.Animated.Value(0)).current;
6442
+ const height = (0, import_react28.useRef)(new import_react_native55.Animated.Value(0)).current;
6443
+ const contentOpacity = (0, import_react28.useRef)(new import_react_native55.Animated.Value(0)).current;
6361
6444
  const selected = options.find((o) => o.value === value);
6362
- const chevronRotate = (0, import_react27.useMemo)(
6445
+ const chevronRotate = (0, import_react28.useMemo)(
6363
6446
  () => chevron.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "180deg"] }),
6364
6447
  [chevron]
6365
6448
  );
6366
- (0, import_react27.useEffect)(() => {
6449
+ (0, import_react28.useEffect)(() => {
6367
6450
  import_react_native55.Animated.timing(chevron, {
6368
6451
  toValue: open ? 1 : 0,
6369
6452
  duration: 180,
@@ -6371,7 +6454,7 @@ function AppSelector({
6371
6454
  useNativeDriver: false
6372
6455
  }).start();
6373
6456
  }, [open, chevron]);
6374
- (0, import_react27.useEffect)(() => {
6457
+ (0, import_react28.useEffect)(() => {
6375
6458
  const animation = import_react_native55.Animated.parallel([
6376
6459
  import_react_native55.Animated.timing(height, {
6377
6460
  toValue: open ? Math.max(contentHeight, options.length * OPTION_ROW_HEIGHT) : 0,
@@ -6506,7 +6589,7 @@ var styles50 = import_react_native55.StyleSheet.create({
6506
6589
  });
6507
6590
 
6508
6591
  // src/components/card-form/AppToggle.tsx
6509
- var import_react28 = require("react");
6592
+ var import_react29 = require("react");
6510
6593
  var import_react_native56 = require("react-native");
6511
6594
  var import_antonella_theme52 = require("@william-callao/antonella-theme");
6512
6595
  var import_jsx_runtime58 = require("react/jsx-runtime");
@@ -6522,9 +6605,9 @@ function AppToggle({
6522
6605
  onValueChange,
6523
6606
  disabled = false
6524
6607
  }) {
6525
- const thumbX = (0, import_react28.useRef)(new import_react_native56.Animated.Value(value ? 1 : 0)).current;
6526
- const trackColor = (0, import_react28.useRef)(new import_react_native56.Animated.Value(value ? 1 : 0)).current;
6527
- (0, import_react28.useEffect)(() => {
6608
+ const thumbX = (0, import_react29.useRef)(new import_react_native56.Animated.Value(value ? 1 : 0)).current;
6609
+ const trackColor = (0, import_react29.useRef)(new import_react_native56.Animated.Value(value ? 1 : 0)).current;
6610
+ (0, import_react29.useEffect)(() => {
6528
6611
  import_react_native56.Animated.parallel([
6529
6612
  import_react_native56.Animated.timing(thumbX, {
6530
6613
  toValue: value ? 1 : 0,
@@ -6725,13 +6808,13 @@ var styles53 = import_react_native58.StyleSheet.create({
6725
6808
  });
6726
6809
 
6727
6810
  // src/layout/SheetLayout.tsx
6728
- var import_react30 = require("react");
6811
+ var import_react31 = require("react");
6729
6812
  var import_react_native60 = require("react-native");
6730
6813
  var import_react_native_reanimated13 = __toESM(require("react-native-reanimated"));
6731
6814
  var import_antonella_theme55 = require("@william-callao/antonella-theme");
6732
6815
 
6733
6816
  // src/layout/SheetSlot.tsx
6734
- var import_react29 = require("react");
6817
+ var import_react30 = require("react");
6735
6818
  var import_react_native59 = require("react-native");
6736
6819
  var import_react_native_reanimated12 = __toESM(require("react-native-reanimated"));
6737
6820
  var import_react_native_safe_area_context10 = require("react-native-safe-area-context");
@@ -6759,7 +6842,7 @@ function SheetSlot({
6759
6842
  const fixedH = route?.options?.fixedHeaderHeight;
6760
6843
  const headerBg = route?.headerBackgroundColor ?? DEFAULT_HEADER_BG;
6761
6844
  const bodyBg = route?.bodyBackgroundColor ?? DEFAULT_BODY_BG;
6762
- const [measuredH, setMeasuredH] = (0, import_react29.useState)(fixedH ?? 0);
6845
+ const [measuredH, setMeasuredH] = (0, import_react30.useState)(fixedH ?? 0);
6763
6846
  const headerHAnim = (0, import_react_native_reanimated12.useSharedValue)(fixedH ?? 0);
6764
6847
  const scrollY = (0, import_react_native_reanimated12.useSharedValue)(0);
6765
6848
  const contentFade = (0, import_react_native_reanimated12.useSharedValue)(1);
@@ -6769,7 +6852,7 @@ function SheetSlot({
6769
6852
  setMeasuredH(h);
6770
6853
  headerHAnim.value = (0, import_react_native_reanimated12.withTiming)(h, { duration: 280 });
6771
6854
  };
6772
- (0, import_react29.useEffect)(() => {
6855
+ (0, import_react30.useEffect)(() => {
6773
6856
  scrollY.value = (0, import_react_native_reanimated12.withTiming)(0, { duration: 250 });
6774
6857
  contentFade.value = 0;
6775
6858
  contentFade.value = (0, import_react_native_reanimated12.withTiming)(1, { duration: 240 });
@@ -6966,12 +7049,12 @@ var _semantic8 = (0, import_antonella_theme55.resolveSemantic)(import_antonella_
6966
7049
  var HEADER_BG = _semantic8.default.bg.default;
6967
7050
  var BODY_BG = _semantic8.darkness.bg.default;
6968
7051
  var DURATION = 340;
6969
- var SheetLayoutContext = (0, import_react30.createContext)({
7052
+ var SheetLayoutContext = (0, import_react31.createContext)({
6970
7053
  change: () => {
6971
7054
  }
6972
7055
  });
6973
7056
  function useSheetLayout() {
6974
- return (0, import_react30.useContext)(SheetLayoutContext);
7057
+ return (0, import_react31.useContext)(SheetLayoutContext);
6975
7058
  }
6976
7059
  function resolveBaseColor(key) {
6977
7060
  return key === "header" ? HEADER_BG : BODY_BG;
@@ -6982,14 +7065,14 @@ function SheetLayout({
6982
7065
  onRequestChange,
6983
7066
  style
6984
7067
  }) {
6985
- const routeMap = (0, import_react30.useMemo)(() => {
7068
+ const routeMap = (0, import_react31.useMemo)(() => {
6986
7069
  const m = {};
6987
7070
  for (const r of routes) m[r.key] = r;
6988
7071
  return m;
6989
7072
  }, [routes]);
6990
7073
  const activeRoute = routeMap[activeKey];
6991
7074
  const comp = activeRoute ? resolveComposition(activeRoute.kind) : { host: "base", baseColor: "header" };
6992
- const [slots, setSlots] = (0, import_react30.useState)(() => {
7075
+ const [slots, setSlots] = (0, import_react31.useState)(() => {
6993
7076
  const init = {
6994
7077
  base: null,
6995
7078
  top: null,
@@ -7009,8 +7092,8 @@ function SheetLayout({
7009
7092
  const baseFrom = (0, import_react_native_reanimated13.useSharedValue)(HEADER_BG);
7010
7093
  const baseTo = (0, import_react_native_reanimated13.useSharedValue)(HEADER_BG);
7011
7094
  const baseProg = (0, import_react_native_reanimated13.useSharedValue)(1);
7012
- const prevKey = (0, import_react30.useRef)(activeKey);
7013
- (0, import_react30.useEffect)(() => {
7095
+ const prevKey = (0, import_react31.useRef)(activeKey);
7096
+ (0, import_react31.useEffect)(() => {
7014
7097
  if (activeRoute) {
7015
7098
  visBySide[comp.host].value = (0, import_react_native_reanimated13.withTiming)(1, { duration: DURATION });
7016
7099
  }
@@ -7019,7 +7102,7 @@ function SheetLayout({
7019
7102
  baseTo.value = c;
7020
7103
  baseProg.value = 1;
7021
7104
  }, []);
7022
- (0, import_react30.useEffect)(() => {
7105
+ (0, import_react31.useEffect)(() => {
7023
7106
  if (activeKey === prevKey.current) return;
7024
7107
  const toRoute = activeRoute;
7025
7108
  if (!toRoute) return;
@@ -7160,7 +7243,7 @@ var styles56 = import_react_native61.StyleSheet.create({
7160
7243
  });
7161
7244
 
7162
7245
  // src/layout/AppLayout.tsx
7163
- var import_react31 = require("react");
7246
+ var import_react32 = require("react");
7164
7247
  var import_react_native63 = require("react-native");
7165
7248
  var import_react_native64 = require("react-native");
7166
7249
  var import_react_native_reanimated14 = __toESM(require("react-native-reanimated"));
@@ -7265,9 +7348,9 @@ var DEFAULT_COLORS = {
7265
7348
  };
7266
7349
  var COLLAPSE_DISTANCE = 80;
7267
7350
  var TRANSITION = 320;
7268
- var AppNavigationContext = (0, import_react31.createContext)(null);
7351
+ var AppNavigationContext = (0, import_react32.createContext)(null);
7269
7352
  function useAppNavigation() {
7270
- const ctx = (0, import_react31.useContext)(AppNavigationContext);
7353
+ const ctx = (0, import_react32.useContext)(AppNavigationContext);
7271
7354
  if (!ctx) {
7272
7355
  throw new Error("useAppNavigation debe usarse dentro de <AppLayout>");
7273
7356
  }
@@ -7279,9 +7362,9 @@ function AppLayout({
7279
7362
  debug = false
7280
7363
  }) {
7281
7364
  const { height: H } = (0, import_react_native64.useWindowDimensions)();
7282
- const [stack, setStack] = (0, import_react31.useState)([initialRoute]);
7283
- const [prevRoute, setPrevRoute] = (0, import_react31.useState)(null);
7284
- (0, import_react31.useEffect)(() => {
7365
+ const [stack, setStack] = (0, import_react32.useState)([initialRoute]);
7366
+ const [prevRoute, setPrevRoute] = (0, import_react32.useState)(null);
7367
+ (0, import_react32.useEffect)(() => {
7285
7368
  setStack((s) => {
7286
7369
  if (s[0]?.name !== initialRoute.name) {
7287
7370
  return [initialRoute];
@@ -7289,18 +7372,18 @@ function AppLayout({
7289
7372
  return s;
7290
7373
  });
7291
7374
  }, [initialRoute.name]);
7292
- const navigate = (0, import_react31.useCallback)((route) => {
7375
+ const navigate = (0, import_react32.useCallback)((route) => {
7293
7376
  setStack((s) => [...s, route]);
7294
7377
  }, []);
7295
- const replace = (0, import_react31.useCallback)((route) => {
7378
+ const replace = (0, import_react32.useCallback)((route) => {
7296
7379
  setStack((s) => [...s.slice(0, -1), route]);
7297
7380
  }, []);
7298
- const back = (0, import_react31.useCallback)(() => {
7381
+ const back = (0, import_react32.useCallback)(() => {
7299
7382
  setStack((s) => s.length > 1 ? s.slice(0, -1) : s);
7300
7383
  }, []);
7301
7384
  const canGoBack = stack.length > 1;
7302
7385
  const currentRoute = stack[stack.length - 1];
7303
- (0, import_react31.useEffect)(() => {
7386
+ (0, import_react32.useEffect)(() => {
7304
7387
  const sub = import_react_native63.BackHandler.addEventListener("hardwareBackPress", () => {
7305
7388
  if (canGoBack) {
7306
7389
  back();
@@ -7337,9 +7420,9 @@ function AppLayout({
7337
7420
  };
7338
7421
  const animating = (0, import_react_native_reanimated14.useSharedValue)(0);
7339
7422
  const scrollY = (0, import_react_native_reanimated14.useSharedValue)(0);
7340
- const scrollRef = (0, import_react31.useRef)(null);
7341
- const innerScrollRef = (0, import_react31.useRef)(null);
7342
- const settleTimerRef = (0, import_react31.useRef)(null);
7423
+ const scrollRef = (0, import_react32.useRef)(null);
7424
+ const innerScrollRef = (0, import_react32.useRef)(null);
7425
+ const settleTimerRef = (0, import_react32.useRef)(null);
7343
7426
  const progress = (0, import_react_native_reanimated14.useSharedValue)(1);
7344
7427
  const fromH = {
7345
7428
  top: (0, import_react_native_reanimated14.useSharedValue)(H / 3),
@@ -7401,7 +7484,7 @@ function AppLayout({
7401
7484
  }
7402
7485
  }
7403
7486
  };
7404
- (0, import_react31.useLayoutEffect)(() => {
7487
+ (0, import_react32.useLayoutEffect)(() => {
7405
7488
  if (settleTimerRef.current) clearTimeout(settleTimerRef.current);
7406
7489
  animating.value = 1;
7407
7490
  if (!state.pageScroll) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@william-callao/antonella-ui",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Componentes UI de Antonella.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",