@sia.soul/sia-react-ui 0.1.117 → 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-KIQSPAAQ.js → chunk-6MGFX7B2.js} +21 -0
- package/dist/{chunk-RYNEJ6LD.js → chunk-AOWWHL5Z.js} +2 -2
- package/dist/{chunk-CKP3SNVH.js → chunk-BEVCKS5J.js} +5 -3
- package/dist/{chunk-SB53UBFV.js → chunk-BQIARYZB.js} +48 -18
- package/dist/{chunk-6DFAX43X.js → chunk-GKFFFHHU.js} +4 -2
- package/dist/{chunk-HHPZOBY3.js → chunk-QBBIBJXW.js} +2 -2
- package/dist/{core-De9MXbF6.d.ts → core-PlVXb05e.d.ts} +7 -3
- package/dist/{core-DlngVjmf.d.cts → core-mmHC4SGJ.d.cts} +7 -3
- package/dist/core.cjs +166 -117
- 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 +6 -0
- package/dist/game.css +4 -0
- package/dist/game.js +1 -1
- package/dist/index.cjs +102 -24
- 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 +9 -1
- package/dist/rich-text-editor.js +3 -3
- package/dist/select-date-range.cjs +62 -15
- package/dist/select-date-range.js +4 -4
- package/package.json +1 -1
package/dist/core.cjs
CHANGED
|
@@ -1655,6 +1655,7 @@ function MenuEntry({
|
|
|
1655
1655
|
ref: anchorRef,
|
|
1656
1656
|
type: "button",
|
|
1657
1657
|
className: "sia-menu__item",
|
|
1658
|
+
"data-sia-interaction-cursor": props.interactionCursor,
|
|
1658
1659
|
style: { paddingInlineStart: props.mode === "inline" && !props.inlineCollapsed ? 12 + level * props.inlineIndent : void 0 },
|
|
1659
1660
|
...withTitleTooltip({ title: collapsed ? item.title ?? (typeof item.label === "string" ? item.label : void 0) : item.title }),
|
|
1660
1661
|
disabled: item.disabled,
|
|
@@ -1712,6 +1713,7 @@ function Menu({
|
|
|
1712
1713
|
items,
|
|
1713
1714
|
mode = "vertical",
|
|
1714
1715
|
gridColumns = 2,
|
|
1716
|
+
interactionCursor = "pointer",
|
|
1715
1717
|
theme = "light",
|
|
1716
1718
|
selectedKeys,
|
|
1717
1719
|
autoScrollSelected = false,
|
|
@@ -1786,7 +1788,7 @@ function Menu({
|
|
|
1786
1788
|
if (mode !== "inline") setOpen([]);
|
|
1787
1789
|
}
|
|
1788
1790
|
const gridStyle = mode === "grid" ? { "--sia-menu-grid-columns": gridColumns === "auto" ? "repeat(auto-fill, minmax(88px, 1fr))" : `repeat(${Number.isFinite(gridColumns) ? Math.max(1, Math.floor(Number(gridColumns))) : 2}, minmax(0, 1fr))` } : {};
|
|
1789
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { ref: rootRef, className: `sia-menu sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), style: { ...gridStyle, ...style }, "data-sia-menu-owner": menuId, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuLevel, { items, level: 0, parents: [], props: { menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }) });
|
|
1791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { ref: rootRef, className: `sia-menu sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), style: { ...gridStyle, ...style }, "data-sia-menu-owner": menuId, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuLevel, { items, level: 0, parents: [], props: { interactionCursor, menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }) });
|
|
1790
1792
|
}
|
|
1791
1793
|
function Segmented({ options, value, defaultValue, variant = "default", shape = "capsule", size: sizeProp, block = false, vertical = false, disabled = false, onChange, className = "", onKeyDown, ...props }) {
|
|
1792
1794
|
const size = useControlSize(sizeProp);
|
|
@@ -2159,6 +2161,7 @@ function Card({
|
|
|
2159
2161
|
description,
|
|
2160
2162
|
extra,
|
|
2161
2163
|
selectable = false,
|
|
2164
|
+
interactionCursor = "pointer",
|
|
2162
2165
|
selected,
|
|
2163
2166
|
showSelectedIndicator = true,
|
|
2164
2167
|
defaultSelected = false,
|
|
@@ -2211,6 +2214,7 @@ function Card({
|
|
|
2211
2214
|
{
|
|
2212
2215
|
className: `sia-card${fill ? " sia-card--fill" : ""}${fill && bodyHeight !== void 0 ? " sia-card--body-height" : ""}${!bordered ? " sia-card--borderless" : ""}${isCollapsed ? " sia-card--collapsed" : ""}${selectable ? " sia-card--selectable" : ""}${actionable ? " sia-card--actionable" : ""}${selectable && isSelected ? " sia-card--selected" : ""}${hoverActions ? " sia-card--hover-actions" : ""} ${className}`.trim(),
|
|
2213
2216
|
style: mergedStyle,
|
|
2217
|
+
"data-sia-interaction-cursor": interactionCursor,
|
|
2214
2218
|
role: selectable ? "checkbox" : actionable ? "button" : void 0,
|
|
2215
2219
|
"aria-checked": selectable ? isSelected : void 0,
|
|
2216
2220
|
"aria-disabled": selectable || actionable ? disabled : void 0,
|
|
@@ -2572,13 +2576,13 @@ function Tabs({
|
|
|
2572
2576
|
}
|
|
2573
2577
|
|
|
2574
2578
|
// src/components/Feedback.tsx
|
|
2575
|
-
var
|
|
2576
|
-
var
|
|
2579
|
+
var import_react18 = require("react");
|
|
2580
|
+
var import_react_dom4 = require("react-dom");
|
|
2577
2581
|
var import_client2 = require("react-dom/client");
|
|
2578
2582
|
|
|
2579
2583
|
// src/components/FloatingDisplay.tsx
|
|
2580
|
-
var
|
|
2581
|
-
var
|
|
2584
|
+
var import_react17 = require("react");
|
|
2585
|
+
var import_react_dom3 = require("react-dom");
|
|
2582
2586
|
|
|
2583
2587
|
// src/components/Checkbox.tsx
|
|
2584
2588
|
var import_react13 = require("react");
|
|
@@ -2804,6 +2808,8 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
2804
2808
|
const entries = /* @__PURE__ */ new Map();
|
|
2805
2809
|
let scanFrame = 0;
|
|
2806
2810
|
let updateFrame = 0;
|
|
2811
|
+
const dirtyStyles = /* @__PURE__ */ new Set();
|
|
2812
|
+
let fullScan = true;
|
|
2807
2813
|
const setEntryVisible = (entry, visible) => {
|
|
2808
2814
|
entry.horizontalTrack.classList.toggle("sia-floating-scrollbar--visible", visible);
|
|
2809
2815
|
entry.verticalTrack.classList.toggle("sia-floating-scrollbar--visible", visible);
|
|
@@ -3003,13 +3009,17 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
3003
3009
|
const scanTargets = () => {
|
|
3004
3010
|
scanFrame = 0;
|
|
3005
3011
|
const managedSelector = ".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track, .sia-floating-scrollbar-layer";
|
|
3006
|
-
const discovered =
|
|
3012
|
+
const discovered = /* @__PURE__ */ new Set();
|
|
3007
3013
|
if (!targetRef) {
|
|
3008
|
-
const
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3014
|
+
const roots = fullScan ? [document.body] : [...dirtyStyles].filter((node) => node.isConnected);
|
|
3015
|
+
for (const root of roots) {
|
|
3016
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
|
|
3017
|
+
acceptNode: (node) => node.matches(managedSelector) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
3018
|
+
});
|
|
3019
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
3020
|
+
if (node instanceof HTMLElement) discovered.add(node);
|
|
3021
|
+
}
|
|
3022
|
+
for (let node = root; node; node = node.parentElement) discovered.add(node);
|
|
3013
3023
|
}
|
|
3014
3024
|
}
|
|
3015
3025
|
const candidates = (targetRef ? [targetRef.current] : [document.scrollingElement, ...discovered]).filter((target) => target instanceof HTMLElement);
|
|
@@ -3021,28 +3031,48 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
3021
3031
|
}
|
|
3022
3032
|
});
|
|
3023
3033
|
entries.forEach((_entry, target) => {
|
|
3024
|
-
if (!target.isConnected || !nextTargets.has(target)) removeTarget(target);
|
|
3034
|
+
if (!target.isConnected || (fullScan || candidates.includes(target)) && !nextTargets.has(target)) removeTarget(target);
|
|
3025
3035
|
else updateEntry(_entry);
|
|
3026
3036
|
});
|
|
3037
|
+
dirtyStyles.clear();
|
|
3038
|
+
fullScan = false;
|
|
3027
3039
|
};
|
|
3028
|
-
const scheduleScan = () => {
|
|
3040
|
+
const scheduleScan = (complete = true) => {
|
|
3041
|
+
fullScan ||= complete;
|
|
3029
3042
|
if (scanFrame) return;
|
|
3030
3043
|
scanFrame = window.requestAnimationFrame(scanTargets);
|
|
3031
3044
|
};
|
|
3045
|
+
const previousStyle = document.createElement("div").style;
|
|
3046
|
+
const positionProperties = /* @__PURE__ */ new Set(["left", "top", "transform"]);
|
|
3032
3047
|
const mutationObserver = new MutationObserver((mutations) => {
|
|
3033
|
-
|
|
3048
|
+
let relevant = false;
|
|
3049
|
+
for (const mutation of mutations) {
|
|
3034
3050
|
const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
|
|
3035
|
-
|
|
3036
|
-
|
|
3051
|
+
if (!target || layer.contains(target) || target.closest(".sia-table__viewport, [data-sia-native-scrollbar], .sia-scrollbar-track")) continue;
|
|
3052
|
+
relevant = true;
|
|
3053
|
+
let positionOnly = false;
|
|
3054
|
+
if (mutation.type === "attributes" && mutation.attributeName === "style" && target instanceof HTMLElement) {
|
|
3055
|
+
previousStyle.cssText = mutation.oldValue ?? "";
|
|
3056
|
+
const keys = /* @__PURE__ */ new Set([...Array.from(previousStyle), ...Array.from(target.style)]);
|
|
3057
|
+
const changed = [...keys].filter((key) => previousStyle.getPropertyValue(key) !== target.style.getPropertyValue(key) || previousStyle.getPropertyPriority(key) !== target.style.getPropertyPriority(key));
|
|
3058
|
+
if (!changed.length) continue;
|
|
3059
|
+
const fixedSize = target.style.width.endsWith("px") && target.style.height.endsWith("px");
|
|
3060
|
+
positionOnly = fixedSize && changed.every((key) => positionProperties.has(key)) && ["absolute", "fixed"].includes(getComputedStyle(target).position);
|
|
3061
|
+
}
|
|
3062
|
+
if (positionOnly && target instanceof HTMLElement) dirtyStyles.add(target);
|
|
3063
|
+
else fullScan = true;
|
|
3064
|
+
}
|
|
3065
|
+
if (relevant) scheduleScan(false);
|
|
3037
3066
|
});
|
|
3038
|
-
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeFilter: ["class", "style", "hidden"] });
|
|
3039
|
-
|
|
3067
|
+
mutationObserver.observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeOldValue: true, attributeFilter: ["class", "style", "hidden"] });
|
|
3068
|
+
const onResize = () => scheduleScan();
|
|
3069
|
+
window.addEventListener("resize", onResize);
|
|
3040
3070
|
window.addEventListener("scroll", scheduleUpdateAll, true);
|
|
3041
3071
|
scheduleScan();
|
|
3042
3072
|
return () => {
|
|
3043
3073
|
mutationObserver.disconnect();
|
|
3044
3074
|
resizeObserver.disconnect();
|
|
3045
|
-
window.removeEventListener("resize",
|
|
3075
|
+
window.removeEventListener("resize", onResize);
|
|
3046
3076
|
window.removeEventListener("scroll", scheduleUpdateAll, true);
|
|
3047
3077
|
if (scanFrame) window.cancelAnimationFrame(scanFrame);
|
|
3048
3078
|
if (updateFrame) window.cancelAnimationFrame(updateFrame);
|
|
@@ -3054,6 +3084,104 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
3054
3084
|
return null;
|
|
3055
3085
|
}
|
|
3056
3086
|
|
|
3087
|
+
// src/components/Overlay.tsx
|
|
3088
|
+
var import_react16 = require("react");
|
|
3089
|
+
var import_react_dom2 = require("react-dom");
|
|
3090
|
+
var bodyLockCount = 0;
|
|
3091
|
+
var previousBodyOverflow = "";
|
|
3092
|
+
var overlayStack = [];
|
|
3093
|
+
var overlayPanels = /* @__PURE__ */ new Map();
|
|
3094
|
+
var overlayListeners = /* @__PURE__ */ new Set();
|
|
3095
|
+
function subscribeOverlayLayers(listener) {
|
|
3096
|
+
overlayListeners.add(listener);
|
|
3097
|
+
return () => {
|
|
3098
|
+
overlayListeners.delete(listener);
|
|
3099
|
+
};
|
|
3100
|
+
}
|
|
3101
|
+
function isAnchorBehindOverlay(anchor) {
|
|
3102
|
+
const top = overlayStack.at(-1);
|
|
3103
|
+
const panel = top ? overlayPanels.get(top)?.current : void 0;
|
|
3104
|
+
if (!panel) return false;
|
|
3105
|
+
const root = panel.closest(".sia-modal-root, .sia-drawer-root");
|
|
3106
|
+
return root ? anchor.closest(".sia-modal-root, .sia-drawer-root") !== root : !panel.contains(anchor);
|
|
3107
|
+
}
|
|
3108
|
+
function lockBodyScroll() {
|
|
3109
|
+
if (bodyLockCount === 0) {
|
|
3110
|
+
previousBodyOverflow = document.body.style.overflow;
|
|
3111
|
+
document.body.style.overflow = "hidden";
|
|
3112
|
+
}
|
|
3113
|
+
bodyLockCount += 1;
|
|
3114
|
+
return () => {
|
|
3115
|
+
bodyLockCount = Math.max(0, bodyLockCount - 1);
|
|
3116
|
+
if (bodyLockCount === 0) document.body.style.overflow = previousBodyOverflow;
|
|
3117
|
+
};
|
|
3118
|
+
}
|
|
3119
|
+
function focusableElements(container) {
|
|
3120
|
+
return [...container.querySelectorAll(
|
|
3121
|
+
'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
3122
|
+
)].filter((element) => !element.hidden && element.getAttribute("aria-hidden") !== "true");
|
|
3123
|
+
}
|
|
3124
|
+
function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
3125
|
+
const overlayIdRef = (0, import_react16.useRef)(/* @__PURE__ */ Symbol("sia-overlay"));
|
|
3126
|
+
const closeRef = (0, import_react16.useRef)(onRequestClose);
|
|
3127
|
+
closeRef.current = onRequestClose;
|
|
3128
|
+
(0, import_react16.useEffect)(() => {
|
|
3129
|
+
if (!open || typeof document === "undefined") return void 0;
|
|
3130
|
+
const overlayId = overlayIdRef.current;
|
|
3131
|
+
const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
3132
|
+
overlayStack.push(overlayId);
|
|
3133
|
+
overlayPanels.set(overlayId, panelRef);
|
|
3134
|
+
overlayListeners.forEach((listener) => listener());
|
|
3135
|
+
const unlockBody = lockBodyScroll();
|
|
3136
|
+
const focusTimer = window.setTimeout(() => {
|
|
3137
|
+
const panel = panelRef.current;
|
|
3138
|
+
if (!panel) return;
|
|
3139
|
+
const [firstFocusable] = focusableElements(panel);
|
|
3140
|
+
(firstFocusable ?? panel).focus({ preventScroll: true });
|
|
3141
|
+
}, 0);
|
|
3142
|
+
function handleKeyDown(event) {
|
|
3143
|
+
if (overlayStack.at(-1) !== overlayId) return;
|
|
3144
|
+
if (event.key === "Escape" && keyboard) {
|
|
3145
|
+
event.preventDefault();
|
|
3146
|
+
closeRef.current();
|
|
3147
|
+
return;
|
|
3148
|
+
}
|
|
3149
|
+
if (event.key !== "Tab" || !panelRef.current) return;
|
|
3150
|
+
const focusable = focusableElements(panelRef.current);
|
|
3151
|
+
if (focusable.length === 0) {
|
|
3152
|
+
event.preventDefault();
|
|
3153
|
+
panelRef.current.focus();
|
|
3154
|
+
return;
|
|
3155
|
+
}
|
|
3156
|
+
const first = focusable[0];
|
|
3157
|
+
const last = focusable.at(-1);
|
|
3158
|
+
if (event.shiftKey && document.activeElement === first) {
|
|
3159
|
+
event.preventDefault();
|
|
3160
|
+
last.focus();
|
|
3161
|
+
} else if (!event.shiftKey && document.activeElement === last) {
|
|
3162
|
+
event.preventDefault();
|
|
3163
|
+
first.focus();
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
3167
|
+
return () => {
|
|
3168
|
+
window.clearTimeout(focusTimer);
|
|
3169
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
3170
|
+
const index = overlayStack.lastIndexOf(overlayId);
|
|
3171
|
+
if (index >= 0) overlayStack.splice(index, 1);
|
|
3172
|
+
overlayPanels.delete(overlayId);
|
|
3173
|
+
overlayListeners.forEach((listener) => listener());
|
|
3174
|
+
unlockBody();
|
|
3175
|
+
previouslyFocused?.focus({ preventScroll: true });
|
|
3176
|
+
};
|
|
3177
|
+
}, [keyboard, open, panelRef]);
|
|
3178
|
+
}
|
|
3179
|
+
function OverlayPortal({ children, container }) {
|
|
3180
|
+
if (typeof document === "undefined") return null;
|
|
3181
|
+
const target = typeof container === "function" ? container() : container ?? document.body;
|
|
3182
|
+
return (0, import_react_dom2.createPortal)(children, target);
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3057
3185
|
// src/components/FloatingDisplay.tsx
|
|
3058
3186
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3059
3187
|
var FLOATING_GAP = 9;
|
|
@@ -3140,23 +3268,23 @@ function Floating({
|
|
|
3140
3268
|
role = "tooltip",
|
|
3141
3269
|
onOpenChange
|
|
3142
3270
|
}) {
|
|
3143
|
-
const rootRef = (0,
|
|
3144
|
-
const triggerElementRef = (0,
|
|
3145
|
-
const overlayRef = (0,
|
|
3146
|
-
const enterTimer = (0,
|
|
3147
|
-
const leaveTimer = (0,
|
|
3148
|
-
const contentId = (0,
|
|
3271
|
+
const rootRef = (0, import_react17.useRef)(null);
|
|
3272
|
+
const triggerElementRef = (0, import_react17.useRef)(null);
|
|
3273
|
+
const overlayRef = (0, import_react17.useRef)(null);
|
|
3274
|
+
const enterTimer = (0, import_react17.useRef)();
|
|
3275
|
+
const leaveTimer = (0, import_react17.useRef)();
|
|
3276
|
+
const contentId = (0, import_react17.useId)();
|
|
3149
3277
|
const triggers = Array.isArray(trigger) ? trigger : [trigger];
|
|
3150
3278
|
const [visible, setVisible] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });
|
|
3151
|
-
const [position, setPosition] = (0,
|
|
3152
|
-
const [portalContainer, setPortalContainer] = (0,
|
|
3153
|
-
(0,
|
|
3279
|
+
const [position, setPosition] = (0, import_react17.useState)();
|
|
3280
|
+
const [portalContainer, setPortalContainer] = (0, import_react17.useState)(null);
|
|
3281
|
+
(0, import_react17.useLayoutEffect)(() => {
|
|
3154
3282
|
if (!visible) return;
|
|
3155
3283
|
setPortalContainer(rootRef.current?.closest(".sia-modal-root, .sia-drawer-root") ?? document.body);
|
|
3156
3284
|
});
|
|
3157
|
-
const setVisibleRef = (0,
|
|
3285
|
+
const setVisibleRef = (0, import_react17.useRef)(setVisible);
|
|
3158
3286
|
setVisibleRef.current = setVisible;
|
|
3159
|
-
const closeSelfRef = (0,
|
|
3287
|
+
const closeSelfRef = (0, import_react17.useRef)();
|
|
3160
3288
|
if (!closeSelfRef.current) closeSelfRef.current = () => setVisibleRef.current(false);
|
|
3161
3289
|
const exclusiveTooltip = role === "tooltip" && triggers.includes("hover");
|
|
3162
3290
|
function openNow() {
|
|
@@ -3184,7 +3312,7 @@ function Floating({
|
|
|
3184
3312
|
if (delay <= 0) closeNow();
|
|
3185
3313
|
else leaveTimer.current = window.setTimeout(closeNow, delay * 1e3);
|
|
3186
3314
|
}
|
|
3187
|
-
(0,
|
|
3315
|
+
(0, import_react17.useEffect)(() => {
|
|
3188
3316
|
if (!visible || !triggers.includes("click")) return;
|
|
3189
3317
|
const close = (event) => {
|
|
3190
3318
|
const target = event.target;
|
|
@@ -3193,7 +3321,7 @@ function Floating({
|
|
|
3193
3321
|
document.addEventListener("pointerdown", close);
|
|
3194
3322
|
return () => document.removeEventListener("pointerdown", close);
|
|
3195
3323
|
}, [triggers.join("|"), visible]);
|
|
3196
|
-
(0,
|
|
3324
|
+
(0, import_react17.useLayoutEffect)(() => {
|
|
3197
3325
|
if (!visible) {
|
|
3198
3326
|
setPosition(void 0);
|
|
3199
3327
|
return;
|
|
@@ -3209,11 +3337,12 @@ function Floating({
|
|
|
3209
3337
|
if (anchor2) {
|
|
3210
3338
|
const rect = anchor2.getBoundingClientRect();
|
|
3211
3339
|
const next = resolveFloatingPosition(rect, overlayRef.current.getBoundingClientRect(), placement, typeof arrow === "object" && !!arrow.pointAtCenter, autoAdjustOverflow);
|
|
3212
|
-
next.hidden = isFloatingAnchorHidden(anchor2, rect);
|
|
3340
|
+
next.hidden = isFloatingAnchorHidden(anchor2, rect) || isAnchorBehindOverlay(anchor2);
|
|
3213
3341
|
setPosition(next);
|
|
3214
3342
|
}
|
|
3215
3343
|
};
|
|
3216
3344
|
update();
|
|
3345
|
+
const unsubscribeLayers = subscribeOverlayLayers(update);
|
|
3217
3346
|
window.addEventListener("resize", update);
|
|
3218
3347
|
window.addEventListener("scroll", update, true);
|
|
3219
3348
|
window.addEventListener("animationend", update, true);
|
|
@@ -3229,13 +3358,14 @@ function Floating({
|
|
|
3229
3358
|
window.removeEventListener("animationend", update, true);
|
|
3230
3359
|
window.removeEventListener("transitionend", update, true);
|
|
3231
3360
|
observer.disconnect();
|
|
3361
|
+
unsubscribeLayers();
|
|
3232
3362
|
};
|
|
3233
3363
|
}, [children, content, placement, visible, portalContainer, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
|
|
3234
|
-
(0,
|
|
3364
|
+
(0, import_react17.useEffect)(() => () => {
|
|
3235
3365
|
clearTimers();
|
|
3236
3366
|
if (activeTooltipClose === closeSelfRef.current) activeTooltipClose = void 0;
|
|
3237
3367
|
}, []);
|
|
3238
|
-
const child = (0,
|
|
3368
|
+
const child = (0, import_react17.cloneElement)(children, {
|
|
3239
3369
|
...triggers.includes("hover") ? { onMouseEnter: (event) => {
|
|
3240
3370
|
triggerElementRef.current = event.currentTarget;
|
|
3241
3371
|
children.props.onMouseEnter?.(event);
|
|
@@ -3260,7 +3390,7 @@ function Floating({
|
|
|
3260
3390
|
} } : {},
|
|
3261
3391
|
"aria-describedby": visible ? contentId : void 0
|
|
3262
3392
|
});
|
|
3263
|
-
const overlay = visible && content !== null && content !== void 0 && typeof document !== "undefined" ? (0,
|
|
3393
|
+
const overlay = visible && content !== null && content !== void 0 && typeof document !== "undefined" ? (0, import_react_dom3.createPortal)(
|
|
3264
3394
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
3265
3395
|
"span",
|
|
3266
3396
|
{
|
|
@@ -3345,87 +3475,6 @@ function Progress({
|
|
|
3345
3475
|
// src/components/DataDisplay.tsx
|
|
3346
3476
|
var import_react19 = require("react");
|
|
3347
3477
|
var import_react_dom5 = require("react-dom");
|
|
3348
|
-
|
|
3349
|
-
// src/components/Overlay.tsx
|
|
3350
|
-
var import_react18 = require("react");
|
|
3351
|
-
var import_react_dom4 = require("react-dom");
|
|
3352
|
-
var bodyLockCount = 0;
|
|
3353
|
-
var previousBodyOverflow = "";
|
|
3354
|
-
var overlayStack = [];
|
|
3355
|
-
function lockBodyScroll() {
|
|
3356
|
-
if (bodyLockCount === 0) {
|
|
3357
|
-
previousBodyOverflow = document.body.style.overflow;
|
|
3358
|
-
document.body.style.overflow = "hidden";
|
|
3359
|
-
}
|
|
3360
|
-
bodyLockCount += 1;
|
|
3361
|
-
return () => {
|
|
3362
|
-
bodyLockCount = Math.max(0, bodyLockCount - 1);
|
|
3363
|
-
if (bodyLockCount === 0) document.body.style.overflow = previousBodyOverflow;
|
|
3364
|
-
};
|
|
3365
|
-
}
|
|
3366
|
-
function focusableElements(container) {
|
|
3367
|
-
return [...container.querySelectorAll(
|
|
3368
|
-
'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
3369
|
-
)].filter((element) => !element.hidden && element.getAttribute("aria-hidden") !== "true");
|
|
3370
|
-
}
|
|
3371
|
-
function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
3372
|
-
const overlayIdRef = (0, import_react18.useRef)(/* @__PURE__ */ Symbol("sia-overlay"));
|
|
3373
|
-
const closeRef = (0, import_react18.useRef)(onRequestClose);
|
|
3374
|
-
closeRef.current = onRequestClose;
|
|
3375
|
-
(0, import_react18.useEffect)(() => {
|
|
3376
|
-
if (!open || typeof document === "undefined") return void 0;
|
|
3377
|
-
const overlayId = overlayIdRef.current;
|
|
3378
|
-
const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
3379
|
-
overlayStack.push(overlayId);
|
|
3380
|
-
const unlockBody = lockBodyScroll();
|
|
3381
|
-
const focusTimer = window.setTimeout(() => {
|
|
3382
|
-
const panel = panelRef.current;
|
|
3383
|
-
if (!panel) return;
|
|
3384
|
-
const [firstFocusable] = focusableElements(panel);
|
|
3385
|
-
(firstFocusable ?? panel).focus({ preventScroll: true });
|
|
3386
|
-
}, 0);
|
|
3387
|
-
function handleKeyDown(event) {
|
|
3388
|
-
if (overlayStack.at(-1) !== overlayId) return;
|
|
3389
|
-
if (event.key === "Escape" && keyboard) {
|
|
3390
|
-
event.preventDefault();
|
|
3391
|
-
closeRef.current();
|
|
3392
|
-
return;
|
|
3393
|
-
}
|
|
3394
|
-
if (event.key !== "Tab" || !panelRef.current) return;
|
|
3395
|
-
const focusable = focusableElements(panelRef.current);
|
|
3396
|
-
if (focusable.length === 0) {
|
|
3397
|
-
event.preventDefault();
|
|
3398
|
-
panelRef.current.focus();
|
|
3399
|
-
return;
|
|
3400
|
-
}
|
|
3401
|
-
const first = focusable[0];
|
|
3402
|
-
const last = focusable.at(-1);
|
|
3403
|
-
if (event.shiftKey && document.activeElement === first) {
|
|
3404
|
-
event.preventDefault();
|
|
3405
|
-
last.focus();
|
|
3406
|
-
} else if (!event.shiftKey && document.activeElement === last) {
|
|
3407
|
-
event.preventDefault();
|
|
3408
|
-
first.focus();
|
|
3409
|
-
}
|
|
3410
|
-
}
|
|
3411
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
3412
|
-
return () => {
|
|
3413
|
-
window.clearTimeout(focusTimer);
|
|
3414
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
3415
|
-
const index = overlayStack.lastIndexOf(overlayId);
|
|
3416
|
-
if (index >= 0) overlayStack.splice(index, 1);
|
|
3417
|
-
unlockBody();
|
|
3418
|
-
previouslyFocused?.focus({ preventScroll: true });
|
|
3419
|
-
};
|
|
3420
|
-
}, [keyboard, open, panelRef]);
|
|
3421
|
-
}
|
|
3422
|
-
function OverlayPortal({ children, container }) {
|
|
3423
|
-
if (typeof document === "undefined") return null;
|
|
3424
|
-
const target = typeof container === "function" ? container() : container ?? document.body;
|
|
3425
|
-
return (0, import_react_dom4.createPortal)(children, target);
|
|
3426
|
-
}
|
|
3427
|
-
|
|
3428
|
-
// src/components/DataDisplay.tsx
|
|
3429
3478
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3430
3479
|
function BadgeRibbon({ text, color, placement = "end", className = "", children, ...props }) {
|
|
3431
3480
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: `sia-ribbon-wrap ${className}`.trim(), ...withTitleTooltip(props), children: [
|
package/dist/core.css
CHANGED
|
@@ -2614,6 +2614,10 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
2614
2614
|
.sia-card--actionable {
|
|
2615
2615
|
cursor: pointer;
|
|
2616
2616
|
}
|
|
2617
|
+
.sia-card--selectable[data-sia-interaction-cursor=default],
|
|
2618
|
+
.sia-card--actionable[data-sia-interaction-cursor=default] {
|
|
2619
|
+
cursor: default;
|
|
2620
|
+
}
|
|
2617
2621
|
.sia-card--actionable[aria-disabled=true] {
|
|
2618
2622
|
cursor: default;
|
|
2619
2623
|
}
|
|
@@ -8223,6 +8227,9 @@ body:has(.sia-window-frame[data-sia-text-selectable=false]) img {
|
|
|
8223
8227
|
.sia-menu__item:hover {
|
|
8224
8228
|
background: var(--sia-color-control-hover);
|
|
8225
8229
|
}
|
|
8230
|
+
.sia-menu__item[data-sia-interaction-cursor=default] {
|
|
8231
|
+
cursor: default;
|
|
8232
|
+
}
|
|
8226
8233
|
.sia-menu__entry.is-selected > .sia-menu__item {
|
|
8227
8234
|
color: var(--sia-color-primary-text);
|
|
8228
8235
|
background: var(--sia-color-primary-light);
|
package/dist/core.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-
|
|
1
|
+
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-mmHC4SGJ.cjs';
|
|
2
2
|
export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-O_pNB3SQ.cjs';
|
|
3
3
|
export { e as Modal, d as ModalActionResult, M as ModalOpenConfig, f as ModalProps, g as ModalType, a as OverlayApiHandle, h as Select, S as SelectOption, c as SelectProps, j as SelectValue } from './Select-BAFXKVZB.cjs';
|
|
4
4
|
import 'react';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-
|
|
1
|
+
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-PlVXb05e.js';
|
|
2
2
|
export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-BiL3Wjsd.js';
|
|
3
3
|
export { e as Modal, d as ModalActionResult, M as ModalOpenConfig, f as ModalProps, g as ModalType, a as OverlayApiHandle, h as Select, S as SelectOption, c as SelectProps, j as SelectValue } from './Select-vjX7B63I.js';
|
|
4
4
|
import 'react';
|
package/dist/core.js
CHANGED
|
@@ -11,20 +11,20 @@ import {
|
|
|
11
11
|
Typography,
|
|
12
12
|
Upload,
|
|
13
13
|
message
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-BEVCKS5J.js";
|
|
15
15
|
import "./chunk-RX242MUO.js";
|
|
16
16
|
import {
|
|
17
17
|
Select
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-BQIARYZB.js";
|
|
19
19
|
import {
|
|
20
20
|
Input,
|
|
21
21
|
Segmented
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-GKFFFHHU.js";
|
|
23
23
|
import "./chunk-SCEHVGKV.js";
|
|
24
24
|
import {
|
|
25
25
|
Icon,
|
|
26
26
|
Modal
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-6MGFX7B2.js";
|
|
28
28
|
import {
|
|
29
29
|
Button
|
|
30
30
|
} from "./chunk-CZ2ITBRW.js";
|
package/dist/game.cjs
CHANGED
|
@@ -2267,6 +2267,8 @@ var import_react_dom2 = require("react-dom");
|
|
|
2267
2267
|
var bodyLockCount = 0;
|
|
2268
2268
|
var previousBodyOverflow = "";
|
|
2269
2269
|
var overlayStack = [];
|
|
2270
|
+
var overlayPanels = /* @__PURE__ */ new Map();
|
|
2271
|
+
var overlayListeners = /* @__PURE__ */ new Set();
|
|
2270
2272
|
function lockBodyScroll() {
|
|
2271
2273
|
if (bodyLockCount === 0) {
|
|
2272
2274
|
previousBodyOverflow = document.body.style.overflow;
|
|
@@ -2292,6 +2294,8 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
2292
2294
|
const overlayId = overlayIdRef.current;
|
|
2293
2295
|
const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
2294
2296
|
overlayStack.push(overlayId);
|
|
2297
|
+
overlayPanels.set(overlayId, panelRef);
|
|
2298
|
+
overlayListeners.forEach((listener) => listener());
|
|
2295
2299
|
const unlockBody = lockBodyScroll();
|
|
2296
2300
|
const focusTimer = window.setTimeout(() => {
|
|
2297
2301
|
const panel = panelRef.current;
|
|
@@ -2329,6 +2333,8 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
2329
2333
|
document.removeEventListener("keydown", handleKeyDown);
|
|
2330
2334
|
const index = overlayStack.lastIndexOf(overlayId);
|
|
2331
2335
|
if (index >= 0) overlayStack.splice(index, 1);
|
|
2336
|
+
overlayPanels.delete(overlayId);
|
|
2337
|
+
overlayListeners.forEach((listener) => listener());
|
|
2332
2338
|
unlockBody();
|
|
2333
2339
|
previouslyFocused?.focus({ preventScroll: true });
|
|
2334
2340
|
};
|
package/dist/game.css
CHANGED
|
@@ -2623,6 +2623,10 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
2623
2623
|
.sia-card--actionable {
|
|
2624
2624
|
cursor: pointer;
|
|
2625
2625
|
}
|
|
2626
|
+
.sia-card--selectable[data-sia-interaction-cursor=default],
|
|
2627
|
+
.sia-card--actionable[data-sia-interaction-cursor=default] {
|
|
2628
|
+
cursor: default;
|
|
2629
|
+
}
|
|
2626
2630
|
.sia-card--actionable[aria-disabled=true] {
|
|
2627
2631
|
cursor: default;
|
|
2628
2632
|
}
|