react-better-html 1.1.74 → 1.1.76

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.mjs CHANGED
@@ -1335,7 +1335,7 @@ var theme = {
1335
1335
  },
1336
1336
  dark: {
1337
1337
  textPrimary: "#f8f8f8",
1338
- textSecondary: "#e8e8e8",
1338
+ textSecondary: "#c8c8c8",
1339
1339
  textLink: "#0894ff",
1340
1340
  label: "#111111",
1341
1341
  primary: "#9b6499",
@@ -1344,7 +1344,7 @@ var theme = {
1344
1344
  success: "#28a745",
1345
1345
  info: "#0fa0da",
1346
1346
  warn: "#ffc107",
1347
- error: "#dc3545",
1347
+ error: "#f5384b",
1348
1348
  base: "#f8f8f8",
1349
1349
  backgroundBase: "#111111",
1350
1350
  backgroundSecondary: "#222222",
@@ -1553,7 +1553,7 @@ function BetterHtmlProvider({ value, plugins: pluginsToUse, children }) {
1553
1553
  const [loaders, setLoaders] = useState(value?.loaders ?? {});
1554
1554
  const [plugins] = useState(pluginsToUse ?? []);
1555
1555
  const [colorTheme, setColorTheme] = useState(
1556
- localStorage.getItem("theme") === "dark" ? "dark" : "light"
1556
+ localStorage.getItem("theme") === "dark" ? "dark" : value?.colorTheme ?? "light"
1557
1557
  );
1558
1558
  const readyValue = useMemo(
1559
1559
  () => ({
@@ -1606,7 +1606,7 @@ function BetterHtmlProvider({ value, plugins: pluginsToUse, children }) {
1606
1606
  const observer = new MutationObserver((mutations) => {
1607
1607
  mutations.forEach((mutation) => {
1608
1608
  if (mutation.type === "attributes") {
1609
- setColorTheme(html.getAttribute("data-theme") === "dark" ? "dark" : "light");
1609
+ setColorTheme(html.getAttribute("data-theme") === "dark" ? "dark" : value?.colorTheme ?? "light");
1610
1610
  }
1611
1611
  });
1612
1612
  });
@@ -2991,7 +2991,7 @@ function PageHeader({
2991
2991
  /* @__PURE__ */ jsxs6(
2992
2992
  Div_default.column,
2993
2993
  {
2994
- justifyContent: textAlign === "center" ? "center" : textAlign === "right" ? "flex-end" : void 0,
2994
+ alignItems: textAlign === "center" ? "center" : textAlign === "right" ? "flex-end" : void 0,
2995
2995
  flex: 1,
2996
2996
  gap: theme2.styles.gap / 2,
2997
2997
  children: [
@@ -5908,7 +5908,7 @@ import styled10, { css as css2 } from "styled-components";
5908
5908
  import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
5909
5909
  var defaultImageWidth = 120;
5910
5910
  var TableStyledComponent = styled10.table.withConfig({
5911
- shouldForwardProp: (prop) => !["isStriped", "withHover", "withStickyHeader", "theme"].includes(prop)
5911
+ shouldForwardProp: (prop) => !["isStriped", "withHover", "withStickyHeader", "colorTheme", "theme"].includes(prop)
5912
5912
  })`
5913
5913
  width: 100%;
5914
5914
  border-collapse: collapse;
@@ -5936,7 +5936,7 @@ var TableStyledComponent = styled10.table.withConfig({
5936
5936
  transition: ${props.theme.styles.transition};
5937
5937
 
5938
5938
  &:not(.isHeader):hover {
5939
- background-color: ${props.theme.colors.backgroundSecondary}20;
5939
+ filter: brightness(${props.colorTheme === "light" ? "0.95" : "0.85"});
5940
5940
  }
5941
5941
  ` : ""}
5942
5942
 
@@ -5947,7 +5947,7 @@ var TableStyledComponent = styled10.table.withConfig({
5947
5947
  }
5948
5948
 
5949
5949
  td {
5950
- border-top: 1px solid ${(props) => props.theme.colors.border}60;
5950
+ border-top: 1px solid ${(props) => props.theme.colors.border + (props.colorTheme === "light" ? "60" : "40")};
5951
5951
  padding: ${(props) => props.theme.styles.gap}px ${(props) => props.theme.styles.space}px;
5952
5952
 
5953
5953
  &.noData {
@@ -5974,12 +5974,14 @@ var TableComponent = forwardRef11(function Table({
5974
5974
  columns,
5975
5975
  data,
5976
5976
  isStriped,
5977
+ isLoading,
5977
5978
  withStickyHeader,
5978
5979
  noDataItemsMessage = "No data available",
5979
5980
  onClickRow,
5980
5981
  onClickAllCheckboxes,
5981
5982
  ...props
5982
5983
  }, ref) {
5984
+ const { colorTheme } = useBetterHtmlContext();
5983
5985
  const theme2 = useTheme();
5984
5986
  const [checkedItems, setCheckedItems] = useState8([]);
5985
5987
  const renderCellContent = useCallback10(
@@ -6051,6 +6053,7 @@ var TableComponent = forwardRef11(function Table({
6051
6053
  isStriped,
6052
6054
  withHover: onClickRow !== void 0,
6053
6055
  withStickyHeader,
6056
+ colorTheme,
6054
6057
  theme: theme2,
6055
6058
  children: [
6056
6059
  /* @__PURE__ */ jsx19("thead", { children: /* @__PURE__ */ jsx19("tr", { className: "isHeader", children: columns.map((column, index) => /* @__PURE__ */ jsx19(
@@ -6070,7 +6073,7 @@ var TableComponent = forwardRef11(function Table({
6070
6073
  },
6071
6074
  column.type + column.label + index
6072
6075
  )) }) }),
6073
- /* @__PURE__ */ jsx19("tbody", { children: data.length > 0 ? data.map((item, rowIndex) => /* @__PURE__ */ jsx19(
6076
+ /* @__PURE__ */ jsx19("tbody", { children: isLoading ? /* @__PURE__ */ jsx19("tr", { children: /* @__PURE__ */ jsx19("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ jsx19(Loader_default.box, {}) }) }) : data.length > 0 ? data.map((item, rowIndex) => /* @__PURE__ */ jsx19(
6074
6077
  "tr",
6075
6078
  {
6076
6079
  className: onClickRow ? "isClickable" : void 0,