react-better-html 1.1.286 → 1.1.288

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.js CHANGED
@@ -1558,6 +1558,7 @@ Image.profileImage = (0, import_react4.forwardRef)(function ProfileImage({ size
1558
1558
  const betterHtmlContextInternal = useBetterHtmlContextInternal();
1559
1559
  const props = useComponentsPropsMerger(betterHtmlContextInternal.components.image?.style?.default, ImageProps3);
1560
1560
  const theme2 = (0, import_react_better_core4.useTheme)();
1561
+ const lettersSplit = letters?.split(" ") ?? [];
1561
1562
  return letters ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1562
1563
  Div_default.row,
1563
1564
  {
@@ -1571,7 +1572,7 @@ Image.profileImage = (0, import_react4.forwardRef)(function ProfileImage({ size
1571
1572
  ...props,
1572
1573
  width: size,
1573
1574
  height: size,
1574
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text_default, { fontSize: size / 2.5, fontWeight: 700, color: letterColor ?? theme2.colors.textPrimary, children: letters.toUpperCase().slice(0, 2) })
1575
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text_default, { fontSize: size / 2.5, fontWeight: 700, color: letterColor ?? theme2.colors.textPrimary, children: lettersSplit.length > 1 ? lettersSplit[0][0] + (lettersSplit.at(-1)?.[0] ?? lettersSplit[0][1] ?? "") : letters.toUpperCase().slice(0, 2) })
1575
1576
  }
1576
1577
  ) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1577
1578
  Image,
@@ -3851,6 +3852,7 @@ var DropdownComponent = (0, import_react19.forwardRef)(function Dropdown(dropdow
3851
3852
  labelGap,
3852
3853
  errorText,
3853
3854
  infoText,
3855
+ infoTextColor,
3854
3856
  required,
3855
3857
  name,
3856
3858
  disabled,
@@ -4097,6 +4099,7 @@ var DropdownComponent = (0, import_react19.forwardRef)(function Dropdown(dropdow
4097
4099
  labelGap,
4098
4100
  errorText,
4099
4101
  infoText,
4102
+ infoTextColor,
4100
4103
  required: withMultiselect ? (Array.isArray(value) ? value.length > 0 : value !== void 0) ? false : required : required,
4101
4104
  textAlign,
4102
4105
  name,
@@ -4749,6 +4752,7 @@ var InputFieldComponent = (0, import_react22.forwardRef)(function InputField(inp
4749
4752
  labelGap,
4750
4753
  errorText,
4751
4754
  infoText,
4755
+ infoTextColor,
4752
4756
  leftIcon,
4753
4757
  rightIcon,
4754
4758
  prefix,
@@ -4914,7 +4918,7 @@ var InputFieldComponent = (0, import_react22.forwardRef)(function InputField(inp
4914
4918
  as: "span",
4915
4919
  display: "block",
4916
4920
  fontSize: 14,
4917
- color: errorText ? theme2.colors.error : labelColor ?? theme2.colors.textSecondary,
4921
+ color: errorText ? theme2.colors.error : infoTextColor ?? labelColor ?? theme2.colors.textSecondary,
4918
4922
  children: errorText || infoText
4919
4923
  }
4920
4924
  )
@@ -5918,6 +5922,7 @@ var ToggleInputComponent = (0, import_react23.forwardRef)(function ToggleInput({
5918
5922
  textAdvanced,
5919
5923
  errorText,
5920
5924
  infoText,
5925
+ infoTextColor,
5921
5926
  size = componentSize,
5922
5927
  value,
5923
5928
  onChange,
@@ -6047,7 +6052,7 @@ var ToggleInputComponent = (0, import_react23.forwardRef)(function ToggleInput({
6047
6052
  as: "span",
6048
6053
  display: "block",
6049
6054
  fontSize: 14,
6050
- color: errorText ? theme2.colors.error : labelColor ?? theme2.colors.textSecondary,
6055
+ color: errorText ? theme2.colors.error : infoTextColor ?? labelColor ?? theme2.colors.textSecondary,
6051
6056
  children: errorText || infoText
6052
6057
  }
6053
6058
  )
@@ -6174,30 +6179,32 @@ var ToggleInput_default = {
6174
6179
  var import_react24 = require("react");
6175
6180
  var import_react_better_core21 = require("react-better-core");
6176
6181
  var import_jsx_runtime21 = require("react/jsx-runtime");
6177
- var FormComponent = (0, import_react24.forwardRef)(function Form({
6178
- form,
6179
- name,
6180
- submitButtonText,
6181
- submitButtonLoaderName,
6182
- submitButtonIsLoading,
6183
- submitButtonId,
6184
- submitButtonIsDisabled,
6185
- cancelButtonText,
6186
- cancelButtonLoaderName,
6187
- cancelButtonIsLoading,
6188
- cancelButtonId,
6189
- cancelButtonIsDisabled,
6190
- actionButtonsLocation = "right",
6191
- gap,
6192
- isDestructive,
6193
- withDividers,
6194
- renderActionButtons,
6195
- onClickCancel,
6196
- onSubmit,
6197
- id,
6198
- children,
6199
- ...props
6200
- }, ref) {
6182
+ var FormComponent = (0, import_react24.forwardRef)(function Form(formProps, ref) {
6183
+ const betterHtmlContextInternal = useBetterHtmlContextInternal();
6184
+ const {
6185
+ form,
6186
+ name,
6187
+ submitButtonText,
6188
+ submitButtonLoaderName,
6189
+ submitButtonIsLoading,
6190
+ submitButtonId,
6191
+ submitButtonIsDisabled,
6192
+ cancelButtonText,
6193
+ cancelButtonLoaderName,
6194
+ cancelButtonIsLoading,
6195
+ cancelButtonId,
6196
+ cancelButtonIsDisabled,
6197
+ actionButtonsLocation = "right",
6198
+ gap,
6199
+ isDestructive,
6200
+ withDividers,
6201
+ renderActionButtons,
6202
+ onClickCancel,
6203
+ onSubmit,
6204
+ id,
6205
+ children,
6206
+ ...props
6207
+ } = useComponentsPropsMerger(betterHtmlContextInternal.components.form?.style?.default, formProps);
6201
6208
  const theme2 = (0, import_react_better_core21.useTheme)();
6202
6209
  const submitButtonIsDisabledInternal = (0, import_react24.useMemo)(() => {
6203
6210
  if (!form || !form.requiredFields) return false;
@@ -6207,6 +6214,17 @@ var FormComponent = (0, import_react24.forwardRef)(function Form({
6207
6214
  }, [form]);
6208
6215
  const SubmitButtonTag = isDestructive ? Button_default.destructive : Button_default;
6209
6216
  const submitButtonIsDisabledFinal = submitButtonIsDisabled || submitButtonIsDisabledInternal;
6217
+ const cancelButton = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6218
+ Button_default.secondary,
6219
+ {
6220
+ text: cancelButtonText ?? "Cancel",
6221
+ isLoading: cancelButtonIsLoading,
6222
+ loaderName: cancelButtonLoaderName,
6223
+ disabled: cancelButtonIsDisabled,
6224
+ id: cancelButtonId,
6225
+ onClick: onClickCancel
6226
+ }
6227
+ );
6210
6228
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Div_default, { width: "100%", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("form", { name, onSubmit: onSubmit ?? form?.onSubmit, id, ref, children: [
6211
6229
  gap !== void 0 || withDividers ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Div_default.column, { gap: gap ?? (withDividers ? theme2.styles.space : theme2.styles.gap), children: withDividers ? import_react24.Children.toArray(children).map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react24.Fragment, { children: [
6212
6230
  child,
@@ -6225,18 +6243,8 @@ var FormComponent = (0, import_react24.forwardRef)(function Form({
6225
6243
  gap: theme2.styles.gap,
6226
6244
  marginTop: theme2.styles.space,
6227
6245
  children: [
6228
- renderActionButtons,
6229
- onClickCancel && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6230
- Button_default.secondary,
6231
- {
6232
- text: cancelButtonText ?? "Cancel",
6233
- isLoading: cancelButtonIsLoading,
6234
- loaderName: cancelButtonLoaderName,
6235
- disabled: cancelButtonIsDisabled,
6236
- id: cancelButtonId,
6237
- onClick: onClickCancel
6238
- }
6239
- ),
6246
+ actionButtonsLocation === "right" && renderActionButtons,
6247
+ actionButtonsLocation === "right" && onClickCancel ? cancelButton : void 0,
6240
6248
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6241
6249
  SubmitButtonTag,
6242
6250
  {
@@ -6247,7 +6255,9 @@ var FormComponent = (0, import_react24.forwardRef)(function Form({
6247
6255
  id: submitButtonId,
6248
6256
  isSubmit: true
6249
6257
  }
6250
- )
6258
+ ),
6259
+ actionButtonsLocation === "left" && onClickCancel ? cancelButton : void 0,
6260
+ actionButtonsLocation === "left" && renderActionButtons
6251
6261
  ]
6252
6262
  }
6253
6263
  )
@@ -7294,73 +7304,38 @@ var Table_default = Table2;
7294
7304
 
7295
7305
  // src/components/Tooltip.tsx
7296
7306
  var import_react29 = require("react");
7307
+ var import_react_dom2 = require("react-dom");
7297
7308
  var import_react_better_core26 = require("react-better-core");
7298
7309
  var import_styled_components14 = __toESM(require("styled-components"));
7299
7310
  var import_jsx_runtime26 = require("react/jsx-runtime");
7300
- var tooltipContainerStyle = (props) => ({
7311
+ var isStartAlign = (align) => align === "left" || align === "top";
7312
+ var tooltipClosedTransform = (props) => ({
7301
7313
  top: import_styled_components14.css`
7302
- bottom: calc(100% + ${props.gap}px + ${props.arrowSize}px);
7303
- ${props.align === "center" ? "left: 50%;" : props.align === "left" ? "left: 0;" : "right: 0;"}
7314
+ transform: translateY(${props.theme.styles.gap}px);
7304
7315
  `,
7305
7316
  bottom: import_styled_components14.css`
7306
- top: calc(100% + ${props.gap}px + ${props.arrowSize}px);
7307
- ${props.align === "center" ? "left: 50%;" : props.align === "left" ? "left: 0;" : "right: 0;"};
7317
+ transform: translateY(-${props.theme.styles.gap}px);
7308
7318
  `,
7309
7319
  left: import_styled_components14.css`
7310
- ${props.align === "center" ? "top: 50%;" : props.align === "top" ? "top: 0;" : "bottom: 0;"};
7311
- right: calc(100% + ${props.gap}px + ${props.arrowSize}px);
7320
+ transform: translateX(${props.theme.styles.gap}px);
7312
7321
  `,
7313
7322
  right: import_styled_components14.css`
7314
- ${props.align === "center" ? "top: 50%;" : props.align === "top" ? "top: 0;" : "bottom: 0;"};
7315
- left: calc(100% + ${props.gap}px + ${props.arrowSize}px);
7323
+ transform: translateX(-${props.theme.styles.gap}px);
7316
7324
  `
7317
7325
  });
7318
- var tooltipPositionStyle = (props) => ({
7319
- top: {
7320
- opened: import_styled_components14.css`
7321
- transform: translateX(${props.align === "center" ? "-50%" : "0"});
7322
- `,
7323
- closed: import_styled_components14.css`
7324
- transform: translateX(${props.align === "center" ? "-50%" : "0"}) translateY(${props.theme.styles.gap}px);
7325
- `
7326
- },
7327
- bottom: {
7328
- opened: import_styled_components14.css`
7329
- transform: translateX(${props.align === "center" ? "-50%" : "0"});
7330
- `,
7331
- closed: import_styled_components14.css`
7332
- transform: translateX(${props.align === "center" ? "-50%" : "0"}) translateY(-${props.theme.styles.gap}px);
7333
- `
7334
- },
7335
- left: {
7336
- opened: import_styled_components14.css`
7337
- transform: translateY(${props.align === "center" ? "-50%" : "0"});
7338
- `,
7339
- closed: import_styled_components14.css`
7340
- transform: translateX(${props.theme.styles.gap}px) translateY(${props.align === "center" ? "-50%" : "0"});
7341
- `
7342
- },
7343
- right: {
7344
- opened: import_styled_components14.css`
7345
- transform: translateY(${props.align === "center" ? "-50%" : "0"});
7346
- `,
7347
- closed: import_styled_components14.css`
7348
- transform: translateX(-${props.theme.styles.gap}px) translateY(${props.align === "center" ? "-50%" : "0"});
7349
- `
7350
- }
7351
- });
7352
7326
  var TooltipContainer = import_styled_components14.default.div.withConfig({
7353
- shouldForwardProp: (prop) => !["theme", "position", "align", "pointerEvents", "withArrow", "arrowSize", "isOpen", "gap"].includes(prop)
7327
+ shouldForwardProp: (prop) => !["theme", "position", "pointerEvents", "isOpen"].includes(prop)
7354
7328
  })`
7355
- position: absolute;
7329
+ position: fixed;
7330
+ top: 0;
7331
+ left: 0;
7356
7332
  opacity: ${(props) => props.isOpen ? 1 : 0};
7357
7333
  pointer-events: ${(props) => props.isOpen ? props.pointerEvents : "none"};
7358
7334
  transition: ${(props) => props.theme.styles.transition};
7335
+ transition-property: opacity, transform;
7359
7336
  z-index: 1000;
7360
7337
 
7361
- ${(props) => tooltipContainerStyle(props)[props.position]}
7362
-
7363
- ${(props) => props.isOpen ? tooltipPositionStyle(props)[props.position].opened : tooltipPositionStyle(props)[props.position].closed}
7338
+ ${(props) => props.isOpen ? "transform: none;" : tooltipClosedTransform(props)[props.position]}
7364
7339
  `;
7365
7340
  var arrowStyle = (props, borderWidth) => ({
7366
7341
  top: {
@@ -7456,6 +7431,7 @@ var TooltipComponent = (0, import_react29.forwardRef)(function Tooltip({
7456
7431
  const wrapperRef = (0, import_react29.useRef)(null);
7457
7432
  const triggerHolderRef = (0, import_react29.useRef)(null);
7458
7433
  const contentRef = (0, import_react29.useRef)(null);
7434
+ const tooltipContainerRef = (0, import_react29.useRef)(null);
7459
7435
  const closeTimerRef = (0, import_react29.useRef)(void 0);
7460
7436
  const [isOpen, setIsOpen] = (0, import_react29.useState)(false);
7461
7437
  const [isOpenLate, setIsOpenLate] = (0, import_react29.useState)(false);
@@ -7463,6 +7439,8 @@ var TooltipComponent = (0, import_react29.forwardRef)(function Tooltip({
7463
7439
  const gap = theme2.styles.gap / 2;
7464
7440
  const outsideScreenGap = theme2.styles.gap / 2;
7465
7441
  const totalGap = arrowSize + gap;
7442
+ const arrowSideSpace = theme2.styles.borderRadius;
7443
+ const arrowAnchorOffset = withArrow ? arrowSideSpace + arrowSize : 0;
7466
7444
  const openTooltip = (0, import_react29.useCallback)(() => {
7467
7445
  if (disabled) return;
7468
7446
  if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
@@ -7500,19 +7478,25 @@ var TooltipComponent = (0, import_react29.forwardRef)(function Tooltip({
7500
7478
  },
7501
7479
  [trigger, isOpen, closeTooltip]
7502
7480
  );
7503
- const clampContentInsideViewport = (0, import_react29.useCallback)(() => {
7504
- if (!wrapperRef.current || !contentRef.current) return;
7481
+ const updateContainerPosition = (0, import_react29.useCallback)(() => {
7482
+ if (!wrapperRef.current || !contentRef.current || !tooltipContainerRef.current) return;
7505
7483
  const wrapperRect = wrapperRef.current.getBoundingClientRect();
7506
7484
  const contentWidth2 = contentRef.current.offsetWidth;
7507
7485
  const contentHeight = contentRef.current.offsetHeight;
7486
+ const getCrossAxisStart = (wrapperStart, wrapperSize, contentSize) => {
7487
+ const wrapperCenter = wrapperStart + wrapperSize / 2;
7488
+ if (align === "center") return wrapperCenter - contentSize / 2;
7489
+ if (isStartAlign(align)) return arrowAnchorOffset ? wrapperCenter - arrowAnchorOffset : wrapperStart;
7490
+ return arrowAnchorOffset ? wrapperCenter + arrowAnchorOffset - contentSize : wrapperStart + wrapperSize - contentSize;
7491
+ };
7508
7492
  let expectedLeft;
7509
7493
  let expectedTop;
7510
7494
  if (position === "top" || position === "bottom") {
7511
7495
  expectedTop = position === "top" ? wrapperRect.top - totalGap - contentHeight : wrapperRect.bottom + totalGap;
7512
- expectedLeft = align === "left" ? wrapperRect.left : align === "right" ? wrapperRect.right - contentWidth2 : wrapperRect.left + wrapperRect.width / 2 - contentWidth2 / 2;
7496
+ expectedLeft = getCrossAxisStart(wrapperRect.left, wrapperRect.width, contentWidth2);
7513
7497
  } else {
7514
7498
  expectedLeft = position === "left" ? wrapperRect.left - totalGap - contentWidth2 : wrapperRect.right + totalGap;
7515
- expectedTop = align === "top" ? wrapperRect.top : align === "bottom" ? wrapperRect.bottom - contentHeight : wrapperRect.top + wrapperRect.height / 2 - contentHeight / 2;
7499
+ expectedTop = getCrossAxisStart(wrapperRect.top, wrapperRect.height, contentHeight);
7516
7500
  }
7517
7501
  const getShift = (start, size, viewportSize) => {
7518
7502
  if (start < outsideScreenGap) return outsideScreenGap - start;
@@ -7521,8 +7505,9 @@ var TooltipComponent = (0, import_react29.forwardRef)(function Tooltip({
7521
7505
  };
7522
7506
  const shiftX = getShift(expectedLeft, contentWidth2, window.innerWidth);
7523
7507
  const shiftY = getShift(expectedTop, contentHeight, window.innerHeight);
7524
- contentRef.current.style.transform = shiftX || shiftY ? `translate(${shiftX}px, ${shiftY}px)` : "";
7525
- }, [position, align, totalGap, outsideScreenGap]);
7508
+ tooltipContainerRef.current.style.left = `${expectedLeft + shiftX}px`;
7509
+ tooltipContainerRef.current.style.top = `${expectedTop + shiftY}px`;
7510
+ }, [position, align, totalGap, outsideScreenGap, arrowAnchorOffset]);
7526
7511
  (0, import_react29.useEffect)(() => {
7527
7512
  if (trigger === "click") {
7528
7513
  document.addEventListener("mousedown", onClickOutside);
@@ -7536,8 +7521,15 @@ var TooltipComponent = (0, import_react29.forwardRef)(function Tooltip({
7536
7521
  closeTooltip();
7537
7522
  }, [disabled]);
7538
7523
  (0, import_react29.useLayoutEffect)(() => {
7539
- if (isOpen) clampContentInsideViewport();
7540
- }, [isOpen, clampContentInsideViewport]);
7524
+ if (!isOpen) return;
7525
+ updateContainerPosition();
7526
+ window.addEventListener("scroll", updateContainerPosition, true);
7527
+ window.addEventListener("resize", updateContainerPosition);
7528
+ return () => {
7529
+ window.removeEventListener("scroll", updateContainerPosition, true);
7530
+ window.removeEventListener("resize", updateContainerPosition);
7531
+ };
7532
+ }, [isOpen, updateContainerPosition]);
7541
7533
  (0, import_react29.useImperativeHandle)(ref, () => {
7542
7534
  return {
7543
7535
  isOpen,
@@ -7566,60 +7558,60 @@ var TooltipComponent = (0, import_react29.forwardRef)(function Tooltip({
7566
7558
  children
7567
7559
  }
7568
7560
  ),
7569
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7570
- TooltipContainer,
7571
- {
7572
- theme: theme2,
7573
- position,
7574
- align,
7575
- pointerEvents: contentPointerEvents,
7576
- withArrow,
7577
- arrowSize,
7578
- gap,
7579
- isOpen,
7580
- role: "tooltip",
7581
- children: (isOpen || isOpenLate) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Div_default, { position: "relative", ref: contentRef, children: [
7582
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7583
- Div_default.box,
7584
- {
7585
- position: "relative",
7586
- width: contentWidth,
7587
- minWidth: contentMinWidth,
7588
- backgroundColor: backgroundColor ?? theme2.colors.backgroundContent,
7589
- boxShadow: "0px 10px 20px #00000020",
7590
- paddingBlock: contentPaddingBlock ?? (isSmall ? theme2.styles.gap / 2 : theme2.styles.gap),
7591
- paddingInline: contentPaddingInline ?? (asContextMenu ? 0 : isSmall ? theme2.styles.space / 2 : theme2.styles.space),
7592
- overflow: asContextMenu ? "hidden" : void 0,
7593
- children: content
7594
- }
7595
- ),
7596
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7597
- Div_default,
7598
- {
7599
- position: "absolute",
7600
- width: position === "left" || position === "right" ? totalGap : "100%",
7601
- height: position === "top" || position === "bottom" ? totalGap : "100%",
7602
- top: position === "top" ? "100%" : position === "bottom" ? void 0 : 0,
7603
- bottom: position === "bottom" ? "100%" : position === "top" ? void 0 : 0,
7604
- left: position === "left" ? "100%" : position === "right" ? void 0 : 0,
7605
- right: position === "right" ? "100%" : position === "left" ? void 0 : 0,
7606
- borderTopLeftRadius: 999,
7607
- borderTopRightRadius: 999
7608
- }
7609
- ),
7610
- withArrow && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7611
- Arrow,
7612
- {
7613
- position,
7614
- align,
7615
- sideSpace: theme2.styles.borderRadius,
7616
- size: arrowSize,
7617
- color: backgroundColor ?? theme2.colors.backgroundContent,
7618
- isOpen
7619
- }
7620
- )
7621
- ] })
7622
- }
7561
+ (0, import_react_dom2.createPortal)(
7562
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7563
+ TooltipContainer,
7564
+ {
7565
+ theme: theme2,
7566
+ position,
7567
+ pointerEvents: contentPointerEvents,
7568
+ isOpen,
7569
+ role: "tooltip",
7570
+ ref: tooltipContainerRef,
7571
+ children: (isOpen || isOpenLate) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Div_default, { position: "relative", ref: contentRef, children: [
7572
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7573
+ Div_default.box,
7574
+ {
7575
+ position: "relative",
7576
+ width: contentWidth,
7577
+ minWidth: contentMinWidth,
7578
+ backgroundColor: backgroundColor ?? theme2.colors.backgroundContent,
7579
+ boxShadow: "0px 10px 20px #00000020",
7580
+ paddingBlock: contentPaddingBlock ?? (isSmall ? theme2.styles.gap / 2 : theme2.styles.gap),
7581
+ paddingInline: contentPaddingInline ?? (asContextMenu ? 0 : isSmall ? theme2.styles.space / 2 : theme2.styles.space),
7582
+ overflow: asContextMenu ? "hidden" : void 0,
7583
+ children: content
7584
+ }
7585
+ ),
7586
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7587
+ Div_default,
7588
+ {
7589
+ position: "absolute",
7590
+ width: position === "left" || position === "right" ? totalGap : "100%",
7591
+ height: position === "top" || position === "bottom" ? totalGap : "100%",
7592
+ top: position === "top" ? "100%" : position === "bottom" ? void 0 : 0,
7593
+ bottom: position === "bottom" ? "100%" : position === "top" ? void 0 : 0,
7594
+ left: position === "left" ? "100%" : position === "right" ? void 0 : 0,
7595
+ right: position === "right" ? "100%" : position === "left" ? void 0 : 0,
7596
+ borderTopLeftRadius: 999,
7597
+ borderTopRightRadius: 999
7598
+ }
7599
+ ),
7600
+ withArrow && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
7601
+ Arrow,
7602
+ {
7603
+ position,
7604
+ align,
7605
+ sideSpace: arrowSideSpace,
7606
+ size: arrowSize,
7607
+ color: backgroundColor ?? theme2.colors.backgroundContent,
7608
+ isOpen
7609
+ }
7610
+ )
7611
+ ] })
7612
+ }
7613
+ ),
7614
+ document.body
7623
7615
  )
7624
7616
  ]
7625
7617
  }