@avenue-ticketing/native 0.1.11 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/input.d.ts CHANGED
@@ -1,7 +1,9 @@
1
+ import * as react from 'react';
1
2
  import { FC, ComponentType, ReactNode } from 'react';
2
- import { TextInputProps } from 'react-native';
3
+ import { TextInputProps, TextInput } from 'react-native';
3
4
  import { I as InputSize, a as InputType } from './select-native-C3ctbnUG.js';
4
5
  export { N as NativeSelect, c as NativeSelectOption, b as NativeSelectProps } from './select-native-C3ctbnUG.js';
6
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
7
 
6
8
  interface LabelProps {
7
9
  children: ReactNode;
@@ -36,6 +38,8 @@ interface InputBaseProps {
36
38
  /** Android autofill hint. */
37
39
  autoComplete?: TextInputProps["autoComplete"];
38
40
  autoCorrect?: boolean;
41
+ autoFocus?: boolean;
42
+ returnKeyType?: TextInputProps["returnKeyType"];
39
43
  editable?: boolean;
40
44
  className?: string;
41
45
  inputClassName?: string;
@@ -55,7 +59,7 @@ interface InputProps extends InputBaseProps {
55
59
  }
56
60
  declare const Label: FC<LabelProps>;
57
61
  declare const HintText: FC<HintTextProps>;
58
- declare const InputBase: FC<InputBaseProps>;
62
+ declare const InputBase: react.ForwardRefExoticComponent<InputBaseProps & react.RefAttributes<TextInput>>;
59
63
  declare const Input: FC<InputProps>;
60
64
 
61
65
  interface InputPrefixProps {
@@ -303,7 +307,10 @@ interface InputClearButtonProps {
303
307
  size?: number;
304
308
  }
305
309
  /** Clear control for search / filter fields (X-in-circle). */
306
- declare const InputClearButton: FC<InputClearButtonProps>;
310
+ declare const InputClearButton: {
311
+ ({ label, onClear, className, size }: InputClearButtonProps): react_jsx_runtime.JSX.Element;
312
+ displayName: string;
313
+ };
307
314
  interface SearchInputProps extends Omit<InputBaseProps, "type" | "icon" | "className"> {
308
315
  /** Leading icon. Defaults to magnifying glass. */
309
316
  icon?: ComponentType<{
@@ -336,6 +343,6 @@ interface SearchInputProps extends Omit<InputBaseProps, "type" | "icon" | "class
336
343
  * Search field: leading magnifying glass + clear button when filled.
337
344
  * Matches the mobile discover / organizer sheet search chrome.
338
345
  */
339
- declare const SearchInput: FC<SearchInputProps>;
346
+ declare const SearchInput: react.ForwardRefExoticComponent<SearchInputProps & react.RefAttributes<TextInput>>;
340
347
 
341
348
  export { ContactInput, type ContactInputProps, type ContactMode, type ContactValue, EmailInput, type EmailInputProps, HintText, Input, InputBase, type InputBaseProps, InputClearButton, type InputClearButtonProps, InputDate, type InputDateProps, InputFile, type InputFileProps, InputGroup, type InputGroupProps, InputNumber, type InputNumberProps, InputPrefix, type InputPrefixProps, type InputProps, InputSize, InputTags, InputTagsOuter, type InputTagsOuterProps, type InputTagsProps, InputType, Label, PaymentInput, type PaymentInputProps, PhoneInput, type PhoneInputProps, SearchInput, type SearchInputProps, emptyContactValue };
package/dist/input.js CHANGED
@@ -1,7 +1,7 @@
1
- import { createContext, useContext, useState, useCallback, useEffect, useMemo, useRef, isValidElement } from 'react';
2
- import { StyleSheet, useColorScheme, Platform, Modal, View as View$1, Pressable as Pressable$1, StatusBar, Linking } from 'react-native';
1
+ import { createContext, forwardRef, useContext, useState, useRef, useCallback, useEffect, useMemo, isValidElement } from 'react';
2
+ import { StyleSheet, Platform, useColorScheme, Modal, View as View$1, Pressable as Pressable$1, StatusBar, Linking } from 'react-native';
3
3
  import { useNativeVariable } from 'react-native-css';
4
- import { View, Text, TextInput, Pressable, FlatList } from 'react-native-css/components';
4
+ import { View, TextInput, Pressable, Text, FlatList } from 'react-native-css/components';
5
5
  import { EyeIcon } from 'phosphor-react-native/src/icons/Eye';
6
6
  import { EyeSlashIcon } from 'phosphor-react-native/src/icons/EyeSlash';
7
7
  import { InfoIcon } from 'phosphor-react-native/src/icons/Info';
@@ -343,7 +343,7 @@ var HintText = ({ children, isInvalid, size, className }) => {
343
343
  }
344
344
  );
345
345
  };
346
- var InputBase = ({
346
+ var InputBase = forwardRef(function InputBase2({
347
347
  size: sizeProp = "md",
348
348
  type = "text",
349
349
  placeholder,
@@ -358,6 +358,8 @@ var InputBase = ({
358
358
  textContentType: textContentTypeProp,
359
359
  autoComplete: autoCompleteProp,
360
360
  autoCorrect: autoCorrectProp,
361
+ autoFocus,
362
+ returnKeyType,
361
363
  editable,
362
364
  className,
363
365
  inputClassName,
@@ -368,7 +370,7 @@ var InputBase = ({
368
370
  onBlur,
369
371
  onPress,
370
372
  onSubmitEditing
371
- }) => {
373
+ }, ref) {
372
374
  const group = useInputGroupContext();
373
375
  const setShellFocus = useShellFocus();
374
376
  const size = group?.size ?? sizeProp;
@@ -421,6 +423,7 @@ var InputBase = ({
421
423
  /* @__PURE__ */ jsx(
422
424
  TextInput,
423
425
  {
426
+ ref,
424
427
  accessibilityLabel: placeholder,
425
428
  editable: editable ?? !isDisabled,
426
429
  placeholder,
@@ -429,6 +432,8 @@ var InputBase = ({
429
432
  secureTextEntry: isPassword && !isPasswordVisible,
430
433
  autoCapitalize: autoCapitalize ?? (type === "email" ? "none" : void 0),
431
434
  autoCorrect: autoCorrectProp ?? type !== "email",
435
+ autoFocus,
436
+ returnKeyType,
432
437
  keyboardType: keyboardType ?? (type === "email" ? "email-address" : "default"),
433
438
  textContentType: textContentTypeProp ?? (isPassword ? "password" : type === "email" ? "emailAddress" : void 0),
434
439
  autoComplete: autoCompleteProp ?? (type === "email" ? "email" : isPassword ? "password" : void 0),
@@ -473,7 +478,7 @@ var InputBase = ({
473
478
  return /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", disabled: isDisabled, onPress, className: "min-w-0 flex-1", children: field });
474
479
  }
475
480
  return field;
476
- };
481
+ });
477
482
  var Input = ({
478
483
  label,
479
484
  hint,
@@ -7841,7 +7846,15 @@ var InputClearButton = ({ label, onClear, className, size = 20 }) => {
7841
7846
  );
7842
7847
  };
7843
7848
  InputClearButton.displayName = "InputClearButton";
7844
- var SearchInput = ({
7849
+ var assignRef = (ref, value) => {
7850
+ if (!ref) return;
7851
+ if (typeof ref === "function") {
7852
+ ref(value);
7853
+ return;
7854
+ }
7855
+ ref.current = value;
7856
+ };
7857
+ var SearchInput = forwardRef(function SearchInput2({
7845
7858
  value,
7846
7859
  clearLabel,
7847
7860
  onClear,
@@ -7860,7 +7873,8 @@ var SearchInput = ({
7860
7873
  fieldClassName,
7861
7874
  wrapperClassName,
7862
7875
  ...baseProps
7863
- }) => {
7876
+ }, ref) {
7877
+ const inputRef = useRef(null);
7864
7878
  const showClear = isClearable && typeof value === "string" && value.length > 0;
7865
7879
  const showRequired = Boolean(label) && isRequired && !hideRequiredIndicator;
7866
7880
  const handleClear = () => {
@@ -7869,6 +7883,7 @@ var SearchInput = ({
7869
7883
  } else {
7870
7884
  onChangeText?.("");
7871
7885
  }
7886
+ inputRef.current?.focus();
7872
7887
  };
7873
7888
  return /* @__PURE__ */ jsxs(View, { className: cx(inputStyles.stack, className), children: [
7874
7889
  label && /* @__PURE__ */ jsx(Label, { isRequired: showRequired, isInvalid, children: label }),
@@ -7877,6 +7892,10 @@ var SearchInput = ({
7877
7892
  InputBase,
7878
7893
  {
7879
7894
  ...baseProps,
7895
+ ref: (node) => {
7896
+ inputRef.current = node;
7897
+ assignRef(ref, node);
7898
+ },
7880
7899
  size,
7881
7900
  icon,
7882
7901
  value,
@@ -7900,7 +7919,7 @@ var SearchInput = ({
7900
7919
  ] }),
7901
7920
  hint != null && hint !== false && hint !== "" && /* @__PURE__ */ jsx(HintText, { isInvalid, size, children: hint })
7902
7921
  ] });
7903
- };
7922
+ });
7904
7923
  SearchInput.displayName = "SearchInput";
7905
7924
 
7906
7925
  export { ContactInput, EmailInput, HintText, Input, InputBase, InputClearButton, InputDate, InputFile, InputGroup, InputNumber, InputPrefix, InputTags, InputTagsOuter, Label, NativeSelect, PaymentInput, PhoneInput, SearchInput, emptyContactValue };