@hoddy-ui/next 2.0.36 → 2.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode, FC } from 'react';
2
- import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps } from 'react-native';
2
+ import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps, TextInput } from 'react-native';
3
3
  import * as index from 'index';
4
4
 
5
5
  type ThemeTypes = "dark" | "light";
@@ -123,6 +123,7 @@ interface IconButtonProps {
123
123
  }
124
124
  type locatorLocation = {
125
125
  description: string;
126
+ formatted_address?: string;
126
127
  longitude: number;
127
128
  latitude: number;
128
129
  };
@@ -339,7 +340,15 @@ declare const getPredictionsFromQuery: (query: string, country: string) => Promi
339
340
  description: any;
340
341
  id: any;
341
342
  }[]>;
342
- declare const getLocationFromPlaceId: (place_id: string) => Promise<any>;
343
+ declare const getLocationFromPlaceId: (place_id: string) => Promise<{
344
+ formatted_address: string;
345
+ geometry: {
346
+ location: {
347
+ lat: number;
348
+ lng: number;
349
+ };
350
+ };
351
+ }>;
343
352
  declare const Locator: React.FC<LocatorProps>;
344
353
 
345
354
  declare const Popup: React.FC<PopupProps>;
@@ -353,7 +362,7 @@ declare const SelectMenu: React.FC<SelectMenuProps>;
353
362
  declare const Spinner: React.FC<SpinnerProps>;
354
363
 
355
364
  declare const TextField: React.FC<TextFieldProps>;
356
- declare const TextField2: React.FC<TextFieldProps>;
365
+ declare const TextField2: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<TextInput>>;
357
366
 
358
367
  declare const Typography: React.FC<TypographyProps>;
359
368
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode, FC } from 'react';
2
- import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps } from 'react-native';
2
+ import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps, TextInput } from 'react-native';
3
3
  import * as index from 'index';
4
4
 
5
5
  type ThemeTypes = "dark" | "light";
@@ -123,6 +123,7 @@ interface IconButtonProps {
123
123
  }
124
124
  type locatorLocation = {
125
125
  description: string;
126
+ formatted_address?: string;
126
127
  longitude: number;
127
128
  latitude: number;
128
129
  };
@@ -339,7 +340,15 @@ declare const getPredictionsFromQuery: (query: string, country: string) => Promi
339
340
  description: any;
340
341
  id: any;
341
342
  }[]>;
342
- declare const getLocationFromPlaceId: (place_id: string) => Promise<any>;
343
+ declare const getLocationFromPlaceId: (place_id: string) => Promise<{
344
+ formatted_address: string;
345
+ geometry: {
346
+ location: {
347
+ lat: number;
348
+ lng: number;
349
+ };
350
+ };
351
+ }>;
343
352
  declare const Locator: React.FC<LocatorProps>;
344
353
 
345
354
  declare const Popup: React.FC<PopupProps>;
@@ -353,7 +362,7 @@ declare const SelectMenu: React.FC<SelectMenuProps>;
353
362
  declare const Spinner: React.FC<SpinnerProps>;
354
363
 
355
364
  declare const TextField: React.FC<TextFieldProps>;
356
- declare const TextField2: React.FC<TextFieldProps>;
365
+ declare const TextField2: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<TextInput>>;
357
366
 
358
367
  declare const Typography: React.FC<TypographyProps>;
359
368
 
package/dist/index.js CHANGED
@@ -1573,191 +1573,194 @@ var TextField = ({
1573
1573
  }
1574
1574
  ));
1575
1575
  };
