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.d.mts +103 -97
- package/dist/index.d.ts +103 -97
- package/dist/index.js +142 -150
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +142 -150
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
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
|
-
|
|
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
|
|
7311
|
+
var isStartAlign = (align) => align === "left" || align === "top";
|
|
7312
|
+
var tooltipClosedTransform = (props) => ({
|
|
7301
7313
|
top: import_styled_components14.css`
|
|
7302
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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", "
|
|
7327
|
+
shouldForwardProp: (prop) => !["theme", "position", "pointerEvents", "isOpen"].includes(prop)
|
|
7354
7328
|
})`
|
|
7355
|
-
position:
|
|
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) =>
|
|
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
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
7525
|
-
|
|
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)
|
|
7540
|
-
|
|
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
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
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
|
}
|