@sia.soul/sia-react-ui 0.1.116 → 0.1.118
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/{chunk-XY7CXJS6.js → chunk-6MGFX7B2.js} +24 -2
- package/dist/{chunk-MKCU5S77.js → chunk-AOWWHL5Z.js} +2 -2
- package/dist/{chunk-D2H37DUL.js → chunk-BEVCKS5J.js} +5 -3
- package/dist/{chunk-7PPE6DJO.js → chunk-BQIARYZB.js} +48 -18
- package/dist/{chunk-SATXB6X4.js → chunk-GKFFFHHU.js} +4 -2
- package/dist/{chunk-CVIFJLW6.js → chunk-QBBIBJXW.js} +2 -2
- package/dist/{core-CJnRQZkv.d.ts → core-PlVXb05e.d.ts} +13 -3
- package/dist/{core-CCb4CoSP.d.cts → core-mmHC4SGJ.d.cts} +13 -3
- package/dist/core.cjs +169 -119
- package/dist/core.css +7 -0
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +4 -4
- package/dist/game.cjs +9 -2
- package/dist/game.css +4 -0
- package/dist/game.js +1 -1
- package/dist/index.cjs +105 -26
- package/dist/index.css +7 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +41 -14
- package/dist/rich-text-editor.cjs +12 -3
- package/dist/rich-text-editor.js +3 -3
- package/dist/select-date-range.cjs +65 -17
- package/dist/select-date-range.js +4 -4
- package/package.json +1 -1
|
@@ -1469,9 +1469,10 @@ var filledIconPaths = {
|
|
|
1469
1469
|
var FILLED_ICON_NAMES = Object.freeze(Object.keys(filledIconPaths));
|
|
1470
1470
|
var normalizedOutlinePaths = normalizeIconPaths(iconPaths, outlineIconBounds);
|
|
1471
1471
|
var normalizedFilledPaths = normalizeIconPaths(filledIconPaths, filledIconBounds);
|
|
1472
|
-
var Icon = (0, import_react4.forwardRef)(function Icon2({ name, size = "1em", strokeWidth = 1.8, rotate = 0, spin = false, pulse = false, label, variant = "outline", className = "", style, ...props }, ref) {
|
|
1472
|
+
var Icon = (0, import_react4.forwardRef)(function Icon2({ name, tone = "inherit", size = "1em", strokeWidth = 1.8, rotate = 0, spin = false, pulse = false, label, variant = "outline", className = "", style, ...props }, ref) {
|
|
1473
1473
|
const resolvedSize = typeof size === "number" ? `${size}px` : size;
|
|
1474
|
-
const
|
|
1474
|
+
const toneColor = tone === "inherit" ? void 0 : `var(--sia-color-${tone === "danger" ? "error" : tone === "primary" ? "primary-text" : tone})`;
|
|
1475
|
+
const mergedStyle = { "--sia-icon-size": resolvedSize, "--sia-icon-rotate": `${rotate}deg`, color: toneColor, ...style };
|
|
1475
1476
|
const animationClass = spin ? " sia-icon--spin" : pulse ? " sia-icon--pulse" : "";
|
|
1476
1477
|
const filledPath = filledIconPaths[name];
|
|
1477
1478
|
const resolvedVariant = variant === "filled" && filledPath ? "filled" : "outline";
|
|
@@ -1633,6 +1634,8 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
1633
1634
|
const entries = /* @__PURE__ */ new Map();
|
|
1634
1635
|
let scanFrame = 0;
|
|
1635
1636
|
let updateFrame = 0;
|
|
1637
|
+
const dirtyStyles = /* @__PURE__ */ new Set();
|
|
1638
|
+
let fullScan = true;
|
|
1636
1639
|
const setEntryVisible = (entry, visible) => {
|
|
1637
1640
|
entry.horizontalTrack.classList.toggle("sia-floating-scrollbar--visible", visible);
|
|
1638
1641
|
entry.verticalTrack.classList.toggle("sia-floating-scrollbar--visible", visible);
|
|
@@ -1832,13 +1835,17 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
1832
1835
|
const scanTargets = () => {
|
|
1833
1836
|
scanFrame = 0;
|
|
1834
1837
|
const managedSelector = ".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track, .sia-floating-scrollbar-layer";
|
|
1835
|
-
const discovered =
|
|
1838
|
+
const discovered = /* @__PURE__ */ new Set();
|
|
1836
1839
|
if (!targetRef) {
|
|
1837
|
-
const
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1840
|
+
const roots = fullScan ? [document.body] : [...dirtyStyles].filter((node) => node.isConnected);
|
|
1841
|
+
for (const root of roots) {
|
|
1842
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
|
|
1843
|
+
acceptNode: (node) => node.matches(managedSelector) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
1844
|
+
});
|
|
1845
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
1846
|
+
if (node instanceof HTMLElement) discovered.add(node);
|
|
1847
|
+
}
|
|
1848
|
+
for (let node = root; node; node = node.parentElement) discovered.add(node);
|
|
1842
1849
|
}
|
|
1843
1850
|
}
|
|
1844
1851
|
const candidates = (targetRef ? [targetRef.current] : [document.scrollingElement, ...discovered]).filter((target) => target instanceof HTMLElement);
|
|
@@ -1850,28 +1857,48 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
1850
1857
|
}
|
|
1851
1858
|
});
|
|
1852
1859
|
entries.forEach((_entry, target) => {
|
|
1853
|
-
if (!target.isConnected || !nextTargets.has(target)) removeTarget(target);
|
|
1860
|
+
if (!target.isConnected || (fullScan || candidates.includes(target)) && !nextTargets.has(target)) removeTarget(target);
|
|
1854
1861
|
else updateEntry(_entry);
|
|
1855
1862
|
});
|
|
1863
|
+
dirtyStyles.clear();
|
|
1864
|
+
fullScan = false;
|
|
1856
1865
|
};
|
|
1857
|
-
const scheduleScan = () => {
|
|
1866
|
+
const scheduleScan = (complete = true) => {
|
|
1867
|
+
fullScan ||= complete;
|
|
1858
1868
|
if (scanFrame) return;
|
|
1859
1869
|
scanFrame = window.requestAnimationFrame(scanTargets);
|
|
1860
1870
|
};
|
|
1871
|
+
const previousStyle = document.createElement("div").style;
|
|
1872
|
+
const positionProperties = /* @__PURE__ */ new Set(["left", "top", "transform"]);
|
|
1861
1873
|
const mutationObserver = new MutationObserver((mutations) => {
|
|
1862
|
-
|
|
1874
|
+
let relevant = false;
|
|
1875
|
+
for (const mutation of mutations) {
|
|
1863
1876
|
const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
|
|
1864
|
-
|
|
1865
|
-
|
|
1877
|
+
if (!target || layer.contains(target) || target.closest(".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track")) continue;
|
|
1878
|
+
relevant = true;
|
|
1879
|
+
let positionOnly = false;
|
|
1880
|
+
if (mutation.type === "attributes" && mutation.attributeName === "style" && target instanceof HTMLElement) {
|
|
1881
|
+
previousStyle.cssText = mutation.oldValue ?? "";
|
|
1882
|
+
const keys = /* @__PURE__ */ new Set([...Array.from(previousStyle), ...Array.from(target.style)]);
|
|
1883
|
+
const changed = [...keys].filter((key) => previousStyle.getPropertyValue(key) !== target.style.getPropertyValue(key) || previousStyle.getPropertyPriority(key) !== target.style.getPropertyPriority(key));
|
|
1884
|
+
if (!changed.length) continue;
|
|
1885
|
+
const fixedSize = target.style.width.endsWith("px") && target.style.height.endsWith("px");
|
|
1886
|
+
positionOnly = fixedSize && changed.every((key) => positionProperties.has(key)) && ["absolute", "fixed"].includes(getComputedStyle(target).position);
|
|
1887
|
+
}
|
|
1888
|
+
if (positionOnly && target instanceof HTMLElement) dirtyStyles.add(target);
|
|
1889
|
+
else fullScan = true;
|
|
1890
|
+
}
|
|
1891
|
+
if (relevant) scheduleScan(false);
|
|
1866
1892
|
});
|
|
1867
|
-
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeFilter: ["class", "style", "hidden"] });
|
|
1868
|
-
|
|
1893
|
+
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeOldValue: true, attributeFilter: ["class", "style", "hidden"] });
|
|
1894
|
+
const onResize = () => scheduleScan();
|
|
1895
|
+
window.addEventListener("resize", onResize);
|
|
1869
1896
|
window.addEventListener("scroll", scheduleUpdateAll, true);
|
|
1870
1897
|
scheduleScan();
|
|
1871
1898
|
return () => {
|
|
1872
1899
|
mutationObserver.disconnect();
|
|
1873
1900
|
resizeObserver.disconnect();
|
|
1874
|
-
window.removeEventListener("resize",
|
|
1901
|
+
window.removeEventListener("resize", onResize);
|
|
1875
1902
|
window.removeEventListener("scroll", scheduleUpdateAll, true);
|
|
1876
1903
|
if (scanFrame) window.cancelAnimationFrame(scanFrame);
|
|
1877
1904
|
if (updateFrame) window.cancelAnimationFrame(updateFrame);
|
|
@@ -2800,6 +2827,21 @@ var import_react_dom2 = require("react-dom");
|
|
|
2800
2827
|
var bodyLockCount = 0;
|
|
2801
2828
|
var previousBodyOverflow = "";
|
|
2802
2829
|
var overlayStack = [];
|
|
2830
|
+
var overlayPanels = /* @__PURE__ */ new Map();
|
|
2831
|
+
var overlayListeners = /* @__PURE__ */ new Set();
|
|
2832
|
+
function subscribeOverlayLayers(listener) {
|
|
2833
|
+
overlayListeners.add(listener);
|
|
2834
|
+
return () => {
|
|
2835
|
+
overlayListeners.delete(listener);
|
|
2836
|
+
};
|
|
2837
|
+
}
|
|
2838
|
+
function isAnchorBehindOverlay(anchor) {
|
|
2839
|
+
const top = overlayStack.at(-1);
|
|
2840
|
+
const panel = top ? overlayPanels.get(top)?.current : void 0;
|
|
2841
|
+
if (!panel) return false;
|
|
2842
|
+
const root = panel.closest(".sia-modal-root, .sia-drawer-root");
|
|
2843
|
+
return root ? anchor.closest(".sia-modal-root, .sia-drawer-root") !== root : !panel.contains(anchor);
|
|
2844
|
+
}
|
|
2803
2845
|
function lockBodyScroll() {
|
|
2804
2846
|
if (bodyLockCount === 0) {
|
|
2805
2847
|
previousBodyOverflow = document.body.style.overflow;
|
|
@@ -2825,6 +2867,8 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
2825
2867
|
const overlayId = overlayIdRef.current;
|
|
2826
2868
|
const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
2827
2869
|
overlayStack.push(overlayId);
|
|
2870
|
+
overlayPanels.set(overlayId, panelRef);
|
|
2871
|
+
overlayListeners.forEach((listener) => listener());
|
|
2828
2872
|
const unlockBody = lockBodyScroll();
|
|
2829
2873
|
const focusTimer = window.setTimeout(() => {
|
|
2830
2874
|
const panel = panelRef.current;
|
|
@@ -2862,6 +2906,8 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
2862
2906
|
document.removeEventListener("keydown", handleKeyDown);
|
|
2863
2907
|
const index = overlayStack.lastIndexOf(overlayId);
|
|
2864
2908
|
if (index >= 0) overlayStack.splice(index, 1);
|
|
2909
|
+
overlayPanels.delete(overlayId);
|
|
2910
|
+
overlayListeners.forEach((listener) => listener());
|
|
2865
2911
|
unlockBody();
|
|
2866
2912
|
previouslyFocused?.focus({ preventScroll: true });
|
|
2867
2913
|
};
|
|
@@ -3588,11 +3634,12 @@ function Floating({
|
|
|
3588
3634
|
if (anchor2) {
|
|
3589
3635
|
const rect = anchor2.getBoundingClientRect();
|
|
3590
3636
|
const next = resolveFloatingPosition(rect, overlayRef.current.getBoundingClientRect(), placement, typeof arrow === "object" && !!arrow.pointAtCenter, autoAdjustOverflow);
|
|
3591
|
-
next.hidden = isFloatingAnchorHidden(anchor2, rect);
|
|
3637
|
+
next.hidden = isFloatingAnchorHidden(anchor2, rect) || isAnchorBehindOverlay(anchor2);
|
|
3592
3638
|
setPosition(next);
|
|
3593
3639
|
}
|
|
3594
3640
|
};
|
|
3595
3641
|
update();
|
|
3642
|
+
const unsubscribeLayers = subscribeOverlayLayers(update);
|
|
3596
3643
|
window.addEventListener("resize", update);
|
|
3597
3644
|
window.addEventListener("scroll", update, true);
|
|
3598
3645
|
window.addEventListener("animationend", update, true);
|
|
@@ -3608,6 +3655,7 @@ function Floating({
|
|
|
3608
3655
|
window.removeEventListener("animationend", update, true);
|
|
3609
3656
|
window.removeEventListener("transitionend", update, true);
|
|
3610
3657
|
observer.disconnect();
|
|
3658
|
+
unsubscribeLayers();
|
|
3611
3659
|
};
|
|
3612
3660
|
}, [children, content, placement, visible, portalContainer, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
|
|
3613
3661
|
(0, import_react15.useEffect)(() => () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SelectDateRange
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-AOWWHL5Z.js";
|
|
4
|
+
import "./chunk-BQIARYZB.js";
|
|
5
|
+
import "./chunk-GKFFFHHU.js";
|
|
6
6
|
import "./chunk-SCEHVGKV.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-6MGFX7B2.js";
|
|
8
8
|
import "./chunk-CZ2ITBRW.js";
|
|
9
9
|
import "./chunk-KY6A5IJH.js";
|
|
10
10
|
import "./chunk-NZMUW5XI.js";
|