@x-plat/design-system 0.14.18 → 0.15.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/components/Dropdown/index.cjs +54 -17
- package/dist/components/Dropdown/index.js +54 -17
- package/dist/components/PopOver/index.cjs +53 -16
- package/dist/components/PopOver/index.js +53 -16
- package/dist/components/Select/index.cjs +73 -36
- package/dist/components/Select/index.js +73 -36
- package/dist/components/TimePicker/index.cjs +58 -21
- package/dist/components/TimePicker/index.js +58 -21
- package/dist/components/Tooltip/index.cjs +2 -2
- package/dist/components/Tooltip/index.js +2 -2
- package/dist/components/index.cjs +255 -215
- package/dist/components/index.js +255 -215
- package/dist/index.cjs +260 -220
- package/dist/index.js +260 -220
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7291,10 +7291,16 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7291
7291
|
const scrollParentRef = React10.useRef(null);
|
|
7292
7292
|
const placedRef = React10.useRef(false);
|
|
7293
7293
|
const frozenMaxRef = React10.useRef(void 0);
|
|
7294
|
+
const cssCapRef = React10.useRef(void 0);
|
|
7294
7295
|
const calculatePosition = React10.useCallback((remeasure = false) => {
|
|
7295
7296
|
const pop = popRef.current;
|
|
7296
7297
|
if (!triggerRef.current || !pop) return;
|
|
7297
7298
|
if (remeasure) frozenMaxRef.current = void 0;
|
|
7299
|
+
if (cssCapRef.current === void 0) {
|
|
7300
|
+
pop.style.maxHeight = "";
|
|
7301
|
+
const raw = getComputedStyle(pop).maxHeight;
|
|
7302
|
+
cssCapRef.current = raw === "none" ? null : Number.parseFloat(raw) || null;
|
|
7303
|
+
}
|
|
7298
7304
|
if (remeasure || !sizeRef.current) {
|
|
7299
7305
|
sizeRef.current = {
|
|
7300
7306
|
w: pop.offsetWidth,
|
|
@@ -7316,8 +7322,10 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7316
7322
|
};
|
|
7317
7323
|
const first = !placedRef.current;
|
|
7318
7324
|
if (first) pop.style.transition = "none";
|
|
7325
|
+
const cap = cssCapRef.current;
|
|
7326
|
+
const desiredH = cap == null ? popH : Math.min(popH, cap);
|
|
7319
7327
|
const frozen = frozenMaxRef.current;
|
|
7320
|
-
const effectiveH = frozen == null ?
|
|
7328
|
+
const effectiveH = frozen == null ? desiredH : Math.min(desiredH, frozen);
|
|
7321
7329
|
const { direction: next, top, left, over, maxHeight: suggested } = computePlacement(
|
|
7322
7330
|
triggerRect,
|
|
7323
7331
|
popW,
|
|
@@ -7326,8 +7334,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7326
7334
|
);
|
|
7327
7335
|
if (frozenMaxRef.current === void 0) frozenMaxRef.current = suggested;
|
|
7328
7336
|
const maxHeight = frozenMaxRef.current;
|
|
7329
|
-
|
|
7330
|
-
pop.style.
|
|
7337
|
+
const hostRect = (pop.offsetParent ?? pop.parentElement)?.getBoundingClientRect();
|
|
7338
|
+
pop.style.top = `${top - (hostRect?.top ?? 0)}px`;
|
|
7339
|
+
pop.style.left = `${left - (hostRect?.left ?? 0)}px`;
|
|
7331
7340
|
pop.style.maxHeight = maxHeight === null ? "" : `${maxHeight}px`;
|
|
7332
7341
|
pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
|
|
7333
7342
|
directionRef.current = next;
|
|
@@ -7345,6 +7354,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
7345
7354
|
scrollParentRef.current = null;
|
|
7346
7355
|
placedRef.current = false;
|
|
7347
7356
|
frozenMaxRef.current = void 0;
|
|
7357
|
+
cssCapRef.current = void 0;
|
|
7348
7358
|
return;
|
|
7349
7359
|
}
|
|
7350
7360
|
if (triggerRef.current) {
|
|
@@ -8128,13 +8138,13 @@ Drawer.displayName = "Drawer";
|
|
|
8128
8138
|
var Drawer_default = Drawer;
|
|
8129
8139
|
|
|
8130
8140
|
// src/components/Dropdown/Dropdown.tsx
|
|
8131
|
-
import
|
|
8141
|
+
import React22 from "react";
|
|
8132
8142
|
|
|
8133
8143
|
// src/tokens/hooks/Portal.tsx
|
|
8134
8144
|
import ReactDOM from "react-dom";
|
|
8135
|
-
var Portal = ({ children }) => {
|
|
8145
|
+
var Portal = ({ children, container }) => {
|
|
8136
8146
|
if (typeof document === "undefined") return null;
|
|
8137
|
-
return ReactDOM.createPortal(children, document.body);
|
|
8147
|
+
return ReactDOM.createPortal(children, container ?? document.body);
|
|
8138
8148
|
};
|
|
8139
8149
|
Portal.displayName = "Portal";
|
|
8140
8150
|
var Portal_default = Portal;
|
|
@@ -8164,15 +8174,42 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
8164
8174
|
};
|
|
8165
8175
|
var useClickOutside_default = useClickOutside;
|
|
8166
8176
|
|
|
8177
|
+
// src/tokens/hooks/useOverlayHost.ts
|
|
8178
|
+
import React21 from "react";
|
|
8179
|
+
var useOverlayHost = (triggerRef, enabled) => {
|
|
8180
|
+
const [host, setHost] = React21.useState(null);
|
|
8181
|
+
React21.useLayoutEffect(() => {
|
|
8182
|
+
if (!enabled || !triggerRef.current) {
|
|
8183
|
+
setHost(null);
|
|
8184
|
+
return;
|
|
8185
|
+
}
|
|
8186
|
+
const el = document.createElement("div");
|
|
8187
|
+
el.dataset.xplatOverlayHost = "";
|
|
8188
|
+
el.style.position = "relative";
|
|
8189
|
+
el.style.width = "0";
|
|
8190
|
+
el.style.height = "0";
|
|
8191
|
+
const parent = findScrollParent(triggerRef.current) ?? document.body;
|
|
8192
|
+
parent.appendChild(el);
|
|
8193
|
+
setHost(el);
|
|
8194
|
+
return () => {
|
|
8195
|
+
el.remove();
|
|
8196
|
+
setHost(null);
|
|
8197
|
+
};
|
|
8198
|
+
}, [enabled, triggerRef]);
|
|
8199
|
+
return host;
|
|
8200
|
+
};
|
|
8201
|
+
var useOverlayHost_default = useOverlayHost;
|
|
8202
|
+
|
|
8167
8203
|
// src/components/Dropdown/Dropdown.tsx
|
|
8168
8204
|
import { jsx as jsx322, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
8169
8205
|
var Dropdown = (props) => {
|
|
8170
8206
|
const { items, children } = props;
|
|
8171
|
-
const [isOpen, setIsOpen] =
|
|
8172
|
-
const [mounted, setMounted] =
|
|
8173
|
-
const [visible, setVisible] =
|
|
8174
|
-
const triggerRef =
|
|
8175
|
-
const menuRef =
|
|
8207
|
+
const [isOpen, setIsOpen] = React22.useState(false);
|
|
8208
|
+
const [mounted, setMounted] = React22.useState(false);
|
|
8209
|
+
const [visible, setVisible] = React22.useState(false);
|
|
8210
|
+
const triggerRef = React22.useRef(null);
|
|
8211
|
+
const menuRef = React22.useRef(null);
|
|
8212
|
+
const host = useOverlayHost_default(triggerRef, mounted);
|
|
8176
8213
|
useAutoPosition_default(triggerRef, menuRef, mounted);
|
|
8177
8214
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false), isOpen);
|
|
8178
8215
|
useCloseWhenFocusHidden(isOpen, triggerRef, menuRef, () => setIsOpen(false));
|
|
@@ -8180,7 +8217,7 @@ var Dropdown = (props) => {
|
|
|
8180
8217
|
setIsOpen(false);
|
|
8181
8218
|
triggerRef.current?.focus({ preventScroll: true });
|
|
8182
8219
|
});
|
|
8183
|
-
|
|
8220
|
+
React22.useEffect(() => {
|
|
8184
8221
|
if (isOpen) {
|
|
8185
8222
|
setMounted(true);
|
|
8186
8223
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -8205,7 +8242,7 @@ var Dropdown = (props) => {
|
|
|
8205
8242
|
children
|
|
8206
8243
|
}
|
|
8207
8244
|
),
|
|
8208
|
-
mounted && /* @__PURE__ */ jsx322(Portal_default, { children: /* @__PURE__ */ jsx322(
|
|
8245
|
+
mounted && /* @__PURE__ */ jsx322(Portal_default, { container: host, children: /* @__PURE__ */ jsx322(
|
|
8209
8246
|
"div",
|
|
8210
8247
|
{
|
|
8211
8248
|
ref: menuRef,
|
|
@@ -8233,7 +8270,7 @@ Dropdown.displayName = "Dropdown";
|
|
|
8233
8270
|
var Dropdown_default = Dropdown;
|
|
8234
8271
|
|
|
8235
8272
|
// src/components/Editor/Editor.tsx
|
|
8236
|
-
import
|
|
8273
|
+
import React23 from "react";
|
|
8237
8274
|
|
|
8238
8275
|
// src/components/Editor/highlight.ts
|
|
8239
8276
|
var CODE_LANGUAGES = [
|
|
@@ -8504,22 +8541,22 @@ var Editor = (props) => {
|
|
|
8504
8541
|
onImageUpload,
|
|
8505
8542
|
minHeight = 200
|
|
8506
8543
|
} = props;
|
|
8507
|
-
const editorRef =
|
|
8508
|
-
const lastRangeRef =
|
|
8509
|
-
const composingRef =
|
|
8510
|
-
const [isFocused, setIsFocused] =
|
|
8511
|
-
const [isEmpty, setIsEmpty] =
|
|
8512
|
-
const [activeFormats, setActiveFormats] =
|
|
8513
|
-
const [slashOpen, setSlashOpen] =
|
|
8514
|
-
const [slashFilter, setSlashFilter] =
|
|
8515
|
-
const [slashIdx, setSlashIdx] =
|
|
8516
|
-
const [slashPos, setSlashPos] =
|
|
8517
|
-
const slashStartRangeRef =
|
|
8518
|
-
const [linkOpen, setLinkOpen] =
|
|
8519
|
-
const [linkValue, setLinkValue] =
|
|
8520
|
-
const [linkPos, setLinkPos] =
|
|
8521
|
-
const lastEmittedRef =
|
|
8522
|
-
|
|
8544
|
+
const editorRef = React23.useRef(null);
|
|
8545
|
+
const lastRangeRef = React23.useRef(null);
|
|
8546
|
+
const composingRef = React23.useRef(false);
|
|
8547
|
+
const [isFocused, setIsFocused] = React23.useState(false);
|
|
8548
|
+
const [isEmpty, setIsEmpty] = React23.useState(!value);
|
|
8549
|
+
const [activeFormats, setActiveFormats] = React23.useState(/* @__PURE__ */ new Set());
|
|
8550
|
+
const [slashOpen, setSlashOpen] = React23.useState(false);
|
|
8551
|
+
const [slashFilter, setSlashFilter] = React23.useState("");
|
|
8552
|
+
const [slashIdx, setSlashIdx] = React23.useState(0);
|
|
8553
|
+
const [slashPos, setSlashPos] = React23.useState({ top: 0, left: 0 });
|
|
8554
|
+
const slashStartRangeRef = React23.useRef(null);
|
|
8555
|
+
const [linkOpen, setLinkOpen] = React23.useState(false);
|
|
8556
|
+
const [linkValue, setLinkValue] = React23.useState("");
|
|
8557
|
+
const [linkPos, setLinkPos] = React23.useState({ top: 0, left: 0 });
|
|
8558
|
+
const lastEmittedRef = React23.useRef(null);
|
|
8559
|
+
React23.useEffect(() => {
|
|
8523
8560
|
const el = editorRef.current;
|
|
8524
8561
|
if (!el) return;
|
|
8525
8562
|
if (value === lastEmittedRef.current) return;
|
|
@@ -8601,10 +8638,10 @@ var Editor = (props) => {
|
|
|
8601
8638
|
const current = String(document.queryCommandValue("formatBlock") || "").toLowerCase();
|
|
8602
8639
|
setBlock(current === tag ? "p" : tag);
|
|
8603
8640
|
};
|
|
8604
|
-
const historyRef =
|
|
8605
|
-
const historyIdxRef =
|
|
8606
|
-
const lastPushAtRef =
|
|
8607
|
-
const isRestoringRef =
|
|
8641
|
+
const historyRef = React23.useRef([]);
|
|
8642
|
+
const historyIdxRef = React23.useRef(-1);
|
|
8643
|
+
const lastPushAtRef = React23.useRef(0);
|
|
8644
|
+
const isRestoringRef = React23.useRef(false);
|
|
8608
8645
|
const caretOffset = (rootEl) => {
|
|
8609
8646
|
const el = rootEl ?? editorRef.current;
|
|
8610
8647
|
const sel = window.getSelection();
|
|
@@ -8681,8 +8718,8 @@ var Editor = (props) => {
|
|
|
8681
8718
|
const cls = Array.from(pre.classList).find((c) => c.startsWith("lang-"));
|
|
8682
8719
|
return cls?.slice(5) ?? "plain";
|
|
8683
8720
|
};
|
|
8684
|
-
const [codeLang, setCodeLang] =
|
|
8685
|
-
const highlightRafRef =
|
|
8721
|
+
const [codeLang, setCodeLang] = React23.useState("plain");
|
|
8722
|
+
const highlightRafRef = React23.useRef(0);
|
|
8686
8723
|
const rehighlight = (pre) => {
|
|
8687
8724
|
if (composingRef.current) return;
|
|
8688
8725
|
const code = pre.querySelector("code");
|
|
@@ -9027,7 +9064,7 @@ var Editor = (props) => {
|
|
|
9027
9064
|
setSlashIdx(0);
|
|
9028
9065
|
slashStartRangeRef.current = null;
|
|
9029
9066
|
};
|
|
9030
|
-
const filteredSlashItems =
|
|
9067
|
+
const filteredSlashItems = React23.useMemo(() => {
|
|
9031
9068
|
if (!slashFilter) return SLASH_ITEMS;
|
|
9032
9069
|
const f = slashFilter.toLowerCase();
|
|
9033
9070
|
return SLASH_ITEMS.filter((it) => it.label.toLowerCase().includes(f) || it.key.includes(f));
|
|
@@ -9292,7 +9329,7 @@ var Editor = (props) => {
|
|
|
9292
9329
|
}
|
|
9293
9330
|
}
|
|
9294
9331
|
};
|
|
9295
|
-
const plainPasteRef =
|
|
9332
|
+
const plainPasteRef = React23.useRef(false);
|
|
9296
9333
|
const handlePaste = (e) => {
|
|
9297
9334
|
if (readOnly) return;
|
|
9298
9335
|
e.preventDefault();
|
|
@@ -9593,7 +9630,7 @@ var EditorToolbar = ({
|
|
|
9593
9630
|
] });
|
|
9594
9631
|
};
|
|
9595
9632
|
var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
9596
|
-
|
|
9633
|
+
React23.useEffect(() => {
|
|
9597
9634
|
const handleClickOutside = (e) => {
|
|
9598
9635
|
const target = e.target;
|
|
9599
9636
|
const menu = document.querySelector(".lib-xplat-editor__slash-menu");
|
|
@@ -9627,8 +9664,8 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
9627
9664
|
);
|
|
9628
9665
|
};
|
|
9629
9666
|
var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
9630
|
-
const inputRef =
|
|
9631
|
-
|
|
9667
|
+
const inputRef = React23.useRef(null);
|
|
9668
|
+
React23.useEffect(() => {
|
|
9632
9669
|
inputRef.current?.focus();
|
|
9633
9670
|
}, []);
|
|
9634
9671
|
return /* @__PURE__ */ jsxs207(
|
|
@@ -9686,7 +9723,7 @@ EmptyState.displayName = "EmptyState";
|
|
|
9686
9723
|
var EmptyState_default = EmptyState;
|
|
9687
9724
|
|
|
9688
9725
|
// src/components/FileUpload/FileUpload.tsx
|
|
9689
|
-
import
|
|
9726
|
+
import React24 from "react";
|
|
9690
9727
|
import { jsx as jsx325, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
9691
9728
|
var FileUpload = (props) => {
|
|
9692
9729
|
const {
|
|
@@ -9700,9 +9737,9 @@ var FileUpload = (props) => {
|
|
|
9700
9737
|
label,
|
|
9701
9738
|
required
|
|
9702
9739
|
} = props;
|
|
9703
|
-
const fieldId =
|
|
9704
|
-
const [isDragOver, setIsDragOver] =
|
|
9705
|
-
const inputRef =
|
|
9740
|
+
const fieldId = React24.useId();
|
|
9741
|
+
const [isDragOver, setIsDragOver] = React24.useState(false);
|
|
9742
|
+
const inputRef = React24.useRef(null);
|
|
9706
9743
|
const handleFiles = (fileList) => {
|
|
9707
9744
|
let files = Array.from(fileList);
|
|
9708
9745
|
if (maxSize) {
|
|
@@ -9765,10 +9802,10 @@ FileUpload.displayName = "FileUpload";
|
|
|
9765
9802
|
var FileUpload_default = FileUpload;
|
|
9766
9803
|
|
|
9767
9804
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
9768
|
-
import
|
|
9805
|
+
import React26 from "react";
|
|
9769
9806
|
|
|
9770
9807
|
// src/components/HtmlTypeWriter/utils.ts
|
|
9771
|
-
import
|
|
9808
|
+
import React25 from "react";
|
|
9772
9809
|
var voidTags = /* @__PURE__ */ new Set([
|
|
9773
9810
|
"br",
|
|
9774
9811
|
"img",
|
|
@@ -9836,15 +9873,15 @@ var convertNodeToReactWithRange = (node, typedLen, rangeMap) => {
|
|
|
9836
9873
|
props[attr.name] = attr.value;
|
|
9837
9874
|
});
|
|
9838
9875
|
if (voidTags.has(tag)) {
|
|
9839
|
-
return
|
|
9876
|
+
return React25.createElement(tag, props);
|
|
9840
9877
|
}
|
|
9841
9878
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
9842
|
-
return
|
|
9879
|
+
return React25.createElement(tag, props, ...children);
|
|
9843
9880
|
};
|
|
9844
9881
|
var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
9845
9882
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
9846
9883
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
9847
|
-
return node == null ? null :
|
|
9884
|
+
return node == null ? null : React25.createElement(React25.Fragment, { key: idx }, node);
|
|
9848
9885
|
}).filter(Boolean);
|
|
9849
9886
|
return nodes.length === 0 ? null : nodes;
|
|
9850
9887
|
};
|
|
@@ -9857,20 +9894,20 @@ var HtmlTypeWriter = ({
|
|
|
9857
9894
|
onDone,
|
|
9858
9895
|
onChange
|
|
9859
9896
|
}) => {
|
|
9860
|
-
const [typedLen, setTypedLen] =
|
|
9861
|
-
const doneCalledRef =
|
|
9862
|
-
const { doc, rangeMap, totalLength } =
|
|
9897
|
+
const [typedLen, setTypedLen] = React26.useState(0);
|
|
9898
|
+
const doneCalledRef = React26.useRef(false);
|
|
9899
|
+
const { doc, rangeMap, totalLength } = React26.useMemo(() => {
|
|
9863
9900
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
9864
9901
|
const decoded = decodeHtmlEntities(html);
|
|
9865
9902
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
9866
9903
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
9867
9904
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
9868
9905
|
}, [html]);
|
|
9869
|
-
|
|
9906
|
+
React26.useEffect(() => {
|
|
9870
9907
|
setTypedLen(0);
|
|
9871
9908
|
doneCalledRef.current = false;
|
|
9872
9909
|
}, [html]);
|
|
9873
|
-
|
|
9910
|
+
React26.useEffect(() => {
|
|
9874
9911
|
if (!totalLength) return;
|
|
9875
9912
|
if (typedLen >= totalLength) return;
|
|
9876
9913
|
const timer = window.setInterval(() => {
|
|
@@ -9878,18 +9915,18 @@ var HtmlTypeWriter = ({
|
|
|
9878
9915
|
}, duration);
|
|
9879
9916
|
return () => window.clearInterval(timer);
|
|
9880
9917
|
}, [typedLen, totalLength, duration]);
|
|
9881
|
-
|
|
9918
|
+
React26.useEffect(() => {
|
|
9882
9919
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
9883
9920
|
onChange?.();
|
|
9884
9921
|
}
|
|
9885
9922
|
}, [typedLen, totalLength, onChange]);
|
|
9886
|
-
|
|
9923
|
+
React26.useEffect(() => {
|
|
9887
9924
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
9888
9925
|
doneCalledRef.current = true;
|
|
9889
9926
|
onDone?.();
|
|
9890
9927
|
}
|
|
9891
9928
|
}, [typedLen, totalLength, onDone]);
|
|
9892
|
-
const parsed =
|
|
9929
|
+
const parsed = React26.useMemo(
|
|
9893
9930
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
9894
9931
|
[doc, typedLen, rangeMap]
|
|
9895
9932
|
);
|
|
@@ -9899,13 +9936,13 @@ HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
|
9899
9936
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
9900
9937
|
|
|
9901
9938
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
9902
|
-
import
|
|
9939
|
+
import React27 from "react";
|
|
9903
9940
|
import { jsx as jsx327, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
9904
9941
|
var ImageSelector = (props) => {
|
|
9905
9942
|
const { value, placeholder, onChange, validations, label, required } = props;
|
|
9906
|
-
const fieldId =
|
|
9907
|
-
const [previewUrl, setPreviewUrl] =
|
|
9908
|
-
|
|
9943
|
+
const fieldId = React27.useId();
|
|
9944
|
+
const [previewUrl, setPreviewUrl] = React27.useState();
|
|
9945
|
+
React27.useEffect(() => {
|
|
9909
9946
|
if (!value) {
|
|
9910
9947
|
setPreviewUrl(void 0);
|
|
9911
9948
|
return;
|
|
@@ -9914,7 +9951,7 @@ var ImageSelector = (props) => {
|
|
|
9914
9951
|
setPreviewUrl(url);
|
|
9915
9952
|
return () => URL.revokeObjectURL(url);
|
|
9916
9953
|
}, [value]);
|
|
9917
|
-
const inputRef =
|
|
9954
|
+
const inputRef = React27.useRef(null);
|
|
9918
9955
|
const handleFileChange = (e) => {
|
|
9919
9956
|
const selectedFile = e.target.files?.[0];
|
|
9920
9957
|
if (selectedFile) {
|
|
@@ -10097,22 +10134,23 @@ Pagination.displayName = "Pagination";
|
|
|
10097
10134
|
var Pagination_default = Pagination;
|
|
10098
10135
|
|
|
10099
10136
|
// src/components/PopOver/PopOver.tsx
|
|
10100
|
-
import
|
|
10137
|
+
import React28 from "react";
|
|
10101
10138
|
import { jsx as jsx332, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
10102
10139
|
var PopOver = (props) => {
|
|
10103
10140
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
10104
|
-
const popRef =
|
|
10105
|
-
const triggerRef =
|
|
10106
|
-
const [localOpen, setLocalOpen] =
|
|
10107
|
-
const [eventTrigger, setEventTrigger] =
|
|
10141
|
+
const popRef = React28.useRef(null);
|
|
10142
|
+
const triggerRef = React28.useRef(null);
|
|
10143
|
+
const [localOpen, setLocalOpen] = React28.useState(false);
|
|
10144
|
+
const [eventTrigger, setEventTrigger] = React28.useState(false);
|
|
10108
10145
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
10109
10146
|
useCloseWhenFocusHidden(isOpen, triggerRef, popRef, onClose);
|
|
10110
10147
|
useEscapeKey(isOpen, () => {
|
|
10111
10148
|
onClose();
|
|
10112
10149
|
triggerRef.current?.focus({ preventScroll: true });
|
|
10113
10150
|
});
|
|
10151
|
+
const host = useOverlayHost_default(triggerRef, localOpen);
|
|
10114
10152
|
useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
10115
|
-
|
|
10153
|
+
React28.useEffect(() => {
|
|
10116
10154
|
if (isOpen) {
|
|
10117
10155
|
setLocalOpen(isOpen);
|
|
10118
10156
|
setTimeout(() => {
|
|
@@ -10135,7 +10173,7 @@ var PopOver = (props) => {
|
|
|
10135
10173
|
},
|
|
10136
10174
|
children: [
|
|
10137
10175
|
children,
|
|
10138
|
-
localOpen && /* @__PURE__ */ jsx332(Portal_default, { children: /* @__PURE__ */ jsx332(
|
|
10176
|
+
localOpen && /* @__PURE__ */ jsx332(Portal_default, { container: host, children: /* @__PURE__ */ jsx332(
|
|
10139
10177
|
"div",
|
|
10140
10178
|
{
|
|
10141
10179
|
className: clsx_default(
|
|
@@ -10193,12 +10231,12 @@ Progress.displayName = "Progress";
|
|
|
10193
10231
|
var Progress_default = Progress;
|
|
10194
10232
|
|
|
10195
10233
|
// src/components/Radio/RadioGroupContext.tsx
|
|
10196
|
-
import
|
|
10197
|
-
var RadioGroupContext =
|
|
10234
|
+
import React29 from "react";
|
|
10235
|
+
var RadioGroupContext = React29.createContext(
|
|
10198
10236
|
null
|
|
10199
10237
|
);
|
|
10200
10238
|
var useRadioGroupContext = () => {
|
|
10201
|
-
return
|
|
10239
|
+
return React29.useContext(RadioGroupContext);
|
|
10202
10240
|
};
|
|
10203
10241
|
var RadioGroupContext_default = RadioGroupContext;
|
|
10204
10242
|
|
|
@@ -10274,19 +10312,19 @@ RadioGroup.displayName = "RadioGroup";
|
|
|
10274
10312
|
var RadioGroup_default = RadioGroup;
|
|
10275
10313
|
|
|
10276
10314
|
// src/components/Select/Select.tsx
|
|
10277
|
-
import
|
|
10315
|
+
import React32 from "react";
|
|
10278
10316
|
|
|
10279
10317
|
// src/components/Select/context.ts
|
|
10280
|
-
import
|
|
10281
|
-
var SelectContext =
|
|
10318
|
+
import React30 from "react";
|
|
10319
|
+
var SelectContext = React30.createContext(null);
|
|
10282
10320
|
var context_default = SelectContext;
|
|
10283
10321
|
|
|
10284
10322
|
// src/components/Select/SelectItem.tsx
|
|
10285
|
-
import
|
|
10323
|
+
import React31 from "react";
|
|
10286
10324
|
import { jsx as jsx336 } from "react/jsx-runtime";
|
|
10287
10325
|
var SelectItem = (props) => {
|
|
10288
10326
|
const { children, value, onClick, disabled = false } = props;
|
|
10289
|
-
const ctx =
|
|
10327
|
+
const ctx = React31.useContext(context_default);
|
|
10290
10328
|
const handleClick = (e) => {
|
|
10291
10329
|
e.preventDefault();
|
|
10292
10330
|
e.stopPropagation();
|
|
@@ -10336,29 +10374,29 @@ var SelectRoot = (props) => {
|
|
|
10336
10374
|
required,
|
|
10337
10375
|
size = "md"
|
|
10338
10376
|
} = props;
|
|
10339
|
-
const fieldId =
|
|
10340
|
-
const itemChildren =
|
|
10341
|
-
(child) =>
|
|
10377
|
+
const fieldId = React32.useId();
|
|
10378
|
+
const itemChildren = React32.Children.toArray(children).filter(
|
|
10379
|
+
(child) => React32.isValidElement(child) && child.type === SelectItem_default
|
|
10342
10380
|
);
|
|
10343
10381
|
const isControlled = valueProp !== void 0;
|
|
10344
|
-
const [isOpen, setOpen] =
|
|
10345
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
10346
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
10347
|
-
const controlledLabel =
|
|
10382
|
+
const [isOpen, setOpen] = React32.useState(false);
|
|
10383
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React32.useState(null);
|
|
10384
|
+
const [uncontrolledValue, setUncontrolledValue] = React32.useState(void 0);
|
|
10385
|
+
const controlledLabel = React32.useMemo(() => {
|
|
10348
10386
|
if (!isControlled) return null;
|
|
10349
10387
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
10350
10388
|
return match ? match.props.children : null;
|
|
10351
10389
|
}, [isControlled, valueProp, itemChildren]);
|
|
10352
10390
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
10353
10391
|
const selectedValue = isControlled ? valueProp : uncontrolledValue;
|
|
10354
|
-
const triggerRef =
|
|
10355
|
-
const contentRef =
|
|
10356
|
-
const [mounted, setMounted] =
|
|
10357
|
-
const [visible, setVisible] =
|
|
10358
|
-
|
|
10392
|
+
const triggerRef = React32.useRef(null);
|
|
10393
|
+
const contentRef = React32.useRef(null);
|
|
10394
|
+
const [mounted, setMounted] = React32.useState(false);
|
|
10395
|
+
const [visible, setVisible] = React32.useState(false);
|
|
10396
|
+
React32.useEffect(() => {
|
|
10359
10397
|
if (disabled && isOpen) setOpen(false);
|
|
10360
10398
|
}, [disabled, isOpen]);
|
|
10361
|
-
|
|
10399
|
+
React32.useEffect(() => {
|
|
10362
10400
|
if (isOpen) {
|
|
10363
10401
|
setMounted(true);
|
|
10364
10402
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -10368,33 +10406,34 @@ var SelectRoot = (props) => {
|
|
|
10368
10406
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
10369
10407
|
return () => clearTimeout(t);
|
|
10370
10408
|
}, [isOpen]);
|
|
10371
|
-
const [query, setQuery] =
|
|
10409
|
+
const [query, setQuery] = React32.useState("");
|
|
10372
10410
|
const textOf = (node) => {
|
|
10373
10411
|
if (node === null || node === void 0 || typeof node === "boolean") return "";
|
|
10374
10412
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
10375
10413
|
if (Array.isArray(node)) return node.map(textOf).join("");
|
|
10376
|
-
if (
|
|
10414
|
+
if (React32.isValidElement(node)) return textOf(node.props.children);
|
|
10377
10415
|
return "";
|
|
10378
10416
|
};
|
|
10379
|
-
const visibleItems =
|
|
10417
|
+
const visibleItems = React32.useMemo(() => {
|
|
10380
10418
|
if (!searchable || !query.trim()) return itemChildren;
|
|
10381
10419
|
const q = query.trim().toLowerCase();
|
|
10382
10420
|
return itemChildren.filter((c) => textOf(c.props.children).toLowerCase().includes(q));
|
|
10383
10421
|
}, [searchable, query, itemChildren]);
|
|
10384
|
-
const open =
|
|
10385
|
-
const close =
|
|
10422
|
+
const open = React32.useCallback(() => setOpen(true), []);
|
|
10423
|
+
const close = React32.useCallback(() => {
|
|
10386
10424
|
setOpen(false);
|
|
10387
10425
|
setQuery("");
|
|
10388
10426
|
}, []);
|
|
10389
|
-
const toggle =
|
|
10427
|
+
const toggle = React32.useCallback(() => setOpen((prev) => !prev), []);
|
|
10390
10428
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
10391
10429
|
useCloseWhenFocusHidden(isOpen, triggerRef, contentRef, close);
|
|
10392
10430
|
useEscapeKey(isOpen, () => {
|
|
10393
10431
|
close();
|
|
10394
10432
|
triggerRef.current?.focus({ preventScroll: true });
|
|
10395
10433
|
});
|
|
10434
|
+
const host = useOverlayHost_default(triggerRef, mounted);
|
|
10396
10435
|
useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
10397
|
-
const setSelected =
|
|
10436
|
+
const setSelected = React32.useCallback(
|
|
10398
10437
|
(label2, itemValue) => {
|
|
10399
10438
|
if (!isControlled) {
|
|
10400
10439
|
setUncontrolledLabel(label2);
|
|
@@ -10404,7 +10443,7 @@ var SelectRoot = (props) => {
|
|
|
10404
10443
|
},
|
|
10405
10444
|
[isControlled, onChange]
|
|
10406
10445
|
);
|
|
10407
|
-
const ctxValue =
|
|
10446
|
+
const ctxValue = React32.useMemo(
|
|
10408
10447
|
() => ({
|
|
10409
10448
|
isOpen,
|
|
10410
10449
|
mounted,
|
|
@@ -10483,7 +10522,7 @@ var SelectRoot = (props) => {
|
|
|
10483
10522
|
]
|
|
10484
10523
|
}
|
|
10485
10524
|
),
|
|
10486
|
-
mounted && /* @__PURE__ */ jsx337(Portal_default, { children: /* @__PURE__ */ jsxs216(
|
|
10525
|
+
mounted && /* @__PURE__ */ jsx337(Portal_default, { container: host, children: /* @__PURE__ */ jsxs216(
|
|
10487
10526
|
"div",
|
|
10488
10527
|
{
|
|
10489
10528
|
className: clsx_default("lib-xplat-select-content", size, stateClass),
|
|
@@ -10649,7 +10688,7 @@ Steps.displayName = "Steps";
|
|
|
10649
10688
|
var Steps_default = Steps;
|
|
10650
10689
|
|
|
10651
10690
|
// src/components/Swiper/Swiper.tsx
|
|
10652
|
-
import
|
|
10691
|
+
import React33 from "react";
|
|
10653
10692
|
import { jsx as jsx342, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
10654
10693
|
var Swiper = (props) => {
|
|
10655
10694
|
const {
|
|
@@ -10674,26 +10713,26 @@ var Swiper = (props) => {
|
|
|
10674
10713
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
10675
10714
|
const useLoop = loop && canSlide;
|
|
10676
10715
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
10677
|
-
const extendedItems =
|
|
10716
|
+
const extendedItems = React33.useMemo(() => {
|
|
10678
10717
|
if (!useLoop) return items;
|
|
10679
10718
|
return [...items, ...items, ...items];
|
|
10680
10719
|
}, [items, useLoop]);
|
|
10681
10720
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
10682
|
-
const [innerIndex, setInnerIndex] =
|
|
10721
|
+
const [innerIndex, setInnerIndex] = React33.useState(
|
|
10683
10722
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
10684
10723
|
);
|
|
10685
|
-
const [isDragging, setIsDragging] =
|
|
10686
|
-
const [dragOffset, setDragOffset] =
|
|
10687
|
-
const [animated, setAnimated] =
|
|
10688
|
-
const [containerWidth, setContainerWidth] =
|
|
10689
|
-
const containerRef =
|
|
10690
|
-
const startXRef =
|
|
10691
|
-
const startTimeRef =
|
|
10692
|
-
const autoplayTimerRef =
|
|
10693
|
-
const resumeTimeoutRef =
|
|
10694
|
-
const [paused, setPaused] =
|
|
10695
|
-
const initializedRef =
|
|
10696
|
-
|
|
10724
|
+
const [isDragging, setIsDragging] = React33.useState(false);
|
|
10725
|
+
const [dragOffset, setDragOffset] = React33.useState(0);
|
|
10726
|
+
const [animated, setAnimated] = React33.useState(false);
|
|
10727
|
+
const [containerWidth, setContainerWidth] = React33.useState(0);
|
|
10728
|
+
const containerRef = React33.useRef(null);
|
|
10729
|
+
const startXRef = React33.useRef(0);
|
|
10730
|
+
const startTimeRef = React33.useRef(0);
|
|
10731
|
+
const autoplayTimerRef = React33.useRef(null);
|
|
10732
|
+
const resumeTimeoutRef = React33.useRef(null);
|
|
10733
|
+
const [paused, setPaused] = React33.useState(false);
|
|
10734
|
+
const initializedRef = React33.useRef(false);
|
|
10735
|
+
React33.useEffect(() => {
|
|
10697
10736
|
const el = containerRef.current;
|
|
10698
10737
|
if (!el) return;
|
|
10699
10738
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -10716,7 +10755,7 @@ var Swiper = (props) => {
|
|
|
10716
10755
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
10717
10756
|
};
|
|
10718
10757
|
const realIndex = getRealIndex(innerIndex);
|
|
10719
|
-
const moveToInner =
|
|
10758
|
+
const moveToInner = React33.useCallback(
|
|
10720
10759
|
(idx, withAnim = true) => {
|
|
10721
10760
|
if (!useLoop) {
|
|
10722
10761
|
setAnimated(withAnim);
|
|
@@ -10744,7 +10783,7 @@ var Swiper = (props) => {
|
|
|
10744
10783
|
},
|
|
10745
10784
|
[useLoop, cloneCount, totalSlides]
|
|
10746
10785
|
);
|
|
10747
|
-
const handleTransitionEnd =
|
|
10786
|
+
const handleTransitionEnd = React33.useCallback(() => {
|
|
10748
10787
|
if (!useLoop) return;
|
|
10749
10788
|
const real = getRealIndex(innerIndex);
|
|
10750
10789
|
const canonical = cloneCount + real;
|
|
@@ -10754,7 +10793,7 @@ var Swiper = (props) => {
|
|
|
10754
10793
|
}
|
|
10755
10794
|
onChange?.(Math.min(real, maxIndex));
|
|
10756
10795
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
10757
|
-
const slideTo =
|
|
10796
|
+
const slideTo = React33.useCallback(
|
|
10758
10797
|
(logicalIndex) => {
|
|
10759
10798
|
if (!canSlide) return;
|
|
10760
10799
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -10764,7 +10803,7 @@ var Swiper = (props) => {
|
|
|
10764
10803
|
},
|
|
10765
10804
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
10766
10805
|
);
|
|
10767
|
-
const slideNext =
|
|
10806
|
+
const slideNext = React33.useCallback(() => {
|
|
10768
10807
|
if (!canSlide) return;
|
|
10769
10808
|
const nextInner = innerIndex + slideBy;
|
|
10770
10809
|
if (useLoop) {
|
|
@@ -10773,7 +10812,7 @@ var Swiper = (props) => {
|
|
|
10773
10812
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
10774
10813
|
}
|
|
10775
10814
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
10776
|
-
const slidePrev =
|
|
10815
|
+
const slidePrev = React33.useCallback(() => {
|
|
10777
10816
|
if (!canSlide) return;
|
|
10778
10817
|
const prevInner = innerIndex - slideBy;
|
|
10779
10818
|
if (useLoop) {
|
|
@@ -10782,7 +10821,7 @@ var Swiper = (props) => {
|
|
|
10782
10821
|
moveToInner(Math.max(prevInner, 0), true);
|
|
10783
10822
|
}
|
|
10784
10823
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
10785
|
-
|
|
10824
|
+
React33.useEffect(() => {
|
|
10786
10825
|
if (indexProp === void 0) return;
|
|
10787
10826
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
10788
10827
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -10790,12 +10829,12 @@ var Swiper = (props) => {
|
|
|
10790
10829
|
moveToInner(target, true);
|
|
10791
10830
|
}
|
|
10792
10831
|
}, [indexProp]);
|
|
10793
|
-
|
|
10832
|
+
React33.useImperativeHandle(swiperRef, () => ({
|
|
10794
10833
|
slidePrev,
|
|
10795
10834
|
slideNext,
|
|
10796
10835
|
slideTo
|
|
10797
10836
|
}));
|
|
10798
|
-
|
|
10837
|
+
React33.useEffect(() => {
|
|
10799
10838
|
if (!auto || !canSlide || paused) return;
|
|
10800
10839
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
10801
10840
|
return () => {
|
|
@@ -10821,7 +10860,7 @@ var Swiper = (props) => {
|
|
|
10821
10860
|
resumeTimeoutRef.current = null;
|
|
10822
10861
|
}, pauseOnInteraction);
|
|
10823
10862
|
};
|
|
10824
|
-
|
|
10863
|
+
React33.useEffect(() => {
|
|
10825
10864
|
return () => {
|
|
10826
10865
|
if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
|
|
10827
10866
|
};
|
|
@@ -10839,7 +10878,7 @@ var Swiper = (props) => {
|
|
|
10839
10878
|
startXRef.current = getClientX(e);
|
|
10840
10879
|
startTimeRef.current = Date.now();
|
|
10841
10880
|
};
|
|
10842
|
-
|
|
10881
|
+
React33.useEffect(() => {
|
|
10843
10882
|
if (!isDragging) return;
|
|
10844
10883
|
const handleMove = (e) => {
|
|
10845
10884
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -10878,7 +10917,7 @@ var Swiper = (props) => {
|
|
|
10878
10917
|
}, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
|
|
10879
10918
|
const slideWidthPercent = 100 / viewItemCount;
|
|
10880
10919
|
const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
|
|
10881
|
-
const slideElements =
|
|
10920
|
+
const slideElements = React33.useMemo(
|
|
10882
10921
|
() => extendedItems.map((item, idx) => /* @__PURE__ */ jsx342(
|
|
10883
10922
|
"div",
|
|
10884
10923
|
{
|
|
@@ -10952,7 +10991,7 @@ Swiper.displayName = "Swiper";
|
|
|
10952
10991
|
var Swiper_default = Swiper;
|
|
10953
10992
|
|
|
10954
10993
|
// src/components/Switch/Switch.tsx
|
|
10955
|
-
import
|
|
10994
|
+
import React34 from "react";
|
|
10956
10995
|
import { jsx as jsx343 } from "react/jsx-runtime";
|
|
10957
10996
|
var KNOB_TRANSITION_MS = 250;
|
|
10958
10997
|
var Switch = (props) => {
|
|
@@ -10966,11 +11005,11 @@ var Switch = (props) => {
|
|
|
10966
11005
|
label,
|
|
10967
11006
|
required
|
|
10968
11007
|
} = props;
|
|
10969
|
-
const fieldId =
|
|
11008
|
+
const fieldId = React34.useId();
|
|
10970
11009
|
const statusType = normalizeStatus(type);
|
|
10971
|
-
const [isAnimating, setIsAnimating] =
|
|
10972
|
-
const timeoutRef =
|
|
10973
|
-
|
|
11010
|
+
const [isAnimating, setIsAnimating] = React34.useState(false);
|
|
11011
|
+
const timeoutRef = React34.useRef(null);
|
|
11012
|
+
React34.useEffect(() => {
|
|
10974
11013
|
return () => {
|
|
10975
11014
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
10976
11015
|
};
|
|
@@ -11009,10 +11048,10 @@ Switch.displayName = "Switch";
|
|
|
11009
11048
|
var Switch_default = Switch;
|
|
11010
11049
|
|
|
11011
11050
|
// src/components/Table/TableContext.tsx
|
|
11012
|
-
import
|
|
11013
|
-
var TableContext =
|
|
11051
|
+
import React35 from "react";
|
|
11052
|
+
var TableContext = React35.createContext(null);
|
|
11014
11053
|
var useTableContext = () => {
|
|
11015
|
-
const ctx =
|
|
11054
|
+
const ctx = React35.useContext(TableContext);
|
|
11016
11055
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
11017
11056
|
return ctx;
|
|
11018
11057
|
};
|
|
@@ -11055,24 +11094,24 @@ TableBody.displayName = "TableBody";
|
|
|
11055
11094
|
var TableBody_default = TableBody;
|
|
11056
11095
|
|
|
11057
11096
|
// src/components/Table/TableCell.tsx
|
|
11058
|
-
import
|
|
11097
|
+
import React38 from "react";
|
|
11059
11098
|
|
|
11060
11099
|
// src/components/Table/TableHeadContext.tsx
|
|
11061
|
-
import
|
|
11062
|
-
var TableHeadContext =
|
|
11100
|
+
import React36 from "react";
|
|
11101
|
+
var TableHeadContext = React36.createContext(
|
|
11063
11102
|
null
|
|
11064
11103
|
);
|
|
11065
11104
|
var useTableHeadContext = () => {
|
|
11066
|
-
const ctx =
|
|
11105
|
+
const ctx = React36.useContext(TableHeadContext);
|
|
11067
11106
|
return ctx;
|
|
11068
11107
|
};
|
|
11069
11108
|
var TableHeadContext_default = TableHeadContext;
|
|
11070
11109
|
|
|
11071
11110
|
// src/components/Table/TableRowContext.tsx
|
|
11072
|
-
import
|
|
11073
|
-
var TableRowContext =
|
|
11111
|
+
import React37 from "react";
|
|
11112
|
+
var TableRowContext = React37.createContext(null);
|
|
11074
11113
|
var useTableRowContext = () => {
|
|
11075
|
-
const ctx =
|
|
11114
|
+
const ctx = React37.useContext(TableRowContext);
|
|
11076
11115
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
11077
11116
|
return ctx;
|
|
11078
11117
|
};
|
|
@@ -11080,7 +11119,7 @@ var TableRowContext_default = TableRowContext;
|
|
|
11080
11119
|
|
|
11081
11120
|
// src/components/Table/TableCell.tsx
|
|
11082
11121
|
import { jsx as jsx346 } from "react/jsx-runtime";
|
|
11083
|
-
var TableCell =
|
|
11122
|
+
var TableCell = React38.memo((props) => {
|
|
11084
11123
|
const {
|
|
11085
11124
|
children,
|
|
11086
11125
|
align = "center",
|
|
@@ -11094,9 +11133,9 @@ var TableCell = React37.memo((props) => {
|
|
|
11094
11133
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
11095
11134
|
const { stickyShadow } = useTableContext();
|
|
11096
11135
|
const headContext = useTableHeadContext();
|
|
11097
|
-
const [left, setLeft] =
|
|
11098
|
-
const cellRef =
|
|
11099
|
-
const calculateLeft =
|
|
11136
|
+
const [left, setLeft] = React38.useState(0);
|
|
11137
|
+
const cellRef = React38.useRef(null);
|
|
11138
|
+
const calculateLeft = React38.useCallback(() => {
|
|
11100
11139
|
if (!cellRef.current) return 0;
|
|
11101
11140
|
let totalLeft = 0;
|
|
11102
11141
|
for (const ref of stickyCells) {
|
|
@@ -11105,7 +11144,7 @@ var TableCell = React37.memo((props) => {
|
|
|
11105
11144
|
}
|
|
11106
11145
|
return totalLeft;
|
|
11107
11146
|
}, [stickyCells]);
|
|
11108
|
-
|
|
11147
|
+
React38.useEffect(() => {
|
|
11109
11148
|
if (!isSticky || !cellRef.current) return;
|
|
11110
11149
|
registerStickyCell(cellRef);
|
|
11111
11150
|
setLeft(calculateLeft());
|
|
@@ -11163,9 +11202,9 @@ TableHead.displayName = "TableHead";
|
|
|
11163
11202
|
var TableHead_default = TableHead;
|
|
11164
11203
|
|
|
11165
11204
|
// src/components/Table/TableRow.tsx
|
|
11166
|
-
import
|
|
11205
|
+
import React39 from "react";
|
|
11167
11206
|
import { jsx as jsx348 } from "react/jsx-runtime";
|
|
11168
|
-
var TableRow =
|
|
11207
|
+
var TableRow = React39.memo((props) => {
|
|
11169
11208
|
const {
|
|
11170
11209
|
children,
|
|
11171
11210
|
type = "secondary",
|
|
@@ -11174,7 +11213,7 @@ var TableRow = React38.memo((props) => {
|
|
|
11174
11213
|
onClick
|
|
11175
11214
|
} = props;
|
|
11176
11215
|
const { rowBorderUse } = useTableContext();
|
|
11177
|
-
const [stickyCells, setStickyCells] =
|
|
11216
|
+
const [stickyCells, setStickyCells] = React39.useState([]);
|
|
11178
11217
|
const registerStickyCell = (ref) => {
|
|
11179
11218
|
setStickyCells((prev) => {
|
|
11180
11219
|
if (prev.includes(ref)) return prev;
|
|
@@ -11238,9 +11277,9 @@ Tag.displayName = "Tag";
|
|
|
11238
11277
|
var Tag_default = Tag;
|
|
11239
11278
|
|
|
11240
11279
|
// src/components/TextArea/TextArea.tsx
|
|
11241
|
-
import
|
|
11280
|
+
import React40 from "react";
|
|
11242
11281
|
import { jsx as jsx350 } from "react/jsx-runtime";
|
|
11243
|
-
var TextArea =
|
|
11282
|
+
var TextArea = React40.forwardRef(
|
|
11244
11283
|
(props, ref) => {
|
|
11245
11284
|
const {
|
|
11246
11285
|
className,
|
|
@@ -11253,7 +11292,7 @@ var TextArea = React39.forwardRef(
|
|
|
11253
11292
|
disabled,
|
|
11254
11293
|
...textareaProps
|
|
11255
11294
|
} = props;
|
|
11256
|
-
const autoId =
|
|
11295
|
+
const autoId = React40.useId();
|
|
11257
11296
|
const fieldId = props.id ?? autoId;
|
|
11258
11297
|
const control = /* @__PURE__ */ jsx350("div", { className: clsx_default("lib-xplat-textarea-wrap", className), children: /* @__PURE__ */ jsx350(
|
|
11259
11298
|
"textarea",
|
|
@@ -11275,7 +11314,7 @@ TextArea.displayName = "TextArea";
|
|
|
11275
11314
|
var TextArea_default = TextArea;
|
|
11276
11315
|
|
|
11277
11316
|
// src/components/TimePicker/TimePicker.tsx
|
|
11278
|
-
import
|
|
11317
|
+
import React41 from "react";
|
|
11279
11318
|
import { jsx as jsx351, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
11280
11319
|
var ANIMATION_DURATION_MS4 = 200;
|
|
11281
11320
|
var toMinutes = (hhmm) => {
|
|
@@ -11313,13 +11352,13 @@ var TimePicker = (props) => {
|
|
|
11313
11352
|
required,
|
|
11314
11353
|
validations
|
|
11315
11354
|
} = props;
|
|
11316
|
-
const fieldId =
|
|
11317
|
-
const triggerRef =
|
|
11318
|
-
const contentRef =
|
|
11319
|
-
const [isOpen, setOpen] =
|
|
11320
|
-
const [mounted, setMounted] =
|
|
11321
|
-
const [visible, setVisible] =
|
|
11322
|
-
const options =
|
|
11355
|
+
const fieldId = React41.useId();
|
|
11356
|
+
const triggerRef = React41.useRef(null);
|
|
11357
|
+
const contentRef = React41.useRef(null);
|
|
11358
|
+
const [isOpen, setOpen] = React41.useState(false);
|
|
11359
|
+
const [mounted, setMounted] = React41.useState(false);
|
|
11360
|
+
const [visible, setVisible] = React41.useState(false);
|
|
11361
|
+
const options = React41.useMemo(() => {
|
|
11323
11362
|
const safeStep = step > 0 && step <= 720 ? step : 30;
|
|
11324
11363
|
const lo = toMinutes(min) ?? 0;
|
|
11325
11364
|
const hi = toMinutes(max) ?? 24 * 60 - 1;
|
|
@@ -11327,18 +11366,19 @@ var TimePicker = (props) => {
|
|
|
11327
11366
|
for (let t = lo; t <= hi; t += safeStep) out.push(toHHmm(t));
|
|
11328
11367
|
return out;
|
|
11329
11368
|
}, [step, min, max]);
|
|
11330
|
-
const close =
|
|
11369
|
+
const close = React41.useCallback(() => setOpen(false), []);
|
|
11331
11370
|
useClickOutside_default([triggerRef, contentRef], close, isOpen);
|
|
11332
11371
|
useCloseWhenFocusHidden(isOpen, triggerRef, contentRef, close);
|
|
11333
11372
|
useEscapeKey(isOpen, () => {
|
|
11334
11373
|
close();
|
|
11335
11374
|
triggerRef.current?.focus({ preventScroll: true });
|
|
11336
11375
|
});
|
|
11376
|
+
const host = useOverlayHost_default(triggerRef, mounted);
|
|
11337
11377
|
useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
11338
|
-
|
|
11378
|
+
React41.useEffect(() => {
|
|
11339
11379
|
if (disabled && isOpen) setOpen(false);
|
|
11340
11380
|
}, [disabled, isOpen]);
|
|
11341
|
-
|
|
11381
|
+
React41.useEffect(() => {
|
|
11342
11382
|
if (isOpen) {
|
|
11343
11383
|
setMounted(true);
|
|
11344
11384
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -11376,7 +11416,7 @@ var TimePicker = (props) => {
|
|
|
11376
11416
|
children: /* @__PURE__ */ jsx351("span", { className: clsx_default("time-picker-value", !value && "placeholder"), children: value ? display(value, use12Hours) : placeholder })
|
|
11377
11417
|
}
|
|
11378
11418
|
),
|
|
11379
|
-
mounted && /* @__PURE__ */ jsx351(Portal_default, { children: /* @__PURE__ */ jsx351(
|
|
11419
|
+
mounted && /* @__PURE__ */ jsx351(Portal_default, { container: host, children: /* @__PURE__ */ jsx351(
|
|
11380
11420
|
"div",
|
|
11381
11421
|
{
|
|
11382
11422
|
ref: contentRef,
|
|
@@ -11410,20 +11450,20 @@ TimePicker.displayName = "TimePicker";
|
|
|
11410
11450
|
var TimePicker_default = TimePicker;
|
|
11411
11451
|
|
|
11412
11452
|
// src/components/Toast/Toast.tsx
|
|
11413
|
-
import
|
|
11453
|
+
import React42 from "react";
|
|
11414
11454
|
import { createPortal as createPortal3 } from "react-dom";
|
|
11415
11455
|
import { jsx as jsx352, jsxs as jsxs223 } from "react/jsx-runtime";
|
|
11416
|
-
var ToastContext =
|
|
11456
|
+
var ToastContext = React42.createContext(null);
|
|
11417
11457
|
var useToast = () => {
|
|
11418
|
-
const ctx =
|
|
11458
|
+
const ctx = React42.useContext(ToastContext);
|
|
11419
11459
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
11420
11460
|
return ctx;
|
|
11421
11461
|
};
|
|
11422
11462
|
var EXIT_DURATION = 300;
|
|
11423
11463
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
11424
|
-
const ref =
|
|
11425
|
-
const [height, setHeight] =
|
|
11426
|
-
|
|
11464
|
+
const ref = React42.useRef(null);
|
|
11465
|
+
const [height, setHeight] = React42.useState(void 0);
|
|
11466
|
+
React42.useEffect(() => {
|
|
11427
11467
|
if (ref.current && !isExiting) {
|
|
11428
11468
|
setHeight(ref.current.offsetHeight);
|
|
11429
11469
|
}
|
|
@@ -11455,13 +11495,13 @@ var ToastProvider = ({
|
|
|
11455
11495
|
children,
|
|
11456
11496
|
position = "top-right"
|
|
11457
11497
|
}) => {
|
|
11458
|
-
const [toasts, setToasts] =
|
|
11459
|
-
const [removing, setRemoving] =
|
|
11460
|
-
const [mounted, setMounted] =
|
|
11461
|
-
|
|
11498
|
+
const [toasts, setToasts] = React42.useState([]);
|
|
11499
|
+
const [removing, setRemoving] = React42.useState(/* @__PURE__ */ new Set());
|
|
11500
|
+
const [mounted, setMounted] = React42.useState(false);
|
|
11501
|
+
React42.useEffect(() => {
|
|
11462
11502
|
setMounted(true);
|
|
11463
11503
|
}, []);
|
|
11464
|
-
const remove =
|
|
11504
|
+
const remove = React42.useCallback((id) => {
|
|
11465
11505
|
setRemoving((prev) => new Set(prev).add(id));
|
|
11466
11506
|
setTimeout(() => {
|
|
11467
11507
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -11472,7 +11512,7 @@ var ToastProvider = ({
|
|
|
11472
11512
|
});
|
|
11473
11513
|
}, EXIT_DURATION);
|
|
11474
11514
|
}, []);
|
|
11475
|
-
const toast =
|
|
11515
|
+
const toast = React42.useCallback(
|
|
11476
11516
|
(type, message, duration = 3e3) => {
|
|
11477
11517
|
const id = `${Date.now()}-${Math.random()}`;
|
|
11478
11518
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -11525,7 +11565,7 @@ ToggleChip.displayName = "ToggleChip";
|
|
|
11525
11565
|
var ToggleChip_default = ToggleChip;
|
|
11526
11566
|
|
|
11527
11567
|
// src/components/Tooltip/Tooltip.tsx
|
|
11528
|
-
import
|
|
11568
|
+
import React43 from "react";
|
|
11529
11569
|
import { Fragment as Fragment6, jsx as jsx354, jsxs as jsxs224 } from "react/jsx-runtime";
|
|
11530
11570
|
var OFFSET = 12;
|
|
11531
11571
|
var GAP = 8;
|
|
@@ -11541,14 +11581,14 @@ var Tooltip = (props) => {
|
|
|
11541
11581
|
disabled = false
|
|
11542
11582
|
} = props;
|
|
11543
11583
|
const shape = variant ?? type ?? "dark";
|
|
11544
|
-
const triggerRef =
|
|
11545
|
-
const tooltipRef =
|
|
11546
|
-
const [visible, setVisible] =
|
|
11547
|
-
const [pos, setPos] =
|
|
11548
|
-
const delayTimer =
|
|
11549
|
-
const rafRef =
|
|
11550
|
-
const cursor =
|
|
11551
|
-
const clamp =
|
|
11584
|
+
const triggerRef = React43.useRef(null);
|
|
11585
|
+
const tooltipRef = React43.useRef(null);
|
|
11586
|
+
const [visible, setVisible] = React43.useState(false);
|
|
11587
|
+
const [pos, setPos] = React43.useState({ left: 0, top: 0 });
|
|
11588
|
+
const delayTimer = React43.useRef(0);
|
|
11589
|
+
const rafRef = React43.useRef(0);
|
|
11590
|
+
const cursor = React43.useRef(null);
|
|
11591
|
+
const clamp = React43.useCallback((left, top, w, h) => {
|
|
11552
11592
|
const vw = window.innerWidth;
|
|
11553
11593
|
const vh = window.innerHeight;
|
|
11554
11594
|
return {
|
|
@@ -11556,7 +11596,7 @@ var Tooltip = (props) => {
|
|
|
11556
11596
|
top: Math.min(Math.max(GAP, top), Math.max(GAP, vh - h - GAP))
|
|
11557
11597
|
};
|
|
11558
11598
|
}, []);
|
|
11559
|
-
const placeAtCursor =
|
|
11599
|
+
const placeAtCursor = React43.useCallback((x, y) => {
|
|
11560
11600
|
const el = tooltipRef.current;
|
|
11561
11601
|
if (!el) return;
|
|
11562
11602
|
const w = el.offsetWidth;
|
|
@@ -11567,7 +11607,7 @@ var Tooltip = (props) => {
|
|
|
11567
11607
|
if (top < GAP) top = y + OFFSET;
|
|
11568
11608
|
setPos(clamp(left, top, w, h));
|
|
11569
11609
|
}, [clamp]);
|
|
11570
|
-
const placeAtTrigger =
|
|
11610
|
+
const placeAtTrigger = React43.useCallback(() => {
|
|
11571
11611
|
const el = tooltipRef.current;
|
|
11572
11612
|
const trigger = triggerRef.current;
|
|
11573
11613
|
if (!el || !trigger) return;
|
|
@@ -11579,19 +11619,19 @@ var Tooltip = (props) => {
|
|
|
11579
11619
|
const left = rect.left + rect.width / 2 - w / 2;
|
|
11580
11620
|
setPos(clamp(left, top, w, h));
|
|
11581
11621
|
}, [clamp]);
|
|
11582
|
-
const reposition =
|
|
11622
|
+
const reposition = React43.useCallback(() => {
|
|
11583
11623
|
if (follow && cursor.current) {
|
|
11584
11624
|
placeAtCursor(cursor.current.x, cursor.current.y);
|
|
11585
11625
|
} else {
|
|
11586
11626
|
placeAtTrigger();
|
|
11587
11627
|
}
|
|
11588
11628
|
}, [follow, placeAtCursor, placeAtTrigger]);
|
|
11589
|
-
const handleMouseEnter =
|
|
11629
|
+
const handleMouseEnter = React43.useCallback((e) => {
|
|
11590
11630
|
if (disabled) return;
|
|
11591
11631
|
cursor.current = { x: e.clientX, y: e.clientY };
|
|
11592
11632
|
delayTimer.current = window.setTimeout(() => setVisible(true), SHOW_DELAY);
|
|
11593
11633
|
}, [disabled]);
|
|
11594
|
-
const handleMouseMove =
|
|
11634
|
+
const handleMouseMove = React43.useCallback((e) => {
|
|
11595
11635
|
cursor.current = { x: e.clientX, y: e.clientY };
|
|
11596
11636
|
if (!visible || !follow) return;
|
|
11597
11637
|
cancelAnimationFrame(rafRef.current);
|
|
@@ -11599,25 +11639,25 @@ var Tooltip = (props) => {
|
|
|
11599
11639
|
if (cursor.current) placeAtCursor(cursor.current.x, cursor.current.y);
|
|
11600
11640
|
});
|
|
11601
11641
|
}, [visible, follow, placeAtCursor]);
|
|
11602
|
-
const close =
|
|
11642
|
+
const close = React43.useCallback(() => {
|
|
11603
11643
|
window.clearTimeout(delayTimer.current);
|
|
11604
11644
|
cancelAnimationFrame(rafRef.current);
|
|
11605
11645
|
setVisible(false);
|
|
11606
11646
|
}, []);
|
|
11607
|
-
const handleMouseLeave =
|
|
11647
|
+
const handleMouseLeave = React43.useCallback(() => {
|
|
11608
11648
|
cursor.current = null;
|
|
11609
11649
|
close();
|
|
11610
11650
|
}, [close]);
|
|
11611
|
-
const handleFocus =
|
|
11651
|
+
const handleFocus = React43.useCallback(() => {
|
|
11612
11652
|
if (disabled) return;
|
|
11613
11653
|
cursor.current = null;
|
|
11614
11654
|
setVisible(true);
|
|
11615
11655
|
}, [disabled]);
|
|
11616
|
-
|
|
11656
|
+
React43.useLayoutEffect(() => {
|
|
11617
11657
|
if (!visible) return;
|
|
11618
11658
|
reposition();
|
|
11619
11659
|
}, [visible, reposition]);
|
|
11620
|
-
|
|
11660
|
+
React43.useEffect(() => {
|
|
11621
11661
|
if (!visible || follow) return;
|
|
11622
11662
|
const onChange = () => placeAtTrigger();
|
|
11623
11663
|
window.addEventListener("scroll", onChange, true);
|
|
@@ -11627,7 +11667,7 @@ var Tooltip = (props) => {
|
|
|
11627
11667
|
window.removeEventListener("resize", onChange);
|
|
11628
11668
|
};
|
|
11629
11669
|
}, [visible, follow, placeAtTrigger]);
|
|
11630
|
-
|
|
11670
|
+
React43.useEffect(() => () => {
|
|
11631
11671
|
window.clearTimeout(delayTimer.current);
|
|
11632
11672
|
cancelAnimationFrame(rafRef.current);
|
|
11633
11673
|
}, []);
|
|
@@ -11666,7 +11706,7 @@ Tooltip.displayName = "Tooltip";
|
|
|
11666
11706
|
var Tooltip_default = Tooltip;
|
|
11667
11707
|
|
|
11668
11708
|
// src/components/Video/Video.tsx
|
|
11669
|
-
import
|
|
11709
|
+
import React44 from "react";
|
|
11670
11710
|
import { jsx as jsx355, jsxs as jsxs225 } from "react/jsx-runtime";
|
|
11671
11711
|
var PipIcon = () => /* @__PURE__ */ jsxs225("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
11672
11712
|
/* @__PURE__ */ jsx355("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
|
|
@@ -11678,7 +11718,7 @@ var formatTime = (sec) => {
|
|
|
11678
11718
|
const s = Math.floor(sec % 60);
|
|
11679
11719
|
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
11680
11720
|
};
|
|
11681
|
-
var Video =
|
|
11721
|
+
var Video = React44.forwardRef((props, ref) => {
|
|
11682
11722
|
const {
|
|
11683
11723
|
src,
|
|
11684
11724
|
poster,
|
|
@@ -11702,21 +11742,21 @@ var Video = React43.forwardRef((props, ref) => {
|
|
|
11702
11742
|
children,
|
|
11703
11743
|
...rest
|
|
11704
11744
|
} = props;
|
|
11705
|
-
const containerRef =
|
|
11706
|
-
const videoRef =
|
|
11707
|
-
const [isPlaying, setIsPlaying] =
|
|
11708
|
-
const [isLoaded, setIsLoaded] =
|
|
11709
|
-
const [currentTime, setCurrentTime] =
|
|
11710
|
-
const [duration, setDuration] =
|
|
11711
|
-
const [buffered, setBuffered] =
|
|
11712
|
-
const [volume, setVolume] =
|
|
11713
|
-
const [isMuted, setIsMuted] =
|
|
11714
|
-
const [isFullscreen, setIsFullscreen] =
|
|
11715
|
-
const [playbackRate, setPlaybackRate] =
|
|
11716
|
-
const [rateMenuOpen, setRateMenuOpen] =
|
|
11717
|
-
const [captionsOn, setCaptionsOn] =
|
|
11718
|
-
const [isPip, setIsPip] =
|
|
11719
|
-
const setRefs =
|
|
11745
|
+
const containerRef = React44.useRef(null);
|
|
11746
|
+
const videoRef = React44.useRef(null);
|
|
11747
|
+
const [isPlaying, setIsPlaying] = React44.useState(Boolean(autoPlay));
|
|
11748
|
+
const [isLoaded, setIsLoaded] = React44.useState(false);
|
|
11749
|
+
const [currentTime, setCurrentTime] = React44.useState(0);
|
|
11750
|
+
const [duration, setDuration] = React44.useState(0);
|
|
11751
|
+
const [buffered, setBuffered] = React44.useState(0);
|
|
11752
|
+
const [volume, setVolume] = React44.useState(1);
|
|
11753
|
+
const [isMuted, setIsMuted] = React44.useState(Boolean(muted));
|
|
11754
|
+
const [isFullscreen, setIsFullscreen] = React44.useState(false);
|
|
11755
|
+
const [playbackRate, setPlaybackRate] = React44.useState(1);
|
|
11756
|
+
const [rateMenuOpen, setRateMenuOpen] = React44.useState(false);
|
|
11757
|
+
const [captionsOn, setCaptionsOn] = React44.useState(false);
|
|
11758
|
+
const [isPip, setIsPip] = React44.useState(false);
|
|
11759
|
+
const setRefs = React44.useCallback(
|
|
11720
11760
|
(el) => {
|
|
11721
11761
|
videoRef.current = el;
|
|
11722
11762
|
if (typeof ref === "function") ref(el);
|
|
@@ -11724,14 +11764,14 @@ var Video = React43.forwardRef((props, ref) => {
|
|
|
11724
11764
|
},
|
|
11725
11765
|
[ref]
|
|
11726
11766
|
);
|
|
11727
|
-
|
|
11767
|
+
React44.useEffect(() => {
|
|
11728
11768
|
const onFsChange = () => {
|
|
11729
11769
|
setIsFullscreen(document.fullscreenElement === containerRef.current);
|
|
11730
11770
|
};
|
|
11731
11771
|
document.addEventListener("fullscreenchange", onFsChange);
|
|
11732
11772
|
return () => document.removeEventListener("fullscreenchange", onFsChange);
|
|
11733
11773
|
}, []);
|
|
11734
|
-
|
|
11774
|
+
React44.useEffect(() => {
|
|
11735
11775
|
const v = videoRef.current;
|
|
11736
11776
|
if (!v) return;
|
|
11737
11777
|
const onEnter = () => setIsPip(true);
|
|
@@ -12120,13 +12160,13 @@ Layout.displayName = "Layout";
|
|
|
12120
12160
|
var Layout_default = Layout;
|
|
12121
12161
|
|
|
12122
12162
|
// src/layout/SideBar/SideBar.tsx
|
|
12123
|
-
import
|
|
12163
|
+
import React46 from "react";
|
|
12124
12164
|
|
|
12125
12165
|
// src/layout/SideBar/SideBarContext.tsx
|
|
12126
|
-
import
|
|
12127
|
-
var SideBarContext =
|
|
12166
|
+
import React45 from "react";
|
|
12167
|
+
var SideBarContext = React45.createContext(null);
|
|
12128
12168
|
var useSideBarContext = () => {
|
|
12129
|
-
const ctx =
|
|
12169
|
+
const ctx = React45.useContext(SideBarContext);
|
|
12130
12170
|
if (!ctx) throw new Error("Error");
|
|
12131
12171
|
return ctx;
|
|
12132
12172
|
};
|
|
@@ -12136,7 +12176,7 @@ var SideBarContext_default = SideBarContext;
|
|
|
12136
12176
|
import { jsx as jsx361 } from "react/jsx-runtime";
|
|
12137
12177
|
var SideBar = (props) => {
|
|
12138
12178
|
const { children, className } = props;
|
|
12139
|
-
const [isOpen, setIsOpen] =
|
|
12179
|
+
const [isOpen, setIsOpen] = React46.useState(true);
|
|
12140
12180
|
const handleSwitchSideBar = () => {
|
|
12141
12181
|
setIsOpen((prev) => !prev);
|
|
12142
12182
|
};
|