1576
- var TextField2 = ({
1577
- label,
1578
- keyboardType,
1579
- color = "primary",
1580
- value,
1581
- type,
1582
- helperText,
1583
- onChangeText,
1584
- onSubmitEditing = () => {
1585
- },
1586
- onFocus = () => {
1587
- },
1588
- onBlur = () => {
1589
- },
1590
- error,
1591
- start,
1592
- rounded,
1593
- disabled = false,
1594
- style = {},
1595
- inputStyles = {},
1596
- gutterBottom = 8,
1597
- placeholder,
1598
- end,
1599
- options,
1600
- ...props
1601
- }) => {
1602
- const colors2 = useColors();
1603
- const [focused, _setFocused] = (0, import_react16.useState)(false);
1604
- const [showPassword, setShowPassword] = (0, import_react16.useState)(false);
1605
- const height = (0, import_react_native_size_matters14.moderateScale)(
1606
- props.multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
1607
- );
1608
- const setFocused = (value2) => {
1609
- _setFocused(value2);
1610
- };
1611
- const styles2 = import_react_native_size_matters14.ScaledSheet.create({
1612
- root: {
1613
- marginBottom: gutterBottom + "@vs",
1614
- ...style
1615
- },
1616
- container: {
1617
- height,
1618
- overflow: "hidden",
1619
- flexDirection: "row",
1620
- borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.white[5],
1621
- borderWidth: error ? 1 : focused ? 2 : 1,
1622
- width: "100%",
1623
- borderRadius: rounded ? 30 : 10,
1624
- alignItems: "center",
1625
- ...inputStyles
1626
- },
1627
- input: {
1628
- fontSize: "14@s",
1629
- flex: 1,
1630
- alignSelf: "stretch",
1631
- paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10),
1632
- paddingRight: (0, import_react_native_size_matters14.moderateScale)(10),
1633
- color: colors2.dark.main,
1634
- zIndex: 10
1635
- // backgroundColor: "#284",
1636
- },
1637
- inputText: {
1638
- fontSize: "14@ms",
1639
- color: colors2.dark.main,
1640
- paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
1641
- },
1642
- placeholder: {
1643
- fontSize: "14@ms",
1644
- color: colors2.textSecondary.main,
1645
- paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
1576
+ var TextField2 = import_react16.default.forwardRef(
1577
+ ({
1578
+ label,
1579
+ keyboardType,
1580
+ color = "primary",
1581
+ value,
1582
+ type,
1583
+ helperText,
1584
+ onChangeText,
1585
+ onSubmitEditing = () => {
1646
1586
  },
1647
- label: {},
1648
- helperText: {
1649
- paddingHorizontal: "15@s",
1650
- color: focused ? colors2[color].dark : "#fffa",
1651
- paddingTop: "4@ms"
1587
+ onFocus = () => {
1652
1588
  },
1653
- error: {
1654
- paddingLeft: 10,
1655
- paddingRight: 10,
1656
- paddingTop: 5,
1657
- flexDirection: "row",
1658
- alignItems: "center"
1659
- },
1660
- errorText: {
1661
- fontSize: 12,
1662
- marginLeft: 10
1663
- }
1664
- });
1665
- const formProps = type === "email" ? {
1666
- textContentType: "emailAddress",
1667
- keyboardType: "email-address",
1668
- autoCapitalize: "none",
1669
- autoCompleteType: "email"
1670
- } : type === "number" ? {
1671
- keyboardType: "numeric"
1672
- } : type === "tel" ? {
1673
- textContentType: "telephoneNumber",
1674
- keyboardType: "phone-pad"
1675
- } : type === "search" ? {
1676
- keyboardType: "web-search",
1677
- returnKeyType: "search",
1678
- autoCapitalize: "none"
1679
- } : type === "password" ? {
1680
- secureTextEntry: !showPassword,
1681
- autoCompleteType: "password",
1682
- autoCapitalize: "none",
1683
- textContentType: "password"
1684
- } : {};
1685
- return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles2.root }, label && /* @__PURE__ */ import_react16.default.createElement(Typography_default, { variant: "body1", color: "textSecondary", gutterBottom: 7 }, label), /* @__PURE__ */ import_react16.default.createElement(
1686
- import_react_native16.TouchableOpacity,
1687
- {
1688
- onPress: () => setFocused(true),
1689
- style: styles2.container
1589
+ onBlur = () => {
1690
1590
  },
1591
+ error,
1691
1592
  start,
1692
- options ? /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, value ? /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.inputText }, options.find((cur) => cur.value === value)?.label) : /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.placeholder }, placeholder), /* @__PURE__ */ import_react16.default.createElement(
1693
- import_vector_icons8.Ionicons,
1694
- {
1695
- name: "chevron-down",
1696
- size: 24,
1697
- style: { marginLeft: "auto", marginRight: 15 },
1698
- color: colors2.dark.light
1699
- }
1700
- )) : /* @__PURE__ */ import_react16.default.createElement(
1701
- import_react_native16.TextInput,
1702
- {
1703
- onFocus: () => {
1704
- onFocus();
1705
- setFocused(true);
1706
- },
1707
- onBlur: () => {
1708
- onBlur();
1709
- setFocused(false);
1710
- },
1711
- value,
1712
- onChangeText,
1713
- key: showPassword ? "show" : "hide",
1714
- keyboardType,
1715
- placeholderTextColor: colors2.textSecondary.main,
1716
- editable: !disabled,
1717
- placeholder,
1718
- selectTextOnFocus: !disabled,
1719
- onSubmitEditing,
1720
- ...formProps,
1721
- ...props,
1722
- style: styles2.input
1593
+ rounded,
1594
+ disabled = false,
1595
+ style = {},
1596
+ inputStyles = {},
1597
+ gutterBottom = 8,
1598
+ placeholder,
1599
+ end,
1600
+ options,
1601
+ ...props
1602
+ }, ref) => {
1603
+ const colors2 = useColors();
1604
+ const [focused, _setFocused] = (0, import_react16.useState)(false);
1605
+ const [showPassword, setShowPassword] = (0, import_react16.useState)(false);
1606
+ const height = (0, import_react_native_size_matters14.moderateScale)(
1607
+ props.multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
1608
+ );
1609
+ const setFocused = (value2) => {
1610
+ _setFocused(value2);
1611
+ };
1612
+ const styles2 = import_react_native_size_matters14.ScaledSheet.create({
1613
+ root: {
1614
+ marginBottom: gutterBottom + "@vs",
1615
+ ...style
1616
+ },
1617
+ container: {
1618
+ height,
1619
+ overflow: "hidden",
1620
+ flexDirection: "row",
1621
+ borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.white[5],
1622
+ borderWidth: error ? 1 : focused ? 2 : 1,
1623
+ width: "100%",
1624
+ borderRadius: rounded ? 30 : 10,
1625
+ alignItems: "center",
1626
+ ...inputStyles
1627
+ },
1628
+ input: {
1629
+ fontSize: "14@s",
1630
+ flex: 1,
1631
+ alignSelf: "stretch",
1632
+ paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10),
1633
+ paddingRight: (0, import_react_native_size_matters14.moderateScale)(10),
1634
+ color: colors2.dark.main,
1635
+ zIndex: 10
1636
+ // backgroundColor: "#284",
1637
+ },
1638
+ inputText: {
1639
+ fontSize: "14@ms",
1640
+ color: colors2.dark.main,
1641
+ paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
1642
+ },
1643
+ placeholder: {
1644
+ fontSize: "14@ms",
1645
+ color: colors2.textSecondary.main,
1646
+ paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
1647
+ },
1648
+ label: {},
1649
+ helperText: {
1650
+ paddingHorizontal: "15@s",
1651
+ color: focused ? colors2[color].dark : "#fffa",
1652
+ paddingTop: "4@ms"
1653
+ },
1654
+ error: {
1655
+ paddingLeft: 10,
1656
+ paddingRight: 10,
1657
+ paddingTop: 5,
1658
+ flexDirection: "row",
1659
+ alignItems: "center"
1660
+ },
1661
+ errorText: {
1662
+ fontSize: 12,
1663
+ marginLeft: 10
1723
1664
  }
1724
- ),
1725
- end ? /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: { marginRight: 20 } }, end) : type === "password" && /* @__PURE__ */ import_react16.default.createElement(
1665
+ });
1666
+ const formProps = type === "email" ? {
1667
+ textContentType: "emailAddress",
1668
+ keyboardType: "email-address",
1669
+ autoCapitalize: "none",
1670
+ autoCompleteType: "email"
1671
+ } : type === "number" ? {
1672
+ keyboardType: "numeric"
1673
+ } : type === "tel" ? {
1674
+ textContentType: "telephoneNumber",
1675
+ keyboardType: "phone-pad"
1676
+ } : type === "search" ? {
1677
+ keyboardType: "web-search",
1678
+ returnKeyType: "search",
1679
+ autoCapitalize: "none"
1680
+ } : type === "password" ? {
1681
+ secureTextEntry: !showPassword,
1682
+ autoCompleteType: "password",
1683
+ autoCapitalize: "none",
1684
+ textContentType: "password"
1685
+ } : {};
1686
+ return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles2.root }, label && /* @__PURE__ */ import_react16.default.createElement(Typography_default, { variant: "body1", color: "textSecondary", gutterBottom: 7 }, label), /* @__PURE__ */ import_react16.default.createElement(
1726
1687
  import_react_native16.TouchableOpacity,
1727
1688
  {
1728
- style: { marginRight: 20 },
1729
- onPress: () => setShowPassword(!showPassword)
1689
+ onPress: () => setFocused(true),
1690
+ style: styles2.container
1730
1691
  },
1731
- /* @__PURE__ */ import_react16.default.createElement(
1692
+ start,
1693
+ options ? /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, value ? /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.inputText }, options.find((cur) => cur.value === value)?.label) : /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.placeholder }, placeholder), /* @__PURE__ */ import_react16.default.createElement(
1732
1694
  import_vector_icons8.Ionicons,
1733
1695
  {
1734
- name: showPassword ? "eye-outline" : "eye-off-outline",
1696
+ name: "chevron-down",
1735
1697
  size: 24,
1736
- color: colors2.textSecondary.main
1698
+ style: { marginLeft: "auto", marginRight: 15 },
1699
+ color: colors2.dark.light
1700
+ }
1701
+ )) : /* @__PURE__ */ import_react16.default.createElement(
1702
+ import_react_native16.TextInput,
1703
+ {
1704
+ ref,
1705
+ onFocus: () => {
1706
+ onFocus();
1707
+ setFocused(true);
1708
+ },
1709
+ onBlur: () => {
1710
+ onBlur();
1711
+ setFocused(false);
1712
+ },
1713
+ value,
1714
+ onChangeText,
1715
+ key: showPassword ? "show" : "hide",
1716
+ keyboardType,
1717
+ placeholderTextColor: colors2.textSecondary.main,
1718
+ editable: !disabled,
1719
+ placeholder,
1720
+ selectTextOnFocus: !disabled,
1721
+ onSubmitEditing,
1722
+ ...formProps,
1723
+ ...props,
1724
+ style: styles2.input
1737
1725
  }
1726
+ ),
1727
+ end ? /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: { marginRight: 20 } }, end) : type === "password" && /* @__PURE__ */ import_react16.default.createElement(
1728
+ import_react_native16.TouchableOpacity,
1729
+ {
1730
+ style: { marginRight: 20 },
1731
+ onPress: () => setShowPassword(!showPassword)
1732
+ },
1733
+ /* @__PURE__ */ import_react16.default.createElement(
1734
+ import_vector_icons8.Ionicons,
1735
+ {
1736
+ name: showPassword ? "eye-outline" : "eye-off-outline",
1737
+ size: 24,
1738
+ color: colors2.textSecondary.main
1739
+ }
1740
+ )
1738
1741
  )
