@yahoo/uds-mobile 2.15.0 → 2.16.0

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 (55) hide show
  1. package/README.md +27 -24
  2. package/dist/components/Input.cjs +16 -13
  3. package/dist/components/Input.d.cts.map +1 -1
  4. package/dist/components/Input.d.ts.map +1 -1
  5. package/dist/components/Input.js +16 -13
  6. package/dist/components/Input.js.map +1 -1
  7. package/dist/components/InputHelpText.cjs +52 -0
  8. package/dist/components/InputHelpText.d.cts +37 -0
  9. package/dist/components/InputHelpText.d.cts.map +1 -0
  10. package/dist/components/InputHelpText.d.ts +37 -0
  11. package/dist/components/InputHelpText.d.ts.map +1 -0
  12. package/dist/components/InputHelpText.js +52 -0
  13. package/dist/components/InputHelpText.js.map +1 -0
  14. package/dist/components/internal/Overlay/OverlayPortal.cjs +20 -0
  15. package/dist/components/internal/Overlay/OverlayPortal.d.cts +17 -0
  16. package/dist/components/internal/Overlay/OverlayPortal.d.cts.map +1 -0
  17. package/dist/components/internal/Overlay/OverlayPortal.d.ts +17 -0
  18. package/dist/components/internal/Overlay/OverlayPortal.d.ts.map +1 -0
  19. package/dist/components/internal/Overlay/OverlayPortal.js +20 -0
  20. package/dist/components/internal/Overlay/OverlayPortal.js.map +1 -0
  21. package/dist/components/internal/Overlay/index.cjs +6 -0
  22. package/dist/components/internal/Overlay/index.d.cts +5 -0
  23. package/dist/components/internal/Overlay/index.d.ts +5 -0
  24. package/dist/components/internal/Overlay/index.js +4 -0
  25. package/dist/components/internal/Overlay/types.cjs +1 -0
  26. package/dist/components/internal/Overlay/types.d.cts +21 -0
  27. package/dist/components/internal/Overlay/types.d.cts.map +1 -0
  28. package/dist/components/internal/Overlay/types.d.ts +21 -0
  29. package/dist/components/internal/Overlay/types.d.ts.map +1 -0
  30. package/dist/components/internal/Overlay/types.js +1 -0
  31. package/dist/components/internal/Overlay/useControllableState.cjs +34 -0
  32. package/dist/components/internal/Overlay/useControllableState.d.cts +18 -0
  33. package/dist/components/internal/Overlay/useControllableState.d.cts.map +1 -0
  34. package/dist/components/internal/Overlay/useControllableState.d.ts +18 -0
  35. package/dist/components/internal/Overlay/useControllableState.d.ts.map +1 -0
  36. package/dist/components/internal/Overlay/useControllableState.js +34 -0
  37. package/dist/components/internal/Overlay/useControllableState.js.map +1 -0
  38. package/dist/portal.cjs +1 -0
  39. package/dist/portal.d.cts +6 -1
  40. package/dist/portal.d.cts.map +1 -1
  41. package/dist/portal.d.ts +6 -1
  42. package/dist/portal.d.ts.map +1 -1
  43. package/dist/portal.js +1 -1
  44. package/dist/portal.js.map +1 -1
  45. package/dist/types/dist/index.d.cts +1 -1
  46. package/dist/types/dist/index.d.cts.map +1 -1
  47. package/dist/types/dist/index.d.ts +1 -1
  48. package/dist/types/dist/index.d.ts.map +1 -1
  49. package/fonts/index.cjs +219 -219
  50. package/fonts/index.mjs +219 -219
  51. package/generated/styles.cjs +114 -0
  52. package/generated/styles.d.ts +29 -0
  53. package/generated/styles.mjs +114 -0
  54. package/generated/unistyles.d.ts +110 -0
  55. package/package.json +11 -1
package/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  `@yahoo/uds-mobile` brings UDS to React Native. It provides:
19
19
 
20
- - **Pre-built Components**: Avatar, Badge, Button, Checkbox, Chip, Divider, Icon, IconButton, Image, Input, Link, Radio, RadioGroup, Switch, Tabs, Text, and layout primitives (Box, VStack, HStack, Screen)
20
+ - **Pre-built Components**: Avatar, Badge, Button, Checkbox, Chip, Divider, Icon, IconButton, Image, Input, InputHelpText, Link, Radio, RadioGroup, Switch, Tabs, Text, and layout primitives (Box, VStack, HStack, Screen)
21
21
  - **Theming**: Full light/dark mode support with automatic system preference detection
22
22
  - **Design Token Integration**: Colors, typography, spacing, and motion configs synced from UDS tokens
23
23
  - **Animations**: Smooth, physics-based animations using Reanimated with motion parity to web
