@refineui/react 0.0.3 → 0.0.4
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 +498 -288
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3462 -9
- package/dist/index.d.ts +3462 -9
- package/dist/index.js +377 -168
- package/dist/index.js.map +1 -1
- package/dist/spec/contract-index.json +1 -1
- package/dist/spec/token-graph.json +143 -35
- package/dist/spec/token-trace-v2.json +109 -19
- package/package.json +1 -1
- package/refineui.css +19 -16
package/dist/index.js
CHANGED
|
@@ -137,13 +137,16 @@ var componentColorTokens = {
|
|
|
137
137
|
},
|
|
138
138
|
tooltip: {
|
|
139
139
|
default: {
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
/** Menu / Select floating panel semantic */
|
|
141
|
+
background: semanticToken("backgroundPrimary"),
|
|
142
|
+
foreground: semanticToken("foregroundPrimary"),
|
|
143
|
+
border: semanticToken("borderDefault")
|
|
142
144
|
}
|
|
143
145
|
},
|
|
144
146
|
popover: {
|
|
145
147
|
default: {
|
|
146
|
-
|
|
148
|
+
/** Menu / Select floating panel semantic */
|
|
149
|
+
background: semanticToken("backgroundPrimary"),
|
|
147
150
|
foreground: semanticToken("foregroundPrimary"),
|
|
148
151
|
border: semanticToken("borderDefault")
|
|
149
152
|
},
|
|
@@ -322,8 +325,8 @@ var componentColorTokens = {
|
|
|
322
325
|
foreground: semanticToken("foregroundOnSuccess")
|
|
323
326
|
},
|
|
324
327
|
warning: {
|
|
325
|
-
background:
|
|
326
|
-
foreground:
|
|
328
|
+
background: semanticToken("backgroundWarning"),
|
|
329
|
+
foreground: semanticToken("foregroundOnWarning")
|
|
327
330
|
},
|
|
328
331
|
danger: {
|
|
329
332
|
background: semanticToken("backgroundError"),
|
|
@@ -392,7 +395,7 @@ var componentColorTokens = {
|
|
|
392
395
|
pointStroke: semanticToken("backgroundPrimary"),
|
|
393
396
|
cursor: semanticToken("backgroundSurfaceHover"),
|
|
394
397
|
tooltip: {
|
|
395
|
-
background: semanticToken("
|
|
398
|
+
background: semanticToken("backgroundPrimary"),
|
|
396
399
|
foreground: semanticToken("foregroundPrimary"),
|
|
397
400
|
muted: semanticToken("foregroundSecondary"),
|
|
398
401
|
border: semanticToken("borderDefault")
|
|
@@ -445,8 +448,10 @@ var componentColorTokens = {
|
|
|
445
448
|
}
|
|
446
449
|
},
|
|
447
450
|
toast: {
|
|
448
|
-
|
|
451
|
+
/** Menu / Select panel semantic — solid, not frosted */
|
|
452
|
+
background: semanticToken("backgroundPrimary"),
|
|
449
453
|
message: semanticToken("foregroundPrimary"),
|
|
454
|
+
border: semanticToken("borderDefault"),
|
|
450
455
|
accent: {
|
|
451
456
|
default: semanticToken("foregroundPrimary"),
|
|
452
457
|
success: semanticToken("foregroundSuccess"),
|
|
@@ -514,14 +519,15 @@ var componentColorTokens = {
|
|
|
514
519
|
},
|
|
515
520
|
menu: {
|
|
516
521
|
panel: {
|
|
517
|
-
|
|
522
|
+
/** Matches Menu.style panel classes */
|
|
523
|
+
background: semanticToken("backgroundPrimary"),
|
|
518
524
|
border: semanticToken("borderDefault")
|
|
519
525
|
},
|
|
520
526
|
popover: {
|
|
521
527
|
background: "transparent"
|
|
522
528
|
},
|
|
523
529
|
list: {
|
|
524
|
-
background: semanticToken("
|
|
530
|
+
background: semanticToken("backgroundPrimary"),
|
|
525
531
|
border: semanticToken("borderDefault")
|
|
526
532
|
},
|
|
527
533
|
section: semanticToken("foregroundPrimary"),
|
|
@@ -625,8 +631,8 @@ var componentColorTokens = {
|
|
|
625
631
|
},
|
|
626
632
|
divider: {
|
|
627
633
|
line: semanticToken("borderDefault"),
|
|
628
|
-
label:
|
|
629
|
-
icon:
|
|
634
|
+
label: semanticToken("foregroundPrimary"),
|
|
635
|
+
icon: semanticToken("foregroundPrimary")
|
|
630
636
|
},
|
|
631
637
|
avatar: {
|
|
632
638
|
image: {
|
|
@@ -910,6 +916,129 @@ var componentTypographyTokens = {
|
|
|
910
916
|
}
|
|
911
917
|
};
|
|
912
918
|
|
|
919
|
+
// src/tokens/componentTokens.ts
|
|
920
|
+
import { componentSizes, semanticElevations, semanticInteraction } from "@refineui/tokens";
|
|
921
|
+
var motion = {
|
|
922
|
+
fast: {
|
|
923
|
+
duration: semanticInteraction.duration.fast,
|
|
924
|
+
easing: semanticInteraction.easing.easeOut
|
|
925
|
+
},
|
|
926
|
+
indicator: {
|
|
927
|
+
duration: semanticInteraction.duration.medium,
|
|
928
|
+
easing: semanticInteraction.easing.emphasized
|
|
929
|
+
},
|
|
930
|
+
panel: {
|
|
931
|
+
duration: semanticInteraction.duration.panel,
|
|
932
|
+
easing: semanticInteraction.easing.panel
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
var componentTokens = {
|
|
936
|
+
color: componentColorTokens,
|
|
937
|
+
typography: componentTypographyTokens,
|
|
938
|
+
motion,
|
|
939
|
+
elevation: semanticElevations,
|
|
940
|
+
toast: {
|
|
941
|
+
color: componentColorTokens.toast,
|
|
942
|
+
typography: componentTypographyTokens.toast,
|
|
943
|
+
size: {
|
|
944
|
+
minWidth: componentSizes.toastMinWidth,
|
|
945
|
+
maxWidth: componentSizes.toastMaxWidth
|
|
946
|
+
},
|
|
947
|
+
elevation: {
|
|
948
|
+
role: "toast",
|
|
949
|
+
foundation: semanticElevations.toast
|
|
950
|
+
},
|
|
951
|
+
motion: {
|
|
952
|
+
enter: semanticInteraction.duration.toastEnter,
|
|
953
|
+
leave: semanticInteraction.duration.toastLeave,
|
|
954
|
+
easing: semanticInteraction.easing.emphasized
|
|
955
|
+
}
|
|
956
|
+
},
|
|
957
|
+
segmentedControl: {
|
|
958
|
+
color: componentColorTokens.segmentedControl,
|
|
959
|
+
typography: componentTypographyTokens.segmentedControl,
|
|
960
|
+
elevation: {
|
|
961
|
+
/** Selected thumb — recipe `shadow-refineui-2` / surface */
|
|
962
|
+
role: "surface",
|
|
963
|
+
foundation: semanticElevations.surface
|
|
964
|
+
},
|
|
965
|
+
motion: {
|
|
966
|
+
/** Indicator slide after first layout */
|
|
967
|
+
indicator: motion.indicator,
|
|
968
|
+
/** Item label color fade */
|
|
969
|
+
itemColor: motion.fast
|
|
970
|
+
}
|
|
971
|
+
},
|
|
972
|
+
button: {
|
|
973
|
+
color: componentColorTokens.button,
|
|
974
|
+
typography: componentTypographyTokens.button,
|
|
975
|
+
motion: {
|
|
976
|
+
pressScale: semanticInteraction.scale.press,
|
|
977
|
+
color: motion.fast
|
|
978
|
+
}
|
|
979
|
+
},
|
|
980
|
+
chip: {
|
|
981
|
+
color: componentColorTokens.chip,
|
|
982
|
+
typography: componentTypographyTokens.chip
|
|
983
|
+
},
|
|
984
|
+
badge: {
|
|
985
|
+
color: componentColorTokens.badge
|
|
986
|
+
},
|
|
987
|
+
alert: {
|
|
988
|
+
color: componentColorTokens.alert,
|
|
989
|
+
typography: componentTypographyTokens.alert
|
|
990
|
+
},
|
|
991
|
+
dialog: {
|
|
992
|
+
color: componentColorTokens.dialog,
|
|
993
|
+
typography: componentTypographyTokens.dialog,
|
|
994
|
+
elevation: {
|
|
995
|
+
role: "modal",
|
|
996
|
+
foundation: semanticElevations.modal
|
|
997
|
+
},
|
|
998
|
+
motion: {
|
|
999
|
+
enterScale: semanticInteraction.scale.dialogEnter,
|
|
1000
|
+
panel: motion.panel
|
|
1001
|
+
}
|
|
1002
|
+
},
|
|
1003
|
+
drawer: {
|
|
1004
|
+
color: componentColorTokens.drawer,
|
|
1005
|
+
typography: componentTypographyTokens.drawer,
|
|
1006
|
+
motion: {
|
|
1007
|
+
panel: motion.panel
|
|
1008
|
+
}
|
|
1009
|
+
},
|
|
1010
|
+
accordion: {
|
|
1011
|
+
color: componentColorTokens.accordion,
|
|
1012
|
+
typography: componentTypographyTokens.accordion,
|
|
1013
|
+
motion: {
|
|
1014
|
+
panel: semanticInteraction.duration.accordionPanel,
|
|
1015
|
+
content: semanticInteraction.duration.accordionContent
|
|
1016
|
+
}
|
|
1017
|
+
},
|
|
1018
|
+
tabs: {
|
|
1019
|
+
// underline indicator shares the same mount/slide motion contract
|
|
1020
|
+
motion: {
|
|
1021
|
+
indicator: motion.indicator
|
|
1022
|
+
}
|
|
1023
|
+
},
|
|
1024
|
+
input: {
|
|
1025
|
+
color: componentColorTokens.input,
|
|
1026
|
+
typography: componentTypographyTokens.formControl
|
|
1027
|
+
},
|
|
1028
|
+
checkbox: {
|
|
1029
|
+
color: componentColorTokens.checkbox
|
|
1030
|
+
},
|
|
1031
|
+
radio: {
|
|
1032
|
+
color: componentColorTokens.radio
|
|
1033
|
+
},
|
|
1034
|
+
switch: {
|
|
1035
|
+
color: componentColorTokens.switch
|
|
1036
|
+
},
|
|
1037
|
+
toggle: {
|
|
1038
|
+
color: componentColorTokens.toggle
|
|
1039
|
+
}
|
|
1040
|
+
};
|
|
1041
|
+
|
|
913
1042
|
// src/typography.ts
|
|
914
1043
|
import { SEMANTIC_TEXT } from "@refineui/tokens";
|
|
915
1044
|
import {
|
|
@@ -942,7 +1071,7 @@ import { SEMANTIC_TEXT as SEMANTIC_TEXT2 } from "@refineui/tokens";
|
|
|
942
1071
|
|
|
943
1072
|
// src/componentSizes.ts
|
|
944
1073
|
import {
|
|
945
|
-
componentSizes,
|
|
1074
|
+
componentSizes as componentSizes2,
|
|
946
1075
|
componentSizeFoundationKeys,
|
|
947
1076
|
foundationSizes
|
|
948
1077
|
} from "@refineui/tokens";
|
|
@@ -3271,7 +3400,7 @@ var SelectContent = forwardRef6(function SelectContent2(props, forwardedRef) {
|
|
|
3271
3400
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
3272
3401
|
const vw = window.innerWidth;
|
|
3273
3402
|
const vh = window.innerHeight;
|
|
3274
|
-
const minW = parsePx(
|
|
3403
|
+
const minW = parsePx(componentSizes2.dropdownMenuWidth, 180);
|
|
3275
3404
|
const width = Math.min(Math.max(triggerRect.width, minW), vw - 2 * CONTENT_MARGIN);
|
|
3276
3405
|
const left = clampNumber(triggerRect.left, [CONTENT_MARGIN, Math.max(CONTENT_MARGIN, vw - width - CONTENT_MARGIN)]);
|
|
3277
3406
|
const gap2 = SIDE_OFFSET;
|
|
@@ -3801,7 +3930,7 @@ import {
|
|
|
3801
3930
|
useState as useState6
|
|
3802
3931
|
} from "react";
|
|
3803
3932
|
import { createPortal as createPortal2 } from "react-dom";
|
|
3804
|
-
import { iconSizes as iconSizes6, semanticInteraction } from "@refineui/tokens";
|
|
3933
|
+
import { iconSizes as iconSizes6, semanticInteraction as semanticInteraction2 } from "@refineui/tokens";
|
|
3805
3934
|
import { motionMsToNumber } from "@refineui/utilities/animation";
|
|
3806
3935
|
import { resolveColorTokenValue as resolveColorTokenValue2 } from "@refineui/utilities/color";
|
|
3807
3936
|
|
|
@@ -3899,9 +4028,9 @@ var dialogStyles = {
|
|
|
3899
4028
|
|
|
3900
4029
|
// src/components/Dialog/Dialog.tsx
|
|
3901
4030
|
import { jsx as jsx25, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
3902
|
-
var PANEL_MS = motionMsToNumber(
|
|
3903
|
-
var SCRIM_MS = motionMsToNumber(
|
|
3904
|
-
var EASING =
|
|
4031
|
+
var PANEL_MS = motionMsToNumber(semanticInteraction2.duration.panel);
|
|
4032
|
+
var SCRIM_MS = motionMsToNumber(semanticInteraction2.duration.overlay);
|
|
4033
|
+
var EASING = semanticInteraction2.easing.panel;
|
|
3905
4034
|
var DialogContext = createContext6(null);
|
|
3906
4035
|
function useDialogContext(component) {
|
|
3907
4036
|
const ctx = useContext6(DialogContext);
|
|
@@ -3994,7 +4123,7 @@ function DialogContent({ className, style, container, scrollable = true, childre
|
|
|
3994
4123
|
transform: entered ? "scale(1) translateY(0)" : "scale(var(--refineui-motion-scale-enter)) translateY(var(--refineui-spacing-size-small))",
|
|
3995
4124
|
transition: `opacity ${PANEL_MS}ms ${EASING}, transform ${PANEL_MS}ms ${EASING}`,
|
|
3996
4125
|
willChange: "opacity, transform",
|
|
3997
|
-
maxWidth: size === "lg" ?
|
|
4126
|
+
maxWidth: size === "lg" ? componentSizes2.dialogMaxWidth : componentSizes2.dialogWidthSm
|
|
3998
4127
|
};
|
|
3999
4128
|
const panelBody = scrollable ? /* @__PURE__ */ jsx25(
|
|
4000
4129
|
ScrollAreaRegion,
|
|
@@ -6030,11 +6159,15 @@ function TabsList({ className, children, ...props }) {
|
|
|
6030
6159
|
width: 0,
|
|
6031
6160
|
ready: false
|
|
6032
6161
|
});
|
|
6162
|
+
const [animate, setAnimate] = useState10(false);
|
|
6163
|
+
const hasMeasuredRef = useRef9(false);
|
|
6033
6164
|
const updateIndicator = useCallback8(() => {
|
|
6034
6165
|
const list = tabListRef.current;
|
|
6035
6166
|
if (!list) return;
|
|
6036
6167
|
const selected = list.querySelector(`${TRIGGER_SELECTOR}[data-selected="true"]`);
|
|
6037
6168
|
if (!selected) {
|
|
6169
|
+
hasMeasuredRef.current = false;
|
|
6170
|
+
setAnimate(false);
|
|
6038
6171
|
setIndicator((prev) => ({ ...prev, width: 0, ready: false }));
|
|
6039
6172
|
return;
|
|
6040
6173
|
}
|
|
@@ -6047,6 +6180,18 @@ function TabsList({ className, children, ...props }) {
|
|
|
6047
6180
|
useLayoutEffect4(() => {
|
|
6048
6181
|
updateIndicator();
|
|
6049
6182
|
}, [updateIndicator, selectedValue, children]);
|
|
6183
|
+
useEffect6(() => {
|
|
6184
|
+
if (!indicator.ready || hasMeasuredRef.current) return;
|
|
6185
|
+
hasMeasuredRef.current = true;
|
|
6186
|
+
let raf2 = 0;
|
|
6187
|
+
const raf1 = requestAnimationFrame(() => {
|
|
6188
|
+
raf2 = requestAnimationFrame(() => setAnimate(true));
|
|
6189
|
+
});
|
|
6190
|
+
return () => {
|
|
6191
|
+
cancelAnimationFrame(raf1);
|
|
6192
|
+
cancelAnimationFrame(raf2);
|
|
6193
|
+
};
|
|
6194
|
+
}, [indicator.ready]);
|
|
6050
6195
|
useEffect6(() => {
|
|
6051
6196
|
const list = tabListRef.current;
|
|
6052
6197
|
if (!list) return;
|
|
@@ -6082,6 +6227,7 @@ function TabsList({ className, children, ...props }) {
|
|
|
6082
6227
|
{
|
|
6083
6228
|
"data-refineui": "tabs-indicator",
|
|
6084
6229
|
"data-ready": indicator.ready ? "true" : void 0,
|
|
6230
|
+
"data-animate": animate ? "true" : void 0,
|
|
6085
6231
|
"aria-hidden": true,
|
|
6086
6232
|
className: tabsStyles.indicator,
|
|
6087
6233
|
style: indicatorStyle
|
|
@@ -6299,6 +6445,8 @@ function SegmentedControl({
|
|
|
6299
6445
|
width: 0,
|
|
6300
6446
|
ready: false
|
|
6301
6447
|
});
|
|
6448
|
+
const [animate, setAnimate] = useState11(false);
|
|
6449
|
+
const hasMeasuredRef = useRef10(false);
|
|
6302
6450
|
const updateIndicator = useCallback9(() => {
|
|
6303
6451
|
const group = groupRef.current;
|
|
6304
6452
|
if (!group) return;
|
|
@@ -6306,6 +6454,8 @@ function SegmentedControl({
|
|
|
6306
6454
|
`${ITEM_SELECTOR}[data-selected="true"]`
|
|
6307
6455
|
);
|
|
6308
6456
|
if (!selected) {
|
|
6457
|
+
hasMeasuredRef.current = false;
|
|
6458
|
+
setAnimate(false);
|
|
6309
6459
|
setIndicator((prev) => ({ ...prev, width: 0, ready: false }));
|
|
6310
6460
|
return;
|
|
6311
6461
|
}
|
|
@@ -6318,6 +6468,18 @@ function SegmentedControl({
|
|
|
6318
6468
|
useLayoutEffect5(() => {
|
|
6319
6469
|
updateIndicator();
|
|
6320
6470
|
}, [updateIndicator, selectedValue, children]);
|
|
6471
|
+
useEffect7(() => {
|
|
6472
|
+
if (!indicator.ready || hasMeasuredRef.current) return;
|
|
6473
|
+
hasMeasuredRef.current = true;
|
|
6474
|
+
let raf2 = 0;
|
|
6475
|
+
const raf1 = requestAnimationFrame(() => {
|
|
6476
|
+
raf2 = requestAnimationFrame(() => setAnimate(true));
|
|
6477
|
+
});
|
|
6478
|
+
return () => {
|
|
6479
|
+
cancelAnimationFrame(raf1);
|
|
6480
|
+
cancelAnimationFrame(raf2);
|
|
6481
|
+
};
|
|
6482
|
+
}, [indicator.ready]);
|
|
6321
6483
|
useEffect7(() => {
|
|
6322
6484
|
const group = groupRef.current;
|
|
6323
6485
|
if (!group) return;
|
|
@@ -6353,6 +6515,7 @@ function SegmentedControl({
|
|
|
6353
6515
|
{
|
|
6354
6516
|
"data-refineui": "segmented-control-indicator",
|
|
6355
6517
|
"data-ready": indicator.ready ? "true" : void 0,
|
|
6518
|
+
"data-animate": animate ? "true" : void 0,
|
|
6356
6519
|
"aria-hidden": true,
|
|
6357
6520
|
className: segmentedControlStyles.indicator,
|
|
6358
6521
|
style: indicatorStyle
|
|
@@ -6524,14 +6687,14 @@ import { clsx as clsx51 } from "clsx";
|
|
|
6524
6687
|
|
|
6525
6688
|
// src/components/Accordion/context.ts
|
|
6526
6689
|
import { createContext as createContext13, useEffect as useEffect8, useState as useState12 } from "react";
|
|
6527
|
-
import { semanticInteraction as
|
|
6690
|
+
import { semanticInteraction as semanticInteraction3 } from "@refineui/tokens";
|
|
6528
6691
|
import { getReducedMotionQuery } from "@refineui/utilities/animation";
|
|
6529
6692
|
var AccordionContext = createContext13(null);
|
|
6530
6693
|
var AccordionItemContext = createContext13(null);
|
|
6531
|
-
var PANEL_HEIGHT_MS = Number.parseFloat(
|
|
6532
|
-
var PANEL_CONTENT_MS = Number.parseFloat(
|
|
6533
|
-
var PANEL_HEIGHT_EASE =
|
|
6534
|
-
var PANEL_CONTENT_EASE =
|
|
6694
|
+
var PANEL_HEIGHT_MS = Number.parseFloat(semanticInteraction3.duration.accordionPanel) / 1e3;
|
|
6695
|
+
var PANEL_CONTENT_MS = Number.parseFloat(semanticInteraction3.duration.accordionContent) / 1e3;
|
|
6696
|
+
var PANEL_HEIGHT_EASE = semanticInteraction3.easing.panel;
|
|
6697
|
+
var PANEL_CONTENT_EASE = semanticInteraction3.easing.content;
|
|
6535
6698
|
function usePrefersReducedMotion() {
|
|
6536
6699
|
const [reduce, setReduce] = useState12(false);
|
|
6537
6700
|
useEffect8(() => {
|
|
@@ -7640,8 +7803,8 @@ function DividerCircleGlyph() {
|
|
|
7640
7803
|
"aria-hidden": true,
|
|
7641
7804
|
className: dividerStyles.iconCircle,
|
|
7642
7805
|
style: {
|
|
7643
|
-
width:
|
|
7644
|
-
height:
|
|
7806
|
+
width: componentSizes2.dividerIconCircleDiameter,
|
|
7807
|
+
height: componentSizes2.dividerIconCircleDiameter
|
|
7645
7808
|
}
|
|
7646
7809
|
}
|
|
7647
7810
|
);
|
|
@@ -8025,7 +8188,7 @@ import {
|
|
|
8025
8188
|
useState as useState15
|
|
8026
8189
|
} from "react";
|
|
8027
8190
|
import { createPortal as createPortal3 } from "react-dom";
|
|
8028
|
-
import { iconSizes as iconSizes13, semanticInteraction as
|
|
8191
|
+
import { iconSizes as iconSizes13, semanticInteraction as semanticInteraction4 } from "@refineui/tokens";
|
|
8029
8192
|
import { motionMsToNumber as motionMsToNumber2 } from "@refineui/utilities/animation";
|
|
8030
8193
|
import { resolveColorTokenValue as resolveColorTokenValue6 } from "@refineui/utilities/color";
|
|
8031
8194
|
import { acquireBodyScrollLock as acquireBodyScrollLock2 } from "@refineui/utilities/react";
|
|
@@ -8066,9 +8229,9 @@ var drawerStyles = {
|
|
|
8066
8229
|
|
|
8067
8230
|
// src/components/Drawer/Drawer.tsx
|
|
8068
8231
|
import { jsx as jsx52, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
8069
|
-
var PANEL_MS2 = motionMsToNumber2(
|
|
8070
|
-
var SCRIM_MS2 = motionMsToNumber2(
|
|
8071
|
-
var EASING2 =
|
|
8232
|
+
var PANEL_MS2 = motionMsToNumber2(semanticInteraction4.duration.panel);
|
|
8233
|
+
var SCRIM_MS2 = motionMsToNumber2(semanticInteraction4.duration.overlay);
|
|
8234
|
+
var EASING2 = semanticInteraction4.easing.panel;
|
|
8072
8235
|
var DrawerContext = createContext15(null);
|
|
8073
8236
|
function useDrawerContext(component) {
|
|
8074
8237
|
const ctx = useContext17(DrawerContext);
|
|
@@ -8091,11 +8254,11 @@ function useDrawerOpenState(openProp, defaultOpen, onOpenChange) {
|
|
|
8091
8254
|
function widthToken(s) {
|
|
8092
8255
|
switch (s) {
|
|
8093
8256
|
case "md":
|
|
8094
|
-
return
|
|
8257
|
+
return componentSizes2.drawerWidthMd;
|
|
8095
8258
|
case "lg":
|
|
8096
|
-
return
|
|
8259
|
+
return componentSizes2.drawerWidthLg;
|
|
8097
8260
|
default:
|
|
8098
|
-
return
|
|
8261
|
+
return componentSizes2.drawerWidthSm;
|
|
8099
8262
|
}
|
|
8100
8263
|
}
|
|
8101
8264
|
function Drawer({
|
|
@@ -8690,7 +8853,7 @@ function DropdownContent({
|
|
|
8690
8853
|
const [fixedStyle, setFixedStyle] = useState16(null);
|
|
8691
8854
|
const [menuSide, setMenuSide] = useState16("bottom");
|
|
8692
8855
|
const gapPx = sideOffset ?? parseCssPxLen(spacings2.sizeXXSmall, 4);
|
|
8693
|
-
const defaultMenuW = parseCssPxLen(
|
|
8856
|
+
const defaultMenuW = parseCssPxLen(componentSizes2.dropdownMenuWidth, 180);
|
|
8694
8857
|
const z = Number.parseInt(String(zIndex.zIndexMessages), 10) || 1e4;
|
|
8695
8858
|
useIsomorphicLayoutEffect3(() => {
|
|
8696
8859
|
if (!open) {
|
|
@@ -8718,7 +8881,7 @@ function DropdownContent({
|
|
|
8718
8881
|
position: "fixed",
|
|
8719
8882
|
top: pos.top,
|
|
8720
8883
|
left: pos.left,
|
|
8721
|
-
minWidth:
|
|
8884
|
+
minWidth: componentSizes2.dropdownMenuWidth,
|
|
8722
8885
|
zIndex: z,
|
|
8723
8886
|
maxHeight: "min(60vh, 20rem)"
|
|
8724
8887
|
};
|
|
@@ -9055,7 +9218,7 @@ function DropdownSubContent({ className, children, style, ...props }) {
|
|
|
9055
9218
|
const panelRef = useRef13(null);
|
|
9056
9219
|
const [fixedStyle, setFixedStyle] = useState16(null);
|
|
9057
9220
|
const [side, setSide] = useState16("right");
|
|
9058
|
-
const defaultMenuW = parseCssPxLen(
|
|
9221
|
+
const defaultMenuW = parseCssPxLen(componentSizes2.dropdownMenuWidth, 180);
|
|
9059
9222
|
const gapPx = parseCssPxLen(spacings2.sizeXXXSmall, 2);
|
|
9060
9223
|
const setPanelEl = useCallback12(
|
|
9061
9224
|
(el) => {
|
|
@@ -9093,7 +9256,7 @@ function DropdownSubContent({ className, children, style, ...props }) {
|
|
|
9093
9256
|
position: "fixed",
|
|
9094
9257
|
top: pos.top,
|
|
9095
9258
|
left: pos.left,
|
|
9096
|
-
minWidth:
|
|
9259
|
+
minWidth: componentSizes2.dropdownMenuWidth,
|
|
9097
9260
|
zIndex: (Number.parseInt(String(zIndex.zIndexMessages), 10) || 1e4) + 100,
|
|
9098
9261
|
maxHeight: "min(60vh, 20rem)"
|
|
9099
9262
|
});
|
|
@@ -9305,7 +9468,7 @@ import {
|
|
|
9305
9468
|
useState as useState17
|
|
9306
9469
|
} from "react";
|
|
9307
9470
|
import { createPortal as createPortal5 } from "react-dom";
|
|
9308
|
-
import { iconSizes as iconSizes16, semanticInteraction as
|
|
9471
|
+
import { iconSizes as iconSizes16, semanticInteraction as semanticInteraction5, spacings as spacings3, zIndex as zIndex2 } from "@refineui/tokens";
|
|
9309
9472
|
import { motionMsToNumber as motionMsToNumber3 } from "@refineui/utilities/animation";
|
|
9310
9473
|
import { getMergeableTriggerChild as getMergeableTriggerChild2 } from "@refineui/utilities/react";
|
|
9311
9474
|
|
|
@@ -9450,7 +9613,7 @@ function MenuPopover({ className, children, style, ...props }) {
|
|
|
9450
9613
|
setShouldRender(false);
|
|
9451
9614
|
setIsClosing(false);
|
|
9452
9615
|
setFixedStyle(null);
|
|
9453
|
-
}, motionMsToNumber3(
|
|
9616
|
+
}, motionMsToNumber3(semanticInteraction5.duration.normal));
|
|
9454
9617
|
return () => window.clearTimeout(timeout);
|
|
9455
9618
|
}, [open, shouldRender]);
|
|
9456
9619
|
useIsomorphicLayoutEffect4(() => {
|
|
@@ -9465,7 +9628,7 @@ function MenuPopover({ className, children, style, ...props }) {
|
|
|
9465
9628
|
position: "fixed",
|
|
9466
9629
|
top: rect.bottom + gapPx,
|
|
9467
9630
|
left: rect.left,
|
|
9468
|
-
minWidth:
|
|
9631
|
+
minWidth: componentSizes2.menuPanelWidth,
|
|
9469
9632
|
width: positioning?.autoSize ? "max-content" : void 0,
|
|
9470
9633
|
maxWidth: "min(100vw - 16px, 24rem)",
|
|
9471
9634
|
zIndex: z
|
|
@@ -9815,7 +9978,7 @@ function MenuSubContent({ className, children, style, ...props }) {
|
|
|
9815
9978
|
const [side, setSide] = useState17("right");
|
|
9816
9979
|
const gapPx = parseCssPx(spacings3.sizeXXXSmall, 2);
|
|
9817
9980
|
const z = (Number.parseInt(String(zIndex2.zIndexMessages), 10) || 1e4) + 100;
|
|
9818
|
-
const defaultW = parseCssPx(
|
|
9981
|
+
const defaultW = parseCssPx(componentSizes2.menuPanelWidth, 244);
|
|
9819
9982
|
const setPanelEl = useCallback13(
|
|
9820
9983
|
(el) => {
|
|
9821
9984
|
panelRef.current = el;
|
|
@@ -9854,7 +10017,7 @@ function MenuSubContent({ className, children, style, ...props }) {
|
|
|
9854
10017
|
position: "fixed",
|
|
9855
10018
|
top: pos.top,
|
|
9856
10019
|
left: pos.left,
|
|
9857
|
-
minWidth:
|
|
10020
|
+
minWidth: componentSizes2.menuPanelWidth,
|
|
9858
10021
|
zIndex: z,
|
|
9859
10022
|
maxHeight: "min(60vh, 20rem)"
|
|
9860
10023
|
});
|
|
@@ -9923,14 +10086,14 @@ import {
|
|
|
9923
10086
|
useRef as useRef15,
|
|
9924
10087
|
useState as useState18
|
|
9925
10088
|
} from "react";
|
|
9926
|
-
import { iconSizes as iconSizes17, semanticInteraction as
|
|
10089
|
+
import { iconSizes as iconSizes17, semanticInteraction as semanticInteraction6 } from "@refineui/tokens";
|
|
9927
10090
|
import { motionMsToNumber as motionMsToNumber4 } from "@refineui/utilities/animation";
|
|
9928
10091
|
|
|
9929
10092
|
// src/components/NavigationMenu/style.ts
|
|
9930
10093
|
import { clsx as clsx77 } from "clsx";
|
|
9931
10094
|
var topLevelItem = clsx77(
|
|
9932
10095
|
componentTextClass(componentTypographyTokens.navigationMenu.trigger),
|
|
9933
|
-
"box-border inline-flex cursor-pointer items-center justify-center gap-refineui-size-x-small",
|
|
10096
|
+
"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",
|
|
9934
10097
|
"rounded-refineui-large border-none bg-transparent px-refineui-size-medium py-refineui-size-x-small",
|
|
9935
10098
|
"text-refineui-alias-foreground-tertiary outline-none leading-none",
|
|
9936
10099
|
"transition-[color,background-color] duration-[var(--refineui-motion-duration-fast)]"
|
|
@@ -9947,8 +10110,6 @@ var navigationMenuStyles = {
|
|
|
9947
10110
|
triggerDisabled: "cursor-not-allowed text-refineui-alias-foreground-disabled",
|
|
9948
10111
|
chevron,
|
|
9949
10112
|
chevronOpen: "rotate-180",
|
|
9950
|
-
/** Matches trigger chevron box so direct top-level links align with dropdown triggers. */
|
|
9951
|
-
linkChevronSpacer: clsx77(chevron, "inline-block size-refineui-icon-xsmall shrink-0 pointer-events-none invisible"),
|
|
9952
10113
|
content: clsx77(
|
|
9953
10114
|
/** Flush under trigger so pointer does not leave the item while moving into the panel. */
|
|
9954
10115
|
"absolute start-0 top-full z-refineui-messages pt-refineui-size-xx-small",
|
|
@@ -10023,8 +10184,8 @@ function NavigationMenu({
|
|
|
10023
10184
|
const openTimerRef = useRef15(null);
|
|
10024
10185
|
const closeTimerRef = useRef15(null);
|
|
10025
10186
|
const rootRef = useRef15(null);
|
|
10026
|
-
const delayDuration = delayDurationProp ?? motionMsToNumber4(
|
|
10027
|
-
const skipDelayDuration = skipDelayDurationProp ?? motionMsToNumber4(
|
|
10187
|
+
const delayDuration = delayDurationProp ?? motionMsToNumber4(semanticInteraction6.duration.normal);
|
|
10188
|
+
const skipDelayDuration = skipDelayDurationProp ?? motionMsToNumber4(semanticInteraction6.duration.fast);
|
|
10028
10189
|
const clearTimers = useCallback14(() => {
|
|
10029
10190
|
if (openTimerRef.current != null) {
|
|
10030
10191
|
window.clearTimeout(openTimerRef.current);
|
|
@@ -10189,10 +10350,12 @@ function NavigationMenuItem({
|
|
|
10189
10350
|
onPointerEnter: (event) => {
|
|
10190
10351
|
onPointerEnter?.(event);
|
|
10191
10352
|
if (event.defaultPrevented) return;
|
|
10192
|
-
const
|
|
10193
|
-
event.currentTarget.querySelector(
|
|
10353
|
+
const hasEnabledTrigger = Boolean(
|
|
10354
|
+
event.currentTarget.querySelector(
|
|
10355
|
+
'[data-refineui="navigation-menu-trigger"]:not(:disabled)'
|
|
10356
|
+
)
|
|
10194
10357
|
);
|
|
10195
|
-
if (
|
|
10358
|
+
if (hasEnabledTrigger) {
|
|
10196
10359
|
menu.openItem(value);
|
|
10197
10360
|
}
|
|
10198
10361
|
},
|
|
@@ -10304,7 +10467,7 @@ function NavigationMenuContent({
|
|
|
10304
10467
|
const timeout = window.setTimeout(() => {
|
|
10305
10468
|
setShouldRender(false);
|
|
10306
10469
|
setIsClosing(false);
|
|
10307
|
-
}, motionMsToNumber4(
|
|
10470
|
+
}, motionMsToNumber4(semanticInteraction6.duration.fast));
|
|
10308
10471
|
return () => window.clearTimeout(timeout);
|
|
10309
10472
|
}, [item.open, shouldRender]);
|
|
10310
10473
|
const contentCtx = useMemo14(
|
|
@@ -10346,7 +10509,7 @@ function NavigationMenuLink({
|
|
|
10346
10509
|
const menu = useContext20(NavigationMenuContext);
|
|
10347
10510
|
const inContent = menu?.isInsideContent ?? false;
|
|
10348
10511
|
const disabled = ariaDisabled === true || ariaDisabled === "true";
|
|
10349
|
-
return /* @__PURE__ */
|
|
10512
|
+
return /* @__PURE__ */ jsx59(
|
|
10350
10513
|
"a",
|
|
10351
10514
|
{
|
|
10352
10515
|
"data-refineui": "navigation-menu-link",
|
|
@@ -10362,7 +10525,11 @@ function NavigationMenuLink({
|
|
|
10362
10525
|
),
|
|
10363
10526
|
onClick: (event) => {
|
|
10364
10527
|
onClick?.(event);
|
|
10365
|
-
if (event.defaultPrevented
|
|
10528
|
+
if (event.defaultPrevented) return;
|
|
10529
|
+
if (disabled) {
|
|
10530
|
+
event.preventDefault();
|
|
10531
|
+
return;
|
|
10532
|
+
}
|
|
10366
10533
|
menu?.setValue("");
|
|
10367
10534
|
},
|
|
10368
10535
|
onFocus: (event) => {
|
|
@@ -10372,10 +10539,7 @@ function NavigationMenuLink({
|
|
|
10372
10539
|
}
|
|
10373
10540
|
},
|
|
10374
10541
|
...props,
|
|
10375
|
-
children
|
|
10376
|
-
children,
|
|
10377
|
-
!inContent ? /* @__PURE__ */ jsx59("span", { "aria-hidden": true, className: navigationMenuStyles.linkChevronSpacer }) : null
|
|
10378
|
-
]
|
|
10542
|
+
children
|
|
10379
10543
|
}
|
|
10380
10544
|
);
|
|
10381
10545
|
}
|
|
@@ -10588,7 +10752,7 @@ import {
|
|
|
10588
10752
|
useRef as useRef16,
|
|
10589
10753
|
useState as useState19
|
|
10590
10754
|
} from "react";
|
|
10591
|
-
import { semanticInteraction as
|
|
10755
|
+
import { semanticInteraction as semanticInteraction7 } from "@refineui/tokens";
|
|
10592
10756
|
import { motionMsToNumber as motionMsToNumber5 } from "@refineui/utilities/animation";
|
|
10593
10757
|
|
|
10594
10758
|
// src/components/Sidebar/peekStyle.ts
|
|
@@ -10614,9 +10778,9 @@ var sidebarPeekStyles = {
|
|
|
10614
10778
|
|
|
10615
10779
|
// src/components/Sidebar/SidebarPeek.tsx
|
|
10616
10780
|
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
10617
|
-
var PEEK_OPEN_DELAY_MS = motionMsToNumber5(
|
|
10618
|
-
var PEEK_CLOSE_DELAY_MS = motionMsToNumber5(
|
|
10619
|
-
var PEEK_BRIDGE_DELAY_MS = motionMsToNumber5(
|
|
10781
|
+
var PEEK_OPEN_DELAY_MS = motionMsToNumber5(semanticInteraction7.duration.medium);
|
|
10782
|
+
var PEEK_CLOSE_DELAY_MS = motionMsToNumber5(semanticInteraction7.duration.medium);
|
|
10783
|
+
var PEEK_BRIDGE_DELAY_MS = motionMsToNumber5(semanticInteraction7.duration.slow);
|
|
10620
10784
|
var SidebarPeekContext = createContext19(null);
|
|
10621
10785
|
function useSidebarPeekContext(component) {
|
|
10622
10786
|
const ctx = useContext21(SidebarPeekContext);
|
|
@@ -11032,8 +11196,8 @@ var BEAK_OFFSET = foundationSizes.foundationSize80;
|
|
|
11032
11196
|
var BEAK_BORDER_OVERLAP = strokeWidths2.strokeWidthThin;
|
|
11033
11197
|
var POPOVER_GAP = spacings4.sizeMedium;
|
|
11034
11198
|
function beakWrapperStyle(placement, align) {
|
|
11035
|
-
const insetStart =
|
|
11036
|
-
const insetEnd =
|
|
11199
|
+
const insetStart = componentSizes2.popoverBeakInsetFromStartEdge;
|
|
11200
|
+
const insetEnd = componentSizes2.popoverBeakInsetFromEndEdge;
|
|
11037
11201
|
const edge = spacings4.sizeMedium;
|
|
11038
11202
|
const overlapOffset = `calc(-1 * ${BEAK_OFFSET} + ${BEAK_BORDER_OVERLAP})`;
|
|
11039
11203
|
switch (placement) {
|
|
@@ -11262,7 +11426,7 @@ function PopoverContent({
|
|
|
11262
11426
|
),
|
|
11263
11427
|
style: {
|
|
11264
11428
|
...styleProp && typeof styleProp === "object" ? styleProp : {},
|
|
11265
|
-
minWidth:
|
|
11429
|
+
minWidth: componentSizes2.popoverPanelWidth,
|
|
11266
11430
|
padding: spacings4.sizeLarge,
|
|
11267
11431
|
backgroundColor: bg,
|
|
11268
11432
|
color: resolveColorTokenValue10(palette.foreground),
|
|
@@ -13235,14 +13399,15 @@ import {
|
|
|
13235
13399
|
useSyncExternalStore
|
|
13236
13400
|
} from "react";
|
|
13237
13401
|
import { createPortal as createPortal6 } from "react-dom";
|
|
13238
|
-
import { iconSizes as iconSizes22,
|
|
13402
|
+
import { iconSizes as iconSizes22, spacings as spacings5 } from "@refineui/tokens";
|
|
13239
13403
|
import { motionMsToNumber as motionMsToNumber6 } from "@refineui/utilities/animation";
|
|
13404
|
+
import { resolveColorTokenValue as resolveColorTokenValue11 } from "@refineui/utilities/color";
|
|
13240
13405
|
|
|
13241
13406
|
// src/recipes/toast.recipe.ts
|
|
13242
13407
|
import { clsx as clsx97 } from "clsx";
|
|
13243
13408
|
var toastRecipe = defineRecipe({
|
|
13244
13409
|
name: "toast",
|
|
13245
|
-
base: "relative isolate box-border flex w-fit max-w-refineui-toast-max-width cursor-grab items-center gap-refineui-size-small rounded-refineui-
|
|
13410
|
+
base: "relative isolate box-border flex w-fit min-w-refineui-toast-min-width max-w-refineui-toast-max-width cursor-grab items-center gap-refineui-size-small rounded-refineui-x-large border-refineui-hairline border-refineui-alias-border-default bg-refineui-alias-background-primary py-refineui-size-medium ps-refineui-size-medium pe-refineui-size-large select-none",
|
|
13246
13411
|
variants: {
|
|
13247
13412
|
variant: {
|
|
13248
13413
|
default: "",
|
|
@@ -13272,7 +13437,7 @@ var toastStyles = {
|
|
|
13272
13437
|
import { jsx as jsx71, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
13273
13438
|
var useIsomorphicLayoutEffect6 = typeof document !== "undefined" ? useLayoutEffect11 : useEffect18;
|
|
13274
13439
|
var ENTER_MS = 20;
|
|
13275
|
-
var LEAVE_MS = motionMsToNumber6(
|
|
13440
|
+
var LEAVE_MS = motionMsToNumber6(componentTokens.toast.motion.leave) + 60;
|
|
13276
13441
|
var DEFAULT_DURATION = 4200;
|
|
13277
13442
|
var DEFAULT_MAX_TOASTS = 1;
|
|
13278
13443
|
var STACK_Z_BASE = 100;
|
|
@@ -13477,6 +13642,12 @@ var Toast = forwardRef15(function Toast2(props, ref) {
|
|
|
13477
13642
|
children: action.label
|
|
13478
13643
|
}
|
|
13479
13644
|
) : action;
|
|
13645
|
+
const color = componentColorTokens.toast;
|
|
13646
|
+
const tokenStyle = {
|
|
13647
|
+
backgroundColor: resolveColorTokenValue11(color.background),
|
|
13648
|
+
borderColor: resolveColorTokenValue11(color.border),
|
|
13649
|
+
color: resolveColorTokenValue11(color.message)
|
|
13650
|
+
};
|
|
13480
13651
|
return /* @__PURE__ */ jsxs29(
|
|
13481
13652
|
"div",
|
|
13482
13653
|
{
|
|
@@ -13487,7 +13658,7 @@ var Toast = forwardRef15(function Toast2(props, ref) {
|
|
|
13487
13658
|
role: liveRole,
|
|
13488
13659
|
"aria-live": ariaLive,
|
|
13489
13660
|
...domProps,
|
|
13490
|
-
style,
|
|
13661
|
+
style: { ...tokenStyle, ...style },
|
|
13491
13662
|
className: clsx98(toastStyles.card, className),
|
|
13492
13663
|
children: [
|
|
13493
13664
|
/* @__PURE__ */ jsx71("div", { "data-refineui": "toast-icon", className: toastStyles.iconWrap, children: iconContent }),
|
|
@@ -14243,36 +14414,49 @@ function TreeItemContent({ className, children, ...props }) {
|
|
|
14243
14414
|
// src/components/Tooltip/Tooltip.tsx
|
|
14244
14415
|
import { clsx as clsx105 } from "clsx";
|
|
14245
14416
|
import { cloneElement as cloneElement6, useId as useId16, useRef as useRef23, useState as useState30 } from "react";
|
|
14246
|
-
import {
|
|
14247
|
-
import { resolveColorTokenValue as resolveColorTokenValue11 } from "@refineui/utilities/color";
|
|
14417
|
+
import { resolveColorTokenValue as resolveColorTokenValue12 } from "@refineui/utilities/color";
|
|
14248
14418
|
import { getMergeableTriggerChild as getMergeableTriggerChild4 } from "@refineui/utilities/react";
|
|
14249
14419
|
|
|
14250
14420
|
// src/components/Tooltip/style.ts
|
|
14251
|
-
import {
|
|
14421
|
+
import { spacings as spacings6, strokeWidths as strokeWidths3 } from "@refineui/tokens";
|
|
14252
14422
|
import { clsx as clsx104 } from "clsx";
|
|
14423
|
+
var TOOLTIP_BEAK_W = foundationSizes.foundationSize160;
|
|
14424
|
+
var TOOLTIP_BEAK_H = foundationSizes.foundationSize80;
|
|
14425
|
+
var TOOLTIP_BEAK_OFFSET = foundationSizes.foundationSize80;
|
|
14426
|
+
var BEAK_BORDER_OVERLAP2 = strokeWidths3.strokeWidthThin;
|
|
14427
|
+
var gap = spacings6.sizeXSmall;
|
|
14428
|
+
var edgeInset = spacings6.sizeMedium;
|
|
14253
14429
|
var tooltipStyles = {
|
|
14254
14430
|
root: "relative inline-block",
|
|
14255
14431
|
fallbackTrigger: "inline-flex outline-none",
|
|
14432
|
+
/** Positions the floating stack (beak + panel), like PopOver `floatingRoot`. */
|
|
14433
|
+
floating: "pointer-events-none absolute z-refineui-popup",
|
|
14434
|
+
panelWrap: "relative inline-block max-w-refineui-tooltip-max-width",
|
|
14435
|
+
beakWrap: "pointer-events-none absolute z-[1]",
|
|
14256
14436
|
panel: clsx104(
|
|
14257
14437
|
componentTextClass(componentTypographyTokens.tooltip),
|
|
14258
|
-
"
|
|
14438
|
+
"relative z-0 box-border max-w-refineui-tooltip-max-width whitespace-nowrap rounded-refineui-medium border-refineui-thin px-refineui-size-medium py-refineui-size-small shadow-refineui-8"
|
|
14259
14439
|
)
|
|
14260
14440
|
};
|
|
14261
|
-
|
|
14262
|
-
|
|
14263
|
-
|
|
14264
|
-
|
|
14265
|
-
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
|
|
14441
|
+
function tooltipPlacement(position) {
|
|
14442
|
+
switch (position) {
|
|
14443
|
+
case "Top":
|
|
14444
|
+
return "top";
|
|
14445
|
+
case "Left":
|
|
14446
|
+
return "left";
|
|
14447
|
+
case "Right":
|
|
14448
|
+
return "right";
|
|
14449
|
+
case "Bottom":
|
|
14450
|
+
default:
|
|
14451
|
+
return "bottom";
|
|
14452
|
+
}
|
|
14270
14453
|
}
|
|
14271
|
-
function
|
|
14272
|
-
|
|
14454
|
+
function tooltipAlignKey(align) {
|
|
14455
|
+
if (align === "Start") return "start";
|
|
14456
|
+
if (align === "End") return "end";
|
|
14457
|
+
return "center";
|
|
14273
14458
|
}
|
|
14274
|
-
|
|
14275
|
-
function tooltipPanelStyle(position, align) {
|
|
14459
|
+
function tooltipFloatingStyle(position, align) {
|
|
14276
14460
|
switch (position) {
|
|
14277
14461
|
case "Top":
|
|
14278
14462
|
if (align === "Start") return { bottom: "100%", left: 0, marginBottom: gap };
|
|
@@ -14294,55 +14478,44 @@ function tooltipPanelStyle(position, align) {
|
|
|
14294
14478
|
return {};
|
|
14295
14479
|
}
|
|
14296
14480
|
}
|
|
14297
|
-
function
|
|
14298
|
-
const
|
|
14299
|
-
const
|
|
14300
|
-
|
|
14301
|
-
|
|
14302
|
-
|
|
14303
|
-
|
|
14304
|
-
|
|
14305
|
-
|
|
14306
|
-
|
|
14307
|
-
|
|
14308
|
-
|
|
14309
|
-
|
|
14310
|
-
|
|
14311
|
-
|
|
14312
|
-
|
|
14313
|
-
|
|
14314
|
-
|
|
14315
|
-
top:
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14319
|
-
|
|
14320
|
-
if (align === "Start") return { ...tri2, left: edgeInset, marginLeft: 0 };
|
|
14321
|
-
if (align === "End") return { ...tri2, right: edgeInset, left: "auto", marginLeft: 0 };
|
|
14322
|
-
return { ...tri2, left: "50%", marginLeft: -b };
|
|
14481
|
+
function tooltipBeakWrapperStyle(position, align) {
|
|
14482
|
+
const overlapOffset = `calc(-1 * ${TOOLTIP_BEAK_OFFSET} + ${BEAK_BORDER_OVERLAP2})`;
|
|
14483
|
+
const placement = tooltipPlacement(position);
|
|
14484
|
+
const a = tooltipAlignKey(align);
|
|
14485
|
+
switch (placement) {
|
|
14486
|
+
case "bottom":
|
|
14487
|
+
if (a === "center") return { top: overlapOffset, left: `calc(50% - ${TOOLTIP_BEAK_W} / 2)` };
|
|
14488
|
+
if (a === "start") return { top: overlapOffset, left: edgeInset };
|
|
14489
|
+
return { top: overlapOffset, right: edgeInset };
|
|
14490
|
+
case "top":
|
|
14491
|
+
if (a === "center") return { bottom: overlapOffset, left: `calc(50% - ${TOOLTIP_BEAK_W} / 2)` };
|
|
14492
|
+
if (a === "start") return { bottom: overlapOffset, left: edgeInset };
|
|
14493
|
+
return { bottom: overlapOffset, right: edgeInset };
|
|
14494
|
+
case "left":
|
|
14495
|
+
if (a === "center") return { right: overlapOffset, top: `calc(50% - ${TOOLTIP_BEAK_W} / 2)` };
|
|
14496
|
+
if (a === "start") return { right: overlapOffset, top: edgeInset };
|
|
14497
|
+
return { right: overlapOffset, bottom: edgeInset };
|
|
14498
|
+
case "right":
|
|
14499
|
+
if (a === "center") return { left: overlapOffset, top: `calc(50% - ${TOOLTIP_BEAK_W} / 2)` };
|
|
14500
|
+
if (a === "start") return { left: overlapOffset, top: edgeInset };
|
|
14501
|
+
return { left: overlapOffset, bottom: edgeInset };
|
|
14502
|
+
default:
|
|
14503
|
+
return {};
|
|
14323
14504
|
}
|
|
14324
|
-
|
|
14325
|
-
|
|
14326
|
-
|
|
14327
|
-
|
|
14328
|
-
|
|
14329
|
-
|
|
14330
|
-
|
|
14331
|
-
|
|
14332
|
-
|
|
14333
|
-
|
|
14334
|
-
|
|
14505
|
+
}
|
|
14506
|
+
function tooltipBeakRotateDeg(position) {
|
|
14507
|
+
switch (tooltipPlacement(position)) {
|
|
14508
|
+
case "bottom":
|
|
14509
|
+
return 0;
|
|
14510
|
+
case "top":
|
|
14511
|
+
return 180;
|
|
14512
|
+
case "left":
|
|
14513
|
+
return -90;
|
|
14514
|
+
case "right":
|
|
14515
|
+
return 90;
|
|
14516
|
+
default:
|
|
14517
|
+
return 0;
|
|
14335
14518
|
}
|
|
14336
|
-
const tri = {
|
|
14337
|
-
...baseBox,
|
|
14338
|
-
left: outset,
|
|
14339
|
-
borderTop: `${b}px solid transparent`,
|
|
14340
|
-
borderBottom: `${b}px solid transparent`,
|
|
14341
|
-
borderRight: `${b}px solid ${bg}`
|
|
14342
|
-
};
|
|
14343
|
-
if (align === "Start") return { ...tri, top: edgeInset, marginTop: 0 };
|
|
14344
|
-
if (align === "End") return { ...tri, bottom: edgeInset, top: "auto", marginTop: 0 };
|
|
14345
|
-
return { ...tri, top: "50%", marginTop: -b };
|
|
14346
14519
|
}
|
|
14347
14520
|
|
|
14348
14521
|
// src/components/Tooltip/Tooltip.tsx
|
|
@@ -14367,8 +14540,10 @@ function Tooltip({
|
|
|
14367
14540
|
if (ctrlOpen === void 0) setInnerOpen(next);
|
|
14368
14541
|
onOpenChange?.(next);
|
|
14369
14542
|
};
|
|
14370
|
-
const
|
|
14371
|
-
const
|
|
14543
|
+
const tipColor = componentColorTokens.tooltip.default;
|
|
14544
|
+
const bg = resolveColorTokenValue12(tipColor.background);
|
|
14545
|
+
const fg = resolveColorTokenValue12(tipColor.foreground);
|
|
14546
|
+
const borderCol = resolveColorTokenValue12(tipColor.border);
|
|
14372
14547
|
const clearTimer = () => {
|
|
14373
14548
|
if (showTimer.current != null) {
|
|
14374
14549
|
clearTimeout(showTimer.current);
|
|
@@ -14383,9 +14558,9 @@ function Tooltip({
|
|
|
14383
14558
|
clearTimer();
|
|
14384
14559
|
setOpen(false);
|
|
14385
14560
|
};
|
|
14386
|
-
const
|
|
14387
|
-
const
|
|
14388
|
-
const
|
|
14561
|
+
const floatingStyle = tooltipFloatingStyle(position, align);
|
|
14562
|
+
const beakWrapStyle = tooltipBeakWrapperStyle(position, align);
|
|
14563
|
+
const beakRot = tooltipBeakRotateDeg(position);
|
|
14389
14564
|
const describedBy = open ? tooltipId : void 0;
|
|
14390
14565
|
const mergeEl = getMergeableTriggerChild4(trigger);
|
|
14391
14566
|
let triggerNode;
|
|
@@ -14435,26 +14610,59 @@ function Tooltip({
|
|
|
14435
14610
|
}
|
|
14436
14611
|
return /* @__PURE__ */ jsxs31("div", { "data-refineui": "tooltip", className: clsx105(tooltipStyles.root, className), ...props, children: [
|
|
14437
14612
|
triggerNode,
|
|
14438
|
-
open && /* @__PURE__ */ jsxs31(
|
|
14439
|
-
|
|
14440
|
-
|
|
14441
|
-
|
|
14442
|
-
|
|
14443
|
-
|
|
14444
|
-
|
|
14445
|
-
|
|
14446
|
-
|
|
14447
|
-
|
|
14448
|
-
|
|
14449
|
-
|
|
14450
|
-
|
|
14451
|
-
|
|
14452
|
-
|
|
14453
|
-
|
|
14454
|
-
|
|
14455
|
-
|
|
14456
|
-
|
|
14457
|
-
|
|
14613
|
+
open && /* @__PURE__ */ jsx76("div", { className: tooltipStyles.floating, style: floatingStyle, children: /* @__PURE__ */ jsxs31("div", { className: tooltipStyles.panelWrap, children: [
|
|
14614
|
+
/* @__PURE__ */ jsx76(
|
|
14615
|
+
"div",
|
|
14616
|
+
{
|
|
14617
|
+
className: tooltipStyles.beakWrap,
|
|
14618
|
+
style: { ...beakWrapStyle, width: TOOLTIP_BEAK_W, height: TOOLTIP_BEAK_H },
|
|
14619
|
+
"aria-hidden": true,
|
|
14620
|
+
children: /* @__PURE__ */ jsx76(
|
|
14621
|
+
"div",
|
|
14622
|
+
{
|
|
14623
|
+
style: {
|
|
14624
|
+
width: TOOLTIP_BEAK_W,
|
|
14625
|
+
height: TOOLTIP_BEAK_H,
|
|
14626
|
+
transform: `rotate(${beakRot}deg)`,
|
|
14627
|
+
transformOrigin: "center center"
|
|
14628
|
+
},
|
|
14629
|
+
children: /* @__PURE__ */ jsxs31(
|
|
14630
|
+
"svg",
|
|
14631
|
+
{
|
|
14632
|
+
width: TOOLTIP_BEAK_W,
|
|
14633
|
+
height: TOOLTIP_BEAK_H,
|
|
14634
|
+
viewBox: "0 0 16 8",
|
|
14635
|
+
fill: "none",
|
|
14636
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14637
|
+
style: { display: "block" },
|
|
14638
|
+
children: [
|
|
14639
|
+
/* @__PURE__ */ jsx76("polygon", { points: "8,0 0,8 16,8", fill: borderCol }),
|
|
14640
|
+
/* @__PURE__ */ jsx76("polygon", { points: "8,2 2,8 14,8", fill: bg })
|
|
14641
|
+
]
|
|
14642
|
+
}
|
|
14643
|
+
)
|
|
14644
|
+
}
|
|
14645
|
+
)
|
|
14646
|
+
}
|
|
14647
|
+
),
|
|
14648
|
+
/* @__PURE__ */ jsx76(
|
|
14649
|
+
"div",
|
|
14650
|
+
{
|
|
14651
|
+
id: tooltipId,
|
|
14652
|
+
role: "tooltip",
|
|
14653
|
+
"data-refineui": "tooltip-panel",
|
|
14654
|
+
"data-position": position,
|
|
14655
|
+
"data-align": align,
|
|
14656
|
+
className: tooltipStyles.panel,
|
|
14657
|
+
style: {
|
|
14658
|
+
backgroundColor: bg,
|
|
14659
|
+
color: fg,
|
|
14660
|
+
borderColor: borderCol
|
|
14661
|
+
},
|
|
14662
|
+
children: content
|
|
14663
|
+
}
|
|
14664
|
+
)
|
|
14665
|
+
] }) })
|
|
14458
14666
|
] });
|
|
14459
14667
|
}
|
|
14460
14668
|
|
|
@@ -14471,7 +14679,7 @@ import {
|
|
|
14471
14679
|
useState as useState31
|
|
14472
14680
|
} from "react";
|
|
14473
14681
|
import { opacities } from "@refineui/tokens";
|
|
14474
|
-
import { resolveColorTokenValue as
|
|
14682
|
+
import { resolveColorTokenValue as resolveColorTokenValue13 } from "@refineui/utilities/color";
|
|
14475
14683
|
|
|
14476
14684
|
// src/components/Chart/style.ts
|
|
14477
14685
|
import { clsx as clsx106 } from "clsx";
|
|
@@ -14515,12 +14723,12 @@ var chartStyles = {
|
|
|
14515
14723
|
};
|
|
14516
14724
|
|
|
14517
14725
|
// src/components/Chart/utils.ts
|
|
14518
|
-
import { borderRadii, foundationSizes as foundationSizes3, spacings as
|
|
14726
|
+
import { borderRadii, foundationSizes as foundationSizes3, spacings as spacings7 } from "@refineui/tokens";
|
|
14519
14727
|
var CHART_VIEWBOX_WIDTH = 800;
|
|
14520
14728
|
var CHART_VIEWBOX_HEIGHT = 320;
|
|
14521
|
-
var CHART_PLOT_PADDING_TOP = parseFloat(
|
|
14522
|
-
var CHART_PLOT_PADDING_BOTTOM = parseFloat(
|
|
14523
|
-
var CHART_PLOT_PADDING_X = parseFloat(
|
|
14729
|
+
var CHART_PLOT_PADDING_TOP = parseFloat(spacings7.sizeMedium);
|
|
14730
|
+
var CHART_PLOT_PADDING_BOTTOM = parseFloat(spacings7.sizeXXSmall);
|
|
14731
|
+
var CHART_PLOT_PADDING_X = parseFloat(spacings7.sizeMedium);
|
|
14524
14732
|
var CHART_BAR_RADIUS = parseFloat(borderRadii.roundedMedium);
|
|
14525
14733
|
var CHART_BAR_BAND_FILL = 0.5;
|
|
14526
14734
|
var CHART_POINT_RADIUS = parseFloat(foundationSizes3.foundationSize40);
|
|
@@ -14704,19 +14912,19 @@ function useChartContext(component) {
|
|
|
14704
14912
|
return value;
|
|
14705
14913
|
}
|
|
14706
14914
|
function seriesColorToken(color) {
|
|
14707
|
-
return
|
|
14915
|
+
return resolveColorTokenValue13(componentColorTokens.chart.series[color]);
|
|
14708
14916
|
}
|
|
14709
14917
|
function seriesSubtleToken(color) {
|
|
14710
|
-
return
|
|
14918
|
+
return resolveColorTokenValue13(componentColorTokens.chart.seriesSubtle[color]);
|
|
14711
14919
|
}
|
|
14712
14920
|
function gridStroke() {
|
|
14713
|
-
return
|
|
14921
|
+
return resolveColorTokenValue13(componentColorTokens.chart.grid);
|
|
14714
14922
|
}
|
|
14715
14923
|
function gridBaselineStroke() {
|
|
14716
|
-
return
|
|
14924
|
+
return resolveColorTokenValue13(componentColorTokens.chart.gridBaseline);
|
|
14717
14925
|
}
|
|
14718
14926
|
function pointStrokeColor() {
|
|
14719
|
-
return
|
|
14927
|
+
return resolveColorTokenValue13(componentColorTokens.chart.pointStroke);
|
|
14720
14928
|
}
|
|
14721
14929
|
function resolveScale(values, max, fallbackMax = 100) {
|
|
14722
14930
|
if (max !== void 0 && max > 0) return max;
|
|
@@ -15427,8 +15635,9 @@ export {
|
|
|
15427
15635
|
breadcrumbLinkClassName,
|
|
15428
15636
|
componentColorTokens,
|
|
15429
15637
|
componentSizeFoundationKeys,
|
|
15430
|
-
componentSizes,
|
|
15638
|
+
componentSizes2 as componentSizes,
|
|
15431
15639
|
componentTextClass,
|
|
15640
|
+
componentTokens,
|
|
15432
15641
|
componentTypographyTokens,
|
|
15433
15642
|
defaultCommandFilter,
|
|
15434
15643
|
dismissToast,
|