@refineui/react 0.0.9 → 0.0.11
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 +693 -490
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -25
- package/dist/index.d.ts +36 -25
- package/dist/index.js +641 -433
- package/dist/index.js.map +1 -1
- package/dist/spec/components/sidebar.json +3 -1
- package/dist/spec/contract-index.json +1 -1
- package/dist/spec/token-graph.json +73 -111
- package/dist/spec/token-trace-v2.json +35 -62
- package/package.json +1 -1
- package/refineui.css +36 -15
- package/spec/components/sidebar.json +3 -1
package/dist/index.js
CHANGED
|
@@ -35,14 +35,13 @@ var componentColorTokens = {
|
|
|
35
35
|
states: buttonPrimaryColorTokens.states
|
|
36
36
|
},
|
|
37
37
|
secondary: {
|
|
38
|
-
background: semanticToken("
|
|
38
|
+
background: semanticToken("backgroundSurfaceHover"),
|
|
39
39
|
foreground: semanticToken("foregroundPrimary"),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
hoverBorder: semanticToken("borderStrong"),
|
|
40
|
+
hoverBackground: semanticToken("backgroundSurfaceActive"),
|
|
41
|
+
hoverForeground: semanticToken("foregroundPrimaryHover"),
|
|
43
42
|
activeBackground: semanticToken("backgroundSurfaceActive"),
|
|
43
|
+
activeForeground: semanticToken("foregroundPrimary"),
|
|
44
44
|
disabledBackground: semanticToken("backgroundSurfaceDisabled"),
|
|
45
|
-
disabledBorder: semanticToken("borderDisabled"),
|
|
46
45
|
disabledForeground: semanticToken("foregroundDisabled")
|
|
47
46
|
},
|
|
48
47
|
outline: {
|
|
@@ -141,16 +140,16 @@ var componentColorTokens = {
|
|
|
141
140
|
},
|
|
142
141
|
tooltip: {
|
|
143
142
|
default: {
|
|
144
|
-
/**
|
|
145
|
-
background: semanticToken("
|
|
143
|
+
/** Frosted floating panel — blur is applied by refineui.css */
|
|
144
|
+
background: semanticToken("surfaceFrosted"),
|
|
146
145
|
foreground: semanticToken("foregroundPrimary"),
|
|
147
146
|
border: semanticToken("borderDefault")
|
|
148
147
|
}
|
|
149
148
|
},
|
|
150
149
|
popover: {
|
|
151
150
|
default: {
|
|
152
|
-
/**
|
|
153
|
-
background: semanticToken("
|
|
151
|
+
/** Frosted floating panel — blur is applied by refineui.css */
|
|
152
|
+
background: semanticToken("surfaceFrosted"),
|
|
154
153
|
foreground: semanticToken("foregroundPrimary"),
|
|
155
154
|
border: semanticToken("borderDefault")
|
|
156
155
|
},
|
|
@@ -1198,7 +1197,7 @@ function resolveSlotClasses(recipe, slot, variants = {}) {
|
|
|
1198
1197
|
// src/recipes/button.recipe.ts
|
|
1199
1198
|
var buttonVariantClass = {
|
|
1200
1199
|
primary: "border-refineui-none border border-transparent bg-refineui-alias-background-brand text-refineui-alias-foreground-inversed",
|
|
1201
|
-
secondary: "border-refineui-
|
|
1200
|
+
secondary: "border-refineui-none border border-transparent bg-refineui-alias-background-surface-hover text-refineui-alias-foreground-primary",
|
|
1202
1201
|
outline: "border-refineui-thin border-refineui-alias-border-default bg-transparent text-refineui-alias-foreground-primary",
|
|
1203
1202
|
ghost: "border-refineui-none border border-transparent bg-transparent text-refineui-alias-foreground-primary"
|
|
1204
1203
|
};
|
|
@@ -1236,6 +1235,10 @@ var buttonRecipe = defineRecipe({
|
|
|
1236
1235
|
match: { layout: "icon", variant: "primary" },
|
|
1237
1236
|
className: "border-0"
|
|
1238
1237
|
},
|
|
1238
|
+
{
|
|
1239
|
+
match: { layout: "icon", variant: "secondary" },
|
|
1240
|
+
className: "border-0"
|
|
1241
|
+
},
|
|
1239
1242
|
{
|
|
1240
1243
|
match: { layout: "icon", variant: "ghost" },
|
|
1241
1244
|
className: "border-0"
|
|
@@ -1270,7 +1273,7 @@ var Button = forwardRef(function Button2({
|
|
|
1270
1273
|
const inactive = Boolean(disabled) || ariaDisabledProp === true || ariaDisabledProp === "true";
|
|
1271
1274
|
const variantStyles = variant === "ghost" && layout === "icon" ? buttonStyles.iconGhost : buttonVariantClass[variant];
|
|
1272
1275
|
const sizeStyles = layout === "icon" ? buttonIconSizeClass[size] : buttonLabelSizeClass[size];
|
|
1273
|
-
const iconNoStroke = layout === "icon" && (variant === "primary" || variant === "ghost") ? "border-0" : null;
|
|
1276
|
+
const iconNoStroke = layout === "icon" && (variant === "primary" || variant === "secondary" || variant === "ghost") ? "border-0" : null;
|
|
1274
1277
|
return /* @__PURE__ */ jsx2(
|
|
1275
1278
|
"button",
|
|
1276
1279
|
{
|
|
@@ -9515,8 +9518,12 @@ var menuStyles = {
|
|
|
9515
9518
|
row: "flex items-center gap-refineui-size-x-small",
|
|
9516
9519
|
iconWrap: "inline-flex shrink-0 items-center justify-center text-current [&>span]:leading-none",
|
|
9517
9520
|
textCol: "flex min-w-0 flex-1 flex-col gap-refineui-size-xxx-small px-refineui-size-xxx-small",
|
|
9518
|
-
|
|
9519
|
-
|
|
9521
|
+
/** Preserve labels and supporting copy by wrapping within the shared panel width. */
|
|
9522
|
+
title: clsx75(componentTextClass(componentTypographyTokens.menu.item), "break-words whitespace-normal"),
|
|
9523
|
+
description: clsx75(
|
|
9524
|
+
componentTextClass(componentTypographyTokens.menu.description),
|
|
9525
|
+
"break-words whitespace-normal"
|
|
9526
|
+
),
|
|
9520
9527
|
descriptionEnabled: "text-refineui-alias-foreground-tertiary",
|
|
9521
9528
|
descriptionDisabled: "text-refineui-alias-foreground-disabled",
|
|
9522
9529
|
rightWrap: "flex shrink-0 items-center gap-refineui-size-x-small",
|
|
@@ -9989,7 +9996,7 @@ function MenuSubContent({ className, children, style, ...props }) {
|
|
|
9989
9996
|
const [side, setSide] = useState17("right");
|
|
9990
9997
|
const gapPx = parseCssPx(spacings3.sizeXXXSmall, 2);
|
|
9991
9998
|
const z = (Number.parseInt(String(zIndex2.zIndexMessages), 10) || 1e4) + 100;
|
|
9992
|
-
const defaultW = parseCssPx(componentSizes2.menuPanelWidth,
|
|
9999
|
+
const defaultW = parseCssPx(componentSizes2.menuPanelWidth, 200);
|
|
9993
10000
|
const setPanelEl = useCallback13(
|
|
9994
10001
|
(el) => {
|
|
9995
10002
|
panelRef.current = el;
|
|
@@ -10097,7 +10104,8 @@ import {
|
|
|
10097
10104
|
useRef as useRef15,
|
|
10098
10105
|
useState as useState18
|
|
10099
10106
|
} from "react";
|
|
10100
|
-
import {
|
|
10107
|
+
import { createPortal as createPortal6 } from "react-dom";
|
|
10108
|
+
import { iconSizes as iconSizes16, semanticInteraction as semanticInteraction6, spacings as spacings4, zIndex as zIndex3 } from "@refineui/tokens";
|
|
10101
10109
|
import { motionMsToNumber as motionMsToNumber4 } from "@refineui/utilities/animation";
|
|
10102
10110
|
|
|
10103
10111
|
// src/components/NavigationMenu/style.ts
|
|
@@ -10105,34 +10113,34 @@ import { clsx as clsx77 } from "clsx";
|
|
|
10105
10113
|
var topLevelItem = clsx77(
|
|
10106
10114
|
componentTextClass(componentTypographyTokens.navigationMenu.trigger),
|
|
10107
10115
|
"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",
|
|
10108
|
-
"rounded-refineui-large border-none bg-transparent px-refineui-size-medium py-refineui-size-x-small",
|
|
10116
|
+
"rounded-refineui-x-large border-none bg-transparent px-refineui-size-medium py-refineui-size-x-small",
|
|
10109
10117
|
"text-refineui-alias-foreground-tertiary outline-none leading-none",
|
|
10110
|
-
"transition-[color,background-color] duration-[var(--refineui-motion-duration-fast)]"
|
|
10118
|
+
"transition-[color,background-color,box-shadow] duration-[var(--refineui-motion-duration-fast)] ease-[var(--refineui-motion-easing-ease-out)]"
|
|
10111
10119
|
);
|
|
10112
10120
|
var chevron = clsx77(
|
|
10113
10121
|
"shrink-0 transition-transform duration-[var(--refineui-motion-duration-fast)] ease-[var(--refineui-motion-easing-ease-out)]"
|
|
10114
10122
|
);
|
|
10115
10123
|
var navigationMenuStyles = {
|
|
10116
10124
|
root: "relative isolate z-refineui-messages flex w-full max-w-max items-center",
|
|
10117
|
-
list: "relative m-0 flex list-none flex-wrap items-center gap-refineui-size-
|
|
10125
|
+
list: "relative m-0 flex list-none flex-wrap items-center gap-refineui-size-xxx-small p-0",
|
|
10118
10126
|
item: "relative inline-flex items-center",
|
|
10119
10127
|
trigger: clsx77(topLevelItem, "m-0 appearance-none font-inherit"),
|
|
10120
|
-
triggerOpen: "text-refineui-alias-foreground-primary",
|
|
10128
|
+
triggerOpen: "bg-refineui-alias-background-primary-hover text-refineui-alias-foreground-primary",
|
|
10121
10129
|
triggerDisabled: "cursor-not-allowed text-refineui-alias-foreground-disabled",
|
|
10122
10130
|
chevron,
|
|
10123
10131
|
chevronOpen: "rotate-180",
|
|
10124
10132
|
content: clsx77(
|
|
10125
10133
|
/** Flush under trigger so pointer does not leave the item while moving into the panel. */
|
|
10126
10134
|
"absolute start-0 top-full z-refineui-messages pt-refineui-size-xx-small",
|
|
10127
|
-
"box-border min-w-refineui-menu-panel-width",
|
|
10135
|
+
"box-border min-w-refineui-navigation-menu-panel-width",
|
|
10128
10136
|
"outline-none"
|
|
10129
10137
|
),
|
|
10130
10138
|
contentPanel: clsx77(
|
|
10131
|
-
"box-border overflow-hidden rounded-refineui-large border-refineui-hairline border-refineui-alias-border-default",
|
|
10132
|
-
"
|
|
10139
|
+
"box-border flex flex-col gap-px overflow-hidden rounded-refineui-xx-large border-refineui-hairline border-refineui-alias-border-default",
|
|
10140
|
+
"p-refineui-size-xx-small shadow-refineui-2"
|
|
10133
10141
|
),
|
|
10134
10142
|
link: clsx77(topLevelItem, "no-underline"),
|
|
10135
|
-
linkActive: "text-refineui-alias-foreground-primary",
|
|
10143
|
+
linkActive: "bg-refineui-alias-background-primary-hover text-refineui-alias-foreground-primary",
|
|
10136
10144
|
linkDisabled: "cursor-not-allowed text-refineui-alias-foreground-disabled",
|
|
10137
10145
|
/** Dense row inside a content panel — same density as Menu item. */
|
|
10138
10146
|
linkInContent: clsx77(
|
|
@@ -10140,7 +10148,7 @@ var navigationMenuStyles = {
|
|
|
10140
10148
|
"box-border flex w-full cursor-pointer items-center gap-refineui-size-x-small",
|
|
10141
10149
|
"rounded-refineui-large border-none bg-transparent p-refineui-size-x-small text-start no-underline outline-none",
|
|
10142
10150
|
"text-refineui-alias-foreground-primary",
|
|
10143
|
-
"transition-[background-color,color] duration-[var(--refineui-motion-duration-fast)]"
|
|
10151
|
+
"transition-[background-color,color] duration-[var(--refineui-motion-duration-fast)] ease-[var(--refineui-motion-easing-ease-out)]"
|
|
10144
10152
|
),
|
|
10145
10153
|
/** Optional — prefer omitting; kept for API compatibility. */
|
|
10146
10154
|
indicator: "hidden"
|
|
@@ -10192,6 +10200,7 @@ function NavigationMenu({
|
|
|
10192
10200
|
const [value, setValue] = useControllableOpen(valueControlled, defaultValue, onValueChange);
|
|
10193
10201
|
const listRef = useRef15(null);
|
|
10194
10202
|
const triggerMapRef = useRef15(/* @__PURE__ */ new Map());
|
|
10203
|
+
const contentMapRef = useRef15(/* @__PURE__ */ new Map());
|
|
10195
10204
|
const openTimerRef = useRef15(null);
|
|
10196
10205
|
const closeTimerRef = useRef15(null);
|
|
10197
10206
|
const rootRef = useRef15(null);
|
|
@@ -10250,12 +10259,25 @@ function NavigationMenu({
|
|
|
10250
10259
|
triggerMapRef.current.delete(itemValue);
|
|
10251
10260
|
}
|
|
10252
10261
|
}, []);
|
|
10262
|
+
const registerContent = useCallback14((itemValue, el) => {
|
|
10263
|
+
if (el) {
|
|
10264
|
+
contentMapRef.current.set(itemValue, el);
|
|
10265
|
+
} else {
|
|
10266
|
+
contentMapRef.current.delete(itemValue);
|
|
10267
|
+
}
|
|
10268
|
+
}, []);
|
|
10269
|
+
const isContentTarget = useCallback14((itemValue, target) => {
|
|
10270
|
+
return target instanceof Node && contentMapRef.current.get(itemValue)?.contains(target) === true;
|
|
10271
|
+
}, []);
|
|
10272
|
+
const isMenuTarget = useCallback14((target) => {
|
|
10273
|
+
if (!(target instanceof Node)) return false;
|
|
10274
|
+
return rootRef.current?.contains(target) === true || Array.from(contentMapRef.current.values()).some((content) => content.contains(target));
|
|
10275
|
+
}, []);
|
|
10253
10276
|
useEffect13(() => () => clearTimers(), [clearTimers]);
|
|
10254
10277
|
useEffect13(() => {
|
|
10255
10278
|
if (!value) return;
|
|
10256
10279
|
const onPointerDown = (event) => {
|
|
10257
|
-
|
|
10258
|
-
if (rootRef.current?.contains(target)) return;
|
|
10280
|
+
if (isMenuTarget(event.target)) return;
|
|
10259
10281
|
setValueSafe("");
|
|
10260
10282
|
};
|
|
10261
10283
|
const onKeyDown = (event) => {
|
|
@@ -10271,7 +10293,7 @@ function NavigationMenu({
|
|
|
10271
10293
|
document.removeEventListener("pointerdown", onPointerDown);
|
|
10272
10294
|
document.removeEventListener("keydown", onKeyDown);
|
|
10273
10295
|
};
|
|
10274
|
-
}, [setValueSafe, value]);
|
|
10296
|
+
}, [isMenuTarget, setValueSafe, value]);
|
|
10275
10297
|
const ctx = useMemo14(
|
|
10276
10298
|
() => ({
|
|
10277
10299
|
value,
|
|
@@ -10282,9 +10304,23 @@ function NavigationMenu({
|
|
|
10282
10304
|
skipDelayDuration,
|
|
10283
10305
|
listRef,
|
|
10284
10306
|
registerTrigger,
|
|
10307
|
+
registerContent,
|
|
10308
|
+
isContentTarget,
|
|
10309
|
+
isMenuTarget,
|
|
10285
10310
|
isInsideContent: false
|
|
10286
10311
|
}),
|
|
10287
|
-
[
|
|
10312
|
+
[
|
|
10313
|
+
close,
|
|
10314
|
+
delayDuration,
|
|
10315
|
+
isContentTarget,
|
|
10316
|
+
isMenuTarget,
|
|
10317
|
+
openItem,
|
|
10318
|
+
registerContent,
|
|
10319
|
+
registerTrigger,
|
|
10320
|
+
setValueSafe,
|
|
10321
|
+
skipDelayDuration,
|
|
10322
|
+
value
|
|
10323
|
+
]
|
|
10288
10324
|
);
|
|
10289
10325
|
return /* @__PURE__ */ jsx59(NavigationMenuContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx59(
|
|
10290
10326
|
"nav",
|
|
@@ -10373,6 +10409,7 @@ function NavigationMenuItem({
|
|
|
10373
10409
|
onPointerLeave: (event) => {
|
|
10374
10410
|
onPointerLeave?.(event);
|
|
10375
10411
|
if (event.defaultPrevented) return;
|
|
10412
|
+
if (menu.isContentTarget(value, event.relatedTarget)) return;
|
|
10376
10413
|
menu.close();
|
|
10377
10414
|
},
|
|
10378
10415
|
...props,
|
|
@@ -10461,12 +10498,22 @@ function NavigationMenuContent({
|
|
|
10461
10498
|
children,
|
|
10462
10499
|
className,
|
|
10463
10500
|
onKeyDown,
|
|
10501
|
+
style,
|
|
10464
10502
|
...props
|
|
10465
10503
|
}) {
|
|
10466
10504
|
const menu = useNavigationMenu("NavigationMenuContent");
|
|
10467
10505
|
const item = useNavigationMenuItem("NavigationMenuContent");
|
|
10468
10506
|
const [shouldRender, setShouldRender] = useState18(item.open);
|
|
10469
10507
|
const [isClosing, setIsClosing] = useState18(false);
|
|
10508
|
+
const contentRef = useRef15(null);
|
|
10509
|
+
const [positionStyle, setPositionStyle] = useState18(null);
|
|
10510
|
+
const setContentRef = useCallback14(
|
|
10511
|
+
(el) => {
|
|
10512
|
+
contentRef.current = el;
|
|
10513
|
+
menu.registerContent(item.value, el);
|
|
10514
|
+
},
|
|
10515
|
+
[item.value, menu]
|
|
10516
|
+
);
|
|
10470
10517
|
useEffect13(() => {
|
|
10471
10518
|
if (item.open) {
|
|
10472
10519
|
setShouldRender(true);
|
|
@@ -10481,20 +10528,58 @@ function NavigationMenuContent({
|
|
|
10481
10528
|
}, motionMsToNumber4(semanticInteraction6.duration.fast));
|
|
10482
10529
|
return () => window.clearTimeout(timeout);
|
|
10483
10530
|
}, [item.open, shouldRender]);
|
|
10531
|
+
useIsomorphicLayoutEffect5(() => {
|
|
10532
|
+
if (!shouldRender || !item.open || typeof document === "undefined") return;
|
|
10533
|
+
const trigger = document.getElementById(item.triggerId);
|
|
10534
|
+
if (!trigger) return;
|
|
10535
|
+
const updatePosition = () => {
|
|
10536
|
+
const content2 = contentRef.current;
|
|
10537
|
+
if (!content2) return;
|
|
10538
|
+
const triggerRect = trigger.getBoundingClientRect();
|
|
10539
|
+
const contentWidth = content2.offsetWidth;
|
|
10540
|
+
const edge = Number.parseFloat(spacings4.sizeMedium) || 8;
|
|
10541
|
+
const left = Math.max(
|
|
10542
|
+
edge,
|
|
10543
|
+
Math.min(triggerRect.left, window.innerWidth - contentWidth - edge)
|
|
10544
|
+
);
|
|
10545
|
+
setPositionStyle({
|
|
10546
|
+
position: "fixed",
|
|
10547
|
+
top: triggerRect.bottom,
|
|
10548
|
+
left,
|
|
10549
|
+
zIndex: Number.parseInt(String(zIndex3.zIndexMessages), 10) || 1e4
|
|
10550
|
+
});
|
|
10551
|
+
};
|
|
10552
|
+
updatePosition();
|
|
10553
|
+
const frame = requestAnimationFrame(updatePosition);
|
|
10554
|
+
window.addEventListener("resize", updatePosition);
|
|
10555
|
+
const unsubscribe = subscribeScrollAndScrollableAncestors2(trigger, updatePosition);
|
|
10556
|
+
return () => {
|
|
10557
|
+
cancelAnimationFrame(frame);
|
|
10558
|
+
window.removeEventListener("resize", updatePosition);
|
|
10559
|
+
unsubscribe();
|
|
10560
|
+
};
|
|
10561
|
+
}, [item.open, item.triggerId, shouldRender]);
|
|
10484
10562
|
const contentCtx = useMemo14(
|
|
10485
10563
|
() => ({ ...menu, isInsideContent: true }),
|
|
10486
10564
|
[menu]
|
|
10487
10565
|
);
|
|
10488
10566
|
if (!shouldRender) return null;
|
|
10489
|
-
|
|
10567
|
+
const content = /* @__PURE__ */ jsx59(NavigationMenuContext.Provider, { value: contentCtx, children: /* @__PURE__ */ jsx59(
|
|
10490
10568
|
"div",
|
|
10491
10569
|
{
|
|
10570
|
+
ref: setContentRef,
|
|
10492
10571
|
id: item.contentId,
|
|
10493
10572
|
role: "region",
|
|
10494
10573
|
"aria-labelledby": item.triggerId,
|
|
10495
10574
|
"data-refineui": "navigation-menu-content",
|
|
10496
10575
|
"data-state": isClosing || !item.open ? "closed" : "open",
|
|
10497
10576
|
className: clsx78(navigationMenuStyles.content, className),
|
|
10577
|
+
style: { ...positionStyle, ...style },
|
|
10578
|
+
onPointerEnter: () => menu.openItem(item.value, { immediate: true }),
|
|
10579
|
+
onPointerLeave: (event) => {
|
|
10580
|
+
if (menu.isMenuTarget(event.relatedTarget)) return;
|
|
10581
|
+
menu.close();
|
|
10582
|
+
},
|
|
10498
10583
|
onKeyDown: (event) => {
|
|
10499
10584
|
onKeyDown?.(event);
|
|
10500
10585
|
if (event.defaultPrevented) return;
|
|
@@ -10507,6 +10592,7 @@ function NavigationMenuContent({
|
|
|
10507
10592
|
children: /* @__PURE__ */ jsx59("div", { "data-refineui": "navigation-menu-content-panel", className: navigationMenuStyles.contentPanel, children })
|
|
10508
10593
|
}
|
|
10509
10594
|
) });
|
|
10595
|
+
return typeof document === "undefined" ? content : createPortal6(content, document.body);
|
|
10510
10596
|
}
|
|
10511
10597
|
function NavigationMenuLink({
|
|
10512
10598
|
children,
|
|
@@ -11041,6 +11127,89 @@ function useSidebarPeek() {
|
|
|
11041
11127
|
return useSidebarPeekContext("useSidebarPeek");
|
|
11042
11128
|
}
|
|
11043
11129
|
|
|
11130
|
+
// src/components/Sidebar/SidebarProvider.tsx
|
|
11131
|
+
import {
|
|
11132
|
+
createContext as createContext20,
|
|
11133
|
+
forwardRef as forwardRef14,
|
|
11134
|
+
useCallback as useCallback16,
|
|
11135
|
+
useContext as useContext22,
|
|
11136
|
+
useId as useId13,
|
|
11137
|
+
useMemo as useMemo16,
|
|
11138
|
+
useState as useState20
|
|
11139
|
+
} from "react";
|
|
11140
|
+
import { Slot as Slot3 } from "@refineui/utilities/react";
|
|
11141
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
11142
|
+
var SidebarContext = createContext20(null);
|
|
11143
|
+
function useSidebarContext(component) {
|
|
11144
|
+
const value = useContext22(SidebarContext);
|
|
11145
|
+
if (!value) throw new Error(`${component} must be used within <SidebarProvider>.`);
|
|
11146
|
+
return value;
|
|
11147
|
+
}
|
|
11148
|
+
function useSidebar() {
|
|
11149
|
+
return useSidebarContext("useSidebar");
|
|
11150
|
+
}
|
|
11151
|
+
function SidebarProvider({
|
|
11152
|
+
open: openProp,
|
|
11153
|
+
defaultOpen = true,
|
|
11154
|
+
onOpenChange,
|
|
11155
|
+
id,
|
|
11156
|
+
children
|
|
11157
|
+
}) {
|
|
11158
|
+
const [uncontrolled, setUncontrolled] = useState20(defaultOpen);
|
|
11159
|
+
const open = openProp ?? uncontrolled;
|
|
11160
|
+
const generatedId = useId13();
|
|
11161
|
+
const sidebarId = id ?? generatedId;
|
|
11162
|
+
const toggle = useCallback16(() => {
|
|
11163
|
+
const next = !open;
|
|
11164
|
+
if (openProp === void 0) setUncontrolled(next);
|
|
11165
|
+
onOpenChange?.(next);
|
|
11166
|
+
}, [onOpenChange, open, openProp]);
|
|
11167
|
+
const value = useMemo16(
|
|
11168
|
+
() => ({ open, sidebarId, toggle }),
|
|
11169
|
+
[open, sidebarId, toggle]
|
|
11170
|
+
);
|
|
11171
|
+
return /* @__PURE__ */ jsx62(SidebarContext.Provider, { value, children });
|
|
11172
|
+
}
|
|
11173
|
+
var SidebarTrigger = forwardRef14(function SidebarTrigger2({
|
|
11174
|
+
asChild = false,
|
|
11175
|
+
onClick,
|
|
11176
|
+
className,
|
|
11177
|
+
children,
|
|
11178
|
+
variant = "secondary",
|
|
11179
|
+
size,
|
|
11180
|
+
layout,
|
|
11181
|
+
fullWidth,
|
|
11182
|
+
type = "button",
|
|
11183
|
+
...props
|
|
11184
|
+
}, ref) {
|
|
11185
|
+
const { open, toggle, sidebarId } = useSidebarContext("SidebarTrigger");
|
|
11186
|
+
const shared = {
|
|
11187
|
+
...props,
|
|
11188
|
+
ref,
|
|
11189
|
+
"aria-expanded": open,
|
|
11190
|
+
"aria-controls": sidebarId,
|
|
11191
|
+
"data-state": open ? "open" : "closed",
|
|
11192
|
+
className,
|
|
11193
|
+
onClick: (event) => {
|
|
11194
|
+
onClick?.(event);
|
|
11195
|
+
if (!event.defaultPrevented) toggle();
|
|
11196
|
+
}
|
|
11197
|
+
};
|
|
11198
|
+
if (asChild) return /* @__PURE__ */ jsx62(Slot3, { ...shared, children });
|
|
11199
|
+
return /* @__PURE__ */ jsx62(
|
|
11200
|
+
Button,
|
|
11201
|
+
{
|
|
11202
|
+
...shared,
|
|
11203
|
+
type,
|
|
11204
|
+
variant,
|
|
11205
|
+
size,
|
|
11206
|
+
layout,
|
|
11207
|
+
fullWidth,
|
|
11208
|
+
children
|
|
11209
|
+
}
|
|
11210
|
+
);
|
|
11211
|
+
});
|
|
11212
|
+
|
|
11044
11213
|
// src/components/Pagination/Pagination.tsx
|
|
11045
11214
|
import { clsx as clsx84 } from "clsx";
|
|
11046
11215
|
import { iconSizes as iconSizes17 } from "@refineui/tokens";
|
|
@@ -11061,18 +11230,18 @@ var paginationStyles = {
|
|
|
11061
11230
|
};
|
|
11062
11231
|
|
|
11063
11232
|
// src/components/Pagination/Pagination.tsx
|
|
11064
|
-
import { jsx as
|
|
11233
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
11065
11234
|
function PaginationRoot({ className, ...props }) {
|
|
11066
|
-
return /* @__PURE__ */
|
|
11235
|
+
return /* @__PURE__ */ jsx63("nav", { "aria-label": "Pagination", className: clsx84(paginationStyles.root, className), ...props });
|
|
11067
11236
|
}
|
|
11068
11237
|
function PaginationContent({ className, ...props }) {
|
|
11069
|
-
return /* @__PURE__ */
|
|
11238
|
+
return /* @__PURE__ */ jsx63("ul", { className: clsx84(paginationStyles.listWrap, className), ...props });
|
|
11070
11239
|
}
|
|
11071
11240
|
function PaginationItem({ className, ...props }) {
|
|
11072
|
-
return /* @__PURE__ */
|
|
11241
|
+
return /* @__PURE__ */ jsx63("li", { className, ...props });
|
|
11073
11242
|
}
|
|
11074
11243
|
function PaginationLink({ className, isActive, ...props }) {
|
|
11075
|
-
return /* @__PURE__ */
|
|
11244
|
+
return /* @__PURE__ */ jsx63(
|
|
11076
11245
|
"a",
|
|
11077
11246
|
{
|
|
11078
11247
|
"data-refineui": "pagination",
|
|
@@ -11092,7 +11261,7 @@ function PaginationNavButton({
|
|
|
11092
11261
|
}) {
|
|
11093
11262
|
const isPrev = direction === "prev";
|
|
11094
11263
|
const iconColor = disabled ? resolveColorTokenValue9(componentColorTokens.pagination.navIcon.disabled) : resolveColorTokenValue9(componentColorTokens.pagination.navIcon.default);
|
|
11095
|
-
return /* @__PURE__ */
|
|
11264
|
+
return /* @__PURE__ */ jsx63(
|
|
11096
11265
|
"button",
|
|
11097
11266
|
{
|
|
11098
11267
|
type: "button",
|
|
@@ -11102,7 +11271,7 @@ function PaginationNavButton({
|
|
|
11102
11271
|
"aria-label": isPrev ? "Previous page" : "Next page",
|
|
11103
11272
|
className: clsx84(paginationStyles.itemShell, paginationStyles.nav, className),
|
|
11104
11273
|
...props,
|
|
11105
|
-
children: /* @__PURE__ */
|
|
11274
|
+
children: /* @__PURE__ */ jsx63(
|
|
11106
11275
|
WebIcon,
|
|
11107
11276
|
{
|
|
11108
11277
|
name: isPrev ? "chevron-left" : "chevron-right",
|
|
@@ -11115,13 +11284,13 @@ function PaginationNavButton({
|
|
|
11115
11284
|
);
|
|
11116
11285
|
}
|
|
11117
11286
|
function PaginationPrevious(props) {
|
|
11118
|
-
return /* @__PURE__ */
|
|
11287
|
+
return /* @__PURE__ */ jsx63(PaginationNavButton, { direction: "prev", ...props });
|
|
11119
11288
|
}
|
|
11120
11289
|
function PaginationNext(props) {
|
|
11121
|
-
return /* @__PURE__ */
|
|
11290
|
+
return /* @__PURE__ */ jsx63(PaginationNavButton, { direction: "next", ...props });
|
|
11122
11291
|
}
|
|
11123
11292
|
function PaginationEllipsis({ className, ...props }) {
|
|
11124
|
-
return /* @__PURE__ */
|
|
11293
|
+
return /* @__PURE__ */ jsx63(
|
|
11125
11294
|
"span",
|
|
11126
11295
|
{
|
|
11127
11296
|
"aria-hidden": true,
|
|
@@ -11129,7 +11298,7 @@ function PaginationEllipsis({ className, ...props }) {
|
|
|
11129
11298
|
"data-ellipsis": "true",
|
|
11130
11299
|
className: clsx84(paginationStyles.itemShell, paginationStyles.ellipsis, className),
|
|
11131
11300
|
...props,
|
|
11132
|
-
children: /* @__PURE__ */
|
|
11301
|
+
children: /* @__PURE__ */ jsx63(
|
|
11133
11302
|
WebIcon,
|
|
11134
11303
|
{
|
|
11135
11304
|
name: "more-horizontal",
|
|
@@ -11142,24 +11311,24 @@ function PaginationEllipsis({ className, ...props }) {
|
|
|
11142
11311
|
);
|
|
11143
11312
|
}
|
|
11144
11313
|
function Pagination(props) {
|
|
11145
|
-
return /* @__PURE__ */
|
|
11314
|
+
return /* @__PURE__ */ jsx63(PaginationRoot, { ...props });
|
|
11146
11315
|
}
|
|
11147
11316
|
|
|
11148
11317
|
// src/components/PopOver/PopOver.tsx
|
|
11149
11318
|
import { clsx as clsx85 } from "clsx";
|
|
11150
11319
|
import {
|
|
11151
|
-
createContext as
|
|
11152
|
-
useCallback as
|
|
11153
|
-
useContext as
|
|
11320
|
+
createContext as createContext21,
|
|
11321
|
+
useCallback as useCallback17,
|
|
11322
|
+
useContext as useContext23,
|
|
11154
11323
|
useEffect as useEffect15,
|
|
11155
|
-
useId as
|
|
11156
|
-
useMemo as
|
|
11324
|
+
useId as useId14,
|
|
11325
|
+
useMemo as useMemo17,
|
|
11157
11326
|
useRef as useRef17,
|
|
11158
|
-
useState as
|
|
11327
|
+
useState as useState21
|
|
11159
11328
|
} from "react";
|
|
11160
|
-
import { spacings as
|
|
11329
|
+
import { spacings as spacings5, strokeWidths as strokeWidths2 } from "@refineui/tokens";
|
|
11161
11330
|
import { resolveColorTokenValue as resolveColorTokenValue10 } from "@refineui/utilities/color";
|
|
11162
|
-
import { Slot as
|
|
11331
|
+
import { Slot as Slot4, getMergeableTriggerChild as getMergeableTriggerChild3 } from "@refineui/utilities/react";
|
|
11163
11332
|
|
|
11164
11333
|
// src/components/PopOver/style.ts
|
|
11165
11334
|
var popoverStyles = {
|
|
@@ -11193,10 +11362,10 @@ function popoverFloatingClasses(placement, align) {
|
|
|
11193
11362
|
}
|
|
11194
11363
|
|
|
11195
11364
|
// src/components/PopOver/PopOver.tsx
|
|
11196
|
-
import { jsx as
|
|
11197
|
-
var PopoverContext =
|
|
11365
|
+
import { jsx as jsx64, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
11366
|
+
var PopoverContext = createContext21(null);
|
|
11198
11367
|
function usePopoverContext(component) {
|
|
11199
|
-
const ctx =
|
|
11368
|
+
const ctx = useContext23(PopoverContext);
|
|
11200
11369
|
if (!ctx) throw new Error(`${component} must be used within <Popover>`);
|
|
11201
11370
|
return ctx;
|
|
11202
11371
|
}
|
|
@@ -11204,11 +11373,11 @@ var BEAK_W = foundationSizes.foundationSize160;
|
|
|
11204
11373
|
var BEAK_H = foundationSizes.foundationSize80;
|
|
11205
11374
|
var BEAK_OFFSET = foundationSizes.foundationSize80;
|
|
11206
11375
|
var BEAK_BORDER_OVERLAP = strokeWidths2.strokeWidthThin;
|
|
11207
|
-
var POPOVER_GAP =
|
|
11376
|
+
var POPOVER_GAP = spacings5.sizeMedium;
|
|
11208
11377
|
function beakWrapperStyle(placement, align) {
|
|
11209
11378
|
const insetStart = componentSizes2.popoverBeakInsetFromStartEdge;
|
|
11210
11379
|
const insetEnd = componentSizes2.popoverBeakInsetFromEndEdge;
|
|
11211
|
-
const edge =
|
|
11380
|
+
const edge = spacings5.sizeMedium;
|
|
11212
11381
|
const overlapOffset = `calc(-1 * ${BEAK_OFFSET} + ${BEAK_BORDER_OVERLAP})`;
|
|
11213
11382
|
switch (placement) {
|
|
11214
11383
|
case "bottom":
|
|
@@ -11252,20 +11421,20 @@ function floatingGapStyle(placement) {
|
|
|
11252
11421
|
return { marginLeft: POPOVER_GAP };
|
|
11253
11422
|
}
|
|
11254
11423
|
function Popover({ children, className, open: openProp, defaultOpen = false, onOpenChange, ...props }) {
|
|
11255
|
-
const [internalOpen, setInternalOpen] =
|
|
11424
|
+
const [internalOpen, setInternalOpen] = useState21(defaultOpen);
|
|
11256
11425
|
const open = openProp ?? internalOpen;
|
|
11257
|
-
const setOpen =
|
|
11426
|
+
const setOpen = useCallback17(
|
|
11258
11427
|
(next) => {
|
|
11259
11428
|
if (openProp === void 0) setInternalOpen(next);
|
|
11260
11429
|
onOpenChange?.(next);
|
|
11261
11430
|
},
|
|
11262
11431
|
[openProp, onOpenChange]
|
|
11263
11432
|
);
|
|
11264
|
-
const toggle =
|
|
11433
|
+
const toggle = useCallback17(() => setOpen(!open), [open, setOpen]);
|
|
11265
11434
|
const containerRef = useRef17(null);
|
|
11266
11435
|
const contentRef = useRef17(null);
|
|
11267
11436
|
const triggerRef = useRef17(null);
|
|
11268
|
-
const contentId =
|
|
11437
|
+
const contentId = useId14();
|
|
11269
11438
|
useEffect15(() => {
|
|
11270
11439
|
const handler = (e) => {
|
|
11271
11440
|
if (containerRef.current && !containerRef.current.contains(e.target)) setOpen(false);
|
|
@@ -11280,7 +11449,7 @@ function Popover({ children, className, open: openProp, defaultOpen = false, onO
|
|
|
11280
11449
|
if (open) document.addEventListener("keydown", onKey);
|
|
11281
11450
|
return () => document.removeEventListener("keydown", onKey);
|
|
11282
11451
|
}, [open, setOpen]);
|
|
11283
|
-
const onTriggerKeyDown =
|
|
11452
|
+
const onTriggerKeyDown = useCallback17(
|
|
11284
11453
|
(e) => {
|
|
11285
11454
|
if (e.key === "Enter" || e.key === " ") {
|
|
11286
11455
|
e.preventDefault();
|
|
@@ -11289,7 +11458,7 @@ function Popover({ children, className, open: openProp, defaultOpen = false, onO
|
|
|
11289
11458
|
},
|
|
11290
11459
|
[toggle]
|
|
11291
11460
|
);
|
|
11292
|
-
const value =
|
|
11461
|
+
const value = useMemo17(
|
|
11293
11462
|
() => ({
|
|
11294
11463
|
open,
|
|
11295
11464
|
setOpen,
|
|
@@ -11302,7 +11471,7 @@ function Popover({ children, className, open: openProp, defaultOpen = false, onO
|
|
|
11302
11471
|
}),
|
|
11303
11472
|
[open, setOpen, toggle, contentId, onTriggerKeyDown]
|
|
11304
11473
|
);
|
|
11305
|
-
return /* @__PURE__ */
|
|
11474
|
+
return /* @__PURE__ */ jsx64(PopoverContext.Provider, { value, children: /* @__PURE__ */ jsx64(
|
|
11306
11475
|
"div",
|
|
11307
11476
|
{
|
|
11308
11477
|
ref: containerRef,
|
|
@@ -11318,8 +11487,8 @@ function PopoverTrigger({ children, className, ...props }) {
|
|
|
11318
11487
|
const mergeEl = getMergeableTriggerChild3(children);
|
|
11319
11488
|
if (mergeEl) {
|
|
11320
11489
|
const passthrough = props;
|
|
11321
|
-
return /* @__PURE__ */
|
|
11322
|
-
|
|
11490
|
+
return /* @__PURE__ */ jsx64(
|
|
11491
|
+
Slot4,
|
|
11323
11492
|
{
|
|
11324
11493
|
ref: triggerRef,
|
|
11325
11494
|
...props,
|
|
@@ -11340,7 +11509,7 @@ function PopoverTrigger({ children, className, ...props }) {
|
|
|
11340
11509
|
);
|
|
11341
11510
|
}
|
|
11342
11511
|
const passthroughBtn = props;
|
|
11343
|
-
return /* @__PURE__ */
|
|
11512
|
+
return /* @__PURE__ */ jsx64(
|
|
11344
11513
|
"button",
|
|
11345
11514
|
{
|
|
11346
11515
|
type: "button",
|
|
@@ -11383,7 +11552,7 @@ function PopoverContent({
|
|
|
11383
11552
|
const rot = beakRotateDeg(placement);
|
|
11384
11553
|
const gapStyle = floatingGapStyle(placement);
|
|
11385
11554
|
if (!open) return null;
|
|
11386
|
-
return /* @__PURE__ */
|
|
11555
|
+
return /* @__PURE__ */ jsx64(
|
|
11387
11556
|
"div",
|
|
11388
11557
|
{
|
|
11389
11558
|
className: clsx85(
|
|
@@ -11392,7 +11561,7 @@ function PopoverContent({
|
|
|
11392
11561
|
),
|
|
11393
11562
|
style: gapStyle,
|
|
11394
11563
|
children: /* @__PURE__ */ jsxs24("div", { className: popoverStyles.panelWrap, children: [
|
|
11395
|
-
/* @__PURE__ */
|
|
11564
|
+
/* @__PURE__ */ jsx64("div", { className: popoverStyles.beakWrap, style: { ...bw, width: BEAK_W, height: BEAK_H }, "aria-hidden": true, children: /* @__PURE__ */ jsx64(
|
|
11396
11565
|
"div",
|
|
11397
11566
|
{
|
|
11398
11567
|
style: {
|
|
@@ -11411,14 +11580,14 @@ function PopoverContent({
|
|
|
11411
11580
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11412
11581
|
style: { display: "block" },
|
|
11413
11582
|
children: [
|
|
11414
|
-
/* @__PURE__ */
|
|
11415
|
-
/* @__PURE__ */
|
|
11583
|
+
/* @__PURE__ */ jsx64("polygon", { points: "8,0 0,8 16,8", fill: borderCol }),
|
|
11584
|
+
/* @__PURE__ */ jsx64("polygon", { points: "8,2 2,8 14,8", fill: bg })
|
|
11416
11585
|
]
|
|
11417
11586
|
}
|
|
11418
11587
|
)
|
|
11419
11588
|
}
|
|
11420
11589
|
) }),
|
|
11421
|
-
/* @__PURE__ */
|
|
11590
|
+
/* @__PURE__ */ jsx64(
|
|
11422
11591
|
"div",
|
|
11423
11592
|
{
|
|
11424
11593
|
ref: contentRef,
|
|
@@ -11437,7 +11606,7 @@ function PopoverContent({
|
|
|
11437
11606
|
style: {
|
|
11438
11607
|
...styleProp && typeof styleProp === "object" ? styleProp : {},
|
|
11439
11608
|
minWidth: componentSizes2.popoverPanelWidth,
|
|
11440
|
-
padding:
|
|
11609
|
+
padding: spacings5.sizeLarge,
|
|
11441
11610
|
backgroundColor: bg,
|
|
11442
11611
|
color: resolveColorTokenValue10(palette.foreground),
|
|
11443
11612
|
borderColor: borderCol
|
|
@@ -11459,8 +11628,8 @@ function PopOver({
|
|
|
11459
11628
|
...props
|
|
11460
11629
|
}) {
|
|
11461
11630
|
return /* @__PURE__ */ jsxs24(Popover, { className, ...props, children: [
|
|
11462
|
-
/* @__PURE__ */
|
|
11463
|
-
/* @__PURE__ */
|
|
11631
|
+
/* @__PURE__ */ jsx64(PopoverTrigger, { children: trigger }),
|
|
11632
|
+
/* @__PURE__ */ jsx64(PopoverContent, { placement, align, children: content })
|
|
11464
11633
|
] });
|
|
11465
11634
|
}
|
|
11466
11635
|
|
|
@@ -11476,7 +11645,7 @@ var skeletonStyles = {
|
|
|
11476
11645
|
};
|
|
11477
11646
|
|
|
11478
11647
|
// src/components/Skeleton/Skeleton.tsx
|
|
11479
|
-
import { jsx as
|
|
11648
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
11480
11649
|
function Skeleton({
|
|
11481
11650
|
width,
|
|
11482
11651
|
height,
|
|
@@ -11508,7 +11677,7 @@ function Skeleton({
|
|
|
11508
11677
|
w = width ?? "100%";
|
|
11509
11678
|
}
|
|
11510
11679
|
const dimStyle = { width: w, height: h };
|
|
11511
|
-
return /* @__PURE__ */
|
|
11680
|
+
return /* @__PURE__ */ jsx65(
|
|
11512
11681
|
"div",
|
|
11513
11682
|
{
|
|
11514
11683
|
"data-refineui": "skeleton",
|
|
@@ -11526,7 +11695,7 @@ function Skeleton({
|
|
|
11526
11695
|
|
|
11527
11696
|
// src/components/Slider/Slider.tsx
|
|
11528
11697
|
import { clsx as clsx87 } from "clsx";
|
|
11529
|
-
import { useState as
|
|
11698
|
+
import { useState as useState22 } from "react";
|
|
11530
11699
|
|
|
11531
11700
|
// src/components/Slider/style.ts
|
|
11532
11701
|
var sliderStyles = {
|
|
@@ -11534,7 +11703,7 @@ var sliderStyles = {
|
|
|
11534
11703
|
};
|
|
11535
11704
|
|
|
11536
11705
|
// src/components/Slider/Slider.tsx
|
|
11537
|
-
import { jsx as
|
|
11706
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
11538
11707
|
function clampPct(n) {
|
|
11539
11708
|
if (Number.isNaN(n)) return 0;
|
|
11540
11709
|
return Math.min(100, Math.max(0, n));
|
|
@@ -11552,12 +11721,12 @@ function Slider({
|
|
|
11552
11721
|
style,
|
|
11553
11722
|
...props
|
|
11554
11723
|
}) {
|
|
11555
|
-
const [internalFillPct, setInternalFillPct] =
|
|
11724
|
+
const [internalFillPct, setInternalFillPct] = useState22(() => {
|
|
11556
11725
|
const v = defaultValue !== void 0 ? Number(defaultValue) : (min + max) / 2;
|
|
11557
11726
|
return clampPct((v - min) / (max - min) * 100);
|
|
11558
11727
|
});
|
|
11559
11728
|
const fillPct = value !== void 0 ? clampPct((Number(value) - min) / (max - min) * 100) : internalFillPct;
|
|
11560
|
-
return /* @__PURE__ */
|
|
11729
|
+
return /* @__PURE__ */ jsx66(
|
|
11561
11730
|
"input",
|
|
11562
11731
|
{
|
|
11563
11732
|
type: "range",
|
|
@@ -11597,16 +11766,16 @@ import { iconSizes as iconSizes18 } from "@refineui/tokens";
|
|
|
11597
11766
|
import {
|
|
11598
11767
|
Children as Children6,
|
|
11599
11768
|
cloneElement as cloneElement2,
|
|
11600
|
-
createContext as
|
|
11601
|
-
forwardRef as
|
|
11769
|
+
createContext as createContext22,
|
|
11770
|
+
forwardRef as forwardRef15,
|
|
11602
11771
|
isValidElement as isValidElement5,
|
|
11603
|
-
useCallback as
|
|
11604
|
-
useContext as
|
|
11772
|
+
useCallback as useCallback18,
|
|
11773
|
+
useContext as useContext24,
|
|
11605
11774
|
useEffect as useEffect16,
|
|
11606
11775
|
useLayoutEffect as useLayoutEffect9,
|
|
11607
|
-
useMemo as
|
|
11776
|
+
useMemo as useMemo18,
|
|
11608
11777
|
useRef as useRef18,
|
|
11609
|
-
useState as
|
|
11778
|
+
useState as useState23
|
|
11610
11779
|
} from "react";
|
|
11611
11780
|
|
|
11612
11781
|
// src/components/Carousel/style.ts
|
|
@@ -11639,11 +11808,11 @@ var carouselStyles = {
|
|
|
11639
11808
|
};
|
|
11640
11809
|
|
|
11641
11810
|
// src/components/Carousel/Carousel.tsx
|
|
11642
|
-
import { jsx as
|
|
11811
|
+
import { jsx as jsx67, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
11643
11812
|
var DRAG_COMMIT_RATIO = 0.18;
|
|
11644
|
-
var CarouselContext =
|
|
11813
|
+
var CarouselContext = createContext22(null);
|
|
11645
11814
|
function useCarouselContext(component) {
|
|
11646
|
-
const v =
|
|
11815
|
+
const v = useContext24(CarouselContext);
|
|
11647
11816
|
if (!v) throw new Error(`${component} must be used within Carousel.`);
|
|
11648
11817
|
return v;
|
|
11649
11818
|
}
|
|
@@ -11662,13 +11831,13 @@ function Carousel({
|
|
|
11662
11831
|
...props
|
|
11663
11832
|
}) {
|
|
11664
11833
|
const isControlled = indexControlled !== void 0;
|
|
11665
|
-
const [internalIndex, setInternalIndex] =
|
|
11666
|
-
const [count, setCount] =
|
|
11667
|
-
const [trackIndex, setTrackIndex] =
|
|
11668
|
-
const [instant, setInstant] =
|
|
11834
|
+
const [internalIndex, setInternalIndex] = useState23(defaultIndex);
|
|
11835
|
+
const [count, setCount] = useState23(0);
|
|
11836
|
+
const [trackIndex, setTrackIndex] = useState23(defaultIndex);
|
|
11837
|
+
const [instant, setInstant] = useState23(false);
|
|
11669
11838
|
const index = isControlled ? indexControlled : internalIndex;
|
|
11670
11839
|
const loopActive = loop && count > 1;
|
|
11671
|
-
const commitLogical =
|
|
11840
|
+
const commitLogical = useCallback18(
|
|
11672
11841
|
(next) => {
|
|
11673
11842
|
const normalized = clampIndex(next, Math.max(count, 1));
|
|
11674
11843
|
if (!isControlled) setInternalIndex(normalized);
|
|
@@ -11696,7 +11865,7 @@ function Carousel({
|
|
|
11696
11865
|
}, [index, count, loopActive]);
|
|
11697
11866
|
const canScrollPrev = loopActive ? true : index > 0;
|
|
11698
11867
|
const canScrollNext = loopActive ? true : index < count - 1;
|
|
11699
|
-
const scrollTo =
|
|
11868
|
+
const scrollTo = useCallback18(
|
|
11700
11869
|
(i) => {
|
|
11701
11870
|
if (count <= 0) return;
|
|
11702
11871
|
const next = clampIndex(i, count);
|
|
@@ -11705,7 +11874,7 @@ function Carousel({
|
|
|
11705
11874
|
},
|
|
11706
11875
|
[commitLogical, count, loopActive]
|
|
11707
11876
|
);
|
|
11708
|
-
const scrollPrev =
|
|
11877
|
+
const scrollPrev = useCallback18(() => {
|
|
11709
11878
|
if (count <= 0) return;
|
|
11710
11879
|
if (loopActive) {
|
|
11711
11880
|
if (trackIndex < 1 || trackIndex > count) return;
|
|
@@ -11718,7 +11887,7 @@ function Carousel({
|
|
|
11718
11887
|
setTrackIndex(index - 1);
|
|
11719
11888
|
}
|
|
11720
11889
|
}, [commitLogical, count, index, loopActive, trackIndex]);
|
|
11721
|
-
const scrollNext =
|
|
11890
|
+
const scrollNext = useCallback18(() => {
|
|
11722
11891
|
if (count <= 0) return;
|
|
11723
11892
|
if (loopActive) {
|
|
11724
11893
|
if (trackIndex < 1 || trackIndex > count) return;
|
|
@@ -11731,7 +11900,7 @@ function Carousel({
|
|
|
11731
11900
|
setTrackIndex(index + 1);
|
|
11732
11901
|
}
|
|
11733
11902
|
}, [commitLogical, count, index, loopActive, trackIndex]);
|
|
11734
|
-
const onTrackSettled =
|
|
11903
|
+
const onTrackSettled = useCallback18(() => {
|
|
11735
11904
|
if (!loopActive) return;
|
|
11736
11905
|
if (trackIndex === 0) {
|
|
11737
11906
|
setInstant(true);
|
|
@@ -11747,7 +11916,7 @@ function Carousel({
|
|
|
11747
11916
|
});
|
|
11748
11917
|
}
|
|
11749
11918
|
}, [count, loopActive, trackIndex]);
|
|
11750
|
-
const ctx =
|
|
11919
|
+
const ctx = useMemo18(
|
|
11751
11920
|
() => ({
|
|
11752
11921
|
index,
|
|
11753
11922
|
count,
|
|
@@ -11802,7 +11971,7 @@ function Carousel({
|
|
|
11802
11971
|
break;
|
|
11803
11972
|
}
|
|
11804
11973
|
};
|
|
11805
|
-
return /* @__PURE__ */
|
|
11974
|
+
return /* @__PURE__ */ jsx67(CarouselContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx67(
|
|
11806
11975
|
"div",
|
|
11807
11976
|
{
|
|
11808
11977
|
"data-refineui": "carousel",
|
|
@@ -11828,8 +11997,8 @@ function CarouselContent({ className, children, ...props }) {
|
|
|
11828
11997
|
} = useCarouselContext("CarouselContent");
|
|
11829
11998
|
const viewportRef = useRef18(null);
|
|
11830
11999
|
const dragStartX = useRef18(null);
|
|
11831
|
-
const [dragPx, setDragPx] =
|
|
11832
|
-
const [dragging, setDragging] =
|
|
12000
|
+
const [dragPx, setDragPx] = useState23(0);
|
|
12001
|
+
const [dragging, setDragging] = useState23(false);
|
|
11833
12002
|
const slides = Children6.toArray(children).filter(isValidElement5);
|
|
11834
12003
|
const slideCount = slides.length;
|
|
11835
12004
|
useEffect16(() => {
|
|
@@ -11840,7 +12009,7 @@ function CarouselContent({ className, children, ...props }) {
|
|
|
11840
12009
|
...slides,
|
|
11841
12010
|
cloneElement2(slides[0], { key: "__carousel-clone-first" })
|
|
11842
12011
|
] : slides;
|
|
11843
|
-
const endDrag =
|
|
12012
|
+
const endDrag = useCallback18(
|
|
11844
12013
|
(clientX) => {
|
|
11845
12014
|
if (dragStartX.current == null) return;
|
|
11846
12015
|
const width = viewportRef.current?.offsetWidth ?? 1;
|
|
@@ -11889,7 +12058,7 @@ function CarouselContent({ className, children, ...props }) {
|
|
|
11889
12058
|
};
|
|
11890
12059
|
const animated = !dragging && !instant;
|
|
11891
12060
|
const transform = dragPx !== 0 ? `translate3d(calc(-${trackIndex * 100}% + ${dragPx}px), 0, 0)` : `translate3d(-${trackIndex * 100}%, 0, 0)`;
|
|
11892
|
-
return /* @__PURE__ */
|
|
12061
|
+
return /* @__PURE__ */ jsx67(
|
|
11893
12062
|
"div",
|
|
11894
12063
|
{
|
|
11895
12064
|
ref: viewportRef,
|
|
@@ -11900,7 +12069,7 @@ function CarouselContent({ className, children, ...props }) {
|
|
|
11900
12069
|
onPointerMove,
|
|
11901
12070
|
onPointerUp,
|
|
11902
12071
|
onPointerCancel,
|
|
11903
|
-
children: /* @__PURE__ */
|
|
12072
|
+
children: /* @__PURE__ */ jsx67(
|
|
11904
12073
|
"div",
|
|
11905
12074
|
{
|
|
11906
12075
|
"data-refineui": "carousel-track",
|
|
@@ -11915,9 +12084,9 @@ function CarouselContent({ className, children, ...props }) {
|
|
|
11915
12084
|
}
|
|
11916
12085
|
);
|
|
11917
12086
|
}
|
|
11918
|
-
var CarouselItem =
|
|
12087
|
+
var CarouselItem = forwardRef15(function CarouselItem2({ className, children, ...props }, ref) {
|
|
11919
12088
|
useCarouselContext("CarouselItem");
|
|
11920
|
-
return /* @__PURE__ */
|
|
12089
|
+
return /* @__PURE__ */ jsx67(
|
|
11921
12090
|
"div",
|
|
11922
12091
|
{
|
|
11923
12092
|
ref,
|
|
@@ -11932,12 +12101,12 @@ var CarouselItem = forwardRef14(function CarouselItem2({ className, children, ..
|
|
|
11932
12101
|
});
|
|
11933
12102
|
function CarouselControls({ className, children, ...props }) {
|
|
11934
12103
|
useCarouselContext("CarouselControls");
|
|
11935
|
-
return /* @__PURE__ */
|
|
12104
|
+
return /* @__PURE__ */ jsx67("div", { "data-refineui": "carousel-controls", className: clsx89(carouselStyles.controls, className), ...props, children });
|
|
11936
12105
|
}
|
|
11937
12106
|
function CarouselPrevious({ className, disabled, onClick, ...props }) {
|
|
11938
12107
|
const { scrollPrev, canScrollPrev } = useCarouselContext("CarouselPrevious");
|
|
11939
12108
|
const isDisabled = disabled || !canScrollPrev;
|
|
11940
|
-
return /* @__PURE__ */
|
|
12109
|
+
return /* @__PURE__ */ jsx67(
|
|
11941
12110
|
Button,
|
|
11942
12111
|
{
|
|
11943
12112
|
variant: "outline",
|
|
@@ -11953,7 +12122,7 @@ function CarouselPrevious({ className, disabled, onClick, ...props }) {
|
|
|
11953
12122
|
onClick?.(e);
|
|
11954
12123
|
if (!e.defaultPrevented && !isDisabled) scrollPrev();
|
|
11955
12124
|
},
|
|
11956
|
-
children: /* @__PURE__ */
|
|
12125
|
+
children: /* @__PURE__ */ jsx67(
|
|
11957
12126
|
WebIcon,
|
|
11958
12127
|
{
|
|
11959
12128
|
name: "chevron-left",
|
|
@@ -11969,7 +12138,7 @@ function CarouselPrevious({ className, disabled, onClick, ...props }) {
|
|
|
11969
12138
|
function CarouselNext({ className, disabled, onClick, ...props }) {
|
|
11970
12139
|
const { scrollNext, canScrollNext } = useCarouselContext("CarouselNext");
|
|
11971
12140
|
const isDisabled = disabled || !canScrollNext;
|
|
11972
|
-
return /* @__PURE__ */
|
|
12141
|
+
return /* @__PURE__ */ jsx67(
|
|
11973
12142
|
Button,
|
|
11974
12143
|
{
|
|
11975
12144
|
variant: "outline",
|
|
@@ -11985,7 +12154,7 @@ function CarouselNext({ className, disabled, onClick, ...props }) {
|
|
|
11985
12154
|
onClick?.(e);
|
|
11986
12155
|
if (!e.defaultPrevented && !isDisabled) scrollNext();
|
|
11987
12156
|
},
|
|
11988
|
-
children: /* @__PURE__ */
|
|
12157
|
+
children: /* @__PURE__ */ jsx67(
|
|
11989
12158
|
WebIcon,
|
|
11990
12159
|
{
|
|
11991
12160
|
name: "chevron-right",
|
|
@@ -12001,8 +12170,8 @@ function CarouselNext({ className, disabled, onClick, ...props }) {
|
|
|
12001
12170
|
function CarouselIndicators({ className, ...props }) {
|
|
12002
12171
|
const { count, index, scrollTo } = useCarouselContext("CarouselIndicators");
|
|
12003
12172
|
const trackRef = useRef18(null);
|
|
12004
|
-
const [thumb, setThumb] =
|
|
12005
|
-
const updateThumb =
|
|
12173
|
+
const [thumb, setThumb] = useState23({ width: 0, x: 0, ready: false });
|
|
12174
|
+
const updateThumb = useCallback18(() => {
|
|
12006
12175
|
const el = trackRef.current;
|
|
12007
12176
|
if (!el || count <= 0) {
|
|
12008
12177
|
setThumb({ width: 0, x: 0, ready: false });
|
|
@@ -12042,7 +12211,7 @@ function CarouselIndicators({ className, ...props }) {
|
|
|
12042
12211
|
className: clsx89(carouselStyles.indicators, className),
|
|
12043
12212
|
...props,
|
|
12044
12213
|
children: [
|
|
12045
|
-
/* @__PURE__ */
|
|
12214
|
+
/* @__PURE__ */ jsx67(
|
|
12046
12215
|
"span",
|
|
12047
12216
|
{
|
|
12048
12217
|
"data-refineui": "carousel-indicator-thumb",
|
|
@@ -12052,7 +12221,7 @@ function CarouselIndicators({ className, ...props }) {
|
|
|
12052
12221
|
style: thumbStyle
|
|
12053
12222
|
}
|
|
12054
12223
|
),
|
|
12055
|
-
/* @__PURE__ */
|
|
12224
|
+
/* @__PURE__ */ jsx67("div", { "data-refineui": "carousel-indicator-hits", className: carouselStyles.indicatorHitRow, children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx67(
|
|
12056
12225
|
"button",
|
|
12057
12226
|
{
|
|
12058
12227
|
type: "button",
|
|
@@ -12075,9 +12244,9 @@ function CarouselIndicators({ className, ...props }) {
|
|
|
12075
12244
|
import { clsx as clsx91 } from "clsx";
|
|
12076
12245
|
import {
|
|
12077
12246
|
Children as Children7,
|
|
12078
|
-
createContext as
|
|
12247
|
+
createContext as createContext23,
|
|
12079
12248
|
isValidElement as isValidElement6,
|
|
12080
|
-
useContext as
|
|
12249
|
+
useContext as useContext25
|
|
12081
12250
|
} from "react";
|
|
12082
12251
|
|
|
12083
12252
|
// src/components/Bubble/style.ts
|
|
@@ -12143,10 +12312,10 @@ var bubbleContentVariantClass = {
|
|
|
12143
12312
|
};
|
|
12144
12313
|
|
|
12145
12314
|
// src/components/Bubble/Bubble.tsx
|
|
12146
|
-
import { jsx as
|
|
12147
|
-
var BubbleContext =
|
|
12315
|
+
import { jsx as jsx68, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
12316
|
+
var BubbleContext = createContext23(null);
|
|
12148
12317
|
function useBubbleContext(component) {
|
|
12149
|
-
const value =
|
|
12318
|
+
const value = useContext25(BubbleContext);
|
|
12150
12319
|
if (!value) throw new Error(`${component} must be used within Bubble.`);
|
|
12151
12320
|
return value;
|
|
12152
12321
|
}
|
|
@@ -12175,7 +12344,7 @@ function partitionBubbleChildren(children) {
|
|
|
12175
12344
|
};
|
|
12176
12345
|
}
|
|
12177
12346
|
function BubbleGroup({ className, ...props }) {
|
|
12178
|
-
return /* @__PURE__ */
|
|
12347
|
+
return /* @__PURE__ */ jsx68(
|
|
12179
12348
|
"div",
|
|
12180
12349
|
{
|
|
12181
12350
|
"data-refineui": "bubble-group",
|
|
@@ -12194,7 +12363,7 @@ function Bubble({
|
|
|
12194
12363
|
}) {
|
|
12195
12364
|
const rootStyle = variant === "ghost" ? style : { maxWidth: BUBBLE_MAX_WIDTH, ...style };
|
|
12196
12365
|
const { top, middle, bottom, hasTop, hasBottom } = partitionBubbleChildren(children);
|
|
12197
|
-
return /* @__PURE__ */
|
|
12366
|
+
return /* @__PURE__ */ jsx68(BubbleContext.Provider, { value: { variant, align }, children: /* @__PURE__ */ jsx68(
|
|
12198
12367
|
"div",
|
|
12199
12368
|
{
|
|
12200
12369
|
"data-refineui": "bubble",
|
|
@@ -12219,7 +12388,7 @@ function Bubble({
|
|
|
12219
12388
|
}
|
|
12220
12389
|
function BubbleContent({ className, ...props }) {
|
|
12221
12390
|
const { variant } = useBubbleContext("BubbleContent");
|
|
12222
|
-
return /* @__PURE__ */
|
|
12391
|
+
return /* @__PURE__ */ jsx68(
|
|
12223
12392
|
"div",
|
|
12224
12393
|
{
|
|
12225
12394
|
"data-refineui": "bubble-content",
|
|
@@ -12240,7 +12409,7 @@ function BubbleReactions({
|
|
|
12240
12409
|
}) {
|
|
12241
12410
|
const { align: bubbleAlign } = useBubbleContext("BubbleReactions");
|
|
12242
12411
|
const align = alignProp ?? (bubbleAlign === "start" ? "end" : "start");
|
|
12243
|
-
return /* @__PURE__ */
|
|
12412
|
+
return /* @__PURE__ */ jsx68(
|
|
12244
12413
|
"div",
|
|
12245
12414
|
{
|
|
12246
12415
|
"data-refineui": "bubble-reactions",
|
|
@@ -12261,12 +12430,12 @@ function BubbleReactions({
|
|
|
12261
12430
|
import { clsx as clsx93 } from "clsx";
|
|
12262
12431
|
import { iconSizes as iconSizes19 } from "@refineui/tokens";
|
|
12263
12432
|
import {
|
|
12264
|
-
createContext as
|
|
12265
|
-
useCallback as
|
|
12266
|
-
useContext as
|
|
12267
|
-
useMemo as
|
|
12433
|
+
createContext as createContext24,
|
|
12434
|
+
useCallback as useCallback19,
|
|
12435
|
+
useContext as useContext26,
|
|
12436
|
+
useMemo as useMemo19,
|
|
12268
12437
|
useRef as useRef19,
|
|
12269
|
-
useState as
|
|
12438
|
+
useState as useState24
|
|
12270
12439
|
} from "react";
|
|
12271
12440
|
|
|
12272
12441
|
// src/components/Stepper/style.ts
|
|
@@ -12375,17 +12544,17 @@ var stepperConnectorVars = {
|
|
|
12375
12544
|
};
|
|
12376
12545
|
|
|
12377
12546
|
// src/components/Stepper/Stepper.tsx
|
|
12378
|
-
import { jsx as
|
|
12379
|
-
var StepperContext =
|
|
12380
|
-
var StepperItemContext =
|
|
12381
|
-
var StepperListRegistryContext =
|
|
12547
|
+
import { jsx as jsx69, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
12548
|
+
var StepperContext = createContext24(null);
|
|
12549
|
+
var StepperItemContext = createContext24(null);
|
|
12550
|
+
var StepperListRegistryContext = createContext24(null);
|
|
12382
12551
|
function useStepperContext(component) {
|
|
12383
|
-
const v =
|
|
12552
|
+
const v = useContext26(StepperContext);
|
|
12384
12553
|
if (!v) throw new Error(`${component} must be used within Stepper.`);
|
|
12385
12554
|
return v;
|
|
12386
12555
|
}
|
|
12387
12556
|
function useStepperItemContext(component) {
|
|
12388
|
-
const v =
|
|
12557
|
+
const v = useContext26(StepperItemContext);
|
|
12389
12558
|
if (!v) throw new Error(`${component} must be used within StepperItem.`);
|
|
12390
12559
|
return v;
|
|
12391
12560
|
}
|
|
@@ -12405,16 +12574,16 @@ function Stepper({
|
|
|
12405
12574
|
...props
|
|
12406
12575
|
}) {
|
|
12407
12576
|
const isControlled = valueControlled !== void 0;
|
|
12408
|
-
const [internalValue, setInternalValue] =
|
|
12577
|
+
const [internalValue, setInternalValue] = useState24(defaultValue);
|
|
12409
12578
|
const value = isControlled ? valueControlled : internalValue;
|
|
12410
|
-
const setValue =
|
|
12579
|
+
const setValue = useCallback19(
|
|
12411
12580
|
(next) => {
|
|
12412
12581
|
if (!isControlled) setInternalValue(next);
|
|
12413
12582
|
onValueChange?.(next);
|
|
12414
12583
|
},
|
|
12415
12584
|
[isControlled, onValueChange]
|
|
12416
12585
|
);
|
|
12417
|
-
const ctx =
|
|
12586
|
+
const ctx = useMemo19(
|
|
12418
12587
|
() => ({
|
|
12419
12588
|
value,
|
|
12420
12589
|
setValue,
|
|
@@ -12423,7 +12592,7 @@ function Stepper({
|
|
|
12423
12592
|
}),
|
|
12424
12593
|
[value, setValue, orientation, onValueChange, isControlled]
|
|
12425
12594
|
);
|
|
12426
|
-
return /* @__PURE__ */
|
|
12595
|
+
return /* @__PURE__ */ jsx69(StepperContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx69(
|
|
12427
12596
|
"div",
|
|
12428
12597
|
{
|
|
12429
12598
|
"data-refineui": "stepper",
|
|
@@ -12439,7 +12608,7 @@ function StepperList({ className, children, ...props }) {
|
|
|
12439
12608
|
const { orientation, value } = useStepperContext("StepperList");
|
|
12440
12609
|
const cursorRef = useRef19(null);
|
|
12441
12610
|
cursorRef.current = null;
|
|
12442
|
-
const registry =
|
|
12611
|
+
const registry = useMemo19(
|
|
12443
12612
|
() => ({
|
|
12444
12613
|
noteItem(itemValue) {
|
|
12445
12614
|
cursorRef.current = itemValue;
|
|
@@ -12451,7 +12620,7 @@ function StepperList({ className, children, ...props }) {
|
|
|
12451
12620
|
}),
|
|
12452
12621
|
[value]
|
|
12453
12622
|
);
|
|
12454
|
-
return /* @__PURE__ */
|
|
12623
|
+
return /* @__PURE__ */ jsx69(StepperListRegistryContext.Provider, { value: registry, children: /* @__PURE__ */ jsx69(
|
|
12455
12624
|
"ol",
|
|
12456
12625
|
{
|
|
12457
12626
|
"data-refineui": "stepper-list",
|
|
@@ -12476,7 +12645,7 @@ function StepperItem({
|
|
|
12476
12645
|
...props
|
|
12477
12646
|
}) {
|
|
12478
12647
|
const { value, setValue, orientation, interactive } = useStepperContext("StepperItem");
|
|
12479
|
-
const registry =
|
|
12648
|
+
const registry = useContext26(StepperListRegistryContext);
|
|
12480
12649
|
registry?.noteItem(itemValue);
|
|
12481
12650
|
const state = resolveState2(itemValue, value);
|
|
12482
12651
|
const canActivate = interactive && !disabled;
|
|
@@ -12492,11 +12661,11 @@ function StepperItem({
|
|
|
12492
12661
|
activate();
|
|
12493
12662
|
}
|
|
12494
12663
|
};
|
|
12495
|
-
const itemCtx =
|
|
12664
|
+
const itemCtx = useMemo19(
|
|
12496
12665
|
() => ({ state, disabled }),
|
|
12497
12666
|
[state, disabled]
|
|
12498
12667
|
);
|
|
12499
|
-
return /* @__PURE__ */
|
|
12668
|
+
return /* @__PURE__ */ jsx69(StepperItemContext.Provider, { value: itemCtx, children: /* @__PURE__ */ jsx69(
|
|
12500
12669
|
"li",
|
|
12501
12670
|
{
|
|
12502
12671
|
"data-refineui": "stepper-item",
|
|
@@ -12524,7 +12693,7 @@ function StepperItem({
|
|
|
12524
12693
|
function StepperIndicator({ className, children, ...props }) {
|
|
12525
12694
|
const { state } = useStepperItemContext("StepperIndicator");
|
|
12526
12695
|
const stateClass = state === "complete" ? stepperStyles.indicatorComplete : state === "current" ? stepperStyles.indicatorCurrent : stepperStyles.indicatorUpcoming;
|
|
12527
|
-
const content = state === "upcoming" ? children : /* @__PURE__ */
|
|
12696
|
+
const content = state === "upcoming" ? children : /* @__PURE__ */ jsx69(
|
|
12528
12697
|
WebIcon,
|
|
12529
12698
|
{
|
|
12530
12699
|
name: "checkmark",
|
|
@@ -12535,7 +12704,7 @@ function StepperIndicator({ className, children, ...props }) {
|
|
|
12535
12704
|
className: "items-center justify-center"
|
|
12536
12705
|
}
|
|
12537
12706
|
);
|
|
12538
|
-
return /* @__PURE__ */
|
|
12707
|
+
return /* @__PURE__ */ jsx69(
|
|
12539
12708
|
"span",
|
|
12540
12709
|
{
|
|
12541
12710
|
"data-refineui": "stepper-indicator",
|
|
@@ -12550,7 +12719,7 @@ function StepperIndicator({ className, children, ...props }) {
|
|
|
12550
12719
|
function StepperContent({ className, ...props }) {
|
|
12551
12720
|
const { orientation } = useStepperContext("StepperContent");
|
|
12552
12721
|
useStepperItemContext("StepperContent");
|
|
12553
|
-
return /* @__PURE__ */
|
|
12722
|
+
return /* @__PURE__ */ jsx69(
|
|
12554
12723
|
"div",
|
|
12555
12724
|
{
|
|
12556
12725
|
"data-refineui": "stepper-content",
|
|
@@ -12566,7 +12735,7 @@ function StepperContent({ className, ...props }) {
|
|
|
12566
12735
|
function StepperTitle({ className, ...props }) {
|
|
12567
12736
|
const { state } = useStepperItemContext("StepperTitle");
|
|
12568
12737
|
const stateClass = state === "complete" ? stepperStyles.titleComplete : state === "current" ? stepperStyles.titleCurrent : stepperStyles.titleUpcoming;
|
|
12569
|
-
return /* @__PURE__ */
|
|
12738
|
+
return /* @__PURE__ */ jsx69(
|
|
12570
12739
|
"span",
|
|
12571
12740
|
{
|
|
12572
12741
|
"data-refineui": "stepper-title",
|
|
@@ -12579,7 +12748,7 @@ function StepperTitle({ className, ...props }) {
|
|
|
12579
12748
|
function StepperDescription({ className, ...props }) {
|
|
12580
12749
|
const { state } = useStepperItemContext("StepperDescription");
|
|
12581
12750
|
const stateClass = state === "complete" ? stepperStyles.descriptionComplete : state === "current" ? stepperStyles.descriptionCurrent : stepperStyles.descriptionUpcoming;
|
|
12582
|
-
return /* @__PURE__ */
|
|
12751
|
+
return /* @__PURE__ */ jsx69(
|
|
12583
12752
|
"span",
|
|
12584
12753
|
{
|
|
12585
12754
|
"data-refineui": "stepper-description",
|
|
@@ -12591,10 +12760,10 @@ function StepperDescription({ className, ...props }) {
|
|
|
12591
12760
|
}
|
|
12592
12761
|
function StepperSeparator({ className, ...props }) {
|
|
12593
12762
|
const { orientation } = useStepperContext("StepperSeparator");
|
|
12594
|
-
const registry =
|
|
12763
|
+
const registry = useContext26(StepperListRegistryContext);
|
|
12595
12764
|
const state = registry?.takeSeparatorState() ?? "upcoming";
|
|
12596
12765
|
const vertical = orientation === "vertical";
|
|
12597
|
-
return /* @__PURE__ */
|
|
12766
|
+
return /* @__PURE__ */ jsx69(
|
|
12598
12767
|
"li",
|
|
12599
12768
|
{
|
|
12600
12769
|
"data-refineui": "stepper-separator",
|
|
@@ -12617,14 +12786,14 @@ function StepperSeparator({ className, ...props }) {
|
|
|
12617
12786
|
vertical ? stepperStyles.separatorRailVertical : stepperStyles.separatorRailHorizontal
|
|
12618
12787
|
),
|
|
12619
12788
|
children: [
|
|
12620
|
-
/* @__PURE__ */
|
|
12789
|
+
/* @__PURE__ */ jsx69(
|
|
12621
12790
|
"span",
|
|
12622
12791
|
{
|
|
12623
12792
|
"data-refineui": "stepper-separator-track",
|
|
12624
12793
|
className: stepperStyles.separatorTrack
|
|
12625
12794
|
}
|
|
12626
12795
|
),
|
|
12627
|
-
/* @__PURE__ */
|
|
12796
|
+
/* @__PURE__ */ jsx69(
|
|
12628
12797
|
"span",
|
|
12629
12798
|
{
|
|
12630
12799
|
"data-refineui": "stepper-separator-fill",
|
|
@@ -12653,14 +12822,14 @@ StepperSeparator.displayName = "StepperSeparator";
|
|
|
12653
12822
|
// src/components/Resizable/Resizable.tsx
|
|
12654
12823
|
import { clsx as clsx95 } from "clsx";
|
|
12655
12824
|
import {
|
|
12656
|
-
createContext as
|
|
12657
|
-
useCallback as
|
|
12658
|
-
useContext as
|
|
12659
|
-
useId as
|
|
12825
|
+
createContext as createContext25,
|
|
12826
|
+
useCallback as useCallback20,
|
|
12827
|
+
useContext as useContext27,
|
|
12828
|
+
useId as useId15,
|
|
12660
12829
|
useLayoutEffect as useLayoutEffect10,
|
|
12661
|
-
useMemo as
|
|
12830
|
+
useMemo as useMemo20,
|
|
12662
12831
|
useRef as useRef20,
|
|
12663
|
-
useState as
|
|
12832
|
+
useState as useState25
|
|
12664
12833
|
} from "react";
|
|
12665
12834
|
|
|
12666
12835
|
// src/components/Resizable/style.ts
|
|
@@ -12696,15 +12865,15 @@ var resizableStyles = {
|
|
|
12696
12865
|
};
|
|
12697
12866
|
|
|
12698
12867
|
// src/components/Resizable/Resizable.tsx
|
|
12699
|
-
import { jsx as
|
|
12868
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
12700
12869
|
var KEYBOARD_STEP = 2;
|
|
12701
12870
|
var KEYBOARD_STEP_LARGE = 10;
|
|
12702
12871
|
var DEFAULT_SIZE = 50;
|
|
12703
12872
|
var DEFAULT_MIN_SIZE = 10;
|
|
12704
12873
|
var DEFAULT_MAX_SIZE = 100;
|
|
12705
|
-
var ResizableContext =
|
|
12874
|
+
var ResizableContext = createContext25(null);
|
|
12706
12875
|
function useResizableContext(component) {
|
|
12707
|
-
const v =
|
|
12876
|
+
const v = useContext27(ResizableContext);
|
|
12708
12877
|
if (!v) throw new Error(`${component} must be used within ResizablePanelGroup.`);
|
|
12709
12878
|
return v;
|
|
12710
12879
|
}
|
|
@@ -12766,10 +12935,10 @@ function ResizablePanelGroup({
|
|
|
12766
12935
|
const groupRef = useRef20(null);
|
|
12767
12936
|
const panelsRef = useRef20(/* @__PURE__ */ new Map());
|
|
12768
12937
|
const orderCounterRef = useRef20(0);
|
|
12769
|
-
const [sizes, setSizes] =
|
|
12938
|
+
const [sizes, setSizes] = useState25({});
|
|
12770
12939
|
const onLayoutRef = useRef20(onLayout);
|
|
12771
12940
|
onLayoutRef.current = onLayout;
|
|
12772
|
-
const syncInitialSizes =
|
|
12941
|
+
const syncInitialSizes = useCallback20(() => {
|
|
12773
12942
|
const panels = [...panelsRef.current.values()].sort((a, b) => a.order - b.order);
|
|
12774
12943
|
if (panels.length === 0) return;
|
|
12775
12944
|
setSizes((prev) => {
|
|
@@ -12804,7 +12973,7 @@ function ResizablePanelGroup({
|
|
|
12804
12973
|
return base;
|
|
12805
12974
|
});
|
|
12806
12975
|
}, []);
|
|
12807
|
-
const registerPanel =
|
|
12976
|
+
const registerPanel = useCallback20(
|
|
12808
12977
|
(panel) => {
|
|
12809
12978
|
const existing = panelsRef.current.get(panel.id);
|
|
12810
12979
|
const order = existing?.order ?? orderCounterRef.current++;
|
|
@@ -12813,7 +12982,7 @@ function ResizablePanelGroup({
|
|
|
12813
12982
|
},
|
|
12814
12983
|
[syncInitialSizes]
|
|
12815
12984
|
);
|
|
12816
|
-
const unregisterPanel =
|
|
12985
|
+
const unregisterPanel = useCallback20((id) => {
|
|
12817
12986
|
panelsRef.current.delete(id);
|
|
12818
12987
|
setSizes((prev) => {
|
|
12819
12988
|
if (!(id in prev)) return prev;
|
|
@@ -12822,13 +12991,13 @@ function ResizablePanelGroup({
|
|
|
12822
12991
|
return next;
|
|
12823
12992
|
});
|
|
12824
12993
|
}, []);
|
|
12825
|
-
const getPanel =
|
|
12826
|
-
const emitPanelResize =
|
|
12994
|
+
const getPanel = useCallback20((id) => panelsRef.current.get(id), []);
|
|
12995
|
+
const emitPanelResize = useCallback20((next) => {
|
|
12827
12996
|
for (const [id, size] of Object.entries(next)) {
|
|
12828
12997
|
panelsRef.current.get(id)?.onResize?.(size);
|
|
12829
12998
|
}
|
|
12830
12999
|
}, []);
|
|
12831
|
-
const resizeBetween =
|
|
13000
|
+
const resizeBetween = useCallback20(
|
|
12832
13001
|
(leftId, rightId, deltaPct) => {
|
|
12833
13002
|
setSizes((prev) => {
|
|
12834
13003
|
const next = applyResize(
|
|
@@ -12845,7 +13014,7 @@ function ResizablePanelGroup({
|
|
|
12845
13014
|
},
|
|
12846
13015
|
[emitPanelResize]
|
|
12847
13016
|
);
|
|
12848
|
-
const setBetween =
|
|
13017
|
+
const setBetween = useCallback20(
|
|
12849
13018
|
(leftId, rightId, leftSize) => {
|
|
12850
13019
|
setSizes((prev) => {
|
|
12851
13020
|
const left = panelsRef.current.get(leftId);
|
|
@@ -12876,7 +13045,7 @@ function ResizablePanelGroup({
|
|
|
12876
13045
|
if (ids.some((id) => sizes[id] === void 0)) return;
|
|
12877
13046
|
onLayoutRef.current?.(ids.map((id) => sizes[id]));
|
|
12878
13047
|
}, [sizes]);
|
|
12879
|
-
const ctx =
|
|
13048
|
+
const ctx = useMemo20(
|
|
12880
13049
|
() => ({
|
|
12881
13050
|
orientation,
|
|
12882
13051
|
groupRef,
|
|
@@ -12897,7 +13066,7 @@ function ResizablePanelGroup({
|
|
|
12897
13066
|
setBetween
|
|
12898
13067
|
]
|
|
12899
13068
|
);
|
|
12900
|
-
return /* @__PURE__ */
|
|
13069
|
+
return /* @__PURE__ */ jsx70(ResizableContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx70(
|
|
12901
13070
|
"div",
|
|
12902
13071
|
{
|
|
12903
13072
|
ref: groupRef,
|
|
@@ -12925,7 +13094,7 @@ function ResizablePanel({
|
|
|
12925
13094
|
onResize,
|
|
12926
13095
|
...props
|
|
12927
13096
|
}) {
|
|
12928
|
-
const id =
|
|
13097
|
+
const id = useId15();
|
|
12929
13098
|
const { orientation, sizes, registerPanel, unregisterPanel } = useResizableContext("ResizablePanel");
|
|
12930
13099
|
const onResizeRef = useRef20(onResize);
|
|
12931
13100
|
onResizeRef.current = onResize;
|
|
@@ -12956,7 +13125,7 @@ function ResizablePanel({
|
|
|
12956
13125
|
flexBasis: 0,
|
|
12957
13126
|
...orientation === "horizontal" ? { minWidth: `${minSize}%` } : { minHeight: `${minSize}%` }
|
|
12958
13127
|
};
|
|
12959
|
-
return /* @__PURE__ */
|
|
13128
|
+
return /* @__PURE__ */ jsx70(
|
|
12960
13129
|
"div",
|
|
12961
13130
|
{
|
|
12962
13131
|
"data-refineui": "resizable-panel",
|
|
@@ -12988,8 +13157,8 @@ function ResizableHandle({
|
|
|
12988
13157
|
setBetween
|
|
12989
13158
|
} = useResizableContext("ResizableHandle");
|
|
12990
13159
|
const handleRef = useRef20(null);
|
|
12991
|
-
const [active, setActive] =
|
|
12992
|
-
const [, setAdjacentReady] =
|
|
13160
|
+
const [active, setActive] = useState25(false);
|
|
13161
|
+
const [, setAdjacentReady] = useState25(false);
|
|
12993
13162
|
const dragRef = useRef20(null);
|
|
12994
13163
|
useLayoutEffect10(() => {
|
|
12995
13164
|
setAdjacentReady(true);
|
|
@@ -13002,7 +13171,7 @@ function ResizableHandle({
|
|
|
13002
13171
|
const ariaMin = leftPanel?.minSize ?? 0;
|
|
13003
13172
|
const ariaMax = leftPanel?.maxSize ?? DEFAULT_MAX_SIZE;
|
|
13004
13173
|
const defaultKeyshortcuts = orientation === "horizontal" ? "ArrowLeft ArrowRight Home End" : "ArrowUp ArrowDown Home End";
|
|
13005
|
-
const keepFocus =
|
|
13174
|
+
const keepFocus = useCallback20(() => {
|
|
13006
13175
|
const el = handleRef.current;
|
|
13007
13176
|
if (el && document.activeElement !== el) {
|
|
13008
13177
|
el.focus({ preventScroll: true });
|
|
@@ -13101,7 +13270,7 @@ function ResizableHandle({
|
|
|
13101
13270
|
resizeBetween(leftId, rightId, delta);
|
|
13102
13271
|
queueMicrotask(keepFocus);
|
|
13103
13272
|
};
|
|
13104
|
-
return /* @__PURE__ */
|
|
13273
|
+
return /* @__PURE__ */ jsx70(
|
|
13105
13274
|
"div",
|
|
13106
13275
|
{
|
|
13107
13276
|
ref: handleRef,
|
|
@@ -13131,7 +13300,7 @@ function ResizableHandle({
|
|
|
13131
13300
|
onPointerUp: handlePointerUp,
|
|
13132
13301
|
onPointerCancel: handlePointerUp,
|
|
13133
13302
|
onKeyDown: handleKeyDown,
|
|
13134
|
-
children: withHandle ? /* @__PURE__ */
|
|
13303
|
+
children: withHandle ? /* @__PURE__ */ jsx70(
|
|
13135
13304
|
"span",
|
|
13136
13305
|
{
|
|
13137
13306
|
"aria-hidden": true,
|
|
@@ -13147,7 +13316,7 @@ function ResizableHandle({
|
|
|
13147
13316
|
|
|
13148
13317
|
// src/components/SpinButton/SpinButton.tsx
|
|
13149
13318
|
import { clsx as clsx96 } from "clsx";
|
|
13150
|
-
import { useEffect as useEffect17, useState as
|
|
13319
|
+
import { useEffect as useEffect17, useState as useState26 } from "react";
|
|
13151
13320
|
import { iconSizes as iconSizes20 } from "@refineui/tokens";
|
|
13152
13321
|
|
|
13153
13322
|
// src/components/SpinButton/style.ts
|
|
@@ -13171,7 +13340,7 @@ var spinButtonShellClass = formControlShellHeightClass;
|
|
|
13171
13340
|
var spinButtonValueTypo = formControlTypoClass;
|
|
13172
13341
|
|
|
13173
13342
|
// src/components/SpinButton/SpinButton.tsx
|
|
13174
|
-
import { jsx as
|
|
13343
|
+
import { jsx as jsx71, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
13175
13344
|
function SpinButton({
|
|
13176
13345
|
value,
|
|
13177
13346
|
onChange,
|
|
@@ -13185,7 +13354,7 @@ function SpinButton({
|
|
|
13185
13354
|
onKeyDown,
|
|
13186
13355
|
...props
|
|
13187
13356
|
}) {
|
|
13188
|
-
const [draftValue, setDraftValue] =
|
|
13357
|
+
const [draftValue, setDraftValue] = useState26(String(value));
|
|
13189
13358
|
useEffect17(() => {
|
|
13190
13359
|
setDraftValue(String(value));
|
|
13191
13360
|
}, [value]);
|
|
@@ -13297,7 +13466,7 @@ function SpinButton({
|
|
|
13297
13466
|
...props,
|
|
13298
13467
|
onKeyDown: handleKeyDown,
|
|
13299
13468
|
children: [
|
|
13300
|
-
/* @__PURE__ */
|
|
13469
|
+
/* @__PURE__ */ jsx71(
|
|
13301
13470
|
"div",
|
|
13302
13471
|
{
|
|
13303
13472
|
"aria-live": "polite",
|
|
@@ -13308,7 +13477,7 @@ function SpinButton({
|
|
|
13308
13477
|
disabled ? spinButtonStyles.valueTextDisabled : spinButtonStyles.valueTextDefault,
|
|
13309
13478
|
disabled ? spinButtonStyles.bgDisabled : spinButtonStyles.bgDefault
|
|
13310
13479
|
),
|
|
13311
|
-
children: /* @__PURE__ */
|
|
13480
|
+
children: /* @__PURE__ */ jsx71(
|
|
13312
13481
|
"input",
|
|
13313
13482
|
{
|
|
13314
13483
|
type: "text",
|
|
@@ -13341,7 +13510,7 @@ function SpinButton({
|
|
|
13341
13510
|
disabled ? spinButtonStyles.bgDisabled : spinButtonStyles.bgDefault
|
|
13342
13511
|
),
|
|
13343
13512
|
children: [
|
|
13344
|
-
/* @__PURE__ */
|
|
13513
|
+
/* @__PURE__ */ jsx71(
|
|
13345
13514
|
"button",
|
|
13346
13515
|
{
|
|
13347
13516
|
type: "button",
|
|
@@ -13353,7 +13522,7 @@ function SpinButton({
|
|
|
13353
13522
|
spinButtonStyles.stepButtonBase,
|
|
13354
13523
|
disabled || atMax ? spinButtonStyles.stepButtonDisabled : spinButtonStyles.stepButtonEnabled
|
|
13355
13524
|
),
|
|
13356
|
-
children: /* @__PURE__ */
|
|
13525
|
+
children: /* @__PURE__ */ jsx71(
|
|
13357
13526
|
WebIcon,
|
|
13358
13527
|
{
|
|
13359
13528
|
name: "chevron-up",
|
|
@@ -13365,7 +13534,7 @@ function SpinButton({
|
|
|
13365
13534
|
)
|
|
13366
13535
|
}
|
|
13367
13536
|
),
|
|
13368
|
-
/* @__PURE__ */
|
|
13537
|
+
/* @__PURE__ */ jsx71(
|
|
13369
13538
|
"button",
|
|
13370
13539
|
{
|
|
13371
13540
|
type: "button",
|
|
@@ -13377,7 +13546,7 @@ function SpinButton({
|
|
|
13377
13546
|
spinButtonStyles.stepButtonBase,
|
|
13378
13547
|
disabled || atMin ? spinButtonStyles.stepButtonDisabled : spinButtonStyles.stepButtonEnabled
|
|
13379
13548
|
),
|
|
13380
|
-
children: /* @__PURE__ */
|
|
13549
|
+
children: /* @__PURE__ */ jsx71(
|
|
13381
13550
|
WebIcon,
|
|
13382
13551
|
{
|
|
13383
13552
|
name: "chevron-down",
|
|
@@ -13400,16 +13569,16 @@ function SpinButton({
|
|
|
13400
13569
|
// src/components/Toast/Toast.tsx
|
|
13401
13570
|
import { clsx as clsx98 } from "clsx";
|
|
13402
13571
|
import {
|
|
13403
|
-
forwardRef as
|
|
13404
|
-
useCallback as
|
|
13572
|
+
forwardRef as forwardRef16,
|
|
13573
|
+
useCallback as useCallback21,
|
|
13405
13574
|
useEffect as useEffect18,
|
|
13406
13575
|
useLayoutEffect as useLayoutEffect11,
|
|
13407
13576
|
useRef as useRef21,
|
|
13408
|
-
useState as
|
|
13577
|
+
useState as useState27,
|
|
13409
13578
|
useSyncExternalStore
|
|
13410
13579
|
} from "react";
|
|
13411
|
-
import { createPortal as
|
|
13412
|
-
import { iconSizes as iconSizes21, spacings as
|
|
13580
|
+
import { createPortal as createPortal7 } from "react-dom";
|
|
13581
|
+
import { iconSizes as iconSizes21, spacings as spacings6 } from "@refineui/tokens";
|
|
13413
13582
|
import { motionMsToNumber as motionMsToNumber6 } from "@refineui/utilities/animation";
|
|
13414
13583
|
import { resolveColorTokenValue as resolveColorTokenValue11 } from "@refineui/utilities/color";
|
|
13415
13584
|
|
|
@@ -13444,7 +13613,7 @@ var toastStyles = {
|
|
|
13444
13613
|
};
|
|
13445
13614
|
|
|
13446
13615
|
// src/components/Toast/Toast.tsx
|
|
13447
|
-
import { jsx as
|
|
13616
|
+
import { jsx as jsx72, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
13448
13617
|
var useIsomorphicLayoutEffect6 = typeof document !== "undefined" ? useLayoutEffect11 : useEffect18;
|
|
13449
13618
|
var ENTER_MS = 20;
|
|
13450
13619
|
var LEAVE_MS = motionMsToNumber6(componentTokens.toast.motion.leave) + 60;
|
|
@@ -13468,10 +13637,10 @@ function gapPxFromSpacingToken(token) {
|
|
|
13468
13637
|
var TOAST_NARROW_STACK_MQ = "(max-width: 480px), (hover: none)";
|
|
13469
13638
|
function readToastStackGapPx() {
|
|
13470
13639
|
if (typeof globalThis.matchMedia === "undefined") {
|
|
13471
|
-
return gapPxFromSpacingToken(String(
|
|
13640
|
+
return gapPxFromSpacingToken(String(spacings6.sizeLarge));
|
|
13472
13641
|
}
|
|
13473
13642
|
const mq = globalThis.matchMedia(TOAST_NARROW_STACK_MQ);
|
|
13474
|
-
return gapPxFromSpacingToken(mq.matches ? String(
|
|
13643
|
+
return gapPxFromSpacingToken(mq.matches ? String(spacings6.sizeMedium) : String(spacings6.sizeLarge));
|
|
13475
13644
|
}
|
|
13476
13645
|
function subscribeToastStackGap(onChange) {
|
|
13477
13646
|
if (typeof globalThis.matchMedia === "undefined") return () => {
|
|
@@ -13484,7 +13653,7 @@ function useToastStackGapPx() {
|
|
|
13484
13653
|
return useSyncExternalStore(
|
|
13485
13654
|
subscribeToastStackGap,
|
|
13486
13655
|
readToastStackGapPx,
|
|
13487
|
-
() => gapPxFromSpacingToken(String(
|
|
13656
|
+
() => gapPxFromSpacingToken(String(spacings6.sizeLarge))
|
|
13488
13657
|
);
|
|
13489
13658
|
}
|
|
13490
13659
|
function readToastNaturalHeight(li) {
|
|
@@ -13623,7 +13792,7 @@ var variantIconNames = {
|
|
|
13623
13792
|
error: "error-circle",
|
|
13624
13793
|
warning: "warning"
|
|
13625
13794
|
};
|
|
13626
|
-
var Toast =
|
|
13795
|
+
var Toast = forwardRef16(function Toast2(props, ref) {
|
|
13627
13796
|
const { variant = "default", message, iconName, icon, action, className, stackState, style, ...rest } = props;
|
|
13628
13797
|
const domProps = { ...rest };
|
|
13629
13798
|
delete domProps.iconName;
|
|
@@ -13632,7 +13801,7 @@ var Toast = forwardRef15(function Toast2(props, ref) {
|
|
|
13632
13801
|
const liveRole = variant === "error" ? "alert" : "status";
|
|
13633
13802
|
const ariaLive = variant === "error" ? void 0 : variant === "warning" ? "assertive" : "polite";
|
|
13634
13803
|
const resolvedIconName = iconName ?? variantIconNames[variant];
|
|
13635
|
-
const iconContent = icon ?? /* @__PURE__ */
|
|
13804
|
+
const iconContent = icon ?? /* @__PURE__ */ jsx72(
|
|
13636
13805
|
WebIcon,
|
|
13637
13806
|
{
|
|
13638
13807
|
name: resolvedIconName,
|
|
@@ -13642,7 +13811,7 @@ var Toast = forwardRef15(function Toast2(props, ref) {
|
|
|
13642
13811
|
}
|
|
13643
13812
|
);
|
|
13644
13813
|
const isPrimaryAction = !action || typeof action !== "object" || !("variant" in action) || action.variant === "primary";
|
|
13645
|
-
const actionEl = typeof action === "object" && action !== null && "label" in action ? /* @__PURE__ */
|
|
13814
|
+
const actionEl = typeof action === "object" && action !== null && "label" in action ? /* @__PURE__ */ jsx72(
|
|
13646
13815
|
Button,
|
|
13647
13816
|
{
|
|
13648
13817
|
variant: isPrimaryAction ? "primary" : "outline",
|
|
@@ -13671,8 +13840,8 @@ var Toast = forwardRef15(function Toast2(props, ref) {
|
|
|
13671
13840
|
style: { ...tokenStyle, ...style },
|
|
13672
13841
|
className: clsx98(toastStyles.card, className),
|
|
13673
13842
|
children: [
|
|
13674
|
-
/* @__PURE__ */
|
|
13675
|
-
/* @__PURE__ */
|
|
13843
|
+
/* @__PURE__ */ jsx72("div", { "data-refineui": "toast-icon", className: toastStyles.iconWrap, children: iconContent }),
|
|
13844
|
+
/* @__PURE__ */ jsx72("div", { className: toastStyles.contentWrap, children: message != null && message !== "" ? /* @__PURE__ */ jsx72("div", { className: toastStyles.message, children: message }) : null }),
|
|
13676
13845
|
action != null && actionEl
|
|
13677
13846
|
]
|
|
13678
13847
|
}
|
|
@@ -13683,8 +13852,8 @@ function SwipeableToast({ record, index, swipeDirections, onSwipeStart, onSwipeE
|
|
|
13683
13852
|
const dragStartRef = useRef21(null);
|
|
13684
13853
|
const axisRef = useRef21(null);
|
|
13685
13854
|
const offsetRef = useRef21({ x: 0, y: 0 });
|
|
13686
|
-
const [swiping, setSwiping] =
|
|
13687
|
-
const clearSwipeOffset =
|
|
13855
|
+
const [swiping, setSwiping] = useState27(false);
|
|
13856
|
+
const clearSwipeOffset = useCallback21(() => {
|
|
13688
13857
|
const el = toastRef.current;
|
|
13689
13858
|
offsetRef.current = { x: 0, y: 0 };
|
|
13690
13859
|
if (!el) return;
|
|
@@ -13759,7 +13928,7 @@ function SwipeableToast({ record, index, swipeDirections, onSwipeStart, onSwipeE
|
|
|
13759
13928
|
clearSwipeOffset();
|
|
13760
13929
|
onSwipeEnd();
|
|
13761
13930
|
};
|
|
13762
|
-
return /* @__PURE__ */
|
|
13931
|
+
return /* @__PURE__ */ jsx72(
|
|
13763
13932
|
Toast,
|
|
13764
13933
|
{
|
|
13765
13934
|
ref: toastRef,
|
|
@@ -13794,12 +13963,12 @@ function Toaster({
|
|
|
13794
13963
|
() => activeToasterKey === toasterKeyRef.current,
|
|
13795
13964
|
() => false
|
|
13796
13965
|
);
|
|
13797
|
-
const [records, setRecords] =
|
|
13966
|
+
const [records, setRecords] = useState27([]);
|
|
13798
13967
|
const timerMapRef = useRef21({});
|
|
13799
13968
|
const pausedRef = useRef21(/* @__PURE__ */ new Set());
|
|
13800
13969
|
const rootRef = useRef21(null);
|
|
13801
13970
|
const itemRefs = useRef21({});
|
|
13802
|
-
const [layoutTick, setLayoutTick] =
|
|
13971
|
+
const [layoutTick, setLayoutTick] = useState27(0);
|
|
13803
13972
|
const stackGapPx = useToastStackGapPx();
|
|
13804
13973
|
const resolvedSwipe = swipeDirections ?? DEFAULT_SWIPE_DIRECTIONS;
|
|
13805
13974
|
useIsomorphicLayoutEffect6(() => {
|
|
@@ -13900,8 +14069,8 @@ function Toaster({
|
|
|
13900
14069
|
if (typeof document === "undefined" || !isPortalOwner) {
|
|
13901
14070
|
return null;
|
|
13902
14071
|
}
|
|
13903
|
-
return
|
|
13904
|
-
/* @__PURE__ */
|
|
14072
|
+
return createPortal7(
|
|
14073
|
+
/* @__PURE__ */ jsx72(
|
|
13905
14074
|
"ol",
|
|
13906
14075
|
{
|
|
13907
14076
|
ref: rootRef,
|
|
@@ -13912,7 +14081,7 @@ function Toaster({
|
|
|
13912
14081
|
style: {
|
|
13913
14082
|
["--refineui-toast-gap"]: `${stackGapPx}px`
|
|
13914
14083
|
},
|
|
13915
|
-
children: records.map((rec, index) => /* @__PURE__ */
|
|
14084
|
+
children: records.map((rec, index) => /* @__PURE__ */ jsx72(
|
|
13916
14085
|
"li",
|
|
13917
14086
|
{
|
|
13918
14087
|
ref: (node) => {
|
|
@@ -13926,7 +14095,7 @@ function Toaster({
|
|
|
13926
14095
|
["--refineui-toast-z-index"]: String(STACK_Z_BASE - index),
|
|
13927
14096
|
["--refineui-toast-stack-index"]: String(index)
|
|
13928
14097
|
},
|
|
13929
|
-
children: /* @__PURE__ */
|
|
14098
|
+
children: /* @__PURE__ */ jsx72("div", { "data-refineui": "toast-scale-layer", children: /* @__PURE__ */ jsx72(
|
|
13930
14099
|
SwipeableToast,
|
|
13931
14100
|
{
|
|
13932
14101
|
record: rec,
|
|
@@ -13948,24 +14117,24 @@ function Toaster({
|
|
|
13948
14117
|
// src/components/Tree/Tree.tsx
|
|
13949
14118
|
import { clsx as clsx100 } from "clsx";
|
|
13950
14119
|
import {
|
|
13951
|
-
useCallback as
|
|
13952
|
-
useMemo as
|
|
14120
|
+
useCallback as useCallback22,
|
|
14121
|
+
useMemo as useMemo21,
|
|
13953
14122
|
useRef as useRef22,
|
|
13954
|
-
useState as
|
|
14123
|
+
useState as useState29
|
|
13955
14124
|
} from "react";
|
|
13956
14125
|
|
|
13957
14126
|
// src/components/Tree/context.ts
|
|
13958
|
-
import { createContext as
|
|
14127
|
+
import { createContext as createContext26, useEffect as useEffect19, useState as useState28 } from "react";
|
|
13959
14128
|
import { semanticInteraction as semanticInteraction8 } from "@refineui/tokens";
|
|
13960
14129
|
import { getReducedMotionQuery as getReducedMotionQuery2 } from "@refineui/utilities/animation";
|
|
13961
14130
|
var TREE_PANEL_MS = Number.parseFloat(semanticInteraction8.duration.accordionPanel) / 1e3;
|
|
13962
14131
|
var TREE_CONTENT_MS = Number.parseFloat(semanticInteraction8.duration.accordionContent) / 1e3;
|
|
13963
14132
|
var TREE_PANEL_EASE = semanticInteraction8.easing.panel;
|
|
13964
14133
|
var TREE_CONTENT_EASE = semanticInteraction8.easing.content;
|
|
13965
|
-
var TreeContext =
|
|
13966
|
-
var TreeItemContext =
|
|
14134
|
+
var TreeContext = createContext26(null);
|
|
14135
|
+
var TreeItemContext = createContext26(null);
|
|
13967
14136
|
function usePrefersReducedMotion2() {
|
|
13968
|
-
const [reduce, setReduce] =
|
|
14137
|
+
const [reduce, setReduce] = useState28(false);
|
|
13969
14138
|
useEffect19(() => {
|
|
13970
14139
|
const mql = window.matchMedia(getReducedMotionQuery2().replace("@media ", ""));
|
|
13971
14140
|
const sync = () => setReduce(mql.matches);
|
|
@@ -14021,7 +14190,7 @@ var treeItemTypo = {
|
|
|
14021
14190
|
};
|
|
14022
14191
|
|
|
14023
14192
|
// src/components/Tree/Tree.tsx
|
|
14024
|
-
import { jsx as
|
|
14193
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
14025
14194
|
function Tree({
|
|
14026
14195
|
size = "md",
|
|
14027
14196
|
defaultExpanded,
|
|
@@ -14035,29 +14204,29 @@ function Tree({
|
|
|
14035
14204
|
...props
|
|
14036
14205
|
}) {
|
|
14037
14206
|
const reduceMotion = usePrefersReducedMotion2();
|
|
14038
|
-
const [uncontrolledExpanded, setUncontrolledExpanded] =
|
|
14039
|
-
const [uncontrolledSelected, setUncontrolledSelected] =
|
|
14207
|
+
const [uncontrolledExpanded, setUncontrolledExpanded] = useState29(() => toExpandedSet(defaultExpanded));
|
|
14208
|
+
const [uncontrolledSelected, setUncontrolledSelected] = useState29(defaultSelected ?? null);
|
|
14040
14209
|
const expanded = expandedProp === void 0 ? uncontrolledExpanded : toExpandedSet(expandedProp);
|
|
14041
14210
|
const selected = selectedProp === void 0 ? uncontrolledSelected : selectedProp;
|
|
14042
14211
|
const orderRef = useRef22([]);
|
|
14043
14212
|
const elMapRef = useRef22(/* @__PURE__ */ new Map());
|
|
14044
14213
|
const metaMapRef = useRef22(/* @__PURE__ */ new Map());
|
|
14045
|
-
const emitExpanded =
|
|
14214
|
+
const emitExpanded = useCallback22(
|
|
14046
14215
|
(next) => {
|
|
14047
14216
|
if (expandedProp === void 0) setUncontrolledExpanded(next);
|
|
14048
14217
|
onExpandedChange?.(Array.from(next));
|
|
14049
14218
|
},
|
|
14050
14219
|
[expandedProp, onExpandedChange]
|
|
14051
14220
|
);
|
|
14052
|
-
const emitSelected =
|
|
14221
|
+
const emitSelected = useCallback22(
|
|
14053
14222
|
(next) => {
|
|
14054
14223
|
if (selectedProp === void 0) setUncontrolledSelected(next);
|
|
14055
14224
|
onSelectedChange?.(next);
|
|
14056
14225
|
},
|
|
14057
14226
|
[onSelectedChange, selectedProp]
|
|
14058
14227
|
);
|
|
14059
|
-
const isExpanded =
|
|
14060
|
-
const toggleExpanded =
|
|
14228
|
+
const isExpanded = useCallback22((value) => expanded.has(value), [expanded]);
|
|
14229
|
+
const toggleExpanded = useCallback22(
|
|
14061
14230
|
(value) => {
|
|
14062
14231
|
const next = new Set(expanded);
|
|
14063
14232
|
if (next.has(value)) next.delete(value);
|
|
@@ -14066,7 +14235,7 @@ function Tree({
|
|
|
14066
14235
|
},
|
|
14067
14236
|
[emitExpanded, expanded]
|
|
14068
14237
|
);
|
|
14069
|
-
const expand =
|
|
14238
|
+
const expand = useCallback22(
|
|
14070
14239
|
(value) => {
|
|
14071
14240
|
if (expanded.has(value)) return;
|
|
14072
14241
|
const next = new Set(expanded);
|
|
@@ -14075,7 +14244,7 @@ function Tree({
|
|
|
14075
14244
|
},
|
|
14076
14245
|
[emitExpanded, expanded]
|
|
14077
14246
|
);
|
|
14078
|
-
const collapse =
|
|
14247
|
+
const collapse = useCallback22(
|
|
14079
14248
|
(value) => {
|
|
14080
14249
|
if (!expanded.has(value)) return;
|
|
14081
14250
|
const next = new Set(expanded);
|
|
@@ -14084,13 +14253,13 @@ function Tree({
|
|
|
14084
14253
|
},
|
|
14085
14254
|
[emitExpanded, expanded]
|
|
14086
14255
|
);
|
|
14087
|
-
const select =
|
|
14256
|
+
const select = useCallback22(
|
|
14088
14257
|
(value) => {
|
|
14089
14258
|
emitSelected(value);
|
|
14090
14259
|
},
|
|
14091
14260
|
[emitSelected]
|
|
14092
14261
|
);
|
|
14093
|
-
const registerItem =
|
|
14262
|
+
const registerItem = useCallback22((value, el, meta) => {
|
|
14094
14263
|
metaMapRef.current.set(value, meta);
|
|
14095
14264
|
if (!orderRef.current.includes(value)) {
|
|
14096
14265
|
orderRef.current.push(value);
|
|
@@ -14102,10 +14271,10 @@ function Tree({
|
|
|
14102
14271
|
orderRef.current = orderRef.current.filter((v) => v !== value);
|
|
14103
14272
|
}
|
|
14104
14273
|
}, []);
|
|
14105
|
-
const focusItem =
|
|
14274
|
+
const focusItem = useCallback22((value) => {
|
|
14106
14275
|
elMapRef.current.get(value)?.focus();
|
|
14107
14276
|
}, []);
|
|
14108
|
-
const visibleValues =
|
|
14277
|
+
const visibleValues = useCallback22(() => {
|
|
14109
14278
|
const result = [];
|
|
14110
14279
|
const walk = (parent) => {
|
|
14111
14280
|
for (const value of orderRef.current) {
|
|
@@ -14119,7 +14288,7 @@ function Tree({
|
|
|
14119
14288
|
walk(null);
|
|
14120
14289
|
return result;
|
|
14121
14290
|
}, [expanded]);
|
|
14122
|
-
const focusByDelta =
|
|
14291
|
+
const focusByDelta = useCallback22(
|
|
14123
14292
|
(currentValue, delta) => {
|
|
14124
14293
|
const list = visibleValues();
|
|
14125
14294
|
const idx = list.indexOf(currentValue);
|
|
@@ -14129,17 +14298,17 @@ function Tree({
|
|
|
14129
14298
|
},
|
|
14130
14299
|
[focusItem, visibleValues]
|
|
14131
14300
|
);
|
|
14132
|
-
const focusFirst =
|
|
14301
|
+
const focusFirst = useCallback22(() => {
|
|
14133
14302
|
const list = visibleValues();
|
|
14134
14303
|
if (list[0]) focusItem(list[0]);
|
|
14135
14304
|
}, [focusItem, visibleValues]);
|
|
14136
|
-
const focusLast =
|
|
14305
|
+
const focusLast = useCallback22(() => {
|
|
14137
14306
|
const list = visibleValues();
|
|
14138
14307
|
const last = list[list.length - 1];
|
|
14139
14308
|
if (last) focusItem(last);
|
|
14140
14309
|
}, [focusItem, visibleValues]);
|
|
14141
|
-
const getParent =
|
|
14142
|
-
const contextValue =
|
|
14310
|
+
const getParent = useCallback22((value) => metaMapRef.current.get(value)?.parentValue ?? null, []);
|
|
14311
|
+
const contextValue = useMemo21(
|
|
14143
14312
|
() => ({
|
|
14144
14313
|
size,
|
|
14145
14314
|
isExpanded,
|
|
@@ -14173,7 +14342,7 @@ function Tree({
|
|
|
14173
14342
|
toggleExpanded
|
|
14174
14343
|
]
|
|
14175
14344
|
);
|
|
14176
|
-
return /* @__PURE__ */
|
|
14345
|
+
return /* @__PURE__ */ jsx73(TreeContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx73(
|
|
14177
14346
|
"ul",
|
|
14178
14347
|
{
|
|
14179
14348
|
"data-refineui": "tree",
|
|
@@ -14187,21 +14356,21 @@ function Tree({
|
|
|
14187
14356
|
|
|
14188
14357
|
// src/components/Tree/TreeItem.tsx
|
|
14189
14358
|
import { clsx as clsx101 } from "clsx";
|
|
14190
|
-
import { useContext as
|
|
14191
|
-
import { jsx as
|
|
14359
|
+
import { useContext as useContext28, useId as useId16, useMemo as useMemo22, useState as useState30 } from "react";
|
|
14360
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
14192
14361
|
function TreeItem({ value, disabled = false, className, children, ...props }) {
|
|
14193
|
-
const tree =
|
|
14194
|
-
const parent =
|
|
14362
|
+
const tree = useContext28(TreeContext);
|
|
14363
|
+
const parent = useContext28(TreeItemContext);
|
|
14195
14364
|
if (!tree) throw new Error("TreeItem must be used within Tree.");
|
|
14196
|
-
const [hasBranch, setHasBranch] =
|
|
14197
|
-
const uid =
|
|
14365
|
+
const [hasBranch, setHasBranch] = useState30(false);
|
|
14366
|
+
const uid = useId16().replace(/:/g, "");
|
|
14198
14367
|
const depth = parent ? parent.depth + 1 : 0;
|
|
14199
14368
|
const parentValue = parent?.value ?? null;
|
|
14200
14369
|
const expanded = tree.isExpanded(value);
|
|
14201
14370
|
const selected = tree.selected === value;
|
|
14202
14371
|
const triggerId = `tree-trigger-${uid}-${value}`;
|
|
14203
14372
|
const groupId = `tree-group-${uid}-${value}`;
|
|
14204
|
-
const itemContext =
|
|
14373
|
+
const itemContext = useMemo22(
|
|
14205
14374
|
() => ({
|
|
14206
14375
|
value,
|
|
14207
14376
|
depth,
|
|
@@ -14216,7 +14385,7 @@ function TreeItem({ value, disabled = false, className, children, ...props }) {
|
|
|
14216
14385
|
}),
|
|
14217
14386
|
[value, depth, parentValue, expanded, selected, disabled, hasBranch, triggerId, groupId]
|
|
14218
14387
|
);
|
|
14219
|
-
return /* @__PURE__ */
|
|
14388
|
+
return /* @__PURE__ */ jsx74(TreeItemContext.Provider, { value: itemContext, children: /* @__PURE__ */ jsx74(
|
|
14220
14389
|
"li",
|
|
14221
14390
|
{
|
|
14222
14391
|
"data-refineui": "tree-item",
|
|
@@ -14238,13 +14407,13 @@ function TreeItem({ value, disabled = false, className, children, ...props }) {
|
|
|
14238
14407
|
// src/components/Tree/TreeItemTrigger.tsx
|
|
14239
14408
|
import { clsx as clsx102 } from "clsx";
|
|
14240
14409
|
import {
|
|
14241
|
-
useContext as
|
|
14410
|
+
useContext as useContext29,
|
|
14242
14411
|
useEffect as useEffect20
|
|
14243
14412
|
} from "react";
|
|
14244
|
-
import { jsx as
|
|
14413
|
+
import { jsx as jsx75, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
14245
14414
|
function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props }) {
|
|
14246
|
-
const tree =
|
|
14247
|
-
const item =
|
|
14415
|
+
const tree = useContext29(TreeContext);
|
|
14416
|
+
const item = useContext29(TreeItemContext);
|
|
14248
14417
|
if (!tree || !item) throw new Error("TreeItemTrigger must be used within TreeItem.");
|
|
14249
14418
|
const iconSize = treeIconSize[tree.size];
|
|
14250
14419
|
const depthIndent = "calc(var(--refineui-spacing-size-large) + var(--refineui-spacing-size-x-small))";
|
|
@@ -14327,7 +14496,7 @@ function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props })
|
|
|
14327
14496
|
break;
|
|
14328
14497
|
}
|
|
14329
14498
|
};
|
|
14330
|
-
return /* @__PURE__ */
|
|
14499
|
+
return /* @__PURE__ */ jsx75(
|
|
14331
14500
|
"div",
|
|
14332
14501
|
{
|
|
14333
14502
|
ref: setRowRef,
|
|
@@ -14347,7 +14516,7 @@ function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props })
|
|
|
14347
14516
|
),
|
|
14348
14517
|
...props,
|
|
14349
14518
|
children: /* @__PURE__ */ jsxs30("div", { "data-refineui": "tree-item-main", className: treeStyles.rowMain, style: mainStyle, children: [
|
|
14350
|
-
item.hasBranch ? /* @__PURE__ */
|
|
14519
|
+
item.hasBranch ? /* @__PURE__ */ jsx75(
|
|
14351
14520
|
"button",
|
|
14352
14521
|
{
|
|
14353
14522
|
type: "button",
|
|
@@ -14361,10 +14530,10 @@ function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props })
|
|
|
14361
14530
|
item.expanded && treeStyles.chevronExpanded,
|
|
14362
14531
|
tree.reduceMotion && "transition-none"
|
|
14363
14532
|
),
|
|
14364
|
-
children: /* @__PURE__ */
|
|
14533
|
+
children: /* @__PURE__ */ jsx75(WebIcon, { name: "chevron-right", size: iconSize, color: "currentColor", fallback: "\u203A" })
|
|
14365
14534
|
}
|
|
14366
|
-
) : /* @__PURE__ */
|
|
14367
|
-
/* @__PURE__ */
|
|
14535
|
+
) : /* @__PURE__ */ jsx75("span", { className: treeStyles.chevronSpacer, "aria-hidden": "true" }),
|
|
14536
|
+
/* @__PURE__ */ jsx75("span", { className: treeStyles.label, children })
|
|
14368
14537
|
] })
|
|
14369
14538
|
}
|
|
14370
14539
|
);
|
|
@@ -14372,11 +14541,11 @@ function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props })
|
|
|
14372
14541
|
|
|
14373
14542
|
// src/components/Tree/TreeItemContent.tsx
|
|
14374
14543
|
import { clsx as clsx103 } from "clsx";
|
|
14375
|
-
import { useContext as
|
|
14376
|
-
import { jsx as
|
|
14544
|
+
import { useContext as useContext30, useLayoutEffect as useLayoutEffect12 } from "react";
|
|
14545
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
14377
14546
|
function TreeItemContent({ className, children, ...props }) {
|
|
14378
|
-
const tree =
|
|
14379
|
-
const item =
|
|
14547
|
+
const tree = useContext30(TreeContext);
|
|
14548
|
+
const item = useContext30(TreeItemContext);
|
|
14380
14549
|
if (!tree || !item) throw new Error("TreeItemContent must be used within TreeItem.");
|
|
14381
14550
|
const { setHasBranch, expanded, groupId, triggerId } = item;
|
|
14382
14551
|
useLayoutEffect12(() => {
|
|
@@ -14394,7 +14563,7 @@ function TreeItemContent({ className, children, ...props }) {
|
|
|
14394
14563
|
transition: tree.reduceMotion ? void 0 : `opacity ${TREE_CONTENT_MS}s ${TREE_CONTENT_EASE}, transform ${TREE_CONTENT_MS}s ${TREE_CONTENT_EASE}`,
|
|
14395
14564
|
pointerEvents: expanded ? void 0 : "none"
|
|
14396
14565
|
};
|
|
14397
|
-
return /* @__PURE__ */
|
|
14566
|
+
return /* @__PURE__ */ jsx76(
|
|
14398
14567
|
"div",
|
|
14399
14568
|
{
|
|
14400
14569
|
ref: (el) => {
|
|
@@ -14405,7 +14574,7 @@ function TreeItemContent({ className, children, ...props }) {
|
|
|
14405
14574
|
"data-refineui": "tree-item-panel",
|
|
14406
14575
|
"aria-hidden": !expanded,
|
|
14407
14576
|
style: gridStyle,
|
|
14408
|
-
children: /* @__PURE__ */
|
|
14577
|
+
children: /* @__PURE__ */ jsx76("div", { className: treeStyles.panel, children: /* @__PURE__ */ jsx76("div", { className: treeStyles.panelInner, style: innerMotionStyle, children: /* @__PURE__ */ jsx76(
|
|
14409
14578
|
"ul",
|
|
14410
14579
|
{
|
|
14411
14580
|
id: groupId,
|
|
@@ -14423,19 +14592,72 @@ function TreeItemContent({ className, children, ...props }) {
|
|
|
14423
14592
|
|
|
14424
14593
|
// src/components/Tooltip/Tooltip.tsx
|
|
14425
14594
|
import { clsx as clsx105 } from "clsx";
|
|
14426
|
-
import { useId as
|
|
14595
|
+
import { useId as useId17, useRef as useRef23, useState as useState31 } from "react";
|
|
14427
14596
|
import { resolveColorTokenValue as resolveColorTokenValue12 } from "@refineui/utilities/color";
|
|
14428
|
-
import { Slot as
|
|
14597
|
+
import { Slot as Slot5, getMergeableTriggerChild as getMergeableTriggerChild4 } from "@refineui/utilities/react";
|
|
14598
|
+
|
|
14599
|
+
// src/components/shared/FrostedBeak.tsx
|
|
14600
|
+
import { strokeWidths as strokeWidths3 } from "@refineui/tokens";
|
|
14601
|
+
import { jsx as jsx77, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
14602
|
+
var triangleClipPath = "polygon(50% 0, 0 100%, 100% 100%)";
|
|
14603
|
+
function FrostedBeak({ width, height, rotateDeg, borderColor }) {
|
|
14604
|
+
const surfaceStyle = {
|
|
14605
|
+
position: "absolute",
|
|
14606
|
+
inset: 0,
|
|
14607
|
+
clipPath: triangleClipPath
|
|
14608
|
+
};
|
|
14609
|
+
return /* @__PURE__ */ jsxs31(
|
|
14610
|
+
"div",
|
|
14611
|
+
{
|
|
14612
|
+
style: {
|
|
14613
|
+
position: "relative",
|
|
14614
|
+
width,
|
|
14615
|
+
height,
|
|
14616
|
+
transform: `rotate(${rotateDeg}deg)`,
|
|
14617
|
+
transformOrigin: "center center"
|
|
14618
|
+
},
|
|
14619
|
+
children: [
|
|
14620
|
+
/* @__PURE__ */ jsx77(
|
|
14621
|
+
"span",
|
|
14622
|
+
{
|
|
14623
|
+
"data-refineui": "floating-beak-surface",
|
|
14624
|
+
style: surfaceStyle
|
|
14625
|
+
}
|
|
14626
|
+
),
|
|
14627
|
+
/* @__PURE__ */ jsx77(
|
|
14628
|
+
"svg",
|
|
14629
|
+
{
|
|
14630
|
+
width,
|
|
14631
|
+
height,
|
|
14632
|
+
viewBox: "0 0 16 8",
|
|
14633
|
+
fill: "none",
|
|
14634
|
+
"aria-hidden": true,
|
|
14635
|
+
style: { position: "absolute", inset: 0, overflow: "visible" },
|
|
14636
|
+
children: /* @__PURE__ */ jsx77(
|
|
14637
|
+
"path",
|
|
14638
|
+
{
|
|
14639
|
+
d: "M0 8L8 0L16 8",
|
|
14640
|
+
stroke: borderColor,
|
|
14641
|
+
strokeWidth: strokeWidths3.strokeWidthThin,
|
|
14642
|
+
strokeLinejoin: "round"
|
|
14643
|
+
}
|
|
14644
|
+
)
|
|
14645
|
+
}
|
|
14646
|
+
)
|
|
14647
|
+
]
|
|
14648
|
+
}
|
|
14649
|
+
);
|
|
14650
|
+
}
|
|
14429
14651
|
|
|
14430
14652
|
// src/components/Tooltip/style.ts
|
|
14431
|
-
import { spacings as
|
|
14653
|
+
import { spacings as spacings7, strokeWidths as strokeWidths4 } from "@refineui/tokens";
|
|
14432
14654
|
import { clsx as clsx104 } from "clsx";
|
|
14433
14655
|
var TOOLTIP_BEAK_W = foundationSizes.foundationSize160;
|
|
14434
14656
|
var TOOLTIP_BEAK_H = foundationSizes.foundationSize80;
|
|
14435
14657
|
var TOOLTIP_BEAK_OFFSET = foundationSizes.foundationSize80;
|
|
14436
|
-
var BEAK_BORDER_OVERLAP2 =
|
|
14437
|
-
var gap =
|
|
14438
|
-
var edgeInset =
|
|
14658
|
+
var BEAK_BORDER_OVERLAP2 = strokeWidths4.strokeWidthThin;
|
|
14659
|
+
var gap = spacings7.sizeXSmall;
|
|
14660
|
+
var edgeInset = spacings7.sizeMedium;
|
|
14439
14661
|
var tooltipStyles = {
|
|
14440
14662
|
root: "relative inline-block",
|
|
14441
14663
|
fallbackTrigger: "inline-flex outline-none",
|
|
@@ -14529,7 +14751,7 @@ function tooltipBeakRotateDeg(position) {
|
|
|
14529
14751
|
}
|
|
14530
14752
|
|
|
14531
14753
|
// src/components/Tooltip/Tooltip.tsx
|
|
14532
|
-
import { jsx as
|
|
14754
|
+
import { jsx as jsx78, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
14533
14755
|
function Tooltip({
|
|
14534
14756
|
trigger,
|
|
14535
14757
|
content,
|
|
@@ -14542,9 +14764,9 @@ function Tooltip({
|
|
|
14542
14764
|
className,
|
|
14543
14765
|
...props
|
|
14544
14766
|
}) {
|
|
14545
|
-
const [innerOpen, setInnerOpen] =
|
|
14767
|
+
const [innerOpen, setInnerOpen] = useState31(defaultOpen);
|
|
14546
14768
|
const open = ctrlOpen !== void 0 ? ctrlOpen : innerOpen;
|
|
14547
|
-
const tooltipId =
|
|
14769
|
+
const tooltipId = useId17();
|
|
14548
14770
|
const showTimer = useRef23(null);
|
|
14549
14771
|
const setOpen = (next) => {
|
|
14550
14772
|
if (ctrlOpen === void 0) setInnerOpen(next);
|
|
@@ -14575,8 +14797,8 @@ function Tooltip({
|
|
|
14575
14797
|
const mergeEl = getMergeableTriggerChild4(trigger);
|
|
14576
14798
|
let triggerNode;
|
|
14577
14799
|
if (mergeEl != null) {
|
|
14578
|
-
triggerNode = /* @__PURE__ */
|
|
14579
|
-
|
|
14800
|
+
triggerNode = /* @__PURE__ */ jsx78(
|
|
14801
|
+
Slot5,
|
|
14580
14802
|
{
|
|
14581
14803
|
"aria-describedby": describedBy,
|
|
14582
14804
|
onMouseEnter: scheduleShow,
|
|
@@ -14592,7 +14814,7 @@ function Tooltip({
|
|
|
14592
14814
|
}
|
|
14593
14815
|
);
|
|
14594
14816
|
} else {
|
|
14595
|
-
triggerNode = /* @__PURE__ */
|
|
14817
|
+
triggerNode = /* @__PURE__ */ jsx78(
|
|
14596
14818
|
"span",
|
|
14597
14819
|
{
|
|
14598
14820
|
tabIndex: 0,
|
|
@@ -14609,44 +14831,27 @@ function Tooltip({
|
|
|
14609
14831
|
}
|
|
14610
14832
|
);
|
|
14611
14833
|
}
|
|
14612
|
-
return /* @__PURE__ */
|
|
14834
|
+
return /* @__PURE__ */ jsxs32("div", { "data-refineui": "tooltip", className: clsx105(tooltipStyles.root, className), ...props, children: [
|
|
14613
14835
|
triggerNode,
|
|
14614
|
-
open && /* @__PURE__ */
|
|
14615
|
-
/* @__PURE__ */
|
|
14836
|
+
open && /* @__PURE__ */ jsx78("div", { className: tooltipStyles.floating, style: floatingStyle, children: /* @__PURE__ */ jsxs32("div", { className: tooltipStyles.panelWrap, children: [
|
|
14837
|
+
/* @__PURE__ */ jsx78(
|
|
14616
14838
|
"div",
|
|
14617
14839
|
{
|
|
14618
14840
|
className: tooltipStyles.beakWrap,
|
|
14619
14841
|
style: { ...beakWrapStyle, width: TOOLTIP_BEAK_W, height: TOOLTIP_BEAK_H },
|
|
14620
14842
|
"aria-hidden": true,
|
|
14621
|
-
children: /* @__PURE__ */
|
|
14622
|
-
|
|
14843
|
+
children: /* @__PURE__ */ jsx78(
|
|
14844
|
+
FrostedBeak,
|
|
14623
14845
|
{
|
|
14624
|
-
|
|
14625
|
-
|
|
14626
|
-
|
|
14627
|
-
|
|
14628
|
-
transformOrigin: "center center"
|
|
14629
|
-
},
|
|
14630
|
-
children: /* @__PURE__ */ jsxs31(
|
|
14631
|
-
"svg",
|
|
14632
|
-
{
|
|
14633
|
-
width: TOOLTIP_BEAK_W,
|
|
14634
|
-
height: TOOLTIP_BEAK_H,
|
|
14635
|
-
viewBox: "0 0 16 8",
|
|
14636
|
-
fill: "none",
|
|
14637
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
14638
|
-
style: { display: "block" },
|
|
14639
|
-
children: [
|
|
14640
|
-
/* @__PURE__ */ jsx76("polygon", { points: "8,0 0,8 16,8", fill: borderCol }),
|
|
14641
|
-
/* @__PURE__ */ jsx76("polygon", { points: "8,2 2,8 14,8", fill: bg })
|
|
14642
|
-
]
|
|
14643
|
-
}
|
|
14644
|
-
)
|
|
14846
|
+
width: TOOLTIP_BEAK_W,
|
|
14847
|
+
height: TOOLTIP_BEAK_H,
|
|
14848
|
+
rotateDeg: beakRot,
|
|
14849
|
+
borderColor: borderCol
|
|
14645
14850
|
}
|
|
14646
14851
|
)
|
|
14647
14852
|
}
|
|
14648
14853
|
),
|
|
14649
|
-
/* @__PURE__ */
|
|
14854
|
+
/* @__PURE__ */ jsx78(
|
|
14650
14855
|
"div",
|
|
14651
14856
|
{
|
|
14652
14857
|
id: tooltipId,
|
|
@@ -14671,13 +14876,13 @@ function Tooltip({
|
|
|
14671
14876
|
import { clsx as clsx107 } from "clsx";
|
|
14672
14877
|
import {
|
|
14673
14878
|
Children as Children8,
|
|
14674
|
-
createContext as
|
|
14879
|
+
createContext as createContext27,
|
|
14675
14880
|
isValidElement as isValidElement7,
|
|
14676
|
-
useContext as
|
|
14677
|
-
useId as
|
|
14881
|
+
useContext as useContext31,
|
|
14882
|
+
useId as useId18,
|
|
14678
14883
|
useLayoutEffect as useLayoutEffect13,
|
|
14679
|
-
useMemo as
|
|
14680
|
-
useState as
|
|
14884
|
+
useMemo as useMemo23,
|
|
14885
|
+
useState as useState32
|
|
14681
14886
|
} from "react";
|
|
14682
14887
|
import { opacities } from "@refineui/tokens";
|
|
14683
14888
|
import { resolveColorTokenValue as resolveColorTokenValue13 } from "@refineui/utilities/color";
|
|
@@ -14724,12 +14929,12 @@ var chartStyles = {
|
|
|
14724
14929
|
};
|
|
14725
14930
|
|
|
14726
14931
|
// src/components/Chart/utils.ts
|
|
14727
|
-
import { borderRadii, foundationSizes as foundationSizes3, spacings as
|
|
14932
|
+
import { borderRadii, foundationSizes as foundationSizes3, spacings as spacings8 } from "@refineui/tokens";
|
|
14728
14933
|
var CHART_VIEWBOX_WIDTH = 800;
|
|
14729
14934
|
var CHART_VIEWBOX_HEIGHT = 320;
|
|
14730
|
-
var CHART_PLOT_PADDING_TOP = parseFloat(
|
|
14731
|
-
var CHART_PLOT_PADDING_BOTTOM = parseFloat(
|
|
14732
|
-
var CHART_PLOT_PADDING_X = parseFloat(
|
|
14935
|
+
var CHART_PLOT_PADDING_TOP = parseFloat(spacings8.sizeMedium);
|
|
14936
|
+
var CHART_PLOT_PADDING_BOTTOM = parseFloat(spacings8.sizeXXSmall);
|
|
14937
|
+
var CHART_PLOT_PADDING_X = parseFloat(spacings8.sizeMedium);
|
|
14733
14938
|
var CHART_BAR_RADIUS = parseFloat(borderRadii.roundedXLarge);
|
|
14734
14939
|
var CHART_BAR_BAND_FILL = 0.5;
|
|
14735
14940
|
var CHART_POINT_RADIUS = parseFloat(foundationSizes3.foundationSize40);
|
|
@@ -14905,10 +15110,10 @@ function formatAxisTick(value) {
|
|
|
14905
15110
|
}
|
|
14906
15111
|
|
|
14907
15112
|
// src/components/Chart/Chart.tsx
|
|
14908
|
-
import { Fragment as Fragment4, jsx as
|
|
14909
|
-
var ChartContext =
|
|
15113
|
+
import { Fragment as Fragment4, jsx as jsx79, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
15114
|
+
var ChartContext = createContext27(null);
|
|
14910
15115
|
function useChartContext(component) {
|
|
14911
|
-
const value =
|
|
15116
|
+
const value = useContext31(ChartContext);
|
|
14912
15117
|
if (!value) throw new Error(`${component} must be used within Chart.`);
|
|
14913
15118
|
return value;
|
|
14914
15119
|
}
|
|
@@ -14941,12 +15146,12 @@ function isChartTooltipElement(node) {
|
|
|
14941
15146
|
return isValidElement7(node) && node.type === ChartTooltip;
|
|
14942
15147
|
}
|
|
14943
15148
|
function Chart({ className, children, ...props }) {
|
|
14944
|
-
const [hoverIndex, setHoverIndex] =
|
|
14945
|
-
const [selectedIndex, setSelectedIndex] =
|
|
14946
|
-
const [pointer, setPointer] =
|
|
14947
|
-
const [labels, setLabels] =
|
|
14948
|
-
const [series, setSeries] =
|
|
14949
|
-
const context =
|
|
15149
|
+
const [hoverIndex, setHoverIndex] = useState32(null);
|
|
15150
|
+
const [selectedIndex, setSelectedIndex] = useState32(null);
|
|
15151
|
+
const [pointer, setPointer] = useState32(null);
|
|
15152
|
+
const [labels, setLabels] = useState32([]);
|
|
15153
|
+
const [series, setSeries] = useState32(null);
|
|
15154
|
+
const context = useMemo23(
|
|
14950
15155
|
() => ({
|
|
14951
15156
|
hoverIndex,
|
|
14952
15157
|
selectedIndex,
|
|
@@ -14961,7 +15166,7 @@ function Chart({ className, children, ...props }) {
|
|
|
14961
15166
|
}),
|
|
14962
15167
|
[hoverIndex, selectedIndex, pointer, labels, series]
|
|
14963
15168
|
);
|
|
14964
|
-
return /* @__PURE__ */
|
|
15169
|
+
return /* @__PURE__ */ jsx79(ChartContext.Provider, { value: context, children: /* @__PURE__ */ jsx79(
|
|
14965
15170
|
"div",
|
|
14966
15171
|
{
|
|
14967
15172
|
"data-refineui": "chart",
|
|
@@ -14972,7 +15177,7 @@ function Chart({ className, children, ...props }) {
|
|
|
14972
15177
|
) });
|
|
14973
15178
|
}
|
|
14974
15179
|
function ChartBody({ className, ...props }) {
|
|
14975
|
-
return /* @__PURE__ */
|
|
15180
|
+
return /* @__PURE__ */ jsx79(
|
|
14976
15181
|
"div",
|
|
14977
15182
|
{
|
|
14978
15183
|
"data-refineui": "chart-body",
|
|
@@ -14982,7 +15187,7 @@ function ChartBody({ className, ...props }) {
|
|
|
14982
15187
|
);
|
|
14983
15188
|
}
|
|
14984
15189
|
function ChartContent({ className, ...props }) {
|
|
14985
|
-
return /* @__PURE__ */
|
|
15190
|
+
return /* @__PURE__ */ jsx79(
|
|
14986
15191
|
"div",
|
|
14987
15192
|
{
|
|
14988
15193
|
"data-refineui": "chart-content",
|
|
@@ -15007,7 +15212,7 @@ function ChartHitArea() {
|
|
|
15007
15212
|
setHoverIndex(hoverIndexFromPlotX(next.x, count, series.align));
|
|
15008
15213
|
return next;
|
|
15009
15214
|
};
|
|
15010
|
-
return /* @__PURE__ */
|
|
15215
|
+
return /* @__PURE__ */ jsx79(
|
|
15011
15216
|
"rect",
|
|
15012
15217
|
{
|
|
15013
15218
|
"data-refineui": "chart-hit-area",
|
|
@@ -15045,7 +15250,7 @@ function ChartPlot({
|
|
|
15045
15250
|
if (isChartTooltipElement(child)) tooltipNodes.push(child);
|
|
15046
15251
|
else svgChildren.push(child);
|
|
15047
15252
|
});
|
|
15048
|
-
return /* @__PURE__ */
|
|
15253
|
+
return /* @__PURE__ */ jsxs33(
|
|
15049
15254
|
"div",
|
|
15050
15255
|
{
|
|
15051
15256
|
"data-refineui": "chart-plot-frame",
|
|
@@ -15054,7 +15259,7 @@ function ChartPlot({
|
|
|
15054
15259
|
className: clsx107(chartStyles.plotFrame, className),
|
|
15055
15260
|
...props,
|
|
15056
15261
|
children: [
|
|
15057
|
-
/* @__PURE__ */
|
|
15262
|
+
/* @__PURE__ */ jsxs33(
|
|
15058
15263
|
"svg",
|
|
15059
15264
|
{
|
|
15060
15265
|
"data-refineui": "chart-plot",
|
|
@@ -15065,7 +15270,7 @@ function ChartPlot({
|
|
|
15065
15270
|
className: chartStyles.plot,
|
|
15066
15271
|
children: [
|
|
15067
15272
|
svgChildren,
|
|
15068
|
-
/* @__PURE__ */
|
|
15273
|
+
/* @__PURE__ */ jsx79(ChartHitArea, {})
|
|
15069
15274
|
]
|
|
15070
15275
|
}
|
|
15071
15276
|
),
|
|
@@ -15083,7 +15288,7 @@ function ChartTooltip({ className, children, style, ...props }) {
|
|
|
15083
15288
|
const flipY = pointer.y < CHART_PLOT_PADDING_TOP + plotHeight() * CHART_TOOLTIP_FLIP_Y;
|
|
15084
15289
|
const offsetX = flipX ? "calc(-100% - var(--refineui-spacing-size-small))" : "var(--refineui-spacing-size-small)";
|
|
15085
15290
|
const offsetY = flipY ? "var(--refineui-spacing-size-small)" : "calc(-100% - var(--refineui-spacing-size-x-small))";
|
|
15086
|
-
return /* @__PURE__ */
|
|
15291
|
+
return /* @__PURE__ */ jsx79(
|
|
15087
15292
|
"div",
|
|
15088
15293
|
{
|
|
15089
15294
|
"data-refineui": "chart-tooltip",
|
|
@@ -15096,9 +15301,9 @@ function ChartTooltip({ className, children, style, ...props }) {
|
|
|
15096
15301
|
...style
|
|
15097
15302
|
},
|
|
15098
15303
|
...props,
|
|
15099
|
-
children: children ?? /* @__PURE__ */
|
|
15100
|
-
label ? /* @__PURE__ */
|
|
15101
|
-
/* @__PURE__ */
|
|
15304
|
+
children: children ?? /* @__PURE__ */ jsxs33(Fragment4, { children: [
|
|
15305
|
+
label ? /* @__PURE__ */ jsx79("span", { className: chartStyles.tooltipLabel, children: label }) : null,
|
|
15306
|
+
/* @__PURE__ */ jsx79("span", { className: chartStyles.tooltipValue, children: formatAxisTick(value) })
|
|
15102
15307
|
] })
|
|
15103
15308
|
}
|
|
15104
15309
|
);
|
|
@@ -15113,14 +15318,14 @@ function ChartYAxisLabels({
|
|
|
15113
15318
|
}) {
|
|
15114
15319
|
const scaleMax = resolveScale(values, max);
|
|
15115
15320
|
const ticks = yAxisTicks(scaleMax, lines).slice().reverse();
|
|
15116
|
-
return /* @__PURE__ */
|
|
15321
|
+
return /* @__PURE__ */ jsx79(
|
|
15117
15322
|
"div",
|
|
15118
15323
|
{
|
|
15119
15324
|
"data-refineui": "chart-y-axis",
|
|
15120
15325
|
className: clsx107(chartStyles.yAxis, className),
|
|
15121
15326
|
"aria-hidden": true,
|
|
15122
15327
|
...props,
|
|
15123
|
-
children: ticks.map((tick) => /* @__PURE__ */
|
|
15328
|
+
children: ticks.map((tick) => /* @__PURE__ */ jsx79(
|
|
15124
15329
|
"span",
|
|
15125
15330
|
{
|
|
15126
15331
|
className: chartStyles.yAxisTick,
|
|
@@ -15143,12 +15348,12 @@ function ChartGrid({
|
|
|
15143
15348
|
const ticks = yAxisTicks(scaleMax, lines);
|
|
15144
15349
|
const gridColor = gridStroke();
|
|
15145
15350
|
const baselineColor = gridBaselineStroke();
|
|
15146
|
-
return /* @__PURE__ */
|
|
15351
|
+
return /* @__PURE__ */ jsx79("g", { "data-refineui": "chart-grid", className, ...props, children: ticks.map((tick, index) => {
|
|
15147
15352
|
const y = gridLineY(scaleMax, tick);
|
|
15148
15353
|
const isBaseline = index === 0;
|
|
15149
15354
|
const isTop = index === ticks.length - 1;
|
|
15150
15355
|
if (isTop) return null;
|
|
15151
|
-
return /* @__PURE__ */
|
|
15356
|
+
return /* @__PURE__ */ jsx79(
|
|
15152
15357
|
"line",
|
|
15153
15358
|
{
|
|
15154
15359
|
x1: CHART_PLOT_PADDING_X,
|
|
@@ -15183,10 +15388,10 @@ function ChartBars({
|
|
|
15183
15388
|
useLayoutEffect13(() => {
|
|
15184
15389
|
setSeries({ values, seriesColor, max, align: "bar" });
|
|
15185
15390
|
}, [values, seriesColor, max, setSeries]);
|
|
15186
|
-
return /* @__PURE__ */
|
|
15391
|
+
return /* @__PURE__ */ jsxs33("g", { "data-refineui": "chart-bars", "data-series-color": seriesColor, className, ...props, children: [
|
|
15187
15392
|
showTrack ? values.map((_, index) => {
|
|
15188
15393
|
const x = barX(index, values.length);
|
|
15189
|
-
return /* @__PURE__ */
|
|
15394
|
+
return /* @__PURE__ */ jsx79(
|
|
15190
15395
|
"path",
|
|
15191
15396
|
{
|
|
15192
15397
|
"data-refineui": "chart-bar-track",
|
|
@@ -15208,7 +15413,7 @@ function ChartBars({
|
|
|
15208
15413
|
const height = baselineY - y;
|
|
15209
15414
|
if (height <= 0) return null;
|
|
15210
15415
|
const state = itemState(index, hoverIndex, selectedIndex);
|
|
15211
|
-
return /* @__PURE__ */
|
|
15416
|
+
return /* @__PURE__ */ jsx79(
|
|
15212
15417
|
"path",
|
|
15213
15418
|
{
|
|
15214
15419
|
"data-refineui": "chart-bar",
|
|
@@ -15231,7 +15436,7 @@ function ChartLine({
|
|
|
15231
15436
|
...props
|
|
15232
15437
|
}) {
|
|
15233
15438
|
const { hoverIndex, selectedIndex, setSeries } = useChartContext("ChartLine");
|
|
15234
|
-
const gradientId =
|
|
15439
|
+
const gradientId = useId18().replace(/:/g, "");
|
|
15235
15440
|
const scaleMax = resolveChartScale(values, max);
|
|
15236
15441
|
const stroke = seriesColorToken(seriesColor);
|
|
15237
15442
|
const coords = linePointCoords(values, scaleMax);
|
|
@@ -15241,10 +15446,10 @@ function ChartLine({
|
|
|
15241
15446
|
useLayoutEffect13(() => {
|
|
15242
15447
|
setSeries({ values, seriesColor, max, align: "line" });
|
|
15243
15448
|
}, [values, seriesColor, max, setSeries]);
|
|
15244
|
-
return /* @__PURE__ */
|
|
15245
|
-
showArea && coords.length > 1 ? /* @__PURE__ */
|
|
15246
|
-
/* @__PURE__ */
|
|
15247
|
-
/* @__PURE__ */
|
|
15449
|
+
return /* @__PURE__ */ jsxs33("g", { "data-refineui": "chart-line", "data-series-color": seriesColor, className, ...props, children: [
|
|
15450
|
+
showArea && coords.length > 1 ? /* @__PURE__ */ jsxs33(Fragment4, { children: [
|
|
15451
|
+
/* @__PURE__ */ jsx79("defs", { children: /* @__PURE__ */ jsxs33("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
15452
|
+
/* @__PURE__ */ jsx79(
|
|
15248
15453
|
"stop",
|
|
15249
15454
|
{
|
|
15250
15455
|
offset: "0%",
|
|
@@ -15252,9 +15457,9 @@ function ChartLine({
|
|
|
15252
15457
|
stopOpacity: opacities.opacityDisabled
|
|
15253
15458
|
}
|
|
15254
15459
|
),
|
|
15255
|
-
/* @__PURE__ */
|
|
15460
|
+
/* @__PURE__ */ jsx79("stop", { offset: "100%", stopColor: stroke, stopOpacity: "0" })
|
|
15256
15461
|
] }) }),
|
|
15257
|
-
/* @__PURE__ */
|
|
15462
|
+
/* @__PURE__ */ jsx79(
|
|
15258
15463
|
"path",
|
|
15259
15464
|
{
|
|
15260
15465
|
"data-refineui": "chart-line-area",
|
|
@@ -15263,7 +15468,7 @@ function ChartLine({
|
|
|
15263
15468
|
}
|
|
15264
15469
|
)
|
|
15265
15470
|
] }) : null,
|
|
15266
|
-
/* @__PURE__ */
|
|
15471
|
+
/* @__PURE__ */ jsx79(
|
|
15267
15472
|
"path",
|
|
15268
15473
|
{
|
|
15269
15474
|
"data-refineui": "chart-line-stroke",
|
|
@@ -15281,7 +15486,7 @@ function ChartLine({
|
|
|
15281
15486
|
const state = itemState(index, hoverIndex, selectedIndex);
|
|
15282
15487
|
const visible = showPoints || state !== "default";
|
|
15283
15488
|
if (!visible) return null;
|
|
15284
|
-
return /* @__PURE__ */
|
|
15489
|
+
return /* @__PURE__ */ jsx79(
|
|
15285
15490
|
"circle",
|
|
15286
15491
|
{
|
|
15287
15492
|
"data-refineui": "chart-point",
|
|
@@ -15310,7 +15515,7 @@ function ChartAxisLabels({
|
|
|
15310
15515
|
useLayoutEffect13(() => {
|
|
15311
15516
|
setLabels(labels);
|
|
15312
15517
|
}, [labels, setLabels]);
|
|
15313
|
-
return /* @__PURE__ */
|
|
15518
|
+
return /* @__PURE__ */ jsx79(
|
|
15314
15519
|
"div",
|
|
15315
15520
|
{
|
|
15316
15521
|
"data-refineui": "chart-axis-labels",
|
|
@@ -15319,7 +15524,7 @@ function ChartAxisLabels({
|
|
|
15319
15524
|
...props,
|
|
15320
15525
|
children: labels.map((label, index) => {
|
|
15321
15526
|
const state = itemState(index, hoverIndex, selectedIndex);
|
|
15322
|
-
return /* @__PURE__ */
|
|
15527
|
+
return /* @__PURE__ */ jsx79(
|
|
15323
15528
|
"span",
|
|
15324
15529
|
{
|
|
15325
15530
|
"data-state": state,
|
|
@@ -15337,7 +15542,7 @@ function ChartAxisLabels({
|
|
|
15337
15542
|
);
|
|
15338
15543
|
}
|
|
15339
15544
|
function ChartLegend({ className, ...props }) {
|
|
15340
|
-
return /* @__PURE__ */
|
|
15545
|
+
return /* @__PURE__ */ jsx79(
|
|
15341
15546
|
"ul",
|
|
15342
15547
|
{
|
|
15343
15548
|
"data-refineui": "chart-legend",
|
|
@@ -15353,7 +15558,7 @@ function ChartLegendItem({
|
|
|
15353
15558
|
style,
|
|
15354
15559
|
...props
|
|
15355
15560
|
}) {
|
|
15356
|
-
return /* @__PURE__ */
|
|
15561
|
+
return /* @__PURE__ */ jsxs33(
|
|
15357
15562
|
"li",
|
|
15358
15563
|
{
|
|
15359
15564
|
"data-refineui": "chart-legend-item",
|
|
@@ -15361,7 +15566,7 @@ function ChartLegendItem({
|
|
|
15361
15566
|
className: clsx107(chartStyles.legendItem, className),
|
|
15362
15567
|
...props,
|
|
15363
15568
|
children: [
|
|
15364
|
-
/* @__PURE__ */
|
|
15569
|
+
/* @__PURE__ */ jsx79(
|
|
15365
15570
|
"span",
|
|
15366
15571
|
{
|
|
15367
15572
|
"aria-hidden": true,
|
|
@@ -15376,31 +15581,31 @@ function ChartLegendItem({
|
|
|
15376
15581
|
}
|
|
15377
15582
|
|
|
15378
15583
|
// src/components/Slot/Slot.tsx
|
|
15379
|
-
import { Slot as
|
|
15584
|
+
import { Slot as Slot6 } from "@refineui/utilities/react";
|
|
15380
15585
|
|
|
15381
15586
|
// src/components/Collapsible/Collapsible.tsx
|
|
15382
15587
|
import {
|
|
15383
|
-
forwardRef as
|
|
15384
|
-
useCallback as
|
|
15385
|
-
useId as
|
|
15386
|
-
useMemo as
|
|
15387
|
-
useState as
|
|
15588
|
+
forwardRef as forwardRef17,
|
|
15589
|
+
useCallback as useCallback23,
|
|
15590
|
+
useId as useId19,
|
|
15591
|
+
useMemo as useMemo24,
|
|
15592
|
+
useState as useState34
|
|
15388
15593
|
} from "react";
|
|
15389
15594
|
import { clsx as clsx108 } from "clsx";
|
|
15390
|
-
import { Slot as
|
|
15595
|
+
import { Slot as Slot7 } from "@refineui/utilities/react";
|
|
15391
15596
|
|
|
15392
15597
|
// src/components/Collapsible/context.ts
|
|
15393
|
-
import { createContext as
|
|
15598
|
+
import { createContext as createContext28, useContext as useContext32, useEffect as useEffect21, useState as useState33 } from "react";
|
|
15394
15599
|
import { semanticInteraction as semanticInteraction9 } from "@refineui/tokens";
|
|
15395
15600
|
import { getReducedMotionQuery as getReducedMotionQuery3 } from "@refineui/utilities/animation";
|
|
15396
|
-
var CollapsibleContext =
|
|
15601
|
+
var CollapsibleContext = createContext28(null);
|
|
15397
15602
|
function useCollapsibleContext(part) {
|
|
15398
|
-
const value =
|
|
15603
|
+
const value = useContext32(CollapsibleContext);
|
|
15399
15604
|
if (!value) throw new Error(`${part} must be used within Collapsible`);
|
|
15400
15605
|
return value;
|
|
15401
15606
|
}
|
|
15402
15607
|
function usePrefersReducedMotion3() {
|
|
15403
|
-
const [reduce, setReduce] =
|
|
15608
|
+
const [reduce, setReduce] = useState33(false);
|
|
15404
15609
|
useEffect21(() => {
|
|
15405
15610
|
const mql = window.matchMedia(getReducedMotionQuery3().replace("@media ", ""));
|
|
15406
15611
|
const sync = () => setReduce(mql.matches);
|
|
@@ -15421,18 +15626,18 @@ var collapsibleStyles = {
|
|
|
15421
15626
|
};
|
|
15422
15627
|
|
|
15423
15628
|
// src/components/Collapsible/Collapsible.tsx
|
|
15424
|
-
import { jsx as
|
|
15425
|
-
var Collapsible =
|
|
15426
|
-
const [uncontrolled, setUncontrolled] =
|
|
15629
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
15630
|
+
var Collapsible = forwardRef17(function Collapsible2({ open: openProp, defaultOpen = false, onOpenChange, asChild = false, className, children, ...props }, ref) {
|
|
15631
|
+
const [uncontrolled, setUncontrolled] = useState34(defaultOpen);
|
|
15427
15632
|
const open = openProp ?? uncontrolled;
|
|
15428
|
-
const reactId =
|
|
15633
|
+
const reactId = useId19();
|
|
15429
15634
|
const reduceMotion = usePrefersReducedMotion3();
|
|
15430
|
-
const toggle =
|
|
15635
|
+
const toggle = useCallback23(() => {
|
|
15431
15636
|
const next = !(openProp ?? uncontrolled);
|
|
15432
15637
|
if (openProp === void 0) setUncontrolled(next);
|
|
15433
15638
|
onOpenChange?.(next);
|
|
15434
15639
|
}, [onOpenChange, openProp, uncontrolled]);
|
|
15435
|
-
const contextValue =
|
|
15640
|
+
const contextValue = useMemo24(
|
|
15436
15641
|
() => ({
|
|
15437
15642
|
open,
|
|
15438
15643
|
toggle,
|
|
@@ -15449,9 +15654,9 @@ var Collapsible = forwardRef16(function Collapsible2({ open: openProp, defaultOp
|
|
|
15449
15654
|
"data-refineui": "collapsible",
|
|
15450
15655
|
className
|
|
15451
15656
|
};
|
|
15452
|
-
return /* @__PURE__ */
|
|
15657
|
+
return /* @__PURE__ */ jsx80(CollapsibleContext.Provider, { value: contextValue, children: asChild ? /* @__PURE__ */ jsx80(Slot7, { ...shared, children }) : /* @__PURE__ */ jsx80("div", { ...shared, children }) });
|
|
15453
15658
|
});
|
|
15454
|
-
var CollapsibleTrigger =
|
|
15659
|
+
var CollapsibleTrigger = forwardRef17(
|
|
15455
15660
|
function CollapsibleTrigger2({
|
|
15456
15661
|
asChild = false,
|
|
15457
15662
|
onClick,
|
|
@@ -15478,8 +15683,8 @@ var CollapsibleTrigger = forwardRef16(
|
|
|
15478
15683
|
if (!event.defaultPrevented) toggle();
|
|
15479
15684
|
}
|
|
15480
15685
|
};
|
|
15481
|
-
if (asChild) return /* @__PURE__ */
|
|
15482
|
-
return /* @__PURE__ */
|
|
15686
|
+
if (asChild) return /* @__PURE__ */ jsx80(Slot7, { ...shared, children });
|
|
15687
|
+
return /* @__PURE__ */ jsx80(
|
|
15483
15688
|
Button,
|
|
15484
15689
|
{
|
|
15485
15690
|
...shared,
|
|
@@ -15493,7 +15698,7 @@ var CollapsibleTrigger = forwardRef16(
|
|
|
15493
15698
|
);
|
|
15494
15699
|
}
|
|
15495
15700
|
);
|
|
15496
|
-
var CollapsibleContent =
|
|
15701
|
+
var CollapsibleContent = forwardRef17(
|
|
15497
15702
|
function CollapsibleContent2({ className, children, style, ...props }, ref) {
|
|
15498
15703
|
const { open, contentId, triggerId, reduceMotion } = useCollapsibleContext("CollapsibleContent");
|
|
15499
15704
|
const gridStyle = {
|
|
@@ -15508,7 +15713,7 @@ var CollapsibleContent = forwardRef16(
|
|
|
15508
15713
|
pointerEvents: open ? void 0 : "none",
|
|
15509
15714
|
...style
|
|
15510
15715
|
};
|
|
15511
|
-
return /* @__PURE__ */
|
|
15716
|
+
return /* @__PURE__ */ jsx80(
|
|
15512
15717
|
"div",
|
|
15513
15718
|
{
|
|
15514
15719
|
...props,
|
|
@@ -15520,7 +15725,7 @@ var CollapsibleContent = forwardRef16(
|
|
|
15520
15725
|
"data-state": open ? "open" : "closed",
|
|
15521
15726
|
"data-refineui": "collapsible-content",
|
|
15522
15727
|
style: gridStyle,
|
|
15523
|
-
children: /* @__PURE__ */
|
|
15728
|
+
children: /* @__PURE__ */ jsx80("div", { className: collapsibleStyles.panelOuter, children: /* @__PURE__ */ jsx80("div", { className: clsx108(className), style: innerMotionStyle, children }) })
|
|
15524
15729
|
}
|
|
15525
15730
|
);
|
|
15526
15731
|
}
|
|
@@ -15528,28 +15733,28 @@ var CollapsibleContent = forwardRef16(
|
|
|
15528
15733
|
|
|
15529
15734
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
15530
15735
|
import {
|
|
15531
|
-
createContext as
|
|
15532
|
-
forwardRef as
|
|
15533
|
-
useCallback as
|
|
15534
|
-
useContext as
|
|
15736
|
+
createContext as createContext29,
|
|
15737
|
+
forwardRef as forwardRef18,
|
|
15738
|
+
useCallback as useCallback24,
|
|
15739
|
+
useContext as useContext33,
|
|
15535
15740
|
useEffect as useEffect22,
|
|
15536
15741
|
useLayoutEffect as useLayoutEffect14,
|
|
15537
|
-
useMemo as
|
|
15742
|
+
useMemo as useMemo25,
|
|
15538
15743
|
useRef as useRef24,
|
|
15539
|
-
useState as
|
|
15744
|
+
useState as useState35
|
|
15540
15745
|
} from "react";
|
|
15541
|
-
import { createPortal as
|
|
15746
|
+
import { createPortal as createPortal8 } from "react-dom";
|
|
15542
15747
|
import { clsx as clsx109 } from "clsx";
|
|
15543
15748
|
import { componentSizes as componentSizes3, iconSizes as iconSizes23, semanticInteraction as semanticInteraction10 } from "@refineui/tokens";
|
|
15544
15749
|
import { motionMsToNumber as motionMsToNumber7 } from "@refineui/utilities/animation";
|
|
15545
|
-
import { Slot as
|
|
15546
|
-
import { Fragment as Fragment5, jsx as
|
|
15750
|
+
import { Slot as Slot8 } from "@refineui/utilities/react";
|
|
15751
|
+
import { Fragment as Fragment5, jsx as jsx81, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
15547
15752
|
var MENU_ATTR = "data-refineui-context-menu";
|
|
15548
15753
|
var CLOSE_MS = motionMsToNumber7(semanticInteraction10.duration.normal);
|
|
15549
|
-
var MenuContext2 =
|
|
15550
|
-
var SubContext =
|
|
15754
|
+
var MenuContext2 = createContext29(null);
|
|
15755
|
+
var SubContext = createContext29(null);
|
|
15551
15756
|
function useMenu() {
|
|
15552
|
-
const value =
|
|
15757
|
+
const value = useContext33(MenuContext2);
|
|
15553
15758
|
if (!value) throw new Error("Context menu parts must be used within ContextMenu");
|
|
15554
15759
|
return value;
|
|
15555
15760
|
}
|
|
@@ -15566,29 +15771,29 @@ function placeInView(element, x, y) {
|
|
|
15566
15771
|
}
|
|
15567
15772
|
function ContextMenu({ modal = true, onOpenChange, children }) {
|
|
15568
15773
|
void modal;
|
|
15569
|
-
const [open, setOpen] =
|
|
15570
|
-
const [point, setPoint] =
|
|
15774
|
+
const [open, setOpen] = useState35(false);
|
|
15775
|
+
const [point, setPoint] = useState35({ x: 0, y: 0 });
|
|
15571
15776
|
const openRef = useRef24(false);
|
|
15572
15777
|
const onOpenChangeRef = useRef24(onOpenChange);
|
|
15573
15778
|
openRef.current = open;
|
|
15574
15779
|
onOpenChangeRef.current = onOpenChange;
|
|
15575
|
-
const close =
|
|
15780
|
+
const close = useCallback24(() => {
|
|
15576
15781
|
if (!openRef.current) return;
|
|
15577
15782
|
openRef.current = false;
|
|
15578
15783
|
setOpen(false);
|
|
15579
15784
|
onOpenChangeRef.current?.(false);
|
|
15580
15785
|
}, []);
|
|
15581
|
-
const openAt =
|
|
15786
|
+
const openAt = useCallback24((x, y) => {
|
|
15582
15787
|
setPoint({ x, y });
|
|
15583
15788
|
const wasOpen = openRef.current;
|
|
15584
15789
|
openRef.current = true;
|
|
15585
15790
|
setOpen(true);
|
|
15586
15791
|
if (!wasOpen) onOpenChangeRef.current?.(true);
|
|
15587
15792
|
}, []);
|
|
15588
|
-
const value =
|
|
15589
|
-
return /* @__PURE__ */
|
|
15793
|
+
const value = useMemo25(() => ({ open, point, openAt, close }), [open, point, openAt, close]);
|
|
15794
|
+
return /* @__PURE__ */ jsx81(MenuContext2.Provider, { value, children });
|
|
15590
15795
|
}
|
|
15591
|
-
var ContextMenuTrigger =
|
|
15796
|
+
var ContextMenuTrigger = forwardRef18(function ContextMenuTrigger2({ asChild = false, onContextMenu, children, ...props }, ref) {
|
|
15592
15797
|
const { openAt } = useMenu();
|
|
15593
15798
|
const shared = {
|
|
15594
15799
|
...props,
|
|
@@ -15601,17 +15806,17 @@ var ContextMenuTrigger = forwardRef17(function ContextMenuTrigger2({ asChild = f
|
|
|
15601
15806
|
openAt(event.clientX, event.clientY);
|
|
15602
15807
|
}
|
|
15603
15808
|
};
|
|
15604
|
-
if (asChild) return /* @__PURE__ */
|
|
15605
|
-
return /* @__PURE__ */
|
|
15809
|
+
if (asChild) return /* @__PURE__ */ jsx81(Slot8, { ...shared, children });
|
|
15810
|
+
return /* @__PURE__ */ jsx81("span", { ...shared, className: clsx109(menuStyles.triggerFallback, props.className), children });
|
|
15606
15811
|
});
|
|
15607
15812
|
function ContextMenuPortal({ children }) {
|
|
15608
|
-
return /* @__PURE__ */
|
|
15813
|
+
return /* @__PURE__ */ jsx81(Fragment5, { children });
|
|
15609
15814
|
}
|
|
15610
|
-
var ContextMenuContent =
|
|
15815
|
+
var ContextMenuContent = forwardRef18(function ContextMenuContent2({ className, style, onPointerDown, children, ...props }, ref) {
|
|
15611
15816
|
const { open, point, close } = useMenu();
|
|
15612
15817
|
const localRef = useRef24(null);
|
|
15613
|
-
const [shouldRender, setShouldRender] =
|
|
15614
|
-
const [isClosing, setIsClosing] =
|
|
15818
|
+
const [shouldRender, setShouldRender] = useState35(open);
|
|
15819
|
+
const [isClosing, setIsClosing] = useState35(false);
|
|
15615
15820
|
useEffect22(() => {
|
|
15616
15821
|
if (open) {
|
|
15617
15822
|
setShouldRender(true);
|
|
@@ -15648,8 +15853,8 @@ var ContextMenuContent = forwardRef17(function ContextMenuContent2({ className,
|
|
|
15648
15853
|
};
|
|
15649
15854
|
}, [open, close]);
|
|
15650
15855
|
if (!shouldRender || typeof document === "undefined") return null;
|
|
15651
|
-
return
|
|
15652
|
-
/* @__PURE__ */
|
|
15856
|
+
return createPortal8(
|
|
15857
|
+
/* @__PURE__ */ jsx81(
|
|
15653
15858
|
"div",
|
|
15654
15859
|
{
|
|
15655
15860
|
...props,
|
|
@@ -15676,7 +15881,7 @@ var ContextMenuContent = forwardRef17(function ContextMenuContent2({ className,
|
|
|
15676
15881
|
onPointerDown?.(event);
|
|
15677
15882
|
},
|
|
15678
15883
|
onContextMenu: (event) => event.preventDefault(),
|
|
15679
|
-
children: /* @__PURE__ */
|
|
15884
|
+
children: /* @__PURE__ */ jsx81("div", { role: "menu", "data-refineui": "menu", className: clsx109(menuStyles.list, className), children })
|
|
15680
15885
|
}
|
|
15681
15886
|
),
|
|
15682
15887
|
document.body
|
|
@@ -15693,11 +15898,11 @@ function runSelect(onSelect, close, disabled) {
|
|
|
15693
15898
|
onSelect?.(selectEvent);
|
|
15694
15899
|
if (!selectEvent.defaultPrevented) close();
|
|
15695
15900
|
}
|
|
15696
|
-
var ContextMenuItem =
|
|
15901
|
+
var ContextMenuItem = forwardRef18(function ContextMenuItem2({ disabled = false, description, shortcut, startIcon, endIcon, state = "default", onSelect, className, onClick, onKeyDown, children, ...props }, ref) {
|
|
15697
15902
|
const { close } = useMenu();
|
|
15698
15903
|
const isDisabled = disabled || state === "disabled";
|
|
15699
15904
|
const slotted = startIcon != null || description != null || shortcut != null || endIcon != null;
|
|
15700
|
-
return /* @__PURE__ */
|
|
15905
|
+
return /* @__PURE__ */ jsx81(
|
|
15701
15906
|
"button",
|
|
15702
15907
|
{
|
|
15703
15908
|
ref,
|
|
@@ -15723,8 +15928,8 @@ var ContextMenuItem = forwardRef17(function ContextMenuItem2({ disabled = false,
|
|
|
15723
15928
|
runSelect(onSelect, close, isDisabled);
|
|
15724
15929
|
}
|
|
15725
15930
|
},
|
|
15726
|
-
children: slotted ? /* @__PURE__ */
|
|
15727
|
-
startIcon ? /* @__PURE__ */
|
|
15931
|
+
children: slotted ? /* @__PURE__ */ jsxs34("span", { className: menuStyles.row, children: [
|
|
15932
|
+
startIcon ? /* @__PURE__ */ jsx81(
|
|
15728
15933
|
"span",
|
|
15729
15934
|
{
|
|
15730
15935
|
className: menuStyles.iconWrap,
|
|
@@ -15732,13 +15937,13 @@ var ContextMenuItem = forwardRef17(function ContextMenuItem2({ disabled = false,
|
|
|
15732
15937
|
children: startIcon
|
|
15733
15938
|
}
|
|
15734
15939
|
) : null,
|
|
15735
|
-
/* @__PURE__ */
|
|
15736
|
-
/* @__PURE__ */
|
|
15737
|
-
description ? /* @__PURE__ */
|
|
15940
|
+
/* @__PURE__ */ jsxs34("span", { className: menuStyles.textCol, children: [
|
|
15941
|
+
/* @__PURE__ */ jsx81("span", { className: menuStyles.title, children }),
|
|
15942
|
+
description ? /* @__PURE__ */ jsx81("span", { className: clsx109(menuStyles.description, isDisabled ? menuStyles.descriptionDisabled : menuStyles.descriptionEnabled), children: description }) : null
|
|
15738
15943
|
] }),
|
|
15739
|
-
(shortcut || endIcon) && /* @__PURE__ */
|
|
15740
|
-
shortcut ? /* @__PURE__ */
|
|
15741
|
-
endIcon ? /* @__PURE__ */
|
|
15944
|
+
(shortcut || endIcon) && /* @__PURE__ */ jsxs34("span", { className: menuStyles.rightWrap, children: [
|
|
15945
|
+
shortcut ? /* @__PURE__ */ jsx81("span", { className: menuStyles.shortcut, children: shortcut }) : null,
|
|
15946
|
+
endIcon ? /* @__PURE__ */ jsx81(
|
|
15742
15947
|
"span",
|
|
15743
15948
|
{
|
|
15744
15949
|
className: menuStyles.iconWrap,
|
|
@@ -15747,13 +15952,13 @@ var ContextMenuItem = forwardRef17(function ContextMenuItem2({ disabled = false,
|
|
|
15747
15952
|
}
|
|
15748
15953
|
) : null
|
|
15749
15954
|
] })
|
|
15750
|
-
] }) : /* @__PURE__ */
|
|
15955
|
+
] }) : /* @__PURE__ */ jsx81("span", { className: menuStyles.row, children })
|
|
15751
15956
|
}
|
|
15752
15957
|
);
|
|
15753
15958
|
});
|
|
15754
|
-
var ContextMenuSeparator =
|
|
15959
|
+
var ContextMenuSeparator = forwardRef18(
|
|
15755
15960
|
function ContextMenuSeparator2({ className, ...props }, ref) {
|
|
15756
|
-
return /* @__PURE__ */
|
|
15961
|
+
return /* @__PURE__ */ jsx81(
|
|
15757
15962
|
"div",
|
|
15758
15963
|
{
|
|
15759
15964
|
ref,
|
|
@@ -15763,16 +15968,16 @@ var ContextMenuSeparator = forwardRef17(
|
|
|
15763
15968
|
...{ [MENU_ATTR]: "" },
|
|
15764
15969
|
className: clsx109(menuStyles.dividerWrap, className),
|
|
15765
15970
|
...props,
|
|
15766
|
-
children: /* @__PURE__ */
|
|
15971
|
+
children: /* @__PURE__ */ jsx81("div", { className: menuStyles.dividerLine })
|
|
15767
15972
|
}
|
|
15768
15973
|
);
|
|
15769
15974
|
}
|
|
15770
15975
|
);
|
|
15771
15976
|
function ContextMenuLabel({ className, children, ...props }) {
|
|
15772
|
-
return /* @__PURE__ */
|
|
15977
|
+
return /* @__PURE__ */ jsx81("div", { "data-refineui": "menu-label", className: clsx109(menuStyles.section, className), ...props, children: /* @__PURE__ */ jsx81("span", { className: menuStyles.sectionText, children }) });
|
|
15773
15978
|
}
|
|
15774
15979
|
function ContextMenuSub({ children }) {
|
|
15775
|
-
const [open, setOpen] =
|
|
15980
|
+
const [open, setOpen] = useState35(false);
|
|
15776
15981
|
const triggerRef = useRef24(null);
|
|
15777
15982
|
const timer = useRef24(null);
|
|
15778
15983
|
const clear = () => {
|
|
@@ -15780,7 +15985,7 @@ function ContextMenuSub({ children }) {
|
|
|
15780
15985
|
timer.current = null;
|
|
15781
15986
|
};
|
|
15782
15987
|
useEffect22(() => clear, []);
|
|
15783
|
-
const value =
|
|
15988
|
+
const value = useMemo25(
|
|
15784
15989
|
() => ({
|
|
15785
15990
|
open,
|
|
15786
15991
|
triggerRef,
|
|
@@ -15795,14 +16000,14 @@ function ContextMenuSub({ children }) {
|
|
|
15795
16000
|
}),
|
|
15796
16001
|
[open]
|
|
15797
16002
|
);
|
|
15798
|
-
return /* @__PURE__ */
|
|
16003
|
+
return /* @__PURE__ */ jsx81(SubContext.Provider, { value, children });
|
|
15799
16004
|
}
|
|
15800
16005
|
function useSub2() {
|
|
15801
|
-
const value =
|
|
16006
|
+
const value = useContext33(SubContext);
|
|
15802
16007
|
if (!value) throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");
|
|
15803
16008
|
return value;
|
|
15804
16009
|
}
|
|
15805
|
-
var ContextMenuSubTrigger =
|
|
16010
|
+
var ContextMenuSubTrigger = forwardRef18(
|
|
15806
16011
|
function ContextMenuSubTrigger2({ asChild = false, description, startIcon, onMouseEnter, onMouseLeave, onClick, className, children, ...props }, ref) {
|
|
15807
16012
|
const sub = useSub2();
|
|
15808
16013
|
const shared = {
|
|
@@ -15838,9 +16043,9 @@ var ContextMenuSubTrigger = forwardRef17(
|
|
|
15838
16043
|
if (!event.defaultPrevented) sub.show();
|
|
15839
16044
|
}
|
|
15840
16045
|
};
|
|
15841
|
-
if (asChild) return /* @__PURE__ */
|
|
15842
|
-
return /* @__PURE__ */
|
|
15843
|
-
startIcon ? /* @__PURE__ */
|
|
16046
|
+
if (asChild) return /* @__PURE__ */ jsx81(Slot8, { ...shared, children });
|
|
16047
|
+
return /* @__PURE__ */ jsx81("button", { ...shared, children: /* @__PURE__ */ jsxs34("span", { className: menuStyles.row, children: [
|
|
16048
|
+
startIcon ? /* @__PURE__ */ jsx81(
|
|
15844
16049
|
"span",
|
|
15845
16050
|
{
|
|
15846
16051
|
className: menuStyles.iconWrap,
|
|
@@ -15848,26 +16053,26 @@ var ContextMenuSubTrigger = forwardRef17(
|
|
|
15848
16053
|
children: startIcon
|
|
15849
16054
|
}
|
|
15850
16055
|
) : null,
|
|
15851
|
-
/* @__PURE__ */
|
|
15852
|
-
/* @__PURE__ */
|
|
15853
|
-
description ? /* @__PURE__ */
|
|
16056
|
+
/* @__PURE__ */ jsxs34("span", { className: menuStyles.textCol, children: [
|
|
16057
|
+
/* @__PURE__ */ jsx81("span", { className: menuStyles.title, children }),
|
|
16058
|
+
description ? /* @__PURE__ */ jsx81("span", { className: clsx109(menuStyles.description, menuStyles.descriptionEnabled), children: description }) : null
|
|
15854
16059
|
] }),
|
|
15855
|
-
/* @__PURE__ */
|
|
16060
|
+
/* @__PURE__ */ jsx81("span", { className: menuStyles.rightWrap, children: /* @__PURE__ */ jsx81(
|
|
15856
16061
|
"span",
|
|
15857
16062
|
{
|
|
15858
16063
|
className: menuStyles.iconWrap,
|
|
15859
16064
|
style: { width: iconSizes23.small, minWidth: iconSizes23.small, height: iconSizes23.small },
|
|
15860
|
-
children: /* @__PURE__ */
|
|
16065
|
+
children: /* @__PURE__ */ jsx81(WebIcon, { name: "chevron-right", size: iconSizes23.small, color: "currentColor", "aria-hidden": true })
|
|
15861
16066
|
}
|
|
15862
16067
|
) })
|
|
15863
16068
|
] }) });
|
|
15864
16069
|
}
|
|
15865
16070
|
);
|
|
15866
|
-
var ContextMenuSubContent =
|
|
16071
|
+
var ContextMenuSubContent = forwardRef18(
|
|
15867
16072
|
function ContextMenuSubContent2({ className, style, onPointerDown, onMouseEnter, onMouseLeave, ...props }, ref) {
|
|
15868
16073
|
const sub = useSub2();
|
|
15869
16074
|
const localRef = useRef24(null);
|
|
15870
|
-
const [side, setSide] =
|
|
16075
|
+
const [side, setSide] = useState35("right");
|
|
15871
16076
|
useLayoutEffect14(() => {
|
|
15872
16077
|
const trigger = sub.triggerRef.current;
|
|
15873
16078
|
const element = localRef.current;
|
|
@@ -15885,8 +16090,8 @@ var ContextMenuSubContent = forwardRef17(
|
|
|
15885
16090
|
placeInView(element, left, rect.top);
|
|
15886
16091
|
}, [sub.open, sub.triggerRef]);
|
|
15887
16092
|
if (!sub.open || typeof document === "undefined") return null;
|
|
15888
|
-
return
|
|
15889
|
-
/* @__PURE__ */
|
|
16093
|
+
return createPortal8(
|
|
16094
|
+
/* @__PURE__ */ jsx81(
|
|
15890
16095
|
"div",
|
|
15891
16096
|
{
|
|
15892
16097
|
...props,
|
|
@@ -16153,9 +16358,11 @@ export {
|
|
|
16153
16358
|
SidebarPeekInset,
|
|
16154
16359
|
SidebarPeekPanel,
|
|
16155
16360
|
SidebarPeekPin,
|
|
16361
|
+
SidebarProvider,
|
|
16362
|
+
SidebarTrigger,
|
|
16156
16363
|
Skeleton,
|
|
16157
16364
|
Slider,
|
|
16158
|
-
|
|
16365
|
+
Slot6 as Slot,
|
|
16159
16366
|
Spacer,
|
|
16160
16367
|
SpinButton,
|
|
16161
16368
|
Spinner,
|
|
@@ -16210,6 +16417,7 @@ export {
|
|
|
16210
16417
|
semanticTextClass,
|
|
16211
16418
|
sizedComponentTextClass,
|
|
16212
16419
|
toast,
|
|
16420
|
+
useSidebar,
|
|
16213
16421
|
useSidebarPeek
|
|
16214
16422
|
};
|
|
16215
16423
|
//# sourceMappingURL=index.js.map
|