1739
- )
1740
- ), helperText && /* @__PURE__ */ import_react16.default.createElement(
1741
- Typography_default,
1742
- {
1743
- color: "textSecondary",
1744
- style: styles2.helperText,
1745
- variant: "caption"
1746
- },
1747
- helperText
1748
- ), error && /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles2.error }, /* @__PURE__ */ import_react16.default.createElement(import_vector_icons8.MaterialIcons, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.errorText, color: "error" }, error))), options && /* @__PURE__ */ import_react16.default.createElement(
1749
- SelectMenu_default,
1750
- {
1751
- options,
1752
- value,
1753
- open: focused,
1754
- onClose: () => setFocused(false),
1755
- label,
1756
- helperText,
1757
- onChange: onChangeText
1758
- }
1759
- ));
1760
- };
1742
+ ), helperText && /* @__PURE__ */ import_react16.default.createElement(
1743
+ Typography_default,
1744
+ {
1745
+ color: "textSecondary",
1746
+ style: styles2.helperText,
1747
+ variant: "caption"
1748
+ },
1749
+ helperText
1750
+ ), error && /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles2.error }, /* @__PURE__ */ import_react16.default.createElement(import_vector_icons8.MaterialIcons, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.errorText, color: "error" }, error))), options && /* @__PURE__ */ import_react16.default.createElement(
1751
+ SelectMenu_default,
1752
+ {
1753
+ options,
1754
+ value,
1755
+ open: focused,
1756
+ onClose: () => setFocused(false),
1757
+ label,
1758
+ helperText,
1759
+ onChange: onChangeText
1760
+ }
1761
+ ));
1762
+ }
1763
+ );
1761
1764
  var TextField_default = TextField;
1762
1765
 
1763
1766
  // ../src/Components/Locator.tsx