@refineui/react 0.0.3 → 0.0.5
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 +1107 -361
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3779 -245
- package/dist/index.d.ts +3779 -245
- package/dist/index.js +995 -250
- 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.cjs
CHANGED
|
@@ -88,6 +88,10 @@ __export(index_exports, {
|
|
|
88
88
|
ChartYAxisLabels: () => ChartYAxisLabels,
|
|
89
89
|
Checkbox: () => Checkbox,
|
|
90
90
|
Chip: () => Chip,
|
|
91
|
+
Collapsible: () => Collapsible,
|
|
92
|
+
CollapsibleContent: () => CollapsibleContent,
|
|
93
|
+
CollapsibleRoot: () => CollapsibleRoot,
|
|
94
|
+
CollapsibleTrigger: () => CollapsibleTrigger,
|
|
91
95
|
Command: () => Command,
|
|
92
96
|
CommandDialog: () => CommandDialog,
|
|
93
97
|
CommandEmpty: () => CommandEmpty,
|
|
@@ -99,6 +103,17 @@ __export(index_exports, {
|
|
|
99
103
|
CommandSeparator: () => CommandSeparator,
|
|
100
104
|
CommandShortcut: () => CommandShortcut,
|
|
101
105
|
Container: () => Container,
|
|
106
|
+
ContextMenu: () => ContextMenu,
|
|
107
|
+
ContextMenuContent: () => ContextMenuContent,
|
|
108
|
+
ContextMenuItem: () => ContextMenuItem,
|
|
109
|
+
ContextMenuPortal: () => ContextMenuPortal,
|
|
110
|
+
ContextMenuRoot: () => ContextMenuRoot,
|
|
111
|
+
ContextMenuSection: () => ContextMenuSection,
|
|
112
|
+
ContextMenuSeparator: () => ContextMenuSeparator,
|
|
113
|
+
ContextMenuSub: () => ContextMenuSub,
|
|
114
|
+
ContextMenuSubContent: () => ContextMenuSubContent,
|
|
115
|
+
ContextMenuSubTrigger: () => ContextMenuSubTrigger,
|
|
116
|
+
ContextMenuTrigger: () => ContextMenuTrigger,
|
|
102
117
|
Dialog: () => Dialog,
|
|
103
118
|
DialogClose: () => DialogClose,
|
|
104
119
|
DialogContent: () => DialogContent,
|
|
@@ -197,7 +212,7 @@ __export(index_exports, {
|
|
|
197
212
|
ResizableHandle: () => ResizableHandle,
|
|
198
213
|
ResizablePanel: () => ResizablePanel,
|
|
199
214
|
ResizablePanelGroup: () => ResizablePanelGroup,
|
|
200
|
-
SEMANTIC_TEXT: () =>
|
|
215
|
+
SEMANTIC_TEXT: () => import_tokens38.SEMANTIC_TEXT,
|
|
201
216
|
ScrollArea: () => ScrollArea,
|
|
202
217
|
ScrollAreaScrollbar: () => ScrollAreaScrollbar,
|
|
203
218
|
ScrollAreaThumb: () => ScrollAreaThumb,
|
|
@@ -241,6 +256,7 @@ __export(index_exports, {
|
|
|
241
256
|
SidebarPeekPin: () => SidebarPeekPin,
|
|
242
257
|
Skeleton: () => Skeleton,
|
|
243
258
|
Slider: () => Slider,
|
|
259
|
+
Slot: () => import_react57.Slot,
|
|
244
260
|
Spacer: () => Spacer,
|
|
245
261
|
SpinButton: () => SpinButton,
|
|
246
262
|
Spinner: () => Spinner,
|
|
@@ -280,9 +296,10 @@ __export(index_exports, {
|
|
|
280
296
|
WebIcon: () => WebIcon,
|
|
281
297
|
breadcrumbLinkClassName: () => breadcrumbLinkClassName,
|
|
282
298
|
componentColorTokens: () => componentColorTokens,
|
|
283
|
-
componentSizeFoundationKeys: () =>
|
|
284
|
-
componentSizes: () =>
|
|
299
|
+
componentSizeFoundationKeys: () => import_tokens3.componentSizeFoundationKeys,
|
|
300
|
+
componentSizes: () => import_tokens3.componentSizes,
|
|
285
301
|
componentTextClass: () => componentTextClass,
|
|
302
|
+
componentTokens: () => componentTokens,
|
|
286
303
|
componentTypographyTokens: () => componentTypographyTokens,
|
|
287
304
|
defaultCommandFilter: () => defaultCommandFilter,
|
|
288
305
|
dismissToast: () => dismissToast,
|
|
@@ -290,7 +307,7 @@ __export(index_exports, {
|
|
|
290
307
|
footerLocaleLinkClassName: () => footerLocaleLinkClassName,
|
|
291
308
|
footerLocaleTriggerClassName: () => footerLocaleTriggerClassName,
|
|
292
309
|
footerSocialLinkClassName: () => footerSocialLinkClassName,
|
|
293
|
-
foundationSizes: () =>
|
|
310
|
+
foundationSizes: () => import_tokens3.foundationSizes,
|
|
294
311
|
semanticTextClass: () => semanticTextClass,
|
|
295
312
|
sizedComponentTextClass: () => sizedComponentTextClass,
|
|
296
313
|
toast: () => toast,
|
|
@@ -437,13 +454,16 @@ var componentColorTokens = {
|
|
|
437
454
|
},
|
|
438
455
|
tooltip: {
|
|
439
456
|
default: {
|
|
440
|
-
|
|
441
|
-
|
|
457
|
+
/** Menu / Select floating panel semantic */
|
|
458
|
+
background: semanticToken("backgroundPrimary"),
|
|
459
|
+
foreground: semanticToken("foregroundPrimary"),
|
|
460
|
+
border: semanticToken("borderDefault")
|
|
442
461
|
}
|
|
443
462
|
},
|
|
444
463
|
popover: {
|
|
445
464
|
default: {
|
|
446
|
-
|
|
465
|
+
/** Menu / Select floating panel semantic */
|
|
466
|
+
background: semanticToken("backgroundPrimary"),
|
|
447
467
|
foreground: semanticToken("foregroundPrimary"),
|
|
448
468
|
border: semanticToken("borderDefault")
|
|
449
469
|
},
|
|
@@ -622,8 +642,8 @@ var componentColorTokens = {
|
|
|
622
642
|
foreground: semanticToken("foregroundOnSuccess")
|
|
623
643
|
},
|
|
624
644
|
warning: {
|
|
625
|
-
background:
|
|
626
|
-
foreground:
|
|
645
|
+
background: semanticToken("backgroundWarning"),
|
|
646
|
+
foreground: semanticToken("foregroundOnWarning")
|
|
627
647
|
},
|
|
628
648
|
danger: {
|
|
629
649
|
background: semanticToken("backgroundError"),
|
|
@@ -692,7 +712,7 @@ var componentColorTokens = {
|
|
|
692
712
|
pointStroke: semanticToken("backgroundPrimary"),
|
|
693
713
|
cursor: semanticToken("backgroundSurfaceHover"),
|
|
694
714
|
tooltip: {
|
|
695
|
-
background: semanticToken("
|
|
715
|
+
background: semanticToken("backgroundPrimary"),
|
|
696
716
|
foreground: semanticToken("foregroundPrimary"),
|
|
697
717
|
muted: semanticToken("foregroundSecondary"),
|
|
698
718
|
border: semanticToken("borderDefault")
|
|
@@ -745,8 +765,10 @@ var componentColorTokens = {
|
|
|
745
765
|
}
|
|
746
766
|
},
|
|
747
767
|
toast: {
|
|
748
|
-
|
|
768
|
+
/** Menu / Select panel semantic — solid, not frosted */
|
|
769
|
+
background: semanticToken("backgroundPrimary"),
|
|
749
770
|
message: semanticToken("foregroundPrimary"),
|
|
771
|
+
border: semanticToken("borderDefault"),
|
|
750
772
|
accent: {
|
|
751
773
|
default: semanticToken("foregroundPrimary"),
|
|
752
774
|
success: semanticToken("foregroundSuccess"),
|
|
@@ -814,14 +836,15 @@ var componentColorTokens = {
|
|
|
814
836
|
},
|
|
815
837
|
menu: {
|
|
816
838
|
panel: {
|
|
817
|
-
|
|
839
|
+
/** Matches Menu.style panel classes */
|
|
840
|
+
background: semanticToken("backgroundPrimary"),
|
|
818
841
|
border: semanticToken("borderDefault")
|
|
819
842
|
},
|
|
820
843
|
popover: {
|
|
821
844
|
background: "transparent"
|
|
822
845
|
},
|
|
823
846
|
list: {
|
|
824
|
-
background: semanticToken("
|
|
847
|
+
background: semanticToken("backgroundPrimary"),
|
|
825
848
|
border: semanticToken("borderDefault")
|
|
826
849
|
},
|
|
827
850
|
section: semanticToken("foregroundPrimary"),
|
|
@@ -925,8 +948,8 @@ var componentColorTokens = {
|
|
|
925
948
|
},
|
|
926
949
|
divider: {
|
|
927
950
|
line: semanticToken("borderDefault"),
|
|
928
|
-
label:
|
|
929
|
-
icon:
|
|
951
|
+
label: semanticToken("foregroundPrimary"),
|
|
952
|
+
icon: semanticToken("foregroundPrimary")
|
|
930
953
|
},
|
|
931
954
|
avatar: {
|
|
932
955
|
image: {
|
|
@@ -1210,11 +1233,134 @@ var componentTypographyTokens = {
|
|
|
1210
1233
|
}
|
|
1211
1234
|
};
|
|
1212
1235
|
|
|
1213
|
-
// src/
|
|
1236
|
+
// src/tokens/componentTokens.ts
|
|
1214
1237
|
var import_tokens = require("@refineui/tokens");
|
|
1238
|
+
var motion = {
|
|
1239
|
+
fast: {
|
|
1240
|
+
duration: import_tokens.semanticInteraction.duration.fast,
|
|
1241
|
+
easing: import_tokens.semanticInteraction.easing.easeOut
|
|
1242
|
+
},
|
|
1243
|
+
indicator: {
|
|
1244
|
+
duration: import_tokens.semanticInteraction.duration.medium,
|
|
1245
|
+
easing: import_tokens.semanticInteraction.easing.emphasized
|
|
1246
|
+
},
|
|
1247
|
+
panel: {
|
|
1248
|
+
duration: import_tokens.semanticInteraction.duration.panel,
|
|
1249
|
+
easing: import_tokens.semanticInteraction.easing.panel
|
|
1250
|
+
}
|
|
1251
|
+
};
|
|
1252
|
+
var componentTokens = {
|
|
1253
|
+
color: componentColorTokens,
|
|
1254
|
+
typography: componentTypographyTokens,
|
|
1255
|
+
motion,
|
|
1256
|
+
elevation: import_tokens.semanticElevations,
|
|
1257
|
+
toast: {
|
|
1258
|
+
color: componentColorTokens.toast,
|
|
1259
|
+
typography: componentTypographyTokens.toast,
|
|
1260
|
+
size: {
|
|
1261
|
+
minWidth: import_tokens.componentSizes.toastMinWidth,
|
|
1262
|
+
maxWidth: import_tokens.componentSizes.toastMaxWidth
|
|
1263
|
+
},
|
|
1264
|
+
elevation: {
|
|
1265
|
+
role: "toast",
|
|
1266
|
+
foundation: import_tokens.semanticElevations.toast
|
|
1267
|
+
},
|
|
1268
|
+
motion: {
|
|
1269
|
+
enter: import_tokens.semanticInteraction.duration.toastEnter,
|
|
1270
|
+
leave: import_tokens.semanticInteraction.duration.toastLeave,
|
|
1271
|
+
easing: import_tokens.semanticInteraction.easing.emphasized
|
|
1272
|
+
}
|
|
1273
|
+
},
|
|
1274
|
+
segmentedControl: {
|
|
1275
|
+
color: componentColorTokens.segmentedControl,
|
|
1276
|
+
typography: componentTypographyTokens.segmentedControl,
|
|
1277
|
+
elevation: {
|
|
1278
|
+
/** Selected thumb — recipe `shadow-refineui-2` / surface */
|
|
1279
|
+
role: "surface",
|
|
1280
|
+
foundation: import_tokens.semanticElevations.surface
|
|
1281
|
+
},
|
|
1282
|
+
motion: {
|
|
1283
|
+
/** Indicator slide after first layout */
|
|
1284
|
+
indicator: motion.indicator,
|
|
1285
|
+
/** Item label color fade */
|
|
1286
|
+
itemColor: motion.fast
|
|
1287
|
+
}
|
|
1288
|
+
},
|
|
1289
|
+
button: {
|
|
1290
|
+
color: componentColorTokens.button,
|
|
1291
|
+
typography: componentTypographyTokens.button,
|
|
1292
|
+
motion: {
|
|
1293
|
+
pressScale: import_tokens.semanticInteraction.scale.press,
|
|
1294
|
+
color: motion.fast
|
|
1295
|
+
}
|
|
1296
|
+
},
|
|
1297
|
+
chip: {
|
|
1298
|
+
color: componentColorTokens.chip,
|
|
1299
|
+
typography: componentTypographyTokens.chip
|
|
1300
|
+
},
|
|
1301
|
+
badge: {
|
|
1302
|
+
color: componentColorTokens.badge
|
|
1303
|
+
},
|
|
1304
|
+
alert: {
|
|
1305
|
+
color: componentColorTokens.alert,
|
|
1306
|
+
typography: componentTypographyTokens.alert
|
|
1307
|
+
},
|
|
1308
|
+
dialog: {
|
|
1309
|
+
color: componentColorTokens.dialog,
|
|
1310
|
+
typography: componentTypographyTokens.dialog,
|
|
1311
|
+
elevation: {
|
|
1312
|
+
role: "modal",
|
|
1313
|
+
foundation: import_tokens.semanticElevations.modal
|
|
1314
|
+
},
|
|
1315
|
+
motion: {
|
|
1316
|
+
enterScale: import_tokens.semanticInteraction.scale.dialogEnter,
|
|
1317
|
+
panel: motion.panel
|
|
1318
|
+
}
|
|
1319
|
+
},
|
|
1320
|
+
drawer: {
|
|
1321
|
+
color: componentColorTokens.drawer,
|
|
1322
|
+
typography: componentTypographyTokens.drawer,
|
|
1323
|
+
motion: {
|
|
1324
|
+
panel: motion.panel
|
|
1325
|
+
}
|
|
1326
|
+
},
|
|
1327
|
+
accordion: {
|
|
1328
|
+
color: componentColorTokens.accordion,
|
|
1329
|
+
typography: componentTypographyTokens.accordion,
|
|
1330
|
+
motion: {
|
|
1331
|
+
panel: import_tokens.semanticInteraction.duration.accordionPanel,
|
|
1332
|
+
content: import_tokens.semanticInteraction.duration.accordionContent
|
|
1333
|
+
}
|
|
1334
|
+
},
|
|
1335
|
+
tabs: {
|
|
1336
|
+
// underline indicator shares the same mount/slide motion contract
|
|
1337
|
+
motion: {
|
|
1338
|
+
indicator: motion.indicator
|
|
1339
|
+
}
|
|
1340
|
+
},
|
|
1341
|
+
input: {
|
|
1342
|
+
color: componentColorTokens.input,
|
|
1343
|
+
typography: componentTypographyTokens.formControl
|
|
1344
|
+
},
|
|
1345
|
+
checkbox: {
|
|
1346
|
+
color: componentColorTokens.checkbox
|
|
1347
|
+
},
|
|
1348
|
+
radio: {
|
|
1349
|
+
color: componentColorTokens.radio
|
|
1350
|
+
},
|
|
1351
|
+
switch: {
|
|
1352
|
+
color: componentColorTokens.switch
|
|
1353
|
+
},
|
|
1354
|
+
toggle: {
|
|
1355
|
+
color: componentColorTokens.toggle
|
|
1356
|
+
}
|
|
1357
|
+
};
|
|
1358
|
+
|
|
1359
|
+
// src/typography.ts
|
|
1360
|
+
var import_tokens2 = require("@refineui/tokens");
|
|
1215
1361
|
var import_utilities2 = require("@refineui/utilities");
|
|
1216
1362
|
function semanticTextClass(name) {
|
|
1217
|
-
return (0, import_utilities2.foundationTypographyUtilityClass)(
|
|
1363
|
+
return (0, import_utilities2.foundationTypographyUtilityClass)(import_tokens2.SEMANTIC_TEXT[name]);
|
|
1218
1364
|
}
|
|
1219
1365
|
function componentTextClass(ref) {
|
|
1220
1366
|
if (!(0, import_utilities2.isSemanticTextTokenRef)(ref)) {
|
|
@@ -1235,19 +1381,19 @@ function buildSemanticTextClassMap(map) {
|
|
|
1235
1381
|
}
|
|
1236
1382
|
|
|
1237
1383
|
// src/index.ts
|
|
1238
|
-
var
|
|
1384
|
+
var import_tokens38 = require("@refineui/tokens");
|
|
1239
1385
|
|
|
1240
1386
|
// src/componentSizes.ts
|
|
1241
|
-
var
|
|
1387
|
+
var import_tokens3 = require("@refineui/tokens");
|
|
1242
1388
|
|
|
1243
1389
|
// src/WebIcon.tsx
|
|
1244
1390
|
var import_clsx = require("clsx");
|
|
1245
|
-
var
|
|
1391
|
+
var import_tokens4 = require("@refineui/tokens");
|
|
1246
1392
|
var import_web_icons = require("@refineui/web-icons");
|
|
1247
1393
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
1248
1394
|
function WebIcon({
|
|
1249
1395
|
name,
|
|
1250
|
-
size =
|
|
1396
|
+
size = import_tokens4.iconSizes.medium,
|
|
1251
1397
|
color,
|
|
1252
1398
|
iconStyle = "regular",
|
|
1253
1399
|
className,
|
|
@@ -1850,9 +1996,9 @@ var import_clsx6 = require("clsx");
|
|
|
1850
1996
|
var import_react4 = require("react");
|
|
1851
1997
|
|
|
1852
1998
|
// src/components/SearchField/style.ts
|
|
1853
|
-
var
|
|
1854
|
-
var searchFieldLeadingIconSize =
|
|
1855
|
-
var searchFieldClearIconSize =
|
|
1999
|
+
var import_tokens5 = require("@refineui/tokens");
|
|
2000
|
+
var searchFieldLeadingIconSize = import_tokens5.iconSizes.medium;
|
|
2001
|
+
var searchFieldClearIconSize = import_tokens5.iconSizes.small;
|
|
1856
2002
|
var searchFieldStyles = {
|
|
1857
2003
|
root: [
|
|
1858
2004
|
"box-border flex w-full min-w-0 items-center gap-refineui-size-x-small overflow-hidden outline-none",
|
|
@@ -2321,7 +2467,7 @@ function CardFooter({ className, ...props }) {
|
|
|
2321
2467
|
// src/components/Checkbox/Checkbox.tsx
|
|
2322
2468
|
var import_clsx21 = require("clsx");
|
|
2323
2469
|
var import_react5 = require("react");
|
|
2324
|
-
var
|
|
2470
|
+
var import_tokens6 = require("@refineui/tokens");
|
|
2325
2471
|
var import_color2 = require("@refineui/utilities/color");
|
|
2326
2472
|
|
|
2327
2473
|
// src/components/Label/style.ts
|
|
@@ -2437,7 +2583,7 @@ function Checkbox({
|
|
|
2437
2583
|
WebIcon,
|
|
2438
2584
|
{
|
|
2439
2585
|
name: "checkmark",
|
|
2440
|
-
size:
|
|
2586
|
+
size: import_tokens6.iconSizes.small,
|
|
2441
2587
|
color: checkColor,
|
|
2442
2588
|
iconStyle: "filled"
|
|
2443
2589
|
}
|
|
@@ -2598,7 +2744,7 @@ function Radio({
|
|
|
2598
2744
|
var import_clsx28 = require("clsx");
|
|
2599
2745
|
var import_react11 = require("react");
|
|
2600
2746
|
var import_react_dom = require("react-dom");
|
|
2601
|
-
var
|
|
2747
|
+
var import_tokens8 = require("@refineui/tokens");
|
|
2602
2748
|
var import_react12 = require("@refineui/utilities/react");
|
|
2603
2749
|
|
|
2604
2750
|
// src/components/ScrollArea/ScrollAreaRegion.tsx
|
|
@@ -2612,8 +2758,8 @@ var import_react9 = require("@refineui/utilities/react");
|
|
|
2612
2758
|
|
|
2613
2759
|
// src/components/ScrollArea/style.ts
|
|
2614
2760
|
var import_clsx24 = require("clsx");
|
|
2615
|
-
var
|
|
2616
|
-
var SCROLL_AREA_THUMB_MIN_PX = Number.parseFloat(
|
|
2761
|
+
var import_tokens7 = require("@refineui/tokens");
|
|
2762
|
+
var SCROLL_AREA_THUMB_MIN_PX = Number.parseFloat(import_tokens7.spacings.sizeXLarge);
|
|
2617
2763
|
var scrollAreaStyles = {
|
|
2618
2764
|
root: "box-border min-h-0 min-w-0 overflow-hidden outline-none",
|
|
2619
2765
|
/**
|
|
@@ -3110,8 +3256,8 @@ function parsePx(px, fallback) {
|
|
|
3110
3256
|
const n = Number.parseFloat(px);
|
|
3111
3257
|
return Number.isFinite(n) ? n : fallback;
|
|
3112
3258
|
}
|
|
3113
|
-
var SIDE_OFFSET = parsePx(
|
|
3114
|
-
var CONTENT_MARGIN = parsePx(
|
|
3259
|
+
var SIDE_OFFSET = parsePx(import_tokens3.foundationSizes.foundationSize40, 4);
|
|
3260
|
+
var CONTENT_MARGIN = parsePx(import_tokens3.foundationSizes.foundationSize100, 10);
|
|
3115
3261
|
function clampNumber(value, [minB, maxB]) {
|
|
3116
3262
|
return Math.min(Math.max(value, minB), maxB);
|
|
3117
3263
|
}
|
|
@@ -3384,7 +3530,7 @@ var SelectTrigger = (0, import_react11.forwardRef)(function SelectTrigger2(props
|
|
|
3384
3530
|
WebIcon,
|
|
3385
3531
|
{
|
|
3386
3532
|
name: "chevron-down",
|
|
3387
|
-
size:
|
|
3533
|
+
size: import_tokens8.iconSizes.xsmall,
|
|
3388
3534
|
color: "currentColor",
|
|
3389
3535
|
className: (0, import_clsx28.clsx)(selectStyles.chevron, open && selectStyles.chevronOpen),
|
|
3390
3536
|
"aria-hidden": true
|
|
@@ -3401,7 +3547,7 @@ function SelectValue({ placeholder, className, ...props }) {
|
|
|
3401
3547
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { "data-refineui-select-value": "", className: (0, import_clsx28.clsx)(selectStyles.value, !label && "text-refineui-alias-foreground-placeholder", className), ...props, children: label || placeholder || rootPlaceholder || "Select..." });
|
|
3402
3548
|
}
|
|
3403
3549
|
function SelectIcon({ children, className, ...props }) {
|
|
3404
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: (0, import_clsx28.clsx)(selectStyles.iconWrap, className), ...props, children: children ?? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(WebIcon, { name: "chevron-down", size:
|
|
3550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: (0, import_clsx28.clsx)(selectStyles.iconWrap, className), ...props, children: children ?? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(WebIcon, { name: "chevron-down", size: import_tokens8.iconSizes.xsmall }) });
|
|
3405
3551
|
}
|
|
3406
3552
|
function SelectPortal({ children, container }) {
|
|
3407
3553
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PortalContainerContext.Provider, { value: container ?? void 0, children });
|
|
@@ -3525,7 +3671,7 @@ var SelectContent = (0, import_react11.forwardRef)(function SelectContent2(props
|
|
|
3525
3671
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
3526
3672
|
const vw = window.innerWidth;
|
|
3527
3673
|
const vh = window.innerHeight;
|
|
3528
|
-
const minW = parsePx(
|
|
3674
|
+
const minW = parsePx(import_tokens3.componentSizes.dropdownMenuWidth, 180);
|
|
3529
3675
|
const width = Math.min(Math.max(triggerRect.width, minW), vw - 2 * CONTENT_MARGIN);
|
|
3530
3676
|
const left = clampNumber(triggerRect.left, [CONTENT_MARGIN, Math.max(CONTENT_MARGIN, vw - width - CONTENT_MARGIN)]);
|
|
3531
3677
|
const gap2 = SIDE_OFFSET;
|
|
@@ -3843,7 +3989,7 @@ function SelectItem({
|
|
|
3843
3989
|
{
|
|
3844
3990
|
className: (0, import_clsx28.clsx)(selectStyles.itemIndicator, disabled && "text-refineui-alias-foreground-disabled"),
|
|
3845
3991
|
"aria-hidden": true,
|
|
3846
|
-
children: isSelected ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(WebIcon, { name: "checkmark", size:
|
|
3992
|
+
children: isSelected ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(WebIcon, { name: "checkmark", size: import_tokens8.iconSizes.xsmall }) : null
|
|
3847
3993
|
}
|
|
3848
3994
|
),
|
|
3849
3995
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { "data-refineui-select-item-text": true, className: selectStyles.itemText, children })
|
|
@@ -3925,7 +4071,7 @@ function Toggle({
|
|
|
3925
4071
|
var import_clsx30 = require("clsx");
|
|
3926
4072
|
|
|
3927
4073
|
// src/recipes/chip.recipe.ts
|
|
3928
|
-
var
|
|
4074
|
+
var import_tokens9 = require("@refineui/tokens");
|
|
3929
4075
|
var chipVariantClass = {
|
|
3930
4076
|
default: "border-none bg-refineui-alias-background-surface text-refineui-alias-foreground-brand",
|
|
3931
4077
|
outline: "border-refineui-thin border-refineui-alias-border-default box-border bg-transparent text-refineui-alias-foreground-brand",
|
|
@@ -3943,9 +4089,9 @@ var chipSizeClass = {
|
|
|
3943
4089
|
};
|
|
3944
4090
|
var chipSizeTypo = buildSemanticTextClassMap(componentTypographyTokens.chip);
|
|
3945
4091
|
var chipSizeIcon = {
|
|
3946
|
-
sm:
|
|
3947
|
-
md:
|
|
3948
|
-
lg:
|
|
4092
|
+
sm: import_tokens9.iconSizes.xxsmall,
|
|
4093
|
+
md: import_tokens9.iconSizes.xsmall,
|
|
4094
|
+
lg: import_tokens9.iconSizes.small
|
|
3949
4095
|
};
|
|
3950
4096
|
var chipRecipe = defineRecipe({
|
|
3951
4097
|
name: "chip",
|
|
@@ -4026,13 +4172,13 @@ function Chip({
|
|
|
4026
4172
|
// src/components/Command/Command.tsx
|
|
4027
4173
|
var import_clsx34 = require("clsx");
|
|
4028
4174
|
var import_react15 = require("react");
|
|
4029
|
-
var
|
|
4175
|
+
var import_tokens12 = require("@refineui/tokens");
|
|
4030
4176
|
|
|
4031
4177
|
// src/components/Dialog/Dialog.tsx
|
|
4032
4178
|
var import_clsx32 = require("clsx");
|
|
4033
4179
|
var import_react14 = require("react");
|
|
4034
4180
|
var import_react_dom2 = require("react-dom");
|
|
4035
|
-
var
|
|
4181
|
+
var import_tokens10 = require("@refineui/tokens");
|
|
4036
4182
|
var import_animation = require("@refineui/utilities/animation");
|
|
4037
4183
|
var import_color3 = require("@refineui/utilities/color");
|
|
4038
4184
|
|
|
@@ -4130,9 +4276,9 @@ var dialogStyles = {
|
|
|
4130
4276
|
|
|
4131
4277
|
// src/components/Dialog/Dialog.tsx
|
|
4132
4278
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4133
|
-
var PANEL_MS = (0, import_animation.motionMsToNumber)(
|
|
4134
|
-
var SCRIM_MS = (0, import_animation.motionMsToNumber)(
|
|
4135
|
-
var EASING =
|
|
4279
|
+
var PANEL_MS = (0, import_animation.motionMsToNumber)(import_tokens10.semanticInteraction.duration.panel);
|
|
4280
|
+
var SCRIM_MS = (0, import_animation.motionMsToNumber)(import_tokens10.semanticInteraction.duration.overlay);
|
|
4281
|
+
var EASING = import_tokens10.semanticInteraction.easing.panel;
|
|
4136
4282
|
var DialogContext = (0, import_react14.createContext)(null);
|
|
4137
4283
|
function useDialogContext(component) {
|
|
4138
4284
|
const ctx = (0, import_react14.useContext)(DialogContext);
|
|
@@ -4225,7 +4371,7 @@ function DialogContent({ className, style, container, scrollable = true, childre
|
|
|
4225
4371
|
transform: entered ? "scale(1) translateY(0)" : "scale(var(--refineui-motion-scale-enter)) translateY(var(--refineui-spacing-size-small))",
|
|
4226
4372
|
transition: `opacity ${PANEL_MS}ms ${EASING}, transform ${PANEL_MS}ms ${EASING}`,
|
|
4227
4373
|
willChange: "opacity, transform",
|
|
4228
|
-
maxWidth: size === "lg" ?
|
|
4374
|
+
maxWidth: size === "lg" ? import_tokens3.componentSizes.dialogMaxWidth : import_tokens3.componentSizes.dialogWidthSm
|
|
4229
4375
|
};
|
|
4230
4376
|
const panelBody = scrollable ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4231
4377
|
ScrollAreaRegion,
|
|
@@ -4343,15 +4489,15 @@ function DialogClose({ className, onClick, type = "button", ...props }) {
|
|
|
4343
4489
|
onClick?.(e);
|
|
4344
4490
|
if (!e.defaultPrevented) setOpen(false);
|
|
4345
4491
|
},
|
|
4346
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(WebIcon, { name: "dismiss", size:
|
|
4492
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(WebIcon, { name: "dismiss", size: import_tokens10.iconSizes.small, color: "currentColor", iconStyle: "regular", "aria-hidden": true })
|
|
4347
4493
|
}
|
|
4348
4494
|
);
|
|
4349
4495
|
}
|
|
4350
4496
|
|
|
4351
4497
|
// src/components/Command/style.ts
|
|
4352
4498
|
var import_clsx33 = require("clsx");
|
|
4353
|
-
var
|
|
4354
|
-
var COMMAND_LIST_MAX_HEIGHT = `min(60vh, ${
|
|
4499
|
+
var import_tokens11 = require("@refineui/tokens");
|
|
4500
|
+
var COMMAND_LIST_MAX_HEIGHT = `min(60vh, ${import_tokens11.foundationSizes.foundationSize3200})`;
|
|
4355
4501
|
var commandStyles = {
|
|
4356
4502
|
root: (0, import_clsx33.clsx)(
|
|
4357
4503
|
"flex w-full flex-col overflow-hidden outline-none",
|
|
@@ -4900,9 +5046,9 @@ var CommandItem = (0, import_react15.forwardRef)(function CommandItem2({
|
|
|
4900
5046
|
{
|
|
4901
5047
|
className: commandStyles.iconWrap,
|
|
4902
5048
|
style: {
|
|
4903
|
-
width:
|
|
4904
|
-
minWidth:
|
|
4905
|
-
height:
|
|
5049
|
+
width: import_tokens12.iconSizes.small,
|
|
5050
|
+
minWidth: import_tokens12.iconSizes.small,
|
|
5051
|
+
height: import_tokens12.iconSizes.small
|
|
4906
5052
|
},
|
|
4907
5053
|
children: startIcon
|
|
4908
5054
|
}
|
|
@@ -4916,9 +5062,9 @@ var CommandItem = (0, import_react15.forwardRef)(function CommandItem2({
|
|
|
4916
5062
|
{
|
|
4917
5063
|
className: commandStyles.iconWrap,
|
|
4918
5064
|
style: {
|
|
4919
|
-
width:
|
|
4920
|
-
minWidth:
|
|
4921
|
-
height:
|
|
5065
|
+
width: import_tokens12.iconSizes.small,
|
|
5066
|
+
minWidth: import_tokens12.iconSizes.small,
|
|
5067
|
+
height: import_tokens12.iconSizes.small
|
|
4922
5068
|
},
|
|
4923
5069
|
children: endIcon
|
|
4924
5070
|
}
|
|
@@ -4938,7 +5084,7 @@ var import_react17 = require("react");
|
|
|
4938
5084
|
var import_color6 = require("@refineui/utilities/color");
|
|
4939
5085
|
|
|
4940
5086
|
// src/components/Avatar/avatarStyles.ts
|
|
4941
|
-
var
|
|
5087
|
+
var import_tokens13 = require("@refineui/tokens");
|
|
4942
5088
|
var import_color4 = require("@refineui/utilities/color");
|
|
4943
5089
|
var avatarSizeAliasMap = {
|
|
4944
5090
|
"3xs": "xxxsmall",
|
|
@@ -5003,15 +5149,15 @@ var avatarTypoNeutral = buildSemanticTextClassMap(
|
|
|
5003
5149
|
componentTypographyTokens.avatar.initialsNeutral
|
|
5004
5150
|
);
|
|
5005
5151
|
var avatarIconSlotSize = {
|
|
5006
|
-
xxxsmall:
|
|
5007
|
-
xxsmall:
|
|
5008
|
-
xsmall:
|
|
5009
|
-
small:
|
|
5010
|
-
medium:
|
|
5011
|
-
large:
|
|
5012
|
-
xlarge:
|
|
5013
|
-
xxlarge:
|
|
5014
|
-
xxxlarge:
|
|
5152
|
+
xxxsmall: import_tokens13.iconSizes.xxsmall,
|
|
5153
|
+
xxsmall: import_tokens13.iconSizes.xsmall,
|
|
5154
|
+
xsmall: import_tokens13.iconSizes.small,
|
|
5155
|
+
small: import_tokens13.iconSizes.small,
|
|
5156
|
+
medium: import_tokens13.iconSizes.medium,
|
|
5157
|
+
large: import_tokens13.iconSizes.medium,
|
|
5158
|
+
xlarge: import_tokens13.iconSizes.large,
|
|
5159
|
+
xxlarge: import_tokens13.iconSizes.xlarge,
|
|
5160
|
+
xxxlarge: import_tokens13.iconSizes.xxlarge
|
|
5015
5161
|
};
|
|
5016
5162
|
var AVATAR_INNER_MASK = "relative flex size-full min-h-0 min-w-0 items-center justify-center overflow-hidden rounded-refineui-circle";
|
|
5017
5163
|
function initialsAccentTypo(size) {
|
|
@@ -5076,15 +5222,15 @@ var defaultPersonIconColor = {
|
|
|
5076
5222
|
yellow: (0, import_color4.resolveColorTokenValue)(componentColorTokens.avatar.icon.yellow)
|
|
5077
5223
|
};
|
|
5078
5224
|
var avatarOverflowIconSize = {
|
|
5079
|
-
xxxsmall:
|
|
5080
|
-
xxsmall:
|
|
5081
|
-
xsmall:
|
|
5082
|
-
small:
|
|
5083
|
-
medium:
|
|
5084
|
-
large:
|
|
5085
|
-
xlarge:
|
|
5086
|
-
xxlarge:
|
|
5087
|
-
xxxlarge:
|
|
5225
|
+
xxxsmall: import_tokens13.iconSizes.xsmall,
|
|
5226
|
+
xxsmall: import_tokens13.iconSizes.xsmall,
|
|
5227
|
+
xsmall: import_tokens13.iconSizes.small,
|
|
5228
|
+
small: import_tokens13.iconSizes.small,
|
|
5229
|
+
medium: import_tokens13.iconSizes.medium,
|
|
5230
|
+
large: import_tokens13.iconSizes.medium,
|
|
5231
|
+
xlarge: import_tokens13.iconSizes.large,
|
|
5232
|
+
xxlarge: import_tokens13.iconSizes.xlarge,
|
|
5233
|
+
xxxlarge: import_tokens13.iconSizes.xxlarge
|
|
5088
5234
|
};
|
|
5089
5235
|
var avatarSpreadGap = {
|
|
5090
5236
|
xxxsmall: "gap-refineui-size-xx-small",
|
|
@@ -5489,7 +5635,7 @@ function Avatars({
|
|
|
5489
5635
|
|
|
5490
5636
|
// src/components/Alert/Alert.tsx
|
|
5491
5637
|
var import_clsx38 = require("clsx");
|
|
5492
|
-
var
|
|
5638
|
+
var import_tokens14 = require("@refineui/tokens");
|
|
5493
5639
|
|
|
5494
5640
|
// src/components/Alert/context.ts
|
|
5495
5641
|
var import_react18 = require("react");
|
|
@@ -5614,7 +5760,7 @@ function AlertIcon({ className, name, children, ...props }) {
|
|
|
5614
5760
|
"data-refineui": "alert-icon",
|
|
5615
5761
|
className: (0, import_clsx38.clsx)(resolveAlertSlotClasses("icon", variant), className),
|
|
5616
5762
|
...props,
|
|
5617
|
-
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(WebIcon, { name: iconName, size:
|
|
5763
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(WebIcon, { name: iconName, size: import_tokens14.iconSizes.medium, color: "currentColor", fallback: "\u25CF", "aria-hidden": true })
|
|
5618
5764
|
}
|
|
5619
5765
|
);
|
|
5620
5766
|
}
|
|
@@ -5691,7 +5837,7 @@ function AlertClose({ className, type = "button", children, ...props }) {
|
|
|
5691
5837
|
WebIcon,
|
|
5692
5838
|
{
|
|
5693
5839
|
name: "dismiss",
|
|
5694
|
-
size:
|
|
5840
|
+
size: import_tokens14.iconSizes.small,
|
|
5695
5841
|
color: "currentColor",
|
|
5696
5842
|
iconStyle: "regular",
|
|
5697
5843
|
fallback: "\xD7",
|
|
@@ -6242,11 +6388,15 @@ function TabsList({ className, children, ...props }) {
|
|
|
6242
6388
|
width: 0,
|
|
6243
6389
|
ready: false
|
|
6244
6390
|
});
|
|
6391
|
+
const [animate, setAnimate] = (0, import_react20.useState)(false);
|
|
6392
|
+
const hasMeasuredRef = (0, import_react20.useRef)(false);
|
|
6245
6393
|
const updateIndicator = (0, import_react20.useCallback)(() => {
|
|
6246
6394
|
const list = tabListRef.current;
|
|
6247
6395
|
if (!list) return;
|
|
6248
6396
|
const selected = list.querySelector(`${TRIGGER_SELECTOR}[data-selected="true"]`);
|
|
6249
6397
|
if (!selected) {
|
|
6398
|
+
hasMeasuredRef.current = false;
|
|
6399
|
+
setAnimate(false);
|
|
6250
6400
|
setIndicator((prev) => ({ ...prev, width: 0, ready: false }));
|
|
6251
6401
|
return;
|
|
6252
6402
|
}
|
|
@@ -6259,6 +6409,18 @@ function TabsList({ className, children, ...props }) {
|
|
|
6259
6409
|
(0, import_react20.useLayoutEffect)(() => {
|
|
6260
6410
|
updateIndicator();
|
|
6261
6411
|
}, [updateIndicator, selectedValue, children]);
|
|
6412
|
+
(0, import_react20.useEffect)(() => {
|
|
6413
|
+
if (!indicator.ready || hasMeasuredRef.current) return;
|
|
6414
|
+
hasMeasuredRef.current = true;
|
|
6415
|
+
let raf2 = 0;
|
|
6416
|
+
const raf1 = requestAnimationFrame(() => {
|
|
6417
|
+
raf2 = requestAnimationFrame(() => setAnimate(true));
|
|
6418
|
+
});
|
|
6419
|
+
return () => {
|
|
6420
|
+
cancelAnimationFrame(raf1);
|
|
6421
|
+
cancelAnimationFrame(raf2);
|
|
6422
|
+
};
|
|
6423
|
+
}, [indicator.ready]);
|
|
6262
6424
|
(0, import_react20.useEffect)(() => {
|
|
6263
6425
|
const list = tabListRef.current;
|
|
6264
6426
|
if (!list) return;
|
|
@@ -6294,6 +6456,7 @@ function TabsList({ className, children, ...props }) {
|
|
|
6294
6456
|
{
|
|
6295
6457
|
"data-refineui": "tabs-indicator",
|
|
6296
6458
|
"data-ready": indicator.ready ? "true" : void 0,
|
|
6459
|
+
"data-animate": animate ? "true" : void 0,
|
|
6297
6460
|
"aria-hidden": true,
|
|
6298
6461
|
className: tabsStyles.indicator,
|
|
6299
6462
|
style: indicatorStyle
|
|
@@ -6501,6 +6664,8 @@ function SegmentedControl({
|
|
|
6501
6664
|
width: 0,
|
|
6502
6665
|
ready: false
|
|
6503
6666
|
});
|
|
6667
|
+
const [animate, setAnimate] = (0, import_react21.useState)(false);
|
|
6668
|
+
const hasMeasuredRef = (0, import_react21.useRef)(false);
|
|
6504
6669
|
const updateIndicator = (0, import_react21.useCallback)(() => {
|
|
6505
6670
|
const group = groupRef.current;
|
|
6506
6671
|
if (!group) return;
|
|
@@ -6508,6 +6673,8 @@ function SegmentedControl({
|
|
|
6508
6673
|
`${ITEM_SELECTOR}[data-selected="true"]`
|
|
6509
6674
|
);
|
|
6510
6675
|
if (!selected) {
|
|
6676
|
+
hasMeasuredRef.current = false;
|
|
6677
|
+
setAnimate(false);
|
|
6511
6678
|
setIndicator((prev) => ({ ...prev, width: 0, ready: false }));
|
|
6512
6679
|
return;
|
|
6513
6680
|
}
|
|
@@ -6520,6 +6687,18 @@ function SegmentedControl({
|
|
|
6520
6687
|
(0, import_react21.useLayoutEffect)(() => {
|
|
6521
6688
|
updateIndicator();
|
|
6522
6689
|
}, [updateIndicator, selectedValue, children]);
|
|
6690
|
+
(0, import_react21.useEffect)(() => {
|
|
6691
|
+
if (!indicator.ready || hasMeasuredRef.current) return;
|
|
6692
|
+
hasMeasuredRef.current = true;
|
|
6693
|
+
let raf2 = 0;
|
|
6694
|
+
const raf1 = requestAnimationFrame(() => {
|
|
6695
|
+
raf2 = requestAnimationFrame(() => setAnimate(true));
|
|
6696
|
+
});
|
|
6697
|
+
return () => {
|
|
6698
|
+
cancelAnimationFrame(raf1);
|
|
6699
|
+
cancelAnimationFrame(raf2);
|
|
6700
|
+
};
|
|
6701
|
+
}, [indicator.ready]);
|
|
6523
6702
|
(0, import_react21.useEffect)(() => {
|
|
6524
6703
|
const group = groupRef.current;
|
|
6525
6704
|
if (!group) return;
|
|
@@ -6555,6 +6734,7 @@ function SegmentedControl({
|
|
|
6555
6734
|
{
|
|
6556
6735
|
"data-refineui": "segmented-control-indicator",
|
|
6557
6736
|
"data-ready": indicator.ready ? "true" : void 0,
|
|
6737
|
+
"data-animate": animate ? "true" : void 0,
|
|
6558
6738
|
"aria-hidden": true,
|
|
6559
6739
|
className: segmentedControlStyles.indicator,
|
|
6560
6740
|
style: indicatorStyle
|
|
@@ -6726,14 +6906,14 @@ var import_clsx51 = require("clsx");
|
|
|
6726
6906
|
|
|
6727
6907
|
// src/components/Accordion/context.ts
|
|
6728
6908
|
var import_react23 = require("react");
|
|
6729
|
-
var
|
|
6909
|
+
var import_tokens15 = require("@refineui/tokens");
|
|
6730
6910
|
var import_animation2 = require("@refineui/utilities/animation");
|
|
6731
6911
|
var AccordionContext = (0, import_react23.createContext)(null);
|
|
6732
6912
|
var AccordionItemContext = (0, import_react23.createContext)(null);
|
|
6733
|
-
var PANEL_HEIGHT_MS = Number.parseFloat(
|
|
6734
|
-
var PANEL_CONTENT_MS = Number.parseFloat(
|
|
6735
|
-
var PANEL_HEIGHT_EASE =
|
|
6736
|
-
var PANEL_CONTENT_EASE =
|
|
6913
|
+
var PANEL_HEIGHT_MS = Number.parseFloat(import_tokens15.semanticInteraction.duration.accordionPanel) / 1e3;
|
|
6914
|
+
var PANEL_CONTENT_MS = Number.parseFloat(import_tokens15.semanticInteraction.duration.accordionContent) / 1e3;
|
|
6915
|
+
var PANEL_HEIGHT_EASE = import_tokens15.semanticInteraction.easing.panel;
|
|
6916
|
+
var PANEL_CONTENT_EASE = import_tokens15.semanticInteraction.easing.content;
|
|
6737
6917
|
function usePrefersReducedMotion() {
|
|
6738
6918
|
const [reduce, setReduce] = (0, import_react23.useState)(false);
|
|
6739
6919
|
(0, import_react23.useEffect)(() => {
|
|
@@ -6752,7 +6932,7 @@ function toSet(value, type) {
|
|
|
6752
6932
|
}
|
|
6753
6933
|
|
|
6754
6934
|
// src/recipes/accordion.recipe.ts
|
|
6755
|
-
var
|
|
6935
|
+
var import_tokens16 = require("@refineui/tokens");
|
|
6756
6936
|
var accordionRecipe = defineSlotRecipe({
|
|
6757
6937
|
name: "accordion",
|
|
6758
6938
|
slots: ["root", "item", "trigger", "triggerRow", "chevron", "panel", "panelPad", "content"],
|
|
@@ -6791,9 +6971,9 @@ var accordionStyles = {
|
|
|
6791
6971
|
panelBody: accordionRecipe.base.content
|
|
6792
6972
|
};
|
|
6793
6973
|
var accordionIconSize = {
|
|
6794
|
-
sm:
|
|
6795
|
-
md:
|
|
6796
|
-
lg:
|
|
6974
|
+
sm: import_tokens16.iconSizes.xsmall,
|
|
6975
|
+
md: import_tokens16.iconSizes.small,
|
|
6976
|
+
lg: import_tokens16.iconSizes.medium
|
|
6797
6977
|
};
|
|
6798
6978
|
var triggerTypo = {
|
|
6799
6979
|
sm: sizedComponentTextClass(componentTypographyTokens.accordion.trigger, "sm"),
|
|
@@ -7027,7 +7207,7 @@ function AccordionContent({ className, children, ...props }) {
|
|
|
7027
7207
|
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
7028
7208
|
var import_clsx55 = require("clsx");
|
|
7029
7209
|
var import_react28 = require("react");
|
|
7030
|
-
var
|
|
7210
|
+
var import_tokens17 = require("@refineui/tokens");
|
|
7031
7211
|
|
|
7032
7212
|
// src/components/Breadcrumb/style.ts
|
|
7033
7213
|
var breadcrumbStyles = {
|
|
@@ -7127,7 +7307,7 @@ function BreadcrumbEllipsis({ className, ...props }) {
|
|
|
7127
7307
|
WebIcon,
|
|
7128
7308
|
{
|
|
7129
7309
|
name: "more-horizontal",
|
|
7130
|
-
size:
|
|
7310
|
+
size: import_tokens17.iconSizes.small,
|
|
7131
7311
|
color: "currentColor",
|
|
7132
7312
|
fallback: "\u22EF",
|
|
7133
7313
|
className: "items-center justify-center"
|
|
@@ -7153,7 +7333,7 @@ var BreadcrumbEllipsisTrigger = (0, import_react28.forwardRef)(
|
|
|
7153
7333
|
WebIcon,
|
|
7154
7334
|
{
|
|
7155
7335
|
name: "more-horizontal",
|
|
7156
|
-
size:
|
|
7336
|
+
size: import_tokens17.iconSizes.small,
|
|
7157
7337
|
color: "currentColor",
|
|
7158
7338
|
fallback: "\u22EF",
|
|
7159
7339
|
className: "items-center justify-center"
|
|
@@ -7413,7 +7593,7 @@ function FooterSocial({ className, ...props }) {
|
|
|
7413
7593
|
// src/components/Calendar/Calendar.tsx
|
|
7414
7594
|
var import_clsx59 = require("clsx");
|
|
7415
7595
|
var import_react30 = require("react");
|
|
7416
|
-
var
|
|
7596
|
+
var import_tokens18 = require("@refineui/tokens");
|
|
7417
7597
|
|
|
7418
7598
|
// src/components/Calendar/style.ts
|
|
7419
7599
|
var import_clsx58 = require("clsx");
|
|
@@ -7742,7 +7922,7 @@ function Calendar({
|
|
|
7742
7922
|
"aria-label": "Previous month",
|
|
7743
7923
|
className: calendarStyles.navButton,
|
|
7744
7924
|
onClick: () => setView(new Date(year, month - 1)),
|
|
7745
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(WebIcon, { name: "chevron-left", size:
|
|
7925
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(WebIcon, { name: "chevron-left", size: import_tokens18.iconSizes.small, color: "currentColor", fallback: "\u2039" })
|
|
7746
7926
|
}
|
|
7747
7927
|
),
|
|
7748
7928
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
@@ -7782,7 +7962,7 @@ function Calendar({
|
|
|
7782
7962
|
"aria-label": "Next month",
|
|
7783
7963
|
className: calendarStyles.navButton,
|
|
7784
7964
|
onClick: () => setView(new Date(year, month + 1)),
|
|
7785
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(WebIcon, { name: "chevron-right", size:
|
|
7965
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(WebIcon, { name: "chevron-right", size: import_tokens18.iconSizes.small, color: "currentColor", fallback: "\u203A" })
|
|
7786
7966
|
}
|
|
7787
7967
|
)
|
|
7788
7968
|
] }),
|
|
@@ -7842,8 +8022,8 @@ function DividerCircleGlyph() {
|
|
|
7842
8022
|
"aria-hidden": true,
|
|
7843
8023
|
className: dividerStyles.iconCircle,
|
|
7844
8024
|
style: {
|
|
7845
|
-
width:
|
|
7846
|
-
height:
|
|
8025
|
+
width: import_tokens3.componentSizes.dividerIconCircleDiameter,
|
|
8026
|
+
height: import_tokens3.componentSizes.dividerIconCircleDiameter
|
|
7847
8027
|
}
|
|
7848
8028
|
}
|
|
7849
8029
|
);
|
|
@@ -8216,7 +8396,7 @@ function Spacer({ className, ...props }) {
|
|
|
8216
8396
|
var import_clsx68 = require("clsx");
|
|
8217
8397
|
var import_react31 = require("react");
|
|
8218
8398
|
var import_react_dom3 = require("react-dom");
|
|
8219
|
-
var
|
|
8399
|
+
var import_tokens19 = require("@refineui/tokens");
|
|
8220
8400
|
var import_animation3 = require("@refineui/utilities/animation");
|
|
8221
8401
|
var import_color7 = require("@refineui/utilities/color");
|
|
8222
8402
|
var import_react32 = require("@refineui/utilities/react");
|
|
@@ -8257,9 +8437,9 @@ var drawerStyles = {
|
|
|
8257
8437
|
|
|
8258
8438
|
// src/components/Drawer/Drawer.tsx
|
|
8259
8439
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
8260
|
-
var PANEL_MS2 = (0, import_animation3.motionMsToNumber)(
|
|
8261
|
-
var SCRIM_MS2 = (0, import_animation3.motionMsToNumber)(
|
|
8262
|
-
var EASING2 =
|
|
8440
|
+
var PANEL_MS2 = (0, import_animation3.motionMsToNumber)(import_tokens19.semanticInteraction.duration.panel);
|
|
8441
|
+
var SCRIM_MS2 = (0, import_animation3.motionMsToNumber)(import_tokens19.semanticInteraction.duration.overlay);
|
|
8442
|
+
var EASING2 = import_tokens19.semanticInteraction.easing.panel;
|
|
8263
8443
|
var DrawerContext = (0, import_react31.createContext)(null);
|
|
8264
8444
|
function useDrawerContext(component) {
|
|
8265
8445
|
const ctx = (0, import_react31.useContext)(DrawerContext);
|
|
@@ -8282,11 +8462,11 @@ function useDrawerOpenState(openProp, defaultOpen, onOpenChange) {
|
|
|
8282
8462
|
function widthToken(s) {
|
|
8283
8463
|
switch (s) {
|
|
8284
8464
|
case "md":
|
|
8285
|
-
return
|
|
8465
|
+
return import_tokens3.componentSizes.drawerWidthMd;
|
|
8286
8466
|
case "lg":
|
|
8287
|
-
return
|
|
8467
|
+
return import_tokens3.componentSizes.drawerWidthLg;
|
|
8288
8468
|
default:
|
|
8289
|
-
return
|
|
8469
|
+
return import_tokens3.componentSizes.drawerWidthSm;
|
|
8290
8470
|
}
|
|
8291
8471
|
}
|
|
8292
8472
|
function Drawer({
|
|
@@ -8592,7 +8772,7 @@ function DrawerClose({
|
|
|
8592
8772
|
onClick?.(e);
|
|
8593
8773
|
if (!e.defaultPrevented) setOpen(false);
|
|
8594
8774
|
},
|
|
8595
|
-
children: iconOnly ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(WebIcon, { name: "dismiss", size:
|
|
8775
|
+
children: iconOnly ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(WebIcon, { name: "dismiss", size: import_tokens19.iconSizes.xlarge, color: "currentColor", iconStyle: "regular", "aria-hidden": true }) : children
|
|
8596
8776
|
}
|
|
8597
8777
|
);
|
|
8598
8778
|
}
|
|
@@ -8601,7 +8781,7 @@ function DrawerClose({
|
|
|
8601
8781
|
var import_clsx70 = require("clsx");
|
|
8602
8782
|
var import_react34 = require("react");
|
|
8603
8783
|
var import_react_dom4 = require("react-dom");
|
|
8604
|
-
var
|
|
8784
|
+
var import_tokens20 = require("@refineui/tokens");
|
|
8605
8785
|
var import_color8 = require("@refineui/utilities/color");
|
|
8606
8786
|
|
|
8607
8787
|
// src/components/Dropdown/style.ts
|
|
@@ -8809,27 +8989,27 @@ function DropdownTrigger({ children, className, ...props }) {
|
|
|
8809
8989
|
};
|
|
8810
8990
|
const mergeEl = (0, import_react35.getMergeableTriggerChild)(children);
|
|
8811
8991
|
if (mergeEl) {
|
|
8812
|
-
const el = mergeEl;
|
|
8813
8992
|
const passthrough = props;
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8994
|
+
import_react35.Slot,
|
|
8995
|
+
{
|
|
8996
|
+
ref: triggerRef,
|
|
8997
|
+
...props,
|
|
8998
|
+
className,
|
|
8999
|
+
"aria-expanded": open,
|
|
9000
|
+
"aria-haspopup": "menu",
|
|
9001
|
+
"aria-controls": menuId,
|
|
9002
|
+
onClick: (event) => {
|
|
9003
|
+
passthrough.onClick?.(event);
|
|
9004
|
+
toggle();
|
|
9005
|
+
},
|
|
9006
|
+
onKeyDown: (event) => {
|
|
9007
|
+
passthrough.onKeyDown?.(event);
|
|
9008
|
+
onTriggerKeyDown(event);
|
|
9009
|
+
},
|
|
9010
|
+
children: mergeEl
|
|
8831
9011
|
}
|
|
8832
|
-
|
|
9012
|
+
);
|
|
8833
9013
|
}
|
|
8834
9014
|
const passthroughBtn = props;
|
|
8835
9015
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
@@ -8870,9 +9050,9 @@ function DropdownContent({
|
|
|
8870
9050
|
const { open, setOpen, close, triggerRef, menuRef, menuId } = useDropdownRoot("DropdownContent");
|
|
8871
9051
|
const [fixedStyle, setFixedStyle] = (0, import_react34.useState)(null);
|
|
8872
9052
|
const [menuSide, setMenuSide] = (0, import_react34.useState)("bottom");
|
|
8873
|
-
const gapPx = sideOffset ?? parseCssPxLen(
|
|
8874
|
-
const defaultMenuW = parseCssPxLen(
|
|
8875
|
-
const z = Number.parseInt(String(
|
|
9053
|
+
const gapPx = sideOffset ?? parseCssPxLen(import_tokens20.spacings.sizeXXSmall, 4);
|
|
9054
|
+
const defaultMenuW = parseCssPxLen(import_tokens3.componentSizes.dropdownMenuWidth, 180);
|
|
9055
|
+
const z = Number.parseInt(String(import_tokens20.zIndex.zIndexMessages), 10) || 1e4;
|
|
8876
9056
|
useIsomorphicLayoutEffect3(() => {
|
|
8877
9057
|
if (!open) {
|
|
8878
9058
|
setFixedStyle(null);
|
|
@@ -8899,7 +9079,7 @@ function DropdownContent({
|
|
|
8899
9079
|
position: "fixed",
|
|
8900
9080
|
top: pos.top,
|
|
8901
9081
|
left: pos.left,
|
|
8902
|
-
minWidth:
|
|
9082
|
+
minWidth: import_tokens3.componentSizes.dropdownMenuWidth,
|
|
8903
9083
|
zIndex: z,
|
|
8904
9084
|
maxHeight: "min(60vh, 20rem)"
|
|
8905
9085
|
};
|
|
@@ -9220,7 +9400,7 @@ function DropdownSubTrigger({
|
|
|
9220
9400
|
WebIcon,
|
|
9221
9401
|
{
|
|
9222
9402
|
name: "chevron-right",
|
|
9223
|
-
size:
|
|
9403
|
+
size: import_tokens20.iconSizes.small,
|
|
9224
9404
|
color: "currentColor",
|
|
9225
9405
|
"aria-hidden": true,
|
|
9226
9406
|
className: "ms-auto shrink-0"
|
|
@@ -9236,8 +9416,8 @@ function DropdownSubContent({ className, children, style, ...props }) {
|
|
|
9236
9416
|
const panelRef = (0, import_react34.useRef)(null);
|
|
9237
9417
|
const [fixedStyle, setFixedStyle] = (0, import_react34.useState)(null);
|
|
9238
9418
|
const [side, setSide] = (0, import_react34.useState)("right");
|
|
9239
|
-
const defaultMenuW = parseCssPxLen(
|
|
9240
|
-
const gapPx = parseCssPxLen(
|
|
9419
|
+
const defaultMenuW = parseCssPxLen(import_tokens3.componentSizes.dropdownMenuWidth, 180);
|
|
9420
|
+
const gapPx = parseCssPxLen(import_tokens20.spacings.sizeXXXSmall, 2);
|
|
9241
9421
|
const setPanelEl = (0, import_react34.useCallback)(
|
|
9242
9422
|
(el) => {
|
|
9243
9423
|
panelRef.current = el;
|
|
@@ -9274,8 +9454,8 @@ function DropdownSubContent({ className, children, style, ...props }) {
|
|
|
9274
9454
|
position: "fixed",
|
|
9275
9455
|
top: pos.top,
|
|
9276
9456
|
left: pos.left,
|
|
9277
|
-
minWidth:
|
|
9278
|
-
zIndex: (Number.parseInt(String(
|
|
9457
|
+
minWidth: import_tokens3.componentSizes.dropdownMenuWidth,
|
|
9458
|
+
zIndex: (Number.parseInt(String(import_tokens20.zIndex.zIndexMessages), 10) || 1e4) + 100,
|
|
9279
9459
|
maxHeight: "min(60vh, 20rem)"
|
|
9280
9460
|
});
|
|
9281
9461
|
};
|
|
@@ -9428,7 +9608,7 @@ function FieldError({ className, ...props }) {
|
|
|
9428
9608
|
|
|
9429
9609
|
// src/components/Link/Link.tsx
|
|
9430
9610
|
var import_clsx74 = require("clsx");
|
|
9431
|
-
var
|
|
9611
|
+
var import_tokens21 = require("@refineui/tokens");
|
|
9432
9612
|
|
|
9433
9613
|
// src/components/Link/style.ts
|
|
9434
9614
|
var linkStyles = {
|
|
@@ -9466,7 +9646,7 @@ function Link({
|
|
|
9466
9646
|
...props,
|
|
9467
9647
|
children: [
|
|
9468
9648
|
children,
|
|
9469
|
-
showOpen && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(WebIcon, { name: "open", size:
|
|
9649
|
+
showOpen && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(WebIcon, { name: "open", size: import_tokens21.iconSizes.large, color: "currentColor" })
|
|
9470
9650
|
]
|
|
9471
9651
|
}
|
|
9472
9652
|
);
|
|
@@ -9476,7 +9656,7 @@ function Link({
|
|
|
9476
9656
|
var import_clsx76 = require("clsx");
|
|
9477
9657
|
var import_react36 = require("react");
|
|
9478
9658
|
var import_react_dom5 = require("react-dom");
|
|
9479
|
-
var
|
|
9659
|
+
var import_tokens22 = require("@refineui/tokens");
|
|
9480
9660
|
var import_animation4 = require("@refineui/utilities/animation");
|
|
9481
9661
|
var import_react37 = require("@refineui/utilities/react");
|
|
9482
9662
|
|
|
@@ -9578,15 +9758,7 @@ function MenuTrigger({ children }) {
|
|
|
9578
9758
|
const { open, setOpen } = useMenuContext("MenuTrigger");
|
|
9579
9759
|
const mergeEl = (0, import_react37.getMergeableTriggerChild)(children);
|
|
9580
9760
|
if (mergeEl) {
|
|
9581
|
-
|
|
9582
|
-
return (0, import_react36.cloneElement)(el, {
|
|
9583
|
-
"aria-expanded": open,
|
|
9584
|
-
"aria-haspopup": "menu",
|
|
9585
|
-
onClick: (e) => {
|
|
9586
|
-
el.props.onClick?.(e);
|
|
9587
|
-
setOpen(!open);
|
|
9588
|
-
}
|
|
9589
|
-
});
|
|
9761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react37.Slot, { "aria-expanded": open, "aria-haspopup": "menu", onClick: () => setOpen(!open), children: mergeEl });
|
|
9590
9762
|
}
|
|
9591
9763
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
9592
9764
|
"button",
|
|
@@ -9605,8 +9777,8 @@ function MenuPopover({ className, children, style, ...props }) {
|
|
|
9605
9777
|
const [shouldRender, setShouldRender] = (0, import_react36.useState)(open);
|
|
9606
9778
|
const [isClosing, setIsClosing] = (0, import_react36.useState)(false);
|
|
9607
9779
|
const [fixedStyle, setFixedStyle] = (0, import_react36.useState)(null);
|
|
9608
|
-
const gapPx = parseCssPx(
|
|
9609
|
-
const z = Number.parseInt(String(
|
|
9780
|
+
const gapPx = parseCssPx(import_tokens22.spacings.sizeXXSmall, 4);
|
|
9781
|
+
const z = Number.parseInt(String(import_tokens22.zIndex.zIndexMessages), 10) || 1e4;
|
|
9610
9782
|
(0, import_react36.useEffect)(() => {
|
|
9611
9783
|
if (open) {
|
|
9612
9784
|
setShouldRender(true);
|
|
@@ -9621,7 +9793,7 @@ function MenuPopover({ className, children, style, ...props }) {
|
|
|
9621
9793
|
setShouldRender(false);
|
|
9622
9794
|
setIsClosing(false);
|
|
9623
9795
|
setFixedStyle(null);
|
|
9624
|
-
}, (0, import_animation4.motionMsToNumber)(
|
|
9796
|
+
}, (0, import_animation4.motionMsToNumber)(import_tokens22.semanticInteraction.duration.normal));
|
|
9625
9797
|
return () => window.clearTimeout(timeout);
|
|
9626
9798
|
}, [open, shouldRender]);
|
|
9627
9799
|
useIsomorphicLayoutEffect4(() => {
|
|
@@ -9636,7 +9808,7 @@ function MenuPopover({ className, children, style, ...props }) {
|
|
|
9636
9808
|
position: "fixed",
|
|
9637
9809
|
top: rect.bottom + gapPx,
|
|
9638
9810
|
left: rect.left,
|
|
9639
|
-
minWidth:
|
|
9811
|
+
minWidth: import_tokens3.componentSizes.menuPanelWidth,
|
|
9640
9812
|
width: positioning?.autoSize ? "max-content" : void 0,
|
|
9641
9813
|
maxWidth: "min(100vw - 16px, 24rem)",
|
|
9642
9814
|
zIndex: z
|
|
@@ -9761,9 +9933,9 @@ function MenuItem({
|
|
|
9761
9933
|
{
|
|
9762
9934
|
className: menuStyles.iconWrap,
|
|
9763
9935
|
style: {
|
|
9764
|
-
width:
|
|
9765
|
-
minWidth:
|
|
9766
|
-
height:
|
|
9936
|
+
width: import_tokens22.iconSizes.small,
|
|
9937
|
+
minWidth: import_tokens22.iconSizes.small,
|
|
9938
|
+
height: import_tokens22.iconSizes.small
|
|
9767
9939
|
},
|
|
9768
9940
|
children: startIcon
|
|
9769
9941
|
}
|
|
@@ -9788,9 +9960,9 @@ function MenuItem({
|
|
|
9788
9960
|
{
|
|
9789
9961
|
className: menuStyles.iconWrap,
|
|
9790
9962
|
style: {
|
|
9791
|
-
width:
|
|
9792
|
-
minWidth:
|
|
9793
|
-
height:
|
|
9963
|
+
width: import_tokens22.iconSizes.small,
|
|
9964
|
+
minWidth: import_tokens22.iconSizes.small,
|
|
9965
|
+
height: import_tokens22.iconSizes.small
|
|
9794
9966
|
},
|
|
9795
9967
|
children: endIcon
|
|
9796
9968
|
}
|
|
@@ -9942,9 +10114,9 @@ function MenuSubTrigger({
|
|
|
9942
10114
|
{
|
|
9943
10115
|
className: menuStyles.iconWrap,
|
|
9944
10116
|
style: {
|
|
9945
|
-
width:
|
|
9946
|
-
minWidth:
|
|
9947
|
-
height:
|
|
10117
|
+
width: import_tokens22.iconSizes.small,
|
|
10118
|
+
minWidth: import_tokens22.iconSizes.small,
|
|
10119
|
+
height: import_tokens22.iconSizes.small
|
|
9948
10120
|
},
|
|
9949
10121
|
children: startIcon
|
|
9950
10122
|
}
|
|
@@ -9967,11 +10139,11 @@ function MenuSubTrigger({
|
|
|
9967
10139
|
{
|
|
9968
10140
|
className: menuStyles.iconWrap,
|
|
9969
10141
|
style: {
|
|
9970
|
-
width:
|
|
9971
|
-
minWidth:
|
|
9972
|
-
height:
|
|
10142
|
+
width: import_tokens22.iconSizes.small,
|
|
10143
|
+
minWidth: import_tokens22.iconSizes.small,
|
|
10144
|
+
height: import_tokens22.iconSizes.small
|
|
9973
10145
|
},
|
|
9974
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(WebIcon, { name: "chevron-right", size:
|
|
10146
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(WebIcon, { name: "chevron-right", size: import_tokens22.iconSizes.small, color: "currentColor", "aria-hidden": true })
|
|
9975
10147
|
}
|
|
9976
10148
|
) })
|
|
9977
10149
|
] })
|
|
@@ -9984,9 +10156,9 @@ function MenuSubContent({ className, children, style, ...props }) {
|
|
|
9984
10156
|
const panelRef = (0, import_react36.useRef)(null);
|
|
9985
10157
|
const [fixedStyle, setFixedStyle] = (0, import_react36.useState)(null);
|
|
9986
10158
|
const [side, setSide] = (0, import_react36.useState)("right");
|
|
9987
|
-
const gapPx = parseCssPx(
|
|
9988
|
-
const z = (Number.parseInt(String(
|
|
9989
|
-
const defaultW = parseCssPx(
|
|
10159
|
+
const gapPx = parseCssPx(import_tokens22.spacings.sizeXXXSmall, 2);
|
|
10160
|
+
const z = (Number.parseInt(String(import_tokens22.zIndex.zIndexMessages), 10) || 1e4) + 100;
|
|
10161
|
+
const defaultW = parseCssPx(import_tokens3.componentSizes.menuPanelWidth, 244);
|
|
9990
10162
|
const setPanelEl = (0, import_react36.useCallback)(
|
|
9991
10163
|
(el) => {
|
|
9992
10164
|
panelRef.current = el;
|
|
@@ -10025,7 +10197,7 @@ function MenuSubContent({ className, children, style, ...props }) {
|
|
|
10025
10197
|
position: "fixed",
|
|
10026
10198
|
top: pos.top,
|
|
10027
10199
|
left: pos.left,
|
|
10028
|
-
minWidth:
|
|
10200
|
+
minWidth: import_tokens3.componentSizes.menuPanelWidth,
|
|
10029
10201
|
zIndex: z,
|
|
10030
10202
|
maxHeight: "min(60vh, 20rem)"
|
|
10031
10203
|
});
|
|
@@ -10084,14 +10256,14 @@ function MenuSubContent({ className, children, style, ...props }) {
|
|
|
10084
10256
|
// src/components/NavigationMenu/NavigationMenu.tsx
|
|
10085
10257
|
var import_clsx78 = require("clsx");
|
|
10086
10258
|
var import_react38 = require("react");
|
|
10087
|
-
var
|
|
10259
|
+
var import_tokens23 = require("@refineui/tokens");
|
|
10088
10260
|
var import_animation5 = require("@refineui/utilities/animation");
|
|
10089
10261
|
|
|
10090
10262
|
// src/components/NavigationMenu/style.ts
|
|
10091
10263
|
var import_clsx77 = require("clsx");
|
|
10092
10264
|
var topLevelItem = (0, import_clsx77.clsx)(
|
|
10093
10265
|
componentTextClass(componentTypographyTokens.navigationMenu.trigger),
|
|
10094
|
-
"box-border inline-flex cursor-pointer items-center justify-center gap-refineui-size-x-small",
|
|
10266
|
+
"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",
|
|
10095
10267
|
"rounded-refineui-large border-none bg-transparent px-refineui-size-medium py-refineui-size-x-small",
|
|
10096
10268
|
"text-refineui-alias-foreground-tertiary outline-none leading-none",
|
|
10097
10269
|
"transition-[color,background-color] duration-[var(--refineui-motion-duration-fast)]"
|
|
@@ -10108,8 +10280,6 @@ var navigationMenuStyles = {
|
|
|
10108
10280
|
triggerDisabled: "cursor-not-allowed text-refineui-alias-foreground-disabled",
|
|
10109
10281
|
chevron,
|
|
10110
10282
|
chevronOpen: "rotate-180",
|
|
10111
|
-
/** Matches trigger chevron box so direct top-level links align with dropdown triggers. */
|
|
10112
|
-
linkChevronSpacer: (0, import_clsx77.clsx)(chevron, "inline-block size-refineui-icon-xsmall shrink-0 pointer-events-none invisible"),
|
|
10113
10283
|
content: (0, import_clsx77.clsx)(
|
|
10114
10284
|
/** Flush under trigger so pointer does not leave the item while moving into the panel. */
|
|
10115
10285
|
"absolute start-0 top-full z-refineui-messages pt-refineui-size-xx-small",
|
|
@@ -10184,8 +10354,8 @@ function NavigationMenu({
|
|
|
10184
10354
|
const openTimerRef = (0, import_react38.useRef)(null);
|
|
10185
10355
|
const closeTimerRef = (0, import_react38.useRef)(null);
|
|
10186
10356
|
const rootRef = (0, import_react38.useRef)(null);
|
|
10187
|
-
const delayDuration = delayDurationProp ?? (0, import_animation5.motionMsToNumber)(
|
|
10188
|
-
const skipDelayDuration = skipDelayDurationProp ?? (0, import_animation5.motionMsToNumber)(
|
|
10357
|
+
const delayDuration = delayDurationProp ?? (0, import_animation5.motionMsToNumber)(import_tokens23.semanticInteraction.duration.normal);
|
|
10358
|
+
const skipDelayDuration = skipDelayDurationProp ?? (0, import_animation5.motionMsToNumber)(import_tokens23.semanticInteraction.duration.fast);
|
|
10189
10359
|
const clearTimers = (0, import_react38.useCallback)(() => {
|
|
10190
10360
|
if (openTimerRef.current != null) {
|
|
10191
10361
|
window.clearTimeout(openTimerRef.current);
|
|
@@ -10350,10 +10520,12 @@ function NavigationMenuItem({
|
|
|
10350
10520
|
onPointerEnter: (event) => {
|
|
10351
10521
|
onPointerEnter?.(event);
|
|
10352
10522
|
if (event.defaultPrevented) return;
|
|
10353
|
-
const
|
|
10354
|
-
event.currentTarget.querySelector(
|
|
10523
|
+
const hasEnabledTrigger = Boolean(
|
|
10524
|
+
event.currentTarget.querySelector(
|
|
10525
|
+
'[data-refineui="navigation-menu-trigger"]:not(:disabled)'
|
|
10526
|
+
)
|
|
10355
10527
|
);
|
|
10356
|
-
if (
|
|
10528
|
+
if (hasEnabledTrigger) {
|
|
10357
10529
|
menu.openItem(value);
|
|
10358
10530
|
}
|
|
10359
10531
|
},
|
|
@@ -10432,7 +10604,7 @@ function NavigationMenuTrigger({
|
|
|
10432
10604
|
WebIcon,
|
|
10433
10605
|
{
|
|
10434
10606
|
name: "chevron-down",
|
|
10435
|
-
size:
|
|
10607
|
+
size: import_tokens23.iconSizes.xsmall,
|
|
10436
10608
|
color: "currentColor",
|
|
10437
10609
|
className: (0, import_clsx78.clsx)(
|
|
10438
10610
|
navigationMenuStyles.chevron,
|
|
@@ -10465,7 +10637,7 @@ function NavigationMenuContent({
|
|
|
10465
10637
|
const timeout = window.setTimeout(() => {
|
|
10466
10638
|
setShouldRender(false);
|
|
10467
10639
|
setIsClosing(false);
|
|
10468
|
-
}, (0, import_animation5.motionMsToNumber)(
|
|
10640
|
+
}, (0, import_animation5.motionMsToNumber)(import_tokens23.semanticInteraction.duration.fast));
|
|
10469
10641
|
return () => window.clearTimeout(timeout);
|
|
10470
10642
|
}, [item.open, shouldRender]);
|
|
10471
10643
|
const contentCtx = (0, import_react38.useMemo)(
|
|
@@ -10507,7 +10679,7 @@ function NavigationMenuLink({
|
|
|
10507
10679
|
const menu = (0, import_react38.useContext)(NavigationMenuContext);
|
|
10508
10680
|
const inContent = menu?.isInsideContent ?? false;
|
|
10509
10681
|
const disabled = ariaDisabled === true || ariaDisabled === "true";
|
|
10510
|
-
return /* @__PURE__ */ (0, import_jsx_runtime59.
|
|
10682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
10511
10683
|
"a",
|
|
10512
10684
|
{
|
|
10513
10685
|
"data-refineui": "navigation-menu-link",
|
|
@@ -10523,7 +10695,11 @@ function NavigationMenuLink({
|
|
|
10523
10695
|
),
|
|
10524
10696
|
onClick: (event) => {
|
|
10525
10697
|
onClick?.(event);
|
|
10526
|
-
if (event.defaultPrevented
|
|
10698
|
+
if (event.defaultPrevented) return;
|
|
10699
|
+
if (disabled) {
|
|
10700
|
+
event.preventDefault();
|
|
10701
|
+
return;
|
|
10702
|
+
}
|
|
10527
10703
|
menu?.setValue("");
|
|
10528
10704
|
},
|
|
10529
10705
|
onFocus: (event) => {
|
|
@@ -10533,10 +10709,7 @@ function NavigationMenuLink({
|
|
|
10533
10709
|
}
|
|
10534
10710
|
},
|
|
10535
10711
|
...props,
|
|
10536
|
-
children
|
|
10537
|
-
children,
|
|
10538
|
-
!inContent ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { "aria-hidden": true, className: navigationMenuStyles.linkChevronSpacer }) : null
|
|
10539
|
-
]
|
|
10712
|
+
children
|
|
10540
10713
|
}
|
|
10541
10714
|
);
|
|
10542
10715
|
}
|
|
@@ -10741,7 +10914,7 @@ function SidebarFooter({ className, ...props }) {
|
|
|
10741
10914
|
// src/components/Sidebar/SidebarPeek.tsx
|
|
10742
10915
|
var import_clsx82 = require("clsx");
|
|
10743
10916
|
var import_react39 = require("react");
|
|
10744
|
-
var
|
|
10917
|
+
var import_tokens24 = require("@refineui/tokens");
|
|
10745
10918
|
var import_animation6 = require("@refineui/utilities/animation");
|
|
10746
10919
|
|
|
10747
10920
|
// src/components/Sidebar/peekStyle.ts
|
|
@@ -10767,9 +10940,9 @@ var sidebarPeekStyles = {
|
|
|
10767
10940
|
|
|
10768
10941
|
// src/components/Sidebar/SidebarPeek.tsx
|
|
10769
10942
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
10770
|
-
var PEEK_OPEN_DELAY_MS = (0, import_animation6.motionMsToNumber)(
|
|
10771
|
-
var PEEK_CLOSE_DELAY_MS = (0, import_animation6.motionMsToNumber)(
|
|
10772
|
-
var PEEK_BRIDGE_DELAY_MS = (0, import_animation6.motionMsToNumber)(
|
|
10943
|
+
var PEEK_OPEN_DELAY_MS = (0, import_animation6.motionMsToNumber)(import_tokens24.semanticInteraction.duration.medium);
|
|
10944
|
+
var PEEK_CLOSE_DELAY_MS = (0, import_animation6.motionMsToNumber)(import_tokens24.semanticInteraction.duration.medium);
|
|
10945
|
+
var PEEK_BRIDGE_DELAY_MS = (0, import_animation6.motionMsToNumber)(import_tokens24.semanticInteraction.duration.slow);
|
|
10773
10946
|
var SidebarPeekContext = (0, import_react39.createContext)(null);
|
|
10774
10947
|
function useSidebarPeekContext(component) {
|
|
10775
10948
|
const ctx = (0, import_react39.useContext)(SidebarPeekContext);
|
|
@@ -11021,7 +11194,7 @@ function useSidebarPeek() {
|
|
|
11021
11194
|
|
|
11022
11195
|
// src/components/Pagination/Pagination.tsx
|
|
11023
11196
|
var import_clsx84 = require("clsx");
|
|
11024
|
-
var
|
|
11197
|
+
var import_tokens25 = require("@refineui/tokens");
|
|
11025
11198
|
var import_color10 = require("@refineui/utilities/color");
|
|
11026
11199
|
|
|
11027
11200
|
// src/components/Pagination/style.ts
|
|
@@ -11084,7 +11257,7 @@ function PaginationNavButton({
|
|
|
11084
11257
|
WebIcon,
|
|
11085
11258
|
{
|
|
11086
11259
|
name: isPrev ? "chevron-left" : "chevron-right",
|
|
11087
|
-
size:
|
|
11260
|
+
size: import_tokens25.iconSizes.medium,
|
|
11088
11261
|
color: iconColor,
|
|
11089
11262
|
fallback: isPrev ? "\u2039" : "\u203A"
|
|
11090
11263
|
}
|
|
@@ -11111,7 +11284,7 @@ function PaginationEllipsis({ className, ...props }) {
|
|
|
11111
11284
|
WebIcon,
|
|
11112
11285
|
{
|
|
11113
11286
|
name: "more-horizontal",
|
|
11114
|
-
size:
|
|
11287
|
+
size: import_tokens25.iconSizes.medium,
|
|
11115
11288
|
color: (0, import_color10.resolveColorTokenValue)(componentColorTokens.pagination.navIcon.default),
|
|
11116
11289
|
fallback: "\u2026"
|
|
11117
11290
|
}
|
|
@@ -11126,7 +11299,7 @@ function Pagination(props) {
|
|
|
11126
11299
|
// src/components/PopOver/PopOver.tsx
|
|
11127
11300
|
var import_clsx85 = require("clsx");
|
|
11128
11301
|
var import_react40 = require("react");
|
|
11129
|
-
var
|
|
11302
|
+
var import_tokens26 = require("@refineui/tokens");
|
|
11130
11303
|
var import_color11 = require("@refineui/utilities/color");
|
|
11131
11304
|
var import_react41 = require("@refineui/utilities/react");
|
|
11132
11305
|
|
|
@@ -11169,15 +11342,15 @@ function usePopoverContext(component) {
|
|
|
11169
11342
|
if (!ctx) throw new Error(`${component} must be used within <Popover>`);
|
|
11170
11343
|
return ctx;
|
|
11171
11344
|
}
|
|
11172
|
-
var BEAK_W =
|
|
11173
|
-
var BEAK_H =
|
|
11174
|
-
var BEAK_OFFSET =
|
|
11175
|
-
var BEAK_BORDER_OVERLAP =
|
|
11176
|
-
var POPOVER_GAP =
|
|
11345
|
+
var BEAK_W = import_tokens3.foundationSizes.foundationSize160;
|
|
11346
|
+
var BEAK_H = import_tokens3.foundationSizes.foundationSize80;
|
|
11347
|
+
var BEAK_OFFSET = import_tokens3.foundationSizes.foundationSize80;
|
|
11348
|
+
var BEAK_BORDER_OVERLAP = import_tokens26.strokeWidths.strokeWidthThin;
|
|
11349
|
+
var POPOVER_GAP = import_tokens26.spacings.sizeMedium;
|
|
11177
11350
|
function beakWrapperStyle(placement, align) {
|
|
11178
|
-
const insetStart =
|
|
11179
|
-
const insetEnd =
|
|
11180
|
-
const edge =
|
|
11351
|
+
const insetStart = import_tokens3.componentSizes.popoverBeakInsetFromStartEdge;
|
|
11352
|
+
const insetEnd = import_tokens3.componentSizes.popoverBeakInsetFromEndEdge;
|
|
11353
|
+
const edge = import_tokens26.spacings.sizeMedium;
|
|
11181
11354
|
const overlapOffset = `calc(-1 * ${BEAK_OFFSET} + ${BEAK_BORDER_OVERLAP})`;
|
|
11182
11355
|
switch (placement) {
|
|
11183
11356
|
case "bottom":
|
|
@@ -11286,27 +11459,27 @@ function PopoverTrigger({ children, className, ...props }) {
|
|
|
11286
11459
|
const { open, toggle, triggerRef, contentId, onTriggerKeyDown } = usePopoverContext("PopoverTrigger");
|
|
11287
11460
|
const mergeEl = (0, import_react41.getMergeableTriggerChild)(children);
|
|
11288
11461
|
if (mergeEl) {
|
|
11289
|
-
const el = mergeEl;
|
|
11290
11462
|
const passthrough = props;
|
|
11291
|
-
|
|
11292
|
-
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
|
|
11463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
11464
|
+
import_react41.Slot,
|
|
11465
|
+
{
|
|
11466
|
+
ref: triggerRef,
|
|
11467
|
+
...props,
|
|
11468
|
+
className,
|
|
11469
|
+
"aria-expanded": open,
|
|
11470
|
+
"aria-haspopup": "dialog",
|
|
11471
|
+
"aria-controls": contentId,
|
|
11472
|
+
onClick: (event) => {
|
|
11473
|
+
passthrough.onClick?.(event);
|
|
11474
|
+
toggle();
|
|
11475
|
+
},
|
|
11476
|
+
onKeyDown: (event) => {
|
|
11477
|
+
passthrough.onKeyDown?.(event);
|
|
11478
|
+
onTriggerKeyDown(event);
|
|
11479
|
+
},
|
|
11480
|
+
children: mergeEl
|
|
11308
11481
|
}
|
|
11309
|
-
|
|
11482
|
+
);
|
|
11310
11483
|
}
|
|
11311
11484
|
const passthroughBtn = props;
|
|
11312
11485
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
@@ -11405,8 +11578,8 @@ function PopoverContent({
|
|
|
11405
11578
|
),
|
|
11406
11579
|
style: {
|
|
11407
11580
|
...styleProp && typeof styleProp === "object" ? styleProp : {},
|
|
11408
|
-
minWidth:
|
|
11409
|
-
padding:
|
|
11581
|
+
minWidth: import_tokens3.componentSizes.popoverPanelWidth,
|
|
11582
|
+
padding: import_tokens26.spacings.sizeLarge,
|
|
11410
11583
|
backgroundColor: bg,
|
|
11411
11584
|
color: (0, import_color11.resolveColorTokenValue)(palette.foreground),
|
|
11412
11585
|
borderColor: borderCol
|
|
@@ -11562,7 +11735,7 @@ function Slider({
|
|
|
11562
11735
|
|
|
11563
11736
|
// src/components/Carousel/Carousel.tsx
|
|
11564
11737
|
var import_clsx89 = require("clsx");
|
|
11565
|
-
var
|
|
11738
|
+
var import_tokens27 = require("@refineui/tokens");
|
|
11566
11739
|
var import_react43 = require("react");
|
|
11567
11740
|
|
|
11568
11741
|
// src/components/Carousel/style.ts
|
|
@@ -11913,7 +12086,7 @@ function CarouselPrevious({ className, disabled, onClick, ...props }) {
|
|
|
11913
12086
|
WebIcon,
|
|
11914
12087
|
{
|
|
11915
12088
|
name: "chevron-left",
|
|
11916
|
-
size:
|
|
12089
|
+
size: import_tokens27.iconSizes.small,
|
|
11917
12090
|
color: "currentColor",
|
|
11918
12091
|
iconStyle: "filled",
|
|
11919
12092
|
fallback: "\u2039"
|
|
@@ -11945,7 +12118,7 @@ function CarouselNext({ className, disabled, onClick, ...props }) {
|
|
|
11945
12118
|
WebIcon,
|
|
11946
12119
|
{
|
|
11947
12120
|
name: "chevron-right",
|
|
11948
|
-
size:
|
|
12121
|
+
size: import_tokens27.iconSizes.small,
|
|
11949
12122
|
color: "currentColor",
|
|
11950
12123
|
iconStyle: "filled",
|
|
11951
12124
|
fallback: "\u203A"
|
|
@@ -12210,7 +12383,7 @@ function BubbleReactions({
|
|
|
12210
12383
|
|
|
12211
12384
|
// src/components/Stepper/Stepper.tsx
|
|
12212
12385
|
var import_clsx93 = require("clsx");
|
|
12213
|
-
var
|
|
12386
|
+
var import_tokens28 = require("@refineui/tokens");
|
|
12214
12387
|
var import_react45 = require("react");
|
|
12215
12388
|
|
|
12216
12389
|
// src/components/Stepper/style.ts
|
|
@@ -12472,7 +12645,7 @@ function StepperIndicator({ className, children, ...props }) {
|
|
|
12472
12645
|
WebIcon,
|
|
12473
12646
|
{
|
|
12474
12647
|
name: "checkmark",
|
|
12475
|
-
size:
|
|
12648
|
+
size: import_tokens28.iconSizes.xsmall,
|
|
12476
12649
|
color: "currentColor",
|
|
12477
12650
|
iconStyle: "filled",
|
|
12478
12651
|
fallback: "\u2713",
|
|
@@ -13083,7 +13256,7 @@ function ResizableHandle({
|
|
|
13083
13256
|
// src/components/SpinButton/SpinButton.tsx
|
|
13084
13257
|
var import_clsx96 = require("clsx");
|
|
13085
13258
|
var import_react47 = require("react");
|
|
13086
|
-
var
|
|
13259
|
+
var import_tokens29 = require("@refineui/tokens");
|
|
13087
13260
|
|
|
13088
13261
|
// src/components/SpinButton/style.ts
|
|
13089
13262
|
var spinButtonStyles = {
|
|
@@ -13292,7 +13465,7 @@ function SpinButton({
|
|
|
13292
13465
|
WebIcon,
|
|
13293
13466
|
{
|
|
13294
13467
|
name: "chevron-up",
|
|
13295
|
-
size:
|
|
13468
|
+
size: import_tokens29.iconSizes.xsmall,
|
|
13296
13469
|
color: "currentColor",
|
|
13297
13470
|
iconStyle: "filled",
|
|
13298
13471
|
fallback: "\u25B2"
|
|
@@ -13316,7 +13489,7 @@ function SpinButton({
|
|
|
13316
13489
|
WebIcon,
|
|
13317
13490
|
{
|
|
13318
13491
|
name: "chevron-down",
|
|
13319
|
-
size:
|
|
13492
|
+
size: import_tokens29.iconSizes.xsmall,
|
|
13320
13493
|
color: "currentColor",
|
|
13321
13494
|
iconStyle: "filled",
|
|
13322
13495
|
fallback: "\u25BC"
|
|
@@ -13336,14 +13509,15 @@ function SpinButton({
|
|
|
13336
13509
|
var import_clsx98 = require("clsx");
|
|
13337
13510
|
var import_react48 = require("react");
|
|
13338
13511
|
var import_react_dom6 = require("react-dom");
|
|
13339
|
-
var
|
|
13512
|
+
var import_tokens30 = require("@refineui/tokens");
|
|
13340
13513
|
var import_animation7 = require("@refineui/utilities/animation");
|
|
13514
|
+
var import_color12 = require("@refineui/utilities/color");
|
|
13341
13515
|
|
|
13342
13516
|
// src/recipes/toast.recipe.ts
|
|
13343
13517
|
var import_clsx97 = require("clsx");
|
|
13344
13518
|
var toastRecipe = defineRecipe({
|
|
13345
13519
|
name: "toast",
|
|
13346
|
-
base: "relative isolate box-border flex w-fit max-w-refineui-toast-max-width cursor-grab items-center gap-refineui-size-small rounded-refineui-
|
|
13520
|
+
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",
|
|
13347
13521
|
variants: {
|
|
13348
13522
|
variant: {
|
|
13349
13523
|
default: "",
|
|
@@ -13373,7 +13547,7 @@ var toastStyles = {
|
|
|
13373
13547
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
13374
13548
|
var useIsomorphicLayoutEffect6 = typeof document !== "undefined" ? import_react48.useLayoutEffect : import_react48.useEffect;
|
|
13375
13549
|
var ENTER_MS = 20;
|
|
13376
|
-
var LEAVE_MS = (0, import_animation7.motionMsToNumber)(
|
|
13550
|
+
var LEAVE_MS = (0, import_animation7.motionMsToNumber)(componentTokens.toast.motion.leave) + 60;
|
|
13377
13551
|
var DEFAULT_DURATION = 4200;
|
|
13378
13552
|
var DEFAULT_MAX_TOASTS = 1;
|
|
13379
13553
|
var STACK_Z_BASE = 100;
|
|
@@ -13394,10 +13568,10 @@ function gapPxFromSpacingToken(token) {
|
|
|
13394
13568
|
var TOAST_NARROW_STACK_MQ = "(max-width: 480px), (hover: none)";
|
|
13395
13569
|
function readToastStackGapPx() {
|
|
13396
13570
|
if (typeof globalThis.matchMedia === "undefined") {
|
|
13397
|
-
return gapPxFromSpacingToken(String(
|
|
13571
|
+
return gapPxFromSpacingToken(String(import_tokens30.spacings.sizeLarge));
|
|
13398
13572
|
}
|
|
13399
13573
|
const mq = globalThis.matchMedia(TOAST_NARROW_STACK_MQ);
|
|
13400
|
-
return gapPxFromSpacingToken(mq.matches ? String(
|
|
13574
|
+
return gapPxFromSpacingToken(mq.matches ? String(import_tokens30.spacings.sizeMedium) : String(import_tokens30.spacings.sizeLarge));
|
|
13401
13575
|
}
|
|
13402
13576
|
function subscribeToastStackGap(onChange) {
|
|
13403
13577
|
if (typeof globalThis.matchMedia === "undefined") return () => {
|
|
@@ -13410,7 +13584,7 @@ function useToastStackGapPx() {
|
|
|
13410
13584
|
return (0, import_react48.useSyncExternalStore)(
|
|
13411
13585
|
subscribeToastStackGap,
|
|
13412
13586
|
readToastStackGapPx,
|
|
13413
|
-
() => gapPxFromSpacingToken(String(
|
|
13587
|
+
() => gapPxFromSpacingToken(String(import_tokens30.spacings.sizeLarge))
|
|
13414
13588
|
);
|
|
13415
13589
|
}
|
|
13416
13590
|
function readToastNaturalHeight(li) {
|
|
@@ -13562,7 +13736,7 @@ var Toast = (0, import_react48.forwardRef)(function Toast2(props, ref) {
|
|
|
13562
13736
|
WebIcon,
|
|
13563
13737
|
{
|
|
13564
13738
|
name: resolvedIconName,
|
|
13565
|
-
size:
|
|
13739
|
+
size: import_tokens30.iconSizes.medium,
|
|
13566
13740
|
color: "currentColor",
|
|
13567
13741
|
iconStyle: "filled"
|
|
13568
13742
|
}
|
|
@@ -13578,6 +13752,12 @@ var Toast = (0, import_react48.forwardRef)(function Toast2(props, ref) {
|
|
|
13578
13752
|
children: action.label
|
|
13579
13753
|
}
|
|
13580
13754
|
) : action;
|
|
13755
|
+
const color = componentColorTokens.toast;
|
|
13756
|
+
const tokenStyle = {
|
|
13757
|
+
backgroundColor: (0, import_color12.resolveColorTokenValue)(color.background),
|
|
13758
|
+
borderColor: (0, import_color12.resolveColorTokenValue)(color.border),
|
|
13759
|
+
color: (0, import_color12.resolveColorTokenValue)(color.message)
|
|
13760
|
+
};
|
|
13581
13761
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
13582
13762
|
"div",
|
|
13583
13763
|
{
|
|
@@ -13588,7 +13768,7 @@ var Toast = (0, import_react48.forwardRef)(function Toast2(props, ref) {
|
|
|
13588
13768
|
role: liveRole,
|
|
13589
13769
|
"aria-live": ariaLive,
|
|
13590
13770
|
...domProps,
|
|
13591
|
-
style,
|
|
13771
|
+
style: { ...tokenStyle, ...style },
|
|
13592
13772
|
className: (0, import_clsx98.clsx)(toastStyles.card, className),
|
|
13593
13773
|
children: [
|
|
13594
13774
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { "data-refineui": "toast-icon", className: toastStyles.iconWrap, children: iconContent }),
|
|
@@ -13871,12 +14051,12 @@ var import_react50 = require("react");
|
|
|
13871
14051
|
|
|
13872
14052
|
// src/components/Tree/context.ts
|
|
13873
14053
|
var import_react49 = require("react");
|
|
13874
|
-
var
|
|
14054
|
+
var import_tokens31 = require("@refineui/tokens");
|
|
13875
14055
|
var import_animation8 = require("@refineui/utilities/animation");
|
|
13876
|
-
var TREE_PANEL_MS = Number.parseFloat(
|
|
13877
|
-
var TREE_CONTENT_MS = Number.parseFloat(
|
|
13878
|
-
var TREE_PANEL_EASE =
|
|
13879
|
-
var TREE_CONTENT_EASE =
|
|
14056
|
+
var TREE_PANEL_MS = Number.parseFloat(import_tokens31.semanticInteraction.duration.accordionPanel) / 1e3;
|
|
14057
|
+
var TREE_CONTENT_MS = Number.parseFloat(import_tokens31.semanticInteraction.duration.accordionContent) / 1e3;
|
|
14058
|
+
var TREE_PANEL_EASE = import_tokens31.semanticInteraction.easing.panel;
|
|
14059
|
+
var TREE_CONTENT_EASE = import_tokens31.semanticInteraction.easing.content;
|
|
13880
14060
|
var TreeContext = (0, import_react49.createContext)(null);
|
|
13881
14061
|
var TreeItemContext = (0, import_react49.createContext)(null);
|
|
13882
14062
|
function usePrefersReducedMotion2() {
|
|
@@ -13897,7 +14077,7 @@ function toExpandedSet(value) {
|
|
|
13897
14077
|
|
|
13898
14078
|
// src/components/Tree/style.ts
|
|
13899
14079
|
var import_clsx99 = require("clsx");
|
|
13900
|
-
var
|
|
14080
|
+
var import_tokens32 = require("@refineui/tokens");
|
|
13901
14081
|
var treeStyles = {
|
|
13902
14082
|
root: "m-0 flex list-none flex-col gap-px p-0",
|
|
13903
14083
|
item: "m-0 list-none p-0",
|
|
@@ -13925,9 +14105,9 @@ var treeStyles = {
|
|
|
13925
14105
|
label: "min-w-0 flex-1 truncate text-start"
|
|
13926
14106
|
};
|
|
13927
14107
|
var treeIconSize = {
|
|
13928
|
-
sm:
|
|
13929
|
-
md:
|
|
13930
|
-
lg:
|
|
14108
|
+
sm: import_tokens32.iconSizes.xxsmall,
|
|
14109
|
+
md: import_tokens32.iconSizes.xsmall,
|
|
14110
|
+
lg: import_tokens32.iconSizes.xsmall
|
|
13931
14111
|
};
|
|
13932
14112
|
var treeItemTypo = {
|
|
13933
14113
|
sm: sizedComponentTextClass(componentTypographyTokens.tree.item, "sm"),
|
|
@@ -14336,36 +14516,49 @@ function TreeItemContent({ className, children, ...props }) {
|
|
|
14336
14516
|
// src/components/Tooltip/Tooltip.tsx
|
|
14337
14517
|
var import_clsx105 = require("clsx");
|
|
14338
14518
|
var import_react54 = require("react");
|
|
14339
|
-
var
|
|
14340
|
-
var import_color12 = require("@refineui/utilities/color");
|
|
14519
|
+
var import_color13 = require("@refineui/utilities/color");
|
|
14341
14520
|
var import_react55 = require("@refineui/utilities/react");
|
|
14342
14521
|
|
|
14343
14522
|
// src/components/Tooltip/style.ts
|
|
14344
|
-
var
|
|
14523
|
+
var import_tokens33 = require("@refineui/tokens");
|
|
14345
14524
|
var import_clsx104 = require("clsx");
|
|
14525
|
+
var TOOLTIP_BEAK_W = import_tokens3.foundationSizes.foundationSize160;
|
|
14526
|
+
var TOOLTIP_BEAK_H = import_tokens3.foundationSizes.foundationSize80;
|
|
14527
|
+
var TOOLTIP_BEAK_OFFSET = import_tokens3.foundationSizes.foundationSize80;
|
|
14528
|
+
var BEAK_BORDER_OVERLAP2 = import_tokens33.strokeWidths.strokeWidthThin;
|
|
14529
|
+
var gap = import_tokens33.spacings.sizeXSmall;
|
|
14530
|
+
var edgeInset = import_tokens33.spacings.sizeMedium;
|
|
14346
14531
|
var tooltipStyles = {
|
|
14347
14532
|
root: "relative inline-block",
|
|
14348
14533
|
fallbackTrigger: "inline-flex outline-none",
|
|
14534
|
+
/** Positions the floating stack (beak + panel), like PopOver `floatingRoot`. */
|
|
14535
|
+
floating: "pointer-events-none absolute z-refineui-popup",
|
|
14536
|
+
panelWrap: "relative inline-block max-w-refineui-tooltip-max-width",
|
|
14537
|
+
beakWrap: "pointer-events-none absolute z-[1]",
|
|
14349
14538
|
panel: (0, import_clsx104.clsx)(
|
|
14350
14539
|
componentTextClass(componentTypographyTokens.tooltip),
|
|
14351
|
-
"
|
|
14540
|
+
"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"
|
|
14352
14541
|
)
|
|
14353
14542
|
};
|
|
14354
|
-
|
|
14355
|
-
|
|
14356
|
-
|
|
14357
|
-
|
|
14358
|
-
|
|
14359
|
-
|
|
14360
|
-
|
|
14361
|
-
|
|
14362
|
-
|
|
14543
|
+
function tooltipPlacement(position) {
|
|
14544
|
+
switch (position) {
|
|
14545
|
+
case "Top":
|
|
14546
|
+
return "top";
|
|
14547
|
+
case "Left":
|
|
14548
|
+
return "left";
|
|
14549
|
+
case "Right":
|
|
14550
|
+
return "right";
|
|
14551
|
+
case "Bottom":
|
|
14552
|
+
default:
|
|
14553
|
+
return "bottom";
|
|
14554
|
+
}
|
|
14363
14555
|
}
|
|
14364
|
-
function
|
|
14365
|
-
|
|
14556
|
+
function tooltipAlignKey(align) {
|
|
14557
|
+
if (align === "Start") return "start";
|
|
14558
|
+
if (align === "End") return "end";
|
|
14559
|
+
return "center";
|
|
14366
14560
|
}
|
|
14367
|
-
|
|
14368
|
-
function tooltipPanelStyle(position, align) {
|
|
14561
|
+
function tooltipFloatingStyle(position, align) {
|
|
14369
14562
|
switch (position) {
|
|
14370
14563
|
case "Top":
|
|
14371
14564
|
if (align === "Start") return { bottom: "100%", left: 0, marginBottom: gap };
|
|
@@ -14387,55 +14580,44 @@ function tooltipPanelStyle(position, align) {
|
|
|
14387
14580
|
return {};
|
|
14388
14581
|
}
|
|
14389
14582
|
}
|
|
14390
|
-
function
|
|
14391
|
-
const
|
|
14392
|
-
const
|
|
14393
|
-
|
|
14394
|
-
|
|
14395
|
-
|
|
14396
|
-
|
|
14397
|
-
|
|
14398
|
-
|
|
14399
|
-
|
|
14400
|
-
|
|
14401
|
-
|
|
14402
|
-
|
|
14403
|
-
|
|
14404
|
-
|
|
14405
|
-
|
|
14406
|
-
|
|
14407
|
-
|
|
14408
|
-
top:
|
|
14409
|
-
|
|
14410
|
-
|
|
14411
|
-
|
|
14412
|
-
|
|
14413
|
-
if (align === "Start") return { ...tri2, left: edgeInset, marginLeft: 0 };
|
|
14414
|
-
if (align === "End") return { ...tri2, right: edgeInset, left: "auto", marginLeft: 0 };
|
|
14415
|
-
return { ...tri2, left: "50%", marginLeft: -b };
|
|
14583
|
+
function tooltipBeakWrapperStyle(position, align) {
|
|
14584
|
+
const overlapOffset = `calc(-1 * ${TOOLTIP_BEAK_OFFSET} + ${BEAK_BORDER_OVERLAP2})`;
|
|
14585
|
+
const placement = tooltipPlacement(position);
|
|
14586
|
+
const a = tooltipAlignKey(align);
|
|
14587
|
+
switch (placement) {
|
|
14588
|
+
case "bottom":
|
|
14589
|
+
if (a === "center") return { top: overlapOffset, left: `calc(50% - ${TOOLTIP_BEAK_W} / 2)` };
|
|
14590
|
+
if (a === "start") return { top: overlapOffset, left: edgeInset };
|
|
14591
|
+
return { top: overlapOffset, right: edgeInset };
|
|
14592
|
+
case "top":
|
|
14593
|
+
if (a === "center") return { bottom: overlapOffset, left: `calc(50% - ${TOOLTIP_BEAK_W} / 2)` };
|
|
14594
|
+
if (a === "start") return { bottom: overlapOffset, left: edgeInset };
|
|
14595
|
+
return { bottom: overlapOffset, right: edgeInset };
|
|
14596
|
+
case "left":
|
|
14597
|
+
if (a === "center") return { right: overlapOffset, top: `calc(50% - ${TOOLTIP_BEAK_W} / 2)` };
|
|
14598
|
+
if (a === "start") return { right: overlapOffset, top: edgeInset };
|
|
14599
|
+
return { right: overlapOffset, bottom: edgeInset };
|
|
14600
|
+
case "right":
|
|
14601
|
+
if (a === "center") return { left: overlapOffset, top: `calc(50% - ${TOOLTIP_BEAK_W} / 2)` };
|
|
14602
|
+
if (a === "start") return { left: overlapOffset, top: edgeInset };
|
|
14603
|
+
return { left: overlapOffset, bottom: edgeInset };
|
|
14604
|
+
default:
|
|
14605
|
+
return {};
|
|
14416
14606
|
}
|
|
14417
|
-
|
|
14418
|
-
|
|
14419
|
-
|
|
14420
|
-
|
|
14421
|
-
|
|
14422
|
-
|
|
14423
|
-
|
|
14424
|
-
|
|
14425
|
-
|
|
14426
|
-
|
|
14427
|
-
|
|
14607
|
+
}
|
|
14608
|
+
function tooltipBeakRotateDeg(position) {
|
|
14609
|
+
switch (tooltipPlacement(position)) {
|
|
14610
|
+
case "bottom":
|
|
14611
|
+
return 0;
|
|
14612
|
+
case "top":
|
|
14613
|
+
return 180;
|
|
14614
|
+
case "left":
|
|
14615
|
+
return -90;
|
|
14616
|
+
case "right":
|
|
14617
|
+
return 90;
|
|
14618
|
+
default:
|
|
14619
|
+
return 0;
|
|
14428
14620
|
}
|
|
14429
|
-
const tri = {
|
|
14430
|
-
...baseBox,
|
|
14431
|
-
left: outset,
|
|
14432
|
-
borderTop: `${b}px solid transparent`,
|
|
14433
|
-
borderBottom: `${b}px solid transparent`,
|
|
14434
|
-
borderRight: `${b}px solid ${bg}`
|
|
14435
|
-
};
|
|
14436
|
-
if (align === "Start") return { ...tri, top: edgeInset, marginTop: 0 };
|
|
14437
|
-
if (align === "End") return { ...tri, bottom: edgeInset, top: "auto", marginTop: 0 };
|
|
14438
|
-
return { ...tri, top: "50%", marginTop: -b };
|
|
14439
14621
|
}
|
|
14440
14622
|
|
|
14441
14623
|
// src/components/Tooltip/Tooltip.tsx
|
|
@@ -14460,8 +14642,10 @@ function Tooltip({
|
|
|
14460
14642
|
if (ctrlOpen === void 0) setInnerOpen(next);
|
|
14461
14643
|
onOpenChange?.(next);
|
|
14462
14644
|
};
|
|
14463
|
-
const
|
|
14464
|
-
const
|
|
14645
|
+
const tipColor = componentColorTokens.tooltip.default;
|
|
14646
|
+
const bg = (0, import_color13.resolveColorTokenValue)(tipColor.background);
|
|
14647
|
+
const fg = (0, import_color13.resolveColorTokenValue)(tipColor.foreground);
|
|
14648
|
+
const borderCol = (0, import_color13.resolveColorTokenValue)(tipColor.border);
|
|
14465
14649
|
const clearTimer = () => {
|
|
14466
14650
|
if (showTimer.current != null) {
|
|
14467
14651
|
clearTimeout(showTimer.current);
|
|
@@ -14476,38 +14660,29 @@ function Tooltip({
|
|
|
14476
14660
|
clearTimer();
|
|
14477
14661
|
setOpen(false);
|
|
14478
14662
|
};
|
|
14479
|
-
const
|
|
14480
|
-
const
|
|
14481
|
-
const
|
|
14663
|
+
const floatingStyle = tooltipFloatingStyle(position, align);
|
|
14664
|
+
const beakWrapStyle = tooltipBeakWrapperStyle(position, align);
|
|
14665
|
+
const beakRot = tooltipBeakRotateDeg(position);
|
|
14482
14666
|
const describedBy = open ? tooltipId : void 0;
|
|
14483
14667
|
const mergeEl = (0, import_react55.getMergeableTriggerChild)(trigger);
|
|
14484
14668
|
let triggerNode;
|
|
14485
14669
|
if (mergeEl != null) {
|
|
14486
|
-
|
|
14487
|
-
|
|
14488
|
-
|
|
14489
|
-
|
|
14490
|
-
|
|
14491
|
-
|
|
14492
|
-
scheduleShow
|
|
14493
|
-
|
|
14494
|
-
|
|
14495
|
-
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
|
|
14500
|
-
scheduleShow();
|
|
14501
|
-
},
|
|
14502
|
-
onBlur: (e) => {
|
|
14503
|
-
el.props.onBlur?.(e);
|
|
14504
|
-
if (!e.currentTarget.contains(e.relatedTarget)) hide();
|
|
14505
|
-
},
|
|
14506
|
-
onKeyDown: (e) => {
|
|
14507
|
-
el.props.onKeyDown?.(e);
|
|
14508
|
-
if (e.key === "Escape") hide();
|
|
14670
|
+
triggerNode = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
14671
|
+
import_react55.Slot,
|
|
14672
|
+
{
|
|
14673
|
+
"aria-describedby": describedBy,
|
|
14674
|
+
onMouseEnter: scheduleShow,
|
|
14675
|
+
onMouseLeave: hide,
|
|
14676
|
+
onFocus: scheduleShow,
|
|
14677
|
+
onBlur: (event) => {
|
|
14678
|
+
if (!event.currentTarget.contains(event.relatedTarget)) hide();
|
|
14679
|
+
},
|
|
14680
|
+
onKeyDown: (event) => {
|
|
14681
|
+
if (event.key === "Escape") hide();
|
|
14682
|
+
},
|
|
14683
|
+
children: mergeEl
|
|
14509
14684
|
}
|
|
14510
|
-
|
|
14685
|
+
);
|
|
14511
14686
|
} else {
|
|
14512
14687
|
triggerNode = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
14513
14688
|
"span",
|
|
@@ -14528,26 +14703,59 @@ function Tooltip({
|
|
|
14528
14703
|
}
|
|
14529
14704
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { "data-refineui": "tooltip", className: (0, import_clsx105.clsx)(tooltipStyles.root, className), ...props, children: [
|
|
14530
14705
|
triggerNode,
|
|
14531
|
-
open && /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
14532
|
-
|
|
14533
|
-
|
|
14534
|
-
|
|
14535
|
-
|
|
14536
|
-
|
|
14537
|
-
|
|
14538
|
-
|
|
14539
|
-
|
|
14540
|
-
|
|
14541
|
-
|
|
14542
|
-
|
|
14543
|
-
|
|
14544
|
-
|
|
14545
|
-
|
|
14546
|
-
|
|
14547
|
-
|
|
14548
|
-
|
|
14549
|
-
|
|
14550
|
-
|
|
14706
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: tooltipStyles.floating, style: floatingStyle, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: tooltipStyles.panelWrap, children: [
|
|
14707
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
14708
|
+
"div",
|
|
14709
|
+
{
|
|
14710
|
+
className: tooltipStyles.beakWrap,
|
|
14711
|
+
style: { ...beakWrapStyle, width: TOOLTIP_BEAK_W, height: TOOLTIP_BEAK_H },
|
|
14712
|
+
"aria-hidden": true,
|
|
14713
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
14714
|
+
"div",
|
|
14715
|
+
{
|
|
14716
|
+
style: {
|
|
14717
|
+
width: TOOLTIP_BEAK_W,
|
|
14718
|
+
height: TOOLTIP_BEAK_H,
|
|
14719
|
+
transform: `rotate(${beakRot}deg)`,
|
|
14720
|
+
transformOrigin: "center center"
|
|
14721
|
+
},
|
|
14722
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
14723
|
+
"svg",
|
|
14724
|
+
{
|
|
14725
|
+
width: TOOLTIP_BEAK_W,
|
|
14726
|
+
height: TOOLTIP_BEAK_H,
|
|
14727
|
+
viewBox: "0 0 16 8",
|
|
14728
|
+
fill: "none",
|
|
14729
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14730
|
+
style: { display: "block" },
|
|
14731
|
+
children: [
|
|
14732
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("polygon", { points: "8,0 0,8 16,8", fill: borderCol }),
|
|
14733
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("polygon", { points: "8,2 2,8 14,8", fill: bg })
|
|
14734
|
+
]
|
|
14735
|
+
}
|
|
14736
|
+
)
|
|
14737
|
+
}
|
|
14738
|
+
)
|
|
14739
|
+
}
|
|
14740
|
+
),
|
|
14741
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
14742
|
+
"div",
|
|
14743
|
+
{
|
|
14744
|
+
id: tooltipId,
|
|
14745
|
+
role: "tooltip",
|
|
14746
|
+
"data-refineui": "tooltip-panel",
|
|
14747
|
+
"data-position": position,
|
|
14748
|
+
"data-align": align,
|
|
14749
|
+
className: tooltipStyles.panel,
|
|
14750
|
+
style: {
|
|
14751
|
+
backgroundColor: bg,
|
|
14752
|
+
color: fg,
|
|
14753
|
+
borderColor: borderCol
|
|
14754
|
+
},
|
|
14755
|
+
children: content
|
|
14756
|
+
}
|
|
14757
|
+
)
|
|
14758
|
+
] }) })
|
|
14551
14759
|
] });
|
|
14552
14760
|
}
|
|
14553
14761
|
|
|
@@ -14555,7 +14763,7 @@ function Tooltip({
|
|
|
14555
14763
|
var import_clsx107 = require("clsx");
|
|
14556
14764
|
var import_react56 = require("react");
|
|
14557
14765
|
var import_tokens35 = require("@refineui/tokens");
|
|
14558
|
-
var
|
|
14766
|
+
var import_color14 = require("@refineui/utilities/color");
|
|
14559
14767
|
|
|
14560
14768
|
// src/components/Chart/style.ts
|
|
14561
14769
|
var import_clsx106 = require("clsx");
|
|
@@ -14788,19 +14996,19 @@ function useChartContext(component) {
|
|
|
14788
14996
|
return value;
|
|
14789
14997
|
}
|
|
14790
14998
|
function seriesColorToken(color) {
|
|
14791
|
-
return (0,
|
|
14999
|
+
return (0, import_color14.resolveColorTokenValue)(componentColorTokens.chart.series[color]);
|
|
14792
15000
|
}
|
|
14793
15001
|
function seriesSubtleToken(color) {
|
|
14794
|
-
return (0,
|
|
15002
|
+
return (0, import_color14.resolveColorTokenValue)(componentColorTokens.chart.seriesSubtle[color]);
|
|
14795
15003
|
}
|
|
14796
15004
|
function gridStroke() {
|
|
14797
|
-
return (0,
|
|
15005
|
+
return (0, import_color14.resolveColorTokenValue)(componentColorTokens.chart.grid);
|
|
14798
15006
|
}
|
|
14799
15007
|
function gridBaselineStroke() {
|
|
14800
|
-
return (0,
|
|
15008
|
+
return (0, import_color14.resolveColorTokenValue)(componentColorTokens.chart.gridBaseline);
|
|
14801
15009
|
}
|
|
14802
15010
|
function pointStrokeColor() {
|
|
14803
|
-
return (0,
|
|
15011
|
+
return (0, import_color14.resolveColorTokenValue)(componentColorTokens.chart.pointStroke);
|
|
14804
15012
|
}
|
|
14805
15013
|
function resolveScale(values, max, fallbackMax = 100) {
|
|
14806
15014
|
if (max !== void 0 && max > 0) return max;
|
|
@@ -15249,6 +15457,527 @@ function ChartLegendItem({
|
|
|
15249
15457
|
}
|
|
15250
15458
|
);
|
|
15251
15459
|
}
|
|
15460
|
+
|
|
15461
|
+
// src/components/Slot/Slot.tsx
|
|
15462
|
+
var import_react57 = require("@refineui/utilities/react");
|
|
15463
|
+
|
|
15464
|
+
// src/components/Collapsible/Collapsible.tsx
|
|
15465
|
+
var import_react58 = require("react");
|
|
15466
|
+
var import_clsx108 = require("clsx");
|
|
15467
|
+
var import_tokens36 = require("@refineui/tokens");
|
|
15468
|
+
var import_react59 = require("@refineui/utilities/react");
|
|
15469
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
15470
|
+
var CollapsibleContext = (0, import_react58.createContext)(null);
|
|
15471
|
+
function useCollapsible() {
|
|
15472
|
+
const value = (0, import_react58.useContext)(CollapsibleContext);
|
|
15473
|
+
if (!value) throw new Error("Collapsible parts must be used inside Collapsible.Root");
|
|
15474
|
+
return value;
|
|
15475
|
+
}
|
|
15476
|
+
function usePrefersReducedMotion3() {
|
|
15477
|
+
const [reduce, setReduce] = (0, import_react58.useState)(false);
|
|
15478
|
+
(0, import_react58.useEffect)(() => {
|
|
15479
|
+
const query = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
15480
|
+
const sync = () => setReduce(query.matches);
|
|
15481
|
+
sync();
|
|
15482
|
+
query.addEventListener("change", sync);
|
|
15483
|
+
return () => query.removeEventListener("change", sync);
|
|
15484
|
+
}, []);
|
|
15485
|
+
return reduce;
|
|
15486
|
+
}
|
|
15487
|
+
var CollapsibleRoot = (0, import_react58.forwardRef)(function CollapsibleRoot2({ open: openProp, defaultOpen = false, onOpenChange, asChild = false, className, children, ...props }, ref) {
|
|
15488
|
+
const [uncontrolled, setUncontrolled] = (0, import_react58.useState)(defaultOpen);
|
|
15489
|
+
const open = openProp ?? uncontrolled;
|
|
15490
|
+
const openRef = (0, import_react58.useRef)(open);
|
|
15491
|
+
openRef.current = open;
|
|
15492
|
+
const reactId = (0, import_react58.useId)();
|
|
15493
|
+
const reduceMotion = usePrefersReducedMotion3();
|
|
15494
|
+
const toggle = () => {
|
|
15495
|
+
const next = !openRef.current;
|
|
15496
|
+
if (openProp === void 0) setUncontrolled(next);
|
|
15497
|
+
onOpenChange?.(next);
|
|
15498
|
+
};
|
|
15499
|
+
const shared = {
|
|
15500
|
+
...props,
|
|
15501
|
+
ref,
|
|
15502
|
+
"data-state": open ? "open" : "closed",
|
|
15503
|
+
"data-refineui": "collapsible",
|
|
15504
|
+
className
|
|
15505
|
+
};
|
|
15506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
15507
|
+
CollapsibleContext.Provider,
|
|
15508
|
+
{
|
|
15509
|
+
value: {
|
|
15510
|
+
open,
|
|
15511
|
+
toggle,
|
|
15512
|
+
contentId: `${reactId}-content`,
|
|
15513
|
+
triggerId: `${reactId}-trigger`,
|
|
15514
|
+
reduceMotion
|
|
15515
|
+
},
|
|
15516
|
+
children: asChild ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react59.Slot, { ...shared, children }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { ...shared, children })
|
|
15517
|
+
}
|
|
15518
|
+
);
|
|
15519
|
+
});
|
|
15520
|
+
var CollapsibleTrigger = (0, import_react58.forwardRef)(function CollapsibleTrigger2({ asChild = false, onClick, className, children, ...props }, ref) {
|
|
15521
|
+
const { open, toggle, contentId, triggerId } = useCollapsible();
|
|
15522
|
+
const shared = {
|
|
15523
|
+
...props,
|
|
15524
|
+
ref,
|
|
15525
|
+
id: triggerId,
|
|
15526
|
+
"aria-expanded": open,
|
|
15527
|
+
"aria-controls": contentId,
|
|
15528
|
+
"data-state": open ? "open" : "closed",
|
|
15529
|
+
"data-refineui": "collapsible-trigger",
|
|
15530
|
+
className,
|
|
15531
|
+
onClick: (event) => {
|
|
15532
|
+
onClick?.(event);
|
|
15533
|
+
if (!event.defaultPrevented) toggle();
|
|
15534
|
+
}
|
|
15535
|
+
};
|
|
15536
|
+
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react59.Slot, { ...shared, children });
|
|
15537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("button", { ...shared, type: "button", children });
|
|
15538
|
+
});
|
|
15539
|
+
var CollapsibleContent = (0, import_react58.forwardRef)(function CollapsibleContent2({ className, children, style, ...props }, ref) {
|
|
15540
|
+
const { open, contentId, triggerId, reduceMotion } = useCollapsible();
|
|
15541
|
+
const innerRef = (0, import_react58.useRef)(null);
|
|
15542
|
+
const [size, setSize] = (0, import_react58.useState)({ height: 0, width: 0 });
|
|
15543
|
+
(0, import_react58.useLayoutEffect)(() => {
|
|
15544
|
+
const node = innerRef.current;
|
|
15545
|
+
if (!node) return;
|
|
15546
|
+
const measure = () => {
|
|
15547
|
+
setSize({ height: node.scrollHeight, width: node.scrollWidth });
|
|
15548
|
+
};
|
|
15549
|
+
measure();
|
|
15550
|
+
const observer = new ResizeObserver(measure);
|
|
15551
|
+
observer.observe(node);
|
|
15552
|
+
return () => observer.disconnect();
|
|
15553
|
+
}, [children, open]);
|
|
15554
|
+
const clipStyle = {
|
|
15555
|
+
["--refineui-collapsible-content-height"]: `${size.height}px`,
|
|
15556
|
+
["--refineui-collapsible-content-width"]: `${size.width}px`,
|
|
15557
|
+
height: open ? size.height : 0,
|
|
15558
|
+
overflow: "hidden",
|
|
15559
|
+
transition: reduceMotion ? void 0 : `height ${import_tokens36.semanticInteraction.duration.panel} ${import_tokens36.semanticInteraction.easing.panel}`
|
|
15560
|
+
};
|
|
15561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
15562
|
+
"div",
|
|
15563
|
+
{
|
|
15564
|
+
...props,
|
|
15565
|
+
ref,
|
|
15566
|
+
id: contentId,
|
|
15567
|
+
role: "region",
|
|
15568
|
+
"aria-labelledby": triggerId,
|
|
15569
|
+
"aria-hidden": !open,
|
|
15570
|
+
"data-state": open ? "open" : "closed",
|
|
15571
|
+
"data-refineui": "collapsible-content",
|
|
15572
|
+
style: clipStyle,
|
|
15573
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { ref: innerRef, className: (0, import_clsx108.clsx)(className), style, children })
|
|
15574
|
+
}
|
|
15575
|
+
);
|
|
15576
|
+
});
|
|
15577
|
+
var Collapsible = Object.assign(CollapsibleRoot, {
|
|
15578
|
+
Root: CollapsibleRoot,
|
|
15579
|
+
Trigger: CollapsibleTrigger,
|
|
15580
|
+
Content: CollapsibleContent
|
|
15581
|
+
});
|
|
15582
|
+
|
|
15583
|
+
// src/components/ContextMenu/ContextMenu.tsx
|
|
15584
|
+
var import_react60 = require("react");
|
|
15585
|
+
var import_react_dom7 = require("react-dom");
|
|
15586
|
+
var import_clsx109 = require("clsx");
|
|
15587
|
+
var import_tokens37 = require("@refineui/tokens");
|
|
15588
|
+
var import_animation9 = require("@refineui/utilities/animation");
|
|
15589
|
+
var import_react61 = require("@refineui/utilities/react");
|
|
15590
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
15591
|
+
var MENU_ATTR = "data-refineui-context-menu";
|
|
15592
|
+
var CLOSE_MS = (0, import_animation9.motionMsToNumber)(import_tokens37.semanticInteraction.duration.normal);
|
|
15593
|
+
var MenuContext2 = (0, import_react60.createContext)(null);
|
|
15594
|
+
var SubContext = (0, import_react60.createContext)(null);
|
|
15595
|
+
function useMenu() {
|
|
15596
|
+
const value = (0, import_react60.useContext)(MenuContext2);
|
|
15597
|
+
if (!value) throw new Error("Context menu parts must be used inside ContextMenu.Root");
|
|
15598
|
+
return value;
|
|
15599
|
+
}
|
|
15600
|
+
function placeInView(element, x, y) {
|
|
15601
|
+
const width = element.offsetWidth;
|
|
15602
|
+
const height = element.offsetHeight;
|
|
15603
|
+
const pad = 4;
|
|
15604
|
+
let left = x;
|
|
15605
|
+
let top = y;
|
|
15606
|
+
if (left + width > window.innerWidth - pad) left = Math.max(pad, window.innerWidth - width - pad);
|
|
15607
|
+
if (top + height > window.innerHeight - pad) top = Math.max(pad, window.innerHeight - height - pad);
|
|
15608
|
+
element.style.left = `${left}px`;
|
|
15609
|
+
element.style.top = `${top}px`;
|
|
15610
|
+
}
|
|
15611
|
+
function ContextMenuRoot({ modal = true, onOpenChange, children }) {
|
|
15612
|
+
void modal;
|
|
15613
|
+
const [open, setOpen] = (0, import_react60.useState)(false);
|
|
15614
|
+
const [point, setPoint] = (0, import_react60.useState)({ x: 0, y: 0 });
|
|
15615
|
+
const openRef = (0, import_react60.useRef)(false);
|
|
15616
|
+
const onOpenChangeRef = (0, import_react60.useRef)(onOpenChange);
|
|
15617
|
+
openRef.current = open;
|
|
15618
|
+
onOpenChangeRef.current = onOpenChange;
|
|
15619
|
+
const close = (0, import_react60.useCallback)(() => {
|
|
15620
|
+
if (!openRef.current) return;
|
|
15621
|
+
openRef.current = false;
|
|
15622
|
+
setOpen(false);
|
|
15623
|
+
onOpenChangeRef.current?.(false);
|
|
15624
|
+
}, []);
|
|
15625
|
+
const openAt = (0, import_react60.useCallback)((x, y) => {
|
|
15626
|
+
setPoint({ x, y });
|
|
15627
|
+
const wasOpen = openRef.current;
|
|
15628
|
+
openRef.current = true;
|
|
15629
|
+
setOpen(true);
|
|
15630
|
+
if (!wasOpen) onOpenChangeRef.current?.(true);
|
|
15631
|
+
}, []);
|
|
15632
|
+
const value = (0, import_react60.useMemo)(() => ({ open, point, openAt, close }), [open, point, openAt, close]);
|
|
15633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(MenuContext2.Provider, { value, children });
|
|
15634
|
+
}
|
|
15635
|
+
var ContextMenuTrigger = (0, import_react60.forwardRef)(function ContextMenuTrigger2({ asChild = false, onContextMenu, children, ...props }, ref) {
|
|
15636
|
+
const { openAt } = useMenu();
|
|
15637
|
+
const shared = {
|
|
15638
|
+
...props,
|
|
15639
|
+
ref,
|
|
15640
|
+
[MENU_ATTR]: "",
|
|
15641
|
+
onContextMenu: (event) => {
|
|
15642
|
+
onContextMenu?.(event);
|
|
15643
|
+
if (event.defaultPrevented) return;
|
|
15644
|
+
event.preventDefault();
|
|
15645
|
+
openAt(event.clientX, event.clientY);
|
|
15646
|
+
}
|
|
15647
|
+
};
|
|
15648
|
+
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react61.Slot, { ...shared, children });
|
|
15649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { ...shared, className: (0, import_clsx109.clsx)(menuStyles.triggerFallback, props.className), children });
|
|
15650
|
+
});
|
|
15651
|
+
function ContextMenuPortal({ children }) {
|
|
15652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_jsx_runtime79.Fragment, { children });
|
|
15653
|
+
}
|
|
15654
|
+
var ContextMenuContent = (0, import_react60.forwardRef)(function ContextMenuContent2({ className, style, onPointerDown, children, ...props }, ref) {
|
|
15655
|
+
const { open, point, close } = useMenu();
|
|
15656
|
+
const localRef = (0, import_react60.useRef)(null);
|
|
15657
|
+
const [shouldRender, setShouldRender] = (0, import_react60.useState)(open);
|
|
15658
|
+
const [isClosing, setIsClosing] = (0, import_react60.useState)(false);
|
|
15659
|
+
(0, import_react60.useEffect)(() => {
|
|
15660
|
+
if (open) {
|
|
15661
|
+
setShouldRender(true);
|
|
15662
|
+
setIsClosing(false);
|
|
15663
|
+
return;
|
|
15664
|
+
}
|
|
15665
|
+
if (!shouldRender) return;
|
|
15666
|
+
setIsClosing(true);
|
|
15667
|
+
const timeout = window.setTimeout(() => {
|
|
15668
|
+
setShouldRender(false);
|
|
15669
|
+
setIsClosing(false);
|
|
15670
|
+
}, CLOSE_MS);
|
|
15671
|
+
return () => window.clearTimeout(timeout);
|
|
15672
|
+
}, [open, shouldRender]);
|
|
15673
|
+
(0, import_react60.useLayoutEffect)(() => {
|
|
15674
|
+
if (!shouldRender || !localRef.current) return;
|
|
15675
|
+
placeInView(localRef.current, point.x, point.y);
|
|
15676
|
+
}, [shouldRender, point.x, point.y]);
|
|
15677
|
+
(0, import_react60.useEffect)(() => {
|
|
15678
|
+
if (!open) return;
|
|
15679
|
+
const onKey = (event) => {
|
|
15680
|
+
if (event.key === "Escape") close();
|
|
15681
|
+
};
|
|
15682
|
+
const onPointer = (event) => {
|
|
15683
|
+
const target = event.target;
|
|
15684
|
+
if (target instanceof Element && target.closest(`[${MENU_ATTR}]`)) return;
|
|
15685
|
+
close();
|
|
15686
|
+
};
|
|
15687
|
+
document.addEventListener("keydown", onKey);
|
|
15688
|
+
document.addEventListener("pointerdown", onPointer);
|
|
15689
|
+
return () => {
|
|
15690
|
+
document.removeEventListener("keydown", onKey);
|
|
15691
|
+
document.removeEventListener("pointerdown", onPointer);
|
|
15692
|
+
};
|
|
15693
|
+
}, [open, close]);
|
|
15694
|
+
if (!shouldRender || typeof document === "undefined") return null;
|
|
15695
|
+
return (0, import_react_dom7.createPortal)(
|
|
15696
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15697
|
+
"div",
|
|
15698
|
+
{
|
|
15699
|
+
...props,
|
|
15700
|
+
ref: (node) => {
|
|
15701
|
+
localRef.current = node;
|
|
15702
|
+
if (typeof ref === "function") ref(node);
|
|
15703
|
+
else if (ref) ref.current = node;
|
|
15704
|
+
},
|
|
15705
|
+
"data-refineui": "menu-popover",
|
|
15706
|
+
"data-state": isClosing ? "closed" : "open",
|
|
15707
|
+
...{ [MENU_ATTR]: "" },
|
|
15708
|
+
className: menuStyles.popover,
|
|
15709
|
+
style: {
|
|
15710
|
+
position: "fixed",
|
|
15711
|
+
top: point.y,
|
|
15712
|
+
left: point.x,
|
|
15713
|
+
width: import_tokens37.componentSizes.menuPanelWidth,
|
|
15714
|
+
minWidth: import_tokens37.componentSizes.menuPanelWidth,
|
|
15715
|
+
zIndex: 9999,
|
|
15716
|
+
...style
|
|
15717
|
+
},
|
|
15718
|
+
onPointerDown: (event) => {
|
|
15719
|
+
event.preventDefault();
|
|
15720
|
+
onPointerDown?.(event);
|
|
15721
|
+
},
|
|
15722
|
+
onContextMenu: (event) => event.preventDefault(),
|
|
15723
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { role: "menu", "data-refineui": "menu", className: (0, import_clsx109.clsx)(menuStyles.list, className), children })
|
|
15724
|
+
}
|
|
15725
|
+
),
|
|
15726
|
+
document.body
|
|
15727
|
+
);
|
|
15728
|
+
});
|
|
15729
|
+
function runSelect(onSelect, close, disabled) {
|
|
15730
|
+
if (disabled) return;
|
|
15731
|
+
const selectEvent = {
|
|
15732
|
+
defaultPrevented: false,
|
|
15733
|
+
preventDefault() {
|
|
15734
|
+
selectEvent.defaultPrevented = true;
|
|
15735
|
+
}
|
|
15736
|
+
};
|
|
15737
|
+
onSelect?.(selectEvent);
|
|
15738
|
+
if (!selectEvent.defaultPrevented) close();
|
|
15739
|
+
}
|
|
15740
|
+
var ContextMenuItem = (0, import_react60.forwardRef)(function ContextMenuItem2({ disabled = false, description, shortcut, startIcon, endIcon, state = "default", onSelect, className, onClick, onKeyDown, children, ...props }, ref) {
|
|
15741
|
+
const { close } = useMenu();
|
|
15742
|
+
const isDisabled = disabled || state === "disabled";
|
|
15743
|
+
const slotted = startIcon != null || description != null || shortcut != null || endIcon != null;
|
|
15744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15745
|
+
"button",
|
|
15746
|
+
{
|
|
15747
|
+
ref,
|
|
15748
|
+
type: "button",
|
|
15749
|
+
role: "menuitem",
|
|
15750
|
+
disabled: isDisabled,
|
|
15751
|
+
"aria-disabled": isDisabled || void 0,
|
|
15752
|
+
"data-refineui": "menu-item",
|
|
15753
|
+
"data-state": isDisabled ? "disabled" : state,
|
|
15754
|
+
...{ [MENU_ATTR]: "" },
|
|
15755
|
+
className: (0, import_clsx109.clsx)(menuStyles.itemBase, isDisabled ? menuStyles.itemDisabled : menuStyles.itemEnabled, className),
|
|
15756
|
+
...props,
|
|
15757
|
+
onClick: (event) => {
|
|
15758
|
+
onClick?.(event);
|
|
15759
|
+
if (event.defaultPrevented) return;
|
|
15760
|
+
runSelect(onSelect, close, isDisabled);
|
|
15761
|
+
},
|
|
15762
|
+
onKeyDown: (event) => {
|
|
15763
|
+
onKeyDown?.(event);
|
|
15764
|
+
if (event.defaultPrevented) return;
|
|
15765
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
15766
|
+
event.preventDefault();
|
|
15767
|
+
runSelect(onSelect, close, isDisabled);
|
|
15768
|
+
}
|
|
15769
|
+
},
|
|
15770
|
+
children: slotted ? /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("span", { className: menuStyles.row, children: [
|
|
15771
|
+
startIcon ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15772
|
+
"span",
|
|
15773
|
+
{
|
|
15774
|
+
className: menuStyles.iconWrap,
|
|
15775
|
+
style: { width: import_tokens37.iconSizes.small, minWidth: import_tokens37.iconSizes.small, height: import_tokens37.iconSizes.small },
|
|
15776
|
+
children: startIcon
|
|
15777
|
+
}
|
|
15778
|
+
) : null,
|
|
15779
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("span", { className: menuStyles.textCol, children: [
|
|
15780
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: menuStyles.title, children }),
|
|
15781
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: (0, import_clsx109.clsx)(menuStyles.description, isDisabled ? menuStyles.descriptionDisabled : menuStyles.descriptionEnabled), children: description }) : null
|
|
15782
|
+
] }),
|
|
15783
|
+
(shortcut || endIcon) && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("span", { className: menuStyles.rightWrap, children: [
|
|
15784
|
+
shortcut ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: menuStyles.shortcut, children: shortcut }) : null,
|
|
15785
|
+
endIcon ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15786
|
+
"span",
|
|
15787
|
+
{
|
|
15788
|
+
className: menuStyles.iconWrap,
|
|
15789
|
+
style: { width: import_tokens37.iconSizes.small, minWidth: import_tokens37.iconSizes.small, height: import_tokens37.iconSizes.small },
|
|
15790
|
+
children: endIcon
|
|
15791
|
+
}
|
|
15792
|
+
) : null
|
|
15793
|
+
] })
|
|
15794
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: menuStyles.row, children })
|
|
15795
|
+
}
|
|
15796
|
+
);
|
|
15797
|
+
});
|
|
15798
|
+
var ContextMenuSeparator = (0, import_react60.forwardRef)(
|
|
15799
|
+
function ContextMenuSeparator2({ className, ...props }, ref) {
|
|
15800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15801
|
+
"div",
|
|
15802
|
+
{
|
|
15803
|
+
ref,
|
|
15804
|
+
role: "separator",
|
|
15805
|
+
"aria-orientation": "horizontal",
|
|
15806
|
+
"data-refineui": "menu-divider",
|
|
15807
|
+
...{ [MENU_ATTR]: "" },
|
|
15808
|
+
className: (0, import_clsx109.clsx)(menuStyles.dividerWrap, className),
|
|
15809
|
+
...props,
|
|
15810
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: menuStyles.dividerLine })
|
|
15811
|
+
}
|
|
15812
|
+
);
|
|
15813
|
+
}
|
|
15814
|
+
);
|
|
15815
|
+
function ContextMenuSection({ className, children, ...props }) {
|
|
15816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { "data-refineui": "menu-section", className: (0, import_clsx109.clsx)(menuStyles.section, className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: menuStyles.sectionText, children }) });
|
|
15817
|
+
}
|
|
15818
|
+
function ContextMenuSub({ children }) {
|
|
15819
|
+
const [open, setOpen] = (0, import_react60.useState)(false);
|
|
15820
|
+
const triggerRef = (0, import_react60.useRef)(null);
|
|
15821
|
+
const timer = (0, import_react60.useRef)(null);
|
|
15822
|
+
const clear = () => {
|
|
15823
|
+
if (timer.current != null) window.clearTimeout(timer.current);
|
|
15824
|
+
timer.current = null;
|
|
15825
|
+
};
|
|
15826
|
+
(0, import_react60.useEffect)(() => clear, []);
|
|
15827
|
+
const value = (0, import_react60.useMemo)(
|
|
15828
|
+
() => ({
|
|
15829
|
+
open,
|
|
15830
|
+
triggerRef,
|
|
15831
|
+
show: () => {
|
|
15832
|
+
clear();
|
|
15833
|
+
setOpen(true);
|
|
15834
|
+
},
|
|
15835
|
+
hideSoon: () => {
|
|
15836
|
+
clear();
|
|
15837
|
+
timer.current = window.setTimeout(() => setOpen(false), 150);
|
|
15838
|
+
}
|
|
15839
|
+
}),
|
|
15840
|
+
[open]
|
|
15841
|
+
);
|
|
15842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(SubContext.Provider, { value, children });
|
|
15843
|
+
}
|
|
15844
|
+
function useSub2() {
|
|
15845
|
+
const value = (0, import_react60.useContext)(SubContext);
|
|
15846
|
+
if (!value) throw new Error("ContextMenu.SubTrigger must be used inside ContextMenu.Sub");
|
|
15847
|
+
return value;
|
|
15848
|
+
}
|
|
15849
|
+
var ContextMenuSubTrigger = (0, import_react60.forwardRef)(
|
|
15850
|
+
function ContextMenuSubTrigger2({ asChild = false, description, startIcon, onMouseEnter, onMouseLeave, onClick, className, children, ...props }, ref) {
|
|
15851
|
+
const sub = useSub2();
|
|
15852
|
+
const shared = {
|
|
15853
|
+
...props,
|
|
15854
|
+
type: "button",
|
|
15855
|
+
role: "menuitem",
|
|
15856
|
+
"aria-haspopup": "menu",
|
|
15857
|
+
"aria-expanded": sub.open,
|
|
15858
|
+
"data-state": sub.open ? "active" : "default",
|
|
15859
|
+
"data-refineui": "menu-item",
|
|
15860
|
+
[MENU_ATTR]: "",
|
|
15861
|
+
className: (0, import_clsx109.clsx)(
|
|
15862
|
+
menuStyles.itemBase,
|
|
15863
|
+
menuStyles.itemEnabled,
|
|
15864
|
+
sub.open && "bg-refineui-alias-background-primary-hover",
|
|
15865
|
+
className
|
|
15866
|
+
),
|
|
15867
|
+
ref: (node) => {
|
|
15868
|
+
sub.triggerRef.current = node;
|
|
15869
|
+
if (typeof ref === "function") ref(node);
|
|
15870
|
+
else if (ref) ref.current = node;
|
|
15871
|
+
},
|
|
15872
|
+
onMouseEnter: (event) => {
|
|
15873
|
+
onMouseEnter?.(event);
|
|
15874
|
+
sub.show();
|
|
15875
|
+
},
|
|
15876
|
+
onMouseLeave: (event) => {
|
|
15877
|
+
onMouseLeave?.(event);
|
|
15878
|
+
sub.hideSoon();
|
|
15879
|
+
},
|
|
15880
|
+
onClick: (event) => {
|
|
15881
|
+
onClick?.(event);
|
|
15882
|
+
if (!event.defaultPrevented) sub.show();
|
|
15883
|
+
}
|
|
15884
|
+
};
|
|
15885
|
+
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react61.Slot, { ...shared, children });
|
|
15886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("button", { ...shared, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("span", { className: menuStyles.row, children: [
|
|
15887
|
+
startIcon ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15888
|
+
"span",
|
|
15889
|
+
{
|
|
15890
|
+
className: menuStyles.iconWrap,
|
|
15891
|
+
style: { width: import_tokens37.iconSizes.small, minWidth: import_tokens37.iconSizes.small, height: import_tokens37.iconSizes.small },
|
|
15892
|
+
children: startIcon
|
|
15893
|
+
}
|
|
15894
|
+
) : null,
|
|
15895
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("span", { className: menuStyles.textCol, children: [
|
|
15896
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: menuStyles.title, children }),
|
|
15897
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: (0, import_clsx109.clsx)(menuStyles.description, menuStyles.descriptionEnabled), children: description }) : null
|
|
15898
|
+
] }),
|
|
15899
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: menuStyles.rightWrap, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15900
|
+
"span",
|
|
15901
|
+
{
|
|
15902
|
+
className: menuStyles.iconWrap,
|
|
15903
|
+
style: { width: import_tokens37.iconSizes.small, minWidth: import_tokens37.iconSizes.small, height: import_tokens37.iconSizes.small },
|
|
15904
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(WebIcon, { name: "chevron-right", size: import_tokens37.iconSizes.small, color: "currentColor", "aria-hidden": true })
|
|
15905
|
+
}
|
|
15906
|
+
) })
|
|
15907
|
+
] }) });
|
|
15908
|
+
}
|
|
15909
|
+
);
|
|
15910
|
+
var ContextMenuSubContent = (0, import_react60.forwardRef)(
|
|
15911
|
+
function ContextMenuSubContent2({ className, style, onPointerDown, onMouseEnter, onMouseLeave, ...props }, ref) {
|
|
15912
|
+
const sub = useSub2();
|
|
15913
|
+
const localRef = (0, import_react60.useRef)(null);
|
|
15914
|
+
const [side, setSide] = (0, import_react60.useState)("right");
|
|
15915
|
+
(0, import_react60.useLayoutEffect)(() => {
|
|
15916
|
+
const trigger = sub.triggerRef.current;
|
|
15917
|
+
const element = localRef.current;
|
|
15918
|
+
if (!sub.open || !trigger || !element) return;
|
|
15919
|
+
const rect = trigger.getBoundingClientRect();
|
|
15920
|
+
const width = element.offsetWidth;
|
|
15921
|
+
const pad = 4;
|
|
15922
|
+
let left = rect.right;
|
|
15923
|
+
let nextSide = "right";
|
|
15924
|
+
if (left + width > window.innerWidth - pad) {
|
|
15925
|
+
left = Math.max(pad, rect.left - width);
|
|
15926
|
+
nextSide = "left";
|
|
15927
|
+
}
|
|
15928
|
+
setSide(nextSide);
|
|
15929
|
+
placeInView(element, left, rect.top);
|
|
15930
|
+
}, [sub.open, sub.triggerRef]);
|
|
15931
|
+
if (!sub.open || typeof document === "undefined") return null;
|
|
15932
|
+
return (0, import_react_dom7.createPortal)(
|
|
15933
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
15934
|
+
"div",
|
|
15935
|
+
{
|
|
15936
|
+
...props,
|
|
15937
|
+
ref: (node) => {
|
|
15938
|
+
localRef.current = node;
|
|
15939
|
+
if (typeof ref === "function") ref(node);
|
|
15940
|
+
else if (ref) ref.current = node;
|
|
15941
|
+
},
|
|
15942
|
+
role: "menu",
|
|
15943
|
+
"data-refineui": "menu",
|
|
15944
|
+
"data-submenu": "true",
|
|
15945
|
+
"data-state": "open",
|
|
15946
|
+
"data-side": side,
|
|
15947
|
+
...{ [MENU_ATTR]: "" },
|
|
15948
|
+
className: (0, import_clsx109.clsx)(menuStyles.subPanel, className),
|
|
15949
|
+
style: { position: "fixed", zIndex: 1e4, ...style },
|
|
15950
|
+
onPointerDown: (event) => {
|
|
15951
|
+
event.preventDefault();
|
|
15952
|
+
onPointerDown?.(event);
|
|
15953
|
+
},
|
|
15954
|
+
onMouseEnter: (event) => {
|
|
15955
|
+
onMouseEnter?.(event);
|
|
15956
|
+
sub.show();
|
|
15957
|
+
},
|
|
15958
|
+
onMouseLeave: (event) => {
|
|
15959
|
+
onMouseLeave?.(event);
|
|
15960
|
+
sub.hideSoon();
|
|
15961
|
+
},
|
|
15962
|
+
onContextMenu: (event) => event.preventDefault()
|
|
15963
|
+
}
|
|
15964
|
+
),
|
|
15965
|
+
document.body
|
|
15966
|
+
);
|
|
15967
|
+
}
|
|
15968
|
+
);
|
|
15969
|
+
var ContextMenu = Object.assign(ContextMenuRoot, {
|
|
15970
|
+
Root: ContextMenuRoot,
|
|
15971
|
+
Trigger: ContextMenuTrigger,
|
|
15972
|
+
Portal: ContextMenuPortal,
|
|
15973
|
+
Content: ContextMenuContent,
|
|
15974
|
+
Item: ContextMenuItem,
|
|
15975
|
+
Section: ContextMenuSection,
|
|
15976
|
+
Separator: ContextMenuSeparator,
|
|
15977
|
+
Sub: ContextMenuSub,
|
|
15978
|
+
SubTrigger: ContextMenuSubTrigger,
|
|
15979
|
+
SubContent: ContextMenuSubContent
|
|
15980
|
+
});
|
|
15252
15981
|
// Annotate the CommonJS export names for ESM import in node:
|
|
15253
15982
|
0 && (module.exports = {
|
|
15254
15983
|
Accordion,
|
|
@@ -15319,6 +16048,10 @@ function ChartLegendItem({
|
|
|
15319
16048
|
ChartYAxisLabels,
|
|
15320
16049
|
Checkbox,
|
|
15321
16050
|
Chip,
|
|
16051
|
+
Collapsible,
|
|
16052
|
+
CollapsibleContent,
|
|
16053
|
+
CollapsibleRoot,
|
|
16054
|
+
CollapsibleTrigger,
|
|
15322
16055
|
Command,
|
|
15323
16056
|
CommandDialog,
|
|
15324
16057
|
CommandEmpty,
|
|
@@ -15330,6 +16063,17 @@ function ChartLegendItem({
|
|
|
15330
16063
|
CommandSeparator,
|
|
15331
16064
|
CommandShortcut,
|
|
15332
16065
|
Container,
|
|
16066
|
+
ContextMenu,
|
|
16067
|
+
ContextMenuContent,
|
|
16068
|
+
ContextMenuItem,
|
|
16069
|
+
ContextMenuPortal,
|
|
16070
|
+
ContextMenuRoot,
|
|
16071
|
+
ContextMenuSection,
|
|
16072
|
+
ContextMenuSeparator,
|
|
16073
|
+
ContextMenuSub,
|
|
16074
|
+
ContextMenuSubContent,
|
|
16075
|
+
ContextMenuSubTrigger,
|
|
16076
|
+
ContextMenuTrigger,
|
|
15333
16077
|
Dialog,
|
|
15334
16078
|
DialogClose,
|
|
15335
16079
|
DialogContent,
|
|
@@ -15472,6 +16216,7 @@ function ChartLegendItem({
|
|
|
15472
16216
|
SidebarPeekPin,
|
|
15473
16217
|
Skeleton,
|
|
15474
16218
|
Slider,
|
|
16219
|
+
Slot,
|
|
15475
16220
|
Spacer,
|
|
15476
16221
|
SpinButton,
|
|
15477
16222
|
Spinner,
|
|
@@ -15514,6 +16259,7 @@ function ChartLegendItem({
|
|
|
15514
16259
|
componentSizeFoundationKeys,
|
|
15515
16260
|
componentSizes,
|
|
15516
16261
|
componentTextClass,
|
|
16262
|
+
componentTokens,
|
|
15517
16263
|
componentTypographyTokens,
|
|
15518
16264
|
defaultCommandFilter,
|
|
15519
16265
|
dismissToast,
|