@vellira-ui/react-native 2.59.0 → 2.59.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.
Files changed (2) hide show
  1. package/dist/index.js +370 -251
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { Children, cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useMemo, useRef, useState, useSyncExternalStore } from "react";
1
+ import { Children, cloneElement, createContext, createElement, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useMemo, useRef, useState, useSyncExternalStore } from "react";
2
2
  import { Check, ChevronDown, Close, Search } from "@vellira-ui/icons";
3
3
  import { AccessibilityInfo, ActivityIndicator, Animated, BackHandler, Dimensions, Easing, FlatList, Modal as Modal$1, Platform, Pressable, ScrollView, StyleSheet, Text, TextInput, View, findNodeHandle, useWindowDimensions } from "react-native";
4
4
  import { createConsoleOverlayDiagnostics, createOverlayManagerStore, createOverlayZIndexPolicy, createRetainedResourceRegistry, deferOverlayFocusRestore, getCompoundSlot, markCompoundSlot, resolveOverlayPresentation } from "@vellira-ui/core";
5
- import { darkTheme, highContrastTheme, lightTheme } from "@vellira-ui/tokens";
5
+ import { controlSizes, darkTheme, highContrastTheme, lightTheme } from "@vellira-ui/tokens";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/theme/fontWeight.ts
8
8
  const nativeFontWeights = /* @__PURE__ */ new Set([
@@ -385,19 +385,17 @@ const useKeyboardNavigation = ({ activeIndex, setActiveIndex, items, isOpen, onO
385
385
  case "Tab":
386
386
  onClose?.();
387
387
  break;
388
- default:
389
- if (event.key.length === 1 && !event.altKey && !event.ctrlKey && !event.metaKey) {
390
- event.preventDefault();
391
- if (searchRef.current.timeoutId) clearTimeout(searchRef.current.timeoutId);
392
- searchRef.current.value += event.key;
393
- searchRef.current.timeoutId = setTimeout(() => {
394
- searchRef.current.value = "";
395
- searchRef.current.timeoutId = void 0;
396
- }, 700);
397
- const nextIndex = getTypeaheadIndex(searchRef.current.value);
398
- if (nextIndex >= 0) setActiveIndex(nextIndex);
399
- }
400
- break;
388
+ default: if (event.key.length === 1 && !event.altKey && !event.ctrlKey && !event.metaKey) {
389
+ event.preventDefault();
390
+ if (searchRef.current.timeoutId) clearTimeout(searchRef.current.timeoutId);
391
+ searchRef.current.value += event.key;
392
+ searchRef.current.timeoutId = setTimeout(() => {
393
+ searchRef.current.value = "";
394
+ searchRef.current.timeoutId = void 0;
395
+ }, 700);
396
+ const nextIndex = getTypeaheadIndex(searchRef.current.value);
397
+ if (nextIndex >= 0) setActiveIndex(nextIndex);
398
+ }
401
399
  }
402
400
  }, [
403
401
  activeIndex,
@@ -1359,9 +1357,10 @@ const createStyles$19 = (theme) => StyleSheet.create({ groupLabel: {
1359
1357
  //#endregion
1360
1358
  //#region src/components/Dropdown/Group/DropdownGroup.tsx
1361
1359
  function DropdownGroup({ label }) {
1360
+ const styles = useThemeStyles(createStyles$19);
1362
1361
  return /* @__PURE__ */ jsx(Text, {
1363
1362
  accessibilityRole: "header",
1364
- style: useThemeStyles(createStyles$19).groupLabel,
1363
+ style: styles.groupLabel,
1365
1364
  children: label
1366
1365
  });
1367
1366
  }
@@ -1474,7 +1473,8 @@ const createStyles$17 = (theme) => StyleSheet.create({ separator: {
1474
1473
  //#endregion
1475
1474
  //#region src/components/Dropdown/Separator/DropdownSeparator.tsx
1476
1475
  function DropdownSeparator() {
1477
- return /* @__PURE__ */ jsx(View, { style: useThemeStyles(createStyles$17).separator });
1476
+ const styles = useThemeStyles(createStyles$17);
1477
+ return /* @__PURE__ */ jsx(View, { style: styles.separator });
1478
1478
  }
1479
1479
  DropdownSeparator.displayName = "DropdownSeparator";
1480
1480
  //#endregion
@@ -1795,48 +1795,49 @@ function DropdownRoot({ children, label = "Menu", trigger, icon, arrowIcon, show
1795
1795
  }, [handleSelect, styles.emptyText]);
1796
1796
  const resolvedSearchPlaceholder = parsed.searchProps?.placeholder ?? searchPlaceholder ?? (command || contentCommand ? "Type a command..." : "Search actions...");
1797
1797
  const searchAccessibilityLabel = parsed.searchProps?.accessibilityLabel;
1798
+ const contextValue = useMemo(() => ({
1799
+ open: isOpen,
1800
+ disabled,
1801
+ loading,
1802
+ color,
1803
+ size,
1804
+ presentation: contentPresentation,
1805
+ position,
1806
+ zIndex: dismiss.zIndex,
1807
+ searchable: isSearchable,
1808
+ searchValue: resolvedSearchValue,
1809
+ searchPlaceholder: resolvedSearchPlaceholder,
1810
+ searchAccessibilityLabel,
1811
+ itemStyle,
1812
+ textStyle,
1813
+ requestClose: dismiss.requestClose,
1814
+ getOutsidePressProps: dismiss.getOutsidePressProps,
1815
+ toggle: handleTriggerPress,
1816
+ onSearchChange: handleSearchChange,
1817
+ onFloatingLayout
1818
+ }), [
1819
+ color,
1820
+ contentPresentation,
1821
+ disabled,
1822
+ dismiss.zIndex,
1823
+ dismiss.getOutsidePressProps,
1824
+ dismiss.requestClose,
1825
+ handleSearchChange,
1826
+ handleTriggerPress,
1827
+ isOpen,
1828
+ isSearchable,
1829
+ itemStyle,
1830
+ loading,
1831
+ onFloatingLayout,
1832
+ position,
1833
+ resolvedSearchPlaceholder,
1834
+ resolvedSearchValue,
1835
+ searchAccessibilityLabel,
1836
+ size,
1837
+ textStyle
1838
+ ]);
1798
1839
  return /* @__PURE__ */ jsx(DropdownProvider, {
1799
- value: useMemo(() => ({
1800
- open: isOpen,
1801
- disabled,
1802
- loading,
1803
- color,
1804
- size,
1805
- presentation: contentPresentation,
1806
- position,
1807
- zIndex: dismiss.zIndex,
1808
- searchable: isSearchable,
1809
- searchValue: resolvedSearchValue,
1810
- searchPlaceholder: resolvedSearchPlaceholder,
1811
- searchAccessibilityLabel,
1812
- itemStyle,
1813
- textStyle,
1814
- requestClose: dismiss.requestClose,
1815
- getOutsidePressProps: dismiss.getOutsidePressProps,
1816
- toggle: handleTriggerPress,
1817
- onSearchChange: handleSearchChange,
1818
- onFloatingLayout
1819
- }), [
1820
- color,
1821
- contentPresentation,
1822
- disabled,
1823
- dismiss.zIndex,
1824
- dismiss.getOutsidePressProps,
1825
- dismiss.requestClose,
1826
- handleSearchChange,
1827
- handleTriggerPress,
1828
- isOpen,
1829
- isSearchable,
1830
- itemStyle,
1831
- loading,
1832
- onFloatingLayout,
1833
- position,
1834
- resolvedSearchPlaceholder,
1835
- resolvedSearchValue,
1836
- searchAccessibilityLabel,
1837
- size,
1838
- textStyle
1839
- ]),
1840
+ value: contextValue,
1840
1841
  children: /* @__PURE__ */ jsxs(View, {
1841
1842
  style: [styles.root, style],
1842
1843
  children: [/* @__PURE__ */ jsx(DropdownTrigger, {
@@ -2063,8 +2064,9 @@ const createStyles$12 = (theme) => StyleSheet.create({ footer: {
2063
2064
  //#endregion
2064
2065
  //#region src/components/Modal/Footer/ModalFooter.tsx
2065
2066
  const ModalFooter = ({ children, style }) => {
2067
+ const styles = useThemeStyles(createStyles$12);
2066
2068
  return /* @__PURE__ */ jsx(View, {
2067
- style: [useThemeStyles(createStyles$12).footer, style],
2069
+ style: [styles.footer, style],
2068
2070
  children
2069
2071
  });
2070
2072
  };
@@ -2072,8 +2074,9 @@ ModalFooter.displayName = "ModalFooter";
2072
2074
  //#endregion
2073
2075
  //#region src/components/Modal/Header/ModalDescription.tsx
2074
2076
  const ModalDescription = ({ children, style }) => {
2077
+ const styles = useThemeStyles(createStyles$14);
2075
2078
  return /* @__PURE__ */ jsx(Text, {
2076
- style: [useThemeStyles(createStyles$14).description, style],
2079
+ style: [styles.description, style],
2077
2080
  children
2078
2081
  });
2079
2082
  };
@@ -2102,9 +2105,10 @@ ModalHeader.displayName = "ModalHeader";
2102
2105
  //#endregion
2103
2106
  //#region src/components/Modal/Header/ModalTitle.tsx
2104
2107
  const ModalTitle = ({ children, style }) => {
2108
+ const styles = useThemeStyles(createStyles$14);
2105
2109
  return /* @__PURE__ */ jsx(Text, {
2106
2110
  accessibilityRole: "header",
2107
- style: [useThemeStyles(createStyles$14).title, style],
2111
+ style: [styles.title, style],
2108
2112
  children
2109
2113
  });
2110
2114
  };
@@ -2402,12 +2406,12 @@ function createPopoverArrowStyles({ theme, side, arrowPosition }) {
2402
2406
  position.left = -halfSize;
2403
2407
  border.borderLeftWidth = 1;
2404
2408
  border.borderBottomWidth = 1;
2405
- break;
2406
2409
  }
2407
2410
  return StyleSheet.create({ arrow: {
2408
2411
  position: "absolute",
2409
2412
  width: tokens.size,
2410
2413
  height: tokens.size,
2414
+ ...Platform.OS === "web" ? { pointerEvents: "none" } : {},
2411
2415
  backgroundColor: tokens.bg,
2412
2416
  ...position,
2413
2417
  ...border
@@ -2419,18 +2423,19 @@ function PopoverArrow({ style }) {
2419
2423
  const { theme } = useTheme();
2420
2424
  const { placement, arrowPosition } = usePopoverContext("Popover.Arrow");
2421
2425
  const side = placement.split("-")[0];
2426
+ const styles = useMemo(() => createPopoverArrowStyles({
2427
+ theme,
2428
+ side,
2429
+ arrowPosition
2430
+ }), [
2431
+ theme,
2432
+ side,
2433
+ arrowPosition
2434
+ ]);
2422
2435
  return /* @__PURE__ */ jsx(View, {
2423
2436
  accessible: false,
2424
- pointerEvents: "none",
2425
- style: [useMemo(() => createPopoverArrowStyles({
2426
- theme,
2427
- side,
2428
- arrowPosition
2429
- }), [
2430
- theme,
2431
- side,
2432
- arrowPosition
2433
- ]).arrow, style]
2437
+ pointerEvents: Platform.OS === "web" ? void 0 : "none",
2438
+ style: [styles.arrow, style]
2434
2439
  });
2435
2440
  }
2436
2441
  PopoverArrow.displayName = "Popover.Arrow";
@@ -2455,7 +2460,10 @@ PopoverClose.displayName = "PopoverClose";
2455
2460
  //#endregion
2456
2461
  //#region src/primitives/Portal/Portal.tsx
2457
2462
  const PortalContext = createContext(null);
2458
- const styles$1 = StyleSheet.create({ host: { flex: 1 } });
2463
+ const styles$1 = StyleSheet.create({ host: {
2464
+ flex: 1,
2465
+ ...Platform.OS === "web" ? { pointerEvents: "box-none" } : {}
2466
+ } });
2459
2467
  const PortalProvider = ({ children, container = null }) => /* @__PURE__ */ jsx(PortalContext.Provider, {
2460
2468
  value: container,
2461
2469
  children
@@ -2474,7 +2482,7 @@ const Portal = ({ children, visible = true, animationType = "none", hardwareAcce
2474
2482
  transparent: true,
2475
2483
  visible: true,
2476
2484
  children: /* @__PURE__ */ jsx(View, {
2477
- pointerEvents: "box-none",
2485
+ pointerEvents: Platform.OS === "web" ? void 0 : "box-none",
2478
2486
  style: styles$1.host,
2479
2487
  children
2480
2488
  })
@@ -2486,7 +2494,10 @@ PortalProvider.displayName = "PortalProvider";
2486
2494
  //#endregion
2487
2495
  //#region src/components/Popover/Content/PopoverContent.styles.ts
2488
2496
  const styles = StyleSheet.create({
2489
- root: { flex: 1 },
2497
+ root: {
2498
+ flex: 1,
2499
+ ...Platform.OS === "web" ? { pointerEvents: "box-none" } : {}
2500
+ },
2490
2501
  backdrop: StyleSheet.absoluteFill,
2491
2502
  content: { position: "absolute" }
2492
2503
  });
@@ -2502,14 +2513,16 @@ function createPopoverContentStyles(theme) {
2502
2513
  borderColor: tokens.border,
2503
2514
  borderWidth: tokens.borderWidth,
2504
2515
  borderRadius: tokens.radius,
2505
- shadowColor: shadow.color,
2506
- shadowOpacity: shadow.opacity,
2507
- shadowRadius: shadow.blur,
2508
- shadowOffset: {
2509
- width: shadow.x,
2510
- height: shadow.y
2511
- },
2512
- elevation: shadow.elevation
2516
+ ...Platform.OS === "web" ? { boxShadow: tokens.shadow.web } : {
2517
+ shadowColor: shadow.color,
2518
+ shadowOpacity: shadow.opacity,
2519
+ shadowRadius: shadow.blur,
2520
+ shadowOffset: {
2521
+ width: shadow.x,
2522
+ height: shadow.y
2523
+ },
2524
+ elevation: shadow.elevation
2525
+ }
2513
2526
  } });
2514
2527
  }
2515
2528
  //#endregion
@@ -2530,7 +2543,7 @@ function PopoverContent({ children, style, ...contentProps }) {
2530
2543
  onRequestClose: requestClose,
2531
2544
  children: /* @__PURE__ */ jsxs(View, {
2532
2545
  ref: layerRef,
2533
- pointerEvents: "box-none",
2546
+ pointerEvents: Platform.OS === "web" ? void 0 : "box-none",
2534
2547
  style: [styles.root, { zIndex }],
2535
2548
  children: [/* @__PURE__ */ jsx(Pressable, {
2536
2549
  testID: "popover-backdrop",
@@ -2701,8 +2714,6 @@ function useRadioGroupContext() {
2701
2714
  const createStyles$10 = (theme) => StyleSheet.create({
2702
2715
  root: { alignSelf: "flex-start" },
2703
2716
  pressable: {
2704
- minWidth: 32,
2705
- minHeight: 32,
2706
2717
  flexDirection: "row",
2707
2718
  alignItems: "flex-start",
2708
2719
  gap: theme.tokens.spacing[2]
@@ -2773,6 +2784,8 @@ const Radio = forwardRef(({ value, checked, defaultChecked = false, disabled: di
2773
2784
  const radioColor = theme.components.radio[resolvedColor];
2774
2785
  const radioSize = theme.components.radio.size[resolvedSize];
2775
2786
  const controlMarginTop = (radioSize.labelLineHeight - radioSize.controlSize) / 2;
2787
+ const visualHeight = Math.max(radioSize.labelLineHeight, radioSize.controlSize);
2788
+ const hitSlop = Math.max(0, (32 - visualHeight) / 2);
2776
2789
  useEffect(() => {
2777
2790
  if (typeof __DEV__ !== "undefined" && __DEV__ && !label && !accessibilityLabel) console.warn("Radio requires either a visible label or accessibilityLabel.");
2778
2791
  }, [accessibilityLabel, label]);
@@ -2809,6 +2822,7 @@ const Radio = forwardRef(({ value, checked, defaultChecked = false, disabled: di
2809
2822
  disabled: resolvedDisabled
2810
2823
  },
2811
2824
  disabled: resolvedDisabled,
2825
+ hitSlop: Platform.OS === "web" ? void 0 : hitSlop,
2812
2826
  onPress: handlePress,
2813
2827
  style: resolvePressableStyle,
2814
2828
  children: (state) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(View, {
@@ -2873,7 +2887,7 @@ const Radio = forwardRef(({ value, checked, defaultChecked = false, disabled: di
2873
2887
  children: description
2874
2888
  }) : description)]
2875
2889
  })] })
2876
- }), error && /* @__PURE__ */ jsx(Text, {
2890
+ }), Boolean(error) && /* @__PURE__ */ jsx(Text, {
2877
2891
  accessibilityLiveRegion: "polite",
2878
2892
  style: [
2879
2893
  styles.error,
@@ -2903,7 +2917,7 @@ const createStyles$9 = (theme) => StyleSheet.create({
2903
2917
  root: {
2904
2918
  width: "100%",
2905
2919
  minWidth: 0,
2906
- alignSelf: "stretch",
2920
+ alignSelf: "auto",
2907
2921
  gap: theme.components.formField.size.md.gap
2908
2922
  },
2909
2923
  label: {
@@ -3087,7 +3101,7 @@ function FormFieldRoot({ id, label, description, error, message, messageTone, me
3087
3101
  style: styles.required,
3088
3102
  accessible: false,
3089
3103
  importantForAccessibility: "no",
3090
- children: " *"
3104
+ children: "*"
3091
3105
  }),
3092
3106
  !required && resolvedOptionalText && /* @__PURE__ */ jsx(Text, {
3093
3107
  style: [styles.optional, {
@@ -3218,10 +3232,13 @@ const RadioGroupRoot = forwardRef(({ value, defaultValue = "", onValueChange, di
3218
3232
  required,
3219
3233
  disabled,
3220
3234
  size,
3235
+ accessibilityRole: "radiogroup",
3236
+ accessibilityLabel: resolvedAccessibilityLabel,
3237
+ accessibilityHint: resolvedAccessibilityHint,
3221
3238
  labelStyle,
3222
3239
  descriptionStyle,
3223
3240
  errorStyle,
3224
- style,
3241
+ style: [{ alignSelf: "auto" }, style],
3225
3242
  children: /* @__PURE__ */ jsx(RadioGroupProvider, {
3226
3243
  value: {
3227
3244
  value: selectedValue,
@@ -3235,10 +3252,6 @@ const RadioGroupRoot = forwardRef(({ value, defaultValue = "", onValueChange, di
3235
3252
  children: /* @__PURE__ */ jsx(View, {
3236
3253
  ...rest,
3237
3254
  ref,
3238
- accessibilityRole: "radiogroup",
3239
- accessibilityLabel: resolvedAccessibilityLabel,
3240
- accessibilityHint: resolvedAccessibilityHint,
3241
- accessibilityState: { disabled },
3242
3255
  style: [
3243
3256
  styles.items,
3244
3257
  orientation === "horizontal" ? [styles.horizontal, {
@@ -3528,8 +3541,9 @@ const createGroupStyles = (theme) => StyleSheet.create({
3528
3541
  //#region src/components/Select/Group/SelectGroup.tsx
3529
3542
  const SelectGroup = createSelectSlot("group", "Select.Group");
3530
3543
  const SelectGroupLabelRow = ({ label }) => {
3544
+ const styles = useThemeStyles(createGroupStyles);
3531
3545
  return /* @__PURE__ */ jsx(Text, {
3532
- style: useThemeStyles(createGroupStyles).groupLabel,
3546
+ style: styles.groupLabel,
3533
3547
  children: label
3534
3548
  });
3535
3549
  };
@@ -3709,7 +3723,7 @@ const SelectItemRow = ({ option, isSelected, isDisabled, itemIndex, selectedValu
3709
3723
  multiple,
3710
3724
  pressed
3711
3725
  }), [styles.optionLabel, { color: optionFg }]) : /* @__PURE__ */ jsxs(Fragment, { children: [
3712
- option.icon && /* @__PURE__ */ jsx(View, {
3726
+ Boolean(option.icon) && /* @__PURE__ */ jsx(View, {
3713
3727
  style: styles.optionIcon,
3714
3728
  children: isValidElement(option.icon) ? cloneElement(option.icon, {
3715
3729
  color: optionFg,
@@ -3722,13 +3736,13 @@ const SelectItemRow = ({ option, isSelected, isDisabled, itemIndex, selectedValu
3722
3736
  numberOfLines: 1,
3723
3737
  style: [styles.optionLabel, { color: optionFg }],
3724
3738
  children: option.label
3725
- }), option.description && /* @__PURE__ */ jsx(Text, {
3739
+ }), Boolean(option.description) && /* @__PURE__ */ jsx(Text, {
3726
3740
  numberOfLines: 2,
3727
3741
  style: [styles.optionDescription, { color: descriptionFg }],
3728
3742
  children: option.description
3729
3743
  })]
3730
3744
  }),
3731
- option.badge && /* @__PURE__ */ jsx(View, {
3745
+ Boolean(option.badge) && /* @__PURE__ */ jsx(View, {
3732
3746
  style: [styles.badge, {
3733
3747
  backgroundColor: optionPalette.badge.bg,
3734
3748
  borderColor: optionPalette.badge.border
@@ -4013,7 +4027,7 @@ const SelectSearchField = () => {
4013
4027
  accessibilityLabel: searchPlaceholder,
4014
4028
  style: [styles.searchInput, searchStyle]
4015
4029
  }),
4016
- query && /* @__PURE__ */ jsx(Pressable, {
4030
+ Boolean(query) && /* @__PURE__ */ jsx(Pressable, {
4017
4031
  accessibilityRole: "button",
4018
4032
  accessibilityLabel: "Clear search",
4019
4033
  hitSlop: 8,
@@ -4033,7 +4047,8 @@ SelectSearchField.displayName = "Select.SearchField";
4033
4047
  //#region src/components/Select/Separator/SelectSeparator.tsx
4034
4048
  const SelectSeparator = createSelectSlot("separator", "Select.Separator");
4035
4049
  const SelectSeparatorRow = () => {
4036
- return /* @__PURE__ */ jsx(View, { style: useThemeStyles(createGroupStyles).separator });
4050
+ const styles = useThemeStyles(createGroupStyles);
4051
+ return /* @__PURE__ */ jsx(View, { style: styles.separator });
4037
4052
  };
4038
4053
  SelectSeparatorRow.displayName = "Select.SeparatorRow";
4039
4054
  //#endregion
@@ -4190,14 +4205,14 @@ const createTriggerStyles = (theme) => StyleSheet.create({
4190
4205
  trigger: {
4191
4206
  width: "100%",
4192
4207
  minWidth: 0,
4193
- minHeight: 44,
4208
+ minHeight: 38,
4194
4209
  alignItems: "center",
4195
4210
  flexDirection: "row",
4196
4211
  borderRadius: theme.tokens.radius.md,
4197
4212
  borderWidth: 1
4198
4213
  },
4199
4214
  sm: {
4200
- minHeight: 44,
4215
+ minHeight: 38,
4201
4216
  paddingHorizontal: theme.tokens.spacing[3],
4202
4217
  paddingVertical: theme.tokens.spacing[2]
4203
4218
  },
@@ -4211,9 +4226,9 @@ const createTriggerStyles = (theme) => StyleSheet.create({
4211
4226
  paddingHorizontal: theme.tokens.spacing[5],
4212
4227
  paddingVertical: theme.tokens.spacing[4]
4213
4228
  },
4214
- triggerWithClearSm: { paddingRight: theme.tokens.spacing[3] + 28 + theme.tokens.spacing[2] },
4215
- triggerWithClearMd: { paddingRight: theme.tokens.spacing[4] + 28 + theme.tokens.spacing[2] },
4216
- triggerWithClearLg: { paddingRight: theme.tokens.spacing[5] + 28 + theme.tokens.spacing[2] },
4229
+ triggerWithClearSm: { paddingRight: theme.tokens.spacing[3] + 24 + theme.tokens.spacing[2] },
4230
+ triggerWithClearMd: { paddingRight: theme.tokens.spacing[4] + 24 + theme.tokens.spacing[2] },
4231
+ triggerWithClearLg: { paddingRight: theme.tokens.spacing[5] + 24 + theme.tokens.spacing[2] },
4217
4232
  clearButtonContainer: {
4218
4233
  position: "absolute",
4219
4234
  top: 0,
@@ -4249,23 +4264,23 @@ const createTriggerStyles = (theme) => StyleSheet.create({
4249
4264
  lineHeight: theme.tokens.typography.lineHeight.md
4250
4265
  },
4251
4266
  startIcon: {
4252
- width: 18,
4253
- height: 18,
4267
+ width: 16,
4268
+ height: 16,
4254
4269
  marginRight: theme.tokens.spacing[2],
4255
4270
  alignItems: "center",
4256
4271
  justifyContent: "center"
4257
4272
  },
4258
4273
  endIcon: {
4259
- width: 18,
4260
- height: 18,
4274
+ width: 16,
4275
+ height: 16,
4261
4276
  marginLeft: theme.tokens.spacing[2],
4262
4277
  alignItems: "center",
4263
4278
  justifyContent: "center"
4264
4279
  },
4265
4280
  iconOpen: { transform: [{ rotate: "180deg" }] },
4266
4281
  clearButton: {
4267
- width: 28,
4268
- height: 28,
4282
+ width: 24,
4283
+ height: 24,
4269
4284
  alignItems: "center",
4270
4285
  justifyContent: "center",
4271
4286
  borderRadius: 999,
@@ -4279,12 +4294,18 @@ const nativePointerEventsNone$2 = Platform.OS === "web" ? void 0 : { pointerEven
4279
4294
  const nativePointerEventsBoxNone = Platform.OS === "web" ? void 0 : { pointerEvents: "box-none" };
4280
4295
  const webPointerEventsNone$2 = Platform.OS === "web" ? { pointerEvents: "none" } : void 0;
4281
4296
  const webPointerEventsBoxNone = Platform.OS === "web" ? { pointerEvents: "box-none" } : void 0;
4297
+ const compactTouchHitSlop = {
4298
+ top: 3,
4299
+ bottom: 3,
4300
+ left: 0,
4301
+ right: 0
4302
+ };
4282
4303
  function SelectTrigger({ displayText, isPlaceholder, isOpen, size = "md", color = "primary", variant = "outline", disabled = false, required = false, hasError = false, hasValue = false, loading = false, clearable = false, startIcon, endIcon, prefix, suffix, accessibilityLabel, accessibilityHint, nativeID, accessibilityLabelledBy, ariaDescribedBy, triggerStyle, textStyle, onPress, onClear }) {
4283
4304
  const { theme } = useTheme();
4284
4305
  const styles = useThemeStyles(createTriggerStyles);
4285
4306
  const palette = theme.components.select[color][variant];
4286
4307
  const triggerState = isOpen ? palette.focus : palette.default;
4287
- const resolvedIconSize = size === "lg" ? 18 : 16;
4308
+ const resolvedIconSize = 16;
4288
4309
  const showClearButton = clearable && hasValue && !disabled && !loading;
4289
4310
  const openRingStyle = Platform.OS === "web" ? { boxShadow: `0 0 0 3px ${theme.components.select[color].ring}` } : {
4290
4311
  shadowColor: theme.components.select[color].ring,
@@ -4353,6 +4374,7 @@ function SelectTrigger({ displayText, isPlaceholder, isOpen, size = "md", color
4353
4374
  selected: hasValue,
4354
4375
  busy: loading
4355
4376
  },
4377
+ hitSlop: size === "sm" ? compactTouchHitSlop : void 0,
4356
4378
  onPress,
4357
4379
  style: [
4358
4380
  styles.trigger,
@@ -4425,8 +4447,8 @@ function SelectTrigger({ displayText, isPlaceholder, isOpen, size = "md", color
4425
4447
  onPress: onClear,
4426
4448
  style: styles.clearButton,
4427
4449
  children: /* @__PURE__ */ jsx(Close, {
4428
- width: 14,
4429
- height: 14,
4450
+ width: 16,
4451
+ height: 16,
4430
4452
  color: theme.components.select.clearButton.hoverFg
4431
4453
  })
4432
4454
  })
@@ -4692,9 +4714,11 @@ function useSelectRootDisplayValue({ multiple, placeholder, renderValue, selecte
4692
4714
  //#endregion
4693
4715
  //#region src/components/Select/Root/useSelectRootSelection.ts
4694
4716
  function useSelectRootSelection({ props, options, isDisabled }) {
4717
+ const controlledValue = props.multiple ? props.value : props.value === null ? "" : props.value;
4718
+ const controlledDefaultValue = props.multiple ? props.defaultValue : props.defaultValue === null ? "" : props.defaultValue;
4695
4719
  const selection = useSelect({
4696
- value: props.multiple ? props.value : props.value === null ? "" : props.value,
4697
- defaultValue: props.multiple ? props.defaultValue : props.defaultValue === null ? "" : props.defaultValue,
4720
+ value: controlledValue,
4721
+ defaultValue: controlledDefaultValue,
4698
4722
  onValueChange: (nextValue) => {
4699
4723
  if (props.multiple) {
4700
4724
  props.onValueChange?.(Array.isArray(nextValue) ? nextValue : nextValue ? [nextValue] : []);
@@ -4729,7 +4753,7 @@ function useSelectRootState(props) {
4729
4753
  const searchInputRef = useRef(null);
4730
4754
  const selectedFocusValueRef = useRef(void 0);
4731
4755
  const resolvedPresentation = useOverlayPresentation(presentation);
4732
- const { position, onFloatingLayout } = useNativeFloatingPosition(placement, offset);
4756
+ const { position, updatePosition, onFloatingLayout } = useNativeFloatingPosition(placement, offset);
4733
4757
  const { options, rows, searchableFromChildren, searchPlaceholderFromChildren, emptyFromChildren, loadingFromChildren } = useSelectCollection(children, optionsProp);
4734
4758
  const resolvedSize = size ?? field?.size ?? "md";
4735
4759
  const isInvalid = invalid || Boolean(error) || !hasOwnField && Boolean(field?.invalid);
@@ -4757,6 +4781,10 @@ function useSelectRootState(props) {
4757
4781
  filterOptions,
4758
4782
  filter
4759
4783
  });
4784
+ const openAndPositionDropdown = useCallback(() => {
4785
+ updatePosition(triggerRef);
4786
+ openDropdown();
4787
+ }, [openDropdown, updatePosition]);
4760
4788
  const selectedFocusValue = selectedValues.includes(selectedFocusValueRef.current ?? "") ? selectedFocusValueRef.current : selectedValues[0];
4761
4789
  const selectedRowIndex = Math.max(0, filteredRows.findIndex((row) => row.type === "item" && row.option.value === selectedFocusValue));
4762
4790
  const itemHeight = typeof virtual === "object" ? virtual.estimatedItemSize ?? 46 : 46;
@@ -4849,7 +4877,7 @@ function useSelectRootState(props) {
4849
4877
  isOpen,
4850
4878
  isRequired,
4851
4879
  clearValue,
4852
- openDropdown,
4880
+ openDropdown: openAndPositionDropdown,
4853
4881
  resolvedHint,
4854
4882
  resolvedLabel,
4855
4883
  resolvedSize,
@@ -5235,7 +5263,17 @@ const createStyles$6 = (theme) => StyleSheet.create({
5235
5263
  gap: theme.tokens.spacing[5],
5236
5264
  marginBottom: theme.tokens.spacing[6]
5237
5265
  },
5266
+ listLine: {
5267
+ borderBottomWidth: 1,
5268
+ borderColor: theme.components.tabs.list.border
5269
+ },
5270
+ listLineVertical: {
5271
+ borderRightWidth: 1,
5272
+ borderBottomWidth: 0
5273
+ },
5238
5274
  listSegmented: {
5275
+ alignSelf: "flex-start",
5276
+ width: "auto",
5239
5277
  gap: theme.tokens.spacing[1],
5240
5278
  padding: 2,
5241
5279
  backgroundColor: theme.components.tabs.list.segmentedBg,
@@ -5263,8 +5301,10 @@ const TabsList = ({ children, scrollable: scrollableProp, style }) => {
5263
5301
  const scrollable = scrollableProp ?? false;
5264
5302
  const listStyle = [
5265
5303
  styles.list,
5304
+ variant === "line" && styles.listLine,
5266
5305
  variant === "segmented" && styles.listSegmented,
5267
5306
  orientation === "vertical" && styles.listVertical,
5307
+ variant === "line" && orientation === "vertical" && styles.listLineVertical,
5268
5308
  style
5269
5309
  ];
5270
5310
  if (scrollable && orientation === "horizontal") return /* @__PURE__ */ jsx(ScrollView, {
@@ -5286,7 +5326,7 @@ TabsList.displayName = "TabsList";
5286
5326
  const fontWeight$1 = (value) => value;
5287
5327
  const createStyles$5 = (theme) => StyleSheet.create({
5288
5328
  tab: {
5289
- minHeight: 44,
5329
+ minHeight: 38,
5290
5330
  minWidth: 44,
5291
5331
  alignItems: "center",
5292
5332
  flexDirection: "row",
@@ -5303,7 +5343,7 @@ const createStyles$5 = (theme) => StyleSheet.create({
5303
5343
  paddingHorizontal: 0
5304
5344
  },
5305
5345
  tabSm: {
5306
- minHeight: 36,
5346
+ minHeight: 32,
5307
5347
  paddingHorizontal: theme.tokens.spacing[3],
5308
5348
  paddingVertical: 6
5309
5349
  },
@@ -5313,7 +5353,7 @@ const createStyles$5 = (theme) => StyleSheet.create({
5313
5353
  paddingHorizontal: 0
5314
5354
  },
5315
5355
  tabLg: {
5316
- minHeight: 52,
5356
+ minHeight: 51,
5317
5357
  paddingHorizontal: theme.tokens.spacing[5],
5318
5358
  paddingVertical: theme.tokens.spacing[3]
5319
5359
  },
@@ -5323,7 +5363,8 @@ const createStyles$5 = (theme) => StyleSheet.create({
5323
5363
  paddingHorizontal: 0
5324
5364
  },
5325
5365
  tabSegmented: {
5326
- flex: 1,
5366
+ flexGrow: 0,
5367
+ flexShrink: 0,
5327
5368
  minWidth: 0,
5328
5369
  minHeight: 32,
5329
5370
  paddingVertical: 5,
@@ -5368,7 +5409,7 @@ const createStyles$5 = (theme) => StyleSheet.create({
5368
5409
  tabText: {
5369
5410
  flexShrink: 0,
5370
5411
  textAlign: "center",
5371
- lineHeight: theme.tokens.typography.lineHeight.md,
5412
+ lineHeight: theme.tokens.typography.size.md * 1.25,
5372
5413
  color: theme.components.tabs.primary.trigger.default.fg,
5373
5414
  fontFamily: theme.tokens.typography.family.regular,
5374
5415
  fontSize: theme.tokens.typography.size.md,
@@ -5376,11 +5417,11 @@ const createStyles$5 = (theme) => StyleSheet.create({
5376
5417
  },
5377
5418
  tabTextSm: {
5378
5419
  fontSize: theme.tokens.typography.size.sm,
5379
- lineHeight: theme.tokens.typography.lineHeight.sm
5420
+ lineHeight: theme.tokens.typography.size.sm * 1.25
5380
5421
  },
5381
5422
  tabTextLg: {
5382
5423
  fontSize: theme.tokens.typography.size.lg,
5383
- lineHeight: theme.tokens.typography.lineHeight.lg
5424
+ lineHeight: theme.tokens.typography.size.lg * 1.25
5384
5425
  },
5385
5426
  tabTextHover: { color: theme.components.tabs.primary.trigger.hover.fg },
5386
5427
  tabTextPressed: { color: theme.components.tabs.primary.trigger.active.fg },
@@ -5458,8 +5499,9 @@ TabsBadge.displayName = "Tabs.Badge";
5458
5499
  //#endregion
5459
5500
  //#region src/components/Tabs/Trigger/TabsIcon.tsx
5460
5501
  const TabsIcon = ({ children, style }) => {
5502
+ const styles = useThemeStyles(createStyles$5);
5461
5503
  return /* @__PURE__ */ jsx(View, {
5462
- style: [useThemeStyles(createStyles$5).tabIcon, style],
5504
+ style: [styles.tabIcon, style],
5463
5505
  children
5464
5506
  });
5465
5507
  };
@@ -5656,38 +5698,39 @@ const TabsRoot = ({ children, value: controlledValue, defaultValue, onValueChang
5656
5698
  value,
5657
5699
  version
5658
5700
  ]);
5701
+ const contextValue = useMemo(() => ({
5702
+ value,
5703
+ setValue,
5704
+ orientation,
5705
+ activationMode,
5706
+ variant,
5707
+ color,
5708
+ size,
5709
+ keepMounted,
5710
+ lazyMount,
5711
+ disabled,
5712
+ registerTrigger,
5713
+ indicatorVersion,
5714
+ getTriggerLayout,
5715
+ registerTriggerLayout
5716
+ }), [
5717
+ activationMode,
5718
+ color,
5719
+ disabled,
5720
+ keepMounted,
5721
+ lazyMount,
5722
+ orientation,
5723
+ getTriggerLayout,
5724
+ indicatorVersion,
5725
+ registerTriggerLayout,
5726
+ registerTrigger,
5727
+ setValue,
5728
+ size,
5729
+ value,
5730
+ variant
5731
+ ]);
5659
5732
  return /* @__PURE__ */ jsx(TabsProvider, {
5660
- value: useMemo(() => ({
5661
- value,
5662
- setValue,
5663
- orientation,
5664
- activationMode,
5665
- variant,
5666
- color,
5667
- size,
5668
- keepMounted,
5669
- lazyMount,
5670
- disabled,
5671
- registerTrigger,
5672
- indicatorVersion,
5673
- getTriggerLayout,
5674
- registerTriggerLayout
5675
- }), [
5676
- activationMode,
5677
- color,
5678
- disabled,
5679
- keepMounted,
5680
- lazyMount,
5681
- orientation,
5682
- getTriggerLayout,
5683
- indicatorVersion,
5684
- registerTriggerLayout,
5685
- registerTrigger,
5686
- setValue,
5687
- size,
5688
- value,
5689
- variant
5690
- ]),
5733
+ value: contextValue,
5691
5734
  children: /* @__PURE__ */ jsx(View, {
5692
5735
  style: [
5693
5736
  styles.root,
@@ -5741,9 +5784,10 @@ function TooltipArrow() {
5741
5784
  marginLeft: -size / 2
5742
5785
  };
5743
5786
  return /* @__PURE__ */ jsx(View, {
5744
- pointerEvents: "none",
5787
+ pointerEvents: Platform.OS === "web" ? void 0 : "none",
5745
5788
  style: {
5746
5789
  position: "absolute",
5790
+ ...Platform.OS === "web" ? { pointerEvents: "none" } : {},
5747
5791
  width: size,
5748
5792
  height: size,
5749
5793
  backgroundColor: theme.components.tooltip.arrow.bg,
@@ -5799,9 +5843,10 @@ const TooltipContent = ({ children, forceMount = false, withArrow = false, style
5799
5843
  if (!forceMount && !visible) return null;
5800
5844
  const bubble = /* @__PURE__ */ jsxs(View, {
5801
5845
  nativeID: tooltip.contentId,
5802
- pointerEvents: "none",
5846
+ pointerEvents: Platform.OS === "web" ? void 0 : "none",
5803
5847
  style: [
5804
5848
  styles.bubble,
5849
+ Platform.OS === "web" && { pointerEvents: "none" },
5805
5850
  {
5806
5851
  top: tooltip.position.top,
5807
5852
  left: tooltip.position.left,
@@ -5908,37 +5953,38 @@ const TooltipRoot = ({ children, open: openProp, defaultOpen = false, onOpenChan
5908
5953
  useEffect(() => {
5909
5954
  return clearCloseTimer;
5910
5955
  }, [clearCloseTimer]);
5956
+ const contextValue = useMemo(() => ({
5957
+ contentId,
5958
+ open,
5959
+ disabled,
5960
+ placement: resolvedPlacement,
5961
+ position,
5962
+ arrowPosition,
5963
+ triggerRef,
5964
+ setOpen,
5965
+ show,
5966
+ hide,
5967
+ zIndex: dismiss.zIndex,
5968
+ requestClose: dismiss.requestClose,
5969
+ getOutsidePressProps: dismiss.getOutsidePressProps,
5970
+ onFloatingLayout
5971
+ }), [
5972
+ arrowPosition,
5973
+ contentId,
5974
+ disabled,
5975
+ dismiss.zIndex,
5976
+ dismiss.getOutsidePressProps,
5977
+ dismiss.requestClose,
5978
+ hide,
5979
+ open,
5980
+ resolvedPlacement,
5981
+ position,
5982
+ setOpen,
5983
+ show,
5984
+ onFloatingLayout
5985
+ ]);
5911
5986
  return /* @__PURE__ */ jsx(TooltipProvider, {
5912
- value: useMemo(() => ({
5913
- contentId,
5914
- open,
5915
- disabled,
5916
- placement: resolvedPlacement,
5917
- position,
5918
- arrowPosition,
5919
- triggerRef,
5920
- setOpen,
5921
- show,
5922
- hide,
5923
- zIndex: dismiss.zIndex,
5924
- requestClose: dismiss.requestClose,
5925
- getOutsidePressProps: dismiss.getOutsidePressProps,
5926
- onFloatingLayout
5927
- }), [
5928
- arrowPosition,
5929
- contentId,
5930
- disabled,
5931
- dismiss.zIndex,
5932
- dismiss.getOutsidePressProps,
5933
- dismiss.requestClose,
5934
- hide,
5935
- open,
5936
- resolvedPlacement,
5937
- position,
5938
- setOpen,
5939
- show,
5940
- onFloatingLayout
5941
- ]),
5987
+ value: contextValue,
5942
5988
  children: /* @__PURE__ */ jsx(View, {
5943
5989
  style,
5944
5990
  children
@@ -5948,9 +5994,65 @@ const TooltipRoot = ({ children, open: openProp, defaultOpen = false, onOpenChan
5948
5994
  TooltipRoot.displayName = "Tooltip.Root";
5949
5995
  //#endregion
5950
5996
  //#region src/components/Tooltip/Trigger/TooltipTrigger.tsx
5951
- const TooltipTrigger = ({ children, disabled, onLongPress, style, ...props }) => {
5997
+ function flattenWebStyle(style) {
5998
+ if (!style) return;
5999
+ if (Array.isArray(style)) return Object.assign({}, ...style.map(flattenWebStyle).filter(Boolean));
6000
+ return typeof style === "object" ? style : void 0;
6001
+ }
6002
+ const TooltipTrigger = ({ children, disabled, onBlur, onFocus, onHoverIn, onHoverOut, onLongPress, onPress, onPressIn, style, ...props }) => {
5952
6003
  const tooltip = useTooltipContext();
5953
6004
  const isDisabled = tooltip.disabled || disabled;
6005
+ if (Platform.OS === "web") {
6006
+ const webProps = props;
6007
+ const showFromWebEvent = (event) => {
6008
+ if (event.defaultPrevented || isDisabled) return;
6009
+ tooltip.show();
6010
+ };
6011
+ return createElement("button", {
6012
+ "aria-label": webProps.accessibilityLabel,
6013
+ "data-testid": webProps.testID,
6014
+ disabled: isDisabled || void 0,
6015
+ type: "button",
6016
+ ref: (node) => {
6017
+ if (node) Object.assign(node, { measureInWindow(callback) {
6018
+ const rect = node.getBoundingClientRect();
6019
+ callback(rect.left, rect.top, rect.width, rect.height);
6020
+ } });
6021
+ tooltip.triggerRef.current = node;
6022
+ },
6023
+ onBlur: (event) => {
6024
+ onBlur?.(event);
6025
+ tooltip.hide();
6026
+ },
6027
+ onClick: (event) => {
6028
+ onPress?.(event);
6029
+ showFromWebEvent(event);
6030
+ },
6031
+ onClickCapture: showFromWebEvent,
6032
+ onPointerDown: showFromWebEvent,
6033
+ onPointerDownCapture: showFromWebEvent,
6034
+ onMouseDown: showFromWebEvent,
6035
+ onMouseDownCapture: showFromWebEvent,
6036
+ onFocusCapture: showFromWebEvent,
6037
+ onFocus: (event) => {
6038
+ onFocus?.(event);
6039
+ tooltip.show();
6040
+ },
6041
+ onMouseEnter: (event) => {
6042
+ onHoverIn?.(event);
6043
+ tooltip.show();
6044
+ },
6045
+ onMouseLeave: (event) => {
6046
+ onHoverOut?.(event);
6047
+ },
6048
+ style: {
6049
+ all: "unset",
6050
+ cursor: isDisabled ? "default" : "pointer",
6051
+ display: "inline-flex",
6052
+ ...flattenWebStyle(style)
6053
+ }
6054
+ }, children);
6055
+ }
5954
6056
  return /* @__PURE__ */ jsx(Pressable, {
5955
6057
  ...props,
5956
6058
  ref: tooltip.triggerRef,
@@ -5959,11 +6061,36 @@ const TooltipTrigger = ({ children, disabled, onLongPress, style, ...props }) =>
5959
6061
  disabled: isDisabled || props.accessibilityState?.disabled
5960
6062
  },
5961
6063
  disabled: isDisabled,
6064
+ onBlur: (event) => {
6065
+ onBlur?.(event);
6066
+ if (Platform.OS === "web") tooltip.hide();
6067
+ },
6068
+ onFocus: (event) => {
6069
+ onFocus?.(event);
6070
+ if (Platform.OS === "web") tooltip.show();
6071
+ },
6072
+ onHoverIn: (event) => {
6073
+ onHoverIn?.(event);
6074
+ if (Platform.OS === "web") tooltip.show();
6075
+ },
6076
+ onHoverOut: (event) => {
6077
+ onHoverOut?.(event);
6078
+ if (Platform.OS === "web") tooltip.hide();
6079
+ },
5962
6080
  onLongPress: (event) => {
5963
6081
  onLongPress?.(event);
5964
6082
  if (event.defaultPrevented) return;
5965
6083
  tooltip.show();
5966
6084
  },
6085
+ onPress: (event) => {
6086
+ onPress?.(event);
6087
+ if (event.defaultPrevented || Platform.OS !== "web") return;
6088
+ tooltip.show();
6089
+ },
6090
+ onPressIn: (event) => {
6091
+ onPressIn?.(event);
6092
+ if (Platform.OS === "web") tooltip.show();
6093
+ },
5967
6094
  style,
5968
6095
  children
5969
6096
  });
@@ -5987,14 +6114,10 @@ const createStyles$2 = (theme) => StyleSheet.create({
5987
6114
  gap: 8,
5988
6115
  borderWidth: 1
5989
6116
  },
5990
- fullWidth: {
5991
- alignSelf: "stretch",
5992
- width: "100%"
5993
- },
6117
+ fullWidth: { width: "100%" },
5994
6118
  text: {
5995
6119
  fontFamily: theme.tokens.typography.family.regular,
5996
6120
  fontWeight: fontWeight(theme.tokens.typography.weight.regular),
5997
- lineHeight: theme.tokens.typography.lineHeight.md,
5998
6121
  textAlign: "center",
5999
6122
  color: theme.components.button.primary.solid.default.fg
6000
6123
  },
@@ -6007,10 +6130,7 @@ const createStyles$2 = (theme) => StyleSheet.create({
6007
6130
  position: "absolute",
6008
6131
  opacity: 0
6009
6132
  },
6010
- spinner: {
6011
- fontSize: 12,
6012
- lineHeight: theme.tokens.typography.lineHeight.md
6013
- },
6133
+ spinner: { fontSize: 12 },
6014
6134
  badge: {
6015
6135
  minWidth: 18,
6016
6136
  height: 18,
@@ -6047,33 +6167,16 @@ const createStyles$2 = (theme) => StyleSheet.create({
6047
6167
  });
6048
6168
  //#endregion
6049
6169
  //#region src/primitives/Button/Button.tsx
6050
- const sizeMap = {
6051
- sm: {
6052
- px: 16,
6053
- py: 6,
6054
- height: 36,
6055
- fontSize: 12,
6056
- iconSize: 16
6057
- },
6058
- md: {
6059
- px: 24,
6060
- py: 8,
6061
- height: 44,
6062
- fontSize: 14,
6063
- iconSize: 20
6064
- },
6065
- lg: {
6066
- px: 32,
6067
- py: 10,
6068
- height: 52,
6069
- fontSize: 16,
6070
- iconSize: 24
6071
- }
6170
+ const buttonSizeMap = {
6171
+ sm: { px: 16 },
6172
+ md: { px: 24 },
6173
+ lg: { px: 32 }
6072
6174
  };
6073
6175
  function Button({ children, color = "primary", appearance = "solid", shape = "pill", disabled = false, loading = false, loadingText, onPress, onFocus, onBlur, onHoverIn, onHoverOut, size = "md", iconStart, iconEnd, badge, shortcut, fullWidth = false, iconOnly: iconOnlyProp = false, style, textStyle, accessibilityLabel, iconSize, testID, ...props }) {
6074
6176
  const { theme } = useTheme();
6075
6177
  const styles = useThemeStyles(createStyles$2);
6076
- const config = sizeMap[size];
6178
+ const controlSize = controlSizes[size];
6179
+ const buttonSize = buttonSizeMap[size];
6077
6180
  const radius = shape === "square" ? theme.tokens.radius.sm : shape === "rounded" ? theme.tokens.radius.md : theme.tokens.radius.full;
6078
6181
  const appearanceTheme = theme.components.button[color][appearance];
6079
6182
  const [isHovered, setIsHovered] = useState(false);
@@ -6084,7 +6187,7 @@ function Button({ children, color = "primary", appearance = "solid", shape = "pi
6084
6187
  const content = loading && loadingText ? loadingText : children;
6085
6188
  const measureLabel = loadingText && children && !iconOnly ? loading ? children : loadingText : void 0;
6086
6189
  devWarning(!iconOnly || Boolean(accessibilityLabel), "Button: icon-only buttons must provide an accessibilityLabel.");
6087
- const resolvedIconSize = iconSize ?? config.iconSize;
6190
+ const resolvedIconSize = iconSize ?? controlSize.iconSize;
6088
6191
  const handleFocus = (event) => {
6089
6192
  setIsFocused(true);
6090
6193
  onFocus?.(event);
@@ -6133,10 +6236,11 @@ function Button({ children, color = "primary", appearance = "solid", shape = "pi
6133
6236
  backgroundColor: interactionTheme.bg,
6134
6237
  borderColor: interactionTheme.border,
6135
6238
  borderRadius: radius,
6136
- paddingHorizontal: iconOnly ? 0 : config.px,
6137
- paddingVertical: iconOnly ? 0 : config.py,
6138
- width: iconOnly ? config.height : void 0,
6139
- height: iconOnly ? config.height : void 0
6239
+ minHeight: controlSize.height,
6240
+ paddingHorizontal: iconOnly ? 0 : buttonSize.px,
6241
+ paddingVertical: 0,
6242
+ width: iconOnly ? controlSize.height : void 0,
6243
+ height: iconOnly ? controlSize.height : void 0
6140
6244
  },
6141
6245
  fullWidth && !iconOnly && styles.fullWidth,
6142
6246
  isDisabled && styles.disabled,
@@ -6149,7 +6253,7 @@ function Button({ children, color = "primary", appearance = "solid", shape = "pi
6149
6253
  const contentColor = getInteractionTheme(pressed).fg;
6150
6254
  return /* @__PURE__ */ jsxs(Fragment, { children: [
6151
6255
  loading && /* @__PURE__ */ jsx(ActivityIndicator, {
6152
- size: "small",
6256
+ size: controlSize.iconSize,
6153
6257
  color: contentColor
6154
6258
  }),
6155
6259
  !loading && iconStart && renderIcon(iconStart, contentColor),
@@ -6160,7 +6264,8 @@ function Button({ children, color = "primary", appearance = "solid", shape = "pi
6160
6264
  style: [
6161
6265
  styles.text,
6162
6266
  {
6163
- fontSize: config.fontSize,
6267
+ fontSize: controlSize.fontSize,
6268
+ lineHeight: controlSize.lineHeight,
6164
6269
  color: contentColor
6165
6270
  },
6166
6271
  textStyle
@@ -6173,7 +6278,10 @@ function Button({ children, color = "primary", appearance = "solid", shape = "pi
6173
6278
  style: [
6174
6279
  styles.text,
6175
6280
  styles.labelMeasure,
6176
- { fontSize: config.fontSize },
6281
+ {
6282
+ fontSize: controlSize.fontSize,
6283
+ lineHeight: controlSize.lineHeight
6284
+ },
6177
6285
  textStyle
6178
6286
  ],
6179
6287
  children: measureLabel
@@ -6273,7 +6381,7 @@ const createStyles$1 = (theme) => StyleSheet.create({
6273
6381
  labelCheckedPressed: { color: theme.components.checkbox.primary.pressed.labelFg },
6274
6382
  labelSm: {
6275
6383
  fontSize: theme.tokens.typography.size.sm,
6276
- lineHeight: theme.tokens.typography.lineHeight.sm
6384
+ lineHeight: theme.tokens.typography.lineHeight.md
6277
6385
  },
6278
6386
  labelMd: {
6279
6387
  fontSize: theme.tokens.typography.size.md,
@@ -6281,7 +6389,7 @@ const createStyles$1 = (theme) => StyleSheet.create({
6281
6389
  },
6282
6390
  labelLg: {
6283
6391
  fontSize: theme.tokens.typography.size.lg,
6284
- lineHeight: theme.tokens.typography.lineHeight.lg
6392
+ lineHeight: theme.tokens.typography.lineHeight.md
6285
6393
  },
6286
6394
  labelDisabled: { color: theme.components.checkbox.disabled.fg },
6287
6395
  requiredMark: { color: theme.components.checkbox.error.fg },
@@ -6393,7 +6501,7 @@ const Checkbox = forwardRef(({ label, description, icon, indeterminateIcon, chec
6393
6501
  size: iconSizeBySize[size],
6394
6502
  color: checkColor
6395
6503
  }))
6396
- }), label && /* @__PURE__ */ jsxs(Text, {
6504
+ }), Boolean(label) && /* @__PURE__ */ jsxs(Text, {
6397
6505
  style: [
6398
6506
  styles.label,
6399
6507
  labelSizeStyle[size],
@@ -6408,7 +6516,7 @@ const Checkbox = forwardRef(({ label, description, icon, indeterminateIcon, chec
6408
6516
  })] });
6409
6517
  }
6410
6518
  }),
6411
- description && /* @__PURE__ */ jsx(Text, {
6519
+ Boolean(description) && /* @__PURE__ */ jsx(Text, {
6412
6520
  style: [
6413
6521
  styles.descriptionText,
6414
6522
  helperTextSizeStyle[size],
@@ -6508,22 +6616,16 @@ const createStyles = (theme) => StyleSheet.create({
6508
6616
  },
6509
6617
  clearButtonPressed: { backgroundColor: theme.components.input.clearButton.pressedBg },
6510
6618
  sm: {
6511
- minHeight: 36,
6512
6619
  paddingHorizontal: theme.tokens.spacing[3],
6513
- paddingVertical: theme.tokens.spacing[2],
6514
- fontSize: theme.tokens.typography.size.sm
6620
+ paddingVertical: 0
6515
6621
  },
6516
6622
  md: {
6517
- minHeight: 44,
6518
6623
  paddingHorizontal: theme.tokens.spacing[4],
6519
- paddingVertical: theme.tokens.spacing[3],
6520
- fontSize: theme.tokens.typography.size.md
6624
+ paddingVertical: 0
6521
6625
  },
6522
6626
  lg: {
6523
- minHeight: 52,
6524
6627
  paddingHorizontal: theme.tokens.spacing[5],
6525
- paddingVertical: theme.tokens.spacing[4],
6526
- fontSize: theme.tokens.typography.size.lg
6628
+ paddingVertical: 0
6527
6629
  },
6528
6630
  focused: {
6529
6631
  color: theme.components.input.focus.fg,
@@ -6635,6 +6737,8 @@ const Input = forwardRef(({ label, description, value, defaultValue, onValueChan
6635
6737
  const displayValue = format ? format(currentValue) : currentValue;
6636
6738
  const hasValue = currentValue !== "";
6637
6739
  const resolvedSize = size ?? field?.size ?? "md";
6740
+ const controlSize = controlSizes[resolvedSize];
6741
+ const resolvedIconSize = iconSize ?? controlSize.iconSize;
6638
6742
  const inputColorPalette = theme.components.input[color];
6639
6743
  const inputPalette = inputColorPalette[variant];
6640
6744
  const inputState = isFocused ? inputPalette.focus : inputPalette.default;
@@ -6642,6 +6746,7 @@ const Input = forwardRef(({ label, description, value, defaultValue, onValueChan
6642
6746
  const isDisabled = disabled || !hasOwnField && Boolean(field?.disabled);
6643
6747
  const isRequired = required || !hasOwnField && Boolean(field?.required);
6644
6748
  const isReadOnly = readOnly || loading;
6749
+ const showLoading = loading && !isDisabled;
6645
6750
  const placeholderTextColor = isDisabled ? getDisabledPlaceholderTextColor(theme) : readOnly ? theme.components.input.readOnly.placeholder : inputState.placeholder;
6646
6751
  const focusedRingStyle = Platform.OS === "web" ? { boxShadow: `0 0 0 3px ${inputColorPalette.ring}` } : {
6647
6752
  shadowColor: inputColorPalette.ring,
@@ -6655,7 +6760,6 @@ const Input = forwardRef(({ label, description, value, defaultValue, onValueChan
6655
6760
  };
6656
6761
  const isPassword = type === "password";
6657
6762
  const [isPasswordRevealed, setIsPasswordRevealed] = useState(false);
6658
- const resolvedIconSize = iconSize ?? 16;
6659
6763
  const handleFocus = (event) => {
6660
6764
  setIsFocused(true);
6661
6765
  onFocus?.(event);
@@ -6675,9 +6779,9 @@ const Input = forwardRef(({ label, description, value, defaultValue, onValueChan
6675
6779
  onValueChange?.("");
6676
6780
  onClear?.();
6677
6781
  };
6678
- const showClearButton = clearable && hasValue && !isDisabled && !isReadOnly;
6679
- const showRevealButton = revealPassword && isPassword && !isDisabled;
6680
- const showRightIcon = !showClearButton && !showRevealButton && Boolean(endIcon);
6782
+ const showClearButton = clearable && hasValue && !isDisabled && !isReadOnly && !showLoading;
6783
+ const showRevealButton = revealPassword && isPassword && !isDisabled && !showLoading && !showClearButton;
6784
+ const showRightIcon = !showLoading && !showClearButton && !showRevealButton && Boolean(endIcon);
6681
6785
  const startIconColor = isDisabled ? theme.components.input.disabled.icon : theme.components.input.icon[startIconTone];
6682
6786
  const endIconColor = isDisabled ? theme.components.input.disabled.icon : theme.components.input.icon[endIconTone];
6683
6787
  const clearIconColor = isDisabled ? theme.components.input.disabled.icon : theme.components.input.icon[clearIconTone];
@@ -6714,7 +6818,10 @@ const Input = forwardRef(({ label, description, value, defaultValue, onValueChan
6714
6818
  placeholderTextColor,
6715
6819
  accessibilityLabel: accessibilityLabel ?? label,
6716
6820
  accessibilityHint,
6717
- accessibilityState: { disabled: isDisabled },
6821
+ accessibilityState: {
6822
+ disabled: isDisabled,
6823
+ busy: loading
6824
+ },
6718
6825
  accessibilityLabelledBy: !hasOwnField ? field?.labelId : void 0,
6719
6826
  "aria-describedby": !hasOwnField ? field?.ariaDescribedBy : void 0,
6720
6827
  style: [
@@ -6722,12 +6829,15 @@ const Input = forwardRef(({ label, description, value, defaultValue, onValueChan
6722
6829
  {
6723
6830
  color: inputState.fg,
6724
6831
  backgroundColor: inputState.bg,
6725
- borderColor: inputState.border
6832
+ borderColor: inputState.border,
6833
+ height: controlSize.height,
6834
+ fontSize: controlSize.fontSize,
6835
+ lineHeight: controlSize.lineHeight
6726
6836
  },
6727
6837
  styles[resolvedSize],
6728
6838
  inputStyle,
6729
6839
  startIcon && styles.inputWithLeftAdornment,
6730
- (showRightIcon || showClearButton || showRevealButton) && styles.inputWithRightAdornment,
6840
+ (showLoading || showRightIcon || showClearButton || showRevealButton) && styles.inputWithRightAdornment,
6731
6841
  isFocused && !isDisabled && !isReadOnly && {
6732
6842
  color: inputPalette.focus.fg,
6733
6843
  backgroundColor: inputPalette.focus.bg,
@@ -6740,7 +6850,16 @@ const Input = forwardRef(({ label, description, value, defaultValue, onValueChan
6740
6850
  isDisabled && styles.disabled
6741
6851
  ]
6742
6852
  }),
6743
- showClearButton ? /* @__PURE__ */ jsx(Pressable, {
6853
+ showLoading ? /* @__PURE__ */ jsx(View, {
6854
+ ...nativePointerEventsNone,
6855
+ style: [styles.rightIcon, webPointerEventsNone],
6856
+ accessibilityElementsHidden: true,
6857
+ importantForAccessibility: "no",
6858
+ children: /* @__PURE__ */ jsx(ActivityIndicator, {
6859
+ size: "small",
6860
+ color: endIconColor
6861
+ })
6862
+ }) : showClearButton ? /* @__PURE__ */ jsx(Pressable, {
6744
6863
  accessibilityRole: "button",
6745
6864
  accessibilityLabel: "Clear input",
6746
6865
  hitSlop: 8,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellira-ui/react-native",
3
- "version": "2.59.0",
3
+ "version": "2.59.1",
4
4
  "description": "React Native components for Vellira Design System",
5
5
  "keywords": [
6
6
  "vellira",