react-better-html 1.1.144 → 1.1.146

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
@@ -3266,6 +3266,7 @@ var ModalComponent = forwardRef6(function Modal({
3266
3266
  headerBackgroundColor,
3267
3267
  name,
3268
3268
  overflow,
3269
+ withoutCloseButton,
3269
3270
  onOpen,
3270
3271
  onClose,
3271
3272
  children
@@ -3300,6 +3301,15 @@ var ModalComponent = forwardRef6(function Modal({
3300
3301
  setIsOpenedLate(false);
3301
3302
  }, 0.2 * 1e3);
3302
3303
  }, [onClose, urlQuery, name]);
3304
+ const onKeyDown = useCallback6(
3305
+ (event) => {
3306
+ if (event.key === "Escape") {
3307
+ if (!withoutCloseButton) return;
3308
+ event.preventDefault();
3309
+ }
3310
+ },
3311
+ [withoutCloseButton]
3312
+ );
3303
3313
  useImperativeHandle(
3304
3314
  ref,
3305
3315
  () => {
@@ -3319,6 +3329,7 @@ var ModalComponent = forwardRef6(function Modal({
3319
3329
  colorTheme,
3320
3330
  opacity: !isOpened ? 0 : 1,
3321
3331
  onClose: onClickClose,
3332
+ onKeyDown,
3322
3333
  ref: dialogRef,
3323
3334
  children: isOpenedLate ? /* @__PURE__ */ jsx11(
3324
3335
  Div_default.column,
@@ -3378,7 +3389,7 @@ var ModalComponent = forwardRef6(function Modal({
3378
3389
  }
3379
3390
  )
3380
3391
  ] }),
3381
- /* @__PURE__ */ jsx11(
3392
+ !withoutCloseButton && /* @__PURE__ */ jsx11(
3382
3393
  Button_default.icon,
3383
3394
  {
3384
3395
  icon: "XMark",
@@ -3392,7 +3403,7 @@ var ModalComponent = forwardRef6(function Modal({
3392
3403
  }
3393
3404
  ),
3394
3405
  /* @__PURE__ */ jsx11(Divider_default.horizontal, {})
3395
- ] }) : /* @__PURE__ */ jsx11(Div_default, { position: "absolute", top: theme2.styles.space, right: theme2.styles.space, children: /* @__PURE__ */ jsx11(Button_default.icon, { icon: "XMark", onClick: onClickClose }) }),
3406
+ ] }) : /* @__PURE__ */ jsx11(Fragment2, { children: !withoutCloseButton && /* @__PURE__ */ jsx11(Div_default, { position: "absolute", top: theme2.styles.space, right: theme2.styles.space, children: /* @__PURE__ */ jsx11(Button_default.icon, { icon: "XMark", onClick: onClickClose }) }) }),
3396
3407
  /* @__PURE__ */ jsx11(
3397
3408
  Div_default,
3398
3409
  {
@@ -7015,6 +7026,7 @@ var ToggleInput_default = {
7015
7026
  {
7016
7027
  alignItems: "center",
7017
7028
  gap: theme2.styles.gap,
7029
+ isTabAccessed: true,
7018
7030
  onMouseDown: setIsMouseDown.setTrue,
7019
7031
  onMouseUp: setIsMouseDown.setFalse,
7020
7032
  onMouseOut: setIsMouseDown.setFalse,
@@ -7317,12 +7329,65 @@ import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs17 } from "react/jsx-r
7317
7329
  var defaultImageWidth = 160;
7318
7330
  var maximumVisiblePages = 11;
7319
7331
  var TableStyledComponent = styled11.table.withConfig({
7320
- shouldForwardProp: (prop) => !["isStriped", "withHover", "withStickyHeader", "colorTheme", "theme"].includes(prop)
7332
+ shouldForwardProp: (prop) => ![
7333
+ "isStriped",
7334
+ "withHover",
7335
+ "withStickyHeader",
7336
+ "colorTheme",
7337
+ "theme",
7338
+ "containsOverflowComponents",
7339
+ "withFooter"
7340
+ ].includes(prop)
7321
7341
  })`
7322
7342
  width: 100%;
7323
7343
  border-collapse: collapse;
7324
7344
  border-spacing: 0;
7325
7345
 
7346
+ thead {
7347
+ tr:first-child {
7348
+ border-top-left-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
7349
+ border-top-right-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
7350
+
7351
+ th:first-child {
7352
+ border-top-left-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
7353
+ }
7354
+
7355
+ th:last-child {
7356
+ border-top-right-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
7357
+ }
7358
+ }
7359
+ }
7360
+
7361
+ tbody {
7362
+ tr:last-child {
7363
+ border-bottom-left-radius: ${(props) => props.containsOverflowComponents && !props.withFooter ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
7364
+ border-bottom-right-radius: ${(props) => props.containsOverflowComponents && !props.withFooter ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
7365
+
7366
+ td:first-child {
7367
+ border-bottom-left-radius: ${(props) => props.containsOverflowComponents && !props.withFooter ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
7368
+ }
7369
+
7370
+ td:last-child {
7371
+ border-bottom-right-radius: ${(props) => props.containsOverflowComponents && !props.withFooter ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
7372
+ }
7373
+ }
7374
+ }
7375
+
7376
+ tfoot {
7377
+ tr:last-child {
7378
+ border-bottom-left-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
7379
+ border-bottom-right-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
7380
+
7381
+ td:first-child {
7382
+ border-bottom-left-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
7383
+ }
7384
+
7385
+ td:last-child {
7386
+ border-bottom-right-radius: ${(props) => props.containsOverflowComponents ? `${props.theme.styles.borderRadius * 2 - 1}px` : void 0};
7387
+ }
7388
+ }
7389
+ }
7390
+
7326
7391
  tr {
7327
7392
  background-color: ${(props) => props.theme.colors.backgroundContent};
7328
7393
 
@@ -7415,6 +7480,7 @@ var TableComponent = forwardRef15(function Table({
7415
7480
  pageSize,
7416
7481
  pageCount,
7417
7482
  isInsideTableExpandRow,
7483
+ containsOverflowComponents,
7418
7484
  getRowStyle,
7419
7485
  onClickRow,
7420
7486
  onClickAllCheckboxes,
@@ -7504,14 +7570,14 @@ var TableComponent = forwardRef15(function Table({
7504
7570
  );
7505
7571
  }
7506
7572
  case "expand": {
7507
- return /* @__PURE__ */ jsx22(
7573
+ return /* @__PURE__ */ jsx22(Div_default, { isTabAccessed: true, children: /* @__PURE__ */ jsx22(
7508
7574
  Icon_default,
7509
7575
  {
7510
7576
  name: "chevronDown",
7511
7577
  transform: `rotate(${expandedRows[itemIndex] ? 180 : 0}deg)`,
7512
7578
  transition: theme2.styles.transition
7513
7579
  }
7514
- );
7580
+ ) });
7515
7581
  }
7516
7582
  default: {
7517
7583
  return /* @__PURE__ */ jsx22(Fragment6, {});
@@ -7785,6 +7851,7 @@ var TableComponent = forwardRef15(function Table({
7785
7851
  },
7786
7852
  [currentPage, setCurrentPage, pageCountInternal, setCheckedItems]
7787
7853
  );
7854
+ const withFooter = pageSize !== void 0 && pageCountInternal > 1;
7788
7855
  const mobileFooterBreakingPoint = mediaQuery.size700 && pageCountInternal > maximumVisiblePages / 1.4;
7789
7856
  return /* @__PURE__ */ jsxs17(Fragment6, { children: [
7790
7857
  /* @__PURE__ */ jsx22(
@@ -7792,7 +7859,7 @@ var TableComponent = forwardRef15(function Table({
7792
7859
  {
7793
7860
  border: `1px solid ${theme2.colors.border}`,
7794
7861
  borderRadius: theme2.styles.borderRadius * 2,
7795
- overflow: "auto",
7862
+ overflow: !containsOverflowComponents ? "auto" : void 0,
7796
7863
  ...props,
7797
7864
  children: /* @__PURE__ */ jsxs17(
7798
7865
  TableStyledComponent,
@@ -7802,6 +7869,8 @@ var TableComponent = forwardRef15(function Table({
7802
7869
  withStickyHeader,
7803
7870
  colorTheme,
7804
7871
  theme: theme2,
7872
+ containsOverflowComponents,
7873
+ withFooter,
7805
7874
  children: [
7806
7875
  /* @__PURE__ */ jsx22("thead", { children: /* @__PURE__ */ jsx22("tr", { className: "isHeader", children: columns.map((column, index) => /* @__PURE__ */ jsx22(
7807
7876
  ThStyledComponent,
@@ -7863,7 +7932,7 @@ var TableComponent = forwardRef15(function Table({
7863
7932
  ),
7864
7933
  expandedRows[rowIndex] && /* @__PURE__ */ jsx22("tr", { className: "withoutHover isExpandRow", children: /* @__PURE__ */ jsx22("td", { colSpan: columns.length, children: renderExpandedRow(item, rowIndex) }) })
7865
7934
  ] }, JSON.stringify(item) + rowIndex)) : /* @__PURE__ */ jsx22("tr", { className: "withoutHover", children: /* @__PURE__ */ jsx22("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ jsx22(Text_default.unknown, { children: noDataItemsMessage }) }) }) }),
7866
- pageSize !== void 0 && pageCountInternal > 1 && /* @__PURE__ */ jsx22("tfoot", { children: /* @__PURE__ */ jsx22("tr", { className: "isFooter", children: /* @__PURE__ */ jsx22("td", { colSpan: columns.length, children: /* @__PURE__ */ jsxs17(
7935
+ withFooter && /* @__PURE__ */ jsx22("tfoot", { children: /* @__PURE__ */ jsx22("tr", { className: "isFooter", children: /* @__PURE__ */ jsx22("td", { colSpan: columns.length, children: /* @__PURE__ */ jsxs17(
7867
7936
  Div_default.column,
7868
7937
  {
7869
7938
  position: "relative",