@@ -319,29 +319,30 @@ const styles = StyleSheet.create((theme) => ({
319
319
 
320
320
  ### Available Components
321
321
 
322
- | Component | Description |
323
- | ------------ | ----------------------------------------------- |
324
- | `Avatar` | User avatars with image, initials, or icon |
325
- | `Badge` | Status indicators and labels |
326
- | `Box` | Flexible container with layout props |
327
- | `Button` | Interactive button with variants and animations |
328
- | `Checkbox` | Selectable checkbox with label |
329
- | `Chip` | Compact elements for filters and selections |
330
- | `Divider` | Visual separator for grouping content |
331
- | `HStack` | Horizontal flex container |
332
- | `Icon` | Icon rendering (font or SVG) |
333
- | `IconButton` | Icon-only button |
334
- | `IconSlot` | Flexible icon slot for component composition |
335
- | `Image` | Image component with loading states |
336
- | `Input` | Text input with label and helper text |
337
- | `Link` | Inline text links with icons |
338
- | `Pressable` | Base pressable component |
339
- | `Radio` | Radio button with label |
340
- | `RadioGroup` | Coordinates Radio selection in a group |
341
- | `Screen` | Screen container with safe area handling |
342
- | `Switch` | Toggle switch with animations |
343
- | `Text` | Typography component with variants |
344
- | `VStack` | Vertical flex container |
322
+ | Component | Description |
323
+ | --------------- | ----------------------------------------------- |
324
+ | `Avatar` | User avatars with image, initials, or icon |
325
+ | `Badge` | Status indicators and labels |
326
+ | `Box` | Flexible container with layout props |
327
+ | `Button` | Interactive button with variants and animations |
328
+ | `Checkbox` | Selectable checkbox with label |
329
+ | `Chip` | Compact elements for filters and selections |
330
+ | `Divider` | Visual separator for grouping content |
331
+ | `HStack` | Horizontal flex container |
332
+ | `Icon` | Icon rendering (font or SVG) |
333
+ | `IconButton` | Icon-only button |
334
+ | `IconSlot` | Flexible icon slot for component composition |
335
+ | `Image` | Image component with loading states |
336
+ | `Input` | Text input with label and helper text |
337
+ | `InputHelpText` | Helper text for custom input layouts |
338
+ | `Link` | Inline text links with icons |
339
+ | `Pressable` | Base pressable component |
340
+ | `Radio` | Radio button with label |
341
+ | `RadioGroup` | Coordinates Radio selection in a group |
342
+ | `Screen` | Screen container with safe area handling |
343
+ | `Switch` | Toggle switch with animations |
344
+ | `Text` | Typography component with variants |
345
+ | `VStack` | Vertical flex container |
345
346
 
346
347
  ### Usage Examples
347
348
 
@@ -668,6 +669,7 @@ import type { IconProps, IconName } from '@yahoo/uds-mobile/Icon';
668
669
  import type { IconButtonProps } from '@yahoo/uds-mobile/IconButton';
669
670
  import type { ImageProps } from '@yahoo/uds-mobile/Image';
670
671
  import type { InputProps } from '@yahoo/uds-mobile/Input';
672
+ import type { InputHelpTextProps } from '@yahoo/uds-mobile/InputHelpText';
671
673
  import type { LinkProps } from '@yahoo/uds-mobile/Link';
672
674
  import type { RadioProps } from '@yahoo/uds-mobile/Radio';
673
675
  import type { SwitchProps } from '@yahoo/uds-mobile/Switch';
@@ -696,6 +698,7 @@ import { IconButton } from '@yahoo/uds-mobile/IconButton';
696
698
  import { IconSlot } from '@yahoo/uds-mobile/IconSlot';
697
699
  import { Image } from '@yahoo/uds-mobile/Image';
698
700
  import { Input } from '@yahoo/uds-mobile/Input';
701
+ import { InputHelpText } from '@yahoo/uds-mobile/InputHelpText';
699
702
  import { Link } from '@yahoo/uds-mobile/Link';
700
703
  import { Pressable } from '@yahoo/uds-mobile/Pressable';
701
704
  import { Radio } from '@yahoo/uds-mobile/Radio';
@@ -4,6 +4,7 @@ require("../_virtual/_rolldown/runtime.cjs");
4
4
  const require_components_HStack = require("./HStack.cjs");
5
5
  const require_components_IconSlot = require("./IconSlot.cjs");
6
6
  const require_components_Text = require("./Text.cjs");
7
+ const require_components_InputHelpText = require("./InputHelpText.cjs");
7
8
  const require_components_VStack = require("./VStack.cjs");
8
9
  let react = require("react");
9
10
  let react_native = require("react-native");
@@ -128,23 +129,25 @@ const Input = (0, react.memo)(function Input({ label, size = "md", startIcon, en
128
129
  const helpTextContent = (0, react.useMemo)(() => {
129
130
  if (!helpText) return null;
130
131
  const content = (0, lodash_es.isFunction)(helpText) ? helpText() : helpText;
131
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_HStack.HStack, {
132
- columnGap: "1",
133
- alignItems: "center",
134
- spacingTop: "2",
135
- children: [helperTextIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
136
- icon: helperTextIcon,
137
- style: generated_styles.inputStyles.helperIcon
138
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
139
- style: generated_styles.inputStyles.helperText,
140
- children: content
141
- })]
132
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_InputHelpText.InputHelpText, {
133
+ startIcon: helperTextIcon,
134
+ size,
135
+ isFilled: valueState === "filled",
136
+ disabled,
137
+ readOnly,
138
+ hasError,
139
+ pressed: isFocused,
140
+ children: content
142
141
  });
143
142
  }, [
143
+ disabled,
144
+ hasError,
144
145
  helpText,
145
146
  helperTextIcon,
146
- generated_styles.inputStyles.helperIcon,
147
- generated_styles.inputStyles.helperText
147
+ isFocused,
148
+ readOnly,
149
+ size,
150
+ valueState
148
151
  ]);
149
152
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_VStack.VStack, {
150
153
  style: rootStyle,
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.cts","names":[],"sources":["../../src/components/Input.tsx"],"mappings":";;;;;;;;;UAmBU,UAAA,SAEN,IAAA,CAAK,mBAAA,CAAoB,YAAA,aACzB,IAAA,CAAK,cAAA,yBACL,IAAA,CAAK,SAAA;;EAEP,GAAA,GAAM,GAAA,CAAI,SAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAAS;;;;;;;;;;;cA0Cf,KAAA,EAAK,OAAA,CAAA,oBAAA,CAAA,UAAA"}
1
+ {"version":3,"file":"Input.d.cts","names":[],"sources":["../../src/components/Input.tsx"],"mappings":";;;;;;;;;UAoBU,UAAA,SAEN,IAAA,CAAK,mBAAA,CAAoB,YAAA,aACzB,IAAA,CAAK,cAAA,yBACL,IAAA,CAAK,SAAA;;EAEP,GAAA,GAAM,GAAA,CAAI,SAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAAS;;;;;;;;;;;cA0Cf,KAAA,EAAK,OAAA,CAAA,oBAAA,CAAA,UAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","names":[],"sources":["../../src/components/Input.tsx"],"mappings":";;;;;;;;;UAmBU,UAAA,SAEN,IAAA,CAAK,mBAAA,CAAoB,YAAA,aACzB,IAAA,CAAK,cAAA,yBACL,IAAA,CAAK,SAAA;;EAEP,GAAA,GAAM,GAAA,CAAI,SAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAAS;;;;;;;;;;;cA0Cf,KAAA,EAAK,OAAA,CAAA,oBAAA,CAAA,UAAA"}
1
+ {"version":3,"file":"Input.d.ts","names":[],"sources":["../../src/components/Input.tsx"],"mappings":";;;;;;;;;UAoBU,UAAA,SAEN,IAAA,CAAK,mBAAA,CAAoB,YAAA,aACzB,IAAA,CAAK,cAAA,yBACL,IAAA,CAAK,SAAA;;EAEP,GAAA,GAAM,GAAA,CAAI,SAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAAS;;;;;;;;;;;cA0Cf,KAAA,EAAK,OAAA,CAAA,oBAAA,CAAA,UAAA"}
@@ -2,6 +2,7 @@
2
2
  import { HStack } from "./HStack.js";
3
3
  import { IconSlot } from "./IconSlot.js";
4
4
  import { Text as Text$1 } from "./Text.js";
5
+ import { InputHelpText } from "./InputHelpText.js";
5
6
  import { VStack } from "./VStack.js";
6
7
  import { memo, useCallback, useId, useMemo, useState } from "react";
7
8
  import { TextInput, View } from "react-native";
@@ -126,23 +127,25 @@ const Input = memo(function Input({ label, size = "md", startIcon, endIcon, help
126
127
  const helpTextContent = useMemo(() => {
127
128
  if (!helpText) return null;
128
129
  const content = isFunction(helpText) ? helpText() : helpText;
129
- return /* @__PURE__ */ jsxs(HStack, {
130
- columnGap: "1",
131
- alignItems: "center",
132
- spacingTop: "2",
133
- children: [helperTextIcon && /* @__PURE__ */ jsx(IconSlot, {
134
- icon: helperTextIcon,
135
- style: inputStyles.helperIcon
136
- }), /* @__PURE__ */ jsx(Text$1, {
137
- style: inputStyles.helperText,
138
- children: content
139
- })]
130
+ return /* @__PURE__ */ jsx(InputHelpText, {
131
+ startIcon: helperTextIcon,
132
+ size,
133
+ isFilled: valueState === "filled",
134
+ disabled,
135
+ readOnly,
136
+ hasError,
137
+ pressed: isFocused,
138
+ children: content
140
139
  });
141
140
  }, [
141
+ disabled,
142
+ hasError,
142
143
  helpText,
143
144
  helperTextIcon,
144
- inputStyles.helperIcon,
145
- inputStyles.helperText
145
+ isFocused,
146
+ readOnly,
147
+ size,
148
+ valueState
146
149
  ]);
147
150
  return /* @__PURE__ */ jsxs(VStack, {
148
151
  style: rootStyle,
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","names":["Text"],"sources":["../../src/components/Input.tsx"],"sourcesContent":["import type { UniversalInputProps } from '@yahoo/uds-types';\nimport { isFunction } from 'lodash-es';\nimport type { Ref } from 'react';\nimport { memo, useCallback, useId, useMemo, useState } from 'react';\nimport type { TextInputProps } from 'react-native';\nimport { TextInput, View } from 'react-native';\n\nimport { inputStyles } from '../../generated/styles';\nimport type { SizeProps } from '../types';\nimport { HStack } from './HStack';\nimport type { IconSlotType } from './IconSlot';\nimport { IconSlot } from './IconSlot';\nimport { Text } from './Text';\nimport { VStack } from './VStack';\n\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\ninterface InputProps\n extends\n Omit<UniversalInputProps<IconSlotType>, 'width'>,\n Omit<TextInputProps, 'style' | 'editable'>,\n Pick<SizeProps, 'width'> {\n /** Ref to the underlying TextInput element */\n ref?: Ref<TextInput>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Input Component */\n/* -------------------------------------------------------------------------- */\n\n/**\n * **📦 An input that allows users to enter text and collect data.**\n *\n * @description\n * An input field is a component that takes text typed into it. It can also serve\n * as a way to display a selection and trigger a dropdown menu. Inputs are interactive\n * elements that users can click, tap, or otherwise engage with to collect data.\n *\n * @category Form\n * @platform mobile\n *\n * @example\n * ```tsx\n * import { Input } from '@yahoo/uds-mobile/Input';\n *\n * <Input label=\"Name\" placeholder=\"Enter your name\" required />\n * <Input label=\"Email\" startIcon=\"Mail\" helpText=\"We'll never share your email\" />\n * <Input label=\"Password\" secureTextEntry hasError helpText=\"Password is required\" />\n * ```\n *\n * @usage\n * - Forms: For collecting data like names, emails, passwords, etc.\n * - Search Bars: Allowing users to enter search queries\n * - Filters/Settings: When users need to specify preferences\n * - Feedback/Comments: Letting users leave reviews or comments\n *\n * @accessibility\n * - Label is automatically associated with the input\n * - Help text is announced as accessibility hint\n * - Error state is communicated to screen readers\n * - Disabled state prevents interaction\n *\n * @see {@link Checkbox} for boolean selections\n * @see {@link Radio} for single-select options\n */\nconst Input = memo(function Input({\n // Input props\n label,\n size = 'md',\n startIcon,\n endIcon,\n helpText,\n helperTextIcon,\n hasError,\n disabled,\n readOnly,\n required,\n // Size props\n width = '100%',\n // TextInput props\n defaultValue,\n value: controlledValue,\n onChangeText,\n onFocus,\n onBlur,\n placeholder,\n placeholderTextColor,\n ref,\n ...textInputProps\n}: InputProps) {\n const generatedId = useId();\n const uid = `uds-input-${generatedId}`;\n\n /* --------------------------------- State ---------------------------------- */\n const [internalValue, setInternalValue] = useState(defaultValue ?? '');\n const [isFocused, setIsFocused] = useState(false);\n\n // Support both controlled and uncontrolled modes\n const isControlled = controlledValue !== undefined;\n const value = isControlled ? controlledValue : internalValue;\n const valueState = value ? 'filled' : 'empty';\n\n /* -------------------------------- Handlers -------------------------------- */\n const handleChangeText = useCallback(\n (text: string) => {\n if (!isControlled) {\n setInternalValue(text);\n }\n onChangeText?.(text);\n },\n [isControlled, onChangeText],\n );\n\n const handleFocus = useCallback<NonNullable<TextInputProps['onFocus']>>(\n (e) => {\n setIsFocused(true);\n onFocus?.(e);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback<NonNullable<TextInputProps['onBlur']>>(\n (e) => {\n setIsFocused(false);\n onBlur?.(e);\n },\n [onBlur],\n );\n\n /* --------------------------------- Styles --------------------------------- */\n inputStyles.useVariants({\n size,\n value: valueState,\n disabled,\n pressed: isFocused,\n readonly: readOnly,\n invalid: hasError,\n });\n\n // Get placeholder color from theme styles\n const computedPlaceholderColor = placeholderTextColor ?? inputStyles.inputPlaceholder.color;\n\n const rootStyle = useMemo(() => [{ width, opacity: disabled ? 0.5 : 1 }], [width, disabled]);\n\n const inputWrapperStyle = useMemo(\n () => [\n inputStyles.inputWrapper,\n { flexDirection: 'row' as const, alignItems: 'center' as const },\n ],\n [inputStyles.inputWrapper],\n );\n\n // Android-specific fixes: TextInput on Android has rendering issues with text visibility\n // - includeFontPadding: false removes Android's extra font padding that can clip text\n // - textAlignVertical: 'center' ensures text is vertically centered in the input\n // - paddingVertical: 0 removes default padding that interferes with flex layout\n const textInputStyle = useMemo(\n () => [\n inputStyles.input,\n {\n flex: 1,\n includeFontPadding: false,\n textAlignVertical: 'center' as const,\n paddingVertical: 0,\n },\n ],\n [inputStyles.input],\n );\n\n /* ---------------------------- Render Helpers ------------------------------ */\n const labelContent = useMemo(() => {\n if (!label) {\n return null;\n }\n const content = isFunction(label) ? label() : label;\n return (\n <HStack columnGap=\"1\" alignItems=\"flex-end\" spacingBottom=\"2\">\n <Text style={inputStyles.label}>{content}</Text>\n {required && <Text style={inputStyles.labelRequired}>*</Text>}\n </HStack>\n );\n }, [label, required, inputStyles.label, inputStyles.labelRequired]);\n\n const startIconContent = useMemo(() => {\n if (!startIcon) {\n return null;\n }\n return <IconSlot icon={startIcon} variant=\"outline\" style={inputStyles.startIcon} />;\n }, [startIcon, inputStyles.startIcon]);\n\n const endIconContent = useMemo(() => {\n if (!endIcon) {\n return null;\n }\n return <IconSlot icon={endIcon} variant=\"outline\" style={inputStyles.endIcon} />;\n }, [endIcon, inputStyles.endIcon]);\n\n const helpTextContent = useMemo(() => {\n if (!helpText) {\n return null;\n }\n const content = isFunction(helpText) ? helpText() : helpText;\n return (\n <HStack columnGap=\"1\" alignItems=\"center\" spacingTop=\"2\">\n {helperTextIcon && <IconSlot icon={helperTextIcon} style={inputStyles.helperIcon} />}\n <Text style={inputStyles.helperText}>{content}</Text>\n </HStack>\n );\n }, [helpText, helperTextIcon, inputStyles.helperIcon, inputStyles.helperText]);\n\n /* --------------------------------- Render --------------------------------- */\n return (\n <VStack style={rootStyle}>\n {labelContent}\n\n <View\n style={inputWrapperStyle}\n accessible\n accessibilityRole=\"none\"\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n >\n {startIconContent}\n\n <TextInput\n ref={ref}\n nativeID={uid}\n value={value}\n onChangeText={handleChangeText}\n onFocus={handleFocus}\n onBlur={handleBlur}\n placeholder={placeholder}\n placeholderTextColor={computedPlaceholderColor}\n editable={!disabled && !readOnly}\n style={textInputStyle}\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n accessibilityHint={typeof helpText === 'string' ? helpText : undefined}\n accessibilityState={{ disabled }}\n {...textInputProps}\n />\n\n {endIconContent}\n </View>\n\n {helpTextContent}\n </VStack>\n );\n});\n\nInput.displayName = 'Input';\n\nexport { Input, type InputProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA,MAAM,QAAQ,KAAK,SAAS,MAAM,EAEhC,OACA,OAAO,MACP,WACA,SACA,UACA,gBACA,UACA,UACA,UACA,UAEA,QAAQ,QAER,cACA,OAAO,iBACP,cACA,SACA,QACA,aACA,sBACA,KACA,GAAG,kBACU;CAEb,MAAM,MAAM,aADQ,OACgB;CAGpC,MAAM,CAAC,eAAe,oBAAoB,SAAS,gBAAgB,GAAG;CACtE,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CAGjD,MAAM,eAAe,oBAAoB,KAAA;CACzC,MAAM,QAAQ,eAAe,kBAAkB;CAC/C,MAAM,aAAa,QAAQ,WAAW;CAGtC,MAAM,mBAAmB,aACtB,SAAiB;EAChB,IAAI,CAAC,cACH,iBAAiB,KAAK;EAExB,eAAe,KAAK;IAEtB,CAAC,cAAc,aAAa,CAC7B;CAED,MAAM,cAAc,aACjB,MA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GAAU,MAAM;GAAS,SAAQ;GAAU,OAAO,YAAY;GAAW,CAAA;IAC/E,CAAC,SAAS,YAAY,QAAQ,CAAC;CAElC,MAAM,kBAAkB,cAAc;EACpC,IAAI,CAAC,UACH,OAAO;EAET,MAAM,UAAU,WAAW,SAAS,GAAG,UAAU,GAAG;EACpD,OACE,qBAAC,QAAD;GAAQ,WAAU;GAAI,YAAW;GAAS,YAAW;aAArD,CACG,kBAAkB,oBAAC,UAAD;IAAU,MAAM;IAAgB,OAAO,YAAY;IAAc,CAAA,EACpF,oBAACA,QAAD;IAAM,OAAO,YAAY;cAAa;IAAe,CAAA,CAC9C;;IAEV;EAAC;EAAU;EAAgB,YAAY;EAAY,YAAY;EAAW,CAAC;CAG9E,OACE,qBAAC,QAAD;EAAQ,OAAO;YAAf;GACG;GAED,qBAAC,MAAD;IACE,OAAO;IACP,YAAA;IACA,mBAAkB;IAClB,oBAAoB,OAAO,UAAU,WAAW,QAAQ,KAAA;cAJ1D;KAMG;KAED,oBAAC,WAAD;MACO;MACL,UAAU;MACH;MACP,cAAc;MACd,SAAS;MACT,QAAQ;MACK;MACb,sBAAsB;MACtB,UAAU,CAAC,YAAY,CAAC;MACxB,OAAO;MACP,oBAAoB,OAAO,UAAU,WAAW,QAAQ,KAAA;MACxD,mBAAmB,OAAO,aAAa,WAAW,WAAW,KAAA;MAC7D,oBAAoB,EAAE,UAAU;MAChC,GAAI;MACJ,CAAA;KAED;KACI;;GAEN;GACM;;EAEX;AAEF,MAAM,cAAc"}
1
+ {"version":3,"file":"Input.js","names":["Text"],"sources":["../../src/components/Input.tsx"],"sourcesContent":["import type { UniversalInputProps } from '@yahoo/uds-types';\nimport { isFunction } from 'lodash-es';\nimport type { Ref } from 'react';\nimport { memo, useCallback, useId, useMemo, useState } from 'react';\nimport type { TextInputProps } from 'react-native';\nimport { TextInput, View } from 'react-native';\n\nimport { inputStyles } from '../../generated/styles';\nimport type { SizeProps } from '../types';\nimport { HStack } from './HStack';\nimport type { IconSlotType } from './IconSlot';\nimport { IconSlot } from './IconSlot';\nimport { InputHelpText } from './InputHelpText';\nimport { Text } from './Text';\nimport { VStack } from './VStack';\n\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\ninterface InputProps\n extends\n Omit<UniversalInputProps<IconSlotType>, 'width'>,\n Omit<TextInputProps, 'style' | 'editable'>,\n Pick<SizeProps, 'width'> {\n /** Ref to the underlying TextInput element */\n ref?: Ref<TextInput>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Input Component */\n/* -------------------------------------------------------------------------- */\n\n/**\n * **📦 An input that allows users to enter text and collect data.**\n *\n * @description\n * An input field is a component that takes text typed into it. It can also serve\n * as a way to display a selection and trigger a dropdown menu. Inputs are interactive\n * elements that users can click, tap, or otherwise engage with to collect data.\n *\n * @category Form\n * @platform mobile\n *\n * @example\n * ```tsx\n * import { Input } from '@yahoo/uds-mobile/Input';\n *\n * <Input label=\"Name\" placeholder=\"Enter your name\" required />\n * <Input label=\"Email\" startIcon=\"Mail\" helpText=\"We'll never share your email\" />\n * <Input label=\"Password\" secureTextEntry hasError helpText=\"Password is required\" />\n * ```\n *\n * @usage\n * - Forms: For collecting data like names, emails, passwords, etc.\n * - Search Bars: Allowing users to enter search queries\n * - Filters/Settings: When users need to specify preferences\n * - Feedback/Comments: Letting users leave reviews or comments\n *\n * @accessibility\n * - Label is automatically associated with the input\n * - Help text is announced as accessibility hint\n * - Error state is communicated to screen readers\n * - Disabled state prevents interaction\n *\n * @see {@link Checkbox} for boolean selections\n * @see {@link Radio} for single-select options\n */\nconst Input = memo(function Input({\n // Input props\n label,\n size = 'md',\n startIcon,\n endIcon,\n helpText,\n helperTextIcon,\n hasError,\n disabled,\n readOnly,\n required,\n // Size props\n width = '100%',\n // TextInput props\n defaultValue,\n value: controlledValue,\n onChangeText,\n onFocus,\n onBlur,\n placeholder,\n placeholderTextColor,\n ref,\n ...textInputProps\n}: InputProps) {\n const generatedId = useId();\n const uid = `uds-input-${generatedId}`;\n\n /* --------------------------------- State ---------------------------------- */\n const [internalValue, setInternalValue] = useState(defaultValue ?? '');\n const [isFocused, setIsFocused] = useState(false);\n\n // Support both controlled and uncontrolled modes\n const isControlled = controlledValue !== undefined;\n const value = isControlled ? controlledValue : internalValue;\n const valueState = value ? 'filled' : 'empty';\n\n /* -------------------------------- Handlers -------------------------------- */\n const handleChangeText = useCallback(\n (text: string) => {\n if (!isControlled) {\n setInternalValue(text);\n }\n onChangeText?.(text);\n },\n [isControlled, onChangeText],\n );\n\n const handleFocus = useCallback<NonNullable<TextInputProps['onFocus']>>(\n (e) => {\n setIsFocused(true);\n onFocus?.(e);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback<NonNullable<TextInputProps['onBlur']>>(\n (e) => {\n setIsFocused(false);\n onBlur?.(e);\n },\n [onBlur],\n );\n\n /* --------------------------------- Styles --------------------------------- */\n inputStyles.useVariants({\n size,\n value: valueState,\n disabled,\n pressed: isFocused,\n readonly: readOnly,\n invalid: hasError,\n });\n\n // Get placeholder color from theme styles\n const computedPlaceholderColor = placeholderTextColor ?? inputStyles.inputPlaceholder.color;\n\n const rootStyle = useMemo(() => [{ width, opacity: disabled ? 0.5 : 1 }], [width, disabled]);\n\n const inputWrapperStyle = useMemo(\n () => [\n inputStyles.inputWrapper,\n { flexDirection: 'row' as const, alignItems: 'center' as const },\n ],\n [inputStyles.inputWrapper],\n );\n\n // Android-specific fixes: TextInput on Android has rendering issues with text visibility\n // - includeFontPadding: false removes Android's extra font padding that can clip text\n // - textAlignVertical: 'center' ensures text is vertically centered in the input\n // - paddingVertical: 0 removes default padding that interferes with flex layout\n const textInputStyle = useMemo(\n () => [\n inputStyles.input,\n {\n flex: 1,\n includeFontPadding: false,\n textAlignVertical: 'center' as const,\n paddingVertical: 0,\n },\n ],\n [inputStyles.input],\n );\n\n /* ---------------------------- Render Helpers ------------------------------ */\n const labelContent = useMemo(() => {\n if (!label) {\n return null;\n }\n const content = isFunction(label) ? label() : label;\n return (\n <HStack columnGap=\"1\" alignItems=\"flex-end\" spacingBottom=\"2\">\n <Text style={inputStyles.label}>{content}</Text>\n {required && <Text style={inputStyles.labelRequired}>*</Text>}\n </HStack>\n );\n }, [label, required, inputStyles.label, inputStyles.labelRequired]);\n\n const startIconContent = useMemo(() => {\n if (!startIcon) {\n return null;\n }\n return <IconSlot icon={startIcon} variant=\"outline\" style={inputStyles.startIcon} />;\n }, [startIcon, inputStyles.startIcon]);\n\n const endIconContent = useMemo(() => {\n if (!endIcon) {\n return null;\n }\n return <IconSlot icon={endIcon} variant=\"outline\" style={inputStyles.endIcon} />;\n }, [endIcon, inputStyles.endIcon]);\n\n const helpTextContent = useMemo(() => {\n if (!helpText) {\n return null;\n }\n const content = isFunction(helpText) ? helpText() : helpText;\n return (\n <InputHelpText\n startIcon={helperTextIcon}\n size={size}\n isFilled={valueState === 'filled'}\n disabled={disabled}\n readOnly={readOnly}\n hasError={hasError}\n pressed={isFocused}\n >\n {content}\n </InputHelpText>\n );\n }, [disabled, hasError, helpText, helperTextIcon, isFocused, readOnly, size, valueState]);\n\n /* --------------------------------- Render --------------------------------- */\n return (\n <VStack style={rootStyle}>\n {labelContent}\n\n <View\n style={inputWrapperStyle}\n accessible\n accessibilityRole=\"none\"\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n >\n {startIconContent}\n\n <TextInput\n ref={ref}\n nativeID={uid}\n value={value}\n onChangeText={handleChangeText}\n onFocus={handleFocus}\n onBlur={handleBlur}\n placeholder={placeholder}\n placeholderTextColor={computedPlaceholderColor}\n editable={!disabled && !readOnly}\n style={textInputStyle}\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n accessibilityHint={typeof helpText === 'string' ? helpText : undefined}\n accessibilityState={{ disabled }}\n {...textInputProps}\n />\n\n {endIconContent}\n </View>\n\n {helpTextContent}\n </VStack>\n );\n});\n\nInput.displayName = 'Input';\n\nexport { Input, type InputProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAoB,OAAO,UAAU,WAAW,QAAQ,KAAA;MACxD,mBAAmB,OAAO,aAAa,WAAW,WAAW,KAAA;MAC7D,oBAAoB,EAAE,UAAU;MAChC,GAAI;MACJ,CAAA;KAED;KACI;;GAEN;GACM;;EAEX;AAEF,MAAM,cAAc"}
@@ -0,0 +1,52 @@
1
+ /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ require("../_virtual/_rolldown/runtime.cjs");
4
+ const require_components_HStack = require("./HStack.cjs");
5
+ const require_components_IconSlot = require("./IconSlot.cjs");
6
+ const require_components_Text = require("./Text.cjs");
7
+ let react = require("react");
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ let generated_styles = require("../../generated/styles");
10
+ //#region src/components/InputHelpText.tsx
11
+ const InputHelpText = (0, react.memo)(function InputHelpText({ children, startIcon, endIcon, iconProps, size = "md", isFilled = false, disabled, readOnly, hasError, pressed, ref, ...hStackProps }) {
12
+ const { style: iconStyle, variant = "outline", ...resolvedIconProps } = iconProps ?? {};
13
+ const value = isFilled ? "filled" : "empty";
14
+ generated_styles.inputStyles.useVariants({
15
+ size,
16
+ value,
17
+ disabled,
18
+ pressed,
19
+ readonly: readOnly,
20
+ invalid: hasError
21
+ });
22
+ const resolvedIconStyle = (0, react.useMemo)(() => [generated_styles.inputStyles.helperIcon, iconStyle], [iconStyle, generated_styles.inputStyles.helperIcon]);
23
+ if (children === null || children === void 0 || children === false) return null;
24
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_HStack.HStack, {
25
+ ref,
26
+ columnGap: "1",
27
+ alignItems: "center",
28
+ spacingTop: "2",
29
+ ...hStackProps,
30
+ children: [
31
+ startIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
32
+ icon: startIcon,
33
+ variant,
34
+ style: resolvedIconStyle,
35
+ ...resolvedIconProps
36
+ }),
37
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
38
+ style: generated_styles.inputStyles.helperText,
39
+ children
40
+ }),
41
+ endIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
42
+ icon: endIcon,
43
+ variant,
44
+ style: resolvedIconStyle,
45
+ ...resolvedIconProps
46
+ })
47
+ ]
48
+ });
49
+ });
50
+ InputHelpText.displayName = "InputHelpText";
51
+ //#endregion
52
+ exports.InputHelpText = InputHelpText;
@@ -0,0 +1,37 @@
1
+
2
+ import { InputSize } from "../types/dist/index.cjs";
3
+ import { IconSlotProps, IconSlotType } from "./IconSlot.cjs";
4
+ import { HStackProps } from "./HStack.cjs";
5
+ import * as _$react from "react";
6
+ import { ReactNode, Ref } from "react";
7
+ import { View } from "react-native";
8
+
9
+ //#region src/components/InputHelpText.d.ts
10
+ interface InputHelpTextProps extends Omit<HStackProps, 'children' | 'ref'> {
11
+ /** Ref to the underlying root View. */
12
+ ref?: Ref<View>;
13
+ /** Helper text content. */
14
+ children?: ReactNode;
15
+ /** Icon to render before the help text. */
16
+ startIcon?: IconSlotType;
17
+ /** Icon to render after the help text. */
18
+ endIcon?: IconSlotType;
19
+ /** Props to apply to both helper icons. */
20
+ iconProps?: Omit<IconSlotProps, 'icon' | 'ref'>;
21
+ /** Input size used to resolve configured helper text styles. */
22
+ size?: InputSize;
23
+ /** Whether the associated input has a value. */
24
+ isFilled?: boolean;
25
+ /** Whether the associated input is disabled. */
26
+ disabled?: boolean;
27
+ /** Whether the associated input is read-only. */
28
+ readOnly?: boolean;
29
+ /** Whether the associated input has a validation error. */
30
+ hasError?: boolean;
31
+ /** Whether the associated input is focused or pressed. */
32
+ pressed?: boolean;
33
+ }
34
+ declare const InputHelpText: _$react.NamedExoticComponent<InputHelpTextProps>;
35
+ //#endregion
36
+ export { InputHelpText, type InputHelpTextProps };
37
+ //# sourceMappingURL=InputHelpText.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputHelpText.d.cts","names":[],"sources":["../../src/components/InputHelpText.tsx"],"mappings":";;;;;;;;;UAaU,kBAAA,SAA2B,IAAA,CAAK,WAAA;;EAExC,GAAA,GAAM,GAAA,CAAI,IAAA;EAFF;EAIR,QAAA,GAAW,SAAA;;EAEX,SAAA,GAAY,YAAA;EAJF;EAMV,OAAA,GAAU,YAAA;EAJC;EAMX,SAAA,GAAY,IAAA,CAAK,aAAA;EAFP;EAIV,IAAA,GAAO,SAAA;EAFK;EAIZ,QAAA;EAdmC;EAgBnC,QAAA;EAhBuC;EAkBvC,QAAA;EAlBwC;EAoBxC,QAAA;EAlBM;EAoBN,OAAA;AAAA;AAAA,cAGI,aAAA,EAAa,OAAA,CAAA,oBAAA,CAAA,kBAAA"}
@@ -0,0 +1,37 @@
1
+
2
+ import { InputSize } from "../types/dist/index.js";
3
+ import { IconSlotProps, IconSlotType } from "./IconSlot.js";
4
+ import { HStackProps } from "./HStack.js";
5
+ import * as _$react from "react";
6
+ import { ReactNode, Ref } from "react";
7
+ import { View } from "react-native";
8
+
9
+ //#region src/components/InputHelpText.d.ts
10
+ interface InputHelpTextProps extends Omit<HStackProps, 'children' | 'ref'> {
11
+ /** Ref to the underlying root View. */
12
+ ref?: Ref<View>;
13
+ /** Helper text content. */
14
+ children?: ReactNode;
15
+ /** Icon to render before the help text. */
16
+ startIcon?: IconSlotType;
17
+ /** Icon to render after the help text. */
18
+ endIcon?: IconSlotType;
19
+ /** Props to apply to both helper icons. */
20
+ iconProps?: Omit<IconSlotProps, 'icon' | 'ref'>;
21
+ /** Input size used to resolve configured helper text styles. */
22
+ size?: InputSize;
23
+ /** Whether the associated input has a value. */
24
+ isFilled?: boolean;
25
+ /** Whether the associated input is disabled. */
26
+ disabled?: boolean;
27
+ /** Whether the associated input is read-only. */
28
+ readOnly?: boolean;
29
+ /** Whether the associated input has a validation error. */
30
+ hasError?: boolean;
31
+ /** Whether the associated input is focused or pressed. */
32
+ pressed?: boolean;
33
+ }
34
+ declare const InputHelpText: _$react.NamedExoticComponent<InputHelpTextProps>;
35
+ //#endregion
36
+ export { InputHelpText, type InputHelpTextProps };
37
+ //# sourceMappingURL=InputHelpText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputHelpText.d.ts","names":[],"sources":["../../src/components/InputHelpText.tsx"],"mappings":";;;;;;;;;UAaU,kBAAA,SAA2B,IAAA,CAAK,WAAA;;EAExC,GAAA,GAAM,GAAA,CAAI,IAAA;EAFF;EAIR,QAAA,GAAW,SAAA;;EAEX,SAAA,GAAY,YAAA;EAJF;EAMV,OAAA,GAAU,YAAA;EAJC;EAMX,SAAA,GAAY,IAAA,CAAK,aAAA;EAFP;EAIV,IAAA,GAAO,SAAA;EAFK;EAIZ,QAAA;EAdmC;EAgBnC,QAAA;EAhBuC;EAkBvC,QAAA;EAlBwC;EAoBxC,QAAA;EAlBM;EAoBN,OAAA;AAAA;AAAA,cAGI,aAAA,EAAa,OAAA,CAAA,oBAAA,CAAA,kBAAA"}
@@ -0,0 +1,52 @@
1
+ /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
+ import { HStack } from "./HStack.js";
3
+ import { IconSlot } from "./IconSlot.js";
4
+ import { Text } from "./Text.js";
5
+ import { memo, useMemo } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { inputStyles } from "../../generated/styles";
8
+ //#region src/components/InputHelpText.tsx
9
+ const InputHelpText = memo(function InputHelpText({ children, startIcon, endIcon, iconProps, size = "md", isFilled = false, disabled, readOnly, hasError, pressed, ref, ...hStackProps }) {
10
+ const { style: iconStyle, variant = "outline", ...resolvedIconProps } = iconProps ?? {};
11
+ const value = isFilled ? "filled" : "empty";
12
+ inputStyles.useVariants({
13
+ size,
14
+ value,
15
+ disabled,
16
+ pressed,
17
+ readonly: readOnly,
18
+ invalid: hasError
19
+ });
20
+ const resolvedIconStyle = useMemo(() => [inputStyles.helperIcon, iconStyle], [iconStyle, inputStyles.helperIcon]);
21
+ if (children === null || children === void 0 || children === false) return null;
22
+ return /* @__PURE__ */ jsxs(HStack, {
23
+ ref,
24
+ columnGap: "1",
25
+ alignItems: "center",
26
+ spacingTop: "2",
27
+ ...hStackProps,
28
+ children: [
29
+ startIcon && /* @__PURE__ */ jsx(IconSlot, {
30
+ icon: startIcon,
31
+ variant,
32
+ style: resolvedIconStyle,
33
+ ...resolvedIconProps
34
+ }),
35
+ /* @__PURE__ */ jsx(Text, {
36
+ style: inputStyles.helperText,
37
+ children
38
+ }),
39
+ endIcon && /* @__PURE__ */ jsx(IconSlot, {
40
+ icon: endIcon,
41
+ variant,
42
+ style: resolvedIconStyle,
43
+ ...resolvedIconProps
44
+ })
45
+ ]
46
+ });
47
+ });
48
+ InputHelpText.displayName = "InputHelpText";
49
+ //#endregion
50
+ export { InputHelpText };
51
+
52
+ //# sourceMappingURL=InputHelpText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputHelpText.js","names":[],"sources":["../../src/components/InputHelpText.tsx"],"sourcesContent":["import type { InputSize } from '@yahoo/uds-types';\nimport type { ReactNode, Ref } from 'react';\nimport { memo, useMemo } from 'react';\nimport type { View } from 'react-native';\n\nimport { inputStyles } from '../../generated/styles';\nimport type { HStackProps } from './HStack';\nimport { HStack } from './HStack';\nimport type { IconSlotProps, IconSlotType } from './IconSlot';\nimport { IconSlot } from './IconSlot';\nimport type { TextProps } from './Text';\nimport { Text } from './Text';\n\ninterface InputHelpTextProps extends Omit<HStackProps, 'children' | 'ref'> {\n /** Ref to the underlying root View. */\n ref?: Ref<View>;\n /** Helper text content. */\n children?: ReactNode;\n /** Icon to render before the help text. */\n startIcon?: IconSlotType;\n /** Icon to render after the help text. */\n endIcon?: IconSlotType;\n /** Props to apply to both helper icons. */\n iconProps?: Omit<IconSlotProps, 'icon' | 'ref'>;\n /** Input size used to resolve configured helper text styles. */\n size?: InputSize;\n /** Whether the associated input has a value. */\n isFilled?: boolean;\n /** Whether the associated input is disabled. */\n disabled?: boolean;\n /** Whether the associated input is read-only. */\n readOnly?: boolean;\n /** Whether the associated input has a validation error. */\n hasError?: boolean;\n /** Whether the associated input is focused or pressed. */\n pressed?: boolean;\n}\n\nconst InputHelpText = memo(function InputHelpText({\n children,\n startIcon,\n endIcon,\n iconProps,\n size = 'md',\n isFilled = false,\n disabled,\n readOnly,\n hasError,\n pressed,\n ref,\n ...hStackProps\n}: InputHelpTextProps) {\n const { style: iconStyle, variant = 'outline', ...resolvedIconProps } = iconProps ?? {};\n const value = isFilled ? 'filled' : 'empty';\n\n inputStyles.useVariants({\n size,\n value,\n disabled,\n pressed,\n readonly: readOnly,\n invalid: hasError,\n });\n\n const resolvedIconStyle = useMemo(\n () => [inputStyles.helperIcon, iconStyle],\n [iconStyle, inputStyles.helperIcon],\n );\n\n if (children === null || children === undefined || children === false) {\n return null;\n }\n\n return (\n <HStack ref={ref} columnGap=\"1\" alignItems=\"center\" spacingTop=\"2\" {...hStackProps}>\n {startIcon && (\n <IconSlot\n icon={startIcon}\n variant={variant}\n style={resolvedIconStyle}\n {...resolvedIconProps}\n />\n )}\n\n <Text style={inputStyles.helperText as TextProps['style']}>{children}</Text>\n\n {endIcon && (\n <IconSlot\n icon={endIcon}\n variant={variant}\n style={resolvedIconStyle}\n {...resolvedIconProps}\n />\n )}\n </HStack>\n );\n});\n\nInputHelpText.displayName = 'InputHelpText';\n\nexport { InputHelpText, type InputHelpTextProps };\n"],"mappings":";;;;;;;;AAsCA,MAAM,gBAAgB,KAAK,SAAS,cAAc,EAChD,UACA,WACA,SACA,WACA,OAAO,MACP,WAAW,OACX,UACA,UACA,UACA,SACA,KACA,GAAG,eACkB;CACrB,MAAM,EAAE,OAAO,WAAW,UAAU,WAAW,GAAG,sBAAsB,aAAa,EAAE;CACvF,MAAM,QAAQ,WAAW,WAAW;CAEpC,YAAY,YAAY;EACtB;EACA;EACA;EACA;EACA,UAAU;EACV,SAAS;EACV,CAAC;CAEF,MAAM,oBAAoB,cAClB,CAAC,YAAY,YAAY,UAAU,EACzC,CAAC,WAAW,YAAY,WAAW,CACpC;CAED,IAAI,aAAa,QAAQ,aAAa,KAAA,KAAa,aAAa,OAC9D,OAAO;CAGT,OACE,qBAAC,QAAD;EAAa;EAAK,WAAU;EAAI,YAAW;EAAS,YAAW;EAAI,GAAI;YAAvE;GACG,aACC,oBAAC,UAAD;IACE,MAAM;IACG;IACT,OAAO;IACP,GAAI;IACJ,CAAA;GAGJ,oBAAC,MAAD;IAAM,OAAO,YAAY;IAAmC;IAAgB,CAAA;GAE3E,WACC,oBAAC,UAAD;IACE,MAAM;IACG;IACT,OAAO;IACP,GAAI;IACJ,CAAA;GAEG;;EAEX;AAEF,cAAc,cAAc"}
@@ -0,0 +1,20 @@
1
+ /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ require("../../../_virtual/_rolldown/runtime.cjs");
4
+ const require_portal = require("../../../portal.cjs");
5
+ let react_native = require("react-native");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ let react_native_screens = require("react-native-screens");
8
+ //#region src/components/internal/Overlay/OverlayPortal.tsx
9
+ /**
10
+ * Internal portal wrapper for mobile overlays.
11
+ *
12
+ * Uses `FullWindowOverlay` on iOS when requested, otherwise renders through the UDS portal host.
13
+ */
14
+ function OverlayPortal({ children, useFullWindowOverlay = true }) {
15
+ require_portal.usePortalContext();
16
+ if (react_native.Platform.OS === "ios" && useFullWindowOverlay) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_screens.FullWindowOverlay, { children });
17
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_portal.Portal, { children });
18
+ }
19
+ //#endregion
20
+ exports.OverlayPortal = OverlayPortal;
@@ -0,0 +1,17 @@
1
+
2
+ import { OverlayPortalProps } from "./types.cjs";
3
+ import * as _$react from "react";
4
+
5
+ //#region src/components/internal/Overlay/OverlayPortal.d.ts
6
+ /**
7
+ * Internal portal wrapper for mobile overlays.
8
+ *
9
+ * Uses `FullWindowOverlay` on iOS when requested, otherwise renders through the UDS portal host.
10
+ */
11
+ declare function OverlayPortal({
12
+ children,
13
+ useFullWindowOverlay
14
+ }: OverlayPortalProps): _$react.JSX.Element;
15
+ //#endregion
16
+ export { OverlayPortal };
17
+ //# sourceMappingURL=OverlayPortal.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OverlayPortal.d.cts","names":[],"sources":["../../../../src/components/internal/Overlay/OverlayPortal.tsx"],"mappings":";;;;;;;;AAIkD;;iBAOzC,aAAA,CAAA;EAAgB,QAAA;EAAU;AAAA,GAA+B,kBAAA,GAAkB,OAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -0,0 +1,17 @@
1
+
2
+ import { OverlayPortalProps } from "./types.js";
3
+ import * as _$react from "react";
4
+
5
+ //#region src/components/internal/Overlay/OverlayPortal.d.ts
6
+ /**
7
+ * Internal portal wrapper for mobile overlays.
8
+ *
9
+ * Uses `FullWindowOverlay` on iOS when requested, otherwise renders through the UDS portal host.
10
+ */
11
+ declare function OverlayPortal({
12
+ children,
13
+ useFullWindowOverlay
14
+ }: OverlayPortalProps): _$react.JSX.Element;
15
+ //#endregion
16
+ export { OverlayPortal };
17
+ //# sourceMappingURL=OverlayPortal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OverlayPortal.d.ts","names":[],"sources":["../../../../src/components/internal/Overlay/OverlayPortal.tsx"],"mappings":";;;;;;;;AAIkD;;iBAOzC,aAAA,CAAA;EAAgB,QAAA;EAAU;AAAA,GAA+B,kBAAA,GAAkB,OAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -0,0 +1,20 @@
1
+ /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
+ import { Portal, usePortalContext } from "../../../portal.js";
3
+ import { Platform } from "react-native";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { FullWindowOverlay } from "react-native-screens";
6
+ //#region src/components/internal/Overlay/OverlayPortal.tsx
7
+ /**
8
+ * Internal portal wrapper for mobile overlays.
9
+ *
10
+ * Uses `FullWindowOverlay` on iOS when requested, otherwise renders through the UDS portal host.
11
+ */
12
+ function OverlayPortal({ children, useFullWindowOverlay = true }) {
13
+ usePortalContext();
14
+ if (Platform.OS === "ios" && useFullWindowOverlay) return /* @__PURE__ */ jsx(FullWindowOverlay, { children });
15
+ return /* @__PURE__ */ jsx(Portal, { children });
16
+ }
17
+ //#endregion
18
+ export { OverlayPortal };
19
+
20
+ //# sourceMappingURL=OverlayPortal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OverlayPortal.js","names":[],"sources":["../../../../src/components/internal/Overlay/OverlayPortal.tsx"],"sourcesContent":["import { Platform } from 'react-native';\nimport { FullWindowOverlay } from 'react-native-screens';\n\nimport { Portal, usePortalContext } from '../../../portal';\nimport type { OverlayPortalProps } from './types';\n\n/**\n * Internal portal wrapper for mobile overlays.\n *\n * Uses `FullWindowOverlay` on iOS when requested, otherwise renders through the UDS portal host.\n */\nfunction OverlayPortal({ children, useFullWindowOverlay = true }: OverlayPortalProps) {\n // Always assert UDSProvider presence, even when iOS renders through FullWindowOverlay.\n usePortalContext();\n\n if (Platform.OS === 'ios' && useFullWindowOverlay) {\n return <FullWindowOverlay>{children}</FullWindowOverlay>;\n }\n\n return <Portal>{children}</Portal>;\n}\n\nexport { OverlayPortal };\n"],"mappings":";;;;;;;;;;;AAWA,SAAS,cAAc,EAAE,UAAU,uBAAuB,QAA4B;CAEpF,kBAAkB;CAElB,IAAI,SAAS,OAAO,SAAS,sBAC3B,OAAO,oBAAC,mBAAD,EAAoB,UAA6B,CAAA;CAG1D,OAAO,oBAAC,QAAD,EAAS,UAAkB,CAAA"}
@@ -0,0 +1,6 @@
1
+ /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require_components_internal_Overlay_OverlayPortal = require("./OverlayPortal.cjs");
4
+ const require_components_internal_Overlay_useControllableState = require("./useControllableState.cjs");
5
+ exports.OverlayPortal = require_components_internal_Overlay_OverlayPortal.OverlayPortal;
6
+ exports.useControllableState = require_components_internal_Overlay_useControllableState.useControllableState;
@@ -0,0 +1,5 @@
1
+
2
+ import { OverlayPortalProps, UseControllableStateProps, UseControllableStateResult } from "./types.cjs";
3
+ import { OverlayPortal } from "./OverlayPortal.cjs";
4
+ import { useControllableState } from "./useControllableState.cjs";
5
+ export { OverlayPortal, type OverlayPortalProps, type UseControllableStateProps, type UseControllableStateResult, useControllableState };
@@ -0,0 +1,5 @@
1
+
2
+ import { OverlayPortalProps, UseControllableStateProps, UseControllableStateResult } from "./types.js";
3
+ import { OverlayPortal } from "./OverlayPortal.js";
4
+ import { useControllableState } from "./useControllableState.js";
5
+ export { OverlayPortal, type OverlayPortalProps, type UseControllableStateProps, type UseControllableStateResult, useControllableState };
@@ -0,0 +1,4 @@
1
+ /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
+ import { OverlayPortal } from "./OverlayPortal.js";
3
+ import { useControllableState } from "./useControllableState.js";
4
+ export { OverlayPortal, useControllableState };
@@ -0,0 +1 @@
1
+ /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
@@ -0,0 +1,21 @@
1
+
2
+ import { Dispatch, ReactNode, SetStateAction } from "react";
3
+
4
+ //#region src/components/internal/Overlay/types.d.ts
5
+ interface OverlayPortalProps {
6
+ children: ReactNode;
7
+ /**
8
+ * Render through iOS FullWindowOverlay. Keep enabled for surfaces that need to sit above native
9
+ * screen content.
10
+ */
11
+ useFullWindowOverlay?: boolean;
12
+ }
13
+ interface UseControllableStateProps<T> {
14
+ value?: T;
15
+ defaultValue: T | (() => T);
16
+ onChange?: (value: T) => void;
17
+ }
18
+ type UseControllableStateResult<T> = [T, Dispatch<SetStateAction<T>>];
19
+ //#endregion
20
+ export { type OverlayPortalProps, type UseControllableStateProps, type UseControllableStateResult };
21
+ //# sourceMappingURL=types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../../../src/components/internal/Overlay/types.ts"],"mappings":";;;;UAEU,kBAAA;EACR,QAAA,EAAU,SAAA;EADF;;;;EAMR,oBAAA;AAAA;AAAA,UAGQ,yBAAA;EACR,KAAA,GAAQ,CAAA;EACR,YAAA,EAAc,CAAA,UAAW,CAAA;EACzB,QAAA,IAAY,KAAA,EAAO,CAAA;AAAA;AAAA,KAGhB,0BAAA,OAAiC,CAAA,EAAG,QAAA,CAAS,cAAA,CAAe,CAAA"}
@@ -0,0 +1,21 @@
1
+
2
+ import { Dispatch, ReactNode, SetStateAction } from "react";
3
+
4
+ //#region src/components/internal/Overlay/types.d.ts
5
+ interface OverlayPortalProps {
6
+ children: ReactNode;
7
+ /**
8
+ * Render through iOS FullWindowOverlay. Keep enabled for surfaces that need to sit above native
9
+ * screen content.
10
+ */
11
+ useFullWindowOverlay?: boolean;
12
+ }
13
+ interface UseControllableStateProps<T> {
14
+ value?: T;
15
+ defaultValue: T | (() => T);
16
+ onChange?: (value: T) => void;
17
+ }
18
+ type UseControllableStateResult<T> = [T, Dispatch<SetStateAction<T>>];
19
+ //#endregion
20
+ export { type OverlayPortalProps, type UseControllableStateProps, type UseControllableStateResult };
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/components/internal/Overlay/types.ts"],"mappings":";;;;UAEU,kBAAA;EACR,QAAA,EAAU,SAAA;EADF;;;;EAMR,oBAAA;AAAA;AAAA,UAGQ,yBAAA;EACR,KAAA,GAAQ,CAAA;EACR,YAAA,EAAc,CAAA,UAAW,CAAA;EACzB,QAAA,IAAY,KAAA,EAAO,CAAA;AAAA;AAAA,KAGhB,0BAAA,OAAiC,CAAA,EAAG,QAAA,CAAS,cAAA,CAAe,CAAA"}
@@ -0,0 +1 @@
1
+ /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */