@x-plat/design-system 0.4.4 → 0.4.5
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/Card/index.css +1 -2
- package/dist/components/DatePicker/index.cjs +30 -5
- package/dist/components/DatePicker/index.css +43 -0
- package/dist/components/DatePicker/index.js +30 -5
- package/dist/components/PopOver/index.css +3 -0
- package/dist/components/index.cjs +166 -141
- package/dist/components/index.css +47 -2
- package/dist/components/index.js +166 -141
- package/dist/index.cjs +171 -146
- package/dist/index.css +73 -2
- package/dist/index.js +171 -146
- package/dist/layout/Header/index.css +11 -0
- package/dist/layout/Layout/index.css +15 -0
- package/dist/layout/index.css +26 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21098,7 +21098,7 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
21098
21098
|
var InputDatePicker_default = InputDatePicker;
|
|
21099
21099
|
|
|
21100
21100
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
21101
|
-
import
|
|
21101
|
+
import React13 from "react";
|
|
21102
21102
|
|
|
21103
21103
|
// src/components/Modal/Modal.tsx
|
|
21104
21104
|
import React11 from "react";
|
|
@@ -21147,6 +21147,7 @@ Modal.displayName = "Modal";
|
|
|
21147
21147
|
var Modal_default = Modal;
|
|
21148
21148
|
|
|
21149
21149
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
21150
|
+
import React12 from "react";
|
|
21150
21151
|
import { jsx as jsx315, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
21151
21152
|
var RangePicker = (props) => {
|
|
21152
21153
|
const {
|
|
@@ -21158,6 +21159,7 @@ var RangePicker = (props) => {
|
|
|
21158
21159
|
maxDate,
|
|
21159
21160
|
locale = "ko"
|
|
21160
21161
|
} = props;
|
|
21162
|
+
const [activeTab, setActiveTab] = React12.useState("start");
|
|
21161
21163
|
const startCal = useCalendar(startDate.getFullYear(), startDate.getMonth());
|
|
21162
21164
|
const endCal = useCalendar(endDate.getFullYear(), endDate.getMonth());
|
|
21163
21165
|
const isDisabled = (date, type) => {
|
|
@@ -21264,8 +21266,31 @@ var RangePicker = (props) => {
|
|
|
21264
21266
|
"--datepicker-active-color": `var(--${color2})`
|
|
21265
21267
|
},
|
|
21266
21268
|
children: [
|
|
21267
|
-
|
|
21268
|
-
|
|
21269
|
+
/* @__PURE__ */ jsxs201("div", { className: "datepicker-range-tabs", children: [
|
|
21270
|
+
/* @__PURE__ */ jsx315(
|
|
21271
|
+
"button",
|
|
21272
|
+
{
|
|
21273
|
+
type: "button",
|
|
21274
|
+
className: clsx_default("datepicker-range-tab", activeTab === "start" && "active"),
|
|
21275
|
+
onClick: () => setActiveTab("start"),
|
|
21276
|
+
children: locale === "ko" ? "\uC2DC\uC791\uC77C" : "Start"
|
|
21277
|
+
}
|
|
21278
|
+
),
|
|
21279
|
+
/* @__PURE__ */ jsx315(
|
|
21280
|
+
"button",
|
|
21281
|
+
{
|
|
21282
|
+
type: "button",
|
|
21283
|
+
className: clsx_default("datepicker-range-tab", activeTab === "end" && "active"),
|
|
21284
|
+
onClick: () => setActiveTab("end"),
|
|
21285
|
+
children: locale === "ko" ? "\uC885\uB8CC\uC77C" : "End"
|
|
21286
|
+
}
|
|
21287
|
+
)
|
|
21288
|
+
] }),
|
|
21289
|
+
/* @__PURE__ */ jsxs201("div", { className: "datepicker-range-panels", children: [
|
|
21290
|
+
renderCalendar(startCal, "start"),
|
|
21291
|
+
renderCalendar(endCal, "end")
|
|
21292
|
+
] }),
|
|
21293
|
+
/* @__PURE__ */ jsx315("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? renderCalendar(startCal, "start") : renderCalendar(endCal, "end") })
|
|
21269
21294
|
]
|
|
21270
21295
|
}
|
|
21271
21296
|
);
|
|
@@ -21277,7 +21302,7 @@ var RangePicker_default = RangePicker;
|
|
|
21277
21302
|
import { jsx as jsx316, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
21278
21303
|
var PopupPicker = (props) => {
|
|
21279
21304
|
const { component, type, locale } = props;
|
|
21280
|
-
const [isOpen, setIsOpen] =
|
|
21305
|
+
const [isOpen, setIsOpen] = React13.useState(false);
|
|
21281
21306
|
const handleClick = () => setIsOpen(true);
|
|
21282
21307
|
const handleClose = () => setIsOpen(false);
|
|
21283
21308
|
const handleSingleChange = (date) => {
|
|
@@ -21286,7 +21311,7 @@ var PopupPicker = (props) => {
|
|
|
21286
21311
|
handleClose();
|
|
21287
21312
|
};
|
|
21288
21313
|
return /* @__PURE__ */ jsxs202("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
21289
|
-
|
|
21314
|
+
React13.cloneElement(component, { onClick: handleClick }),
|
|
21290
21315
|
/* @__PURE__ */ jsx316(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
21291
21316
|
/* @__PURE__ */ jsxs202("div", { className: "popup-datepicker-content", children: [
|
|
21292
21317
|
type === "single" && /* @__PURE__ */ jsx316(
|
|
@@ -21346,15 +21371,15 @@ Divider.displayName = "Divider";
|
|
|
21346
21371
|
var Divider_default = Divider;
|
|
21347
21372
|
|
|
21348
21373
|
// src/components/Drawer/Drawer.tsx
|
|
21349
|
-
import
|
|
21374
|
+
import React14 from "react";
|
|
21350
21375
|
import { createPortal as createPortal2 } from "react-dom";
|
|
21351
21376
|
import { jsx as jsx318, jsxs as jsxs203 } from "react/jsx-runtime";
|
|
21352
21377
|
var ANIMATION_DURATION_MS2 = 250;
|
|
21353
21378
|
var Drawer = (props) => {
|
|
21354
21379
|
const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
|
|
21355
|
-
const [mounted, setMounted] =
|
|
21356
|
-
const [visible, setVisible] =
|
|
21357
|
-
|
|
21380
|
+
const [mounted, setMounted] = React14.useState(false);
|
|
21381
|
+
const [visible, setVisible] = React14.useState(false);
|
|
21382
|
+
React14.useEffect(() => {
|
|
21358
21383
|
if (isOpen) {
|
|
21359
21384
|
setMounted(true);
|
|
21360
21385
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -21400,16 +21425,16 @@ Drawer.displayName = "Drawer";
|
|
|
21400
21425
|
var Drawer_default = Drawer;
|
|
21401
21426
|
|
|
21402
21427
|
// src/components/Dropdown/Dropdown.tsx
|
|
21403
|
-
import
|
|
21428
|
+
import React16 from "react";
|
|
21404
21429
|
|
|
21405
21430
|
// src/tokens/hooks/useAutoPosition.ts
|
|
21406
|
-
import
|
|
21431
|
+
import React15 from "react";
|
|
21407
21432
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
21408
|
-
const [position, setPosition] =
|
|
21433
|
+
const [position, setPosition] = React15.useState({
|
|
21409
21434
|
position: {},
|
|
21410
21435
|
direction: "bottom"
|
|
21411
21436
|
});
|
|
21412
|
-
const calculatePosition =
|
|
21437
|
+
const calculatePosition = React15.useCallback(() => {
|
|
21413
21438
|
if (!triggerRef.current || !popRef.current) return;
|
|
21414
21439
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
21415
21440
|
const popRect = popRef.current.getBoundingClientRect();
|
|
@@ -21431,7 +21456,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
21431
21456
|
direction
|
|
21432
21457
|
});
|
|
21433
21458
|
}, [triggerRef, popRef]);
|
|
21434
|
-
|
|
21459
|
+
React15.useEffect(() => {
|
|
21435
21460
|
calculatePosition();
|
|
21436
21461
|
window.addEventListener("resize", calculatePosition);
|
|
21437
21462
|
return () => window.removeEventListener("resize", calculatePosition);
|
|
@@ -21444,14 +21469,14 @@ var useAutoPosition_default = useAutoPosition;
|
|
|
21444
21469
|
import { jsx as jsx319, jsxs as jsxs204 } from "react/jsx-runtime";
|
|
21445
21470
|
var Dropdown = (props) => {
|
|
21446
21471
|
const { items, children, className } = props;
|
|
21447
|
-
const [isOpen, setIsOpen] =
|
|
21448
|
-
const [mounted, setMounted] =
|
|
21449
|
-
const [visible, setVisible] =
|
|
21450
|
-
const triggerRef =
|
|
21451
|
-
const menuRef =
|
|
21472
|
+
const [isOpen, setIsOpen] = React16.useState(false);
|
|
21473
|
+
const [mounted, setMounted] = React16.useState(false);
|
|
21474
|
+
const [visible, setVisible] = React16.useState(false);
|
|
21475
|
+
const triggerRef = React16.useRef(null);
|
|
21476
|
+
const menuRef = React16.useRef(null);
|
|
21452
21477
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, isOpen);
|
|
21453
21478
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false));
|
|
21454
|
-
|
|
21479
|
+
React16.useEffect(() => {
|
|
21455
21480
|
if (isOpen) {
|
|
21456
21481
|
setMounted(true);
|
|
21457
21482
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -21520,7 +21545,7 @@ EmptyState.displayName = "EmptyState";
|
|
|
21520
21545
|
var EmptyState_default = EmptyState;
|
|
21521
21546
|
|
|
21522
21547
|
// src/components/FileUpload/FileUpload.tsx
|
|
21523
|
-
import
|
|
21548
|
+
import React17 from "react";
|
|
21524
21549
|
import { jsx as jsx321, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
21525
21550
|
var FileUpload = (props) => {
|
|
21526
21551
|
const {
|
|
@@ -21532,8 +21557,8 @@ var FileUpload = (props) => {
|
|
|
21532
21557
|
description,
|
|
21533
21558
|
className
|
|
21534
21559
|
} = props;
|
|
21535
|
-
const [isDragOver, setIsDragOver] =
|
|
21536
|
-
const inputRef =
|
|
21560
|
+
const [isDragOver, setIsDragOver] = React17.useState(false);
|
|
21561
|
+
const inputRef = React17.useRef(null);
|
|
21537
21562
|
const handleFiles = (fileList) => {
|
|
21538
21563
|
let files = Array.from(fileList);
|
|
21539
21564
|
if (maxSize) {
|
|
@@ -21593,19 +21618,19 @@ FileUpload.displayName = "FileUpload";
|
|
|
21593
21618
|
var FileUpload_default = FileUpload;
|
|
21594
21619
|
|
|
21595
21620
|
// src/components/Select/Select.tsx
|
|
21596
|
-
import
|
|
21621
|
+
import React20 from "react";
|
|
21597
21622
|
|
|
21598
21623
|
// src/components/Select/context.ts
|
|
21599
|
-
import
|
|
21600
|
-
var SelectContext =
|
|
21624
|
+
import React18 from "react";
|
|
21625
|
+
var SelectContext = React18.createContext(null);
|
|
21601
21626
|
var context_default = SelectContext;
|
|
21602
21627
|
|
|
21603
21628
|
// src/components/Select/SelectItem.tsx
|
|
21604
|
-
import
|
|
21629
|
+
import React19 from "react";
|
|
21605
21630
|
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
21606
21631
|
var SelectItem = (props) => {
|
|
21607
21632
|
const { children, value, onClick, disabled = false, className } = props;
|
|
21608
|
-
const ctx =
|
|
21633
|
+
const ctx = React19.useContext(context_default);
|
|
21609
21634
|
const handleClick = (e) => {
|
|
21610
21635
|
e.preventDefault();
|
|
21611
21636
|
e.stopPropagation();
|
|
@@ -21647,26 +21672,26 @@ var SelectRoot = (props) => {
|
|
|
21647
21672
|
error = false,
|
|
21648
21673
|
size = "md"
|
|
21649
21674
|
} = props;
|
|
21650
|
-
const itemChildren =
|
|
21651
|
-
(child) =>
|
|
21675
|
+
const itemChildren = React20.Children.toArray(children).filter(
|
|
21676
|
+
(child) => React20.isValidElement(child) && child.type === SelectItem_default
|
|
21652
21677
|
);
|
|
21653
21678
|
const isControlled = valueProp !== void 0;
|
|
21654
|
-
const [isOpen, setOpen] =
|
|
21655
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
21656
|
-
const controlledLabel =
|
|
21679
|
+
const [isOpen, setOpen] = React20.useState(false);
|
|
21680
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React20.useState(null);
|
|
21681
|
+
const controlledLabel = React20.useMemo(() => {
|
|
21657
21682
|
if (!isControlled) return null;
|
|
21658
21683
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
21659
21684
|
return match ? match.props.children : null;
|
|
21660
21685
|
}, [isControlled, valueProp, itemChildren]);
|
|
21661
21686
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
21662
|
-
const triggerRef =
|
|
21663
|
-
const contentRef =
|
|
21664
|
-
const [mounted, setMounted] =
|
|
21665
|
-
const [visible, setVisible] =
|
|
21666
|
-
|
|
21687
|
+
const triggerRef = React20.useRef(null);
|
|
21688
|
+
const contentRef = React20.useRef(null);
|
|
21689
|
+
const [mounted, setMounted] = React20.useState(false);
|
|
21690
|
+
const [visible, setVisible] = React20.useState(false);
|
|
21691
|
+
React20.useEffect(() => {
|
|
21667
21692
|
if (disabled && isOpen) setOpen(false);
|
|
21668
21693
|
}, [disabled, isOpen]);
|
|
21669
|
-
|
|
21694
|
+
React20.useEffect(() => {
|
|
21670
21695
|
if (isOpen) {
|
|
21671
21696
|
setMounted(true);
|
|
21672
21697
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -21676,12 +21701,12 @@ var SelectRoot = (props) => {
|
|
|
21676
21701
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
21677
21702
|
return () => clearTimeout(t);
|
|
21678
21703
|
}, [isOpen]);
|
|
21679
|
-
const open =
|
|
21680
|
-
const close =
|
|
21681
|
-
const toggle =
|
|
21704
|
+
const open = React20.useCallback(() => setOpen(true), []);
|
|
21705
|
+
const close = React20.useCallback(() => setOpen(false), []);
|
|
21706
|
+
const toggle = React20.useCallback(() => setOpen((prev) => !prev), []);
|
|
21682
21707
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
21683
21708
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
21684
|
-
const setSelected =
|
|
21709
|
+
const setSelected = React20.useCallback(
|
|
21685
21710
|
(label, itemValue) => {
|
|
21686
21711
|
if (!isControlled) {
|
|
21687
21712
|
setUncontrolledLabel(label);
|
|
@@ -21690,7 +21715,7 @@ var SelectRoot = (props) => {
|
|
|
21690
21715
|
},
|
|
21691
21716
|
[isControlled, onChange]
|
|
21692
21717
|
);
|
|
21693
|
-
const ctxValue =
|
|
21718
|
+
const ctxValue = React20.useMemo(
|
|
21694
21719
|
() => ({
|
|
21695
21720
|
isOpen,
|
|
21696
21721
|
mounted,
|
|
@@ -21788,10 +21813,10 @@ var Select = Object.assign(SelectRoot, {
|
|
|
21788
21813
|
var Select_default = Select;
|
|
21789
21814
|
|
|
21790
21815
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
21791
|
-
import
|
|
21816
|
+
import React22 from "react";
|
|
21792
21817
|
|
|
21793
21818
|
// src/components/HtmlTypeWriter/utils.ts
|
|
21794
|
-
import
|
|
21819
|
+
import React21 from "react";
|
|
21795
21820
|
var voidTags = /* @__PURE__ */ new Set([
|
|
21796
21821
|
"br",
|
|
21797
21822
|
"img",
|
|
@@ -21859,15 +21884,15 @@ function convertNodeToReactWithRange(node, typedLen, rangeMap) {
|
|
|
21859
21884
|
props[attr.name] = attr.value;
|
|
21860
21885
|
});
|
|
21861
21886
|
if (voidTags.has(tag)) {
|
|
21862
|
-
return
|
|
21887
|
+
return React21.createElement(tag, props);
|
|
21863
21888
|
}
|
|
21864
21889
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
21865
|
-
return
|
|
21890
|
+
return React21.createElement(tag, props, ...children);
|
|
21866
21891
|
}
|
|
21867
21892
|
function htmlToReactProgressive(root, typedLen, rangeMap) {
|
|
21868
21893
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
21869
21894
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
21870
|
-
return node == null ? null :
|
|
21895
|
+
return node == null ? null : React21.createElement(React21.Fragment, { key: idx }, node);
|
|
21871
21896
|
}).filter(Boolean);
|
|
21872
21897
|
return nodes.length === 0 ? null : nodes;
|
|
21873
21898
|
}
|
|
@@ -21880,20 +21905,20 @@ var HtmlTypeWriter = ({
|
|
|
21880
21905
|
onDone,
|
|
21881
21906
|
onChange
|
|
21882
21907
|
}) => {
|
|
21883
|
-
const [typedLen, setTypedLen] =
|
|
21884
|
-
const doneCalledRef =
|
|
21885
|
-
const { doc, rangeMap, totalLength } =
|
|
21908
|
+
const [typedLen, setTypedLen] = React22.useState(0);
|
|
21909
|
+
const doneCalledRef = React22.useRef(false);
|
|
21910
|
+
const { doc, rangeMap, totalLength } = React22.useMemo(() => {
|
|
21886
21911
|
if (typeof window === "undefined") return { doc: null, rangeMap: /* @__PURE__ */ new Map(), totalLength: 0 };
|
|
21887
21912
|
const decoded = decodeHtmlEntities(html);
|
|
21888
21913
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
21889
21914
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
21890
21915
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
21891
21916
|
}, [html]);
|
|
21892
|
-
|
|
21917
|
+
React22.useEffect(() => {
|
|
21893
21918
|
setTypedLen(0);
|
|
21894
21919
|
doneCalledRef.current = false;
|
|
21895
21920
|
}, [html]);
|
|
21896
|
-
|
|
21921
|
+
React22.useEffect(() => {
|
|
21897
21922
|
if (!totalLength) return;
|
|
21898
21923
|
if (typedLen >= totalLength) return;
|
|
21899
21924
|
const timer = window.setInterval(() => {
|
|
@@ -21901,18 +21926,18 @@ var HtmlTypeWriter = ({
|
|
|
21901
21926
|
}, duration);
|
|
21902
21927
|
return () => window.clearInterval(timer);
|
|
21903
21928
|
}, [typedLen, totalLength, duration]);
|
|
21904
|
-
|
|
21929
|
+
React22.useEffect(() => {
|
|
21905
21930
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
21906
21931
|
onChange?.();
|
|
21907
21932
|
}
|
|
21908
21933
|
}, [typedLen, totalLength, onChange]);
|
|
21909
|
-
|
|
21934
|
+
React22.useEffect(() => {
|
|
21910
21935
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
21911
21936
|
doneCalledRef.current = true;
|
|
21912
21937
|
onDone?.();
|
|
21913
21938
|
}
|
|
21914
21939
|
}, [typedLen, totalLength, onDone]);
|
|
21915
|
-
const parsed =
|
|
21940
|
+
const parsed = React22.useMemo(
|
|
21916
21941
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
21917
21942
|
[doc, typedLen, rangeMap]
|
|
21918
21943
|
);
|
|
@@ -21922,12 +21947,12 @@ HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
|
21922
21947
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
21923
21948
|
|
|
21924
21949
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
21925
|
-
import
|
|
21950
|
+
import React23 from "react";
|
|
21926
21951
|
import { jsx as jsx325, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
21927
21952
|
var ImageSelector = (props) => {
|
|
21928
21953
|
const { value, label, onChange } = props;
|
|
21929
|
-
const [previewUrl, setPreviewUrl] =
|
|
21930
|
-
|
|
21954
|
+
const [previewUrl, setPreviewUrl] = React23.useState();
|
|
21955
|
+
React23.useEffect(() => {
|
|
21931
21956
|
if (!value) {
|
|
21932
21957
|
setPreviewUrl(void 0);
|
|
21933
21958
|
return;
|
|
@@ -21936,7 +21961,7 @@ var ImageSelector = (props) => {
|
|
|
21936
21961
|
setPreviewUrl(url);
|
|
21937
21962
|
return () => URL.revokeObjectURL(url);
|
|
21938
21963
|
}, [value]);
|
|
21939
|
-
const inputRef =
|
|
21964
|
+
const inputRef = React23.useRef(null);
|
|
21940
21965
|
const handleFileChange = (e) => {
|
|
21941
21966
|
const selectedFile = e.target.files?.[0];
|
|
21942
21967
|
if (selectedFile) {
|
|
@@ -22058,17 +22083,17 @@ Pagination.displayName = "Pagination";
|
|
|
22058
22083
|
var Pagination_default = Pagination;
|
|
22059
22084
|
|
|
22060
22085
|
// src/components/PopOver/PopOver.tsx
|
|
22061
|
-
import
|
|
22086
|
+
import React24 from "react";
|
|
22062
22087
|
import { jsx as jsx327, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
22063
22088
|
var PopOver = (props) => {
|
|
22064
22089
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
22065
|
-
const popRef =
|
|
22066
|
-
const triggerRef =
|
|
22067
|
-
const [localOpen, setLocalOpen] =
|
|
22068
|
-
const [eventTrigger, setEventTrigger] =
|
|
22090
|
+
const popRef = React24.useRef(null);
|
|
22091
|
+
const triggerRef = React24.useRef(null);
|
|
22092
|
+
const [localOpen, setLocalOpen] = React24.useState(false);
|
|
22093
|
+
const [eventTrigger, setEventTrigger] = React24.useState(false);
|
|
22069
22094
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
22070
22095
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
22071
|
-
|
|
22096
|
+
React24.useEffect(() => {
|
|
22072
22097
|
if (isOpen) {
|
|
22073
22098
|
setLocalOpen(isOpen);
|
|
22074
22099
|
setTimeout(() => {
|
|
@@ -22154,12 +22179,12 @@ Progress.displayName = "Progress";
|
|
|
22154
22179
|
var Progress_default = Progress;
|
|
22155
22180
|
|
|
22156
22181
|
// src/components/Radio/RadioGroupContext.tsx
|
|
22157
|
-
import
|
|
22158
|
-
var RadioGroupContext =
|
|
22182
|
+
import React25 from "react";
|
|
22183
|
+
var RadioGroupContext = React25.createContext(
|
|
22159
22184
|
null
|
|
22160
22185
|
);
|
|
22161
22186
|
var useRadioGroupContext = () => {
|
|
22162
|
-
return
|
|
22187
|
+
return React25.useContext(RadioGroupContext);
|
|
22163
22188
|
};
|
|
22164
22189
|
var RadioGroupContext_default = RadioGroupContext;
|
|
22165
22190
|
|
|
@@ -22315,7 +22340,7 @@ Steps.displayName = "Steps";
|
|
|
22315
22340
|
var Steps_default = Steps;
|
|
22316
22341
|
|
|
22317
22342
|
// src/components/Swiper/Swiper.tsx
|
|
22318
|
-
import
|
|
22343
|
+
import React26 from "react";
|
|
22319
22344
|
import { jsx as jsx334, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
22320
22345
|
var Swiper = (props) => {
|
|
22321
22346
|
const {
|
|
@@ -22340,23 +22365,23 @@ var Swiper = (props) => {
|
|
|
22340
22365
|
const maxIndex = Math.max(0, totalSlides - viewItemCount);
|
|
22341
22366
|
const useLoop = loop && canSlide;
|
|
22342
22367
|
const cloneCount = useLoop ? totalSlides : 0;
|
|
22343
|
-
const extendedItems =
|
|
22368
|
+
const extendedItems = React26.useMemo(() => {
|
|
22344
22369
|
if (!useLoop) return items;
|
|
22345
22370
|
return [...items, ...items, ...items];
|
|
22346
22371
|
}, [items, useLoop]);
|
|
22347
22372
|
const initialIdx = Math.max(0, Math.min(indexProp ?? 0, maxIndex));
|
|
22348
|
-
const [innerIndex, setInnerIndex] =
|
|
22373
|
+
const [innerIndex, setInnerIndex] = React26.useState(
|
|
22349
22374
|
useLoop ? cloneCount + initialIdx : initialIdx
|
|
22350
22375
|
);
|
|
22351
|
-
const [isDragging, setIsDragging] =
|
|
22352
|
-
const [dragOffset, setDragOffset] =
|
|
22353
|
-
const [animated, setAnimated] =
|
|
22354
|
-
const [containerWidth, setContainerWidth] =
|
|
22355
|
-
const containerRef =
|
|
22356
|
-
const startXRef =
|
|
22357
|
-
const startTimeRef =
|
|
22358
|
-
const autoplayTimerRef =
|
|
22359
|
-
|
|
22376
|
+
const [isDragging, setIsDragging] = React26.useState(false);
|
|
22377
|
+
const [dragOffset, setDragOffset] = React26.useState(0);
|
|
22378
|
+
const [animated, setAnimated] = React26.useState(true);
|
|
22379
|
+
const [containerWidth, setContainerWidth] = React26.useState(0);
|
|
22380
|
+
const containerRef = React26.useRef(null);
|
|
22381
|
+
const startXRef = React26.useRef(0);
|
|
22382
|
+
const startTimeRef = React26.useRef(0);
|
|
22383
|
+
const autoplayTimerRef = React26.useRef(null);
|
|
22384
|
+
React26.useEffect(() => {
|
|
22360
22385
|
const el = containerRef.current;
|
|
22361
22386
|
if (!el) return;
|
|
22362
22387
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -22375,7 +22400,7 @@ var Swiper = (props) => {
|
|
|
22375
22400
|
return ((inner - cloneCount) % totalSlides + totalSlides) % totalSlides;
|
|
22376
22401
|
};
|
|
22377
22402
|
const realIndex = getRealIndex(innerIndex);
|
|
22378
|
-
const moveToInner =
|
|
22403
|
+
const moveToInner = React26.useCallback(
|
|
22379
22404
|
(idx, withAnim = true) => {
|
|
22380
22405
|
if (!useLoop) {
|
|
22381
22406
|
setAnimated(withAnim);
|
|
@@ -22403,7 +22428,7 @@ var Swiper = (props) => {
|
|
|
22403
22428
|
},
|
|
22404
22429
|
[useLoop, cloneCount, totalSlides]
|
|
22405
22430
|
);
|
|
22406
|
-
const handleTransitionEnd =
|
|
22431
|
+
const handleTransitionEnd = React26.useCallback(() => {
|
|
22407
22432
|
if (!useLoop) return;
|
|
22408
22433
|
const real = getRealIndex(innerIndex);
|
|
22409
22434
|
const canonical = cloneCount + real;
|
|
@@ -22413,7 +22438,7 @@ var Swiper = (props) => {
|
|
|
22413
22438
|
}
|
|
22414
22439
|
onChange?.(Math.min(real, maxIndex));
|
|
22415
22440
|
}, [useLoop, innerIndex, cloneCount, totalSlides, maxIndex, onChange]);
|
|
22416
|
-
const slideTo =
|
|
22441
|
+
const slideTo = React26.useCallback(
|
|
22417
22442
|
(logicalIndex) => {
|
|
22418
22443
|
if (!canSlide) return;
|
|
22419
22444
|
const clamped = useLoop ? logicalIndex : Math.max(0, Math.min(logicalIndex, maxIndex));
|
|
@@ -22423,7 +22448,7 @@ var Swiper = (props) => {
|
|
|
22423
22448
|
},
|
|
22424
22449
|
[canSlide, useLoop, cloneCount, maxIndex, onChange, moveToInner]
|
|
22425
22450
|
);
|
|
22426
|
-
const slideNext =
|
|
22451
|
+
const slideNext = React26.useCallback(() => {
|
|
22427
22452
|
if (!canSlide) return;
|
|
22428
22453
|
const nextInner = innerIndex + slideBy;
|
|
22429
22454
|
if (useLoop) {
|
|
@@ -22432,7 +22457,7 @@ var Swiper = (props) => {
|
|
|
22432
22457
|
moveToInner(Math.min(nextInner, maxIndex), true);
|
|
22433
22458
|
}
|
|
22434
22459
|
}, [canSlide, useLoop, innerIndex, slideBy, maxIndex, moveToInner]);
|
|
22435
|
-
const slidePrev =
|
|
22460
|
+
const slidePrev = React26.useCallback(() => {
|
|
22436
22461
|
if (!canSlide) return;
|
|
22437
22462
|
const prevInner = innerIndex - slideBy;
|
|
22438
22463
|
if (useLoop) {
|
|
@@ -22441,7 +22466,7 @@ var Swiper = (props) => {
|
|
|
22441
22466
|
moveToInner(Math.max(prevInner, 0), true);
|
|
22442
22467
|
}
|
|
22443
22468
|
}, [canSlide, useLoop, innerIndex, slideBy, moveToInner]);
|
|
22444
|
-
|
|
22469
|
+
React26.useEffect(() => {
|
|
22445
22470
|
if (indexProp === void 0) return;
|
|
22446
22471
|
const clamped = Math.max(0, Math.min(indexProp, maxIndex));
|
|
22447
22472
|
const target = useLoop ? cloneCount + clamped : clamped;
|
|
@@ -22449,12 +22474,12 @@ var Swiper = (props) => {
|
|
|
22449
22474
|
moveToInner(target, true);
|
|
22450
22475
|
}
|
|
22451
22476
|
}, [indexProp]);
|
|
22452
|
-
|
|
22477
|
+
React26.useImperativeHandle(swiperRef, () => ({
|
|
22453
22478
|
slidePrev,
|
|
22454
22479
|
slideNext,
|
|
22455
22480
|
slideTo
|
|
22456
22481
|
}));
|
|
22457
|
-
|
|
22482
|
+
React26.useEffect(() => {
|
|
22458
22483
|
if (!auto || !canSlide) return;
|
|
22459
22484
|
autoplayTimerRef.current = setInterval(slideNext, autoplayDelay);
|
|
22460
22485
|
return () => {
|
|
@@ -22477,7 +22502,7 @@ var Swiper = (props) => {
|
|
|
22477
22502
|
startXRef.current = getClientX(e);
|
|
22478
22503
|
startTimeRef.current = Date.now();
|
|
22479
22504
|
};
|
|
22480
|
-
|
|
22505
|
+
React26.useEffect(() => {
|
|
22481
22506
|
if (!isDragging) return;
|
|
22482
22507
|
const handleMove = (e) => {
|
|
22483
22508
|
setDragOffset(getClientX(e) - startXRef.current);
|
|
@@ -22584,7 +22609,7 @@ Swiper.displayName = "Swiper";
|
|
|
22584
22609
|
var Swiper_default = Swiper;
|
|
22585
22610
|
|
|
22586
22611
|
// src/components/Switch/Switch.tsx
|
|
22587
|
-
import
|
|
22612
|
+
import React27 from "react";
|
|
22588
22613
|
import { jsx as jsx335 } from "react/jsx-runtime";
|
|
22589
22614
|
var KNOB_TRANSITION_MS = 250;
|
|
22590
22615
|
var Switch = (props) => {
|
|
@@ -22596,9 +22621,9 @@ var Switch = (props) => {
|
|
|
22596
22621
|
color: color2 = "xplat-blue-500",
|
|
22597
22622
|
className
|
|
22598
22623
|
} = props;
|
|
22599
|
-
const [isAnimating, setIsAnimating] =
|
|
22600
|
-
const timeoutRef =
|
|
22601
|
-
|
|
22624
|
+
const [isAnimating, setIsAnimating] = React27.useState(false);
|
|
22625
|
+
const timeoutRef = React27.useRef(null);
|
|
22626
|
+
React27.useEffect(() => {
|
|
22602
22627
|
return () => {
|
|
22603
22628
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
22604
22629
|
};
|
|
@@ -22636,12 +22661,12 @@ Switch.displayName = "Switch";
|
|
|
22636
22661
|
var Switch_default = Switch;
|
|
22637
22662
|
|
|
22638
22663
|
// src/components/Tab/Tab.tsx
|
|
22639
|
-
import
|
|
22664
|
+
import React29 from "react";
|
|
22640
22665
|
|
|
22641
22666
|
// src/components/Tab/TabItem.tsx
|
|
22642
|
-
import
|
|
22667
|
+
import React28 from "react";
|
|
22643
22668
|
import { jsx as jsx336 } from "react/jsx-runtime";
|
|
22644
|
-
var TabItem =
|
|
22669
|
+
var TabItem = React28.forwardRef((props, ref) => {
|
|
22645
22670
|
const { isActive, title, onClick } = props;
|
|
22646
22671
|
return /* @__PURE__ */ jsx336(
|
|
22647
22672
|
"div",
|
|
@@ -22660,15 +22685,15 @@ var TabItem_default = TabItem;
|
|
|
22660
22685
|
import { jsx as jsx337, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
22661
22686
|
var Tab = (props) => {
|
|
22662
22687
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
22663
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
22688
|
+
const [underlineStyle, setUnderlineStyle] = React29.useState({
|
|
22664
22689
|
left: 0,
|
|
22665
22690
|
width: 0
|
|
22666
22691
|
});
|
|
22667
|
-
const itemRefs =
|
|
22692
|
+
const itemRefs = React29.useRef([]);
|
|
22668
22693
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
22669
22694
|
onChange(tabItem, tabIdx);
|
|
22670
22695
|
};
|
|
22671
|
-
|
|
22696
|
+
React29.useEffect(() => {
|
|
22672
22697
|
const el = itemRefs.current[activeIndex];
|
|
22673
22698
|
if (el) {
|
|
22674
22699
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
@@ -22703,10 +22728,10 @@ Tab.displayName = "Tab";
|
|
|
22703
22728
|
var Tab_default = Tab;
|
|
22704
22729
|
|
|
22705
22730
|
// src/components/Table/TableContext.tsx
|
|
22706
|
-
import
|
|
22707
|
-
var TableContext =
|
|
22731
|
+
import React30 from "react";
|
|
22732
|
+
var TableContext = React30.createContext(null);
|
|
22708
22733
|
var useTableContext = () => {
|
|
22709
|
-
const ctx =
|
|
22734
|
+
const ctx = React30.useContext(TableContext);
|
|
22710
22735
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
22711
22736
|
return ctx;
|
|
22712
22737
|
};
|
|
@@ -22749,24 +22774,24 @@ TableBody.displayName = "TableBody";
|
|
|
22749
22774
|
var TableBody_default = TableBody;
|
|
22750
22775
|
|
|
22751
22776
|
// src/components/Table/TableCell.tsx
|
|
22752
|
-
import
|
|
22777
|
+
import React33 from "react";
|
|
22753
22778
|
|
|
22754
22779
|
// src/components/Table/TableHeadContext.tsx
|
|
22755
|
-
import
|
|
22756
|
-
var TableHeadContext =
|
|
22780
|
+
import React31 from "react";
|
|
22781
|
+
var TableHeadContext = React31.createContext(
|
|
22757
22782
|
null
|
|
22758
22783
|
);
|
|
22759
22784
|
var useTableHeadContext = () => {
|
|
22760
|
-
const ctx =
|
|
22785
|
+
const ctx = React31.useContext(TableHeadContext);
|
|
22761
22786
|
return ctx;
|
|
22762
22787
|
};
|
|
22763
22788
|
var TableHeadContext_default = TableHeadContext;
|
|
22764
22789
|
|
|
22765
22790
|
// src/components/Table/TableRowContext.tsx
|
|
22766
|
-
import
|
|
22767
|
-
var TableRowContext =
|
|
22791
|
+
import React32 from "react";
|
|
22792
|
+
var TableRowContext = React32.createContext(null);
|
|
22768
22793
|
var useTableRowContext = () => {
|
|
22769
|
-
const ctx =
|
|
22794
|
+
const ctx = React32.useContext(TableRowContext);
|
|
22770
22795
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
22771
22796
|
return ctx;
|
|
22772
22797
|
};
|
|
@@ -22785,9 +22810,9 @@ var TableCell = (props) => {
|
|
|
22785
22810
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
22786
22811
|
const { stickyShadow } = useTableContext();
|
|
22787
22812
|
const headContext = useTableHeadContext();
|
|
22788
|
-
const [left, setLeft] =
|
|
22789
|
-
const cellRef =
|
|
22790
|
-
const calculateLeft =
|
|
22813
|
+
const [left, setLeft] = React33.useState(0);
|
|
22814
|
+
const cellRef = React33.useRef(null);
|
|
22815
|
+
const calculateLeft = React33.useCallback(() => {
|
|
22791
22816
|
if (!cellRef.current) return 0;
|
|
22792
22817
|
let totalLeft = 0;
|
|
22793
22818
|
for (const ref of stickyCells) {
|
|
@@ -22796,7 +22821,7 @@ var TableCell = (props) => {
|
|
|
22796
22821
|
}
|
|
22797
22822
|
return totalLeft;
|
|
22798
22823
|
}, [stickyCells]);
|
|
22799
|
-
|
|
22824
|
+
React33.useEffect(() => {
|
|
22800
22825
|
if (!isSticky || !cellRef.current) return;
|
|
22801
22826
|
registerStickyCell(cellRef);
|
|
22802
22827
|
setLeft(calculateLeft());
|
|
@@ -22849,7 +22874,7 @@ TableHead.displayName = "TableHead";
|
|
|
22849
22874
|
var TableHead_default = TableHead;
|
|
22850
22875
|
|
|
22851
22876
|
// src/components/Table/TableRow.tsx
|
|
22852
|
-
import
|
|
22877
|
+
import React34 from "react";
|
|
22853
22878
|
import { jsx as jsx342 } from "react/jsx-runtime";
|
|
22854
22879
|
var TableRow = (props) => {
|
|
22855
22880
|
const {
|
|
@@ -22861,7 +22886,7 @@ var TableRow = (props) => {
|
|
|
22861
22886
|
onClick
|
|
22862
22887
|
} = props;
|
|
22863
22888
|
const { rowBorderUse } = useTableContext();
|
|
22864
|
-
const [stickyCells, setStickyCells] =
|
|
22889
|
+
const [stickyCells, setStickyCells] = React34.useState([]);
|
|
22865
22890
|
const registerStickyCell = (ref) => {
|
|
22866
22891
|
setStickyCells((prev) => {
|
|
22867
22892
|
if (prev.includes(ref)) return prev;
|
|
@@ -22908,12 +22933,12 @@ Tag.displayName = "Tag";
|
|
|
22908
22933
|
var Tag_default = Tag;
|
|
22909
22934
|
|
|
22910
22935
|
// src/components/TextArea/TextArea.tsx
|
|
22911
|
-
import
|
|
22936
|
+
import React35 from "react";
|
|
22912
22937
|
import { jsx as jsx344 } from "react/jsx-runtime";
|
|
22913
|
-
var TextArea =
|
|
22938
|
+
var TextArea = React35.forwardRef(
|
|
22914
22939
|
(props, ref) => {
|
|
22915
22940
|
const { value, onChange, className, disabled, ...textareaProps } = props;
|
|
22916
|
-
const localRef =
|
|
22941
|
+
const localRef = React35.useRef(null);
|
|
22917
22942
|
const setRefs = (el) => {
|
|
22918
22943
|
localRef.current = el;
|
|
22919
22944
|
if (!ref) return;
|
|
@@ -22933,7 +22958,7 @@ var TextArea = React34.forwardRef(
|
|
|
22933
22958
|
onChange(event);
|
|
22934
22959
|
}
|
|
22935
22960
|
};
|
|
22936
|
-
|
|
22961
|
+
React35.useEffect(() => {
|
|
22937
22962
|
const el = localRef.current;
|
|
22938
22963
|
if (!el) return;
|
|
22939
22964
|
el.style.height = "0px";
|
|
@@ -22965,20 +22990,20 @@ TextArea.displayName = "TextArea";
|
|
|
22965
22990
|
var TextArea_default = TextArea;
|
|
22966
22991
|
|
|
22967
22992
|
// src/components/Toast/Toast.tsx
|
|
22968
|
-
import
|
|
22993
|
+
import React36 from "react";
|
|
22969
22994
|
import { createPortal as createPortal3 } from "react-dom";
|
|
22970
22995
|
import { jsx as jsx345, jsxs as jsxs218 } from "react/jsx-runtime";
|
|
22971
|
-
var ToastContext =
|
|
22996
|
+
var ToastContext = React36.createContext(null);
|
|
22972
22997
|
var useToast = () => {
|
|
22973
|
-
const ctx =
|
|
22998
|
+
const ctx = React36.useContext(ToastContext);
|
|
22974
22999
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
22975
23000
|
return ctx;
|
|
22976
23001
|
};
|
|
22977
23002
|
var EXIT_DURATION = 300;
|
|
22978
23003
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
22979
|
-
const ref =
|
|
22980
|
-
const [height, setHeight] =
|
|
22981
|
-
|
|
23004
|
+
const ref = React36.useRef(null);
|
|
23005
|
+
const [height, setHeight] = React36.useState(void 0);
|
|
23006
|
+
React36.useEffect(() => {
|
|
22982
23007
|
if (ref.current && !isExiting) {
|
|
22983
23008
|
setHeight(ref.current.offsetHeight);
|
|
22984
23009
|
}
|
|
@@ -23010,13 +23035,13 @@ var ToastProvider = ({
|
|
|
23010
23035
|
children,
|
|
23011
23036
|
position = "top-right"
|
|
23012
23037
|
}) => {
|
|
23013
|
-
const [toasts, setToasts] =
|
|
23014
|
-
const [removing, setRemoving] =
|
|
23015
|
-
const [mounted, setMounted] =
|
|
23016
|
-
|
|
23038
|
+
const [toasts, setToasts] = React36.useState([]);
|
|
23039
|
+
const [removing, setRemoving] = React36.useState(/* @__PURE__ */ new Set());
|
|
23040
|
+
const [mounted, setMounted] = React36.useState(false);
|
|
23041
|
+
React36.useEffect(() => {
|
|
23017
23042
|
setMounted(true);
|
|
23018
23043
|
}, []);
|
|
23019
|
-
const remove =
|
|
23044
|
+
const remove = React36.useCallback((id) => {
|
|
23020
23045
|
setRemoving((prev) => new Set(prev).add(id));
|
|
23021
23046
|
setTimeout(() => {
|
|
23022
23047
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -23027,7 +23052,7 @@ var ToastProvider = ({
|
|
|
23027
23052
|
});
|
|
23028
23053
|
}, EXIT_DURATION);
|
|
23029
23054
|
}, []);
|
|
23030
|
-
const toast =
|
|
23055
|
+
const toast = React36.useCallback(
|
|
23031
23056
|
(type, message, duration = 3e3) => {
|
|
23032
23057
|
const id = `${Date.now()}-${Math.random()}`;
|
|
23033
23058
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -23056,7 +23081,7 @@ var ToastProvider = ({
|
|
|
23056
23081
|
ToastProvider.displayName = "ToastProvider";
|
|
23057
23082
|
|
|
23058
23083
|
// src/components/Tooltip/Tooltip.tsx
|
|
23059
|
-
import
|
|
23084
|
+
import React37 from "react";
|
|
23060
23085
|
import { jsx as jsx346, jsxs as jsxs219 } from "react/jsx-runtime";
|
|
23061
23086
|
var Tooltip2 = (props) => {
|
|
23062
23087
|
const {
|
|
@@ -23065,7 +23090,7 @@ var Tooltip2 = (props) => {
|
|
|
23065
23090
|
description,
|
|
23066
23091
|
children
|
|
23067
23092
|
} = props;
|
|
23068
|
-
const iconRef =
|
|
23093
|
+
const iconRef = React37.useRef(null);
|
|
23069
23094
|
const colorClass = color2;
|
|
23070
23095
|
return /* @__PURE__ */ jsxs219("div", { className: "lib-xplat-tooltip", children: [
|
|
23071
23096
|
/* @__PURE__ */ jsx346("div", { className: "tooltip-content", ref: iconRef, children: children || "Tooltip" }),
|
|
@@ -23076,9 +23101,9 @@ Tooltip2.displayName = "Tooltip";
|
|
|
23076
23101
|
var Tooltip_default = Tooltip2;
|
|
23077
23102
|
|
|
23078
23103
|
// src/components/Video/Video.tsx
|
|
23079
|
-
import
|
|
23104
|
+
import React38 from "react";
|
|
23080
23105
|
import { jsx as jsx347, jsxs as jsxs220 } from "react/jsx-runtime";
|
|
23081
|
-
var Video =
|
|
23106
|
+
var Video = React38.forwardRef((props, ref) => {
|
|
23082
23107
|
const {
|
|
23083
23108
|
src,
|
|
23084
23109
|
poster,
|
|
@@ -23092,10 +23117,10 @@ var Video = React37.forwardRef((props, ref) => {
|
|
|
23092
23117
|
onPause,
|
|
23093
23118
|
...rest
|
|
23094
23119
|
} = props;
|
|
23095
|
-
const videoRef =
|
|
23096
|
-
const [isPlaying, setIsPlaying] =
|
|
23097
|
-
const [isLoaded, setIsLoaded] =
|
|
23098
|
-
const setRefs =
|
|
23120
|
+
const videoRef = React38.useRef(null);
|
|
23121
|
+
const [isPlaying, setIsPlaying] = React38.useState(Boolean(autoPlay));
|
|
23122
|
+
const [isLoaded, setIsLoaded] = React38.useState(false);
|
|
23123
|
+
const setRefs = React38.useCallback(
|
|
23099
23124
|
(el) => {
|
|
23100
23125
|
videoRef.current = el;
|
|
23101
23126
|
if (typeof ref === "function") ref(el);
|
|
@@ -23243,13 +23268,13 @@ Layout.displayName = "Layout";
|
|
|
23243
23268
|
var Layout_default = Layout;
|
|
23244
23269
|
|
|
23245
23270
|
// src/layout/SideBar/SideBar.tsx
|
|
23246
|
-
import
|
|
23271
|
+
import React40 from "react";
|
|
23247
23272
|
|
|
23248
23273
|
// src/layout/SideBar/SideBarContext.tsx
|
|
23249
|
-
import
|
|
23250
|
-
var SideBarContext =
|
|
23274
|
+
import React39 from "react";
|
|
23275
|
+
var SideBarContext = React39.createContext(null);
|
|
23251
23276
|
var useSideBarContext = () => {
|
|
23252
|
-
const ctx =
|
|
23277
|
+
const ctx = React39.useContext(SideBarContext);
|
|
23253
23278
|
if (!ctx) throw new Error("Error");
|
|
23254
23279
|
return ctx;
|
|
23255
23280
|
};
|
|
@@ -23259,7 +23284,7 @@ var SideBarContext_default = SideBarContext;
|
|
|
23259
23284
|
import { jsx as jsx353 } from "react/jsx-runtime";
|
|
23260
23285
|
var SideBar = (props) => {
|
|
23261
23286
|
const { children, className } = props;
|
|
23262
|
-
const [isOpen, setIsOpen] =
|
|
23287
|
+
const [isOpen, setIsOpen] = React40.useState(true);
|
|
23263
23288
|
const handleSwitchSideBar = () => {
|
|
23264
23289
|
setIsOpen((prev) => !prev);
|
|
23265
23290
|
};
|