@hoddy-ui/next 2.5.91 → 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.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -226,6 +226,8 @@ interface TextFieldProps extends TextInputProps {
|
|
|
226
226
|
onFocus?: () => void;
|
|
227
227
|
onBlur?: () => void;
|
|
228
228
|
selectMenuProps?: Partial<SelectMenuProps>;
|
|
229
|
+
/** When true (default), floating label is in open state when placeholder is set. When false, label only opens on focus or when value is set. */
|
|
230
|
+
openLabelWithPlaceholder?: boolean;
|
|
229
231
|
}
|
|
230
232
|
interface TypographyProps extends TextProps {
|
|
231
233
|
children: ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -226,6 +226,8 @@ interface TextFieldProps extends TextInputProps {
|
|
|
226
226
|
onFocus?: () => void;
|
|
227
227
|
onBlur?: () => void;
|
|
228
228
|
selectMenuProps?: Partial<SelectMenuProps>;
|
|
229
|
+
/** When true (default), floating label is in open state when placeholder is set. When false, label only opens on focus or when value is set. */
|
|
230
|
+
openLabelWithPlaceholder?: boolean;
|
|
229
231
|
}
|
|
230
232
|
interface TypographyProps extends TextProps {
|
|
231
233
|
children: ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -143,6 +143,30 @@ function colors(theme) {
|
|
|
143
143
|
text: "#ffffff",
|
|
144
144
|
...extraColors?.light?.primary,
|
|
145
145
|
...extraColors?.dark?.primary
|
|
146
|
+
},
|
|
147
|
+
error: {
|
|
148
|
+
...extraColors?.light?.error,
|
|
149
|
+
...extraColors?.dark?.error
|
|
150
|
+
},
|
|
151
|
+
secondary: {
|
|
152
|
+
...extraColors?.light?.secondary,
|
|
153
|
+
...extraColors?.dark?.secondary
|
|
154
|
+
},
|
|
155
|
+
warning: {
|
|
156
|
+
...extraColors?.light?.warning,
|
|
157
|
+
...extraColors?.dark?.warning
|
|
158
|
+
},
|
|
159
|
+
success: {
|
|
160
|
+
...extraColors?.light?.success,
|
|
161
|
+
...extraColors?.dark?.success
|
|
162
|
+
},
|
|
163
|
+
info: {
|
|
164
|
+
...extraColors?.light?.info,
|
|
165
|
+
...extraColors?.dark?.info
|
|
166
|
+
},
|
|
167
|
+
blue: {
|
|
168
|
+
...extraColors?.light?.blue,
|
|
169
|
+
...extraColors?.dark?.blue
|
|
146
170
|
}
|
|
147
171
|
};
|
|
148
172
|
const dynamicColors = theme === "dark" ? darkColors : lightColors;
|
|
@@ -1601,6 +1625,7 @@ var TextFieldBase = import_react16.default.forwardRef(
|
|
|
1601
1625
|
options,
|
|
1602
1626
|
multiline,
|
|
1603
1627
|
selectMenuProps,
|
|
1628
|
+
openLabelWithPlaceholder = true,
|
|
1604
1629
|
...props
|
|
1605
1630
|
}, ref) => {
|
|
1606
1631
|
const colors2 = useColors();
|
|
@@ -1619,7 +1644,7 @@ var TextFieldBase = import_react16.default.forwardRef(
|
|
|
1619
1644
|
};
|
|
1620
1645
|
const isFloating = labelVariant === "floating";
|
|
1621
1646
|
const hasPlaceholder = placeholder != null && String(placeholder).trim() !== "";
|
|
1622
|
-
const labelOpen = focused || value || isFloating && hasPlaceholder;
|
|
1647
|
+
const labelOpen = focused || value || isFloating && hasPlaceholder && openLabelWithPlaceholder;
|
|
1623
1648
|
const baseHeight = (0, import_react_native_size_matters13.moderateScale)(
|
|
1624
1649
|
multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
|
|
1625
1650
|
);
|