@hoddy-ui/next 2.5.83 → 2.5.85

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
@@ -274,6 +274,7 @@ interface RatingStarsProps {
274
274
  rating: number;
275
275
  size: number;
276
276
  color?: colorTypes | (string & {});
277
+ inactiveColor?: colorTypes | (string & {});
277
278
  }
278
279
  interface RatingInputProps {
279
280
  rating?: number;
package/dist/index.d.ts CHANGED
@@ -274,6 +274,7 @@ interface RatingStarsProps {
274
274
  rating: number;
275
275
  size: number;
276
276
  color?: colorTypes | (string & {});
277
+ inactiveColor?: colorTypes | (string & {});
277
278
  }
278
279
  interface RatingInputProps {
279
280
  rating?: number;
package/dist/index.js CHANGED
@@ -1291,7 +1291,8 @@ var RatingInput = ({
1291
1291
  var RatingStars = ({
1292
1292
  rating = 0,
1293
1293
  size = 16,
1294
- color = "#FFD700"
1294
+ color = "#FFD700",
1295
+ inactiveColor = "textSecondary"
1295
1296
  }) => {
1296
1297
  const colors2 = useColors();
1297
1298
  const styles = import_react_native_size_matters9.ScaledSheet.create({
@@ -1314,7 +1315,7 @@ var RatingStars = ({
1314
1315
  key: index,
1315
1316
  name: "star",
1316
1317
  size,
1317
- color: colors2.textSecondary.light
1318
+ color: colors2[inactiveColor]?.main || inactiveColor
1318
1319
  }
1319
1320
  )));
1320
1321
  };
@@ -1685,9 +1686,9 @@ var TextField = ({
1685
1686
  return /* @__PURE__ */ new Date();
1686
1687
  if (value instanceof Date)
1687
1688
  return value;
1688
- const parts = `${value}`.split("/");
1689
- if (parts.length === 3) {
1690
- const [day, month, year] = parts;
1689
+ const isoParts = `${value}`.split("-");
1690
+ if (isoParts.length === 3) {
1691
+ const [year, month, day] = isoParts;
1691
1692
  const parsed = new Date(
1692
1693
  parseInt(year, 10),
1693
1694
  parseInt(month, 10) - 1,
@@ -1700,10 +1701,10 @@ var TextField = ({
1700
1701
  return isNaN(fallback.getTime()) ? /* @__PURE__ */ new Date() : fallback;
1701
1702
  };
1702
1703
  const handleDateConfirm = (date) => {
1703
- const day = date.getDate();
1704
- const month = date.getMonth() + 1;
1705
1704
  const year = date.getFullYear();
1706
- const dateString = `${day}/${month}/${year}`;
1705
+ const month = `${date.getMonth() + 1}`.padStart(2, "0");
1706
+ const day = `${date.getDate()}`.padStart(2, "0");
1707
+ const dateString = `${year}-${month}-${day}`;
1707
1708
  onChangeText?.(dateString);
1708
1709
  setDatePickerVisible(false);
1709
1710
  };
@@ -1983,9 +1984,9 @@ var TextField2 = import_react16.default.forwardRef(
1983
1984
  return /* @__PURE__ */ new Date();
1984
1985
  if (value instanceof Date)
1985
1986
  return value;
1986
- const parts = `${value}`.split("/");
1987
- if (parts.length === 3) {
1988
- const [day, month, year] = parts;
1987
+ const isoParts = `${value}`.split("-");
1988
+ if (isoParts.length === 3) {
1989
+ const [year, month, day] = isoParts;
1989
1990
  const parsed = new Date(
1990
1991
  parseInt(year, 10),
1991
1992
  parseInt(month, 10) - 1,
@@ -1998,12 +1999,13 @@ var TextField2 = import_react16.default.forwardRef(
1998
1999
  return isNaN(fallback.getTime()) ? /* @__PURE__ */ new Date() : fallback;
1999
2000
  };
2000
2001
  const handleDateConfirm = (date) => {
2001
- const day = date.getDate();
2002
- const month = date.getMonth() + 1;
2003
2002
  const year = date.getFullYear();
2003
+ const month = `${date.getMonth() + 1}`.padStart(2, "0");
2004
+ const day = `${date.getDate()}`.padStart(2, "0");
2004
2005
  const dateString = `${year}-${month}-${day}`;
2005
2006
  onChangeText?.(dateString);
2006
2007
  setDatePickerVisible(false);
2008
+ setFocused(false);
2007
2009
  };
2008
2010
  const handleContainerPress = () => {
2009
2011
  if (disabled)
@@ -2106,19 +2108,7 @@ var TextField2 = import_react16.default.forwardRef(
2106
2108
  variant: "caption"
2107
2109
  },
2108
2110
  helperText
2109
- ), 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))), isDate && /* @__PURE__ */ import_react16.default.createElement(
2110
- import_react_native_modal_datetime_picker.default,
2111
- {
2112
- isVisible: datePickerVisible,
2113
- mode: "date",
2114
- date: parseDateValue(),
2115
- onConfirm: handleDateConfirm,
2116
- onCancel: () => {
2117
- setDatePickerVisible(false);
2118
- setFocused(false);
2119
- }
2120
- }
2121
- ), options && /* @__PURE__ */ import_react16.default.createElement(
2111
+ ), 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))), options && /* @__PURE__ */ import_react16.default.createElement(
2122
2112
  SelectMenu_default,
2123
2113
  {
2124
2114
  options,
@@ -2130,6 +2120,18 @@ var TextField2 = import_react16.default.forwardRef(
2130
2120
  onChange: onChangeText,
2131
2121
  ...selectMenuProps
2132
2122
  }
2123
+ ), isDate && /* @__PURE__ */ import_react16.default.createElement(
2124
+ import_react_native_modal_datetime_picker.default,
2125
+ {
2126
+ isVisible: datePickerVisible,
2127
+ mode: "date",
2128
+ date: parseDateValue(),
2129
+ onConfirm: handleDateConfirm,
2130
+ onCancel: () => {
2131
+ setDatePickerVisible(false);
2132
+ setFocused(false);
2133
+ }
2134
+ }
2133
2135
  ));
2134
2136
  }
2135
2137
  );