@hoddy-ui/next 2.5.90 → 2.5.92

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
@@ -65,6 +65,30 @@ function colors(theme) {
65
65
  text: "#ffffff",
66
66
  ...extraColors?.light?.primary,
67
67
  ...extraColors?.dark?.primary
68
+ },
69
+ error: {
70
+ ...extraColors?.light?.error,
71
+ ...extraColors?.dark?.error
72
+ },
73
+ secondary: {
74
+ ...extraColors?.light?.secondary,
75
+ ...extraColors?.dark?.secondary
76
+ },
77
+ warning: {
78
+ ...extraColors?.light?.warning,
79
+ ...extraColors?.dark?.warning
80
+ },
81
+ success: {
82
+ ...extraColors?.light?.success,
83
+ ...extraColors?.dark?.success
84
+ },
85
+ info: {
86
+ ...extraColors?.light?.info,
87
+ ...extraColors?.dark?.info
88
+ },
89
+ blue: {
90
+ ...extraColors?.light?.blue,
91
+ ...extraColors?.dark?.blue
68
92
  }
69
93
  };
70
94
  const dynamicColors = theme === "dark" ? darkColors : lightColors;
@@ -1566,9 +1590,11 @@ var TextFieldBase = React15.forwardRef(
1566
1590
  options,
1567
1591
  multiline,
1568
1592
  selectMenuProps,
1593
+ openLabelWithPlaceholder = true,
1569
1594
  ...props
1570
1595
  }, ref) => {
1571
1596
  const colors2 = useColors();
1597
+ const theme = useTheme();
1572
1598
  const [focused, _setFocused] = useState7(false);
1573
1599
  const [showPassword, setShowPassword] = useState7(false);
1574
1600
  const [datePickerVisible, setDatePickerVisible] = useState7(false);
@@ -1583,7 +1609,7 @@ var TextFieldBase = React15.forwardRef(
1583
1609
  };
1584
1610
  const isFloating = labelVariant === "floating";
1585
1611
  const hasPlaceholder = placeholder != null && String(placeholder).trim() !== "";
1586
- const labelOpen = focused || value || isFloating && hasPlaceholder;
1612
+ const labelOpen = focused || value || isFloating && hasPlaceholder && openLabelWithPlaceholder;
1587
1613
  const baseHeight = moderateScale2(
1588
1614
  multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
1589
1615
  );
@@ -1685,13 +1711,13 @@ var TextFieldBase = React15.forwardRef(
1685
1711
  position: "absolute",
1686
1712
  left: inputPadding,
1687
1713
  fontSize: labelOpen ? "10@s" : "13@s",
1688
- color: error ? colors2.error.main : focused ? colors2[color].main : colors2.textSecondary.main
1714
+ color: error ? colors2.error.main : focused ? theme === "dark" ? colors2[color].light : colors2[color].main : colors2.textSecondary.main
1689
1715
  }
1690
1716
  } : {},
1691
1717
  helperText: {
1692
1718
  paddingHorizontal: "15@s",
1693
1719
  flex: 1,
1694
- color: focused ? colors2[color].main : colors2.textSecondary.main,
1720
+ color: error ? colors2.error.main : focused ? theme === "dark" ? colors2[color].light : colors2[color].main : colors2.textSecondary.main,
1695
1721
  paddingTop: "4@ms"
1696
1722
  },
1697
1723
  error: {
@@ -1900,7 +1926,15 @@ var TextFieldBase = React15.forwardRef(
1900
1926
  }
1901
1927
  )
1902
1928
  ) : null
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", fontWeight: 400 }, error)) : null), options ? /* @__PURE__ */ React15.createElement(
1929
+ ), 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(
1930
+ Typography_default,
1931
+ {
1932
+ style: styles.errorText,
1933
+ color: "error",
1934
+ fontWeight: 400
1935
+ },
1936
+ error
1937
+ )) : null), options ? /* @__PURE__ */ React15.createElement(
1904
1938
  SelectMenu_default,
1905
1939
  {
1906
1940
  options,