react-better-html 1.1.287 → 1.1.288
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 +103 -97
- package/dist/index.d.ts +103 -97
- package/dist/index.js +50 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -40
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1485,6 +1485,7 @@ Image.profileImage = forwardRef3(function ProfileImage({ size = 40, letters, let
|
|
|
1485
1485
|
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
1486
1486
|
const props = useComponentsPropsMerger(betterHtmlContextInternal.components.image?.style?.default, ImageProps3);
|
|
1487
1487
|
const theme2 = useTheme4();
|
|
1488
|
+
const lettersSplit = letters?.split(" ") ?? [];
|
|
1488
1489
|
return letters ? /* @__PURE__ */ jsx3(
|
|
1489
1490
|
Div_default.row,
|
|
1490
1491
|
{
|
|
@@ -1498,7 +1499,7 @@ Image.profileImage = forwardRef3(function ProfileImage({ size = 40, letters, let
|
|
|
1498
1499
|
...props,
|
|
1499
1500
|
width: size,
|
|
1500
1501
|
height: size,
|
|
1501
|
-
children: /* @__PURE__ */ jsx3(Text_default, { fontSize: size / 2.5, fontWeight: 700, color: letterColor ?? theme2.colors.textPrimary, children: letters.toUpperCase().slice(0, 2) })
|
|
1502
|
+
children: /* @__PURE__ */ jsx3(Text_default, { fontSize: size / 2.5, fontWeight: 700, color: letterColor ?? theme2.colors.textPrimary, children: lettersSplit.length > 1 ? lettersSplit[0][0] + (lettersSplit.at(-1)?.[0] ?? lettersSplit[0][1] ?? "") : letters.toUpperCase().slice(0, 2) })
|
|
1502
1503
|
}
|
|
1503
1504
|
) : /* @__PURE__ */ jsx3(
|
|
1504
1505
|
Image,
|
|
@@ -3800,6 +3801,7 @@ var DropdownComponent = forwardRef10(function Dropdown(dropdownProps, ref) {
|
|
|
3800
3801
|
labelGap,
|
|
3801
3802
|
errorText,
|
|
3802
3803
|
infoText,
|
|
3804
|
+
infoTextColor,
|
|
3803
3805
|
required,
|
|
3804
3806
|
name,
|
|
3805
3807
|
disabled,
|
|
@@ -4046,6 +4048,7 @@ var DropdownComponent = forwardRef10(function Dropdown(dropdownProps, ref) {
|
|
|
4046
4048
|
labelGap,
|
|
4047
4049
|
errorText,
|
|
4048
4050
|
infoText,
|
|
4051
|
+
infoTextColor,
|
|
4049
4052
|
required: withMultiselect ? (Array.isArray(value) ? value.length > 0 : value !== void 0) ? false : required : required,
|
|
4050
4053
|
textAlign,
|
|
4051
4054
|
name,
|
|
@@ -4698,6 +4701,7 @@ var InputFieldComponent = forwardRef11(function InputField(inputFieldProps, ref)
|
|
|
4698
4701
|
labelGap,
|
|
4699
4702
|
errorText,
|
|
4700
4703
|
infoText,
|
|
4704
|
+
infoTextColor,
|
|
4701
4705
|
leftIcon,
|
|
4702
4706
|
rightIcon,
|
|
4703
4707
|
prefix,
|
|
@@ -4863,7 +4867,7 @@ var InputFieldComponent = forwardRef11(function InputField(inputFieldProps, ref)
|
|
|
4863
4867
|
as: "span",
|
|
4864
4868
|
display: "block",
|
|
4865
4869
|
fontSize: 14,
|
|
4866
|
-
color: errorText ? theme2.colors.error : labelColor ?? theme2.colors.textSecondary,
|
|
4870
|
+
color: errorText ? theme2.colors.error : infoTextColor ?? labelColor ?? theme2.colors.textSecondary,
|
|
4867
4871
|
children: errorText || infoText
|
|
4868
4872
|
}
|
|
4869
4873
|
)
|
|
@@ -5867,6 +5871,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5867
5871
|
textAdvanced,
|
|
5868
5872
|
errorText,
|
|
5869
5873
|
infoText,
|
|
5874
|
+
infoTextColor,
|
|
5870
5875
|
size = componentSize,
|
|
5871
5876
|
value,
|
|
5872
5877
|
onChange,
|
|
@@ -5996,7 +6001,7 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
|
|
|
5996
6001
|
as: "span",
|
|
5997
6002
|
display: "block",
|
|
5998
6003
|
fontSize: 14,
|
|
5999
|
-
color: errorText ? theme2.colors.error : labelColor ?? theme2.colors.textSecondary,
|
|
6004
|
+
color: errorText ? theme2.colors.error : infoTextColor ?? labelColor ?? theme2.colors.textSecondary,
|
|
6000
6005
|
children: errorText || infoText
|
|
6001
6006
|
}
|
|
6002
6007
|
)
|
|
@@ -6123,30 +6128,32 @@ var ToggleInput_default = {
|
|
|
6123
6128
|
import { Children, forwardRef as forwardRef13, Fragment as Fragment7, memo as memo19, useMemo as useMemo7 } from "react";
|
|
6124
6129
|
import { useTheme as useTheme21 } from "react-better-core";
|
|
6125
6130
|
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
6126
|
-
var FormComponent = forwardRef13(function Form({
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6131
|
+
var FormComponent = forwardRef13(function Form(formProps, ref) {
|
|
6132
|
+
const betterHtmlContextInternal = useBetterHtmlContextInternal();
|
|
6133
|
+
const {
|
|
6134
|
+
form,
|
|
6135
|
+
name,
|
|
6136
|
+
submitButtonText,
|
|
6137
|
+
submitButtonLoaderName,
|
|
6138
|
+
submitButtonIsLoading,
|
|
6139
|
+
submitButtonId,
|
|
6140
|
+
submitButtonIsDisabled,
|
|
6141
|
+
cancelButtonText,
|
|
6142
|
+
cancelButtonLoaderName,
|
|
6143
|
+
cancelButtonIsLoading,
|
|
6144
|
+
cancelButtonId,
|
|
6145
|
+
cancelButtonIsDisabled,
|
|
6146
|
+
actionButtonsLocation = "right",
|
|
6147
|
+
gap,
|
|
6148
|
+
isDestructive,
|
|
6149
|
+
withDividers,
|
|
6150
|
+
renderActionButtons,
|
|
6151
|
+
onClickCancel,
|
|
6152
|
+
onSubmit,
|
|
6153
|
+
id,
|
|
6154
|
+
children,
|
|
6155
|
+
...props
|
|
6156
|
+
} = useComponentsPropsMerger(betterHtmlContextInternal.components.form?.style?.default, formProps);
|
|
6150
6157
|
const theme2 = useTheme21();
|
|
6151
6158
|
const submitButtonIsDisabledInternal = useMemo7(() => {
|
|
6152
6159
|
if (!form || !form.requiredFields) return false;
|
|
@@ -6156,6 +6163,17 @@ var FormComponent = forwardRef13(function Form({
|
|
|
6156
6163
|
}, [form]);
|
|
6157
6164
|
const SubmitButtonTag = isDestructive ? Button_default.destructive : Button_default;
|
|
6158
6165
|
const submitButtonIsDisabledFinal = submitButtonIsDisabled || submitButtonIsDisabledInternal;
|
|
6166
|
+
const cancelButton = /* @__PURE__ */ jsx20(
|
|
6167
|
+
Button_default.secondary,
|
|
6168
|
+
{
|
|
6169
|
+
text: cancelButtonText ?? "Cancel",
|
|
6170
|
+
isLoading: cancelButtonIsLoading,
|
|
6171
|
+
loaderName: cancelButtonLoaderName,
|
|
6172
|
+
disabled: cancelButtonIsDisabled,
|
|
6173
|
+
id: cancelButtonId,
|
|
6174
|
+
onClick: onClickCancel
|
|
6175
|
+
}
|
|
6176
|
+
);
|
|
6159
6177
|
return /* @__PURE__ */ jsx20(Div_default, { width: "100%", ...props, children: /* @__PURE__ */ jsxs16("form", { name, onSubmit: onSubmit ?? form?.onSubmit, id, ref, children: [
|
|
6160
6178
|
gap !== void 0 || withDividers ? /* @__PURE__ */ jsx20(Div_default.column, { gap: gap ?? (withDividers ? theme2.styles.space : theme2.styles.gap), children: withDividers ? Children.toArray(children).map((child, index) => /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
6161
6179
|
child,
|
|
@@ -6174,18 +6192,8 @@ var FormComponent = forwardRef13(function Form({
|
|
|
6174
6192
|
gap: theme2.styles.gap,
|
|
6175
6193
|
marginTop: theme2.styles.space,
|
|
6176
6194
|
children: [
|
|
6177
|
-
renderActionButtons,
|
|
6178
|
-
|
|
6179
|
-
Button_default.secondary,
|
|
6180
|
-
{
|
|
6181
|
-
text: cancelButtonText ?? "Cancel",
|
|
6182
|
-
isLoading: cancelButtonIsLoading,
|
|
6183
|
-
loaderName: cancelButtonLoaderName,
|
|
6184
|
-
disabled: cancelButtonIsDisabled,
|
|
6185
|
-
id: cancelButtonId,
|
|
6186
|
-
onClick: onClickCancel
|
|
6187
|
-
}
|
|
6188
|
-
),
|
|
6195
|
+
actionButtonsLocation === "right" && renderActionButtons,
|
|
6196
|
+
actionButtonsLocation === "right" && onClickCancel ? cancelButton : void 0,
|
|
6189
6197
|
/* @__PURE__ */ jsx20(
|
|
6190
6198
|
SubmitButtonTag,
|
|
6191
6199
|
{
|
|
@@ -6196,7 +6204,9 @@ var FormComponent = forwardRef13(function Form({
|
|
|
6196
6204
|
id: submitButtonId,
|
|
6197
6205
|
isSubmit: true
|
|
6198
6206
|
}
|
|
6199
|
-
)
|
|
6207
|
+
),
|
|
6208
|
+
actionButtonsLocation === "left" && onClickCancel ? cancelButton : void 0,
|
|
6209
|
+
actionButtonsLocation === "left" && renderActionButtons
|
|
6200
6210
|
]
|
|
6201
6211
|
}
|
|
6202
6212
|
)
|