react-better-html 1.1.141 → 1.1.143

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
@@ -733,6 +733,7 @@ type TableProps<DataItem> = {
733
733
  pageSize?: number;
734
734
  pageCount?: number;
735
735
  isInsideTableExpandRow?: boolean;
736
+ getRowStyle?: (item: DataItem, index: number) => ComponentStyle;
736
737
  onClickRow?: (item: DataItem, index: number) => void;
737
738
  onClickAllCheckboxes?: (checked: boolean) => void;
738
739
  onChangePage?: (page: number) => void;
package/dist/index.d.ts CHANGED
@@ -733,6 +733,7 @@ type TableProps<DataItem> = {
733
733
  pageSize?: number;
734
734
  pageCount?: number;
735
735
  isInsideTableExpandRow?: boolean;
736
+ getRowStyle?: (item: DataItem, index: number) => ComponentStyle;
736
737
  onClickRow?: (item: DataItem, index: number) => void;
737
738
  onClickAllCheckboxes?: (checked: boolean) => void;
738
739
  onChangePage?: (page: number) => void;
package/dist/index.js CHANGED
@@ -6989,7 +6989,7 @@ var ToggleInputComponent = (0, import_react21.forwardRef)(function ToggleInput({
6989
6989
  onChange?.(newIsChecked, value);
6990
6990
  }, [checked, controlledChecked, onChange, value]);
6991
6991
  const readyId = id ?? internalId;
6992
- 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: [
6993
6993
  label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Label_default, { text: label, color: labelColor, required, isError: !!errorText, htmlFor: readyId }),
6994
6994
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
6995
6995
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Div_default.row, { position: "relative", alignItems: "center", children: [
@@ -7233,24 +7233,16 @@ FormRowComponent.withTitle = (0, import_react23.forwardRef)(function WithTitle({
7233
7233
  }, ref) {
7234
7234
  const theme2 = useTheme();
7235
7235
  const mediaQuery = useMediaQuery();
7236
+ const titleGap = theme2.styles.space;
7236
7237
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(FormRowComponent, { ...props, ref, children: [
7237
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7238
- Div_default.row,
7239
- {
7240
- width: "100%",
7241
- alignItems: "center",
7242
- gap: theme2.styles.space,
7243
- paddingRight: isLoading ? 26 : void 0,
7244
- transition: theme2.styles.transition,
7245
- children: [
7246
- icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon_default, { name: icon }),
7247
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
7248
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { as: "h3", children: title }),
7249
- description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { color: theme2.colors.textSecondary, children: description })
7250
- ] })
7251
- ]
7252
- }
7253
- ),
7238
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.row, { width: "100%", alignItems: "center", gap: titleGap, children: [
7239
+ icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon_default, { name: icon }),
7240
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
7241
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { as: "h3", children: title }),
7242
+ description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { color: theme2.colors.textSecondary, children: description })
7243
+ ] }),
7244
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Div_default, { width: 26 - titleGap })
7245
+ ] }),
7254
7246
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7255
7247
  Div_default.row,
7256
7248
  {
@@ -7499,6 +7491,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
7499
7491
  pageSize,
7500
7492
  pageCount,
7501
7493
  isInsideTableExpandRow,
7494
+ getRowStyle,
7502
7495
  onClickRow,
7503
7496
  onClickAllCheckboxes,
7504
7497
  onChangePage,
@@ -7927,6 +7920,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
7927
7920
  "tr",
7928
7921
  {
7929
7922
  className: isInsideTableExpandRow && onClickRow === void 0 && expandColumn === void 0 ? "withoutHover" : void 0,
7923
+ style: getRowStyle?.(item, rowIndex),
7930
7924
  onClick: () => onClickRowElement(item, rowIndex),
7931
7925
  children: columns.map((column, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
7932
7926
  TdStyledComponent,