@refineui/react 0.0.10 → 0.0.12
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.cjs +285 -161
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.js +273 -149
- package/dist/index.js.map +1 -1
- package/dist/spec/contract-index.json +1 -1
- package/dist/spec/token-graph.json +30 -36
- package/dist/spec/token-trace-v2.json +32 -29
- package/package.json +1 -1
- package/refineui.css +34 -11
package/dist/index.js
CHANGED
|
@@ -140,16 +140,16 @@ var componentColorTokens = {
|
|
|
140
140
|
},
|
|
141
141
|
tooltip: {
|
|
142
142
|
default: {
|
|
143
|
-
/**
|
|
144
|
-
background: semanticToken("
|
|
143
|
+
/** Frosted floating panel — blur is applied by refineui.css */
|
|
144
|
+
background: semanticToken("surfaceFrosted"),
|
|
145
145
|
foreground: semanticToken("foregroundPrimary"),
|
|
146
146
|
border: semanticToken("borderDefault")
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
149
|
popover: {
|
|
150
150
|
default: {
|
|
151
|
-
/**
|
|
152
|
-
background: semanticToken("
|
|
151
|
+
/** Frosted floating panel — blur is applied by refineui.css */
|
|
152
|
+
background: semanticToken("surfaceFrosted"),
|
|
153
153
|
foreground: semanticToken("foregroundPrimary"),
|
|
154
154
|
border: semanticToken("borderDefault")
|
|
155
155
|
},
|
|
@@ -338,7 +338,7 @@ var componentColorTokens = {
|
|
|
338
338
|
},
|
|
339
339
|
chip: {
|
|
340
340
|
default: {
|
|
341
|
-
background: semanticToken("
|
|
341
|
+
background: semanticToken("backgroundSurfaceSelected"),
|
|
342
342
|
foreground: semanticToken("foregroundBrand"),
|
|
343
343
|
hoverBackground: semanticToken("backgroundPrimaryHover"),
|
|
344
344
|
activeBackground: semanticToken("backgroundPrimaryActive"),
|
|
@@ -368,7 +368,7 @@ var componentColorTokens = {
|
|
|
368
368
|
},
|
|
369
369
|
tag: {
|
|
370
370
|
default: {
|
|
371
|
-
background: semanticToken("
|
|
371
|
+
background: semanticToken("backgroundSurfaceSelected"),
|
|
372
372
|
foreground: semanticToken("foregroundBrand")
|
|
373
373
|
},
|
|
374
374
|
outline: {
|
|
@@ -666,6 +666,7 @@ var componentColorTokens = {
|
|
|
666
666
|
},
|
|
667
667
|
/** Cell fill only — Global tint per MCP `Color`. Glyph/initials ink: `avatar.icon`. */
|
|
668
668
|
shell: {
|
|
669
|
+
border: semanticToken("borderSubtle"),
|
|
669
670
|
background: {
|
|
670
671
|
neutral: paletteToken("neutral300"),
|
|
671
672
|
blue: paletteToken("blue100"),
|
|
@@ -2025,7 +2026,7 @@ import { clsx as clsx11 } from "clsx";
|
|
|
2025
2026
|
import { clsx as clsx10 } from "clsx";
|
|
2026
2027
|
var badgeVariantClass = {
|
|
2027
2028
|
default: "bg-refineui-alias-background-brand text-refineui-alias-foreground-inversed",
|
|
2028
|
-
neutral: "bg-refineui-alias-background-
|
|
2029
|
+
neutral: "bg-refineui-alias-background-brand-subtle text-refineui-alias-foreground-brand-strong",
|
|
2029
2030
|
outline: "border-refineui-thin border-refineui-alias-border-default border bg-transparent text-refineui-alias-foreground-primary box-border",
|
|
2030
2031
|
success: "bg-refineui-alias-background-success text-refineui-alias-foreground-inversed",
|
|
2031
2032
|
warning: "bg-refineui-alias-background-warning text-refineui-alias-foreground-inversed",
|
|
@@ -3856,13 +3857,13 @@ import { clsx as clsx30 } from "clsx";
|
|
|
3856
3857
|
// src/recipes/chip.recipe.ts
|
|
3857
3858
|
import { iconSizes as iconSizes5 } from "@refineui/tokens";
|
|
3858
3859
|
var chipVariantClass = {
|
|
3859
|
-
default: "border-none bg-refineui-alias-background-surface text-refineui-alias-foreground-brand",
|
|
3860
|
-
outline: "border-refineui-thin border-refineui-alias-border-default box-border bg-transparent text-refineui-alias-foreground-brand",
|
|
3860
|
+
default: "border-none bg-refineui-alias-background-surface-selected text-refineui-alias-foreground-brand",
|
|
3861
|
+
outline: "border border-refineui-thin border-refineui-alias-border-default box-border bg-transparent text-refineui-alias-foreground-brand",
|
|
3861
3862
|
filled: "border-none bg-refineui-alias-background-brand text-refineui-alias-foreground-inversed"
|
|
3862
3863
|
};
|
|
3863
3864
|
var chipDisabledVariantClass = {
|
|
3864
3865
|
default: "border-none bg-refineui-alias-background-surface-disabled text-refineui-alias-foreground-disabled",
|
|
3865
|
-
outline: "border-refineui-thin border-refineui-alias-border-disabled box-border bg-transparent text-refineui-alias-foreground-disabled",
|
|
3866
|
+
outline: "border border-refineui-thin border-refineui-alias-border-disabled box-border bg-transparent text-refineui-alias-foreground-disabled",
|
|
3866
3867
|
filled: "border-none bg-refineui-alias-background-surface-disabled text-refineui-alias-foreground-disabled"
|
|
3867
3868
|
};
|
|
3868
3869
|
var chipSizeClass = {
|
|
@@ -4998,15 +4999,18 @@ var avatarShellInitialsForegroundColor = {
|
|
|
4998
4999
|
yellow: resolveColorTokenValue3(componentColorTokens.avatar.icon.yellow)
|
|
4999
5000
|
};
|
|
5000
5001
|
var avatarNeutralForegroundColor = resolveColorTokenValue3(componentColorTokens.avatar.icon.neutral);
|
|
5002
|
+
var avatarShellBorderColor = resolveColorTokenValue3(componentColorTokens.avatar.shell.border);
|
|
5001
5003
|
function resolveAvatarShellStyle(color, layout) {
|
|
5002
5004
|
if (layout === "initials") {
|
|
5003
5005
|
return {
|
|
5004
5006
|
backgroundColor: avatarShellBackgroundColor[color],
|
|
5005
|
-
color: avatarShellInitialsForegroundColor[color]
|
|
5007
|
+
color: avatarShellInitialsForegroundColor[color],
|
|
5008
|
+
borderColor: avatarShellInitialsForegroundColor[color]
|
|
5006
5009
|
};
|
|
5007
5010
|
}
|
|
5008
5011
|
return {
|
|
5009
|
-
backgroundColor: avatarShellBackgroundColor[color]
|
|
5012
|
+
backgroundColor: avatarShellBackgroundColor[color],
|
|
5013
|
+
borderColor: avatarShellBorderColor
|
|
5010
5014
|
};
|
|
5011
5015
|
}
|
|
5012
5016
|
function resolveAvatarShellColorLayer(_color, size, layout) {
|
|
@@ -5251,6 +5255,7 @@ function Avatar({
|
|
|
5251
5255
|
className: clsx36(
|
|
5252
5256
|
AVATAR_INNER_MASK,
|
|
5253
5257
|
resolveAvatarShellColorLayer(effectiveColor, normalizedSize, resolvedLayout),
|
|
5258
|
+
"box-border border border-refineui-thin",
|
|
5254
5259
|
useNeutralShellTypo && avatarTypoNeutral[normalizedSize],
|
|
5255
5260
|
innerClassName
|
|
5256
5261
|
),
|
|
@@ -9518,8 +9523,12 @@ var menuStyles = {
|
|
|
9518
9523
|
row: "flex items-center gap-refineui-size-x-small",
|
|
9519
9524
|
iconWrap: "inline-flex shrink-0 items-center justify-center text-current [&>span]:leading-none",
|
|
9520
9525
|
textCol: "flex min-w-0 flex-1 flex-col gap-refineui-size-xxx-small px-refineui-size-xxx-small",
|
|
9521
|
-
|
|
9522
|
-
|
|
9526
|
+
/** Preserve labels and supporting copy by wrapping within the shared panel width. */
|
|
9527
|
+
title: clsx75(componentTextClass(componentTypographyTokens.menu.item), "break-words whitespace-normal"),
|
|
9528
|
+
description: clsx75(
|
|
9529
|
+
componentTextClass(componentTypographyTokens.menu.description),
|
|
9530
|
+
"break-words whitespace-normal"
|
|
9531
|
+
),
|
|
9523
9532
|
descriptionEnabled: "text-refineui-alias-foreground-tertiary",
|
|
9524
9533
|
descriptionDisabled: "text-refineui-alias-foreground-disabled",
|
|
9525
9534
|
rightWrap: "flex shrink-0 items-center gap-refineui-size-x-small",
|
|
@@ -9992,7 +10001,7 @@ function MenuSubContent({ className, children, style, ...props }) {
|
|
|
9992
10001
|
const [side, setSide] = useState17("right");
|
|
9993
10002
|
const gapPx = parseCssPx(spacings3.sizeXXXSmall, 2);
|
|
9994
10003
|
const z = (Number.parseInt(String(zIndex2.zIndexMessages), 10) || 1e4) + 100;
|
|
9995
|
-
const defaultW = parseCssPx(componentSizes2.menuPanelWidth,
|
|
10004
|
+
const defaultW = parseCssPx(componentSizes2.menuPanelWidth, 200);
|
|
9996
10005
|
const setPanelEl = useCallback13(
|
|
9997
10006
|
(el) => {
|
|
9998
10007
|
panelRef.current = el;
|
|
@@ -10100,7 +10109,8 @@ import {
|
|
|
10100
10109
|
useRef as useRef15,
|
|
10101
10110
|
useState as useState18
|
|
10102
10111
|
} from "react";
|
|
10103
|
-
import {
|
|
10112
|
+
import { createPortal as createPortal6 } from "react-dom";
|
|
10113
|
+
import { iconSizes as iconSizes16, semanticInteraction as semanticInteraction6, spacings as spacings4, zIndex as zIndex3 } from "@refineui/tokens";
|
|
10104
10114
|
import { motionMsToNumber as motionMsToNumber4 } from "@refineui/utilities/animation";
|
|
10105
10115
|
|
|
10106
10116
|
// src/components/NavigationMenu/style.ts
|
|
@@ -10108,34 +10118,34 @@ import { clsx as clsx77 } from "clsx";
|
|
|
10108
10118
|
var topLevelItem = clsx77(
|
|
10109
10119
|
componentTextClass(componentTypographyTokens.navigationMenu.trigger),
|
|
10110
10120
|
"box-border inline-flex h-refineui-button-min-height-md min-w-refineui-navigation-menu-item-min-width cursor-pointer items-center justify-center gap-refineui-size-x-small",
|
|
10111
|
-
"rounded-refineui-large border-none bg-transparent px-refineui-size-medium py-refineui-size-x-small",
|
|
10121
|
+
"rounded-refineui-x-large border-none bg-transparent px-refineui-size-medium py-refineui-size-x-small",
|
|
10112
10122
|
"text-refineui-alias-foreground-tertiary outline-none leading-none",
|
|
10113
|
-
"transition-[color,background-color] duration-[var(--refineui-motion-duration-fast)]"
|
|
10123
|
+
"transition-[color,background-color,box-shadow] duration-[var(--refineui-motion-duration-fast)] ease-[var(--refineui-motion-easing-ease-out)]"
|
|
10114
10124
|
);
|
|
10115
10125
|
var chevron = clsx77(
|
|
10116
10126
|
"shrink-0 transition-transform duration-[var(--refineui-motion-duration-fast)] ease-[var(--refineui-motion-easing-ease-out)]"
|
|
10117
10127
|
);
|
|
10118
10128
|
var navigationMenuStyles = {
|
|
10119
10129
|
root: "relative isolate z-refineui-messages flex w-full max-w-max items-center",
|
|
10120
|
-
list: "relative m-0 flex list-none flex-wrap items-center gap-refineui-size-
|
|
10130
|
+
list: "relative m-0 flex list-none flex-wrap items-center gap-refineui-size-xxx-small p-0",
|
|
10121
10131
|
item: "relative inline-flex items-center",
|
|
10122
10132
|
trigger: clsx77(topLevelItem, "m-0 appearance-none font-inherit"),
|
|
10123
|
-
triggerOpen: "text-refineui-alias-foreground-primary",
|
|
10133
|
+
triggerOpen: "bg-refineui-alias-background-primary-hover text-refineui-alias-foreground-primary",
|
|
10124
10134
|
triggerDisabled: "cursor-not-allowed text-refineui-alias-foreground-disabled",
|
|
10125
10135
|
chevron,
|
|
10126
10136
|
chevronOpen: "rotate-180",
|
|
10127
10137
|
content: clsx77(
|
|
10128
10138
|
/** Flush under trigger so pointer does not leave the item while moving into the panel. */
|
|
10129
10139
|
"absolute start-0 top-full z-refineui-messages pt-refineui-size-xx-small",
|
|
10130
|
-
"box-border min-w-refineui-menu-panel-width",
|
|
10140
|
+
"box-border min-w-refineui-navigation-menu-panel-width",
|
|
10131
10141
|
"outline-none"
|
|
10132
10142
|
),
|
|
10133
10143
|
contentPanel: clsx77(
|
|
10134
|
-
"box-border overflow-hidden rounded-refineui-large border-refineui-hairline border-refineui-alias-border-default",
|
|
10135
|
-
"
|
|
10144
|
+
"box-border flex flex-col gap-px overflow-hidden rounded-refineui-xx-large border-refineui-hairline border-refineui-alias-border-default",
|
|
10145
|
+
"p-refineui-size-xx-small shadow-refineui-2"
|
|
10136
10146
|
),
|
|
10137
10147
|
link: clsx77(topLevelItem, "no-underline"),
|
|
10138
|
-
linkActive: "text-refineui-alias-foreground-primary",
|
|
10148
|
+
linkActive: "bg-refineui-alias-background-primary-hover text-refineui-alias-foreground-primary",
|
|
10139
10149
|
linkDisabled: "cursor-not-allowed text-refineui-alias-foreground-disabled",
|
|
10140
10150
|
/** Dense row inside a content panel — same density as Menu item. */
|
|
10141
10151
|
linkInContent: clsx77(
|
|
@@ -10143,7 +10153,7 @@ var navigationMenuStyles = {
|
|
|
10143
10153
|
"box-border flex w-full cursor-pointer items-center gap-refineui-size-x-small",
|
|
10144
10154
|
"rounded-refineui-large border-none bg-transparent p-refineui-size-x-small text-start no-underline outline-none",
|
|
10145
10155
|
"text-refineui-alias-foreground-primary",
|
|
10146
|
-
"transition-[background-color,color] duration-[var(--refineui-motion-duration-fast)]"
|
|
10156
|
+
"transition-[background-color,color] duration-[var(--refineui-motion-duration-fast)] ease-[var(--refineui-motion-easing-ease-out)]"
|
|
10147
10157
|
),
|
|
10148
10158
|
/** Optional — prefer omitting; kept for API compatibility. */
|
|
10149
10159
|
indicator: "hidden"
|
|
@@ -10195,6 +10205,7 @@ function NavigationMenu({
|
|
|
10195
10205
|
const [value, setValue] = useControllableOpen(valueControlled, defaultValue, onValueChange);
|
|
10196
10206
|
const listRef = useRef15(null);
|
|
10197
10207
|
const triggerMapRef = useRef15(/* @__PURE__ */ new Map());
|
|
10208
|
+
const contentMapRef = useRef15(/* @__PURE__ */ new Map());
|
|
10198
10209
|
const openTimerRef = useRef15(null);
|
|
10199
10210
|
const closeTimerRef = useRef15(null);
|
|
10200
10211
|
const rootRef = useRef15(null);
|
|
@@ -10253,12 +10264,25 @@ function NavigationMenu({
|
|
|
10253
10264
|
triggerMapRef.current.delete(itemValue);
|
|
10254
10265
|
}
|
|
10255
10266
|
}, []);
|
|
10267
|
+
const registerContent = useCallback14((itemValue, el) => {
|
|
10268
|
+
if (el) {
|
|
10269
|
+
contentMapRef.current.set(itemValue, el);
|
|
10270
|
+
} else {
|
|
10271
|
+
contentMapRef.current.delete(itemValue);
|
|
10272
|
+
}
|
|
10273
|
+
}, []);
|
|
10274
|
+
const isContentTarget = useCallback14((itemValue, target) => {
|
|
10275
|
+
return target instanceof Node && contentMapRef.current.get(itemValue)?.contains(target) === true;
|
|
10276
|
+
}, []);
|
|
10277
|
+
const isMenuTarget = useCallback14((target) => {
|
|
10278
|
+
if (!(target instanceof Node)) return false;
|
|
10279
|
+
return rootRef.current?.contains(target) === true || Array.from(contentMapRef.current.values()).some((content) => content.contains(target));
|
|
10280
|
+
}, []);
|
|
10256
10281
|
useEffect13(() => () => clearTimers(), [clearTimers]);
|
|
10257
10282
|
useEffect13(() => {
|
|
10258
10283
|
if (!value) return;
|
|
10259
10284
|
const onPointerDown = (event) => {
|
|
10260
|
-
|
|
10261
|
-
if (rootRef.current?.contains(target)) return;
|
|
10285
|
+
if (isMenuTarget(event.target)) return;
|
|
10262
10286
|
setValueSafe("");
|
|
10263
10287
|
};
|
|
10264
10288
|
const onKeyDown = (event) => {
|
|
@@ -10274,7 +10298,7 @@ function NavigationMenu({
|
|
|
10274
10298
|
document.removeEventListener("pointerdown", onPointerDown);
|
|
10275
10299
|
document.removeEventListener("keydown", onKeyDown);
|
|
10276
10300
|
};
|
|
10277
|
-
}, [setValueSafe, value]);
|
|
10301
|
+
}, [isMenuTarget, setValueSafe, value]);
|
|
10278
10302
|
const ctx = useMemo14(
|
|
10279
10303
|
() => ({
|
|
10280
10304
|
value,
|
|
@@ -10285,9 +10309,23 @@ function NavigationMenu({
|
|
|
10285
10309
|
skipDelayDuration,
|
|
10286
10310
|
listRef,
|
|
10287
10311
|
registerTrigger,
|
|
10312
|
+
registerContent,
|
|
10313
|
+
isContentTarget,
|
|
10314
|
+
isMenuTarget,
|
|
10288
10315
|
isInsideContent: false
|
|
10289
10316
|
}),
|
|
10290
|
-
[
|
|
10317
|
+
[
|
|
10318
|
+
close,
|
|
10319
|
+
delayDuration,
|
|
10320
|
+
isContentTarget,
|
|
10321
|
+
isMenuTarget,
|
|
10322
|
+
openItem,
|
|
10323
|
+
registerContent,
|
|
10324
|
+
registerTrigger,
|
|
10325
|
+
setValueSafe,
|
|
10326
|
+
skipDelayDuration,
|
|
10327
|
+
value
|
|
10328
|
+
]
|
|
10291
10329
|
);
|
|
10292
10330
|
return /* @__PURE__ */ jsx59(NavigationMenuContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx59(
|
|
10293
10331
|
"nav",
|
|
@@ -10376,6 +10414,7 @@ function NavigationMenuItem({
|
|
|
10376
10414
|
onPointerLeave: (event) => {
|
|
10377
10415
|
onPointerLeave?.(event);
|
|
10378
10416
|
if (event.defaultPrevented) return;
|
|
10417
|
+
if (menu.isContentTarget(value, event.relatedTarget)) return;
|
|
10379
10418
|
menu.close();
|
|
10380
10419
|
},
|
|
10381
10420
|
...props,
|
|
@@ -10464,12 +10503,22 @@ function NavigationMenuContent({
|
|
|
10464
10503
|
children,
|
|
10465
10504
|
className,
|
|
10466
10505
|
onKeyDown,
|
|
10506
|
+
style,
|
|
10467
10507
|
...props
|
|
10468
10508
|
}) {
|
|
10469
10509
|
const menu = useNavigationMenu("NavigationMenuContent");
|
|
10470
10510
|
const item = useNavigationMenuItem("NavigationMenuContent");
|
|
10471
10511
|
const [shouldRender, setShouldRender] = useState18(item.open);
|
|
10472
10512
|
const [isClosing, setIsClosing] = useState18(false);
|
|
10513
|
+
const contentRef = useRef15(null);
|
|
10514
|
+
const [positionStyle, setPositionStyle] = useState18(null);
|
|
10515
|
+
const setContentRef = useCallback14(
|
|
10516
|
+
(el) => {
|
|
10517
|
+
contentRef.current = el;
|
|
10518
|
+
menu.registerContent(item.value, el);
|
|
10519
|
+
},
|
|
10520
|
+
[item.value, menu]
|
|
10521
|
+
);
|
|
10473
10522
|
useEffect13(() => {
|
|
10474
10523
|
if (item.open) {
|
|
10475
10524
|
setShouldRender(true);
|
|
@@ -10484,20 +10533,58 @@ function NavigationMenuContent({
|
|
|
10484
10533
|
}, motionMsToNumber4(semanticInteraction6.duration.fast));
|
|
10485
10534
|
return () => window.clearTimeout(timeout);
|
|
10486
10535
|
}, [item.open, shouldRender]);
|
|
10536
|
+
useIsomorphicLayoutEffect5(() => {
|
|
10537
|
+
if (!shouldRender || !item.open || typeof document === "undefined") return;
|
|
10538
|
+
const trigger = document.getElementById(item.triggerId);
|
|
10539
|
+
if (!trigger) return;
|
|
10540
|
+
const updatePosition = () => {
|
|
10541
|
+
const content2 = contentRef.current;
|
|
10542
|
+
if (!content2) return;
|
|
10543
|
+
const triggerRect = trigger.getBoundingClientRect();
|
|
10544
|
+
const contentWidth = content2.offsetWidth;
|
|
10545
|
+
const edge = Number.parseFloat(spacings4.sizeMedium) || 8;
|
|
10546
|
+
const left = Math.max(
|
|
10547
|
+
edge,
|
|
10548
|
+
Math.min(triggerRect.left, window.innerWidth - contentWidth - edge)
|
|
10549
|
+
);
|
|
10550
|
+
setPositionStyle({
|
|
10551
|
+
position: "fixed",
|
|
10552
|
+
top: triggerRect.bottom,
|
|
10553
|
+
left,
|
|
10554
|
+
zIndex: Number.parseInt(String(zIndex3.zIndexMessages), 10) || 1e4
|
|
10555
|
+
});
|
|
10556
|
+
};
|
|
10557
|
+
updatePosition();
|
|
10558
|
+
const frame = requestAnimationFrame(updatePosition);
|
|
10559
|
+
window.addEventListener("resize", updatePosition);
|
|
10560
|
+
const unsubscribe = subscribeScrollAndScrollableAncestors2(trigger, updatePosition);
|
|
10561
|
+
return () => {
|
|
10562
|
+
cancelAnimationFrame(frame);
|
|
10563
|
+
window.removeEventListener("resize", updatePosition);
|
|
10564
|
+
unsubscribe();
|
|
10565
|
+
};
|
|
10566
|
+
}, [item.open, item.triggerId, shouldRender]);
|
|
10487
10567
|
const contentCtx = useMemo14(
|
|
10488
10568
|
() => ({ ...menu, isInsideContent: true }),
|
|
10489
10569
|
[menu]
|
|
10490
10570
|
);
|
|
10491
10571
|
if (!shouldRender) return null;
|
|
10492
|
-
|
|
10572
|
+
const content = /* @__PURE__ */ jsx59(NavigationMenuContext.Provider, { value: contentCtx, children: /* @__PURE__ */ jsx59(
|
|
10493
10573
|
"div",
|
|
10494
10574
|
{
|
|
10575
|
+
ref: setContentRef,
|
|
10495
10576
|
id: item.contentId,
|
|
10496
10577
|
role: "region",
|
|
10497
10578
|
"aria-labelledby": item.triggerId,
|
|
10498
10579
|
"data-refineui": "navigation-menu-content",
|
|
10499
10580
|
"data-state": isClosing || !item.open ? "closed" : "open",
|
|
10500
10581
|
className: clsx78(navigationMenuStyles.content, className),
|
|
10582
|
+
style: { ...positionStyle, ...style },
|
|
10583
|
+
onPointerEnter: () => menu.openItem(item.value, { immediate: true }),
|
|
10584
|
+
onPointerLeave: (event) => {
|
|
10585
|
+
if (menu.isMenuTarget(event.relatedTarget)) return;
|
|
10586
|
+
menu.close();
|
|
10587
|
+
},
|
|
10501
10588
|
onKeyDown: (event) => {
|
|
10502
10589
|
onKeyDown?.(event);
|
|
10503
10590
|
if (event.defaultPrevented) return;
|
|
@@ -10510,6 +10597,7 @@ function NavigationMenuContent({
|
|
|
10510
10597
|
children: /* @__PURE__ */ jsx59("div", { "data-refineui": "navigation-menu-content-panel", className: navigationMenuStyles.contentPanel, children })
|
|
10511
10598
|
}
|
|
10512
10599
|
) });
|
|
10600
|
+
return typeof document === "undefined" ? content : createPortal6(content, document.body);
|
|
10513
10601
|
}
|
|
10514
10602
|
function NavigationMenuLink({
|
|
10515
10603
|
children,
|
|
@@ -11243,7 +11331,7 @@ import {
|
|
|
11243
11331
|
useRef as useRef17,
|
|
11244
11332
|
useState as useState21
|
|
11245
11333
|
} from "react";
|
|
11246
|
-
import { spacings as
|
|
11334
|
+
import { spacings as spacings5, strokeWidths as strokeWidths2 } from "@refineui/tokens";
|
|
11247
11335
|
import { resolveColorTokenValue as resolveColorTokenValue10 } from "@refineui/utilities/color";
|
|
11248
11336
|
import { Slot as Slot4, getMergeableTriggerChild as getMergeableTriggerChild3 } from "@refineui/utilities/react";
|
|
11249
11337
|
|
|
@@ -11290,11 +11378,11 @@ var BEAK_W = foundationSizes.foundationSize160;
|
|
|
11290
11378
|
var BEAK_H = foundationSizes.foundationSize80;
|
|
11291
11379
|
var BEAK_OFFSET = foundationSizes.foundationSize80;
|
|
11292
11380
|
var BEAK_BORDER_OVERLAP = strokeWidths2.strokeWidthThin;
|
|
11293
|
-
var POPOVER_GAP =
|
|
11381
|
+
var POPOVER_GAP = spacings5.sizeMedium;
|
|
11294
11382
|
function beakWrapperStyle(placement, align) {
|
|
11295
11383
|
const insetStart = componentSizes2.popoverBeakInsetFromStartEdge;
|
|
11296
11384
|
const insetEnd = componentSizes2.popoverBeakInsetFromEndEdge;
|
|
11297
|
-
const edge =
|
|
11385
|
+
const edge = spacings5.sizeMedium;
|
|
11298
11386
|
const overlapOffset = `calc(-1 * ${BEAK_OFFSET} + ${BEAK_BORDER_OVERLAP})`;
|
|
11299
11387
|
switch (placement) {
|
|
11300
11388
|
case "bottom":
|
|
@@ -11523,7 +11611,7 @@ function PopoverContent({
|
|
|
11523
11611
|
style: {
|
|
11524
11612
|
...styleProp && typeof styleProp === "object" ? styleProp : {},
|
|
11525
11613
|
minWidth: componentSizes2.popoverPanelWidth,
|
|
11526
|
-
padding:
|
|
11614
|
+
padding: spacings5.sizeLarge,
|
|
11527
11615
|
backgroundColor: bg,
|
|
11528
11616
|
color: resolveColorTokenValue10(palette.foreground),
|
|
11529
11617
|
borderColor: borderCol
|
|
@@ -13494,8 +13582,8 @@ import {
|
|
|
13494
13582
|
useState as useState27,
|
|
13495
13583
|
useSyncExternalStore
|
|
13496
13584
|
} from "react";
|
|
13497
|
-
import { createPortal as
|
|
13498
|
-
import { iconSizes as iconSizes21, spacings as
|
|
13585
|
+
import { createPortal as createPortal7 } from "react-dom";
|
|
13586
|
+
import { iconSizes as iconSizes21, spacings as spacings6 } from "@refineui/tokens";
|
|
13499
13587
|
import { motionMsToNumber as motionMsToNumber6 } from "@refineui/utilities/animation";
|
|
13500
13588
|
import { resolveColorTokenValue as resolveColorTokenValue11 } from "@refineui/utilities/color";
|
|
13501
13589
|
|
|
@@ -13554,10 +13642,10 @@ function gapPxFromSpacingToken(token) {
|
|
|
13554
13642
|
var TOAST_NARROW_STACK_MQ = "(max-width: 480px), (hover: none)";
|
|
13555
13643
|
function readToastStackGapPx() {
|
|
13556
13644
|
if (typeof globalThis.matchMedia === "undefined") {
|
|
13557
|
-
return gapPxFromSpacingToken(String(
|
|
13645
|
+
return gapPxFromSpacingToken(String(spacings6.sizeLarge));
|
|
13558
13646
|
}
|
|
13559
13647
|
const mq = globalThis.matchMedia(TOAST_NARROW_STACK_MQ);
|
|
13560
|
-
return gapPxFromSpacingToken(mq.matches ? String(
|
|
13648
|
+
return gapPxFromSpacingToken(mq.matches ? String(spacings6.sizeMedium) : String(spacings6.sizeLarge));
|
|
13561
13649
|
}
|
|
13562
13650
|
function subscribeToastStackGap(onChange) {
|
|
13563
13651
|
if (typeof globalThis.matchMedia === "undefined") return () => {
|
|
@@ -13570,7 +13658,7 @@ function useToastStackGapPx() {
|
|
|
13570
13658
|
return useSyncExternalStore(
|
|
13571
13659
|
subscribeToastStackGap,
|
|
13572
13660
|
readToastStackGapPx,
|
|
13573
|
-
() => gapPxFromSpacingToken(String(
|
|
13661
|
+
() => gapPxFromSpacingToken(String(spacings6.sizeLarge))
|
|
13574
13662
|
);
|
|
13575
13663
|
}
|
|
13576
13664
|
function readToastNaturalHeight(li) {
|
|
@@ -13986,7 +14074,7 @@ function Toaster({
|
|
|
13986
14074
|
if (typeof document === "undefined" || !isPortalOwner) {
|
|
13987
14075
|
return null;
|
|
13988
14076
|
}
|
|
13989
|
-
return
|
|
14077
|
+
return createPortal7(
|
|
13990
14078
|
/* @__PURE__ */ jsx72(
|
|
13991
14079
|
"ol",
|
|
13992
14080
|
{
|
|
@@ -14513,15 +14601,68 @@ import { useId as useId17, useRef as useRef23, useState as useState31 } from "re
|
|
|
14513
14601
|
import { resolveColorTokenValue as resolveColorTokenValue12 } from "@refineui/utilities/color";
|
|
14514
14602
|
import { Slot as Slot5, getMergeableTriggerChild as getMergeableTriggerChild4 } from "@refineui/utilities/react";
|
|
14515
14603
|
|
|
14604
|
+
// src/components/shared/FrostedBeak.tsx
|
|
14605
|
+
import { strokeWidths as strokeWidths3 } from "@refineui/tokens";
|
|
14606
|
+
import { jsx as jsx77, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
14607
|
+
var triangleClipPath = "polygon(50% 0, 0 100%, 100% 100%)";
|
|
14608
|
+
function FrostedBeak({ width, height, rotateDeg, borderColor }) {
|
|
14609
|
+
const surfaceStyle = {
|
|
14610
|
+
position: "absolute",
|
|
14611
|
+
inset: 0,
|
|
14612
|
+
clipPath: triangleClipPath
|
|
14613
|
+
};
|
|
14614
|
+
return /* @__PURE__ */ jsxs31(
|
|
14615
|
+
"div",
|
|
14616
|
+
{
|
|
14617
|
+
style: {
|
|
14618
|
+
position: "relative",
|
|
14619
|
+
width,
|
|
14620
|
+
height,
|
|
14621
|
+
transform: `rotate(${rotateDeg}deg)`,
|
|
14622
|
+
transformOrigin: "center center"
|
|
14623
|
+
},
|
|
14624
|
+
children: [
|
|
14625
|
+
/* @__PURE__ */ jsx77(
|
|
14626
|
+
"span",
|
|
14627
|
+
{
|
|
14628
|
+
"data-refineui": "floating-beak-surface",
|
|
14629
|
+
style: surfaceStyle
|
|
14630
|
+
}
|
|
14631
|
+
),
|
|
14632
|
+
/* @__PURE__ */ jsx77(
|
|
14633
|
+
"svg",
|
|
14634
|
+
{
|
|
14635
|
+
width,
|
|
14636
|
+
height,
|
|
14637
|
+
viewBox: "0 0 16 8",
|
|
14638
|
+
fill: "none",
|
|
14639
|
+
"aria-hidden": true,
|
|
14640
|
+
style: { position: "absolute", inset: 0, overflow: "visible" },
|
|
14641
|
+
children: /* @__PURE__ */ jsx77(
|
|
14642
|
+
"path",
|
|
14643
|
+
{
|
|
14644
|
+
d: "M0 8L8 0L16 8",
|
|
14645
|
+
stroke: borderColor,
|
|
14646
|
+
strokeWidth: strokeWidths3.strokeWidthThin,
|
|
14647
|
+
strokeLinejoin: "round"
|
|
14648
|
+
}
|
|
14649
|
+
)
|
|
14650
|
+
}
|
|
14651
|
+
)
|
|
14652
|
+
]
|
|
14653
|
+
}
|
|
14654
|
+
);
|
|
14655
|
+
}
|
|
14656
|
+
|
|
14516
14657
|
// src/components/Tooltip/style.ts
|
|
14517
|
-
import { spacings as
|
|
14658
|
+
import { spacings as spacings7, strokeWidths as strokeWidths4 } from "@refineui/tokens";
|
|
14518
14659
|
import { clsx as clsx104 } from "clsx";
|
|
14519
14660
|
var TOOLTIP_BEAK_W = foundationSizes.foundationSize160;
|
|
14520
14661
|
var TOOLTIP_BEAK_H = foundationSizes.foundationSize80;
|
|
14521
14662
|
var TOOLTIP_BEAK_OFFSET = foundationSizes.foundationSize80;
|
|
14522
|
-
var BEAK_BORDER_OVERLAP2 =
|
|
14523
|
-
var gap =
|
|
14524
|
-
var edgeInset =
|
|
14663
|
+
var BEAK_BORDER_OVERLAP2 = strokeWidths4.strokeWidthThin;
|
|
14664
|
+
var gap = spacings7.sizeXSmall;
|
|
14665
|
+
var edgeInset = spacings7.sizeMedium;
|
|
14525
14666
|
var tooltipStyles = {
|
|
14526
14667
|
root: "relative inline-block",
|
|
14527
14668
|
fallbackTrigger: "inline-flex outline-none",
|
|
@@ -14615,7 +14756,7 @@ function tooltipBeakRotateDeg(position) {
|
|
|
14615
14756
|
}
|
|
14616
14757
|
|
|
14617
14758
|
// src/components/Tooltip/Tooltip.tsx
|
|
14618
|
-
import { jsx as
|
|
14759
|
+
import { jsx as jsx78, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
14619
14760
|
function Tooltip({
|
|
14620
14761
|
trigger,
|
|
14621
14762
|
content,
|
|
@@ -14661,7 +14802,7 @@ function Tooltip({
|
|
|
14661
14802
|
const mergeEl = getMergeableTriggerChild4(trigger);
|
|
14662
14803
|
let triggerNode;
|
|
14663
14804
|
if (mergeEl != null) {
|
|
14664
|
-
triggerNode = /* @__PURE__ */
|
|
14805
|
+
triggerNode = /* @__PURE__ */ jsx78(
|
|
14665
14806
|
Slot5,
|
|
14666
14807
|
{
|
|
14667
14808
|
"aria-describedby": describedBy,
|
|
@@ -14678,7 +14819,7 @@ function Tooltip({
|
|
|
14678
14819
|
}
|
|
14679
14820
|
);
|
|
14680
14821
|
} else {
|
|
14681
|
-
triggerNode = /* @__PURE__ */
|
|
14822
|
+
triggerNode = /* @__PURE__ */ jsx78(
|
|
14682
14823
|
"span",
|
|
14683
14824
|
{
|
|
14684
14825
|
tabIndex: 0,
|
|
@@ -14695,44 +14836,27 @@ function Tooltip({
|
|
|
14695
14836
|
}
|
|
14696
14837
|
);
|
|
14697
14838
|
}
|
|
14698
|
-
return /* @__PURE__ */
|
|
14839
|
+
return /* @__PURE__ */ jsxs32("div", { "data-refineui": "tooltip", className: clsx105(tooltipStyles.root, className), ...props, children: [
|
|
14699
14840
|
triggerNode,
|
|
14700
|
-
open && /* @__PURE__ */
|
|
14701
|
-
/* @__PURE__ */
|
|
14841
|
+
open && /* @__PURE__ */ jsx78("div", { className: tooltipStyles.floating, style: floatingStyle, children: /* @__PURE__ */ jsxs32("div", { className: tooltipStyles.panelWrap, children: [
|
|
14842
|
+
/* @__PURE__ */ jsx78(
|
|
14702
14843
|
"div",
|
|
14703
14844
|
{
|
|
14704
14845
|
className: tooltipStyles.beakWrap,
|
|
14705
14846
|
style: { ...beakWrapStyle, width: TOOLTIP_BEAK_W, height: TOOLTIP_BEAK_H },
|
|
14706
14847
|
"aria-hidden": true,
|
|
14707
|
-
children: /* @__PURE__ */
|
|
14708
|
-
|
|
14848
|
+
children: /* @__PURE__ */ jsx78(
|
|
14849
|
+
FrostedBeak,
|
|
14709
14850
|
{
|
|
14710
|
-
|
|
14711
|
-
|
|
14712
|
-
|
|
14713
|
-
|
|
14714
|
-
transformOrigin: "center center"
|
|
14715
|
-
},
|
|
14716
|
-
children: /* @__PURE__ */ jsxs31(
|
|
14717
|
-
"svg",
|
|
14718
|
-
{
|
|
14719
|
-
width: TOOLTIP_BEAK_W,
|
|
14720
|
-
height: TOOLTIP_BEAK_H,
|
|
14721
|
-
viewBox: "0 0 16 8",
|
|
14722
|
-
fill: "none",
|
|
14723
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
14724
|
-
style: { display: "block" },
|
|
14725
|
-
children: [
|
|
14726
|
-
/* @__PURE__ */ jsx77("polygon", { points: "8,0 0,8 16,8", fill: borderCol }),
|
|
14727
|
-
/* @__PURE__ */ jsx77("polygon", { points: "8,2 2,8 14,8", fill: bg })
|
|
14728
|
-
]
|
|
14729
|
-
}
|
|
14730
|
-
)
|
|
14851
|
+
width: TOOLTIP_BEAK_W,
|
|
14852
|
+
height: TOOLTIP_BEAK_H,
|
|
14853
|
+
rotateDeg: beakRot,
|
|
14854
|
+
borderColor: borderCol
|
|
14731
14855
|
}
|
|
14732
14856
|
)
|
|
14733
14857
|
}
|
|
14734
14858
|
),
|
|
14735
|
-
/* @__PURE__ */
|
|
14859
|
+
/* @__PURE__ */ jsx78(
|
|
14736
14860
|
"div",
|
|
14737
14861
|
{
|
|
14738
14862
|
id: tooltipId,
|
|
@@ -14810,12 +14934,12 @@ var chartStyles = {
|
|
|
14810
14934
|
};
|
|
14811
14935
|
|
|
14812
14936
|
// src/components/Chart/utils.ts
|
|
14813
|
-
import { borderRadii, foundationSizes as foundationSizes3, spacings as
|
|
14937
|
+
import { borderRadii, foundationSizes as foundationSizes3, spacings as spacings8 } from "@refineui/tokens";
|
|
14814
14938
|
var CHART_VIEWBOX_WIDTH = 800;
|
|
14815
14939
|
var CHART_VIEWBOX_HEIGHT = 320;
|
|
14816
|
-
var CHART_PLOT_PADDING_TOP = parseFloat(
|
|
14817
|
-
var CHART_PLOT_PADDING_BOTTOM = parseFloat(
|
|
14818
|
-
var CHART_PLOT_PADDING_X = parseFloat(
|
|
14940
|
+
var CHART_PLOT_PADDING_TOP = parseFloat(spacings8.sizeMedium);
|
|
14941
|
+
var CHART_PLOT_PADDING_BOTTOM = parseFloat(spacings8.sizeXXSmall);
|
|
14942
|
+
var CHART_PLOT_PADDING_X = parseFloat(spacings8.sizeMedium);
|
|
14819
14943
|
var CHART_BAR_RADIUS = parseFloat(borderRadii.roundedXLarge);
|
|
14820
14944
|
var CHART_BAR_BAND_FILL = 0.5;
|
|
14821
14945
|
var CHART_POINT_RADIUS = parseFloat(foundationSizes3.foundationSize40);
|
|
@@ -14991,7 +15115,7 @@ function formatAxisTick(value) {
|
|
|
14991
15115
|
}
|
|
14992
15116
|
|
|
14993
15117
|
// src/components/Chart/Chart.tsx
|
|
14994
|
-
import { Fragment as Fragment4, jsx as
|
|
15118
|
+
import { Fragment as Fragment4, jsx as jsx79, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
14995
15119
|
var ChartContext = createContext27(null);
|
|
14996
15120
|
function useChartContext(component) {
|
|
14997
15121
|
const value = useContext31(ChartContext);
|
|
@@ -15047,7 +15171,7 @@ function Chart({ className, children, ...props }) {
|
|
|
15047
15171
|
}),
|
|
15048
15172
|
[hoverIndex, selectedIndex, pointer, labels, series]
|
|
15049
15173
|
);
|
|
15050
|
-
return /* @__PURE__ */
|
|
15174
|
+
return /* @__PURE__ */ jsx79(ChartContext.Provider, { value: context, children: /* @__PURE__ */ jsx79(
|
|
15051
15175
|
"div",
|
|
15052
15176
|
{
|
|
15053
15177
|
"data-refineui": "chart",
|
|
@@ -15058,7 +15182,7 @@ function Chart({ className, children, ...props }) {
|
|
|
15058
15182
|
) });
|
|
15059
15183
|
}
|
|
15060
15184
|
function ChartBody({ className, ...props }) {
|
|
15061
|
-
return /* @__PURE__ */
|
|
15185
|
+
return /* @__PURE__ */ jsx79(
|
|
15062
15186
|
"div",
|
|
15063
15187
|
{
|
|
15064
15188
|
"data-refineui": "chart-body",
|
|
@@ -15068,7 +15192,7 @@ function ChartBody({ className, ...props }) {
|
|
|
15068
15192
|
);
|
|
15069
15193
|
}
|
|
15070
15194
|
function ChartContent({ className, ...props }) {
|
|
15071
|
-
return /* @__PURE__ */
|
|
15195
|
+
return /* @__PURE__ */ jsx79(
|
|
15072
15196
|
"div",
|
|
15073
15197
|
{
|
|
15074
15198
|
"data-refineui": "chart-content",
|
|
@@ -15093,7 +15217,7 @@ function ChartHitArea() {
|
|
|
15093
15217
|
setHoverIndex(hoverIndexFromPlotX(next.x, count, series.align));
|
|
15094
15218
|
return next;
|
|
15095
15219
|
};
|
|
15096
|
-
return /* @__PURE__ */
|
|
15220
|
+
return /* @__PURE__ */ jsx79(
|
|
15097
15221
|
"rect",
|
|
15098
15222
|
{
|
|
15099
15223
|
"data-refineui": "chart-hit-area",
|
|
@@ -15131,7 +15255,7 @@ function ChartPlot({
|
|
|
15131
15255
|
if (isChartTooltipElement(child)) tooltipNodes.push(child);
|
|
15132
15256
|
else svgChildren.push(child);
|
|
15133
15257
|
});
|
|
15134
|
-
return /* @__PURE__ */
|
|
15258
|
+
return /* @__PURE__ */ jsxs33(
|
|
15135
15259
|
"div",
|
|
15136
15260
|
{
|
|
15137
15261
|
"data-refineui": "chart-plot-frame",
|
|
@@ -15140,7 +15264,7 @@ function ChartPlot({
|
|
|
15140
15264
|
className: clsx107(chartStyles.plotFrame, className),
|
|
15141
15265
|
...props,
|
|
15142
15266
|
children: [
|
|
15143
|
-
/* @__PURE__ */
|
|
15267
|
+
/* @__PURE__ */ jsxs33(
|
|
15144
15268
|
"svg",
|
|
15145
15269
|
{
|
|
15146
15270
|
"data-refineui": "chart-plot",
|
|
@@ -15151,7 +15275,7 @@ function ChartPlot({
|
|
|
15151
15275
|
className: chartStyles.plot,
|
|
15152
15276
|
children: [
|
|
15153
15277
|
svgChildren,
|
|
15154
|
-
/* @__PURE__ */
|
|
15278
|
+
/* @__PURE__ */ jsx79(ChartHitArea, {})
|
|
15155
15279
|
]
|
|
15156
15280
|
}
|
|
15157
15281
|
),
|
|
@@ -15169,7 +15293,7 @@ function ChartTooltip({ className, children, style, ...props }) {
|
|
|
15169
15293
|
const flipY = pointer.y < CHART_PLOT_PADDING_TOP + plotHeight() * CHART_TOOLTIP_FLIP_Y;
|
|
15170
15294
|
const offsetX = flipX ? "calc(-100% - var(--refineui-spacing-size-small))" : "var(--refineui-spacing-size-small)";
|
|
15171
15295
|
const offsetY = flipY ? "var(--refineui-spacing-size-small)" : "calc(-100% - var(--refineui-spacing-size-x-small))";
|
|
15172
|
-
return /* @__PURE__ */
|
|
15296
|
+
return /* @__PURE__ */ jsx79(
|
|
15173
15297
|
"div",
|
|
15174
15298
|
{
|
|
15175
15299
|
"data-refineui": "chart-tooltip",
|
|
@@ -15182,9 +15306,9 @@ function ChartTooltip({ className, children, style, ...props }) {
|
|
|
15182
15306
|
...style
|
|
15183
15307
|
},
|
|
15184
15308
|
...props,
|
|
15185
|
-
children: children ?? /* @__PURE__ */
|
|
15186
|
-
label ? /* @__PURE__ */
|
|
15187
|
-
/* @__PURE__ */
|
|
15309
|
+
children: children ?? /* @__PURE__ */ jsxs33(Fragment4, { children: [
|
|
15310
|
+
label ? /* @__PURE__ */ jsx79("span", { className: chartStyles.tooltipLabel, children: label }) : null,
|
|
15311
|
+
/* @__PURE__ */ jsx79("span", { className: chartStyles.tooltipValue, children: formatAxisTick(value) })
|
|
15188
15312
|
] })
|
|
15189
15313
|
}
|
|
15190
15314
|
);
|
|
@@ -15199,14 +15323,14 @@ function ChartYAxisLabels({
|
|
|
15199
15323
|
}) {
|
|
15200
15324
|
const scaleMax = resolveScale(values, max);
|
|
15201
15325
|
const ticks = yAxisTicks(scaleMax, lines).slice().reverse();
|
|
15202
|
-
return /* @__PURE__ */
|
|
15326
|
+
return /* @__PURE__ */ jsx79(
|
|
15203
15327
|
"div",
|
|
15204
15328
|
{
|
|
15205
15329
|
"data-refineui": "chart-y-axis",
|
|
15206
15330
|
className: clsx107(chartStyles.yAxis, className),
|
|
15207
15331
|
"aria-hidden": true,
|
|
15208
15332
|
...props,
|
|
15209
|
-
children: ticks.map((tick) => /* @__PURE__ */
|
|
15333
|
+
children: ticks.map((tick) => /* @__PURE__ */ jsx79(
|
|
15210
15334
|
"span",
|
|
15211
15335
|
{
|
|
15212
15336
|
className: chartStyles.yAxisTick,
|
|
@@ -15229,12 +15353,12 @@ function ChartGrid({
|
|
|
15229
15353
|
const ticks = yAxisTicks(scaleMax, lines);
|
|
15230
15354
|
const gridColor = gridStroke();
|
|
15231
15355
|
const baselineColor = gridBaselineStroke();
|
|
15232
|
-
return /* @__PURE__ */
|
|
15356
|
+
return /* @__PURE__ */ jsx79("g", { "data-refineui": "chart-grid", className, ...props, children: ticks.map((tick, index) => {
|
|
15233
15357
|
const y = gridLineY(scaleMax, tick);
|
|
15234
15358
|
const isBaseline = index === 0;
|
|
15235
15359
|
const isTop = index === ticks.length - 1;
|
|
15236
15360
|
if (isTop) return null;
|
|
15237
|
-
return /* @__PURE__ */
|
|
15361
|
+
return /* @__PURE__ */ jsx79(
|
|
15238
15362
|
"line",
|
|
15239
15363
|
{
|
|
15240
15364
|
x1: CHART_PLOT_PADDING_X,
|
|
@@ -15269,10 +15393,10 @@ function ChartBars({
|
|
|
15269
15393
|
useLayoutEffect13(() => {
|
|
15270
15394
|
setSeries({ values, seriesColor, max, align: "bar" });
|
|
15271
15395
|
}, [values, seriesColor, max, setSeries]);
|
|
15272
|
-
return /* @__PURE__ */
|
|
15396
|
+
return /* @__PURE__ */ jsxs33("g", { "data-refineui": "chart-bars", "data-series-color": seriesColor, className, ...props, children: [
|
|
15273
15397
|
showTrack ? values.map((_, index) => {
|
|
15274
15398
|
const x = barX(index, values.length);
|
|
15275
|
-
return /* @__PURE__ */
|
|
15399
|
+
return /* @__PURE__ */ jsx79(
|
|
15276
15400
|
"path",
|
|
15277
15401
|
{
|
|
15278
15402
|
"data-refineui": "chart-bar-track",
|
|
@@ -15294,7 +15418,7 @@ function ChartBars({
|
|
|
15294
15418
|
const height = baselineY - y;
|
|
15295
15419
|
if (height <= 0) return null;
|
|
15296
15420
|
const state = itemState(index, hoverIndex, selectedIndex);
|
|
15297
|
-
return /* @__PURE__ */
|
|
15421
|
+
return /* @__PURE__ */ jsx79(
|
|
15298
15422
|
"path",
|
|
15299
15423
|
{
|
|
15300
15424
|
"data-refineui": "chart-bar",
|
|
@@ -15327,10 +15451,10 @@ function ChartLine({
|
|
|
15327
15451
|
useLayoutEffect13(() => {
|
|
15328
15452
|
setSeries({ values, seriesColor, max, align: "line" });
|
|
15329
15453
|
}, [values, seriesColor, max, setSeries]);
|
|
15330
|
-
return /* @__PURE__ */
|
|
15331
|
-
showArea && coords.length > 1 ? /* @__PURE__ */
|
|
15332
|
-
/* @__PURE__ */
|
|
15333
|
-
/* @__PURE__ */
|
|
15454
|
+
return /* @__PURE__ */ jsxs33("g", { "data-refineui": "chart-line", "data-series-color": seriesColor, className, ...props, children: [
|
|
15455
|
+
showArea && coords.length > 1 ? /* @__PURE__ */ jsxs33(Fragment4, { children: [
|
|
15456
|
+
/* @__PURE__ */ jsx79("defs", { children: /* @__PURE__ */ jsxs33("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
15457
|
+
/* @__PURE__ */ jsx79(
|
|
15334
15458
|
"stop",
|
|
15335
15459
|
{
|
|
15336
15460
|
offset: "0%",
|
|
@@ -15338,9 +15462,9 @@ function ChartLine({
|
|
|
15338
15462
|
stopOpacity: opacities.opacityDisabled
|
|
15339
15463
|
}
|
|
15340
15464
|
),
|
|
15341
|
-
/* @__PURE__ */
|
|
15465
|
+
/* @__PURE__ */ jsx79("stop", { offset: "100%", stopColor: stroke, stopOpacity: "0" })
|
|
15342
15466
|
] }) }),
|
|
15343
|
-
/* @__PURE__ */
|
|
15467
|
+
/* @__PURE__ */ jsx79(
|
|
15344
15468
|
"path",
|
|
15345
15469
|
{
|
|
15346
15470
|
"data-refineui": "chart-line-area",
|
|
@@ -15349,7 +15473,7 @@ function ChartLine({
|
|
|
15349
15473
|
}
|
|
15350
15474
|
)
|
|
15351
15475
|
] }) : null,
|
|
15352
|
-
/* @__PURE__ */
|
|
15476
|
+
/* @__PURE__ */ jsx79(
|
|
15353
15477
|
"path",
|
|
15354
15478
|
{
|
|
15355
15479
|
"data-refineui": "chart-line-stroke",
|
|
@@ -15367,7 +15491,7 @@ function ChartLine({
|
|
|
15367
15491
|
const state = itemState(index, hoverIndex, selectedIndex);
|
|
15368
15492
|
const visible = showPoints || state !== "default";
|
|
15369
15493
|
if (!visible) return null;
|
|
15370
|
-
return /* @__PURE__ */
|
|
15494
|
+
return /* @__PURE__ */ jsx79(
|
|
15371
15495
|
"circle",
|
|
15372
15496
|
{
|
|
15373
15497
|
"data-refineui": "chart-point",
|
|
@@ -15396,7 +15520,7 @@ function ChartAxisLabels({
|
|
|
15396
15520
|
useLayoutEffect13(() => {
|
|
15397
15521
|
setLabels(labels);
|
|
15398
15522
|
}, [labels, setLabels]);
|
|
15399
|
-
return /* @__PURE__ */
|
|
15523
|
+
return /* @__PURE__ */ jsx79(
|
|
15400
15524
|
"div",
|
|
15401
15525
|
{
|
|
15402
15526
|
"data-refineui": "chart-axis-labels",
|
|
@@ -15405,7 +15529,7 @@ function ChartAxisLabels({
|
|
|
15405
15529
|
...props,
|
|
15406
15530
|
children: labels.map((label, index) => {
|
|
15407
15531
|
const state = itemState(index, hoverIndex, selectedIndex);
|
|
15408
|
-
return /* @__PURE__ */
|
|
15532
|
+
return /* @__PURE__ */ jsx79(
|
|
15409
15533
|
"span",
|
|
15410
15534
|
{
|
|
15411
15535
|
"data-state": state,
|
|
@@ -15423,7 +15547,7 @@ function ChartAxisLabels({
|
|
|
15423
15547
|
);
|
|
15424
15548
|
}
|
|
15425
15549
|
function ChartLegend({ className, ...props }) {
|
|
15426
|
-
return /* @__PURE__ */
|
|
15550
|
+
return /* @__PURE__ */ jsx79(
|
|
15427
15551
|
"ul",
|
|
15428
15552
|
{
|
|
15429
15553
|
"data-refineui": "chart-legend",
|
|
@@ -15439,7 +15563,7 @@ function ChartLegendItem({
|
|
|
15439
15563
|
style,
|
|
15440
15564
|
...props
|
|
15441
15565
|
}) {
|
|
15442
|
-
return /* @__PURE__ */
|
|
15566
|
+
return /* @__PURE__ */ jsxs33(
|
|
15443
15567
|
"li",
|
|
15444
15568
|
{
|
|
15445
15569
|
"data-refineui": "chart-legend-item",
|
|
@@ -15447,7 +15571,7 @@ function ChartLegendItem({
|
|
|
15447
15571
|
className: clsx107(chartStyles.legendItem, className),
|
|
15448
15572
|
...props,
|
|
15449
15573
|
children: [
|
|
15450
|
-
/* @__PURE__ */
|
|
15574
|
+
/* @__PURE__ */ jsx79(
|
|
15451
15575
|
"span",
|
|
15452
15576
|
{
|
|
15453
15577
|
"aria-hidden": true,
|
|
@@ -15507,7 +15631,7 @@ var collapsibleStyles = {
|
|
|
15507
15631
|
};
|
|
15508
15632
|
|
|
15509
15633
|
// src/components/Collapsible/Collapsible.tsx
|
|
15510
|
-
import { jsx as
|
|
15634
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
15511
15635
|
var Collapsible = forwardRef17(function Collapsible2({ open: openProp, defaultOpen = false, onOpenChange, asChild = false, className, children, ...props }, ref) {
|
|
15512
15636
|
const [uncontrolled, setUncontrolled] = useState34(defaultOpen);
|
|
15513
15637
|
const open = openProp ?? uncontrolled;
|
|
@@ -15535,7 +15659,7 @@ var Collapsible = forwardRef17(function Collapsible2({ open: openProp, defaultOp
|
|
|
15535
15659
|
"data-refineui": "collapsible",
|
|
15536
15660
|
className
|
|
15537
15661
|
};
|
|
15538
|
-
return /* @__PURE__ */
|
|
15662
|
+
return /* @__PURE__ */ jsx80(CollapsibleContext.Provider, { value: contextValue, children: asChild ? /* @__PURE__ */ jsx80(Slot7, { ...shared, children }) : /* @__PURE__ */ jsx80("div", { ...shared, children }) });
|
|
15539
15663
|
});
|
|
15540
15664
|
var CollapsibleTrigger = forwardRef17(
|
|
15541
15665
|
function CollapsibleTrigger2({
|
|
@@ -15564,8 +15688,8 @@ var CollapsibleTrigger = forwardRef17(
|
|
|
15564
15688
|
if (!event.defaultPrevented) toggle();
|
|
15565
15689
|
}
|
|
15566
15690
|
};
|
|
15567
|
-
if (asChild) return /* @__PURE__ */
|
|
15568
|
-
return /* @__PURE__ */
|
|
15691
|
+
if (asChild) return /* @__PURE__ */ jsx80(Slot7, { ...shared, children });
|
|
15692
|
+
return /* @__PURE__ */ jsx80(
|
|
15569
15693
|
Button,
|
|
15570
15694
|
{
|
|
15571
15695
|
...shared,
|
|
@@ -15594,7 +15718,7 @@ var CollapsibleContent = forwardRef17(
|
|
|
15594
15718
|
pointerEvents: open ? void 0 : "none",
|
|
15595
15719
|
...style
|
|
15596
15720
|
};
|
|
15597
|
-
return /* @__PURE__ */
|
|
15721
|
+
return /* @__PURE__ */ jsx80(
|
|
15598
15722
|
"div",
|
|
15599
15723
|
{
|
|
15600
15724
|
...props,
|
|
@@ -15606,7 +15730,7 @@ var CollapsibleContent = forwardRef17(
|
|
|
15606
15730
|
"data-state": open ? "open" : "closed",
|
|
15607
15731
|
"data-refineui": "collapsible-content",
|
|
15608
15732
|
style: gridStyle,
|
|
15609
|
-
children: /* @__PURE__ */
|
|
15733
|
+
children: /* @__PURE__ */ jsx80("div", { className: collapsibleStyles.panelOuter, children: /* @__PURE__ */ jsx80("div", { className: clsx108(className), style: innerMotionStyle, children }) })
|
|
15610
15734
|
}
|
|
15611
15735
|
);
|
|
15612
15736
|
}
|
|
@@ -15624,12 +15748,12 @@ import {
|
|
|
15624
15748
|
useRef as useRef24,
|
|
15625
15749
|
useState as useState35
|
|
15626
15750
|
} from "react";
|
|
15627
|
-
import { createPortal as
|
|
15751
|
+
import { createPortal as createPortal8 } from "react-dom";
|
|
15628
15752
|
import { clsx as clsx109 } from "clsx";
|
|
15629
15753
|
import { componentSizes as componentSizes3, iconSizes as iconSizes23, semanticInteraction as semanticInteraction10 } from "@refineui/tokens";
|
|
15630
15754
|
import { motionMsToNumber as motionMsToNumber7 } from "@refineui/utilities/animation";
|
|
15631
15755
|
import { Slot as Slot8 } from "@refineui/utilities/react";
|
|
15632
|
-
import { Fragment as Fragment5, jsx as
|
|
15756
|
+
import { Fragment as Fragment5, jsx as jsx81, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
15633
15757
|
var MENU_ATTR = "data-refineui-context-menu";
|
|
15634
15758
|
var CLOSE_MS = motionMsToNumber7(semanticInteraction10.duration.normal);
|
|
15635
15759
|
var MenuContext2 = createContext29(null);
|
|
@@ -15672,7 +15796,7 @@ function ContextMenu({ modal = true, onOpenChange, children }) {
|
|
|
15672
15796
|
if (!wasOpen) onOpenChangeRef.current?.(true);
|
|
15673
15797
|
}, []);
|
|
15674
15798
|
const value = useMemo25(() => ({ open, point, openAt, close }), [open, point, openAt, close]);
|
|
15675
|
-
return /* @__PURE__ */
|
|
15799
|
+
return /* @__PURE__ */ jsx81(MenuContext2.Provider, { value, children });
|
|
15676
15800
|
}
|
|
15677
15801
|
var ContextMenuTrigger = forwardRef18(function ContextMenuTrigger2({ asChild = false, onContextMenu, children, ...props }, ref) {
|
|
15678
15802
|
const { openAt } = useMenu();
|
|
@@ -15687,11 +15811,11 @@ var ContextMenuTrigger = forwardRef18(function ContextMenuTrigger2({ asChild = f
|
|
|
15687
15811
|
openAt(event.clientX, event.clientY);
|
|
15688
15812
|
}
|
|
15689
15813
|
};
|
|
15690
|
-
if (asChild) return /* @__PURE__ */
|
|
15691
|
-
return /* @__PURE__ */
|
|
15814
|
+
if (asChild) return /* @__PURE__ */ jsx81(Slot8, { ...shared, children });
|
|
15815
|
+
return /* @__PURE__ */ jsx81("span", { ...shared, className: clsx109(menuStyles.triggerFallback, props.className), children });
|
|
15692
15816
|
});
|
|
15693
15817
|
function ContextMenuPortal({ children }) {
|
|
15694
|
-
return /* @__PURE__ */
|
|
15818
|
+
return /* @__PURE__ */ jsx81(Fragment5, { children });
|
|
15695
15819
|
}
|
|
15696
15820
|
var ContextMenuContent = forwardRef18(function ContextMenuContent2({ className, style, onPointerDown, children, ...props }, ref) {
|
|
15697
15821
|
const { open, point, close } = useMenu();
|
|
@@ -15734,8 +15858,8 @@ var ContextMenuContent = forwardRef18(function ContextMenuContent2({ className,
|
|
|
15734
15858
|
};
|
|
15735
15859
|
}, [open, close]);
|
|
15736
15860
|
if (!shouldRender || typeof document === "undefined") return null;
|
|
15737
|
-
return
|
|
15738
|
-
/* @__PURE__ */
|
|
15861
|
+
return createPortal8(
|
|
15862
|
+
/* @__PURE__ */ jsx81(
|
|
15739
15863
|
"div",
|
|
15740
15864
|
{
|
|
15741
15865
|
...props,
|
|
@@ -15762,7 +15886,7 @@ var ContextMenuContent = forwardRef18(function ContextMenuContent2({ className,
|
|
|
15762
15886
|
onPointerDown?.(event);
|
|
15763
15887
|
},
|
|
15764
15888
|
onContextMenu: (event) => event.preventDefault(),
|
|
15765
|
-
children: /* @__PURE__ */
|
|
15889
|
+
children: /* @__PURE__ */ jsx81("div", { role: "menu", "data-refineui": "menu", className: clsx109(menuStyles.list, className), children })
|
|
15766
15890
|
}
|
|
15767
15891
|
),
|
|
15768
15892
|
document.body
|
|
@@ -15783,7 +15907,7 @@ var ContextMenuItem = forwardRef18(function ContextMenuItem2({ disabled = false,
|
|
|
15783
15907
|
const { close } = useMenu();
|
|
15784
15908
|
const isDisabled = disabled || state === "disabled";
|
|
15785
15909
|
const slotted = startIcon != null || description != null || shortcut != null || endIcon != null;
|
|
15786
|
-
return /* @__PURE__ */
|
|
15910
|
+
return /* @__PURE__ */ jsx81(
|
|
15787
15911
|
"button",
|
|
15788
15912
|
{
|
|
15789
15913
|
ref,
|
|
@@ -15809,8 +15933,8 @@ var ContextMenuItem = forwardRef18(function ContextMenuItem2({ disabled = false,
|
|
|
15809
15933
|
runSelect(onSelect, close, isDisabled);
|
|
15810
15934
|
}
|
|
15811
15935
|
},
|
|
15812
|
-
children: slotted ? /* @__PURE__ */
|
|
15813
|
-
startIcon ? /* @__PURE__ */
|
|
15936
|
+
children: slotted ? /* @__PURE__ */ jsxs34("span", { className: menuStyles.row, children: [
|
|
15937
|
+
startIcon ? /* @__PURE__ */ jsx81(
|
|
15814
15938
|
"span",
|
|
15815
15939
|
{
|
|
15816
15940
|
className: menuStyles.iconWrap,
|
|
@@ -15818,13 +15942,13 @@ var ContextMenuItem = forwardRef18(function ContextMenuItem2({ disabled = false,
|
|
|
15818
15942
|
children: startIcon
|
|
15819
15943
|
}
|
|
15820
15944
|
) : null,
|
|
15821
|
-
/* @__PURE__ */
|
|
15822
|
-
/* @__PURE__ */
|
|
15823
|
-
description ? /* @__PURE__ */
|
|
15945
|
+
/* @__PURE__ */ jsxs34("span", { className: menuStyles.textCol, children: [
|
|
15946
|
+
/* @__PURE__ */ jsx81("span", { className: menuStyles.title, children }),
|
|
15947
|
+
description ? /* @__PURE__ */ jsx81("span", { className: clsx109(menuStyles.description, isDisabled ? menuStyles.descriptionDisabled : menuStyles.descriptionEnabled), children: description }) : null
|
|
15824
15948
|
] }),
|
|
15825
|
-
(shortcut || endIcon) && /* @__PURE__ */
|
|
15826
|
-
shortcut ? /* @__PURE__ */
|
|
15827
|
-
endIcon ? /* @__PURE__ */
|
|
15949
|
+
(shortcut || endIcon) && /* @__PURE__ */ jsxs34("span", { className: menuStyles.rightWrap, children: [
|
|
15950
|
+
shortcut ? /* @__PURE__ */ jsx81("span", { className: menuStyles.shortcut, children: shortcut }) : null,
|
|
15951
|
+
endIcon ? /* @__PURE__ */ jsx81(
|
|
15828
15952
|
"span",
|
|
15829
15953
|
{
|
|
15830
15954
|
className: menuStyles.iconWrap,
|
|
@@ -15833,13 +15957,13 @@ var ContextMenuItem = forwardRef18(function ContextMenuItem2({ disabled = false,
|
|
|
15833
15957
|
}
|
|
15834
15958
|
) : null
|
|
15835
15959
|
] })
|
|
15836
|
-
] }) : /* @__PURE__ */
|
|
15960
|
+
] }) : /* @__PURE__ */ jsx81("span", { className: menuStyles.row, children })
|
|
15837
15961
|
}
|
|
15838
15962
|
);
|
|
15839
15963
|
});
|
|
15840
15964
|
var ContextMenuSeparator = forwardRef18(
|
|
15841
15965
|
function ContextMenuSeparator2({ className, ...props }, ref) {
|
|
15842
|
-
return /* @__PURE__ */
|
|
15966
|
+
return /* @__PURE__ */ jsx81(
|
|
15843
15967
|
"div",
|
|
15844
15968
|
{
|
|
15845
15969
|
ref,
|
|
@@ -15849,13 +15973,13 @@ var ContextMenuSeparator = forwardRef18(
|
|
|
15849
15973
|
...{ [MENU_ATTR]: "" },
|
|
15850
15974
|
className: clsx109(menuStyles.dividerWrap, className),
|
|
15851
15975
|
...props,
|
|
15852
|
-
children: /* @__PURE__ */
|
|
15976
|
+
children: /* @__PURE__ */ jsx81("div", { className: menuStyles.dividerLine })
|
|
15853
15977
|
}
|
|
15854
15978
|
);
|
|
15855
15979
|
}
|
|
15856
15980
|
);
|
|
15857
15981
|
function ContextMenuLabel({ className, children, ...props }) {
|
|
15858
|
-
return /* @__PURE__ */
|
|
15982
|
+
return /* @__PURE__ */ jsx81("div", { "data-refineui": "menu-label", className: clsx109(menuStyles.section, className), ...props, children: /* @__PURE__ */ jsx81("span", { className: menuStyles.sectionText, children }) });
|
|
15859
15983
|
}
|
|
15860
15984
|
function ContextMenuSub({ children }) {
|
|
15861
15985
|
const [open, setOpen] = useState35(false);
|
|
@@ -15881,7 +16005,7 @@ function ContextMenuSub({ children }) {
|
|
|
15881
16005
|
}),
|
|
15882
16006
|
[open]
|
|
15883
16007
|
);
|
|
15884
|
-
return /* @__PURE__ */
|
|
16008
|
+
return /* @__PURE__ */ jsx81(SubContext.Provider, { value, children });
|
|
15885
16009
|
}
|
|
15886
16010
|
function useSub2() {
|
|
15887
16011
|
const value = useContext33(SubContext);
|
|
@@ -15924,9 +16048,9 @@ var ContextMenuSubTrigger = forwardRef18(
|
|
|
15924
16048
|
if (!event.defaultPrevented) sub.show();
|
|
15925
16049
|
}
|
|
15926
16050
|
};
|
|
15927
|
-
if (asChild) return /* @__PURE__ */
|
|
15928
|
-
return /* @__PURE__ */
|
|
15929
|
-
startIcon ? /* @__PURE__ */
|
|
16051
|
+
if (asChild) return /* @__PURE__ */ jsx81(Slot8, { ...shared, children });
|
|
16052
|
+
return /* @__PURE__ */ jsx81("button", { ...shared, children: /* @__PURE__ */ jsxs34("span", { className: menuStyles.row, children: [
|
|
16053
|
+
startIcon ? /* @__PURE__ */ jsx81(
|
|
15930
16054
|
"span",
|
|
15931
16055
|
{
|
|
15932
16056
|
className: menuStyles.iconWrap,
|
|
@@ -15934,16 +16058,16 @@ var ContextMenuSubTrigger = forwardRef18(
|
|
|
15934
16058
|
children: startIcon
|
|
15935
16059
|
}
|
|
15936
16060
|
) : null,
|
|
15937
|
-
/* @__PURE__ */
|
|
15938
|
-
/* @__PURE__ */
|
|
15939
|
-
description ? /* @__PURE__ */
|
|
16061
|
+
/* @__PURE__ */ jsxs34("span", { className: menuStyles.textCol, children: [
|
|
16062
|
+
/* @__PURE__ */ jsx81("span", { className: menuStyles.title, children }),
|
|
16063
|
+
description ? /* @__PURE__ */ jsx81("span", { className: clsx109(menuStyles.description, menuStyles.descriptionEnabled), children: description }) : null
|
|
15940
16064
|
] }),
|
|
15941
|
-
/* @__PURE__ */
|
|
16065
|
+
/* @__PURE__ */ jsx81("span", { className: menuStyles.rightWrap, children: /* @__PURE__ */ jsx81(
|
|
15942
16066
|
"span",
|
|
15943
16067
|
{
|
|
15944
16068
|
className: menuStyles.iconWrap,
|
|
15945
16069
|
style: { width: iconSizes23.small, minWidth: iconSizes23.small, height: iconSizes23.small },
|
|
15946
|
-
children: /* @__PURE__ */
|
|
16070
|
+
children: /* @__PURE__ */ jsx81(WebIcon, { name: "chevron-right", size: iconSizes23.small, color: "currentColor", "aria-hidden": true })
|
|
15947
16071
|
}
|
|
15948
16072
|
) })
|
|
15949
16073
|
] }) });
|
|
@@ -15971,8 +16095,8 @@ var ContextMenuSubContent = forwardRef18(
|
|
|
15971
16095
|
placeInView(element, left, rect.top);
|
|
15972
16096
|
}, [sub.open, sub.triggerRef]);
|
|
15973
16097
|
if (!sub.open || typeof document === "undefined") return null;
|
|
15974
|
-
return
|
|
15975
|
-
/* @__PURE__ */
|
|
16098
|
+
return createPortal8(
|
|
16099
|
+
/* @__PURE__ */ jsx81(
|
|
15976
16100
|
"div",
|
|
15977
16101
|
{
|
|
15978
16102
|
...props,
|