@hoddy-ui/next 2.5.87 → 2.5.89

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.js CHANGED
@@ -1619,7 +1619,11 @@ var TextFieldBase = import_react16.default.forwardRef(
1619
1619
  const isFloating = labelVariant === "floating";
1620
1620
  const hasPlaceholder = placeholder != null && String(placeholder).trim() !== "";
1621
1621
  const labelOpen = focused || value || isFloating && hasPlaceholder;
1622
- const height2 = isFloating ? (0, import_react_native_size_matters13.moderateScale)(variant === "text" ? 50 : 45) * (size === "large" ? 1.2 : size === "small" ? 0.8 : 1) : (0, import_react_native_size_matters13.moderateScale)(multiline ? 50 + (props.numberOfLines || 1) * 18 : 50);
1622
+ const baseHeight = (0, import_react_native_size_matters13.moderateScale)(
1623
+ multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
1624
+ );
1625
+ const sizeMultiplier = isFloating ? size === "large" ? 1.2 : size === "small" ? 0.8 : 1 : 1;
1626
+ const height2 = baseHeight * sizeMultiplier;
1623
1627
  const labelAnim = (0, import_react16.useRef)(
1624
1628
  new import_react_native16.Animated.Value(
1625
1629
  height2 / (0, import_react_native_size_matters13.moderateScale)(variant === "text" ? 2.5 : 3.2)
@@ -1662,8 +1666,7 @@ var TextFieldBase = import_react16.default.forwardRef(
1662
1666
  };
1663
1667
  const inputPadding = variant === "text" ? 0 : (0, import_react_native_size_matters13.moderateScale)(isFloating ? 15 : 10);
1664
1668
  const containerBorderRadius = variant === "text" ? 0 : rounded ? 30 : isFloating ? 7 : 10;
1665
- const datePlaceholderColor = isFloating ? colors2.textSecondary.main : colors2.textSecondary.light;
1666
- const helperTextUnfocusedColor = isFloating ? colors2.textSecondary.main : "#fffa";
1669
+ const datePlaceholderColor = colors2.textSecondary.light;
1667
1670
  const styles = import_react_native_size_matters13.ScaledSheet.create({
1668
1671
  root: {
1669
1672
  marginBottom: (0, import_react_native_size_matters13.ms)(gutterBottom ?? (isFloating ? 0 : 8)),
@@ -1674,9 +1677,9 @@ var TextFieldBase = import_react16.default.forwardRef(
1674
1677
  height: height2,
1675
1678
  overflow: "hidden",
1676
1679
  flexDirection: "row",
1677
- backgroundColor: variant === "outlined" || variant === "text" ? "#fff0" : focused ? colors2.white[3] : colors2.white[2],
1678
- borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.textSecondary.main,
1679
- borderWidth: error ? 1 : variant === "outlined" ? focused ? 2 : 0.5 : 0,
1680
+ backgroundColor: variant === "outlined" || variant === "text" ? "#fff0" : focused ? colors2.white[2] + "dd" : colors2.white[2],
1681
+ borderColor: error ? colors2.error.main : isFloating && focused && variant === "contained" ? colors2[color].light : focused ? colors2[color].main : colors2.textSecondary.main,
1682
+ borderWidth: error ? 1 : isFloating && focused && variant === "contained" ? 1 : variant === "outlined" ? focused ? 2 : 0.5 : 0,
1680
1683
  borderBottomWidth: variant === "text" ? 0.5 : void 0,
1681
1684
  width: "100%",
1682
1685
  borderRadius: containerBorderRadius,
@@ -1711,10 +1714,11 @@ var TextFieldBase = import_react16.default.forwardRef(
1711
1714
  dateText: { fontSize: "14@ms", flex: 1 },
1712
1715
  datePlaceholder: { color: datePlaceholderColor },
1713
1716
  ...isFloating ? {
1717
+ contentWrapper: { flex: 1, position: "relative" },
1714
1718
  label: {
1715
1719
  fontFamily: getFontFamily(400),
1716
1720
  position: "absolute",
1717
- left: variant === "text" ? 0 : (0, import_react_native_size_matters13.moderateScale)(15),
1721
+ left: inputPadding,
1718
1722
  fontSize: labelOpen ? "10@s" : "13@s",
1719
1723
  color: focused ? colors2[color].main : colors2.textSecondary.main
1720
1724
  }
@@ -1722,7 +1726,7 @@ var TextFieldBase = import_react16.default.forwardRef(
1722
1726
  helperText: {
1723
1727
  paddingHorizontal: "15@s",
1724
1728
  flex: 1,
1725
- color: focused ? colors2[color].dark : helperTextUnfocusedColor,
1729
+ color: focused ? colors2[color].main : colors2.textSecondary.main,
1726
1730
  paddingTop: "4@ms"
1727
1731
  },
1728
1732
  error: {
@@ -1757,16 +1761,22 @@ var TextFieldBase = import_react16.default.forwardRef(
1757
1761
  style: styles.container,
1758
1762
  activeOpacity: 1
1759
1763
  },
1760
- isFloating && label != null && label !== "" ? /* @__PURE__ */ import_react16.default.createElement(import_react_native16.Animated.Text, { style: { ...styles.label, top: labelAnim } }, label) : null,
1761
1764
  /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: { marginTop: multiline && !isFloating ? 5 : 0 } }, start),
1762
- options ? /* @__PURE__ */ import_react16.default.createElement(
1765
+ isFloating ? /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles.contentWrapper }, label != null && label !== "" ? /* @__PURE__ */ import_react16.default.createElement(
1766
+ import_react_native16.Animated.Text,
1767
+ {
1768
+ style: { ...styles.label, top: labelAnim },
1769
+ pointerEvents: "none"
1770
+ },
1771
+ label
1772
+ ) : null, options ? /* @__PURE__ */ import_react16.default.createElement(
1763
1773
  import_react_native16.View,
1764
1774
  {
1765
- style: isFloating ? {
1775
+ style: {
1766
1776
  flex: 1,
1767
1777
  alignItems: "center",
1768
1778
  flexDirection: "row"
1769
- } : void 0
1779
+ }
1770
1780
  },
1771
1781
  isFloating && selectedOption?.start ? /* @__PURE__ */ import_react16.default.createElement(
1772
1782
  import_react_native16.View,
@@ -1837,7 +1847,59 @@ var TextFieldBase = import_react16.default.forwardRef(
1837
1847
  onChangeText,
1838
1848
  key: type === "password" ? showPassword ? "show" : "hide" : void 0,
1839
1849
  keyboardType,
1840
- placeholderTextColor: isFloating ? colors2.textSecondary.main : colors2.textSecondary.light,
1850
+ placeholderTextColor: colors2.textSecondary.light,
1851
+ editable: !disabled,
1852
+ placeholder,
1853
+ selectTextOnFocus: !disabled,
1854
+ onSubmitEditing,
1855
+ multiline,
1856
+ textAlignVertical: multiline ? "top" : "center",
1857
+ ...formProps,
1858
+ ...props,
1859
+ style: styles.input
1860
+ }
1861
+ )) : options ? /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, selectedOption ? /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles.inputText }, selectedOption.label) : /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles.placeholder }, placeholder), /* @__PURE__ */ import_react16.default.createElement(
1862
+ import_vector_icons8.Ionicons,
1863
+ {
1864
+ name: "chevron-down",
1865
+ size: 24,
1866
+ style: { marginLeft: "auto", marginRight: 15 },
1867
+ color: colors2.dark.light
1868
+ }
1869
+ )) : isDate ? /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles.dateContent }, /* @__PURE__ */ import_react16.default.createElement(
1870
+ Typography_default,
1871
+ {
1872
+ style: [
1873
+ styles.dateText,
1874
+ !value ? styles.datePlaceholder : void 0
1875
+ ],
1876
+ color: value ? "dark" : "textSecondary"
1877
+ },
1878
+ value || placeholder
1879
+ ), /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: { marginLeft: 8 } }, end ?? /* @__PURE__ */ import_react16.default.createElement(
1880
+ import_vector_icons8.Ionicons,
1881
+ {
1882
+ name: "calendar-outline",
1883
+ size: 22,
1884
+ color: colors2.textSecondary.main
1885
+ }
1886
+ ))) : /* @__PURE__ */ import_react16.default.createElement(
1887
+ import_react_native16.TextInput,
1888
+ {
1889
+ ref,
1890
+ onFocus: () => {
1891
+ onFocus();
1892
+ setFocused(true);
1893
+ },
1894
+ onBlur: () => {
1895
+ onBlur();
1896
+ setFocused(false);
1897
+ },
1898
+ value,
1899
+ onChangeText,
1900
+ key: type === "password" ? showPassword ? "show" : "hide" : void 0,
1901
+ keyboardType,
1902
+ placeholderTextColor: colors2.textSecondary.light,
1841
1903
  editable: !disabled,
1842
1904
  placeholder,
1843
1905
  selectTextOnFocus: !disabled,
@@ -1873,15 +1935,7 @@ var TextFieldBase = import_react16.default.forwardRef(
1873
1935
  }
1874
1936
  )
1875
1937
  ) : null
1876
- ), helperText ? /* @__PURE__ */ import_react16.default.createElement(
1877
- Typography_default,
1878
- {
1879
- color: "textSecondary",
1880
- style: styles.helperText,
1881
- variant: "caption"
1882
- },
1883
- helperText
1884
- ) : null, error ? /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles.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: styles.errorText, color: "error" }, error)) : null), options ? /* @__PURE__ */ import_react16.default.createElement(
1938
+ ), helperText ? /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles.helperText, variant: "caption" }, helperText) : null, error ? /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles.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: styles.errorText, color: "error" }, error)) : null), options ? /* @__PURE__ */ import_react16.default.createElement(
1885
1939
  SelectMenu_default,
1886
1940
  {
1887
1941
  options,