@refineui/react 0.1.2 → 0.2.1
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/authoring-manifest.cjs +29 -2
- package/dist/authoring-manifest.cjs.map +1 -1
- package/dist/authoring-manifest.js +29 -2
- package/dist/authoring-manifest.js.map +1 -1
- package/dist/index.cjs +697 -490
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -12
- package/dist/index.d.ts +50 -12
- package/dist/index.js +342 -135
- package/dist/index.js.map +1 -1
- package/dist/spec/authoring/components/command.json +15 -1
- package/dist/spec/authoring/components/search-field.json +13 -0
- package/dist/spec/authoring/manifest.json +29 -2
- package/dist/spec/components/command.json +8 -0
- package/dist/spec/components/search-field.json +5 -0
- package/dist/spec/contract-index.json +1 -1
- package/dist/spec/token-trace-v2.json +1 -1
- package/package.json +2 -2
- package/refineui.css +151 -11
- package/spec/authoring/components/command.json +15 -1
- package/spec/authoring/components/search-field.json +13 -0
- package/spec/authoring/manifest.json +29 -2
- package/spec/components/command.json +8 -0
- package/spec/components/search-field.json +5 -0
package/dist/index.cjs
CHANGED
|
@@ -209,7 +209,7 @@ __export(src_exports, {
|
|
|
209
209
|
ResizableHandle: () => ResizableHandle,
|
|
210
210
|
ResizablePanel: () => ResizablePanel,
|
|
211
211
|
ResizablePanelGroup: () => ResizablePanelGroup,
|
|
212
|
-
SEMANTIC_TEXT: () =>
|
|
212
|
+
SEMANTIC_TEXT: () => import_tokens39.SEMANTIC_TEXT,
|
|
213
213
|
ScrollArea: () => ScrollArea,
|
|
214
214
|
ScrollAreaScrollbar: () => ScrollAreaScrollbar,
|
|
215
215
|
ScrollAreaThumb: () => ScrollAreaThumb,
|
|
@@ -254,7 +254,7 @@ __export(src_exports, {
|
|
|
254
254
|
SidebarTrigger: () => SidebarTrigger,
|
|
255
255
|
Skeleton: () => Skeleton,
|
|
256
256
|
Slider: () => Slider,
|
|
257
|
-
Slot: () =>
|
|
257
|
+
Slot: () => import_react61.Slot,
|
|
258
258
|
Spacer: () => Spacer,
|
|
259
259
|
SpinButton: () => SpinButton,
|
|
260
260
|
Spinner: () => Spinner,
|
|
@@ -1103,7 +1103,12 @@ var componentTypographyTokens = {
|
|
|
1103
1103
|
/** Command palette — same scale as Menu (list / section / shortcut). */
|
|
1104
1104
|
command: {
|
|
1105
1105
|
group: role("captionLg"),
|
|
1106
|
-
|
|
1106
|
+
/** Row text follows the Command size, like Tree rows. */
|
|
1107
|
+
item: {
|
|
1108
|
+
sm: role("bodySm"),
|
|
1109
|
+
md: role("bodyMd"),
|
|
1110
|
+
lg: role("bodyLg")
|
|
1111
|
+
},
|
|
1107
1112
|
empty: role("bodyXs"),
|
|
1108
1113
|
shortcut: role("bodyXs"),
|
|
1109
1114
|
input: role("bodyMd")
|
|
@@ -1386,7 +1391,7 @@ function buildSemanticTextClassMap(map) {
|
|
|
1386
1391
|
}
|
|
1387
1392
|
|
|
1388
1393
|
// src/index.ts
|
|
1389
|
-
var
|
|
1394
|
+
var import_tokens39 = require("@refineui/tokens");
|
|
1390
1395
|
|
|
1391
1396
|
// src/componentSizes.ts
|
|
1392
1397
|
var import_tokens3 = require("@refineui/tokens");
|
|
@@ -1628,10 +1633,20 @@ var radius = {
|
|
|
1628
1633
|
md: "rounded-refineui-x-large",
|
|
1629
1634
|
lg: "rounded-refineui-xx-large"
|
|
1630
1635
|
};
|
|
1636
|
+
var paddingInline = {
|
|
1637
|
+
sm: "px-refineui-size-medium",
|
|
1638
|
+
md: "px-refineui-size-large",
|
|
1639
|
+
lg: "px-refineui-size-x-large"
|
|
1640
|
+
};
|
|
1641
|
+
var paddingBlock = {
|
|
1642
|
+
sm: "py-refineui-size-x-small",
|
|
1643
|
+
md: "py-refineui-size-medium",
|
|
1644
|
+
lg: "py-refineui-size-large"
|
|
1645
|
+
};
|
|
1631
1646
|
var padding = {
|
|
1632
|
-
sm: "
|
|
1633
|
-
md: "
|
|
1634
|
-
lg: "
|
|
1647
|
+
sm: [paddingInline.sm, paddingBlock.sm].join(" "),
|
|
1648
|
+
md: [paddingInline.md, paddingBlock.md].join(" "),
|
|
1649
|
+
lg: [paddingInline.lg, paddingBlock.lg].join(" ")
|
|
1635
1650
|
};
|
|
1636
1651
|
var typography = {
|
|
1637
1652
|
sm: sizedComponentTextClass(componentTypographyTokens.formControl, "sm"),
|
|
@@ -1649,6 +1664,11 @@ var formControlShellSizeClass = {
|
|
|
1649
1664
|
md: [fixedHeight.md, radius.md, padding.md, typography.md].join(" "),
|
|
1650
1665
|
lg: [fixedHeight.lg, radius.lg, padding.lg, typography.lg].join(" ")
|
|
1651
1666
|
};
|
|
1667
|
+
var formControlRowShellSizeClass = {
|
|
1668
|
+
sm: [fixedHeight.sm, radius.sm, paddingInline.sm].join(" "),
|
|
1669
|
+
md: [fixedHeight.md, radius.md, paddingInline.md].join(" "),
|
|
1670
|
+
lg: [fixedHeight.lg, radius.lg, paddingInline.lg].join(" ")
|
|
1671
|
+
};
|
|
1652
1672
|
var formControlShellHeightClass = {
|
|
1653
1673
|
sm: [fixedHeight.sm, radius.sm].join(" "),
|
|
1654
1674
|
md: [fixedHeight.md, radius.md].join(" "),
|
|
@@ -1730,7 +1750,7 @@ var inputOtpStyles = {
|
|
|
1730
1750
|
"inline-flex shrink-0 cursor-text items-center justify-center",
|
|
1731
1751
|
"border-refineui-thin border-transparent",
|
|
1732
1752
|
// Soft grey tile (not white) so cells read on light preview / page.
|
|
1733
|
-
"bg-refineui-alias-background-surface-
|
|
1753
|
+
"bg-refineui-alias-background-surface-hover",
|
|
1734
1754
|
"text-center tabular-nums",
|
|
1735
1755
|
"text-refineui-alias-foreground-primary",
|
|
1736
1756
|
"transition-[background-color,border-color]",
|
|
@@ -2011,22 +2031,27 @@ var import_react4 = require("react");
|
|
|
2011
2031
|
|
|
2012
2032
|
// src/components/SearchField/style.ts
|
|
2013
2033
|
var import_tokens5 = require("@refineui/tokens");
|
|
2014
|
-
var searchFieldLeadingIconSize =
|
|
2015
|
-
|
|
2034
|
+
var searchFieldLeadingIconSize = {
|
|
2035
|
+
sm: import_tokens5.iconSizes.small,
|
|
2036
|
+
md: import_tokens5.iconSizes.medium,
|
|
2037
|
+
lg: import_tokens5.iconSizes.large
|
|
2038
|
+
};
|
|
2039
|
+
var searchFieldClearIconSize = {
|
|
2040
|
+
sm: import_tokens5.iconSizes.xsmall,
|
|
2041
|
+
md: import_tokens5.iconSizes.small,
|
|
2042
|
+
lg: import_tokens5.iconSizes.small
|
|
2043
|
+
};
|
|
2016
2044
|
var searchFieldStyles = {
|
|
2017
2045
|
root: [
|
|
2018
2046
|
"box-border flex w-full min-w-0 items-center gap-refineui-size-x-small overflow-hidden outline-none",
|
|
2019
|
-
formControlTypoClass.md,
|
|
2020
2047
|
"transition-[background-color,border-color]",
|
|
2021
2048
|
"duration-[var(--refineui-motion-duration-fast)]",
|
|
2022
2049
|
"ease-[var(--refineui-motion-easing-emphasized)]"
|
|
2023
2050
|
].join(" "),
|
|
2024
2051
|
rootFilled: [
|
|
2025
|
-
"h-refineui-control-height-md min-h-refineui-control-height-md",
|
|
2026
|
-
"rounded-refineui-x-large px-refineui-size-large",
|
|
2027
2052
|
"border-refineui-thin border-transparent",
|
|
2028
2053
|
/** Same soft plate as InputOTP slots */
|
|
2029
|
-
"bg-refineui-alias-background-surface-
|
|
2054
|
+
"bg-refineui-alias-background-surface-hover"
|
|
2030
2055
|
].join(" "),
|
|
2031
2056
|
rootPlain: [
|
|
2032
2057
|
"h-auto min-h-0 rounded-none border-none bg-transparent px-0 py-0"
|
|
@@ -2039,6 +2064,8 @@ var searchFieldStyles = {
|
|
|
2039
2064
|
clear: "inline-flex shrink-0 cursor-pointer items-center justify-center border-none bg-transparent p-0 leading-none text-refineui-alias-foreground-tertiary",
|
|
2040
2065
|
clearDisabled: "cursor-not-allowed text-refineui-alias-foreground-disabled"
|
|
2041
2066
|
};
|
|
2067
|
+
var searchFieldFilledSizeClass = formControlRowShellSizeClass;
|
|
2068
|
+
var searchFieldTypoClass = formControlTypoClass;
|
|
2042
2069
|
|
|
2043
2070
|
// src/components/SearchField/SearchField.tsx
|
|
2044
2071
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
@@ -2069,6 +2096,7 @@ function SearchField({
|
|
|
2069
2096
|
onValueChange,
|
|
2070
2097
|
disabled = false,
|
|
2071
2098
|
appearance = "filled",
|
|
2099
|
+
size: sizeProp,
|
|
2072
2100
|
className,
|
|
2073
2101
|
children,
|
|
2074
2102
|
id,
|
|
@@ -2076,6 +2104,8 @@ function SearchField({
|
|
|
2076
2104
|
"aria-label": ariaLabel = "Search",
|
|
2077
2105
|
...props
|
|
2078
2106
|
}) {
|
|
2107
|
+
const fieldSize = useOptionalFieldSize();
|
|
2108
|
+
const size = sizeProp ?? fieldSize ?? "md";
|
|
2079
2109
|
const [query, setQuery] = useControllableString(value, defaultValue, onValueChange);
|
|
2080
2110
|
const inputRef = (0, import_react4.useRef)(null);
|
|
2081
2111
|
const reactId = (0, import_react4.useId)();
|
|
@@ -2090,11 +2120,12 @@ function SearchField({
|
|
|
2090
2120
|
setValue: setQuery,
|
|
2091
2121
|
clear,
|
|
2092
2122
|
disabled,
|
|
2123
|
+
size,
|
|
2093
2124
|
inputId,
|
|
2094
2125
|
inputLabel: ariaLabel,
|
|
2095
2126
|
inputRef
|
|
2096
2127
|
}),
|
|
2097
|
-
[ariaLabel, clear, disabled, inputId, query, setQuery]
|
|
2128
|
+
[ariaLabel, clear, disabled, size, inputId, query, setQuery]
|
|
2098
2129
|
);
|
|
2099
2130
|
const handlePointerDown = (event) => {
|
|
2100
2131
|
onPointerDown?.(event);
|
|
@@ -2110,10 +2141,12 @@ function SearchField({
|
|
|
2110
2141
|
{
|
|
2111
2142
|
"data-refineui": "search-field",
|
|
2112
2143
|
"data-appearance": appearance,
|
|
2144
|
+
"data-size": size,
|
|
2113
2145
|
"data-disabled": disabled || void 0,
|
|
2114
2146
|
className: (0, import_clsx6.clsx)(
|
|
2115
2147
|
searchFieldStyles.root,
|
|
2116
|
-
|
|
2148
|
+
searchFieldTypoClass[size],
|
|
2149
|
+
appearance === "plain" ? searchFieldStyles.rootPlain : [searchFieldStyles.rootFilled, searchFieldFilledSizeClass[size]],
|
|
2117
2150
|
disabled && (appearance === "plain" ? searchFieldStyles.rootPlainDisabled : searchFieldStyles.rootDisabled),
|
|
2118
2151
|
className
|
|
2119
2152
|
),
|
|
@@ -2124,7 +2157,7 @@ function SearchField({
|
|
|
2124
2157
|
) });
|
|
2125
2158
|
}
|
|
2126
2159
|
function SearchFieldIcon({ children, className, ...props }) {
|
|
2127
|
-
const { disabled } = useSearchFieldContext("SearchFieldIcon");
|
|
2160
|
+
const { disabled, size } = useSearchFieldContext("SearchFieldIcon");
|
|
2128
2161
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2129
2162
|
"span",
|
|
2130
2163
|
{
|
|
@@ -2140,7 +2173,7 @@ function SearchFieldIcon({ children, className, ...props }) {
|
|
|
2140
2173
|
WebIcon,
|
|
2141
2174
|
{
|
|
2142
2175
|
name: "search",
|
|
2143
|
-
size: searchFieldLeadingIconSize,
|
|
2176
|
+
size: searchFieldLeadingIconSize[size],
|
|
2144
2177
|
color: "currentColor",
|
|
2145
2178
|
"aria-hidden": true
|
|
2146
2179
|
}
|
|
@@ -2203,7 +2236,7 @@ function SearchFieldClear({
|
|
|
2203
2236
|
"aria-label": ariaLabel = "Clear search",
|
|
2204
2237
|
...props
|
|
2205
2238
|
}) {
|
|
2206
|
-
const { value, clear, disabled } = useSearchFieldContext("SearchFieldClear");
|
|
2239
|
+
const { value, clear, disabled, size } = useSearchFieldContext("SearchFieldClear");
|
|
2207
2240
|
const isDisabled = disabledProp ?? disabled;
|
|
2208
2241
|
if (value.length === 0) return null;
|
|
2209
2242
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
@@ -2228,7 +2261,7 @@ function SearchFieldClear({
|
|
|
2228
2261
|
WebIcon,
|
|
2229
2262
|
{
|
|
2230
2263
|
name: "dismiss",
|
|
2231
|
-
size: searchFieldClearIconSize,
|
|
2264
|
+
size: searchFieldClearIconSize[size],
|
|
2232
2265
|
color: "currentColor",
|
|
2233
2266
|
iconStyle: "filled",
|
|
2234
2267
|
"aria-hidden": true
|
|
@@ -2774,6 +2807,7 @@ var import_react9 = require("@refineui/utilities/react");
|
|
|
2774
2807
|
var import_clsx24 = require("clsx");
|
|
2775
2808
|
var import_tokens7 = require("@refineui/tokens");
|
|
2776
2809
|
var SCROLL_AREA_THUMB_MIN_PX = Number.parseFloat(import_tokens7.spacings.sizeXLarge);
|
|
2810
|
+
var SCROLL_EDGE_FALLOFF_RATIO = 0.25;
|
|
2777
2811
|
var scrollAreaStyles = {
|
|
2778
2812
|
root: "box-border min-h-0 min-w-0 overflow-hidden outline-none",
|
|
2779
2813
|
/**
|
|
@@ -2849,6 +2883,15 @@ function readMetrics(viewport) {
|
|
|
2849
2883
|
function isScrollable(metrics) {
|
|
2850
2884
|
return metrics.scrollSize > metrics.clientSize + 1;
|
|
2851
2885
|
}
|
|
2886
|
+
function resolveEdgeFactors(metrics) {
|
|
2887
|
+
const zone = metrics.clientSize * SCROLL_EDGE_FALLOFF_RATIO;
|
|
2888
|
+
if (!isScrollable(metrics) || zone <= 0) return { top: 0, bottom: 0 };
|
|
2889
|
+
const hiddenBelow = metrics.scrollSize - metrics.clientSize - metrics.scrollOffset;
|
|
2890
|
+
return {
|
|
2891
|
+
top: Math.min(1, Math.max(0, metrics.scrollOffset / zone)),
|
|
2892
|
+
bottom: Math.min(1, Math.max(0, hiddenBelow / zone))
|
|
2893
|
+
};
|
|
2894
|
+
}
|
|
2852
2895
|
function resolveThumbGeometry(metrics, trackSize, minThumb) {
|
|
2853
2896
|
if (trackSize <= 0 || metrics.scrollSize <= 0) {
|
|
2854
2897
|
return { thumbSize: 0, offset: 0 };
|
|
@@ -2869,6 +2912,8 @@ var ScrollArea = (0, import_react8.forwardRef)(function ScrollArea2({
|
|
|
2869
2912
|
children,
|
|
2870
2913
|
...props
|
|
2871
2914
|
}, ref) {
|
|
2915
|
+
const rootRef = (0, import_react8.useRef)(null);
|
|
2916
|
+
const composedRootRef = (0, import_react9.useComposedRefs)(rootRef, ref);
|
|
2872
2917
|
const viewportRef = (0, import_react8.useRef)(null);
|
|
2873
2918
|
const [viewportEpoch, setViewportEpoch] = (0, import_react8.useState)(0);
|
|
2874
2919
|
const [vertical, setVertical] = (0, import_react8.useState)(EMPTY_METRICS);
|
|
@@ -2896,6 +2941,12 @@ var ScrollArea = (0, import_react8.forwardRef)(function ScrollArea2({
|
|
|
2896
2941
|
const next = readMetrics(viewport);
|
|
2897
2942
|
setVertical(next.vertical);
|
|
2898
2943
|
setHorizontal(next.horizontal);
|
|
2944
|
+
const root = rootRef.current;
|
|
2945
|
+
if (root) {
|
|
2946
|
+
const edges = resolveEdgeFactors(next.vertical);
|
|
2947
|
+
root.style.setProperty("--refineui-scroll-edge-top", String(edges.top));
|
|
2948
|
+
root.style.setProperty("--refineui-scroll-edge-bottom", String(edges.bottom));
|
|
2949
|
+
}
|
|
2899
2950
|
}, []);
|
|
2900
2951
|
const markScrolling = (0, import_react8.useCallback)(() => {
|
|
2901
2952
|
setScrolling(true);
|
|
@@ -2962,7 +3013,7 @@ var ScrollArea = (0, import_react8.forwardRef)(function ScrollArea2({
|
|
|
2962
3013
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ScrollAreaContext.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2963
3014
|
"div",
|
|
2964
3015
|
{
|
|
2965
|
-
ref,
|
|
3016
|
+
ref: composedRootRef,
|
|
2966
3017
|
"data-refineui": "scroll-area",
|
|
2967
3018
|
"data-type": type,
|
|
2968
3019
|
"data-scrolling": scrolling || void 0,
|
|
@@ -3928,7 +3979,7 @@ function SelectGroup({ children, className, ...props }) {
|
|
|
3928
3979
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { role: "group", className: (0, import_clsx28.clsx)(selectStyles.group, className), ...props, children });
|
|
3929
3980
|
}
|
|
3930
3981
|
function SelectLabel({ children, className, ...props }) {
|
|
3931
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: (0, import_clsx28.clsx)(selectStyles.label, className), ...props, children });
|
|
3982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { "data-scroll-edge-item": true, className: (0, import_clsx28.clsx)(selectStyles.label, className), ...props, children });
|
|
3932
3983
|
}
|
|
3933
3984
|
function SelectSeparator({ className, ...props }) {
|
|
3934
3985
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { role: "separator", className: (0, import_clsx28.clsx)(selectStyles.separator, className), ...props });
|
|
@@ -3975,6 +4026,7 @@ function SelectItem({
|
|
|
3975
4026
|
"aria-selected": isSelected,
|
|
3976
4027
|
"aria-disabled": disabled,
|
|
3977
4028
|
"data-refineui": "select-item",
|
|
4029
|
+
"data-scroll-edge-item": true,
|
|
3978
4030
|
"data-selected": isSelected ? true : void 0,
|
|
3979
4031
|
"data-state": pressed ? "pressed" : isSelected ? "selected" : void 0,
|
|
3980
4032
|
"data-highlighted": isHighlighted ? "" : void 0,
|
|
@@ -4225,7 +4277,6 @@ function Chip({
|
|
|
4225
4277
|
// src/components/Command/Command.tsx
|
|
4226
4278
|
var import_clsx34 = require("clsx");
|
|
4227
4279
|
var import_react15 = require("react");
|
|
4228
|
-
var import_tokens12 = require("@refineui/tokens");
|
|
4229
4280
|
|
|
4230
4281
|
// src/components/Dialog/Dialog.tsx
|
|
4231
4282
|
var import_clsx32 = require("clsx");
|
|
@@ -4552,34 +4603,42 @@ var import_clsx33 = require("clsx");
|
|
|
4552
4603
|
var import_tokens11 = require("@refineui/tokens");
|
|
4553
4604
|
var COMMAND_LIST_MAX_HEIGHT = `min(60vh, ${import_tokens11.foundationSizes.foundationSize3200})`;
|
|
4554
4605
|
var commandStyles = {
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
"shadow-refineui-2"
|
|
4560
|
-
),
|
|
4561
|
-
/** Nested inside Dialog panel — Dialog already supplies radius / elevation */
|
|
4562
|
-
rootInDialog: "min-h-0 w-full flex-col overflow-hidden rounded-none border-none shadow-none",
|
|
4606
|
+
/** Detached layout: the search field and the results panel are separate surfaces, so the root has none. */
|
|
4607
|
+
root: "flex w-full flex-col gap-refineui-size-small text-refineui-alias-foreground-primary outline-none",
|
|
4608
|
+
rootInDialog: "min-h-0 w-full",
|
|
4609
|
+
/** Dialog panel stays transparent — the field and results panel float on the scrim themselves. */
|
|
4563
4610
|
dialogContentPanel: {
|
|
4564
4611
|
padding: 0,
|
|
4565
|
-
overflow: "
|
|
4612
|
+
overflow: "visible",
|
|
4613
|
+
backgroundColor: "transparent",
|
|
4614
|
+
boxShadow: "none",
|
|
4615
|
+
borderRadius: 0
|
|
4566
4616
|
},
|
|
4567
|
-
dialogBody: "flex min-h-0 w-full flex-col
|
|
4568
|
-
inputWrap: "shrink-0
|
|
4569
|
-
/**
|
|
4570
|
-
|
|
4617
|
+
dialogBody: "flex min-h-0 w-full flex-col",
|
|
4618
|
+
inputWrap: "shrink-0",
|
|
4619
|
+
/**
|
|
4620
|
+
* Results surface. Height is measured from the results (animated in refineui.css), capped by `maxHeight`.
|
|
4621
|
+
* Radius comes from `--refineui-command-list-radius` (per size, refineui.css) so the scrollbar inset can share it.
|
|
4622
|
+
*/
|
|
4623
|
+
listShell: (0, import_clsx33.clsx)(
|
|
4624
|
+
"box-border w-full overflow-hidden",
|
|
4625
|
+
"border-refineui-hairline border-refineui-alias-border-default",
|
|
4626
|
+
"bg-refineui-alias-background-primary shadow-refineui-2"
|
|
4627
|
+
),
|
|
4571
4628
|
list: "h-full min-h-0 w-full",
|
|
4572
|
-
|
|
4573
|
-
height: COMMAND_LIST_MAX_HEIGHT,
|
|
4629
|
+
listShellMaxHeight: {
|
|
4574
4630
|
maxHeight: COMMAND_LIST_MAX_HEIGHT
|
|
4575
4631
|
},
|
|
4576
4632
|
listViewport: "outline-none",
|
|
4577
|
-
listInner: "flex flex-col gap-refineui-size-xxx-small px-refineui-size-medium py-refineui-size-small",
|
|
4633
|
+
listInner: "relative flex flex-col gap-refineui-size-xxx-small px-refineui-size-medium py-refineui-size-small",
|
|
4634
|
+
/** Sliding highlight behind the selected item; geometry is measured, so physical `left`/`top` (inline) are intentional. */
|
|
4635
|
+
indicator: "pointer-events-none absolute rounded-refineui-large bg-refineui-alias-background-surface-hover",
|
|
4578
4636
|
empty: (0, import_clsx33.clsx)(
|
|
4579
4637
|
componentTextClass(componentTypographyTokens.command.empty),
|
|
4580
4638
|
"px-refineui-size-medium py-refineui-size-xx-large text-center text-refineui-alias-foreground-tertiary"
|
|
4581
4639
|
),
|
|
4582
|
-
|
|
4640
|
+
/** `overflow-clip`, not hidden: a hidden group would become the scroll container the edge effect tracks. */
|
|
4641
|
+
group: "flex flex-col gap-refineui-size-xxx-small overflow-clip",
|
|
4583
4642
|
groupHeading: (0, import_clsx33.clsx)(
|
|
4584
4643
|
componentTextClass(componentTypographyTokens.command.group),
|
|
4585
4644
|
"flex w-full items-center overflow-hidden px-refineui-size-x-small py-refineui-size-xxx-small text-refineui-alias-foreground-tertiary"
|
|
@@ -4587,9 +4646,8 @@ var commandStyles = {
|
|
|
4587
4646
|
separatorWrap: "flex w-full items-center px-refineui-size-x-small py-refineui-size-x-small",
|
|
4588
4647
|
separatorLine: "h-px w-full shrink-0 bg-refineui-alias-border-default",
|
|
4589
4648
|
itemBase: (0, import_clsx33.clsx)(
|
|
4590
|
-
|
|
4591
|
-
"
|
|
4592
|
-
"px-refineui-size-x-small py-refineui-size-small text-start outline-none"
|
|
4649
|
+
"relative flex w-full items-center gap-refineui-size-x-small rounded-refineui-large border-none bg-transparent",
|
|
4650
|
+
"px-refineui-size-x-small text-start outline-none"
|
|
4593
4651
|
),
|
|
4594
4652
|
itemDisabled: "cursor-not-allowed text-refineui-alias-foreground-disabled",
|
|
4595
4653
|
itemEnabled: "cursor-pointer text-refineui-alias-foreground-primary",
|
|
@@ -4601,6 +4659,16 @@ var commandStyles = {
|
|
|
4601
4659
|
"shrink-0 tracking-wide text-refineui-alias-foreground-tertiary"
|
|
4602
4660
|
)
|
|
4603
4661
|
};
|
|
4662
|
+
var commandItemSizeClass = {
|
|
4663
|
+
sm: (0, import_clsx33.clsx)(sizedComponentTextClass(componentTypographyTokens.command.item, "sm"), "py-refineui-size-xx-small"),
|
|
4664
|
+
md: (0, import_clsx33.clsx)(sizedComponentTextClass(componentTypographyTokens.command.item, "md"), "py-refineui-size-small"),
|
|
4665
|
+
lg: (0, import_clsx33.clsx)(sizedComponentTextClass(componentTypographyTokens.command.item, "lg"), "py-refineui-size-medium")
|
|
4666
|
+
};
|
|
4667
|
+
var commandItemIconSize = {
|
|
4668
|
+
sm: import_tokens11.iconSizes.xsmall,
|
|
4669
|
+
md: import_tokens11.iconSizes.small,
|
|
4670
|
+
lg: import_tokens11.iconSizes.medium
|
|
4671
|
+
};
|
|
4604
4672
|
|
|
4605
4673
|
// src/components/Command/Command.tsx
|
|
4606
4674
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
@@ -4636,6 +4704,7 @@ function useControllableString2(controlled, defaultValue, onChange) {
|
|
|
4636
4704
|
function Command({
|
|
4637
4705
|
children,
|
|
4638
4706
|
className,
|
|
4707
|
+
size = "md",
|
|
4639
4708
|
value,
|
|
4640
4709
|
defaultValue,
|
|
4641
4710
|
onValueChange,
|
|
@@ -4754,6 +4823,7 @@ function Command({
|
|
|
4754
4823
|
);
|
|
4755
4824
|
const ctx = (0, import_react15.useMemo)(
|
|
4756
4825
|
() => ({
|
|
4826
|
+
size,
|
|
4757
4827
|
search,
|
|
4758
4828
|
setSearch,
|
|
4759
4829
|
shouldFilter,
|
|
@@ -4771,6 +4841,7 @@ function Command({
|
|
|
4771
4841
|
groupHasVisibleItems
|
|
4772
4842
|
}),
|
|
4773
4843
|
[
|
|
4844
|
+
size,
|
|
4774
4845
|
search,
|
|
4775
4846
|
setSearch,
|
|
4776
4847
|
shouldFilter,
|
|
@@ -4792,6 +4863,7 @@ function Command({
|
|
|
4792
4863
|
"div",
|
|
4793
4864
|
{
|
|
4794
4865
|
"data-refineui": "command",
|
|
4866
|
+
"data-size": size,
|
|
4795
4867
|
role: "presentation",
|
|
4796
4868
|
className: (0, import_clsx34.clsx)(commandStyles.root, className),
|
|
4797
4869
|
onKeyDown: (event) => {
|
|
@@ -4843,17 +4915,19 @@ function CommandDialog({
|
|
|
4843
4915
|
Command,
|
|
4844
4916
|
{
|
|
4845
4917
|
...commandProps,
|
|
4918
|
+
size: commandProps?.size ?? "lg",
|
|
4846
4919
|
className: (0, import_clsx34.clsx)(commandStyles.rootInDialog, commandProps?.className),
|
|
4847
4920
|
children
|
|
4848
4921
|
}
|
|
4849
4922
|
) }) }) });
|
|
4850
4923
|
}
|
|
4851
4924
|
var CommandInput = (0, import_react15.forwardRef)(function CommandInput2({ className, startIcon, placeholder = "Type a command or search\u2026", disabled, onKeyDown, ...props }, ref) {
|
|
4852
|
-
const { search, setSearch, listId, label, selectedValue } = useCommandContext("CommandInput");
|
|
4925
|
+
const { size, search, setSearch, listId, label, selectedValue } = useCommandContext("CommandInput");
|
|
4853
4926
|
const activeDescendantId = selectedValue ? `${listId}-item-${cssEscape(selectedValue)}` : void 0;
|
|
4854
4927
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { "data-refineui": "command-input", className: commandStyles.inputWrap, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4855
4928
|
SearchField,
|
|
4856
4929
|
{
|
|
4930
|
+
size,
|
|
4857
4931
|
value: search,
|
|
4858
4932
|
onValueChange: setSearch,
|
|
4859
4933
|
disabled,
|
|
@@ -4882,14 +4956,90 @@ var CommandInput = (0, import_react15.forwardRef)(function CommandInput2({ class
|
|
|
4882
4956
|
}
|
|
4883
4957
|
) });
|
|
4884
4958
|
});
|
|
4959
|
+
var HIDDEN_INDICATOR = { top: 0, left: 0, width: 0, height: 0, ready: false };
|
|
4960
|
+
var SELECTED_ITEM_SELECTOR = '[data-refineui="command-item"][data-selected="true"]';
|
|
4961
|
+
function sameIndicatorBox(a, b) {
|
|
4962
|
+
return a.ready === b.ready && a.top === b.top && a.left === b.left && a.width === b.width && a.height === b.height;
|
|
4963
|
+
}
|
|
4885
4964
|
function CommandList({ className, children, ...props }) {
|
|
4886
|
-
const { listId } = useCommandContext("CommandList");
|
|
4965
|
+
const { listId, selectedValue, search, visibleCount } = useCommandContext("CommandList");
|
|
4966
|
+
const shellRef = (0, import_react15.useRef)(null);
|
|
4967
|
+
const innerRef = (0, import_react15.useRef)(null);
|
|
4968
|
+
const [contentHeight, setContentHeight] = (0, import_react15.useState)(null);
|
|
4969
|
+
const [indicator, setIndicator] = (0, import_react15.useState)(HIDDEN_INDICATOR);
|
|
4970
|
+
const [animate, setAnimate] = (0, import_react15.useState)(false);
|
|
4971
|
+
const [snap, setSnap] = (0, import_react15.useState)(false);
|
|
4972
|
+
const lastSearchRef = (0, import_react15.useRef)(search);
|
|
4973
|
+
const measure = (0, import_react15.useCallback)(() => {
|
|
4974
|
+
const inner = innerRef.current;
|
|
4975
|
+
const shell = shellRef.current;
|
|
4976
|
+
if (!inner || !shell) return;
|
|
4977
|
+
const shellStyle = getComputedStyle(shell);
|
|
4978
|
+
const height = inner.offsetHeight + parseFloat(shellStyle.borderTopWidth) + parseFloat(shellStyle.borderBottomWidth);
|
|
4979
|
+
setContentHeight((prev) => prev === height ? prev : height);
|
|
4980
|
+
const selected = inner.querySelector(SELECTED_ITEM_SELECTOR);
|
|
4981
|
+
setIndicator((prev) => {
|
|
4982
|
+
const next = selected ? {
|
|
4983
|
+
top: selected.offsetTop,
|
|
4984
|
+
left: selected.offsetLeft,
|
|
4985
|
+
width: selected.offsetWidth,
|
|
4986
|
+
height: selected.offsetHeight,
|
|
4987
|
+
ready: true
|
|
4988
|
+
} : { ...prev, ready: false };
|
|
4989
|
+
return sameIndicatorBox(prev, next) ? prev : next;
|
|
4990
|
+
});
|
|
4991
|
+
}, []);
|
|
4992
|
+
useIsomorphicLayoutEffect2(() => {
|
|
4993
|
+
if (lastSearchRef.current !== search) {
|
|
4994
|
+
lastSearchRef.current = search;
|
|
4995
|
+
setSnap(true);
|
|
4996
|
+
}
|
|
4997
|
+
measure();
|
|
4998
|
+
}, [measure, selectedValue, search, visibleCount, children]);
|
|
4999
|
+
(0, import_react15.useEffect)(() => {
|
|
5000
|
+
if (!snap) return;
|
|
5001
|
+
let raf2 = 0;
|
|
5002
|
+
const raf1 = requestAnimationFrame(() => {
|
|
5003
|
+
raf2 = requestAnimationFrame(() => setSnap(false));
|
|
5004
|
+
});
|
|
5005
|
+
return () => {
|
|
5006
|
+
cancelAnimationFrame(raf1);
|
|
5007
|
+
cancelAnimationFrame(raf2);
|
|
5008
|
+
};
|
|
5009
|
+
}, [snap]);
|
|
5010
|
+
(0, import_react15.useEffect)(() => {
|
|
5011
|
+
const inner = innerRef.current;
|
|
5012
|
+
if (!inner || typeof ResizeObserver === "undefined") return;
|
|
5013
|
+
const observer = new ResizeObserver(measure);
|
|
5014
|
+
observer.observe(inner);
|
|
5015
|
+
return () => observer.disconnect();
|
|
5016
|
+
}, [measure]);
|
|
5017
|
+
const measured = contentHeight !== null;
|
|
5018
|
+
(0, import_react15.useEffect)(() => {
|
|
5019
|
+
if (!measured || animate) return;
|
|
5020
|
+
let raf2 = 0;
|
|
5021
|
+
const raf1 = requestAnimationFrame(() => {
|
|
5022
|
+
raf2 = requestAnimationFrame(() => setAnimate(true));
|
|
5023
|
+
});
|
|
5024
|
+
return () => {
|
|
5025
|
+
cancelAnimationFrame(raf1);
|
|
5026
|
+
cancelAnimationFrame(raf2);
|
|
5027
|
+
};
|
|
5028
|
+
}, [measured, animate]);
|
|
5029
|
+
const indicatorStyle = {
|
|
5030
|
+
top: indicator.top,
|
|
5031
|
+
left: indicator.left,
|
|
5032
|
+
width: indicator.width,
|
|
5033
|
+
height: indicator.height
|
|
5034
|
+
};
|
|
4887
5035
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4888
5036
|
"div",
|
|
4889
5037
|
{
|
|
5038
|
+
ref: shellRef,
|
|
4890
5039
|
"data-refineui": "command-list",
|
|
5040
|
+
"data-animate": animate ? "true" : void 0,
|
|
4891
5041
|
className: commandStyles.listShell,
|
|
4892
|
-
style: commandStyles.
|
|
5042
|
+
style: { ...commandStyles.listShellMaxHeight, height: contentHeight ?? void 0 },
|
|
4893
5043
|
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4894
5044
|
ScrollAreaRegion,
|
|
4895
5045
|
{
|
|
@@ -4897,7 +5047,21 @@ function CommandList({ className, children, ...props }) {
|
|
|
4897
5047
|
className: (0, import_clsx34.clsx)(commandStyles.list, className),
|
|
4898
5048
|
viewportClassName: commandStyles.listViewport,
|
|
4899
5049
|
...props,
|
|
4900
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime26.
|
|
5050
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { ref: innerRef, id: listId, role: "listbox", className: commandStyles.listInner, children: [
|
|
5051
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5052
|
+
"div",
|
|
5053
|
+
{
|
|
5054
|
+
"data-refineui": "command-indicator",
|
|
5055
|
+
"data-ready": indicator.ready ? "true" : void 0,
|
|
5056
|
+
"data-animate": animate && !snap ? "true" : void 0,
|
|
5057
|
+
"data-scroll-edge-item": true,
|
|
5058
|
+
"aria-hidden": true,
|
|
5059
|
+
className: commandStyles.indicator,
|
|
5060
|
+
style: indicatorStyle
|
|
5061
|
+
}
|
|
5062
|
+
),
|
|
5063
|
+
children
|
|
5064
|
+
] })
|
|
4901
5065
|
}
|
|
4902
5066
|
)
|
|
4903
5067
|
}
|
|
@@ -4942,6 +5106,7 @@ function CommandGroupHeading({ className, children, ...props }) {
|
|
|
4942
5106
|
"div",
|
|
4943
5107
|
{
|
|
4944
5108
|
"data-refineui": "command-group-heading",
|
|
5109
|
+
"data-scroll-edge-item": true,
|
|
4945
5110
|
className: (0, import_clsx34.clsx)(commandStyles.groupHeading, className),
|
|
4946
5111
|
...props,
|
|
4947
5112
|
children
|
|
@@ -5025,6 +5190,7 @@ var CommandItem = (0, import_react15.forwardRef)(function CommandItem2({
|
|
|
5025
5190
|
...props
|
|
5026
5191
|
}, forwardedRef) {
|
|
5027
5192
|
const {
|
|
5193
|
+
size,
|
|
5028
5194
|
selectedValue,
|
|
5029
5195
|
setSelectedValue,
|
|
5030
5196
|
listId,
|
|
@@ -5032,6 +5198,7 @@ var CommandItem = (0, import_react15.forwardRef)(function CommandItem2({
|
|
|
5032
5198
|
isItemVisible,
|
|
5033
5199
|
selectById
|
|
5034
5200
|
} = useCommandContext("CommandItem");
|
|
5201
|
+
const iconSize = commandItemIconSize[size];
|
|
5035
5202
|
const group = (0, import_react15.useContext)(CommandGroupContext);
|
|
5036
5203
|
const itemId = (0, import_react15.useId)();
|
|
5037
5204
|
const nodeRef = (0, import_react15.useRef)(null);
|
|
@@ -5075,11 +5242,13 @@ var CommandItem = (0, import_react15.forwardRef)(function CommandItem2({
|
|
|
5075
5242
|
"aria-selected": isSelected,
|
|
5076
5243
|
disabled,
|
|
5077
5244
|
"data-refineui": "command-item",
|
|
5245
|
+
"data-scroll-edge-item": true,
|
|
5078
5246
|
"data-state": disabled ? "disabled" : isSelected ? "active" : "default",
|
|
5079
5247
|
"data-selected": isSelected || void 0,
|
|
5080
5248
|
"data-disabled": disabled || void 0,
|
|
5081
5249
|
className: (0, import_clsx34.clsx)(
|
|
5082
5250
|
commandStyles.itemBase,
|
|
5251
|
+
commandItemSizeClass[size],
|
|
5083
5252
|
disabled ? commandStyles.itemDisabled : commandStyles.itemEnabled,
|
|
5084
5253
|
className
|
|
5085
5254
|
),
|
|
@@ -5099,9 +5268,9 @@ var CommandItem = (0, import_react15.forwardRef)(function CommandItem2({
|
|
|
5099
5268
|
{
|
|
5100
5269
|
className: commandStyles.iconWrap,
|
|
5101
5270
|
style: {
|
|
5102
|
-
width:
|
|
5103
|
-
minWidth:
|
|
5104
|
-
height:
|
|
5271
|
+
width: iconSize,
|
|
5272
|
+
minWidth: iconSize,
|
|
5273
|
+
height: iconSize
|
|
5105
5274
|
},
|
|
5106
5275
|
children: startIcon
|
|
5107
5276
|
}
|
|
@@ -5115,9 +5284,9 @@ var CommandItem = (0, import_react15.forwardRef)(function CommandItem2({
|
|
|
5115
5284
|
{
|
|
5116
5285
|
className: commandStyles.iconWrap,
|
|
5117
5286
|
style: {
|
|
5118
|
-
width:
|
|
5119
|
-
minWidth:
|
|
5120
|
-
height:
|
|
5287
|
+
width: iconSize,
|
|
5288
|
+
minWidth: iconSize,
|
|
5289
|
+
height: iconSize
|
|
5121
5290
|
},
|
|
5122
5291
|
children: endIcon
|
|
5123
5292
|
}
|
|
@@ -5137,7 +5306,7 @@ var import_react17 = require("react");
|
|
|
5137
5306
|
var import_color6 = require("@refineui/utilities/color");
|
|
5138
5307
|
|
|
5139
5308
|
// src/components/Avatar/avatarStyles.ts
|
|
5140
|
-
var
|
|
5309
|
+
var import_tokens12 = require("@refineui/tokens");
|
|
5141
5310
|
var import_color4 = require("@refineui/utilities/color");
|
|
5142
5311
|
var avatarSizeAliasMap = {
|
|
5143
5312
|
"3xs": "xxxsmall",
|
|
@@ -5202,15 +5371,15 @@ var avatarTypoNeutral = buildSemanticTextClassMap(
|
|
|
5202
5371
|
componentTypographyTokens.avatar.initialsNeutral
|
|
5203
5372
|
);
|
|
5204
5373
|
var avatarIconSlotSize = {
|
|
5205
|
-
xxxsmall:
|
|
5206
|
-
xxsmall:
|
|
5207
|
-
xsmall:
|
|
5208
|
-
small:
|
|
5209
|
-
medium:
|
|
5210
|
-
large:
|
|
5211
|
-
xlarge:
|
|
5212
|
-
xxlarge:
|
|
5213
|
-
xxxlarge:
|
|
5374
|
+
xxxsmall: import_tokens12.iconSizes.xxsmall,
|
|
5375
|
+
xxsmall: import_tokens12.iconSizes.xsmall,
|
|
5376
|
+
xsmall: import_tokens12.iconSizes.small,
|
|
5377
|
+
small: import_tokens12.iconSizes.small,
|
|
5378
|
+
medium: import_tokens12.iconSizes.medium,
|
|
5379
|
+
large: import_tokens12.iconSizes.medium,
|
|
5380
|
+
xlarge: import_tokens12.iconSizes.large,
|
|
5381
|
+
xxlarge: import_tokens12.iconSizes.xlarge,
|
|
5382
|
+
xxxlarge: import_tokens12.iconSizes.xxlarge
|
|
5214
5383
|
};
|
|
5215
5384
|
var AVATAR_INNER_MASK = "relative flex size-full min-h-0 min-w-0 items-center justify-center overflow-hidden rounded-refineui-circle";
|
|
5216
5385
|
function initialsAccentTypo(size) {
|
|
@@ -5278,15 +5447,15 @@ var defaultPersonIconColor = {
|
|
|
5278
5447
|
yellow: (0, import_color4.resolveColorTokenValue)(componentColorTokens.avatar.icon.yellow)
|
|
5279
5448
|
};
|
|
5280
5449
|
var avatarOverflowIconSize = {
|
|
5281
|
-
xxxsmall:
|
|
5282
|
-
xxsmall:
|
|
5283
|
-
xsmall:
|
|
5284
|
-
small:
|
|
5285
|
-
medium:
|
|
5286
|
-
large:
|
|
5287
|
-
xlarge:
|
|
5288
|
-
xxlarge:
|
|
5289
|
-
xxxlarge:
|
|
5450
|
+
xxxsmall: import_tokens12.iconSizes.xsmall,
|
|
5451
|
+
xxsmall: import_tokens12.iconSizes.xsmall,
|
|
5452
|
+
xsmall: import_tokens12.iconSizes.small,
|
|
5453
|
+
small: import_tokens12.iconSizes.small,
|
|
5454
|
+
medium: import_tokens12.iconSizes.medium,
|
|
5455
|
+
large: import_tokens12.iconSizes.medium,
|
|
5456
|
+
xlarge: import_tokens12.iconSizes.large,
|
|
5457
|
+
xxlarge: import_tokens12.iconSizes.xlarge,
|
|
5458
|
+
xxxlarge: import_tokens12.iconSizes.xxlarge
|
|
5290
5459
|
};
|
|
5291
5460
|
var avatarSpreadGap = {
|
|
5292
5461
|
xxxsmall: "gap-refineui-size-xx-small",
|
|
@@ -5692,7 +5861,7 @@ function Avatars({
|
|
|
5692
5861
|
|
|
5693
5862
|
// src/components/Alert/Alert.tsx
|
|
5694
5863
|
var import_clsx38 = require("clsx");
|
|
5695
|
-
var
|
|
5864
|
+
var import_tokens13 = require("@refineui/tokens");
|
|
5696
5865
|
|
|
5697
5866
|
// src/components/Alert/context.ts
|
|
5698
5867
|
var import_react18 = require("react");
|
|
@@ -5817,7 +5986,7 @@ function AlertIcon({ className, name, children, ...props }) {
|
|
|
5817
5986
|
"data-refineui": "alert-icon",
|
|
5818
5987
|
className: (0, import_clsx38.clsx)(resolveAlertSlotClasses("icon", variant), className),
|
|
5819
5988
|
...props,
|
|
5820
|
-
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(WebIcon, { name: iconName, size:
|
|
5989
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(WebIcon, { name: iconName, size: import_tokens13.iconSizes.medium, color: "currentColor", fallback: "\u25CF", "aria-hidden": true })
|
|
5821
5990
|
}
|
|
5822
5991
|
);
|
|
5823
5992
|
}
|
|
@@ -5894,7 +6063,7 @@ function AlertClose({ className, type = "button", children, ...props }) {
|
|
|
5894
6063
|
WebIcon,
|
|
5895
6064
|
{
|
|
5896
6065
|
name: "dismiss",
|
|
5897
|
-
size:
|
|
6066
|
+
size: import_tokens13.iconSizes.small,
|
|
5898
6067
|
color: "currentColor",
|
|
5899
6068
|
iconStyle: "regular",
|
|
5900
6069
|
fallback: "\xD7",
|
|
@@ -6963,14 +7132,14 @@ var import_clsx51 = require("clsx");
|
|
|
6963
7132
|
|
|
6964
7133
|
// src/components/Accordion/context.ts
|
|
6965
7134
|
var import_react23 = require("react");
|
|
6966
|
-
var
|
|
7135
|
+
var import_tokens14 = require("@refineui/tokens");
|
|
6967
7136
|
var import_animation2 = require("@refineui/utilities/animation");
|
|
6968
7137
|
var AccordionContext = (0, import_react23.createContext)(null);
|
|
6969
7138
|
var AccordionItemContext = (0, import_react23.createContext)(null);
|
|
6970
|
-
var PANEL_HEIGHT_MS = Number.parseFloat(
|
|
6971
|
-
var PANEL_CONTENT_MS = Number.parseFloat(
|
|
6972
|
-
var PANEL_HEIGHT_EASE =
|
|
6973
|
-
var PANEL_CONTENT_EASE =
|
|
7139
|
+
var PANEL_HEIGHT_MS = Number.parseFloat(import_tokens14.semanticInteraction.duration.accordionPanel) / 1e3;
|
|
7140
|
+
var PANEL_CONTENT_MS = Number.parseFloat(import_tokens14.semanticInteraction.duration.accordionContent) / 1e3;
|
|
7141
|
+
var PANEL_HEIGHT_EASE = import_tokens14.semanticInteraction.easing.panel;
|
|
7142
|
+
var PANEL_CONTENT_EASE = import_tokens14.semanticInteraction.easing.content;
|
|
6974
7143
|
function usePrefersReducedMotion() {
|
|
6975
7144
|
const [reduce, setReduce] = (0, import_react23.useState)(false);
|
|
6976
7145
|
(0, import_react23.useEffect)(() => {
|
|
@@ -6989,7 +7158,7 @@ function toSet(value, type) {
|
|
|
6989
7158
|
}
|
|
6990
7159
|
|
|
6991
7160
|
// src/recipes/accordion.recipe.ts
|
|
6992
|
-
var
|
|
7161
|
+
var import_tokens15 = require("@refineui/tokens");
|
|
6993
7162
|
var accordionRecipe = defineSlotRecipe({
|
|
6994
7163
|
name: "accordion",
|
|
6995
7164
|
slots: ["root", "item", "trigger", "triggerRow", "chevron", "panel", "panelPad", "content"],
|
|
@@ -7028,9 +7197,9 @@ var accordionStyles = {
|
|
|
7028
7197
|
panelBody: accordionRecipe.base.content
|
|
7029
7198
|
};
|
|
7030
7199
|
var accordionIconSize = {
|
|
7031
|
-
sm:
|
|
7032
|
-
md:
|
|
7033
|
-
lg:
|
|
7200
|
+
sm: import_tokens15.iconSizes.xsmall,
|
|
7201
|
+
md: import_tokens15.iconSizes.small,
|
|
7202
|
+
lg: import_tokens15.iconSizes.medium
|
|
7034
7203
|
};
|
|
7035
7204
|
var triggerTypo = {
|
|
7036
7205
|
sm: sizedComponentTextClass(componentTypographyTokens.accordion.trigger, "sm"),
|
|
@@ -7264,7 +7433,7 @@ function AccordionContent({ className, children, ...props }) {
|
|
|
7264
7433
|
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
7265
7434
|
var import_clsx55 = require("clsx");
|
|
7266
7435
|
var import_react28 = require("react");
|
|
7267
|
-
var
|
|
7436
|
+
var import_tokens16 = require("@refineui/tokens");
|
|
7268
7437
|
|
|
7269
7438
|
// src/components/Breadcrumb/style.ts
|
|
7270
7439
|
var ellipsisChip = "box-border inline-flex min-h-refineui-button-min-height-sm min-w-refineui-button-min-height-sm shrink-0 items-center justify-center rounded-refineui-large p-refineui-size-xx-small leading-none";
|
|
@@ -7357,7 +7526,7 @@ function EllipsisIcon() {
|
|
|
7357
7526
|
WebIcon,
|
|
7358
7527
|
{
|
|
7359
7528
|
name: "more-horizontal",
|
|
7360
|
-
size:
|
|
7529
|
+
size: import_tokens16.iconSizes.small,
|
|
7361
7530
|
color: "currentColor",
|
|
7362
7531
|
fallback: "\u22EF",
|
|
7363
7532
|
className: "items-center justify-center"
|
|
@@ -7643,7 +7812,7 @@ function FooterSocial({ className, ...props }) {
|
|
|
7643
7812
|
// src/components/Calendar/Calendar.tsx
|
|
7644
7813
|
var import_clsx59 = require("clsx");
|
|
7645
7814
|
var import_react30 = require("react");
|
|
7646
|
-
var
|
|
7815
|
+
var import_tokens17 = require("@refineui/tokens");
|
|
7647
7816
|
|
|
7648
7817
|
// src/components/Calendar/style.ts
|
|
7649
7818
|
var import_clsx58 = require("clsx");
|
|
@@ -7972,7 +8141,7 @@ function Calendar({
|
|
|
7972
8141
|
"aria-label": "Previous month",
|
|
7973
8142
|
className: calendarStyles.navButton,
|
|
7974
8143
|
onClick: () => setView(new Date(year, month - 1)),
|
|
7975
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(WebIcon, { name: "chevron-left", size:
|
|
8144
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(WebIcon, { name: "chevron-left", size: import_tokens17.iconSizes.small, color: "currentColor", fallback: "\u2039" })
|
|
7976
8145
|
}
|
|
7977
8146
|
),
|
|
7978
8147
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
@@ -8012,7 +8181,7 @@ function Calendar({
|
|
|
8012
8181
|
"aria-label": "Next month",
|
|
8013
8182
|
className: calendarStyles.navButton,
|
|
8014
8183
|
onClick: () => setView(new Date(year, month + 1)),
|
|
8015
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(WebIcon, { name: "chevron-right", size:
|
|
8184
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(WebIcon, { name: "chevron-right", size: import_tokens17.iconSizes.small, color: "currentColor", fallback: "\u203A" })
|
|
8016
8185
|
}
|
|
8017
8186
|
)
|
|
8018
8187
|
] }),
|
|
@@ -8446,7 +8615,7 @@ function Spacer({ className, ...props }) {
|
|
|
8446
8615
|
var import_clsx68 = require("clsx");
|
|
8447
8616
|
var import_react31 = require("react");
|
|
8448
8617
|
var import_react_dom3 = require("react-dom");
|
|
8449
|
-
var
|
|
8618
|
+
var import_tokens18 = require("@refineui/tokens");
|
|
8450
8619
|
var import_animation3 = require("@refineui/utilities/animation");
|
|
8451
8620
|
var import_color7 = require("@refineui/utilities/color");
|
|
8452
8621
|
var import_react32 = require("@refineui/utilities/react");
|
|
@@ -8487,9 +8656,9 @@ var drawerStyles = {
|
|
|
8487
8656
|
|
|
8488
8657
|
// src/components/Drawer/Drawer.tsx
|
|
8489
8658
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
8490
|
-
var PANEL_MS2 = (0, import_animation3.motionMsToNumber)(
|
|
8491
|
-
var SCRIM_MS2 = (0, import_animation3.motionMsToNumber)(
|
|
8492
|
-
var EASING2 =
|
|
8659
|
+
var PANEL_MS2 = (0, import_animation3.motionMsToNumber)(import_tokens18.semanticInteraction.duration.panel);
|
|
8660
|
+
var SCRIM_MS2 = (0, import_animation3.motionMsToNumber)(import_tokens18.semanticInteraction.duration.overlay);
|
|
8661
|
+
var EASING2 = import_tokens18.semanticInteraction.easing.panel;
|
|
8493
8662
|
var DrawerContext = (0, import_react31.createContext)(null);
|
|
8494
8663
|
function useDrawerContext(component) {
|
|
8495
8664
|
const ctx = (0, import_react31.useContext)(DrawerContext);
|
|
@@ -8799,7 +8968,7 @@ function DrawerFooter({ className, ...props }) {
|
|
|
8799
8968
|
var import_clsx70 = require("clsx");
|
|
8800
8969
|
var import_react34 = require("react");
|
|
8801
8970
|
var import_react_dom4 = require("react-dom");
|
|
8802
|
-
var
|
|
8971
|
+
var import_tokens19 = require("@refineui/tokens");
|
|
8803
8972
|
var import_color8 = require("@refineui/utilities/color");
|
|
8804
8973
|
|
|
8805
8974
|
// src/components/Dropdown/style.ts
|
|
@@ -9072,9 +9241,9 @@ function DropdownContent({
|
|
|
9072
9241
|
const { open, setOpen, close, triggerRef, menuRef, menuId } = useDropdownRoot("DropdownContent");
|
|
9073
9242
|
const [fixedStyle, setFixedStyle] = (0, import_react34.useState)(null);
|
|
9074
9243
|
const [menuSide, setMenuSide] = (0, import_react34.useState)("bottom");
|
|
9075
|
-
const gapPx = sideOffset ?? parseCssPxLen(
|
|
9244
|
+
const gapPx = sideOffset ?? parseCssPxLen(import_tokens19.spacings.sizeXXSmall, 4);
|
|
9076
9245
|
const defaultMenuW = parseCssPxLen(import_tokens3.componentSizes.dropdownMenuWidth, 180);
|
|
9077
|
-
const z = Number.parseInt(String(
|
|
9246
|
+
const z = Number.parseInt(String(import_tokens19.zIndex.zIndexMessages), 10) || 1e4;
|
|
9078
9247
|
useIsomorphicLayoutEffect3(() => {
|
|
9079
9248
|
if (!open) {
|
|
9080
9249
|
setFixedStyle(null);
|
|
@@ -9179,6 +9348,7 @@ function DropdownLabel({ className, ...props }) {
|
|
|
9179
9348
|
{
|
|
9180
9349
|
role: "presentation",
|
|
9181
9350
|
"data-refineui": "dropdown-menu-label",
|
|
9351
|
+
"data-scroll-edge-item": true,
|
|
9182
9352
|
className: (0, import_clsx70.clsx)(dropdownStyles.label, className),
|
|
9183
9353
|
...props
|
|
9184
9354
|
}
|
|
@@ -9208,6 +9378,7 @@ function DropdownItem({
|
|
|
9208
9378
|
type: "button",
|
|
9209
9379
|
role: "menuitem",
|
|
9210
9380
|
"data-refineui": "dropdown-item",
|
|
9381
|
+
"data-scroll-edge-item": true,
|
|
9211
9382
|
"data-selected": selected || void 0,
|
|
9212
9383
|
"data-state": pressed ? "pressed" : selected ? "selected" : void 0,
|
|
9213
9384
|
disabled,
|
|
@@ -9385,6 +9556,7 @@ function DropdownSubTrigger({
|
|
|
9385
9556
|
"aria-expanded": open,
|
|
9386
9557
|
disabled: isDisabled,
|
|
9387
9558
|
"data-refineui": "dropdown-item",
|
|
9559
|
+
"data-scroll-edge-item": true,
|
|
9388
9560
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
9389
9561
|
tabIndex: -1,
|
|
9390
9562
|
className: (0, import_clsx70.clsx)(
|
|
@@ -9422,7 +9594,7 @@ function DropdownSubTrigger({
|
|
|
9422
9594
|
WebIcon,
|
|
9423
9595
|
{
|
|
9424
9596
|
name: "chevron-right",
|
|
9425
|
-
size:
|
|
9597
|
+
size: import_tokens19.iconSizes.small,
|
|
9426
9598
|
color: "currentColor",
|
|
9427
9599
|
"aria-hidden": true,
|
|
9428
9600
|
className: "ms-auto shrink-0"
|
|
@@ -9439,7 +9611,7 @@ function DropdownSubContent({ className, children, style, ...props }) {
|
|
|
9439
9611
|
const [fixedStyle, setFixedStyle] = (0, import_react34.useState)(null);
|
|
9440
9612
|
const [side, setSide] = (0, import_react34.useState)("right");
|
|
9441
9613
|
const defaultMenuW = parseCssPxLen(import_tokens3.componentSizes.dropdownMenuWidth, 180);
|
|
9442
|
-
const gapPx = parseCssPxLen(
|
|
9614
|
+
const gapPx = parseCssPxLen(import_tokens19.spacings.sizeXXXSmall, 2);
|
|
9443
9615
|
const setPanelEl = (0, import_react34.useCallback)(
|
|
9444
9616
|
(el) => {
|
|
9445
9617
|
panelRef.current = el;
|
|
@@ -9477,7 +9649,7 @@ function DropdownSubContent({ className, children, style, ...props }) {
|
|
|
9477
9649
|
top: pos.top,
|
|
9478
9650
|
left: pos.left,
|
|
9479
9651
|
minWidth: import_tokens3.componentSizes.dropdownMenuWidth,
|
|
9480
|
-
zIndex: (Number.parseInt(String(
|
|
9652
|
+
zIndex: (Number.parseInt(String(import_tokens19.zIndex.zIndexMessages), 10) || 1e4) + 100,
|
|
9481
9653
|
maxHeight: "min(60vh, 20rem)"
|
|
9482
9654
|
});
|
|
9483
9655
|
};
|
|
@@ -9630,7 +9802,7 @@ function FieldError({ className, ...props }) {
|
|
|
9630
9802
|
|
|
9631
9803
|
// src/components/Link/Link.tsx
|
|
9632
9804
|
var import_clsx74 = require("clsx");
|
|
9633
|
-
var
|
|
9805
|
+
var import_tokens20 = require("@refineui/tokens");
|
|
9634
9806
|
|
|
9635
9807
|
// src/components/Link/style.ts
|
|
9636
9808
|
var linkStyles = {
|
|
@@ -9668,7 +9840,7 @@ function Link({
|
|
|
9668
9840
|
...props,
|
|
9669
9841
|
children: [
|
|
9670
9842
|
children,
|
|
9671
|
-
showOpen && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(WebIcon, { name: "open", size:
|
|
9843
|
+
showOpen && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(WebIcon, { name: "open", size: import_tokens20.iconSizes.large, color: "currentColor" })
|
|
9672
9844
|
]
|
|
9673
9845
|
}
|
|
9674
9846
|
);
|
|
@@ -9678,7 +9850,7 @@ function Link({
|
|
|
9678
9850
|
var import_clsx76 = require("clsx");
|
|
9679
9851
|
var import_react36 = require("react");
|
|
9680
9852
|
var import_react_dom5 = require("react-dom");
|
|
9681
|
-
var
|
|
9853
|
+
var import_tokens21 = require("@refineui/tokens");
|
|
9682
9854
|
var import_animation4 = require("@refineui/utilities/animation");
|
|
9683
9855
|
var import_react37 = require("@refineui/utilities/react");
|
|
9684
9856
|
|
|
@@ -9808,8 +9980,8 @@ function MenuPopover({ className, children, style, ...props }) {
|
|
|
9808
9980
|
const [shouldRender, setShouldRender] = (0, import_react36.useState)(open);
|
|
9809
9981
|
const [isClosing, setIsClosing] = (0, import_react36.useState)(false);
|
|
9810
9982
|
const [fixedStyle, setFixedStyle] = (0, import_react36.useState)(null);
|
|
9811
|
-
const gapPx = parseCssPx(
|
|
9812
|
-
const z = Number.parseInt(String(
|
|
9983
|
+
const gapPx = parseCssPx(import_tokens21.spacings.sizeXXSmall, 4);
|
|
9984
|
+
const z = Number.parseInt(String(import_tokens21.zIndex.zIndexMessages), 10) || 1e4;
|
|
9813
9985
|
(0, import_react36.useEffect)(() => {
|
|
9814
9986
|
if (open) {
|
|
9815
9987
|
setShouldRender(true);
|
|
@@ -9824,7 +9996,7 @@ function MenuPopover({ className, children, style, ...props }) {
|
|
|
9824
9996
|
setShouldRender(false);
|
|
9825
9997
|
setIsClosing(false);
|
|
9826
9998
|
setFixedStyle(null);
|
|
9827
|
-
}, (0, import_animation4.motionMsToNumber)(
|
|
9999
|
+
}, (0, import_animation4.motionMsToNumber)(import_tokens21.semanticInteraction.duration.normal));
|
|
9828
10000
|
return () => window.clearTimeout(timeout);
|
|
9829
10001
|
}, [open, shouldRender]);
|
|
9830
10002
|
useIsomorphicLayoutEffect4(() => {
|
|
@@ -9964,9 +10136,9 @@ function MenuItem({
|
|
|
9964
10136
|
{
|
|
9965
10137
|
className: menuStyles.iconWrap,
|
|
9966
10138
|
style: {
|
|
9967
|
-
width:
|
|
9968
|
-
minWidth:
|
|
9969
|
-
height:
|
|
10139
|
+
width: import_tokens21.iconSizes.small,
|
|
10140
|
+
minWidth: import_tokens21.iconSizes.small,
|
|
10141
|
+
height: import_tokens21.iconSizes.small
|
|
9970
10142
|
},
|
|
9971
10143
|
children: startIcon
|
|
9972
10144
|
}
|
|
@@ -9991,9 +10163,9 @@ function MenuItem({
|
|
|
9991
10163
|
{
|
|
9992
10164
|
className: menuStyles.iconWrap,
|
|
9993
10165
|
style: {
|
|
9994
|
-
width:
|
|
9995
|
-
minWidth:
|
|
9996
|
-
height:
|
|
10166
|
+
width: import_tokens21.iconSizes.small,
|
|
10167
|
+
minWidth: import_tokens21.iconSizes.small,
|
|
10168
|
+
height: import_tokens21.iconSizes.small
|
|
9997
10169
|
},
|
|
9998
10170
|
children: endIcon
|
|
9999
10171
|
}
|
|
@@ -10145,9 +10317,9 @@ function MenuSubTrigger({
|
|
|
10145
10317
|
{
|
|
10146
10318
|
className: menuStyles.iconWrap,
|
|
10147
10319
|
style: {
|
|
10148
|
-
width:
|
|
10149
|
-
minWidth:
|
|
10150
|
-
height:
|
|
10320
|
+
width: import_tokens21.iconSizes.small,
|
|
10321
|
+
minWidth: import_tokens21.iconSizes.small,
|
|
10322
|
+
height: import_tokens21.iconSizes.small
|
|
10151
10323
|
},
|
|
10152
10324
|
children: startIcon
|
|
10153
10325
|
}
|
|
@@ -10170,11 +10342,11 @@ function MenuSubTrigger({
|
|
|
10170
10342
|
{
|
|
10171
10343
|
className: menuStyles.iconWrap,
|
|
10172
10344
|
style: {
|
|
10173
|
-
width:
|
|
10174
|
-
minWidth:
|
|
10175
|
-
height:
|
|
10345
|
+
width: import_tokens21.iconSizes.small,
|
|
10346
|
+
minWidth: import_tokens21.iconSizes.small,
|
|
10347
|
+
height: import_tokens21.iconSizes.small
|
|
10176
10348
|
},
|
|
10177
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(WebIcon, { name: "chevron-right", size:
|
|
10349
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(WebIcon, { name: "chevron-right", size: import_tokens21.iconSizes.small, color: "currentColor", "aria-hidden": true })
|
|
10178
10350
|
}
|
|
10179
10351
|
) })
|
|
10180
10352
|
] })
|
|
@@ -10187,8 +10359,8 @@ function MenuSubContent({ className, children, style, ...props }) {
|
|
|
10187
10359
|
const panelRef = (0, import_react36.useRef)(null);
|
|
10188
10360
|
const [fixedStyle, setFixedStyle] = (0, import_react36.useState)(null);
|
|
10189
10361
|
const [side, setSide] = (0, import_react36.useState)("right");
|
|
10190
|
-
const gapPx = parseCssPx(
|
|
10191
|
-
const z = (Number.parseInt(String(
|
|
10362
|
+
const gapPx = parseCssPx(import_tokens21.spacings.sizeXXXSmall, 2);
|
|
10363
|
+
const z = (Number.parseInt(String(import_tokens21.zIndex.zIndexMessages), 10) || 1e4) + 100;
|
|
10192
10364
|
const defaultW = parseCssPx(import_tokens3.componentSizes.menuPanelWidth, 200);
|
|
10193
10365
|
const setPanelEl = (0, import_react36.useCallback)(
|
|
10194
10366
|
(el) => {
|
|
@@ -10288,7 +10460,7 @@ function MenuSubContent({ className, children, style, ...props }) {
|
|
|
10288
10460
|
var import_clsx78 = require("clsx");
|
|
10289
10461
|
var import_react38 = require("react");
|
|
10290
10462
|
var import_react_dom6 = require("react-dom");
|
|
10291
|
-
var
|
|
10463
|
+
var import_tokens22 = require("@refineui/tokens");
|
|
10292
10464
|
var import_animation5 = require("@refineui/utilities/animation");
|
|
10293
10465
|
|
|
10294
10466
|
// src/components/NavigationMenu/style.ts
|
|
@@ -10387,8 +10559,8 @@ function NavigationMenu({
|
|
|
10387
10559
|
const openTimerRef = (0, import_react38.useRef)(null);
|
|
10388
10560
|
const closeTimerRef = (0, import_react38.useRef)(null);
|
|
10389
10561
|
const rootRef = (0, import_react38.useRef)(null);
|
|
10390
|
-
const delayDuration = delayDurationProp ?? (0, import_animation5.motionMsToNumber)(
|
|
10391
|
-
const skipDelayDuration = skipDelayDurationProp ?? (0, import_animation5.motionMsToNumber)(
|
|
10562
|
+
const delayDuration = delayDurationProp ?? (0, import_animation5.motionMsToNumber)(import_tokens22.semanticInteraction.duration.normal);
|
|
10563
|
+
const skipDelayDuration = skipDelayDurationProp ?? (0, import_animation5.motionMsToNumber)(import_tokens22.semanticInteraction.duration.fast);
|
|
10392
10564
|
const clearTimers = (0, import_react38.useCallback)(() => {
|
|
10393
10565
|
if (openTimerRef.current != null) {
|
|
10394
10566
|
window.clearTimeout(openTimerRef.current);
|
|
@@ -10665,7 +10837,7 @@ function NavigationMenuTrigger({
|
|
|
10665
10837
|
WebIcon,
|
|
10666
10838
|
{
|
|
10667
10839
|
name: "chevron-down",
|
|
10668
|
-
size:
|
|
10840
|
+
size: import_tokens22.iconSizes.xsmall,
|
|
10669
10841
|
color: "currentColor",
|
|
10670
10842
|
className: (0, import_clsx78.clsx)(
|
|
10671
10843
|
navigationMenuStyles.chevron,
|
|
@@ -10708,7 +10880,7 @@ function NavigationMenuContent({
|
|
|
10708
10880
|
const timeout = window.setTimeout(() => {
|
|
10709
10881
|
setShouldRender(false);
|
|
10710
10882
|
setIsClosing(false);
|
|
10711
|
-
}, (0, import_animation5.motionMsToNumber)(
|
|
10883
|
+
}, (0, import_animation5.motionMsToNumber)(import_tokens22.semanticInteraction.duration.fast));
|
|
10712
10884
|
return () => window.clearTimeout(timeout);
|
|
10713
10885
|
}, [item.open, shouldRender]);
|
|
10714
10886
|
useIsomorphicLayoutEffect5(() => {
|
|
@@ -10720,7 +10892,7 @@ function NavigationMenuContent({
|
|
|
10720
10892
|
if (!content2) return;
|
|
10721
10893
|
const triggerRect = trigger.getBoundingClientRect();
|
|
10722
10894
|
const contentWidth = content2.offsetWidth;
|
|
10723
|
-
const edge = Number.parseFloat(
|
|
10895
|
+
const edge = Number.parseFloat(import_tokens22.spacings.sizeMedium) || 8;
|
|
10724
10896
|
const left = Math.max(
|
|
10725
10897
|
edge,
|
|
10726
10898
|
Math.min(triggerRect.left, window.innerWidth - contentWidth - edge)
|
|
@@ -10729,7 +10901,7 @@ function NavigationMenuContent({
|
|
|
10729
10901
|
position: "fixed",
|
|
10730
10902
|
top: triggerRect.bottom,
|
|
10731
10903
|
left,
|
|
10732
|
-
zIndex: Number.parseInt(String(
|
|
10904
|
+
zIndex: Number.parseInt(String(import_tokens22.zIndex.zIndexMessages), 10) || 1e4
|
|
10733
10905
|
});
|
|
10734
10906
|
};
|
|
10735
10907
|
updatePosition();
|
|
@@ -10871,6 +11043,7 @@ function NavigationMenuIndicator({ className, style, ...props }) {
|
|
|
10871
11043
|
|
|
10872
11044
|
// src/components/Sidebar/Sidebar.tsx
|
|
10873
11045
|
var import_clsx80 = require("clsx");
|
|
11046
|
+
var import_react39 = require("react");
|
|
10874
11047
|
|
|
10875
11048
|
// src/components/Sidebar/style.ts
|
|
10876
11049
|
var import_clsx79 = require("clsx");
|
|
@@ -10889,7 +11062,9 @@ var sidebarStyles = {
|
|
|
10889
11062
|
componentTextClass(componentTypographyTokens.sidebar.brand),
|
|
10890
11063
|
"m-0 flex min-w-0 items-center gap-refineui-size-small text-refineui-alias-foreground-primary"
|
|
10891
11064
|
),
|
|
10892
|
-
|
|
11065
|
+
/** Scrolls through a built-in ScrollArea; padding sits inside the viewport so rows scroll under the edges. */
|
|
11066
|
+
content: "flex min-h-0 flex-1 flex-col",
|
|
11067
|
+
contentViewport: "box-border px-refineui-size-medium py-refineui-size-medium",
|
|
10893
11068
|
nav: "flex min-h-0 flex-col gap-refineui-size-x-large",
|
|
10894
11069
|
group: "flex min-w-0 flex-col gap-refineui-size-xx-small",
|
|
10895
11070
|
groupLabel: (0, import_clsx79.clsx)(
|
|
@@ -10914,6 +11089,7 @@ var sidebarStyles = {
|
|
|
10914
11089
|
|
|
10915
11090
|
// src/components/Sidebar/Sidebar.tsx
|
|
10916
11091
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
11092
|
+
var SidebarScrollContext = (0, import_react39.createContext)(false);
|
|
10917
11093
|
function Sidebar({ className, ...props }) {
|
|
10918
11094
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
10919
11095
|
"aside",
|
|
@@ -10944,13 +11120,14 @@ function SidebarBrand({ className, ...props }) {
|
|
|
10944
11120
|
}
|
|
10945
11121
|
);
|
|
10946
11122
|
}
|
|
10947
|
-
function SidebarContent({ className, ...props }) {
|
|
11123
|
+
function SidebarContent({ className, children, ...props }) {
|
|
10948
11124
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
10949
11125
|
"div",
|
|
10950
11126
|
{
|
|
10951
11127
|
"data-refineui": "sidebar-content",
|
|
10952
11128
|
className: (0, import_clsx80.clsx)(sidebarStyles.content, className),
|
|
10953
|
-
...props
|
|
11129
|
+
...props,
|
|
11130
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ScrollAreaRegion, { type: "hover", viewportClassName: sidebarStyles.contentViewport, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SidebarScrollContext.Provider, { value: true, children }) })
|
|
10954
11131
|
}
|
|
10955
11132
|
);
|
|
10956
11133
|
}
|
|
@@ -10976,10 +11153,12 @@ function SidebarGroup({ className, ...props }) {
|
|
|
10976
11153
|
);
|
|
10977
11154
|
}
|
|
10978
11155
|
function SidebarGroupLabel({ className, ...props }) {
|
|
11156
|
+
const inScroll = (0, import_react39.useContext)(SidebarScrollContext);
|
|
10979
11157
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
10980
11158
|
"p",
|
|
10981
11159
|
{
|
|
10982
11160
|
"data-refineui": "sidebar-group-label",
|
|
11161
|
+
"data-scroll-edge-item": inScroll || void 0,
|
|
10983
11162
|
className: (0, import_clsx80.clsx)(sidebarStyles.groupLabel, className),
|
|
10984
11163
|
...props
|
|
10985
11164
|
}
|
|
@@ -10992,10 +11171,12 @@ function SidebarLink({
|
|
|
10992
11171
|
...props
|
|
10993
11172
|
}) {
|
|
10994
11173
|
const disabled = ariaDisabled === true || ariaDisabled === "true";
|
|
11174
|
+
const inScroll = (0, import_react39.useContext)(SidebarScrollContext);
|
|
10995
11175
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
10996
11176
|
"a",
|
|
10997
11177
|
{
|
|
10998
11178
|
"data-refineui": "sidebar-link",
|
|
11179
|
+
"data-scroll-edge-item": inScroll || void 0,
|
|
10999
11180
|
"data-active": active || void 0,
|
|
11000
11181
|
"aria-current": active ? "page" : void 0,
|
|
11001
11182
|
"aria-disabled": disabled || void 0,
|
|
@@ -11023,8 +11204,8 @@ function SidebarFooter({ className, ...props }) {
|
|
|
11023
11204
|
|
|
11024
11205
|
// src/components/Sidebar/SidebarPeek.tsx
|
|
11025
11206
|
var import_clsx82 = require("clsx");
|
|
11026
|
-
var
|
|
11027
|
-
var
|
|
11207
|
+
var import_react40 = require("react");
|
|
11208
|
+
var import_tokens23 = require("@refineui/tokens");
|
|
11028
11209
|
var import_animation6 = require("@refineui/utilities/animation");
|
|
11029
11210
|
|
|
11030
11211
|
// src/components/Sidebar/peekStyle.ts
|
|
@@ -11050,12 +11231,12 @@ var sidebarPeekStyles = {
|
|
|
11050
11231
|
|
|
11051
11232
|
// src/components/Sidebar/SidebarPeek.tsx
|
|
11052
11233
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
11053
|
-
var PEEK_OPEN_DELAY_MS = (0, import_animation6.motionMsToNumber)(
|
|
11054
|
-
var PEEK_CLOSE_DELAY_MS = (0, import_animation6.motionMsToNumber)(
|
|
11055
|
-
var PEEK_BRIDGE_DELAY_MS = (0, import_animation6.motionMsToNumber)(
|
|
11056
|
-
var SidebarPeekContext = (0,
|
|
11234
|
+
var PEEK_OPEN_DELAY_MS = (0, import_animation6.motionMsToNumber)(import_tokens23.semanticInteraction.duration.medium);
|
|
11235
|
+
var PEEK_CLOSE_DELAY_MS = (0, import_animation6.motionMsToNumber)(import_tokens23.semanticInteraction.duration.medium);
|
|
11236
|
+
var PEEK_BRIDGE_DELAY_MS = (0, import_animation6.motionMsToNumber)(import_tokens23.semanticInteraction.duration.slow);
|
|
11237
|
+
var SidebarPeekContext = (0, import_react40.createContext)(null);
|
|
11057
11238
|
function useSidebarPeekContext(component) {
|
|
11058
|
-
const ctx = (0,
|
|
11239
|
+
const ctx = (0, import_react40.useContext)(SidebarPeekContext);
|
|
11059
11240
|
if (!ctx) throw new Error(`${component} must be used within <SidebarPeek>.`);
|
|
11060
11241
|
return ctx;
|
|
11061
11242
|
}
|
|
@@ -11069,38 +11250,38 @@ function SidebarPeek({
|
|
|
11069
11250
|
children,
|
|
11070
11251
|
...props
|
|
11071
11252
|
}) {
|
|
11072
|
-
const rootRef = (0,
|
|
11073
|
-
const widthPercentRef = (0,
|
|
11253
|
+
const rootRef = (0, import_react40.useRef)(null);
|
|
11254
|
+
const widthPercentRef = (0, import_react40.useRef)(widthPercent);
|
|
11074
11255
|
widthPercentRef.current = widthPercent;
|
|
11075
|
-
const [peekOpen, setPeekOpen] = (0,
|
|
11076
|
-
const [flyoutWidthPx, setFlyoutWidthPx] = (0,
|
|
11077
|
-
const peekOpenTimerRef = (0,
|
|
11078
|
-
const peekCloseTimerRef = (0,
|
|
11079
|
-
const clearPeekOpenTimer = (0,
|
|
11256
|
+
const [peekOpen, setPeekOpen] = (0, import_react40.useState)(false);
|
|
11257
|
+
const [flyoutWidthPx, setFlyoutWidthPx] = (0, import_react40.useState)();
|
|
11258
|
+
const peekOpenTimerRef = (0, import_react40.useRef)(null);
|
|
11259
|
+
const peekCloseTimerRef = (0, import_react40.useRef)(null);
|
|
11260
|
+
const clearPeekOpenTimer = (0, import_react40.useCallback)(() => {
|
|
11080
11261
|
if (peekOpenTimerRef.current != null) {
|
|
11081
11262
|
window.clearTimeout(peekOpenTimerRef.current);
|
|
11082
11263
|
peekOpenTimerRef.current = null;
|
|
11083
11264
|
}
|
|
11084
11265
|
}, []);
|
|
11085
|
-
const clearPeekCloseTimer = (0,
|
|
11266
|
+
const clearPeekCloseTimer = (0, import_react40.useCallback)(() => {
|
|
11086
11267
|
if (peekCloseTimerRef.current != null) {
|
|
11087
11268
|
window.clearTimeout(peekCloseTimerRef.current);
|
|
11088
11269
|
peekCloseTimerRef.current = null;
|
|
11089
11270
|
}
|
|
11090
11271
|
}, []);
|
|
11091
|
-
const closePeekImmediate = (0,
|
|
11272
|
+
const closePeekImmediate = (0, import_react40.useCallback)(() => {
|
|
11092
11273
|
clearPeekOpenTimer();
|
|
11093
11274
|
clearPeekCloseTimer();
|
|
11094
11275
|
setPeekOpen(false);
|
|
11095
11276
|
}, [clearPeekCloseTimer, clearPeekOpenTimer]);
|
|
11096
|
-
const closePeek = (0,
|
|
11277
|
+
const closePeek = (0, import_react40.useCallback)(() => {
|
|
11097
11278
|
closePeekImmediate();
|
|
11098
11279
|
}, [closePeekImmediate]);
|
|
11099
|
-
(0,
|
|
11280
|
+
(0, import_react40.useEffect)(() => {
|
|
11100
11281
|
if (enabled) return;
|
|
11101
11282
|
closePeek();
|
|
11102
11283
|
}, [closePeek, enabled]);
|
|
11103
|
-
(0,
|
|
11284
|
+
(0, import_react40.useEffect)(() => {
|
|
11104
11285
|
const el = rootRef.current;
|
|
11105
11286
|
if (!el) return;
|
|
11106
11287
|
const syncFlyoutWidth = () => {
|
|
@@ -11111,8 +11292,8 @@ function SidebarPeek({
|
|
|
11111
11292
|
observer.observe(el);
|
|
11112
11293
|
return () => observer.disconnect();
|
|
11113
11294
|
}, []);
|
|
11114
|
-
const pointerRef = (0,
|
|
11115
|
-
(0,
|
|
11295
|
+
const pointerRef = (0, import_react40.useRef)({ x: 0, y: 0 });
|
|
11296
|
+
(0, import_react40.useEffect)(() => {
|
|
11116
11297
|
if (!enabled) return;
|
|
11117
11298
|
const onPointerMove = (event) => {
|
|
11118
11299
|
pointerRef.current = { x: event.clientX, y: event.clientY };
|
|
@@ -11120,7 +11301,7 @@ function SidebarPeek({
|
|
|
11120
11301
|
document.addEventListener("pointermove", onPointerMove, { passive: true });
|
|
11121
11302
|
return () => document.removeEventListener("pointermove", onPointerMove);
|
|
11122
11303
|
}, [enabled]);
|
|
11123
|
-
(0,
|
|
11304
|
+
(0, import_react40.useEffect)(() => {
|
|
11124
11305
|
if (!peekOpen) return;
|
|
11125
11306
|
const onKeyDown = (event) => {
|
|
11126
11307
|
if (event.key === "Escape") closePeek();
|
|
@@ -11128,17 +11309,17 @@ function SidebarPeek({
|
|
|
11128
11309
|
window.addEventListener("keydown", onKeyDown);
|
|
11129
11310
|
return () => window.removeEventListener("keydown", onKeyDown);
|
|
11130
11311
|
}, [closePeek, peekOpen]);
|
|
11131
|
-
(0,
|
|
11312
|
+
(0, import_react40.useEffect)(
|
|
11132
11313
|
() => () => {
|
|
11133
11314
|
clearPeekOpenTimer();
|
|
11134
11315
|
clearPeekCloseTimer();
|
|
11135
11316
|
},
|
|
11136
11317
|
[clearPeekCloseTimer, clearPeekOpenTimer]
|
|
11137
11318
|
);
|
|
11138
|
-
const cancelPeekOpen = (0,
|
|
11319
|
+
const cancelPeekOpen = (0, import_react40.useCallback)(() => {
|
|
11139
11320
|
clearPeekOpenTimer();
|
|
11140
11321
|
}, [clearPeekOpenTimer]);
|
|
11141
|
-
const schedulePeekOpen = (0,
|
|
11322
|
+
const schedulePeekOpen = (0, import_react40.useCallback)(() => {
|
|
11142
11323
|
if (!enabled || peekOpen) return;
|
|
11143
11324
|
clearPeekCloseTimer();
|
|
11144
11325
|
clearPeekOpenTimer();
|
|
@@ -11147,7 +11328,7 @@ function SidebarPeek({
|
|
|
11147
11328
|
peekOpenTimerRef.current = null;
|
|
11148
11329
|
}, PEEK_OPEN_DELAY_MS);
|
|
11149
11330
|
}, [clearPeekCloseTimer, clearPeekOpenTimer, enabled, peekOpen]);
|
|
11150
|
-
const schedulePeekClose = (0,
|
|
11331
|
+
const schedulePeekClose = (0, import_react40.useCallback)(
|
|
11151
11332
|
(delay = PEEK_CLOSE_DELAY_MS) => {
|
|
11152
11333
|
clearPeekOpenTimer();
|
|
11153
11334
|
if (!peekOpen) return;
|
|
@@ -11159,10 +11340,10 @@ function SidebarPeek({
|
|
|
11159
11340
|
},
|
|
11160
11341
|
[clearPeekCloseTimer, clearPeekOpenTimer, closePeekImmediate, peekOpen]
|
|
11161
11342
|
);
|
|
11162
|
-
const cancelPeekClose = (0,
|
|
11343
|
+
const cancelPeekClose = (0, import_react40.useCallback)(() => {
|
|
11163
11344
|
clearPeekCloseTimer();
|
|
11164
11345
|
}, [clearPeekCloseTimer]);
|
|
11165
|
-
(0,
|
|
11346
|
+
(0, import_react40.useEffect)(() => {
|
|
11166
11347
|
if (!peekOpen || !enabled) return;
|
|
11167
11348
|
const frame = requestAnimationFrame(() => {
|
|
11168
11349
|
const root = rootRef.current;
|
|
@@ -11184,7 +11365,7 @@ function SidebarPeek({
|
|
|
11184
11365
|
});
|
|
11185
11366
|
return () => cancelAnimationFrame(frame);
|
|
11186
11367
|
}, [cancelPeekClose, enabled, peekOpen]);
|
|
11187
|
-
const contextValue = (0,
|
|
11368
|
+
const contextValue = (0, import_react40.useMemo)(
|
|
11188
11369
|
() => ({
|
|
11189
11370
|
enabled,
|
|
11190
11371
|
mode,
|
|
@@ -11303,12 +11484,12 @@ function useSidebarPeek() {
|
|
|
11303
11484
|
}
|
|
11304
11485
|
|
|
11305
11486
|
// src/components/Sidebar/SidebarProvider.tsx
|
|
11306
|
-
var
|
|
11307
|
-
var
|
|
11487
|
+
var import_react41 = require("react");
|
|
11488
|
+
var import_react42 = require("@refineui/utilities/react");
|
|
11308
11489
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
11309
|
-
var SidebarContext = (0,
|
|
11490
|
+
var SidebarContext = (0, import_react41.createContext)(null);
|
|
11310
11491
|
function useSidebarContext(component) {
|
|
11311
|
-
const value = (0,
|
|
11492
|
+
const value = (0, import_react41.useContext)(SidebarContext);
|
|
11312
11493
|
if (!value) throw new Error(`${component} must be used within <SidebarProvider>.`);
|
|
11313
11494
|
return value;
|
|
11314
11495
|
}
|
|
@@ -11322,22 +11503,22 @@ function SidebarProvider({
|
|
|
11322
11503
|
id,
|
|
11323
11504
|
children
|
|
11324
11505
|
}) {
|
|
11325
|
-
const [uncontrolled, setUncontrolled] = (0,
|
|
11506
|
+
const [uncontrolled, setUncontrolled] = (0, import_react41.useState)(defaultOpen);
|
|
11326
11507
|
const open = openProp ?? uncontrolled;
|
|
11327
|
-
const generatedId = (0,
|
|
11508
|
+
const generatedId = (0, import_react41.useId)();
|
|
11328
11509
|
const sidebarId = id ?? generatedId;
|
|
11329
|
-
const toggle = (0,
|
|
11510
|
+
const toggle = (0, import_react41.useCallback)(() => {
|
|
11330
11511
|
const next = !open;
|
|
11331
11512
|
if (openProp === void 0) setUncontrolled(next);
|
|
11332
11513
|
onOpenChange?.(next);
|
|
11333
11514
|
}, [onOpenChange, open, openProp]);
|
|
11334
|
-
const value = (0,
|
|
11515
|
+
const value = (0, import_react41.useMemo)(
|
|
11335
11516
|
() => ({ open, sidebarId, toggle }),
|
|
11336
11517
|
[open, sidebarId, toggle]
|
|
11337
11518
|
);
|
|
11338
11519
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(SidebarContext.Provider, { value, children });
|
|
11339
11520
|
}
|
|
11340
|
-
var SidebarTrigger = (0,
|
|
11521
|
+
var SidebarTrigger = (0, import_react41.forwardRef)(function SidebarTrigger2({
|
|
11341
11522
|
asChild = false,
|
|
11342
11523
|
onClick,
|
|
11343
11524
|
className,
|
|
@@ -11362,7 +11543,7 @@ var SidebarTrigger = (0, import_react40.forwardRef)(function SidebarTrigger2({
|
|
|
11362
11543
|
if (!event.defaultPrevented) toggle();
|
|
11363
11544
|
}
|
|
11364
11545
|
};
|
|
11365
|
-
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
11546
|
+
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react42.Slot, { ...shared, children });
|
|
11366
11547
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
11367
11548
|
Button,
|
|
11368
11549
|
{
|
|
@@ -11379,7 +11560,7 @@ var SidebarTrigger = (0, import_react40.forwardRef)(function SidebarTrigger2({
|
|
|
11379
11560
|
|
|
11380
11561
|
// src/components/Pagination/Pagination.tsx
|
|
11381
11562
|
var import_clsx84 = require("clsx");
|
|
11382
|
-
var
|
|
11563
|
+
var import_tokens24 = require("@refineui/tokens");
|
|
11383
11564
|
var import_color10 = require("@refineui/utilities/color");
|
|
11384
11565
|
|
|
11385
11566
|
// src/components/Pagination/style.ts
|
|
@@ -11442,7 +11623,7 @@ function PaginationNavButton({
|
|
|
11442
11623
|
WebIcon,
|
|
11443
11624
|
{
|
|
11444
11625
|
name: isPrev ? "chevron-left" : "chevron-right",
|
|
11445
|
-
size:
|
|
11626
|
+
size: import_tokens24.iconSizes.medium,
|
|
11446
11627
|
color: iconColor,
|
|
11447
11628
|
fallback: isPrev ? "\u2039" : "\u203A"
|
|
11448
11629
|
}
|
|
@@ -11469,7 +11650,7 @@ function PaginationEllipsis({ className, ...props }) {
|
|
|
11469
11650
|
WebIcon,
|
|
11470
11651
|
{
|
|
11471
11652
|
name: "more-horizontal",
|
|
11472
|
-
size:
|
|
11653
|
+
size: import_tokens24.iconSizes.medium,
|
|
11473
11654
|
color: (0, import_color10.resolveColorTokenValue)(componentColorTokens.pagination.navIcon.default),
|
|
11474
11655
|
fallback: "\u2026"
|
|
11475
11656
|
}
|
|
@@ -11483,14 +11664,14 @@ function Pagination(props) {
|
|
|
11483
11664
|
|
|
11484
11665
|
// src/components/PopOver/PopOver.tsx
|
|
11485
11666
|
var import_clsx85 = require("clsx");
|
|
11486
|
-
var
|
|
11487
|
-
var
|
|
11667
|
+
var import_react44 = require("react");
|
|
11668
|
+
var import_tokens26 = require("@refineui/tokens");
|
|
11488
11669
|
var import_color11 = require("@refineui/utilities/color");
|
|
11489
|
-
var
|
|
11670
|
+
var import_react45 = require("@refineui/utilities/react");
|
|
11490
11671
|
|
|
11491
11672
|
// src/components/shared/FloatingSurface.tsx
|
|
11492
|
-
var
|
|
11493
|
-
var
|
|
11673
|
+
var import_react43 = require("react");
|
|
11674
|
+
var import_tokens25 = require("@refineui/tokens");
|
|
11494
11675
|
|
|
11495
11676
|
// src/components/shared/floatingOutline.ts
|
|
11496
11677
|
var PATH_PRECISION = 100;
|
|
@@ -11587,11 +11768,15 @@ function buildFloatingOutline({
|
|
|
11587
11768
|
|
|
11588
11769
|
// src/components/shared/FloatingSurface.tsx
|
|
11589
11770
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
11590
|
-
var useIsomorphicLayoutEffect6 = typeof document !== "undefined" ?
|
|
11591
|
-
var SHADOW_BLEED = parseFloat(
|
|
11592
|
-
var STROKE = parseFloat(
|
|
11771
|
+
var useIsomorphicLayoutEffect6 = typeof document !== "undefined" ? import_react43.useLayoutEffect : import_react43.useEffect;
|
|
11772
|
+
var SHADOW_BLEED = parseFloat(import_tokens25.spacings.sizeXXXLarge);
|
|
11773
|
+
var STROKE = parseFloat(import_tokens25.strokeWidths.strokeWidthHairline);
|
|
11774
|
+
function svgPathMask(shape, width, height, bleed) {
|
|
11775
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${width + bleed * 2}" height="${height + bleed * 2}"><path transform="translate(${bleed} ${bleed})" d="${shape}"/></svg>`;
|
|
11776
|
+
return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
|
|
11777
|
+
}
|
|
11593
11778
|
function usePanelSize(panelRef) {
|
|
11594
|
-
const [size, setSize] = (0,
|
|
11779
|
+
const [size, setSize] = (0, import_react43.useState)(null);
|
|
11595
11780
|
useIsomorphicLayoutEffect6(() => {
|
|
11596
11781
|
const panel = panelRef.current;
|
|
11597
11782
|
if (!panel) return;
|
|
@@ -11648,8 +11833,8 @@ function FloatingSurface({
|
|
|
11648
11833
|
const shape = buildFloatingOutline(geometry);
|
|
11649
11834
|
const outline = buildFloatingOutline({ ...geometry, inset: STROKE / 2 });
|
|
11650
11835
|
const box = floatingShapeSize(size.width, size.height, side, bh);
|
|
11651
|
-
const
|
|
11652
|
-
const
|
|
11836
|
+
const holeMask = `linear-gradient(black 0 0), ${svgPathMask(shape, box.width, box.height, SHADOW_BLEED)}`;
|
|
11837
|
+
const surfaceMask = svgPathMask(shape, box.width, box.height, 0);
|
|
11653
11838
|
const rootStyle = {
|
|
11654
11839
|
width: box.width,
|
|
11655
11840
|
height: box.height,
|
|
@@ -11667,10 +11852,19 @@ function FloatingSurface({
|
|
|
11667
11852
|
maskRepeat: "no-repeat",
|
|
11668
11853
|
WebkitMaskRepeat: "no-repeat"
|
|
11669
11854
|
};
|
|
11855
|
+
const surfaceStyle = {
|
|
11856
|
+
backgroundColor,
|
|
11857
|
+
maskImage: surfaceMask,
|
|
11858
|
+
WebkitMaskImage: surfaceMask,
|
|
11859
|
+
maskSize: "100% 100%",
|
|
11860
|
+
WebkitMaskSize: "100% 100%",
|
|
11861
|
+
maskRepeat: "no-repeat",
|
|
11862
|
+
WebkitMaskRepeat: "no-repeat"
|
|
11863
|
+
};
|
|
11670
11864
|
const clip = `path("${shape}")`;
|
|
11671
11865
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { "data-refineui": "floating-chrome", "aria-hidden": true, className: "pointer-events-none absolute -z-1", style: rootStyle, children: [
|
|
11672
11866
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "absolute", style: shadowStyle, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { "data-refineui": "floating-shadow", className: "absolute", style: { inset: SHADOW_BLEED }, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "absolute inset-0", style: { clipPath: clip, backgroundColor: borderColor } }) }) }),
|
|
11673
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { "data-refineui": "floating-surface", className: "absolute inset-0", style:
|
|
11867
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { "data-refineui": "floating-surface", className: "absolute inset-0", style: surfaceStyle }),
|
|
11674
11868
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
11675
11869
|
"svg",
|
|
11676
11870
|
{
|
|
@@ -11693,7 +11887,7 @@ var popoverStyles = {
|
|
|
11693
11887
|
floatingRoot: "absolute z-refineui-popup",
|
|
11694
11888
|
panelWrap: "relative inline-block min-w-refineui-popover-panel-width",
|
|
11695
11889
|
/** Fill, stroke, and shadow come from `FloatingSurface`; the transparent border keeps the box size. */
|
|
11696
|
-
panel: "relative z-0 box-border min-w-refineui-popover-panel-width rounded-refineui-xx-large border-refineui-
|
|
11890
|
+
panel: "relative z-0 box-border min-w-refineui-popover-panel-width rounded-refineui-xx-large border-refineui-hairline border-transparent outline-none"
|
|
11697
11891
|
};
|
|
11698
11892
|
function popoverFloatingClasses(placement, align) {
|
|
11699
11893
|
if (placement === "bottom") {
|
|
@@ -11718,15 +11912,15 @@ function popoverFloatingClasses(placement, align) {
|
|
|
11718
11912
|
|
|
11719
11913
|
// src/components/PopOver/PopOver.tsx
|
|
11720
11914
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
11721
|
-
var PopoverContext = (0,
|
|
11915
|
+
var PopoverContext = (0, import_react44.createContext)(null);
|
|
11722
11916
|
function usePopoverContext(component) {
|
|
11723
|
-
const ctx = (0,
|
|
11917
|
+
const ctx = (0, import_react44.useContext)(PopoverContext);
|
|
11724
11918
|
if (!ctx) throw new Error(`${component} must be used within <Popover>`);
|
|
11725
11919
|
return ctx;
|
|
11726
11920
|
}
|
|
11727
|
-
var BEAK_TIP_GAP =
|
|
11921
|
+
var BEAK_TIP_GAP = import_tokens26.spacings.sizeXXSmall;
|
|
11728
11922
|
var POPOVER_GAP = `calc(${import_tokens3.componentSizes.popoverBeakHeight} + ${BEAK_TIP_GAP})`;
|
|
11729
|
-
var SIDE_BEAK_INSET =
|
|
11923
|
+
var SIDE_BEAK_INSET = import_tokens26.spacings.sizeMedium;
|
|
11730
11924
|
var beakSideByPlacement = {
|
|
11731
11925
|
bottom: "top",
|
|
11732
11926
|
top: "bottom",
|
|
@@ -11740,35 +11934,35 @@ function floatingGapStyle(placement) {
|
|
|
11740
11934
|
return { marginLeft: POPOVER_GAP };
|
|
11741
11935
|
}
|
|
11742
11936
|
function Popover({ children, className, open: openProp, defaultOpen = false, onOpenChange, ...props }) {
|
|
11743
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
11937
|
+
const [internalOpen, setInternalOpen] = (0, import_react44.useState)(defaultOpen);
|
|
11744
11938
|
const open = openProp ?? internalOpen;
|
|
11745
|
-
const setOpen = (0,
|
|
11939
|
+
const setOpen = (0, import_react44.useCallback)(
|
|
11746
11940
|
(next) => {
|
|
11747
11941
|
if (openProp === void 0) setInternalOpen(next);
|
|
11748
11942
|
onOpenChange?.(next);
|
|
11749
11943
|
},
|
|
11750
11944
|
[openProp, onOpenChange]
|
|
11751
11945
|
);
|
|
11752
|
-
const toggle = (0,
|
|
11753
|
-
const containerRef = (0,
|
|
11754
|
-
const contentRef = (0,
|
|
11755
|
-
const triggerRef = (0,
|
|
11756
|
-
const contentId = (0,
|
|
11757
|
-
(0,
|
|
11946
|
+
const toggle = (0, import_react44.useCallback)(() => setOpen(!open), [open, setOpen]);
|
|
11947
|
+
const containerRef = (0, import_react44.useRef)(null);
|
|
11948
|
+
const contentRef = (0, import_react44.useRef)(null);
|
|
11949
|
+
const triggerRef = (0, import_react44.useRef)(null);
|
|
11950
|
+
const contentId = (0, import_react44.useId)();
|
|
11951
|
+
(0, import_react44.useEffect)(() => {
|
|
11758
11952
|
const handler = (e) => {
|
|
11759
11953
|
if (containerRef.current && !containerRef.current.contains(e.target)) setOpen(false);
|
|
11760
11954
|
};
|
|
11761
11955
|
if (open) document.addEventListener("mousedown", handler);
|
|
11762
11956
|
return () => document.removeEventListener("mousedown", handler);
|
|
11763
11957
|
}, [open, setOpen]);
|
|
11764
|
-
(0,
|
|
11958
|
+
(0, import_react44.useEffect)(() => {
|
|
11765
11959
|
const onKey = (e) => {
|
|
11766
11960
|
if (e instanceof KeyboardEvent && e.key === "Escape") setOpen(false);
|
|
11767
11961
|
};
|
|
11768
11962
|
if (open) document.addEventListener("keydown", onKey);
|
|
11769
11963
|
return () => document.removeEventListener("keydown", onKey);
|
|
11770
11964
|
}, [open, setOpen]);
|
|
11771
|
-
const onTriggerKeyDown = (0,
|
|
11965
|
+
const onTriggerKeyDown = (0, import_react44.useCallback)(
|
|
11772
11966
|
(e) => {
|
|
11773
11967
|
if (e.key === "Enter" || e.key === " ") {
|
|
11774
11968
|
e.preventDefault();
|
|
@@ -11777,7 +11971,7 @@ function Popover({ children, className, open: openProp, defaultOpen = false, onO
|
|
|
11777
11971
|
},
|
|
11778
11972
|
[toggle]
|
|
11779
11973
|
);
|
|
11780
|
-
const value = (0,
|
|
11974
|
+
const value = (0, import_react44.useMemo)(
|
|
11781
11975
|
() => ({
|
|
11782
11976
|
open,
|
|
11783
11977
|
setOpen,
|
|
@@ -11803,11 +11997,11 @@ function Popover({ children, className, open: openProp, defaultOpen = false, onO
|
|
|
11803
11997
|
}
|
|
11804
11998
|
function PopoverTrigger({ children, className, ...props }) {
|
|
11805
11999
|
const { open, toggle, triggerRef, contentId, onTriggerKeyDown } = usePopoverContext("PopoverTrigger");
|
|
11806
|
-
const mergeEl = (0,
|
|
12000
|
+
const mergeEl = (0, import_react45.getMergeableTriggerChild)(children);
|
|
11807
12001
|
if (mergeEl) {
|
|
11808
12002
|
const passthrough = props;
|
|
11809
12003
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
11810
|
-
|
|
12004
|
+
import_react45.Slot,
|
|
11811
12005
|
{
|
|
11812
12006
|
ref: triggerRef,
|
|
11813
12007
|
...props,
|
|
@@ -11894,7 +12088,7 @@ function PopoverContent({
|
|
|
11894
12088
|
style: {
|
|
11895
12089
|
...styleProp && typeof styleProp === "object" ? styleProp : {},
|
|
11896
12090
|
minWidth: import_tokens3.componentSizes.popoverPanelWidth,
|
|
11897
|
-
padding:
|
|
12091
|
+
padding: import_tokens26.spacings.sizeLarge,
|
|
11898
12092
|
color: (0, import_color11.resolveColorTokenValue)(palette.foreground)
|
|
11899
12093
|
},
|
|
11900
12094
|
...props,
|
|
@@ -11907,7 +12101,7 @@ function PopoverContent({
|
|
|
11907
12101
|
panelRef: contentRef,
|
|
11908
12102
|
side: beakSideByPlacement[placement],
|
|
11909
12103
|
align,
|
|
11910
|
-
radius:
|
|
12104
|
+
radius: import_tokens26.borderRadii.roundedXXLarge,
|
|
11911
12105
|
beakWidth: import_tokens3.componentSizes.popoverBeakWidth,
|
|
11912
12106
|
beakHeight: import_tokens3.componentSizes.popoverBeakHeight,
|
|
11913
12107
|
tipRadius: import_tokens3.componentSizes.popoverBeakTipRadius,
|
|
@@ -11997,7 +12191,7 @@ function Skeleton({
|
|
|
11997
12191
|
|
|
11998
12192
|
// src/components/Slider/Slider.tsx
|
|
11999
12193
|
var import_clsx87 = require("clsx");
|
|
12000
|
-
var
|
|
12194
|
+
var import_react46 = require("react");
|
|
12001
12195
|
|
|
12002
12196
|
// src/components/Slider/style.ts
|
|
12003
12197
|
var sliderStyles = {
|
|
@@ -12023,7 +12217,7 @@ function Slider({
|
|
|
12023
12217
|
style,
|
|
12024
12218
|
...props
|
|
12025
12219
|
}) {
|
|
12026
|
-
const [internalFillPct, setInternalFillPct] = (0,
|
|
12220
|
+
const [internalFillPct, setInternalFillPct] = (0, import_react46.useState)(() => {
|
|
12027
12221
|
const v = defaultValue !== void 0 ? Number(defaultValue) : (min + max) / 2;
|
|
12028
12222
|
return clampPct((v - min) / (max - min) * 100);
|
|
12029
12223
|
});
|
|
@@ -12064,8 +12258,8 @@ function Slider({
|
|
|
12064
12258
|
|
|
12065
12259
|
// src/components/Carousel/Carousel.tsx
|
|
12066
12260
|
var import_clsx89 = require("clsx");
|
|
12067
|
-
var
|
|
12068
|
-
var
|
|
12261
|
+
var import_tokens27 = require("@refineui/tokens");
|
|
12262
|
+
var import_react47 = require("react");
|
|
12069
12263
|
|
|
12070
12264
|
// src/components/Carousel/style.ts
|
|
12071
12265
|
var import_clsx88 = require("clsx");
|
|
@@ -12089,8 +12283,8 @@ var carouselStyles = {
|
|
|
12089
12283
|
),
|
|
12090
12284
|
indicatorThumb: (0, import_clsx88.clsx)(
|
|
12091
12285
|
"pointer-events-none absolute top-refineui-size-xxx-small bottom-refineui-size-xxx-small start-refineui-size-xxx-small z-0",
|
|
12092
|
-
|
|
12093
|
-
"
|
|
12286
|
+
/* Motion lives in refineui.css, gated by `data-animate`. */
|
|
12287
|
+
"rounded-refineui-circle bg-refineui-alias-background-brand shadow-refineui-2"
|
|
12094
12288
|
),
|
|
12095
12289
|
indicatorHitRow: "relative z-[1] flex h-full w-full",
|
|
12096
12290
|
indicatorHit: "h-full min-w-0 flex-1 cursor-pointer border-none bg-transparent p-0 outline-none"
|
|
@@ -12099,9 +12293,9 @@ var carouselStyles = {
|
|
|
12099
12293
|
// src/components/Carousel/Carousel.tsx
|
|
12100
12294
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
12101
12295
|
var DRAG_COMMIT_RATIO = 0.18;
|
|
12102
|
-
var CarouselContext = (0,
|
|
12296
|
+
var CarouselContext = (0, import_react47.createContext)(null);
|
|
12103
12297
|
function useCarouselContext(component) {
|
|
12104
|
-
const v = (0,
|
|
12298
|
+
const v = (0, import_react47.useContext)(CarouselContext);
|
|
12105
12299
|
if (!v) throw new Error(`${component} must be used within Carousel.`);
|
|
12106
12300
|
return v;
|
|
12107
12301
|
}
|
|
@@ -12120,13 +12314,13 @@ function Carousel({
|
|
|
12120
12314
|
...props
|
|
12121
12315
|
}) {
|
|
12122
12316
|
const isControlled = indexControlled !== void 0;
|
|
12123
|
-
const [internalIndex, setInternalIndex] = (0,
|
|
12124
|
-
const [count, setCount] = (0,
|
|
12125
|
-
const [trackIndex, setTrackIndex] = (0,
|
|
12126
|
-
const [instant, setInstant] = (0,
|
|
12317
|
+
const [internalIndex, setInternalIndex] = (0, import_react47.useState)(defaultIndex);
|
|
12318
|
+
const [count, setCount] = (0, import_react47.useState)(0);
|
|
12319
|
+
const [trackIndex, setTrackIndex] = (0, import_react47.useState)(defaultIndex);
|
|
12320
|
+
const [instant, setInstant] = (0, import_react47.useState)(false);
|
|
12127
12321
|
const index = isControlled ? indexControlled : internalIndex;
|
|
12128
12322
|
const loopActive = loop && count > 1;
|
|
12129
|
-
const commitLogical = (0,
|
|
12323
|
+
const commitLogical = (0, import_react47.useCallback)(
|
|
12130
12324
|
(next) => {
|
|
12131
12325
|
const normalized = clampIndex(next, Math.max(count, 1));
|
|
12132
12326
|
if (!isControlled) setInternalIndex(normalized);
|
|
@@ -12134,13 +12328,20 @@ function Carousel({
|
|
|
12134
12328
|
},
|
|
12135
12329
|
[count, isControlled, onIndexChange]
|
|
12136
12330
|
);
|
|
12137
|
-
(0,
|
|
12331
|
+
const snapTrackTo = (0, import_react47.useCallback)((next) => {
|
|
12332
|
+
setInstant(true);
|
|
12333
|
+
setTrackIndex(next);
|
|
12334
|
+
requestAnimationFrame(() => {
|
|
12335
|
+
requestAnimationFrame(() => setInstant(false));
|
|
12336
|
+
});
|
|
12337
|
+
}, []);
|
|
12338
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
12138
12339
|
if (count <= 0) return;
|
|
12139
12340
|
const logical = clampIndex(index, count);
|
|
12140
12341
|
if (logical !== index) commitLogical(logical);
|
|
12141
|
-
|
|
12342
|
+
snapTrackTo(loopActive ? logical + 1 : logical);
|
|
12142
12343
|
}, [count, loopActive]);
|
|
12143
|
-
(0,
|
|
12344
|
+
(0, import_react47.useEffect)(() => {
|
|
12144
12345
|
if (count <= 0) return;
|
|
12145
12346
|
if (!loopActive) {
|
|
12146
12347
|
setTrackIndex(clampIndex(index, count));
|
|
@@ -12154,7 +12355,7 @@ function Carousel({
|
|
|
12154
12355
|
}, [index, count, loopActive]);
|
|
12155
12356
|
const canScrollPrev = loopActive ? true : index > 0;
|
|
12156
12357
|
const canScrollNext = loopActive ? true : index < count - 1;
|
|
12157
|
-
const scrollTo = (0,
|
|
12358
|
+
const scrollTo = (0, import_react47.useCallback)(
|
|
12158
12359
|
(i) => {
|
|
12159
12360
|
if (count <= 0) return;
|
|
12160
12361
|
const next = clampIndex(i, count);
|
|
@@ -12163,7 +12364,7 @@ function Carousel({
|
|
|
12163
12364
|
},
|
|
12164
12365
|
[commitLogical, count, loopActive]
|
|
12165
12366
|
);
|
|
12166
|
-
const scrollPrev = (0,
|
|
12367
|
+
const scrollPrev = (0, import_react47.useCallback)(() => {
|
|
12167
12368
|
if (count <= 0) return;
|
|
12168
12369
|
if (loopActive) {
|
|
12169
12370
|
if (trackIndex < 1 || trackIndex > count) return;
|
|
@@ -12176,7 +12377,7 @@ function Carousel({
|
|
|
12176
12377
|
setTrackIndex(index - 1);
|
|
12177
12378
|
}
|
|
12178
12379
|
}, [commitLogical, count, index, loopActive, trackIndex]);
|
|
12179
|
-
const scrollNext = (0,
|
|
12380
|
+
const scrollNext = (0, import_react47.useCallback)(() => {
|
|
12180
12381
|
if (count <= 0) return;
|
|
12181
12382
|
if (loopActive) {
|
|
12182
12383
|
if (trackIndex < 1 || trackIndex > count) return;
|
|
@@ -12189,23 +12390,12 @@ function Carousel({
|
|
|
12189
12390
|
setTrackIndex(index + 1);
|
|
12190
12391
|
}
|
|
12191
12392
|
}, [commitLogical, count, index, loopActive, trackIndex]);
|
|
12192
|
-
const onTrackSettled = (0,
|
|
12393
|
+
const onTrackSettled = (0, import_react47.useCallback)(() => {
|
|
12193
12394
|
if (!loopActive) return;
|
|
12194
|
-
if (trackIndex === 0)
|
|
12195
|
-
|
|
12196
|
-
|
|
12197
|
-
|
|
12198
|
-
requestAnimationFrame(() => setInstant(false));
|
|
12199
|
-
});
|
|
12200
|
-
} else if (trackIndex === count + 1) {
|
|
12201
|
-
setInstant(true);
|
|
12202
|
-
setTrackIndex(1);
|
|
12203
|
-
requestAnimationFrame(() => {
|
|
12204
|
-
requestAnimationFrame(() => setInstant(false));
|
|
12205
|
-
});
|
|
12206
|
-
}
|
|
12207
|
-
}, [count, loopActive, trackIndex]);
|
|
12208
|
-
const ctx = (0, import_react46.useMemo)(
|
|
12395
|
+
if (trackIndex === 0) snapTrackTo(count);
|
|
12396
|
+
else if (trackIndex === count + 1) snapTrackTo(1);
|
|
12397
|
+
}, [count, loopActive, snapTrackTo, trackIndex]);
|
|
12398
|
+
const ctx = (0, import_react47.useMemo)(
|
|
12209
12399
|
() => ({
|
|
12210
12400
|
index,
|
|
12211
12401
|
count,
|
|
@@ -12284,21 +12474,21 @@ function CarouselContent({ className, children, ...props }) {
|
|
|
12284
12474
|
instant,
|
|
12285
12475
|
onTrackSettled
|
|
12286
12476
|
} = useCarouselContext("CarouselContent");
|
|
12287
|
-
const viewportRef = (0,
|
|
12288
|
-
const dragStartX = (0,
|
|
12289
|
-
const [dragPx, setDragPx] = (0,
|
|
12290
|
-
const [dragging, setDragging] = (0,
|
|
12291
|
-
const slides =
|
|
12477
|
+
const viewportRef = (0, import_react47.useRef)(null);
|
|
12478
|
+
const dragStartX = (0, import_react47.useRef)(null);
|
|
12479
|
+
const [dragPx, setDragPx] = (0, import_react47.useState)(0);
|
|
12480
|
+
const [dragging, setDragging] = (0, import_react47.useState)(false);
|
|
12481
|
+
const slides = import_react47.Children.toArray(children).filter(import_react47.isValidElement);
|
|
12292
12482
|
const slideCount = slides.length;
|
|
12293
|
-
(0,
|
|
12483
|
+
(0, import_react47.useEffect)(() => {
|
|
12294
12484
|
setCount(slideCount);
|
|
12295
12485
|
}, [setCount, slideCount]);
|
|
12296
12486
|
const trackSlides = loop && slides.length > 1 ? [
|
|
12297
|
-
(0,
|
|
12487
|
+
(0, import_react47.cloneElement)(slides[slides.length - 1], { key: "__carousel-clone-last" }),
|
|
12298
12488
|
...slides,
|
|
12299
|
-
(0,
|
|
12489
|
+
(0, import_react47.cloneElement)(slides[0], { key: "__carousel-clone-first" })
|
|
12300
12490
|
] : slides;
|
|
12301
|
-
const endDrag = (0,
|
|
12491
|
+
const endDrag = (0, import_react47.useCallback)(
|
|
12302
12492
|
(clientX) => {
|
|
12303
12493
|
if (dragStartX.current == null) return;
|
|
12304
12494
|
const width = viewportRef.current?.offsetWidth ?? 1;
|
|
@@ -12373,7 +12563,7 @@ function CarouselContent({ className, children, ...props }) {
|
|
|
12373
12563
|
}
|
|
12374
12564
|
);
|
|
12375
12565
|
}
|
|
12376
|
-
var CarouselItem = (0,
|
|
12566
|
+
var CarouselItem = (0, import_react47.forwardRef)(function CarouselItem2({ className, children, ...props }, ref) {
|
|
12377
12567
|
useCarouselContext("CarouselItem");
|
|
12378
12568
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
12379
12569
|
"div",
|
|
@@ -12415,7 +12605,7 @@ function CarouselPrevious({ className, disabled, onClick, ...props }) {
|
|
|
12415
12605
|
WebIcon,
|
|
12416
12606
|
{
|
|
12417
12607
|
name: "chevron-left",
|
|
12418
|
-
size:
|
|
12608
|
+
size: import_tokens27.iconSizes.small,
|
|
12419
12609
|
color: "currentColor",
|
|
12420
12610
|
iconStyle: "filled",
|
|
12421
12611
|
fallback: "\u2039"
|
|
@@ -12447,7 +12637,7 @@ function CarouselNext({ className, disabled, onClick, ...props }) {
|
|
|
12447
12637
|
WebIcon,
|
|
12448
12638
|
{
|
|
12449
12639
|
name: "chevron-right",
|
|
12450
|
-
size:
|
|
12640
|
+
size: import_tokens27.iconSizes.small,
|
|
12451
12641
|
color: "currentColor",
|
|
12452
12642
|
iconStyle: "filled",
|
|
12453
12643
|
fallback: "\u203A"
|
|
@@ -12458,9 +12648,10 @@ function CarouselNext({ className, disabled, onClick, ...props }) {
|
|
|
12458
12648
|
}
|
|
12459
12649
|
function CarouselIndicators({ className, ...props }) {
|
|
12460
12650
|
const { count, index, scrollTo } = useCarouselContext("CarouselIndicators");
|
|
12461
|
-
const trackRef = (0,
|
|
12462
|
-
const [thumb, setThumb] = (0,
|
|
12463
|
-
const
|
|
12651
|
+
const trackRef = (0, import_react47.useRef)(null);
|
|
12652
|
+
const [thumb, setThumb] = (0, import_react47.useState)({ width: 0, x: 0, ready: false });
|
|
12653
|
+
const [animate, setAnimate] = (0, import_react47.useState)(false);
|
|
12654
|
+
const updateThumb = (0, import_react47.useCallback)(() => {
|
|
12464
12655
|
const el = trackRef.current;
|
|
12465
12656
|
if (!el || count <= 0) {
|
|
12466
12657
|
setThumb({ width: 0, x: 0, ready: false });
|
|
@@ -12475,10 +12666,25 @@ function CarouselIndicators({ className, ...props }) {
|
|
|
12475
12666
|
ready: true
|
|
12476
12667
|
});
|
|
12477
12668
|
}, [count, index]);
|
|
12478
|
-
(0,
|
|
12669
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
12479
12670
|
updateThumb();
|
|
12480
12671
|
}, [updateThumb]);
|
|
12481
|
-
(0,
|
|
12672
|
+
(0, import_react47.useEffect)(() => {
|
|
12673
|
+
if (!thumb.ready) {
|
|
12674
|
+
setAnimate(false);
|
|
12675
|
+
return;
|
|
12676
|
+
}
|
|
12677
|
+
if (animate) return;
|
|
12678
|
+
let raf2 = 0;
|
|
12679
|
+
const raf1 = requestAnimationFrame(() => {
|
|
12680
|
+
raf2 = requestAnimationFrame(() => setAnimate(true));
|
|
12681
|
+
});
|
|
12682
|
+
return () => {
|
|
12683
|
+
cancelAnimationFrame(raf1);
|
|
12684
|
+
cancelAnimationFrame(raf2);
|
|
12685
|
+
};
|
|
12686
|
+
}, [thumb.ready, animate]);
|
|
12687
|
+
(0, import_react47.useEffect)(() => {
|
|
12482
12688
|
const el = trackRef.current;
|
|
12483
12689
|
if (!el) return;
|
|
12484
12690
|
const ro = new ResizeObserver(() => updateThumb());
|
|
@@ -12505,6 +12711,7 @@ function CarouselIndicators({ className, ...props }) {
|
|
|
12505
12711
|
{
|
|
12506
12712
|
"data-refineui": "carousel-indicator-thumb",
|
|
12507
12713
|
"data-ready": thumb.ready ? "true" : void 0,
|
|
12714
|
+
"data-animate": animate ? "true" : void 0,
|
|
12508
12715
|
"aria-hidden": true,
|
|
12509
12716
|
className: carouselStyles.indicatorThumb,
|
|
12510
12717
|
style: thumbStyle
|
|
@@ -12531,7 +12738,7 @@ function CarouselIndicators({ className, ...props }) {
|
|
|
12531
12738
|
|
|
12532
12739
|
// src/components/Bubble/Bubble.tsx
|
|
12533
12740
|
var import_clsx91 = require("clsx");
|
|
12534
|
-
var
|
|
12741
|
+
var import_react48 = require("react");
|
|
12535
12742
|
|
|
12536
12743
|
// src/components/Bubble/style.ts
|
|
12537
12744
|
var import_clsx90 = require("clsx");
|
|
@@ -12597,20 +12804,20 @@ var bubbleContentVariantClass = {
|
|
|
12597
12804
|
|
|
12598
12805
|
// src/components/Bubble/Bubble.tsx
|
|
12599
12806
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
12600
|
-
var BubbleContext = (0,
|
|
12807
|
+
var BubbleContext = (0, import_react48.createContext)(null);
|
|
12601
12808
|
function useBubbleContext(component) {
|
|
12602
|
-
const value = (0,
|
|
12809
|
+
const value = (0, import_react48.useContext)(BubbleContext);
|
|
12603
12810
|
if (!value) throw new Error(`${component} must be used within Bubble.`);
|
|
12604
12811
|
return value;
|
|
12605
12812
|
}
|
|
12606
12813
|
function isBubbleReactionsElement(node) {
|
|
12607
|
-
return (0,
|
|
12814
|
+
return (0, import_react48.isValidElement)(node) && node.type === BubbleReactions;
|
|
12608
12815
|
}
|
|
12609
12816
|
function partitionBubbleChildren(children) {
|
|
12610
12817
|
const top = [];
|
|
12611
12818
|
const middle = [];
|
|
12612
12819
|
const bottom = [];
|
|
12613
|
-
|
|
12820
|
+
import_react48.Children.forEach(children, (child) => {
|
|
12614
12821
|
if (!isBubbleReactionsElement(child)) {
|
|
12615
12822
|
middle.push(child);
|
|
12616
12823
|
return;
|
|
@@ -12712,8 +12919,8 @@ function BubbleReactions({
|
|
|
12712
12919
|
|
|
12713
12920
|
// src/components/Stepper/Stepper.tsx
|
|
12714
12921
|
var import_clsx93 = require("clsx");
|
|
12715
|
-
var
|
|
12716
|
-
var
|
|
12922
|
+
var import_tokens28 = require("@refineui/tokens");
|
|
12923
|
+
var import_react49 = require("react");
|
|
12717
12924
|
|
|
12718
12925
|
// src/components/Stepper/style.ts
|
|
12719
12926
|
var import_clsx92 = require("clsx");
|
|
@@ -12822,16 +13029,16 @@ var stepperConnectorVars = {
|
|
|
12822
13029
|
|
|
12823
13030
|
// src/components/Stepper/Stepper.tsx
|
|
12824
13031
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
12825
|
-
var StepperContext = (0,
|
|
12826
|
-
var StepperItemContext = (0,
|
|
12827
|
-
var StepperListRegistryContext = (0,
|
|
13032
|
+
var StepperContext = (0, import_react49.createContext)(null);
|
|
13033
|
+
var StepperItemContext = (0, import_react49.createContext)(null);
|
|
13034
|
+
var StepperListRegistryContext = (0, import_react49.createContext)(null);
|
|
12828
13035
|
function useStepperContext(component) {
|
|
12829
|
-
const v = (0,
|
|
13036
|
+
const v = (0, import_react49.useContext)(StepperContext);
|
|
12830
13037
|
if (!v) throw new Error(`${component} must be used within Stepper.`);
|
|
12831
13038
|
return v;
|
|
12832
13039
|
}
|
|
12833
13040
|
function useStepperItemContext(component) {
|
|
12834
|
-
const v = (0,
|
|
13041
|
+
const v = (0, import_react49.useContext)(StepperItemContext);
|
|
12835
13042
|
if (!v) throw new Error(`${component} must be used within StepperItem.`);
|
|
12836
13043
|
return v;
|
|
12837
13044
|
}
|
|
@@ -12851,16 +13058,16 @@ function Stepper({
|
|
|
12851
13058
|
...props
|
|
12852
13059
|
}) {
|
|
12853
13060
|
const isControlled = valueControlled !== void 0;
|
|
12854
|
-
const [internalValue, setInternalValue] = (0,
|
|
13061
|
+
const [internalValue, setInternalValue] = (0, import_react49.useState)(defaultValue);
|
|
12855
13062
|
const value = isControlled ? valueControlled : internalValue;
|
|
12856
|
-
const setValue = (0,
|
|
13063
|
+
const setValue = (0, import_react49.useCallback)(
|
|
12857
13064
|
(next) => {
|
|
12858
13065
|
if (!isControlled) setInternalValue(next);
|
|
12859
13066
|
onValueChange?.(next);
|
|
12860
13067
|
},
|
|
12861
13068
|
[isControlled, onValueChange]
|
|
12862
13069
|
);
|
|
12863
|
-
const ctx = (0,
|
|
13070
|
+
const ctx = (0, import_react49.useMemo)(
|
|
12864
13071
|
() => ({
|
|
12865
13072
|
value,
|
|
12866
13073
|
setValue,
|
|
@@ -12883,9 +13090,9 @@ function Stepper({
|
|
|
12883
13090
|
}
|
|
12884
13091
|
function StepperList({ className, children, ...props }) {
|
|
12885
13092
|
const { orientation, value } = useStepperContext("StepperList");
|
|
12886
|
-
const cursorRef = (0,
|
|
13093
|
+
const cursorRef = (0, import_react49.useRef)(null);
|
|
12887
13094
|
cursorRef.current = null;
|
|
12888
|
-
const registry = (0,
|
|
13095
|
+
const registry = (0, import_react49.useMemo)(
|
|
12889
13096
|
() => ({
|
|
12890
13097
|
noteItem(itemValue) {
|
|
12891
13098
|
cursorRef.current = itemValue;
|
|
@@ -12922,7 +13129,7 @@ function StepperItem({
|
|
|
12922
13129
|
...props
|
|
12923
13130
|
}) {
|
|
12924
13131
|
const { value, setValue, orientation, interactive } = useStepperContext("StepperItem");
|
|
12925
|
-
const registry = (0,
|
|
13132
|
+
const registry = (0, import_react49.useContext)(StepperListRegistryContext);
|
|
12926
13133
|
registry?.noteItem(itemValue);
|
|
12927
13134
|
const state = resolveState2(itemValue, value);
|
|
12928
13135
|
const canActivate = interactive && !disabled;
|
|
@@ -12938,7 +13145,7 @@ function StepperItem({
|
|
|
12938
13145
|
activate();
|
|
12939
13146
|
}
|
|
12940
13147
|
};
|
|
12941
|
-
const itemCtx = (0,
|
|
13148
|
+
const itemCtx = (0, import_react49.useMemo)(
|
|
12942
13149
|
() => ({ state, disabled }),
|
|
12943
13150
|
[state, disabled]
|
|
12944
13151
|
);
|
|
@@ -12974,7 +13181,7 @@ function StepperIndicator({ className, children, ...props }) {
|
|
|
12974
13181
|
WebIcon,
|
|
12975
13182
|
{
|
|
12976
13183
|
name: "checkmark",
|
|
12977
|
-
size:
|
|
13184
|
+
size: import_tokens28.iconSizes.xsmall,
|
|
12978
13185
|
color: "currentColor",
|
|
12979
13186
|
iconStyle: "filled",
|
|
12980
13187
|
fallback: "\u2713",
|
|
@@ -13037,7 +13244,7 @@ function StepperDescription({ className, ...props }) {
|
|
|
13037
13244
|
}
|
|
13038
13245
|
function StepperSeparator({ className, ...props }) {
|
|
13039
13246
|
const { orientation } = useStepperContext("StepperSeparator");
|
|
13040
|
-
const registry = (0,
|
|
13247
|
+
const registry = (0, import_react49.useContext)(StepperListRegistryContext);
|
|
13041
13248
|
const state = registry?.takeSeparatorState() ?? "upcoming";
|
|
13042
13249
|
const vertical = orientation === "vertical";
|
|
13043
13250
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
@@ -13098,7 +13305,7 @@ StepperSeparator.displayName = "StepperSeparator";
|
|
|
13098
13305
|
|
|
13099
13306
|
// src/components/Resizable/Resizable.tsx
|
|
13100
13307
|
var import_clsx95 = require("clsx");
|
|
13101
|
-
var
|
|
13308
|
+
var import_react50 = require("react");
|
|
13102
13309
|
|
|
13103
13310
|
// src/components/Resizable/style.ts
|
|
13104
13311
|
var import_clsx94 = require("clsx");
|
|
@@ -13139,9 +13346,9 @@ var KEYBOARD_STEP_LARGE = 10;
|
|
|
13139
13346
|
var DEFAULT_SIZE = 50;
|
|
13140
13347
|
var DEFAULT_MIN_SIZE = 10;
|
|
13141
13348
|
var DEFAULT_MAX_SIZE = 100;
|
|
13142
|
-
var ResizableContext = (0,
|
|
13349
|
+
var ResizableContext = (0, import_react50.createContext)(null);
|
|
13143
13350
|
function useResizableContext(component) {
|
|
13144
|
-
const v = (0,
|
|
13351
|
+
const v = (0, import_react50.useContext)(ResizableContext);
|
|
13145
13352
|
if (!v) throw new Error(`${component} must be used within ResizablePanelGroup.`);
|
|
13146
13353
|
return v;
|
|
13147
13354
|
}
|
|
@@ -13200,13 +13407,13 @@ function ResizablePanelGroup({
|
|
|
13200
13407
|
onLayout,
|
|
13201
13408
|
...props
|
|
13202
13409
|
}) {
|
|
13203
|
-
const groupRef = (0,
|
|
13204
|
-
const panelsRef = (0,
|
|
13205
|
-
const orderCounterRef = (0,
|
|
13206
|
-
const [sizes, setSizes] = (0,
|
|
13207
|
-
const onLayoutRef = (0,
|
|
13410
|
+
const groupRef = (0, import_react50.useRef)(null);
|
|
13411
|
+
const panelsRef = (0, import_react50.useRef)(/* @__PURE__ */ new Map());
|
|
13412
|
+
const orderCounterRef = (0, import_react50.useRef)(0);
|
|
13413
|
+
const [sizes, setSizes] = (0, import_react50.useState)({});
|
|
13414
|
+
const onLayoutRef = (0, import_react50.useRef)(onLayout);
|
|
13208
13415
|
onLayoutRef.current = onLayout;
|
|
13209
|
-
const syncInitialSizes = (0,
|
|
13416
|
+
const syncInitialSizes = (0, import_react50.useCallback)(() => {
|
|
13210
13417
|
const panels = [...panelsRef.current.values()].sort((a, b) => a.order - b.order);
|
|
13211
13418
|
if (panels.length === 0) return;
|
|
13212
13419
|
setSizes((prev) => {
|
|
@@ -13241,7 +13448,7 @@ function ResizablePanelGroup({
|
|
|
13241
13448
|
return base;
|
|
13242
13449
|
});
|
|
13243
13450
|
}, []);
|
|
13244
|
-
const registerPanel = (0,
|
|
13451
|
+
const registerPanel = (0, import_react50.useCallback)(
|
|
13245
13452
|
(panel) => {
|
|
13246
13453
|
const existing = panelsRef.current.get(panel.id);
|
|
13247
13454
|
const order = existing?.order ?? orderCounterRef.current++;
|
|
@@ -13250,7 +13457,7 @@ function ResizablePanelGroup({
|
|
|
13250
13457
|
},
|
|
13251
13458
|
[syncInitialSizes]
|
|
13252
13459
|
);
|
|
13253
|
-
const unregisterPanel = (0,
|
|
13460
|
+
const unregisterPanel = (0, import_react50.useCallback)((id) => {
|
|
13254
13461
|
panelsRef.current.delete(id);
|
|
13255
13462
|
setSizes((prev) => {
|
|
13256
13463
|
if (!(id in prev)) return prev;
|
|
@@ -13259,13 +13466,13 @@ function ResizablePanelGroup({
|
|
|
13259
13466
|
return next;
|
|
13260
13467
|
});
|
|
13261
13468
|
}, []);
|
|
13262
|
-
const getPanel = (0,
|
|
13263
|
-
const emitPanelResize = (0,
|
|
13469
|
+
const getPanel = (0, import_react50.useCallback)((id) => panelsRef.current.get(id), []);
|
|
13470
|
+
const emitPanelResize = (0, import_react50.useCallback)((next) => {
|
|
13264
13471
|
for (const [id, size] of Object.entries(next)) {
|
|
13265
13472
|
panelsRef.current.get(id)?.onResize?.(size);
|
|
13266
13473
|
}
|
|
13267
13474
|
}, []);
|
|
13268
|
-
const resizeBetween = (0,
|
|
13475
|
+
const resizeBetween = (0, import_react50.useCallback)(
|
|
13269
13476
|
(leftId, rightId, deltaPct) => {
|
|
13270
13477
|
setSizes((prev) => {
|
|
13271
13478
|
const next = applyResize(
|
|
@@ -13282,7 +13489,7 @@ function ResizablePanelGroup({
|
|
|
13282
13489
|
},
|
|
13283
13490
|
[emitPanelResize]
|
|
13284
13491
|
);
|
|
13285
|
-
const setBetween = (0,
|
|
13492
|
+
const setBetween = (0, import_react50.useCallback)(
|
|
13286
13493
|
(leftId, rightId, leftSize) => {
|
|
13287
13494
|
setSizes((prev) => {
|
|
13288
13495
|
const left = panelsRef.current.get(leftId);
|
|
@@ -13307,13 +13514,13 @@ function ResizablePanelGroup({
|
|
|
13307
13514
|
},
|
|
13308
13515
|
[emitPanelResize]
|
|
13309
13516
|
);
|
|
13310
|
-
(0,
|
|
13517
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
13311
13518
|
const ids = orderedPanelIds(panelsRef.current);
|
|
13312
13519
|
if (ids.length === 0) return;
|
|
13313
13520
|
if (ids.some((id) => sizes[id] === void 0)) return;
|
|
13314
13521
|
onLayoutRef.current?.(ids.map((id) => sizes[id]));
|
|
13315
13522
|
}, [sizes]);
|
|
13316
|
-
const ctx = (0,
|
|
13523
|
+
const ctx = (0, import_react50.useMemo)(
|
|
13317
13524
|
() => ({
|
|
13318
13525
|
orientation,
|
|
13319
13526
|
groupRef,
|
|
@@ -13362,11 +13569,11 @@ function ResizablePanel({
|
|
|
13362
13569
|
onResize,
|
|
13363
13570
|
...props
|
|
13364
13571
|
}) {
|
|
13365
|
-
const id = (0,
|
|
13572
|
+
const id = (0, import_react50.useId)();
|
|
13366
13573
|
const { orientation, sizes, registerPanel, unregisterPanel } = useResizableContext("ResizablePanel");
|
|
13367
|
-
const onResizeRef = (0,
|
|
13574
|
+
const onResizeRef = (0, import_react50.useRef)(onResize);
|
|
13368
13575
|
onResizeRef.current = onResize;
|
|
13369
|
-
(0,
|
|
13576
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
13370
13577
|
registerPanel({
|
|
13371
13578
|
id,
|
|
13372
13579
|
defaultSize,
|
|
@@ -13424,11 +13631,11 @@ function ResizableHandle({
|
|
|
13424
13631
|
resizeBetween,
|
|
13425
13632
|
setBetween
|
|
13426
13633
|
} = useResizableContext("ResizableHandle");
|
|
13427
|
-
const handleRef = (0,
|
|
13428
|
-
const [active, setActive] = (0,
|
|
13429
|
-
const [, setAdjacentReady] = (0,
|
|
13430
|
-
const dragRef = (0,
|
|
13431
|
-
(0,
|
|
13634
|
+
const handleRef = (0, import_react50.useRef)(null);
|
|
13635
|
+
const [active, setActive] = (0, import_react50.useState)(false);
|
|
13636
|
+
const [, setAdjacentReady] = (0, import_react50.useState)(false);
|
|
13637
|
+
const dragRef = (0, import_react50.useRef)(null);
|
|
13638
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
13432
13639
|
setAdjacentReady(true);
|
|
13433
13640
|
}, []);
|
|
13434
13641
|
const adjacent = handleRef.current ? findAdjacentPanelIds(handleRef.current) : { leftId: null, rightId: null };
|
|
@@ -13439,7 +13646,7 @@ function ResizableHandle({
|
|
|
13439
13646
|
const ariaMin = leftPanel?.minSize ?? 0;
|
|
13440
13647
|
const ariaMax = leftPanel?.maxSize ?? DEFAULT_MAX_SIZE;
|
|
13441
13648
|
const defaultKeyshortcuts = orientation === "horizontal" ? "ArrowLeft ArrowRight Home End" : "ArrowUp ArrowDown Home End";
|
|
13442
|
-
const keepFocus = (0,
|
|
13649
|
+
const keepFocus = (0, import_react50.useCallback)(() => {
|
|
13443
13650
|
const el = handleRef.current;
|
|
13444
13651
|
if (el && document.activeElement !== el) {
|
|
13445
13652
|
el.focus({ preventScroll: true });
|
|
@@ -13584,8 +13791,8 @@ function ResizableHandle({
|
|
|
13584
13791
|
|
|
13585
13792
|
// src/components/SpinButton/SpinButton.tsx
|
|
13586
13793
|
var import_clsx96 = require("clsx");
|
|
13587
|
-
var
|
|
13588
|
-
var
|
|
13794
|
+
var import_react51 = require("react");
|
|
13795
|
+
var import_tokens29 = require("@refineui/tokens");
|
|
13589
13796
|
|
|
13590
13797
|
// src/components/SpinButton/style.ts
|
|
13591
13798
|
var spinButtonStyles = {
|
|
@@ -13622,8 +13829,8 @@ function SpinButton({
|
|
|
13622
13829
|
onKeyDown,
|
|
13623
13830
|
...props
|
|
13624
13831
|
}) {
|
|
13625
|
-
const [draftValue, setDraftValue] = (0,
|
|
13626
|
-
(0,
|
|
13832
|
+
const [draftValue, setDraftValue] = (0, import_react51.useState)(String(value));
|
|
13833
|
+
(0, import_react51.useEffect)(() => {
|
|
13627
13834
|
setDraftValue(String(value));
|
|
13628
13835
|
}, [value]);
|
|
13629
13836
|
const clampValue2 = (next) => {
|
|
@@ -13794,7 +14001,7 @@ function SpinButton({
|
|
|
13794
14001
|
WebIcon,
|
|
13795
14002
|
{
|
|
13796
14003
|
name: "chevron-up",
|
|
13797
|
-
size:
|
|
14004
|
+
size: import_tokens29.iconSizes.xsmall,
|
|
13798
14005
|
color: "currentColor",
|
|
13799
14006
|
iconStyle: "filled",
|
|
13800
14007
|
fallback: "\u25B2"
|
|
@@ -13818,7 +14025,7 @@ function SpinButton({
|
|
|
13818
14025
|
WebIcon,
|
|
13819
14026
|
{
|
|
13820
14027
|
name: "chevron-down",
|
|
13821
|
-
size:
|
|
14028
|
+
size: import_tokens29.iconSizes.xsmall,
|
|
13822
14029
|
color: "currentColor",
|
|
13823
14030
|
iconStyle: "filled",
|
|
13824
14031
|
fallback: "\u25BC"
|
|
@@ -13836,9 +14043,9 @@ function SpinButton({
|
|
|
13836
14043
|
|
|
13837
14044
|
// src/components/Toast/Toast.tsx
|
|
13838
14045
|
var import_clsx98 = require("clsx");
|
|
13839
|
-
var
|
|
14046
|
+
var import_react52 = require("react");
|
|
13840
14047
|
var import_react_dom7 = require("react-dom");
|
|
13841
|
-
var
|
|
14048
|
+
var import_tokens30 = require("@refineui/tokens");
|
|
13842
14049
|
var import_animation7 = require("@refineui/utilities/animation");
|
|
13843
14050
|
var import_color12 = require("@refineui/utilities/color");
|
|
13844
14051
|
|
|
@@ -13874,7 +14081,7 @@ var toastStyles = {
|
|
|
13874
14081
|
|
|
13875
14082
|
// src/components/Toast/Toast.tsx
|
|
13876
14083
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
13877
|
-
var useIsomorphicLayoutEffect7 = typeof document !== "undefined" ?
|
|
14084
|
+
var useIsomorphicLayoutEffect7 = typeof document !== "undefined" ? import_react52.useLayoutEffect : import_react52.useEffect;
|
|
13878
14085
|
var ENTER_MS = 20;
|
|
13879
14086
|
var LEAVE_MS = (0, import_animation7.motionMsToNumber)(componentTokens.toast.motion.leave) + 60;
|
|
13880
14087
|
var DEFAULT_DURATION = 4200;
|
|
@@ -13897,10 +14104,10 @@ function gapPxFromSpacingToken(token) {
|
|
|
13897
14104
|
var TOAST_NARROW_STACK_MQ = "(max-width: 480px), (hover: none)";
|
|
13898
14105
|
function readToastStackGapPx() {
|
|
13899
14106
|
if (typeof globalThis.matchMedia === "undefined") {
|
|
13900
|
-
return gapPxFromSpacingToken(String(
|
|
14107
|
+
return gapPxFromSpacingToken(String(import_tokens30.spacings.sizeLarge));
|
|
13901
14108
|
}
|
|
13902
14109
|
const mq = globalThis.matchMedia(TOAST_NARROW_STACK_MQ);
|
|
13903
|
-
return gapPxFromSpacingToken(mq.matches ? String(
|
|
14110
|
+
return gapPxFromSpacingToken(mq.matches ? String(import_tokens30.spacings.sizeMedium) : String(import_tokens30.spacings.sizeLarge));
|
|
13904
14111
|
}
|
|
13905
14112
|
function subscribeToastStackGap(onChange) {
|
|
13906
14113
|
if (typeof globalThis.matchMedia === "undefined") return () => {
|
|
@@ -13910,10 +14117,10 @@ function subscribeToastStackGap(onChange) {
|
|
|
13910
14117
|
return () => mq.removeEventListener("change", onChange);
|
|
13911
14118
|
}
|
|
13912
14119
|
function useToastStackGapPx() {
|
|
13913
|
-
return (0,
|
|
14120
|
+
return (0, import_react52.useSyncExternalStore)(
|
|
13914
14121
|
subscribeToastStackGap,
|
|
13915
14122
|
readToastStackGapPx,
|
|
13916
|
-
() => gapPxFromSpacingToken(String(
|
|
14123
|
+
() => gapPxFromSpacingToken(String(import_tokens30.spacings.sizeLarge))
|
|
13917
14124
|
);
|
|
13918
14125
|
}
|
|
13919
14126
|
function readToastNaturalHeight(li) {
|
|
@@ -14052,7 +14259,7 @@ var variantIconNames = {
|
|
|
14052
14259
|
error: "error-circle",
|
|
14053
14260
|
warning: "warning"
|
|
14054
14261
|
};
|
|
14055
|
-
var Toast = (0,
|
|
14262
|
+
var Toast = (0, import_react52.forwardRef)(function Toast2(props, ref) {
|
|
14056
14263
|
const { variant = "default", message, iconName, icon, action, className, stackState, style, ...rest } = props;
|
|
14057
14264
|
const domProps = { ...rest };
|
|
14058
14265
|
delete domProps.iconName;
|
|
@@ -14065,7 +14272,7 @@ var Toast = (0, import_react51.forwardRef)(function Toast2(props, ref) {
|
|
|
14065
14272
|
WebIcon,
|
|
14066
14273
|
{
|
|
14067
14274
|
name: resolvedIconName,
|
|
14068
|
-
size:
|
|
14275
|
+
size: import_tokens30.iconSizes.medium,
|
|
14069
14276
|
color: "currentColor",
|
|
14070
14277
|
iconStyle: "filled"
|
|
14071
14278
|
}
|
|
@@ -14108,12 +14315,12 @@ var Toast = (0, import_react51.forwardRef)(function Toast2(props, ref) {
|
|
|
14108
14315
|
);
|
|
14109
14316
|
});
|
|
14110
14317
|
function SwipeableToast({ record, index, swipeDirections, onSwipeStart, onSwipeEnd }) {
|
|
14111
|
-
const toastRef = (0,
|
|
14112
|
-
const dragStartRef = (0,
|
|
14113
|
-
const axisRef = (0,
|
|
14114
|
-
const offsetRef = (0,
|
|
14115
|
-
const [swiping, setSwiping] = (0,
|
|
14116
|
-
const clearSwipeOffset = (0,
|
|
14318
|
+
const toastRef = (0, import_react52.useRef)(null);
|
|
14319
|
+
const dragStartRef = (0, import_react52.useRef)(null);
|
|
14320
|
+
const axisRef = (0, import_react52.useRef)(null);
|
|
14321
|
+
const offsetRef = (0, import_react52.useRef)({ x: 0, y: 0 });
|
|
14322
|
+
const [swiping, setSwiping] = (0, import_react52.useState)(false);
|
|
14323
|
+
const clearSwipeOffset = (0, import_react52.useCallback)(() => {
|
|
14117
14324
|
const el = toastRef.current;
|
|
14118
14325
|
offsetRef.current = { x: 0, y: 0 };
|
|
14119
14326
|
if (!el) return;
|
|
@@ -14214,8 +14421,8 @@ function Toaster({
|
|
|
14214
14421
|
swipeDirections,
|
|
14215
14422
|
className
|
|
14216
14423
|
}) {
|
|
14217
|
-
const toasterKeyRef = (0,
|
|
14218
|
-
const isPortalOwner = (0,
|
|
14424
|
+
const toasterKeyRef = (0, import_react52.useRef)(/* @__PURE__ */ Symbol("refineui-toaster"));
|
|
14425
|
+
const isPortalOwner = (0, import_react52.useSyncExternalStore)(
|
|
14219
14426
|
(onStoreChange) => {
|
|
14220
14427
|
toasterOwnerListeners.add(onStoreChange);
|
|
14221
14428
|
return () => toasterOwnerListeners.delete(onStoreChange);
|
|
@@ -14223,12 +14430,12 @@ function Toaster({
|
|
|
14223
14430
|
() => activeToasterKey === toasterKeyRef.current,
|
|
14224
14431
|
() => false
|
|
14225
14432
|
);
|
|
14226
|
-
const [records, setRecords] = (0,
|
|
14227
|
-
const timerMapRef = (0,
|
|
14228
|
-
const pausedRef = (0,
|
|
14229
|
-
const rootRef = (0,
|
|
14230
|
-
const itemRefs = (0,
|
|
14231
|
-
const [layoutTick, setLayoutTick] = (0,
|
|
14433
|
+
const [records, setRecords] = (0, import_react52.useState)([]);
|
|
14434
|
+
const timerMapRef = (0, import_react52.useRef)({});
|
|
14435
|
+
const pausedRef = (0, import_react52.useRef)(/* @__PURE__ */ new Set());
|
|
14436
|
+
const rootRef = (0, import_react52.useRef)(null);
|
|
14437
|
+
const itemRefs = (0, import_react52.useRef)({});
|
|
14438
|
+
const [layoutTick, setLayoutTick] = (0, import_react52.useState)(0);
|
|
14232
14439
|
const stackGapPx = useToastStackGapPx();
|
|
14233
14440
|
const resolvedSwipe = swipeDirections ?? DEFAULT_SWIPE_DIRECTIONS;
|
|
14234
14441
|
useIsomorphicLayoutEffect7(() => {
|
|
@@ -14242,13 +14449,13 @@ function Toaster({
|
|
|
14242
14449
|
}
|
|
14243
14450
|
};
|
|
14244
14451
|
}, []);
|
|
14245
|
-
(0,
|
|
14452
|
+
(0, import_react52.useEffect)(() => {
|
|
14246
14453
|
if (!isPortalOwner) return;
|
|
14247
14454
|
return subscribeToasts((next) => {
|
|
14248
14455
|
setRecords(next.slice(0, Math.max(1, maxToasts)));
|
|
14249
14456
|
});
|
|
14250
14457
|
}, [isPortalOwner, maxToasts]);
|
|
14251
|
-
(0,
|
|
14458
|
+
(0, import_react52.useEffect)(() => {
|
|
14252
14459
|
if (!isPortalOwner) return;
|
|
14253
14460
|
for (const rec of records) {
|
|
14254
14461
|
if (rec.phase === "leaving") continue;
|
|
@@ -14270,7 +14477,7 @@ function Toaster({
|
|
|
14270
14477
|
}
|
|
14271
14478
|
}
|
|
14272
14479
|
}, [isPortalOwner, records]);
|
|
14273
|
-
(0,
|
|
14480
|
+
(0, import_react52.useEffect)(() => {
|
|
14274
14481
|
return () => {
|
|
14275
14482
|
for (const handle of Object.values(timerMapRef.current)) {
|
|
14276
14483
|
clearTimeout(handle);
|
|
@@ -14296,7 +14503,7 @@ function Toaster({
|
|
|
14296
14503
|
li.style.height = `${slotHeight(idx)}px`;
|
|
14297
14504
|
}
|
|
14298
14505
|
}, [isPortalOwner, layoutTick, records, stackGapPx]);
|
|
14299
|
-
(0,
|
|
14506
|
+
(0, import_react52.useEffect)(() => {
|
|
14300
14507
|
if (!isPortalOwner) return;
|
|
14301
14508
|
const root = rootRef.current;
|
|
14302
14509
|
if (!root) return;
|
|
@@ -14376,21 +14583,21 @@ function Toaster({
|
|
|
14376
14583
|
|
|
14377
14584
|
// src/components/Tree/Tree.tsx
|
|
14378
14585
|
var import_clsx100 = require("clsx");
|
|
14379
|
-
var
|
|
14586
|
+
var import_react54 = require("react");
|
|
14380
14587
|
|
|
14381
14588
|
// src/components/Tree/context.ts
|
|
14382
|
-
var
|
|
14383
|
-
var
|
|
14589
|
+
var import_react53 = require("react");
|
|
14590
|
+
var import_tokens31 = require("@refineui/tokens");
|
|
14384
14591
|
var import_animation8 = require("@refineui/utilities/animation");
|
|
14385
|
-
var TREE_PANEL_MS = Number.parseFloat(
|
|
14386
|
-
var TREE_CONTENT_MS = Number.parseFloat(
|
|
14387
|
-
var TREE_PANEL_EASE =
|
|
14388
|
-
var TREE_CONTENT_EASE =
|
|
14389
|
-
var TreeContext = (0,
|
|
14390
|
-
var TreeItemContext = (0,
|
|
14592
|
+
var TREE_PANEL_MS = Number.parseFloat(import_tokens31.semanticInteraction.duration.accordionPanel) / 1e3;
|
|
14593
|
+
var TREE_CONTENT_MS = Number.parseFloat(import_tokens31.semanticInteraction.duration.accordionContent) / 1e3;
|
|
14594
|
+
var TREE_PANEL_EASE = import_tokens31.semanticInteraction.easing.panel;
|
|
14595
|
+
var TREE_CONTENT_EASE = import_tokens31.semanticInteraction.easing.content;
|
|
14596
|
+
var TreeContext = (0, import_react53.createContext)(null);
|
|
14597
|
+
var TreeItemContext = (0, import_react53.createContext)(null);
|
|
14391
14598
|
function usePrefersReducedMotion2() {
|
|
14392
|
-
const [reduce, setReduce] = (0,
|
|
14393
|
-
(0,
|
|
14599
|
+
const [reduce, setReduce] = (0, import_react53.useState)(false);
|
|
14600
|
+
(0, import_react53.useEffect)(() => {
|
|
14394
14601
|
const mql = window.matchMedia((0, import_animation8.getReducedMotionQuery)().replace("@media ", ""));
|
|
14395
14602
|
const sync = () => setReduce(mql.matches);
|
|
14396
14603
|
sync();
|
|
@@ -14406,7 +14613,7 @@ function toExpandedSet(value) {
|
|
|
14406
14613
|
|
|
14407
14614
|
// src/components/Tree/style.ts
|
|
14408
14615
|
var import_clsx99 = require("clsx");
|
|
14409
|
-
var
|
|
14616
|
+
var import_tokens32 = require("@refineui/tokens");
|
|
14410
14617
|
var treeStyles = {
|
|
14411
14618
|
root: "m-0 flex list-none flex-col gap-px p-0",
|
|
14412
14619
|
item: "m-0 list-none p-0",
|
|
@@ -14434,9 +14641,9 @@ var treeStyles = {
|
|
|
14434
14641
|
label: "min-w-0 flex-1 truncate text-start"
|
|
14435
14642
|
};
|
|
14436
14643
|
var treeIconSize = {
|
|
14437
|
-
sm:
|
|
14438
|
-
md:
|
|
14439
|
-
lg:
|
|
14644
|
+
sm: import_tokens32.iconSizes.xxsmall,
|
|
14645
|
+
md: import_tokens32.iconSizes.xsmall,
|
|
14646
|
+
lg: import_tokens32.iconSizes.xsmall
|
|
14440
14647
|
};
|
|
14441
14648
|
var treeItemTypo = {
|
|
14442
14649
|
sm: sizedComponentTextClass(componentTypographyTokens.tree.item, "sm"),
|
|
@@ -14459,29 +14666,29 @@ function Tree({
|
|
|
14459
14666
|
...props
|
|
14460
14667
|
}) {
|
|
14461
14668
|
const reduceMotion = usePrefersReducedMotion2();
|
|
14462
|
-
const [uncontrolledExpanded, setUncontrolledExpanded] = (0,
|
|
14463
|
-
const [uncontrolledSelected, setUncontrolledSelected] = (0,
|
|
14669
|
+
const [uncontrolledExpanded, setUncontrolledExpanded] = (0, import_react54.useState)(() => toExpandedSet(defaultExpanded));
|
|
14670
|
+
const [uncontrolledSelected, setUncontrolledSelected] = (0, import_react54.useState)(defaultSelected ?? null);
|
|
14464
14671
|
const expanded = expandedProp === void 0 ? uncontrolledExpanded : toExpandedSet(expandedProp);
|
|
14465
14672
|
const selected = selectedProp === void 0 ? uncontrolledSelected : selectedProp;
|
|
14466
|
-
const orderRef = (0,
|
|
14467
|
-
const elMapRef = (0,
|
|
14468
|
-
const metaMapRef = (0,
|
|
14469
|
-
const emitExpanded = (0,
|
|
14673
|
+
const orderRef = (0, import_react54.useRef)([]);
|
|
14674
|
+
const elMapRef = (0, import_react54.useRef)(/* @__PURE__ */ new Map());
|
|
14675
|
+
const metaMapRef = (0, import_react54.useRef)(/* @__PURE__ */ new Map());
|
|
14676
|
+
const emitExpanded = (0, import_react54.useCallback)(
|
|
14470
14677
|
(next) => {
|
|
14471
14678
|
if (expandedProp === void 0) setUncontrolledExpanded(next);
|
|
14472
14679
|
onExpandedChange?.(Array.from(next));
|
|
14473
14680
|
},
|
|
14474
14681
|
[expandedProp, onExpandedChange]
|
|
14475
14682
|
);
|
|
14476
|
-
const emitSelected = (0,
|
|
14683
|
+
const emitSelected = (0, import_react54.useCallback)(
|
|
14477
14684
|
(next) => {
|
|
14478
14685
|
if (selectedProp === void 0) setUncontrolledSelected(next);
|
|
14479
14686
|
onSelectedChange?.(next);
|
|
14480
14687
|
},
|
|
14481
14688
|
[onSelectedChange, selectedProp]
|
|
14482
14689
|
);
|
|
14483
|
-
const isExpanded = (0,
|
|
14484
|
-
const toggleExpanded = (0,
|
|
14690
|
+
const isExpanded = (0, import_react54.useCallback)((value) => expanded.has(value), [expanded]);
|
|
14691
|
+
const toggleExpanded = (0, import_react54.useCallback)(
|
|
14485
14692
|
(value) => {
|
|
14486
14693
|
const next = new Set(expanded);
|
|
14487
14694
|
if (next.has(value)) next.delete(value);
|
|
@@ -14490,7 +14697,7 @@ function Tree({
|
|
|
14490
14697
|
},
|
|
14491
14698
|
[emitExpanded, expanded]
|
|
14492
14699
|
);
|
|
14493
|
-
const expand = (0,
|
|
14700
|
+
const expand = (0, import_react54.useCallback)(
|
|
14494
14701
|
(value) => {
|
|
14495
14702
|
if (expanded.has(value)) return;
|
|
14496
14703
|
const next = new Set(expanded);
|
|
@@ -14499,7 +14706,7 @@ function Tree({
|
|
|
14499
14706
|
},
|
|
14500
14707
|
[emitExpanded, expanded]
|
|
14501
14708
|
);
|
|
14502
|
-
const collapse = (0,
|
|
14709
|
+
const collapse = (0, import_react54.useCallback)(
|
|
14503
14710
|
(value) => {
|
|
14504
14711
|
if (!expanded.has(value)) return;
|
|
14505
14712
|
const next = new Set(expanded);
|
|
@@ -14508,13 +14715,13 @@ function Tree({
|
|
|
14508
14715
|
},
|
|
14509
14716
|
[emitExpanded, expanded]
|
|
14510
14717
|
);
|
|
14511
|
-
const select = (0,
|
|
14718
|
+
const select = (0, import_react54.useCallback)(
|
|
14512
14719
|
(value) => {
|
|
14513
14720
|
emitSelected(value);
|
|
14514
14721
|
},
|
|
14515
14722
|
[emitSelected]
|
|
14516
14723
|
);
|
|
14517
|
-
const registerItem = (0,
|
|
14724
|
+
const registerItem = (0, import_react54.useCallback)((value, el, meta) => {
|
|
14518
14725
|
metaMapRef.current.set(value, meta);
|
|
14519
14726
|
if (!orderRef.current.includes(value)) {
|
|
14520
14727
|
orderRef.current.push(value);
|
|
@@ -14526,10 +14733,10 @@ function Tree({
|
|
|
14526
14733
|
orderRef.current = orderRef.current.filter((v) => v !== value);
|
|
14527
14734
|
}
|
|
14528
14735
|
}, []);
|
|
14529
|
-
const focusItem = (0,
|
|
14736
|
+
const focusItem = (0, import_react54.useCallback)((value) => {
|
|
14530
14737
|
elMapRef.current.get(value)?.focus();
|
|
14531
14738
|
}, []);
|
|
14532
|
-
const visibleValues = (0,
|
|
14739
|
+
const visibleValues = (0, import_react54.useCallback)(() => {
|
|
14533
14740
|
const result = [];
|
|
14534
14741
|
const walk = (parent) => {
|
|
14535
14742
|
for (const value of orderRef.current) {
|
|
@@ -14543,7 +14750,7 @@ function Tree({
|
|
|
14543
14750
|
walk(null);
|
|
14544
14751
|
return result;
|
|
14545
14752
|
}, [expanded]);
|
|
14546
|
-
const focusByDelta = (0,
|
|
14753
|
+
const focusByDelta = (0, import_react54.useCallback)(
|
|
14547
14754
|
(currentValue, delta) => {
|
|
14548
14755
|
const list = visibleValues();
|
|
14549
14756
|
const idx = list.indexOf(currentValue);
|
|
@@ -14553,17 +14760,17 @@ function Tree({
|
|
|
14553
14760
|
},
|
|
14554
14761
|
[focusItem, visibleValues]
|
|
14555
14762
|
);
|
|
14556
|
-
const focusFirst = (0,
|
|
14763
|
+
const focusFirst = (0, import_react54.useCallback)(() => {
|
|
14557
14764
|
const list = visibleValues();
|
|
14558
14765
|
if (list[0]) focusItem(list[0]);
|
|
14559
14766
|
}, [focusItem, visibleValues]);
|
|
14560
|
-
const focusLast = (0,
|
|
14767
|
+
const focusLast = (0, import_react54.useCallback)(() => {
|
|
14561
14768
|
const list = visibleValues();
|
|
14562
14769
|
const last = list[list.length - 1];
|
|
14563
14770
|
if (last) focusItem(last);
|
|
14564
14771
|
}, [focusItem, visibleValues]);
|
|
14565
|
-
const getParent = (0,
|
|
14566
|
-
const contextValue = (0,
|
|
14772
|
+
const getParent = (0, import_react54.useCallback)((value) => metaMapRef.current.get(value)?.parentValue ?? null, []);
|
|
14773
|
+
const contextValue = (0, import_react54.useMemo)(
|
|
14567
14774
|
() => ({
|
|
14568
14775
|
size,
|
|
14569
14776
|
isExpanded,
|
|
@@ -14611,21 +14818,21 @@ function Tree({
|
|
|
14611
14818
|
|
|
14612
14819
|
// src/components/Tree/TreeItem.tsx
|
|
14613
14820
|
var import_clsx101 = require("clsx");
|
|
14614
|
-
var
|
|
14821
|
+
var import_react55 = require("react");
|
|
14615
14822
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
14616
14823
|
function TreeItem({ value, disabled = false, className, children, ...props }) {
|
|
14617
|
-
const tree = (0,
|
|
14618
|
-
const parent = (0,
|
|
14824
|
+
const tree = (0, import_react55.useContext)(TreeContext);
|
|
14825
|
+
const parent = (0, import_react55.useContext)(TreeItemContext);
|
|
14619
14826
|
if (!tree) throw new Error("TreeItem must be used within Tree.");
|
|
14620
|
-
const [hasBranch, setHasBranch] = (0,
|
|
14621
|
-
const uid = (0,
|
|
14827
|
+
const [hasBranch, setHasBranch] = (0, import_react55.useState)(false);
|
|
14828
|
+
const uid = (0, import_react55.useId)().replace(/:/g, "");
|
|
14622
14829
|
const depth = parent ? parent.depth + 1 : 0;
|
|
14623
14830
|
const parentValue = parent?.value ?? null;
|
|
14624
14831
|
const expanded = tree.isExpanded(value);
|
|
14625
14832
|
const selected = tree.selected === value;
|
|
14626
14833
|
const triggerId = `tree-trigger-${uid}-${value}`;
|
|
14627
14834
|
const groupId = `tree-group-${uid}-${value}`;
|
|
14628
|
-
const itemContext = (0,
|
|
14835
|
+
const itemContext = (0, import_react55.useMemo)(
|
|
14629
14836
|
() => ({
|
|
14630
14837
|
value,
|
|
14631
14838
|
depth,
|
|
@@ -14661,18 +14868,18 @@ function TreeItem({ value, disabled = false, className, children, ...props }) {
|
|
|
14661
14868
|
|
|
14662
14869
|
// src/components/Tree/TreeItemTrigger.tsx
|
|
14663
14870
|
var import_clsx102 = require("clsx");
|
|
14664
|
-
var
|
|
14871
|
+
var import_react56 = require("react");
|
|
14665
14872
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
14666
14873
|
function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props }) {
|
|
14667
|
-
const tree = (0,
|
|
14668
|
-
const item = (0,
|
|
14874
|
+
const tree = (0, import_react56.useContext)(TreeContext);
|
|
14875
|
+
const item = (0, import_react56.useContext)(TreeItemContext);
|
|
14669
14876
|
if (!tree || !item) throw new Error("TreeItemTrigger must be used within TreeItem.");
|
|
14670
14877
|
const iconSize = treeIconSize[tree.size];
|
|
14671
14878
|
const depthIndent = "calc(var(--refineui-spacing-size-large) + var(--refineui-spacing-size-x-small))";
|
|
14672
14879
|
const mainStyle = {
|
|
14673
14880
|
paddingInlineStart: item.depth > 0 ? `calc(${depthIndent} * ${item.depth})` : void 0
|
|
14674
14881
|
};
|
|
14675
|
-
(0,
|
|
14882
|
+
(0, import_react56.useEffect)(() => {
|
|
14676
14883
|
return () => {
|
|
14677
14884
|
tree.registerItem(item.value, null, {
|
|
14678
14885
|
parentValue: item.parentValue,
|
|
@@ -14793,14 +15000,14 @@ function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props })
|
|
|
14793
15000
|
|
|
14794
15001
|
// src/components/Tree/TreeItemContent.tsx
|
|
14795
15002
|
var import_clsx103 = require("clsx");
|
|
14796
|
-
var
|
|
15003
|
+
var import_react57 = require("react");
|
|
14797
15004
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
14798
15005
|
function TreeItemContent({ className, children, ...props }) {
|
|
14799
|
-
const tree = (0,
|
|
14800
|
-
const item = (0,
|
|
15006
|
+
const tree = (0, import_react57.useContext)(TreeContext);
|
|
15007
|
+
const item = (0, import_react57.useContext)(TreeItemContext);
|
|
14801
15008
|
if (!tree || !item) throw new Error("TreeItemContent must be used within TreeItem.");
|
|
14802
15009
|
const { setHasBranch, expanded, groupId, triggerId } = item;
|
|
14803
|
-
(0,
|
|
15010
|
+
(0, import_react57.useLayoutEffect)(() => {
|
|
14804
15011
|
setHasBranch(true);
|
|
14805
15012
|
return () => setHasBranch(false);
|
|
14806
15013
|
}, [setHasBranch]);
|
|
@@ -14844,16 +15051,16 @@ function TreeItemContent({ className, children, ...props }) {
|
|
|
14844
15051
|
|
|
14845
15052
|
// src/components/Tooltip/Tooltip.tsx
|
|
14846
15053
|
var import_clsx105 = require("clsx");
|
|
14847
|
-
var
|
|
14848
|
-
var
|
|
15054
|
+
var import_react58 = require("react");
|
|
15055
|
+
var import_tokens34 = require("@refineui/tokens");
|
|
14849
15056
|
var import_color13 = require("@refineui/utilities/color");
|
|
14850
|
-
var
|
|
15057
|
+
var import_react59 = require("@refineui/utilities/react");
|
|
14851
15058
|
|
|
14852
15059
|
// src/components/Tooltip/style.ts
|
|
14853
|
-
var
|
|
15060
|
+
var import_tokens33 = require("@refineui/tokens");
|
|
14854
15061
|
var import_clsx104 = require("clsx");
|
|
14855
|
-
var gap = `calc(${import_tokens3.componentSizes.tooltipBeakHeight} + ${
|
|
14856
|
-
var TOOLTIP_BEAK_INSET =
|
|
15062
|
+
var gap = `calc(${import_tokens3.componentSizes.tooltipBeakHeight} + ${import_tokens33.spacings.sizeXXSmall})`;
|
|
15063
|
+
var TOOLTIP_BEAK_INSET = import_tokens33.spacings.sizeMedium;
|
|
14857
15064
|
var tooltipStyles = {
|
|
14858
15065
|
root: "relative inline-block",
|
|
14859
15066
|
fallbackTrigger: "inline-flex outline-none",
|
|
@@ -14863,7 +15070,7 @@ var tooltipStyles = {
|
|
|
14863
15070
|
/** Fill, stroke, and shadow come from `FloatingSurface`; the transparent border keeps the box size. */
|
|
14864
15071
|
panel: (0, import_clsx104.clsx)(
|
|
14865
15072
|
componentTextClass(componentTypographyTokens.tooltip),
|
|
14866
|
-
"relative z-0 box-border max-w-refineui-tooltip-max-width whitespace-nowrap rounded-refineui-medium border-refineui-
|
|
15073
|
+
"relative z-0 box-border max-w-refineui-tooltip-max-width whitespace-nowrap rounded-refineui-medium border-refineui-hairline border-transparent px-refineui-size-medium py-refineui-size-small"
|
|
14867
15074
|
)
|
|
14868
15075
|
};
|
|
14869
15076
|
function tooltipPlacement(position) {
|
|
@@ -14930,11 +15137,11 @@ function Tooltip({
|
|
|
14930
15137
|
className,
|
|
14931
15138
|
...props
|
|
14932
15139
|
}) {
|
|
14933
|
-
const [innerOpen, setInnerOpen] = (0,
|
|
15140
|
+
const [innerOpen, setInnerOpen] = (0, import_react58.useState)(defaultOpen);
|
|
14934
15141
|
const open = ctrlOpen !== void 0 ? ctrlOpen : innerOpen;
|
|
14935
|
-
const tooltipId = (0,
|
|
14936
|
-
const showTimer = (0,
|
|
14937
|
-
const panelRef = (0,
|
|
15142
|
+
const tooltipId = (0, import_react58.useId)();
|
|
15143
|
+
const showTimer = (0, import_react58.useRef)(null);
|
|
15144
|
+
const panelRef = (0, import_react58.useRef)(null);
|
|
14938
15145
|
const setOpen = (next) => {
|
|
14939
15146
|
if (ctrlOpen === void 0) setInnerOpen(next);
|
|
14940
15147
|
onOpenChange?.(next);
|
|
@@ -14959,11 +15166,11 @@ function Tooltip({
|
|
|
14959
15166
|
};
|
|
14960
15167
|
const floatingStyle = tooltipFloatingStyle(position, align);
|
|
14961
15168
|
const describedBy = open ? tooltipId : void 0;
|
|
14962
|
-
const mergeEl = (0,
|
|
15169
|
+
const mergeEl = (0, import_react59.getMergeableTriggerChild)(trigger);
|
|
14963
15170
|
let triggerNode;
|
|
14964
15171
|
if (mergeEl != null) {
|
|
14965
15172
|
triggerNode = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14966
|
-
|
|
15173
|
+
import_react59.Slot,
|
|
14967
15174
|
{
|
|
14968
15175
|
"aria-describedby": describedBy,
|
|
14969
15176
|
onMouseEnter: scheduleShow,
|
|
@@ -15019,7 +15226,7 @@ function Tooltip({
|
|
|
15019
15226
|
panelRef,
|
|
15020
15227
|
side: tooltipBeakSide(position),
|
|
15021
15228
|
align: tooltipAlignKey(align),
|
|
15022
|
-
radius:
|
|
15229
|
+
radius: import_tokens34.borderRadii.roundedMedium,
|
|
15023
15230
|
beakWidth: import_tokens3.componentSizes.tooltipBeakWidth,
|
|
15024
15231
|
beakHeight: import_tokens3.componentSizes.tooltipBeakHeight,
|
|
15025
15232
|
tipRadius: import_tokens3.componentSizes.tooltipBeakTipRadius,
|
|
@@ -15035,8 +15242,8 @@ function Tooltip({
|
|
|
15035
15242
|
|
|
15036
15243
|
// src/components/Chart/Chart.tsx
|
|
15037
15244
|
var import_clsx107 = require("clsx");
|
|
15038
|
-
var
|
|
15039
|
-
var
|
|
15245
|
+
var import_react60 = require("react");
|
|
15246
|
+
var import_tokens36 = require("@refineui/tokens");
|
|
15040
15247
|
var import_color14 = require("@refineui/utilities/color");
|
|
15041
15248
|
|
|
15042
15249
|
// src/components/Chart/style.ts
|
|
@@ -15081,16 +15288,16 @@ var chartStyles = {
|
|
|
15081
15288
|
};
|
|
15082
15289
|
|
|
15083
15290
|
// src/components/Chart/utils.ts
|
|
15084
|
-
var
|
|
15291
|
+
var import_tokens35 = require("@refineui/tokens");
|
|
15085
15292
|
var CHART_VIEWBOX_WIDTH = 800;
|
|
15086
15293
|
var CHART_VIEWBOX_HEIGHT = 320;
|
|
15087
|
-
var CHART_PLOT_PADDING_TOP = parseFloat(
|
|
15088
|
-
var CHART_PLOT_PADDING_BOTTOM = parseFloat(
|
|
15089
|
-
var CHART_PLOT_PADDING_X = parseFloat(
|
|
15090
|
-
var CHART_BAR_RADIUS = parseFloat(
|
|
15294
|
+
var CHART_PLOT_PADDING_TOP = parseFloat(import_tokens35.spacings.sizeMedium);
|
|
15295
|
+
var CHART_PLOT_PADDING_BOTTOM = parseFloat(import_tokens35.spacings.sizeXXSmall);
|
|
15296
|
+
var CHART_PLOT_PADDING_X = parseFloat(import_tokens35.spacings.sizeMedium);
|
|
15297
|
+
var CHART_BAR_RADIUS = parseFloat(import_tokens35.borderRadii.roundedXLarge);
|
|
15091
15298
|
var CHART_BAR_BAND_FILL = 0.5;
|
|
15092
|
-
var CHART_POINT_RADIUS = parseFloat(
|
|
15093
|
-
var CHART_POINT_STROKE = parseFloat(
|
|
15299
|
+
var CHART_POINT_RADIUS = parseFloat(import_tokens35.foundationSizes.foundationSize40);
|
|
15300
|
+
var CHART_POINT_STROKE = parseFloat(import_tokens35.foundationSizes.foundationSize20);
|
|
15094
15301
|
var CHART_TOOLTIP_FLIP_X = 0.75;
|
|
15095
15302
|
var CHART_TOOLTIP_FLIP_Y = 0.25;
|
|
15096
15303
|
function clampValue(n) {
|
|
@@ -15263,9 +15470,9 @@ function formatAxisTick(value) {
|
|
|
15263
15470
|
|
|
15264
15471
|
// src/components/Chart/Chart.tsx
|
|
15265
15472
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
15266
|
-
var ChartContext = (0,
|
|
15473
|
+
var ChartContext = (0, import_react60.createContext)(null);
|
|
15267
15474
|
function useChartContext(component) {
|
|
15268
|
-
const value = (0,
|
|
15475
|
+
const value = (0, import_react60.useContext)(ChartContext);
|
|
15269
15476
|
if (!value) throw new Error(`${component} must be used within Chart.`);
|
|
15270
15477
|
return value;
|
|
15271
15478
|
}
|
|
@@ -15295,15 +15502,15 @@ function itemState(index, hoverIndex, selectedIndex) {
|
|
|
15295
15502
|
return "default";
|
|
15296
15503
|
}
|
|
15297
15504
|
function isChartTooltipElement(node) {
|
|
15298
|
-
return (0,
|
|
15505
|
+
return (0, import_react60.isValidElement)(node) && node.type === ChartTooltip;
|
|
15299
15506
|
}
|
|
15300
15507
|
function Chart({ className, children, ...props }) {
|
|
15301
|
-
const [hoverIndex, setHoverIndex] = (0,
|
|
15302
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
15303
|
-
const [pointer, setPointer] = (0,
|
|
15304
|
-
const [labels, setLabels] = (0,
|
|
15305
|
-
const [series, setSeries] = (0,
|
|
15306
|
-
const context = (0,
|
|
15508
|
+
const [hoverIndex, setHoverIndex] = (0, import_react60.useState)(null);
|
|
15509
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react60.useState)(null);
|
|
15510
|
+
const [pointer, setPointer] = (0, import_react60.useState)(null);
|
|
15511
|
+
const [labels, setLabels] = (0, import_react60.useState)([]);
|
|
15512
|
+
const [series, setSeries] = (0, import_react60.useState)(null);
|
|
15513
|
+
const context = (0, import_react60.useMemo)(
|
|
15307
15514
|
() => ({
|
|
15308
15515
|
hoverIndex,
|
|
15309
15516
|
selectedIndex,
|
|
@@ -15398,7 +15605,7 @@ function ChartPlot({
|
|
|
15398
15605
|
const { pointer, selectedIndex } = useChartContext("ChartPlot");
|
|
15399
15606
|
const svgChildren = [];
|
|
15400
15607
|
const tooltipNodes = [];
|
|
15401
|
-
|
|
15608
|
+
import_react60.Children.forEach(children, (child) => {
|
|
15402
15609
|
if (isChartTooltipElement(child)) tooltipNodes.push(child);
|
|
15403
15610
|
else svgChildren.push(child);
|
|
15404
15611
|
});
|
|
@@ -15514,7 +15721,7 @@ function ChartGrid({
|
|
|
15514
15721
|
y2: y,
|
|
15515
15722
|
stroke: isBaseline ? baselineColor : gridColor,
|
|
15516
15723
|
strokeWidth: "var(--refineui-stroke-width-thin)",
|
|
15517
|
-
strokeOpacity: isBaseline ?
|
|
15724
|
+
strokeOpacity: isBaseline ? import_tokens36.opacities.opacityFull : import_tokens36.opacities.opacityDisabled,
|
|
15518
15725
|
vectorEffect: "non-scaling-stroke"
|
|
15519
15726
|
},
|
|
15520
15727
|
tick
|
|
@@ -15537,7 +15744,7 @@ function ChartBars({
|
|
|
15537
15744
|
const barRadius = Math.min(CHART_BAR_RADIUS, barWidth / 2);
|
|
15538
15745
|
const baselineY = plotBaselineY();
|
|
15539
15746
|
const trackHeight = plotHeight();
|
|
15540
|
-
(0,
|
|
15747
|
+
(0, import_react60.useLayoutEffect)(() => {
|
|
15541
15748
|
setSeries({ values, seriesColor, max, align: "bar" });
|
|
15542
15749
|
}, [values, seriesColor, max, setSeries]);
|
|
15543
15750
|
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("g", { "data-refineui": "chart-bars", "data-series-color": seriesColor, className, ...props, children: [
|
|
@@ -15588,14 +15795,14 @@ function ChartLine({
|
|
|
15588
15795
|
...props
|
|
15589
15796
|
}) {
|
|
15590
15797
|
const { hoverIndex, selectedIndex, setSeries } = useChartContext("ChartLine");
|
|
15591
|
-
const gradientId = (0,
|
|
15798
|
+
const gradientId = (0, import_react60.useId)().replace(/:/g, "");
|
|
15592
15799
|
const scaleMax = resolveChartScale(values, max);
|
|
15593
15800
|
const stroke = seriesColorToken(seriesColor);
|
|
15594
15801
|
const coords = linePointCoords(values, scaleMax);
|
|
15595
15802
|
const baselineY = plotBaselineY();
|
|
15596
15803
|
const pointRing = pointStrokeColor();
|
|
15597
15804
|
const linePath = monotoneLinePath(coords);
|
|
15598
|
-
(0,
|
|
15805
|
+
(0, import_react60.useLayoutEffect)(() => {
|
|
15599
15806
|
setSeries({ values, seriesColor, max, align: "line" });
|
|
15600
15807
|
}, [values, seriesColor, max, setSeries]);
|
|
15601
15808
|
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("g", { "data-refineui": "chart-line", "data-series-color": seriesColor, className, ...props, children: [
|
|
@@ -15606,7 +15813,7 @@ function ChartLine({
|
|
|
15606
15813
|
{
|
|
15607
15814
|
offset: "0%",
|
|
15608
15815
|
stopColor: stroke,
|
|
15609
|
-
stopOpacity:
|
|
15816
|
+
stopOpacity: import_tokens36.opacities.opacityDisabled
|
|
15610
15817
|
}
|
|
15611
15818
|
),
|
|
15612
15819
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("stop", { offset: "100%", stopColor: stroke, stopOpacity: "0" })
|
|
@@ -15664,7 +15871,7 @@ function ChartAxisLabels({
|
|
|
15664
15871
|
const { hoverIndex, selectedIndex, setLabels } = useChartContext("ChartAxisLabels");
|
|
15665
15872
|
const count = labels.length;
|
|
15666
15873
|
const centerAt = align === "line" ? linePointCenterRatio : barBandCenterRatio;
|
|
15667
|
-
(0,
|
|
15874
|
+
(0, import_react60.useLayoutEffect)(() => {
|
|
15668
15875
|
setLabels(labels);
|
|
15669
15876
|
}, [labels, setLabels]);
|
|
15670
15877
|
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
@@ -15733,26 +15940,26 @@ function ChartLegendItem({
|
|
|
15733
15940
|
}
|
|
15734
15941
|
|
|
15735
15942
|
// src/components/Slot/Slot.tsx
|
|
15736
|
-
var
|
|
15943
|
+
var import_react61 = require("@refineui/utilities/react");
|
|
15737
15944
|
|
|
15738
15945
|
// src/components/Collapsible/Collapsible.tsx
|
|
15739
|
-
var
|
|
15946
|
+
var import_react63 = require("react");
|
|
15740
15947
|
var import_clsx108 = require("clsx");
|
|
15741
|
-
var
|
|
15948
|
+
var import_react64 = require("@refineui/utilities/react");
|
|
15742
15949
|
|
|
15743
15950
|
// src/components/Collapsible/context.ts
|
|
15744
|
-
var
|
|
15745
|
-
var
|
|
15951
|
+
var import_react62 = require("react");
|
|
15952
|
+
var import_tokens37 = require("@refineui/tokens");
|
|
15746
15953
|
var import_animation9 = require("@refineui/utilities/animation");
|
|
15747
|
-
var CollapsibleContext = (0,
|
|
15954
|
+
var CollapsibleContext = (0, import_react62.createContext)(null);
|
|
15748
15955
|
function useCollapsibleContext(part) {
|
|
15749
|
-
const value = (0,
|
|
15956
|
+
const value = (0, import_react62.useContext)(CollapsibleContext);
|
|
15750
15957
|
if (!value) throw new Error(`${part} must be used within Collapsible`);
|
|
15751
15958
|
return value;
|
|
15752
15959
|
}
|
|
15753
15960
|
function usePrefersReducedMotion3() {
|
|
15754
|
-
const [reduce, setReduce] = (0,
|
|
15755
|
-
(0,
|
|
15961
|
+
const [reduce, setReduce] = (0, import_react62.useState)(false);
|
|
15962
|
+
(0, import_react62.useEffect)(() => {
|
|
15756
15963
|
const mql = window.matchMedia((0, import_animation9.getReducedMotionQuery)().replace("@media ", ""));
|
|
15757
15964
|
const sync = () => setReduce(mql.matches);
|
|
15758
15965
|
sync();
|
|
@@ -15761,10 +15968,10 @@ function usePrefersReducedMotion3() {
|
|
|
15761
15968
|
}, []);
|
|
15762
15969
|
return reduce;
|
|
15763
15970
|
}
|
|
15764
|
-
var PANEL_HEIGHT_MS2 = Number.parseFloat(
|
|
15765
|
-
var PANEL_CONTENT_MS2 = Number.parseFloat(
|
|
15766
|
-
var PANEL_HEIGHT_EASE2 =
|
|
15767
|
-
var PANEL_CONTENT_EASE2 =
|
|
15971
|
+
var PANEL_HEIGHT_MS2 = Number.parseFloat(import_tokens37.semanticInteraction.duration.panel) / 1e3;
|
|
15972
|
+
var PANEL_CONTENT_MS2 = Number.parseFloat(import_tokens37.semanticInteraction.duration.normal) / 1e3;
|
|
15973
|
+
var PANEL_HEIGHT_EASE2 = import_tokens37.semanticInteraction.easing.panel;
|
|
15974
|
+
var PANEL_CONTENT_EASE2 = import_tokens37.semanticInteraction.easing.content;
|
|
15768
15975
|
|
|
15769
15976
|
// src/components/Collapsible/style.ts
|
|
15770
15977
|
var collapsibleStyles = {
|
|
@@ -15773,17 +15980,17 @@ var collapsibleStyles = {
|
|
|
15773
15980
|
|
|
15774
15981
|
// src/components/Collapsible/Collapsible.tsx
|
|
15775
15982
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
15776
|
-
var Collapsible = (0,
|
|
15777
|
-
const [uncontrolled, setUncontrolled] = (0,
|
|
15983
|
+
var Collapsible = (0, import_react63.forwardRef)(function Collapsible2({ open: openProp, defaultOpen = false, onOpenChange, asChild = false, className, children, ...props }, ref) {
|
|
15984
|
+
const [uncontrolled, setUncontrolled] = (0, import_react63.useState)(defaultOpen);
|
|
15778
15985
|
const open = openProp ?? uncontrolled;
|
|
15779
|
-
const reactId = (0,
|
|
15986
|
+
const reactId = (0, import_react63.useId)();
|
|
15780
15987
|
const reduceMotion = usePrefersReducedMotion3();
|
|
15781
|
-
const toggle = (0,
|
|
15988
|
+
const toggle = (0, import_react63.useCallback)(() => {
|
|
15782
15989
|
const next = !(openProp ?? uncontrolled);
|
|
15783
15990
|
if (openProp === void 0) setUncontrolled(next);
|
|
15784
15991
|
onOpenChange?.(next);
|
|
15785
15992
|
}, [onOpenChange, openProp, uncontrolled]);
|
|
15786
|
-
const contextValue = (0,
|
|
15993
|
+
const contextValue = (0, import_react63.useMemo)(
|
|
15787
15994
|
() => ({
|
|
15788
15995
|
open,
|
|
15789
15996
|
toggle,
|
|
@@ -15800,9 +16007,9 @@ var Collapsible = (0, import_react62.forwardRef)(function Collapsible2({ open: o
|
|
|
15800
16007
|
"data-refineui": "collapsible",
|
|
15801
16008
|
className
|
|
15802
16009
|
};
|
|
15803
|
-
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(CollapsibleContext.Provider, { value: contextValue, children: asChild ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
16010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(CollapsibleContext.Provider, { value: contextValue, children: asChild ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react64.Slot, { ...shared, children }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { ...shared, children }) });
|
|
15804
16011
|
});
|
|
15805
|
-
var CollapsibleTrigger = (0,
|
|
16012
|
+
var CollapsibleTrigger = (0, import_react63.forwardRef)(
|
|
15806
16013
|
function CollapsibleTrigger2({
|
|
15807
16014
|
asChild = false,
|
|
15808
16015
|
onClick,
|
|
@@ -15829,7 +16036,7 @@ var CollapsibleTrigger = (0, import_react62.forwardRef)(
|
|
|
15829
16036
|
if (!event.defaultPrevented) toggle();
|
|
15830
16037
|
}
|
|
15831
16038
|
};
|
|
15832
|
-
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
16039
|
+
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react64.Slot, { ...shared, children });
|
|
15833
16040
|
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
15834
16041
|
Button,
|
|
15835
16042
|
{
|
|
@@ -15844,7 +16051,7 @@ var CollapsibleTrigger = (0, import_react62.forwardRef)(
|
|
|
15844
16051
|
);
|
|
15845
16052
|
}
|
|
15846
16053
|
);
|
|
15847
|
-
var CollapsibleContent = (0,
|
|
16054
|
+
var CollapsibleContent = (0, import_react63.forwardRef)(
|
|
15848
16055
|
function CollapsibleContent2({ className, children, style, ...props }, ref) {
|
|
15849
16056
|
const { open, contentId, triggerId, reduceMotion } = useCollapsibleContext("CollapsibleContent");
|
|
15850
16057
|
const gridStyle = {
|
|
@@ -15878,19 +16085,19 @@ var CollapsibleContent = (0, import_react62.forwardRef)(
|
|
|
15878
16085
|
);
|
|
15879
16086
|
|
|
15880
16087
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
15881
|
-
var
|
|
16088
|
+
var import_react65 = require("react");
|
|
15882
16089
|
var import_react_dom8 = require("react-dom");
|
|
15883
16090
|
var import_clsx109 = require("clsx");
|
|
15884
|
-
var
|
|
16091
|
+
var import_tokens38 = require("@refineui/tokens");
|
|
15885
16092
|
var import_animation10 = require("@refineui/utilities/animation");
|
|
15886
|
-
var
|
|
16093
|
+
var import_react66 = require("@refineui/utilities/react");
|
|
15887
16094
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
15888
16095
|
var MENU_ATTR = "data-refineui-context-menu";
|
|
15889
|
-
var CLOSE_MS = (0, import_animation10.motionMsToNumber)(
|
|
15890
|
-
var MenuContext2 = (0,
|
|
15891
|
-
var SubContext = (0,
|
|
16096
|
+
var CLOSE_MS = (0, import_animation10.motionMsToNumber)(import_tokens38.semanticInteraction.duration.normal);
|
|
16097
|
+
var MenuContext2 = (0, import_react65.createContext)(null);
|
|
16098
|
+
var SubContext = (0, import_react65.createContext)(null);
|
|
15892
16099
|
function useMenu() {
|
|
15893
|
-
const value = (0,
|
|
16100
|
+
const value = (0, import_react65.useContext)(MenuContext2);
|
|
15894
16101
|
if (!value) throw new Error("Context menu parts must be used within ContextMenu");
|
|
15895
16102
|
return value;
|
|
15896
16103
|
}
|
|
@@ -15907,29 +16114,29 @@ function placeInView(element, x, y) {
|
|
|
15907
16114
|
}
|
|
15908
16115
|
function ContextMenu({ modal = true, onOpenChange, children }) {
|
|
15909
16116
|
void modal;
|
|
15910
|
-
const [open, setOpen] = (0,
|
|
15911
|
-
const [point, setPoint] = (0,
|
|
15912
|
-
const openRef = (0,
|
|
15913
|
-
const onOpenChangeRef = (0,
|
|
16117
|
+
const [open, setOpen] = (0, import_react65.useState)(false);
|
|
16118
|
+
const [point, setPoint] = (0, import_react65.useState)({ x: 0, y: 0 });
|
|
16119
|
+
const openRef = (0, import_react65.useRef)(false);
|
|
16120
|
+
const onOpenChangeRef = (0, import_react65.useRef)(onOpenChange);
|
|
15914
16121
|
openRef.current = open;
|
|
15915
16122
|
onOpenChangeRef.current = onOpenChange;
|
|
15916
|
-
const close = (0,
|
|
16123
|
+
const close = (0, import_react65.useCallback)(() => {
|
|
15917
16124
|
if (!openRef.current) return;
|
|
15918
16125
|
openRef.current = false;
|
|
15919
16126
|
setOpen(false);
|
|
15920
16127
|
onOpenChangeRef.current?.(false);
|
|
15921
16128
|
}, []);
|
|
15922
|
-
const openAt = (0,
|
|
16129
|
+
const openAt = (0, import_react65.useCallback)((x, y) => {
|
|
15923
16130
|
setPoint({ x, y });
|
|
15924
16131
|
const wasOpen = openRef.current;
|
|
15925
16132
|
openRef.current = true;
|
|
15926
16133
|
setOpen(true);
|
|
15927
16134
|
if (!wasOpen) onOpenChangeRef.current?.(true);
|
|
15928
16135
|
}, []);
|
|
15929
|
-
const value = (0,
|
|
16136
|
+
const value = (0, import_react65.useMemo)(() => ({ open, point, openAt, close }), [open, point, openAt, close]);
|
|
15930
16137
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(MenuContext2.Provider, { value, children });
|
|
15931
16138
|
}
|
|
15932
|
-
var ContextMenuTrigger = (0,
|
|
16139
|
+
var ContextMenuTrigger = (0, import_react65.forwardRef)(function ContextMenuTrigger2({ asChild = false, onContextMenu, children, ...props }, ref) {
|
|
15933
16140
|
const { openAt } = useMenu();
|
|
15934
16141
|
const shared = {
|
|
15935
16142
|
...props,
|
|
@@ -15942,18 +16149,18 @@ var ContextMenuTrigger = (0, import_react64.forwardRef)(function ContextMenuTrig
|
|
|
15942
16149
|
openAt(event.clientX, event.clientY);
|
|
15943
16150
|
}
|
|
15944
16151
|
};
|
|
15945
|
-
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16152
|
+
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react66.Slot, { ...shared, children });
|
|
15946
16153
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { ...shared, className: (0, import_clsx109.clsx)(menuStyles.triggerFallback, props.className), children });
|
|
15947
16154
|
});
|
|
15948
16155
|
function ContextMenuPortal({ children }) {
|
|
15949
16156
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_jsx_runtime81.Fragment, { children });
|
|
15950
16157
|
}
|
|
15951
|
-
var ContextMenuContent = (0,
|
|
16158
|
+
var ContextMenuContent = (0, import_react65.forwardRef)(function ContextMenuContent2({ className, style, onPointerDown, children, ...props }, ref) {
|
|
15952
16159
|
const { open, point, close } = useMenu();
|
|
15953
|
-
const localRef = (0,
|
|
15954
|
-
const [shouldRender, setShouldRender] = (0,
|
|
15955
|
-
const [isClosing, setIsClosing] = (0,
|
|
15956
|
-
(0,
|
|
16160
|
+
const localRef = (0, import_react65.useRef)(null);
|
|
16161
|
+
const [shouldRender, setShouldRender] = (0, import_react65.useState)(open);
|
|
16162
|
+
const [isClosing, setIsClosing] = (0, import_react65.useState)(false);
|
|
16163
|
+
(0, import_react65.useEffect)(() => {
|
|
15957
16164
|
if (open) {
|
|
15958
16165
|
setShouldRender(true);
|
|
15959
16166
|
setIsClosing(false);
|
|
@@ -15967,11 +16174,11 @@ var ContextMenuContent = (0, import_react64.forwardRef)(function ContextMenuCont
|
|
|
15967
16174
|
}, CLOSE_MS);
|
|
15968
16175
|
return () => window.clearTimeout(timeout);
|
|
15969
16176
|
}, [open, shouldRender]);
|
|
15970
|
-
(0,
|
|
16177
|
+
(0, import_react65.useLayoutEffect)(() => {
|
|
15971
16178
|
if (!shouldRender || !localRef.current) return;
|
|
15972
16179
|
placeInView(localRef.current, point.x, point.y);
|
|
15973
16180
|
}, [shouldRender, point.x, point.y]);
|
|
15974
|
-
(0,
|
|
16181
|
+
(0, import_react65.useEffect)(() => {
|
|
15975
16182
|
if (!open) return;
|
|
15976
16183
|
const onKey = (event) => {
|
|
15977
16184
|
if (event.key === "Escape") close();
|
|
@@ -16007,8 +16214,8 @@ var ContextMenuContent = (0, import_react64.forwardRef)(function ContextMenuCont
|
|
|
16007
16214
|
position: "fixed",
|
|
16008
16215
|
top: point.y,
|
|
16009
16216
|
left: point.x,
|
|
16010
|
-
width:
|
|
16011
|
-
minWidth:
|
|
16217
|
+
width: import_tokens38.componentSizes.menuPanelWidth,
|
|
16218
|
+
minWidth: import_tokens38.componentSizes.menuPanelWidth,
|
|
16012
16219
|
zIndex: 9999,
|
|
16013
16220
|
...style
|
|
16014
16221
|
},
|
|
@@ -16034,7 +16241,7 @@ function runSelect(onSelect, close, disabled) {
|
|
|
16034
16241
|
onSelect?.(selectEvent);
|
|
16035
16242
|
if (!selectEvent.defaultPrevented) close();
|
|
16036
16243
|
}
|
|
16037
|
-
var ContextMenuItem = (0,
|
|
16244
|
+
var ContextMenuItem = (0, import_react65.forwardRef)(function ContextMenuItem2({ disabled = false, description, shortcut, startIcon, endIcon, state = "default", onSelect, className, onClick, onKeyDown, children, ...props }, ref) {
|
|
16038
16245
|
const { close } = useMenu();
|
|
16039
16246
|
const isDisabled = disabled || state === "disabled";
|
|
16040
16247
|
const slotted = startIcon != null || description != null || shortcut != null || endIcon != null;
|
|
@@ -16069,7 +16276,7 @@ var ContextMenuItem = (0, import_react64.forwardRef)(function ContextMenuItem2({
|
|
|
16069
16276
|
"span",
|
|
16070
16277
|
{
|
|
16071
16278
|
className: menuStyles.iconWrap,
|
|
16072
|
-
style: { width:
|
|
16279
|
+
style: { width: import_tokens38.iconSizes.small, minWidth: import_tokens38.iconSizes.small, height: import_tokens38.iconSizes.small },
|
|
16073
16280
|
children: startIcon
|
|
16074
16281
|
}
|
|
16075
16282
|
) : null,
|
|
@@ -16083,7 +16290,7 @@ var ContextMenuItem = (0, import_react64.forwardRef)(function ContextMenuItem2({
|
|
|
16083
16290
|
"span",
|
|
16084
16291
|
{
|
|
16085
16292
|
className: menuStyles.iconWrap,
|
|
16086
|
-
style: { width:
|
|
16293
|
+
style: { width: import_tokens38.iconSizes.small, minWidth: import_tokens38.iconSizes.small, height: import_tokens38.iconSizes.small },
|
|
16087
16294
|
children: endIcon
|
|
16088
16295
|
}
|
|
16089
16296
|
) : null
|
|
@@ -16092,7 +16299,7 @@ var ContextMenuItem = (0, import_react64.forwardRef)(function ContextMenuItem2({
|
|
|
16092
16299
|
}
|
|
16093
16300
|
);
|
|
16094
16301
|
});
|
|
16095
|
-
var ContextMenuSeparator = (0,
|
|
16302
|
+
var ContextMenuSeparator = (0, import_react65.forwardRef)(
|
|
16096
16303
|
function ContextMenuSeparator2({ className, ...props }, ref) {
|
|
16097
16304
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16098
16305
|
"div",
|
|
@@ -16113,15 +16320,15 @@ function ContextMenuLabel({ className, children, ...props }) {
|
|
|
16113
16320
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { "data-refineui": "menu-label", className: (0, import_clsx109.clsx)(menuStyles.section, className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: menuStyles.sectionText, children }) });
|
|
16114
16321
|
}
|
|
16115
16322
|
function ContextMenuSub({ children }) {
|
|
16116
|
-
const [open, setOpen] = (0,
|
|
16117
|
-
const triggerRef = (0,
|
|
16118
|
-
const timer = (0,
|
|
16323
|
+
const [open, setOpen] = (0, import_react65.useState)(false);
|
|
16324
|
+
const triggerRef = (0, import_react65.useRef)(null);
|
|
16325
|
+
const timer = (0, import_react65.useRef)(null);
|
|
16119
16326
|
const clear = () => {
|
|
16120
16327
|
if (timer.current != null) window.clearTimeout(timer.current);
|
|
16121
16328
|
timer.current = null;
|
|
16122
16329
|
};
|
|
16123
|
-
(0,
|
|
16124
|
-
const value = (0,
|
|
16330
|
+
(0, import_react65.useEffect)(() => clear, []);
|
|
16331
|
+
const value = (0, import_react65.useMemo)(
|
|
16125
16332
|
() => ({
|
|
16126
16333
|
open,
|
|
16127
16334
|
triggerRef,
|
|
@@ -16139,11 +16346,11 @@ function ContextMenuSub({ children }) {
|
|
|
16139
16346
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(SubContext.Provider, { value, children });
|
|
16140
16347
|
}
|
|
16141
16348
|
function useSub2() {
|
|
16142
|
-
const value = (0,
|
|
16349
|
+
const value = (0, import_react65.useContext)(SubContext);
|
|
16143
16350
|
if (!value) throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");
|
|
16144
16351
|
return value;
|
|
16145
16352
|
}
|
|
16146
|
-
var ContextMenuSubTrigger = (0,
|
|
16353
|
+
var ContextMenuSubTrigger = (0, import_react65.forwardRef)(
|
|
16147
16354
|
function ContextMenuSubTrigger2({ asChild = false, description, startIcon, onMouseEnter, onMouseLeave, onClick, className, children, ...props }, ref) {
|
|
16148
16355
|
const sub = useSub2();
|
|
16149
16356
|
const shared = {
|
|
@@ -16179,13 +16386,13 @@ var ContextMenuSubTrigger = (0, import_react64.forwardRef)(
|
|
|
16179
16386
|
if (!event.defaultPrevented) sub.show();
|
|
16180
16387
|
}
|
|
16181
16388
|
};
|
|
16182
|
-
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16389
|
+
if (asChild) return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react66.Slot, { ...shared, children });
|
|
16183
16390
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("button", { ...shared, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("span", { className: menuStyles.row, children: [
|
|
16184
16391
|
startIcon ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16185
16392
|
"span",
|
|
16186
16393
|
{
|
|
16187
16394
|
className: menuStyles.iconWrap,
|
|
16188
|
-
style: { width:
|
|
16395
|
+
style: { width: import_tokens38.iconSizes.small, minWidth: import_tokens38.iconSizes.small, height: import_tokens38.iconSizes.small },
|
|
16189
16396
|
children: startIcon
|
|
16190
16397
|
}
|
|
16191
16398
|
) : null,
|
|
@@ -16197,19 +16404,19 @@ var ContextMenuSubTrigger = (0, import_react64.forwardRef)(
|
|
|
16197
16404
|
"span",
|
|
16198
16405
|
{
|
|
16199
16406
|
className: menuStyles.iconWrap,
|
|
16200
|
-
style: { width:
|
|
16201
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WebIcon, { name: "chevron-right", size:
|
|
16407
|
+
style: { width: import_tokens38.iconSizes.small, minWidth: import_tokens38.iconSizes.small, height: import_tokens38.iconSizes.small },
|
|
16408
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WebIcon, { name: "chevron-right", size: import_tokens38.iconSizes.small, color: "currentColor", "aria-hidden": true })
|
|
16202
16409
|
}
|
|
16203
16410
|
) })
|
|
16204
16411
|
] }) });
|
|
16205
16412
|
}
|
|
16206
16413
|
);
|
|
16207
|
-
var ContextMenuSubContent = (0,
|
|
16414
|
+
var ContextMenuSubContent = (0, import_react65.forwardRef)(
|
|
16208
16415
|
function ContextMenuSubContent2({ className, style, onPointerDown, onMouseEnter, onMouseLeave, ...props }, ref) {
|
|
16209
16416
|
const sub = useSub2();
|
|
16210
|
-
const localRef = (0,
|
|
16211
|
-
const [side, setSide] = (0,
|
|
16212
|
-
(0,
|
|
16417
|
+
const localRef = (0, import_react65.useRef)(null);
|
|
16418
|
+
const [side, setSide] = (0, import_react65.useState)("right");
|
|
16419
|
+
(0, import_react65.useLayoutEffect)(() => {
|
|
16213
16420
|
const trigger = sub.triggerRef.current;
|
|
16214
16421
|
const element = localRef.current;
|
|
16215
16422
|
if (!sub.open || !trigger || !element) return;
|