react-better-html 1.1.140 → 1.1.142

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
@@ -114,7 +114,7 @@ type LoaderProps = {
114
114
  width?: number;
115
115
  /** @default false */
116
116
  disabled?: boolean;
117
- } & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName">;
117
+ } & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName" | "transform" | "clipPath">;
118
118
  type LoaderComponentType = {
119
119
  (props: LoaderProps): React.ReactElement;
120
120
  box: (props: OmitProps<LoaderProps, "size"> & {
@@ -614,6 +614,11 @@ type FormRowProps = {
614
614
  * @default false
615
615
  */
616
616
  noBreakingPoint?: boolean;
617
+ /**
618
+ * @description Weather to render the children as a column or not
619
+ * @default false
620
+ */
621
+ asColumn?: boolean;
617
622
  gap?: React.CSSProperties["gap"];
618
623
  children?: React.ReactNode;
619
624
  } & ComponentMarginProps;
@@ -623,6 +628,7 @@ type FormRowComponentType = {
623
628
  icon?: IconName | AnyOtherString;
624
629
  title?: string;
625
630
  description?: string;
631
+ isLoading?: boolean;
626
632
  withActions?: boolean;
627
633
  saveButtonLoaderName?: LoaderName | AnyOtherString;
628
634
  resetButtonLoaderName?: LoaderName | AnyOtherString;
package/dist/index.d.ts CHANGED
@@ -114,7 +114,7 @@ type LoaderProps = {
114
114
  width?: number;
115
115
  /** @default false */
116
116
  disabled?: boolean;
117
- } & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName">;
117
+ } & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName" | "transform" | "clipPath">;
118
118
  type LoaderComponentType = {
119
119
  (props: LoaderProps): React.ReactElement;
120
120
  box: (props: OmitProps<LoaderProps, "size"> & {
@@ -614,6 +614,11 @@ type FormRowProps = {
614
614
  * @default false
615
615
  */
616
616
  noBreakingPoint?: boolean;
617
+ /**
618
+ * @description Weather to render the children as a column or not
619
+ * @default false
620
+ */
621
+ asColumn?: boolean;
617
622
  gap?: React.CSSProperties["gap"];
618
623
  children?: React.ReactNode;
619
624
  } & ComponentMarginProps;
@@ -623,6 +628,7 @@ type FormRowComponentType = {
623
628
  icon?: IconName | AnyOtherString;
624
629
  title?: string;
625
630
  description?: string;
631
+ isLoading?: boolean;
626
632
  withActions?: boolean;
627
633
  saveButtonLoaderName?: LoaderName | AnyOtherString;
628
634
  resetButtonLoaderName?: LoaderName | AnyOtherString;
package/dist/index.js CHANGED
@@ -2434,6 +2434,7 @@ function AlertsHolder() {
2434
2434
  gap: theme2.styles.gap,
2435
2435
  alignItems: pluginConfig.align === "center" ? "center" : pluginConfig.align === "right" ? "flex-end" : void 0,
2436
2436
  transform: pluginConfig.align === "center" ? "translateX(-50%)" : void 0,
2437
+ zIndex: 1e3,
2437
2438
  children: alerts.map((alert) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Alert_default, { alert }, alert.id))
2438
2439
  }
2439
2440
  );
@@ -6988,7 +6989,7 @@ var ToggleInputComponent = (0, import_react21.forwardRef)(function ToggleInput({
6988
6989
  onChange?.(newIsChecked, value);
6989
6990
  }, [checked, controlledChecked, onChange, value]);
6990
6991
  const readyId = id ?? internalId;
6991
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Div_default.column, { width: "100%", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, children: [
6992
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Div_default.column, { gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, children: [
6992
6993
  label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Label_default, { text: label, color: labelColor, required, isError: !!errorText, htmlFor: readyId }),
6993
6994
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
6994
6995
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Div_default.row, { position: "relative", alignItems: "center", children: [
@@ -7207,10 +7208,10 @@ var Form_default = Form2;
7207
7208
  // src/components/FormRow.tsx
7208
7209
  var import_react23 = require("react");
7209
7210
  var import_jsx_runtime21 = require("react/jsx-runtime");
7210
- var FormRowComponent = (0, import_react23.forwardRef)(function FormRow({ oneItemOnly, noBreakingPoint, gap, children, ...props }, ref) {
7211
+ var FormRowComponent = (0, import_react23.forwardRef)(function FormRow({ oneItemOnly, noBreakingPoint, asColumn, gap, children, ...props }, ref) {
7211
7212
  const theme2 = useTheme();
7212
7213
  const mediaQuery = useMediaQuery();
7213
- const breakingPoint = !noBreakingPoint ? mediaQuery.size900 : false;
7214
+ const breakingPoint = asColumn ?? (!noBreakingPoint ? mediaQuery.size900 : false);
7214
7215
  const readyGap = breakingPoint || noBreakingPoint && mediaQuery.size900 ? theme2.styles.gap : theme2.styles.space * 2;
7215
7216
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.row, { alignItems: "center", gap: gap ?? readyGap, invertFlexDirection: breakingPoint, ...props, ref, children: [
7216
7217
  children,
@@ -7221,6 +7222,7 @@ FormRowComponent.withTitle = (0, import_react23.forwardRef)(function WithTitle({
7221
7222
  icon,
7222
7223
  title,
7223
7224
  description,
7225
+ isLoading,
7224
7226
  withActions,
7225
7227
  saveButtonLoaderName,
7226
7228
  resetButtonLoaderName,
@@ -7231,21 +7233,36 @@ FormRowComponent.withTitle = (0, import_react23.forwardRef)(function WithTitle({
7231
7233
  }, ref) {
7232
7234
  const theme2 = useTheme();
7233
7235
  const mediaQuery = useMediaQuery();
7236
+ const titleGap = theme2.styles.space;
7234
7237
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(FormRowComponent, { ...props, ref, children: [
7235
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.row, { width: "100%", alignItems: "center", gap: theme2.styles.space, children: [
7238
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.row, { width: "100%", alignItems: "center", gap: titleGap, children: [
7236
7239
  icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon_default, { name: icon }),
7237
7240
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
7238
7241
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { as: "h3", children: title }),
7239
7242
  description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { color: theme2.colors.textSecondary, children: description })
7240
- ] })
7243
+ ] }),
7244
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Div_default, { width: 26 - titleGap })
7241
7245
  ] }),
7242
7246
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7243
7247
  Div_default.row,
7244
7248
  {
7249
+ position: "relative",
7245
7250
  width: props.noBreakingPoint && mediaQuery.size900 ? void 0 : "100%",
7246
7251
  alignItems: "center",
7247
7252
  gap: theme2.styles.gap,
7248
7253
  children: [
7254
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7255
+ Div_default,
7256
+ {
7257
+ position: "absolute",
7258
+ top: "50%",
7259
+ right: `calc(100% + ${theme2.styles.space}px)`,
7260
+ transform: "translateY(-50%)",
7261
+ opacity: !isLoading ? 0 : void 0,
7262
+ pointerEvents: !isLoading ? "none" : void 0,
7263
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Loader_default, {})
7264
+ }
7265
+ ),
7249
7266
  children,
7250
7267
  withActions && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
7251
7268
  onClickReset && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button_default.icon, { icon: "XMark", loaderName: resetButtonLoaderName, onClick: onClickReset }),