@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.mjs CHANGED
@@ -1584,7 +1584,11 @@ var TextFieldBase = React15.forwardRef(
1584
1584
  const isFloating = labelVariant === "floating";
1585
1585
  const hasPlaceholder = placeholder != null && String(placeholder).trim() !== "";
1586
1586
  const labelOpen = focused || value || isFloating && hasPlaceholder;
1587
- const height2 = isFloating ? moderateScale2(variant === "text" ? 50 : 45) * (size === "large" ? 1.2 : size === "small" ? 0.8 : 1) : moderateScale2(multiline ? 50 + (props.numberOfLines || 1) * 18 : 50);
1587
+ const baseHeight = moderateScale2(
1588
+ multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
1589
+ );
1590
+ const sizeMultiplier = isFloating ? size === "large" ? 1.2 : size === "small" ? 0.8 : 1 : 1;
1591
+ const height2 = baseHeight * sizeMultiplier;
1588
1592
  const labelAnim = useRef2(
1589
1593
  new Animated3.Value(
1590
1594
  height2 / moderateScale2(variant === "text" ? 2.5 : 3.2)
@@ -1627,8 +1631,7 @@ var TextFieldBase = React15.forwardRef(
1627
1631
  };
1628
1632
  const inputPadding = variant === "text" ? 0 : moderateScale2(isFloating ? 15 : 10);
1629
1633
  const containerBorderRadius = variant === "text" ? 0 : rounded ? 30 : isFloating ? 7 : 10;
1630
- const datePlaceholderColor = isFloating ? colors2.textSecondary.main : colors2.textSecondary.light;
1631
- const helperTextUnfocusedColor = isFloating ? colors2.textSecondary.main : "#fffa";
1634
+ const datePlaceholderColor = colors2.textSecondary.light;
1632
1635
  const styles = ScaledSheet12.create({
1633
1636
  root: {
1634
1637
  marginBottom: ms7(gutterBottom ?? (isFloating ? 0 : 8)),
@@ -1639,9 +1642,9 @@ var TextFieldBase = React15.forwardRef(
1639
1642
  height: height2,
1640
1643
  overflow: "hidden",
1641
1644
  flexDirection: "row",
1642
- backgroundColor: variant === "outlined" || variant === "text" ? "#fff0" : focused ? colors2.white[3] : colors2.white[2],
1643
- borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.textSecondary.main,
1644
- borderWidth: error ? 1 : variant === "outlined" ? focused ? 2 : 0.5 : 0,
1645
+ backgroundColor: variant === "outlined" || variant === "text" ? "#fff0" : focused ? colors2.white[2] + "dd" : colors2.white[2],
1646
+ borderColor: error ? colors2.error.main : isFloating && focused && variant === "contained" ? colors2[color].light : focused ? colors2[color].main : colors2.textSecondary.main,
1647
+ borderWidth: error ? 1 : isFloating && focused && variant === "contained" ? 1 : variant === "outlined" ? focused ? 2 : 0.5 : 0,
1645
1648
  borderBottomWidth: variant === "text" ? 0.5 : void 0,
1646
1649
  width: "100%",
1647
1650
  borderRadius: containerBorderRadius,
@@ -1676,10 +1679,11 @@ var TextFieldBase = React15.forwardRef(
1676
1679
  dateText: { fontSize: "14@ms", flex: 1 },
1677
1680
  datePlaceholder: { color: datePlaceholderColor },
1678
1681
  ...isFloating ? {
1682
+ contentWrapper: { flex: 1, position: "relative" },
1679
1683
  label: {
1680
1684
  fontFamily: getFontFamily(400),
1681
1685
  position: "absolute",
1682
- left: variant === "text" ? 0 : moderateScale2(15),
1686
+ left: inputPadding,
1683
1687
  fontSize: labelOpen ? "10@s" : "13@s",
1684
1688
  color: focused ? colors2[color].main : colors2.textSecondary.main
1685
1689
  }
@@ -1687,7 +1691,7 @@ var TextFieldBase = React15.forwardRef(
1687
1691
  helperText: {
1688
1692
  paddingHorizontal: "15@s",
1689
1693
  flex: 1,
1690
- color: focused ? colors2[color].dark : helperTextUnfocusedColor,
1694
+ color: focused ? colors2[color].main : colors2.textSecondary.main,
1691
1695
  paddingTop: "4@ms"
1692
1696
  },
1693
1697
  error: {
@@ -1722,16 +1726,22 @@ var TextFieldBase = React15.forwardRef(
1722
1726
  style: styles.container,
1723
1727
  activeOpacity: 1
1724
1728
  },
1725
- isFloating && label != null && label !== "" ? /* @__PURE__ */ React15.createElement(Animated3.Text, { style: { ...styles.label, top: labelAnim } }, label) : null,
1726
1729
  /* @__PURE__ */ React15.createElement(View10, { style: { marginTop: multiline && !isFloating ? 5 : 0 } }, start),
1727
- options ? /* @__PURE__ */ React15.createElement(
1730
+ isFloating ? /* @__PURE__ */ React15.createElement(View10, { style: styles.contentWrapper }, label != null && label !== "" ? /* @__PURE__ */ React15.createElement(
1731
+ Animated3.Text,
1732
+ {
1733
+ style: { ...styles.label, top: labelAnim },
1734
+ pointerEvents: "none"
1735
+ },
1736
+ label
1737
+ ) : null, options ? /* @__PURE__ */ React15.createElement(
1728
1738
  View10,
1729
1739
  {
1730
- style: isFloating ? {
1740
+ style: {
1731
1741
  flex: 1,
1732
1742
  alignItems: "center",
1733
1743
  flexDirection: "row"
1734
- } : void 0
1744
+ }
1735
1745
  },
1736
1746
  isFloating && selectedOption?.start ? /* @__PURE__ */ React15.createElement(
1737
1747
  View10,
@@ -1802,7 +1812,59 @@ var TextFieldBase = React15.forwardRef(
1802
1812
  onChangeText,
1803
1813
  key: type === "password" ? showPassword ? "show" : "hide" : void 0,
1804
1814
  keyboardType,
1805
- placeholderTextColor: isFloating ? colors2.textSecondary.main : colors2.textSecondary.light,
1815
+ placeholderTextColor: colors2.textSecondary.light,
1816
+ editable: !disabled,
1817
+ placeholder,
1818
+ selectTextOnFocus: !disabled,
1819
+ onSubmitEditing,
1820
+ multiline,
1821
+ textAlignVertical: multiline ? "top" : "center",
1822
+ ...formProps,
1823
+ ...props,
1824
+ style: styles.input
1825
+ }
1826
+ )) : options ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, selectedOption ? /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.inputText }, selectedOption.label) : /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.placeholder }, placeholder), /* @__PURE__ */ React15.createElement(
1827
+ Ionicons4,
1828
+ {
1829
+ name: "chevron-down",
1830
+ size: 24,
1831
+ style: { marginLeft: "auto", marginRight: 15 },
1832
+ color: colors2.dark.light
1833
+ }
1834
+ )) : isDate ? /* @__PURE__ */ React15.createElement(View10, { style: styles.dateContent }, /* @__PURE__ */ React15.createElement(
1835
+ Typography_default,
1836
+ {
1837
+ style: [
1838
+ styles.dateText,
1839
+ !value ? styles.datePlaceholder : void 0
1840
+ ],
1841
+ color: value ? "dark" : "textSecondary"
1842
+ },
1843
+ value || placeholder
1844
+ ), /* @__PURE__ */ React15.createElement(View10, { style: { marginLeft: 8 } }, end ?? /* @__PURE__ */ React15.createElement(
1845
+ Ionicons4,
1846
+ {
1847
+ name: "calendar-outline",
1848
+ size: 22,
1849
+ color: colors2.textSecondary.main
1850
+ }
1851
+ ))) : /* @__PURE__ */ React15.createElement(
1852
+ TextInput2,
1853
+ {
1854
+ ref,
1855
+ onFocus: () => {
1856
+ onFocus();
1857
+ setFocused(true);
1858
+ },
1859
+ onBlur: () => {
1860
+ onBlur();
1861
+ setFocused(false);
1862
+ },
1863
+ value,
1864
+ onChangeText,
1865
+ key: type === "password" ? showPassword ? "show" : "hide" : void 0,
1866
+ keyboardType,
1867
+ placeholderTextColor: colors2.textSecondary.light,
1806
1868
  editable: !disabled,
1807
1869
  placeholder,
1808
1870
  selectTextOnFocus: !disabled,
@@ -1838,15 +1900,7 @@ var TextFieldBase = React15.forwardRef(
1838
1900
  }
1839
1901
  )
1840
1902
  ) : null
1841
- ), helperText ? /* @__PURE__ */ React15.createElement(
1842
- Typography_default,
1843
- {
1844
- color: "textSecondary",
1845
- style: styles.helperText,
1846
- variant: "caption"
1847
- },
1848
- helperText
1849
- ) : null, error ? /* @__PURE__ */ React15.createElement(View10, { style: styles.error }, /* @__PURE__ */ React15.createElement(MaterialIcons5, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.errorText, color: "error" }, error)) : null), options ? /* @__PURE__ */ React15.createElement(
1903
+ ), helperText ? /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.helperText, variant: "caption" }, helperText) : null, error ? /* @__PURE__ */ React15.createElement(View10, { style: styles.error }, /* @__PURE__ */ React15.createElement(MaterialIcons5, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.errorText, color: "error" }, error)) : null), options ? /* @__PURE__ */ React15.createElement(
1850
1904
  SelectMenu_default,
1851
1905
  {
1852
1906
  options,