@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.cjs
CHANGED
|
@@ -209,7 +209,7 @@ __export(index_exports, {
|
|
|
209
209
|
ResizableHandle: () => ResizableHandle,
|
|
210
210
|
ResizablePanel: () => ResizablePanel,
|
|
211
211
|
ResizablePanelGroup: () => ResizablePanelGroup,
|
|
212
|
-
SEMANTIC_TEXT: () =>
|
|
212
|
+
SEMANTIC_TEXT: () => import_tokens39.SEMANTIC_TEXT,
|
|
213
213
|
ScrollArea: () => ScrollArea,
|
|
214
214
|
ScrollAreaScrollbar: () => ScrollAreaScrollbar,
|
|
215
215
|
ScrollAreaThumb: () => ScrollAreaThumb,
|
|
@@ -456,16 +456,16 @@ var componentColorTokens = {
|
|
|
456
456
|
},
|
|
457
457
|
tooltip: {
|
|
458
458
|
default: {
|
|
459
|
-
/**
|
|
460
|
-
background: semanticToken("
|
|
459
|
+
/** Frosted floating panel — blur is applied by refineui.css */
|
|
460
|
+
background: semanticToken("surfaceFrosted"),
|
|
461
461
|
foreground: semanticToken("foregroundPrimary"),
|
|
462
462
|
border: semanticToken("borderDefault")
|
|
463
463
|
}
|
|
464
464
|
},
|
|
465
465
|
popover: {
|
|
466
466
|
default: {
|
|
467
|
-
/**
|
|
468
|
-
background: semanticToken("
|
|
467
|
+
/** Frosted floating panel — blur is applied by refineui.css */
|
|
468
|
+
background: semanticToken("surfaceFrosted"),
|
|
469
469
|
foreground: semanticToken("foregroundPrimary"),
|
|
470
470
|
border: semanticToken("borderDefault")
|
|
471
471
|
},
|
|
@@ -654,7 +654,7 @@ var componentColorTokens = {
|
|
|
654
654
|
},
|
|
655
655
|
chip: {
|
|
656
656
|
default: {
|
|
657
|
-
background: semanticToken("
|
|
657
|
+
background: semanticToken("backgroundSurfaceSelected"),
|
|
658
658
|
foreground: semanticToken("foregroundBrand"),
|
|
659
659
|
hoverBackground: semanticToken("backgroundPrimaryHover"),
|
|
660
660
|
activeBackground: semanticToken("backgroundPrimaryActive"),
|
|
@@ -684,7 +684,7 @@ var componentColorTokens = {
|
|
|
684
684
|
},
|
|
685
685
|
tag: {
|
|
686
686
|
default: {
|
|
687
|
-
background: semanticToken("
|
|
687
|
+
background: semanticToken("backgroundSurfaceSelected"),
|
|
688
688
|
foreground: semanticToken("foregroundBrand")
|
|
689
689
|
},
|
|
690
690
|
outline: {
|
|
@@ -982,6 +982,7 @@ var componentColorTokens = {
|
|
|
982
982
|
},
|
|
983
983
|
/** Cell fill only — Global tint per MCP `Color`. Glyph/initials ink: `avatar.icon`. */
|
|
984
984
|
shell: {
|
|
985
|
+
border: semanticToken("borderSubtle"),
|
|
985
986
|
background: {
|
|
986
987
|
neutral: paletteToken("neutral300"),
|
|
987
988
|
blue: paletteToken("blue100"),
|
|
@@ -1386,7 +1387,7 @@ function buildSemanticTextClassMap(map) {
|
|
|
1386
1387
|
}
|
|
1387
1388
|
|
|
1388
1389
|
// src/index.ts
|
|
1389
|
-
var
|
|
1390
|
+
var import_tokens39 = require("@refineui/tokens");
|
|
1390
1391
|
|
|
1391
1392
|
// src/componentSizes.ts
|
|
1392
1393
|
var import_tokens3 = require("@refineui/tokens");
|
|
@@ -2317,7 +2318,7 @@ var import_clsx11 = require("clsx");
|
|
|
2317
2318
|
var import_clsx10 = require("clsx");
|
|
2318
2319
|
var badgeVariantClass = {
|
|
2319
2320
|
default: "bg-refineui-alias-background-brand text-refineui-alias-foreground-inversed",
|
|
2320
|
-
neutral: "bg-refineui-alias-background-
|
|
2321
|
+
neutral: "bg-refineui-alias-background-brand-subtle text-refineui-alias-foreground-brand-strong",
|
|
2321
2322
|
outline: "border-refineui-thin border-refineui-alias-border-default border bg-transparent text-refineui-alias-foreground-primary box-border",
|
|
2322
2323
|
success: "bg-refineui-alias-background-success text-refineui-alias-foreground-inversed",
|
|
2323
2324
|
warning: "bg-refineui-alias-background-warning text-refineui-alias-foreground-inversed",
|
|
@@ -4126,13 +4127,13 @@ var import_clsx30 = require("clsx");
|
|
|
4126
4127
|
// src/recipes/chip.recipe.ts
|
|
4127
4128
|
var import_tokens9 = require("@refineui/tokens");
|
|
4128
4129
|
var chipVariantClass = {
|
|
4129
|
-
default: "border-none bg-refineui-alias-background-surface text-refineui-alias-foreground-brand",
|
|
4130
|
-
outline: "border-refineui-thin border-refineui-alias-border-default box-border bg-transparent text-refineui-alias-foreground-brand",
|
|
4130
|
+
default: "border-none bg-refineui-alias-background-surface-selected text-refineui-alias-foreground-brand",
|
|
4131
|
+
outline: "border border-refineui-thin border-refineui-alias-border-default box-border bg-transparent text-refineui-alias-foreground-brand",
|
|
4131
4132
|
filled: "border-none bg-refineui-alias-background-brand text-refineui-alias-foreground-inversed"
|
|
4132
4133
|
};
|
|
4133
4134
|
var chipDisabledVariantClass = {
|
|
4134
4135
|
default: "border-none bg-refineui-alias-background-surface-disabled text-refineui-alias-foreground-disabled",
|
|
4135
|
-
outline: "border-refineui-thin border-refineui-alias-border-disabled box-border bg-transparent text-refineui-alias-foreground-disabled",
|
|
4136
|
+
outline: "border border-refineui-thin border-refineui-alias-border-disabled box-border bg-transparent text-refineui-alias-foreground-disabled",
|
|
4136
4137
|
filled: "border-none bg-refineui-alias-background-surface-disabled text-refineui-alias-foreground-disabled"
|
|
4137
4138
|
};
|
|
4138
4139
|
var chipSizeClass = {
|
|
@@ -5245,15 +5246,18 @@ var avatarShellInitialsForegroundColor = {
|
|
|
5245
5246
|
yellow: (0, import_color4.resolveColorTokenValue)(componentColorTokens.avatar.icon.yellow)
|
|
5246
5247
|
};
|
|
5247
5248
|
var avatarNeutralForegroundColor = (0, import_color4.resolveColorTokenValue)(componentColorTokens.avatar.icon.neutral);
|
|
5249
|
+
var avatarShellBorderColor = (0, import_color4.resolveColorTokenValue)(componentColorTokens.avatar.shell.border);
|
|
5248
5250
|
function resolveAvatarShellStyle(color, layout) {
|
|
5249
5251
|
if (layout === "initials") {
|
|
5250
5252
|
return {
|
|
5251
5253
|
backgroundColor: avatarShellBackgroundColor[color],
|
|
5252
|
-
color: avatarShellInitialsForegroundColor[color]
|
|
5254
|
+
color: avatarShellInitialsForegroundColor[color],
|
|
5255
|
+
borderColor: avatarShellInitialsForegroundColor[color]
|
|
5253
5256
|
};
|
|
5254
5257
|
}
|
|
5255
5258
|
return {
|
|
5256
|
-
backgroundColor: avatarShellBackgroundColor[color]
|
|
5259
|
+
backgroundColor: avatarShellBackgroundColor[color],
|
|
5260
|
+
borderColor: avatarShellBorderColor
|
|
5257
5261
|
};
|
|
5258
5262
|
}
|
|
5259
5263
|
function resolveAvatarShellColorLayer(_color, size, layout) {
|
|
@@ -5498,6 +5502,7 @@ function Avatar({
|
|
|
5498
5502
|
className: (0, import_clsx36.clsx)(
|
|
5499
5503
|
AVATAR_INNER_MASK,
|
|
5500
5504
|
resolveAvatarShellColorLayer(effectiveColor, normalizedSize, resolvedLayout),
|
|
5505
|
+
"box-border border border-refineui-thin",
|
|
5501
5506
|
useNeutralShellTypo && avatarTypoNeutral[normalizedSize],
|
|
5502
5507
|
innerClassName
|
|
5503
5508
|
),
|
|
@@ -9707,8 +9712,12 @@ var menuStyles = {
|
|
|
9707
9712
|
row: "flex items-center gap-refineui-size-x-small",
|
|
9708
9713
|
iconWrap: "inline-flex shrink-0 items-center justify-center text-current [&>span]:leading-none",
|
|
9709
9714
|
textCol: "flex min-w-0 flex-1 flex-col gap-refineui-size-xxx-small px-refineui-size-xxx-small",
|
|
9710
|
-
|
|
9711
|
-
|
|
9715
|
+
/** Preserve labels and supporting copy by wrapping within the shared panel width. */
|
|
9716
|
+
title: (0, import_clsx75.clsx)(componentTextClass(componentTypographyTokens.menu.item), "break-words whitespace-normal"),
|
|
9717
|
+
description: (0, import_clsx75.clsx)(
|
|
9718
|
+
componentTextClass(componentTypographyTokens.menu.description),
|
|
9719
|
+
"break-words whitespace-normal"
|
|
9720
|
+
),
|
|
9712
9721
|
descriptionEnabled: "text-refineui-alias-foreground-tertiary",
|
|
9713
9722
|
descriptionDisabled: "text-refineui-alias-foreground-disabled",
|
|
9714
9723
|
rightWrap: "flex shrink-0 items-center gap-refineui-size-x-small",
|
|
@@ -10181,7 +10190,7 @@ function MenuSubContent({ className, children, style, ...props }) {
|
|
|
10181
10190
|
const [side, setSide] = (0, import_react36.useState)("right");
|
|
10182
10191
|
const gapPx = parseCssPx(import_tokens22.spacings.sizeXXXSmall, 2);
|
|
10183
10192
|
const z = (Number.parseInt(String(import_tokens22.zIndex.zIndexMessages), 10) || 1e4) + 100;
|
|
10184
|
-
const defaultW = parseCssPx(import_tokens3.componentSizes.menuPanelWidth,
|
|
10193
|
+
const defaultW = parseCssPx(import_tokens3.componentSizes.menuPanelWidth, 200);
|
|
10185
10194
|
const setPanelEl = (0, import_react36.useCallback)(
|
|
10186
10195
|
(el) => {
|
|
10187
10196
|
panelRef.current = el;
|
|
@@ -10279,6 +10288,7 @@ function MenuSubContent({ className, children, style, ...props }) {
|
|
|
10279
10288
|
// src/components/NavigationMenu/NavigationMenu.tsx
|
|
10280
10289
|
var import_clsx78 = require("clsx");
|
|
10281
10290
|
var import_react38 = require("react");
|
|
10291
|
+
var import_react_dom6 = require("react-dom");
|
|
10282
10292
|
var import_tokens23 = require("@refineui/tokens");
|
|
10283
10293
|
var import_animation5 = require("@refineui/utilities/animation");
|
|
10284
10294
|
|
|
@@ -10287,34 +10297,34 @@ var import_clsx77 = require("clsx");
|
|
|
10287
10297
|
var topLevelItem = (0, import_clsx77.clsx)(
|
|
10288
10298
|
componentTextClass(componentTypographyTokens.navigationMenu.trigger),
|
|
10289
10299
|
"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",
|
|
10290
|
-
"rounded-refineui-large border-none bg-transparent px-refineui-size-medium py-refineui-size-x-small",
|
|
10300
|
+
"rounded-refineui-x-large border-none bg-transparent px-refineui-size-medium py-refineui-size-x-small",
|
|
10291
10301
|
"text-refineui-alias-foreground-tertiary outline-none leading-none",
|
|
10292
|
-
"transition-[color,background-color] duration-[var(--refineui-motion-duration-fast)]"
|
|
10302
|
+
"transition-[color,background-color,box-shadow] duration-[var(--refineui-motion-duration-fast)] ease-[var(--refineui-motion-easing-ease-out)]"
|
|
10293
10303
|
);
|
|
10294
10304
|
var chevron = (0, import_clsx77.clsx)(
|
|
10295
10305
|
"shrink-0 transition-transform duration-[var(--refineui-motion-duration-fast)] ease-[var(--refineui-motion-easing-ease-out)]"
|
|
10296
10306
|
);
|
|
10297
10307
|
var navigationMenuStyles = {
|
|
10298
10308
|
root: "relative isolate z-refineui-messages flex w-full max-w-max items-center",
|
|
10299
|
-
list: "relative m-0 flex list-none flex-wrap items-center gap-refineui-size-
|
|
10309
|
+
list: "relative m-0 flex list-none flex-wrap items-center gap-refineui-size-xxx-small p-0",
|
|
10300
10310
|
item: "relative inline-flex items-center",
|
|
10301
10311
|
trigger: (0, import_clsx77.clsx)(topLevelItem, "m-0 appearance-none font-inherit"),
|
|
10302
|
-
triggerOpen: "text-refineui-alias-foreground-primary",
|
|
10312
|
+
triggerOpen: "bg-refineui-alias-background-primary-hover text-refineui-alias-foreground-primary",
|
|
10303
10313
|
triggerDisabled: "cursor-not-allowed text-refineui-alias-foreground-disabled",
|
|
10304
10314
|
chevron,
|
|
10305
10315
|
chevronOpen: "rotate-180",
|
|
10306
10316
|
content: (0, import_clsx77.clsx)(
|
|
10307
10317
|
/** Flush under trigger so pointer does not leave the item while moving into the panel. */
|
|
10308
10318
|
"absolute start-0 top-full z-refineui-messages pt-refineui-size-xx-small",
|
|
10309
|
-
"box-border min-w-refineui-menu-panel-width",
|
|
10319
|
+
"box-border min-w-refineui-navigation-menu-panel-width",
|
|
10310
10320
|
"outline-none"
|
|
10311
10321
|
),
|
|
10312
10322
|
contentPanel: (0, import_clsx77.clsx)(
|
|
10313
|
-
"box-border overflow-hidden rounded-refineui-large border-refineui-hairline border-refineui-alias-border-default",
|
|
10314
|
-
"
|
|
10323
|
+
"box-border flex flex-col gap-px overflow-hidden rounded-refineui-xx-large border-refineui-hairline border-refineui-alias-border-default",
|
|
10324
|
+
"p-refineui-size-xx-small shadow-refineui-2"
|
|
10315
10325
|
),
|
|
10316
10326
|
link: (0, import_clsx77.clsx)(topLevelItem, "no-underline"),
|
|
10317
|
-
linkActive: "text-refineui-alias-foreground-primary",
|
|
10327
|
+
linkActive: "bg-refineui-alias-background-primary-hover text-refineui-alias-foreground-primary",
|
|
10318
10328
|
linkDisabled: "cursor-not-allowed text-refineui-alias-foreground-disabled",
|
|
10319
10329
|
/** Dense row inside a content panel — same density as Menu item. */
|
|
10320
10330
|
linkInContent: (0, import_clsx77.clsx)(
|
|
@@ -10322,7 +10332,7 @@ var navigationMenuStyles = {
|
|
|
10322
10332
|
"box-border flex w-full cursor-pointer items-center gap-refineui-size-x-small",
|
|
10323
10333
|
"rounded-refineui-large border-none bg-transparent p-refineui-size-x-small text-start no-underline outline-none",
|
|
10324
10334
|
"text-refineui-alias-foreground-primary",
|
|
10325
|
-
"transition-[background-color,color] duration-[var(--refineui-motion-duration-fast)]"
|
|
10335
|
+
"transition-[background-color,color] duration-[var(--refineui-motion-duration-fast)] ease-[var(--refineui-motion-easing-ease-out)]"
|
|
10326
10336
|
),
|
|
10327
10337
|
/** Optional — prefer omitting; kept for API compatibility. */
|
|
10328
10338
|
indicator: "hidden"
|
|
@@ -10374,6 +10384,7 @@ function NavigationMenu({
|
|
|
10374
10384
|
const [value, setValue] = useControllableOpen(valueControlled, defaultValue, onValueChange);
|
|
10375
10385
|
const listRef = (0, import_react38.useRef)(null);
|
|
10376
10386
|
const triggerMapRef = (0, import_react38.useRef)(/* @__PURE__ */ new Map());
|
|
10387
|
+
const contentMapRef = (0, import_react38.useRef)(/* @__PURE__ */ new Map());
|
|
10377
10388
|
const openTimerRef = (0, import_react38.useRef)(null);
|
|
10378
10389
|
const closeTimerRef = (0, import_react38.useRef)(null);
|
|
10379
10390
|
const rootRef = (0, import_react38.useRef)(null);
|
|
@@ -10432,12 +10443,25 @@ function NavigationMenu({
|
|
|
10432
10443
|
triggerMapRef.current.delete(itemValue);
|
|
10433
10444
|
}
|
|
10434
10445
|
}, []);
|
|
10446
|
+
const registerContent = (0, import_react38.useCallback)((itemValue, el) => {
|
|
10447
|
+
if (el) {
|
|
10448
|
+
contentMapRef.current.set(itemValue, el);
|
|
10449
|
+
} else {
|
|
10450
|
+
contentMapRef.current.delete(itemValue);
|
|
10451
|
+
}
|
|
10452
|
+
}, []);
|
|
10453
|
+
const isContentTarget = (0, import_react38.useCallback)((itemValue, target) => {
|
|
10454
|
+
return target instanceof Node && contentMapRef.current.get(itemValue)?.contains(target) === true;
|
|
10455
|
+
}, []);
|
|
10456
|
+
const isMenuTarget = (0, import_react38.useCallback)((target) => {
|
|
10457
|
+
if (!(target instanceof Node)) return false;
|
|
10458
|
+
return rootRef.current?.contains(target) === true || Array.from(contentMapRef.current.values()).some((content) => content.contains(target));
|
|
10459
|
+
}, []);
|
|
10435
10460
|
(0, import_react38.useEffect)(() => () => clearTimers(), [clearTimers]);
|
|
10436
10461
|
(0, import_react38.useEffect)(() => {
|
|
10437
10462
|
if (!value) return;
|
|
10438
10463
|
const onPointerDown = (event) => {
|
|
10439
|
-
|
|
10440
|
-
if (rootRef.current?.contains(target)) return;
|
|
10464
|
+
if (isMenuTarget(event.target)) return;
|
|
10441
10465
|
setValueSafe("");
|
|
10442
10466
|
};
|
|
10443
10467
|
const onKeyDown = (event) => {
|
|
@@ -10453,7 +10477,7 @@ function NavigationMenu({
|
|
|
10453
10477
|
document.removeEventListener("pointerdown", onPointerDown);
|
|
10454
10478
|
document.removeEventListener("keydown", onKeyDown);
|
|
10455
10479
|
};
|
|
10456
|
-
}, [setValueSafe, value]);
|
|
10480
|
+
}, [isMenuTarget, setValueSafe, value]);
|
|
10457
10481
|
const ctx = (0, import_react38.useMemo)(
|
|
10458
10482
|
() => ({
|
|
10459
10483
|
value,
|
|
@@ -10464,9 +10488,23 @@ function NavigationMenu({
|
|
|
10464
10488
|
skipDelayDuration,
|
|
10465
10489
|
listRef,
|
|
10466
10490
|
registerTrigger,
|
|
10491
|
+
registerContent,
|
|
10492
|
+
isContentTarget,
|
|
10493
|
+
isMenuTarget,
|
|
10467
10494
|
isInsideContent: false
|
|
10468
10495
|
}),
|
|
10469
|
-
[
|
|
10496
|
+
[
|
|
10497
|
+
close,
|
|
10498
|
+
delayDuration,
|
|
10499
|
+
isContentTarget,
|
|
10500
|
+
isMenuTarget,
|
|
10501
|
+
openItem,
|
|
10502
|
+
registerContent,
|
|
10503
|
+
registerTrigger,
|
|
10504
|
+
setValueSafe,
|
|
10505
|
+
skipDelayDuration,
|
|
10506
|
+
value
|
|
10507
|
+
]
|
|
10470
10508
|
);
|
|
10471
10509
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(NavigationMenuContext.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
10472
10510
|
"nav",
|
|
@@ -10555,6 +10593,7 @@ function NavigationMenuItem({
|
|
|
10555
10593
|
onPointerLeave: (event) => {
|
|
10556
10594
|
onPointerLeave?.(event);
|
|
10557
10595
|
if (event.defaultPrevented) return;
|
|
10596
|
+
if (menu.isContentTarget(value, event.relatedTarget)) return;
|
|
10558
10597
|
menu.close();
|
|
10559
10598
|
},
|
|
10560
10599
|
...props,
|
|
@@ -10643,12 +10682,22 @@ function NavigationMenuContent({
|
|
|
10643
10682
|
children,
|
|
10644
10683
|
className,
|
|
10645
10684
|
onKeyDown,
|
|
10685
|
+
style,
|
|
10646
10686
|
...props
|
|
10647
10687
|
}) {
|
|
10648
10688
|
const menu = useNavigationMenu("NavigationMenuContent");
|
|
10649
10689
|
const item = useNavigationMenuItem("NavigationMenuContent");
|
|
10650
10690
|
const [shouldRender, setShouldRender] = (0, import_react38.useState)(item.open);
|
|
10651
10691
|
const [isClosing, setIsClosing] = (0, import_react38.useState)(false);
|
|
10692
|
+
const contentRef = (0, import_react38.useRef)(null);
|
|
10693
|
+
const [positionStyle, setPositionStyle] = (0, import_react38.useState)(null);
|
|
10694
|
+
const setContentRef = (0, import_react38.useCallback)(
|
|
10695
|
+
(el) => {
|
|
10696
|
+
contentRef.current = el;
|
|
10697
|
+
menu.registerContent(item.value, el);
|
|
10698
|
+
},
|
|
10699
|
+
[item.value, menu]
|
|
10700
|
+
);
|
|
10652
10701
|
(0, import_react38.useEffect)(() => {
|
|
10653
10702
|
if (item.open) {
|
|
10654
10703
|
setShouldRender(true);
|
|
@@ -10663,20 +10712,58 @@ function NavigationMenuContent({
|
|
|
10663
10712
|
}, (0, import_animation5.motionMsToNumber)(import_tokens23.semanticInteraction.duration.fast));
|
|
10664
10713
|
return () => window.clearTimeout(timeout);
|
|
10665
10714
|
}, [item.open, shouldRender]);
|
|
10715
|
+
useIsomorphicLayoutEffect5(() => {
|
|
10716
|
+
if (!shouldRender || !item.open || typeof document === "undefined") return;
|
|
10717
|
+
const trigger = document.getElementById(item.triggerId);
|
|
10718
|
+
if (!trigger) return;
|
|
10719
|
+
const updatePosition = () => {
|
|
10720
|
+
const content2 = contentRef.current;
|
|
10721
|
+
if (!content2) return;
|
|
10722
|
+
const triggerRect = trigger.getBoundingClientRect();
|
|
10723
|
+
const contentWidth = content2.offsetWidth;
|
|
10724
|
+
const edge = Number.parseFloat(import_tokens23.spacings.sizeMedium) || 8;
|
|
10725
|
+
const left = Math.max(
|
|
10726
|
+
edge,
|
|
10727
|
+
Math.min(triggerRect.left, window.innerWidth - contentWidth - edge)
|
|
10728
|
+
);
|
|
10729
|
+
setPositionStyle({
|
|
10730
|
+
position: "fixed",
|
|
10731
|
+
top: triggerRect.bottom,
|
|
10732
|
+
left,
|
|
10733
|
+
zIndex: Number.parseInt(String(import_tokens23.zIndex.zIndexMessages), 10) || 1e4
|
|
10734
|
+
});
|
|
10735
|
+
};
|
|
10736
|
+
updatePosition();
|
|
10737
|
+
const frame = requestAnimationFrame(updatePosition);
|
|
10738
|
+
window.addEventListener("resize", updatePosition);
|
|
10739
|
+
const unsubscribe = subscribeScrollAndScrollableAncestors2(trigger, updatePosition);
|
|
10740
|
+
return () => {
|
|
10741
|
+
cancelAnimationFrame(frame);
|
|
10742
|
+
window.removeEventListener("resize", updatePosition);
|
|
10743
|
+
unsubscribe();
|
|
10744
|
+
};
|
|
10745
|
+
}, [item.open, item.triggerId, shouldRender]);
|
|
10666
10746
|
const contentCtx = (0, import_react38.useMemo)(
|
|
10667
10747
|
() => ({ ...menu, isInsideContent: true }),
|
|
10668
10748
|
[menu]
|
|
10669
10749
|
);
|
|
10670
10750
|
if (!shouldRender) return null;
|
|
10671
|
-
|
|
10751
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(NavigationMenuContext.Provider, { value: contentCtx, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
10672
10752
|
"div",
|
|
10673
10753
|
{
|
|
10754
|
+
ref: setContentRef,
|
|
10674
10755
|
id: item.contentId,
|
|
10675
10756
|
role: "region",
|
|
10676
10757
|
"aria-labelledby": item.triggerId,
|
|
10677
10758
|
"data-refineui": "navigation-menu-content",
|
|
10678
10759
|
"data-state": isClosing || !item.open ? "closed" : "open",
|
|
10679
10760
|
className: (0, import_clsx78.clsx)(navigationMenuStyles.content, className),
|
|
10761
|
+
style: { ...positionStyle, ...style },
|
|
10762
|
+
onPointerEnter: () => menu.openItem(item.value, { immediate: true }),
|
|
10763
|
+
onPointerLeave: (event) => {
|
|
10764
|
+
if (menu.isMenuTarget(event.relatedTarget)) return;
|
|
10765
|
+
menu.close();
|
|
10766
|
+
},
|
|
10680
10767
|
onKeyDown: (event) => {
|
|
10681
10768
|
onKeyDown?.(event);
|
|
10682
10769
|
if (event.defaultPrevented) return;
|
|
@@ -10689,6 +10776,7 @@ function NavigationMenuContent({
|
|
|
10689
10776
|
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { "data-refineui": "navigation-menu-content-panel", className: navigationMenuStyles.contentPanel, children })
|
|
10690
10777
|
}
|
|
10691
10778
|
) });
|
|
10779
|
+
return typeof document === "undefined" ? content : (0, import_react_dom6.createPortal)(content, document.body);
|
|
10692
10780
|
}
|
|
10693
10781
|
function NavigationMenuLink({
|
|
10694
10782
|
children,
|
|
@@ -13606,7 +13694,7 @@ function SpinButton({
|
|
|
13606
13694
|
// src/components/Toast/Toast.tsx
|
|
13607
13695
|
var import_clsx98 = require("clsx");
|
|
13608
13696
|
var import_react50 = require("react");
|
|
13609
|
-
var
|
|
13697
|
+
var import_react_dom7 = require("react-dom");
|
|
13610
13698
|
var import_tokens30 = require("@refineui/tokens");
|
|
13611
13699
|
var import_animation7 = require("@refineui/utilities/animation");
|
|
13612
13700
|
var import_color12 = require("@refineui/utilities/color");
|
|
@@ -14098,7 +14186,7 @@ function Toaster({
|
|
|
14098
14186
|
if (typeof document === "undefined" || !isPortalOwner) {
|
|
14099
14187
|
return null;
|
|
14100
14188
|
}
|
|
14101
|
-
return (0,
|
|
14189
|
+
return (0, import_react_dom7.createPortal)(
|
|
14102
14190
|
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
14103
14191
|
"ol",
|
|
14104
14192
|
{
|
|
@@ -14617,15 +14705,68 @@ var import_react56 = require("react");
|
|
|
14617
14705
|
var import_color13 = require("@refineui/utilities/color");
|
|
14618
14706
|
var import_react57 = require("@refineui/utilities/react");
|
|
14619
14707
|
|
|
14620
|
-
// src/components/
|
|
14708
|
+
// src/components/shared/FrostedBeak.tsx
|
|
14621
14709
|
var import_tokens33 = require("@refineui/tokens");
|
|
14710
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
14711
|
+
var triangleClipPath = "polygon(50% 0, 0 100%, 100% 100%)";
|
|
14712
|
+
function FrostedBeak({ width, height, rotateDeg, borderColor }) {
|
|
14713
|
+
const surfaceStyle = {
|
|
14714
|
+
position: "absolute",
|
|
14715
|
+
inset: 0,
|
|
14716
|
+
clipPath: triangleClipPath
|
|
14717
|
+
};
|
|
14718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
14719
|
+
"div",
|
|
14720
|
+
{
|
|
14721
|
+
style: {
|
|
14722
|
+
position: "relative",
|
|
14723
|
+
width,
|
|
14724
|
+
height,
|
|
14725
|
+
transform: `rotate(${rotateDeg}deg)`,
|
|
14726
|
+
transformOrigin: "center center"
|
|
14727
|
+
},
|
|
14728
|
+
children: [
|
|
14729
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
14730
|
+
"span",
|
|
14731
|
+
{
|
|
14732
|
+
"data-refineui": "floating-beak-surface",
|
|
14733
|
+
style: surfaceStyle
|
|
14734
|
+
}
|
|
14735
|
+
),
|
|
14736
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
14737
|
+
"svg",
|
|
14738
|
+
{
|
|
14739
|
+
width,
|
|
14740
|
+
height,
|
|
14741
|
+
viewBox: "0 0 16 8",
|
|
14742
|
+
fill: "none",
|
|
14743
|
+
"aria-hidden": true,
|
|
14744
|
+
style: { position: "absolute", inset: 0, overflow: "visible" },
|
|
14745
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
14746
|
+
"path",
|
|
14747
|
+
{
|
|
14748
|
+
d: "M0 8L8 0L16 8",
|
|
14749
|
+
stroke: borderColor,
|
|
14750
|
+
strokeWidth: import_tokens33.strokeWidths.strokeWidthThin,
|
|
14751
|
+
strokeLinejoin: "round"
|
|
14752
|
+
}
|
|
14753
|
+
)
|
|
14754
|
+
}
|
|
14755
|
+
)
|
|
14756
|
+
]
|
|
14757
|
+
}
|
|
14758
|
+
);
|
|
14759
|
+
}
|
|
14760
|
+
|
|
14761
|
+
// src/components/Tooltip/style.ts
|
|
14762
|
+
var import_tokens34 = require("@refineui/tokens");
|
|
14622
14763
|
var import_clsx104 = require("clsx");
|
|
14623
14764
|
var TOOLTIP_BEAK_W = import_tokens3.foundationSizes.foundationSize160;
|
|
14624
14765
|
var TOOLTIP_BEAK_H = import_tokens3.foundationSizes.foundationSize80;
|
|
14625
14766
|
var TOOLTIP_BEAK_OFFSET = import_tokens3.foundationSizes.foundationSize80;
|
|
14626
|
-
var BEAK_BORDER_OVERLAP2 =
|
|
14627
|
-
var gap =
|
|
14628
|
-
var edgeInset =
|
|
14767
|
+
var BEAK_BORDER_OVERLAP2 = import_tokens34.strokeWidths.strokeWidthThin;
|
|
14768
|
+
var gap = import_tokens34.spacings.sizeXSmall;
|
|
14769
|
+
var edgeInset = import_tokens34.spacings.sizeMedium;
|
|
14629
14770
|
var tooltipStyles = {
|
|
14630
14771
|
root: "relative inline-block",
|
|
14631
14772
|
fallbackTrigger: "inline-flex outline-none",
|
|
@@ -14719,7 +14860,7 @@ function tooltipBeakRotateDeg(position) {
|
|
|
14719
14860
|
}
|
|
14720
14861
|
|
|
14721
14862
|
// src/components/Tooltip/Tooltip.tsx
|
|
14722
|
-
var
|
|
14863
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
14723
14864
|
function Tooltip({
|
|
14724
14865
|
trigger,
|
|
14725
14866
|
content,
|
|
@@ -14765,7 +14906,7 @@ function Tooltip({
|
|
|
14765
14906
|
const mergeEl = (0, import_react57.getMergeableTriggerChild)(trigger);
|
|
14766
14907
|
let triggerNode;
|
|
14767
14908
|
if (mergeEl != null) {
|
|
14768
|
-
triggerNode = /* @__PURE__ */ (0,
|
|
14909
|
+
triggerNode = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14769
14910
|
import_react57.Slot,
|
|
14770
14911
|
{
|
|
14771
14912
|
"aria-describedby": describedBy,
|
|
@@ -14782,7 +14923,7 @@ function Tooltip({
|
|
|
14782
14923
|
}
|
|
14783
14924
|
);
|
|
14784
14925
|
} else {
|
|
14785
|
-
triggerNode = /* @__PURE__ */ (0,
|
|
14926
|
+
triggerNode = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14786
14927
|
"span",
|
|
14787
14928
|
{
|
|
14788
14929
|
tabIndex: 0,
|
|
@@ -14799,44 +14940,27 @@ function Tooltip({
|
|
|
14799
14940
|
}
|
|
14800
14941
|
);
|
|
14801
14942
|
}
|
|
14802
|
-
return /* @__PURE__ */ (0,
|
|
14943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { "data-refineui": "tooltip", className: (0, import_clsx105.clsx)(tooltipStyles.root, className), ...props, children: [
|
|
14803
14944
|
triggerNode,
|
|
14804
|
-
open && /* @__PURE__ */ (0,
|
|
14805
|
-
/* @__PURE__ */ (0,
|
|
14945
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: tooltipStyles.floating, style: floatingStyle, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: tooltipStyles.panelWrap, children: [
|
|
14946
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14806
14947
|
"div",
|
|
14807
14948
|
{
|
|
14808
14949
|
className: tooltipStyles.beakWrap,
|
|
14809
14950
|
style: { ...beakWrapStyle, width: TOOLTIP_BEAK_W, height: TOOLTIP_BEAK_H },
|
|
14810
14951
|
"aria-hidden": true,
|
|
14811
|
-
children: /* @__PURE__ */ (0,
|
|
14812
|
-
|
|
14952
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14953
|
+
FrostedBeak,
|
|
14813
14954
|
{
|
|
14814
|
-
|
|
14815
|
-
|
|
14816
|
-
|
|
14817
|
-
|
|
14818
|
-
transformOrigin: "center center"
|
|
14819
|
-
},
|
|
14820
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
14821
|
-
"svg",
|
|
14822
|
-
{
|
|
14823
|
-
width: TOOLTIP_BEAK_W,
|
|
14824
|
-
height: TOOLTIP_BEAK_H,
|
|
14825
|
-
viewBox: "0 0 16 8",
|
|
14826
|
-
fill: "none",
|
|
14827
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
14828
|
-
style: { display: "block" },
|
|
14829
|
-
children: [
|
|
14830
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("polygon", { points: "8,0 0,8 16,8", fill: borderCol }),
|
|
14831
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("polygon", { points: "8,2 2,8 14,8", fill: bg })
|
|
14832
|
-
]
|
|
14833
|
-
}
|
|
14834
|
-
)
|
|
14955
|
+
width: TOOLTIP_BEAK_W,
|
|
14956
|
+
height: TOOLTIP_BEAK_H,
|
|
14957
|
+
rotateDeg: beakRot,
|
|
14958
|
+
borderColor: borderCol
|
|
14835
14959
|
}
|
|
14836
14960
|
)
|
|
14837
14961
|
}
|
|
14838
14962
|
),
|
|
14839
|
-
/* @__PURE__ */ (0,
|
|
14963
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14840
14964
|
"div",
|
|
14841
14965
|
{
|
|
14842
14966
|
id: tooltipId,
|
|
@@ -14860,7 +14984,7 @@ function Tooltip({
|
|
|
14860
14984
|
// src/components/Chart/Chart.tsx
|
|
14861
14985
|
var import_clsx107 = require("clsx");
|
|
14862
14986
|
var import_react58 = require("react");
|
|
14863
|
-
var
|
|
14987
|
+
var import_tokens36 = require("@refineui/tokens");
|
|
14864
14988
|
var import_color14 = require("@refineui/utilities/color");
|
|
14865
14989
|
|
|
14866
14990
|
// src/components/Chart/style.ts
|
|
@@ -14905,16 +15029,16 @@ var chartStyles = {
|
|
|
14905
15029
|
};
|
|
14906
15030
|
|
|
14907
15031
|
// src/components/Chart/utils.ts
|
|
14908
|
-
var
|
|
15032
|
+
var import_tokens35 = require("@refineui/tokens");
|
|
14909
15033
|
var CHART_VIEWBOX_WIDTH = 800;
|
|
14910
15034
|
var CHART_VIEWBOX_HEIGHT = 320;
|
|
14911
|
-
var CHART_PLOT_PADDING_TOP = parseFloat(
|
|
14912
|
-
var CHART_PLOT_PADDING_BOTTOM = parseFloat(
|
|
14913
|
-
var CHART_PLOT_PADDING_X = parseFloat(
|
|
14914
|
-
var CHART_BAR_RADIUS = parseFloat(
|
|
15035
|
+
var CHART_PLOT_PADDING_TOP = parseFloat(import_tokens35.spacings.sizeMedium);
|
|
15036
|
+
var CHART_PLOT_PADDING_BOTTOM = parseFloat(import_tokens35.spacings.sizeXXSmall);
|
|
15037
|
+
var CHART_PLOT_PADDING_X = parseFloat(import_tokens35.spacings.sizeMedium);
|
|
15038
|
+
var CHART_BAR_RADIUS = parseFloat(import_tokens35.borderRadii.roundedXLarge);
|
|
14915
15039
|
var CHART_BAR_BAND_FILL = 0.5;
|
|
14916
|
-
var CHART_POINT_RADIUS = parseFloat(
|
|
14917
|
-
var CHART_POINT_STROKE = parseFloat(
|
|
15040
|
+
var CHART_POINT_RADIUS = parseFloat(import_tokens35.foundationSizes.foundationSize40);
|
|
15041
|
+
var CHART_POINT_STROKE = parseFloat(import_tokens35.foundationSizes.foundationSize20);
|
|
14918
15042
|
var CHART_TOOLTIP_FLIP_X = 0.75;
|
|
14919
15043
|
var CHART_TOOLTIP_FLIP_Y = 0.25;
|
|
14920
15044
|
function clampValue(n) {
|
|
@@ -15086,7 +15210,7 @@ function formatAxisTick(value) {
|
|
|
15086
15210
|
}
|
|
15087
15211
|
|
|
15088
15212
|
// src/components/Chart/Chart.tsx
|
|
15089
|
-
var
|
|
15213
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
15090
15214
|
var ChartContext = (0, import_react58.createContext)(null);
|
|
15091
15215
|
function useChartContext(component) {
|
|
15092
15216
|
const value = (0, import_react58.useContext)(ChartContext);
|
|
@@ -15142,7 +15266,7 @@ function Chart({ className, children, ...props }) {
|
|
|
15142
15266
|
}),
|
|
15143
15267
|
[hoverIndex, selectedIndex, pointer, labels, series]
|
|
15144
15268
|
);
|
|
15145
|
-
return /* @__PURE__ */ (0,
|
|
15269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ChartContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15146
15270
|
"div",
|
|
15147
15271
|
{
|
|
15148
15272
|
"data-refineui": "chart",
|
|
@@ -15153,7 +15277,7 @@ function Chart({ className, children, ...props }) {
|
|
|
15153
15277
|
) });
|
|
15154
15278
|
}
|
|
15155
15279
|
function ChartBody({ className, ...props }) {
|
|
15156
|
-
return /* @__PURE__ */ (0,
|
|
15280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15157
15281
|
"div",
|
|
15158
15282
|
{
|
|
15159
15283
|
"data-refineui": "chart-body",
|
|
@@ -15163,7 +15287,7 @@ function ChartBody({ className, ...props }) {
|
|
|
15163
15287
|
);
|
|
15164
15288
|
}
|
|
15165
15289
|
function ChartContent({ className, ...props }) {
|
|
15166
|
-
return /* @__PURE__ */ (0,
|
|
15290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15167
15291
|
"div",
|
|
15168
15292
|
{
|
|
15169
15293
|
"data-refineui": "chart-content",
|
|
@@ -15188,7 +15312,7 @@ function ChartHitArea() {
|
|
|
15188
15312
|
setHoverIndex(hoverIndexFromPlotX(next.x, count, series.align));
|
|
15189
15313
|
return next;
|
|
15190
15314
|
};
|
|
15191
|
-
return /* @__PURE__ */ (0,
|
|
15315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15192
15316
|
"rect",
|
|
15193
15317
|
{
|
|
15194
15318
|
"data-refineui": "chart-hit-area",
|
|
@@ -15226,7 +15350,7 @@ function ChartPlot({
|
|
|
15226
15350
|
if (isChartTooltipElement(child)) tooltipNodes.push(child);
|
|
15227
15351
|
else svgChildren.push(child);
|
|
15228
15352
|
});
|
|
15229
|
-
return /* @__PURE__ */ (0,
|
|
15353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
15230
15354
|
"div",
|
|
15231
15355
|
{
|
|
15232
15356
|
"data-refineui": "chart-plot-frame",
|
|
@@ -15235,7 +15359,7 @@ function ChartPlot({
|
|
|
15235
15359
|
className: (0, import_clsx107.clsx)(chartStyles.plotFrame, className),
|
|
15236
15360
|
...props,
|
|
15237
15361
|
children: [
|
|
15238
|
-
/* @__PURE__ */ (0,
|
|
15362
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
15239
15363
|
"svg",
|
|
15240
15364
|
{
|
|
15241
15365
|
"data-refineui": "chart-plot",
|
|
@@ -15246,7 +15370,7 @@ function ChartPlot({
|
|
|
15246
15370
|
className: chartStyles.plot,
|
|
15247
15371
|
children: [
|
|
15248
15372
|
svgChildren,
|
|
15249
|
-
/* @__PURE__ */ (0,
|
|
15373
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ChartHitArea, {})
|
|
15250
15374
|
]
|
|
15251
15375
|
}
|
|
15252
15376
|
),
|
|
@@ -15264,7 +15388,7 @@ function ChartTooltip({ className, children, style, ...props }) {
|
|
|
15264
15388
|
const flipY = pointer.y < CHART_PLOT_PADDING_TOP + plotHeight() * CHART_TOOLTIP_FLIP_Y;
|
|
15265
15389
|
const offsetX = flipX ? "calc(-100% - var(--refineui-spacing-size-small))" : "var(--refineui-spacing-size-small)";
|
|
15266
15390
|
const offsetY = flipY ? "var(--refineui-spacing-size-small)" : "calc(-100% - var(--refineui-spacing-size-x-small))";
|
|
15267
|
-
return /* @__PURE__ */ (0,
|
|
15391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15268
15392
|
"div",
|
|
15269
15393
|
{
|
|
15270
15394
|
"data-refineui": "chart-tooltip",
|
|
@@ -15277,9 +15401,9 @@ function ChartTooltip({ className, children, style, ...props }) {
|
|
|
15277
15401
|
...style
|
|
15278
15402
|
},
|
|
15279
15403
|
...props,
|
|
15280
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
15281
|
-
label ? /* @__PURE__ */ (0,
|
|
15282
|
-
/* @__PURE__ */ (0,
|
|
15404
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
15405
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: chartStyles.tooltipLabel, children: label }) : null,
|
|
15406
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: chartStyles.tooltipValue, children: formatAxisTick(value) })
|
|
15283
15407
|
] })
|
|
15284
15408
|
}
|
|
15285
15409
|
);
|
|
@@ -15294,14 +15418,14 @@ function ChartYAxisLabels({
|
|
|
15294
15418
|
}) {
|
|
15295
15419
|
const scaleMax = resolveScale(values, max);
|
|
15296
15420
|
const ticks = yAxisTicks(scaleMax, lines).slice().reverse();
|
|
15297
|
-
return /* @__PURE__ */ (0,
|
|
15421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15298
15422
|
"div",
|
|
15299
15423
|
{
|
|
15300
15424
|
"data-refineui": "chart-y-axis",
|
|
15301
15425
|
className: (0, import_clsx107.clsx)(chartStyles.yAxis, className),
|
|
15302
15426
|
"aria-hidden": true,
|
|
15303
15427
|
...props,
|
|
15304
|
-
children: ticks.map((tick) => /* @__PURE__ */ (0,
|
|
15428
|
+
children: ticks.map((tick) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15305
15429
|
"span",
|
|
15306
15430
|
{
|
|
15307
15431
|
className: chartStyles.yAxisTick,
|
|
@@ -15324,12 +15448,12 @@ function ChartGrid({
|
|
|
15324
15448
|
const ticks = yAxisTicks(scaleMax, lines);
|
|
15325
15449
|
const gridColor = gridStroke();
|
|
15326
15450
|
const baselineColor = gridBaselineStroke();
|
|
15327
|
-
return /* @__PURE__ */ (0,
|
|
15451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("g", { "data-refineui": "chart-grid", className, ...props, children: ticks.map((tick, index) => {
|
|
15328
15452
|
const y = gridLineY(scaleMax, tick);
|
|
15329
15453
|
const isBaseline = index === 0;
|
|
15330
15454
|
const isTop = index === ticks.length - 1;
|
|
15331
15455
|
if (isTop) return null;
|
|
15332
|
-
return /* @__PURE__ */ (0,
|
|
15456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15333
15457
|
"line",
|
|
15334
15458
|
{
|
|
15335
15459
|
x1: CHART_PLOT_PADDING_X,
|
|
@@ -15338,7 +15462,7 @@ function ChartGrid({
|
|
|
15338
15462
|
y2: y,
|
|
15339
15463
|
stroke: isBaseline ? baselineColor : gridColor,
|
|
15340
15464
|
strokeWidth: "var(--refineui-stroke-width-thin)",
|
|
15341
|
-
strokeOpacity: isBaseline ?
|
|
15465
|
+
strokeOpacity: isBaseline ? import_tokens36.opacities.opacityFull : import_tokens36.opacities.opacityDisabled,
|
|
15342
15466
|
vectorEffect: "non-scaling-stroke"
|
|
15343
15467
|
},
|
|
15344
15468
|
tick
|
|
@@ -15364,10 +15488,10 @@ function ChartBars({
|
|
|
15364
15488
|
(0, import_react58.useLayoutEffect)(() => {
|
|
15365
15489
|
setSeries({ values, seriesColor, max, align: "bar" });
|
|
15366
15490
|
}, [values, seriesColor, max, setSeries]);
|
|
15367
|
-
return /* @__PURE__ */ (0,
|
|
15491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("g", { "data-refineui": "chart-bars", "data-series-color": seriesColor, className, ...props, children: [
|
|
15368
15492
|
showTrack ? values.map((_, index) => {
|
|
15369
15493
|
const x = barX(index, values.length);
|
|
15370
|
-
return /* @__PURE__ */ (0,
|
|
15494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15371
15495
|
"path",
|
|
15372
15496
|
{
|
|
15373
15497
|
"data-refineui": "chart-bar-track",
|
|
@@ -15389,7 +15513,7 @@ function ChartBars({
|
|
|
15389
15513
|
const height = baselineY - y;
|
|
15390
15514
|
if (height <= 0) return null;
|
|
15391
15515
|
const state = itemState(index, hoverIndex, selectedIndex);
|
|
15392
|
-
return /* @__PURE__ */ (0,
|
|
15516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15393
15517
|
"path",
|
|
15394
15518
|
{
|
|
15395
15519
|
"data-refineui": "chart-bar",
|
|
@@ -15422,20 +15546,20 @@ function ChartLine({
|
|
|
15422
15546
|
(0, import_react58.useLayoutEffect)(() => {
|
|
15423
15547
|
setSeries({ values, seriesColor, max, align: "line" });
|
|
15424
15548
|
}, [values, seriesColor, max, setSeries]);
|
|
15425
|
-
return /* @__PURE__ */ (0,
|
|
15426
|
-
showArea && coords.length > 1 ? /* @__PURE__ */ (0,
|
|
15427
|
-
/* @__PURE__ */ (0,
|
|
15428
|
-
/* @__PURE__ */ (0,
|
|
15549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("g", { "data-refineui": "chart-line", "data-series-color": seriesColor, className, ...props, children: [
|
|
15550
|
+
showArea && coords.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
15551
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
15552
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15429
15553
|
"stop",
|
|
15430
15554
|
{
|
|
15431
15555
|
offset: "0%",
|
|
15432
15556
|
stopColor: stroke,
|
|
15433
|
-
stopOpacity:
|
|
15557
|
+
stopOpacity: import_tokens36.opacities.opacityDisabled
|
|
15434
15558
|
}
|
|
15435
15559
|
),
|
|
15436
|
-
/* @__PURE__ */ (0,
|
|
15560
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("stop", { offset: "100%", stopColor: stroke, stopOpacity: "0" })
|
|
15437
15561
|
] }) }),
|
|
15438
|
-
/* @__PURE__ */ (0,
|
|
15562
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15439
15563
|
"path",
|
|
15440
15564
|
{
|
|
15441
15565
|
"data-refineui": "chart-line-area",
|
|
@@ -15444,7 +15568,7 @@ function ChartLine({
|
|
|
15444
15568
|
}
|
|
15445
15569
|
)
|
|
15446
15570
|
] }) : null,
|
|
15447
|
-
/* @__PURE__ */ (0,
|
|
15571
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15448
15572
|
"path",
|
|
15449
15573
|
{
|
|
15450
15574
|
"data-refineui": "chart-line-stroke",
|
|
@@ -15462,7 +15586,7 @@ function ChartLine({
|
|
|
15462
15586
|
const state = itemState(index, hoverIndex, selectedIndex);
|
|
15463
15587
|
const visible = showPoints || state !== "default";
|
|
15464
15588
|
if (!visible) return null;
|
|
15465
|
-
return /* @__PURE__ */ (0,
|
|
15589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15466
15590
|
"circle",
|
|
15467
15591
|
{
|
|
15468
15592
|
"data-refineui": "chart-point",
|
|
@@ -15491,7 +15615,7 @@ function ChartAxisLabels({
|
|
|
15491
15615
|
(0, import_react58.useLayoutEffect)(() => {
|
|
15492
15616
|
setLabels(labels);
|
|
15493
15617
|
}, [labels, setLabels]);
|
|
15494
|
-
return /* @__PURE__ */ (0,
|
|
15618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15495
15619
|
"div",
|
|
15496
15620
|
{
|
|
15497
15621
|
"data-refineui": "chart-axis-labels",
|
|
@@ -15500,7 +15624,7 @@ function ChartAxisLabels({
|
|
|
15500
15624
|
...props,
|
|
15501
15625
|
children: labels.map((label, index) => {
|
|
15502
15626
|
const state = itemState(index, hoverIndex, selectedIndex);
|
|
15503
|
-
return /* @__PURE__ */ (0,
|
|
15627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15504
15628
|
"span",
|
|
15505
15629
|
{
|
|
15506
15630
|
"data-state": state,
|
|
@@ -15518,7 +15642,7 @@ function ChartAxisLabels({
|
|
|
15518
15642
|
);
|
|
15519
15643
|
}
|
|
15520
15644
|
function ChartLegend({ className, ...props }) {
|
|
15521
|
-
return /* @__PURE__ */ (0,
|
|
15645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15522
15646
|
"ul",
|
|
15523
15647
|
{
|
|
15524
15648
|
"data-refineui": "chart-legend",
|
|
@@ -15534,7 +15658,7 @@ function ChartLegendItem({
|
|
|
15534
15658
|
style,
|
|
15535
15659
|
...props
|
|
15536
15660
|
}) {
|
|
15537
|
-
return /* @__PURE__ */ (0,
|
|
15661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
15538
15662
|
"li",
|
|
15539
15663
|
{
|
|
15540
15664
|
"data-refineui": "chart-legend-item",
|
|
@@ -15542,7 +15666,7 @@ function ChartLegendItem({
|
|
|
15542
15666
|
className: (0, import_clsx107.clsx)(chartStyles.legendItem, className),
|
|
15543
15667
|
...props,
|
|
15544
15668
|
children: [
|
|
15545
|
-
/* @__PURE__ */ (0,
|
|
15669
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15546
15670
|
"span",
|
|
15547
15671
|
{
|
|
15548
15672
|
"aria-hidden": true,
|
|
@@ -15566,7 +15690,7 @@ var import_react62 = require("@refineui/utilities/react");
|
|
|
15566
15690
|
|
|
15567
15691
|
// src/components/Collapsible/context.ts
|
|
15568
15692
|
var import_react60 = require("react");
|
|
15569
|
-
var
|
|
15693
|
+
var import_tokens37 = require("@refineui/tokens");
|
|
15570
15694
|
var import_animation9 = require("@refineui/utilities/animation");
|
|
15571
15695
|
var CollapsibleContext = (0, import_react60.createContext)(null);
|
|
15572
15696
|
function useCollapsibleContext(part) {
|
|
@@ -15585,10 +15709,10 @@ function usePrefersReducedMotion3() {
|
|
|
15585
15709
|
}, []);
|
|
15586
15710
|
return reduce;
|
|
15587
15711
|
}
|
|
15588
|
-
var PANEL_HEIGHT_MS2 = Number.parseFloat(
|
|
15589
|
-
var PANEL_CONTENT_MS2 = Number.parseFloat(
|
|
15590
|
-
var PANEL_HEIGHT_EASE2 =
|
|
15591
|
-
var PANEL_CONTENT_EASE2 =
|
|
15712
|
+
var PANEL_HEIGHT_MS2 = Number.parseFloat(import_tokens37.semanticInteraction.duration.panel) / 1e3;
|
|
15713
|
+
var PANEL_CONTENT_MS2 = Number.parseFloat(import_tokens37.semanticInteraction.duration.normal) / 1e3;
|
|
15714
|
+
var PANEL_HEIGHT_EASE2 = import_tokens37.semanticInteraction.easing.panel;
|
|
15715
|
+
var PANEL_CONTENT_EASE2 = import_tokens37.semanticInteraction.easing.content;
|
|
15592
15716
|
|
|
15593
15717
|
// src/components/Collapsible/style.ts
|
|
15594
15718
|
var collapsibleStyles = {
|
|
@@ -15596,7 +15720,7 @@ var collapsibleStyles = {
|
|
|
15596
15720
|
};
|
|
15597
15721
|
|
|
15598
15722
|
// src/components/Collapsible/Collapsible.tsx
|
|
15599
|
-
var
|
|
15723
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
15600
15724
|
var Collapsible = (0, import_react61.forwardRef)(function Collapsible2({ open: openProp, defaultOpen = false, onOpenChange, asChild = false, className, children, ...props }, ref) {
|
|
15601
15725
|
const [uncontrolled, setUncontrolled] = (0, import_react61.useState)(defaultOpen);
|
|
15602
15726
|
const open = openProp ?? uncontrolled;
|
|
@@ -15624,7 +15748,7 @@ var Collapsible = (0, import_react61.forwardRef)(function Collapsible2({ open: o
|
|
|
15624
15748
|
"data-refineui": "collapsible",
|
|
15625
15749
|
className
|
|
15626
15750
|
};
|
|
15627
|
-
return /* @__PURE__ */ (0,
|
|
15751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(CollapsibleContext.Provider, { value: contextValue, children: asChild ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react62.Slot, { ...shared, children }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { ...shared, children }) });
|
|
15628
15752
|
});
|
|
15629
15753
|
var CollapsibleTrigger = (0, import_react61.forwardRef)(
|
|
15630
15754
|
function CollapsibleTrigger2({
|
|
@@ -15653,8 +15777,8 @@ var CollapsibleTrigger = (0, import_react61.forwardRef)(
|
|
|
15653
15777
|
if (!event.defaultPrevented) toggle();
|
|
15654
15778
|
}
|
|
15655
15779
|
};
|
|
15656
|
-
if (asChild) return /* @__PURE__ */ (0,
|
|
15657
|
-
return /* @__PURE__ */ (0,
|
|
15780
|
+
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react62.Slot, { ...shared, children });
|
|
15781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
15658
15782
|
Button,
|
|
15659
15783
|
{
|
|
15660
15784
|
...shared,
|
|
@@ -15683,7 +15807,7 @@ var CollapsibleContent = (0, import_react61.forwardRef)(
|
|
|
15683
15807
|
pointerEvents: open ? void 0 : "none",
|
|
15684
15808
|
...style
|
|
15685
15809
|
};
|
|
15686
|
-
return /* @__PURE__ */ (0,
|
|
15810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
15687
15811
|
"div",
|
|
15688
15812
|
{
|
|
15689
15813
|
...props,
|
|
@@ -15695,7 +15819,7 @@ var CollapsibleContent = (0, import_react61.forwardRef)(
|
|
|
15695
15819
|
"data-state": open ? "open" : "closed",
|
|
15696
15820
|
"data-refineui": "collapsible-content",
|
|
15697
15821
|
style: gridStyle,
|
|
15698
|
-
children: /* @__PURE__ */ (0,
|
|
15822
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: collapsibleStyles.panelOuter, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: (0, import_clsx108.clsx)(className), style: innerMotionStyle, children }) })
|
|
15699
15823
|
}
|
|
15700
15824
|
);
|
|
15701
15825
|
}
|
|
@@ -15703,14 +15827,14 @@ var CollapsibleContent = (0, import_react61.forwardRef)(
|
|
|
15703
15827
|
|
|
15704
15828
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
15705
15829
|
var import_react63 = require("react");
|
|
15706
|
-
var
|
|
15830
|
+
var import_react_dom8 = require("react-dom");
|
|
15707
15831
|
var import_clsx109 = require("clsx");
|
|
15708
|
-
var
|
|
15832
|
+
var import_tokens38 = require("@refineui/tokens");
|
|
15709
15833
|
var import_animation10 = require("@refineui/utilities/animation");
|
|
15710
15834
|
var import_react64 = require("@refineui/utilities/react");
|
|
15711
|
-
var
|
|
15835
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
15712
15836
|
var MENU_ATTR = "data-refineui-context-menu";
|
|
15713
|
-
var CLOSE_MS = (0, import_animation10.motionMsToNumber)(
|
|
15837
|
+
var CLOSE_MS = (0, import_animation10.motionMsToNumber)(import_tokens38.semanticInteraction.duration.normal);
|
|
15714
15838
|
var MenuContext2 = (0, import_react63.createContext)(null);
|
|
15715
15839
|
var SubContext = (0, import_react63.createContext)(null);
|
|
15716
15840
|
function useMenu() {
|
|
@@ -15751,7 +15875,7 @@ function ContextMenu({ modal = true, onOpenChange, children }) {
|
|
|
15751
15875
|
if (!wasOpen) onOpenChangeRef.current?.(true);
|
|
15752
15876
|
}, []);
|
|
15753
15877
|
const value = (0, import_react63.useMemo)(() => ({ open, point, openAt, close }), [open, point, openAt, close]);
|
|
15754
|
-
return /* @__PURE__ */ (0,
|
|
15878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(MenuContext2.Provider, { value, children });
|
|
15755
15879
|
}
|
|
15756
15880
|
var ContextMenuTrigger = (0, import_react63.forwardRef)(function ContextMenuTrigger2({ asChild = false, onContextMenu, children, ...props }, ref) {
|
|
15757
15881
|
const { openAt } = useMenu();
|
|
@@ -15766,11 +15890,11 @@ var ContextMenuTrigger = (0, import_react63.forwardRef)(function ContextMenuTrig
|
|
|
15766
15890
|
openAt(event.clientX, event.clientY);
|
|
15767
15891
|
}
|
|
15768
15892
|
};
|
|
15769
|
-
if (asChild) return /* @__PURE__ */ (0,
|
|
15770
|
-
return /* @__PURE__ */ (0,
|
|
15893
|
+
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react64.Slot, { ...shared, children });
|
|
15894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { ...shared, className: (0, import_clsx109.clsx)(menuStyles.triggerFallback, props.className), children });
|
|
15771
15895
|
});
|
|
15772
15896
|
function ContextMenuPortal({ children }) {
|
|
15773
|
-
return /* @__PURE__ */ (0,
|
|
15897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_jsx_runtime81.Fragment, { children });
|
|
15774
15898
|
}
|
|
15775
15899
|
var ContextMenuContent = (0, import_react63.forwardRef)(function ContextMenuContent2({ className, style, onPointerDown, children, ...props }, ref) {
|
|
15776
15900
|
const { open, point, close } = useMenu();
|
|
@@ -15813,8 +15937,8 @@ var ContextMenuContent = (0, import_react63.forwardRef)(function ContextMenuCont
|
|
|
15813
15937
|
};
|
|
15814
15938
|
}, [open, close]);
|
|
15815
15939
|
if (!shouldRender || typeof document === "undefined") return null;
|
|
15816
|
-
return (0,
|
|
15817
|
-
/* @__PURE__ */ (0,
|
|
15940
|
+
return (0, import_react_dom8.createPortal)(
|
|
15941
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15818
15942
|
"div",
|
|
15819
15943
|
{
|
|
15820
15944
|
...props,
|
|
@@ -15831,8 +15955,8 @@ var ContextMenuContent = (0, import_react63.forwardRef)(function ContextMenuCont
|
|
|
15831
15955
|
position: "fixed",
|
|
15832
15956
|
top: point.y,
|
|
15833
15957
|
left: point.x,
|
|
15834
|
-
width:
|
|
15835
|
-
minWidth:
|
|
15958
|
+
width: import_tokens38.componentSizes.menuPanelWidth,
|
|
15959
|
+
minWidth: import_tokens38.componentSizes.menuPanelWidth,
|
|
15836
15960
|
zIndex: 9999,
|
|
15837
15961
|
...style
|
|
15838
15962
|
},
|
|
@@ -15841,7 +15965,7 @@ var ContextMenuContent = (0, import_react63.forwardRef)(function ContextMenuCont
|
|
|
15841
15965
|
onPointerDown?.(event);
|
|
15842
15966
|
},
|
|
15843
15967
|
onContextMenu: (event) => event.preventDefault(),
|
|
15844
|
-
children: /* @__PURE__ */ (0,
|
|
15968
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { role: "menu", "data-refineui": "menu", className: (0, import_clsx109.clsx)(menuStyles.list, className), children })
|
|
15845
15969
|
}
|
|
15846
15970
|
),
|
|
15847
15971
|
document.body
|
|
@@ -15862,7 +15986,7 @@ var ContextMenuItem = (0, import_react63.forwardRef)(function ContextMenuItem2({
|
|
|
15862
15986
|
const { close } = useMenu();
|
|
15863
15987
|
const isDisabled = disabled || state === "disabled";
|
|
15864
15988
|
const slotted = startIcon != null || description != null || shortcut != null || endIcon != null;
|
|
15865
|
-
return /* @__PURE__ */ (0,
|
|
15989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15866
15990
|
"button",
|
|
15867
15991
|
{
|
|
15868
15992
|
ref,
|
|
@@ -15888,37 +16012,37 @@ var ContextMenuItem = (0, import_react63.forwardRef)(function ContextMenuItem2({
|
|
|
15888
16012
|
runSelect(onSelect, close, isDisabled);
|
|
15889
16013
|
}
|
|
15890
16014
|
},
|
|
15891
|
-
children: slotted ? /* @__PURE__ */ (0,
|
|
15892
|
-
startIcon ? /* @__PURE__ */ (0,
|
|
16015
|
+
children: slotted ? /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("span", { className: menuStyles.row, children: [
|
|
16016
|
+
startIcon ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15893
16017
|
"span",
|
|
15894
16018
|
{
|
|
15895
16019
|
className: menuStyles.iconWrap,
|
|
15896
|
-
style: { width:
|
|
16020
|
+
style: { width: import_tokens38.iconSizes.small, minWidth: import_tokens38.iconSizes.small, height: import_tokens38.iconSizes.small },
|
|
15897
16021
|
children: startIcon
|
|
15898
16022
|
}
|
|
15899
16023
|
) : null,
|
|
15900
|
-
/* @__PURE__ */ (0,
|
|
15901
|
-
/* @__PURE__ */ (0,
|
|
15902
|
-
description ? /* @__PURE__ */ (0,
|
|
16024
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("span", { className: menuStyles.textCol, children: [
|
|
16025
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: menuStyles.title, children }),
|
|
16026
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: (0, import_clsx109.clsx)(menuStyles.description, isDisabled ? menuStyles.descriptionDisabled : menuStyles.descriptionEnabled), children: description }) : null
|
|
15903
16027
|
] }),
|
|
15904
|
-
(shortcut || endIcon) && /* @__PURE__ */ (0,
|
|
15905
|
-
shortcut ? /* @__PURE__ */ (0,
|
|
15906
|
-
endIcon ? /* @__PURE__ */ (0,
|
|
16028
|
+
(shortcut || endIcon) && /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("span", { className: menuStyles.rightWrap, children: [
|
|
16029
|
+
shortcut ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: menuStyles.shortcut, children: shortcut }) : null,
|
|
16030
|
+
endIcon ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15907
16031
|
"span",
|
|
15908
16032
|
{
|
|
15909
16033
|
className: menuStyles.iconWrap,
|
|
15910
|
-
style: { width:
|
|
16034
|
+
style: { width: import_tokens38.iconSizes.small, minWidth: import_tokens38.iconSizes.small, height: import_tokens38.iconSizes.small },
|
|
15911
16035
|
children: endIcon
|
|
15912
16036
|
}
|
|
15913
16037
|
) : null
|
|
15914
16038
|
] })
|
|
15915
|
-
] }) : /* @__PURE__ */ (0,
|
|
16039
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: menuStyles.row, children })
|
|
15916
16040
|
}
|
|
15917
16041
|
);
|
|
15918
16042
|
});
|
|
15919
16043
|
var ContextMenuSeparator = (0, import_react63.forwardRef)(
|
|
15920
16044
|
function ContextMenuSeparator2({ className, ...props }, ref) {
|
|
15921
|
-
return /* @__PURE__ */ (0,
|
|
16045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
15922
16046
|
"div",
|
|
15923
16047
|
{
|
|
15924
16048
|
ref,
|
|
@@ -15928,13 +16052,13 @@ var ContextMenuSeparator = (0, import_react63.forwardRef)(
|
|
|
15928
16052
|
...{ [MENU_ATTR]: "" },
|
|
15929
16053
|
className: (0, import_clsx109.clsx)(menuStyles.dividerWrap, className),
|
|
15930
16054
|
...props,
|
|
15931
|
-
children: /* @__PURE__ */ (0,
|
|
16055
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: menuStyles.dividerLine })
|
|
15932
16056
|
}
|
|
15933
16057
|
);
|
|
15934
16058
|
}
|
|
15935
16059
|
);
|
|
15936
16060
|
function ContextMenuLabel({ className, children, ...props }) {
|
|
15937
|
-
return /* @__PURE__ */ (0,
|
|
16061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { "data-refineui": "menu-label", className: (0, import_clsx109.clsx)(menuStyles.section, className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: menuStyles.sectionText, children }) });
|
|
15938
16062
|
}
|
|
15939
16063
|
function ContextMenuSub({ children }) {
|
|
15940
16064
|
const [open, setOpen] = (0, import_react63.useState)(false);
|
|
@@ -15960,7 +16084,7 @@ function ContextMenuSub({ children }) {
|
|
|
15960
16084
|
}),
|
|
15961
16085
|
[open]
|
|
15962
16086
|
);
|
|
15963
|
-
return /* @__PURE__ */ (0,
|
|
16087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(SubContext.Provider, { value, children });
|
|
15964
16088
|
}
|
|
15965
16089
|
function useSub2() {
|
|
15966
16090
|
const value = (0, import_react63.useContext)(SubContext);
|
|
@@ -16003,26 +16127,26 @@ var ContextMenuSubTrigger = (0, import_react63.forwardRef)(
|
|
|
16003
16127
|
if (!event.defaultPrevented) sub.show();
|
|
16004
16128
|
}
|
|
16005
16129
|
};
|
|
16006
|
-
if (asChild) return /* @__PURE__ */ (0,
|
|
16007
|
-
return /* @__PURE__ */ (0,
|
|
16008
|
-
startIcon ? /* @__PURE__ */ (0,
|
|
16130
|
+
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react64.Slot, { ...shared, children });
|
|
16131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("button", { ...shared, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("span", { className: menuStyles.row, children: [
|
|
16132
|
+
startIcon ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16009
16133
|
"span",
|
|
16010
16134
|
{
|
|
16011
16135
|
className: menuStyles.iconWrap,
|
|
16012
|
-
style: { width:
|
|
16136
|
+
style: { width: import_tokens38.iconSizes.small, minWidth: import_tokens38.iconSizes.small, height: import_tokens38.iconSizes.small },
|
|
16013
16137
|
children: startIcon
|
|
16014
16138
|
}
|
|
16015
16139
|
) : null,
|
|
16016
|
-
/* @__PURE__ */ (0,
|
|
16017
|
-
/* @__PURE__ */ (0,
|
|
16018
|
-
description ? /* @__PURE__ */ (0,
|
|
16140
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("span", { className: menuStyles.textCol, children: [
|
|
16141
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: menuStyles.title, children }),
|
|
16142
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: (0, import_clsx109.clsx)(menuStyles.description, menuStyles.descriptionEnabled), children: description }) : null
|
|
16019
16143
|
] }),
|
|
16020
|
-
/* @__PURE__ */ (0,
|
|
16144
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: menuStyles.rightWrap, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16021
16145
|
"span",
|
|
16022
16146
|
{
|
|
16023
16147
|
className: menuStyles.iconWrap,
|
|
16024
|
-
style: { width:
|
|
16025
|
-
children: /* @__PURE__ */ (0,
|
|
16148
|
+
style: { width: import_tokens38.iconSizes.small, minWidth: import_tokens38.iconSizes.small, height: import_tokens38.iconSizes.small },
|
|
16149
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WebIcon, { name: "chevron-right", size: import_tokens38.iconSizes.small, color: "currentColor", "aria-hidden": true })
|
|
16026
16150
|
}
|
|
16027
16151
|
) })
|
|
16028
16152
|
] }) });
|
|
@@ -16050,8 +16174,8 @@ var ContextMenuSubContent = (0, import_react63.forwardRef)(
|
|
|
16050
16174
|
placeInView(element, left, rect.top);
|
|
16051
16175
|
}, [sub.open, sub.triggerRef]);
|
|
16052
16176
|
if (!sub.open || typeof document === "undefined") return null;
|
|
16053
|
-
return (0,
|
|
16054
|
-
/* @__PURE__ */ (0,
|
|
16177
|
+
return (0, import_react_dom8.createPortal)(
|
|
16178
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16055
16179
|
"div",
|
|
16056
16180
|
{
|
|
16057
16181
|
...props,
|