react-better-html 1.1.154 → 1.1.156

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
@@ -388,7 +388,9 @@ type InputFieldProps = {
388
388
  leftIcon?: IconName | AnyOtherString;
389
389
  rightIcon?: IconName | AnyOtherString;
390
390
  prefix?: React.ReactNode;
391
+ prefixBackgroundColor?: string;
391
392
  suffix?: React.ReactNode;
393
+ suffixBackgroundColor?: string;
392
394
  insideInputFieldComponent?: React.ReactNode;
393
395
  /** @default false */
394
396
  withDebounce?: boolean;
@@ -521,6 +523,7 @@ declare function usePageScroll(): {
521
523
  scrollY: number;
522
524
  };
523
525
  declare function useMediaQuery(): {
526
+ screenWidth: number;
524
527
  size320: boolean;
525
528
  size400: boolean;
526
529
  size500: boolean;
@@ -582,6 +585,7 @@ type FormProps = {
582
585
  form?: OmitProps<ReturnType<typeof useForm>, "focusField">;
583
586
  submitButtonText?: string;
584
587
  submitButtonLoaderName?: LoaderName | AnyOtherString;
588
+ submitButtonIsLoading?: boolean;
585
589
  submitButtonId?: string;
586
590
  /** @default false */
587
591
  submitButtonIsDisabled?: boolean;
@@ -590,14 +594,12 @@ type FormProps = {
590
594
  actionButtonsLocation?: "left" | "center" | "right";
591
595
  gap?: React.CSSProperties["gap"];
592
596
  /** @default false */
593
- isSubmitting?: boolean;
594
- /** @default false */
595
597
  isDestructive?: boolean;
596
598
  /** @default false */
597
599
  withDividers?: boolean;
598
600
  renderActionButtons?: React.ReactNode;
599
601
  onClickCancel?: () => void;
600
- onSubmit?: (value: React.FormEvent<HTMLFormElement>) => void;
602
+ onSubmit?: (event: React.FormEvent<HTMLFormElement>) => void;
601
603
  children?: React.ReactNode;
602
604
  } & ComponentMarginProps;
603
605
  type FormComponentType = {
package/dist/index.d.ts CHANGED
@@ -388,7 +388,9 @@ type InputFieldProps = {
388
388
  leftIcon?: IconName | AnyOtherString;
389
389
  rightIcon?: IconName | AnyOtherString;
390
390
  prefix?: React.ReactNode;
391
+ prefixBackgroundColor?: string;
391
392
  suffix?: React.ReactNode;
393
+ suffixBackgroundColor?: string;
392
394
  insideInputFieldComponent?: React.ReactNode;
393
395
  /** @default false */
394
396
  withDebounce?: boolean;
@@ -521,6 +523,7 @@ declare function usePageScroll(): {
521
523
  scrollY: number;
522
524
  };
523
525
  declare function useMediaQuery(): {
526
+ screenWidth: number;
524
527
  size320: boolean;
525
528
  size400: boolean;
526
529
  size500: boolean;
@@ -582,6 +585,7 @@ type FormProps = {
582
585
  form?: OmitProps<ReturnType<typeof useForm>, "focusField">;
583
586
  submitButtonText?: string;
584
587
  submitButtonLoaderName?: LoaderName | AnyOtherString;
588
+ submitButtonIsLoading?: boolean;
585
589
  submitButtonId?: string;
586
590
  /** @default false */
587
591
  submitButtonIsDisabled?: boolean;
@@ -590,14 +594,12 @@ type FormProps = {
590
594
  actionButtonsLocation?: "left" | "center" | "right";
591
595
  gap?: React.CSSProperties["gap"];
592
596
  /** @default false */
593
- isSubmitting?: boolean;
594
- /** @default false */
595
597
  isDestructive?: boolean;
596
598
  /** @default false */
597
599
  withDividers?: boolean;
598
600
  renderActionButtons?: React.ReactNode;
599
601
  onClickCancel?: () => void;
600
- onSubmit?: (value: React.FormEvent<HTMLFormElement>) => void;
602
+ onSubmit?: (event: React.FormEvent<HTMLFormElement>) => void;
601
603
  children?: React.ReactNode;
602
604
  } & ComponentMarginProps;
603
605
  type FormComponentType = {
package/dist/index.js CHANGED
@@ -2864,6 +2864,7 @@ function usePageScroll() {
2864
2864
  function useMediaQuery() {
2865
2865
  const { width } = usePageResize();
2866
2866
  return {
2867
+ screenWidth: width,
2867
2868
  size320: width <= 320,
2868
2869
  size400: width <= 400,
2869
2870
  size500: width <= 500,
@@ -3704,7 +3705,7 @@ var PageHeaderComponent = (0, import_react15.forwardRef)(function PageHeader({
3704
3705
  {
3705
3706
  alignItems: "center",
3706
3707
  gap: theme2.styles.space,
3707
- marginBottom: marginBottom || theme2.styles.space * 2,
3708
+ marginBottom: marginBottom ?? theme2.styles.space * 2,
3708
3709
  ref,
3709
3710
  children: [
3710
3711
  imageUrl && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Image_default.profileImage, { src: imageUrl, size: imageSize ?? (mediaQuery.size600 ? 46 : 60) }),
@@ -6189,7 +6190,9 @@ var InputFieldComponent = (0, import_react20.forwardRef)(function InputField({
6189
6190
  leftIcon,
6190
6191
  rightIcon,
6191
6192
  prefix,
6193
+ prefixBackgroundColor,
6192
6194
  suffix,
6195
+ suffixBackgroundColor,
6193
6196
  insideInputFieldComponent,
6194
6197
  withDebounce,
6195
6198
  debounceDelay = 0.5,
@@ -6204,6 +6207,7 @@ var InputFieldComponent = (0, import_react20.forwardRef)(function InputField({
6204
6207
  }, ref) {
6205
6208
  const theme2 = useTheme();
6206
6209
  const internalId = (0, import_react20.useId)();
6210
+ const { colorTheme } = useBetterHtmlContextInternal();
6207
6211
  const [_, debouncedValue, setDebouncedValue] = useDebounceState(
6208
6212
  props.value?.toString() ?? "",
6209
6213
  debounceDelay
@@ -6247,7 +6251,7 @@ var InputFieldComponent = (0, import_react20.forwardRef)(function InputField({
6247
6251
  justifyContent: "center",
6248
6252
  border: `1px solid ${theme2.colors.border}`,
6249
6253
  borderRight: "none",
6250
- backgroundColor: lightenColor(theme2.colors.border, 0.8),
6254
+ backgroundColor: prefixBackgroundColor ?? (colorTheme === "light" ? darkenColor(theme2.colors.backgroundContent, 0.03) : lightenColor(theme2.colors.backgroundContent, 0.1)),
6251
6255
  borderTopLeftRadius: theme2.styles.borderRadius,
6252
6256
  borderBottomLeftRadius: theme2.styles.borderRadius,
6253
6257
  paddingInline: theme2.styles.space,
@@ -6316,7 +6320,7 @@ var InputFieldComponent = (0, import_react20.forwardRef)(function InputField({
6316
6320
  justifyContent: "center",
6317
6321
  border: `1px solid ${theme2.colors.border}`,
6318
6322
  borderLeft: "none",
6319
- backgroundColor: lightenColor(theme2.colors.border, 0.8),
6323
+ backgroundColor: suffixBackgroundColor ?? (colorTheme === "light" ? darkenColor(theme2.colors.backgroundContent, 0.03) : lightenColor(theme2.colors.backgroundContent, 0.1)),
6320
6324
  borderTopRightRadius: theme2.styles.borderRadius,
6321
6325
  borderBottomRightRadius: theme2.styles.borderRadius,
6322
6326
  paddingInline: theme2.styles.space,
@@ -7244,12 +7248,12 @@ var FormComponent = (0, import_react22.forwardRef)(function Form({
7244
7248
  form,
7245
7249
  submitButtonText,
7246
7250
  submitButtonLoaderName,
7251
+ submitButtonIsLoading,
7247
7252
  submitButtonId,
7248
7253
  submitButtonIsDisabled,
7249
7254
  cancelButtonText,
7250
7255
  actionButtonsLocation = "right",
7251
7256
  gap,
7252
- isSubmitting,
7253
7257
  isDestructive,
7254
7258
  withDividers,
7255
7259
  renderActionButtons,
@@ -7286,7 +7290,7 @@ var FormComponent = (0, import_react22.forwardRef)(function Form({
7286
7290
  SubmitButtonTag,
7287
7291
  {
7288
7292
  text: submitButtonText,
7289
- isLoading: isSubmitting || form?.isSubmitting,
7293
+ isLoading: submitButtonIsLoading || form?.isSubmitting,
7290
7294
  loaderName: submitButtonLoaderName,
7291
7295
  disabled: submitButtonIsDisabledFinal,
7292
7296
  id: submitButtonId,