@refineui/react 0.1.2 → 0.2.0
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 +1 -1
- 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.js
CHANGED
|
@@ -787,7 +787,12 @@ var componentTypographyTokens = {
|
|
|
787
787
|
/** Command palette — same scale as Menu (list / section / shortcut). */
|
|
788
788
|
command: {
|
|
789
789
|
group: role("captionLg"),
|
|
790
|
-
|
|
790
|
+
/** Row text follows the Command size, like Tree rows. */
|
|
791
|
+
item: {
|
|
792
|
+
sm: role("bodySm"),
|
|
793
|
+
md: role("bodyMd"),
|
|
794
|
+
lg: role("bodyLg")
|
|
795
|
+
},
|
|
791
796
|
empty: role("bodyXs"),
|
|
792
797
|
shortcut: role("bodyXs"),
|
|
793
798
|
input: role("bodyMd")
|
|
@@ -1319,10 +1324,20 @@ var radius = {
|
|
|
1319
1324
|
md: "rounded-refineui-x-large",
|
|
1320
1325
|
lg: "rounded-refineui-xx-large"
|
|
1321
1326
|
};
|
|
1327
|
+
var paddingInline = {
|
|
1328
|
+
sm: "px-refineui-size-medium",
|
|
1329
|
+
md: "px-refineui-size-large",
|
|
1330
|
+
lg: "px-refineui-size-x-large"
|
|
1331
|
+
};
|
|
1332
|
+
var paddingBlock = {
|
|
1333
|
+
sm: "py-refineui-size-x-small",
|
|
1334
|
+
md: "py-refineui-size-medium",
|
|
1335
|
+
lg: "py-refineui-size-large"
|
|
1336
|
+
};
|
|
1322
1337
|
var padding = {
|
|
1323
|
-
sm: "
|
|
1324
|
-
md: "
|
|
1325
|
-
lg: "
|
|
1338
|
+
sm: [paddingInline.sm, paddingBlock.sm].join(" "),
|
|
1339
|
+
md: [paddingInline.md, paddingBlock.md].join(" "),
|
|
1340
|
+
lg: [paddingInline.lg, paddingBlock.lg].join(" ")
|
|
1326
1341
|
};
|
|
1327
1342
|
var typography = {
|
|
1328
1343
|
sm: sizedComponentTextClass(componentTypographyTokens.formControl, "sm"),
|
|
@@ -1340,6 +1355,11 @@ var formControlShellSizeClass = {
|
|
|
1340
1355
|
md: [fixedHeight.md, radius.md, padding.md, typography.md].join(" "),
|
|
1341
1356
|
lg: [fixedHeight.lg, radius.lg, padding.lg, typography.lg].join(" ")
|
|
1342
1357
|
};
|
|
1358
|
+
var formControlRowShellSizeClass = {
|
|
1359
|
+
sm: [fixedHeight.sm, radius.sm, paddingInline.sm].join(" "),
|
|
1360
|
+
md: [fixedHeight.md, radius.md, paddingInline.md].join(" "),
|
|
1361
|
+
lg: [fixedHeight.lg, radius.lg, paddingInline.lg].join(" ")
|
|
1362
|
+
};
|
|
1343
1363
|
var formControlShellHeightClass = {
|
|
1344
1364
|
sm: [fixedHeight.sm, radius.sm].join(" "),
|
|
1345
1365
|
md: [fixedHeight.md, radius.md].join(" "),
|
|
@@ -1429,7 +1449,7 @@ var inputOtpStyles = {
|
|
|
1429
1449
|
"inline-flex shrink-0 cursor-text items-center justify-center",
|
|
1430
1450
|
"border-refineui-thin border-transparent",
|
|
1431
1451
|
// Soft grey tile (not white) so cells read on light preview / page.
|
|
1432
|
-
"bg-refineui-alias-background-surface-
|
|
1452
|
+
"bg-refineui-alias-background-surface-hover",
|
|
1433
1453
|
"text-center tabular-nums",
|
|
1434
1454
|
"text-refineui-alias-foreground-primary",
|
|
1435
1455
|
"transition-[background-color,border-color]",
|
|
@@ -1719,22 +1739,27 @@ import {
|
|
|
1719
1739
|
|
|
1720
1740
|
// src/components/SearchField/style.ts
|
|
1721
1741
|
import { iconSizes as iconSizes2 } from "@refineui/tokens";
|
|
1722
|
-
var searchFieldLeadingIconSize =
|
|
1723
|
-
|
|
1742
|
+
var searchFieldLeadingIconSize = {
|
|
1743
|
+
sm: iconSizes2.small,
|
|
1744
|
+
md: iconSizes2.medium,
|
|
1745
|
+
lg: iconSizes2.large
|
|
1746
|
+
};
|
|
1747
|
+
var searchFieldClearIconSize = {
|
|
1748
|
+
sm: iconSizes2.xsmall,
|
|
1749
|
+
md: iconSizes2.small,
|
|
1750
|
+
lg: iconSizes2.small
|
|
1751
|
+
};
|
|
1724
1752
|
var searchFieldStyles = {
|
|
1725
1753
|
root: [
|
|
1726
1754
|
"box-border flex w-full min-w-0 items-center gap-refineui-size-x-small overflow-hidden outline-none",
|
|
1727
|
-
formControlTypoClass.md,
|
|
1728
1755
|
"transition-[background-color,border-color]",
|
|
1729
1756
|
"duration-[var(--refineui-motion-duration-fast)]",
|
|
1730
1757
|
"ease-[var(--refineui-motion-easing-emphasized)]"
|
|
1731
1758
|
].join(" "),
|
|
1732
1759
|
rootFilled: [
|
|
1733
|
-
"h-refineui-control-height-md min-h-refineui-control-height-md",
|
|
1734
|
-
"rounded-refineui-x-large px-refineui-size-large",
|
|
1735
1760
|
"border-refineui-thin border-transparent",
|
|
1736
1761
|
/** Same soft plate as InputOTP slots */
|
|
1737
|
-
"bg-refineui-alias-background-surface-
|
|
1762
|
+
"bg-refineui-alias-background-surface-hover"
|
|
1738
1763
|
].join(" "),
|
|
1739
1764
|
rootPlain: [
|
|
1740
1765
|
"h-auto min-h-0 rounded-none border-none bg-transparent px-0 py-0"
|
|
@@ -1747,6 +1772,8 @@ var searchFieldStyles = {
|
|
|
1747
1772
|
clear: "inline-flex shrink-0 cursor-pointer items-center justify-center border-none bg-transparent p-0 leading-none text-refineui-alias-foreground-tertiary",
|
|
1748
1773
|
clearDisabled: "cursor-not-allowed text-refineui-alias-foreground-disabled"
|
|
1749
1774
|
};
|
|
1775
|
+
var searchFieldFilledSizeClass = formControlRowShellSizeClass;
|
|
1776
|
+
var searchFieldTypoClass = formControlTypoClass;
|
|
1750
1777
|
|
|
1751
1778
|
// src/components/SearchField/SearchField.tsx
|
|
1752
1779
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
@@ -1777,6 +1804,7 @@ function SearchField({
|
|
|
1777
1804
|
onValueChange,
|
|
1778
1805
|
disabled = false,
|
|
1779
1806
|
appearance = "filled",
|
|
1807
|
+
size: sizeProp,
|
|
1780
1808
|
className,
|
|
1781
1809
|
children,
|
|
1782
1810
|
id,
|
|
@@ -1784,6 +1812,8 @@ function SearchField({
|
|
|
1784
1812
|
"aria-label": ariaLabel = "Search",
|
|
1785
1813
|
...props
|
|
1786
1814
|
}) {
|
|
1815
|
+
const fieldSize = useOptionalFieldSize();
|
|
1816
|
+
const size = sizeProp ?? fieldSize ?? "md";
|
|
1787
1817
|
const [query, setQuery] = useControllableString(value, defaultValue, onValueChange);
|
|
1788
1818
|
const inputRef = useRef2(null);
|
|
1789
1819
|
const reactId = useId2();
|
|
@@ -1798,11 +1828,12 @@ function SearchField({
|
|
|
1798
1828
|
setValue: setQuery,
|
|
1799
1829
|
clear,
|
|
1800
1830
|
disabled,
|
|
1831
|
+
size,
|
|
1801
1832
|
inputId,
|
|
1802
1833
|
inputLabel: ariaLabel,
|
|
1803
1834
|
inputRef
|
|
1804
1835
|
}),
|
|
1805
|
-
[ariaLabel, clear, disabled, inputId, query, setQuery]
|
|
1836
|
+
[ariaLabel, clear, disabled, size, inputId, query, setQuery]
|
|
1806
1837
|
);
|
|
1807
1838
|
const handlePointerDown = (event) => {
|
|
1808
1839
|
onPointerDown?.(event);
|
|
@@ -1818,10 +1849,12 @@ function SearchField({
|
|
|
1818
1849
|
{
|
|
1819
1850
|
"data-refineui": "search-field",
|
|
1820
1851
|
"data-appearance": appearance,
|
|
1852
|
+
"data-size": size,
|
|
1821
1853
|
"data-disabled": disabled || void 0,
|
|
1822
1854
|
className: clsx6(
|
|
1823
1855
|
searchFieldStyles.root,
|
|
1824
|
-
|
|
1856
|
+
searchFieldTypoClass[size],
|
|
1857
|
+
appearance === "plain" ? searchFieldStyles.rootPlain : [searchFieldStyles.rootFilled, searchFieldFilledSizeClass[size]],
|
|
1825
1858
|
disabled && (appearance === "plain" ? searchFieldStyles.rootPlainDisabled : searchFieldStyles.rootDisabled),
|
|
1826
1859
|
className
|
|
1827
1860
|
),
|
|
@@ -1832,7 +1865,7 @@ function SearchField({
|
|
|
1832
1865
|
) });
|
|
1833
1866
|
}
|
|
1834
1867
|
function SearchFieldIcon({ children, className, ...props }) {
|
|
1835
|
-
const { disabled } = useSearchFieldContext("SearchFieldIcon");
|
|
1868
|
+
const { disabled, size } = useSearchFieldContext("SearchFieldIcon");
|
|
1836
1869
|
return /* @__PURE__ */ jsx5(
|
|
1837
1870
|
"span",
|
|
1838
1871
|
{
|
|
@@ -1848,7 +1881,7 @@ function SearchFieldIcon({ children, className, ...props }) {
|
|
|
1848
1881
|
WebIcon,
|
|
1849
1882
|
{
|
|
1850
1883
|
name: "search",
|
|
1851
|
-
size: searchFieldLeadingIconSize,
|
|
1884
|
+
size: searchFieldLeadingIconSize[size],
|
|
1852
1885
|
color: "currentColor",
|
|
1853
1886
|
"aria-hidden": true
|
|
1854
1887
|
}
|
|
@@ -1911,7 +1944,7 @@ function SearchFieldClear({
|
|
|
1911
1944
|
"aria-label": ariaLabel = "Clear search",
|
|
1912
1945
|
...props
|
|
1913
1946
|
}) {
|
|
1914
|
-
const { value, clear, disabled } = useSearchFieldContext("SearchFieldClear");
|
|
1947
|
+
const { value, clear, disabled, size } = useSearchFieldContext("SearchFieldClear");
|
|
1915
1948
|
const isDisabled = disabledProp ?? disabled;
|
|
1916
1949
|
if (value.length === 0) return null;
|
|
1917
1950
|
return /* @__PURE__ */ jsx5(
|
|
@@ -1936,7 +1969,7 @@ function SearchFieldClear({
|
|
|
1936
1969
|
WebIcon,
|
|
1937
1970
|
{
|
|
1938
1971
|
name: "dismiss",
|
|
1939
|
-
size: searchFieldClearIconSize,
|
|
1972
|
+
size: searchFieldClearIconSize[size],
|
|
1940
1973
|
color: "currentColor",
|
|
1941
1974
|
iconStyle: "filled",
|
|
1942
1975
|
"aria-hidden": true
|
|
@@ -2504,6 +2537,7 @@ import { useComposedRefs } from "@refineui/utilities/react";
|
|
|
2504
2537
|
import { clsx as clsx24 } from "clsx";
|
|
2505
2538
|
import { spacings } from "@refineui/tokens";
|
|
2506
2539
|
var SCROLL_AREA_THUMB_MIN_PX = Number.parseFloat(spacings.sizeXLarge);
|
|
2540
|
+
var SCROLL_EDGE_FALLOFF_RATIO = 0.25;
|
|
2507
2541
|
var scrollAreaStyles = {
|
|
2508
2542
|
root: "box-border min-h-0 min-w-0 overflow-hidden outline-none",
|
|
2509
2543
|
/**
|
|
@@ -2579,6 +2613,15 @@ function readMetrics(viewport) {
|
|
|
2579
2613
|
function isScrollable(metrics) {
|
|
2580
2614
|
return metrics.scrollSize > metrics.clientSize + 1;
|
|
2581
2615
|
}
|
|
2616
|
+
function resolveEdgeFactors(metrics) {
|
|
2617
|
+
const zone = metrics.clientSize * SCROLL_EDGE_FALLOFF_RATIO;
|
|
2618
|
+
if (!isScrollable(metrics) || zone <= 0) return { top: 0, bottom: 0 };
|
|
2619
|
+
const hiddenBelow = metrics.scrollSize - metrics.clientSize - metrics.scrollOffset;
|
|
2620
|
+
return {
|
|
2621
|
+
top: Math.min(1, Math.max(0, metrics.scrollOffset / zone)),
|
|
2622
|
+
bottom: Math.min(1, Math.max(0, hiddenBelow / zone))
|
|
2623
|
+
};
|
|
2624
|
+
}
|
|
2582
2625
|
function resolveThumbGeometry(metrics, trackSize, minThumb) {
|
|
2583
2626
|
if (trackSize <= 0 || metrics.scrollSize <= 0) {
|
|
2584
2627
|
return { thumbSize: 0, offset: 0 };
|
|
@@ -2599,6 +2642,8 @@ var ScrollArea = forwardRef4(function ScrollArea2({
|
|
|
2599
2642
|
children,
|
|
2600
2643
|
...props
|
|
2601
2644
|
}, ref) {
|
|
2645
|
+
const rootRef = useRef4(null);
|
|
2646
|
+
const composedRootRef = useComposedRefs(rootRef, ref);
|
|
2602
2647
|
const viewportRef = useRef4(null);
|
|
2603
2648
|
const [viewportEpoch, setViewportEpoch] = useState4(0);
|
|
2604
2649
|
const [vertical, setVertical] = useState4(EMPTY_METRICS);
|
|
@@ -2626,6 +2671,12 @@ var ScrollArea = forwardRef4(function ScrollArea2({
|
|
|
2626
2671
|
const next = readMetrics(viewport);
|
|
2627
2672
|
setVertical(next.vertical);
|
|
2628
2673
|
setHorizontal(next.horizontal);
|
|
2674
|
+
const root = rootRef.current;
|
|
2675
|
+
if (root) {
|
|
2676
|
+
const edges = resolveEdgeFactors(next.vertical);
|
|
2677
|
+
root.style.setProperty("--refineui-scroll-edge-top", String(edges.top));
|
|
2678
|
+
root.style.setProperty("--refineui-scroll-edge-bottom", String(edges.bottom));
|
|
2679
|
+
}
|
|
2629
2680
|
}, []);
|
|
2630
2681
|
const markScrolling = useCallback3(() => {
|
|
2631
2682
|
setScrolling(true);
|
|
@@ -2692,7 +2743,7 @@ var ScrollArea = forwardRef4(function ScrollArea2({
|
|
|
2692
2743
|
return /* @__PURE__ */ jsx20(ScrollAreaContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx20(
|
|
2693
2744
|
"div",
|
|
2694
2745
|
{
|
|
2695
|
-
ref,
|
|
2746
|
+
ref: composedRootRef,
|
|
2696
2747
|
"data-refineui": "scroll-area",
|
|
2697
2748
|
"data-type": type,
|
|
2698
2749
|
"data-scrolling": scrolling || void 0,
|
|
@@ -3658,7 +3709,7 @@ function SelectGroup({ children, className, ...props }) {
|
|
|
3658
3709
|
return /* @__PURE__ */ jsx22("div", { role: "group", className: clsx28(selectStyles.group, className), ...props, children });
|
|
3659
3710
|
}
|
|
3660
3711
|
function SelectLabel({ children, className, ...props }) {
|
|
3661
|
-
return /* @__PURE__ */ jsx22("div", { className: clsx28(selectStyles.label, className), ...props, children });
|
|
3712
|
+
return /* @__PURE__ */ jsx22("div", { "data-scroll-edge-item": true, className: clsx28(selectStyles.label, className), ...props, children });
|
|
3662
3713
|
}
|
|
3663
3714
|
function SelectSeparator({ className, ...props }) {
|
|
3664
3715
|
return /* @__PURE__ */ jsx22("div", { role: "separator", className: clsx28(selectStyles.separator, className), ...props });
|
|
@@ -3705,6 +3756,7 @@ function SelectItem({
|
|
|
3705
3756
|
"aria-selected": isSelected,
|
|
3706
3757
|
"aria-disabled": disabled,
|
|
3707
3758
|
"data-refineui": "select-item",
|
|
3759
|
+
"data-scroll-edge-item": true,
|
|
3708
3760
|
"data-selected": isSelected ? true : void 0,
|
|
3709
3761
|
"data-state": pressed ? "pressed" : isSelected ? "selected" : void 0,
|
|
3710
3762
|
"data-highlighted": isHighlighted ? "" : void 0,
|
|
@@ -3968,7 +4020,6 @@ import {
|
|
|
3968
4020
|
useRef as useRef8,
|
|
3969
4021
|
useState as useState7
|
|
3970
4022
|
} from "react";
|
|
3971
|
-
import { iconSizes as iconSizes7 } from "@refineui/tokens";
|
|
3972
4023
|
|
|
3973
4024
|
// src/components/Dialog/Dialog.tsx
|
|
3974
4025
|
import { clsx as clsx32 } from "clsx";
|
|
@@ -4302,37 +4353,45 @@ function DialogClose({ className, onClick, type = "button", ...props }) {
|
|
|
4302
4353
|
|
|
4303
4354
|
// src/components/Command/style.ts
|
|
4304
4355
|
import { clsx as clsx33 } from "clsx";
|
|
4305
|
-
import { foundationSizes as foundationSizes2 } from "@refineui/tokens";
|
|
4356
|
+
import { foundationSizes as foundationSizes2, iconSizes as iconSizes7 } from "@refineui/tokens";
|
|
4306
4357
|
var COMMAND_LIST_MAX_HEIGHT = `min(60vh, ${foundationSizes2.foundationSize3200})`;
|
|
4307
4358
|
var commandStyles = {
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
"shadow-refineui-2"
|
|
4313
|
-
),
|
|
4314
|
-
/** Nested inside Dialog panel — Dialog already supplies radius / elevation */
|
|
4315
|
-
rootInDialog: "min-h-0 w-full flex-col overflow-hidden rounded-none border-none shadow-none",
|
|
4359
|
+
/** Detached layout: the search field and the results panel are separate surfaces, so the root has none. */
|
|
4360
|
+
root: "flex w-full flex-col gap-refineui-size-small text-refineui-alias-foreground-primary outline-none",
|
|
4361
|
+
rootInDialog: "min-h-0 w-full",
|
|
4362
|
+
/** Dialog panel stays transparent — the field and results panel float on the scrim themselves. */
|
|
4316
4363
|
dialogContentPanel: {
|
|
4317
4364
|
padding: 0,
|
|
4318
|
-
overflow: "
|
|
4365
|
+
overflow: "visible",
|
|
4366
|
+
backgroundColor: "transparent",
|
|
4367
|
+
boxShadow: "none",
|
|
4368
|
+
borderRadius: 0
|
|
4319
4369
|
},
|
|
4320
|
-
dialogBody: "flex min-h-0 w-full flex-col
|
|
4321
|
-
inputWrap: "shrink-0
|
|
4322
|
-
/**
|
|
4323
|
-
|
|
4370
|
+
dialogBody: "flex min-h-0 w-full flex-col",
|
|
4371
|
+
inputWrap: "shrink-0",
|
|
4372
|
+
/**
|
|
4373
|
+
* Results surface. Height is measured from the results (animated in refineui.css), capped by `maxHeight`.
|
|
4374
|
+
* Radius comes from `--refineui-command-list-radius` (per size, refineui.css) so the scrollbar inset can share it.
|
|
4375
|
+
*/
|
|
4376
|
+
listShell: clsx33(
|
|
4377
|
+
"box-border w-full overflow-hidden",
|
|
4378
|
+
"border-refineui-hairline border-refineui-alias-border-default",
|
|
4379
|
+
"bg-refineui-alias-background-primary shadow-refineui-2"
|
|
4380
|
+
),
|
|
4324
4381
|
list: "h-full min-h-0 w-full",
|
|
4325
|
-
|
|
4326
|
-
height: COMMAND_LIST_MAX_HEIGHT,
|
|
4382
|
+
listShellMaxHeight: {
|
|
4327
4383
|
maxHeight: COMMAND_LIST_MAX_HEIGHT
|
|
4328
4384
|
},
|
|
4329
4385
|
listViewport: "outline-none",
|
|
4330
|
-
listInner: "flex flex-col gap-refineui-size-xxx-small px-refineui-size-medium py-refineui-size-small",
|
|
4386
|
+
listInner: "relative flex flex-col gap-refineui-size-xxx-small px-refineui-size-medium py-refineui-size-small",
|
|
4387
|
+
/** Sliding highlight behind the selected item; geometry is measured, so physical `left`/`top` (inline) are intentional. */
|
|
4388
|
+
indicator: "pointer-events-none absolute rounded-refineui-large bg-refineui-alias-background-surface-hover",
|
|
4331
4389
|
empty: clsx33(
|
|
4332
4390
|
componentTextClass(componentTypographyTokens.command.empty),
|
|
4333
4391
|
"px-refineui-size-medium py-refineui-size-xx-large text-center text-refineui-alias-foreground-tertiary"
|
|
4334
4392
|
),
|
|
4335
|
-
|
|
4393
|
+
/** `overflow-clip`, not hidden: a hidden group would become the scroll container the edge effect tracks. */
|
|
4394
|
+
group: "flex flex-col gap-refineui-size-xxx-small overflow-clip",
|
|
4336
4395
|
groupHeading: clsx33(
|
|
4337
4396
|
componentTextClass(componentTypographyTokens.command.group),
|
|
4338
4397
|
"flex w-full items-center overflow-hidden px-refineui-size-x-small py-refineui-size-xxx-small text-refineui-alias-foreground-tertiary"
|
|
@@ -4340,9 +4399,8 @@ var commandStyles = {
|
|
|
4340
4399
|
separatorWrap: "flex w-full items-center px-refineui-size-x-small py-refineui-size-x-small",
|
|
4341
4400
|
separatorLine: "h-px w-full shrink-0 bg-refineui-alias-border-default",
|
|
4342
4401
|
itemBase: clsx33(
|
|
4343
|
-
|
|
4344
|
-
"
|
|
4345
|
-
"px-refineui-size-x-small py-refineui-size-small text-start outline-none"
|
|
4402
|
+
"relative flex w-full items-center gap-refineui-size-x-small rounded-refineui-large border-none bg-transparent",
|
|
4403
|
+
"px-refineui-size-x-small text-start outline-none"
|
|
4346
4404
|
),
|
|
4347
4405
|
itemDisabled: "cursor-not-allowed text-refineui-alias-foreground-disabled",
|
|
4348
4406
|
itemEnabled: "cursor-pointer text-refineui-alias-foreground-primary",
|
|
@@ -4354,6 +4412,16 @@ var commandStyles = {
|
|
|
4354
4412
|
"shrink-0 tracking-wide text-refineui-alias-foreground-tertiary"
|
|
4355
4413
|
)
|
|
4356
4414
|
};
|
|
4415
|
+
var commandItemSizeClass = {
|
|
4416
|
+
sm: clsx33(sizedComponentTextClass(componentTypographyTokens.command.item, "sm"), "py-refineui-size-xx-small"),
|
|
4417
|
+
md: clsx33(sizedComponentTextClass(componentTypographyTokens.command.item, "md"), "py-refineui-size-small"),
|
|
4418
|
+
lg: clsx33(sizedComponentTextClass(componentTypographyTokens.command.item, "lg"), "py-refineui-size-medium")
|
|
4419
|
+
};
|
|
4420
|
+
var commandItemIconSize = {
|
|
4421
|
+
sm: iconSizes7.xsmall,
|
|
4422
|
+
md: iconSizes7.small,
|
|
4423
|
+
lg: iconSizes7.medium
|
|
4424
|
+
};
|
|
4357
4425
|
|
|
4358
4426
|
// src/components/Command/Command.tsx
|
|
4359
4427
|
import { jsx as jsx26, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
@@ -4389,6 +4457,7 @@ function useControllableString2(controlled, defaultValue, onChange) {
|
|
|
4389
4457
|
function Command({
|
|
4390
4458
|
children,
|
|
4391
4459
|
className,
|
|
4460
|
+
size = "md",
|
|
4392
4461
|
value,
|
|
4393
4462
|
defaultValue,
|
|
4394
4463
|
onValueChange,
|
|
@@ -4507,6 +4576,7 @@ function Command({
|
|
|
4507
4576
|
);
|
|
4508
4577
|
const ctx = useMemo6(
|
|
4509
4578
|
() => ({
|
|
4579
|
+
size,
|
|
4510
4580
|
search,
|
|
4511
4581
|
setSearch,
|
|
4512
4582
|
shouldFilter,
|
|
@@ -4524,6 +4594,7 @@ function Command({
|
|
|
4524
4594
|
groupHasVisibleItems
|
|
4525
4595
|
}),
|
|
4526
4596
|
[
|
|
4597
|
+
size,
|
|
4527
4598
|
search,
|
|
4528
4599
|
setSearch,
|
|
4529
4600
|
shouldFilter,
|
|
@@ -4545,6 +4616,7 @@ function Command({
|
|
|
4545
4616
|
"div",
|
|
4546
4617
|
{
|
|
4547
4618
|
"data-refineui": "command",
|
|
4619
|
+
"data-size": size,
|
|
4548
4620
|
role: "presentation",
|
|
4549
4621
|
className: clsx34(commandStyles.root, className),
|
|
4550
4622
|
onKeyDown: (event) => {
|
|
@@ -4596,17 +4668,19 @@ function CommandDialog({
|
|
|
4596
4668
|
Command,
|
|
4597
4669
|
{
|
|
4598
4670
|
...commandProps,
|
|
4671
|
+
size: commandProps?.size ?? "lg",
|
|
4599
4672
|
className: clsx34(commandStyles.rootInDialog, commandProps?.className),
|
|
4600
4673
|
children
|
|
4601
4674
|
}
|
|
4602
4675
|
) }) }) });
|
|
4603
4676
|
}
|
|
4604
4677
|
var CommandInput = forwardRef8(function CommandInput2({ className, startIcon, placeholder = "Type a command or search\u2026", disabled, onKeyDown, ...props }, ref) {
|
|
4605
|
-
const { search, setSearch, listId, label, selectedValue } = useCommandContext("CommandInput");
|
|
4678
|
+
const { size, search, setSearch, listId, label, selectedValue } = useCommandContext("CommandInput");
|
|
4606
4679
|
const activeDescendantId = selectedValue ? `${listId}-item-${cssEscape(selectedValue)}` : void 0;
|
|
4607
4680
|
return /* @__PURE__ */ jsx26("div", { "data-refineui": "command-input", className: commandStyles.inputWrap, children: /* @__PURE__ */ jsxs7(
|
|
4608
4681
|
SearchField,
|
|
4609
4682
|
{
|
|
4683
|
+
size,
|
|
4610
4684
|
value: search,
|
|
4611
4685
|
onValueChange: setSearch,
|
|
4612
4686
|
disabled,
|
|
@@ -4635,14 +4709,90 @@ var CommandInput = forwardRef8(function CommandInput2({ className, startIcon, pl
|
|
|
4635
4709
|
}
|
|
4636
4710
|
) });
|
|
4637
4711
|
});
|
|
4712
|
+
var HIDDEN_INDICATOR = { top: 0, left: 0, width: 0, height: 0, ready: false };
|
|
4713
|
+
var SELECTED_ITEM_SELECTOR = '[data-refineui="command-item"][data-selected="true"]';
|
|
4714
|
+
function sameIndicatorBox(a, b) {
|
|
4715
|
+
return a.ready === b.ready && a.top === b.top && a.left === b.left && a.width === b.width && a.height === b.height;
|
|
4716
|
+
}
|
|
4638
4717
|
function CommandList({ className, children, ...props }) {
|
|
4639
|
-
const { listId } = useCommandContext("CommandList");
|
|
4718
|
+
const { listId, selectedValue, search, visibleCount } = useCommandContext("CommandList");
|
|
4719
|
+
const shellRef = useRef8(null);
|
|
4720
|
+
const innerRef = useRef8(null);
|
|
4721
|
+
const [contentHeight, setContentHeight] = useState7(null);
|
|
4722
|
+
const [indicator, setIndicator] = useState7(HIDDEN_INDICATOR);
|
|
4723
|
+
const [animate, setAnimate] = useState7(false);
|
|
4724
|
+
const [snap, setSnap] = useState7(false);
|
|
4725
|
+
const lastSearchRef = useRef8(search);
|
|
4726
|
+
const measure = useCallback6(() => {
|
|
4727
|
+
const inner = innerRef.current;
|
|
4728
|
+
const shell = shellRef.current;
|
|
4729
|
+
if (!inner || !shell) return;
|
|
4730
|
+
const shellStyle = getComputedStyle(shell);
|
|
4731
|
+
const height = inner.offsetHeight + parseFloat(shellStyle.borderTopWidth) + parseFloat(shellStyle.borderBottomWidth);
|
|
4732
|
+
setContentHeight((prev) => prev === height ? prev : height);
|
|
4733
|
+
const selected = inner.querySelector(SELECTED_ITEM_SELECTOR);
|
|
4734
|
+
setIndicator((prev) => {
|
|
4735
|
+
const next = selected ? {
|
|
4736
|
+
top: selected.offsetTop,
|
|
4737
|
+
left: selected.offsetLeft,
|
|
4738
|
+
width: selected.offsetWidth,
|
|
4739
|
+
height: selected.offsetHeight,
|
|
4740
|
+
ready: true
|
|
4741
|
+
} : { ...prev, ready: false };
|
|
4742
|
+
return sameIndicatorBox(prev, next) ? prev : next;
|
|
4743
|
+
});
|
|
4744
|
+
}, []);
|
|
4745
|
+
useIsomorphicLayoutEffect2(() => {
|
|
4746
|
+
if (lastSearchRef.current !== search) {
|
|
4747
|
+
lastSearchRef.current = search;
|
|
4748
|
+
setSnap(true);
|
|
4749
|
+
}
|
|
4750
|
+
measure();
|
|
4751
|
+
}, [measure, selectedValue, search, visibleCount, children]);
|
|
4752
|
+
useEffect5(() => {
|
|
4753
|
+
if (!snap) return;
|
|
4754
|
+
let raf2 = 0;
|
|
4755
|
+
const raf1 = requestAnimationFrame(() => {
|
|
4756
|
+
raf2 = requestAnimationFrame(() => setSnap(false));
|
|
4757
|
+
});
|
|
4758
|
+
return () => {
|
|
4759
|
+
cancelAnimationFrame(raf1);
|
|
4760
|
+
cancelAnimationFrame(raf2);
|
|
4761
|
+
};
|
|
4762
|
+
}, [snap]);
|
|
4763
|
+
useEffect5(() => {
|
|
4764
|
+
const inner = innerRef.current;
|
|
4765
|
+
if (!inner || typeof ResizeObserver === "undefined") return;
|
|
4766
|
+
const observer = new ResizeObserver(measure);
|
|
4767
|
+
observer.observe(inner);
|
|
4768
|
+
return () => observer.disconnect();
|
|
4769
|
+
}, [measure]);
|
|
4770
|
+
const measured = contentHeight !== null;
|
|
4771
|
+
useEffect5(() => {
|
|
4772
|
+
if (!measured || animate) return;
|
|
4773
|
+
let raf2 = 0;
|
|
4774
|
+
const raf1 = requestAnimationFrame(() => {
|
|
4775
|
+
raf2 = requestAnimationFrame(() => setAnimate(true));
|
|
4776
|
+
});
|
|
4777
|
+
return () => {
|
|
4778
|
+
cancelAnimationFrame(raf1);
|
|
4779
|
+
cancelAnimationFrame(raf2);
|
|
4780
|
+
};
|
|
4781
|
+
}, [measured, animate]);
|
|
4782
|
+
const indicatorStyle = {
|
|
4783
|
+
top: indicator.top,
|
|
4784
|
+
left: indicator.left,
|
|
4785
|
+
width: indicator.width,
|
|
4786
|
+
height: indicator.height
|
|
4787
|
+
};
|
|
4640
4788
|
return /* @__PURE__ */ jsx26(
|
|
4641
4789
|
"div",
|
|
4642
4790
|
{
|
|
4791
|
+
ref: shellRef,
|
|
4643
4792
|
"data-refineui": "command-list",
|
|
4793
|
+
"data-animate": animate ? "true" : void 0,
|
|
4644
4794
|
className: commandStyles.listShell,
|
|
4645
|
-
style: commandStyles.
|
|
4795
|
+
style: { ...commandStyles.listShellMaxHeight, height: contentHeight ?? void 0 },
|
|
4646
4796
|
children: /* @__PURE__ */ jsx26(
|
|
4647
4797
|
ScrollAreaRegion,
|
|
4648
4798
|
{
|
|
@@ -4650,7 +4800,21 @@ function CommandList({ className, children, ...props }) {
|
|
|
4650
4800
|
className: clsx34(commandStyles.list, className),
|
|
4651
4801
|
viewportClassName: commandStyles.listViewport,
|
|
4652
4802
|
...props,
|
|
4653
|
-
children: /* @__PURE__ */
|
|
4803
|
+
children: /* @__PURE__ */ jsxs7("div", { ref: innerRef, id: listId, role: "listbox", className: commandStyles.listInner, children: [
|
|
4804
|
+
/* @__PURE__ */ jsx26(
|
|
4805
|
+
"div",
|
|
4806
|
+
{
|
|
4807
|
+
"data-refineui": "command-indicator",
|
|
4808
|
+
"data-ready": indicator.ready ? "true" : void 0,
|
|
4809
|
+
"data-animate": animate && !snap ? "true" : void 0,
|
|
4810
|
+
"data-scroll-edge-item": true,
|
|
4811
|
+
"aria-hidden": true,
|
|
4812
|
+
className: commandStyles.indicator,
|
|
4813
|
+
style: indicatorStyle
|
|
4814
|
+
}
|
|
4815
|
+
),
|
|
4816
|
+
children
|
|
4817
|
+
] })
|
|
4654
4818
|
}
|
|
4655
4819
|
)
|
|
4656
4820
|
}
|
|
@@ -4695,6 +4859,7 @@ function CommandGroupHeading({ className, children, ...props }) {
|
|
|
4695
4859
|
"div",
|
|
4696
4860
|
{
|
|
4697
4861
|
"data-refineui": "command-group-heading",
|
|
4862
|
+
"data-scroll-edge-item": true,
|
|
4698
4863
|
className: clsx34(commandStyles.groupHeading, className),
|
|
4699
4864
|
...props,
|
|
4700
4865
|
children
|
|
@@ -4778,6 +4943,7 @@ var CommandItem = forwardRef8(function CommandItem2({
|
|
|
4778
4943
|
...props
|
|
4779
4944
|
}, forwardedRef) {
|
|
4780
4945
|
const {
|
|
4946
|
+
size,
|
|
4781
4947
|
selectedValue,
|
|
4782
4948
|
setSelectedValue,
|
|
4783
4949
|
listId,
|
|
@@ -4785,6 +4951,7 @@ var CommandItem = forwardRef8(function CommandItem2({
|
|
|
4785
4951
|
isItemVisible,
|
|
4786
4952
|
selectById
|
|
4787
4953
|
} = useCommandContext("CommandItem");
|
|
4954
|
+
const iconSize = commandItemIconSize[size];
|
|
4788
4955
|
const group = useContext7(CommandGroupContext);
|
|
4789
4956
|
const itemId = useId6();
|
|
4790
4957
|
const nodeRef = useRef8(null);
|
|
@@ -4828,11 +4995,13 @@ var CommandItem = forwardRef8(function CommandItem2({
|
|
|
4828
4995
|
"aria-selected": isSelected,
|
|
4829
4996
|
disabled,
|
|
4830
4997
|
"data-refineui": "command-item",
|
|
4998
|
+
"data-scroll-edge-item": true,
|
|
4831
4999
|
"data-state": disabled ? "disabled" : isSelected ? "active" : "default",
|
|
4832
5000
|
"data-selected": isSelected || void 0,
|
|
4833
5001
|
"data-disabled": disabled || void 0,
|
|
4834
5002
|
className: clsx34(
|
|
4835
5003
|
commandStyles.itemBase,
|
|
5004
|
+
commandItemSizeClass[size],
|
|
4836
5005
|
disabled ? commandStyles.itemDisabled : commandStyles.itemEnabled,
|
|
4837
5006
|
className
|
|
4838
5007
|
),
|
|
@@ -4852,9 +5021,9 @@ var CommandItem = forwardRef8(function CommandItem2({
|
|
|
4852
5021
|
{
|
|
4853
5022
|
className: commandStyles.iconWrap,
|
|
4854
5023
|
style: {
|
|
4855
|
-
width:
|
|
4856
|
-
minWidth:
|
|
4857
|
-
height:
|
|
5024
|
+
width: iconSize,
|
|
5025
|
+
minWidth: iconSize,
|
|
5026
|
+
height: iconSize
|
|
4858
5027
|
},
|
|
4859
5028
|
children: startIcon
|
|
4860
5029
|
}
|
|
@@ -4868,9 +5037,9 @@ var CommandItem = forwardRef8(function CommandItem2({
|
|
|
4868
5037
|
{
|
|
4869
5038
|
className: commandStyles.iconWrap,
|
|
4870
5039
|
style: {
|
|
4871
|
-
width:
|
|
4872
|
-
minWidth:
|
|
4873
|
-
height:
|
|
5040
|
+
width: iconSize,
|
|
5041
|
+
minWidth: iconSize,
|
|
5042
|
+
height: iconSize
|
|
4874
5043
|
},
|
|
4875
5044
|
children: endIcon
|
|
4876
5045
|
}
|
|
@@ -8981,6 +9150,7 @@ function DropdownLabel({ className, ...props }) {
|
|
|
8981
9150
|
{
|
|
8982
9151
|
role: "presentation",
|
|
8983
9152
|
"data-refineui": "dropdown-menu-label",
|
|
9153
|
+
"data-scroll-edge-item": true,
|
|
8984
9154
|
className: clsx70(dropdownStyles.label, className),
|
|
8985
9155
|
...props
|
|
8986
9156
|
}
|
|
@@ -9010,6 +9180,7 @@ function DropdownItem({
|
|
|
9010
9180
|
type: "button",
|
|
9011
9181
|
role: "menuitem",
|
|
9012
9182
|
"data-refineui": "dropdown-item",
|
|
9183
|
+
"data-scroll-edge-item": true,
|
|
9013
9184
|
"data-selected": selected || void 0,
|
|
9014
9185
|
"data-state": pressed ? "pressed" : selected ? "selected" : void 0,
|
|
9015
9186
|
disabled,
|
|
@@ -9187,6 +9358,7 @@ function DropdownSubTrigger({
|
|
|
9187
9358
|
"aria-expanded": open,
|
|
9188
9359
|
disabled: isDisabled,
|
|
9189
9360
|
"data-refineui": "dropdown-item",
|
|
9361
|
+
"data-scroll-edge-item": true,
|
|
9190
9362
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
9191
9363
|
tabIndex: -1,
|
|
9192
9364
|
className: clsx70(
|
|
@@ -10692,6 +10864,7 @@ function NavigationMenuIndicator({ className, style, ...props }) {
|
|
|
10692
10864
|
|
|
10693
10865
|
// src/components/Sidebar/Sidebar.tsx
|
|
10694
10866
|
import { clsx as clsx80 } from "clsx";
|
|
10867
|
+
import { createContext as createContext19, useContext as useContext21 } from "react";
|
|
10695
10868
|
|
|
10696
10869
|
// src/components/Sidebar/style.ts
|
|
10697
10870
|
import { clsx as clsx79 } from "clsx";
|
|
@@ -10710,7 +10883,9 @@ var sidebarStyles = {
|
|
|
10710
10883
|
componentTextClass(componentTypographyTokens.sidebar.brand),
|
|
10711
10884
|
"m-0 flex min-w-0 items-center gap-refineui-size-small text-refineui-alias-foreground-primary"
|
|
10712
10885
|
),
|
|
10713
|
-
|
|
10886
|
+
/** Scrolls through a built-in ScrollArea; padding sits inside the viewport so rows scroll under the edges. */
|
|
10887
|
+
content: "flex min-h-0 flex-1 flex-col",
|
|
10888
|
+
contentViewport: "box-border px-refineui-size-medium py-refineui-size-medium",
|
|
10714
10889
|
nav: "flex min-h-0 flex-col gap-refineui-size-x-large",
|
|
10715
10890
|
group: "flex min-w-0 flex-col gap-refineui-size-xx-small",
|
|
10716
10891
|
groupLabel: clsx79(
|
|
@@ -10735,6 +10910,7 @@ var sidebarStyles = {
|
|
|
10735
10910
|
|
|
10736
10911
|
// src/components/Sidebar/Sidebar.tsx
|
|
10737
10912
|
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
10913
|
+
var SidebarScrollContext = createContext19(false);
|
|
10738
10914
|
function Sidebar({ className, ...props }) {
|
|
10739
10915
|
return /* @__PURE__ */ jsx60(
|
|
10740
10916
|
"aside",
|
|
@@ -10765,13 +10941,14 @@ function SidebarBrand({ className, ...props }) {
|
|
|
10765
10941
|
}
|
|
10766
10942
|
);
|
|
10767
10943
|
}
|
|
10768
|
-
function SidebarContent({ className, ...props }) {
|
|
10944
|
+
function SidebarContent({ className, children, ...props }) {
|
|
10769
10945
|
return /* @__PURE__ */ jsx60(
|
|
10770
10946
|
"div",
|
|
10771
10947
|
{
|
|
10772
10948
|
"data-refineui": "sidebar-content",
|
|
10773
10949
|
className: clsx80(sidebarStyles.content, className),
|
|
10774
|
-
...props
|
|
10950
|
+
...props,
|
|
10951
|
+
children: /* @__PURE__ */ jsx60(ScrollAreaRegion, { type: "hover", viewportClassName: sidebarStyles.contentViewport, children: /* @__PURE__ */ jsx60(SidebarScrollContext.Provider, { value: true, children }) })
|
|
10775
10952
|
}
|
|
10776
10953
|
);
|
|
10777
10954
|
}
|
|
@@ -10797,10 +10974,12 @@ function SidebarGroup({ className, ...props }) {
|
|
|
10797
10974
|
);
|
|
10798
10975
|
}
|
|
10799
10976
|
function SidebarGroupLabel({ className, ...props }) {
|
|
10977
|
+
const inScroll = useContext21(SidebarScrollContext);
|
|
10800
10978
|
return /* @__PURE__ */ jsx60(
|
|
10801
10979
|
"p",
|
|
10802
10980
|
{
|
|
10803
10981
|
"data-refineui": "sidebar-group-label",
|
|
10982
|
+
"data-scroll-edge-item": inScroll || void 0,
|
|
10804
10983
|
className: clsx80(sidebarStyles.groupLabel, className),
|
|
10805
10984
|
...props
|
|
10806
10985
|
}
|
|
@@ -10813,10 +10992,12 @@ function SidebarLink({
|
|
|
10813
10992
|
...props
|
|
10814
10993
|
}) {
|
|
10815
10994
|
const disabled = ariaDisabled === true || ariaDisabled === "true";
|
|
10995
|
+
const inScroll = useContext21(SidebarScrollContext);
|
|
10816
10996
|
return /* @__PURE__ */ jsx60(
|
|
10817
10997
|
"a",
|
|
10818
10998
|
{
|
|
10819
10999
|
"data-refineui": "sidebar-link",
|
|
11000
|
+
"data-scroll-edge-item": inScroll || void 0,
|
|
10820
11001
|
"data-active": active || void 0,
|
|
10821
11002
|
"aria-current": active ? "page" : void 0,
|
|
10822
11003
|
"aria-disabled": disabled || void 0,
|
|
@@ -10845,9 +11026,9 @@ function SidebarFooter({ className, ...props }) {
|
|
|
10845
11026
|
// src/components/Sidebar/SidebarPeek.tsx
|
|
10846
11027
|
import { clsx as clsx82 } from "clsx";
|
|
10847
11028
|
import {
|
|
10848
|
-
createContext as
|
|
11029
|
+
createContext as createContext20,
|
|
10849
11030
|
useCallback as useCallback15,
|
|
10850
|
-
useContext as
|
|
11031
|
+
useContext as useContext22,
|
|
10851
11032
|
useEffect as useEffect14,
|
|
10852
11033
|
useMemo as useMemo15,
|
|
10853
11034
|
useRef as useRef16,
|
|
@@ -10882,9 +11063,9 @@ import { jsx as jsx61 } from "react/jsx-runtime";
|
|
|
10882
11063
|
var PEEK_OPEN_DELAY_MS = motionMsToNumber5(semanticInteraction7.duration.medium);
|
|
10883
11064
|
var PEEK_CLOSE_DELAY_MS = motionMsToNumber5(semanticInteraction7.duration.medium);
|
|
10884
11065
|
var PEEK_BRIDGE_DELAY_MS = motionMsToNumber5(semanticInteraction7.duration.slow);
|
|
10885
|
-
var SidebarPeekContext =
|
|
11066
|
+
var SidebarPeekContext = createContext20(null);
|
|
10886
11067
|
function useSidebarPeekContext(component) {
|
|
10887
|
-
const ctx =
|
|
11068
|
+
const ctx = useContext22(SidebarPeekContext);
|
|
10888
11069
|
if (!ctx) throw new Error(`${component} must be used within <SidebarPeek>.`);
|
|
10889
11070
|
return ctx;
|
|
10890
11071
|
}
|
|
@@ -11133,19 +11314,19 @@ function useSidebarPeek() {
|
|
|
11133
11314
|
|
|
11134
11315
|
// src/components/Sidebar/SidebarProvider.tsx
|
|
11135
11316
|
import {
|
|
11136
|
-
createContext as
|
|
11317
|
+
createContext as createContext21,
|
|
11137
11318
|
forwardRef as forwardRef14,
|
|
11138
11319
|
useCallback as useCallback16,
|
|
11139
|
-
useContext as
|
|
11320
|
+
useContext as useContext23,
|
|
11140
11321
|
useId as useId13,
|
|
11141
11322
|
useMemo as useMemo16,
|
|
11142
11323
|
useState as useState20
|
|
11143
11324
|
} from "react";
|
|
11144
11325
|
import { Slot as Slot3 } from "@refineui/utilities/react";
|
|
11145
11326
|
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
11146
|
-
var SidebarContext =
|
|
11327
|
+
var SidebarContext = createContext21(null);
|
|
11147
11328
|
function useSidebarContext(component) {
|
|
11148
|
-
const value =
|
|
11329
|
+
const value = useContext23(SidebarContext);
|
|
11149
11330
|
if (!value) throw new Error(`${component} must be used within <SidebarProvider>.`);
|
|
11150
11331
|
return value;
|
|
11151
11332
|
}
|
|
@@ -11321,9 +11502,9 @@ function Pagination(props) {
|
|
|
11321
11502
|
// src/components/PopOver/PopOver.tsx
|
|
11322
11503
|
import { clsx as clsx85 } from "clsx";
|
|
11323
11504
|
import {
|
|
11324
|
-
createContext as
|
|
11505
|
+
createContext as createContext22,
|
|
11325
11506
|
useCallback as useCallback17,
|
|
11326
|
-
useContext as
|
|
11507
|
+
useContext as useContext24,
|
|
11327
11508
|
useEffect as useEffect16,
|
|
11328
11509
|
useId as useId14,
|
|
11329
11510
|
useMemo as useMemo17,
|
|
@@ -11435,7 +11616,11 @@ function buildFloatingOutline({
|
|
|
11435
11616
|
import { jsx as jsx64, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
11436
11617
|
var useIsomorphicLayoutEffect6 = typeof document !== "undefined" ? useLayoutEffect9 : useEffect15;
|
|
11437
11618
|
var SHADOW_BLEED = parseFloat(spacings5.sizeXXXLarge);
|
|
11438
|
-
var STROKE = parseFloat(strokeWidths2.
|
|
11619
|
+
var STROKE = parseFloat(strokeWidths2.strokeWidthHairline);
|
|
11620
|
+
function svgPathMask(shape, width, height, bleed) {
|
|
11621
|
+
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>`;
|
|
11622
|
+
return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
|
|
11623
|
+
}
|
|
11439
11624
|
function usePanelSize(panelRef) {
|
|
11440
11625
|
const [size, setSize] = useState21(null);
|
|
11441
11626
|
useIsomorphicLayoutEffect6(() => {
|
|
@@ -11494,8 +11679,8 @@ function FloatingSurface({
|
|
|
11494
11679
|
const shape = buildFloatingOutline(geometry);
|
|
11495
11680
|
const outline = buildFloatingOutline({ ...geometry, inset: STROKE / 2 });
|
|
11496
11681
|
const box = floatingShapeSize(size.width, size.height, side, bh);
|
|
11497
|
-
const
|
|
11498
|
-
const
|
|
11682
|
+
const holeMask = `linear-gradient(black 0 0), ${svgPathMask(shape, box.width, box.height, SHADOW_BLEED)}`;
|
|
11683
|
+
const surfaceMask = svgPathMask(shape, box.width, box.height, 0);
|
|
11499
11684
|
const rootStyle = {
|
|
11500
11685
|
width: box.width,
|
|
11501
11686
|
height: box.height,
|
|
@@ -11513,10 +11698,19 @@ function FloatingSurface({
|
|
|
11513
11698
|
maskRepeat: "no-repeat",
|
|
11514
11699
|
WebkitMaskRepeat: "no-repeat"
|
|
11515
11700
|
};
|
|
11701
|
+
const surfaceStyle = {
|
|
11702
|
+
backgroundColor,
|
|
11703
|
+
maskImage: surfaceMask,
|
|
11704
|
+
WebkitMaskImage: surfaceMask,
|
|
11705
|
+
maskSize: "100% 100%",
|
|
11706
|
+
WebkitMaskSize: "100% 100%",
|
|
11707
|
+
maskRepeat: "no-repeat",
|
|
11708
|
+
WebkitMaskRepeat: "no-repeat"
|
|
11709
|
+
};
|
|
11516
11710
|
const clip = `path("${shape}")`;
|
|
11517
11711
|
return /* @__PURE__ */ jsxs24("div", { "data-refineui": "floating-chrome", "aria-hidden": true, className: "pointer-events-none absolute -z-1", style: rootStyle, children: [
|
|
11518
11712
|
/* @__PURE__ */ jsx64("div", { className: "absolute", style: shadowStyle, children: /* @__PURE__ */ jsx64("div", { "data-refineui": "floating-shadow", className: "absolute", style: { inset: SHADOW_BLEED }, children: /* @__PURE__ */ jsx64("div", { className: "absolute inset-0", style: { clipPath: clip, backgroundColor: borderColor } }) }) }),
|
|
11519
|
-
/* @__PURE__ */ jsx64("div", { "data-refineui": "floating-surface", className: "absolute inset-0", style:
|
|
11713
|
+
/* @__PURE__ */ jsx64("div", { "data-refineui": "floating-surface", className: "absolute inset-0", style: surfaceStyle }),
|
|
11520
11714
|
/* @__PURE__ */ jsx64(
|
|
11521
11715
|
"svg",
|
|
11522
11716
|
{
|
|
@@ -11539,7 +11733,7 @@ var popoverStyles = {
|
|
|
11539
11733
|
floatingRoot: "absolute z-refineui-popup",
|
|
11540
11734
|
panelWrap: "relative inline-block min-w-refineui-popover-panel-width",
|
|
11541
11735
|
/** Fill, stroke, and shadow come from `FloatingSurface`; the transparent border keeps the box size. */
|
|
11542
|
-
panel: "relative z-0 box-border min-w-refineui-popover-panel-width rounded-refineui-xx-large border-refineui-
|
|
11736
|
+
panel: "relative z-0 box-border min-w-refineui-popover-panel-width rounded-refineui-xx-large border-refineui-hairline border-transparent outline-none"
|
|
11543
11737
|
};
|
|
11544
11738
|
function popoverFloatingClasses(placement, align) {
|
|
11545
11739
|
if (placement === "bottom") {
|
|
@@ -11564,9 +11758,9 @@ function popoverFloatingClasses(placement, align) {
|
|
|
11564
11758
|
|
|
11565
11759
|
// src/components/PopOver/PopOver.tsx
|
|
11566
11760
|
import { jsx as jsx65, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
11567
|
-
var PopoverContext =
|
|
11761
|
+
var PopoverContext = createContext22(null);
|
|
11568
11762
|
function usePopoverContext(component) {
|
|
11569
|
-
const ctx =
|
|
11763
|
+
const ctx = useContext24(PopoverContext);
|
|
11570
11764
|
if (!ctx) throw new Error(`${component} must be used within <Popover>`);
|
|
11571
11765
|
return ctx;
|
|
11572
11766
|
}
|
|
@@ -11914,11 +12108,11 @@ import { iconSizes as iconSizes18 } from "@refineui/tokens";
|
|
|
11914
12108
|
import {
|
|
11915
12109
|
Children as Children6,
|
|
11916
12110
|
cloneElement as cloneElement2,
|
|
11917
|
-
createContext as
|
|
12111
|
+
createContext as createContext23,
|
|
11918
12112
|
forwardRef as forwardRef15,
|
|
11919
12113
|
isValidElement as isValidElement5,
|
|
11920
12114
|
useCallback as useCallback18,
|
|
11921
|
-
useContext as
|
|
12115
|
+
useContext as useContext25,
|
|
11922
12116
|
useEffect as useEffect17,
|
|
11923
12117
|
useLayoutEffect as useLayoutEffect10,
|
|
11924
12118
|
useMemo as useMemo18,
|
|
@@ -11948,8 +12142,8 @@ var carouselStyles = {
|
|
|
11948
12142
|
),
|
|
11949
12143
|
indicatorThumb: clsx88(
|
|
11950
12144
|
"pointer-events-none absolute top-refineui-size-xxx-small bottom-refineui-size-xxx-small start-refineui-size-xxx-small z-0",
|
|
11951
|
-
|
|
11952
|
-
"
|
|
12145
|
+
/* Motion lives in refineui.css, gated by `data-animate`. */
|
|
12146
|
+
"rounded-refineui-circle bg-refineui-alias-background-brand shadow-refineui-2"
|
|
11953
12147
|
),
|
|
11954
12148
|
indicatorHitRow: "relative z-[1] flex h-full w-full",
|
|
11955
12149
|
indicatorHit: "h-full min-w-0 flex-1 cursor-pointer border-none bg-transparent p-0 outline-none"
|
|
@@ -11958,9 +12152,9 @@ var carouselStyles = {
|
|
|
11958
12152
|
// src/components/Carousel/Carousel.tsx
|
|
11959
12153
|
import { jsx as jsx68, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
11960
12154
|
var DRAG_COMMIT_RATIO = 0.18;
|
|
11961
|
-
var CarouselContext =
|
|
12155
|
+
var CarouselContext = createContext23(null);
|
|
11962
12156
|
function useCarouselContext(component) {
|
|
11963
|
-
const v =
|
|
12157
|
+
const v = useContext25(CarouselContext);
|
|
11964
12158
|
if (!v) throw new Error(`${component} must be used within Carousel.`);
|
|
11965
12159
|
return v;
|
|
11966
12160
|
}
|
|
@@ -11993,11 +12187,18 @@ function Carousel({
|
|
|
11993
12187
|
},
|
|
11994
12188
|
[count, isControlled, onIndexChange]
|
|
11995
12189
|
);
|
|
12190
|
+
const snapTrackTo = useCallback18((next) => {
|
|
12191
|
+
setInstant(true);
|
|
12192
|
+
setTrackIndex(next);
|
|
12193
|
+
requestAnimationFrame(() => {
|
|
12194
|
+
requestAnimationFrame(() => setInstant(false));
|
|
12195
|
+
});
|
|
12196
|
+
}, []);
|
|
11996
12197
|
useLayoutEffect10(() => {
|
|
11997
12198
|
if (count <= 0) return;
|
|
11998
12199
|
const logical = clampIndex(index, count);
|
|
11999
12200
|
if (logical !== index) commitLogical(logical);
|
|
12000
|
-
|
|
12201
|
+
snapTrackTo(loopActive ? logical + 1 : logical);
|
|
12001
12202
|
}, [count, loopActive]);
|
|
12002
12203
|
useEffect17(() => {
|
|
12003
12204
|
if (count <= 0) return;
|
|
@@ -12050,20 +12251,9 @@ function Carousel({
|
|
|
12050
12251
|
}, [commitLogical, count, index, loopActive, trackIndex]);
|
|
12051
12252
|
const onTrackSettled = useCallback18(() => {
|
|
12052
12253
|
if (!loopActive) return;
|
|
12053
|
-
if (trackIndex === 0)
|
|
12054
|
-
|
|
12055
|
-
|
|
12056
|
-
requestAnimationFrame(() => {
|
|
12057
|
-
requestAnimationFrame(() => setInstant(false));
|
|
12058
|
-
});
|
|
12059
|
-
} else if (trackIndex === count + 1) {
|
|
12060
|
-
setInstant(true);
|
|
12061
|
-
setTrackIndex(1);
|
|
12062
|
-
requestAnimationFrame(() => {
|
|
12063
|
-
requestAnimationFrame(() => setInstant(false));
|
|
12064
|
-
});
|
|
12065
|
-
}
|
|
12066
|
-
}, [count, loopActive, trackIndex]);
|
|
12254
|
+
if (trackIndex === 0) snapTrackTo(count);
|
|
12255
|
+
else if (trackIndex === count + 1) snapTrackTo(1);
|
|
12256
|
+
}, [count, loopActive, snapTrackTo, trackIndex]);
|
|
12067
12257
|
const ctx = useMemo18(
|
|
12068
12258
|
() => ({
|
|
12069
12259
|
index,
|
|
@@ -12319,6 +12509,7 @@ function CarouselIndicators({ className, ...props }) {
|
|
|
12319
12509
|
const { count, index, scrollTo } = useCarouselContext("CarouselIndicators");
|
|
12320
12510
|
const trackRef = useRef18(null);
|
|
12321
12511
|
const [thumb, setThumb] = useState24({ width: 0, x: 0, ready: false });
|
|
12512
|
+
const [animate, setAnimate] = useState24(false);
|
|
12322
12513
|
const updateThumb = useCallback18(() => {
|
|
12323
12514
|
const el = trackRef.current;
|
|
12324
12515
|
if (!el || count <= 0) {
|
|
@@ -12337,6 +12528,21 @@ function CarouselIndicators({ className, ...props }) {
|
|
|
12337
12528
|
useLayoutEffect10(() => {
|
|
12338
12529
|
updateThumb();
|
|
12339
12530
|
}, [updateThumb]);
|
|
12531
|
+
useEffect17(() => {
|
|
12532
|
+
if (!thumb.ready) {
|
|
12533
|
+
setAnimate(false);
|
|
12534
|
+
return;
|
|
12535
|
+
}
|
|
12536
|
+
if (animate) return;
|
|
12537
|
+
let raf2 = 0;
|
|
12538
|
+
const raf1 = requestAnimationFrame(() => {
|
|
12539
|
+
raf2 = requestAnimationFrame(() => setAnimate(true));
|
|
12540
|
+
});
|
|
12541
|
+
return () => {
|
|
12542
|
+
cancelAnimationFrame(raf1);
|
|
12543
|
+
cancelAnimationFrame(raf2);
|
|
12544
|
+
};
|
|
12545
|
+
}, [thumb.ready, animate]);
|
|
12340
12546
|
useEffect17(() => {
|
|
12341
12547
|
const el = trackRef.current;
|
|
12342
12548
|
if (!el) return;
|
|
@@ -12364,6 +12570,7 @@ function CarouselIndicators({ className, ...props }) {
|
|
|
12364
12570
|
{
|
|
12365
12571
|
"data-refineui": "carousel-indicator-thumb",
|
|
12366
12572
|
"data-ready": thumb.ready ? "true" : void 0,
|
|
12573
|
+
"data-animate": animate ? "true" : void 0,
|
|
12367
12574
|
"aria-hidden": true,
|
|
12368
12575
|
className: carouselStyles.indicatorThumb,
|
|
12369
12576
|
style: thumbStyle
|
|
@@ -12392,9 +12599,9 @@ function CarouselIndicators({ className, ...props }) {
|
|
|
12392
12599
|
import { clsx as clsx91 } from "clsx";
|
|
12393
12600
|
import {
|
|
12394
12601
|
Children as Children7,
|
|
12395
|
-
createContext as
|
|
12602
|
+
createContext as createContext24,
|
|
12396
12603
|
isValidElement as isValidElement6,
|
|
12397
|
-
useContext as
|
|
12604
|
+
useContext as useContext26
|
|
12398
12605
|
} from "react";
|
|
12399
12606
|
|
|
12400
12607
|
// src/components/Bubble/style.ts
|
|
@@ -12461,9 +12668,9 @@ var bubbleContentVariantClass = {
|
|
|
12461
12668
|
|
|
12462
12669
|
// src/components/Bubble/Bubble.tsx
|
|
12463
12670
|
import { jsx as jsx69, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
12464
|
-
var BubbleContext =
|
|
12671
|
+
var BubbleContext = createContext24(null);
|
|
12465
12672
|
function useBubbleContext(component) {
|
|
12466
|
-
const value =
|
|
12673
|
+
const value = useContext26(BubbleContext);
|
|
12467
12674
|
if (!value) throw new Error(`${component} must be used within Bubble.`);
|
|
12468
12675
|
return value;
|
|
12469
12676
|
}
|
|
@@ -12578,9 +12785,9 @@ function BubbleReactions({
|
|
|
12578
12785
|
import { clsx as clsx93 } from "clsx";
|
|
12579
12786
|
import { iconSizes as iconSizes19 } from "@refineui/tokens";
|
|
12580
12787
|
import {
|
|
12581
|
-
createContext as
|
|
12788
|
+
createContext as createContext25,
|
|
12582
12789
|
useCallback as useCallback19,
|
|
12583
|
-
useContext as
|
|
12790
|
+
useContext as useContext27,
|
|
12584
12791
|
useMemo as useMemo19,
|
|
12585
12792
|
useRef as useRef19,
|
|
12586
12793
|
useState as useState25
|
|
@@ -12693,16 +12900,16 @@ var stepperConnectorVars = {
|
|
|
12693
12900
|
|
|
12694
12901
|
// src/components/Stepper/Stepper.tsx
|
|
12695
12902
|
import { jsx as jsx70, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
12696
|
-
var StepperContext =
|
|
12697
|
-
var StepperItemContext =
|
|
12698
|
-
var StepperListRegistryContext =
|
|
12903
|
+
var StepperContext = createContext25(null);
|
|
12904
|
+
var StepperItemContext = createContext25(null);
|
|
12905
|
+
var StepperListRegistryContext = createContext25(null);
|
|
12699
12906
|
function useStepperContext(component) {
|
|
12700
|
-
const v =
|
|
12907
|
+
const v = useContext27(StepperContext);
|
|
12701
12908
|
if (!v) throw new Error(`${component} must be used within Stepper.`);
|
|
12702
12909
|
return v;
|
|
12703
12910
|
}
|
|
12704
12911
|
function useStepperItemContext(component) {
|
|
12705
|
-
const v =
|
|
12912
|
+
const v = useContext27(StepperItemContext);
|
|
12706
12913
|
if (!v) throw new Error(`${component} must be used within StepperItem.`);
|
|
12707
12914
|
return v;
|
|
12708
12915
|
}
|
|
@@ -12793,7 +13000,7 @@ function StepperItem({
|
|
|
12793
13000
|
...props
|
|
12794
13001
|
}) {
|
|
12795
13002
|
const { value, setValue, orientation, interactive } = useStepperContext("StepperItem");
|
|
12796
|
-
const registry =
|
|
13003
|
+
const registry = useContext27(StepperListRegistryContext);
|
|
12797
13004
|
registry?.noteItem(itemValue);
|
|
12798
13005
|
const state = resolveState2(itemValue, value);
|
|
12799
13006
|
const canActivate = interactive && !disabled;
|
|
@@ -12908,7 +13115,7 @@ function StepperDescription({ className, ...props }) {
|
|
|
12908
13115
|
}
|
|
12909
13116
|
function StepperSeparator({ className, ...props }) {
|
|
12910
13117
|
const { orientation } = useStepperContext("StepperSeparator");
|
|
12911
|
-
const registry =
|
|
13118
|
+
const registry = useContext27(StepperListRegistryContext);
|
|
12912
13119
|
const state = registry?.takeSeparatorState() ?? "upcoming";
|
|
12913
13120
|
const vertical = orientation === "vertical";
|
|
12914
13121
|
return /* @__PURE__ */ jsx70(
|
|
@@ -12970,9 +13177,9 @@ StepperSeparator.displayName = "StepperSeparator";
|
|
|
12970
13177
|
// src/components/Resizable/Resizable.tsx
|
|
12971
13178
|
import { clsx as clsx95 } from "clsx";
|
|
12972
13179
|
import {
|
|
12973
|
-
createContext as
|
|
13180
|
+
createContext as createContext26,
|
|
12974
13181
|
useCallback as useCallback20,
|
|
12975
|
-
useContext as
|
|
13182
|
+
useContext as useContext28,
|
|
12976
13183
|
useId as useId15,
|
|
12977
13184
|
useLayoutEffect as useLayoutEffect11,
|
|
12978
13185
|
useMemo as useMemo20,
|
|
@@ -13019,9 +13226,9 @@ var KEYBOARD_STEP_LARGE = 10;
|
|
|
13019
13226
|
var DEFAULT_SIZE = 50;
|
|
13020
13227
|
var DEFAULT_MIN_SIZE = 10;
|
|
13021
13228
|
var DEFAULT_MAX_SIZE = 100;
|
|
13022
|
-
var ResizableContext =
|
|
13229
|
+
var ResizableContext = createContext26(null);
|
|
13023
13230
|
function useResizableContext(component) {
|
|
13024
|
-
const v =
|
|
13231
|
+
const v = useContext28(ResizableContext);
|
|
13025
13232
|
if (!v) throw new Error(`${component} must be used within ResizablePanelGroup.`);
|
|
13026
13233
|
return v;
|
|
13027
13234
|
}
|
|
@@ -14272,15 +14479,15 @@ import {
|
|
|
14272
14479
|
} from "react";
|
|
14273
14480
|
|
|
14274
14481
|
// src/components/Tree/context.ts
|
|
14275
|
-
import { createContext as
|
|
14482
|
+
import { createContext as createContext27, useEffect as useEffect20, useState as useState29 } from "react";
|
|
14276
14483
|
import { semanticInteraction as semanticInteraction8 } from "@refineui/tokens";
|
|
14277
14484
|
import { getReducedMotionQuery as getReducedMotionQuery2 } from "@refineui/utilities/animation";
|
|
14278
14485
|
var TREE_PANEL_MS = Number.parseFloat(semanticInteraction8.duration.accordionPanel) / 1e3;
|
|
14279
14486
|
var TREE_CONTENT_MS = Number.parseFloat(semanticInteraction8.duration.accordionContent) / 1e3;
|
|
14280
14487
|
var TREE_PANEL_EASE = semanticInteraction8.easing.panel;
|
|
14281
14488
|
var TREE_CONTENT_EASE = semanticInteraction8.easing.content;
|
|
14282
|
-
var TreeContext =
|
|
14283
|
-
var TreeItemContext =
|
|
14489
|
+
var TreeContext = createContext27(null);
|
|
14490
|
+
var TreeItemContext = createContext27(null);
|
|
14284
14491
|
function usePrefersReducedMotion2() {
|
|
14285
14492
|
const [reduce, setReduce] = useState29(false);
|
|
14286
14493
|
useEffect20(() => {
|
|
@@ -14504,11 +14711,11 @@ function Tree({
|
|
|
14504
14711
|
|
|
14505
14712
|
// src/components/Tree/TreeItem.tsx
|
|
14506
14713
|
import { clsx as clsx101 } from "clsx";
|
|
14507
|
-
import { useContext as
|
|
14714
|
+
import { useContext as useContext29, useId as useId16, useMemo as useMemo22, useState as useState31 } from "react";
|
|
14508
14715
|
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
14509
14716
|
function TreeItem({ value, disabled = false, className, children, ...props }) {
|
|
14510
|
-
const tree =
|
|
14511
|
-
const parent =
|
|
14717
|
+
const tree = useContext29(TreeContext);
|
|
14718
|
+
const parent = useContext29(TreeItemContext);
|
|
14512
14719
|
if (!tree) throw new Error("TreeItem must be used within Tree.");
|
|
14513
14720
|
const [hasBranch, setHasBranch] = useState31(false);
|
|
14514
14721
|
const uid = useId16().replace(/:/g, "");
|
|
@@ -14555,13 +14762,13 @@ function TreeItem({ value, disabled = false, className, children, ...props }) {
|
|
|
14555
14762
|
// src/components/Tree/TreeItemTrigger.tsx
|
|
14556
14763
|
import { clsx as clsx102 } from "clsx";
|
|
14557
14764
|
import {
|
|
14558
|
-
useContext as
|
|
14765
|
+
useContext as useContext30,
|
|
14559
14766
|
useEffect as useEffect21
|
|
14560
14767
|
} from "react";
|
|
14561
14768
|
import { jsx as jsx76, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
14562
14769
|
function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props }) {
|
|
14563
|
-
const tree =
|
|
14564
|
-
const item =
|
|
14770
|
+
const tree = useContext30(TreeContext);
|
|
14771
|
+
const item = useContext30(TreeItemContext);
|
|
14565
14772
|
if (!tree || !item) throw new Error("TreeItemTrigger must be used within TreeItem.");
|
|
14566
14773
|
const iconSize = treeIconSize[tree.size];
|
|
14567
14774
|
const depthIndent = "calc(var(--refineui-spacing-size-large) + var(--refineui-spacing-size-x-small))";
|
|
@@ -14689,11 +14896,11 @@ function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props })
|
|
|
14689
14896
|
|
|
14690
14897
|
// src/components/Tree/TreeItemContent.tsx
|
|
14691
14898
|
import { clsx as clsx103 } from "clsx";
|
|
14692
|
-
import { useContext as
|
|
14899
|
+
import { useContext as useContext31, useLayoutEffect as useLayoutEffect13 } from "react";
|
|
14693
14900
|
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
14694
14901
|
function TreeItemContent({ className, children, ...props }) {
|
|
14695
|
-
const tree =
|
|
14696
|
-
const item =
|
|
14902
|
+
const tree = useContext31(TreeContext);
|
|
14903
|
+
const item = useContext31(TreeItemContext);
|
|
14697
14904
|
if (!tree || !item) throw new Error("TreeItemContent must be used within TreeItem.");
|
|
14698
14905
|
const { setHasBranch, expanded, groupId, triggerId } = item;
|
|
14699
14906
|
useLayoutEffect13(() => {
|
|
@@ -14759,7 +14966,7 @@ var tooltipStyles = {
|
|
|
14759
14966
|
/** Fill, stroke, and shadow come from `FloatingSurface`; the transparent border keeps the box size. */
|
|
14760
14967
|
panel: clsx104(
|
|
14761
14968
|
componentTextClass(componentTypographyTokens.tooltip),
|
|
14762
|
-
"relative z-0 box-border max-w-refineui-tooltip-max-width whitespace-nowrap rounded-refineui-medium border-refineui-
|
|
14969
|
+
"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"
|
|
14763
14970
|
)
|
|
14764
14971
|
};
|
|
14765
14972
|
function tooltipPlacement(position) {
|
|
@@ -14933,9 +15140,9 @@ function Tooltip({
|
|
|
14933
15140
|
import { clsx as clsx107 } from "clsx";
|
|
14934
15141
|
import {
|
|
14935
15142
|
Children as Children8,
|
|
14936
|
-
createContext as
|
|
15143
|
+
createContext as createContext28,
|
|
14937
15144
|
isValidElement as isValidElement7,
|
|
14938
|
-
useContext as
|
|
15145
|
+
useContext as useContext32,
|
|
14939
15146
|
useId as useId18,
|
|
14940
15147
|
useLayoutEffect as useLayoutEffect14,
|
|
14941
15148
|
useMemo as useMemo23,
|
|
@@ -15168,9 +15375,9 @@ function formatAxisTick(value) {
|
|
|
15168
15375
|
|
|
15169
15376
|
// src/components/Chart/Chart.tsx
|
|
15170
15377
|
import { Fragment as Fragment4, jsx as jsx79, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
15171
|
-
var ChartContext =
|
|
15378
|
+
var ChartContext = createContext28(null);
|
|
15172
15379
|
function useChartContext(component) {
|
|
15173
|
-
const value =
|
|
15380
|
+
const value = useContext32(ChartContext);
|
|
15174
15381
|
if (!value) throw new Error(`${component} must be used within Chart.`);
|
|
15175
15382
|
return value;
|
|
15176
15383
|
}
|
|
@@ -15652,12 +15859,12 @@ import { clsx as clsx108 } from "clsx";
|
|
|
15652
15859
|
import { Slot as Slot7 } from "@refineui/utilities/react";
|
|
15653
15860
|
|
|
15654
15861
|
// src/components/Collapsible/context.ts
|
|
15655
|
-
import { createContext as
|
|
15862
|
+
import { createContext as createContext29, useContext as useContext33, useEffect as useEffect22, useState as useState34 } from "react";
|
|
15656
15863
|
import { semanticInteraction as semanticInteraction9 } from "@refineui/tokens";
|
|
15657
15864
|
import { getReducedMotionQuery as getReducedMotionQuery3 } from "@refineui/utilities/animation";
|
|
15658
|
-
var CollapsibleContext =
|
|
15865
|
+
var CollapsibleContext = createContext29(null);
|
|
15659
15866
|
function useCollapsibleContext(part) {
|
|
15660
|
-
const value =
|
|
15867
|
+
const value = useContext33(CollapsibleContext);
|
|
15661
15868
|
if (!value) throw new Error(`${part} must be used within Collapsible`);
|
|
15662
15869
|
return value;
|
|
15663
15870
|
}
|
|
@@ -15790,10 +15997,10 @@ var CollapsibleContent = forwardRef17(
|
|
|
15790
15997
|
|
|
15791
15998
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
15792
15999
|
import {
|
|
15793
|
-
createContext as
|
|
16000
|
+
createContext as createContext30,
|
|
15794
16001
|
forwardRef as forwardRef18,
|
|
15795
16002
|
useCallback as useCallback24,
|
|
15796
|
-
useContext as
|
|
16003
|
+
useContext as useContext34,
|
|
15797
16004
|
useEffect as useEffect23,
|
|
15798
16005
|
useLayoutEffect as useLayoutEffect15,
|
|
15799
16006
|
useMemo as useMemo25,
|
|
@@ -15808,10 +16015,10 @@ import { Slot as Slot8 } from "@refineui/utilities/react";
|
|
|
15808
16015
|
import { Fragment as Fragment5, jsx as jsx81, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
15809
16016
|
var MENU_ATTR = "data-refineui-context-menu";
|
|
15810
16017
|
var CLOSE_MS = motionMsToNumber7(semanticInteraction10.duration.normal);
|
|
15811
|
-
var MenuContext2 =
|
|
15812
|
-
var SubContext =
|
|
16018
|
+
var MenuContext2 = createContext30(null);
|
|
16019
|
+
var SubContext = createContext30(null);
|
|
15813
16020
|
function useMenu() {
|
|
15814
|
-
const value =
|
|
16021
|
+
const value = useContext34(MenuContext2);
|
|
15815
16022
|
if (!value) throw new Error("Context menu parts must be used within ContextMenu");
|
|
15816
16023
|
return value;
|
|
15817
16024
|
}
|
|
@@ -16060,7 +16267,7 @@ function ContextMenuSub({ children }) {
|
|
|
16060
16267
|
return /* @__PURE__ */ jsx81(SubContext.Provider, { value, children });
|
|
16061
16268
|
}
|
|
16062
16269
|
function useSub2() {
|
|
16063
|
-
const value =
|
|
16270
|
+
const value = useContext34(SubContext);
|
|
16064
16271
|
if (!value) throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");
|
|
16065
16272
|
return value;
|
|
16066
16273
|
}
|